|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[194,5,6,7,8,10,17],{"+NIl":function(I,J,P){(function(L){L(P("VrN/"))})(function(L){"use strict";L.defineMode("stex",function(u,S){"use strict";function R(f,b){f.cmdState.push(b)}function h(f){return f.cmdState.length>0?f.cmdState[f.cmdState.length-1]:null}function o(f){var b=f.cmdState.pop();b&&b.closeBracket()}function C(f){for(var b=f.cmdState,v=b.length-1;v>=0;v--){var m=b[v];if(m.name=="DEFAULT")continue;return m}return{styleIdentifier:function(){return null}}}function c(f,b,v){return function(){this.name=f,this.bracketNo=0,this.style=b,this.styles=v,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var a={};a.importmodule=c("importmodule","tag",["string","builtin"]),a.documentclass=c("documentclass","tag",["","atom"]),a.usepackage=c("usepackage","tag",["atom"]),a.begin=c("begin","tag",["atom"]),a.end=c("end","tag",["atom"]),a.label=c("label","tag",["atom"]),a.ref=c("ref","tag",["atom"]),a.eqref=c("eqref","tag",["atom"]),a.cite=c("cite","tag",["atom"]),a.bibitem=c("bibitem","tag",["atom"]),a.Bibitem=c("Bibitem","tag",["atom"]),a.RBibitem=c("RBibitem","tag",["atom"]),a.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function i(f,b){f.f=b}function r(f,b){var v;if(f.match(/^\\[a-zA-Z@]+/)){var m=f.current().slice(1);return v=a.hasOwnProperty(m)?a[m]:a.DEFAULT,v=new v,R(b,v),i(b,p),v.style}if(f.match(/^\\[$&%#{}_]/))return"tag";if(f.match(/^\\[,;!\/\\]/))return"tag";if(f.match("\\["))return i(b,function(d,g){return l(d,g,"\\]")}),"keyword";if(f.match("\\("))return i(b,function(d,g){return l(d,g,"\\)")}),"keyword";if(f.match("$$"))return i(b,function(d,g){return l(d,g,"$$")}),"keyword";if(f.match("$"))return i(b,function(d,g){return l(d,g,"$")}),"keyword";var n=f.next();if(n=="%")return f.skipToEnd(),"comment";if(n=="}"||n=="]"){if(v=h(b),v)v.closeBracket(n),i(b,p);else return"error";return"bracket"}else return n=="{"||n=="["?(v=a.DEFAULT,v=new v,R(b,v),"bracket"):/\d/.test(n)?(f.eatWhile(/[\w.%]/),"atom"):(f.eatWhile(/[\w\-_]/),v=C(b),v.name=="begin"&&(v.argument=f.current()),v.styleIdentifier())}function l(f,b,v){if(f.eatSpace())return null;if(v&&f.match(v))return i(b,r),"keyword";if(f.match(/^\\[a-zA-Z@]+/))return"tag";if(f.match(/^[a-zA-Z]+/))return"variable-2";if(f.match(/^\\[$&%#{}_]/))return"tag";if(f.match(/^\\[,;!\/]/))return"tag";if(f.match(/^[\^_&]/))return"tag";if(f.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(f.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var m=f.next();return m=="{"||m=="}"||m=="["||m=="]"||m=="("||m==")"?"bracket":m=="%"?(f.skipToEnd(),"comment"):"error"}function p(f,b){var v=f.peek(),m;return v=="{"||v=="["?(m=h(b),m.openBracket(v),f.eat(v),i(b,r),"bracket"):/[ \t\r]/.test(v)?(f.eat(v),null):(i(b,r),o(b),r(f,b))}return{startState:function(){var f=S.inMathMode?function(b,v){return l(b,v)}:r;return{cmdState:[],f}},copyState:function(f){return{cmdState:f.cmdState.slice(),f:f.f}},token:function(f,b){return b.f(f,b)},blankLine:function(f){f.f=r,f.cmdState.length=0},lineComment:"%"}}),L.defineMIME("text/x-stex","stex"),L.defineMIME("text/x-latex","stex")})},"19Vz":function(I,J,P){(function(L){L(P("VrN/"))})(function(L){L.defineOption("placeholder","",function(c,a,i){var r=i&&i!=L.Init;if(a&&!r)c.on("blur",h),c.on("change",o),c.on("swapDoc",o),L.on(c.getInputField(),"compositionupdate",c.state.placeholderCompose=function(){R(c)}),o(c);else if(!a&&r){c.off("blur",h),c.off("change",o),c.off("swapDoc",o),L.off(c.getInputField(),"compositionupdate",c.state.placeholderCompose),u(c);var l=c.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}a&&!c.hasFocus()&&h(c)});function u(c){c.state.placeholder&&(c.state.placeholder.parentNode.removeChild(c.state.placeholder),c.state.placeholder=null)}function S(c){u(c);var a=c.state.placeholder=document.createElement("pre");a.style.cssText="height: 0; overflow: visible",a.style.direction=c.getOption("direction"),a.className="CodeMirror-placeholder CodeMirror-line-like";var i=c.getOption("placeholder");typeof i=="string"&&(i=document.createTextNode(i)),a.appendChild(i),c.display.lineSpace.insertBefore(a,c.display.lineSpace.firstChild)}function R(c){setTimeout(function(){var a=!1,i=c.getInputField();i.nodeName=="TEXTAREA"?a=!i.value:c.lineCount()==1&&(a=!/[^\u200b]/.test(i.querySelector(".CodeMirror-line").textContent)),a?S(c):u(c)},20)}function h(c){C(c)&&S(c)}function o(c){var a=c.getWrapperElement(),i=C(c);a.className=a.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?S(c):u(c)}function C(c){return c.lineCount()===1&&c.getLine(0)===""}})},"1T2W":function(I,J,P){I.exports={"code-panel-container":"code-panel-container___1BMQ9","action-oj-bar":"action-oj-bar___1PRBr",active:"active___2710v"}},"1eCo":function(I,J,P){(function(L){L(P("VrN/"))})(function(L){"use strict";var u={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},S={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};L.defineMode("xml",function(R,h){var o=R.indentUnit,C={},c=h.htmlMode?u:S;for(var a in c)C[a]=c[a];for(var a in h)C[a]=h[a];var i,r;function l(_,N){function j(H){return N.tokenize=H,H(_,N)}var k=_.next();if(k=="<")return _.eat("!")?_.eat("[")?_.match("CDATA[")?j(b("atom","]]>")):null:_.match("--")?j(b("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),j(v(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),N.tokenize=b("meta","?>"),"meta"):(i=_.eat("/")?"closeTag":"openTag",N.tokenize=p,"tag bracket");if(k=="&"){var z;return _.eat("#")?_.eat("x")?z=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):z=_.eatWhile(/[\d]/)&&_.eat(";"):z=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),z?"atom":"error"}else return _.eatWhile(/[^&<]/),null}l.isInText=!0;function p(_,N){var j=_.next();if(j==">"||j=="/"&&_.eat(">"))return N.tokenize=l,i=j==">"?"endTag":"selfcloseTag","tag bracket";if(j=="=")return i="equals",null;if(j=="<"){N.tokenize=l,N.state=g,N.tagName=N.tagStart=null;var k=N.tokenize(_,N);return k?k+" tag error":"tag error"}else return/[\'\"]/.test(j)?(N.tokenize=f(j),N.stringStartCol=_.column(),N.tokenize(_,N)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(_){var N=function(j,k){for(;!j.eol();)if(j.next()==_){k.tokenize=p;break}return"string"};return N.isInAttribute=!0,N}function b(_,N){return function(j,k){for(;!j.eol();){if(j.match(N)){k.tokenize=l;break}j.next()}return _}}function v(_){return function(N,j){for(var k;(k=N.next())!=null;){if(k=="<")return j.tokenize=v(_+1),j.tokenize(N,j);if(k==">")if(_==1){j.tokenize=l;break}else return j.tokenize=v(_-1),j.tokenize(N,j)}return"meta"}}function m(_,N,j){this.prev=_.context,this.tagName=N,this.indent=_.indented,this.startOfLine=j,(C.doNotIndent.hasOwnProperty(N)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function n(_){_.context&&(_.context=_.context.prev)}function d(_,N){for(var j;;){if(!_.context)return;if(j=_.context.tagName,!C.contextGrabbers.hasOwnProperty(j)||!C.contextGrabbers[j].hasOwnProperty(N))return;n(_)}}function g(_,N,j){return _=="openTag"?(j.tagStart=N.column(),T):_=="closeTag"?y:g}function T(_,N,j){return _=="word"?(j.tagName=N.current(),r="tag",A):C.allowMissingTagName&&_=="endTag"?(r="tag bracket",A(_,N,j)):(r="error",T)}function y(_,N,j){if(_=="word"){var k=N.current();return j.context&&j.context.tagName!=k&&C.implicitlyClosed.hasOwnProperty(j.context.tagName)&&n(j),j.context&&j.context.tagName==k||C.matchClosing===!1?(r="tag",s):(r="tag error",M)}else return C.allowMissingTagName&&_=="endTag"?(r="tag bracket",s(_,N,j)):(r="error",M)}function s(_,N,j){return _!="endTag"?(r="error",s):(n(j),g)}function M(_,N,j){return r="error",s(_,N,j)}function A(_,N,j){if(_=="word")return r="attribute",x;if(_=="endTag"||_=="selfcloseTag"){var k=j.tagName,z=j.tagStart;return j.tagName=j.tagStart=null,_=="selfcloseTag"||C.autoSelfClosers.hasOwnProperty(k)?d(j,k):(d(j,k),j.context=new m(j,k,z==j.indented)),g}return r="error",A}function x(_,N,j){return _=="equals"?E:(C.allowMissing||(r="error"),A(_,N,j))}function E(_,N,j){return _=="string"?w:_=="word"&&C.allowUnquoted?(r="string",A):(r="error",A(_,N,j))}function w(_,N,j){return _=="string"?w:A(_,N,j)}return{startState:function(_){var N={tokenize:l,state:g,indented:_||0,tagName:null,tagStart:null,context:null};return _!=null&&(N.baseIndent=_),N},token:function(_,N){if(!N.tagName&&_.sol()&&(N.indented=_.indentation()),_.eatSpace())return null;i=null;var j=N.tokenize(_,N);return(j||i)&&j!="comment"&&(r=null,N.state=N.state(i||j,_,N),r&&(j=r=="error"?j+" error":r)),j},indent:function(_,N,j){var k=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+o;if(k&&k.noIndent)return L.Pass;if(_.tokenize!=p&&_.tokenize!=l)return j?j.match(/^(\s*)/)[0].length:0;if(_.tagName)return C.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+o*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(N))return 0;var z=N&&/^<(\/)?([\w_:\.-]*)/.exec(N);if(z&&z[1])for(;k;)if(k.tagName==z[2]){k=k.prev;break}else if(C.implicitlyClosed.hasOwnProperty(k.tagName))k=k.prev;else break;else if(z)for(;k;){var H=C.contextGrabbers[k.tagName];if(H&&H.hasOwnProperty(z[2]))k=k.prev;else break}for(;k&&k.prev&&!k.startOfLine;)k=k.prev;return k?k.indent+o:_.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(_){_.state==E&&(_.state=A)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var N=[],j=_.context;j;j=j.prev)j.tagName&&N.push(j.tagName);return N.reverse()}}}),L.defineMIME("text/xml","xml"),L.defineMIME("application/xml","xml"),L.mimeModes.hasOwnProperty("text/html")||L.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("MlIO"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.Hasher,h=u.x64,o=h.Word,C=h.WordArray,c=u.algo;function a(){return o.create.apply(o,arguments)}var i=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],r=[];(function(){for(var p=0;p<80;p++)r[p]=a()})();var l=c.SHA512=R.extend({_doReset:function(){this._hash=new C.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(p,f){for(var b=this._hash.words,v=b[0],m=b[1],n=b[2],d=b[3],g=b[4],T=b[5],y=b[6],s=b[7],M=v.high,A=v.low,x=m.high,E=m.low,w=n.high,_=n.low,N=d.high,j=d.low,k=g.high,z=g.low,H=T.high,F=T.low,G=y.high,B=y.low,W=s.high,K=s.low,q=M,re=A,ee=x,Ce=E,xe=w,he=_,ke=N,_e=j,de=k,ce=z,ae=H,Se=F,te=G,ue=B,Oe=W,le=K,Q=0;Q<80;Q++){var Y,Z,be=r[Q];if(Q<16)Z=be.high=p[f+Q*2]|0,Y=be.low=p[f+Q*2+1]|0;else{var ge=r[Q-15],De=ge.high,Qe=ge.low,Ze=(De>>>1|Qe<<31)^(De>>>8|Qe<<24)^De>>>7,nt=(Qe>>>1|De<<31)^(Qe>>>8|De<<24)^(Qe>>>7|De<<25),tt=r[Q-2],lt=tt.high,st=tt.low,je=(lt>>>19|st<<13)^(lt<<3|st>>>29)^lt>>>6,Re=(st>>>19|lt<<13)^(st<<3|lt>>>29)^(st>>>6|lt<<26),et=r[Q-7],ct=et.high,$e=et.low,qe=r[Q-16],Ue=qe.high,Me=qe.low;Y=nt+$e,Z=Ze+ct+(Y>>>0<nt>>>0?1:0),Y=Y+Re,Z=Z+je+(Y>>>0<Re>>>0?1:0),Y=Y+Me,Z=Z+Ue+(Y>>>0<Me>>>0?1:0),be.high=Z,be.low=Y}var Ie=de&ae^~de&te,ye=ce&Se^~ce&ue,Te=q&ee^q&xe^ee&xe,Ae=re&Ce^re&he^Ce&he,Pe=(q>>>28|re<<4)^(q<<30|re>>>2)^(q<<25|re>>>7),Xe=(re>>>28|q<<4)^(re<<30|q>>>2)^(re<<25|q>>>7),rt=(de>>>14|ce<<18)^(de>>>18|ce<<14)^(de<<23|ce>>>9),ft=(ce>>>14|de<<18)^(ce>>>18|de<<14)^(ce<<23|de>>>9),St=i[Q],Pt=St.high,dt=St.low,At=le+ft,Ot=Oe+rt+(At>>>0<le>>>0?1:0),At=At+ye,Ot=Ot+Ie+(At>>>0<ye>>>0?1:0),At=At+dt,Ot=Ot+Pt+(At>>>0<dt>>>0?1:0),At=At+Y,Ot=Ot+Z+(At>>>0<Y>>>0?1:0),bt=Xe+Ae,Vt=Pe+Te+(bt>>>0<Xe>>>0?1:0);Oe=te,le=ue,te=ae,ue=Se,ae=de,Se=ce,ce=_e+At|0,de=ke+Ot+(ce>>>0<_e>>>0?1:0)|0,ke=xe,_e=he,xe=ee,he=Ce,ee=q,Ce=re,re=At+bt|0,q=Ot+Vt+(re>>>0<At>>>0?1:0)|0}A=v.low=A+re,v.high=M+q+(A>>>0<re>>>0?1:0),E=m.low=E+Ce,m.high=x+ee+(E>>>0<Ce>>>0?1:0),_=n.low=_+he,n.high=w+xe+(_>>>0<he>>>0?1:0),j=d.low=j+_e,d.high=N+ke+(j>>>0<_e>>>0?1:0),z=g.low=z+ce,g.high=k+de+(z>>>0<ce>>>0?1:0),F=T.low=F+Se,T.high=H+ae+(F>>>0<Se>>>0?1:0),B=y.low=B+ue,y.high=G+te+(B>>>0<ue>>>0?1:0),K=s.low=K+le,s.high=W+Oe+(K>>>0<le>>>0?1:0)},_doFinalize:function(){var p=this._data,f=p.words,b=this._nDataBytes*8,v=p.sigBytes*8;f[v>>>5]|=128<<24-v%32,f[(v+128>>>10<<5)+30]=Math.floor(b/4294967296),f[(v+128>>>10<<5)+31]=b,p.sigBytes=f.length*4,this._process();var m=this._hash.toX32();return m},clone:function(){var p=R.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});u.SHA512=R._createHelper(l),u.HmacSHA512=R._createHmacHelper(l)}(),L.SHA512})},"3y9D":function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.WordArray,h=S.Hasher,o=u.algo,C=[],c=o.SHA1=h.extend({_doReset:function(){this._hash=new R.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,i){for(var r=this._hash.words,l=r[0],p=r[1],f=r[2],b=r[3],v=r[4],m=0;m<80;m++){if(m<16)C[m]=a[i+m]|0;else{var n=C[m-3]^C[m-8]^C[m-14]^C[m-16];C[m]=n<<1|n>>>31}var d=(l<<5|l>>>27)+v+C[m];m<20?d+=(p&f|~p&b)+1518500249:m<40?d+=(p^f^b)+1859775393:m<60?d+=(p&f|p&b|f&b)-1894007588:d+=(p^f^b)-899497514,v=b,b=f,f=p<<30|p>>>2,p=l,l=d}r[0]=r[0]+l|0,r[1]=r[1]+p|0,r[2]=r[2]+f|0,r[3]=r[3]+b|0,r[4]=r[4]+v|0},_doFinalize:function(){var a=this._data,i=a.words,r=this._nDataBytes*8,l=a.sigBytes*8;return i[l>>>5]|=128<<24-l%32,i[(l+64>>>9<<4)+14]=Math.floor(r/4294967296),i[(l+64>>>9<<4)+15]=r,a.sigBytes=i.length*4,this._process(),this._hash},clone:function(){var a=h.clone.call(this);return a._hash=this._hash.clone(),a}});u.SHA1=h._createHelper(c),u.HmacSHA1=h._createHmacHelper(c)}(),L.SHA1})},4:function(I,J){},"5hvy":function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("MlIO"))})(this,function(L){return function(u){var S=L,R=S.lib,h=R.WordArray,o=R.Hasher,C=S.x64,c=C.Word,a=S.algo,i=[],r=[],l=[];(function(){for(var b=1,v=0,m=0;m<24;m++){i[b+5*v]=(m+1)*(m+2)/2%64;var n=v%5,d=(2*b+3*v)%5;b=n,v=d}for(var b=0;b<5;b++)for(var v=0;v<5;v++)r[b+5*v]=v+(2*b+3*v)%5*5;for(var g=1,T=0;T<24;T++){for(var y=0,s=0,M=0;M<7;M++){if(g&1){var A=(1<<M)-1;A<32?s^=1<<A:y^=1<<A-32}g&128?g=g<<1^113:g<<=1}l[T]=c.create(y,s)}})();var p=[];(function(){for(var b=0;b<25;b++)p[b]=c.create()})();var f=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var b=this._state=[],v=0;v<25;v++)b[v]=new c.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(b,v){for(var m=this._state,n=this.blockSize/2,d=0;d<n;d++){var g=b[v+2*d],T=b[v+2*d+1];g=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var y=m[d];y.high^=T,y.low^=g}for(var s=0;s<24;s++){for(var M=0;M<5;M++){for(var A=0,x=0,E=0;E<5;E++){var y=m[M+5*E];A^=y.high,x^=y.low}var w=p[M];w.high=A,w.low=x}for(var M=0;M<5;M++)for(var _=p[(M+4)%5],N=p[(M+1)%5],j=N.high,k=N.low,A=_.high^(j<<1|k>>>31),x=_.low^(k<<1|j>>>31),E=0;E<5;E++){var y=m[M+5*E];y.high^=A,y.low^=x}for(var z=1;z<25;z++){var A,x,y=m[z],H=y.high,F=y.low,G=i[z];G<32?(A=H<<G|F>>>32-G,x=F<<G|H>>>32-G):(A=F<<G-32|H>>>64-G,x=H<<G-32|F>>>64-G);var B=p[r[z]];B.high=A,B.low=x}var W=p[0],K=m[0];W.high=K.high,W.low=K.low;for(var M=0;M<5;M++)for(var E=0;E<5;E++){var z=M+5*E,y=m[z],q=p[z],re=p[(M+1)%5+5*E],ee=p[(M+2)%5+5*E];y.high=q.high^~re.high&ee.high,y.low=q.low^~re.low&ee.low}var y=m[0],Ce=l[s];y.high^=Ce.high,y.low^=Ce.low}},_doFinalize:function(){var b=this._data,v=b.words,m=this._nDataBytes*8,n=b.sigBytes*8,d=this.blockSize*32;v[n>>>5]|=1<<24-n%32,v[(u.ceil((n+1)/d)*d>>>5)-1]|=128,b.sigBytes=v.length*4,this._process();for(var g=this._state,T=this.cfg.outputLength/8,y=T/8,s=[],M=0;M<y;M++){var A=g[M],x=A.high,E=A.low;x=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,E=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,s.push(E),s.push(x)}return new h.init(s,T)},clone:function(){for(var b=o.clone.call(this),v=b._state=this._state.slice(0),m=0;m<25;m++)v[m]=v[m].clone();return b}});S.SHA3=o._createHelper(f),S.HmacSHA3=o._createHmacHelper(f)}(Math),L.SHA3})},"5nXd":function(I,J,P){var L=P("MFOe"),u=L.slice,S=L.pluck,R=L.each,h=L.bind,o=L.create,C=L.isList,c=L.isFunction,a=L.isObject;I.exports={createStore:l};var i={version:"2.0.12",enabled:!1,get:function(p,f){var b=this.storage.read(this._namespacePrefix+p);return this._deserialize(b,f)},set:function(p,f){return f===void 0?this.remove(p):(this.storage.write(this._namespacePrefix+p,this._serialize(f)),f)},remove:function(p){this.storage.remove(this._namespacePrefix+p)},each:function(p){var f=this;this.storage.each(function(b,v){p.call(f,f._deserialize(b),(v||"").replace(f._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(p){return this._namespacePrefix=="__storejs_"+p+"_"},createStore:function(){return l.apply(this,arguments)},addPlugin:function(p){this._addPlugin(p)},namespace:function(p){return l(this.storage,this.plugins,p)}};function r(){var p=typeof console=="undefined"?null:console;if(!p)return;var f=p.warn?p.warn:p.log;f.apply(p,arguments)}function l(p,f,b){b||(b=""),p&&!C(p)&&(p=[p]),f&&!C(f)&&(f=[f]);var v=b?"__storejs_"+b+"_":"",m=b?new RegExp("^"+v):null,n=/^[a-zA-Z0-9_\-]*$/;if(!n.test(b))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var d={_namespacePrefix:v,_namespaceRegexp:m,_testStorage:function(T){try{var y="__storejs__test__";T.write(y,y);var s=T.read(y)===y;return T.remove(y),s}catch(M){return!1}},_assignPluginFnProp:function(T,y){var s=this[y];this[y]=function(){var A=u(arguments,0),x=this;function E(){return s?(R(arguments,function(_,N){A[N]=_}),s.apply(x,A)):void 0}var w=[E].concat(A);return T.apply(x,w)}},_serialize:function(T){return JSON.stringify(T)},_deserialize:function(T,y){if(!T)return y;var s="";try{s=JSON.parse(T)}catch(M){s=T}return s!==void 0?s:y},_addStorage:function(T){if(this.enabled)return;this._testStorage(T)&&(this.storage=T,this.enabled=!0)},_addPlugin:function(T){var y=this;if(C(T)){R(T,function(A){y._addPlugin(A)});return}var s=S(this.plugins,function(A){return T===A});if(s)return;if(this.plugins.push(T),!c(T))throw new Error("Plugins must be function values that return objects");var M=T.call(this);if(!a(M))throw new Error("Plugins must return an object of function properties");R(M,function(A,x){if(!c(A))throw new Error("Bad plugin property: "+x+" from plugin "+T.name+". Plugins should only return functions.");y._assignPluginFnProp(A,x)})},addStorage:function(T){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(T)}},g=o(d,i,{plugins:[]});return g.raw={},R(g,function(T,y){c(T)&&(g.raw[y]=h(g,T))}),R(p,function(T){g._addStorage(T)}),R(f,function(T){g._addPlugin(T)}),g}},"6+eU":function(I,J,P){"use strict";P.d(J,"a",function(){return s});var L=P("wx14"),u=P("rePB"),S=P("VTBJ"),R=P("1OyB"),h=P("vuIU"),o=P("Ji7U"),C=P("LK+K"),c=P("q1tI"),a=P.n(c),i=P("TSYQ"),r=P.n(i),l=function(A){var x,E="".concat(A.rootPrefixCls,"-item"),w=r()(E,"".concat(E,"-").concat(A.page),(x={},Object(u.a)(x,"".concat(E,"-active"),A.active),Object(u.a)(x,A.className,!!A.className),Object(u.a)(x,"".concat(E,"-disabled"),!A.page),x)),_=function(){A.onClick(A.page)},N=function(k){A.onKeyPress(k,A.onClick,A.page)};return a.a.createElement("li",{title:A.showTitle?A.page:null,className:w,onClick:_,onKeyPress:N,tabIndex:"0"},A.itemRender(A.page,"page",a.a.createElement("a",{rel:"nofollow"},A.page)))},p=l,f={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},b=function(M){Object(o.a)(x,M);var A=Object(C.a)(x);function x(){var E;Object(R.a)(this,x);for(var w=arguments.length,_=new Array(w),N=0;N<w;N++)_[N]=arguments[N];return E=A.call.apply(A,[this].concat(_)),E.state={goInputText:""},E.buildOptionText=function(j){return"".concat(j," ").concat(E.props.locale.items_per_page)},E.changeSize=function(j){E.props.changeSize(Number(j))},E.handleChange=function(j){E.setState({goInputText:j.target.value})},E.handleBlur=function(j){var k=E.props,z=k.goButton,H=k.quickGo,F=k.rootPrefixCls,G=E.state.goInputText;if(z||G==="")return;if(j.relatedTarget&&(j.relatedTarget.className.indexOf("".concat(F,"-prev"))>=0||j.relatedTarget.className.indexOf("".concat(F,"-next"))>=0))return;E.setState({goInputText:""}),H(E.getValidValue())},E.go=function(j){var k=E.state.goInputText;if(k==="")return;(j.keyCode===f.ENTER||j.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(h.a)(x,[{key:"getValidValue",value:function(){var w=this.state,_=w.goInputText,N=w.current;return!_||isNaN(_)?N:Number(_)}},{key:"getPageSizeOptions",value:function(){var w=this.props,_=w.pageSize,N=w.pageSizeOptions;return N.some(function(j){return j.toString()===_.toString()})?N:N.concat([_.toString()]).sort(function(j,k){var z=isNaN(Number(j))?0:Number(j),H=isNaN(Number(k))?0:Number(k);return z-H})}},{key:"render",value:function(){var w=this,_=this.props,N=_.pageSize,j=_.locale,k=_.rootPrefixCls,z=_.changeSize,H=_.quickGo,F=_.goButton,G=_.selectComponentClass,B=_.buildOptionText,W=_.selectPrefixCls,K=_.disabled,q=this.state.goInputText,re="".concat(k,"-options"),ee=G,Ce=null,xe=null,he=null;if(!z&&!H)return null;var ke=this.getPageSizeOptions();if(z&&ee){var _e=ke.map(function(de,ce){return a.a.createElement(ee.Option,{key:ce,value:de.toString()},(B||w.buildOptionText)(de))});Ce=a.a.createElement(ee,{disabled:K,prefixCls:W,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(N||ke[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ce){return ce.parentNode}},_e)}return H&&(F&&(he=typeof F=="boolean"?a.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:K,className:"".concat(re,"-quick-jumper-button")},j.jump_to_confirm):a.a.createElement("span",{onClick:this.go,onKeyUp:this.go},F)),xe=a.a.createElement("div",{className:"".concat(re,"-quick-jumper")},j.jump_to,a.a.createElement("input",{disabled:K,type:"text",value:q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),j.page,he)),a.a.createElement("li",{className:"".concat(re)},Ce,xe)}}]),x}(a.a.Component);b.defaultProps={pageSizeOptions:["10","20","50","100"]};var v=b,m=P("N2Kk");function n(){}function d(M){return typeof M=="number"&&isFinite(M)&&Math.floor(M)===M}function g(M,A,x){return x}function T(M,A,x){var E=typeof M=="undefined"?A.pageSize:M;return Math.floor((x.total-1)/E)+1}var y=function(M){Object(o.a)(x,M);var A=Object(C.a)(x);function x(E){var w;Object(R.a)(this,x),w=A.call(this,E),w.getJumpPrevPage=function(){return Math.max(1,w.state.current-(w.props.showLessItems?3:5))},w.getJumpNextPage=function(){return Math.min(T(void 0,w.state,w.props),w.state.current+(w.props.showLessItems?3:5))},w.getItemIcon=function(z,H){var F=w.props.prefixCls,G=z||a.a.createElement("button",{type:"button","aria-label":H,className:"".concat(F,"-item-link")});return typeof z=="function"&&(G=a.a.createElement(z,Object(S.a)({},w.props))),G},w.savePaginationNode=function(z){w.paginationNode=z},w.isValid=function(z){return d(z)&&z!==w.state.current},w.shouldDisplayQuickJumper=function(){var z=w.props,H=z.showQuickJumper,F=z.pageSize,G=z.total;return G<=F?!1:H},w.handleKeyDown=function(z){(z.keyCode===f.ARROW_UP||z.keyCode===f.ARROW_DOWN)&&z.preventDefault()},w.handleKeyUp=function(z){var H=w.getValidValue(z),F=w.state.currentInputValue;H!==F&&w.setState({currentInputValue:H}),z.keyCode===f.ENTER?w.handleChange(H):z.keyCode===f.ARROW_UP?w.handleChange(H-1):z.keyCode===f.ARROW_DOWN&&w.handleChange(H+1)},w.changePageSize=function(z){var H=w.state.current,F=T(z,w.state,w.props);H=H>F?F:H,F===0&&(H=w.state.current),typeof z=="number"&&("pageSize"in w.props||w.setState({pageSize:z}),"current"in w.props||w.setState({current:H,currentInputValue:H})),w.props.onShowSizeChange(H,z),"onChange"in w.props&&w.props.onChange&&w.props.onChange(H,z)},w.handleChange=function(z){var H=w.props.disabled,F=z;if(w.isValid(F)&&!H){var G=T(void 0,w.state,w.props);F>G?F=G:F<1&&(F=1),"current"in w.props||w.setState({current:F,currentInputValue:F});var B=w.state.pageSize;return w.props.onChange(F,B),F}return w.state.current},w.prev=function(){w.hasPrev()&&w.handleChange(w.state.current-1)},w.next=function(){w.hasNext()&&w.handleChange(w.state.current+1)},w.jumpPrev=function(){w.handleChange(w.getJumpPrevPage())},w.jumpNext=function(){w.handleChange(w.getJumpNextPage())},w.hasPrev=function(){return w.state.current>1},w.hasNext=function(){return w.state.current<T(void 0,w.state,w.props)},w.runIfEnter=function(z,H){if(z.key==="Enter"||z.charCode===13){for(var F=arguments.length,G=new Array(F>2?F-2:0),B=2;B<F;B++)G[B-2]=arguments[B];H.apply(void 0,G)}},w.runIfEnterPrev=function(z){w.runIfEnter(z,w.prev)},w.runIfEnterNext=function(z){w.runIfEnter(z,w.next)},w.runIfEnterJumpPrev=function(z){w.runIfEnter(z,w.jumpPrev)},w.runIfEnterJumpNext=function(z){w.runIfEnter(z,w.jumpNext)},w.handleGoTO=function(z){(z.keyCode===f.ENTER||z.type==="click")&&w.handleChange(w.state.currentInputValue)};var _=E.onChange!==n,N="current"in E;N&&!_&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var j=E.defaultCurrent;"current"in E&&(j=E.current);var k=E.defaultPageSize;return"pageSize"in E&&(k=E.pageSize),j=Math.min(j,T(k,void 0,E)),w.state={current:j,currentInputValue:j,pageSize:k},w}return Object(h.a)(x,[{key:"componentDidUpdate",value:function(w,_){var N=this.props.prefixCls;if(_.current!==this.state.current&&this.paginationNode){var j=this.paginationNode.querySelector(".".concat(N,"-item-").concat(_.current));j&&document.activeElement===j&&j.blur()}}},{key:"getValidValue",value:function(w){var _=w.target.value,N=T(void 0,this.state,this.props),j=this.state.currentInputValue,k;return _===""?k=_:isNaN(Number(_))?k=j:_>=N?k=N:k=Number(_),k}},{key:"getShowSizeChanger",value:function(){var w=this.props,_=w.showSizeChanger,N=w.total,j=w.totalBoundaryShowSizeChanger;return typeof _!="undefined"?_:N>j}},{key:"renderPrev",value:function(w){var _=this.props,N=_.prevIcon,j=_.itemRender,k=j(w,"prev",this.getItemIcon(N,"prev page")),z=!this.hasPrev();return Object(c.isValidElement)(k)?Object(c.cloneElement)(k,{disabled:z}):k}},{key:"renderNext",value:function(w){var _=this.props,N=_.nextIcon,j=_.itemRender,k=j(w,"next",this.getItemIcon(N,"next page")),z=!this.hasNext();return Object(c.isValidElement)(k)?Object(c.cloneElement)(k,{disabled:z}):k}},{key:"render",value:function(){var w=this,_=this.props,N=_.prefixCls,j=_.className,k=_.style,z=_.disabled,H=_.hideOnSinglePage,F=_.total,G=_.locale,B=_.showQuickJumper,W=_.showLessItems,K=_.showTitle,q=_.showTotal,re=_.simple,ee=_.itemRender,Ce=_.showPrevNextJumpers,xe=_.jumpPrevIcon,he=_.jumpNextIcon,ke=_.selectComponentClass,_e=_.selectPrefixCls,de=_.pageSizeOptions,ce=this.state,ae=ce.current,Se=ce.pageSize,te=ce.currentInputValue;if(H===!0&&F<=Se)return null;var ue=T(void 0,this.state,this.props),Oe=[],le=null,Q=null,Y=null,Z=null,be=null,ge=B&&B.goButton,De=W?1:2,Qe=ae-1>0?ae-1:0,Ze=ae+1<ue?ae+1:ue,nt=Object.keys(this.props).reduce(function(ye,Te){return(Te.substr(0,5)==="data-"||Te.substr(0,5)==="aria-"||Te==="role")&&(ye[Te]=w.props[Te]),ye},{});if(re)return ge&&(typeof ge=="boolean"?be=a.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):be=a.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ge),be=a.a.createElement("li",{title:K?"".concat(G.jump_to).concat(ae,"/").concat(ue):null,className:"".concat(N,"-simple-pager")},be)),a.a.createElement("ul",Object(L.a)({className:r()(N,"".concat(N,"-simple"),Object(u.a)({},"".concat(N,"-disabled"),z),j),style:k,ref:this.savePaginationNode},nt),a.a.createElement("li",{title:K?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:r()("".concat(N,"-prev"),Object(u.a)({},"".concat(N,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Qe)),a.a.createElement("li",{title:K?"".concat(ae,"/").concat(ue):null,className:"".concat(N,"-simple-pager")},a.a.createElement("input",{type:"text",value:te,disabled:z,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),a.a.createElement("span",{className:"".concat(N,"-slash")},"/"),ue),a.a.createElement("li",{title:K?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:r()("".concat(N,"-next"),Object(u.a)({},"".concat(N,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Ze)),be);if(ue<=3+De*2){var tt={locale:G,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:K,itemRender:ee};ue||Oe.push(a.a.createElement(p,Object(L.a)({},tt,{key:"noPager",page:ue,className:"".concat(N,"-disabled")})));for(var lt=1;lt<=ue;lt+=1){var st=ae===lt;Oe.push(a.a.createElement(p,Object(L.a)({},tt,{key:lt,page:lt,active:st})))}}else{var je=W?G.prev_3:G.prev_5,Re=W?G.next_3:G.next_5;Ce&&(le=a.a.createElement("li",{title:K?je:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:r()("".concat(N,"-jump-prev"),Object(u.a)({},"".concat(N,"-jump-prev-custom-icon"),!!xe))},ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(xe,"prev page"))),Q=a.a.createElement("li",{title:K?Re:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:r()("".concat(N,"-jump-next"),Object(u.a)({},"".concat(N,"-jump-next-custom-icon"),!!he))},ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(he,"next page")))),Z=a.a.createElement(p,{locale:G,last:!0,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ue,page:ue,active:!1,showTitle:K,itemRender:ee}),Y=a.a.createElement(p,{locale:G,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:K,itemRender:ee});var et=Math.max(1,ae-De),ct=Math.min(ae+De,ue);ae-1<=De&&(ct=1+De*2),ue-ae<=De&&(et=ue-De*2);for(var $e=et;$e<=ct;$e+=1){var qe=ae===$e;Oe.push(a.a.createElement(p,{locale:G,rootPrefixCls:N,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:$e,page:$e,active:qe,showTitle:K,itemRender:ee}))}ae-1>=De*2&&ae!==1+2&&(Oe[0]=Object(c.cloneElement)(Oe[0],{className:"".concat(N,"-item-after-jump-prev")}),Oe.unshift(le)),ue-ae>=De*2&&ae!==ue-2&&(Oe[Oe.length-1]=Object(c.cloneElement)(Oe[Oe.length-1],{className:"".concat(N,"-item-before-jump-next")}),Oe.push(Q)),et!==1&&Oe.unshift(Y),ct!==ue&&Oe.push(Z)}var Ue=null;q&&(Ue=a.a.createElement("li",{className:"".concat(N,"-total-text")},q(F,[F===0?0:(ae-1)*Se+1,ae*Se>F?F:ae*Se])));var Me=!this.hasPrev()||!ue,Ie=!this.hasNext()||!ue;return a.a.createElement("ul",Object(L.a)({className:r()(N,j,Object(u.a)({},"".concat(N,"-disabled"),z)),style:k,unselectable:"unselectable",ref:this.savePaginationNode},nt),Ue,a.a.createElement("li",{title:K?G.prev_page:null,onClick:this.prev,tabIndex:Me?null:0,onKeyPress:this.runIfEnterPrev,className:r()("".concat(N,"-prev"),Object(u.a)({},"".concat(N,"-disabled"),Me)),"aria-disabled":Me},this.renderPrev(Qe)),Oe,a.a.createElement("li",{title:K?G.next_page:null,onClick:this.next,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterNext,className:r()("".concat(N,"-next"),Object(u.a)({},"".concat(N,"-disabled"),Ie)),"aria-disabled":Ie},this.renderNext(Ze)),a.a.createElement(v,{disabled:z,locale:G,rootPrefixCls:N,selectComponentClass:ke,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ae,pageSize:Se,pageSizeOptions:de,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ge}))}}],[{key:"getDerivedStateFromProps",value:function(w,_){var N={};if("current"in w&&(N.current=w.current,w.current!==_.current&&(N.currentInputValue=N.current)),"pageSize"in w&&w.pageSize!==_.pageSize){var j=_.current,k=T(w.pageSize,_,w);j=j>k?k:j,"current"in w||(N.current=j,N.currentInputValue=j),N.pageSize=w.pageSize}return N}}]),x}(a.a.Component);y.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:m.a,style:{},itemRender:g,totalBoundaryShowSizeChanger:50};var s=y},"6RRn":function(I,J,P){"use strict";var L=P("wCXF"),u=P("n6Qo");P.d(J,"b",function(){return u.a});var S=P("IBYe"),R=P("6eGT"),h=P("hW8S");P.d(J,"a",function(){return h.a}),J.c=L.b},"6eGT":function(I,J,P){"use strict";function L(u){return null}J.a=L},"7Cbv":function(I,J,P){"use strict";var L=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),u=new Uint8Array(16);function S(){if(!L)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(u)}var R=/^(?:[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 h(p){return typeof p=="string"&&R.test(p)}for(var o=h,C=[],c=0;c<256;++c)C.push((c+256).toString(16).substr(1));function a(p){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=(C[p[f+0]]+C[p[f+1]]+C[p[f+2]]+C[p[f+3]]+"-"+C[p[f+4]]+C[p[f+5]]+"-"+C[p[f+6]]+C[p[f+7]]+"-"+C[p[f+8]]+C[p[f+9]]+"-"+C[p[f+10]]+C[p[f+11]]+C[p[f+12]]+C[p[f+13]]+C[p[f+14]]+C[p[f+15]]).toLowerCase();if(!o(b))throw TypeError("Stringified UUID is invalid");return b}var i=a;function r(p,f,b){p=p||{};var v=p.random||(p.rng||S)();if(v[6]=v[6]&15|64,v[8]=v[8]&63|128,f){b=b||0;for(var m=0;m<16;++m)f[b+m]=v[m];return f}return i(v)}var l=J.a=r},"7ahc":function(I,J,P){"use strict";P.d(J,"a",function(){return T});var L=P("k1fw"),u=P("0Owb"),S=P("+L6B"),R=P("2/Rp"),h=P("y8nQ"),o=P("Vl3Y"),C=P("tJVT"),c=P("OaEy"),a=P("2fM7"),i=P("q1tI"),r=P.n(i),l=P("VrN/"),p=P.n(l),f=P("p77/"),b=P.n(f),v=P("c5Ni"),m=P.n(v),n=a.a.Option,d={labelCol:{span:4},wrapperCol:{span:20}},g={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"]};J.b=function(y){var s=y.callback,M=y.onCancel,A=Object(i.useState)("python"),x=Object(C.a)(A,2),E=x[0],w=x[1];function _(j){w(g[j][1])}function N(j){s(j)}return r.a.createElement(o.a,Object(u.a)({},d,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:N}),r.a.createElement(o.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},r.a.createElement(a.a,{onChange:_},Object.keys(g).map(function(j){return r.a.createElement(n,{key:j,value:j},g[j][0])}))),r.a.createElement(o.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},r.a.createElement(T,{mode:E})),r.a.createElement("div",{className:"flex-container flex-end"},r.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),r.a.createElement(R.a,{type:"ghost",onClick:M},"\u53D6\u6D88")))};function T(y){var s=y.value,M=y.onChange,A=y.mode,x=y.options,E=x===void 0?{}:x,w=Object(i.useRef)(),_=Object(i.useState)(),N=Object(C.a)(_,2),j=N[0],k=N[1];return Object(i.useEffect)(function(){if(j){function z(H){var F=H.getValue();M&&M(F)}return j.on("change",z),function(){j.off("change",z)}}},[j,M]),Object(i.useEffect)(function(){j&&j.setOption("mode",A)},[j,A]),Object(i.useEffect)(function(){j&&((s!==j.getValue()||s==="")&&setTimeout(function(){j.setValue(s||" ")},300))},[j,s]),Object(i.useEffect)(function(){if(w.current&&!j){var z=p.a.fromTextArea(w.current,Object(L.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));k(z)}},[w.current,j]),r.a.createElement("div",{className:"my-codemirror-container"},r.a.createElement("textarea",{ref:w}))}},"815F":function(I,J,P){"use strict";P.d(J,"e",function(){return C}),P.d(J,"c",function(){return a}),P.d(J,"d",function(){return i}),P.d(J,"a",function(){return l}),P.d(J,"f",function(){return p}),P.d(J,"b",function(){return f});var L=P("KQm4"),u=P("VTBJ"),S=P("Ff2n"),R=P("Zm9Q"),h=P("Kwbf"),o=P("OZM5");function C(b,v){return b!=null?b:v}function c(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],v=new Map;function m(n){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(g){var T=g.key,y=g.children;Object(h.a)(T!=null,"Tree node must have a certain key: [".concat(d).concat(T,"]"));var s=String(T);Object(h.a)(!v.has(s)||T===null||T===void 0,"Same 'key' exist in the Tree: ".concat(s)),v.set(s,!0),m(y,"".concat(d).concat(s," > "))})}m(b)}function a(b){function v(m){var n=Object(R.a)(m);return n.map(function(d){if(!Object(o.i)(d))return Object(h.a)(!d,"Tree/TreeNode can only accept TreeNode as children."),null;var g=d.key,T=d.props,y=T.children,s=Object(S.a)(T,["children"]),M=Object(u.a)({key:g},s),A=v(y);return A.length&&(M.children=A),M}).filter(function(d){return d})}return v(b)}function i(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=new Set(v===!0?[]:v),n=[];function d(g){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return g.map(function(y,s){var M=Object(o.h)(T?T.pos:"0",s),A=C(y.key,M),x=Object(u.a)(Object(u.a)({},y),{},{parent:T,pos:M,children:null,data:y,isStart:[].concat(Object(L.a)(T?T.isStart:[]),[s===0]),isEnd:[].concat(Object(L.a)(T?T.isEnd:[]),[s===g.length-1])});return n.push(x),v===!0||m.has(A)?x.children=d(y.children||[],x):x.children=[],x})}return d(b),n}function r(b,v,m){var n;m?typeof m=="string"?n=function(T){return T[m]}:typeof m=="function"&&(n=function(T){return m(T)}):n=function(T,y){return C(T.key,y)};function d(g,T,y){var s=g?g.children:b,M=g?Object(o.h)(y.pos,T):"0";if(g){var A=n(g,M),x={node:g,index:T,pos:M,key:A,parentPos:y.node?y.pos:null,level:y.level+1};v(x)}s&&s.forEach(function(E,w){d(E,w,{node:g,pos:M,level:y?y.level+1:-1})})}d(null)}function l(b){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=v.initWrapper,n=v.processEntity,d=v.onProcessFinished,g=arguments.length>2?arguments[2]:void 0,T={},y={},s={posEntities:T,keyEntities:y};return m&&(s=m(s)||s),r(b,function(M){var A=M.node,x=M.index,E=M.pos,w=M.key,_=M.parentPos,N=M.level,j={node:A,index:x,key:w,pos:E,level:N},k=C(w,E);T[E]=j,y[k]=j,j.parent=T[_],j.parent&&(j.parent.children=j.parent.children||[],j.parent.children.push(j)),n&&n(j,s)},g),d&&d(s),s}function p(b,v){var m=v.expandedKeys,n=v.selectedKeys,d=v.loadedKeys,g=v.loadingKeys,T=v.checkedKeys,y=v.halfCheckedKeys,s=v.dragOverNodeKey,M=v.dropPosition,A=v.keyEntities,x=A[b],E={eventKey:b,expanded:m.indexOf(b)!==-1,selected:n.indexOf(b)!==-1,loaded:d.indexOf(b)!==-1,loading:g.indexOf(b)!==-1,checked:T.indexOf(b)!==-1,halfChecked:y.indexOf(b)!==-1,pos:String(x?x.pos:""),dragOver:s===b&&M===0,dragOverGapTop:s===b&&M===-1,dragOverGapBottom:s===b&&M===1};return E}function f(b){var v=b.data,m=b.expanded,n=b.selected,d=b.checked,g=b.loaded,T=b.loading,y=b.halfChecked,s=b.dragOver,M=b.dragOverGapTop,A=b.dragOverGapBottom,x=b.pos,E=b.active,w=Object(u.a)(Object(u.a)({},v),{},{expanded:m,selected:n,checked:d,loaded:g,loading:T,halfChecked:y,dragOver:s,dragOverGapTop:M,dragOverGapBottom:A,pos:x,active:E});return"props"in w||Object.defineProperty(w,"props",{get:function(){return Object(h.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),b}}),w}},"8EBN":function(I,J,P){(function(L){L(P("VrN/"))})(function(L){"use strict";L.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 u=0;u<L.modeInfo.length;u++){var S=L.modeInfo[u];S.mimes&&(S.mime=S.mimes[0])}L.findModeByMIME=function(R){R=R.toLowerCase();for(var h=0;h<L.modeInfo.length;h++){var o=L.modeInfo[h];if(o.mime==R)return o;if(o.mimes){for(var C=0;C<o.mimes.length;C++)if(o.mimes[C]==R)return o}}if(/\+xml$/.test(R))return L.findModeByMIME("application/xml");if(/\+json$/.test(R))return L.findModeByMIME("application/json")},L.findModeByExtension=function(R){R=R.toLowerCase();for(var h=0;h<L.modeInfo.length;h++){var o=L.modeInfo[h];if(o.ext){for(var C=0;C<o.ext.length;C++)if(o.ext[C]==R)return o}}},L.findModeByFileName=function(R){for(var h=0;h<L.modeInfo.length;h++){var o=L.modeInfo[h];if(o.file&&o.file.test(R))return o}var C=R.lastIndexOf("."),c=C>-1&&R.substring(C+1,R.length);if(c)return L.findModeByExtension(c)},L.findModeByName=function(R){R=R.toLowerCase();for(var h=0;h<L.modeInfo.length;h++){var o=L.modeInfo[h];if(o.name.toLowerCase()==R)return o;if(o.alias){for(var C=0;C<o.alias.length;C++)if(o.alias[C].toLowerCase()==R)return o}}}})},"8hTe":function(I,J,P){I.exports={button:"button___1wy9m"}},"9Bee":function(I,J,P){"use strict";var L=P("DYRE"),u=P("zeV3"),S=P("+L6B"),R=P("2/Rp"),h=P("k1fw"),o=P("9og8"),C=P("tJVT"),c=P("WmNS"),a=P.n(c),i=P("q1tI"),r=P.n(i),l=P("vg9a"),p=P("DlQD"),f=P.n(p),b=P("rUJ1");function v(se,V){var X=se.match(/^(\s+)(?:```)/);if(X===null)return V;var ne=X[1];return V.split(`
|
|
|
`).map(function(me){var ie=me.match(/^\s+/);if(ie===null)return me;var ze=Object(C.a)(ie,1),pt=ze[0];return pt.length>=ne.length?me.slice(ne.length):me}).join(`
|
|
|
`)}var m=[],n=["<ul>"],d=new f.a.Renderer,g=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){m.length=0,n=["<ul>"]}var y={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function s(se,V,X,ne){if(V>=se.length||se[V].level<=X)return V;var me=se[V];ne.push("<li><a href='#"+me.anchor+"'>"+me.text+"</a>"),V++;var ie=[];return V=s(se,V,me.level,ie),ie.length>0&&(ne.push("<ul>"),ie.forEach(function(ze){ne.push(ze)}),ne.push("</ul>")),ne.push("</li>"),V=s(se,V,X,ne),V}function M(){return s(m,0,0,n),n.push("</ul>"),n.join("")}var A={heading:function(V){var X=g.exec(V);if(X)return{type:"heading",raw:X[0],depth:X[1].length,text:X[2]}},fences:function(V){var X=this.rules.block.fences.exec(V);if(X){var ne=X[0],me=v(ne,X[3]||""),ie=X[2]?X[2].trim():X[2];if(["latex","katex","math"].indexOf(ie)>=0){var ze=w(),pt=me;me=ze,_[ze]={type:"block",expression:pt}}return{type:"code",raw:ne,lang:ie,text:me}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,w=function(){return"__special_katext_id_".concat(E++,"__")},_={};function N(){return _}function j(){E=0,_={}}function k(se){return se=se.replace(x,function(V,X){var ne=w();return _[ne]={type:"inline",expression:X},ne}),se}var z=d.listitem;d.listitem=function(se){return z(k(se))};var H=d.paragraph;d.paragraph=function(se){return H(k(se))};var F=d.tablecell;d.tablecell=function(se,V){return F(k(se),V)},d.code=function(se,V,X){var ne=(V||"").match(/\S*/)[0];return ne?["latex","katex","math"].indexOf(ne)>=0?"<p class='editormd-tex'>".concat(se,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(V,'">').concat(X?se:Object(b.escape)(se,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(X?se:Object(b.escape)(se,!0))+"</code></pre>"},d.heading=function(se,V,X){var ne=this.options.headerPrefix+X.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:ne,level:V,text:se}),"<h"+V+' id="'+ne+'">'+se+"</h"+V+">"},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:A,renderer:d});var G=f.a,B=P("SJMd"),W=P("ulZh"),K=P.n(W),q=P("m3rI"),re=P("Oy/b"),ee=P("p5ED"),Ce=P("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 xe=function(se,V){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ne){X.__proto__=ne}||function(X,ne){for(var me in ne)Object.prototype.hasOwnProperty.call(ne,me)&&(X[me]=ne[me])})(se,V)};function he(se,V){function X(){this.constructor=se}xe(se,V),se.prototype=V===null?Object.create(V):(X.prototype=V.prototype,new X)}function ke(se,V,X,ne){return new(X||(X=Promise))(function(me,ie){function ze(It){try{ot(ne.next(It))}catch(gt){ie(gt)}}function pt(It){try{ot(ne.throw(It))}catch(gt){ie(gt)}}function ot(It){var gt;It.done?me(It.value):(gt=It.value,gt instanceof X?gt:new X(function(Ht){Ht(gt)})).then(ze,pt)}ot((ne=ne.apply(se,V||[])).next())})}function _e(se,V){var X,ne,me,ie,ze={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return ie={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(ie[Symbol.iterator]=function(){return this}),ie;function pt(ot){return function(It){return function(gt){if(X)throw new TypeError("Generator is already executing.");for(;ze;)try{if(X=1,ne&&(me=2>[0]?ne.return:gt[0]?ne.throw||((me=ne.return)&&me.call(ne),0):ne.next)&&!(me=me.call(ne,gt[1])).done)return me;switch(ne=0,me&&(gt=[2>[0],me.value]),gt[0]){case 0:case 1:me=gt;break;case 4:return ze.label++,{value:gt[1],done:!1};case 5:ze.label++,ne=gt[1],gt=[0];continue;case 7:gt=ze.ops.pop(),ze.trys.pop();continue;default:if(!(me=ze.trys,(me=me.length>0&&me[me.length-1])||gt[0]!==6&>[0]!==2)){ze=0;continue}if(gt[0]===3&&(!me||gt[1]>me[0]&>[1]<me[3])){ze.label=gt[1];break}if(gt[0]===6&&ze.label<me[1]){ze.label=me[1],me=gt;break}if(me&&ze.label<me[2]){ze.label=me[2],ze.ops.push(gt);break}me[2]&&ze.ops.pop(),ze.trys.pop();continue}gt=V.call(se,ze)}catch(Ht){gt=[6,Ht],ne=0}finally{X=me=0}if(5>[0])throw gt[1];return{value:gt[0]?gt[1]:void 0,done:!0}}([ot,It])}}}function de(){for(var se=0,V=0,X=arguments.length;V<X;V++)se+=arguments[V].length;var ne=Array(se),me=0;for(V=0;V<X;V++)for(var ie=arguments[V],ze=0,pt=ie.length;ze<pt;ze++,me++)ne[me]=ie[ze];return ne}var ce=function(){function se(){}return se.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},se.setAttributes=function(V,X){for(var ne=0,me=X;ne<me.length;ne++){var ie=me[ne],ze=ie[0],pt=ie[1];V.setAttribute(ze,pt)}},se.createRect=function(V,X,ne){var me=document.createElementNS("http://www.w3.org/2000/svg","rect");return me.setAttribute("width",V.toString()),me.setAttribute("height",X.toString()),ne&&se.setAttributes(me,ne),me},se.createLine=function(V,X,ne,me,ie){var ze=document.createElementNS("http://www.w3.org/2000/svg","line");return ze.setAttribute("x1",V.toString()),ze.setAttribute("y1",X.toString()),ze.setAttribute("x2",ne.toString()),ze.setAttribute("y2",me.toString()),ie&&se.setAttributes(ze,ie),ze},se.createPolygon=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ne.setAttribute("points",V),X&&se.setAttributes(ne,X),ne},se.createCircle=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","circle");return ne.setAttribute("cx",(V/2).toString()),ne.setAttribute("cy",(V/2).toString()),ne.setAttribute("r",V.toString()),X&&se.setAttributes(ne,X),ne},se.createEllipse=function(V,X,ne){var me=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return me.setAttribute("cx",(V/2).toString()),me.setAttribute("cy",(X/2).toString()),me.setAttribute("rx",(V/2).toString()),me.setAttribute("ry",(X/2).toString()),ne&&se.setAttributes(me,ne),me},se.createGroup=function(V){var X=document.createElementNS("http://www.w3.org/2000/svg","g");return V&&se.setAttributes(X,V),X},se.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},se.createMarker=function(V,X,ne,me,ie,ze,pt){var ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return se.setAttributes(ot,[["id",V],["orient",X],["markerWidth",ne.toString()],["markerHeight",me.toString()],["refX",ie.toString()],["refY",ze.toString()]]),ot.appendChild(pt),ot},se.createText=function(V){var X=document.createElementNS("http://www.w3.org/2000/svg","text");return X.setAttribute("x","0"),X.setAttribute("y","0"),V&&se.setAttributes(X,V),X},se.createTSpan=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ne.textContent=V,X&&se.setAttributes(ne,X),ne},se.createImage=function(V){var X=document.createElementNS("http://www.w3.org/2000/svg","image");return V&&se.setAttributes(X,V),X},se.createPoint=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ne.x=V,ne.y=X,ne},se.createPath=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","path");return ne.setAttribute("d",V),X&&se.setAttributes(ne,X),ne},se}(),ae=function(){function se(){}return se.addKey=function(V){se.key=V},Object.defineProperty(se,"isLicensed",{get:function(){return!!se.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(se.key)},enumerable:!1,configurable:!0}),se}(),Se=function(){function se(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return se.prototype.rasterize=function(V,X,ne){var me=this;return new Promise(function(ie){var ze=ne!==void 0?ne:document.createElement("canvas");V===null&&(me.markersOnly=!0,me.naturalSize=!1);var pt=document.createElementNS("http://www.w3.org/2000/svg","svg");pt.setAttribute("xmlns","http://www.w3.org/2000/svg"),pt.setAttribute("width",X.width.baseVal.valueAsString),pt.setAttribute("height",X.height.baseVal.valueAsString),pt.setAttribute("viewBox","0 0 "+X.viewBox.baseVal.width.toString()+" "+X.viewBox.baseVal.height.toString()),pt.innerHTML=X.innerHTML,me.naturalSize===!0?(pt.width.baseVal.value=V.naturalWidth,pt.height.baseVal.value=V.naturalHeight):me.width!==void 0&&me.height!==void 0&&(pt.width.baseVal.value=me.width,pt.height.baseVal.value=me.height),ze.width=pt.width.baseVal.value,ze.height=pt.height.baseVal.value;var ot=pt.outerHTML,It=ze.getContext("2d");me.markersOnly!==!0&&It.drawImage(V,0,0,ze.width,ze.height);var gt=window.URL,Ht=new Image(ze.width,ze.height);Ht.setAttribute("crossOrigin","anonymous");var Xt=new Blob([ot],{type:"image/svg+xml"}),Sr=gt.createObjectURL(Xt);Ht.onload=function(){It.drawImage(Ht,0,0),gt.revokeObjectURL(Sr);var an=ze.toDataURL(me.imageType,me.imageQuality);ie(an)},Ht.src=Sr})},se}(),te=function(){},ue=function(){function se(V){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+V+"_"}return Object.defineProperty(se.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(se.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(se.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),se.prototype.addClass=function(V){return this.styleSheet===void 0&&this.addStyleSheet(),V.name=""+this.classNamePrefix+V.localName,this.classes.push(V),this.styleSheet.sheet.insertRule("."+V.name+" {"+V.style+"}",this.styleSheet.sheet.cssRules.length),V},se.prototype.addRule=function(V){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(V),this.styleSheet.sheet.insertRule(V.selector+" {"+V.style+"}",this.styleSheet.sheet.cssRules.length)},se.prototype.addStyleSheet=function(){var V;this.styleSheet=document.createElement("style"),((V=this.styleSheetRoot)!==null&&V!==void 0?V:document.head).appendChild(this.styleSheet),this.addRule(new Oe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Oe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Oe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new le("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new le("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},se.prototype.removeStyleSheet=function(){var V;this.styleSheet&&(((V=this.styleSheetRoot)!==null&&V!==void 0?V:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},se}(),Oe=function(se,V){this.selector=se,this.style=V},le=function(se,V){this.localName=se,this.style=V},Q=function(){function se(V,X,ne,me,ie){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=V,this.displayMode=X,this.markerItems=ne,this.uiStyleSettings=me,this.styles=ie,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return se.prototype.show=function(V){var X=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=V,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ne=document.createElement("div");ne.className=this.toolbarBlockStyleClass.name,ne.style.whiteSpace="nowrap",this.uiContainer.appendChild(ne),this.addActionButton(ne,'<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(ne,'<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(ne,'<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(ne,'<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(ne,'<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(ne,'<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(ne,'<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(ne,'<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(ie){var ze=document.createElement("div");ze.className=""+X.toolbarButtonStyleClass.name,ze.setAttribute("data-type-name",ie.typeName),ze.innerHTML=ie.icon,ze.addEventListener("click",function(){X.markerToolbarButtonClicked(ze,ie)}),X.buttons.push(ze),X.markerButtons.push(ze)}),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 me=document.createElement("div");me.className=this.toolbarBlockStyleClass.name,me.style.whiteSpace="nowrap",me.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(me),this.addActionButton(me,'<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(me,'<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()},se.prototype.addButtonClickListener=function(V){this.buttonClickListeners.push(V)},se.prototype.removeButtonClickListener=function(V){this.buttonClickListeners.indexOf(V)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(V),1)},se.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},se.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var V=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var X=0;X<this.markerButtons.length;X++)X<V||X===V&&this.markerButtons.length-1===V?this.markerButtonBlock.appendChild(this.markerButtons[X]):(X===V&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[X]))}},se.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")},se.prototype.resetButtonStyles=function(){var V=this;this.buttons.forEach(function(X){X.className=X.className.replace(V.uiStyleSettings.toolbarButtonStyleColorsClassName?V.uiStyleSettings.toolbarButtonStyleColorsClassName:V.toolbarButtonStyleColorsClass.name,"").trim(),X.className=X.className.replace(V.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?V.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:V.toolbarActiveButtonStyleColorsClass.name,"").trim(),X.className+=" "+(V.uiStyleSettings.toolbarButtonStyleColorsClassName?V.uiStyleSettings.toolbarButtonStyleColorsClassName:V.toolbarButtonStyleColorsClass.name)})},se.prototype.addActionButton=function(V,X,ne){var me=this,ie=document.createElement("div");switch(ie.className=""+this.toolbarButtonStyleClass.name,ie.innerHTML=X,ie.setAttribute("data-action",ne),ie.addEventListener("click",function(){me.actionToolbarButtonClicked(ie,ne)}),ne){case"select":ie.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":ie.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":ie.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":ie.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":ie.style.fill=this.uiStyleSettings.closeButtonColor}V.appendChild(ie),this.buttons.push(ie)},se.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new le("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new le("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new le("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new le("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new le("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var V=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new le("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*V)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*V)+`px;
|
|
|
padding: `+V+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new le("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new le("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},se.prototype.markerToolbarButtonClicked=function(V,X){this.setActiveButton(V),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ne){return ne("marker",X)}),this.markerButtonOverflowBlock.style.display="none"},se.prototype.actionToolbarButtonClicked=function(V,X){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ne){return ne("action",X)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},se.prototype.setActiveButton=function(V){this.resetButtonStyles(),V.className=V.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),V.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},se.prototype.setActiveMarkerButton=function(V){var X=this.markerButtons.find(function(ne){return ne.getAttribute("data-type-name")===V});X&&this.setActiveButton(X)},se.prototype.setCurrentMarker=function(V){var X=this;this.currentMarker=V,this.buttons.filter(function(ne){return/delete|notes/.test(ne.getAttribute("data-action"))}).forEach(function(ne){X.currentMarker===void 0?(ne.style.fillOpacity="0.4",ne.style.pointerEvents="none"):(ne.style.fillOpacity="1",ne.style.pointerEvents="all")})},se}(),Y=function(){function se(V,X,ne,me){this.panels=[],this.panelButtons=[],this.markerjsContainer=V,this.displayMode=X,this.uiStyleSettings=ne,this.styles=me,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return se.prototype.addStyles=function(){var V;this.toolboxStyleClass=this.styles.addClass(new le("toolbox",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
font-family: sans-serif;
|
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new le("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var X=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new le("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new le("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new le("toolbox-panel-row",`
|
|
|
display: flex;
|
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
cursor: default;
|
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new le("toolbox-panel-row_colors",`
|
|
|
background-color: `+((V=this.uiStyleSettings.toolboxBackgroundColor)!==null&&V!==void 0?V:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new le("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px;
|
|
|
padding: `+X+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new le("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new le("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},se.prototype.show=function(V){var X;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=V,this.uiContainer.className=this.toolboxStyleClass.name+" "+((X=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},se.prototype.setPanelButtons=function(V){var X,ne,me=this;this.panels=V,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ne=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ne!==void 0?ne:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ie){var ze;ie.uiStyleSettings=me.uiStyleSettings;var pt=document.createElement("div");pt.className=me.toolboxButtonStyleClass.name+" "+((ze=me.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ze!==void 0?ze:me.toolboxButtonStyleColorsClass.name),pt.innerHTML=ie.icon,pt.title=ie.title,pt.addEventListener("click",function(){me.panelButtonClick(ie)}),me.panelButtons.push(pt),me.buttonRow.appendChild(pt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},se.prototype.panelButtonClick=function(V){var X=this,ne=-1;if(V!==this.activePanel){ne=this.panels.indexOf(V),this.panelRow.innerHTML="";var me=V.getUi();me.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(me),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=V}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){X.displayMode==="inline"?X.panelRow.style.display="none":X.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(ie,ze){var pt,ot;ie.className=X.toolboxButtonStyleClass.name+" "+(ze===ne?""+((pt=X.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&pt!==void 0?pt:X.toolboxActiveButtonStyleColorsClass.name):""+((ot=X.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ot!==void 0?ot:X.toolboxButtonStyleColorsClass.name))})},se}(),Z=function(se,V){this.title=se,this.icon=V},be=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'<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 ze.colors=[],ze.addTransparent=!1,ze.colorBoxes=[],ze.colors=ne,ze.currentColor=me,ze.setCurrentColor=ze.setCurrentColor.bind(ze),ze.getColorBox=ze.getColorBox.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.overflow="hidden",ne.style.whiteSpace="nowrap",this.colors.forEach(function(me){var ie=X.getColorBox(me);ne.appendChild(ie),X.colorBoxes.push(ie)}),ne},V.prototype.getColorBox=function(X){var ne=this,me=this.uiStyleSettings.toolbarHeight/4,ie=this.uiStyleSettings.toolbarHeight-me,ze=document.createElement("div");ze.style.display="inline-block",ze.style.boxSizing="content-box",ze.style.width=ie-2+"px",ze.style.height=ie-2+"px",ze.style.padding="1px",ze.style.marginRight="2px",ze.style.marginBottom="2px",ze.style.borderWidth="2px",ze.style.borderStyle="solid",ze.style.borderRadius=(ie+2)/2+"px",ze.style.borderColor=X===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ze.addEventListener("click",function(){ne.setCurrentColor(X,ze)});var pt=document.createElement("div");return pt.style.display="inline-block",pt.style.width=ie-2+"px",pt.style.height=ie-2+"px",pt.style.backgroundColor=X,pt.style.borderRadius=ie/2+"px",X==="transparent"&&(pt.style.fill=this.uiStyleSettings.toolboxAccentColor,pt.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>`),ze.appendChild(pt),ze},V.prototype.setCurrentColor=function(X,ne){var me=this;this.currentColor=X,this.colorBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(X)},V}(Z),ge=function(){function se(V,X,ne){this._state="new",this._isSelected=!1,this._container=V,this._overlayContainer=X,this.globalSettings=ne,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(se.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(V){return!1},Object.defineProperty(se.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),se.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},se.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},se.prototype.pointerDown=function(V,X){},se.prototype.dblClick=function(V,X){},se.prototype.manipulate=function(V){},se.prototype.pointerUp=function(V){this.stateChanged()},se.prototype.dispose=function(){},se.prototype.addMarkerVisualToContainer=function(V){this.container.childNodes.length>0?this.container.insertBefore(V,this.container.childNodes[0]):this.container.appendChild(V)},se.prototype.getState=function(){return{typeName:se.typeName,state:this.state,notes:this.notes}},se.prototype.restoreState=function(V){this._state=V.state,this.notes=V.notes},se.prototype.scale=function(V,X){},se.prototype.colorChanged=function(V){this.onColorChanged&&this.onColorChanged(V),this.stateChanged()},se.prototype.fillColorChanged=function(V){this.onFillColorChanged&&this.onFillColorChanged(V),this.stateChanged()},se.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var V=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),V.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(V)&&this.onStateChanged(this)}},se.typeName="MarkerBase",se}(),De=function(){function se(){this.findGripByVisual=this.findGripByVisual.bind(this)}return se.prototype.findGripByVisual=function(V){return this.topLeft.ownsTarget(V)?this.topLeft:this.topCenter.ownsTarget(V)?this.topCenter:this.topRight.ownsTarget(V)?this.topRight:this.centerLeft.ownsTarget(V)?this.centerLeft:this.centerRight.ownsTarget(V)?this.centerRight:this.bottomLeft.ownsTarget(V)?this.bottomLeft:this.bottomCenter.ownsTarget(V)?this.bottomCenter:this.bottomRight.ownsTarget(V)?this.bottomRight:void 0},se}(),Qe=function(){function se(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return se.prototype.ownsTarget=function(V){return V===this.visual||V===this.visual.childNodes[0]||V===this.visual.childNodes[1]},se}(),Ze=function(){function se(){}return se.toITransformMatrix=function(V){return{a:V.a,b:V.b,c:V.c,d:V.d,e:V.e,f:V.f}},se.toSVGMatrix=function(V,X){return V.a=X.a,V.b=X.b,V.c=X.c,V.d=X.d,V.e=X.e,V.f=X.f,V},se}(),nt=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.left=0,ie.top=0,ie.width=0,ie.height=0,ie.defaultSize={x:50,y:20},ie.offsetX=0,ie.offsetY=0,ie.rotationAngle=0,ie.CB_DISTANCE=10,ie._suppressMarkerCreateEvent=!1,ie.container.transform.baseVal.appendItem(ce.createTransform()),ie.setupControlBox(),ie}return he(V,se),Object.defineProperty(V.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"visual",{get:function(){return this._visual},set:function(X){this._visual=X;var ne=ce.createTransform();this._visual.transform.baseVal.appendItem(ne)},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(X){return!!se.prototype.ownsTarget.call(this,X)||!!(this.controlGrips.findGripByVisual(X)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X))},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.left=X.x,this.top=X.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var me=this.unrotatePoint(X);if(this.manipulationStartX=me.x,this.manipulationStartY=me.y,this.offsetX=me.x-this.left,this.offsetY=me.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ne),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ne)){this.activeGrip=this.rotatorGrip;var ie=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=ie.x-this.width/2,this.top=ie.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ze=this.container.transform.baseVal.getItem(0);ze.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ze,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},V.prototype.pointerUp=function(X){var ne=this.state;se.prototype.pointerUp.call(this,X),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(X),this._state="select",ne==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},V.prototype.moveVisual=function(X){this.visual.style.transform="translate("+X.x+"px, "+X.y+"px)"},V.prototype.manipulate=function(X){var ne=this.unrotatePoint(X);this.state==="creating"?this.resize(X):this.state==="move"?(this.left=this.manipulationStartLeft+(ne.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ne.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ne):this.state==="rotate"&&this.rotate(X)},V.prototype.resize=function(X){var ne=this.manipulationStartLeft,me=this.manipulationStartWidth,ie=this.manipulationStartTop,ze=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ne=this.manipulationStartLeft+X.x-this.manipulationStartX,me=this.manipulationStartWidth+this.manipulationStartLeft-ne;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:me=this.manipulationStartWidth+X.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:ie=this.manipulationStartTop+X.y-this.manipulationStartY,ze=this.manipulationStartHeight+this.manipulationStartTop-ie;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ze=this.manipulationStartHeight+X.y-this.manipulationStartY}me>=0?(this.left=ne,this.width=me):(this.left=ne+me,this.width=-me),ze>=0?(this.top=ie,this.height=ze):(this.top=ie+ze,this.height=-ze),this.setSize()},V.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},V.prototype.rotate=function(X){if(Math.abs(X.x-this.centerX)>.1){var ne=Math.sign(X.x-this.centerX);this.rotationAngle=180*Math.atan((X.y-this.centerY)/(X.x-this.centerX))/Math.PI+90*ne,this.applyRotation()}},V.prototype.applyRotation=function(){var X=this.container.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(X,0)},V.prototype.rotatePoint=function(X){if(this.rotationAngle===0)return X;var ne=this.container.getCTM(),me=ce.createPoint(X.x,X.y);return{x:(me=me.matrixTransform(ne)).x,y:me.y}},V.prototype.unrotatePoint=function(X){if(this.rotationAngle===0)return X;var ne=this.container.getCTM();ne=ne.inverse();var me=ce.createPoint(X.x,X.y);return{x:(me=me.matrixTransform(ne)).x,y:me.y}},V.prototype.select=function(){se.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},V.prototype.deselect=function(){se.prototype.deselect.call(this),this.controlBox.style.display="none"},V.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var X=ce.createTransform();X.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(X),this.container.appendChild(this.controlBox),this.controlRect=ce.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=ce.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 De,this.addControlGrips(),this.controlBox.style.display="none"},V.prototype.adjustControlBox=function(){var X=this.controlBox.transform.baseVal.getItem(0);X.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(X,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()},V.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()},V.prototype.createGrip=function(){var X=new Qe;return X.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(X.visual),X},V.prototype.positionGrips=function(){var X=this.controlGrips.topLeft.GRIP_SIZE,ne=-X/2,me=ne,ie=(this.width+this.CB_DISTANCE)/2-X/2,ze=(this.height+this.CB_DISTANCE)/2-X/2,pt=this.height+this.CB_DISTANCE-X/2,ot=this.width+this.CB_DISTANCE-X/2;this.positionGrip(this.controlGrips.topLeft.visual,ne,me),this.positionGrip(this.controlGrips.topCenter.visual,ie,me),this.positionGrip(this.controlGrips.topRight.visual,ot,me),this.positionGrip(this.controlGrips.centerLeft.visual,ne,ze),this.positionGrip(this.controlGrips.centerRight.visual,ot,ze),this.positionGrip(this.controlGrips.bottomLeft.visual,ne,pt),this.positionGrip(this.controlGrips.bottomCenter.visual,ie,pt),this.positionGrip(this.controlGrips.bottomRight.visual,ot,pt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ie,me-3*this.CB_DISTANCE)},V.prototype.positionGrip=function(X,ne,me){var ie=X.transform.baseVal.getItem(0);ie.setTranslate(ne,me),X.transform.baseVal.replaceItem(ie,0)},V.prototype.hideControlBox=function(){this.controlBox.style.display="none"},V.prototype.showControlBox=function(){this.controlBox.style.display=""},V.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ze.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ze.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},se.prototype.getState.call(this))},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.left=ne.left,this.top=ne.top,this.width=ne.width,this.height=ne.height,this.rotationAngle=ne.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ne.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ne.containerTransformMatrix))},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne);var me=this.rotatePoint({x:this.left,y:this.top}),ie=this.unrotatePoint({x:me.x*X,y:me.y*ne});this.left=ie.x,this.top=ie.y,this.width=this.width*X,this.height=this.height*ne,this.adjustControlBox()},V}(ge),tt=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.fillColor="transparent",ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.opacity=1,ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setFillColor=ie.setFillColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.createVisual=ie.createVisual.bind(ie),ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual)},V.prototype.createVisual=function(){this.visual=ce.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)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},V.prototype.manipulate=function(X){se.prototype.manipulate.call(this,X)},V.prototype.resize=function(X){se.prototype.resize.call(this,X),this.setSize()},V.prototype.setSize=function(){se.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},V.prototype.pointerUp=function(X){se.prototype.pointerUp.call(this,X),this.setSize()},V.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},V.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},V.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},V.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},V.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},se.prototype.getState.call(this))},V.prototype.restoreState=function(X){var ne=X;this.fillColor=ne.fillColor,this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.opacity=ne.opacity,this.createVisual(),se.prototype.restoreState.call(this,X),this.setSize()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setSize()},V.title="Rectangle marker",V}(nt),lt=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ze.widths=[],ze.widthBoxes=[],ze.widths=ne,ze.currentWidth=me,ze.setCurrentWidth=ze.setCurrentWidth.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",this.widths.forEach(function(me){var ie=document.createElement("div");ie.style.display="flex",ie.style.flexGrow="2",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderColor=me===X.currentWidth?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentWidth(me,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.innerText=me.toString(),ze.style.marginRight="5px",ie.appendChild(ze);var pt=document.createElement("div");pt.style.minHeight="20px",pt.style.flexGrow="2",pt.style.display="flex",pt.style.alignItems="center";var ot=document.createElement("hr");ot.style.minWidth="20px",ot.style.border="0px",ot.style.borderTop=me+"px solid "+X.uiStyleSettings.toolboxColor,ot.style.flexGrow="2",pt.appendChild(ot),ie.appendChild(pt),X.widthBoxes.push(ie)}),ne},V.prototype.setCurrentWidth=function(X,ne){var me=this;this.currentWidth=X,this.widthBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},V}(Z),st=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'<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 ze.styles=[],ze.styleBoxes=[],ze.styles=ne,ze.currentStyle=me,ze.setCurrentStyle=ze.setCurrentStyle.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",this.styles.forEach(function(me){var ie=document.createElement("div");ie.style.display="flex",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.overflow="hidden",ie.style.maxWidth=100/X.styles.length-5+"%",ie.style.borderColor=me===X.currentStyle?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentStyle(me,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.overflow="hidden";var pt=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+X.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(me!==""?'stroke-dasharray="'+me+'"':"")+` />
|
|
|
</svg>`;ze.innerHTML=pt,ie.appendChild(ze),X.styleBoxes.push(ie)}),ne},V.prototype.setCurrentStyle=function(X,ne){var me=this;this.currentStyle=X,this.styleBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},V}(Z),je=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.strokeColor=me.defaultColor,ie.strokeWidth=me.defaultStrokeWidth,ie.strokeDasharray=me.defaultStrokeDasharray,ie.strokePanel=new be("Line color",me.defaultColorSet,me.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new st("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return he(V,se),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.typeName="FrameMarker",V.title="Frame marker",V.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',V}(tt),Re=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},et=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.x1=0,ie.y1=0,ie.x2=0,ie.y2=0,ie.defaultLength=50,ie.manipulationStartX=0,ie.manipulationStartY=0,ie.manipulationStartX1=0,ie.manipulationStartY1=0,ie.manipulationStartX2=0,ie.manipulationStartY2=0,ie.setupControlBox(),ie}return he(V,se),V.prototype.ownsTarget=function(X){return!!se.prototype.ownsTarget.call(this,X)||!(!this.grip1.ownsTarget(X)&&!this.grip2.ownsTarget(X))},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.manipulationStartX=X.x,this.manipulationStartY=X.y,this.state==="new"&&(this.x1=X.x,this.y1=X.y,this.x2=X.x,this.y2=X.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(ne)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ne)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},V.prototype.pointerUp=function(X){var ne=this.state;se.prototype.pointerUp.call(this,X),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(X),this._state="select",ne==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},V.prototype.adjustVisual=function(){},V.prototype.manipulate=function(X){this.state==="creating"?this.resize(X):this.state==="move"?(this.x1=this.manipulationStartX1+X.x-this.manipulationStartX,this.y1=this.manipulationStartY1+X.y-this.manipulationStartY,this.x2=this.manipulationStartX2+X.x-this.manipulationStartX,this.y2=this.manipulationStartY2+X.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(X)},V.prototype.resize=function(X){switch(this.activeGrip){case this.grip1:this.x1=X.x,this.y1=X.y;break;case this.grip2:case void 0:this.x2=X.x,this.y2=X.y}this.adjustVisual(),this.adjustControlBox()},V.prototype.select=function(){se.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},V.prototype.deselect=function(){se.prototype.deselect.call(this),this.controlBox.style.display="none"},V.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},V.prototype.adjustControlBox=function(){this.positionGrips()},V.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},V.prototype.createGrip=function(){var X=new Qe;return X.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(X.visual),X},V.prototype.positionGrips=function(){var X=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-X/2,this.y1-X/2),this.positionGrip(this.grip2.visual,this.x2-X/2,this.y2-X/2)},V.prototype.positionGrip=function(X,ne,me){var ie=X.transform.baseVal.getItem(0);ie.setTranslate(ne,me),X.transform.baseVal.replaceItem(ie,0)},V.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},se.prototype.getState.call(this))},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.x1=ne.x1,this.y1=ne.y1,this.x2=ne.x2,this.y2=ne.y2},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.x1=this.x1*X,this.y1=this.y1*ne,this.x2=this.x2*X,this.y2=this.y2*ne,this.adjustVisual(),this.adjustControlBox()},V}(ge),ct=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.strokeColor=me.defaultColor,ie.strokeWidth=me.defaultStrokeWidth,ie.strokeDasharray=me.defaultStrokeDasharray,ie.strokePanel=new be("Line color",me.defaultColorSet,me.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new st("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorLine&&X!==this.visibleLine)},V.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.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)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},V.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()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},V.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},V.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},V.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.createVisual(),this.adjustVisual()},V.typeName="LineMarker",V.title="Line marker",V.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',V}(et),$e=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'<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 ze.fonts=[],ze.fontBoxes=[],ze.fonts=ne,ze.currentFont=me,ze.setCurrentFont=ze.setCurrentFont.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.overflow="hidden",ne.style.flexGrow="2",this.fonts.forEach(function(me){var ie=document.createElement("div");ie.style.display="inline-block",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.overflow="hidden",ie.style.maxWidth=100/X.fonts.length-5+"%",ie.style.borderColor=me===X.currentFont?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentFont(me,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.style.display="flex",ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.fontFamily=me,ze.style.overflow="hidden";var pt=document.createElement("div");pt.style.whiteSpace="nowrap",pt.style.overflow="hidden",pt.style.textOverflow="ellipsis",pt.innerHTML="The quick brown fox jumps over the lazy dog",ze.appendChild(pt),ie.appendChild(ze),X.fontBoxes.push(ie)}),ne},V.prototype.setCurrentFont=function(X,ne){var me=this;this.currentFont=X,this.fontBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},V}(Z),qe=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.color="transparent",ie.padding=5,ie.DEFAULT_TEXT="your text here",ie.text=ie.DEFAULT_TEXT,ie.isMoved=!1,ie.color=me.defaultColor,ie.fontFamily=me.defaultFontFamily,ie.defaultSize={x:100,y:30},ie.setColor=ie.setColor.bind(ie),ie.setFont=ie.setFont.bind(ie),ie.renderText=ie.renderText.bind(ie),ie.sizeText=ie.sizeText.bind(ie),ie.textEditDivClicked=ie.textEditDivClicked.bind(ie),ie.showTextEditor=ie.showTextEditor.bind(ie),ie.setSize=ie.setSize.bind(ie),ie.positionTextEditor=ie.positionTextEditor.bind(ie),ie.colorPanel=new be("Color",me.defaultColorSet,me.defaultColor),ie.colorPanel.onColorChanged=ie.setColor,ie.fontFamilyPanel=new $e("Font",me.defaultFontFamilies,me.defaultFontFamily),ie.fontFamilyPanel.onFontChanged=ie.setFont,ie}return he(V,se),V.prototype.ownsTarget=function(X){if(se.prototype.ownsTarget.call(this,X)||X===this.visual||X===this.textElement||X===this.bgRectangle)return!0;var ne=!1;return this.textElement.childNodes.forEach(function(me){me===X&&(ne=!0)}),ne},V.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.isMoved=!1,this.pointerDownPoint=X,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},V.prototype.renderText=function(){var X=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(ne){X.textElement.appendChild(ce.createTSpan(ne.trim()===""?" ":ne.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},V.prototype.getTextScale=function(){var X=this.textElement.getBBox(),ne=1;if(X.width>0&&X.height>0){var me=(1*this.width-this.width*this.padding*2/100)/X.width,ie=(1*this.height-this.height*this.padding*2/100)/X.height;ne=Math.min(me,ie)}return ne},V.prototype.getTextPosition=function(X){var ne=this.textElement.getBBox(),me=0,ie=0;return ne.width>0&&ne.height>0&&(me=(this.width-ne.width*X)/2,ie=this.height/2-ne.height*X/2),{x:me,y:ie}},V.prototype.sizeText=function(){var X=this.textElement.getBBox(),ne=this.getTextScale(),me=this.getTextPosition(ne);me.y-=X.y*ne,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+me.x+"px, "+me.y+"px) scale("+ne+", "+ne+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(me.x,me.y),this.textElement.transform.baseVal.getItem(1).setScale(ne,ne))},V.prototype.manipulate=function(X){se.prototype.manipulate.call(this,X),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(X.x-this.pointerDownPoint.x)>5||Math.abs(X.y-this.pointerDownPoint.y)>5)},V.prototype.resize=function(X){se.prototype.resize.call(this,X),this.isMoved=!0,this.setSize(),this.sizeText()},V.prototype.setSize=function(){se.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},V.prototype.pointerUp=function(X){var ne=this.state;ne==="creating"&&(this._suppressMarkerCreateEvent=!0),se.prototype.pointerUp.call(this,X),this.setSize(),(ne==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},V.prototype.showTextEditor=function(){var X=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(ne){ne.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ne=Number.parseFloat(X.textEditor.style.fontSize);X.textEditor.clientWidth>=Number.parseInt(X.textEditor.style.maxWidth)&&ne>.9;)ne-=.1,X.textEditor.style.fontSize=Math.max(ne,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ne){ne.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ne){if(ne.clipboardData){var me=ne.clipboardData.getData("text"),ie=window.getSelection();if(!ie.rangeCount)return!1;ie.deleteFromDocument(),ie.getRangeAt(0).insertNode(document.createTextNode(me)),ne.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){X.textEditDivClicked(X.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},V.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var X=this.getTextScale(),ne=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),me=this.textElement.getBBox(),ie={x:me.width*X,y:me.height*X};ne.x-=ie.x/2,ne.y-=ie.y/2,this.textEditor.style.top=ne.y+"px",this.textEditor.style.left=ne.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ne.x+"px",this.textEditor.style.fontSize=Math.max(16*X,12)+"px",this.textElement.style.display="none"}},V.prototype.textEditDivClicked=function(X){this.text=X.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},V.prototype.select=function(){se.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},V.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),se.prototype.deselect.call(this)},V.prototype.dblClick=function(X,ne){se.prototype.dblClick.call(this,X,ne),this.showTextEditor()},V.prototype.setColor=function(X){this.textElement&&ce.setAttributes(this.textElement,[["fill",X]]),this.color=X,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(X)},V.prototype.setFont=function(X){this.textElement&&ce.setAttributes(this.textElement,[["font-family",X]]),this.fontFamily=X,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},V.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},V.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){var ne=X;this.color=ne.color,this.fontFamily=ne.fontFamily,this.padding=ne.padding,this.text=ne.text,this.createVisual(),se.prototype.restoreState.call(this,X),this.setSize()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setSize(),this.sizeText(),this.positionTextEditor()},V.typeName="TextMarker",V.title="Text marker",V.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>',V}(nt),Ue=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.color="transparent",ie.lineWidth=3,ie.drawing=!1,ie.pixelRatio=1,ie.color=me.defaultColor,ie.lineWidth=me.defaultStrokeWidth,ie.pixelRatio=me.freehandPixelRatio,ie.setColor=ie.setColor.bind(ie),ie.addCanvas=ie.addCanvas.bind(ie),ie.finishCreation=ie.finishCreation.bind(ie),ie.setLineWidth=ie.setLineWidth.bind(ie),ie.colorPanel=new be("Color",me.defaultColorSet,me.defaultColor),ie.colorPanel.onColorChanged=ie.setColor,ie.lineWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.lineWidthPanel.onWidthChanged=ie.setLineWidth,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.drawingImage)},V.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var X=ce.createTransform();this.visual.transform.baseVal.appendItem(X),this.addMarkerVisualToContainer(this.visual)},V.prototype.pointerDown=function(X,ne){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(X.x,X.y),this.drawing=!0):se.prototype.pointerDown.call(this,X,ne)},V.prototype.manipulate=function(X){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(X.x,X.y),this.canvasContext.stroke()):se.prototype.manipulate.call(this,X)},V.prototype.resize=function(X){se.prototype.resize.call(this,X),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},V.prototype.pointerUp=function(X){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):se.prototype.pointerUp.call(this,X)},V.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)},V.prototype.select=function(){this.state==="creating"&&this.finishCreation(),se.prototype.select.call(this)},V.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),se.prototype.deselect.call(this)},V.prototype.finishCreation=function(){for(var X=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ne=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],me=ne[0],ie=ne[1],ze=ne[2],pt=ne[3],ot=!1,It=0;It<this.canvasElement.height;It++)for(var gt=0;gt<this.canvasElement.width;gt++)X.data[It*this.canvasElement.width*4+4*gt+3]>0&&(ot=!0,It<ie&&(ie=It),gt<me&&(me=gt),It>pt&&(pt=It),gt>ze&&(ze=gt));if(ot){this.left=me/this.pixelRatio,this.top=ie/this.pixelRatio,this.width=(ze-me)/this.pixelRatio,this.height=(pt-ie)/this.pixelRatio;var Ht=document.createElement("canvas");Ht.width=ze-me,Ht.height=pt-ie,Ht.getContext("2d").putImageData(this.canvasContext.getImageData(me,ie,ze-me,pt-ie),0,0),this.drawingImgUrl=Ht.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},V.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},V.prototype.setColor=function(X){this.color=X,this.colorChanged(X)},V.prototype.setLineWidth=function(X){this.lineWidth=X},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({drawingImgUrl:this.drawingImgUrl},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){this.createVisual(),se.prototype.restoreState.call(this,X),this.drawingImgUrl=X.drawingImgUrl,this.setDrawingImage()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setDrawingImage()},V.typeName="FreehandMarker",V.title="Freehand marker",V.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>',V}(nt),Me=function(se){function V(X,ne,me){var ie=se.call(this,X,me||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return ie.typeBoxes=[],ie.currentType=ne,ie.setCurrentType=ie.setCurrentType.bind(ie),ie}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2";for(var me=function(pt){var ot="both";switch(pt){case 0:ot="both";break;case 1:ot="start";break;case 2:ot="end";break;case 3:ot="none"}var It=document.createElement("div");if(It.style.display="flex",It.style.flexGrow="2",It.style.alignItems="center",It.style.justifyContent="space-between",It.style.padding="5px",It.style.borderWidth="2px",It.style.borderStyle="solid",It.style.borderColor=ot===ie.currentType?ie.uiStyleSettings.toolboxAccentColor:"transparent",It.addEventListener("click",function(){X.setCurrentType(ot,It)}),ne.appendChild(It),ot==="both"||ot==="start"){var gt=document.createElement("div");gt.style.display="flex",gt.style.alignItems="center",gt.style.minHeight="20px",gt.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="`+(ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,gt.style.marginLeft="5px",It.appendChild(gt)}var Ht=document.createElement("div");Ht.style.display="flex",Ht.style.alignItems="center",Ht.style.minHeight="20px",Ht.style.flexGrow="2";var Xt=document.createElement("hr");if(Xt.style.minWidth="20px",Xt.style.border="0px",Xt.style.borderTop="3px solid "+(ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxColor:"#eeeeee"),Xt.style.flexGrow="2",Ht.appendChild(Xt),It.appendChild(Ht),ot==="both"||ot==="end"){var Sr=document.createElement("div");Sr.style.display="flex",Sr.style.alignItems="center",Sr.style.minHeight="20px",Sr.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="`+(ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Sr.style.marginRight="5px",It.appendChild(Sr)}ie.typeBoxes.push(It)},ie=this,ze=0;ze<4;ze++)me(ze);return ne},V.prototype.setCurrentType=function(X,ne){var me=this;this.currentType=X,this.typeBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings!==void 0?me.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},V}(Z),Ie=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.arrowType="end",ie.arrowBaseHeight=10,ie.arrowBaseWidth=10,ie.getArrowPoints=ie.getArrowPoints.bind(ie),ie.setArrowType=ie.setArrowType.bind(ie),ie.arrowTypePanel=new Me("Arrow type","end"),ie.arrowTypePanel.onArrowTypeChanged=ie.setArrowType,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.arrow1&&X!==this.arrow2)},V.prototype.getArrowPoints=function(X,ne){var me=this.arrowBaseWidth+2*this.strokeWidth,ie=this.arrowBaseHeight+2*this.strokeWidth;return X-me/2+","+(ne+ie/2)+" "+X+","+(ne-ie/2)+" "+(X+me/2)+","+(ne+ie/2)},V.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="creating"&&this.createTips()},V.prototype.adjustVisual=function(){if(se.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",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ne=this.arrow1.transform.baseVal.getItem(0);ne.setRotate(X,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ne,0);var me=this.arrow2.transform.baseVal.getItem(0);me.setRotate(X+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(me,0)}},V.prototype.setArrowType=function(X){this.arrowType=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({arrowType:this.arrowType},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.arrowType=ne.arrowType,this.createTips(),this.adjustVisual()},V.typeName="ArrowMarker",V.title="Arrow marker",V.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',V}(ct),ye=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.fillColor=me.defaultFillColor,ie.strokeWidth=0,ie.fillPanel=new be("Color",me.defaultColorSet,me.defaultFillColor),ie.fillPanel.onColorChanged=ie.setFillColor,ie}return he(V,se),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.typeName="CoverMarker",V.title="Cover marker",V.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',V}(tt),Te=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'<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 ze.opacities=[],ze.opacityBoxes=[],ze.opacities=ne,ze.currentOpacity=me,ze.setCurrentOpacity=ze.setCurrentOpacity.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",ne.style.justifyContent="space-between",this.opacities.forEach(function(me){var ie=document.createElement("div");ie.style.display="flex",ie.style.alignItems="center",ie.style.justifyContent="center",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderColor=me===X.currentOpacity?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentOpacity(me,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.innerText=100*me+"%",ie.appendChild(ze),X.opacityBoxes.push(ie)}),ne},V.prototype.setCurrentOpacity=function(X,ne){var me=this;this.currentOpacity=X,this.opacityBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},V}(Z),Ae=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.setOpacity=ie.setOpacity.bind(ie),ie.fillColor=me.defaultHighlightColor,ie.strokeWidth=0,ie.opacity=me.defaultHighlightOpacity,ie.fillPanel=new be("Color",me.defaultColorSet,ie.fillColor),ie.fillPanel.onColorChanged=ie.setFillColor,ie.opacityPanel=new Te("Opacity",me.defaultOpacitySteps,ie.opacity),ie.opacityPanel.onOpacityChanged=ie.setOpacity,ie}return he(V,se),V.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.typeName="HighlightMarker",V.title="Highlight marker",V.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>',V}(ye),Pe='<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>',Xe=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.bgColor="transparent",ie.tipPosition={x:0,y:0},ie.tipBase1Position={x:0,y:0},ie.tipBase2Position={x:0,y:0},ie.tipMoving=!1,ie.color=me.defaultStrokeColor,ie.bgColor=me.defaultFillColor,ie.fontFamily=me.defaultFontFamily,ie.defaultSize={x:100,y:30},ie.setBgColor=ie.setBgColor.bind(ie),ie.getTipPoints=ie.getTipPoints.bind(ie),ie.positionTip=ie.positionTip.bind(ie),ie.setTipPoints=ie.setTipPoints.bind(ie),ie.colorPanel=new be("Text color",me.defaultColorSet,ie.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>'),ie.colorPanel.onColorChanged=ie.setColor,ie.bgColorPanel=new be("Fill color",me.defaultColorSet,ie.bgColor,Pe),ie.bgColorPanel.onColorChanged=ie.setBgColor,ie.fontFamilyPanel=new $e("Font",me.defaultFontFamilies,me.defaultFontFamily),ie.fontFamilyPanel.onFontChanged=ie.setFont,ie.tipGrip=new Qe,ie.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),ie.controlBox.appendChild(ie.tipGrip.visual),ie}return he(V,se),V.prototype.ownsTarget=function(X){return se.prototype.ownsTarget.call(this,X)||this.tipGrip.ownsTarget(X)||this.tip===X},V.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},V.prototype.pointerDown=function(X,ne){this.state==="new"&&se.prototype.pointerDown.call(this,X,ne),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ne)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):se.prototype.pointerDown.call(this,X,ne)},V.prototype.pointerUp=function(X){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,se.prototype.pointerUp.call(this,X);else{var ne=this.state==="creating";se.prototype.pointerUp.call(this,X),this.setTipPoints(ne),this.positionTip()}},V.prototype.manipulate=function(X){if(this.tipMoving){var ne=this.unrotatePoint(X);this.tipPosition={x:ne.x-this.manipulationStartLeft,y:ne.y-this.manipulationStartTop},this.positionTip()}else se.prototype.manipulate.call(this,X)},V.prototype.setBgColor=function(X){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",X]]),ce.setAttributes(this.tip,[["fill",X]])),this.bgColor=X,this.fillColorChanged(X)},V.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},V.prototype.setTipPoints=function(X){X===void 0&&(X=!1);var ne=Math.min(this.height/2,15),me=this.height/5;X&&(this.tipPosition={x:ne+me/2,y:this.height+20});var ie=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?ie<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(me=this.width/5,ne=Math.min(this.width/2,15),this.tipBase1Position={x:ne,y:0},this.tipBase2Position={x:ne+me,y:0}):(this.tipBase1Position={x:0,y:ne},this.tipBase2Position={x:0,y:ne+me}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?ie<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(me=this.width/5,ne=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ne-me,y:0},this.tipBase2Position={x:this.width-ne,y:0}):(this.tipBase1Position={x:this.width,y:ne},this.tipBase2Position={x:this.width,y:ne+me}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?ie<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(me=this.width/5,ne=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ne-me,y:this.height},this.tipBase2Position={x:this.width-ne,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ne-me},this.tipBase2Position={x:this.width,y:this.height-ne}):ie<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(me=this.width/5,ne=Math.min(this.width/2,15),this.tipBase1Position={x:ne,y:this.height},this.tipBase2Position={x:ne+me,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ne},this.tipBase2Position={x:0,y:this.height-ne-me})},V.prototype.resize=function(X){se.prototype.resize.call(this,X),this.positionTip()},V.prototype.positionTip=function(){ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var X=this.tipGrip.visual.transform.baseVal.getItem(0);X.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(X,0)},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),V.prototype.select=function(){this.positionTip(),se.prototype.select.call(this)},V.prototype.getState=function(){var X=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){var ne=X;this.bgColor=ne.bgColor,this.tipPosition=ne.tipPosition,se.prototype.restoreState.call(this,X),this.createTip(),this.setTipPoints()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.tipPosition={x:this.tipPosition.x*X,y:this.tipPosition.y*ne},this.positionTip()},V.typeName="CalloutMarker",V.title="Callout marker",V.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>',V}(qe),rt=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.fillColor="transparent",ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.opacity=1,ie.strokeColor=me.defaultColor,ie.strokeWidth=me.defaultStrokeWidth,ie.strokeDasharray=me.defaultStrokeDasharray,ie.fillColor=me.defaultFillColor,ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setFillColor=ie.setFillColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.setOpacity=ie.setOpacity.bind(ie),ie.createVisual=ie.createVisual.bind(ie),ie.strokePanel=new be("Line color",de(me.defaultColorSet,["transparent"]),me.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.fillPanel=new be("Fill color",de(me.defaultColorSet,["transparent"]),ie.fillColor,Pe),ie.fillPanel.onColorChanged=ie.setFillColor,ie.strokeWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new st("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie.opacityPanel=new Te("Opacity",me.defaultOpacitySteps,ie.opacity),ie.opacityPanel.onOpacityChanged=ie.setOpacity,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual)},V.prototype.createVisual=function(){this.visual=ce.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)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},V.prototype.manipulate=function(X){se.prototype.manipulate.call(this,X)},V.prototype.resize=function(X){se.prototype.resize.call(this,X),this.setSize()},V.prototype.setSize=function(){se.prototype.setSize.call(this),ce.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},V.prototype.pointerUp=function(X){se.prototype.pointerUp.call(this,X),this.setSize()},V.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},V.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(X),this.stateChanged()},V.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},V.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},V.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){var ne=X;this.fillColor=ne.fillColor,this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.opacity=ne.opacity,this.createVisual(),se.prototype.restoreState.call(this,X),this.setSize()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setSize()},V.typeName="EllipseMarker",V.title="Ellipse marker",V.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>',V}(nt),ft=function(se){function V(X,ne,me){return se.call(this,X,ne,me)||this}return he(V,se),Object.defineProperty(V.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.tip1&&X!==this.tip2)},V.prototype.createTips=function(){this.tip1=ce.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(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.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(ce.createTransform()),this.visual.appendChild(this.tip2)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="creating"&&this.createTips()},V.prototype.adjustVisual=function(){if(se.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ce.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()]]),ce.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 X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ne=this.tip1.transform.baseVal.getItem(0);ne.setRotate(X,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ne,0);var me=this.tip2.transform.baseVal.getItem(0);me.setRotate(X+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(me,0)}},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X),this.createTips(),this.adjustVisual()},V.typeName="MeasurementMarker",V.title="Measurement marker",V.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>',V}(ct),St=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.strokePanel.colors=me.defaultColorSet,ie.fillColor="transparent",ie}return he(V,se),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.typeName="EllipseFrameMarker",V.title="Ellipse frame marker",V.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>',V}(rt),Pt=function(){function se(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(se.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),se.prototype.addUndoStep=function(V){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(V)||(this.undoStack.push(V),JSON.stringify(this.lastRedoStep)!==JSON.stringify(V)&&this.redoStack.splice(0,this.redoStack.length))},se.prototype.replaceLastUndoStep=function(V){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=V)},se.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},se.prototype.undo=function(){if(this.undoStack.length>1){var V=this.undoStack.pop();return V!==void 0&&this.redoStack.push(V),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},se.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},se}(),dt=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.curveX=0,ie.curveY=0,ie.manipulationStartCurveX=0,ie.manipulationStartCurveY=0,ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.positionGrips=ie.positionGrips.bind(ie),ie.addControlGrips=ie.addControlGrips.bind(ie),ie.adjustVisual=ie.adjustVisual.bind(ie),ie.setupControlBox=ie.setupControlBox.bind(ie),ie.resize=ie.resize.bind(ie),ie.strokeColor=me.defaultColor,ie.strokeWidth=me.defaultStrokeWidth,ie.strokeDasharray=me.defaultStrokeDasharray,ie.strokePanel=new be("Line color",me.defaultColorSet,me.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new st("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorCurve&&X!==this.visibleCurve&&!this.curveGrip.ownsTarget(X))},V.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},V.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.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)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=X.x,this.curveY=X.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ne)&&(this.activeGrip=this.curveGrip,this._state="resize")},V.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},V.prototype.setupControlBox=function(){se.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.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)},V.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,se.prototype.addControlGrips.call(this)},V.prototype.positionGrips=function(){se.prototype.positionGrips.call(this);var X=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-X/2,this.curveY-X/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()))},V.prototype.manipulate=function(X){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+X.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+X.y-this.manipulationStartY),se.prototype.manipulate.call(this,X)},V.prototype.resize=function(X){this.activeGrip===this.curveGrip&&(this.curveX=X.x,this.curveY=X.y),se.prototype.resize.call(this,X),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},V.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},V.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},V.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual()},V.prototype.scale=function(X,ne){this.curveX=this.curveX*X,this.curveY=this.curveY*ne,se.prototype.scale.call(this,X,ne)},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.curveX=ne.curveX,this.curveY=ne.curveY,this.createVisual(),this.adjustVisual()},V.typeName="CurveMarker",V.title="Curve marker",V.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>',V}(et),At=function(){function se(V,X){X===void 0&&(X=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=V,this.cancelable=X}return Object.defineProperty(se.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),se.prototype.preventDefault=function(){this._defaultPrevented=!0},se}(),Ot=function(se){function V(X,ne,me){var ie=se.call(this,X,!1)||this;return ie.dataUrl=ne,ie.state=me,ie}return he(V,se),V}(At),bt=function(se){function V(X,ne,me){me===void 0&&(me=!1);var ie=se.call(this,X,me)||this;return ie.marker=ne,ie}return he(V,se),V}(At),Vt=function(){function se(){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 se.prototype.addEventListener=function(V,X){this[V].push(X)},se.prototype.removeEventListener=function(V,X){var ne=this[V].indexOf(X);ne>-1&&this[V].splice(ne,1)},se}(),ir=function(){function se(V){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Re,this._isOpen=!1,this.undoRedoManager=new Pt,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 Vt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=se.instanceCounter++,this.styles=new ue(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=V,this.targetRoot=document.body,this.width=V.clientWidth,this.height=V.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(se.prototype,"ALL_MARKER_TYPES",{get:function(){return[je,Ue,Ie,qe,St,rt,Ae,Xe,ft,ye,ct,dt]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[je,Ue,Ie,qe,rt,Ae,Xe]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"BASIC_MARKER_TYPES",{get:function(){return[je,Ue,Ie,qe,Ae]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(V){var X=this;this._availableMarkerTypes.splice(0),V.forEach(function(ne){if(typeof ne=="string"){var me=X.ALL_MARKER_TYPES.find(function(ie){return ie.typeName===ne});me!==void 0&&X._availableMarkerTypes.push(me)}else X._availableMarkerTypes.push(ne)})},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(V){this._zoomLevel=V,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(se.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),se.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ae.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},se.prototype.show=function(){var V=this;this.styles.styleSheetRoot===void 0&&te.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=te.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(X){return X(new At(V))})},se.prototype.render=function(){return ke(this,void 0,void 0,function(){var V;return _e(this,function(X){switch(X.label){case 0:return this.setCurrentMarker(),(V=new Se).naturalSize=this.renderAtNaturalSize,V.imageType=this.renderImageType,V.imageQuality=this.renderImageQuality,V.markersOnly=this.renderMarkersOnly,V.width=this.renderWidth,V.height=this.renderHeight,[4,V.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return X.sent(),[4,V.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,X.sent()]}})})},se.prototype.close=function(V){var X=this;if(V===void 0&&(V=!1),this.isOpen){var ne=!1;V||this.eventListeners.beforeclose.forEach(function(me){var ie=new At(X,!0);me(ie),ie.defaultPrevented&&(ne=!0)}),ne||(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(me){return me(new At(X))}),this.detachEvents(),this._isOpen=!1)}},se.prototype.addMarkersToToolbar=function(){for(var V,X=[],ne=0;ne<arguments.length;ne++)X[ne]=arguments[ne];(V=this._availableMarkerTypes).push.apply(V,X)},se.prototype.addRenderEventListener=function(V){this.addEventListener("render",function(X){V(X.dataUrl,X.state)})},se.prototype.removeRenderEventListener=function(V){},se.prototype.addCloseEventListener=function(V){this.addEventListener("close",function(){V()})},se.prototype.removeCloseEventListener=function(V){},se.prototype.setupResizeObserver=function(){var V=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){V.resize(V.target.clientWidth,V.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return V.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},se.prototype.onPopupTargetResize=function(){var V=1*this.target.clientWidth/this.target.clientHeight,X=this.editorCanvas.clientWidth/V>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*V:this.editorCanvas.clientWidth,ne=X<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/V;this.resize(X,ne)},se.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},se.prototype.resize=function(V,X){this._isResizing=!0;var ne=V/this.imageWidth,me=X/this.imageHeight;this.imageWidth=Math.round(V),this.imageHeight=Math.round(X),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(ne,me),this._isResizing=!1},se.prototype.scaleMarkers=function(V,X){var ne,me=this;this._currentMarker&&this._currentMarker instanceof qe?this._currentMarker.scale(V,X):(ne=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(ie){ie!==me._currentMarker&&ie.scale(V,X)}),ne!==void 0&&this.setCurrentMarker(ne)},se.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"},se.prototype.setTopLeft=function(){var V=this.editingTarget.getBoundingClientRect(),X=this.editorCanvas.getBoundingClientRect();this.left=V.left-X.left,this.top=V.top-X.top},se.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)},se.prototype.addDefs=function(){for(var V,X=[],ne=0;ne<arguments.length;ne++)X[ne]=arguments[ne];this.defs=ce.createDefs(),this.addDefsToImage(),(V=this.defs).append.apply(V,X)},se.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},se.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)},se.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},se.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},se.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)},se.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},se.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)},se.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 V=document.createElement("a");V.href="https://markerjs.com/",V.target="_blank",V.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>',V.title="Powered by marker.js",V.style.display="grid",V.style.alignItems="center",V.style.justifyItems="center",V.style.padding="3px",V.style.width="20px",V.style.height="20px",this.logoUI.appendChild(V),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},se.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")},se.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"},se.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},se.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 V=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=V+"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 Q(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 Y(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},se.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},se.prototype.removeMarker=function(V){this.markerImage.removeChild(V.container),this.markers.indexOf(V)>-1&&this.markers.splice(this.markers.indexOf(V),1),V.dispose()},se.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())},se.prototype.toolbarButtonClicked=function(V,X){if(V==="marker"&&X!==void 0)this.createNewMarker(X);else if(V==="action")switch(X){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()}},se.prototype.deleteSelectedMarker=function(){var V=this;if(this._currentMarker!==void 0){var X=!1;if(this.eventListeners.markerbeforedelete.forEach(function(me){var ie=new bt(V,V._currentMarker,!0);me(ie),ie.defaultPrevented&&(X=!0)}),!X){var ne=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(me){return me(new bt(V,ne))})}}},se.prototype.clear=function(){var V=this,X=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ze){var pt=new bt(V,void 0,!0);ze(pt),pt.defaultPrevented&&(X=!0)}),!X)){this.setCurrentMarker();for(var ne=function(ze){var pt=me.markers[ze];me.setCurrentMarker(me.markers[ze]),me._currentMarker.dispose(),me.markerImage.removeChild(me._currentMarker.container),me.markers.splice(me.markers.indexOf(me._currentMarker),1),me.eventListeners.markerdelete.forEach(function(ot){return ot(new bt(V,pt))})},me=this,ie=this.markers.length-1;ie>=0;ie--)ne(ie);this.addUndoStep()}},Object.defineProperty(se.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),se.prototype.showNotesEditor=function(){var V;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=(V=this._currentMarker.notes)!==null&&V!==void 0?V:"",this.overlayContainer.appendChild(this.notesArea))},se.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)},se.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},se.prototype.addUndoStep=function(){var V=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var X=this.getState(),ne=this.undoRedoManager.getLastUndoStep();if(!ne||ne.width===X.width&&ne.height===X.height){var me=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(X),me<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(ie){return ie(new At(V))})}else this.undoRedoManager.replaceLastUndoStep(X),this.eventListeners.statechange.forEach(function(ie){return ie(new At(V))})}},se.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},se.prototype.undoStep=function(){var V=this,X=this.undoRedoManager.undo();X!==void 0&&(this.restoreState(X),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ne){return ne(new At(V))}))},se.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},se.prototype.redoStep=function(){var V=this,X=this.undoRedoManager.redo();X!==void 0&&(this.restoreState(X),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ne){return ne(new At(V))}))},se.prototype.stepZoom=function(){var V=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=V<this.zoomSteps.length-1?this.zoomSteps[V+1]:this.zoomSteps[0]},se.prototype.panTo=function(V){this.contentDiv.scrollBy({left:this.prevPanPoint.x-V.x,top:this.prevPanPoint.y-V.y}),this.prevPanPoint=V},se.prototype.startRenderAndClose=function(){return ke(this,void 0,void 0,function(){var V,X,ne=this;return _e(this,function(me){switch(me.label){case 0:return[4,this.render()];case 1:return V=me.sent(),X=this.getState(),this.eventListeners.render.forEach(function(ie){return ie(new Ot(ne,V,X))}),this.close(!0),[2]}})})},se.prototype.getState=function(V){V===!0&&this.setCurrentMarker();var X={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ne){return X.markers.push(ne.getState())}),X},se.prototype.restoreState=function(V){var X=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);V.markers.forEach(function(ne){var me=X._availableMarkerTypes.find(function(ze){return ze.typeName===ne.typeName});if(me!==void 0){var ie=X.addNewMarker(me);ie.restoreState(ne),X.markers.push(ie)}}),V.width&&V.height&&(V.width!==this.imageWidth||V.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/V.width,this.imageHeight/V.height),this.eventListeners.restorestate.forEach(function(ne){return ne(new At(X))})},se.prototype.addNewMarker=function(V){var X=ce.createGroup();return this.markerImage.appendChild(X),new V(X,this.overlayContainer,this.settings)},se.prototype.createNewMarker=function(V){var X,ne=this;(X=typeof V=="string"?this._availableMarkerTypes.find(function(me){return me.typeName===V}):V)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(X),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(X.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(me){return me(new bt(ne,ne._currentMarker))}))},se.prototype.markerCreated=function(V){var X=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(V),this.setCurrentMarker(V),V instanceof Ue&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ue):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ne){return ne(new bt(X,X._currentMarker))})},se.prototype.colorChanged=function(V){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=V,this.settings.defaultStrokeColor=V)},se.prototype.fillColorChanged=function(V){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=V)},se.prototype.markerStateChanged=function(V){var X=this;this.eventListeners.markerchange.forEach(function(ne){return ne(new bt(X,V))})},se.prototype.setCurrentMarker=function(V){var X=this;this._currentMarker!==V&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ne){return ne(new bt(X,X._currentMarker))})),this._currentMarker=V,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(ne){return ne(new bt(X,X._currentMarker))}))},se.prototype.onPointerDown=function(V){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||V.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var X=this.markers.find(function(ne){return ne.ownsTarget(V.target)});X!==void 0?(this.setCurrentMarker(X),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(V.clientX,V.clientY),V.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:V.clientX,y:V.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(V.clientX,V.clientY))},se.prototype.onDblClick=function(V){if(this._isFocused||this.focus(),this.mode==="select"){var X=this.markers.find(function(ne){return ne.ownsTarget(V.target)});X!==void 0&&X!==this._currentMarker&&this.setCurrentMarker(X),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(V.clientX,V.clientY),V.target):this.setCurrentMarker()}},se.prototype.onPointerMove=function(V){this.touchPoints!==1&&V.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||V.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(V.clientX,V.clientY)):this.zoomLevel>1&&this.panTo({x:V.clientX,y:V.clientY}))},se.prototype.onPointerUp=function(V){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(V.clientX,V.clientY)),this.isDragging=!1,this.addUndoStep()},se.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},se.prototype.onKeyUp=function(V){this._currentMarker===void 0||this.notesArea!==void 0||V.key!=="Delete"&&V.key!=="Backspace"||this.deleteSelectedMarker()},se.prototype.clientToLocalCoordinates=function(V,X){var ne=this.markerImage.getBoundingClientRect();return{x:(V-ne.left)/this.zoomLevel,y:(X-ne.top)/this.zoomLevel}},se.prototype.onWindowResize=function(){this.positionUI()},se.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var V=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=V+"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()},se.prototype.addLicenseKey=function(V){ae.addKey(V)},se.prototype.addEventListener=function(V,X){this.eventListeners.addEventListener(V,X)},se.prototype.removeEventListener=function(V,X){this.eventListeners.removeEventListener(V,X)},se.prototype.renderState=function(V){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(V),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(se.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),se.prototype.focus=function(){var V=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(X){return X(new At(V))}))},se.prototype.blur=function(){var V=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(X){return X(new At(V))}))},se.instanceCounter=0,se}();/* **********************************
|
|
|
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 Qt=function(se,V){return(Qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ne){X.__proto__=ne}||function(X,ne){for(var me in ne)Object.prototype.hasOwnProperty.call(ne,me)&&(X[me]=ne[me])})(se,V)};function dr(se,V){if(typeof V!="function"&&V!==null)throw new TypeError("Class extends value "+String(V)+" is not a constructor or null");function X(){this.constructor=se}Qt(se,V),se.prototype=V===null?Object.create(V):(X.prototype=V.prototype,new X)}function Nt(se,V,X,ne){return new(X||(X=Promise))(function(me,ie){function ze(It){try{ot(ne.next(It))}catch(gt){ie(gt)}}function pt(It){try{ot(ne.throw(It))}catch(gt){ie(gt)}}function ot(It){var gt;It.done?me(It.value):(gt=It.value,gt instanceof X?gt:new X(function(Ht){Ht(gt)})).then(ze,pt)}ot((ne=ne.apply(se,V||[])).next())})}function br(se,V){var X,ne,me,ie,ze={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return ie={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(ie[Symbol.iterator]=function(){return this}),ie;function pt(ot){return function(It){return function(gt){if(X)throw new TypeError("Generator is already executing.");for(;ze;)try{if(X=1,ne&&(me=2>[0]?ne.return:gt[0]?ne.throw||((me=ne.return)&&me.call(ne),0):ne.next)&&!(me=me.call(ne,gt[1])).done)return me;switch(ne=0,me&&(gt=[2>[0],me.value]),gt[0]){case 0:case 1:me=gt;break;case 4:return ze.label++,{value:gt[1],done:!1};case 5:ze.label++,ne=gt[1],gt=[0];continue;case 7:gt=ze.ops.pop(),ze.trys.pop();continue;default:if(!(me=ze.trys,(me=me.length>0&&me[me.length-1])||gt[0]!==6&>[0]!==2)){ze=0;continue}if(gt[0]===3&&(!me||gt[1]>me[0]&>[1]<me[3])){ze.label=gt[1];break}if(gt[0]===6&&ze.label<me[1]){ze.label=me[1],me=gt;break}if(me&&ze.label<me[2]){ze.label=me[2],ze.ops.push(gt);break}me[2]&&ze.ops.pop(),ze.trys.pop();continue}gt=V.call(se,ze)}catch(Ht){gt=[6,Ht],ne=0}finally{X=me=0}if(5>[0])throw gt[1];return{value:gt[0]?gt[1]:void 0,done:!0}}([ot,It])}}}var ur=function(){function se(){}return se.addKey=function(V){se.key=V},Object.defineProperty(se,"isLicensed",{get:function(){return!!se.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(se.key)},enumerable:!1,configurable:!0}),se}(),wt=function(){function se(){}return se.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},se.setAttributes=function(V,X){for(var ne=0,me=X;ne<me.length;ne++){var ie=me[ne],ze=ie[0],pt=ie[1];V.setAttribute(ze,pt)}},se.createRect=function(V,X,ne){var me=document.createElementNS("http://www.w3.org/2000/svg","rect");return me.setAttribute("width",V.toString()),me.setAttribute("height",X.toString()),ne&&se.setAttributes(me,ne),me},se.createLine=function(V,X,ne,me,ie){var ze=document.createElementNS("http://www.w3.org/2000/svg","line");return ze.setAttribute("x1",V.toString()),ze.setAttribute("y1",X.toString()),ze.setAttribute("x2",ne.toString()),ze.setAttribute("y2",me.toString()),ie&&se.setAttributes(ze,ie),ze},se.createPolygon=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ne.setAttribute("points",V),X&&se.setAttributes(ne,X),ne},se.createCircle=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","circle");return ne.setAttribute("cx",(V/2).toString()),ne.setAttribute("cy",(V/2).toString()),ne.setAttribute("r",V.toString()),X&&se.setAttributes(ne,X),ne},se.createEllipse=function(V,X,ne){var me=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return me.setAttribute("cx",(V/2).toString()),me.setAttribute("cy",(X/2).toString()),me.setAttribute("rx",(V/2).toString()),me.setAttribute("ry",(X/2).toString()),ne&&se.setAttributes(me,ne),me},se.createGroup=function(V){var X=document.createElementNS("http://www.w3.org/2000/svg","g");return V&&se.setAttributes(X,V),X},se.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},se.createMarker=function(V,X,ne,me,ie,ze,pt){var ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return se.setAttributes(ot,[["id",V],["orient",X],["markerWidth",ne.toString()],["markerHeight",me.toString()],["refX",ie.toString()],["refY",ze.toString()]]),ot.appendChild(pt),ot},se.createText=function(V){var X=document.createElementNS("http://www.w3.org/2000/svg","text");return X.setAttribute("x","0"),X.setAttribute("y","0"),V&&se.setAttributes(X,V),X},se.createTSpan=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ne.textContent=V,X&&se.setAttributes(ne,X),ne},se.createImage=function(V){var X=document.createElementNS("http://www.w3.org/2000/svg","image");return V&&se.setAttributes(X,V),X},se.createPoint=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ne.x=V,ne.y=X,ne},se.createPath=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg","path");return ne.setAttribute("d",V),X&&se.setAttributes(ne,X),ne},se.createElement=function(V,X){var ne=document.createElementNS("http://www.w3.org/2000/svg",V);return X&&se.setAttributes(ne,X),ne},se.getHollowRectanglePath=function(V,X,ne,me,ie,ze,pt,ot){return"M"+V+","+X+"V"+(X+me)+"H"+(V+ne)+"V"+X+"H"+ie+"V"+ze+"H"+(ie+pt)+"V"+(ze+ot)+"H"+ie+"V"+X+"Z"},se}(),hr=function(){function se(V){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+V+"_"}return Object.defineProperty(se.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(se.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(se.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),se.prototype.addClass=function(V){return this.styleSheet===void 0&&this.addStyleSheet(),V.name=""+this.classNamePrefix+V.localName,this.classes.push(V),this.styleSheet.sheet.insertRule("."+V.name+" {"+V.style+"}",this.styleSheet.sheet.cssRules.length),V},se.prototype.addRule=function(V){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(V),this.styleSheet.sheet.insertRule(V.selector+" {"+V.style+"}",this.styleSheet.sheet.cssRules.length)},se.prototype.addStyleSheet=function(){var V;this.styleSheet=document.createElement("style"),((V=this.styleSheetRoot)!==null&&V!==void 0?V:document.head).appendChild(this.styleSheet),this.addRule(new Qr("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Qr("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Qr("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new Gr("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new Gr("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},se.prototype.removeStyleSheet=function(){var V;this.styleSheet&&(((V=this.styleSheetRoot)!==null&&V!==void 0?V:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},se}(),Qr=function(se,V){this.selector=se,this.style=V},Gr=function(se,V){this.localName=se,this.style=V},Lr=function(){function se(){this.blocks=[],this.display=""}return se.prototype.addButtonBlock=function(V){V.className=this.blockClassName,V.buttonClassName=this.buttonClassName,V.buttonColorsClassName=this.buttonColorsClassName,V.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(V)},se.prototype.addElementBlock=function(V){V.className===void 0&&(V.className=this.blockClassName),this.blocks.push(V)},se.prototype.getUI=function(){var V=document.createElement("div");return V.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,V.style.display=this.display,this.blocks.forEach(function(X){return V.appendChild(X.getUI())}),V},se}(),si=function(){function se(){}return se.prototype.getUI=function(){var V=document.createElement("div");if(V.className=this.className,this.minWidth!==void 0&&(V.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":V.style.justifyContent="flex-start";break;case"center":V.style.justifyContent="center";break;case"end":V.style.justifyContent="flex-end"}return V.style.whiteSpace="nowrap",V},se}(),Tt=function(se){function V(){var X=se!==null&&se.apply(this,arguments)||this;return X.buttons=[],X}return dr(V,se),V.prototype.addButton=function(X){X.className=this.buttonClassName,X.colorsClassName=this.buttonColorsClassName,X.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(X)},V.prototype.getUI=function(){var X=se.prototype.getUI.call(this);return this.buttons.forEach(function(ne){return X.appendChild(ne.getUI())}),X},V}(si),Dt=function(){function se(V,X){this._isActive=!1,this._isHidden=!1,this._icon=V,this.title=X,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(se.prototype,"icon",{get:function(){return this._icon},set:function(V){this._icon=V,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isActive",{get:function(){return this._isActive},set:function(V){this._isActive=V,this.adjustClassName()},enumerable:!1,configurable:!0}),se.prototype.getUI=function(){var V=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 V.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},se.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,"")))},se.prototype.hide=function(){this._isHidden=!0},se}(),Ct=function(se){function V(){var X=se!==null&&se.apply(this,arguments)||this;return X.elements=[],X}return dr(V,se),V.prototype.addElement=function(X){this.elements.push(X)},V.prototype.getUI=function(){var X=se.prototype.getUI.call(this);return this.elements.forEach(function(ne){return X.appendChild(ne)}),X},V}(si),Rr=function(){function se(V,X){this.horizontal=V,this.vertical=X}return Object.defineProperty(se.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),se.prototype.getVerticalLength=function(V){return V/this.ratio},se.prototype.getHorizontalLength=function(V){return V*this.ratio},se}(),jr=function(){function se(){}return se.getIcon=function(V,X){if(V>0&&X>0){var ne=new Rr(V,X),me=ne.ratio>=1?20:ne.getHorizontalLength(20),ie=ne.ratio<1?20:ne.getVerticalLength(20),ze=document.createElementNS("http://www.w3.org/2000/svg","svg");ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),ze.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ze);var pt=wt.createDefs();ze.appendChild(pt);var ot=wt.createElement("clipPath",[["id","text-bg-clip"]]);pt.appendChild(ot);var It=wt.createPath(wt.getHollowRectanglePath((24-me)/2,(24-ie)/2,me,ie,(24-me)/2+2,(24-ie)/2+2,me-4,ie-4));ze.appendChild(It);var gt=wt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);gt.appendChild(wt.createTSpan(V+":"+X)),ze.appendChild(gt);var Ht=gt.getBBox();wt.setAttributes(gt,[["x",((24-Ht.width)/2).toString()],["y",((24-Ht.height)/2-Ht.y).toString()]]);var Xt=wt.createPath(wt.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 ot.appendChild(Xt),wt.setAttributes(It,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ze),ze.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>'},se}(),$t=function(se){function V(X,ne,me){var ie=se.call(this,X,ne)||this;return ie.isDropdownOpen=!1,ie.onClick=ie.dropdownButtonClicked,ie.dropdownButtons=me,ie}return dr(V,se),V.prototype.setupDropdown=function(){var X=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ne){ne.className=X.className,ne.colorsClassName=X.colorsClassName,X.dropdownBlock.appendChild(ne.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},V.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},V.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},V.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},V.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},V.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},V}(Dt),jt=function(){function se(V,X){this.GRIP_SIZE=10,this.color=V,this.fillColor=X,this.visual=wt.createGroup(),this.visual.appendChild(wt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(wt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return se.prototype.ownsTarget=function(V){return V===this.visual||V===this.visual.childNodes[0]||V===this.visual.childNodes[1]},se.prototype.setCenter=function(V,X){this.visual.childNodes.forEach(function(ne){return wt.setAttributes(ne,[["cx",V.toString()],["cy",X.toString()]])})},se}(),Ur=function(){function se(V,X,ne,me){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=V,this.canvasHeight=X,this.margin=ne,this.container=me,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(se.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(V){this._aspectRatio=V,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(V){this._isGridVisible=V,this.gridContainer&&wt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(V){this._zoomFactor=V,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),se.prototype.open=function(){var V=this;this.cropShadeElement=wt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=wt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var X=0;X<this.numberOfGridLines;X++)this.horizontalGridLines.push(wt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(wt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ne){return V.gridContainer.appendChild(ne)}),this.verticalGridLines.forEach(function(ne){return V.gridContainer.appendChild(ne)}),this.cropRectElement=wt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new jt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new jt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new jt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new jt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},se.prototype.setCropRectangle=function(V){this.cropRect=V;var X=Object.assign({},this.cropRect);this.zoomFactor!==1&&(X.width=this.cropRect.width*this.zoomFactor,X.height=this.cropRect.height*this.zoomFactor,X.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-X.width/2,X.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-X.height/2),wt.setAttributes(this.cropRectElement,[["x",X.x.toString()],["y",X.y.toString()],["width",X.width.toString()],["height",X.height.toString()]]);var ne=X.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ie,ze){var pt=X.y+ne*(ze+1);wt.setAttributes(ie,[["x1",""+X.x],["y1",""+pt],["x2",""+(X.x+X.width)],["y2",""+pt]])});var me=X.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ie,ze){var pt=X.x+me*(ze+1);wt.setAttributes(ie,[["x1",""+pt],["y1",""+X.y],["x2",""+pt],["y2",""+(X.y+X.height)]])}),wt.setAttributes(this.cropShadeElement,[["d",wt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,X.x,X.y,X.width,X.height)]]),this.topLeftGrip.setCenter(X.x,X.y),this.topRightGrip.setCenter(X.x+X.width,X.y),this.bottomLeftGrip.setCenter(X.x,X.y+X.height),this.bottomRightGrip.setCenter(X.x+X.width,X.y+X.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},se.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)},se.prototype.clientToLocalCoordinates=function(V,X){var ne=this.container.getBoundingClientRect();return{x:V-ne.left+this.margin,y:X-ne.top+this.margin}},se.prototype.onPointerDown=function(V){this.container.setPointerCapture(V.pointerId),this.previousPoint=this.clientToLocalCoordinates(V.clientX,V.clientY),this.cropRectElement===V.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(V.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(V.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(V.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(V.target)&&(this.activeGrip=this.bottomRightGrip)},se.prototype.onPointerMove=function(V){if(this.isMoving)this.move(this.clientToLocalCoordinates(V.clientX,V.clientY));else if(this.activeGrip){var X=this.clientToLocalCoordinates(V.clientX,V.clientY);this.resize(X)}V.preventDefault()},se.prototype.onPointerUp=function(V){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(V.pointerId)},se.prototype.move=function(V){var X=V.x-this.previousPoint.x,ne=V.y-this.previousPoint.y;this.zoomFactor!==1&&(X=-X/this.zoomFactor,ne=-ne/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+X),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ne),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=V},se.prototype.resize=function(V){var X=Object.assign({},this.cropRect),ne=V.x-this.previousPoint.x,me=V.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:X.x+ne<this.margin&&(ne=this.margin-X.x),X.x+=ne,X.width=this.cropRect.x+this.cropRect.width-X.x;break;case this.bottomRightGrip:case this.topRightGrip:X.width+ne>this.canvasWidth*this.zoomFactor&&(ne=this.canvasWidth*this.zoomFactor-X.width),X.width+=ne}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(X.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ne),X.height=this.aspectRatio.getVerticalLength(X.width)):(X.y+=me,X.height=this.cropRect.y+this.cropRect.height-X.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?X.height=this.aspectRatio.getVerticalLength(X.width):X.height+=me}X.width<10&&(X.x=this.cropRect.x,X.width=10),X.height<10&&(X.y=this.cropRect.y,X.height=10),this.previousPoint=V,X.x>=this.margin&&X.y>=this.margin&&X.x-this.margin+X.width<=this.canvasWidth&&X.y-this.margin+X.height<=this.canvasHeight&&(this.cropRect=X,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},se.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var V=this.cropRect.x+this.cropRect.width/2,X=this.cropRect.y+this.cropRect.height/2,ne=this.aspectRatio.getHorizontalLength(this.cropRect.height),me=this.aspectRatio.getVerticalLength(this.cropRect.width);ne/this.canvasWidth<me/this.canvasHeight?this.cropRect.width=ne:this.cropRect.height=me,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=V-this.cropRect.width/2,this.cropRect.y=X-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)}},se.prototype.getRescaledRect=function(V,X,ne,me,ie,ze){var pt=ne/V,ot=me/X;return{x:(ie.x-ze)*pt+ze,y:(ie.y-ze)*ot+ze,width:ie.width*pt,height:ie.height*ot}},se.prototype.scaleCanvas=function(V,X){var ne=this.getRescaledRect(this.canvasWidth,this.canvasHeight,V,X,this.cropRect,this.margin);this.canvasWidth=V,this.canvasHeight=X,this.onCropChange&&this.onCropChange(ne),this.setCropRectangle(ne)},se}(),_n=function(){function se(V){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=V,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(se.prototype,"angle",{get:function(){return this._angle},set:function(V){this._angle=V,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),se.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},se.prototype.onPointerDown=function(V){this.controlContainer.setPointerCapture(V.pointerId),this.isDragging=!0,this.previousPoint={x:V.clientX,y:V.clientY}},se.prototype.onPointerMove=function(V){this.isDragging&&(this.onAngleChange&&this.onAngleChange((V.clientX-this.previousPoint.x)/5),this.previousPoint.x=V.clientX)},se.prototype.onPointerUp=function(V){this.isDragging&&this.onAngleChange&&this.onAngleChange((V.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(V.pointerId)},se.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var V=this.angleLabelText.getBBox();wt.setAttributes(this.angleLabelElement,[["x",((this.width-V.width)/2).toString()],["y",(this.height/2).toString()]])}},se.prototype.positionScaleShape=function(){if(this.scaleShape){var V=this.scaleShape.transform.baseVal.getItem(0);V.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(V,0)}},se.prototype.getVisual=function(){var V=document.createElementNS("http://www.w3.org/2000/svg","svg");V.setAttribute("xmlns","http://www.w3.org/2000/svg"),V.setAttribute("width",this.width+"px"),V.setAttribute("height",this.height+"px"),V.setAttribute("viewBox","0 0 "+this.width+" "+this.height),V.style.flexShrink="0",document.body.appendChild(V);for(var X="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ne=1;ne<=this.width/5+10;ne++){var me=ne%5==0?this.height/3:this.height/6;X+="h4v"+-me+"h1v"+me}X+="v1H0Z",this.scaleShape=wt.createPath(X);var ie=wt.createTransform();this.scaleShape.transform.baseVal.appendItem(ie),V.appendChild(this.scaleShape),this.angleLabelElement=wt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=wt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ze=wt.createTSpan("");return ze.innerHTML="°",this.angleLabelElement.appendChild(ze),V.appendChild(this.angleLabelElement),document.body.removeChild(V),V},se}(),Vr=function(){function se(){this.naturalSize=!1,this.imageType="image/png"}return se.prototype.rasterize=function(V,X,ne,me,ie,ze,pt){var ot=this;return new Promise(function(It){var gt=document.createElement("canvas");gt.width=V.width.baseVal.value-2*me,gt.height=V.height.baseVal.value-2*me;var Ht=1,Xt=1;ot.naturalSize===!0?(Ht=X.naturalWidth/(V.width.baseVal.value-2*me)/ze,Xt=X.naturalHeight/(V.height.baseVal.value-2*me)/pt,gt.width=X.naturalWidth/ze,gt.height=X.naturalHeight/pt):ot.width!==void 0&&ot.height!==void 0&&(Ht=ot.width/ne.width,Xt=ot.height/ne.height,gt.width*=Ht,gt.height*=Xt);var Sr=gt.getContext("2d");Sr.translate(gt.width/2,gt.height/2),Sr.rotate(ie*Math.PI/180),Sr.scale(ze,pt),Sr.translate(-gt.width/2,-gt.height/2),Sr.drawImage(X,0,0,gt.width,gt.height);var an=document.createElement("canvas");an.width=ne.width*Ht,an.height=ne.height*Xt,an.getContext("2d").putImageData(Sr.getImageData((ne.x-me)*Ht,(ne.y-me)*Xt,ne.width*Ht,ne.height*Xt),0,0),It(an.toDataURL(ot.imageType,ot.imageQuality))})},se}(),vt=function(){function se(V){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=se.instanceCounter++,this.styles=new hr(this.instanceNo),this.target=V,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(se.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(V){this._zoomToCropEnabled=V,V?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(V){this._isGridVisible=V,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"gridLines",{get:function(){return this._gridLines},set:function(V){this._gridLines=V,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(V){this._rotationAngle=V,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"aspectRatio",{get:function(){var V;return(V=this._aspectRatio)!==null&&V!==void 0?V:this.aspectRatios[0]},set:function(V){this._aspectRatio=V},enumerable:!1,configurable:!0}),se.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},se.prototype.show=function(){this.showUI(),this.open()},se.prototype.close=function(V){V===void 0&&(V=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),V||this.closeEventListeners.forEach(function(X){return X()}),this._isOpen=!1)},se.prototype.addRenderEventListener=function(V){this.renderEventListeners.push(V)},se.prototype.removeRenderEventListener=function(V){this.renderEventListeners.indexOf(V)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(V),1)},se.prototype.addCloseEventListener=function(V){this.closeEventListeners.push(V)},se.prototype.removeCloseEventListener=function(V){this.closeEventListeners.indexOf(V)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(V),1)},se.prototype.setupResizeObserver=function(){var V=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){V.resize(V.target.clientWidth,V.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))},se.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var V=1*this.target.clientWidth/this.target.clientHeight,X=this.contentDiv.clientWidth/V>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*V:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ne=X+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/V;this.resize(X,ne)}},se.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},se.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",wt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},se.prototype.resize=function(V,X){this.imageWidth=Math.round(V),this.imageHeight=Math.round(X),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()},se.prototype.setEditingTarget=function(){var V=document.createElement("canvas");V.width=this.target.naturalWidth,V.height=this.target.naturalHeight,V.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var X=V.toDataURL();wt.setAttributes(this.editingTarget,[["href",X]]),this.setEditingTargetSize()},se.prototype.setTopLeft=function(){var V=this.target.getBoundingClientRect(),X=this.editorCanvas.getBoundingClientRect();this.left=V.left-X.left-this.CANVAS_MARGIN,this.top=V.top-X.top-this.CANVAS_MARGIN},se.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=wt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=wt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=wt.createGroup(),this.editingTargetRotationScaleContainer=wt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var V=wt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(V);var X=wt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(X),this.editingTargetContainer=wt.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)},se.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},se.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=wt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ur(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()},se.prototype.zoomToCrop=function(){if(this.cropRect){var V=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,X=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=V+"px "+X+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-V+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-X+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},se.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)},se.prototype.cropRectChanged=function(V){this.cropRect=V,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},se.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},se.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"},se.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},se.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 V=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,X=this.target.offsetTop>V+this.CANVAS_MARGIN?this.target.offsetTop-(V+this.CANVAS_MARGIN):0;this.coverDiv.style.top=X+"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},se.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},se.prototype.addTopToolbar=function(){var V=this;this.topToolbar=new Lr,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 X=new Tt;X.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(X);var ne=[];this.aspectRatios.forEach(function(Xt){var Sr=new Dt(jr.getIcon(Xt.horizontal,Xt.vertical),Xt.horizontal===0&&Xt.vertical===0?"FREE":Xt.horizontal+":"+Xt.vertical);Sr.onClick=function(){return V.ratioButtonClicked(Xt)},ne.push(Sr)}),this.aspectRatioButton=new $t(jr.getIcon(0,0),"Aspect ratio",ne),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,X.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var me=new Dt('<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");me.isActive=this.isGridVisible,me.onClick=function(){V.isGridVisible=!V.isGridVisible,me.isActive=V.isGridVisible},X.addButton(me);var ie=new Dt('<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(ie.isActive=this.zoomToCropEnabled,ie.onClick=function(){V.zoomToCropEnabled=!V.zoomToCropEnabled,ie.isActive=V.zoomToCropEnabled},X.addButton(ie),!ur.isLicensed){var ze=new Ct;this.topToolbar.addElementBlock(ze);var pt=document.createElement("div");pt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ot=document.createElement("a");ot.style.color="currentColor",ot.href="https://markerjs.com/products/cropro",ot.target="_blank",ot.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>',pt.appendChild(ot),ze.addElement(pt)}var It=new Tt;It.minWidth=3*this.toolbarHeight+"px",It.contentAlign="end",this.topToolbar.addButtonBlock(It);var gt=new Dt('<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");gt.onClick=this.startRenderAndClose,It.addButton(gt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(gt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ht=new Dt('<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,It.addButton(Ht),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ht.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},se.prototype.addBottomToolbar=function(){var V=this;this.bottomToolbar=new Lr,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 X=new Tt;X.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(X);var ne=new Dt('<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");ne.onClick=this.rotateLeftButtonClicked,X.addButton(ne);var me=new Dt('<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");me.onClick=this.rotateRightButtonClicked,X.addButton(me);var ie=new Ct;ie.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ie),this.straightener=new _n("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(It){V.rotateBy(It),V.straightener.angle=V.rotationAngle},ie.addElement(this.straightener.getUI());var ze=new Tt;ze.minWidth=2*this.toolbarHeight+"px",ze.contentAlign="end",this.bottomToolbar.addButtonBlock(ze);var pt=new Dt('<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");pt.onClick=this.flipHorizontallyButtonClicked,ze.addButton(pt);var ot=new Dt('<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");ot.onClick=this.flipVerticallyButtonClicked,ze.addButton(ot)},se.prototype.ratioButtonClicked=function(V){this.aspectRatio=V,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},se.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=jr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},se.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Rr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},se.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},se.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},se.prototype.restoreState=function(V){if(V){var X=this.cropLayer.getRescaledRect(V.width,V.height,this.imageWidth,this.imageHeight,V.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(X),this.cropRectChanged(X),this.flippedHorizontally=V.flippedHorizontally,this.flippedVertically=V.flippedVertically,this.applyFlip(),this.rotationAngle=V.rotationAngle,this.applyRotation()}},se.prototype.clientToLocalCoordinates=function(V,X){var ne=this.cropImage.getBoundingClientRect();return{x:V-ne.left,y:X-ne.top}},se.prototype.onWindowResize=function(){this.positionUI()},se.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var V=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=V+"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()},se.prototype.rotateLeftButtonClicked=function(){var V=this.rotationAngle-90;this.rotationAngle%90!=0&&(V+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(V)},se.prototype.rotateRightButtonClicked=function(){var V=this.rotationAngle+90;this.rotationAngle%90!=0&&(V-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(V)},se.prototype.rotateTo=function(V){V=(V=V>180?V-360:V)<=-180?V+360:V,this.rotationAngle=V,this.applyRotation()},se.prototype.rotateBy=function(V){this.rotateTo((this.rotationAngle+V)%360)},se.prototype.applyRotation=function(){var V=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var X=this.editingTargetRotationContainer.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(X,0);var ne=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ne.width,this.imageHeight/ne.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=V},se.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},se.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},se.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},se.prototype.startRenderAndClose=function(){return Nt(this,void 0,void 0,function(){var V,X;return br(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return V=ne.sent(),X=this.getState(),this.renderEventListeners.forEach(function(me){return me(V,X)}),this.close(!0),[2]}})})},se.prototype.render=function(){return Nt(this,void 0,void 0,function(){var V;return br(this,function(X){switch(X.label){case 0:return(V=new Vr).naturalSize=this.renderAtNaturalSize,V.imageType=this.renderImageType,V.imageQuality=this.renderImageQuality,V.width=this.renderWidth,V.height=this.renderHeight,this.unzoomFromCrop(),wt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,V.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 X.sent(),[4,V.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,X.sent()]}})})},se.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Gr("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 Gr("toolbar_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Gr("toolbar-block",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: content-box;
|
|
|
`));var V=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Gr("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.toolbarHeight-2*V)+`px;
|
|
|
height: `+(this.toolbarHeight-2*V)+`px;
|
|
|
padding: `+V+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Gr("toolbar_button_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Gr("toolbar_active_button",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
|
`)),this.styles.addRule(new Qr("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new Qr("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Gr("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 Gr("toolbar_dropdown_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Gr("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 Gr("toolbar_straightener",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
height: `+(this.toolbarHeight-2*V)+`px;
|
|
|
padding: `+V+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Gr("toolbar_straightener_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`))},se.instanceCounter=0,se}(),Ft=P("8hTe"),rn=P.n(Ft),hn=/<pre[^>]*>/g;function An(se){var V=document.createElement("div");return V.innerHTML=se,V.childNodes.length===0?"":V.childNodes[0].nodeValue}var Rn=J.a=function(se){var V=se.value,X=V===void 0?"":V,ne=se.edit,me=ne===void 0?!1:ne,ie=se.className,ze=se.showTextOnly,pt=se.showLines,ot=se.replaces,It=se.zoomImg,gt=se.hasMask,Ht=se.style,Xt=Ht===void 0?{}:Ht,Sr=se.stylesPrev,an=Sr===void 0?{}:Sr,Zr=String(X),Zt=Object(i.useRef)(),Hr=Object(i.useRef)(),fr=Object(i.useState)(""),Jt=Object(C.a)(fr,2),tr=Jt[0],vr=Jt[1],Xr=Object(i.useState)("office"),ln=Object(C.a)(Xr,2),mn=ln[0],li=ln[1],Ki=function(){var cr=new vt(Hr.current);cr.displayMode="popup",cr.addRenderEventListener(function(){var en=Object(o.a)(a.a.mark(function Mr(En){var Fr;return a.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return Zt.current.style.display="none",gn.next=3,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:En}});case 3:Fr=gn.sent,Fr!=null&&Fr.id&&ot(Hr.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Fr==null?void 0:Fr.id,"?type=").concat(Fr.content_type));case 5:case"end":return gn.stop()}},Mr)}));return function(Mr){return en.apply(this,arguments)}}()),cr.show()},Ui=function(){var cr=new ir(Hr.current);cr.settings.displayMode="popup",cr.addEventListener("render",function(){var en=Object(o.a)(a.a.mark(function Mr(En){var Fr;return a.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:if(Zt.current.style.display="none",!Hr.current){gn.next=6;break}return gn.next=4,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:En.dataUrl}});case 4:Fr=gn.sent,Fr!=null&&Fr.id&&ot(Hr.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Fr==null?void 0:Fr.id,"?type=").concat(Fr.content_type));case 6:case"end":return gn.stop()}},Mr)}));return function(Mr){return en.apply(this,arguments)}}()),cr.show(),window.markerArea=cr},Fn=Object(i.useMemo)(function(){try{var Yr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,cr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,en=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Zr=Zr.replace(Yr,"("+q.a.API_SERVER+"/api/attachments/").replace(cr,'"'+q.a.API_SERVER+"/api/attachments/").replace(en,'"'+q.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,`
|
|
|
`),Zr=Zr.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
|
`)}catch(xi){}var Mr=G(Zr),En=N();if(Zr.match(/\[TOC\]/)&&(Mr=Mr.replace("<p>[TOC]</p>",M()),T()),Mr=Mr.replace(/(__special_katext_id_\d+__)/g,function(xi,gn){var On=En[gn],ui=On.type,ci=On.expression;return Object(re.renderToString)(An(ci)||"",{displayMode:ui==="block",throwOnError:!1,output:"html"})}),Mr=Mr.replace(/▁/g,"\u2581\u2581\u2581"),j(),ze){var Fr=document.createElement("div");return Fr.innerHTML=Mr,Fr.innerText}return setTimeout(function(){return on()},500),Mr},[Zr]),qr=Object(i.useRef)();y.WebkitLineClamp=pt,pt&&(Xt=Object(h.a)(Object(h.a)({},Xt),y));function Oi(Yr){var cr=Yr.target;if(cr.tagName.toUpperCase()==="IMG"){if(It){var en=cr.getAttribute("src");vr(en),li("image")}}else if(cr.tagName.toUpperCase()==="A"){var Mr=cr.getAttribute("href");if(Mr.indexOf("office")>-1)Yr.preventDefault(),vr(Mr),li("office");else if(Mr.indexOf("application/pdf")>-1)Yr.preventDefault(),vr(Mr),li("pdf");else if(Mr.indexOf("type=text")>-1)Yr.preventDefault(),vr(Mr),li("html");else if(Mr.startsWith("#")){Yr.preventDefault();var En=document.getElementById(Mr.replace("#",""));En&&En.scrollIntoView(!0)}}}var on=function(){var cr,en=(cr=qr.current)===null||cr===void 0?void 0:cr.querySelectorAll("video");en==null||en.forEach(function(Mr){if(Mr.oncontextmenu=function(){return!1},Mr.src.indexOf(".m3u8")>-1&&!Mr.canPlayType("application/vnd.apple.mpegurl")){if(K.a.isSupported()){var En=new K.a;En.loadSource(Mr.src),En.attachMedia(Mr)}}})};Object(i.useEffect)(function(){if(qr.current&&Fn&&(Fn.match(hn)&&window.PR.prettyPrint()),qr.current)return qr.current.addEventListener("click",Oi),function(){qr.current.removeEventListener("click",Oi),j(),T()}},[Fn,qr.current,Oi]);var Zn=function(cr){if(!me)return;cr.target.nodeName==="IMG"?(Zt.current.style.display="flex",Zt.current.style.width=cr.target.clientWidth+"px",Zt.current.style.height=cr.target.clientHeight+"px",Zt.current.style.top=cr.target.offsetTop+"px",Zt.current.style.left=cr.target.offsetLeft+"px",Hr.current.src=cr.target.getAttribute("src")):Zt.current.style.display="none"};return r.a.createElement("div",{style:{position:"relative"}},r.a.createElement("div",{ref:qr,style:Object(h.a)({},Xt),className:"".concat(ie||""," markdown-body ").concat(rn.a.mdBody),onMouseOver:Zn,dangerouslySetInnerHTML:{__html:Fn}}),r.a.createElement("div",{ref:Zt,className:rn.a.button},r.a.createElement(u.a,null,r.a.createElement(R.a,{onClick:function(){return Ki()}},"\u88C1\u526A"),r.a.createElement(R.a,{onClick:function(){return Ui()}},"\u7F16\u8F91"))),r.a.createElement("img",{ref:Hr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),r.a.createElement(ee.a,{close:!0,data:tr,hasMask:gt,type:tr!=null&&tr.length?mn:"",style:Object(h.a)({},an),onClose:function(){return vr("")}}))}},"9OqN":function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.mode.CTR=function(){var u=L.lib.BlockCipherMode.extend(),S=u.Encryptor=u.extend({processBlock:function(R,h){var o=this._cipher,C=o.blockSize,c=this._iv,a=this._counter;c&&(a=this._counter=c.slice(0),this._iv=void 0);var i=a.slice(0);o.encryptBlock(i,0),a[C-1]=a[C-1]+1|0;for(var r=0;r<C;r++)R[h+r]^=i[r]}});return u.Decryptor=S,u}(),L.mode.CTR})},"9VGf":function(I,J,P){"use strict";P.d(J,"a",function(){return S});var L=P("q1tI"),u=P.n(L);function S(R,h){var o=Object(L.useRef)();Object(L.useEffect)(function(){o.current=R}),Object(L.useEffect)(function(){function C(){o.current()}if(h!==null){var c=setInterval(C,h);return function(){return clearInterval(c)}}},[h])}},ALsQ:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.mode.CFB=function(){var u=L.lib.BlockCipherMode.extend();u.Encryptor=u.extend({processBlock:function(R,h){var o=this._cipher,C=o.blockSize;S.call(this,R,h,C,o),this._prevBlock=R.slice(h,h+C)}}),u.Decryptor=u.extend({processBlock:function(R,h){var o=this._cipher,C=o.blockSize,c=R.slice(h,h+C);S.call(this,R,h,C,o),this._prevBlock=c}});function S(R,h,o,C){var c,a=this._iv;a?(c=a.slice(0),this._iv=void 0):c=this._prevBlock,C.encryptBlock(c,0);for(var i=0;i<o;i++)R[h+i]^=c[i]}return u}(),L.mode.CFB})},B7Ph:function(I,J,P){"use strict";P.d(J,"a",function(){return k});var L=P("5NDa"),u=P("5rEg"),S=P("+L6B"),R=P("2/Rp"),h=P("2qtc"),o=P("kLXV"),C=P("k1fw"),c=P("miYZ"),a=P("tsqr"),i=P("9og8"),r=P("tJVT"),l=P("oBTY"),p=P("DZo9"),f=P("8z0m"),b=P("WmNS"),v=P.n(b),m=P("q1tI"),n=P.n(m),d=P("Bvq2"),g=P.n(d),T=P("nj2k"),y=P.n(T),s=P("mxV5"),M=P.n(s),A=P("KhGG"),x=P("ErOA"),E=P("7Cbv"),w=P("1vsH"),_=f.a.Dragger,N=function(H){for(var F=function(he){return he&&he.substring(0,he.lastIndexOf("."))},G=Object(l.a)(H),B=0,W=[],K=0;K<G.length;K++){for(var q="",re=0;re<W.length;re++)if(F(W[re][0].name)==F(G[K].name)){B=1,q=re;break}if(B==1)W[q].push(G[K]),B=0;else if(B==0){var ee=new Array;ee.push(G[K]),W.push(ee)}}var Ce=W.map(function(xe){if(xe[0].name.includes(".in"))return xe.length===2?xe:[xe[0],{}];if(xe[0].name.includes(".out"))return xe.length===2?xe.reverse():[{},xe[0]]});return Ce},j=function(H){var F=H.onClose,G=H.onOK,B=H.visible,W=H.wrapClassName,K=H.rootIdentifier,q=Object(m.useState)([]),re=Object(r.a)(q,2),ee=re[0],Ce=re[1],xe=Object(m.useState)({}),he=Object(r.a)(xe,2),ke=he[0],_e=he[1],de=Object(m.useState)(!1),ce=Object(r.a)(de,2),ae=ce[0],Se=ce[1],te=Object(m.useRef)([]),ue=Object(m.useRef)(0),Oe=function(){F()};Object(m.useEffect)(function(){le()},[]),Object(m.useEffect)(function(){B&&(te.current=[],ue.current=0,Ce([]))},[B]);var le=function(){var Qe=Object(i.a)(v.a.mark(function Ze(){var nt,tt;return v.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.prev=0,st.next=3,Object(x.a)("/api/buckets/get_upload_token_for_big_files",{method:"get"});case 3:nt=st.sent,tt=JSON.parse(Object(A.a)(nt.data)),_e(tt),st.next=11;break;case 8:st.prev=8,st.t0=st.catch(0),a.b.error(st.t0);case 11:case"end":return st.stop()}},Ze,null,[[0,8]])}));return function(){return Qe.apply(this,arguments)}}(),Q=function(Ze){return Ze&&Ze.substring(0,Ze.lastIndexOf("."))},Y=function(Ze){var nt,tt,lt=Q((nt=Ze[0])===null||nt===void 0?void 0:nt.name)||Q((tt=Ze[1])===null||tt===void 0?void 0:tt.name),st=ee.filter(function(je){return Q(je.name)!==lt});te.current=Object(l.a)(st),Ce(Object(l.a)(st))},Z=function(Ze){var nt=new M.a({endpoint:ke.end_point,region:ke.region,accessKeyId:ke.access_key_id,accessKeySecret:ke.access_key_secret,bucket:ke.bucket,stsToken:ke.security_token}),tt=Ze.name,lt={container_type:"TestSet",file_name:tt},st=Object(E.a)(),je="testsets/".concat(K,"/").concat(st).concat(tt.indexOf(".")>-1?"."+tt.split(".").pop():"");K===null&&(je="testsets/".concat(st).concat(tt.indexOf(".")>-1?"."+tt.split(".").pop():"")),nt.multipartUpload(je,new Blob([Ze.file],{type:Ze.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:tt+""},url:ke==null?void 0:ke.callback_url,host:ke==null?void 0:ke.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(x.e)(lt)}}).then(function(Re){if(Re.data.status===0){ue.current=ue.current+1;var et=te.current.map(function($e){var qe,Ue;if($e.name===((qe=Re.data)===null||qe===void 0||((Ue=qe.data)===null||Ue===void 0)?void 0:Ue.file_name)){var Me,Ie,ye,Te=Object(C.a)({},$e);if((Me=Re.data)!==null&&Me!==void 0&&(Ie=Me.data)!==null&&Ie!==void 0&&(ye=Ie.file_name)!==null&&ye!==void 0&&ye.includes(".in")){var Ae,Pe,Xe,rt,ft,St;Te.in_object_key=(Ae=Re.data)===null||Ae===void 0||((Pe=Ae.data)===null||Pe===void 0)?void 0:Pe.object,Te.in_object_size=(Xe=Re.data)===null||Xe===void 0||((rt=Xe.data)===null||rt===void 0)?void 0:rt.size,Te.input=(ft=Re.data)===null||ft===void 0||((St=ft.data)===null||St===void 0)?void 0:St.file_name,Te.in_file=Ze}else{var Pt,dt,At,Ot,bt,Vt;Te.out_object_key=(Pt=Re.data)===null||Pt===void 0||((dt=Pt.data)===null||dt===void 0)?void 0:dt.object,Te.out_object_size=(At=Re.data)===null||At===void 0||((Ot=At.data)===null||Ot===void 0)?void 0:Ot.size,Te.output=(bt=Re.data)===null||bt===void 0||((Vt=bt.data)===null||Vt===void 0)?void 0:Vt.file_name,Te.out_file=Ze}return Te}return $e});if(te.current=Object(l.a)(et),Ce(Object(l.a)(et)),ue.current>0&&ue.current===ee.length){Se(!1);var ct=N(et);ct=ct.filter(function($e){var qe,Ue;return!!((qe=$e[0])!==null&&qe!==void 0&&qe.name&&(Ue=$e[1])!==null&&Ue!==void 0&&Ue.name)}),ct=ct.map(function($e){return Object(C.a)(Object(C.a)(Object(C.a)({},$e[0]),$e[1]),{},{is_file:!0})}),G(ct),F()}}})},be=function(){if(ee.length===0){a.b.warn("\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6");return}Se(!0);var Ze=N(ee);if(Ze.some(function(nt){var tt,lt;return!((tt=nt[0])!==null&&tt!==void 0&&tt.name&&(lt=nt[1])!==null&<!==void 0&<.name)})){o.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u4E0A\u4F20\u7684\u6D4B\u8BD5\u7528\u4F8B\u4E2D\u5B58\u5728\u672A\u914D\u5BF9\u7684\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4EC5\u4FDD\u5B58\u5DF2\u914D\u5BF9\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF1F",onOk:function(){var nt=Object(i.a)(v.a.mark(function lt(){return v.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:ee.map(function(){var Re=Object(i.a)(v.a.mark(function et(ct){return v.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:Z(ct);case 1:case"end":return qe.stop()}},et)}));return function(et){return Re.apply(this,arguments)}}());case 1:case"end":return je.stop()}},lt)}));function tt(){return nt.apply(this,arguments)}return tt}(),onCancel:function(){Se(!1)}});return}ee.map(function(){var nt=Object(i.a)(v.a.mark(function tt(lt){return v.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:Z(lt);case 1:case"end":return je.stop()}},tt)}));return function(tt){return nt.apply(this,arguments)}}())},ge={name:"file",fileList:ee,multiple:!0,accept:".in, .out",showUploadList:!1,beforeUpload:function(Ze){if(ee!=null&&ee.some(function(tt){return tt.name===Ze.name}))return a.b.info("".concat(Ze.name,"\u6587\u4EF6\u5DF2\u5B58\u5728")),!1;if(Ze.size/1024/1024>100)return a.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(Ze.name))return a.b.warn("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;var nt={name:Ze.name,uid:Ze.uid,file:Ze,percent:0};return ee.push(nt),te.current=Object(l.a)(ee),Ce(Object(l.a)(ee)),!1}},De=N(ee);return console.log(ee,De,"fileList"),n.a.createElement(o.a,{visible:B,wrapClassName:W,onOk:be,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:ae},onCancel:Oe,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},n.a.createElement("div",{className:g.a.wrap},ee.length?n.a.createElement("div",null,n.a.createElement(f.a,ge,n.a.createElement(R.a,{className:g.a.btnS},"\u4E0A\u4F20\u6587\u4EF6")),n.a.createElement(k,{data:De,onRemove:Y})):n.a.createElement("div",{className:g.a.noData},n.a.createElement("img",{src:y.a,alt:""}),n.a.createElement(f.a,ge,n.a.createElement(R.a,{className:g.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),n.a.createElement("div",{className:g.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",n.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",n.a.createElement("br",null),"2\u3001\u8F93\u5165\u8F93\u51FA\u6587\u4EF6\u9700\u6587\u4EF6\u540D\u79F0\u4E00\u4E00\u5BF9\u5E94\uFF0C\u672A\u5BF9\u5E94\u65F6\uFF0C\u5C06\u65E0\u6CD5\u4E0A\u4F20\u3002",n.a.createElement("br",null),"3\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002")))},k=function(H){var F=H.data,G=F===void 0?[]:F,B=H.onRemove,W=H.width,K=W===void 0?"auto":W,q=H.showScore,re=q===void 0?!1:q,ee=H.disabled,Ce=ee===void 0?!1:ee,xe=H.inputChange,he=function(ce){var ae=document.createElement("a");document.body.appendChild(ae);var Se=URL.createObjectURL(ce.file);ae.href=Se,ae.download=ce.name,ae.click(),URL.revokeObjectURL(Se),document.body.removeChild(ae)},ke=function(ce,ae){Object(w.w)(ce,ae)},_e=function(ce,ae){o.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){B(ce,ae)},onCancel:function(){}})};return G.length?n.a.createElement("div",{style:{width:K}},n.a.createElement("div",{className:g.a.head},n.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),n.a.createElement("div",{style:{width:re?"25%":"35%"}},"\u8F93\u5165"),n.a.createElement("div",{style:{width:re?"25%":"35%"}},"\u8F93\u51FA"),re&&n.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),n.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),G.map(function(de,ce){var ae,Se,te,ue;return n.a.createElement("div",{key:ce,className:g.a.list},n.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",ce+1),n.a.createElement("div",{className:g.a.info,style:{width:re?"25%":"35%"}},n.a.createElement("span",{title:de.input||((ae=de[0])===null||ae===void 0?void 0:ae.name),onClick:function(){de.input?de.input_file_url?ke(de.input_file_url,de.input):he(de.in_file):he(de[0])}},de.input||((Se=de[0])===null||Se===void 0?void 0:Se.name))),n.a.createElement("div",{className:g.a.info,style:{width:re?"25%":"35%"}},n.a.createElement("span",{title:de.output||((te=de[1])===null||te===void 0?void 0:te.name),onClick:function(){de.input?de.output_file_url?ke(de.output_file_url,de.output):he(de.out_file):he(de[1])}},de.output||((ue=de[1])===null||ue===void 0?void 0:ue.name))),re&&n.a.createElement("div",{style:{width:"20%"}},n.a.createElement(u.a,{disabled:Ce,style:{width:"70%"},onChange:function(le){return xe(le,ce)},value:de.score}),n.a.createElement("span",null,"\xA0%")),n.a.createElement("div",{onClick:function(){return _e(de,ce)},style:{width:"10%"}},n.a.createElement("span",{className:g.a.del},"\u5220\u9664")))})):n.a.createElement(n.a.Fragment,null)};J.b=j},BU3w:function(I,J,P){"use strict";P.d(J,"a",function(){return o});var L=P("MNnm"),u="rc-util-key";function S(C){if(C.attachTo)return C.attachTo;var c=document.querySelector("head");return c||document.body}function R(C){var c,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(L.a)())return null;var i=document.createElement("style");if((c=a.csp)===null||c===void 0?void 0:c.nonce){var r;i.nonce=(r=a.csp)===null||r===void 0?void 0:r.nonce}i.innerHTML=C;var l=S(a),p=l.firstChild;return a.prepend&&l.prepend?l.prepend(i):a.prepend&&p?l.insertBefore(i,p):l.appendChild(i),i}var h=new Map;function o(C,c){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=S(a);if(!h.has(i)){var r=R("",a),l=r.parentNode;h.set(i,l),l.removeChild(r)}var p=Array.from(h.get(i).children).find(function(n){return n.tagName==="STYLE"&&n[u]===c});if(p){var f,b;if(((f=a.csp)===null||f===void 0?void 0:f.nonce)&&p.nonce!==((b=a.csp)===null||b===void 0?void 0:b.nonce)){var v;p.nonce=(v=a.csp)===null||v===void 0?void 0:v.nonce}return p.innerHTML!==C&&(p.innerHTML=C),p}var m=R(C,a);return m[u]=c,m}},Bd2K:function(I,J,P){(function(L){L(P("VrN/"),P("osHv"))})(function(L){L.defineOption("autoCloseTags",!1,function(a,i,r){if(r!=L.Init&&r&&a.removeKeyMap("autoCloseTags"),!i)return;var l={name:"autoCloseTags"};(typeof i!="object"||i.whenClosing!==!1)&&(l["'/'"]=function(p){return o(p)}),(typeof i!="object"||i.whenOpening!==!1)&&(l["'>'"]=function(p){return R(p)}),a.addKeyMap(l)});var u=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],S=["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 R(a){if(a.getOption("disableInput"))return L.Pass;for(var i=a.listSelections(),r=[],l=a.getOption("autoCloseTags"),p=0;p<i.length;p++){if(!i[p].empty())return L.Pass;var f=i[p].head,b=a.getTokenAt(f),v=L.innerMode(a.getMode(),b.state),m=v.state,n=v.mode.xmlCurrentTag&&v.mode.xmlCurrentTag(m),d=n&&n.name;if(!d)return L.Pass;var g=v.mode.configuration=="html",T=typeof l=="object"&&l.dontCloseTags||g&&u,y=typeof l=="object"&&l.indentTags||g&&S;b.end>f.ch&&(d=d.slice(0,d.length-b.end+f.ch));var s=d.toLowerCase();if(!d||b.type=="string"&&(b.end!=f.ch||!/[\"\']/.test(b.string.charAt(b.string.length-1))||b.string.length==1)||b.type=="tag"&&n.close||b.string.indexOf("/")==f.ch-b.start-1||T&&C(T,s)>-1||c(a,v.mode.xmlCurrentContext&&v.mode.xmlCurrentContext(m)||[],d,f,!0))return L.Pass;var M=typeof l=="object"&&l.emptyTags;if(M&&C(M,d)>-1){r[p]={text:"/>",newPos:L.Pos(f.line,f.ch+2)};continue}var A=y&&C(y,s)>-1;r[p]={indent:A,text:">"+(A?`
|
|
|
|
|
|
`:"")+"</"+d+">",newPos:A?L.Pos(f.line+1,0):L.Pos(f.line,f.ch+1)}}for(var x=typeof l=="object"&&l.dontIndentOnAutoClose,p=i.length-1;p>=0;p--){var E=r[p];a.replaceRange(E.text,i[p].head,i[p].anchor,"+insert");var w=a.listSelections().slice(0);w[p]={head:E.newPos,anchor:E.newPos},a.setSelections(w),!x&&E.indent&&(a.indentLine(E.newPos.line,null,!0),a.indentLine(E.newPos.line+1,null,!0))}}function h(a,i){for(var r=a.listSelections(),l=[],p=i?"/":"</",f=a.getOption("autoCloseTags"),b=typeof f=="object"&&f.dontIndentOnSlash,v=0;v<r.length;v++){if(!r[v].empty())return L.Pass;var m=r[v].head,n=a.getTokenAt(m),d=L.innerMode(a.getMode(),n.state),g=d.state;if(i&&(n.type=="string"||n.string.charAt(0)!="<"||n.start!=m.ch-1))return L.Pass;var T,y=d.mode.name!="xml"&&a.getMode().name=="htmlmixed";if(y&&d.mode.name=="javascript")T=p+"script";else if(y&&d.mode.name=="css")T=p+"style";else{var s=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(g);if(!s||s.length&&c(a,s,s[s.length-1],m))return L.Pass;T=p+s[s.length-1]}a.getLine(m.line).charAt(n.end)!=">"&&(T+=">"),l[v]=T}if(a.replaceSelections(l),r=a.listSelections(),!b)for(var v=0;v<r.length;v++)(v==r.length-1||r[v].head.line<r[v+1].head.line)&&a.indentLine(r[v].head.line)}function o(a){return a.getOption("disableInput")?L.Pass:h(a,!0)}L.commands.closeTag=function(a){return h(a)};function C(a,i){if(a.indexOf)return a.indexOf(i);for(var r=0,l=a.length;r<l;++r)if(a[r]==i)return r;return-1}function c(a,i,r,l,p){if(!L.scanForClosingTag)return!1;var f=Math.min(a.lastLine()+1,l.line+500),b=L.scanForClosingTag(a,l,null,f);if(!b||b.tag!=r)return!1;for(var v=p?1:0,m=i.length-1;m>=0&&i[m]==r;m--)++v;l=b.to;for(var m=1;m<v;m++){var n=L.scanForClosingTag(a,l,null,f);if(!n||n.tag!=r)return!1;l=n.to}return!0}})},BjJ7:function(I,J,P){"use strict";P.d(J,"d",function(){return u}),P.d(J,"c",function(){return S}),P.d(J,"e",function(){return R}),P.d(J,"b",function(){return h}),P.d(J,"a",function(){return C});var L=P("m3rI");function u(c){var a=!0;if(c.length>0){for(var i=0;i<c.length;i++)if(c[i].compile_success==0||!c[i].compile_success){a=!1;break}}else a=!1;return a}function S(c){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=[],r=0;r<c.length;r++){var l=c[r],p=a?"".concat(a,"/").concat(l.name):"".concat(l.name);i.push({title:l.name,isLeaf:!(l.type==="tree"),key:p})}return i}function R(c,a,i){for(var r=0;r<c.length;r++){var l=c[r];if(l.key===a){l.children=i;break}l.children&&R(l.children,a,i)}return c}function h(c,a,i){var r;return function(){var l=this,p=arguments,f=function(){r=null,i||c.apply(l,p)},b=i&&!r;clearTimeout(r),r=setTimeout(f,a),b&&c.apply(l,p)}}var o=!0,C=L.a.API_SERVER},Bvq2:function(I,J,P){I.exports={wrap:"wrap___2zRY4",colorBlue:"colorBlue___XalpT",repeatedName:"repeatedName___2Tfh4",text:"text___1sYHg",noData:"noData___3pdB4",btn:"btn___3WWjB",btnS:"btnS___2M_9t",head:"head____NWmz",list:"list___2fE4M",del:"del___2BO6Y",info:"info___3GJ70"}},"C+DQ":function(I,J,P){},CrYA:function(I,J,P){var L=P("MFOe"),u=L.Global;I.exports={name:"sessionStorage",read:R,write:h,each:o,remove:C,clearAll:c};function S(){return u.sessionStorage}function R(a){return S().getItem(a)}function h(a,i){return S().setItem(a,i)}function o(a){for(var i=S().length-1;i>=0;i--){var r=S().key(i);a(R(r),r)}}function C(a){return S().removeItem(a)}function c(){return S().clear()}},D1Df:function(I,J,P){"use strict";function L(k){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?L=function(H){return typeof H}:L=function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},L(k)}function u(){return u=Object.assign||function(k){for(var z=1;z<arguments.length;z++){var H=arguments[z];for(var F in H)Object.prototype.hasOwnProperty.call(H,F)&&(k[F]=H[F])}return k},u.apply(this,arguments)}function S(k,z){var H=Object.keys(k);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(k);z&&(F=F.filter(function(G){return Object.getOwnPropertyDescriptor(k,G).enumerable})),H.push.apply(H,F)}return H}function R(k){for(var z=1;z<arguments.length;z++){var H=arguments[z]!=null?arguments[z]:{};z%2?S(H,!0).forEach(function(F){b(k,F,H[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(H)):S(H).forEach(function(F){Object.defineProperty(k,F,Object.getOwnPropertyDescriptor(H,F))})}return k}function h(k,z){if(k==null)return{};var H=o(k,z),F,G;if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(k);for(G=0;G<B.length;G++){if(F=B[G],z.indexOf(F)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(k,F))continue;H[F]=k[F]}}return H}function o(k,z){if(k==null)return{};var H={},F=Object.keys(k),G,B;for(B=0;B<F.length;B++){if(G=F[B],z.indexOf(G)>=0)continue;H[G]=k[G]}return H}function C(k,z){if(!(k instanceof z))throw new TypeError("Cannot call a class as a function")}function c(k,z){for(var H=0;H<z.length;H++){var F=z[H];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(k,F.key,F)}}function a(k,z,H){return z&&c(k.prototype,z),H&&c(k,H),k}function i(k,z){return z&&(L(z)==="object"||typeof z=="function")?z:l(k)}function r(k){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(H){return H.__proto__||Object.getPrototypeOf(H)},r(k)}function l(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function p(k,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(z&&z.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),z&&f(k,z)}function f(k,z){return f=Object.setPrototypeOf||function(F,G){return F.__proto__=G,F},f(k,z)}function b(k,z,H){return z in k?Object.defineProperty(k,z,{value:H,enumerable:!0,configurable:!0,writable:!0}):k[z]=H,k}var v=P("q1tI"),m=P("17x9"),n=P("H38U"),d=P("aRTE");function g(k){for(var z="",H=0;H<k.length;H++){var F=k.charCodeAt(H);F<128?z+=String.fromCharCode(F):F<2048?(z+=String.fromCharCode(192|F>>6),z+=String.fromCharCode(128|F&63)):F<55296||F>=57344?(z+=String.fromCharCode(224|F>>12),z+=String.fromCharCode(128|F>>6&63),z+=String.fromCharCode(128|F&63)):(H++,F=65536+((F&1023)<<10|k.charCodeAt(H)&1023),z+=String.fromCharCode(240|F>>18),z+=String.fromCharCode(128|F>>12&63),z+=String.fromCharCode(128|F>>6&63),z+=String.fromCharCode(128|F&63))}return z}var T={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},y={},s=4,M=.1;function A(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,H=[];return k.forEach(function(F,G){var B=null;F.forEach(function(W,K){if(!W&&B!==null){H.push("M".concat(B+z," ").concat(G+z,"h").concat(K-B,"v1H").concat(B+z,"z")),B=null;return}if(K===F.length-1){if(!W)return;B===null?H.push("M".concat(K+z,",").concat(G+z," h1v1H").concat(K+z,"z")):H.push("M".concat(B+z,",").concat(G+z," h").concat(K+1-B,"v1H").concat(B+z,"z"));return}W&&B===null&&(B=K)})}),H.join("")}function x(k,z){return k.slice().map(function(H,F){return F<z.y||F>=z.y+z.h?H:H.map(function(G,B){return B<z.x||B>=z.x+z.w?G:!1})})}function E(k,z){var H=k.imageSettings,F=k.size,G=k.includeMargin;if(H==null)return null;var B=G?s:0,W=z.length+B*2,K=Math.floor(F*M),q=W/F,re=(H.width||K)*q,ee=(H.height||K)*q,Ce=H.x==null?z.length/2-re/2:H.x*q,xe=H.y==null?z.length/2-ee/2:H.y*q,he=null;if(H.excavate){var ke=Math.floor(Ce),_e=Math.floor(xe),de=Math.ceil(re+Ce-ke),ce=Math.ceil(ee+xe-_e);he={x:ke,y:_e,w:de,h:ce}}return{x:Ce,y:xe,h:ee,w:re,excavation:he}}var w=function(){try{new Path2D().addPath(new Path2D)}catch(k){return!1}return!0}(),_=function(k){p(z,k);function z(){var H,F;C(this,z);for(var G=arguments.length,B=new Array(G),W=0;W<G;W++)B[W]=arguments[W];return F=i(this,(H=r(z)).call.apply(H,[this].concat(B))),b(l(F),"_canvas",void 0),b(l(F),"_image",void 0),b(l(F),"state",{imgLoaded:!1}),b(l(F),"handleImageLoad",function(){F.setState({imgLoaded:!0})}),F}return a(z,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var F=this.props,G=F.value,B=F.size,W=F.level,K=F.bgColor,q=F.fgColor,re=F.includeMargin,ee=F.imageSettings,Ce=new n(-1,d[W]);if(Ce.addData(g(G)),Ce.make(),this._canvas!=null){var xe=this._canvas,he=xe.getContext("2d");if(!he)return;var ke=Ce.modules;if(ke===null)return;var _e=re?s:0,de=ke.length+_e*2,ce=E(this.props,ke);ee!=null&&ce!=null&&(ce.excavation!=null&&(ke=x(ke,ce.excavation)));var ae=window.devicePixelRatio||1;xe.height=xe.width=B*ae;var Se=B/de*ae;he.scale(Se,Se),he.fillStyle=K,he.fillRect(0,0,de,de),he.fillStyle=q,w?he.fill(new Path2D(A(ke,_e))):ke.forEach(function(te,ue){te.forEach(function(Oe,le){Oe&&he.fillRect(le+_e,ue+_e,1,1)})}),this.state.imgLoaded&&this._image&&ce!=null&&he.drawImage(this._image,ce.x+_e,ce.y+_e,ce.w,ce.h)}}},{key:"render",value:function(){var F=this,G=this.props,B=G.value,W=G.size,K=G.level,q=G.bgColor,re=G.fgColor,ee=G.style,Ce=G.includeMargin,xe=G.imageSettings,he=h(G,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),ke=R({height:W,width:W},ee),_e=null,de=xe&&xe.src;return xe!=null&&de!=null&&(_e=v.createElement("img",{src:de,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(ae){return F._image=ae}})),v.createElement(v.Fragment,null,v.createElement("canvas",u({style:ke,height:W,width:W,ref:function(ae){return F._canvas=ae}},he)),_e)}}]),z}(v.PureComponent);b(_,"defaultProps",T);var N=function(k){p(z,k);function z(){return C(this,z),i(this,r(z).apply(this,arguments))}return a(z,[{key:"render",value:function(){var F=this.props,G=F.value,B=F.size,W=F.level,K=F.bgColor,q=F.fgColor,re=F.includeMargin,ee=F.imageSettings,Ce=h(F,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),xe=new n(-1,d[W]);xe.addData(g(G)),xe.make();var he=xe.modules;if(he===null)return null;var ke=re?s:0,_e=he.length+ke*2,de=E(this.props,he),ce=null;ee!=null&&de!=null&&(de.excavation!=null&&(he=x(he,de.excavation)),ce=v.createElement("image",{xlinkHref:ee.src,height:de.h,width:de.w,x:de.x+ke,y:de.y+ke,preserveAspectRatio:"none"}));var ae=A(he,ke);return v.createElement("svg",u({shapeRendering:"crispEdges",height:B,width:B,viewBox:"0 0 ".concat(_e," ").concat(_e)},Ce),v.createElement("path",{fill:K,d:"M0,0 h".concat(_e,"v").concat(_e,"H0z")}),v.createElement("path",{fill:q,d:ae}),ce)}}]),z}(v.PureComponent);b(N,"defaultProps",T);var j=function(z){var H=z.renderAs,F=h(z,["renderAs"]),G=H==="svg"?N:_;return v.createElement(G,F)};j.defaultProps=R({renderAs:"canvas"},T),I.exports=j},DlQD:function(I,J,P){(function(L,u){I.exports=u()})(this,function(){"use strict";function L(Ue,Me){for(var Ie=0;Ie<Me.length;Ie++){var ye=Me[Ie];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(Ue,ye.key,ye)}}function u(Ue,Me,Ie){return Me&&L(Ue.prototype,Me),Ie&&L(Ue,Ie),Ue}function S(Ue,Me){if(!Ue)return;if(typeof Ue=="string")return R(Ue,Me);var Ie=Object.prototype.toString.call(Ue).slice(8,-1);if(Ie==="Object"&&Ue.constructor&&(Ie=Ue.constructor.name),Ie==="Map"||Ie==="Set")return Array.from(Ue);if(Ie==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ie))return R(Ue,Me)}function R(Ue,Me){(Me==null||Me>Ue.length)&&(Me=Ue.length);for(var Ie=0,ye=new Array(Me);Ie<Me;Ie++)ye[Ie]=Ue[Ie];return ye}function h(Ue,Me){var Ie;if(typeof Symbol=="undefined"||Ue[Symbol.iterator]==null){if(Array.isArray(Ue)||(Ie=S(Ue))||Me&&Ue&&typeof Ue.length=="number"){Ie&&(Ue=Ie);var ye=0;return function(){return ye>=Ue.length?{done:!0}:{done:!1,value:Ue[ye++]}}}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 Ie=Ue[Symbol.iterator](),Ie.next.bind(Ie)}function o(Ue,Me){return Me={exports:{}},Ue(Me,Me.exports),Me.exports}var C=o(function(Ue){function Me(){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 Ie(ye){Ue.exports.defaults=ye}Ue.exports={defaults:Me(),getDefaults:Me,changeDefaults:Ie}}),c=C.defaults,a=C.getDefaults,i=C.changeDefaults,r=/[&<>"']/,l=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,f=/[<>"']|&(?!#?\w+;)/g,b={"&":"&","<":"<",">":">",'"':""","'":"'"},v=function(Me){return b[Me]};function m(Ue,Me){if(Me){if(r.test(Ue))return Ue.replace(l,v)}else if(p.test(Ue))return Ue.replace(f,v);return Ue}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function d(Ue){return Ue.replace(n,function(Me,Ie){return Ie=Ie.toLowerCase(),Ie==="colon"?":":Ie.charAt(0)==="#"?Ie.charAt(1)==="x"?String.fromCharCode(parseInt(Ie.substring(2),16)):String.fromCharCode(+Ie.substring(1)):""})}var g=/(^|[^\[])\^/g;function T(Ue,Me){Ue=Ue.source||Ue,Me=Me||"";var Ie={replace:function(Te,Ae){return Ae=Ae.source||Ae,Ae=Ae.replace(g,"$1"),Ue=Ue.replace(Te,Ae),Ie},getRegex:function(){return new RegExp(Ue,Me)}};return Ie}var y=/[^\w:]/g,s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function M(Ue,Me,Ie){if(Ue){var ye;try{ye=decodeURIComponent(d(Ie)).replace(y,"").toLowerCase()}catch(Te){return null}if(ye.indexOf("javascript:")===0||ye.indexOf("vbscript:")===0||ye.indexOf("data:")===0)return null}Me&&!s.test(Ie)&&(Ie=_(Me,Ie));try{Ie=encodeURI(Ie).replace(/%25/g,"%")}catch(Te){return null}return Ie}var A={},x=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,w=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(Ue,Me){A[" "+Ue]||(x.test(Ue)?A[" "+Ue]=Ue+"/":A[" "+Ue]=z(Ue,"/",!0)),Ue=A[" "+Ue];var Ie=Ue.indexOf(":")===-1;return Me.substring(0,2)==="//"?Ie?Me:Ue.replace(E,"$1")+Me:Me.charAt(0)==="/"?Ie?Me:Ue.replace(w,"$1")+Me:Ue+Me}var N={exec:function(){}};function j(Ue){for(var Me=1,Ie,ye;Me<arguments.length;Me++){Ie=arguments[Me];for(ye in Ie)Object.prototype.hasOwnProperty.call(Ie,ye)&&(Ue[ye]=Ie[ye])}return Ue}function k(Ue,Me){var Ie=Ue.replace(/\|/g,function(Ae,Pe,Xe){for(var rt=!1,ft=Pe;--ft>=0&&Xe[ft]==="\\";)rt=!rt;return rt?"|":" |"}),ye=Ie.split(/ \|/),Te=0;if(ye.length>Me)ye.splice(Me);else for(;ye.length<Me;)ye.push("");for(;Te<ye.length;Te++)ye[Te]=ye[Te].trim().replace(/\\\|/g,"|");return ye}function z(Ue,Me,Ie){var ye=Ue.length;if(ye===0)return"";for(var Te=0;Te<ye;){var Ae=Ue.charAt(ye-Te-1);if(Ae===Me&&!Ie)Te++;else if(Ae!==Me&&Ie)Te++;else break}return Ue.substr(0,ye-Te)}function H(Ue,Me){if(Ue.indexOf(Me[1])===-1)return-1;for(var Ie=Ue.length,ye=0,Te=0;Te<Ie;Te++)if(Ue[Te]==="\\")Te++;else if(Ue[Te]===Me[0])ye++;else if(Ue[Te]===Me[1]&&(ye--,ye<0))return Te;return-1}function F(Ue){Ue&&Ue.sanitize&&!Ue.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var G={escape:m,unescape:d,edit:T,cleanUrl:M,resolveUrl:_,noopTest:N,merge:j,splitCells:k,rtrim:z,findClosingBracket:H,checkSanitizeDeprecation:F},B=C.defaults,W=G.rtrim,K=G.splitCells,q=G.escape,re=G.findClosingBracket;function ee(Ue,Me,Ie){var ye=Me.href,Te=Me.title?q(Me.title):null,Ae=Ue[1].replace(/\\([\[\]])/g,"$1");return Ue[0].charAt(0)!=="!"?{type:"link",raw:Ie,href:ye,title:Te,text:Ae}:{type:"image",raw:Ie,href:ye,title:Te,text:q(Ae)}}function Ce(Ue,Me){var Ie=Ue.match(/^(\s+)(?:```)/);if(Ie===null)return Me;var ye=Ie[1];return Me.split(`
|
|
|
`).map(function(Te){var Ae=Te.match(/^\s+/);if(Ae===null)return Te;var Pe=Ae[0];return Pe.length>=ye.length?Te.slice(ye.length):Te}).join(`
|
|
|
`)}var xe=function(){function Ue(Ie){this.options=Ie||B}var Me=Ue.prototype;return Me.space=function(ye){var Te=this.rules.block.newline.exec(ye);if(Te)return Te[0].length>1?{type:"space",raw:Te[0]}:{raw:`
|
|
|
`}},Me.code=function(ye,Te){var Ae=this.rules.block.code.exec(ye);if(Ae){var Pe=Te[Te.length-1];if(Pe&&Pe.type==="paragraph")return{raw:Ae[0],text:Ae[0].trimRight()};var Xe=Ae[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ae[0],codeBlockStyle:"indented",text:this.options.pedantic?Xe:W(Xe,`
|
|
|
`)}}},Me.fences=function(ye){var Te=this.rules.block.fences.exec(ye);if(Te){var Ae=Te[0],Pe=Ce(Ae,Te[3]||"");return{type:"code",raw:Ae,lang:Te[2]?Te[2].trim():Te[2],text:Pe}}},Me.heading=function(ye){var Te=this.rules.block.heading.exec(ye);if(Te)return{type:"heading",raw:Te[0],depth:Te[1].length,text:Te[2]}},Me.nptable=function(ye){var Te=this.rules.block.nptable.exec(ye);if(Te){var Ae={type:"table",header:K(Te[1].replace(/^ *| *\| *$/g,"")),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Te[3]?Te[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:Te[0]};if(Ae.header.length===Ae.align.length){var Pe=Ae.align.length,Xe;for(Xe=0;Xe<Pe;Xe++)/^ *-+: *$/.test(Ae.align[Xe])?Ae.align[Xe]="right":/^ *:-+: *$/.test(Ae.align[Xe])?Ae.align[Xe]="center":/^ *:-+ *$/.test(Ae.align[Xe])?Ae.align[Xe]="left":Ae.align[Xe]=null;for(Pe=Ae.cells.length,Xe=0;Xe<Pe;Xe++)Ae.cells[Xe]=K(Ae.cells[Xe],Ae.header.length);return Ae}}},Me.hr=function(ye){var Te=this.rules.block.hr.exec(ye);if(Te)return{type:"hr",raw:Te[0]}},Me.blockquote=function(ye){var Te=this.rules.block.blockquote.exec(ye);if(Te){var Ae=Te[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Te[0],text:Ae}}},Me.list=function(ye){var Te=this.rules.block.list.exec(ye);if(Te){for(var Ae=Te[0],Pe=Te[2],Xe=Pe.length>1,rt=Pe[Pe.length-1]===")",ft={type:"list",raw:Ae,ordered:Xe,start:Xe?+Pe.slice(0,-1):"",loose:!1,items:[]},St=Te[0].match(this.rules.block.item),Pt=!1,dt,At,Ot,bt,Vt,ir,Qt,dr=St.length,Nt=0;Nt<dr;Nt++)dt=St[Nt],Ae=dt,At=dt.length,dt=dt.replace(/^ *([*+-]|\d+[.)]) */,""),~dt.indexOf(`
|
|
|
`)&&(At-=dt.length,dt=this.options.pedantic?dt.replace(/^ {1,4}/gm,""):dt.replace(new RegExp("^ {1,"+At+"}","gm"),"")),Nt!==dr-1&&(Ot=this.rules.block.bullet.exec(St[Nt+1])[0],(Xe?Ot.length===1||!rt&&Ot[Ot.length-1]===")":Ot.length>1||this.options.smartLists&&Ot!==Pe)&&(bt=St.slice(Nt+1).join(`
|
|
|
`),ft.raw=ft.raw.substring(0,ft.raw.length-bt.length),Nt=dr-1)),Vt=Pt||/\n\n(?!\s*$)/.test(dt),Nt!==dr-1&&(Pt=dt.charAt(dt.length-1)===`
|
|
|
`,Vt||(Vt=Pt)),Vt&&(ft.loose=!0),ir=/^\[[ xX]\] /.test(dt),Qt=void 0,ir&&(Qt=dt[1]!==" ",dt=dt.replace(/^\[[ xX]\] +/,"")),ft.items.push({type:"list_item",raw:Ae,task:ir,checked:Qt,loose:Vt,text:dt});return ft}},Me.html=function(ye){var Te=this.rules.block.html.exec(ye);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]):q(Te[0]):Te[0]}},Me.def=function(ye){var Te=this.rules.block.def.exec(ye);if(Te){Te[3]&&(Te[3]=Te[3].substring(1,Te[3].length-1));var Ae=Te[1].toLowerCase().replace(/\s+/g," ");return{tag:Ae,raw:Te[0],href:Te[2],title:Te[3]}}},Me.table=function(ye){var Te=this.rules.block.table.exec(ye);if(Te){var Ae={type:"table",header:K(Te[1].replace(/^ *| *\| *$/g,"")),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Te[3]?Te[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(Ae.header.length===Ae.align.length){Ae.raw=Te[0];var Pe=Ae.align.length,Xe;for(Xe=0;Xe<Pe;Xe++)/^ *-+: *$/.test(Ae.align[Xe])?Ae.align[Xe]="right":/^ *:-+: *$/.test(Ae.align[Xe])?Ae.align[Xe]="center":/^ *:-+ *$/.test(Ae.align[Xe])?Ae.align[Xe]="left":Ae.align[Xe]=null;for(Pe=Ae.cells.length,Xe=0;Xe<Pe;Xe++)Ae.cells[Xe]=K(Ae.cells[Xe].replace(/^ *\| *| *\| *$/g,""),Ae.header.length);return Ae}}},Me.lheading=function(ye){var Te=this.rules.block.lheading.exec(ye);if(Te)return{type:"heading",raw:Te[0],depth:Te[2].charAt(0)==="="?1:2,text:Te[1]}},Me.paragraph=function(ye){var Te=this.rules.block.paragraph.exec(ye);if(Te)return{type:"paragraph",raw:Te[0],text:Te[1].charAt(Te[1].length-1)===`
|
|
|
`?Te[1].slice(0,-1):Te[1]}},Me.text=function(ye,Te){var Ae=this.rules.block.text.exec(ye);if(Ae){var Pe=Te[Te.length-1];return Pe&&Pe.type==="text"?{raw:Ae[0],text:Ae[0]}:{type:"text",raw:Ae[0],text:Ae[0]}}},Me.escape=function(ye){var Te=this.rules.inline.escape.exec(ye);if(Te)return{type:"escape",raw:Te[0],text:q(Te[1])}},Me.tag=function(ye,Te,Ae){var Pe=this.rules.inline.tag.exec(ye);if(Pe)return!Te&&/^<a /i.test(Pe[0])?Te=!0:Te&&/^<\/a>/i.test(Pe[0])&&(Te=!1),!Ae&&/^<(pre|code|kbd|script)(\s|>)/i.test(Pe[0])?Ae=!0:Ae&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Pe[0])&&(Ae=!1),{type:this.options.sanitize?"text":"html",raw:Pe[0],inLink:Te,inRawBlock:Ae,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Pe[0]):q(Pe[0]):Pe[0]}},Me.link=function(ye){var Te=this.rules.inline.link.exec(ye);if(Te){var Ae=re(Te[2],"()");if(Ae>-1){var Pe=Te[0].indexOf("!")===0?5:4,Xe=Pe+Te[1].length+Ae;Te[2]=Te[2].substring(0,Ae),Te[0]=Te[0].substring(0,Xe).trim(),Te[3]=""}var rt=Te[2],ft="";if(this.options.pedantic){var St=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(rt);St?(rt=St[1],ft=St[3]):ft=""}else ft=Te[3]?Te[3].slice(1,-1):"";rt=rt.trim().replace(/^<([\s\S]*)>$/,"$1");var Pt=ee(Te,{href:rt&&rt.replace(this.rules.inline._escapes,"$1"),title:ft&&ft.replace(this.rules.inline._escapes,"$1")},Te[0]);return Pt}},Me.reflink=function(ye,Te){var Ae;if((Ae=this.rules.inline.reflink.exec(ye))||(Ae=this.rules.inline.nolink.exec(ye))){var Pe=(Ae[2]||Ae[1]).replace(/\s+/g," ");if(Pe=Te[Pe.toLowerCase()],!Pe||!Pe.href){var Xe=Ae[0].charAt(0);return{type:"text",raw:Xe,text:Xe}}var rt=ee(Ae,Pe,Ae[0]);return rt}},Me.strong=function(ye,Te,Ae){Ae===void 0&&(Ae="");var Pe=this.rules.inline.strong.start.exec(ye);if(Pe&&(!Pe[1]||Pe[1]&&(Ae===""||this.rules.inline.punctuation.exec(Ae)))){Te=Te.slice(-1*ye.length);var Xe=Pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Xe.lastIndex=0;for(var rt;(Pe=Xe.exec(Te))!=null;)if(rt=this.rules.inline.strong.middle.exec(Te.slice(0,Pe.index+3)),rt)return{type:"strong",raw:ye.slice(0,rt[0].length),text:ye.slice(2,rt[0].length-2)}}},Me.em=function(ye,Te,Ae){Ae===void 0&&(Ae="");var Pe=this.rules.inline.em.start.exec(ye);if(Pe&&(!Pe[1]||Pe[1]&&(Ae===""||this.rules.inline.punctuation.exec(Ae)))){Te=Te.slice(-1*ye.length);var Xe=Pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Xe.lastIndex=0;for(var rt;(Pe=Xe.exec(Te))!=null;)if(rt=this.rules.inline.em.middle.exec(Te.slice(0,Pe.index+2)),rt)return{type:"em",raw:ye.slice(0,rt[0].length),text:ye.slice(1,rt[0].length-1)}}},Me.codespan=function(ye){var Te=this.rules.inline.code.exec(ye);if(Te){var Ae=Te[2].replace(/\n/g," "),Pe=/[^ ]/.test(Ae),Xe=Ae.startsWith(" ")&&Ae.endsWith(" ");return Pe&&Xe&&(Ae=Ae.substring(1,Ae.length-1)),Ae=q(Ae,!0),{type:"codespan",raw:Te[0],text:Ae}}},Me.br=function(ye){var Te=this.rules.inline.br.exec(ye);if(Te)return{type:"br",raw:Te[0]}},Me.del=function(ye){var Te=this.rules.inline.del.exec(ye);if(Te)return{type:"del",raw:Te[0],text:Te[1]}},Me.autolink=function(ye,Te){var Ae=this.rules.inline.autolink.exec(ye);if(Ae){var Pe,Xe;return Ae[2]==="@"?(Pe=q(this.options.mangle?Te(Ae[1]):Ae[1]),Xe="mailto:"+Pe):(Pe=q(Ae[1]),Xe=Pe),{type:"link",raw:Ae[0],text:Pe,href:Xe,tokens:[{type:"text",raw:Pe,text:Pe}]}}},Me.url=function(ye,Te){var Ae;if(Ae=this.rules.inline.url.exec(ye)){var Pe,Xe;if(Ae[2]==="@")Pe=q(this.options.mangle?Te(Ae[0]):Ae[0]),Xe="mailto:"+Pe;else{var rt;do rt=Ae[0],Ae[0]=this.rules.inline._backpedal.exec(Ae[0])[0];while(rt!==Ae[0]);Pe=q(Ae[0]),Ae[1]==="www."?Xe="http://"+Pe:Xe=Pe}return{type:"link",raw:Ae[0],text:Pe,href:Xe,tokens:[{type:"text",raw:Pe,text:Pe}]}}},Me.inlineText=function(ye,Te,Ae){var Pe=this.rules.inline.text.exec(ye);if(Pe){var Xe;return Te?Xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Pe[0]):q(Pe[0]):Pe[0]:Xe=q(this.options.smartypants?Ae(Pe[0]):Pe[0]),{type:"text",raw:Pe[0],text:Xe}}},Ue}(),he=G.noopTest,ke=G.edit,_e=G.merge,de={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:he,table:he,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};de._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,de._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,de.def=ke(de.def).replace("label",de._label).replace("title",de._title).getRegex(),de.bullet=/(?:[*+-]|\d{1,9}[.)])/,de.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,de.item=ke(de.item,"gm").replace(/bull/g,de.bullet).getRegex(),de.list=ke(de.list).replace(/bull/g,de.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+de.def.source+")").getRegex(),de._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",de._comment=/<!--(?!-?>)[\s\S]*?-->/,de.html=ke(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de.paragraph=ke(de._paragraph).replace("hr",de.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",de._tag).getRegex(),de.blockquote=ke(de.blockquote).replace("paragraph",de.paragraph).getRegex(),de.normal=_e({},de),de.gfm=_e({},de.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*|$)"}),de.gfm.nptable=ke(de.gfm.nptable).replace("hr",de.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",de._tag).getRegex(),de.gfm.table=ke(de.gfm.table).replace("hr",de.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",de._tag).getRegex(),de.pedantic=_e({},de.normal,{html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",de._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:he,paragraph:ke(de.normal._paragraph).replace("hr",de.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",de.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:he,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:he,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ce.punctuation=ke(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=ke(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=ke(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=ke(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=ke(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=ke(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=ke(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=ke(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=ke(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=ke(ce._blockSkip,"g").getRegex(),ce.overlapSkip=ke(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=ke(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=ke(ce.tag).replace("comment",de._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=ke(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=ke(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=ke(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=_e({},ce),ce.pedantic=_e({},ce.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:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=_e({},ce.normal,{escape:ke(ce.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ce.gfm.url=ke(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=_e({},ce.gfm,{br:ke(ce.br).replace("{2,}","*").getRegex(),text:ke(ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ae={block:de,inline:ce},Se=C.defaults,te=ae.block,ue=ae.inline;function Oe(Ue){return Ue.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function le(Ue){var Me="",Ie,ye,Te=Ue.length;for(Ie=0;Ie<Te;Ie++)ye=Ue.charCodeAt(Ie),Math.random()>.5&&(ye="x"+ye.toString(16)),Me+="&#"+ye+";";return Me}var Q=function(){function Ue(Ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ie||Se,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ye={block:te.normal,inline:ue.normal};this.options.pedantic?(ye.block=te.pedantic,ye.inline=ue.pedantic):this.options.gfm&&(ye.block=te.gfm,this.options.breaks?ye.inline=ue.breaks:ye.inline=ue.gfm),this.tokenizer.rules=ye}Ue.lex=function(ye,Te){var Ae=new Ue(Te);return Ae.lex(ye)};var Me=Ue.prototype;return Me.lex=function(ye){return ye=ye.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(ye,this.tokens,!0),this.inline(this.tokens),this.tokens},Me.blockTokens=function(ye,Te,Ae){Te===void 0&&(Te=[]),Ae===void 0&&(Ae=!0),ye=ye.replace(/^ +$/gm,"");for(var Pe,Xe,rt,ft;ye;){if(Pe=this.tokenizer.space(ye)){ye=ye.substring(Pe.raw.length),Pe.type&&Te.push(Pe);continue}if(Pe=this.tokenizer.code(ye,Te)){ye=ye.substring(Pe.raw.length),Pe.type?Te.push(Pe):(ft=Te[Te.length-1],ft.raw+=`
|
|
|
`+Pe.raw,ft.text+=`
|
|
|
`+Pe.text);continue}if(Pe=this.tokenizer.fences(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.heading(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.nptable(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.hr(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.blockquote(ye)){ye=ye.substring(Pe.raw.length),Pe.tokens=this.blockTokens(Pe.text,[],Ae),Te.push(Pe);continue}if(Pe=this.tokenizer.list(ye)){for(ye=ye.substring(Pe.raw.length),rt=Pe.items.length,Xe=0;Xe<rt;Xe++)Pe.items[Xe].tokens=this.blockTokens(Pe.items[Xe].text,[],!1);Te.push(Pe);continue}if(Pe=this.tokenizer.html(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Ae&&(Pe=this.tokenizer.def(ye))){ye=ye.substring(Pe.raw.length),this.tokens.links[Pe.tag]||(this.tokens.links[Pe.tag]={href:Pe.href,title:Pe.title});continue}if(Pe=this.tokenizer.table(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.lheading(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Ae&&(Pe=this.tokenizer.paragraph(ye))){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.text(ye,Te)){ye=ye.substring(Pe.raw.length),Pe.type?Te.push(Pe):(ft=Te[Te.length-1],ft.raw+=`
|
|
|
`+Pe.raw,ft.text+=`
|
|
|
`+Pe.text);continue}if(ye){var St="Infinite loop on byte: "+ye.charCodeAt(0);if(this.options.silent){console.error(St);break}else throw new Error(St)}}return Te},Me.inline=function(ye){var Te,Ae,Pe,Xe,rt,ft,St=ye.length;for(Te=0;Te<St;Te++){ft=ye[Te];switch(ft.type){case"paragraph":case"text":case"heading":{ft.tokens=[],this.inlineTokens(ft.text,ft.tokens);break}case"table":{for(ft.tokens={header:[],cells:[]},Xe=ft.header.length,Ae=0;Ae<Xe;Ae++)ft.tokens.header[Ae]=[],this.inlineTokens(ft.header[Ae],ft.tokens.header[Ae]);for(Xe=ft.cells.length,Ae=0;Ae<Xe;Ae++)for(rt=ft.cells[Ae],ft.tokens.cells[Ae]=[],Pe=0;Pe<rt.length;Pe++)ft.tokens.cells[Ae][Pe]=[],this.inlineTokens(rt[Pe],ft.tokens.cells[Ae][Pe]);break}case"blockquote":{this.inline(ft.tokens);break}case"list":{for(Xe=ft.items.length,Ae=0;Ae<Xe;Ae++)this.inline(ft.items[Ae].tokens);break}}}return ye},Me.inlineTokens=function(ye,Te,Ae,Pe,Xe){Te===void 0&&(Te=[]),Ae===void 0&&(Ae=!1),Pe===void 0&&(Pe=!1),Xe===void 0&&(Xe="");var rt,ft=ye,St;if(this.tokens.links){var Pt=Object.keys(this.tokens.links);if(Pt.length>0)for(;(St=this.tokenizer.rules.inline.reflinkSearch.exec(ft))!=null;)Pt.includes(St[0].slice(St[0].lastIndexOf("[")+1,-1))&&(ft=ft.slice(0,St.index)+"["+"a".repeat(St[0].length-2)+"]"+ft.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(St=this.tokenizer.rules.inline.blockSkip.exec(ft))!=null;)ft=ft.slice(0,St.index)+"["+"a".repeat(St[0].length-2)+"]"+ft.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ye;){if(rt=this.tokenizer.escape(ye)){ye=ye.substring(rt.raw.length),Te.push(rt);continue}if(rt=this.tokenizer.tag(ye,Ae,Pe)){ye=ye.substring(rt.raw.length),Ae=rt.inLink,Pe=rt.inRawBlock,Te.push(rt);continue}if(rt=this.tokenizer.link(ye)){ye=ye.substring(rt.raw.length),rt.type==="link"&&(rt.tokens=this.inlineTokens(rt.text,[],!0,Pe)),Te.push(rt);continue}if(rt=this.tokenizer.reflink(ye,this.tokens.links)){ye=ye.substring(rt.raw.length),rt.type==="link"&&(rt.tokens=this.inlineTokens(rt.text,[],!0,Pe)),Te.push(rt);continue}if(rt=this.tokenizer.strong(ye,ft,Xe)){ye=ye.substring(rt.raw.length),rt.tokens=this.inlineTokens(rt.text,[],Ae,Pe),Te.push(rt);continue}if(rt=this.tokenizer.em(ye,ft,Xe)){ye=ye.substring(rt.raw.length),rt.tokens=this.inlineTokens(rt.text,[],Ae,Pe),Te.push(rt);continue}if(rt=this.tokenizer.codespan(ye)){ye=ye.substring(rt.raw.length),Te.push(rt);continue}if(rt=this.tokenizer.br(ye)){ye=ye.substring(rt.raw.length),Te.push(rt);continue}if(rt=this.tokenizer.del(ye)){ye=ye.substring(rt.raw.length),rt.tokens=this.inlineTokens(rt.text,[],Ae,Pe),Te.push(rt);continue}if(rt=this.tokenizer.autolink(ye,le)){ye=ye.substring(rt.raw.length),Te.push(rt);continue}if(!Ae&&(rt=this.tokenizer.url(ye,le))){ye=ye.substring(rt.raw.length),Te.push(rt);continue}if(rt=this.tokenizer.inlineText(ye,Pe,Oe)){ye=ye.substring(rt.raw.length),Xe=rt.raw.slice(-1),Te.push(rt);continue}if(ye){var dt="Infinite loop on byte: "+ye.charCodeAt(0);if(this.options.silent){console.error(dt);break}else throw new Error(dt)}}return Te},u(Ue,null,[{key:"rules",get:function(){return{block:te,inline:ue}}}]),Ue}(),Y=C.defaults,Z=G.cleanUrl,be=G.escape,ge=function(){function Ue(Ie){this.options=Ie||Y}var Me=Ue.prototype;return Me.code=function(ye,Te,Ae){var Pe=(Te||"").match(/\S*/)[0];if(this.options.highlight){var Xe=this.options.highlight(ye,Pe);Xe!=null&&Xe!==ye&&(Ae=!0,ye=Xe)}return Pe?'<pre><code class="'+this.options.langPrefix+be(Pe,!0)+'">'+(Ae?ye:be(ye,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Ae?ye:be(ye,!0))+`</code></pre>
|
|
|
`},Me.blockquote=function(ye){return`<blockquote>
|
|
|
`+ye+`</blockquote>
|
|
|
`},Me.html=function(ye){return ye},Me.heading=function(ye,Te,Ae,Pe){return this.options.headerIds?"<h"+Te+' id="'+this.options.headerPrefix+Pe.slug(Ae)+'">'+ye+"</h"+Te+`>
|
|
|
`:"<h"+Te+">"+ye+"</h"+Te+`>
|
|
|
`},Me.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},Me.list=function(ye,Te,Ae){var Pe=Te?"ol":"ul",Xe=Te&&Ae!==1?' start="'+Ae+'"':"";return"<"+Pe+Xe+`>
|
|
|
`+ye+"</"+Pe+`>
|
|
|
`},Me.listitem=function(ye){return"<li>"+ye+`</li>
|
|
|
`},Me.checkbox=function(ye){return"<input "+(ye?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Me.paragraph=function(ye){return"<p>"+ye+`</p>
|
|
|
`},Me.table=function(ye,Te){return Te&&(Te="<tbody>"+Te+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+ye+`</thead>
|
|
|
`+Te+`</table>
|
|
|
`},Me.tablerow=function(ye){return`<tr>
|
|
|
`+ye+`</tr>
|
|
|
`},Me.tablecell=function(ye,Te){var Ae=Te.header?"th":"td",Pe=Te.align?"<"+Ae+' align="'+Te.align+'">':"<"+Ae+">";return Pe+ye+"</"+Ae+`>
|
|
|
`},Me.strong=function(ye){return"<strong>"+ye+"</strong>"},Me.em=function(ye){return"<em>"+ye+"</em>"},Me.codespan=function(ye){return"<code>"+ye+"</code>"},Me.br=function(){return this.options.xhtml?"<br/>":"<br>"},Me.del=function(ye){return"<del>"+ye+"</del>"},Me.link=function(ye,Te,Ae){if(ye=Z(this.options.sanitize,this.options.baseUrl,ye),ye===null)return Ae;var Pe='<a href="'+be(ye)+'"';return Te&&(Pe+=' title="'+Te+'"'),Pe+=">"+Ae+"</a>",Pe},Me.image=function(ye,Te,Ae){if(ye=Z(this.options.sanitize,this.options.baseUrl,ye),ye===null)return Ae;var Pe='<img src="'+ye+'" alt="'+Ae+'"';return Te&&(Pe+=' title="'+Te+'"'),Pe+=this.options.xhtml?"/>":">",Pe},Me.text=function(ye){return ye},Ue}(),De=function(){function Ue(){}var Me=Ue.prototype;return Me.strong=function(ye){return ye},Me.em=function(ye){return ye},Me.codespan=function(ye){return ye},Me.del=function(ye){return ye},Me.html=function(ye){return ye},Me.text=function(ye){return ye},Me.link=function(ye,Te,Ae){return""+Ae},Me.image=function(ye,Te,Ae){return""+Ae},Me.br=function(){return""},Ue}(),Qe=function(){function Ue(){this.seen={}}var Me=Ue.prototype;return Me.slug=function(ye){var Te=ye.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Te)){var Ae=Te;do this.seen[Ae]++,Te=Ae+"-"+this.seen[Ae];while(this.seen.hasOwnProperty(Te))}return this.seen[Te]=0,Te},Ue}(),Ze=C.defaults,nt=G.unescape,tt=function(){function Ue(Ie){this.options=Ie||Ze,this.options.renderer=this.options.renderer||new ge,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new De,this.slugger=new Qe}Ue.parse=function(ye,Te){var Ae=new Ue(Te);return Ae.parse(ye)};var Me=Ue.prototype;return Me.parse=function(ye,Te){Te===void 0&&(Te=!0);var Ae="",Pe,Xe,rt,ft,St,Pt,dt,At,Ot,bt,Vt,ir,Qt,dr,Nt,br,ur,wt,hr=ye.length;for(Pe=0;Pe<hr;Pe++){bt=ye[Pe];switch(bt.type){case"space":continue;case"hr":{Ae+=this.renderer.hr();continue}case"heading":{Ae+=this.renderer.heading(this.parseInline(bt.tokens),bt.depth,nt(this.parseInline(bt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ae+=this.renderer.code(bt.text,bt.lang,bt.escaped);continue}case"table":{for(At="",dt="",ft=bt.header.length,Xe=0;Xe<ft;Xe++)dt+=this.renderer.tablecell(this.parseInline(bt.tokens.header[Xe]),{header:!0,align:bt.align[Xe]});for(At+=this.renderer.tablerow(dt),Ot="",ft=bt.cells.length,Xe=0;Xe<ft;Xe++){for(Pt=bt.tokens.cells[Xe],dt="",St=Pt.length,rt=0;rt<St;rt++)dt+=this.renderer.tablecell(this.parseInline(Pt[rt]),{header:!1,align:bt.align[rt]});Ot+=this.renderer.tablerow(dt)}Ae+=this.renderer.table(At,Ot);continue}case"blockquote":{Ot=this.parse(bt.tokens),Ae+=this.renderer.blockquote(Ot);continue}case"list":{for(Vt=bt.ordered,ir=bt.start,Qt=bt.loose,ft=bt.items.length,Ot="",Xe=0;Xe<ft;Xe++)Nt=bt.items[Xe],br=Nt.checked,ur=Nt.task,dr="",Nt.task&&(wt=this.renderer.checkbox(br),Qt?Nt.tokens.length>0&&Nt.tokens[0].type==="text"?(Nt.tokens[0].text=wt+" "+Nt.tokens[0].text,Nt.tokens[0].tokens&&Nt.tokens[0].tokens.length>0&&Nt.tokens[0].tokens[0].type==="text"&&(Nt.tokens[0].tokens[0].text=wt+" "+Nt.tokens[0].tokens[0].text)):Nt.tokens.unshift({type:"text",text:wt}):dr+=wt),dr+=this.parse(Nt.tokens,Qt),Ot+=this.renderer.listitem(dr,ur,br);Ae+=this.renderer.list(Ot,Vt,ir);continue}case"html":{Ae+=this.renderer.html(bt.text);continue}case"paragraph":{Ae+=this.renderer.paragraph(this.parseInline(bt.tokens));continue}case"text":{for(Ot=bt.tokens?this.parseInline(bt.tokens):bt.text;Pe+1<hr&&ye[Pe+1].type==="text";)bt=ye[++Pe],Ot+=`
|
|
|
`+(bt.tokens?this.parseInline(bt.tokens):bt.text);Ae+=Te?this.renderer.paragraph(Ot):Ot;continue}default:{var Qr='Token with "'+bt.type+'" type was not found.';if(this.options.silent){console.error(Qr);return}else throw new Error(Qr)}}}return Ae},Me.parseInline=function(ye,Te){Te=Te||this.renderer;var Ae="",Pe,Xe,rt=ye.length;for(Pe=0;Pe<rt;Pe++){Xe=ye[Pe];switch(Xe.type){case"escape":{Ae+=Te.text(Xe.text);break}case"html":{Ae+=Te.html(Xe.text);break}case"link":{Ae+=Te.link(Xe.href,Xe.title,this.parseInline(Xe.tokens,Te));break}case"image":{Ae+=Te.image(Xe.href,Xe.title,Xe.text);break}case"strong":{Ae+=Te.strong(this.parseInline(Xe.tokens,Te));break}case"em":{Ae+=Te.em(this.parseInline(Xe.tokens,Te));break}case"codespan":{Ae+=Te.codespan(Xe.text);break}case"br":{Ae+=Te.br();break}case"del":{Ae+=Te.del(this.parseInline(Xe.tokens,Te));break}case"text":{Ae+=Te.text(Xe.text);break}default:{var ft='Token with "'+Xe.type+'" type was not found.';if(this.options.silent){console.error(ft);return}else throw new Error(ft)}}}return Ae},Ue}(),lt=G.merge,st=G.checkSanitizeDeprecation,je=G.escape,Re=C.getDefaults,et=C.changeDefaults,ct=C.defaults;function $e(Ue,Me,Ie){if(typeof Ue=="undefined"||Ue===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ue!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ue)+", string expected");if(typeof Me=="function"&&(Ie=Me,Me=null),Me=lt({},$e.defaults,Me||{}),st(Me),Ie){var ye=Me.highlight,Te;try{Te=Q.lex(Ue,Me)}catch(rt){return Ie(rt)}var Ae=function(ft){var St;if(!ft)try{St=tt.parse(Te,Me)}catch(Pt){ft=Pt}return Me.highlight=ye,ft?Ie(ft):Ie(null,St)};if(!ye||ye.length<3)return Ae();if(delete Me.highlight,!Te.length)return Ae();var Pe=0;$e.walkTokens(Te,function(rt){rt.type==="code"&&(Pe++,setTimeout(function(){ye(rt.text,rt.lang,function(ft,St){if(ft)return Ae(ft);St!=null&&St!==rt.text&&(rt.text=St,rt.escaped=!0),Pe--,Pe===0&&Ae()})},0))}),Pe===0&&Ae();return}try{var Xe=Q.lex(Ue,Me);return Me.walkTokens&&$e.walkTokens(Xe,Me.walkTokens),tt.parse(Xe,Me)}catch(rt){if(rt.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Me.silent)return"<p>An error occurred:</p><pre>"+je(rt.message+"",!0)+"</pre>";throw rt}}$e.options=$e.setOptions=function(Ue){return lt($e.defaults,Ue),et($e.defaults),$e},$e.getDefaults=Re,$e.defaults=ct,$e.use=function(Ue){var Me=lt({},Ue);if(Ue.renderer&&function(){var ye=$e.defaults.renderer||new ge,Te=function(Xe){var rt=ye[Xe];ye[Xe]=function(){for(var ft=arguments.length,St=new Array(ft),Pt=0;Pt<ft;Pt++)St[Pt]=arguments[Pt];var dt=Ue.renderer[Xe].apply(ye,St);return dt===!1&&(dt=rt.apply(ye,St)),dt}};for(var Ae in Ue.renderer)Te(Ae);Me.renderer=ye}(),Ue.tokenizer&&function(){var ye=$e.defaults.tokenizer||new xe,Te=function(Xe){var rt=ye[Xe];ye[Xe]=function(){for(var ft=arguments.length,St=new Array(ft),Pt=0;Pt<ft;Pt++)St[Pt]=arguments[Pt];var dt=Ue.tokenizer[Xe].apply(ye,St);return dt===!1&&(dt=rt.apply(ye,St)),dt}};for(var Ae in Ue.tokenizer)Te(Ae);Me.tokenizer=ye}(),Ue.walkTokens){var Ie=$e.defaults.walkTokens;Me.walkTokens=function(ye){Ue.walkTokens(ye),Ie&&Ie(ye)}}$e.setOptions(Me)},$e.walkTokens=function(Ue,Me){for(var Ie=h(Ue),ye;!(ye=Ie()).done;){var Te=ye.value;Me(Te);switch(Te.type){case"table":{for(var Ae=h(Te.tokens.header),Pe;!(Pe=Ae()).done;){var Xe=Pe.value;$e.walkTokens(Xe,Me)}for(var rt=h(Te.tokens.cells),ft;!(ft=rt()).done;)for(var St=ft.value,Pt=h(St),dt;!(dt=Pt()).done;){var At=dt.value;$e.walkTokens(At,Me)}break}case"list":{$e.walkTokens(Te.items,Me);break}default:Te.tokens&&$e.walkTokens(Te.tokens,Me)}}},$e.Parser=tt,$e.parser=tt.parse,$e.Renderer=ge,$e.TextRenderer=De,$e.Lexer=Q,$e.lexer=Q.lex,$e.Tokenizer=xe,$e.Slugger=Qe,$e.parse=$e;var qe=$e;return qe})},"DlR+":function(I,J,P){var L=P("MFOe"),u=L.Global,S=L.trim;I.exports={name:"cookieStorage",read:h,write:C,each:o,remove:c,clearAll:a};var R=u.document;function h(r){if(!r||!i(r))return null;var l="(?:^|.*;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(R.cookie.replace(new RegExp(l),"$1"))}function o(r){for(var l=R.cookie.split(/; ?/g),p=l.length-1;p>=0;p--){if(!S(l[p]))continue;var f=l[p].split("="),b=unescape(f[0]),v=unescape(f[1]);r(v,b)}}function C(r,l){if(!r)return;R.cookie=escape(r)+"="+escape(l)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function c(r){if(!r||!i(r))return;R.cookie=escape(r)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function a(){o(function(r,l){c(l)})}function i(r){return new RegExp("(?:^|;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(R.cookie)}},E4JC:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.StreamCipher,h=u.algo,o=[],C=[],c=[],a=h.Rabbit=R.extend({_doReset:function(){for(var r=this._key.words,l=this.cfg.iv,p=0;p<4;p++)r[p]=(r[p]<<8|r[p]>>>24)&16711935|(r[p]<<24|r[p]>>>8)&4278255360;var f=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],b=this._C=[r[2]<<16|r[2]>>>16,r[0]&4294901760|r[1]&65535,r[3]<<16|r[3]>>>16,r[1]&4294901760|r[2]&65535,r[0]<<16|r[0]>>>16,r[2]&4294901760|r[3]&65535,r[1]<<16|r[1]>>>16,r[3]&4294901760|r[0]&65535];this._b=0;for(var p=0;p<4;p++)i.call(this);for(var p=0;p<8;p++)b[p]^=f[p+4&7];if(l){var v=l.words,m=v[0],n=v[1],d=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,g=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,T=d>>>16|g&4294901760,y=g<<16|d&65535;b[0]^=d,b[1]^=T,b[2]^=g,b[3]^=y,b[4]^=d,b[5]^=T,b[6]^=g,b[7]^=y;for(var p=0;p<4;p++)i.call(this)}},_doProcessBlock:function(r,l){var p=this._X;i.call(this),o[0]=p[0]^p[5]>>>16^p[3]<<16,o[1]=p[2]^p[7]>>>16^p[5]<<16,o[2]=p[4]^p[1]>>>16^p[7]<<16,o[3]=p[6]^p[3]>>>16^p[1]<<16;for(var f=0;f<4;f++)o[f]=(o[f]<<8|o[f]>>>24)&16711935|(o[f]<<24|o[f]>>>8)&4278255360,r[l+f]^=o[f]},blockSize:128/32,ivSize:64/32});function i(){for(var r=this._X,l=this._C,p=0;p<8;p++)C[p]=l[p];l[0]=l[0]+1295307597+this._b|0,l[1]=l[1]+3545052371+(l[0]>>>0<C[0]>>>0?1:0)|0,l[2]=l[2]+886263092+(l[1]>>>0<C[1]>>>0?1:0)|0,l[3]=l[3]+1295307597+(l[2]>>>0<C[2]>>>0?1:0)|0,l[4]=l[4]+3545052371+(l[3]>>>0<C[3]>>>0?1:0)|0,l[5]=l[5]+886263092+(l[4]>>>0<C[4]>>>0?1:0)|0,l[6]=l[6]+1295307597+(l[5]>>>0<C[5]>>>0?1:0)|0,l[7]=l[7]+3545052371+(l[6]>>>0<C[6]>>>0?1:0)|0,this._b=l[7]>>>0<C[7]>>>0?1:0;for(var p=0;p<8;p++){var f=r[p]+l[p],b=f&65535,v=f>>>16,m=((b*b>>>17)+b*v>>>15)+v*v,n=((f&4294901760)*f|0)+((f&65535)*f|0);c[p]=m^n}r[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,r[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,r[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,r[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,r[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,r[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,r[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,r[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}u.Rabbit=R._createHelper(a)}(),L.Rabbit})},ELLl:function(I,J,P){(function(L){L(P("VrN/"))})(function(L){var u={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},S=L.Pos;L.defineOption("autoCloseBrackets",!1,function(b,v,m){m&&m!=L.Init&&(b.removeKeyMap(h),b.state.closeBrackets=null),v&&(o(R(v,"pairs")),b.state.closeBrackets=v,b.addKeyMap(h))});function R(b,v){return v=="pairs"&&typeof b=="string"?b:typeof b=="object"&&b[v]!=null?b[v]:u[v]}var h={Backspace:a,Enter:i};function o(b){for(var v=0;v<b.length;v++){var m=b.charAt(v),n="'"+m+"'";h[n]||(h[n]=C(m))}}o(u.pairs+"`");function C(b){return function(v){return l(v,b)}}function c(b){var v=b.state.closeBrackets;if(!v||v.override)return v;var m=b.getModeAt(b.getCursor());return m.closeBrackets||v}function a(b){var v=c(b);if(!v||b.getOption("disableInput"))return L.Pass;for(var m=R(v,"pairs"),n=b.listSelections(),d=0;d<n.length;d++){if(!n[d].empty())return L.Pass;var g=p(b,n[d].head);if(!g||m.indexOf(g)%2!=0)return L.Pass}for(var d=n.length-1;d>=0;d--){var T=n[d].head;b.replaceRange("",S(T.line,T.ch-1),S(T.line,T.ch+1),"+delete")}}function i(b){var v=c(b),m=v&&R(v,"explode");if(!m||b.getOption("disableInput"))return L.Pass;for(var n=b.listSelections(),d=0;d<n.length;d++){if(!n[d].empty())return L.Pass;var g=p(b,n[d].head);if(!g||m.indexOf(g)%2!=0)return L.Pass}b.operation(function(){var T=b.lineSeparator()||`
|
|
|
`;b.replaceSelection(T+T,null),b.execCommand("goCharLeft"),n=b.listSelections();for(var y=0;y<n.length;y++){var s=n[y].head.line;b.indentLine(s,null,!0),b.indentLine(s+1,null,!0)}})}function r(b){var v=L.cmpPos(b.anchor,b.head)>0;return{anchor:new S(b.anchor.line,b.anchor.ch+(v?-1:1)),head:new S(b.head.line,b.head.ch+(v?1:-1))}}function l(b,v){var m=c(b);if(!m||b.getOption("disableInput"))return L.Pass;var n=R(m,"pairs"),d=n.indexOf(v);if(d==-1)return L.Pass;for(var g=R(m,"closeBefore"),T=R(m,"triples"),y=n.charAt(d+1)==v,s=b.listSelections(),M=d%2==0,A,x=0;x<s.length;x++){var E=s[x],w=E.head,_,N=b.getRange(w,S(w.line,w.ch+1));if(M&&!E.empty())_="surround";else if((y||!M)&&N==v)y&&f(b,w)?_="both":T.indexOf(v)>=0&&b.getRange(w,S(w.line,w.ch+3))==v+v+v?_="skipThree":_="skip";else if(y&&w.ch>1&&T.indexOf(v)>=0&&b.getRange(S(w.line,w.ch-2),w)==v+v){if(w.ch>2&&/\bstring/.test(b.getTokenTypeAt(S(w.line,w.ch-2))))return L.Pass;_="addFour"}else if(y){var j=w.ch==0?" ":b.getRange(S(w.line,w.ch-1),w);if(!L.isWordChar(N)&&j!=v&&!L.isWordChar(j))_="both";else return L.Pass}else if(M&&(N.length===0||/\s/.test(N)||g.indexOf(N)>-1))_="both";else return L.Pass;if(!A)A=_;else if(A!=_)return L.Pass}var k=d%2?n.charAt(d-1):v,z=d%2?v:n.charAt(d+1);b.operation(function(){if(A=="skip")b.execCommand("goCharRight");else if(A=="skipThree")for(var H=0;H<3;H++)b.execCommand("goCharRight");else if(A=="surround"){for(var F=b.getSelections(),H=0;H<F.length;H++)F[H]=k+F[H]+z;b.replaceSelections(F,"around"),F=b.listSelections().slice();for(var H=0;H<F.length;H++)F[H]=r(F[H]);b.setSelections(F)}else A=="both"?(b.replaceSelection(k+z,null),b.triggerElectric(k+z),b.execCommand("goCharLeft")):A=="addFour"&&(b.replaceSelection(k+k+k+k,"before"),b.execCommand("goCharRight"))})}function p(b,v){var m=b.getRange(S(v.line,v.ch-1),S(v.line,v.ch+1));return m.length==2?m:null}function f(b,v){var m=b.getTokenAt(S(v.line,v.ch+1));return/\bstring/.test(m.type)&&m.start==v.ch&&(v.ch==0||!/\bstring/.test(b.getTokenTypeAt(v)))}})},ELcG:function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){/** @preserve
|
|
|
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
|
|
|
|
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
|
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
*/return function(u){var S=L,R=S.lib,h=R.WordArray,o=R.Hasher,C=S.algo,c=h.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),a=h.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),i=h.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),r=h.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=h.create([0,1518500249,1859775393,2400959708,2840853838]),p=h.create([1352829926,1548603684,1836072691,2053994217,0]),f=C.RIPEMD160=o.extend({_doReset:function(){this._hash=h.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(T,y){for(var s=0;s<16;s++){var M=y+s,A=T[M];T[M]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var x=this._hash.words,E=l.words,w=p.words,_=c.words,N=a.words,j=i.words,k=r.words,z,H,F,G,B,W,K,q,re,ee;W=z=x[0],K=H=x[1],q=F=x[2],re=G=x[3],ee=B=x[4];for(var Ce,s=0;s<80;s+=1)Ce=z+T[y+_[s]]|0,s<16?Ce+=b(H,F,G)+E[0]:s<32?Ce+=v(H,F,G)+E[1]:s<48?Ce+=m(H,F,G)+E[2]:s<64?Ce+=n(H,F,G)+E[3]:Ce+=d(H,F,G)+E[4],Ce=Ce|0,Ce=g(Ce,j[s]),Ce=Ce+B|0,z=B,B=G,G=g(F,10),F=H,H=Ce,Ce=W+T[y+N[s]]|0,s<16?Ce+=d(K,q,re)+w[0]:s<32?Ce+=n(K,q,re)+w[1]:s<48?Ce+=m(K,q,re)+w[2]:s<64?Ce+=v(K,q,re)+w[3]:Ce+=b(K,q,re)+w[4],Ce=Ce|0,Ce=g(Ce,k[s]),Ce=Ce+ee|0,W=ee,ee=re,re=g(q,10),q=K,K=Ce;Ce=x[1]+F+re|0,x[1]=x[2]+G+ee|0,x[2]=x[3]+B+W|0,x[3]=x[4]+z+K|0,x[4]=x[0]+H+q|0,x[0]=Ce},_doFinalize:function(){var T=this._data,y=T.words,s=this._nDataBytes*8,M=T.sigBytes*8;y[M>>>5]|=128<<24-M%32,y[(M+64>>>9<<4)+14]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,T.sigBytes=(y.length+1)*4,this._process();for(var A=this._hash,x=A.words,E=0;E<5;E++){var w=x[E];x[E]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}return A},clone:function(){var T=o.clone.call(this);return T._hash=this._hash.clone(),T}});function b(T,y,s){return T^y^s}function v(T,y,s){return T&y|~T&s}function m(T,y,s){return(T|~y)^s}function n(T,y,s){return T&s|y&~s}function d(T,y,s){return T^(y|~s)}function g(T,y){return T<<y|T>>>32-y}S.RIPEMD160=o._createHelper(f),S.HmacRIPEMD160=o._createHmacHelper(f)}(Math),L.RIPEMD160})},ETIr:function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.WordArray,h=u.enc,o=h.Base64={stringify:function(c){var a=c.words,i=c.sigBytes,r=this._map;c.clamp();for(var l=[],p=0;p<i;p+=3)for(var f=a[p>>>2]>>>24-p%4*8&255,b=a[p+1>>>2]>>>24-(p+1)%4*8&255,v=a[p+2>>>2]>>>24-(p+2)%4*8&255,m=f<<16|b<<8|v,n=0;n<4&&p+n*.75<i;n++)l.push(r.charAt(m>>>6*(3-n)&63));var d=r.charAt(64);if(d)for(;l.length%4;)l.push(d);return l.join("")},parse:function(c){var a=c.length,i=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var l=0;l<i.length;l++)r[i.charCodeAt(l)]=l}var p=i.charAt(64);if(p){var f=c.indexOf(p);f!==-1&&(a=f)}return C(c,a,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function C(c,a,i){for(var r=[],l=0,p=0;p<a;p++)if(p%4){var f=i[c.charCodeAt(p-1)]<<p%4*2,b=i[c.charCodeAt(p)]>>>6-p%4*2,v=f|b;r[l>>>2]|=v<<24-l%4*8,l++}return R.create(r,l)}}(),L.enc.Base64})},"F+F2":function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(){if(typeof ArrayBuffer!="function")return;var u=L,S=u.lib,R=S.WordArray,h=R.init,o=R.init=function(C){if(C instanceof ArrayBuffer&&(C=new Uint8Array(C)),(C instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&C instanceof Uint8ClampedArray||C instanceof Int16Array||C instanceof Uint16Array||C instanceof Int32Array||C instanceof Uint32Array||C instanceof Float32Array||C instanceof Float64Array)&&(C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength)),C instanceof Uint8Array){for(var c=C.byteLength,a=[],i=0;i<c;i++)a[i>>>2]|=C[i]<<24-i%4*8;h.call(this,a,c)}else h.apply(this,arguments)};o.prototype=R}(),L.lib.WordArray})},GRuw:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("lPiR"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.WordArray,h=u.algo,o=h.SHA256,C=h.SHA224=o.extend({_doReset:function(){this._hash=new R.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var c=o._doFinalize.call(this);return c.sigBytes-=4,c}});u.SHA224=o._createHelper(C),u.HmacSHA224=o._createHmacHelper(C)}(),L.SHA224})},GfqC:function(I,J,P){"use strict";var L=P("q1tI"),u=P.n(L),S=P("TSYQ"),R=P.n(S);function h(G,B){var W="cannot "+G.method+" "+G.action+" "+B.status+"'",K=new Error(W);return K.status=B.status,K.method=G.method,K.url=G.action,K}function o(G){var B=G.responseText||G.response;if(!B)return B;try{return JSON.parse(B)}catch(W){return B}}function C(G){var B=new XMLHttpRequest;G.onProgress&&B.upload&&(B.upload.onprogress=function(re){re.total>0&&(re.percent=re.loaded/re.total*100),G.onProgress(re)});var W=new FormData;G.data&&Object.keys(G.data).forEach(function(q){var re=G.data[q];if(Array.isArray(re)){re.forEach(function(ee){W.append(q+"[]",ee)});return}W.append(q,G.data[q])}),G.file instanceof Blob?W.append(G.filename,G.file,G.file.name):W.append(G.filename,G.file),B.onerror=function(re){G.onError(re)},B.onload=function(){return B.status<200||B.status>=300?G.onError(h(G,B),o(B)):G.onSuccess(o(B),B)},B.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in B&&(B.withCredentials=!0);var K=G.headers||{};return K["X-Requested-With"]!==null&&B.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(K).forEach(function(q){K[q]!==null&&B.setRequestHeader(q,K[q])}),B.send(W),{abort:function(){B.abort()}}}var c=+new Date,a=0;function i(){return"rc-upload-"+c+"-"+ ++a}function r(G,B){return G.indexOf(B,G.length-B.length)!==-1}var l=function(G,B){if(G&&B){var W=Array.isArray(B)?B:B.split(","),K=G.name||"",q=G.type||"",re=q.replace(/\/.*$/,"");return W.some(function(ee){var Ce=ee.trim();return Ce.charAt(0)==="."?r(K.toLowerCase(),Ce.toLowerCase()):/\/\*$/.test(Ce)?re===Ce.replace(/\/.*$/,""):q===Ce})}return!0};function p(G,B){var W=G.createReader(),K=[];function q(){W.readEntries(function(re){var ee=Array.prototype.slice.apply(re);K=K.concat(ee);var Ce=!ee.length;Ce?B(K):q()})}q()}var f=function(B,W,K){var q=function re(ee,Ce){Ce=Ce||"",ee.isFile?ee.file(function(xe){K(xe)&&(ee.fullPath&&!xe.webkitRelativePath&&(Object.defineProperties(xe,{webkitRelativePath:{writable:!0}}),xe.webkitRelativePath=ee.fullPath.replace(/^\//,""),Object.defineProperties(xe,{webkitRelativePath:{writable:!1}})),W([xe]))}):ee.isDirectory&&p(ee,function(xe){xe.forEach(function(he){re(he,""+Ce+ee.name+"/")})})};B.forEach(function(re){q(re.webkitGetAsEntry())})},b=f,v=Object.assign||function(G){for(var B=1;B<arguments.length;B++){var W=arguments[B];for(var K in W)Object.prototype.hasOwnProperty.call(W,K)&&(G[K]=W[K])}return G},m=function(){function G(B,W){var K=[],q=!0,re=!1,ee=void 0;try{for(var Ce=B[Symbol.iterator](),xe;!(q=(xe=Ce.next()).done)&&!(K.push(xe.value),W&&K.length===W);q=!0);}catch(he){re=!0,ee=he}finally{try{!q&&Ce.return&&Ce.return()}finally{if(re)throw ee}}return K}return function(B,W){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return G(B,W);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=function(){function G(B,W){for(var K=0;K<W.length;K++){var q=W[K];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(B,q.key,q)}}return function(B,W,K){return W&&G(B.prototype,W),K&&G(B,K),B}}();function d(G,B,W){return B in G?Object.defineProperty(G,B,{value:W,enumerable:!0,configurable:!0,writable:!0}):G[B]=W,G}function g(G,B){var W={};for(var K in G){if(B.indexOf(K)>=0)continue;if(!Object.prototype.hasOwnProperty.call(G,K))continue;W[K]=G[K]}return W}function T(G,B){if(!(G instanceof B))throw new TypeError("Cannot call a class as a function")}function y(G,B){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B&&(typeof B=="object"||typeof B=="function")?B:G}function s(G,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);G.prototype=Object.create(B&&B.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(G,B):G.__proto__=B)}var M=function(B){return Object.keys(B).reduce(function(W,K){return(K.substr(0,5)==="data-"||K.substr(0,5)==="aria-"||K==="role")&&(W[K]=B[K]),W},{})},A=function(G){s(B,G);function B(){var W,K,q,re;T(this,B);for(var ee=arguments.length,Ce=Array(ee),xe=0;xe<ee;xe++)Ce[xe]=arguments[xe];return re=(K=(q=y(this,(W=B.__proto__||Object.getPrototypeOf(B)).call.apply(W,[this].concat(Ce))),q),q.state={uid:i()},q.reqs={},q.onChange=function(he){var ke=he.target.files;q.uploadFiles(ke),q.reset()},q.onClick=function(he){var ke=q.fileInput;if(!ke)return;var _e=q.props,de=_e.children,ce=_e.onClick;de&&de.type==="button"&&(ke.parentNode.focus(),ke.parentNode.querySelector("button").blur()),ke.click(),ce&&ce(he)},q.onKeyDown=function(he){he.key==="Enter"&&q.onClick()},q.onFileDrop=function(he){var ke=q.props.multiple;if(he.preventDefault(),he.type==="dragover")return;if(q.props.directory)b(Array.prototype.slice.call(he.dataTransfer.items),q.uploadFiles,function(de){return l(de,q.props.accept)});else{var _e=Array.prototype.slice.call(he.dataTransfer.files).filter(function(de){return l(de,q.props.accept)});ke===!1&&(_e=_e.slice(0,1)),q.uploadFiles(_e)}},q.uploadFiles=function(he){var ke=Array.prototype.slice.call(he);ke.map(function(_e){return _e.uid=i(),_e}).forEach(function(_e){q.upload(_e,ke)})},q.saveFileInput=function(he){q.fileInput=he},K),y(q,re)}return n(B,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(K,q){var re=this,ee=this.props;if(!ee.beforeUpload)return setTimeout(function(){return re.post(K)},0);var Ce=ee.beforeUpload(K,q);Ce&&Ce.then?Ce.then(function(xe){var he=Object.prototype.toString.call(xe);return he==="[object File]"||he==="[object Blob]"?re.post(xe):re.post(K)}).catch(function(xe){console.log(xe)}):Ce!==!1&&setTimeout(function(){return re.post(K)},0);return}},{key:"post",value:function(K){var q=this;if(!this._isMounted)return;var re=this.props,ee=re.onStart,Ce=re.onProgress,xe=re.transformFile,he=xe===void 0?function(ke){return ke}:xe;new Promise(function(ke){var _e=re.action;return typeof _e=="function"&&(_e=_e(K)),ke(_e)}).then(function(ke){var _e=K.uid,de=re.customRequest||C,ce=Promise.resolve(he(K)).then(function(ae){var Se=re.data;return typeof Se=="function"&&(Se=Se(ae)),Promise.all([ae,Se])}).catch(function(ae){console.error(ae)});ce.then(function(ae){var Se=m(ae,2),te=Se[0],ue=Se[1],Oe={action:ke,filename:re.name,data:ue,file:te,headers:re.headers,withCredentials:re.withCredentials,method:re.method||"post",onProgress:Ce?function(le){Ce(le,K)}:null,onSuccess:function(Q,Y){delete q.reqs[_e],re.onSuccess(Q,K,Y)},onError:function(Q,Y){delete q.reqs[_e],re.onError(Q,Y,K)}};ee(K),q.reqs[_e]=de(Oe)})})}},{key:"reset",value:function(){this.setState({uid:i()})}},{key:"abort",value:function(K){var q=this.reqs;if(K){var re=K;K&&K.uid&&(re=K.uid),q[re]&&q[re].abort&&q[re].abort(),delete q[re]}else Object.keys(q).forEach(function(ee){q[ee]&&q[ee].abort&&q[ee].abort(),delete q[ee]})}},{key:"render",value:function(){var K,q=this.props,re=q.component,ee=q.prefixCls,Ce=q.className,xe=q.disabled,he=q.id,ke=q.style,_e=q.multiple,de=q.accept,ce=q.children,ae=q.directory,Se=q.openFileDialogOnClick,te=q.onMouseEnter,ue=q.onMouseLeave,Oe=g(q,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),le=R()((K={},d(K,ee,!0),d(K,ee+"-disabled",xe),d(K,Ce,Ce),K)),Q=xe?{}:{onClick:Se?this.onClick:function(){},onKeyDown:Se?this.onKeyDown:function(){},onMouseEnter:te,onMouseLeave:ue,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return u.a.createElement(re,v({},Q,{className:le,role:"button",style:ke}),u.a.createElement("input",v({},M(Oe),{id:he,type:"file",ref:this.saveFileInput,onClick:function(Z){return Z.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:de,directory:ae?"directory":null,webkitdirectory:ae?"webkitdirectory":null,multiple:_e,onChange:this.onChange})),ce)}}]),B}(L.Component),x=A,E=Object.assign||function(G){for(var B=1;B<arguments.length;B++){var W=arguments[B];for(var K in W)Object.prototype.hasOwnProperty.call(W,K)&&(G[K]=W[K])}return G},w=function(){function G(B,W){for(var K=0;K<W.length;K++){var q=W[K];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(B,q.key,q)}}return function(B,W,K){return W&&G(B.prototype,W),K&&G(B,K),B}}();function _(G,B){if(!(G instanceof B))throw new TypeError("Cannot call a class as a function")}function N(G,B){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B&&(typeof B=="object"||typeof B=="function")?B:G}function j(G,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);G.prototype=Object.create(B&&B.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(G,B):G.__proto__=B)}function k(){}var z=function(G){j(B,G);function B(){var W,K,q,re;_(this,B);for(var ee=arguments.length,Ce=Array(ee),xe=0;xe<ee;xe++)Ce[xe]=arguments[xe];return re=(K=(q=N(this,(W=B.__proto__||Object.getPrototypeOf(B)).call.apply(W,[this].concat(Ce))),q),q.saveUploader=function(he){q.uploader=he},K),N(q,re)}return w(B,[{key:"abort",value:function(K){this.uploader.abort(K)}},{key:"render",value:function(){return u.a.createElement(x,E({},this.props,{ref:this.saveUploader}))}}]),B}(L.Component);z.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:k,onError:k,onSuccess:k,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var H=z,F=J.a=H},H38U:function(I,J,P){var L=P("f4xo"),u=P("rcnY"),S=P("wU8J"),R=P("Iq15"),h=P("dWSS");function o(c,a){this.typeNumber=c,this.errorCorrectLevel=a,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var C=o.prototype;C.addData=function(c){var a=new L(c);this.dataList.push(a),this.dataCache=null},C.isDark=function(c,a){if(c<0||this.moduleCount<=c||a<0||this.moduleCount<=a)throw new Error(c+","+a);return this.modules[c][a]},C.getModuleCount=function(){return this.moduleCount},C.make=function(){if(this.typeNumber<1){var c=1;for(c=1;c<40;c++){for(var a=u.getRSBlocks(c,this.errorCorrectLevel),i=new S,r=0,l=0;l<a.length;l++)r+=a[l].dataCount;for(var l=0;l<this.dataList.length;l++){var p=this.dataList[l];i.put(p.mode,4),i.put(p.getLength(),R.getLengthInBits(p.mode,c)),p.write(i)}if(i.getLengthInBits()<=r*8)break}this.typeNumber=c}this.makeImpl(!1,this.getBestMaskPattern())},C.makeImpl=function(c,a){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[i][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(c,a),this.typeNumber>=7&&this.setupTypeNumber(c),this.dataCache==null&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,a)},C.setupPositionProbePattern=function(c,a){for(var i=-1;i<=7;i++){if(c+i<=-1||this.moduleCount<=c+i)continue;for(var r=-1;r<=7;r++){if(a+r<=-1||this.moduleCount<=a+r)continue;0<=i&&i<=6&&(r==0||r==6)||0<=r&&r<=6&&(i==0||i==6)||2<=i&&i<=4&&2<=r&&r<=4?this.modules[c+i][a+r]=!0:this.modules[c+i][a+r]=!1}}},C.getBestMaskPattern=function(){for(var c=0,a=0,i=0;i<8;i++){this.makeImpl(!0,i);var r=R.getLostPoint(this);(i==0||c>r)&&(c=r,a=i)}return a},C.createMovieClip=function(c,a,i){var r=c.createEmptyMovieClip(a,i),l=1;this.make();for(var p=0;p<this.modules.length;p++)for(var f=p*l,b=0;b<this.modules[p].length;b++){var v=b*l,m=this.modules[p][b];m&&(r.beginFill(0,100),r.moveTo(v,f),r.lineTo(v+l,f),r.lineTo(v+l,f+l),r.lineTo(v,f+l),r.endFill())}return r},C.setupTimingPattern=function(){for(var c=8;c<this.moduleCount-8;c++){if(this.modules[c][6]!=null)continue;this.modules[c][6]=c%2==0}for(var a=8;a<this.moduleCount-8;a++){if(this.modules[6][a]!=null)continue;this.modules[6][a]=a%2==0}},C.setupPositionAdjustPattern=function(){for(var c=R.getPatternPosition(this.typeNumber),a=0;a<c.length;a++)for(var i=0;i<c.length;i++){var r=c[a],l=c[i];if(this.modules[r][l]!=null)continue;for(var p=-2;p<=2;p++)for(var f=-2;f<=2;f++)p==-2||p==2||f==-2||f==2||p==0&&f==0?this.modules[r+p][l+f]=!0:this.modules[r+p][l+f]=!1}},C.setupTypeNumber=function(c){for(var a=R.getBCHTypeNumber(this.typeNumber),i=0;i<18;i++){var r=!c&&(a>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=r}for(var i=0;i<18;i++){var r=!c&&(a>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r}},C.setupTypeInfo=function(c,a){for(var i=this.errorCorrectLevel<<3|a,r=R.getBCHTypeInfo(i),l=0;l<15;l++){var p=!c&&(r>>l&1)==1;l<6?this.modules[l][8]=p:l<8?this.modules[l+1][8]=p:this.modules[this.moduleCount-15+l][8]=p}for(var l=0;l<15;l++){var p=!c&&(r>>l&1)==1;l<8?this.modules[8][this.moduleCount-l-1]=p:l<9?this.modules[8][15-l-1+1]=p:this.modules[8][15-l-1]=p}this.modules[this.moduleCount-8][8]=!c},C.mapData=function(c,a){for(var i=-1,r=this.moduleCount-1,l=7,p=0,f=this.moduleCount-1;f>0;f-=2)for(f==6&&f--;;){for(var b=0;b<2;b++)if(this.modules[r][f-b]==null){var v=!1;p<c.length&&(v=(c[p]>>>l&1)==1);var m=R.getMask(a,r,f-b);m&&(v=!v),this.modules[r][f-b]=v,l--,l==-1&&(p++,l=7)}if(r+=i,r<0||this.moduleCount<=r){r-=i,i=-i;break}}},o.PAD0=236,o.PAD1=17,o.createData=function(c,a,i){for(var r=u.getRSBlocks(c,a),l=new S,p=0;p<i.length;p++){var f=i[p];l.put(f.mode,4),l.put(f.getLength(),R.getLengthInBits(f.mode,c)),f.write(l)}for(var b=0,p=0;p<r.length;p++)b+=r[p].dataCount;if(l.getLengthInBits()>b*8)throw new Error("code length overflow. ("+l.getLengthInBits()+">"+b*8+")");for(l.getLengthInBits()+4<=b*8&&l.put(0,4);l.getLengthInBits()%8!=0;)l.putBit(!1);for(;!(l.getLengthInBits()>=b*8);){if(l.put(o.PAD0,8),l.getLengthInBits()>=b*8)break;l.put(o.PAD1,8)}return o.createBytes(l,r)},o.createBytes=function(c,a){for(var i=0,r=0,l=0,p=new Array(a.length),f=new Array(a.length),b=0;b<a.length;b++){var v=a[b].dataCount,m=a[b].totalCount-v;r=Math.max(r,v),l=Math.max(l,m),p[b]=new Array(v);for(var n=0;n<p[b].length;n++)p[b][n]=255&c.buffer[n+i];i+=v;var d=R.getErrorCorrectPolynomial(m),g=new h(p[b],d.getLength()-1),T=g.mod(d);f[b]=new Array(d.getLength()-1);for(var n=0;n<f[b].length;n++){var y=n+T.getLength()-f[b].length;f[b][n]=y>=0?T.get(y):0}}for(var s=0,n=0;n<a.length;n++)s+=a[n].totalCount;for(var M=new Array(s),A=0,n=0;n<r;n++)for(var b=0;b<a.length;b++)n<p[b].length&&(M[A++]=p[b][n]);for(var n=0;n<l;n++)for(var b=0;b<a.length;b++)n<f[b].length&&(M[A++]=f[b][n]);return M},I.exports=o},HmJG:function(I,J,P){},IBYe:function(I,J,P){"use strict";function L(u){return null}J.a=L},Ib8C:function(I,J,P){(function(L){(function(u,S){I.exports=J=S()})(this,function(){var u=u||function(S,R){var h;if(typeof window!="undefined"&&window.crypto&&(h=window.crypto),typeof self!="undefined"&&self.crypto&&(h=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(h=globalThis.crypto),!h&&typeof window!="undefined"&&window.msCrypto&&(h=window.msCrypto),!h&&typeof L!="undefined"&&L.crypto&&(h=L.crypto),!h&&!0)try{h=P(4)}catch(d){}var o=function(){if(h){if(typeof h.getRandomValues=="function")try{return h.getRandomValues(new Uint32Array(1))[0]}catch(d){}if(typeof h.randomBytes=="function")try{return h.randomBytes(4).readInt32LE()}catch(d){}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||function(){function d(){}return function(g){var T;return d.prototype=g,T=new d,d.prototype=null,T}}(),c={},a=c.lib={},i=a.Base=function(){return{extend:function(d){var g=C(this);return d&&g.mixIn(d),(!g.hasOwnProperty("init")||this.init===g.init)&&(g.init=function(){g.$super.init.apply(this,arguments)}),g.init.prototype=g,g.$super=this,g},create:function(){var d=this.extend();return d.init.apply(d,arguments),d},init:function(){},mixIn:function(d){for(var g in d)d.hasOwnProperty(g)&&(this[g]=d[g]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=a.WordArray=i.extend({init:function(d,g){d=this.words=d||[],g!=R?this.sigBytes=g:this.sigBytes=d.length*4},toString:function(d){return(d||p).stringify(this)},concat:function(d){var g=this.words,T=d.words,y=this.sigBytes,s=d.sigBytes;if(this.clamp(),y%4)for(var M=0;M<s;M++){var A=T[M>>>2]>>>24-M%4*8&255;g[y+M>>>2]|=A<<24-(y+M)%4*8}else for(var x=0;x<s;x+=4)g[y+x>>>2]=T[x>>>2];return this.sigBytes+=s,this},clamp:function(){var d=this.words,g=this.sigBytes;d[g>>>2]&=4294967295<<32-g%4*8,d.length=S.ceil(g/4)},clone:function(){var d=i.clone.call(this);return d.words=this.words.slice(0),d},random:function(d){for(var g=[],T=0;T<d;T+=4)g.push(o());return new r.init(g,d)}}),l=c.enc={},p=l.Hex={stringify:function(d){for(var g=d.words,T=d.sigBytes,y=[],s=0;s<T;s++){var M=g[s>>>2]>>>24-s%4*8&255;y.push((M>>>4).toString(16)),y.push((M&15).toString(16))}return y.join("")},parse:function(d){for(var g=d.length,T=[],y=0;y<g;y+=2)T[y>>>3]|=parseInt(d.substr(y,2),16)<<24-y%8*4;return new r.init(T,g/2)}},f=l.Latin1={stringify:function(d){for(var g=d.words,T=d.sigBytes,y=[],s=0;s<T;s++){var M=g[s>>>2]>>>24-s%4*8&255;y.push(String.fromCharCode(M))}return y.join("")},parse:function(d){for(var g=d.length,T=[],y=0;y<g;y++)T[y>>>2]|=(d.charCodeAt(y)&255)<<24-y%4*8;return new r.init(T,g)}},b=l.Utf8={stringify:function(d){try{return decodeURIComponent(escape(f.stringify(d)))}catch(g){throw new Error("Malformed UTF-8 data")}},parse:function(d){return f.parse(unescape(encodeURIComponent(d)))}},v=a.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(d){typeof d=="string"&&(d=b.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},_process:function(d){var g,T=this._data,y=T.words,s=T.sigBytes,M=this.blockSize,A=M*4,x=s/A;d?x=S.ceil(x):x=S.max((x|0)-this._minBufferSize,0);var E=x*M,w=S.min(E*4,s);if(E){for(var _=0;_<E;_+=M)this._doProcessBlock(y,_);g=y.splice(0,E),T.sigBytes-=w}return new r.init(g,w)},clone:function(){var d=i.clone.call(this);return d._data=this._data.clone(),d},_minBufferSize:0}),m=a.Hasher=v.extend({cfg:i.extend(),init:function(d){this.cfg=this.cfg.extend(d),this.reset()},reset:function(){v.reset.call(this),this._doReset()},update:function(d){return this._append(d),this._process(),this},finalize:function(d){d&&this._append(d);var g=this._doFinalize();return g},blockSize:512/32,_createHelper:function(d){return function(g,T){return new d.init(T).finalize(g)}},_createHmacHelper:function(d){return function(g,T){return new n.HMAC.init(d,T).finalize(g)}}}),n=c.algo={};return c}(Math);return u})}).call(this,P("IyRk"))},Iq15:function(I,J,P){var L=P("nVVt"),u=P("dWSS"),S=P("dQei"),R={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},h={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(o){for(var C=o<<10;h.getBCHDigit(C)-h.getBCHDigit(h.G15)>=0;)C^=h.G15<<h.getBCHDigit(C)-h.getBCHDigit(h.G15);return(o<<10|C)^h.G15_MASK},getBCHTypeNumber:function(o){for(var C=o<<12;h.getBCHDigit(C)-h.getBCHDigit(h.G18)>=0;)C^=h.G18<<h.getBCHDigit(C)-h.getBCHDigit(h.G18);return o<<12|C},getBCHDigit:function(o){for(var C=0;o!=0;)C++,o>>>=1;return C},getPatternPosition:function(o){return h.PATTERN_POSITION_TABLE[o-1]},getMask:function(o,C,c){switch(o){case R.PATTERN000:return(C+c)%2==0;case R.PATTERN001:return C%2==0;case R.PATTERN010:return c%3==0;case R.PATTERN011:return(C+c)%3==0;case R.PATTERN100:return(Math.floor(C/2)+Math.floor(c/3))%2==0;case R.PATTERN101:return C*c%2+C*c%3==0;case R.PATTERN110:return(C*c%2+C*c%3)%2==0;case R.PATTERN111:return(C*c%3+(C+c)%2)%2==0;default:throw new Error("bad maskPattern:"+o)}},getErrorCorrectPolynomial:function(o){for(var C=new u([1],0),c=0;c<o;c++)C=C.multiply(new u([1,S.gexp(c)],0));return C},getLengthInBits:function(o,C){if(1<=C&&C<10)switch(o){case L.MODE_NUMBER:return 10;case L.MODE_ALPHA_NUM:return 9;case L.MODE_8BIT_BYTE:return 8;case L.MODE_KANJI:return 8;default:throw new Error("mode:"+o)}else if(C<27)switch(o){case L.MODE_NUMBER:return 12;case L.MODE_ALPHA_NUM:return 11;case L.MODE_8BIT_BYTE:return 16;case L.MODE_KANJI:return 10;default:throw new Error("mode:"+o)}else if(C<41)switch(o){case L.MODE_NUMBER:return 14;case L.MODE_ALPHA_NUM:return 13;case L.MODE_8BIT_BYTE:return 16;case L.MODE_KANJI:return 12;default:throw new Error("mode:"+o)}else throw new Error("type:"+C)},getLostPoint:function(o){for(var C=o.getModuleCount(),c=0,a=0;a<C;a++)for(var i=0;i<C;i++){for(var r=0,l=o.isDark(a,i),p=-1;p<=1;p++){if(a+p<0||C<=a+p)continue;for(var f=-1;f<=1;f++){if(i+f<0||C<=i+f)continue;if(p==0&&f==0)continue;l==o.isDark(a+p,i+f)&&r++}}r>5&&(c+=3+r-5)}for(var a=0;a<C-1;a++)for(var i=0;i<C-1;i++){var b=0;o.isDark(a,i)&&b++,o.isDark(a+1,i)&&b++,o.isDark(a,i+1)&&b++,o.isDark(a+1,i+1)&&b++,(b==0||b==4)&&(c+=3)}for(var a=0;a<C;a++)for(var i=0;i<C-6;i++)o.isDark(a,i)&&!o.isDark(a,i+1)&&o.isDark(a,i+2)&&o.isDark(a,i+3)&&o.isDark(a,i+4)&&!o.isDark(a,i+5)&&o.isDark(a,i+6)&&(c+=40);for(var i=0;i<C;i++)for(var a=0;a<C-6;a++)o.isDark(a,i)&&!o.isDark(a+1,i)&&o.isDark(a+2,i)&&o.isDark(a+3,i)&&o.isDark(a+4,i)&&!o.isDark(a+5,i)&&o.isDark(a+6,i)&&(c+=40);for(var v=0,i=0;i<C;i++)for(var a=0;a<C;a++)o.isDark(a,i)&&v++;var m=Math.abs(100*v/C/C-50)/5;return c+=m*10,c}};I.exports=h},J66h:function(I,J,P){(function(L){var u,S;(function(R,h){I.exports=h(R)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof L!="undefined"?L:this,function(R){"use strict";R=R||{};var h=R.Base64,o="2.6.4",C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=function(k){for(var z={},H=0,F=k.length;H<F;H++)z[k.charAt(H)]=H;return z}(C),a=String.fromCharCode,i=function(k){if(k.length<2){var z=k.charCodeAt(0);return z<128?k:z<2048?a(192|z>>>6)+a(128|z&63):a(224|z>>>12&15)+a(128|z>>>6&63)+a(128|z&63)}else{var z=65536+(k.charCodeAt(0)-55296)*1024+(k.charCodeAt(1)-56320);return a(240|z>>>18&7)+a(128|z>>>12&63)+a(128|z>>>6&63)+a(128|z&63)}},r=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(k){return k.replace(r,i)},p=function(k){var z=[0,2,1][k.length%3],H=k.charCodeAt(0)<<16|(k.length>1?k.charCodeAt(1):0)<<8|(k.length>2?k.charCodeAt(2):0),F=[C.charAt(H>>>18),C.charAt(H>>>12&63),z>=2?"=":C.charAt(H>>>6&63),z>=1?"=":C.charAt(H&63)];return F.join("")},f=R.btoa&&typeof R.btoa=="function"?function(k){return R.btoa(k)}:function(k){if(k.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return k.replace(/[\s\S]{1,3}/g,p)},b=function(k){return f(l(String(k)))},v=function(k){return k.replace(/[+\/]/g,function(z){return z=="+"?"-":"_"}).replace(/=/g,"")},m=function(k,z){return z?v(b(k)):b(k)},n=function(k){return m(k,!0)},d;R.Uint8Array&&(d=function(k,z){for(var H="",F=0,G=k.length;F<G;F+=3){var B=k[F],W=k[F+1],K=k[F+2],q=B<<16|W<<8|K;H+=C.charAt(q>>>18)+C.charAt(q>>>12&63)+(typeof W!="undefined"?C.charAt(q>>>6&63):"=")+(typeof K!="undefined"?C.charAt(q&63):"=")}return z?v(H):H});var g=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,T=function(k){switch(k.length){case 4:var z=(7&k.charCodeAt(0))<<18|(63&k.charCodeAt(1))<<12|(63&k.charCodeAt(2))<<6|63&k.charCodeAt(3),H=z-65536;return a((H>>>10)+55296)+a((H&1023)+56320);case 3:return a((15&k.charCodeAt(0))<<12|(63&k.charCodeAt(1))<<6|63&k.charCodeAt(2));default:return a((31&k.charCodeAt(0))<<6|63&k.charCodeAt(1))}},y=function(k){return k.replace(g,T)},s=function(k){var z=k.length,H=z%4,F=(z>0?c[k.charAt(0)]<<18:0)|(z>1?c[k.charAt(1)]<<12:0)|(z>2?c[k.charAt(2)]<<6:0)|(z>3?c[k.charAt(3)]:0),G=[a(F>>>16),a(F>>>8&255),a(F&255)];return G.length-=[0,0,2,1][H],G.join("")},M=R.atob&&typeof R.atob=="function"?function(k){return R.atob(k)}:function(k){return k.replace(/\S{1,4}/g,s)},A=function(k){return M(String(k).replace(/[^A-Za-z0-9\+\/]/g,""))},x=function(k){return y(M(k))},E=function(k){return String(k).replace(/[-_]/g,function(z){return z=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},w=function(k){return x(E(k))},_;R.Uint8Array&&(_=function(k){return Uint8Array.from(A(E(k)),function(z){return z.charCodeAt(0)})});var N=function(){var k=R.Base64;return R.Base64=h,k};if(R.Base64={VERSION:o,atob:A,btoa:f,fromBase64:w,toBase64:m,utob:l,encode:m,encodeURI:n,btou:y,decode:w,noConflict:N,fromUint8Array:d,toUint8Array:_},typeof Object.defineProperty=="function"){var j=function(k){return{value:k,enumerable:!1,writable:!0,configurable:!0}};R.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",j(function(){return w(this)})),Object.defineProperty(String.prototype,"toBase64",j(function(k){return m(this,k)})),Object.defineProperty(String.prototype,"toBase64URI",j(function(){return m(this,!0)}))}}return R.Meteor&&(Base64=R.Base64),I.exports?I.exports.Base64=R.Base64:!(u=[],S=function(){return R.Base64}.apply(J,u),S!==void 0&&(I.exports=S)),{Base64:R.Base64}})}).call(this,P("IyRk"))},K3mO:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("3y9D"),P("WYAk"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.Base,h=S.WordArray,o=u.algo,C=o.MD5,c=o.EvpKDF=R.extend({cfg:R.extend({keySize:128/32,hasher:C,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,i){for(var r,l=this.cfg,p=l.hasher.create(),f=h.create(),b=f.words,v=l.keySize,m=l.iterations;b.length<v;){r&&p.update(r),r=p.update(a).finalize(i),p.reset();for(var n=1;n<m;n++)r=p.finalize(r),p.reset();f.concat(r)}return f.sigBytes=v*4,f}});u.EvpKDF=function(a,i,r){return c.create(r).compute(a,i)}}(),L.EvpKDF})},KhGG:function(I,J,P){"use strict";P.d(J,"a",function(){return s}),P.d(J,"c",function(){return A});var L=P("0Owb"),u=P("miYZ"),S=P("tsqr"),R=P("oBTY"),h=P("tJVT"),o=P("PpiC"),C=P("k1fw"),c=P("9og8"),a=P("DZo9"),i=P("8z0m"),r=P("WmNS"),l=P.n(r),p=P("q1tI"),f=P.n(p),b=P("ErOA"),v=P("NFKh"),m=P.n(v),n=P("7Cbv"),d=P("9kvl"),g=P("mxV5"),T=P.n(g),y=i.a.Dragger,s=function(w){var _="bf3c199c2470cb477d907b1e0917c17b",N="5183666c72eec9e4",j=m.a.enc.Utf8.parse(_),k=m.a.enc.Utf8.parse(N),z=m.a.AES.decrypt(w,j,{iv:k,mode:m.a.mode.CBC});return z.toString(m.a.enc.Utf8)},M,A=function(){var E=Object(c.a)(l.a.mark(function w(_,N,j){var k,z,H,F,G,B,W,K,q;return l.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return N.file_name=_.name,ee.next=3,Object(b.a)("/api/buckets/get_upload_token.json",{method:"get"});case 3:return W=ee.sent,console.log("decrypt(res.data):",s(W.data)),W.data=JSON.parse(s(W.data)),K=Object(n.a)(),q=new T.a({endpoint:W==null||((k=W.data)===null||k===void 0)?void 0:k.end_point,region:W==null||((z=W.data)===null||z===void 0)?void 0:z.region,accessKeyId:W==null||((H=W.data)===null||H===void 0)?void 0:H.access_key_id,accessKeySecret:W==null||((F=W.data)===null||F===void 0)?void 0:F.access_key_secret,bucket:W==null||((G=W.data)===null||G===void 0)?void 0:G.bucket,stsToken:W==null||((B=W.data)===null||B===void 0)?void 0:B.security_token}),ee.abrupt("return",new Promise(function(Ce,xe){var he;q.multipartUpload("".concat(K),new Blob([_],{type:_.type}),Object(C.a)(Object(C.a)({timeout:200*1e3,partSize:102400},j),{},{callback:{url:W==null||((he=W.data)===null||he===void 0)?void 0:he.callback_url,host:W==null?void 0:W.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(b.e)(N)}})).then(function(ke){var _e;_.response=(_e=ke.data)===null||_e===void 0?void 0:_e.data,Ce(ke==null?void 0:ke.data)}).catch(function(ke){xe(ke),console.log("err:",ke)})}));case 9:case"end":return ee.stop()}},w)}));return function(_,N,j){return E.apply(this,arguments)}}(),x=function(w){var _=w.user,N=w.cancelUpload,j=Object(o.a)(w,["user","cancelUpload"]),k=Object(p.useState)([]),z=Object(h.a)(k,2),H=z[0],F=z[1],G=Object(p.useState)(),B=Object(h.a)(G,2),W=B[0],K=B[1],q={onRemove:function(Ce){F(Object(R.a)(H.filter(function(xe){return xe.name!==Ce.name}))),j.onChange(H.filter(function(xe){return xe.name!==Ce.name}))},disabled:j.disabled,multiple:!0,fileList:H==null?void 0:H.map(function(ee){return ee.file}),customRequest:function(){},beforeUpload:function(){var ee=Object(c.a)(l.a.mark(function xe(he){var ke;return l.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:if(ke=j.maxSize||1024*1024*1024*1,!H.filter(function(ce){return ce.name===he.name}).length){de.next=4;break}return S.b.info("".concat(he.name,"\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9")),de.abrupt("return");case 4:if(!((he==null?void 0:he.size)>ke)){de.next=7;break}return S.b.info("\u6587\u4EF6\u8D85\u8FC7".concat(ke/1024/1024/1024,"GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")),de.abrupt("return",!1);case 7:return H.push({name:he.name,file:he}),F(Object(R.a)(H)),j.onChange(H),de.abrupt("return",!1);case 11:case"end":return de.stop()}},xe)}));function Ce(xe){return ee.apply(this,arguments)}return Ce}()},re=function(){var ee=Object(c.a)(l.a.mark(function Ce(xe,he){var ke,_e,de,ce,ae,Se,te,ue,Oe;return l.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return he.file_name=xe.name,te=xe.name,Q.next=4,Object(b.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 4:if(ue=Q.sent,ue.data=JSON.parse(s(ue.data)),!((ue==null?void 0:ue.status)!==0)){Q.next=12;break}return H[H.findIndex(function(Y){return Y.name===te})].status="error",H[H.findIndex(function(Y){return Y.name===te})].file.status="error",j.onChange(H),S.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),Q.abrupt("return");case 12:return W=new T.a({endpoint:ue==null||((ke=ue.data)===null||ke===void 0)?void 0:ke.end_point,region:ue==null||((_e=ue.data)===null||_e===void 0)?void 0:_e.region,accessKeyId:ue==null||((de=ue.data)===null||de===void 0)?void 0:de.access_key_id,accessKeySecret:ue==null||((ce=ue.data)===null||ce===void 0)?void 0:ce.access_key_secret,bucket:ue==null||((ae=ue.data)===null||ae===void 0)?void 0:ae.bucket,stsToken:ue==null||((Se=ue.data)===null||Se===void 0)?void 0:Se.security_token}),console.log(xe,"file"),K(W),Oe=Object(n.a)(),Q.abrupt("return",new Promise(function(Y,Z){try{var be;W.multipartUpload("".concat(j.identifier,"/").concat(Oe).concat(te.indexOf(".")>-1?"."+te.split(".").pop():""),new Blob([xe.file],{type:xe.file.type}),{timeout:3600*1e3,partSize:1002400,progress:function(De,Qe,Ze){try{console.log("\u8FDB\u5EA6",De,Qe,Ze);var nt=H.findIndex(function(tt){return tt.name===te});H[nt].file.percent=De*100,H[nt].tempCheckpoint=Qe,F(Object(R.a)(H))}catch(tt){}},checkpoint:H[H.findIndex(function(ge){return ge.name===te})].tempCheckpoint,callback:{customValue:{id:te+""},url:ue==null||((be=ue.data)===null||be===void 0)?void 0:be.callback_url,host:ue==null?void 0:ue.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(b.e)(he)}}).then(function(ge){var De,Qe=H.findIndex(function(st){return st.name===te}),Ze="done";if(((De=ge.data)===null||De===void 0?void 0:De.status)===0){var nt;xe.response=(nt=ge.data)===null||nt===void 0?void 0:nt.data;var tt=H.findIndex(function(st){return st.name===te});H[tt].status="done",H[tt].file.status="done"}else{var lt;S.b.warn((lt=ge.data)===null||lt===void 0?void 0:lt.message),Ze="error"}H[Qe].status=Ze,H[Qe].file.status=Ze,j.onChange(H),Y(ge==null?void 0:ge.data)}).catch(function(ge){H[H.findIndex(function(De){return De.name===te})].status="error",H[H.findIndex(function(De){return De.name===te})].file.status="error",S.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),F(Object(R.a)(H)),j.onChange(H),Z(ge),console.log("err:",ge)})}catch(ge){}}));case 17:case"end":return Q.stop()}},Ce)}));return function(xe,he){return ee.apply(this,arguments)}}();return Object(p.useEffect)(function(){H.every(function(ee){return ee==="done"||ee==="error"})&&j.onComplete(H)},[H]),Object(p.useEffect)(function(){if(N){var ee;(ee=W)===null||ee===void 0||ee.cancel()}},[N]),Object(p.useEffect)(function(){j.uploading&&H.map(function(){var ee=Object(c.a)(l.a.mark(function Ce(xe){var he,ke;return l.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:if(!((!xe.status||xe.status==="error")&&!N)){de.next=6;break}return xe.status="uploading",xe.file.status="uploading",de.next=5,re(xe,{login:_==null||((he=_.userInfo)===null||he===void 0)?void 0:he.login,container_type:j.container_type,container_id:j.container_id,description:j.description});case 5:ke=de.sent;case 6:case"end":return de.stop()}},Ce)}));return function(Ce){return ee.apply(this,arguments)}}())},[j.uploading]),f.a.createElement(y,Object(L.a)({},q,{height:j.height,className:j.className}),f.a.createElement("p",{className:"ant-upload-hint"},j.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};J.b=Object(d.a)(function(E){var w=E.loading,_=E.globalSetting,N=E.user;return{globalSetting:_,loading:w.models.competitions,user:N}})(x)},KmYQ:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.pad.ZeroPadding={pad:function(u,S){var R=S*4;u.clamp(),u.sigBytes+=R-(u.sigBytes%R||R)},unpad:function(u){for(var S=u.words,R=u.sigBytes-1,R=u.sigBytes-1;R>=0;R--)if(S[R>>>2]>>>24-R%4*8&255){u.sigBytes=R+1;break}}},L.pad.ZeroPadding})},L9qf:function(I,J,P){I.exports={flex_box_center:"flex_box_center___3J7Qj",flex_space_between:"flex_space_between___3P3xx",flex_box_vertical_center:"flex_box_vertical_center___3QrMz",flex_box_center_end:"flex_box_center_end___37g4V",flex_box_column:"flex_box_column___2PxMN",wrap:"wrap___1xDeN",in:"in___364z1",btns:"btns___8vHXH",customModal:"customModal___2Vkln"}},LdHM:function(I,J,P){"use strict";P.d(J,"b",function(){return g}),P.d(J,"a",function(){return y});var L=P("1OyB"),u=P("vuIU"),S=P("Ji7U"),R=P("LK+K"),h=P("q1tI"),o=P("rePB"),C=P("Ff2n"),c=P("ODXe"),a=P("4IlW"),i=P("bX4T"),r=P("YrtM"),l=P("TSYQ"),p=P.n(l),f=P("+nKL"),b=P("8OUc"),v=function(K,q){var re=K.prefixCls,ee=K.id,Ce=K.flattenOptions,xe=K.childrenAsData,he=K.values,ke=K.searchValue,_e=K.multiple,de=K.defaultActiveFirstOption,ce=K.height,ae=K.itemHeight,Se=K.notFoundContent,te=K.open,ue=K.menuItemSelectedIcon,Oe=K.virtual,le=K.onSelect,Q=K.onToggleOpen,Y=K.onActiveValue,Z=K.onScroll,be=K.onMouseEnter,ge="".concat(re,"-item"),De=Object(r.a)(function(){return Ce},[te,Ce],function(qe,Ue){return Ue[0]&&qe[1]!==Ue[1]}),Qe=h.useRef(null),Ze=function(Ue){Ue.preventDefault()},nt=function(Ue){Qe.current&&Qe.current.scrollTo({index:Ue})},tt=function(Ue){for(var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ie=De.length,ye=0;ye<Ie;ye+=1){var Te=(Ue+ye*Me+Ie)%Ie,Ae=De[Te],Pe=Ae.group,Xe=Ae.data;if(!Pe&&!Xe.disabled)return Te}return-1},lt=h.useState(function(){return tt(0)}),st=Object(c.a)(lt,2),je=st[0],Re=st[1],et=function(Ue){Re(Ue);var Me=De[Ue];if(!Me){Y(null,-1);return}Y(Me.data.value,Ue)};h.useEffect(function(){et(de!==!1?tt(0):-1)},[De.length,ke]),h.useEffect(function(){var qe=setTimeout(function(){if(!_e&&te&&he.size===1){var Ue=Array.from(he)[0],Me=De.findIndex(function(Ie){var ye=Ie.data;return ye.value===Ue});et(Me),nt(Me)}});return function(){return clearTimeout(qe)}},[te]);var ct=function(Ue){Ue!==void 0&&le(Ue,{selected:!he.has(Ue)}),_e||Q(!1)};if(h.useImperativeHandle(q,function(){return{onKeyDown:function(Ue){var Me=Ue.which;switch(Me){case a.a.UP:case a.a.DOWN:{var Ie=0;if(Me===a.a.UP?Ie=-1:Me===a.a.DOWN&&(Ie=1),Ie!==0){var ye=tt(je+Ie,Ie);nt(ye),et(ye)}break}case a.a.ENTER:{var Te=De[je];Te&&!Te.data.disabled?ct(Te.data.value):ct(void 0),te&&Ue.preventDefault();break}case a.a.ESC:Q(!1)}},onKeyUp:function(){},scrollTo:function(Ue){nt(Ue)}}}),De.length===0)return h.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),className:"".concat(ge,"-empty"),onMouseDown:Ze},Se);function $e(qe){var Ue=De[qe];if(!Ue)return null;var Me=Ue.data||{},Ie=Me.value,ye=Me.label,Te=Me.children,Ae=Object(i.a)(Me,!0),Pe=xe?Te:ye;return Ue?h.createElement("div",Object.assign({"aria-label":typeof Pe=="string"?Pe:null},Ae,{key:qe,role:"option",id:"".concat(ee,"_list_").concat(qe),"aria-selected":he.has(Ie)}),Ie):null}return h.createElement(h.Fragment,null,h.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},$e(je-1),$e(je),$e(je+1)),h.createElement(f.a,{itemKey:"key",ref:Qe,data:De,height:ce,itemHeight:ae,fullHeight:!1,onMouseDown:Ze,onScroll:Z,virtual:Oe,onMouseEnter:be},function(qe,Ue){var Me,Ie=qe.group,ye=qe.groupOption,Te=qe.data,Ae=Te.label,Pe=Te.key;if(Ie)return h.createElement("div",{className:p()(ge,"".concat(ge,"-group"))},Ae!==void 0?Ae:Pe);var Xe=Te.disabled,rt=Te.value,ft=Te.title,St=Te.children,Pt=Te.style,dt=Te.className,At=Object(C.a)(Te,["disabled","value","title","children","style","className"]),Ot=he.has(rt),bt="".concat(ge,"-option"),Vt=p()(ge,bt,dt,(Me={},Object(o.a)(Me,"".concat(bt,"-grouped"),ye),Object(o.a)(Me,"".concat(bt,"-active"),je===Ue&&!Xe),Object(o.a)(Me,"".concat(bt,"-disabled"),Xe),Object(o.a)(Me,"".concat(bt,"-selected"),Ot),Me)),ir=xe?St:Ae,Qt=!ue||typeof ue=="function"||Ot;return h.createElement("div",Object.assign({},At,{"aria-selected":Ot,className:Vt,title:ft,onMouseMove:function(){if(je===Ue||Xe)return;et(Ue)},onClick:function(){Xe||ct(rt)},style:Pt}),h.createElement("div",{className:"".concat(bt,"-content")},ir||rt),h.isValidElement(ue)||Ot,Qt&&h.createElement(b.a,{className:"".concat(ge,"-option-state"),customizeIcon:ue,customizeIconProps:{isSelected:Ot}},Ot?"\u2713":null))}))},m=h.forwardRef(v);m.displayName="OptionList";var n=m,d=function(){return null};d.isSelectOption=!0;var g=d,T=function(){return null};T.isSelectOptGroup=!0;var y=T,s=P("VTBJ"),M=P("Zm9Q");function A(W){var K=W.key,q=W.props,re=q.children,ee=q.value,Ce=Object(C.a)(q,["children","value"]);return Object(s.a)({key:K,value:ee!==void 0?ee:K,children:re},Ce)}function x(W){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(M.a)(W).map(function(q,re){if(!h.isValidElement(q)||!q.type)return null;var ee=q.type.isSelectOptGroup,Ce=q.key,xe=q.props,he=xe.children,ke=Object(C.a)(xe,["children"]);return K||!ee?A(q):Object(s.a)(Object(s.a)({key:"__RC_SELECT_GRP__".concat(Ce===null?re:Ce,"__"),label:Ce},ke),{},{options:x(he)})}).filter(function(q){return q})}var E=P("2Qr1"),w=P("qNPg"),_=P("U8pU"),N=P("Kwbf"),j=P("WKfj");function k(W){var K=W.mode,q=W.options,re=W.children,ee=W.backfill,Ce=W.allowClear,xe=W.placeholder,he=W.getInputElement,ke=W.showSearch,_e=W.onSearch,de=W.defaultOpen,ce=W.autoFocus,ae=W.labelInValue,Se=W.value,te=W.inputValue,ue=W.optionLabelProp,Oe=K==="multiple"||K==="tags",le=ke!==void 0?ke:Oe||K==="combobox",Q=q||x(re);if(Object(N.a)(K!=="tags"||Q.every(function(ge){return!ge.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),K==="tags"||K==="combobox"){var Y=Q.some(function(ge){return ge.options?ge.options.some(function(De){return typeof("value"in De?De.value:De.key)=="number"}):typeof("value"in ge?ge.value:ge.key)=="number"});Object(N.a)(!Y,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(N.a)(K!=="combobox"||!ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(N.a)(K==="combobox"||!ee,"`backfill` only works with `combobox` mode."),Object(N.a)(K==="combobox"||!he,"`getInputElement` only work with `combobox` mode."),Object(N.b)(K!=="combobox"||!he||!Ce||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!le&&K!=="combobox"&&K!=="tags"&&Object(N.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(N.b)(!de||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Se!=null){var Z=Object(j.d)(Se);Object(N.a)(!ae||Z.every(function(ge){return Object(_.a)(ge)==="object"&&("key"in ge||"value"in ge)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(N.a)(!Oe||Array.isArray(Se),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var be=null;Object(M.a)(re).some(function(ge){if(!h.isValidElement(ge)||!ge.type)return!1;var De=ge.type;if(De.isSelectOption)return!1;if(De.isSelectOptGroup){var Qe=Object(M.a)(ge.props.children).every(function(Ze){return!h.isValidElement(Ze)||!ge.type||Ze.type.isSelectOption?!0:(be=Ze.type,!1)});return!Qe}return be=De,!0}),be&&Object(N.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(be.displayName||be.name||be,"`.")),Object(N.a)(te===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var z=k,H=Object(w.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:x,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:z,fillOptionsWithMissingValue:E.a}),F=function(W){Object(S.a)(q,W);var K=Object(R.a)(q);function q(){var re;return Object(L.a)(this,q),re=K.apply(this,arguments),re.selectRef=h.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(u.a)(q,[{key:"render",value:function(){return h.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),q}(h.Component);F.Option=g,F.OptGroup=y;var G=F,B=J.c=G},M8RZ:function(I,J,P){"use strict";P.d(J,"a",function(){return a});var L=P("fWQN"),u=P("mtLc"),S=P("yKVA"),R=P("879j"),h=P("q1tI"),o=P.n(h),C=P("i8i4"),c=P.n(C),a=function(i){Object(S.a)(l,i);var r=Object(R.a)(l);function l(p){var f;Object(L.a)(this,l),f=r.call(this,p);var b=window.document;return f.node=b.createElement("div"),b.body.appendChild(f.node),f}return Object(u.a)(l,[{key:"render",value:function(){var f=this.props.children;return Object(C.createPortal)(f,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),l}(o.a.Component)},MFOe:function(I,J,P){(function(L){var u=o(),S=C(),R=c(),h=typeof window!="undefined"?window:L;I.exports={assign:u,create:S,trim:R,bind:a,slice:i,each:r,map:l,pluck:p,isList:f,isFunction:b,isObject:v,Global:h};function o(){return Object.assign?Object.assign:function(n,d,g,T){for(var y=1;y<arguments.length;y++)r(Object(arguments[y]),function(s,M){n[M]=s});return n}}function C(){if(Object.create)return function(d,g,T,y){var s=i(arguments,1);return u.apply(this,[Object.create(d)].concat(s))};{function m(){}return function(d,g,T,y){var s=i(arguments,1);return m.prototype=d,u.apply(this,[new m].concat(s))}}}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 a(m,n){return function(){return n.apply(m,Array.prototype.slice.call(arguments,0))}}function i(m,n){return Array.prototype.slice.call(m,n||0)}function r(m,n){p(m,function(d,g){return n(d,g),!1})}function l(m,n){var d=f(m)?[]:{};return p(m,function(g,T){return d[T]=n(g,T),!1}),d}function p(m,n){if(f(m)){for(var d=0;d<m.length;d++)if(n(m[d],d))return m[d]}else for(var g in m)if(m.hasOwnProperty(g)&&n(m[g],g))return m[g]}function f(m){return m!=null&&typeof m!="function"&&typeof m.length=="number"}function b(m){return m&&{}.toString.call(m)==="[object Function]"}function v(m){return m&&{}.toString.call(m)==="[object Object]"}}).call(this,P("IyRk"))},MlIO:function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(u){var S=L,R=S.lib,h=R.Base,o=R.WordArray,C=S.x64={},c=C.Word=h.extend({init:function(i,r){this.high=i,this.low=r}}),a=C.WordArray=h.extend({init:function(i,r){i=this.words=i||[],r!=u?this.sigBytes=r:this.sigBytes=i.length*8},toX32:function(){for(var i=this.words,r=i.length,l=[],p=0;p<r;p++){var f=i[p];l.push(f.high),l.push(f.low)}return o.create(l,this.sigBytes)},clone:function(){for(var i=h.clone.call(this),r=i.words=this.words.slice(0),l=r.length,p=0;p<l;p++)r[p]=r[p].clone();return i}})}(),L})},NFKh:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("MlIO"),P("F+F2"),P("qM6L"),P("ETIr"),P("wbyO"),P("cv67"),P("3y9D"),P("lPiR"),P("GRuw"),P("1uat"),P("uGsb"),P("5hvy"),P("ELcG"),P("WYAk"),P("e7zE"),P("K3mO"),P("OLod"),P("ALsQ"),P("9OqN"),P("qu8F"),P("S6kV"),P("gb/T"),P("qBft"),P("oRuE"),P("jO9C"),P("KmYQ"),P("uGxW"),P("bQjk"),P("wZgz"),P("pA7S"),P("w7YG"),P("E4JC"),P("PVpz"))})(this,function(L){return L})},NvD2:function(I,J,P){"use strict";P.d(J,"a",function(){return o});var L=P("Kwbf");function u(C,c){var a=new Set;return C.forEach(function(i){c.has(i)||a.add(i)}),a}function S(C){var c=C||{},a=c.disabled,i=c.disableCheckbox,r=c.checkable;return!!(a||i)||r===!1}function R(C,c,a,i){for(var r=new Set(C),l=new Set,p=0;p<=a;p+=1){var f=c.get(p)||new Set;f.forEach(function(n){var d=n.key,g=n.node,T=n.children,y=T===void 0?[]:T;r.has(d)&&!i(g)&&y.filter(function(s){return!i(s.node)}).forEach(function(s){r.add(s.key)})})}for(var b=new Set,v=a;v>=0;v-=1){var m=c.get(v)||new Set;m.forEach(function(n){var d=n.parent,g=n.node;if(i(g)||!n.parent||b.has(n.parent.key))return;if(i(n.parent.node)){b.add(d.key);return}var T=!0,y=!1;(d.children||[]).filter(function(s){return!i(s.node)}).forEach(function(s){var M=s.key,A=r.has(M);T&&!A&&(T=!1),!y&&(A||l.has(M))&&(y=!0)}),T&&r.add(d.key),y&&l.add(d.key),b.add(d.key)})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(u(l,r))}}function h(C,c,a,i,r){for(var l=new Set(C),p=new Set(c),f=0;f<=i;f+=1){var b=a.get(f)||new Set;b.forEach(function(d){var g=d.key,T=d.node,y=d.children,s=y===void 0?[]:y;!l.has(g)&&!p.has(g)&&!r(T)&&s.filter(function(M){return!r(M.node)}).forEach(function(M){l.delete(M.key)})})}p=new Set;for(var v=new Set,m=i;m>=0;m-=1){var n=a.get(m)||new Set;n.forEach(function(d){var g=d.parent,T=d.node;if(r(T)||!d.parent||v.has(d.parent.key))return;if(r(d.parent.node)){v.add(g.key);return}var y=!0,s=!1;(g.children||[]).filter(function(M){return!r(M.node)}).forEach(function(M){var A=M.key,x=l.has(A);y&&!x&&(y=!1),!s&&(x||p.has(A))&&(s=!0)}),y||l.delete(g.key),s&&p.add(g.key),v.add(g.key)})}return{checkedKeys:Array.from(l),halfCheckedKeys:Array.from(u(p,l))}}function o(C,c,a,i){var r=[],l;i?l=i:l=S;var p=new Set(C.filter(function(m){var n=!!a[m];return n||r.push(m),n})),f=new Map,b=0;Object.keys(a).forEach(function(m){var n=a[m],d=n.level,g=f.get(d);g||(g=new Set,f.set(d,g)),g.add(n),b=Math.max(b,d)}),Object(L.a)(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(m){return"'".concat(m,"'")}).join(", ")));var v;return c===!0?v=R(p,f,b,l):v=h(p,c.halfCheckedKeys,f,b,l),v}},OLod:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("K3mO"))})(this,function(L){L.lib.Cipher||function(u){var S=L,R=S.lib,h=R.Base,o=R.WordArray,C=R.BufferedBlockAlgorithm,c=S.enc,a=c.Utf8,i=c.Base64,r=S.algo,l=r.EvpKDF,p=R.Cipher=C.extend({cfg:h.extend(),createEncryptor:function(w,_){return this.create(this._ENC_XFORM_MODE,w,_)},createDecryptor:function(w,_){return this.create(this._DEC_XFORM_MODE,w,_)},init:function(w,_,N){this.cfg=this.cfg.extend(N),this._xformMode=w,this._key=_,this.reset()},reset:function(){C.reset.call(this),this._doReset()},process:function(w){return this._append(w),this._process()},finalize:function(w){w&&this._append(w);var _=this._doFinalize();return _},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function w(_){return typeof _=="string"?E:M}return function(_){return{encrypt:function(N,j,k){return w(j).encrypt(_,N,j,k)},decrypt:function(N,j,k){return w(j).decrypt(_,N,j,k)}}}}()}),f=R.StreamCipher=p.extend({_doFinalize:function(){var w=this._process(!0);return w},blockSize:1}),b=S.mode={},v=R.BlockCipherMode=h.extend({createEncryptor:function(w,_){return this.Encryptor.create(w,_)},createDecryptor:function(w,_){return this.Decryptor.create(w,_)},init:function(w,_){this._cipher=w,this._iv=_}}),m=b.CBC=function(){var w=v.extend();w.Encryptor=w.extend({processBlock:function(N,j){var k=this._cipher,z=k.blockSize;_.call(this,N,j,z),k.encryptBlock(N,j),this._prevBlock=N.slice(j,j+z)}}),w.Decryptor=w.extend({processBlock:function(N,j){var k=this._cipher,z=k.blockSize,H=N.slice(j,j+z);k.decryptBlock(N,j),_.call(this,N,j,z),this._prevBlock=H}});function _(N,j,k){var z,H=this._iv;H?(z=H,this._iv=u):z=this._prevBlock;for(var F=0;F<k;F++)N[j+F]^=z[F]}return w}(),n=S.pad={},d=n.Pkcs7={pad:function(w,_){for(var N=_*4,j=N-w.sigBytes%N,k=j<<24|j<<16|j<<8|j,z=[],H=0;H<j;H+=4)z.push(k);var F=o.create(z,j);w.concat(F)},unpad:function(w){var _=w.words[w.sigBytes-1>>>2]&255;w.sigBytes-=_}},g=R.BlockCipher=p.extend({cfg:p.cfg.extend({mode:m,padding:d}),reset:function(){var w;p.reset.call(this);var _=this.cfg,N=_.iv,j=_.mode;this._xformMode==this._ENC_XFORM_MODE?w=j.createEncryptor:(w=j.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==w?this._mode.init(this,N&&N.words):(this._mode=w.call(j,this,N&&N.words),this._mode.__creator=w)},_doProcessBlock:function(w,_){this._mode.processBlock(w,_)},_doFinalize:function(){var w,_=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(_.pad(this._data,this.blockSize),w=this._process(!0)):(w=this._process(!0),_.unpad(w)),w},blockSize:128/32}),T=R.CipherParams=h.extend({init:function(w){this.mixIn(w)},toString:function(w){return(w||this.formatter).stringify(this)}}),y=S.format={},s=y.OpenSSL={stringify:function(w){var _,N=w.ciphertext,j=w.salt;return j?_=o.create([1398893684,1701076831]).concat(j).concat(N):_=N,_.toString(i)},parse:function(w){var _,N=i.parse(w),j=N.words;return j[0]==1398893684&&j[1]==1701076831&&(_=o.create(j.slice(2,4)),j.splice(0,4),N.sigBytes-=16),T.create({ciphertext:N,salt:_})}},M=R.SerializableCipher=h.extend({cfg:h.extend({format:s}),encrypt:function(w,_,N,j){j=this.cfg.extend(j);var k=w.createEncryptor(N,j),z=k.finalize(_),H=k.cfg;return T.create({ciphertext:z,key:N,iv:H.iv,algorithm:w,mode:H.mode,padding:H.padding,blockSize:w.blockSize,formatter:j.format})},decrypt:function(w,_,N,j){j=this.cfg.extend(j),_=this._parse(_,j.format);var k=w.createDecryptor(N,j).finalize(_.ciphertext);return k},_parse:function(w,_){return typeof w=="string"?_.parse(w,this):w}}),A=S.kdf={},x=A.OpenSSL={execute:function(w,_,N,j){j||(j=o.random(64/8));var k=l.create({keySize:_+N}).compute(w,j),z=o.create(k.words.slice(_),N*4);return k.sigBytes=_*4,T.create({key:k,iv:z,salt:j})}},E=R.PasswordBasedCipher=M.extend({cfg:M.cfg.extend({kdf:x}),encrypt:function(w,_,N,j){j=this.cfg.extend(j);var k=j.kdf.execute(N,w.keySize,w.ivSize);j.iv=k.iv;var z=M.encrypt.call(this,w,_,k.key,j);return z.mixIn(k),z},decrypt:function(w,_,N,j){j=this.cfg.extend(j),_=this._parse(_,j.format);var k=j.kdf.execute(N,w.keySize,w.ivSize,_.salt);j.iv=k.iv;var z=M.decrypt.call(this,w,_,k.key,j);return z}})}()})},OZM5:function(I,J,P){"use strict";P.d(J,"b",function(){return i}),P.d(J,"a",function(){return r}),P.d(J,"k",function(){return l}),P.d(J,"h",function(){return p}),P.d(J,"i",function(){return f}),P.d(J,"g",function(){return b}),P.d(J,"c",function(){return v}),P.d(J,"d",function(){return m}),P.d(J,"j",function(){return g}),P.d(J,"e",function(){return T}),P.d(J,"f",function(){return y});var L=P("KQm4"),u=P("U8pU"),S=P("Ff2n"),R=P("q1tI"),h=P.n(R),o=P("Kwbf"),C=P("WaYH"),c=.25,a=2;function i(s,M){var A=s.slice(),x=A.indexOf(M);return x>=0&&A.splice(x,1),A}function r(s,M){var A=s.slice();return A.indexOf(M)===-1&&A.push(M),A}function l(s){return s.split("-")}function p(s,M){return"".concat(s,"-").concat(M)}function f(s){return s&&s.type&&s.type.isTreeNode}function b(s,M){var A=[s],x=M[s];function E(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];w.forEach(function(_){var N=_.key,j=_.children;A.push(N),E(j)})}return E(x.children),A}function v(s,M){var A=s.clientY,x=M.selectHandle.getBoundingClientRect(),E=x.top,w=x.bottom,_=x.height,N=Math.max(_*c,a);return A<=E+N?-1:A>=w-N?1:0}function m(s,M){if(!s)return;var A=M.multiple;return A?s.slice():s.length?[s[0]]:s}var n=function(M){return M};function d(s,M){if(!s)return[];var A=M||{},x=A.processProps,E=x===void 0?n:x,w=Array.isArray(s)?s:[s];return w.map(function(_){var N=_.children,j=Object(S.a)(_,["children"]),k=d(N,M);return h.a.createElement(C.a,Object.assign({},E(j)),k)})}function g(s){if(!s)return null;var M;if(Array.isArray(s))M={checkedKeys:s,halfCheckedKeys:void 0};else if(Object(u.a)(s)==="object")M={checkedKeys:s.checked||void 0,halfCheckedKeys:s.halfChecked||void 0};else return Object(o.a)(!1,"`checkedKeys` is not an array or an object"),null;return M}function T(s,M){var A=new Set;function x(E){if(A.has(E))return;var w=M[E];if(!w)return;A.add(E);var _=w.parent,N=w.node;if(N.disabled)return;_&&x(_.key)}return(s||[]).forEach(function(E){x(E)}),Object(L.a)(A)}function y(s){var M={};return Object.keys(s).forEach(function(A){(A.startsWith("data-")||A.startsWith("aria-"))&&(M[A]=s[A])}),M}},Ot1p:function(I,J,P){"use strict";var L=P("2qtc"),u=P("kLXV"),S=P("rAM+"),R=P("miYZ"),h=P("tsqr"),o=P("9og8"),C=P("tJVT"),c=P("jrin"),a=P("WmNS"),i=P.n(a),r=P("q1tI"),l=P.n(r),p=P("VrN/"),f=P.n(p),b=P("bdgK"),v=P("p77/"),m=P("Bd2K"),n=P("ELLl"),d=P("19Vz"),g=P("lZu9"),T=P("+NIl"),y=P("kSUc"),s=P("9Bee"),M=function(dt){var At=dt.value,Ot=At===void 0?"":At,bt=dt.className,Vt=dt.showTextOnly,ir=dt.showLines,Qt=dt.style,dr=Qt===void 0?{}:Qt,Nt=Object(r.useMemo)(function(){return""},[Ot]);return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{dangerouslySetInnerHTML:{__html:Nt}}))},A=P("Q9mQ"),x=P("diRs"),E=P("0Owb"),w=P("dejd"),_=P("C+DQ"),N=P("D1Df"),j=P.n(N),k=P("1vsH"),z=P("m3rI"),H=[{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 F(dt){var At=dt.onActionCallback,Ot=dt.title,bt=dt.icon,Vt=dt.actionName,ir=dt.className,Qt=ir===void 0?"":ir,dr=dt.children;function Nt(){At(Vt)}return l.a.createElement("a",{title:Ot,className:Qt,onClick:Nt},l.a.createElement("i",{className:"md-iconfont ".concat(bt)}),dr)}var G=function(dt){var At=dt.watch,Ot=dt.showNullButton,bt=dt.onActionCallback,Vt=dt.fullScreen,ir=dt.insertTemp,Qt=dt.hidetoolBar,dr=dt.uuid,Nt=dt.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(k.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(k.E)("_educoder_session"),"&key=").concat(dr,"&api=").concat(encodeURIComponent(z.a.PROXY_SERVER)));var br=[].concat(H,[{title:"".concat(At?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(At?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return l.a.createElement("ul",{className:"markdown-toolbar-container"},!Qt&&br.map(function(ur,wt){return l.a.createElement("li",{key:wt},ur.actionName?l.a.createElement(F,Object(E.a)({},ur,{onActionCallback:bt})):l.a.createElement("span",{className:"v-line"}))}),Ot?l.a.createElement("li",null,l.a.createElement(F,{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,ir&&l.a.createElement("li",null,l.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ir),onActionCallback:bt},l.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),l.a.createElement("li",null,l.a.createElement(x.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:l.a.createElement("div",null,l.a.createElement(j.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(k.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(k.E)("_educoder_session"),"&key=").concat(dr,"&api=").concat(encodeURIComponent(z.a.PROXY_SERVER))}))},l.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return Nt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),l.a.createElement("li",{className:"btn-full-screen"},l.a.createElement(F,{icon:"".concat(Vt?"icon-shrink":"icon-enlarge"),title:Vt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:bt})))},B=P("M8RZ"),W=P("+L6B"),K=P("2/Rp"),q=P("y8nQ"),re=P("Vl3Y"),ee=P("5NDa"),Ce=P("5rEg"),xe={labelCol:{span:4},wrapperCol:{span:20}},he=function(dt){var At=dt.callback,Ot=dt.onCancel;function bt(Vt){At(Vt)}return l.a.createElement(re.a,Object(E.a)({},xe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:bt}),l.a.createElement(re.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},l.a.createElement(Ce.a,null)),l.a.createElement(re.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},l.a.createElement(Ce.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:Ot},"\u53D6\u6D88")))},ke=P("7ahc"),_e=P("k1fw"),de=P("HmJG"),ce=P("BjJ7"),ae=re.a.useForm,Se={width:280,marginRight:10},te={labelCol:{span:5},wrapperCol:{span:19}},ue=function(dt){var At=dt.callback,Ot=dt.onCancel,bt=ae(),Vt=Object(C.a)(bt,1),ir=Vt[0],Qt=Object(r.useRef)();function dr(ur){At(Object(_e.a)(Object(_e.a)({},ur),{},{name:Qt.current}))}function Nt(ur,wt){ir.setFieldsValue({src:"/api/attachments/".concat(ur.id,"?type=").concat(ur.content_type),type:wt.type})}function br(ur){var wt=ur.target.files[0];Qt.current=wt.name,le(wt,Nt)}return l.a.createElement(re.a,Object(E.a)({form:ir},te,{className:"upload-image-panel",onFinish:dr}),l.a.createElement(re.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},l.a.createElement("div",{className:"flex-container"},l.a.createElement(re.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},l.a.createElement(Ce.a,{style:Se})),l.a.createElement(Oe,{onFileChange:br}))),l.a.createElement(re.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},l.a.createElement(Ce.a,{style:{width:264}})),l.a.createElement(re.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:Ot},"\u53D6\u6D88")))};function Oe(dt){var At=dt.onFileChange;return l.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",l.a.createElement("input",{type:"file",onChange:At}))}function le(dt,At){if(!dt)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ot=new FormData;Ot.append("editormd-image-file",dt),Ot.append("file_param_name","editormd-image-file"),Ot.append("byxhr","true");var bt=new window.XMLHttpRequest;bt.withCredentials=!0,bt.addEventListener("load",function(Vt){At(JSON.parse(Vt.target.responseText),dt)},!1),bt.addEventListener("error",function(Vt){console.error(Vt)},!1),bt.open("POST","".concat(ce.a,"/api/attachments.json")),bt.send(Ot)}var Q=P("giR+"),Y=P("fyUT"),Z=P("7Kak"),be=P("9yH6"),ge=be.a.Group,De={margin:"0 8px"},Qe=function(dt){var At=dt.callback,Ot=dt.onCancel;function bt(Vt){At(Vt)}return l.a.createElement(re.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:De},"\u5355\u5143\u683C\u6570\uFF1A"),l.a.createElement("span",{style:De},"\u884C\u6570"),l.a.createElement(re.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},l.a.createElement(Y.a,null)),l.a.createElement("span",{style:De},"\u5217\u6570"),l.a.createElement(re.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},l.a.createElement(Y.a,null))),l.a.createElement("div",{className:"flex-container",style:{marginTop:12}},l.a.createElement("span",{style:De},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),l.a.createElement(re.a.Item,{name:"align"},l.a.createElement(ge,null,l.a.createElement(be.a,{value:"default"},l.a.createElement("i",{className:"fa fa-align-justify"})),l.a.createElement(be.a,{value:"left"},l.a.createElement("i",{className:"fa fa-align-left"})),l.a.createElement(be.a,{value:"center"},l.a.createElement("i",{className:"fa fa-align-center"})),l.a.createElement(be.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:Ot},"\u53D6\u6D88")))},Ze=P("ErOA"),nt=P("7Cbv"),tt="link",lt="upload-image",st="code-block",je="add-table",Re="------------",et={default:Re,left:":".concat(Re),center:":".concat(Re,":"),right:"".concat(Re,":")},ct=P("9VGf"),$e,qe;function Ue(){}var Me=0,Ie=1e4,ye="\u2581",Te=`
|
|
|
**\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 Ae(dt){return/^\d+$/.test(dt)?"".concat(dt,"px"):dt}var Pe=navigator.platform.toUpperCase().indexOf("MAC")>=0,Xe=Pe?"Cmd":"Ctrl",rt=["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"],ft=($e={},Object(c.a)($e,Xe+"-B","bold"),Object(c.a)($e,Xe+"-I","italic"),$e),St=(qe={},Object(c.a)(qe,tt,"\u6DFB\u52A0\u94FE\u63A5"),Object(c.a)(qe,st,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(c.a)(qe,lt,"\u6DFB\u52A0\u6587\u4EF6"),Object(c.a)(qe,je,"\u6DFB\u52A0\u8868\u683C"),qe),Pt=J.a=function(dt){var At=dt.defaultValue,Ot=At===void 0?"":At,bt=dt.onChange,Vt=dt.width,ir=Vt===void 0?"100%":Vt,Qt=dt.height,dr=Qt===void 0?400:Qt,Nt=dt.miniToolbar,br=Nt===void 0?!1:Nt,ur=dt.isFocus,wt=ur===void 0?!1:ur,hr=dt.watch,Qr=dt.insertTemp,Gr=dt.mode,Lr=Gr===void 0?"markdown":Gr,si=dt.id,Tt=si===void 0?"markdown-editor-id":si,Dt=dt.showResizeBar,Ct=Dt===void 0?!1:Dt,Rr=dt.noStorage,jr=Rr===void 0?!1:Rr,$t=dt.showNullButton,jt=$t===void 0?!1:$t,Ur=dt.hidetoolBar,_n=Ur===void 0?!1:Ur,Vr=dt.fullScreen,vt=Vr===void 0?!1:Vr,Ft=dt.onBlur,rn=dt.onCMBeforeChange,hn=dt.onFullScreen,An=dt.className,Rn=An===void 0?"":An,se=dt.disablePaste,V=se===void 0?!1:se,X=dt.placeholder,ne=X===void 0?"":X,me=dt.values,ie=me===void 0?"":me,ze=Object(r.useState)(null),pt=Object(C.a)(ze,2),ot=pt[0],It=pt[1],gt=Object(r.useState)(Ot),Ht=Object(C.a)(gt,2),Xt=Ht[0],Sr=Ht[1],an=Object(r.useState)(hr),Zr=Object(C.a)(an,2),Zt=Zr[0],Hr=Zr[1],fr=Object(r.useState)(vt),Jt=Object(C.a)(fr,2),tr=Jt[0],vr=Jt[1],Xr=Object(r.useState)(""),ln=Object(C.a)(Xr,2),mn=ln[0],li=ln[1],Ki=Object(r.useState)(0),Ui=Object(C.a)(Ki,2),Fn=Ui[0],qr=Ui[1],Oi=Object(r.useState)(dr),on=Object(C.a)(Oi,2),Zn=on[0],Yr=on[1],cr=Object(r.useState)(!1),en=Object(C.a)(cr,2),Mr=en[0],En=en[1],Fr=Object(r.useRef)(Object(nt.a)()),xi=Object(r.useRef)(!1),gn=Object(r.useRef)(),On=Object(r.useRef)(),ui=Object(r.useRef)(),ci=Object(r.useRef)(),qn=Object(r.useRef)(),Ei=function(){var Bt=Object(o.a)(i.a.mark(function ar(){var Kt,xr;return i.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:return Br.next=2,Object(Ze.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Fr.current}});case 2:xr=Br.sent,xr!=null&&(Kt=xr.attachments)!==null&&Kt!==void 0&&Kt.length&&(console.log("cm:",ot,On),xr.attachments.map(function(Or){Or.content_type.indexOf("image")>-1?ot.replaceSelection(".concat(Or.content_type,")")):Or.content_type.indexOf("video")>-1?ot.replaceSelection('<video width="100%" controls src="'.concat(z.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Or.content_type.indexOf("pdf")>-1?ot.replaceSelection('<a href="'.concat(z.a.API_SERVER,"/api/attachments/").concat(Or.id,"?type=").concat(Or.content_type,'&disposition=inline" target="_blank">').concat(Or.name,"</a>")):ot.replaceSelection("[".concat(Or.name,"](").concat(z.a.API_SERVER,"/api/attachments/").concat(Or.id,"?type=").concat(Or.content_type,")"))}));case 4:case"end":return Br.stop()}},ar)}));return function(){return Bt.apply(this,arguments)}}();Object(r.useEffect)(function(){Sr(ie),ot==null||ot.setValue(ie)},[ie]),Object(r.useEffect)(function(){hn==null||hn(tr)},[tr]),Object(r.useEffect)(function(){if(On.current){var Bt=f.a.fromTextArea(On.current,{mode:Lr,lineNumbers:!br,lineWrapping:!0,value:Ot,autoCloseTags:!0,autoCloseBrackets:!0});wt&&Bt.focus();function ar(Kt,xr){if(V){xr.preventDefault();return}var Dr=xr.clipboardData;if(Dr){var Br=Dr.types.toString(),Or=Dr.items;if(Br==="Files"||Dr.types.indexOf("Files")>-1){if(xr.preventDefault(),Lr=="stex")return;try{var un,Pn=Or[1];((un=Or[0])===null||un===void 0?void 0:un.kind)==="file"&&(Pn=Or[0]);var Er=Pn.getAsFile(),Ri=Er.name.split(".").pop();le(Er,function(Gt){if(Gt.id){var or,sr,vn;(Er==null||((or=Er.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?Bt.replaceSelection(".concat(Gt.content_type,")")):(Er==null||((sr=Er.type)===null||sr===void 0)?void 0:sr.indexOf("video"))>-1?Bt.replaceSelection('<video width="100%" controls src="'.concat(z.a.API_SERVER,"/api/attachments/").concat(Gt.id,'"></video>')):(Er==null||((vn=Er.type)===null||vn===void 0)?void 0:vn.indexOf("pdf"))>-1?Bt.replaceSelection('<a href="'.concat(z.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Er.type,'&disposition=inline" target="_blank">').concat(Er.name,"</a>")):rt.includes(Ri)?Bt.replaceSelection('<a href="'.concat(z.a.API_SERVER,"/api/attachments/").concat(Gt.id,'?type=office&disposition=inline" target="_blank">').concat(Er.name,"</a>")):Bt.replaceSelection("[".concat(Er.name,"](").concat(z.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})}catch(Gt){h.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Bt.on("paste",ar),Bt.on("dragleave",function(Kt,xr){ui.current.classList.remove("mouse-hover-md")}),Bt.on("dragover",function(Kt,xr){ui.current.classList.add("mouse-hover-md")}),Bt.on("drop",function(Kt,xr){ui.current.classList.add("mouse-hover-md");var Dr;if(Dr=xr.dataTransfer.files,Dr.length>0){xr.preventDefault(),xr.stopPropagation();for(var Br=function(Pn){var Er=Dr[Pn],Ri=Er.name.split(".").pop();le(Er,function(Gt){if(Gt.id){var or,sr,vn;(Er==null||((or=Er.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?Bt.replaceSelection(".concat(Gt.content_type,")")):(Er==null||((sr=Er.type)===null||sr===void 0)?void 0:sr.indexOf("video"))>-1?Bt.replaceSelection('<video width="100%" controls src="'.concat(z.a.API_SERVER,"/api/attachments/").concat(Gt.id,'"></video>')):(Er==null||((vn=Er.type)===null||vn===void 0)?void 0:vn.indexOf("pdf"))>-1?Bt.replaceSelection('<a href="'.concat(z.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Er.type,'&disposition=inline" target="_blank">').concat(Er.name,"</a>")):rt.includes(Ri)?Bt.replaceSelection('<a href="'.concat(z.a.API_SERVER,"/api/attachments/").concat(Gt.id,'?type=office&disposition=inline" target="_blank">').concat(Er.name,"</a>")):Bt.replaceSelection("[".concat(Er.name,"](").concat(z.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})},Or=0;Or<Dr.length;Or++)Br(Or)}}),It(Bt),function(){Bt.off("paste",ar)}}},[]);var Yn=Object(r.useCallback)(function(){if(ui.current)try{}catch(Bt){console.log(Bt,"---- to set md editor body height")}},[Zn,ui,tr]);Object(r.useEffect)(function(){function Bt(){var Kt=new b.default(function(xr){var Dr=Object(S.a)(xr),Br;try{for(Dr.s();!(Br=Dr.n()).done;){var Or=Br.value;(Or.target.offsetHeight>0||Or.target.offsetWidth>0)&&(Yn(),ot.setSize("100%","100%"),ot.refresh())}}catch(un){Dr.e(un)}finally{Dr.f()}});return Kt.observe(On.current.parentElement),Kt}if(ot){var ar=Bt();return function(){ar.unobserve(On.current.parentElement)}}},[ot,Yn]),Object(r.useEffect)(function(){if(ot){for(var Bt=[],ar=function(){var Or=xr[Kt];Dr=Object(C.a)(Or,2);var un=Dr[0],Pn=Dr[1],Er=Object(c.a)({},un,function(){Ai(Pn)});Bt.push(Er),ot.addKeyMap(Er)},Kt=0,xr=Object.entries(ft);Kt<xr.length;Kt++){var Dr;ar()}return gn.current=setInterval(function(){xi.current&&Ei()},4e3),function(){clearInterval(gn.current);var Br=Object(S.a)(Bt),Or;try{for(Br.s();!(Or=Br.n()).done;){var un=Or.value;ot.removeKeyMap(un)}}catch(Pn){Br.e(Pn)}finally{Br.f()}}}},[ot]),Object(r.useEffect)(function(){vt!==tr&&vr(vt)},[vt]),Object(ct.a)(function(){if(!jr&&Fn>0){var Bt=new Date().getTime(),ar=window.sessionStorage.getItem(Tt);Bt>=Fn+Ie&&(!ar||ar!==Xt)&&(window.sessionStorage.setItem(Tt,Xt),En(!0))}},Ie),Object(r.useEffect)(function(){Hr(hr)},[ot,hr]),Object(r.useEffect)(function(){ot&&(wt&&ot.focus())},[ot,wt]),Object(r.useEffect)(function(){if(Zt&&ot){var Bt=ot.getScrollerElement();function ar(Kt){var xr=Kt.target;if(qn.current){var Dr=xr.scrollTop/xr.scrollHeight;qn.current.scrollTop=qn.current.scrollHeight*Dr}}return Bt.addEventListener("scroll",ar),function(){Bt.removeEventListener("scroll",ar)}}},[ot,Zt]),Object(r.useEffect)(function(){if(ot&&rn){function Bt(ar,Kt){rn(ar,Kt)}return ot.on("beforeChange",Bt),function(){ot.off("beforeChange",Bt)}}},[ot,rn]),Object(r.useEffect)(function(){if(ot&&Ft){function Bt(){Ft(ot.getValue())}return ot.on("blur",Bt),function(){ot.off("blur",Bt)}}},[ot,Ft]),Object(r.useEffect)(function(){if(ot){function Bt(ar){var Kt=ar.getValue();Sr(Kt),qr(new Date().getTime()),ar.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),bt&&bt(Kt)}return ot.on("change",Bt),function(){ot.off("change",Bt)}}},[ot,bt]),Object(r.useEffect)(function(){ot&&(Ot==null?(ot.setValue(""),Sr("")):Ot!==ot.getValue()&&(ot.setValue(Ot),Sr(Ot),ot.setCursor(ot.lineCount(),0)))},[ot,Ot]);var Ai=Object(r.useCallback)(function(Bt){var ar=ot.getCursor(),Kt=ot.getSelection(),xr=Kt.split(`
|
|
|
`);switch(Bt){case"bold":return ot.replaceSelection("**"+Kt+"**"),Kt===""&&ot.setCursor(ar.line,ar.ch+2),ot.focus();case"italic":return ot.replaceSelection("*"+Kt+"*"),Kt===""&&ot.setCursor(ar.line,ar.ch+1),ot.focus();case"code":return ot.replaceSelection("`"+Kt+"`"),Kt===""&&ot.setCursor(ar.line,ar.ch+1),ot.focus();case"inline-latex":return ot.replaceSelection("`$$"+Kt+"$$`"),Kt===""&&ot.setCursor(ar.line,ar.ch+3),ot.focus();case"latex":return ot.replaceSelection("```latex\n"+Kt+"\n```"),ot.setCursor(ar.line+1,Kt.length+1),ot.focus();case"line-break":return ot.replaceSelection(`<br/>
|
|
|
`),ot.focus();case"list-ul":return Kt===""?ot.replaceSelection("- "+Kt):ot.replaceSelection(xr.map(function(Dr){return Dr===""?"":"- ".concat(Dr)}).join(`
|
|
|
`)),ot.focus();case"list-ol":return Kt===""?ot.replaceSelection("1. "+Kt):ot.replaceSelection(xr.map(function(Dr,Br){return Dr===""?"":"".concat(Br+1,". ").concat(Dr)}).join(`
|
|
|
`)),ot.focus();case"add-null-ch":return Kt===""&&ot.setCursor(ar.line,ar.ch+1),ot.replaceSelection(ye),ot.focus();case"inster-template-1":return Kt===""&&ot.setCursor(ar.line,ar.ch),ot.replaceSelection(Te),ot.focus();case"eraser":return ot.setValue(""),ot.focus();case"trigger-watch":return Hr(!Zt),ot.focus();case"trigger-full-screen":return vr(!tr),ot.focus();case tt:li(tt);return;case st:li(st);return;case lt:li(lt);return;case je:li(je);return;default:throw new Error}},[ot,Zt,tr]),zn=Object(r.useCallback)(function(Bt){li("");switch(mn){case tt:var ar=Bt.title,Kt=Bt.link;return ot.replaceSelection("[".concat(ar,"](").concat(Kt,")")),ot.focus();case st:var xr=Bt.language,Dr=Bt.content;return ot.replaceSelection(["```"+xr,Dr,"```"].join(`
|
|
|
`)),ot.focus();case lt:var Br=Bt.src,Or=Bt.alt,un=Bt.name;return Br.indexOf("type=image")>-1?ot.replaceSelection(".concat(Br,' "').concat(Or||"",'" )')):Br.indexOf("type=application/pdf")>-1?ot.replaceSelection('<a href="'.concat(Br,'&disposition=inline" target="_blank">').concat(un,"</a>")):ot.replaceSelection('<a href="'.concat(Br,'" target="_blank">').concat(un,"</a>")),ot.focus();case je:for(var Pn=Bt.row,Er=Bt.col,Ri=Bt.align,Gt=`
|
|
|
`,or=0;or<Pn;or++){for(var sr=[],vn=[],Di=0;Di<Er;Di++)or===1&&vn.push(et[Ri]),sr.push(" ");or===1&&(Gt+="| ".concat(vn.join(" | "),` |
|
|
|
`)),Gt+="| ".concat(sr.join(Er===1?"":" | "),` |
|
|
|
`)}return ot.replaceSelection(Gt+`
|
|
|
`),ot.focus();default:throw new Error}},[ot,mn]),fi=Object(r.useMemo)(function(){switch(mn){case tt:return l.a.createElement(he,{callback:zn,onCancel:pi});case st:return l.a.createElement(ke.b,{callback:zn,onCancel:pi});case lt:return l.a.createElement(ue,{callback:zn,onCancel:pi});case je:return l.a.createElement(Qe,{callback:zn,onCancel:pi});default:return null}},[mn]);function pi(){li("")}Object(r.useEffect)(function(){if(ci.current){var Bt=ci.current,ar=!1,Kt=0;function xr(Or){ar=!0,Kt=Or.pageY}function Dr(){ar=!1}function Br(Or){if(ar){var un=Or.pageY-Kt;un<0&&(un=0),un>300&&(un=300);var Pn=dr+un+"px";Yr(Pn)}}return Bt.addEventListener("mousedown",xr),document.addEventListener("mousemove",Br),document.addEventListener("mouseup",Dr),function(){Bt.removeEventListener("mousedown",xr),document.removeEventListener("mousemove",Br),document.removeEventListener("mouseup",Dr)}}},[ot,ci]),Object(r.useEffect)(function(){Yr(dr)},[dr]);var ei=Ae(ir),$r=Ae(Zn),$i={width:ei,height:$r},ta=Object(r.useMemo)(function(){if(Fn){var Bt=new Date(Fn),ar=Bt.getHours(),Kt=Bt.getMinutes(),xr=Bt.getSeconds();return ar=ar<10?"0"+ar:ar,Kt=Kt<10?"0"+Kt:Kt,xr=xr<10?"0"+xr:xr,"".concat(ar,":").concat(Kt,":").concat(xr)}return 0},[Fn]);function Ni(){window.sessionStorage.removeItem(Tt),En(!1),qr(0)}function Ji(){En(!1),qr(0),ot.setValue(window.sessionStorage.getItem(Tt))}function Gi(Bt,ar){var Kt=ot.getValue();Kt=Kt.replace(Bt,ar),Sr(Kt),ot==null||ot.setValue(Kt)}return l.a.createElement(r.Fragment,null,l.a.createElement("div",{className:"markdown-editor-wrapper",ref:ui},l.a.createElement("div",{className:"markdown-editor-container ".concat(Rn," ").concat(Zt?"on-preview":""," ").concat(br?"mini":""," ").concat(tr?"full-screen":""),style:$i},l.a.createElement(G,{insertTemp:Qr,watch:Zt,fullScreen:tr,showNullButton:jt,onActionCallback:Ai,hidetoolBar:_n,uuid:Fr.current,setOpenPhones:function(){xi.current=!0}}),l.a.createElement("div",{className:"markdown-editor-body"},l.a.createElement("div",{className:"codemirror-container"},l.a.createElement("textarea",{ref:On,placeholder:ne})),Zt?l.a.createElement("div",{ref:qn,className:"preview-container"},Lr==="stex"&&l.a.createElement(M,{value:Xt}),Lr!=="stex"&&l.a.createElement(s.a,{edit:!0,value:Xt,replaces:Gi})):null))),Ct?l.a.createElement("a",{ref:ci,className:"editor-resize"}):null,l.a.createElement(B.a,null,St[mn]?l.a.createElement(u.a,{centered:!0,title:St[mn],visible:!0,onCancel:pi,footer:null},fi):null))}},PD8m:function(I,J){I.exports={name:"memoryStorage",read:L,write:u,each:S,remove:R,clearAll:h};var P={};function L(o){return P[o]}function u(o,C){P[o]=C}function S(o){for(var C in P)P.hasOwnProperty(C)&&o(P[C],C)}function R(o){delete P[o]}function h(o){P={}}},PVpz:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.StreamCipher,h=u.algo,o=[],C=[],c=[],a=h.RabbitLegacy=R.extend({_doReset:function(){var r=this._key.words,l=this.cfg.iv,p=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],f=this._C=[r[2]<<16|r[2]>>>16,r[0]&4294901760|r[1]&65535,r[3]<<16|r[3]>>>16,r[1]&4294901760|r[2]&65535,r[0]<<16|r[0]>>>16,r[2]&4294901760|r[3]&65535,r[1]<<16|r[1]>>>16,r[3]&4294901760|r[0]&65535];this._b=0;for(var b=0;b<4;b++)i.call(this);for(var b=0;b<8;b++)f[b]^=p[b+4&7];if(l){var v=l.words,m=v[0],n=v[1],d=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,g=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,T=d>>>16|g&4294901760,y=g<<16|d&65535;f[0]^=d,f[1]^=T,f[2]^=g,f[3]^=y,f[4]^=d,f[5]^=T,f[6]^=g,f[7]^=y;for(var b=0;b<4;b++)i.call(this)}},_doProcessBlock:function(r,l){var p=this._X;i.call(this),o[0]=p[0]^p[5]>>>16^p[3]<<16,o[1]=p[2]^p[7]>>>16^p[5]<<16,o[2]=p[4]^p[1]>>>16^p[7]<<16,o[3]=p[6]^p[3]>>>16^p[1]<<16;for(var f=0;f<4;f++)o[f]=(o[f]<<8|o[f]>>>24)&16711935|(o[f]<<24|o[f]>>>8)&4278255360,r[l+f]^=o[f]},blockSize:128/32,ivSize:64/32});function i(){for(var r=this._X,l=this._C,p=0;p<8;p++)C[p]=l[p];l[0]=l[0]+1295307597+this._b|0,l[1]=l[1]+3545052371+(l[0]>>>0<C[0]>>>0?1:0)|0,l[2]=l[2]+886263092+(l[1]>>>0<C[1]>>>0?1:0)|0,l[3]=l[3]+1295307597+(l[2]>>>0<C[2]>>>0?1:0)|0,l[4]=l[4]+3545052371+(l[3]>>>0<C[3]>>>0?1:0)|0,l[5]=l[5]+886263092+(l[4]>>>0<C[4]>>>0?1:0)|0,l[6]=l[6]+1295307597+(l[5]>>>0<C[5]>>>0?1:0)|0,l[7]=l[7]+3545052371+(l[6]>>>0<C[6]>>>0?1:0)|0,this._b=l[7]>>>0<C[7]>>>0?1:0;for(var p=0;p<8;p++){var f=r[p]+l[p],b=f&65535,v=f>>>16,m=((b*b>>>17)+b*v>>>15)+v*v,n=((f&4294901760)*f|0)+((f&65535)*f|0);c[p]=m^n}r[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,r[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,r[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,r[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,r[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,r[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,r[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,r[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}u.RabbitLegacy=R._createHelper(a)}(),L.RabbitLegacy})},RELg:function(I,J,P){var L=P("MFOe"),u=L.Global;I.exports={name:"oldIE-userDataStorage",write:C,read:c,each:a,remove:i,clearAll:r};var S="storejs",R=u.document,h=f(),o=(u.navigator?u.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function C(b,v){if(o)return;var m=p(b);h(function(n){n.setAttribute(m,v),n.save(S)})}function c(b){if(o)return;var v=p(b),m=null;return h(function(n){m=n.getAttribute(v)}),m}function a(b){h(function(v){for(var m=v.XMLDocument.documentElement.attributes,n=m.length-1;n>=0;n--){var d=m[n];b(v.getAttribute(d.name),d.name)}})}function i(b){var v=p(b);h(function(m){m.removeAttribute(v),m.save(S)})}function r(){h(function(b){var v=b.XMLDocument.documentElement.attributes;b.load(S);for(var m=v.length-1;m>=0;m--)b.removeAttribute(v[m].name);b.save(S)})}var l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function p(b){return b.replace(/^\d/,"___$&").replace(l,"___")}function f(){if(!R||!R.documentElement||!R.documentElement.addBehavior)return null;var b="script",v,m,n;try{m=new ActiveXObject("htmlfile"),m.open(),m.write("<"+b+">document.w=window</"+b+'><iframe src="/favicon.ico"></iframe>'),m.close(),v=m.w.frames[0].document,n=v.createElement("div")}catch(d){n=R.createElement("div"),v=R.body}return function(d){var g=[].slice.call(arguments,0);g.unshift(n),v.appendChild(n),n.addBehavior("#default#userData"),n.load(S),d.apply(this,g),v.removeChild(n);return}}},S6kV:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.mode.OFB=function(){var u=L.lib.BlockCipherMode.extend(),S=u.Encryptor=u.extend({processBlock:function(R,h){var o=this._cipher,C=o.blockSize,c=this._iv,a=this._keystream;c&&(a=this._keystream=c.slice(0),this._iv=void 0),o.encryptBlock(a,0);for(var i=0;i<C;i++)R[h+i]^=a[i]}});return u.Decryptor=S,u}(),L.mode.OFB})},"SA+Z":function(I,J,P){var L=P("wTVA"),u=P("EbDI"),S=P("ZhPi"),R=P("wkBT");function h(o){return L(o)||u(o)||S(o)||R()}I.exports=h,I.exports.__esModule=!0,I.exports.default=I.exports},SJMd:function(I,J){/**
|
|
|
* @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 P,L,u,S=!1,R,h;window.PR_SHOULD_USE_CONTINUATION=!0;var o,C;(function(){var c=window,a=["break,continue,do,else,for,if,return,while"],i=[a,"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"],r=[i,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],l=[r,"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"],p=[r,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],f=[r,"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"],b="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",v=[r,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],m="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=[a,"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"],d=[a,"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"],g=[a,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[l,f,p,v,m,n,d,g],y=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,s="str",M="kwd",A="com",x="typ",E="lit",w="pun",_="pln",N="tag",j="dec",k="src",z="atn",H="atv",F="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(le){for(var Q=0,Y=!1,Z=!1,be=0,ge=le.length;be<ge;++be){var De=le[be];if(De.ignoreCase)Z=!0;else if(/[a-z]/i.test(De.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Y=!0,Z=!1;break}}var Qe={b:8,t:9,n:10,v:11,f:12,r:13};function Ze(je){var Re=je.charCodeAt(0);if(Re!==92)return Re;var et=je.charAt(1);return Re=Qe[et],Re||("0"<=et&&et<="7"?parseInt(je.substring(1),8):et==="u"||et==="x"?parseInt(je.substring(2),16):je.charCodeAt(1))}function nt(je){if(je<32)return(je<16?"\\x0":"\\x")+je.toString(16);var Re=String.fromCharCode(je);return Re==="\\"||Re==="-"||Re==="]"||Re==="^"?"\\"+Re:Re}function tt(je){var Re=je.substring(1,je.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")),et=[],ct=Re[0]==="^",$e=["["];ct&&$e.push("^");for(var qe=ct?1:0,Ue=Re.length;qe<Ue;++qe){var Me=Re[qe];if(/\\[bdsw]/i.test(Me))$e.push(Me);else{var Ie=Ze(Me),ye;qe+2<Ue&&Re[qe+1]==="-"?(ye=Ze(Re[qe+2]),qe+=2):ye=Ie,et.push([Ie,ye]),ye<65||Ie>122||(ye<65||Ie>90||et.push([Math.max(65,Ie)|32,Math.min(ye,90)|32]),ye<97||Ie>122||et.push([Math.max(97,Ie)&~32,Math.min(ye,122)&~32]))}}et.sort(function(Xe,rt){return Xe[0]-rt[0]||rt[1]-Xe[1]});for(var Te=[],Ae=[],qe=0;qe<et.length;++qe){var Pe=et[qe];Pe[0]<=Ae[1]+1?Ae[1]=Math.max(Ae[1],Pe[1]):Te.push(Ae=Pe)}for(var qe=0;qe<Te.length;++qe){var Pe=Te[qe];$e.push(nt(Pe[0])),Pe[1]>Pe[0]&&(Pe[1]+1>Pe[0]&&$e.push("-"),$e.push(nt(Pe[1])))}return $e.push("]"),$e.join("")}function lt(je){for(var Re=je.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")),et=Re.length,ct=[],$e=0,qe=0;$e<et;++$e){var Ue=Re[$e];if(Ue==="(")++qe;else if(Ue.charAt(0)==="\\"){var Me=+Ue.substring(1);Me&&(Me<=qe?ct[Me]=-1:Re[$e]=nt(Me))}}for(var $e=1;$e<ct.length;++$e)ct[$e]===-1&&(ct[$e]=++Q);for(var $e=0,qe=0;$e<et;++$e){var Ue=Re[$e];if(Ue==="(")++qe,ct[qe]||(Re[$e]="(?:");else if(Ue.charAt(0)==="\\"){var Me=+Ue.substring(1);Me&&Me<=qe&&(Re[$e]="\\"+ct[Me])}}for(var $e=0;$e<et;++$e)Re[$e]==="^"&&Re[$e+1]!=="^"&&(Re[$e]="");if(je.ignoreCase&&Y)for(var $e=0;$e<et;++$e){var Ue=Re[$e],Ie=Ue.charAt(0);Ue.length>=2&&Ie==="["?Re[$e]=tt(Ue):Ie!=="\\"&&(Re[$e]=Ue.replace(/[a-zA-Z]/g,function(Ae){var Pe=Ae.charCodeAt(0);return"["+String.fromCharCode(Pe&~32,Pe|32)+"]"}))}return Re.join("")}for(var st=[],be=0,ge=le.length;be<ge;++be){var De=le[be];if(De.global||De.multiline)throw new Error(""+De);st.push("(?:"+lt(De)+")")}return new RegExp(st.join("|"),Z?"gi":"g")}function W(le,Q){var Y=/(?:^|\s)nocode(?:\s|$)/,Z=[],be=0,ge=[],De=0;function Qe(Ze){var nt=Ze.nodeType;if(nt==1){if(Y.test(Ze.className))return;for(var tt=Ze.firstChild;tt;tt=tt.nextSibling)Qe(tt);var lt=Ze.nodeName.toLowerCase();(lt==="br"||lt==="li")&&(Z[De]=`
|
|
|
`,ge[De<<1]=be++,ge[De++<<1|1]=Ze)}else if(nt==3||nt==4){var st=Ze.nodeValue;st.length&&(Q?st=st.replace(/\r\n?/g,`
|
|
|
`):st=st.replace(/[ \t\r\n]+/g," "),Z[De]=st,ge[De<<1]=be,be+=st.length,ge[De++<<1|1]=Ze)}}return Qe(le),{sourceCode:Z.join("").replace(/\n$/,""),spans:ge}}function K(le,Q,Y,Z,be){if(!Y)return;var ge={sourceNode:le,pre:1,langExtension:null,numberLines:null,sourceCode:Y,spans:null,basePos:Q,decorations:null};Z(ge),be.push.apply(be,ge.decorations)}var q=/\S/;function re(le){for(var Q=void 0,Y=le.firstChild;Y;Y=Y.nextSibling){var Z=Y.nodeType;Q=Z===1?Q?le:Y:Z===3&&q.test(Y.nodeValue)?le:Q}return Q===le?void 0:Q}function ee(le,Q){var Y={},Z;(function(){for(var De=le.concat(Q),Qe=[],Ze={},nt=0,tt=De.length;nt<tt;++nt){var lt=De[nt],st=lt[3];if(st)for(var je=st.length;--je>=0;)Y[st.charAt(je)]=lt;var Re=lt[1],et=""+Re;Ze.hasOwnProperty(et)||(Qe.push(Re),Ze[et]=null)}Qe.push(/[\0-\uffff]/),Z=B(Qe)})();var be=Q.length,ge=function(De){for(var Qe=De.sourceCode,Ze=De.basePos,nt=De.sourceNode,tt=[Ze,_],lt=0,st=Qe.match(Z)||[],je={},Re=0,et=st.length;Re<et;++Re){var ct=st[Re],$e=je[ct],qe=void 0,Ue;if(typeof $e=="string")Ue=!1;else{var Me=Y[ct.charAt(0)];if(Me)qe=ct.match(Me[1]),$e=Me[0];else{for(var Ie=0;Ie<be;++Ie)if(Me=Q[Ie],qe=ct.match(Me[1]),qe){$e=Me[0];break}qe||($e=_)}Ue=$e.length>=5&&$e.substring(0,5)==="lang-",Ue&&!(qe&&typeof qe[1]=="string")&&(Ue=!1,$e=k),Ue||(je[ct]=$e)}var ye=lt;if(lt+=ct.length,!Ue)tt.push(Ze+ye,$e);else{var Te=qe[1],Ae=ct.indexOf(Te),Pe=Ae+Te.length;qe[2]&&(Pe=ct.length-qe[2].length,Ae=Pe-Te.length);var Xe=$e.substring(5);K(nt,Ze+ye,ct.substring(0,Ae),ge,tt),K(nt,Ze+ye+Ae,Te,ce(Xe,Te),tt),K(nt,Ze+ye+Pe,ct.substring(Pe),ge,tt)}}De.decorations=tt};return ge}function Ce(le){var Q=[],Y=[];le.tripleQuotedStrings?Q.push([s,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):le.multiLineStrings?Q.push([s,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Q.push([s,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),le.verbatimStrings&&Y.push([s,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Z=le.hashComments;Z&&(le.cStyleComments?(Z>1?Q.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Q.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Y.push([s,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Q.push([A,/^#[^\r\n]*/,null,"#"])),le.cStyleComments&&(Y.push([A,/^\/\/[^\r\n]*/,null]),Y.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var be=le.regexLiterals;if(be){var ge=be>1?"":`
|
|
|
\r`,De=ge?".":"[\\S\\s]",Qe="/(?=[^/*"+ge+"])(?:[^/\\x5B\\x5C"+ge+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+ge+"]|\\x5C"+De+")*(?:\\x5D|$))+/";Y.push(["lang-regex",RegExp("^"+G+"("+Qe+")")])}var Ze=le.types;Ze&&Y.push([x,Ze]);var nt=(""+le.keywords).replace(/^ | $/g,"");nt.length&&Y.push([M,new RegExp("^(?:"+nt.replace(/[\s,]+/g,"|")+")\\b"),null]),Q.push([_,/^\s+/,null,` \r
|
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return le.regexLiterals&&(tt+="(?!s*/)"),Y.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[x,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[_,/^[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"],[_,/^\\[\s\S]?/,null],[w,new RegExp(tt),null]),ee(Q,Y)}var xe=Ce({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function he(le,Q,Y){for(var Z=/(?:^|\s)nocode(?:\s|$)/,be=/\r\n?|\n/,ge=le.ownerDocument,De=ge.createElement("li");le.firstChild;)De.appendChild(le.firstChild);var Qe=[De];function Ze(Re){var et=Re.nodeType;if(et==1&&!Z.test(Re.className))if(Re.nodeName==="br")nt(Re),Re.parentNode&&Re.parentNode.removeChild(Re);else for(var ct=Re.firstChild;ct;ct=ct.nextSibling)Ze(ct);else if((et==3||et==4)&&Y){var $e=Re.nodeValue,qe=$e.match(be);if(qe){var Ue=$e.substring(0,qe.index);Re.nodeValue=Ue;var Me=$e.substring(qe.index+qe[0].length);if(Me){var Ie=Re.parentNode;Ie.insertBefore(ge.createTextNode(Me),Re.nextSibling)}nt(Re),Ue||Re.parentNode.removeChild(Re)}}}function nt(Re){for(;!Re.nextSibling;)if(Re=Re.parentNode,!Re)return;function et(qe,Ue){var Me=Ue?qe.cloneNode(!1):qe,Ie=qe.parentNode;if(Ie){var ye=et(Ie,1),Te=qe.nextSibling;ye.appendChild(Me);for(var Ae=Te;Ae;Ae=Te)Te=Ae.nextSibling,ye.appendChild(Ae)}return Me}for(var ct=et(Re.nextSibling,0),$e;($e=ct.parentNode)&&$e.nodeType===1;)ct=$e;Qe.push(ct)}for(var tt=0;tt<Qe.length;++tt)Ze(Qe[tt]);Q===(Q|0)&&Qe[0].setAttribute("value",Q);var lt=ge.createElement("ol");lt.className="linenums";for(var st=Math.max(0,Q-1|0)||0,tt=0,je=Qe.length;tt<je;++tt)De=Qe[tt],De.className="L"+(tt+st)%10,De.firstChild||De.appendChild(ge.createTextNode("\xA0")),lt.appendChild(De);le.appendChild(lt)}function ke(le){var Q=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Q=Q&&+Q[1]<=8;var Y=/\n/g,Z=le.sourceCode,be=Z.length,ge=0,De=le.spans,Qe=De.length,Ze=0,nt=le.decorations,tt=nt.length,lt=0;nt[tt]=be;var st,je;for(je=st=0;je<tt;)nt[je]!==nt[je+2]?(nt[st++]=nt[je++],nt[st++]=nt[je++]):je+=2;for(tt=st,je=st=0;je<tt;){for(var Re=nt[je],et=nt[je+1],ct=je+2;ct+2<=tt&&nt[ct+1]===et;)ct+=2;nt[st++]=Re,nt[st++]=et,je=ct}tt=nt.length=st;var $e=le.sourceNode,qe="";$e&&(qe=$e.style.display,$e.style.display="none");try{for(var Ue=null;Ze<Qe;){var Me=De[Ze],Ie=De[Ze+2]||be,ye=nt[lt+2]||be,ct=Math.min(Ie,ye),Te=De[Ze+1],Ae;if(Te.nodeType!==1&&(Ae=Z.substring(ge,ct))){Q&&(Ae=Ae.replace(Y,"\r")),Te.nodeValue=Ae;var Pe=Te.ownerDocument,Xe=Pe.createElement("span");Xe.className=nt[lt+1];var rt=Te.parentNode;rt.replaceChild(Xe,Te),Xe.appendChild(Te),ge<Ie&&(De[Ze+1]=Te=Pe.createTextNode(Z.substring(ct,Ie)),rt.insertBefore(Te,Xe.nextSibling))}ge=ct,ge>=Ie&&(Ze+=2),ge>=ye&&(lt+=2)}}finally{$e&&($e.style.display=qe)}}var _e={};function de(le,Q){for(var Y=Q.length;--Y>=0;){var Z=Q[Y];_e.hasOwnProperty(Z)?c.console&&console.warn("cannot override language handler %s",Z):_e[Z]=le}}function ce(le,Q){return le&&_e.hasOwnProperty(le)||(le=/^\s*</.test(Q)?"default-markup":"default-code"),_e[le]}de(xe,["default-code"]),de(ee([],[[_,/^[^<?]+/],[j,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[w,/^(?:<[%?]|[%?]>)/],["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"]),de(ee([[_,/^[\s]+/,null,` \r
|
|
|
`],[H,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[N,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[z,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[w,/^[=<>\/]+/],["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"]),de(ee([],[[H,/^[\s\S]+/]]),["uq.val"]),de(Ce({keywords:l,hashComments:!0,cStyleComments:!0,types:y}),["c","cc","cpp","cxx","cyc","m"]),de(Ce({keywords:"null,true,false"}),["json"]),de(Ce({keywords:f,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:y}),["cs"]),de(Ce({keywords:p,cStyleComments:!0}),["java"]),de(Ce({keywords:g,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),de(Ce({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),de(Ce({keywords:m,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),de(Ce({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),de(Ce({keywords:v,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),de(Ce({keywords:b,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),de(ee([],[[s,/^[\s\S]+/]]),["regex"]);function ae(le){var Q=le.langExtension;try{var Y=W(le.sourceNode,le.pre),Z=Y.sourceCode;le.sourceCode=Z,le.spans=Y.spans,le.basePos=0,ce(Q,Z)(le),ke(le)}catch(be){c.console&&console.log(be&&be.stack||be)}}function Se(le,Q,Y){var Z=Y||!1,be=Q||null,ge=document.createElement("div");ge.innerHTML="<pre>"+le+"</pre>",ge=ge.firstChild,Z&&he(ge,Z,!0);var De={langExtension:be,numberLines:Z,sourceNode:ge,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ae(De),ge.innerHTML}function te(le,Q){var Y=Q||document.body,Z=Y.ownerDocument||document;function be(Me){return Y.getElementsByTagName(Me)}for(var ge=[be("pre"),be("code"),be("xmp")],De=[],Qe=0;Qe<ge.length;++Qe)for(var Ze=0,nt=ge[Qe].length;Ze<nt;++Ze)De.push(ge[Qe][Ze]);ge=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var lt=0,st=/\blang(?:uage)?-([\w.]+)(?!\S)/,je=/\bprettyprint\b/,Re=/\bprettyprinted\b/,et=/pre|xmp/i,ct=/^code$/i,$e=/^(?:pre|code|xmp)$/i,qe={};function Ue(){for(var Me=c.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;lt<De.length&&tt.now()<Me;lt++){for(var Ie=De[lt],ye=qe,Te=Ie;Te=Te.previousSibling;){var Ae=Te.nodeType,Pe=(Ae===7||Ae===8)&&Te.nodeValue;if(Pe?!/^\??prettify\b/.test(Pe):Ae!==3||/\S/.test(Te.nodeValue))break;if(Pe){ye={},Pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(dr,Nt,br){ye[Nt]=br});break}}var Xe=Ie.className;if((ye!==qe||je.test(Xe))&&!Re.test(Xe)){for(var rt=!1,ft=Ie.parentNode;ft;ft=ft.parentNode){var St=ft.tagName;if($e.test(St)&&ft.className&&je.test(ft.className)){rt=!0;break}}if(!rt){Ie.className+=" prettyprinted";var Pt=ye.lang;if(!Pt){Pt=Xe.match(st);var dt;!Pt&&(dt=re(Ie))&&ct.test(dt.tagName)&&(Pt=dt.className.match(st)),Pt&&(Pt=Pt[1])}var At;if(et.test(Ie.tagName))At=1;else{var Ot=Ie.currentStyle,bt=Z.defaultView,Vt=Ot?Ot.whiteSpace:bt&&bt.getComputedStyle?bt.getComputedStyle(Ie,null).getPropertyValue("white-space"):0;At=Vt&&Vt.substring(0,3)==="pre"}var ir=ye.linenums;(ir=ir==="true"||+ir)||(ir=Xe.match(/\blinenums\b(?::(\d+))?/),ir=ir?ir[1]&&ir[1].length?+ir[1]:!0:!1),ir&&he(Ie,ir,At);var Qt={langExtension:Pt,sourceNode:Ie,numberLines:ir,pre:At,sourceCode:null,basePos:null,spans:null,decorations:null};ae(Qt)}}}lt<De.length?c.setTimeout(Ue,250):typeof le=="function"&&le()}Ue()}var ue=c.PR={createSimpleLexer:ee,registerLangHandler:de,sourceDecorator:Ce,PR_ATTRIB_NAME:z,PR_ATTRIB_VALUE:H,PR_COMMENT:A,PR_DECLARATION:j,PR_KEYWORD:M,PR_LITERAL:E,PR_NOCODE:F,PR_PLAIN:_,PR_PUNCTUATION:w,PR_SOURCE:k,PR_STRING:s,PR_TAG:N,PR_TYPE:x,prettyPrintOne:S?c.prettyPrintOne=Se:o=Se,prettyPrint:C=S?c.prettyPrint=te:C=te},Oe=c.define;typeof Oe=="function"&&Oe.amd&&Oe("google-code-prettify",[],function(){return ue})})()},"VrN/":function(I,J,P){(function(L,u){I.exports=u()})(this,function(){"use strict";var L=navigator.userAgent,u=navigator.platform,S=/gecko\/\d/i.test(L),R=/MSIE \d/.test(L),h=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(L),o=/Edge\/(\d+)/.exec(L),C=R||h||o,c=C&&(R?document.documentMode||6:+(o||h)[1]),a=!o&&/WebKit\//.test(L),i=a&&/Qt\/\d+\.\d+/.test(L),r=!o&&/Chrome\//.test(L),l=/Opera\//.test(L),p=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(L),b=/PhantomJS/.test(L),v=!o&&/AppleWebKit/.test(L)&&/Mobile\/\w+/.test(L),m=/Android/.test(L),n=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(L),d=v||/Mac/.test(u),g=/\bCrOS\b/.test(L),T=/win/i.test(u),y=l&&L.match(/Version\/(\d*\.\d*)/);y&&(y=Number(y[1])),y&&y>=15&&(l=!1,a=!0);var s=d&&(i||l&&(y==null||y<12.11)),M=S||C&&c>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var x=function(e,t){var D=e.className,O=A(t).exec(D);if(O){var U=D.slice(O.index+O[0].length);e.className=D.slice(0,O.index)+(U?O[1]+U:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function w(e,t){return E(e).appendChild(t)}function _(e,t,D,O){var U=document.createElement(e);if(D&&(U.className=D),O&&(U.style.cssText=O),typeof t=="string")U.appendChild(document.createTextNode(t));else if(t)for(var $=0;$<t.length;++$)U.appendChild(t[$]);return U}function N(e,t,D,O){var U=_(e,t,D,O);return U.setAttribute("role","presentation"),U}var j;document.createRange?j=function(e,t,D,O){var U=document.createRange();return U.setEnd(O||e,D),U.setStart(e,t),U}:j=function(e,t,D){var O=document.body.createTextRange();try{O.moveToElementText(e.parentNode)}catch(U){return O}return O.collapse(!0),O.moveEnd("character",D),O.moveStart("character",t),O};function k(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function z(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var D=e.className;A(t).test(D)||(e.className+=(D?" ":"")+t)}function F(e,t){for(var D=e.split(" "),O=0;O<D.length;O++)D[O]&&!A(D[O]).test(t)&&(t+=" "+D[O]);return t}var G=function(e){e.select()};v?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:C&&(G=function(e){try{e.select()}catch(t){}});function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function W(e,t,D){t||(t={});for(var O in e)e.hasOwnProperty(O)&&(D!==!1||!t.hasOwnProperty(O))&&(t[O]=e[O]);return t}function K(e,t,D,O,U){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var $=O||0,oe=U||0;;){var fe=e.indexOf(" ",$);if(fe<0||fe>=t)return oe+(t-$);oe+=fe-$,oe+=D-oe%D,$=fe+1}}var q=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},q.prototype.set=function(e,t){this.f=t;var D=+new Date+e;(!this.id||D<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=D)};function re(e,t){for(var D=0;D<e.length;++D)if(e[D]==t)return D;return-1}var ee=50,Ce={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},he={origin:"*mouse"},ke={origin:"+move"};function _e(e,t,D){for(var O=0,U=0;;){var $=e.indexOf(" ",O);$==-1&&($=e.length);var oe=$-O;if($==e.length||U+oe>=t)return O+Math.min(oe,t-U);if(U+=$-O,U+=D-U%D,O=$+1,U>=t)return O}}var de=[""];function ce(e){for(;de.length<=e;)de.push(ae(de)+" ");return de[e]}function ae(e){return e[e.length-1]}function Se(e,t){for(var D=[],O=0;O<e.length;O++)D[O]=t(e[O],O);return D}function te(e,t,D){for(var O=0,U=D(t);O<e.length&&D(e[O])<=U;)O++;e.splice(O,0,t)}function ue(){}function Oe(e,t){var D;return Object.create?D=Object.create(e):(ue.prototype=e,D=new ue),t&&W(t,D),D}var le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||le.test(e))}function Y(e,t){return t?t.source.indexOf("\\w")>-1&&Q(e)?!0:t.test(e):Q(e)}function Z(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var be=/[\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 ge(e){return e.charCodeAt(0)>=768&&be.test(e)}function De(e,t,D){for(;(D<0?t>0:t<e.length)&&ge(e.charAt(t));)t+=D;return t}function Qe(e,t,D){for(var O=t>D?-1:1;;){if(t==D)return t;var U=(t+D)/2,$=O<0?Math.ceil(U):Math.floor(U);if($==t)return e($)?t:D;e($)?D=$:t=$+O}}function Ze(e,t,D,O){if(!e)return O(t,D,"ltr",0);for(var U=!1,$=0;$<e.length;++$){var oe=e[$];(oe.from<D&&oe.to>t||t==D&&oe.to==t)&&(O(Math.max(oe.from,t),Math.min(oe.to,D),oe.level==1?"rtl":"ltr",$),U=!0)}U||O(t,D,"ltr")}var nt=null;function tt(e,t,D){var O;nt=null;for(var U=0;U<e.length;++U){var $=e[U];if($.from<t&&$.to>t)return U;$.to==t&&($.from!=$.to&&D=="before"?O=U:nt=U),$.from==t&&($.from!=$.to&&D!="before"?O=U:nt=U)}return O!=null?O:nt}var lt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function D(Ee){return Ee<=247?e.charAt(Ee):1424<=Ee&&Ee<=1524?"R":1536<=Ee&&Ee<=1785?t.charAt(Ee-1536):1774<=Ee&&Ee<=2220?"r":8192<=Ee&&Ee<=8203?"w":Ee==8204?"b":"L"}var O=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,U=/[stwN]/,$=/[LRr]/,oe=/[Lb1n]/,fe=/[1n]/;function pe(Ee,We,Ke){this.level=Ee,this.from=We,this.to=Ke}return function(Ee,We){var Ke=We=="ltr"?"L":"R";if(Ee.length==0||We=="ltr"&&!O.test(Ee))return!1;for(var ut=Ee.length,at=[],mt=0;mt<ut;++mt)at.push(D(Ee.charCodeAt(mt)));for(var yt=0,_t=Ke;yt<ut;++yt){var kt=at[yt];kt=="m"?at[yt]=_t:_t=kt}for(var Ut=0,Lt=Ke;Ut<ut;++Ut){var Wt=at[Ut];Wt=="1"&&Lt=="r"?at[Ut]="n":$.test(Wt)&&(Lt=Wt,Wt=="r"&&(at[Ut]="R"))}for(var lr=1,er=at[0];lr<ut-1;++lr){var kr=at[lr];kr=="+"&&er=="1"&&at[lr+1]=="1"?at[lr]="1":kr==","&&er==at[lr+1]&&(er=="1"||er=="n")&&(at[lr]=er),er=kr}for(var Tn=0;Tn<ut;++Tn){var di=at[Tn];if(di==",")at[Tn]="N";else if(di=="%"){var Un=void 0;for(Un=Tn+1;Un<ut&&at[Un]=="%";++Un);for(var ji=Tn&&at[Tn-1]=="!"||Un<ut&&at[Un]=="1"?"1":"N",Mi=Tn;Mi<Un;++Mi)at[Mi]=ji;Tn=Un-1}}for(var Jn=0,Pi=Ke;Jn<ut;++Jn){var gi=at[Jn];Pi=="L"&&gi=="1"?at[Jn]="L":$.test(gi)&&(Pi=gi)}for(var oi=0;oi<ut;++oi)if(U.test(at[oi])){var Qn=void 0;for(Qn=oi+1;Qn<ut&&U.test(at[Qn]);++Qn);for(var Hn=(oi?at[oi-1]:Ke)=="L",Ii=(Qn<ut?at[Qn]:Ke)=="L",Za=Hn==Ii?Hn?"L":"R":Ke,_a=oi;_a<Qn;++_a)at[_a]=Za;oi=Qn-1}for(var bi=[],ua,hi=0;hi<ut;)if(oe.test(at[hi])){var ps=hi;for(++hi;hi<ut&&oe.test(at[hi]);++hi);bi.push(new pe(0,ps,hi))}else{var ga=hi,La=bi.length,Ma=We=="rtl"?1:0;for(++hi;hi<ut&&at[hi]!="L";++hi);for(var _i=ga;_i<hi;)if(fe.test(at[_i])){ga<_i&&(bi.splice(La,0,new pe(1,ga,_i)),La+=Ma);var qa=_i;for(++_i;_i<hi&&fe.test(at[_i]);++_i);bi.splice(La,0,new pe(2,qa,_i)),La+=Ma,ga=_i}else++_i;ga<hi&&bi.splice(La,0,new pe(1,ga,hi))}return We=="ltr"&&(bi[0].level==1&&(ua=Ee.match(/^\s+/))&&(bi[0].from=ua[0].length,bi.unshift(new pe(0,0,ua[0].length))),ae(bi).level==1&&(ua=Ee.match(/\s+$/))&&(ae(bi).to-=ua[0].length,bi.push(new pe(0,ut-ua[0].length,ut)))),We=="rtl"?bi.reverse():bi}}();function st(e,t){var D=e.order;return D==null&&(D=e.order=lt(e.text,t)),D}var je=[],Re=function(e,t,D){if(e.addEventListener)e.addEventListener(t,D,!1);else if(e.attachEvent)e.attachEvent("on"+t,D);else{var O=e._handlers||(e._handlers={});O[t]=(O[t]||je).concat(D)}};function et(e,t){return e._handlers&&e._handlers[t]||je}function ct(e,t,D){if(e.removeEventListener)e.removeEventListener(t,D,!1);else if(e.detachEvent)e.detachEvent("on"+t,D);else{var O=e._handlers,U=O&&O[t];if(U){var $=re(U,D);$>-1&&(O[t]=U.slice(0,$).concat(U.slice($+1)))}}}function $e(e,t){var D=et(e,t);if(!D.length)return;for(var O=Array.prototype.slice.call(arguments,2),U=0;U<D.length;++U)D[U].apply(null,O)}function qe(e,t,D){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),$e(e,D||t.type,e,t),Ae(t)||t.codemirrorIgnore}function Ue(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var D=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),O=0;O<t.length;++O)re(D,t[O])==-1&&D.push(t[O])}function Me(e,t){return et(e,t).length>0}function Ie(e){e.prototype.on=function(t,D){Re(this,t,D)},e.prototype.off=function(t,D){ct(this,t,D)}}function ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Te(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ae(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Pe(e){ye(e),Te(e)}function Xe(e){return e.target||e.srcElement}function rt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),d&&e.ctrlKey&&t==1&&(t=3),t}var ft=function(){if(C&&c<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}(),St;function Pt(e){if(St==null){var t=_("span","\u200B");w(e,_("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(St=t.offsetWidth<=1&&t.offsetHeight>2&&!(C&&c<8))}var D=St?_("span","\u200B"):_("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return D.setAttribute("cm-text",""),D}var dt;function At(e){if(dt!=null)return dt;var t=w(e,document.createTextNode("A\u062EA")),D=j(t,0,1).getBoundingClientRect(),O=j(t,1,2).getBoundingClientRect();return E(e),!D||D.left==D.right?!1:dt=O.right-D.right<3}var Ot=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,D=[],O=e.length;t<=O;){var U=e.indexOf(`
|
|
|
`,t);U==-1&&(U=e.length);var $=e.slice(t,e.charAt(U-1)=="\r"?U-1:U),oe=$.indexOf("\r");oe!=-1?(D.push($.slice(0,oe)),t+=oe+1):(D.push($),t=U+1)}return D}:function(e){return e.split(/\r\n?|\n/)},bt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(D){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Vt=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ir=null;function Qt(e){if(ir!=null)return ir;var t=w(e,_("span","x")),D=t.getBoundingClientRect(),O=j(t,0,1).getBoundingClientRect();return ir=Math.abs(D.left-O.left)>1}var dr={},Nt={};function br(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),dr[e]=t}function ur(e,t){Nt[e]=t}function wt(e){if(typeof e=="string"&&Nt.hasOwnProperty(e))e=Nt[e];else if(e&&typeof e.name=="string"&&Nt.hasOwnProperty(e.name)){var t=Nt[e.name];typeof t=="string"&&(t={name:t}),e=Oe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return wt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return wt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function hr(e,t){t=wt(t);var D=dr[t.name];if(!D)return hr(e,"text/plain");var O=D(e,t);if(Qr.hasOwnProperty(t.name)){var U=Qr[t.name];for(var $ in U){if(!U.hasOwnProperty($))continue;O.hasOwnProperty($)&&(O["_"+$]=O[$]),O[$]=U[$]}}if(O.name=t.name,t.helperType&&(O.helperType=t.helperType),t.modeProps)for(var oe in t.modeProps)O[oe]=t.modeProps[oe];return O}var Qr={};function Gr(e,t){var D=Qr.hasOwnProperty(e)?Qr[e]:Qr[e]={};W(t,D)}function Lr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var D={};for(var O in t){var U=t[O];U instanceof Array&&(U=U.concat([])),D[O]=U}return D}function si(e,t){for(var D;e.innerMode&&!(D=e.innerMode(t),!D||D.mode==e);)t=D.state,e=D.mode;return D||{mode:e,state:t}}function Tt(e,t,D){return e.startState?e.startState(t,D):!0}var Dt=function(e,t,D){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=D};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Dt.prototype.eat=function(e){var t=this.string.charAt(this.pos),D;if(typeof e=="string"?D=t==e:D=t&&(e.test?e.test(t):e(t)),D)return++this.pos,t},Dt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=K(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.indentation=function(){return K(this.string,null,this.tabSize)-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.match=function(e,t,D){if(typeof e=="string"){var O=function(oe){return D?oe.toLowerCase():oe},U=this.string.substr(this.pos,e.length);if(O(U)==O(e))return t!==!1&&(this.pos+=e.length),!0}else{var $=this.string.slice(this.pos).match(e);return $&&$.index>0?null:($&&t!==!1&&(this.pos+=$[0].length),$)}},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var D=e;!D.lines;)for(var O=0;;++O){var U=D.children[O],$=U.chunkSize();if(t<$){D=U;break}t-=$}return D.lines[t]}function Rr(e,t,D){var O=[],U=t.line;return e.iter(t.line,D.line+1,function($){var oe=$.text;U==D.line&&(oe=oe.slice(0,D.ch)),U==t.line&&(oe=oe.slice(t.ch)),O.push(oe),++U}),O}function jr(e,t,D){var O=[];return e.iter(t,D,function(U){O.push(U.text)}),O}function $t(e,t){var D=t-e.height;if(D)for(var O=e;O;O=O.parent)O.height+=D}function jt(e){if(e.parent==null)return null;for(var t=e.parent,D=re(t.lines,e),O=t.parent;O;t=O,O=O.parent)for(var U=0;!(O.children[U]==t);++U)D+=O.children[U].chunkSize();return D+t.first}function Ur(e,t){var D=e.first;e:do{for(var O=0;O<e.children.length;++O){var U=e.children[O],$=U.height;if(t<$){e=U;continue e}t-=$,D+=U.chunkSize()}return D}while(!e.lines);for(var oe=0;oe<e.lines.length;++oe){var fe=e.lines[oe],pe=fe.height;if(t<pe)break;t-=pe}return D+oe}function _n(e,t){return t>=e.first&&t<e.first+e.size}function Vr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function vt(e,t,D){if(D===void 0&&(D=null),!(this instanceof vt))return new vt(e,t,D);this.line=e,this.ch=t,this.sticky=D}function Ft(e,t){return e.line-t.line||e.ch-t.ch}function rn(e,t){return e.sticky==t.sticky&&Ft(e,t)==0}function hn(e){return vt(e.line,e.ch)}function An(e,t){return Ft(e,t)<0?t:e}function Rn(e,t){return Ft(e,t)<0?e:t}function se(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function V(e,t){if(t.line<e.first)return vt(e.first,0);var D=e.first+e.size-1;return t.line>D?vt(D,Ct(e,D).text.length):X(t,Ct(e,t.line).text.length)}function X(e,t){var D=e.ch;return D==null||D>t?vt(e.line,t):D<0?vt(e.line,0):e}function ne(e,t){for(var D=[],O=0;O<t.length;O++)D[O]=V(e,t[O]);return D}var me=function(e,t){this.state=e,this.lookAhead=t},ie=function(e,t,D,O){this.state=t,this.doc=e,this.line=D,this.maxLookAhead=O||0,this.baseTokens=null,this.baseTokenPos=1};ie.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ie.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ie.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ie.fromSaved=function(e,t,D){return t instanceof me?new ie(e,Lr(e.mode,t.state),D,t.lookAhead):new ie(e,Lr(e.mode,t),D)},ie.prototype.save=function(e){var t=e!==!1?Lr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new me(t,this.maxLookAhead):t};function ze(e,t,D,O){var U=[e.state.modeGen],$={};Zr(e,t.text,e.doc.mode,D,function(Ee,We){return U.push(Ee,We)},$,O);for(var oe=D.state,fe=function(Ee){D.baseTokens=U;var We=e.state.overlays[Ee],Ke=1,ut=0;D.state=!0,Zr(e,t.text,We.mode,D,function(at,mt){for(var yt=Ke;ut<at;){var _t=U[Ke];_t>at&&U.splice(Ke,1,at,U[Ke+1],_t),Ke+=2,ut=Math.min(at,_t)}if(!mt)return;if(We.opaque)U.splice(yt,Ke-yt,at,"overlay "+mt),Ke=yt+2;else for(;yt<Ke;yt+=2){var kt=U[yt+1];U[yt+1]=(kt?kt+" ":"")+"overlay "+mt}},$),D.state=oe,D.baseTokens=null,D.baseTokenPos=1},pe=0;pe<e.state.overlays.length;++pe)fe(pe);return{styles:U,classes:$.bgClass||$.textClass?$:null}}function pt(e,t,D){if(!t.styles||t.styles[0]!=e.state.modeGen){var O=ot(e,jt(t)),U=t.text.length>e.options.maxHighlightLength&&Lr(e.doc.mode,O.state),$=ze(e,t,O);U&&(O.state=U),t.stateAfter=O.save(!U),t.styles=$.styles,$.classes?t.styleClasses=$.classes:t.styleClasses&&(t.styleClasses=null),D===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ot(e,t,D){var O=e.doc,U=e.display;if(!O.mode.startState)return new ie(O,!0,t);var $=Zt(e,t,D),oe=$>O.first&&Ct(O,$-1).stateAfter,fe=oe?ie.fromSaved(O,oe,$):new ie(O,Tt(O.mode),$);return O.iter($,t,function(pe){It(e,pe.text,fe);var Ee=fe.line;pe.stateAfter=Ee==t-1||Ee%5==0||Ee>=U.viewFrom&&Ee<U.viewTo?fe.save():null,fe.nextLine()}),D&&(O.modeFrontier=fe.line),fe}function It(e,t,D,O){var U=e.doc.mode,$=new Dt(t,e.options.tabSize,D);for($.start=$.pos=O||0,t==""&>(U,D.state);!$.eol();)Ht(U,$,D.state),$.start=$.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var D=si(e,t);if(D.mode.blankLine)return D.mode.blankLine(D.state)}function Ht(e,t,D,O){for(var U=0;U<10;U++){O&&(O[0]=si(e,D).mode);var $=e.token(t,D);if(t.pos>t.start)return $}throw new Error("Mode "+e.name+" failed to advance stream.")}var Xt=function(e,t,D){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=D};function Sr(e,t,D,O){var U=e.doc,$=U.mode,oe;t=V(U,t);var fe=Ct(U,t.line),pe=ot(e,t.line,D),Ee=new Dt(fe.text,e.options.tabSize,pe),We;for(O&&(We=[]);(O||Ee.pos<t.ch)&&!Ee.eol();)Ee.start=Ee.pos,oe=Ht($,Ee,pe.state),O&&We.push(new Xt(Ee,oe,Lr(U.mode,pe.state)));return O?We:new Xt(Ee,oe,pe.state)}function an(e,t){if(e)for(;;){var D=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!D)break;e=e.slice(0,D.index)+e.slice(D.index+D[0].length);var O=D[1]?"bgClass":"textClass";t[O]==null?t[O]=D[2]:new RegExp("(?:^|\\s)"+D[2]+"(?:$|\\s)").test(t[O])||(t[O]+=" "+D[2])}return e}function Zr(e,t,D,O,U,$,oe){var fe=D.flattenSpans;fe==null&&(fe=e.options.flattenSpans);var pe=0,Ee=null,We=new Dt(t,e.options.tabSize,O),Ke,ut=e.options.addModeClass&&[null];for(t==""&&an(gt(D,O.state),$);!We.eol();){if(We.pos>e.options.maxHighlightLength?(fe=!1,oe&&It(e,t,O,We.pos),We.pos=t.length,Ke=null):Ke=an(Ht(D,We,O.state,ut),$),ut){var at=ut[0].name;at&&(Ke="m-"+(Ke?at+" "+Ke:at))}if(!fe||Ee!=Ke){for(;pe<We.start;)pe=Math.min(We.start,pe+5e3),U(pe,Ee);Ee=Ke}We.start=We.pos}for(;pe<We.pos;){var mt=Math.min(We.pos,pe+5e3);U(mt,Ee),pe=mt}}function Zt(e,t,D){for(var O,U,$=e.doc,oe=D?-1:t-(e.doc.mode.innerMode?1e3:100),fe=t;fe>oe;--fe){if(fe<=$.first)return $.first;var pe=Ct($,fe-1),Ee=pe.stateAfter;if(Ee&&(!D||fe+(Ee instanceof me?Ee.lookAhead:0)<=$.modeFrontier))return fe;var We=K(pe.text,null,e.options.tabSize);(U==null||O>We)&&(U=fe-1,O=We)}return U}function Hr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var D=e.first,O=t-1;O>D;O--){var U=Ct(e,O).stateAfter;if(U&&(!(U instanceof me)||O+U.lookAhead<t)){D=O+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,D)}var fr=!1,Jt=!1;function tr(){fr=!0}function vr(){Jt=!0}function Xr(e,t,D){this.marker=e,this.from=t,this.to=D}function ln(e,t){if(e)for(var D=0;D<e.length;++D){var O=e[D];if(O.marker==t)return O}}function mn(e,t){for(var D,O=0;O<e.length;++O)e[O]!=t&&(D||(D=[])).push(e[O]);return D}function li(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ki(e,t,D){var O;if(e)for(var U=0;U<e.length;++U){var $=e[U],oe=$.marker,fe=$.from==null||(oe.inclusiveLeft?$.from<=t:$.from<t);if(fe||$.from==t&&oe.type=="bookmark"&&(!D||!$.marker.insertLeft)){var pe=$.to==null||(oe.inclusiveRight?$.to>=t:$.to>t);(O||(O=[])).push(new Xr(oe,$.from,pe?null:$.to))}}return O}function Ui(e,t,D){var O;if(e)for(var U=0;U<e.length;++U){var $=e[U],oe=$.marker,fe=$.to==null||(oe.inclusiveRight?$.to>=t:$.to>t);if(fe||$.from==t&&oe.type=="bookmark"&&(!D||$.marker.insertLeft)){var pe=$.from==null||(oe.inclusiveLeft?$.from<=t:$.from<t);(O||(O=[])).push(new Xr(oe,pe?null:$.from-t,$.to==null?null:$.to-t))}}return O}function Fn(e,t){if(t.full)return null;var D=_n(e,t.from.line)&&Ct(e,t.from.line).markedSpans,O=_n(e,t.to.line)&&Ct(e,t.to.line).markedSpans;if(!D&&!O)return null;var U=t.from.ch,$=t.to.ch,oe=Ft(t.from,t.to)==0,fe=Ki(D,U,oe),pe=Ui(O,$,oe),Ee=t.text.length==1,We=ae(t.text).length+(Ee?U:0);if(fe)for(var Ke=0;Ke<fe.length;++Ke){var ut=fe[Ke];if(ut.to==null){var at=ln(pe,ut.marker);at?Ee&&(ut.to=at.to==null?null:at.to+We):ut.to=U}}if(pe)for(var mt=0;mt<pe.length;++mt){var yt=pe[mt];if(yt.to!=null&&(yt.to+=We),yt.from==null){var _t=ln(fe,yt.marker);_t||(yt.from=We,Ee&&(fe||(fe=[])).push(yt))}else yt.from+=We,Ee&&(fe||(fe=[])).push(yt)}fe&&(fe=qr(fe)),pe&&pe!=fe&&(pe=qr(pe));var kt=[fe];if(!Ee){var Ut=t.text.length-2,Lt;if(Ut>0&&fe)for(var Wt=0;Wt<fe.length;++Wt)fe[Wt].to==null&&(Lt||(Lt=[])).push(new Xr(fe[Wt].marker,null,null));for(var lr=0;lr<Ut;++lr)kt.push(Lt);kt.push(pe)}return kt}function qr(e){for(var t=0;t<e.length;++t){var D=e[t];D.from!=null&&D.from==D.to&&D.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Oi(e,t,D){var O=null;if(e.iter(t.line,D.line+1,function(at){if(at.markedSpans)for(var mt=0;mt<at.markedSpans.length;++mt){var yt=at.markedSpans[mt].marker;yt.readOnly&&(!O||re(O,yt)==-1)&&(O||(O=[])).push(yt)}}),!O)return null;for(var U=[{from:t,to:D}],$=0;$<O.length;++$)for(var oe=O[$],fe=oe.find(0),pe=0;pe<U.length;++pe){var Ee=U[pe];if(Ft(Ee.to,fe.from)<0||Ft(Ee.from,fe.to)>0)continue;var We=[pe,1],Ke=Ft(Ee.from,fe.from),ut=Ft(Ee.to,fe.to);(Ke<0||!oe.inclusiveLeft&&!Ke)&&We.push({from:Ee.from,to:fe.from}),(ut>0||!oe.inclusiveRight&&!ut)&&We.push({from:fe.to,to:Ee.to}),U.splice.apply(U,We),pe+=We.length-3}return U}function on(e){var t=e.markedSpans;if(!t)return;for(var D=0;D<t.length;++D)t[D].marker.detachLine(e);e.markedSpans=null}function Zn(e,t){if(!t)return;for(var D=0;D<t.length;++D)t[D].marker.attachLine(e);e.markedSpans=t}function Yr(e){return e.inclusiveLeft?-1:0}function cr(e){return e.inclusiveRight?1:0}function en(e,t){var D=e.lines.length-t.lines.length;if(D!=0)return D;var O=e.find(),U=t.find(),$=Ft(O.from,U.from)||Yr(e)-Yr(t);if($)return-$;var oe=Ft(O.to,U.to)||cr(e)-cr(t);return oe||t.id-e.id}function Mr(e,t){var D=Jt&&e.markedSpans,O;if(D)for(var U=void 0,$=0;$<D.length;++$)U=D[$],U.marker.collapsed&&(t?U.from:U.to)==null&&(!O||en(O,U.marker)<0)&&(O=U.marker);return O}function En(e){return Mr(e,!0)}function Fr(e){return Mr(e,!1)}function xi(e,t){var D=Jt&&e.markedSpans,O;if(D)for(var U=0;U<D.length;++U){var $=D[U];$.marker.collapsed&&($.from==null||$.from<t)&&($.to==null||$.to>t)&&(!O||en(O,$.marker)<0)&&(O=$.marker)}return O}function gn(e,t,D,O,U){var $=Ct(e,t),oe=Jt&&$.markedSpans;if(oe)for(var fe=0;fe<oe.length;++fe){var pe=oe[fe];if(!pe.marker.collapsed)continue;var Ee=pe.marker.find(0),We=Ft(Ee.from,D)||Yr(pe.marker)-Yr(U),Ke=Ft(Ee.to,O)||cr(pe.marker)-cr(U);if(We>=0&&Ke<=0||We<=0&&Ke>=0)continue;if(We<=0&&(pe.marker.inclusiveRight&&U.inclusiveLeft?Ft(Ee.to,D)>=0:Ft(Ee.to,D)>0)||We>=0&&(pe.marker.inclusiveRight&&U.inclusiveLeft?Ft(Ee.from,O)<=0:Ft(Ee.from,O)<0))return!0}}function On(e){for(var t;t=En(e);)e=t.find(-1,!0).line;return e}function ui(e){for(var t;t=Fr(e);)e=t.find(1,!0).line;return e}function ci(e){for(var t,D;t=Fr(e);)e=t.find(1,!0).line,(D||(D=[])).push(e);return D}function qn(e,t){var D=Ct(e,t),O=On(D);return D==O?t:jt(O)}function Ei(e,t){if(t>e.lastLine())return t;var D=Ct(e,t),O;if(!Yn(e,D))return t;for(;O=Fr(D);)D=O.find(1,!0).line;return jt(D)+1}function Yn(e,t){var D=Jt&&t.markedSpans;if(D)for(var O=void 0,U=0;U<D.length;++U){if(O=D[U],!O.marker.collapsed)continue;if(O.from==null)return!0;if(O.marker.widgetNode)continue;if(O.from==0&&O.marker.inclusiveLeft&&Ai(e,t,O))return!0}}function Ai(e,t,D){if(D.to==null){var O=D.marker.find(1,!0);return Ai(e,O.line,ln(O.line.markedSpans,D.marker))}if(D.marker.inclusiveRight&&D.to==t.text.length)return!0;for(var U=void 0,$=0;$<t.markedSpans.length;++$)if(U=t.markedSpans[$],U.marker.collapsed&&!U.marker.widgetNode&&U.from==D.to&&(U.to==null||U.to!=D.from)&&(U.marker.inclusiveLeft||D.marker.inclusiveRight)&&Ai(e,t,U))return!0}function zn(e){e=On(e);for(var t=0,D=e.parent,O=0;O<D.lines.length;++O){var U=D.lines[O];if(U==e)break;t+=U.height}for(var $=D.parent;$;D=$,$=D.parent)for(var oe=0;oe<$.children.length;++oe){var fe=$.children[oe];if(fe==D)break;t+=fe.height}return t}function fi(e){if(e.height==0)return 0;for(var t=e.text.length,D,O=e;D=En(O);){var U=D.find(0,!0);O=U.from.line,t+=U.from.ch-U.to.ch}for(O=e;D=Fr(O);){var $=D.find(0,!0);t-=O.text.length-$.from.ch,O=$.to.line,t+=O.text.length-$.to.ch}return t}function pi(e){var t=e.display,D=e.doc;t.maxLine=Ct(D,D.first),t.maxLineLength=fi(t.maxLine),t.maxLineChanged=!0,D.iter(function(O){var U=fi(O);U>t.maxLineLength&&(t.maxLineLength=U,t.maxLine=O)})}var ei=function(e,t,D){this.text=e,Zn(this,t),this.height=D?D(this):1};ei.prototype.lineNo=function(){return jt(this)},Ie(ei);function $r(e,t,D,O){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),on(e),Zn(e,D);var U=O?O(e):1;U!=e.height&&$t(e,U)}function $i(e){e.parent=null,on(e)}var ta={},Ni={};function Ji(e,t){if(!e||/^\s*$/.test(e))return null;var D=t.addModeClass?Ni:ta;return D[e]||(D[e]=e.replace(/\S+/g,"cm-$&"))}function Gi(e,t){var D=N("span",null,null,a?"padding-right: .1px":null),O={pre:N("pre",[D],"CodeMirror-line"),content:D,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var U=0;U<=(t.rest?t.rest.length:0);U++){var $=U?t.rest[U-1]:t.line,oe=void 0;O.pos=0,O.addToken=ar,At(e.display.measure)&&(oe=st($,e.doc.direction))&&(O.addToken=xr(O.addToken,oe)),O.map=[];var fe=t!=e.display.externalMeasured&&jt($);Br($,O,pt(e,$,fe)),$.styleClasses&&($.styleClasses.bgClass&&(O.bgClass=F($.styleClasses.bgClass,O.bgClass||"")),$.styleClasses.textClass&&(O.textClass=F($.styleClasses.textClass,O.textClass||""))),O.map.length==0&&O.map.push(0,0,O.content.appendChild(Pt(e.display.measure))),U==0?(t.measure.map=O.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(O.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var pe=O.content.lastChild;(/\bcm-tab\b/.test(pe.className)||pe.querySelector&&pe.querySelector(".cm-tab"))&&(O.content.className="cm-tab-wrap-hack")}return $e(e,"renderLine",e,t.line,O.pre),O.pre.className&&(O.textClass=F(O.pre.className,O.textClass||"")),O}function Bt(e){var t=_("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ar(e,t,D,O,U,$,oe){if(!t)return;var fe=e.splitSpaces?Kt(t,e.trailingSpace):t,pe=e.cm.state.specialChars,Ee=!1,We;if(!pe.test(t))e.col+=t.length,We=document.createTextNode(fe),e.map.push(e.pos,e.pos+t.length,We),C&&c<9&&(Ee=!0),e.pos+=t.length;else{We=document.createDocumentFragment();for(var Ke=0;;){pe.lastIndex=Ke;var ut=pe.exec(t),at=ut?ut.index-Ke:t.length-Ke;if(at){var mt=document.createTextNode(fe.slice(Ke,Ke+at));C&&c<9?We.appendChild(_("span",[mt])):We.appendChild(mt),e.map.push(e.pos,e.pos+at,mt),e.col+=at,e.pos+=at}if(!ut)break;Ke+=at+1;var yt=void 0;if(ut[0]==" "){var _t=e.cm.options.tabSize,kt=_t-e.col%_t;yt=We.appendChild(_("span",ce(kt),"cm-tab")),yt.setAttribute("role","presentation"),yt.setAttribute("cm-text"," "),e.col+=kt}else ut[0]=="\r"||ut[0]==`
|
|
|
`?(yt=We.appendChild(_("span",ut[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),yt.setAttribute("cm-text",ut[0]),e.col+=1):(yt=e.cm.options.specialCharPlaceholder(ut[0]),yt.setAttribute("cm-text",ut[0]),C&&c<9?We.appendChild(_("span",[yt])):We.appendChild(yt),e.col+=1);e.map.push(e.pos,e.pos+1,yt),e.pos++}}if(e.trailingSpace=fe.charCodeAt(t.length-1)==32,D||O||U||Ee||$||oe){var Ut=D||"";O&&(Ut+=O),U&&(Ut+=U);var Lt=_("span",[We],Ut,$);if(oe)for(var Wt in oe)oe.hasOwnProperty(Wt)&&Wt!="style"&&Wt!="class"&&Lt.setAttribute(Wt,oe[Wt]);return e.content.appendChild(Lt)}e.content.appendChild(We)}function Kt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var D=t,O="",U=0;U<e.length;U++){var $=e.charAt(U);$==" "&&D&&(U==e.length-1||e.charCodeAt(U+1)==32)&&($="\xA0"),O+=$,D=$==" "}return O}function xr(e,t){return function(D,O,U,$,oe,fe,pe){U=U?U+" cm-force-border":"cm-force-border";for(var Ee=D.pos,We=Ee+O.length;;){for(var Ke=void 0,ut=0;ut<t.length&&!(Ke=t[ut],Ke.to>Ee&&Ke.from<=Ee);ut++);if(Ke.to>=We)return e(D,O,U,$,oe,fe,pe);e(D,O.slice(0,Ke.to-Ee),U,$,null,fe,pe),$=null,O=O.slice(Ke.to-Ee),Ee=Ke.to}}}function Dr(e,t,D,O){var U=!O&&D.widgetNode;U&&e.map.push(e.pos,e.pos+t,U),!O&&e.cm.display.input.needsContentAttribute&&(U||(U=e.content.appendChild(document.createElement("span"))),U.setAttribute("cm-marker",D.id)),U&&(e.cm.display.input.setUneditable(U),e.content.appendChild(U)),e.pos+=t,e.trailingSpace=!1}function Br(e,t,D){var O=e.markedSpans,U=e.text,$=0;if(!O){for(var oe=1;oe<D.length;oe+=2)t.addToken(t,U.slice($,$=D[oe]),Ji(D[oe+1],t.cm.options));return}for(var fe=U.length,pe=0,Ee=1,We="",Ke,ut,at=0,mt,yt,_t,kt,Ut;;){if(at==pe){mt=yt=_t=ut="",Ut=null,kt=null,at=Infinity;for(var Lt=[],Wt=void 0,lr=0;lr<O.length;++lr){var er=O[lr],kr=er.marker;if(kr.type=="bookmark"&&er.from==pe&&kr.widgetNode)Lt.push(kr);else if(er.from<=pe&&(er.to==null||er.to>pe||kr.collapsed&&er.to==pe&&er.from==pe)){if(er.to!=null&&er.to!=pe&&at>er.to&&(at=er.to,yt=""),kr.className&&(mt+=" "+kr.className),kr.css&&(ut=(ut?ut+";":"")+kr.css),kr.startStyle&&er.from==pe&&(_t+=" "+kr.startStyle),kr.endStyle&&er.to==at&&(Wt||(Wt=[])).push(kr.endStyle,er.to),kr.title&&((Ut||(Ut={})).title=kr.title),kr.attributes)for(var Tn in kr.attributes)(Ut||(Ut={}))[Tn]=kr.attributes[Tn];kr.collapsed&&(!kt||en(kt.marker,kr)<0)&&(kt=er)}else er.from>pe&&at>er.from&&(at=er.from)}if(Wt)for(var di=0;di<Wt.length;di+=2)Wt[di+1]==at&&(yt+=" "+Wt[di]);if(!kt||kt.from==pe)for(var Un=0;Un<Lt.length;++Un)Dr(t,0,Lt[Un]);if(kt&&(kt.from||0)==pe){if(Dr(t,(kt.to==null?fe+1:kt.to)-pe,kt.marker,kt.from==null),kt.to==null)return;kt.to==pe&&(kt=!1)}}if(pe>=fe)break;for(var ji=Math.min(fe,at);;){if(We){var Mi=pe+We.length;if(!kt){var Jn=Mi>ji?We.slice(0,ji-pe):We;t.addToken(t,Jn,Ke?Ke+mt:mt,_t,pe+Jn.length==at?yt:"",ut,Ut)}if(Mi>=ji){We=We.slice(ji-pe),pe=ji;break}pe=Mi,_t=""}We=U.slice($,$=D[Ee++]),Ke=Ji(D[Ee++],t.cm.options)}}}function Or(e,t,D){this.line=t,this.rest=ci(t),this.size=this.rest?jt(ae(this.rest))-D+1:1,this.node=this.text=null,this.hidden=Yn(e,t)}function un(e,t,D){for(var O=[],U,$=t;$<D;$=U){var oe=new Or(e.doc,Ct(e.doc,$),$);U=$+oe.size,O.push(oe)}return O}var Pn=null;function Er(e){Pn?Pn.ops.push(e):e.ownsGroup=Pn={ops:[e],delayedCallbacks:[]}}function Ri(e){var t=e.delayedCallbacks,D=0;do{for(;D<t.length;D++)t[D].call(null);for(var O=0;O<e.ops.length;O++){var U=e.ops[O];if(U.cursorActivityHandlers)for(;U.cursorActivityCalled<U.cursorActivityHandlers.length;)U.cursorActivityHandlers[U.cursorActivityCalled++].call(null,U.cm)}}while(D<t.length)}function Gt(e,t){var D=e.ownsGroup;if(!D)return;try{Ri(D)}finally{Pn=null,t(D)}}var or=null;function sr(e,t){var D=et(e,t);if(!D.length)return;var O=Array.prototype.slice.call(arguments,2),U;Pn?U=Pn.delayedCallbacks:or?U=or:(U=or=[],setTimeout(vn,0));for(var $=function(fe){U.push(function(){return D[fe].apply(null,O)})},oe=0;oe<D.length;++oe)$(oe)}function vn(){var e=or;or=null;for(var t=0;t<e.length;++t)e[t]()}function Di(e,t,D,O){for(var U=0;U<t.changes.length;U++){var $=t.changes[U];$=="text"?pr(e,t):$=="gutter"?tn(e,t,D,O):$=="class"?mr(e,t):$=="widget"&&Tr(e,t,O)}t.changes=null}function Vi(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),C&&c<8&&(e.node.style.zIndex=2)),e.node}function rr(e,t){var D=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(D&&(D+=" CodeMirror-linebackground"),t.background)D?t.background.className=D:(t.background.parentNode.removeChild(t.background),t.background=null);else if(D){var O=Vi(t);t.background=O.insertBefore(_("div",null,D),O.firstChild),e.display.input.setUneditable(t.background)}}function Mt(e,t){var D=e.display.externalMeasured;return D&&D.line==t.line?(e.display.externalMeasured=null,t.measure=D.measure,D.built):Gi(e,t)}function pr(e,t){var D=t.text.className,O=Mt(e,t);t.text==t.node&&(t.node=O.pre),t.text.parentNode.replaceChild(O.pre,t.text),t.text=O.pre,O.bgClass!=t.bgClass||O.textClass!=t.textClass?(t.bgClass=O.bgClass,t.textClass=O.textClass,mr(e,t)):D&&(t.text.className=D)}function mr(e,t){rr(e,t),t.line.wrapClass?Vi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var D=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=D||""}function tn(e,t,D,O){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var U=Vi(t);t.gutterBackground=_("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?O.fixedPos:-O.gutterTotalWidth)+"px; width: "+O.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),U.insertBefore(t.gutterBackground,t.text)}var $=t.line.gutterMarkers;if(e.options.lineNumbers||$){var oe=Vi(t),fe=t.gutter=_("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?O.fixedPos:-O.gutterTotalWidth)+"px");if(e.display.input.setUneditable(fe),oe.insertBefore(fe,t.text),t.line.gutterClass&&(fe.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!$||!$["CodeMirror-linenumbers"])&&(t.lineNumber=fe.appendChild(_("div",Vr(e.options,D),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+O.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),$)for(var pe=0;pe<e.display.gutterSpecs.length;++pe){var Ee=e.display.gutterSpecs[pe].className,We=$.hasOwnProperty(Ee)&&$[Ee];We&&fe.appendChild(_("div",[We],"CodeMirror-gutter-elt","left: "+O.gutterLeft[Ee]+"px; width: "+O.gutterWidth[Ee]+"px"))}}}function Tr(e,t,D){t.alignable&&(t.alignable=null);for(var O=A("CodeMirror-linewidget"),U=t.node.firstChild,$=void 0;U;U=$)$=U.nextSibling,O.test(U.className)&&t.node.removeChild(U);wn(e,t,D)}function Dn(e,t,D,O){var U=Mt(e,t);return t.text=t.node=U.pre,U.bgClass&&(t.bgClass=U.bgClass),U.textClass&&(t.textClass=U.textClass),mr(e,t),tn(e,t,D,O),wn(e,t,O),t.node}function wn(e,t,D){if(ki(e,t.line,t,D,!0),t.rest)for(var O=0;O<t.rest.length;O++)ki(e,t.rest[O],t,D,!1)}function ki(e,t,D,O,U){if(!t.widgets)return;for(var $=Vi(D),oe=0,fe=t.widgets;oe<fe.length;++oe){var pe=fe[oe],Ee=_("div",[pe.node],"CodeMirror-linewidget"+(pe.className?" "+pe.className:""));pe.handleMouseEvents||Ee.setAttribute("cm-ignore-events","true"),Bn(pe,Ee,D,O),e.display.input.setUneditable(Ee),U&&pe.above?$.insertBefore(Ee,D.gutter||D.text):$.appendChild(Ee),sr(pe,"redraw")}}function Bn(e,t,D,O){if(e.noHScroll){(D.alignable||(D.alignable=[])).push(t);var U=O.wrapperWidth;t.style.left=O.fixedPos+"px",e.coverGutter||(U-=O.gutterTotalWidth,t.style.paddingLeft=O.gutterTotalWidth+"px"),t.style.width=U+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-O.gutterTotalWidth+"px"))}function Kn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!k(document.body,e.node)){var D="position: relative;";e.coverGutter&&(D+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(D+="width: "+t.display.wrapper.clientWidth+"px;"),w(t.display.measure,_("div",[e.node],null,D))}return e.height=e.node.parentNode.offsetHeight}function $n(e,t){for(var D=Xe(t);D!=e.wrapper;D=D.parentNode)if(!D||D.nodeType==1&&D.getAttribute("cm-ignore-events")=="true"||D.parentNode==e.sizer&&D!=e.mover)return!0}function Xi(e){return e.lineSpace.offsetTop}function Ne(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ge(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=w(e.measure,_("pre","x","CodeMirror-line-like")),D=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,O={left:parseInt(D.paddingLeft),right:parseInt(D.paddingRight)};return!isNaN(O.left)&&!isNaN(O.right)&&(e.cachedPaddingH=O),O}function Je(e){return ee-e.display.nativeBarWidth}function Fe(e){return e.display.scroller.clientWidth-Je(e)-e.display.barWidth}function ve(e){return e.display.scroller.clientHeight-Je(e)-e.display.barHeight}function Le(e,t,D){var O=e.options.lineWrapping,U=O&&Fe(e);if(!t.measure.heights||O&&t.measure.width!=U){var $=t.measure.heights=[];if(O){t.measure.width=U;for(var oe=t.text.firstChild.getClientRects(),fe=0;fe<oe.length-1;fe++){var pe=oe[fe],Ee=oe[fe+1];Math.abs(pe.bottom-Ee.bottom)>2&&$.push((pe.bottom+Ee.top)/2-D.top)}}$.push(D.bottom-D.top)}}function we(e,t,D){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var O=0;O<e.rest.length;O++)if(e.rest[O]==t)return{map:e.measure.maps[O],cache:e.measure.caches[O]};for(var U=0;U<e.rest.length;U++)if(jt(e.rest[U])>D)return{map:e.measure.maps[U],cache:e.measure.caches[U],before:!0}}function Be(e,t){t=On(t);var D=jt(t),O=e.display.externalMeasured=new Or(e.doc,t,D);O.lineN=D;var U=O.built=Gi(e,O);return O.text=U.pre,w(e.display.lineMeasure,U.pre),O}function He(e,t,D,O){return it(e,Ve(e,t),D,O)}function Ye(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Sn(e,t)];var D=e.display.externalMeasured;if(D&&t>=D.lineN&&t<D.lineN+D.size)return D}function Ve(e,t){var D=jt(t),O=Ye(e,D);O&&!O.text?O=null:O&&O.changes&&(Di(e,O,D,In(e)),e.curOp.forceUpdate=!0),O||(O=Be(e,t));var U=we(O,t,D);return{line:t,view:O,rect:null,map:U.map,cache:U.cache,before:U.before,hasHeights:!1}}function it(e,t,D,O,U){t.before&&(D=-1);var $=D+(O||""),oe;return t.cache.hasOwnProperty($)?oe=t.cache[$]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Le(e,t.view,t.rect),t.hasHeights=!0),oe=Rt(e,t,D,O),oe.bogus||(t.cache[$]=oe)),{left:oe.left,right:oe.right,top:U?oe.rtop:oe.top,bottom:U?oe.rbottom:oe.bottom}}var ht={left:0,right:0,top:0,bottom:0};function Et(e,t,D){for(var O,U,$,oe,fe,pe,Ee=0;Ee<e.length;Ee+=3)if(fe=e[Ee],pe=e[Ee+1],t<fe?(U=0,$=1,oe="left"):t<pe?(U=t-fe,$=U+1):(Ee==e.length-3||t==pe&&e[Ee+3]>t)&&($=pe-fe,U=$-1,t>=pe&&(oe="right")),U!=null){if(O=e[Ee+2],fe==pe&&D==(O.insertLeft?"left":"right")&&(oe=D),D=="left"&&U==0)for(;Ee&&e[Ee-2]==e[Ee-3]&&e[Ee-1].insertLeft;)O=e[(Ee-=3)+2],oe="left";if(D=="right"&&U==pe-fe)for(;Ee<e.length-3&&e[Ee+3]==e[Ee+4]&&!e[Ee+5].insertLeft;)O=e[(Ee+=3)+2],oe="right";break}return{node:O,start:U,end:$,collapse:oe,coverStart:fe,coverEnd:pe}}function xt(e,t){var D=ht;if(t=="left")for(var O=0;O<e.length&&!((D=e[O]).left!=D.right);O++);else for(var U=e.length-1;U>=0&&!((D=e[U]).left!=D.right);U--);return D}function Rt(e,t,D,O){var U=Et(t.map,D,O),$=U.node,oe=U.start,fe=U.end,pe=U.collapse,Ee;if($.nodeType==3){for(var We=0;We<4;We++){for(;oe&&ge(t.line.text.charAt(U.coverStart+oe));)--oe;for(;U.coverStart+fe<U.coverEnd&&ge(t.line.text.charAt(U.coverStart+fe));)++fe;if(C&&c<9&&oe==0&&fe==U.coverEnd-U.coverStart?Ee=$.parentNode.getBoundingClientRect():Ee=xt(j($,oe,fe).getClientRects(),O),Ee.left||Ee.right||oe==0)break;fe=oe,oe=oe-1,pe="right"}C&&c<11&&(Ee=Yt(e.display.measure,Ee))}else{oe>0&&(pe=O="right");var Ke;e.options.lineWrapping&&(Ke=$.getClientRects()).length>1?Ee=Ke[O=="right"?Ke.length-1:0]:Ee=$.getBoundingClientRect()}if(C&&c<9&&!oe&&(!Ee||!Ee.left&&!Ee.right)){var ut=$.parentNode.getClientRects()[0];ut?Ee={left:ut.left,right:ut.left+ti(e.display),top:ut.top,bottom:ut.bottom}:Ee=ht}for(var at=Ee.top-t.rect.top,mt=Ee.bottom-t.rect.top,yt=(at+mt)/2,_t=t.view.measure.heights,kt=0;kt<_t.length-1&&!(yt<_t[kt]);kt++);var Ut=kt?_t[kt-1]:0,Lt=_t[kt],Wt={left:(pe=="right"?Ee.right:Ee.left)-t.rect.left,right:(pe=="left"?Ee.left:Ee.right)-t.rect.left,top:Ut,bottom:Lt};return!Ee.left&&!Ee.right&&(Wt.bogus=!0),e.options.singleCursorHeightPerLine||(Wt.rtop=at,Wt.rbottom=mt),Wt}function Yt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Qt(e))return t;var D=screen.logicalXDPI/screen.deviceXDPI,O=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*D,right:t.right*D,top:t.top*O,bottom:t.bottom*O}}function gr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function yr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)gr(e.display.view[t])}function wr(e){yr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ar(){return r&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function _r(){return r&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Cr(e){var t=0;if(e.widgets)for(var D=0;D<e.widgets.length;++D)e.widgets[D].above&&(t+=Kn(e.widgets[D]));return t}function zr(e,t,D,O,U){if(!U){var $=Cr(t);D.top+=$,D.bottom+=$}if(O=="line")return D;O||(O="local");var oe=zn(t);if(O=="local"?oe+=Xi(e.display):oe-=e.display.viewOffset,O=="page"||O=="window"){var fe=e.display.lineSpace.getBoundingClientRect();oe+=fe.top+(O=="window"?0:_r());var pe=fe.left+(O=="window"?0:Ar());D.left+=pe,D.right+=pe}return D.top+=oe,D.bottom+=oe,D}function Pr(e,t,D){if(D=="div")return t;var O=t.left,U=t.top;if(D=="page")O-=Ar(),U-=_r();else if(D=="local"||!D){var $=e.display.sizer.getBoundingClientRect();O+=$.left,U+=$.top}var oe=e.display.lineSpace.getBoundingClientRect();return{left:O-oe.left,top:U-oe.top}}function kn(e,t,D,O,U){return O||(O=Ct(e.doc,t.line)),zr(e,O,He(e,O,t.ch,U),D)}function Ir(e,t,D,O,U,$){O=O||Ct(e.doc,t.line),U||(U=Ve(e,O));function oe(mt,yt){var _t=it(e,U,mt,yt?"right":"left",$);return yt?_t.left=_t.right:_t.right=_t.left,zr(e,O,_t,D)}var fe=st(O,e.doc.direction),pe=t.ch,Ee=t.sticky;if(pe>=O.text.length?(pe=O.text.length,Ee="before"):pe<=0&&(pe=0,Ee="after"),!fe)return oe(Ee=="before"?pe-1:pe,Ee=="before");function We(mt,yt,_t){var kt=fe[yt],Ut=kt.level==1;return oe(_t?mt-1:mt,Ut!=_t)}var Ke=tt(fe,pe,Ee),ut=nt,at=We(pe,Ke,Ee=="before");return ut!=null&&(at.other=We(pe,ut,Ee!="before")),at}function nr(e,t){var D=0;t=V(e.doc,t),e.options.lineWrapping||(D=ti(e.display)*t.ch);var O=Ct(e.doc,t.line),U=zn(O)+Xi(e.display);return{left:D,right:D,top:U,bottom:U+O.height}}function qt(e,t,D,O,U){var $=vt(e,t,D);return $.xRel=U,O&&($.outside=O),$}function Nr(e,t,D){var O=e.doc;if(D+=e.display.viewOffset,D<0)return qt(O.first,0,null,-1,-1);var U=Ur(O,D),$=O.first+O.size-1;if(U>$)return qt(O.first+O.size-1,Ct(O,$).text.length,null,1,1);t<0&&(t=0);for(var oe=Ct(O,U);;){var fe=Ln(e,oe,U,t,D),pe=xi(oe,fe.ch+(fe.xRel>0||fe.outside>0?1:0));if(!pe)return fe;var Ee=pe.find(1);if(Ee.line==U)return Ee;oe=Ct(O,U=Ee.line)}}function Kr(e,t,D,O){O-=Cr(t);var U=t.text.length,$=Qe(function(oe){return it(e,D,oe-1).bottom<=O},U,0);return U=Qe(function(oe){return it(e,D,oe).top>O},$,U),{begin:$,end:U}}function zt(e,t,D,O){D||(D=Ve(e,t));var U=zr(e,t,it(e,D,O),"line").top;return Kr(e,t,D,U)}function Jr(e,t,D,O){return e.bottom<=D?!1:e.top>D?!0:(O?e.left:e.right)>t}function Ln(e,t,D,O,U){U-=zn(t);var $=Ve(e,t),oe=Cr(t),fe=0,pe=t.text.length,Ee=!0,We=st(t,e.doc.direction);if(We){var Ke=(e.options.lineWrapping?yn:nn)(e,t,D,$,We,O,U);Ee=Ke.level!=1,fe=Ee?Ke.from:Ke.to-1,pe=Ee?Ke.to:Ke.from-1}var ut=null,at=null,mt=Qe(function(lr){var er=it(e,$,lr);return er.top+=oe,er.bottom+=oe,Jr(er,O,U,!1)?(er.top<=U&&er.left<=O&&(ut=lr,at=er),!0):!1},fe,pe),yt,_t,kt=!1;if(at){var Ut=O-at.left<at.right-O,Lt=Ut==Ee;mt=ut+(Lt?0:1),_t=Lt?"after":"before",yt=Ut?at.left:at.right}else{!Ee&&(mt==pe||mt==fe)&&mt++,_t=mt==0?"after":mt==t.text.length?"before":it(e,$,mt-(Ee?1:0)).bottom+oe<=U==Ee?"after":"before";var Wt=Ir(e,vt(D,mt,_t),"line",t,$);yt=Wt.left,kt=U<Wt.top?-1:U>=Wt.bottom?1:0}return mt=De(t.text,mt,1),qt(D,mt,_t,kt,O-yt)}function nn(e,t,D,O,U,$,oe){var fe=Qe(function(Ke){var ut=U[Ke],at=ut.level!=1;return Jr(Ir(e,vt(D,at?ut.to:ut.from,at?"before":"after"),"line",t,O),$,oe,!0)},0,U.length-1),pe=U[fe];if(fe>0){var Ee=pe.level!=1,We=Ir(e,vt(D,Ee?pe.from:pe.to,Ee?"after":"before"),"line",t,O);Jr(We,$,oe,!0)&&We.top>oe&&(pe=U[fe-1])}return pe}function yn(e,t,D,O,U,$,oe){var fe=Kr(e,t,O,oe),pe=fe.begin,Ee=fe.end;/\s/.test(t.text.charAt(Ee-1))&&Ee--;for(var We=null,Ke=null,ut=0;ut<U.length;ut++){var at=U[ut];if(at.from>=Ee||at.to<=pe)continue;var mt=at.level!=1,yt=it(e,O,mt?Math.min(Ee,at.to)-1:Math.max(pe,at.from)).right,_t=yt<$?$-yt+1e9:yt-$;(!We||Ke>_t)&&(We=at,Ke=_t)}return We||(We=U[U.length-1]),We.from<pe&&(We={from:pe,to:We.to,level:We.level}),We.to>Ee&&(We={from:We.from,to:Ee,level:We.level}),We}var fn;function Wn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(fn==null){fn=_("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)fn.appendChild(document.createTextNode("x")),fn.appendChild(_("br"));fn.appendChild(document.createTextNode("x"))}w(e.measure,fn);var D=fn.offsetHeight/50;return D>3&&(e.cachedTextHeight=D),E(e.measure),D||1}function ti(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=_("span","xxxxxxxxxx"),D=_("pre",[t],"CodeMirror-line-like");w(e.measure,D);var O=t.getBoundingClientRect(),U=(O.right-O.left)/10;return U>2&&(e.cachedCharWidth=U),U||10}function In(e){for(var t=e.display,D={},O={},U=t.gutters.clientLeft,$=t.gutters.firstChild,oe=0;$;$=$.nextSibling,++oe){var fe=e.display.gutterSpecs[oe].className;D[fe]=$.offsetLeft+$.clientLeft+U,O[fe]=$.clientWidth}return{fixedPos:vi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:D,gutterWidth:O,wrapperWidth:t.wrapper.clientWidth}}function vi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Fi(e){var t=Wn(e.display),D=e.options.lineWrapping,O=D&&Math.max(5,e.display.scroller.clientWidth/ti(e.display)-3);return function(U){if(Yn(e.doc,U))return 0;var $=0;if(U.widgets)for(var oe=0;oe<U.widgets.length;oe++)U.widgets[oe].height&&($+=U.widgets[oe].height);return D?$+(Math.ceil(U.text.length/O)||1)*t:$+t}}function wi(e){var t=e.doc,D=Fi(e);t.iter(function(O){var U=D(O);U!=O.height&&$t(O,U)})}function ri(e,t,D,O){var U=e.display;if(!D&&Xe(t).getAttribute("cm-not-content")=="true")return null;var $,oe,fe=U.lineSpace.getBoundingClientRect();try{$=t.clientX-fe.left,oe=t.clientY-fe.top}catch(Ke){return null}var pe=Nr(e,$,oe),Ee;if(O&&pe.xRel>0&&(Ee=Ct(e.doc,pe.line).text).length==pe.ch){var We=K(Ee,Ee.length,e.options.tabSize)-Ee.length;pe=vt(pe.line,Math.max(0,Math.round(($-Ge(e.display).left)/ti(e.display))-We))}return pe}function Sn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var D=e.display.view,O=0;O<D.length;O++)if(t-=D[O].size,t<0)return O}function bn(e,t,D,O){t==null&&(t=e.doc.first),D==null&&(D=e.doc.first+e.doc.size),O||(O=0);var U=e.display;if(O&&D<U.viewTo&&(U.updateLineNumbers==null||U.updateLineNumbers>t)&&(U.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=U.viewTo)Jt&&qn(e.doc,t)<U.viewTo&&Mn(e);else if(D<=U.viewFrom)Jt&&Ei(e.doc,D+O)>U.viewFrom?Mn(e):(U.viewFrom+=O,U.viewTo+=O);else if(t<=U.viewFrom&&D>=U.viewTo)Mn(e);else if(t<=U.viewFrom){var $=Bi(e,D,D+O,1);$?(U.view=U.view.slice($.index),U.viewFrom=$.lineN,U.viewTo+=O):Mn(e)}else if(D>=U.viewTo){var oe=Bi(e,t,t,-1);oe?(U.view=U.view.slice(0,oe.index),U.viewTo=oe.lineN):Mn(e)}else{var fe=Bi(e,t,t,-1),pe=Bi(e,D,D+O,1);fe&&pe?(U.view=U.view.slice(0,fe.index).concat(un(e,fe.lineN,pe.lineN)).concat(U.view.slice(pe.index)),U.viewTo+=O):Mn(e)}var Ee=U.externalMeasured;Ee&&(D<Ee.lineN?Ee.lineN+=O:t<Ee.lineN+Ee.size&&(U.externalMeasured=null))}function Nn(e,t,D){e.curOp.viewChanged=!0;var O=e.display,U=e.display.externalMeasured;if(U&&t>=U.lineN&&t<U.lineN+U.size&&(O.externalMeasured=null),t<O.viewFrom||t>=O.viewTo)return;var $=O.view[Sn(e,t)];if($.node==null)return;var oe=$.changes||($.changes=[]);re(oe,D)==-1&&oe.push(D)}function Mn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bi(e,t,D,O){var U=Sn(e,t),$,oe=e.display.view;if(!Jt||D==e.doc.first+e.doc.size)return{index:U,lineN:D};for(var fe=e.display.viewFrom,pe=0;pe<U;pe++)fe+=oe[pe].size;if(fe!=t){if(O>0){if(U==oe.length-1)return null;$=fe+oe[U].size-t,U++}else $=fe-t;t+=$,D+=$}for(;qn(e.doc,D)!=D;){if(U==(O<0?0:oe.length-1))return null;D+=O*oe[U-(O<0?1:0)].size,U+=O}return{index:U,lineN:D}}function ra(e,t,D){var O=e.display,U=O.view;U.length==0||t>=O.viewTo||D<=O.viewFrom?(O.view=un(e,t,D),O.viewFrom=t):(O.viewFrom>t?O.view=un(e,t,O.viewFrom).concat(O.view):O.viewFrom<t&&(O.view=O.view.slice(Sn(e,t))),O.viewFrom=t,O.viewTo<D?O.view=O.view.concat(un(e,O.viewTo,D)):O.viewTo>D&&(O.view=O.view.slice(0,Sn(e,D)))),O.viewTo=D}function na(e){for(var t=e.display.view,D=0,O=0;O<t.length;O++){var U=t[O];!U.hidden&&(!U.node||U.changes)&&++D}return D}function pn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Yi(e,t){t===void 0&&(t=!0);for(var D=e.doc,O={},U=O.cursors=document.createDocumentFragment(),$=O.selection=document.createDocumentFragment(),oe=0;oe<D.sel.ranges.length;oe++){if(!t&&oe==D.sel.primIndex)continue;var fe=D.sel.ranges[oe];if(fe.from().line>=e.display.viewTo||fe.to().line<e.display.viewFrom)continue;var pe=fe.empty();(pe||e.options.showCursorWhenSelecting)&&ia(e,fe.head,U),pe||dn(e,fe,$)}return O}function ia(e,t,D){var O=Ir(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),U=D.appendChild(_("div","\xA0","CodeMirror-cursor"));if(U.style.left=O.left+"px",U.style.top=O.top+"px",U.style.height=Math.max(0,O.bottom-O.top)*e.options.cursorHeight+"px",O.other){var $=D.appendChild(_("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));$.style.display="",$.style.left=O.other.left+"px",$.style.top=O.other.top+"px",$.style.height=(O.other.bottom-O.other.top)*.85+"px"}}function Cn(e,t){return e.top-t.top||e.left-t.left}function dn(e,t,D){var O=e.display,U=e.doc,$=document.createDocumentFragment(),oe=Ge(e.display),fe=oe.left,pe=Math.max(O.sizerWidth,Fe(e)-O.sizer.offsetLeft)-oe.right,Ee=U.direction=="ltr";function We(Lt,Wt,lr,er){Wt<0&&(Wt=0),Wt=Math.round(Wt),er=Math.round(er),$.appendChild(_("div",null,"CodeMirror-selected","position: absolute; left: "+Lt+`px;
|
|
|
top: `+Wt+"px; width: "+(lr==null?pe-Lt:lr)+`px;
|
|
|
height: `+(er-Wt)+"px"))}function Ke(Lt,Wt,lr){var er=Ct(U,Lt),kr=er.text.length,Tn,di;function Un(Jn,Pi){return kn(e,vt(Lt,Jn),"div",er,Pi)}function ji(Jn,Pi,gi){var oi=zt(e,er,null,Jn),Qn=Pi=="ltr"==(gi=="after")?"left":"right",Hn=gi=="after"?oi.begin:oi.end-(/\s/.test(er.text.charAt(oi.end-1))?2:1);return Un(Hn,Qn)[Qn]}var Mi=st(er,U.direction);return Ze(Mi,Wt||0,lr==null?kr:lr,function(Jn,Pi,gi,oi){var Qn=gi=="ltr",Hn=Un(Jn,Qn?"left":"right"),Ii=Un(Pi-1,Qn?"right":"left"),Za=Wt==null&&Jn==0,_a=lr==null&&Pi==kr,bi=oi==0,ua=!Mi||oi==Mi.length-1;if(Ii.top-Hn.top<=3){var hi=(Ee?Za:_a)&&bi,ps=(Ee?_a:Za)&&ua,ga=hi?fe:(Qn?Hn:Ii).left,La=ps?pe:(Qn?Ii:Hn).right;We(ga,Hn.top,La-ga,Hn.bottom)}else{var Ma,_i,qa,ms;Qn?(Ma=Ee&&Za&&bi?fe:Hn.left,_i=Ee?pe:ji(Jn,gi,"before"),qa=Ee?fe:ji(Pi,gi,"after"),ms=Ee&&_a&&ua?pe:Ii.right):(Ma=Ee?ji(Jn,gi,"before"):fe,_i=!Ee&&Za&&bi?pe:Hn.right,qa=!Ee&&_a&&ua?fe:Ii.left,ms=Ee?ji(Pi,gi,"after"):pe),We(Ma,Hn.top,_i-Ma,Hn.bottom),Hn.bottom<Ii.top&&We(fe,Hn.bottom,null,Ii.top),We(qa,Ii.top,ms-qa,Ii.bottom)}(!Tn||Cn(Hn,Tn)<0)&&(Tn=Hn),Cn(Ii,Tn)<0&&(Tn=Ii),(!di||Cn(Hn,di)<0)&&(di=Hn),Cn(Ii,di)<0&&(di=Ii)}),{start:Tn,end:di}}var ut=t.from(),at=t.to();if(ut.line==at.line)Ke(ut.line,ut.ch,at.ch);else{var mt=Ct(U,ut.line),yt=Ct(U,at.line),_t=On(mt)==On(yt),kt=Ke(ut.line,ut.ch,_t?mt.text.length+1:null).end,Ut=Ke(at.line,_t?0:null,at.ch).start;_t&&(kt.top<Ut.top-2?(We(kt.right,kt.top,null,kt.bottom),We(fe,Ut.top,Ut.left,Ut.bottom)):We(kt.right,kt.top,Ut.left-kt.right,kt.bottom)),kt.bottom<Ut.top&&We(fe,kt.bottom,null,Ut.top)}D.appendChild($)}function ni(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var D=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||va(e),t.cursorDiv.style.visibility=(D=!D)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function To(e){e.state.focused||(e.display.input.focus(),aa(e))}function eo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,va(e))},100)}function aa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||($e(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),a&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ni(e)}function va(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&($e(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Pa(e){for(var t=e.display,D=t.lineDiv.offsetTop,O=0;O<t.view.length;O++){var U=t.view[O],$=e.options.lineWrapping,oe=void 0,fe=0;if(U.hidden)continue;if(C&&c<8){var pe=U.node.offsetTop+U.node.offsetHeight;oe=pe-D,D=pe}else{var Ee=U.node.getBoundingClientRect();oe=Ee.bottom-Ee.top,!$&&U.text.firstChild&&(fe=U.text.firstChild.getBoundingClientRect().right-Ee.left-1)}var We=U.line.height-oe;if((We>.005||We<-.005)&&($t(U.line,oe),to(U.line),U.rest))for(var Ke=0;Ke<U.rest.length;Ke++)to(U.rest[Ke]);if(fe>e.display.sizerWidth){var ut=Math.ceil(fe/ti(e.display));ut>e.display.maxLineLength&&(e.display.maxLineLength=ut,e.display.maxLine=U.line,e.display.maxLineChanged=!0)}}}function to(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var D=e.widgets[t],O=D.node.parentNode;O&&(D.height=O.offsetHeight)}}function Ia(e,t,D){var O=D&&D.top!=null?Math.max(0,D.top):e.scroller.scrollTop;O=Math.floor(O-Xi(e));var U=D&&D.bottom!=null?D.bottom:O+e.wrapper.clientHeight,$=Ur(t,O),oe=Ur(t,U);if(D&&D.ensure){var fe=D.ensure.from.line,pe=D.ensure.to.line;fe<$?($=fe,oe=Ur(t,zn(Ct(t,fe))+e.wrapper.clientHeight)):Math.min(pe,t.lastLine())>=oe&&($=Ur(t,zn(Ct(t,pe))-e.wrapper.clientHeight),oe=pe)}return{from:$,to:Math.max(oe,$+1)}}function Xo(e,t){if(qe(e,"scrollCursorIntoView"))return;var D=e.display,O=D.sizer.getBoundingClientRect(),U=null;if(t.top+O.top<0?U=!0:t.bottom+O.top>(window.innerHeight||document.documentElement.clientHeight)&&(U=!1),U!=null&&!b){var $=_("div","\u200B",null,`position: absolute;
|
|
|
top: `+(t.top-D.viewOffset-Xi(e.display))+`px;
|
|
|
height: `+(t.bottom-t.top+Je(e)+D.barHeight)+`px;
|
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild($),$.scrollIntoView(U),e.display.lineSpace.removeChild($)}}function Yo(e,t,D,O){O==null&&(O=0);var U;!e.options.lineWrapping&&t==D&&(t=t.ch?vt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,D=t.sticky=="before"?vt(t.line,t.ch+1,"before"):t);for(var $=0;$<5;$++){var oe=!1,fe=Ir(e,t),pe=!D||D==t?fe:Ir(e,D);U={left:Math.min(fe.left,pe.left),top:Math.min(fe.top,pe.top)-O,right:Math.max(fe.left,pe.left),bottom:Math.max(fe.bottom,pe.bottom)+O};var Ee=ro(e,U),We=e.doc.scrollTop,Ke=e.doc.scrollLeft;if(Ee.scrollTop!=null&&(xa(e,Ee.scrollTop),Math.abs(e.doc.scrollTop-We)>1&&(oe=!0)),Ee.scrollLeft!=null&&(Wi(e,Ee.scrollLeft),Math.abs(e.doc.scrollLeft-Ke)>1&&(oe=!0)),!oe)break}return U}function _o(e,t){var D=ro(e,t);D.scrollTop!=null&&xa(e,D.scrollTop),D.scrollLeft!=null&&Wi(e,D.scrollLeft)}function ro(e,t){var D=e.display,O=Wn(e.display);t.top<0&&(t.top=0);var U=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:D.scroller.scrollTop,$=ve(e),oe={};t.bottom-t.top>$&&(t.bottom=t.top+$);var fe=e.doc.height+Ne(D),pe=t.top<O,Ee=t.bottom>fe-O;if(t.top<U)oe.scrollTop=pe?0:t.top;else if(t.bottom>U+$){var We=Math.min(t.top,(Ee?fe:t.bottom)-$);We!=U&&(oe.scrollTop=We)}var Ke=e.options.fixedGutter?0:D.gutters.offsetWidth,ut=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:D.scroller.scrollLeft-Ke,at=Fe(e)-D.gutters.offsetWidth,mt=t.right-t.left>at;return mt&&(t.right=t.left+at),t.left<10?oe.scrollLeft=0:t.left<ut?oe.scrollLeft=Math.max(0,t.left+Ke-(mt?0:10)):t.right>at+ut-3&&(oe.scrollLeft=t.right+(mt?0:10)-at),oe}function no(e,t){if(t==null)return;Na(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ya(e){Na(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ba(e,t,D){(t!=null||D!=null)&&Na(e),t!=null&&(e.curOp.scrollLeft=t),D!=null&&(e.curOp.scrollTop=D)}function $o(e,t){Na(e),e.curOp.scrollToPos=t}function Na(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var D=nr(e,t.from),O=nr(e,t.to);Oa(e,D,O,t.margin)}}function Oa(e,t,D,O){var U=ro(e,{left:Math.min(t.left,D.left),top:Math.min(t.top,D.top)-O,right:Math.max(t.right,D.right),bottom:Math.max(t.bottom,D.bottom)+O});ba(e,U.scrollLeft,U.scrollTop)}function xa(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;S||Da(e,{top:t}),Ea(e,t,!0),S&&Da(e),Ra(e,100)}function Ea(e,t,D){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!D)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Wi(e,t,D,O){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(D?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!O)return;e.doc.scrollLeft=t,Wr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ca(e){var t=e.display,D=t.gutters.offsetWidth,O=Math.round(e.doc.height+Ne(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?D:0,docHeight:O,scrollHeight:O+Je(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:D}}var oa=function(e,t,D){this.cm=D;var O=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),U=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");O.tabIndex=U.tabIndex=-1,e(O),e(U),Re(O,"scroll",function(){O.clientHeight&&t(O.scrollTop,"vertical")}),Re(U,"scroll",function(){U.clientWidth&&t(U.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,C&&c<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};oa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,D=e.scrollHeight>e.clientHeight+1,O=e.nativeBarWidth;if(D){this.vert.style.display="block",this.vert.style.bottom=t?O+"px":"0";var U=e.viewHeight-(t?O:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+U)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=D?O+"px":"0",this.horiz.style.left=e.barLeft+"px";var $=e.viewWidth-e.barLeft-(D?O:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+$)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(O==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:D?O:0,bottom:t?O:0}},oa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},oa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},oa.prototype.zeroWidthHack=function(){var e=d&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new q,this.disableVert=new q},oa.prototype.enableZeroWidthBar=function(e,t,D){e.style.pointerEvents="auto";function O(){var U=e.getBoundingClientRect(),$=D=="vert"?document.elementFromPoint(U.right-1,(U.top+U.bottom)/2):document.elementFromPoint((U.right+U.left)/2,U.bottom-1);$!=e?e.style.pointerEvents="none":t.set(1e3,O)}t.set(1e3,O)},oa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Aa=function(){};Aa.prototype.update=function(){return{bottom:0,right:0}},Aa.prototype.setScrollLeft=function(){},Aa.prototype.setScrollTop=function(){},Aa.prototype.clear=function(){};function da(e,t){t||(t=ca(e));var D=e.display.barWidth,O=e.display.barHeight;ja(e,t);for(var U=0;U<4&&D!=e.display.barWidth||O!=e.display.barHeight;U++)D!=e.display.barWidth&&e.options.lineWrapping&&Pa(e),ja(e,ca(e)),D=e.display.barWidth,O=e.display.barHeight}function ja(e,t){var D=e.display,O=D.scrollbars.update(t);D.sizer.style.paddingRight=(D.barWidth=O.right)+"px",D.sizer.style.paddingBottom=(D.barHeight=O.bottom)+"px",D.heightForcer.style.borderBottom=O.bottom+"px solid transparent",O.right&&O.bottom?(D.scrollbarFiller.style.display="block",D.scrollbarFiller.style.height=O.bottom+"px",D.scrollbarFiller.style.width=O.right+"px"):D.scrollbarFiller.style.display="",O.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(D.gutterFiller.style.display="block",D.gutterFiller.style.height=O.bottom+"px",D.gutterFiller.style.width=t.gutterWidth+"px"):D.gutterFiller.style.display=""}var io={native:oa,null:Aa};function Ua(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new io[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Re(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,D){D=="horizontal"?Wi(e,t):xa(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var ao=0;function sa(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:++ao},Er(e.curOp)}function ha(e){var t=e.curOp;t&&Gt(t,function(D){for(var O=0;O<D.ops.length;O++)D.ops[O].cm.curOp=null;Oo(D)})}function Oo(e){for(var t=e.ops,D=0;D<t.length;D++)Jo(t[D]);for(var O=0;O<t.length;O++)Qo(t[O]);for(var U=0;U<t.length;U++)Zo(t[U]);for(var $=0;$<t.length;$++)oo(t[$]);for(var oe=0;oe<t.length;oe++)qo(t[oe])}function Jo(e){var t=e.cm,D=t.display;Ao(t),e.updateMaxLine&&pi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<D.viewFrom||e.scrollToPos.to.line>=D.viewTo)||D.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Hi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qo(e){e.updatedDisplay=e.mustUpdate&&fa(e.cm,e.update)}function Zo(e){var t=e.cm,D=t.display;e.updatedDisplay&&Pa(t),e.barMeasure=ca(t),D.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=He(t,D.maxLine,D.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(D.scroller.clientWidth,D.sizer.offsetLeft+e.adjustWidthTo+Je(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,D.sizer.offsetLeft+e.adjustWidthTo-Fe(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=D.input.prepareSelection())}function oo(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Wi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var D=e.focus&&e.focus==z();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,D),(e.updatedDisplay||e.startHeight!=t.doc.height)&&da(t,e.barMeasure),e.updatedDisplay&&cn(t,e.barMeasure),e.selectionChanged&&ni(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),D&&To(e.cm)}function qo(e){var t=e.cm,D=t.display,O=t.doc;if(e.updatedDisplay&&Fa(t,e.update),D.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(D.wheelStartX=D.wheelStartY=null),e.scrollTop!=null&&Ea(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Wi(t,e.scrollLeft,!0,!0),e.scrollToPos){var U=Yo(t,V(O,e.scrollToPos.from),V(O,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,U)}var $=e.maybeHiddenMarkers,oe=e.maybeUnhiddenMarkers;if($)for(var fe=0;fe<$.length;++fe)$[fe].lines.length||$e($[fe],"hide");if(oe)for(var pe=0;pe<oe.length;++pe)oe[pe].lines.length&&$e(oe[pe],"unhide");D.wrapper.offsetHeight&&(O.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&$e(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ci(e,t){if(e.curOp)return t();sa(e);try{return t()}finally{ha(e)}}function Gn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);sa(e);try{return t.apply(e,arguments)}finally{ha(e)}}}function mi(e){return function(){if(this.curOp)return e.apply(this,arguments);sa(this);try{return e.apply(this,arguments)}finally{ha(this)}}}function Vn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);sa(t);try{return e.apply(this,arguments)}finally{ha(t)}}}function Ra(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,B(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var D=+new Date+e.options.workTime,O=ot(e,t.highlightFrontier),U=[];t.iter(O.line,Math.min(t.first+t.size,e.display.viewTo+500),function($){if(O.line>=e.display.viewFrom){var oe=$.styles,fe=$.text.length>e.options.maxHighlightLength?Lr(t.mode,O.state):null,pe=ze(e,$,O,!0);fe&&(O.state=fe),$.styles=pe.styles;var Ee=$.styleClasses,We=pe.classes;We?$.styleClasses=We:Ee&&($.styleClasses=null);for(var Ke=!oe||oe.length!=$.styles.length||Ee!=We&&(!Ee||!We||Ee.bgClass!=We.bgClass||Ee.textClass!=We.textClass),ut=0;!Ke&&ut<oe.length;++ut)Ke=oe[ut]!=$.styles[ut];Ke&&U.push(O.line),$.stateAfter=O.save(),O.nextLine()}else $.text.length<=e.options.maxHighlightLength&&It(e,$.text,O),$.stateAfter=O.line%5==0?O.save():null,O.nextLine();if(+new Date>D)return Ra(e,e.options.workDelay),!0}),t.highlightFrontier=O.line,t.modeFrontier=Math.max(t.modeFrontier,O.line),U.length&&Ci(e,function(){for(var $=0;$<U.length;$++)Nn(e,U[$],"text")})}var Hi=function(e,t,D){var O=e.display;this.viewport=t,this.visible=Ia(O,e.doc,t),this.editorIsHidden=!O.wrapper.offsetWidth,this.wrapperHeight=O.wrapper.clientHeight,this.wrapperWidth=O.wrapper.clientWidth,this.oldDisplayWidth=Fe(e),this.force=D,this.dims=In(e),this.events=[]};Hi.prototype.signal=function(e,t){Me(e,t)&&this.events.push(arguments)},Hi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)$e.apply(null,this.events[e])};function Ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Je(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Je(e)+"px",t.scrollbarsClipped=!0)}function Ro(e){if(e.hasFocus())return null;var t=z();if(!t||!k(e.display.lineDiv,t))return null;var D={activeElt:t};if(window.getSelection){var O=window.getSelection();O.anchorNode&&O.extend&&k(e.display.lineDiv,O.anchorNode)&&(D.anchorNode=O.anchorNode,D.anchorOffset=O.anchorOffset,D.focusNode=O.focusNode,D.focusOffset=O.focusOffset)}return D}function Do(e){if(!e||!e.activeElt||e.activeElt==z())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&k(document.body,e.anchorNode)&&k(document.body,e.focusNode)){var t=window.getSelection(),D=document.createRange();D.setEnd(e.anchorNode,e.anchorOffset),D.collapse(!1),t.removeAllRanges(),t.addRange(D),t.extend(e.focusNode,e.focusOffset)}}function fa(e,t){var D=e.display,O=e.doc;if(t.editorIsHidden)return Mn(e),!1;if(!t.force&&t.visible.from>=D.viewFrom&&t.visible.to<=D.viewTo&&(D.updateLineNumbers==null||D.updateLineNumbers>=D.viewTo)&&D.renderedView==D.view&&na(e)==0)return!1;ii(e)&&(Mn(e),t.dims=In(e));var U=O.first+O.size,$=Math.max(t.visible.from-e.options.viewportMargin,O.first),oe=Math.min(U,t.visible.to+e.options.viewportMargin);D.viewFrom<$&&$-D.viewFrom<20&&($=Math.max(O.first,D.viewFrom)),D.viewTo>oe&&D.viewTo-oe<20&&(oe=Math.min(U,D.viewTo)),Jt&&($=qn(e.doc,$),oe=Ei(e.doc,oe));var fe=$!=D.viewFrom||oe!=D.viewTo||D.lastWrapHeight!=t.wrapperHeight||D.lastWrapWidth!=t.wrapperWidth;ra(e,$,oe),D.viewOffset=zn(Ct(e.doc,D.viewFrom)),e.display.mover.style.top=D.viewOffset+"px";var pe=na(e);if(!fe&&pe==0&&!t.force&&D.renderedView==D.view&&(D.updateLineNumbers==null||D.updateLineNumbers>=D.viewTo))return!1;var Ee=Ro(e);return pe>4&&(D.lineDiv.style.display="none"),ko(e,D.updateLineNumbers,t.dims),pe>4&&(D.lineDiv.style.display=""),D.renderedView=D.view,Do(Ee),E(D.cursorDiv),E(D.selectionDiv),D.gutters.style.height=D.sizer.style.minHeight=0,fe&&(D.lastWrapHeight=t.wrapperHeight,D.lastWrapWidth=t.wrapperWidth,Ra(e,400)),D.updateLineNumbers=null,!0}function Fa(e,t){for(var D=t.viewport,O=!0;;O=!1){if(!O||!e.options.lineWrapping||t.oldDisplayWidth==Fe(e)){if(D&&D.top!=null&&(D={top:Math.min(e.doc.height+Ne(e.display)-ve(e),D.top)}),t.visible=Ia(e.display,e.doc,D),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else O&&(t.visible=Ia(e.display,e.doc,D));if(!fa(e,t))break;Pa(e);var U=ca(e);pn(e),da(e,U),cn(e,U),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Da(e,t){var D=new Hi(e,t);if(fa(e,D)){Pa(e),Fa(e,D);var O=ca(e);pn(e),da(e,O),cn(e,O),D.finish()}}function ko(e,t,D){var O=e.display,U=e.options.lineNumbers,$=O.lineDiv,oe=$.firstChild;function fe(mt){var yt=mt.nextSibling;return a&&d&&e.display.currentWheelTarget==mt?mt.style.display="none":mt.parentNode.removeChild(mt),yt}for(var pe=O.view,Ee=O.viewFrom,We=0;We<pe.length;We++){var Ke=pe[We];if(!Ke.hidden)if(!Ke.node||Ke.node.parentNode!=$){var ut=Dn(e,Ke,Ee,D);$.insertBefore(ut,oe)}else{for(;oe!=Ke.node;)oe=fe(oe);var at=U&&t!=null&&t<=Ee&&Ke.lineNumber;Ke.changes&&(re(Ke.changes,"gutter")>-1&&(at=!1),Di(e,Ke,Ee,D)),at&&(E(Ke.lineNumber),Ke.lineNumber.appendChild(document.createTextNode(Vr(e.options,Ee)))),oe=Ke.node.nextSibling}Ee+=Ke.size}for(;oe;)oe=fe(oe)}function Ba(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function cn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Je(e)+"px"}function Wr(e){var t=e.display,D=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var O=vi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,U=t.gutters.offsetWidth,$=O+"px",oe=0;oe<D.length;oe++)if(!D[oe].hidden){e.options.fixedGutter&&(D[oe].gutter&&(D[oe].gutter.style.left=$),D[oe].gutterBackground&&(D[oe].gutterBackground.style.left=$));var fe=D[oe].alignable;if(fe)for(var pe=0;pe<fe.length;pe++)fe[pe].style.left=$}e.options.fixedGutter&&(t.gutters.style.left=O+U+"px")}function ii(e){if(!e.options.lineNumbers)return!1;var t=e.doc,D=Vr(e.options,t.first+t.size-1),O=e.display;if(D.length!=O.lineNumChars){var U=O.measure.appendChild(_("div",[_("div",D)],"CodeMirror-linenumber CodeMirror-gutter-elt")),$=U.firstChild.offsetWidth,oe=U.offsetWidth-$;return O.lineGutter.style.width="",O.lineNumInnerWidth=Math.max($,O.lineGutter.offsetWidth-oe)+1,O.lineNumWidth=O.lineNumInnerWidth+oe,O.lineNumChars=O.lineNumInnerWidth?D.length:-1,O.lineGutter.style.width=O.lineNumWidth+"px",Ba(e.display),!0}return!1}function Si(e,t){for(var D=[],O=!1,U=0;U<e.length;U++){var $=e[U],oe=null;if(typeof $!="string"&&(oe=$.style,$=$.className),$=="CodeMirror-linenumbers")if(t)O=!0;else continue;D.push({className:$,style:oe})}return t&&!O&&D.push({className:"CodeMirror-linenumbers",style:null}),D}function wa(e){var t=e.gutters,D=e.gutterSpecs;E(t),e.lineGutter=null;for(var O=0;O<D.length;++O){var U=D[O],$=U.className,oe=U.style,fe=t.appendChild(_("div",null,"CodeMirror-gutter "+$));oe&&(fe.style.cssText=oe),$=="CodeMirror-linenumbers"&&(e.lineGutter=fe,fe.style.width=(e.lineNumWidth||1)+"px")}t.style.display=D.length?"":"none",Ba(e)}function Qi(e){wa(e.display),bn(e),Wr(e)}function ka(e,t,D,O){var U=this;this.input=D,U.scrollbarFiller=_("div",null,"CodeMirror-scrollbar-filler"),U.scrollbarFiller.setAttribute("cm-not-content","true"),U.gutterFiller=_("div",null,"CodeMirror-gutter-filler"),U.gutterFiller.setAttribute("cm-not-content","true"),U.lineDiv=N("div",null,"CodeMirror-code"),U.selectionDiv=_("div",null,null,"position: relative; z-index: 1"),U.cursorDiv=_("div",null,"CodeMirror-cursors"),U.measure=_("div",null,"CodeMirror-measure"),U.lineMeasure=_("div",null,"CodeMirror-measure"),U.lineSpace=N("div",[U.measure,U.lineMeasure,U.selectionDiv,U.cursorDiv,U.lineDiv],null,"position: relative; outline: none");var $=N("div",[U.lineSpace],"CodeMirror-lines");U.mover=_("div",[$],null,"position: relative"),U.sizer=_("div",[U.mover],"CodeMirror-sizer"),U.sizerWidth=null,U.heightForcer=_("div",null,null,"position: absolute; height: "+ee+"px; width: 1px;"),U.gutters=_("div",null,"CodeMirror-gutters"),U.lineGutter=null,U.scroller=_("div",[U.sizer,U.heightForcer,U.gutters],"CodeMirror-scroll"),U.scroller.setAttribute("tabIndex","-1"),U.wrapper=_("div",[U.scrollbarFiller,U.gutterFiller,U.scroller],"CodeMirror"),C&&c<8&&(U.gutters.style.zIndex=-1,U.scroller.style.paddingRight=0),!a&&!(S&&n)&&(U.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(U.wrapper):e(U.wrapper)),U.viewFrom=U.viewTo=t.first,U.reportedViewFrom=U.reportedViewTo=t.first,U.view=[],U.renderedView=null,U.externalMeasured=null,U.viewOffset=0,U.lastWrapHeight=U.lastWrapWidth=0,U.updateLineNumbers=null,U.nativeBarWidth=U.barHeight=U.barWidth=0,U.scrollbarsClipped=!1,U.lineNumWidth=U.lineNumInnerWidth=U.lineNumChars=null,U.alignWidgets=!1,U.cachedCharWidth=U.cachedTextHeight=U.cachedPaddingH=null,U.maxLine=null,U.maxLineLength=0,U.maxLineChanged=!1,U.wheelDX=U.wheelDY=U.wheelStartX=U.wheelStartY=null,U.shift=!1,U.selForContextMenu=null,U.activeTouch=null,U.gutterSpecs=Si(O.gutters,O.lineNumbers),wa(U),D.init(U)}var la=0,ai=null;C?ai=-.53:S?ai=15:r?ai=-.7:p&&(ai=-1/3);function Wa(e){var t=e.wheelDeltaX,D=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),D==null&&e.detail&&e.axis==e.VERTICAL_AXIS?D=e.detail:D==null&&(D=e.wheelDelta),{x:t,y:D}}function so(e){var t=Wa(e);return t.x*=ai,t.y*=ai,t}function lo(e,t){var D=Wa(t),O=D.x,U=D.y,$=e.display,oe=$.scroller,fe=oe.scrollWidth>oe.clientWidth,pe=oe.scrollHeight>oe.clientHeight;if(!(O&&fe||U&&pe))return;if(U&&d&&a){e:for(var Ee=t.target,We=$.view;Ee!=oe;Ee=Ee.parentNode)for(var Ke=0;Ke<We.length;Ke++)if(We[Ke].node==Ee){e.display.currentWheelTarget=Ee;break e}}if(O&&!S&&!l&&ai!=null){U&&pe&&xa(e,Math.max(0,oe.scrollTop+U*ai)),Wi(e,Math.max(0,oe.scrollLeft+O*ai)),(!U||U&&pe)&&ye(t),$.wheelStartX=null;return}if(U&&ai!=null){var ut=U*ai,at=e.doc.scrollTop,mt=at+$.wrapper.clientHeight;ut<0?at=Math.max(0,at+ut-50):mt=Math.min(e.doc.height,mt+ut+50),Da(e,{top:at,bottom:mt})}la<20&&($.wheelStartX==null?($.wheelStartX=oe.scrollLeft,$.wheelStartY=oe.scrollTop,$.wheelDX=O,$.wheelDY=U,setTimeout(function(){if($.wheelStartX==null)return;var yt=oe.scrollLeft-$.wheelStartX,_t=oe.scrollTop-$.wheelStartY,kt=_t&&$.wheelDY&&_t/$.wheelDY||yt&&$.wheelDX&&yt/$.wheelDX;if($.wheelStartX=$.wheelStartY=null,!kt)return;ai=(ai*la+kt)/(la+1),++la},200)):($.wheelDX+=O,$.wheelDY+=U))}var Ti=function(e,t){this.ranges=e,this.primIndex=t};Ti.prototype.primary=function(){return this.ranges[this.primIndex]},Ti.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var D=this.ranges[t],O=e.ranges[t];if(!rn(D.anchor,O.anchor)||!rn(D.head,O.head))return!1}return!0},Ti.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new sn(hn(this.ranges[t].anchor),hn(this.ranges[t].head));return new Ti(e,this.primIndex)},Ti.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ti.prototype.contains=function(e,t){t||(t=e);for(var D=0;D<this.ranges.length;D++){var O=this.ranges[D];if(Ft(t,O.from())>=0&&Ft(e,O.to())<=0)return D}return-1};var sn=function(e,t){this.anchor=e,this.head=t};sn.prototype.from=function(){return Rn(this.anchor,this.head)},sn.prototype.to=function(){return An(this.anchor,this.head)},sn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function zi(e,t,D){var O=e&&e.options.selectionsMayTouch,U=t[D];t.sort(function(ut,at){return Ft(ut.from(),at.from())}),D=re(t,U);for(var $=1;$<t.length;$++){var oe=t[$],fe=t[$-1],pe=Ft(fe.to(),oe.from());if(O&&!oe.empty()?pe>0:pe>=0){var Ee=Rn(fe.from(),oe.from()),We=An(fe.to(),oe.to()),Ke=fe.empty()?oe.from()==oe.head:fe.from()==fe.head;$<=D&&--D,t.splice(--$,2,new sn(Ke?We:Ee,Ke?Ee:We))}}return new Ti(t,D)}function Zi(e,t){return new Ti([new sn(e,t||e)],0)}function qi(e){return e.text?vt(e.from.line+e.text.length-1,ae(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function uo(e,t){if(Ft(e,t.from)<0)return e;if(Ft(e,t.to)<=0)return qi(t);var D=e.line+t.text.length-(t.to.line-t.from.line)-1,O=e.ch;return e.line==t.to.line&&(O+=qi(t).ch-t.to.ch),vt(D,O)}function Ha(e,t){for(var D=[],O=0;O<e.sel.ranges.length;O++){var U=e.sel.ranges[O];D.push(new sn(uo(U.anchor,t),uo(U.head,t)))}return zi(e.cm,D,e.sel.primIndex)}function Lo(e,t,D){return e.line==t.line?vt(D.line,e.ch-t.ch+D.ch):vt(D.line+(e.line-t.line),e.ch)}function Mo(e,t,D){for(var O=[],U=vt(e.first,0),$=U,oe=0;oe<t.length;oe++){var fe=t[oe],pe=Lo(fe.from,U,$),Ee=Lo(qi(fe),U,$);if(U=fe.to,$=Ee,D=="around"){var We=e.sel.ranges[oe],Ke=Ft(We.head,We.anchor)<0;O[oe]=new sn(Ke?Ee:pe,Ke?pe:Ee)}else O[oe]=new sn(pe,pe)}return new Ti(O,e.sel.primIndex)}function pa(e){e.doc.mode=hr(e.options,e.doc.modeOption),co(e)}function co(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ra(e,100),e.state.modeGen++,e.curOp&&bn(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&ae(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,D,O){function U(Ut){return D?D[Ut]:null}function $(Ut,Lt,Wt){$r(Ut,Lt,Wt,O),sr(Ut,"change",Ut,t)}function oe(Ut,Lt){for(var Wt=[],lr=Ut;lr<Lt;++lr)Wt.push(new ei(Ee[lr],U(lr),O));return Wt}var fe=t.from,pe=t.to,Ee=t.text,We=Ct(e,fe.line),Ke=Ct(e,pe.line),ut=ae(Ee),at=U(Ee.length-1),mt=pe.line-fe.line;if(t.full)e.insert(0,oe(0,Ee.length)),e.remove(Ee.length,e.size-Ee.length);else if(gs(e,t)){var yt=oe(0,Ee.length-1);$(Ke,Ke.text,at),mt&&e.remove(fe.line,mt),yt.length&&e.insert(fe.line,yt)}else if(We==Ke)if(Ee.length==1)$(We,We.text.slice(0,fe.ch)+ut+We.text.slice(pe.ch),at);else{var _t=oe(1,Ee.length-1);_t.push(new ei(ut+We.text.slice(pe.ch),at,O)),$(We,We.text.slice(0,fe.ch)+Ee[0],U(0)),e.insert(fe.line+1,_t)}else if(Ee.length==1)$(We,We.text.slice(0,fe.ch)+Ee[0]+Ke.text.slice(pe.ch),U(0)),e.remove(fe.line+1,mt);else{$(We,We.text.slice(0,fe.ch)+Ee[0],U(0)),$(Ke,ut+Ke.text.slice(pe.ch),at);var kt=oe(1,Ee.length-1);mt>1&&e.remove(fe.line+1,mt-1),e.insert(fe.line+1,kt)}sr(e,"change",e,t)}function Ca(e,t,D){function O(U,$,oe){if(U.linked)for(var fe=0;fe<U.linked.length;++fe){var pe=U.linked[fe];if(pe.doc==$)continue;var Ee=oe&&pe.sharedHist;if(D&&!Ee)continue;t(pe.doc,Ee),O(pe.doc,U,Ee)}}O(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,wi(e),pa(e),ys(e),e.options.lineWrapping||pi(e),e.options.mode=t.modeOption,bn(e)}function ys(e){(e.doc.direction=="rtl"?H:x)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Ci(e,function(){ys(e),bn(e)})}function Po(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 rs(e,t){var D={from:hn(t.from),to:qi(t),text:Rr(e,t.from,t.to)};return Es(e,D,t.from.line,t.to.line+1),Ca(e,function(O){return Es(O,D,t.from.line,t.to.line+1)},!0),D}function bs(e){for(;e.length;){var t=ae(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return bs(e.done),ae(e.done);if(e.done.length&&!ae(e.done).ranges)return ae(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ae(e.done)}function xs(e,t,D,O){var U=e.history;U.undone.length=0;var $=+new Date,oe,fe;if((U.lastOp==O||U.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&U.lastModTime>$-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(oe=ml(U,U.lastOp==O)))fe=ae(oe.changes),Ft(t.from,t.to)==0&&Ft(t.from,fe.to)==0?fe.to=qi(t):oe.changes.push(rs(e,t));else{var pe=ae(U.done);for((!pe||!pe.ranges)&&Io(e.sel,U.done),oe={changes:[rs(e,t)],generation:U.generation},U.done.push(oe);U.done.length>U.undoDepth;)U.done.shift(),U.done[0].ranges||U.done.shift()}U.done.push(D),U.generation=++U.maxGeneration,U.lastModTime=U.lastSelTime=$,U.lastOp=U.lastSelOp=O,U.lastOrigin=U.lastSelOrigin=t.origin,fe||$e(e,"historyAdded")}function gl(e,t,D,O){var U=t.charAt(0);return U=="*"||U=="+"&&D.ranges.length==O.ranges.length&&D.somethingSelected()==O.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,D,O){var U=e.history,$=O&&O.origin;D==U.lastSelOp||$&&U.lastSelOrigin==$&&(U.lastModTime==U.lastSelTime&&U.lastOrigin==$||gl(e,$,ae(U.done),t))?U.done[U.done.length-1]=t:Io(t,U.done),U.lastSelTime=+new Date,U.lastSelOrigin=$,U.lastSelOp=D,O&&O.clearRedo!==!1&&bs(U.undone)}function Io(e,t){var D=ae(t);D&&D.ranges&&D.equals(e)||t.push(e)}function Es(e,t,D,O){var U=t["spans_"+e.id],$=0;e.iter(Math.max(e.first,D),Math.min(e.first+e.size,O),function(oe){oe.markedSpans&&((U||(U=t["spans_"+e.id]={}))[$]=oe.markedSpans),++$})}function yl(e){if(!e)return null;for(var t,D=0;D<e.length;++D)e[D].marker.explicitlyCleared?t||(t=e.slice(0,D)):t&&t.push(e[D]);return t?t.length?t:null:e}function bl(e,t){var D=t["spans_"+e.id];if(!D)return null;for(var O=[],U=0;U<t.text.length;++U)O.push(yl(D[U]));return O}function ws(e,t){var D=bl(e,t),O=Fn(e,t);if(!D)return O;if(!O)return D;for(var U=0;U<D.length;++U){var $=D[U],oe=O[U];if($&&oe){e:for(var fe=0;fe<oe.length;++fe){for(var pe=oe[fe],Ee=0;Ee<$.length;++Ee)if($[Ee].marker==pe.marker)continue e;$.push(pe)}}else oe&&(D[U]=oe)}return D}function za(e,t,D){for(var O=[],U=0;U<e.length;++U){var $=e[U];if($.ranges){O.push(D?Ti.prototype.deepCopy.call($):$);continue}var oe=$.changes,fe=[];O.push({changes:fe});for(var pe=0;pe<oe.length;++pe){var Ee=oe[pe],We=void 0;if(fe.push({from:Ee.from,to:Ee.to,text:Ee.text}),t)for(var Ke in Ee)(We=Ke.match(/^spans_(\d+)$/))&&(re(t,Number(We[1]))>-1&&(ae(fe)[Ke]=Ee[Ke],delete Ee[Ke]))}}return O}function ns(e,t,D,O){if(O){var U=e.anchor;if(D){var $=Ft(t,U)<0;$!=Ft(D,U)<0?(U=t,t=D):$!=Ft(t,D)<0&&(t=D)}return new sn(U,t)}else return new sn(D||t,t)}function No(e,t,D,O,U){U==null&&(U=e.cm&&(e.cm.display.shift||e.extend)),yi(e,new Ti([ns(e.sel.primary(),t,D,U)],0),O)}function Cs(e,t,D){for(var O=[],U=e.cm&&(e.cm.display.shift||e.extend),$=0;$<e.sel.ranges.length;$++)O[$]=ns(e.sel.ranges[$],t[$],null,U);var oe=zi(e.cm,O,e.sel.primIndex);yi(e,oe,D)}function is(e,t,D,O){var U=e.sel.ranges.slice(0);U[t]=D,yi(e,zi(e.cm,U,e.sel.primIndex),O)}function Ss(e,t,D,O){yi(e,Zi(t,D),O)}function xl(e,t,D){var O={ranges:t.ranges,update:function(U){this.ranges=[];for(var $=0;$<U.length;$++)this.ranges[$]=new sn(V(e,U[$].anchor),V(e,U[$].head))},origin:D&&D.origin};return $e(e,"beforeSelectionChange",e,O),e.cm&&$e(e.cm,"beforeSelectionChange",e.cm,O),O.ranges!=t.ranges?zi(e.cm,O.ranges,O.ranges.length-1):t}function Ts(e,t,D){var O=e.history.done,U=ae(O);U&&U.ranges?(O[O.length-1]=t,jo(e,t,D)):yi(e,t,D)}function yi(e,t,D){jo(e,t,D),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,D)}function jo(e,t,D){(Me(e,"beforeSelectionChange")||e.cm&&Me(e.cm,"beforeSelectionChange"))&&(t=xl(e,t,D));var O=D&&D.bias||(Ft(t.primary().head,e.sel.primary().head)<0?-1:1);_s(e,As(e,t,O,!0)),!(D&&D.scroll===!1)&&e.cm&&ya(e.cm)}function _s(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ue(e.cm)),sr(e,"cursorActivity",e)}function Os(e){_s(e,As(e,e.sel,null,!1))}function As(e,t,D,O){for(var U,$=0;$<t.ranges.length;$++){var oe=t.ranges[$],fe=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[$],pe=Uo(e,oe.anchor,fe&&fe.anchor,D,O),Ee=Uo(e,oe.head,fe&&fe.head,D,O);(U||pe!=oe.anchor||Ee!=oe.head)&&(U||(U=t.ranges.slice(0,$)),U[$]=new sn(pe,Ee))}return U?zi(e.cm,U,t.primIndex):t}function Ka(e,t,D,O,U){var $=Ct(e,t.line);if($.markedSpans)for(var oe=0;oe<$.markedSpans.length;++oe){var fe=$.markedSpans[oe],pe=fe.marker,Ee="selectLeft"in pe?!pe.selectLeft:pe.inclusiveLeft,We="selectRight"in pe?!pe.selectRight:pe.inclusiveRight;if((fe.from==null||(Ee?fe.from<=t.ch:fe.from<t.ch))&&(fe.to==null||(We?fe.to>=t.ch:fe.to>t.ch))){if(U&&($e(pe,"beforeCursorEnter"),pe.explicitlyCleared))if($.markedSpans){--oe;continue}else break;if(!pe.atomic)continue;if(D){var Ke=pe.find(O<0?1:-1),ut=void 0;if((O<0?We:Ee)&&(Ke=Rs(e,Ke,-O,Ke&&Ke.line==t.line?$:null)),Ke&&Ke.line==t.line&&(ut=Ft(Ke,D))&&(O<0?ut<0:ut>0))return Ka(e,Ke,t,O,U)}var at=pe.find(O<0?-1:1);return(O<0?Ee:We)&&(at=Rs(e,at,O,at.line==t.line?$:null)),at?Ka(e,at,t,O,U):null}}return t}function Uo(e,t,D,O,U){var $=O||1,oe=Ka(e,t,D,$,U)||!U&&Ka(e,t,D,$,!0)||Ka(e,t,D,-$,U)||!U&&Ka(e,t,D,-$,!0);return oe||(e.cantEdit=!0,vt(e.first,0))}function Rs(e,t,D,O){return D<0&&t.ch==0?t.line>e.first?V(e,vt(t.line-1)):null:D>0&&t.ch==(O||Ct(e,t.line)).text.length?t.line<e.first+e.size-1?vt(t.line+1,0):null:new vt(t.line,t.ch+D)}function Ds(e){e.setSelection(vt(e.firstLine(),0),vt(e.lastLine()),xe)}function ks(e,t,D){var O={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return O.canceled=!0}};return D&&(O.update=function(U,$,oe,fe){U&&(O.from=V(e,U)),$&&(O.to=V(e,$)),oe&&(O.text=oe),fe!==void 0&&(O.origin=fe)}),$e(e,"beforeChange",e,O),e.cm&&$e(e.cm,"beforeChange",e.cm,O),O.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:O.from,to:O.to,text:O.text,origin:O.origin}}function Ga(e,t,D){if(e.cm){if(!e.cm.curOp)return Gn(e.cm,Ga)(e,t,D);if(e.cm.state.suppressEdits)return}if((Me(e,"beforeChange")||e.cm&&Me(e.cm,"beforeChange"))&&(t=ks(e,t,!0),!t))return;var O=fr&&!D&&Oi(e,t.from,t.to);if(O)for(var U=O.length-1;U>=0;--U)Ls(e,{from:O[U].from,to:O[U].to,text:U?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Ft(t.from,t.to)==0)return;var D=Ha(e,t);xs(e,t,D,e.cm?e.cm.curOp.id:NaN),ho(e,t,D,Fn(e,t));var O=[];Ca(e,function(U,$){!$&&re(O,U.history)==-1&&(Ns(U.history,t),O.push(U.history)),ho(U,t,null,Fn(U,t))})}function Fo(e,t,D){var O=e.cm&&e.cm.state.suppressEdits;if(O&&!D)return;for(var U=e.history,$,oe=e.sel,fe=t=="undo"?U.done:U.undone,pe=t=="undo"?U.undone:U.done,Ee=0;Ee<fe.length&&!($=fe[Ee],D?$.ranges&&!$.equals(e.sel):!$.ranges);Ee++);if(Ee==fe.length)return;for(U.lastOrigin=U.lastSelOrigin=null;;)if($=fe.pop(),$.ranges){if(Io($,pe),D&&!$.equals(e.sel)){yi(e,$,{clearRedo:!1});return}oe=$}else if(O){fe.push($);return}else break;var We=[];Io(oe,pe),pe.push({changes:We,generation:U.generation}),U.generation=$.generation||++U.maxGeneration;for(var Ke=Me(e,"beforeChange")||e.cm&&Me(e.cm,"beforeChange"),ut=function(yt){var _t=$.changes[yt];if(_t.origin=t,Ke&&!ks(e,_t,!1))return fe.length=0,{};We.push(rs(e,_t));var kt=yt?Ha(e,_t):ae(fe);ho(e,_t,kt,ws(e,_t)),!yt&&e.cm&&e.cm.scrollIntoView({from:_t.from,to:qi(_t)});var Ut=[];Ca(e,function(Lt,Wt){!Wt&&re(Ut,Lt.history)==-1&&(Ns(Lt.history,_t),Ut.push(Lt.history)),ho(Lt,_t,null,ws(Lt,_t))})},at=$.changes.length-1;at>=0;--at){var mt=ut(at);if(mt)return mt.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ti(Se(e.sel.ranges,function(U){return new sn(vt(U.anchor.line+t,U.anchor.ch),vt(U.head.line+t,U.head.ch))}),e.sel.primIndex),e.cm){bn(e.cm,e.first,e.first-t,t);for(var D=e.cm.display,O=D.viewFrom;O<D.viewTo;O++)Nn(e.cm,O,"gutter")}}function ho(e,t,D,O){if(e.cm&&!e.cm.curOp)return Gn(e.cm,ho)(e,t,D,O);if(t.to.line<e.first){Ms(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var U=t.text.length-1-(e.first-t.from.line);Ms(e,U),t={from:vt(e.first,0),to:vt(t.to.line+U,t.to.ch),text:[ae(t.text)],origin:t.origin}}var $=e.lastLine();t.to.line>$&&(t={from:t.from,to:vt($,Ct(e,$).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Rr(e,t.from,t.to),D||(D=Ha(e,t)),e.cm?El(e.cm,t,O):ts(e,t,O),jo(e,D,xe),e.cantEdit&&Uo(e,vt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,D){var O=e.doc,U=e.display,$=t.from,oe=t.to,fe=!1,pe=$.line;e.options.lineWrapping||(pe=jt(On(Ct(O,$.line))),O.iter(pe,oe.line+1,function(at){if(at==U.maxLine)return fe=!0,!0})),O.sel.contains(t.from,t.to)>-1&&Ue(e),ts(O,t,D,Fi(e)),e.options.lineWrapping||(O.iter(pe,$.line+t.text.length,function(at){var mt=fi(at);mt>U.maxLineLength&&(U.maxLine=at,U.maxLineLength=mt,U.maxLineChanged=!0,fe=!1)}),fe&&(e.curOp.updateMaxLine=!0)),Hr(O,$.line),Ra(e,400);var Ee=t.text.length-(oe.line-$.line)-1;t.full?bn(e):$.line==oe.line&&t.text.length==1&&!gs(e.doc,t)?Nn(e,$.line,"text"):bn(e,$.line,oe.line+1,Ee);var We=Me(e,"changes"),Ke=Me(e,"change");if(Ke||We){var ut={from:$,to:oe,text:t.text,removed:t.removed,origin:t.origin};Ke&&sr(e,"change",e,ut),We&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ut)}e.display.selForContextMenu=null}function Va(e,t,D,O,U){var $;O||(O=D),Ft(O,D)<0&&($=[O,D],D=$[0],O=$[1]),typeof t=="string"&&(t=e.splitLines(t)),Ga(e,{from:D,to:O,text:t,origin:U})}function Ps(e,t,D,O){D<e.line?e.line+=O:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,D,O){for(var U=0;U<e.length;++U){var $=e[U],oe=!0;if($.ranges){$.copied||($=e[U]=$.deepCopy(),$.copied=!0);for(var fe=0;fe<$.ranges.length;fe++)Ps($.ranges[fe].anchor,t,D,O),Ps($.ranges[fe].head,t,D,O);continue}for(var pe=0;pe<$.changes.length;++pe){var Ee=$.changes[pe];if(D<Ee.from.line)Ee.from=vt(Ee.from.line+O,Ee.from.ch),Ee.to=vt(Ee.to.line+O,Ee.to.ch);else if(t<=Ee.to.line){oe=!1;break}}oe||(e.splice(0,U+1),U=0)}}function Ns(e,t){var D=t.from.line,O=t.to.line,U=t.text.length-(O-D)-1;Is(e.done,D,O,U),Is(e.undone,D,O,U)}function fo(e,t,D,O){var U=t,$=t;return typeof t=="number"?$=Ct(e,se(e,t)):U=jt(t),U==null?null:(O($,U)&&e.cm&&Nn(e.cm,U,D),$)}function po(e){this.lines=e,this.parent=null;for(var t=0,D=0;D<e.length;++D)e[D].parent=this,t+=e[D].height;this.height=t}po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var D=e,O=e+t;D<O;++D){var U=this.lines[D];this.height-=U.height,$i(U),sr(U,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,D){this.height+=D,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var O=0;O<t.length;++O)t[O].parent=this},iterN:function(e,t,D){for(var O=e+t;e<O;++e)if(D(this.lines[e]))return!0}};function mo(e){this.children=e;for(var t=0,D=0,O=0;O<e.length;++O){var U=e[O];t+=U.chunkSize(),D+=U.height,U.parent=this}this.size=t,this.height=D,this.parent=null}mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var D=0;D<this.children.length;++D){var O=this.children[D],U=O.chunkSize();if(e<U){var $=Math.min(t,U-e),oe=O.height;if(O.removeInner(e,$),this.height-=oe-O.height,U==$&&(this.children.splice(D--,1),O.parent=null),(t-=$)==0)break;e=0}else e-=U}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof po))){var fe=[];this.collapse(fe),this.children=[new po(fe)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,D){this.size+=t.length,this.height+=D;for(var O=0;O<this.children.length;++O){var U=this.children[O],$=U.chunkSize();if(e<=$){if(U.insertInner(e,t,D),U.lines&&U.lines.length>50){for(var oe=U.lines.length%25+25,fe=oe;fe<U.lines.length;){var pe=new po(U.lines.slice(fe,fe+=25));U.height-=pe.height,this.children.splice(++O,0,pe),pe.parent=this}U.lines=U.lines.slice(0,oe),this.maybeSpill()}break}e-=$}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),D=new mo(t);if(e.parent){e.size-=D.size,e.height-=D.height;var U=re(e.parent.children,e);e.parent.children.splice(U+1,0,D)}else{var O=new mo(e.children);O.parent=e,e.children=[O,D],e=O}D.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,D){for(var O=0;O<this.children.length;++O){var U=this.children[O],$=U.chunkSize();if(e<$){var oe=Math.min(t,$-e);if(U.iterN(e,oe,D))return!0;if((t-=oe)==0)break;e=0}else e-=$}}};var go=function(e,t,D){if(D)for(var O in D)D.hasOwnProperty(O)&&(this[O]=D[O]);this.doc=e,this.node=t};go.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,D=this.line,O=jt(D);if(O==null||!t)return;for(var U=0;U<t.length;++U)t[U]==this&&t.splice(U--,1);t.length||(D.widgets=null);var $=Kn(this);$t(D,Math.max(0,D.height-$)),e&&(Ci(e,function(){js(e,D,-$),Nn(e,O,"widget")}),sr(e,"lineWidgetCleared",e,this,O))},go.prototype.changed=function(){var e=this,t=this.height,D=this.doc.cm,O=this.line;this.height=null;var U=Kn(this)-t;if(!U)return;Yn(this.doc,O)||$t(O,O.height+U),D&&Ci(D,function(){D.curOp.forceUpdate=!0,js(D,O,U),sr(D,"lineWidgetChanged",D,e,jt(O))})},Ie(go);function js(e,t,D){zn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&no(e,D)}function wl(e,t,D,O){var U=new go(e,D,O),$=e.cm;return $&&U.noHScroll&&($.display.alignWidgets=!0),fo(e,t,"widget",function(oe){var fe=oe.widgets||(oe.widgets=[]);if(U.insertAt==null?fe.push(U):fe.splice(Math.min(fe.length-1,Math.max(0,U.insertAt)),0,U),U.line=oe,$&&!Yn(e,oe)){var pe=zn(oe)<e.scrollTop;$t(oe,oe.height+Kn(U)),pe&&no($,U.height),$.curOp.forceUpdate=!0}return!0}),$&&sr($,"lineWidgetAdded",$,U,typeof t=="number"?t:jt(t)),U}var Us=0,Sa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};Sa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&sa(e),Me(this,"clear")){var D=this.find();D&&sr(this,"clear",D.from,D.to)}for(var O=null,U=null,$=0;$<this.lines.length;++$){var oe=this.lines[$],fe=ln(oe.markedSpans,this);e&&!this.collapsed?Nn(e,jt(oe),"text"):e&&(fe.to!=null&&(U=jt(oe)),fe.from!=null&&(O=jt(oe))),oe.markedSpans=mn(oe.markedSpans,fe),fe.from==null&&this.collapsed&&!Yn(this.doc,oe)&&e&&$t(oe,Wn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var pe=0;pe<this.lines.length;++pe){var Ee=On(this.lines[pe]),We=fi(Ee);We>e.display.maxLineLength&&(e.display.maxLine=Ee,e.display.maxLineLength=We,e.display.maxLineChanged=!0)}O!=null&&e&&this.collapsed&&bn(e,O,U+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&sr(e,"markerCleared",e,this,O,U),t&&ha(e),this.parent&&this.parent.clear()},Sa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var D,O,U=0;U<this.lines.length;++U){var $=this.lines[U],oe=ln($.markedSpans,this);if(oe.from!=null&&(D=vt(t?$:jt($),oe.from),e==-1))return D;if(oe.to!=null&&(O=vt(t?$:jt($),oe.to),e==1))return O}return D&&{from:D,to:O}},Sa.prototype.changed=function(){var e=this,t=this.find(-1,!0),D=this,O=this.doc.cm;if(!t||!O)return;Ci(O,function(){var U=t.line,$=jt(t.line),oe=Ye(O,$);if(oe&&(gr(oe),O.curOp.selectionChanged=O.curOp.forceUpdate=!0),O.curOp.updateMaxLine=!0,!Yn(D.doc,U)&&D.height!=null){var fe=D.height;D.height=null;var pe=Kn(D)-fe;pe&&$t(U,U.height+pe)}sr(O,"markerChanged",O,e)})},Sa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||re(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Sa.prototype.detachLine=function(e){if(this.lines.splice(re(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ie(Sa);function Xa(e,t,D,O,U){if(O&&O.shared)return Cl(e,t,D,O,U);if(e.cm&&!e.cm.curOp)return Gn(e.cm,Xa)(e,t,D,O,U);var $=new Sa(e,U),oe=Ft(t,D);if(O&&W(O,$,!1),oe>0||oe==0&&$.clearWhenEmpty!==!1)return $;if($.replacedWith&&($.collapsed=!0,$.widgetNode=N("span",[$.replacedWith],"CodeMirror-widget"),O.handleMouseEvents||$.widgetNode.setAttribute("cm-ignore-events","true"),O.insertLeft&&($.widgetNode.insertLeft=!0)),$.collapsed){if(gn(e,t.line,t,D,$)||t.line!=D.line&&gn(e,D.line,t,D,$))throw new Error("Inserting collapsed marker partially overlapping an existing one");vr()}$.addToHistory&&xs(e,{from:t,to:D,origin:"markText"},e.sel,NaN);var fe=t.line,pe=e.cm,Ee;if(e.iter(fe,D.line+1,function(Ke){pe&&$.collapsed&&!pe.options.lineWrapping&&On(Ke)==pe.display.maxLine&&(Ee=!0),$.collapsed&&fe!=t.line&&$t(Ke,0),li(Ke,new Xr($,fe==t.line?t.ch:null,fe==D.line?D.ch:null)),++fe}),$.collapsed&&e.iter(t.line,D.line+1,function(Ke){Yn(e,Ke)&&$t(Ke,0)}),$.clearOnEnter&&Re($,"beforeCursorEnter",function(){return $.clear()}),$.readOnly&&(tr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),$.collapsed&&($.id=++Us,$.atomic=!0),pe){if(Ee&&(pe.curOp.updateMaxLine=!0),$.collapsed)bn(pe,t.line,D.line+1);else if($.className||$.startStyle||$.endStyle||$.css||$.attributes||$.title)for(var We=t.line;We<=D.line;We++)Nn(pe,We,"text");$.atomic&&Os(pe.doc),sr(pe,"markerAdded",pe,$)}return $}var vo=function(e,t){this.markers=e,this.primary=t;for(var D=0;D<e.length;++D)e[D].parent=this};vo.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")},vo.prototype.find=function(e,t){return this.primary.find(e,t)},Ie(vo);function Cl(e,t,D,O,U){O=W(O),O.shared=!1;var $=[Xa(e,t,D,O,U)],oe=$[0],fe=O.widgetNode;return Ca(e,function(pe){fe&&(O.widgetNode=fe.cloneNode(!0)),$.push(Xa(pe,V(pe,t),V(pe,D),O,U));for(var Ee=0;Ee<pe.linked.length;++Ee)if(pe.linked[Ee].isParent)return;oe=ae($)}),new vo($,oe)}function Fs(e){return e.findMarks(vt(e.first,0),e.clipPos(vt(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var D=0;D<t.length;D++){var O=t[D],U=O.find(),$=e.clipPos(U.from),oe=e.clipPos(U.to);if(Ft($,oe)){var fe=Xa(e,$,oe,O.primary,O.primary.type);O.markers.push(fe),fe.parent=O}}}function Tl(e){for(var t=function(O){var U=e[O],$=[U.primary.doc];Ca(U.primary.doc,function(pe){return $.push(pe)});for(var oe=0;oe<U.markers.length;oe++){var fe=U.markers[oe];re($,fe.doc)==-1&&(fe.parent=null,U.markers.splice(oe--,1))}},D=0;D<e.length;D++)t(D)}var _l=0,Li=function(e,t,D,O,U){if(!(this instanceof Li))return new Li(e,t,D,O,U);D==null&&(D=0),mo.call(this,[new po([new ei("",null)])]),this.first=D,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=D;var $=vt(D,0);this.sel=Zi($),this.history=new Po(null),this.id=++_l,this.modeOption=t,this.lineSep=O,this.direction=U=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:$,to:$,text:e}),yi(this,Zi($),xe)};Li.prototype=Oe(mo.prototype,{constructor:Li,iter:function(e,t,D){D?this.iterN(e-this.first,t-e,D):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var D=0,O=0;O<t.length;++O)D+=t[O].height;this.insertInner(e-this.first,t,D)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=jr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Vn(function(e){var t=vt(this.first,0),D=this.first+this.size-1;Ga(this,{from:t,to:vt(D,Ct(this,D).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ba(this.cm,0,0),yi(this,Zi(t),xe)}),replaceRange:function(e,t,D,O){t=V(this,t),D=D?V(this,D):t,Va(this,e,t,D,O)},getRange:function(e,t,D){var O=Rr(this,V(this,e),V(this,t));return D===!1?O:O.join(D||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(_n(this,e))return Ct(this,e)},getLineNumber:function(e){return jt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ct(this,e)),On(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return V(this,e)},getCursor:function(e){var t=this.sel.primary(),D;return e==null||e=="head"?D=t.head:e=="anchor"?D=t.anchor:e=="end"||e=="to"||e===!1?D=t.to():D=t.from(),D},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Vn(function(e,t,D){Ss(this,V(this,typeof e=="number"?vt(e,t||0):e),null,D)}),setSelection:Vn(function(e,t,D){Ss(this,V(this,e),V(this,t||e),D)}),extendSelection:Vn(function(e,t,D){No(this,V(this,e),t&&V(this,t),D)}),extendSelections:Vn(function(e,t){Cs(this,ne(this,e),t)}),extendSelectionsBy:Vn(function(e,t){var D=Se(this.sel.ranges,e);Cs(this,ne(this,D),t)}),setSelections:Vn(function(e,t,D){if(!e.length)return;for(var O=[],U=0;U<e.length;U++)O[U]=new sn(V(this,e[U].anchor),V(this,e[U].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),yi(this,zi(this.cm,O,t),D)}),addSelection:Vn(function(e,t,D){var O=this.sel.ranges.slice(0);O.push(new sn(V(this,e),V(this,t||e))),yi(this,zi(this.cm,O,O.length-1),D)}),getSelection:function(e){for(var t=this.sel.ranges,D,O=0;O<t.length;O++){var U=Rr(this,t[O].from(),t[O].to());D=D?D.concat(U):U}return e===!1?D:D.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],D=this.sel.ranges,O=0;O<D.length;O++){var U=Rr(this,D[O].from(),D[O].to());e!==!1&&(U=U.join(e||this.lineSeparator())),t[O]=U}return t},replaceSelection:function(e,t,D){for(var O=[],U=0;U<this.sel.ranges.length;U++)O[U]=e;this.replaceSelections(O,t,D||"+input")},replaceSelections:Vn(function(e,t,D){for(var O=[],U=this.sel,$=0;$<U.ranges.length;$++){var oe=U.ranges[$];O[$]={from:oe.from(),to:oe.to(),text:this.splitLines(e[$]),origin:D}}for(var fe=t&&t!="end"&&Mo(this,O,t),pe=O.length-1;pe>=0;pe--)Ga(this,O[pe]);fe?Ts(this,fe):this.cm&&ya(this.cm)}),undo:Vn(function(){Fo(this,"undo")}),redo:Vn(function(){Fo(this,"redo")}),undoSelection:Vn(function(){Fo(this,"undo",!0)}),redoSelection:Vn(function(){Fo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,D=0,O=0;O<e.done.length;O++)e.done[O].ranges||++t;for(var U=0;U<e.undone.length;U++)e.undone[U].ranges||++D;return{undo:t,redo:D}},clearHistory:function(){var e=this;this.history=new Po(this.history.maxGeneration),Ca(this,function(t){return t.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:za(this.history.done),undone:za(this.history.undone)}},setHistory:function(e){var t=this.history=new Po(this.history.maxGeneration);t.done=za(e.done.slice(0),null,!0),t.undone=za(e.undone.slice(0),null,!0)},setGutterMarker:Vn(function(e,t,D){return fo(this,e,"gutter",function(O){var U=O.gutterMarkers||(O.gutterMarkers={});return U[t]=D,!D&&Z(U)&&(O.gutterMarkers=null),!0})}),clearGutter:Vn(function(e){var t=this;this.iter(function(D){D.gutterMarkers&&D.gutterMarkers[e]&&fo(t,D,"gutter",function(){return D.gutterMarkers[e]=null,Z(D.gutterMarkers)&&(D.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!_n(this,e))return null;if(t=e,e=Ct(this,e),!e)return null}else if(t=jt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Vn(function(e,t,D){return fo(this,e,t=="gutter"?"gutter":"class",function(O){var U=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!O[U])O[U]=D;else{if(A(D).test(O[U]))return!1;O[U]+=" "+D}return!0})}),removeLineClass:Vn(function(e,t,D){return fo(this,e,t=="gutter"?"gutter":"class",function(O){var U=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",$=O[U];if($)if(D==null)O[U]=null;else{var oe=$.match(A(D));if(!oe)return!1;var fe=oe.index+oe[0].length;O[U]=$.slice(0,oe.index)+(!oe.index||fe==$.length?"":" ")+$.slice(fe)||null}else return!1;return!0})}),addLineWidget:Vn(function(e,t,D){return wl(this,e,t,D)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,D){return Xa(this,V(this,e),V(this,t),D,D&&D.type||"range")},setBookmark:function(e,t){var D={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=V(this,e),Xa(this,e,e,D,"bookmark")},findMarksAt:function(e){e=V(this,e);var t=[],D=Ct(this,e.line).markedSpans;if(D)for(var O=0;O<D.length;++O){var U=D[O];(U.from==null||U.from<=e.ch)&&(U.to==null||U.to>=e.ch)&&t.push(U.marker.parent||U.marker)}return t},findMarks:function(e,t,D){e=V(this,e),t=V(this,t);var O=[],U=e.line;return this.iter(e.line,t.line+1,function($){var oe=$.markedSpans;if(oe)for(var fe=0;fe<oe.length;fe++){var pe=oe[fe];!(pe.to!=null&&U==e.line&&e.ch>=pe.to||pe.from==null&&U!=e.line||pe.from!=null&&U==t.line&&pe.from>=t.ch)&&(!D||D(pe.marker))&&O.push(pe.marker.parent||pe.marker)}++U}),O},getAllMarks:function(){var e=[];return this.iter(function(t){var D=t.markedSpans;if(D)for(var O=0;O<D.length;++O)D[O].from!=null&&e.push(D[O].marker)}),e},posFromIndex:function(e){var t,D=this.first,O=this.lineSeparator().length;return this.iter(function(U){var $=U.text.length+O;if($>e)return t=e,!0;e-=$,++D}),V(this,vt(D,t))},indexFromPos:function(e){e=V(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var D=this.lineSeparator().length;return this.iter(this.first,e.line,function(O){t+=O.text.length+D}),t},copy:function(e){var t=new Li(jr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,D=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<D&&(D=e.to);var O=new Li(jr(this,t,D),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(O.history=this.history),(this.linked||(this.linked=[])).push({doc:O,sharedHist:e.sharedHist}),O.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(O,Fs(this)),O},unlinkDoc:function(e){if(e instanceof jn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var D=this.linked[t];if(D.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(Fs(this));break}if(e.history==this.history){var O=[e.id];Ca(e,function(U){return O.push(U.id)},!0),e.history=new Po(null),e.history.done=za(this.history.done,O),e.history.undone=za(this.history.undone,O)}},iterLinkedDocs:function(e){Ca(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ot(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:Vn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&pl(this.cm)})}),Li.prototype.eachLine=Li.prototype.iter;var Bs=0;function Ol(e){var t=this;if(Ws(t),qe(t,e)||$n(t.display,e))return;ye(e),C&&(Bs=+new Date);var D=ri(t,e,!0),O=e.dataTransfer.files;if(!D||t.isReadOnly())return;if(O&&O.length&&window.FileReader&&window.File)for(var U=O.length,$=Array(U),oe=0,fe=function(){++oe==U&&Gn(t,function(){D=V(t.doc,D);var at={from:D,to:D,text:t.doc.splitLines($.filter(function(mt){return mt!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ga(t.doc,at),Ts(t.doc,Zi(V(t.doc,D),V(t.doc,qi(at))))})()},pe=function(at,mt){if(t.options.allowDropFileTypes&&re(t.options.allowDropFileTypes,at.type)==-1){fe();return}var yt=new FileReader;yt.onerror=function(){return fe()},yt.onload=function(){var _t=yt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(_t)){fe();return}$[mt]=_t,fe()},yt.readAsText(at)},Ee=0;Ee<O.length;Ee++)pe(O[Ee],Ee);else{if(t.state.draggingText&&t.doc.sel.contains(D)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var We=e.dataTransfer.getData("Text");if(We){var Ke;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ke=t.listSelections()),jo(t.doc,Zi(D,D)),Ke)for(var ut=0;ut<Ke.length;++ut)Va(t.doc,"",Ke[ut].anchor,Ke[ut].head,"drag");t.replaceSelection(We,"around","paste"),t.display.input.focus()}}catch(at){}}}function Al(e,t){if(C&&(!e.state.draggingText||+new Date-Bs<100)){Pe(t);return}if(qe(e,t)||$n(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var D=_("img",null,null,"position: fixed; left: 0; top: 0;");D.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",l&&(D.width=D.height=1,e.display.wrapper.appendChild(D),D._top=D.offsetTop),t.dataTransfer.setDragImage(D,0,0),l&&D.parentNode.removeChild(D)}}function Rl(e,t){var D=ri(e,t);if(!D)return;var O=document.createDocumentFragment();ia(e,D,O),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),w(e.display.dragCursor,O)}function Ws(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Hs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),D=[],O=0;O<t.length;O++){var U=t[O].CodeMirror;U&&D.push(U)}D.length&&D[0].operation(function(){for(var $=0;$<D.length;$++)e(D[$])})}var zs=!1;function Dl(){if(zs)return;kl(),zs=!0}function kl(){var e;Re(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Hs(Ll)},100))}),Re(window,"blur",function(){return Hs(va)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ta={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"},yo=0;yo<10;yo++)Ta[yo+48]=Ta[yo+96]=String(yo);for(var Bo=65;Bo<=90;Bo++)Ta[Bo]=String.fromCharCode(Bo);for(var bo=1;bo<=12;bo++)Ta[bo+111]=Ta[bo+63235]="F"+bo;var ma={};ma.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"},ma.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"},ma.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"},ma.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"]},ma.default=d?ma.macDefault:ma.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var D,O,U,$,oe=0;oe<t.length-1;oe++){var fe=t[oe];if(/^(cmd|meta|m)$/i.test(fe))$=!0;else if(/^a(lt)?$/i.test(fe))D=!0;else if(/^(c|ctrl|control)$/i.test(fe))O=!0;else if(/^s(hift)?$/i.test(fe))U=!0;else throw new Error("Unrecognized modifier name: "+fe)}return D&&(e="Alt-"+e),O&&(e="Ctrl-"+e),$&&(e="Cmd-"+e),U&&(e="Shift-"+e),e}function Pl(e){var t={};for(var D in e)if(e.hasOwnProperty(D)){var O=e[D];if(/^(name|fallthrough|(de|at)tach)$/.test(D))continue;if(O=="..."){delete e[D];continue}for(var U=Se(D.split(" "),Ml),$=0;$<U.length;$++){var oe=void 0,fe=void 0;$==U.length-1?(fe=U.join(" "),oe=O):(fe=U.slice(0,$+1).join(" "),oe="...");var pe=t[fe];if(!pe)t[fe]=oe;else if(pe!=oe)throw new Error("Inconsistent bindings for "+fe)}delete e[D]}for(var Ee in t)e[Ee]=t[Ee];return e}function Ya(e,t,D,O){t=Wo(t);var U=t.call?t.call(e,O):t[e];if(U===!1)return"nothing";if(U==="...")return"multi";if(U!=null&&D(U))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ya(e,t.fallthrough,D,O);for(var $=0;$<t.fallthrough.length;$++){var oe=Ya(e,t.fallthrough[$],D,O);if(oe)return oe}}}function Ks(e){var t=typeof e=="string"?e:Ta[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,D){var O=e;return t.altKey&&O!="Alt"&&(e="Alt-"+e),(s?t.metaKey:t.ctrlKey)&&O!="Ctrl"&&(e="Ctrl-"+e),(s?t.ctrlKey:t.metaKey)&&O!="Mod"&&(e="Cmd-"+e),!D&&t.shiftKey&&O!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(l&&e.keyCode==34&&e.char)return!1;var D=Ta[e.keyCode];return D==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(D=e.code),Gs(D,e,t))}function Wo(e){return typeof e=="string"?ma[e]:e}function $a(e,t){for(var D=e.doc.sel.ranges,O=[],U=0;U<D.length;U++){for(var $=t(D[U]);O.length&&Ft($.from,ae(O).to)<=0;){var oe=O.pop();if(Ft(oe.from,$.from)<0){$.from=oe.from;break}}O.push($)}Ci(e,function(){for(var fe=O.length-1;fe>=0;fe--)Va(e.doc,"",O[fe].from,O[fe].to,"+delete");ya(e)})}function as(e,t,D){var O=De(e.text,t+D,D);return O<0||O>e.text.length?null:O}function os(e,t,D){var O=as(e,t.ch,D);return O==null?null:new vt(t.line,O,D<0?"after":"before")}function ss(e,t,D,O,U){if(e){t.doc.direction=="rtl"&&(U=-U);var $=st(D,t.doc.direction);if($){var oe=U<0?ae($):$[0],fe=U<0==(oe.level==1),pe=fe?"after":"before",Ee;if(oe.level>0||t.doc.direction=="rtl"){var We=Ve(t,D);Ee=U<0?D.text.length-1:0;var Ke=it(t,We,Ee).top;Ee=Qe(function(ut){return it(t,We,ut).top==Ke},U<0==(oe.level==1)?oe.from:oe.to-1,Ee),pe=="before"&&(Ee=as(D,Ee,1))}else Ee=U<0?oe.to:oe.from;return new vt(O,Ee,pe)}}return new vt(O,U<0?D.text.length:0,U<0?"before":"after")}function Il(e,t,D,O){var U=st(t,e.doc.direction);if(!U)return os(t,D,O);D.ch>=t.text.length?(D.ch=t.text.length,D.sticky="before"):D.ch<=0&&(D.ch=0,D.sticky="after");var $=tt(U,D.ch,D.sticky),oe=U[$];if(e.doc.direction=="ltr"&&oe.level%2==0&&(O>0?oe.to>D.ch:oe.from<D.ch))return os(t,D,O);var fe=function(kt,Ut){return as(t,kt instanceof vt?kt.ch:kt,Ut)},pe,Ee=function(kt){return e.options.lineWrapping?(pe=pe||Ve(e,t),zt(e,t,pe,kt)):{begin:0,end:t.text.length}},We=Ee(D.sticky=="before"?fe(D,-1):D.ch);if(e.doc.direction=="rtl"||oe.level==1){var Ke=oe.level==1==O<0,ut=fe(D,Ke?1:-1);if(ut!=null&&(Ke?ut<=oe.to&&ut<=We.end:ut>=oe.from&&ut>=We.begin)){var at=Ke?"before":"after";return new vt(D.line,ut,at)}}var mt=function(kt,Ut,Lt){for(var Wt=function(Tn,di){return di?new vt(D.line,fe(Tn,1),"before"):new vt(D.line,Tn,"after")};kt>=0&&kt<U.length;kt+=Ut){var lr=U[kt],er=Ut>0==(lr.level!=1),kr=er?Lt.begin:fe(Lt.end,-1);if(lr.from<=kr&&kr<lr.to)return Wt(kr,er);if(kr=er?lr.from:fe(lr.to,-1),Lt.begin<=kr&&kr<Lt.end)return Wt(kr,er)}},yt=mt($+O,O,We);if(yt)return yt;var _t=O>0?We.end:fe(We.begin,-1);return _t!=null&&!(O>0&&_t==t.text.length)&&(yt=mt(O>0?0:U.length-1,O,Ee(_t)),yt)?yt:null}var xo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return $a(e,function(t){if(t.empty()){var D=Ct(e.doc,t.head.line).text.length;return t.head.ch==D&&t.head.line<e.lastLine()?{from:t.head,to:vt(t.head.line+1,0)}:{from:t.head,to:vt(t.head.line,D)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return $a(e,function(t){return{from:vt(t.from().line,0),to:V(e.doc,vt(t.to().line+1,0))}})},delLineLeft:function(e){return $a(e,function(t){return{from:vt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return $a(e,function(t){var D=e.charCoords(t.head,"div").top+5,O=e.coordsChar({left:0,top:D},"div");return{from:O,to:t.from()}})},delWrappedLineRight:function(e){return $a(e,function(t){var D=e.charCoords(t.head,"div").top+5,O=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:D},"div");return{from:t.from(),to:O}})},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(vt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(vt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var D=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:D},"div")},ke)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var D=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:D},"div")},ke)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var D=e.cursorCoords(t.head,"div").top+5,O=e.coordsChar({left:0,top:D},"div");return O.ch<e.getLine(O.line).search(/\S/)?Ys(e,t.head):O},ke)},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 t=[],D=e.listSelections(),O=e.options.tabSize,U=0;U<D.length;U++){var $=D[U].from(),oe=K(e.getLine($.line),$.ch,O);t.push(ce(O-oe%O))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ci(e,function(){for(var t=e.listSelections(),D=[],O=0;O<t.length;O++){if(!t[O].empty())continue;var U=t[O].head,$=Ct(e.doc,U.line).text;if($){if(U.ch==$.length&&(U=new vt(U.line,U.ch-1)),U.ch>0)U=new vt(U.line,U.ch+1),e.replaceRange($.charAt(U.ch-1)+$.charAt(U.ch-2),vt(U.line,U.ch-2),U,"+transpose");else if(U.line>e.doc.first){var oe=Ct(e.doc,U.line-1).text;oe&&(U=new vt(U.line,1),e.replaceRange($.charAt(0)+e.doc.lineSeparator()+oe.charAt(oe.length-1),vt(U.line-1,oe.length-1),U,"+transpose"))}}D.push(new sn(U,U))}e.setSelections(D)})},newlineAndIndent:function(e){return Ci(e,function(){for(var t=e.listSelections(),D=t.length-1;D>=0;D--)e.replaceRange(e.doc.lineSeparator(),t[D].anchor,t[D].head,"+input");t=e.listSelections();for(var O=0;O<t.length;O++)e.indentLine(t[O].from().line,null,!0);ya(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var D=Ct(e.doc,t),O=On(D);return O!=D&&(t=jt(O)),ss(!0,e,O,t,1)}function Nl(e,t){var D=Ct(e.doc,t),O=ui(D);return O!=D&&(t=jt(O)),ss(!0,e,D,t,-1)}function Ys(e,t){var D=Xs(e,t.line),O=Ct(e.doc,D.line),U=st(O,e.doc.direction);if(!U||U[0].level==0){var $=Math.max(D.ch,O.text.search(/\S/)),oe=t.line==D.line&&t.ch<=$&&t.ch;return vt(D.line,oe?0:$,D.sticky)}return D}function Ho(e,t,D){if(typeof t=="string"&&(t=xo[t],!t))return!1;e.display.input.ensurePolled();var O=e.display.shift,U=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),D&&(e.display.shift=!1),U=t(e)!=Ce}finally{e.display.shift=O,e.state.suppressEdits=!1}return U}function jl(e,t,D){for(var O=0;O<e.state.keyMaps.length;O++){var U=Ya(t,e.state.keyMaps[O],D,e);if(U)return U}return e.options.extraKeys&&Ya(t,e.options.extraKeys,D,e)||Ya(t,e.options.keyMap,D,e)}var Ul=new q;function Eo(e,t,D,O){var U=e.state.keySeq;if(U){if(Ks(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==U&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,U+" "+t,D,O))return!0}return $s(e,t,D,O)}function $s(e,t,D,O){var U=jl(e,t,O);return U=="multi"&&(e.state.keySeq=t),U=="handled"&&sr(e,"keyHandled",e,t,D),(U=="handled"||U=="multi")&&(ye(D),ni(e)),!!U}function Js(e,t){var D=Vs(t,!0);return D?t.shiftKey&&!e.state.keySeq?Eo(e,"Shift-"+D,t,function(O){return Ho(e,O,!0)})||Eo(e,D,t,function(O){if(typeof O=="string"?/^go[A-Z]/.test(O):O.motion)return Ho(e,O)}):Eo(e,D,t,function(O){return Ho(e,O)}):!1}function Fl(e,t,D){return Eo(e,"'"+D+"'",t,function(O){return Ho(e,O,!0)})}var ls=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=z(),qe(t,e))return;C&&c<11&&e.keyCode==27&&(e.returnValue=!1);var D=e.keyCode;t.display.shift=D==16||e.shiftKey;var O=Js(t,e);l&&(ls=O?D:null,!O&&D==88&&!Vt&&(d?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),S&&!d&&!O&&D==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),D==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;H(t,"CodeMirror-crosshair");function D(O){(O.keyCode==18||!O.altKey)&&(x(t,"CodeMirror-crosshair"),ct(document,"keyup",D),ct(document,"mouseover",D))}Re(document,"keyup",D),Re(document,"mouseover",D)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),qe(this,e)}function el(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if($n(t.display,e)||qe(t,e)||e.ctrlKey&&!e.altKey||d&&e.metaKey)return;var D=e.keyCode,O=e.charCode;if(l&&D==ls){ls=null,ye(e);return}if(l&&(!e.which||e.which<10)&&Js(t,e))return;var U=String.fromCharCode(O==null?D:O);if(U=="\b")return;if(Fl(t,e,U))return;t.display.input.onKeyPress(e)}var Wl=400,us=function(e,t,D){this.time=e,this.pos=t,this.button=D};us.prototype.compare=function(e,t,D){return this.time+Wl>e&&Ft(t,this.pos)==0&&D==this.button};var wo,Co;function Hl(e,t){var D=+new Date;return Co&&Co.compare(D,e,t)?(wo=Co=null,"triple"):wo&&wo.compare(D,e,t)?(Co=new us(D,e,t),wo=null,"double"):(wo=new us(D,e,t),Co=null,"single")}function tl(e){var t=this,D=t.display;if(qe(t,e)||D.activeTouch&&D.input.supportsTouch())return;if(D.input.ensurePolled(),D.shift=e.shiftKey,$n(D,e)){a||(D.scroller.draggable=!1,setTimeout(function(){return D.scroller.draggable=!0},100));return}if(cs(t,e))return;var O=ri(t,e),U=rt(e),$=O?Hl(O,U):"single";if(window.focus(),U==1&&t.state.selectingText&&t.state.selectingText(e),O&&zl(t,U,O,$,e))return;U==1?O?Gl(t,O,$,e):Xe(e)==D.scroller&&ye(e):U==2?(O&&No(t.doc,O),setTimeout(function(){return D.input.focus()},20)):U==3&&(M?t.display.input.onContextMenu(e):eo(t))}function zl(e,t,D,O,U){var $="Click";return O=="double"?$="Double"+$:O=="triple"&&($="Triple"+$),$=(t==1?"Left":t==2?"Middle":"Right")+$,Eo(e,Gs($,U),U,function(oe){if(typeof oe=="string"&&(oe=xo[oe]),!oe)return!1;var fe=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),fe=oe(e,D)!=Ce}finally{e.state.suppressEdits=!1}return fe})}function Kl(e,t,D){var O=e.getOption("configureMouse"),U=O?O(e,t,D):{};if(U.unit==null){var $=g?D.shiftKey&&D.metaKey:D.altKey;U.unit=$?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(U.extend==null||e.doc.extend)&&(U.extend=e.doc.extend||D.shiftKey),U.addNew==null&&(U.addNew=d?D.metaKey:D.ctrlKey),U.moveOnDrag==null&&(U.moveOnDrag=!(d?D.altKey:D.ctrlKey)),U}function Gl(e,t,D,O){C?setTimeout(B(To,e),0):e.curOp.focus=z();var U=Kl(e,D,O),$=e.doc.sel,oe;e.options.dragDrop&&ft&&!e.isReadOnly()&&D=="single"&&(oe=$.contains(t))>-1&&(Ft((oe=$.ranges[oe]).from(),t)<0||t.xRel>0)&&(Ft(oe.to(),t)>0||t.xRel<0)?Vl(e,O,t,U):Xl(e,O,t,U)}function Vl(e,t,D,O){var U=e.display,$=!1,oe=Gn(e,function(Ee){a&&(U.scroller.draggable=!1),e.state.draggingText=!1,ct(U.wrapper.ownerDocument,"mouseup",oe),ct(U.wrapper.ownerDocument,"mousemove",fe),ct(U.scroller,"dragstart",pe),ct(U.scroller,"drop",oe),$||(ye(Ee),O.addNew||No(e.doc,D,null,null,O.extend),a&&!p||C&&c==9?setTimeout(function(){U.wrapper.ownerDocument.body.focus({preventScroll:!0}),U.input.focus()},20):U.input.focus())}),fe=function(Ee){$=$||Math.abs(t.clientX-Ee.clientX)+Math.abs(t.clientY-Ee.clientY)>=10},pe=function(){return $=!0};a&&(U.scroller.draggable=!0),e.state.draggingText=oe,oe.copy=!O.moveOnDrag,U.scroller.dragDrop&&U.scroller.dragDrop(),Re(U.wrapper.ownerDocument,"mouseup",oe),Re(U.wrapper.ownerDocument,"mousemove",fe),Re(U.scroller,"dragstart",pe),Re(U.scroller,"drop",oe),eo(e),setTimeout(function(){return U.input.focus()},20)}function rl(e,t,D){if(D=="char")return new sn(t,t);if(D=="word")return e.findWordAt(t);if(D=="line")return new sn(vt(t.line,0),V(e.doc,vt(t.line+1,0)));var O=D(e,t);return new sn(O.from,O.to)}function Xl(e,t,D,O){var U=e.display,$=e.doc;ye(t);var oe,fe,pe=$.sel,Ee=pe.ranges;if(O.addNew&&!O.extend?(fe=$.sel.contains(D),fe>-1?oe=Ee[fe]:oe=new sn(D,D)):(oe=$.sel.primary(),fe=$.sel.primIndex),O.unit=="rectangle")O.addNew||(oe=new sn(D,D)),D=ri(e,t,!0,!0),fe=-1;else{var We=rl(e,D,O.unit);O.extend?oe=ns(oe,We.anchor,We.head,O.extend):oe=We}O.addNew?fe==-1?(fe=Ee.length,yi($,zi(e,Ee.concat([oe]),fe),{scroll:!1,origin:"*mouse"})):Ee.length>1&&Ee[fe].empty()&&O.unit=="char"&&!O.extend?(yi($,zi(e,Ee.slice(0,fe).concat(Ee.slice(fe+1)),0),{scroll:!1,origin:"*mouse"}),pe=$.sel):is($,fe,oe,he):(fe=0,yi($,new Ti([oe],0),he),pe=$.sel);var Ke=D;function ut(Lt){if(Ft(Ke,Lt)==0)return;if(Ke=Lt,O.unit=="rectangle"){for(var Wt=[],lr=e.options.tabSize,er=K(Ct($,D.line).text,D.ch,lr),kr=K(Ct($,Lt.line).text,Lt.ch,lr),Tn=Math.min(er,kr),di=Math.max(er,kr),Un=Math.min(D.line,Lt.line),ji=Math.min(e.lastLine(),Math.max(D.line,Lt.line));Un<=ji;Un++){var Mi=Ct($,Un).text,Jn=_e(Mi,Tn,lr);Tn==di?Wt.push(new sn(vt(Un,Jn),vt(Un,Jn))):Mi.length>Jn&&Wt.push(new sn(vt(Un,Jn),vt(Un,_e(Mi,di,lr))))}Wt.length||Wt.push(new sn(D,D)),yi($,zi(e,pe.ranges.slice(0,fe).concat(Wt),fe),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Lt)}else{var Pi=oe,gi=rl(e,Lt,O.unit),oi=Pi.anchor,Qn;Ft(gi.anchor,oi)>0?(Qn=gi.head,oi=Rn(Pi.from(),gi.anchor)):(Qn=gi.anchor,oi=An(Pi.to(),gi.head));var Hn=pe.ranges.slice(0);Hn[fe]=Yl(e,new sn(V($,oi),Qn)),yi($,zi(e,Hn,fe),he)}}var at=U.wrapper.getBoundingClientRect(),mt=0;function yt(Lt){var Wt=++mt,lr=ri(e,Lt,!0,O.unit=="rectangle");if(!lr)return;if(Ft(lr,Ke)!=0){e.curOp.focus=z(),ut(lr);var er=Ia(U,$);(lr.line>=er.to||lr.line<er.from)&&setTimeout(Gn(e,function(){mt==Wt&&yt(Lt)}),150)}else{var kr=Lt.clientY<at.top?-20:Lt.clientY>at.bottom?20:0;kr&&setTimeout(Gn(e,function(){if(mt!=Wt)return;U.scroller.scrollTop+=kr,yt(Lt)}),50)}}function _t(Lt){e.state.selectingText=!1,mt=Infinity,Lt&&(ye(Lt),U.input.focus()),ct(U.wrapper.ownerDocument,"mousemove",kt),ct(U.wrapper.ownerDocument,"mouseup",Ut),$.history.lastSelOrigin=null}var kt=Gn(e,function(Lt){Lt.buttons===0||!rt(Lt)?_t(Lt):yt(Lt)}),Ut=Gn(e,_t);e.state.selectingText=Ut,Re(U.wrapper.ownerDocument,"mousemove",kt),Re(U.wrapper.ownerDocument,"mouseup",Ut)}function Yl(e,t){var D=t.anchor,O=t.head,U=Ct(e.doc,D.line);if(Ft(D,O)==0&&D.sticky==O.sticky)return t;var $=st(U);if(!$)return t;var oe=tt($,D.ch,D.sticky),fe=$[oe];if(fe.from!=D.ch&&fe.to!=D.ch)return t;var pe=oe+(fe.from==D.ch==(fe.level!=1)?0:1);if(pe==0||pe==$.length)return t;var Ee;if(O.line!=D.line)Ee=(O.line-D.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var We=tt($,O.ch,O.sticky),Ke=We-oe||(O.ch-D.ch)*(fe.level==1?-1:1);We==pe-1||We==pe?Ee=Ke<0:Ee=Ke>0}var ut=$[pe+(Ee?-1:0)],at=Ee==(ut.level==1),mt=at?ut.from:ut.to,yt=at?"after":"before";return D.ch==mt&&D.sticky==yt?t:new sn(new vt(D.line,mt,yt),O)}function nl(e,t,D,O){var U,$;if(t.touches)U=t.touches[0].clientX,$=t.touches[0].clientY;else try{U=t.clientX,$=t.clientY}catch(ut){return!1}if(U>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;O&&ye(t);var oe=e.display,fe=oe.lineDiv.getBoundingClientRect();if($>fe.bottom||!Me(e,D))return Ae(t);$-=fe.top-oe.viewOffset;for(var pe=0;pe<e.display.gutterSpecs.length;++pe){var Ee=oe.gutters.childNodes[pe];if(Ee&&Ee.getBoundingClientRect().right>=U){var We=Ur(e.doc,$),Ke=e.display.gutterSpecs[pe];return $e(e,D,e,We,Ke.className,t),Ae(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if($n(e.display,t)||$l(e,t))return;if(qe(e,t,"contextmenu"))return;M||e.display.input.onContextMenu(t)}function $l(e,t){return Me(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wr(e)}var Ja={toString:function(){return"CodeMirror.Init"}},ol={},zo={};function Jl(e){var t=e.optionHandlers;function D(O,U,$,oe){e.defaults[O]=U,$&&(t[O]=oe?function(fe,pe,Ee){Ee!=Ja&&$(fe,pe,Ee)}:$)}e.defineOption=D,e.Init=Ja,D("value","",function(O,U){return O.setValue(U)},!0),D("mode",null,function(O,U){O.doc.modeOption=U,pa(O)},!0),D("indentUnit",2,pa,!0),D("indentWithTabs",!1),D("smartIndent",!0),D("tabSize",4,function(O){co(O),wr(O),bn(O)},!0),D("lineSeparator",null,function(O,U){if(O.doc.lineSep=U,!U)return;var $=[],oe=O.doc.first;O.doc.iter(function(pe){for(var Ee=0;;){var We=pe.text.indexOf(U,Ee);if(We==-1)break;Ee=We+U.length,$.push(vt(oe,We))}oe++});for(var fe=$.length-1;fe>=0;fe--)Va(O.doc,U,$[fe],vt($[fe].line,$[fe].ch+U.length))}),D("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(O,U,$){O.state.specialChars=new RegExp(U.source+(U.test(" ")?"":"| "),"g"),$!=Ja&&O.refresh()}),D("specialCharPlaceholder",Bt,function(O){return O.refresh()},!0),D("electricChars",!0),D("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),D("spellcheck",!1,function(O,U){return O.getInputField().spellcheck=U},!0),D("autocorrect",!1,function(O,U){return O.getInputField().autocorrect=U},!0),D("autocapitalize",!1,function(O,U){return O.getInputField().autocapitalize=U},!0),D("rtlMoveVisually",!T),D("wholeLineUpdateBefore",!0),D("theme","default",function(O){al(O),Qi(O)},!0),D("keyMap","default",function(O,U,$){var oe=Wo(U),fe=$!=Ja&&Wo($);fe&&fe.detach&&fe.detach(O,oe),oe.attach&&oe.attach(O,fe||null)}),D("extraKeys",null),D("configureMouse",null),D("lineWrapping",!1,Zl,!0),D("gutters",[],function(O,U){O.display.gutterSpecs=Si(U,O.options.lineNumbers),Qi(O)},!0),D("fixedGutter",!0,function(O,U){O.display.gutters.style.left=U?vi(O.display)+"px":"0",O.refresh()},!0),D("coverGutterNextToScrollbar",!1,function(O){return da(O)},!0),D("scrollbarStyle","native",function(O){Ua(O),da(O),O.display.scrollbars.setScrollTop(O.doc.scrollTop),O.display.scrollbars.setScrollLeft(O.doc.scrollLeft)},!0),D("lineNumbers",!1,function(O,U){O.display.gutterSpecs=Si(O.options.gutters,U),Qi(O)},!0),D("firstLineNumber",1,Qi,!0),D("lineNumberFormatter",function(O){return O},Qi,!0),D("showCursorWhenSelecting",!1,pn,!0),D("resetSelectionOnContextMenu",!0),D("lineWiseCopyCut",!0),D("pasteLinesPerSelection",!0),D("selectionsMayTouch",!1),D("readOnly",!1,function(O,U){U=="nocursor"&&(va(O),O.display.input.blur()),O.display.input.readOnlyChanged(U)}),D("screenReaderLabel",null,function(O,U){U=U===""?null:U,O.display.input.screenReaderLabelChanged(U)}),D("disableInput",!1,function(O,U){U||O.display.input.reset()},!0),D("dragDrop",!0,Ql),D("allowDropFileTypes",null),D("cursorBlinkRate",530),D("cursorScrollMargin",0),D("cursorHeight",1,pn,!0),D("singleCursorHeightPerLine",!0,pn,!0),D("workTime",100),D("workDelay",100),D("flattenSpans",!0,co,!0),D("addModeClass",!1,co,!0),D("pollInterval",100),D("undoDepth",200,function(O,U){return O.doc.history.undoDepth=U}),D("historyEventDelay",1250),D("viewportMargin",10,function(O){return O.refresh()},!0),D("maxHighlightLength",1e4,co,!0),D("moveInputWithCursor",!0,function(O,U){U||O.display.input.resetPosition()}),D("tabindex",null,function(O,U){return O.display.input.getField().tabIndex=U||""}),D("autofocus",null),D("direction","ltr",function(O,U){return O.doc.setDirection(U)},!0),D("phrases",null)}function Ql(e,t,D){var O=D&&D!=Ja;if(!t!=!O){var U=e.display.dragFunctions,$=t?Re:ct;$(e.display.scroller,"dragstart",U.start),$(e.display.scroller,"dragenter",U.enter),$(e.display.scroller,"dragover",U.over),$(e.display.scroller,"dragleave",U.leave),$(e.display.scroller,"drop",U.drop)}}function Zl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),pi(e)),wi(e),bn(e),wr(e),setTimeout(function(){return da(e)},100)}function jn(e,t){var D=this;if(!(this instanceof jn))return new jn(e,t);this.options=t=t?W(t):{},W(ol,t,!1);var O=t.value;typeof O=="string"?O=new Li(O,t.mode,null,t.lineSeparator,t.direction):t.mode&&(O.modeOption=t.mode),this.doc=O;var U=new jn.inputStyles[t.inputStyle](this),$=this.display=new ka(e,O,U,t);$.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ua(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 q,keySeq:null,specialChars:null},t.autofocus&&!n&&$.input.focus(),C&&c<11&&setTimeout(function(){return D.display.input.reset(!0)},20),ql(this),Dl(),sa(this),this.curOp.forceUpdate=!0,vs(this,O),t.autofocus&&!n||this.hasFocus()?setTimeout(function(){D.hasFocus()&&!D.state.focused&&aa(D)},20):va(this);for(var oe in zo)zo.hasOwnProperty(oe)&&zo[oe](this,t[oe],Ja);ii(this),t.finishInit&&t.finishInit(this);for(var fe=0;fe<ds.length;++fe)ds[fe](this);ha(this),a&&t.lineWrapping&&getComputedStyle($.lineDiv).textRendering=="optimizelegibility"&&($.lineDiv.style.textRendering="auto")}jn.defaults=ol,jn.optionHandlers=zo;function ql(e){var t=e.display;Re(t.scroller,"mousedown",Gn(e,tl)),C&&c<11?Re(t.scroller,"dblclick",Gn(e,function(pe){if(qe(e,pe))return;var Ee=ri(e,pe);if(!Ee||cs(e,pe)||$n(e.display,pe))return;ye(pe);var We=e.findWordAt(Ee);No(e.doc,We.anchor,We.head)})):Re(t.scroller,"dblclick",function(pe){return qe(e,pe)||ye(pe)}),Re(t.scroller,"contextmenu",function(pe){return il(e,pe)}),Re(t.input.getField(),"contextmenu",function(pe){t.scroller.contains(pe.target)||il(e,pe)});var D,O={end:0};function U(){t.activeTouch&&(D=setTimeout(function(){return t.activeTouch=null},1e3),O=t.activeTouch,O.end=+new Date)}function $(pe){if(pe.touches.length!=1)return!1;var Ee=pe.touches[0];return Ee.radiusX<=1&&Ee.radiusY<=1}function oe(pe,Ee){if(Ee.left==null)return!0;var We=Ee.left-pe.left,Ke=Ee.top-pe.top;return We*We+Ke*Ke>20*20}Re(t.scroller,"touchstart",function(pe){if(!qe(e,pe)&&!$(pe)&&!cs(e,pe)){t.input.ensurePolled(),clearTimeout(D);var Ee=+new Date;t.activeTouch={start:Ee,moved:!1,prev:Ee-O.end<=300?O:null},pe.touches.length==1&&(t.activeTouch.left=pe.touches[0].pageX,t.activeTouch.top=pe.touches[0].pageY)}}),Re(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Re(t.scroller,"touchend",function(pe){var Ee=t.activeTouch;if(Ee&&!$n(t,pe)&&Ee.left!=null&&!Ee.moved&&new Date-Ee.start<300){var We=e.coordsChar(t.activeTouch,"page"),Ke;!Ee.prev||oe(Ee,Ee.prev)?Ke=new sn(We,We):!Ee.prev.prev||oe(Ee,Ee.prev.prev)?Ke=e.findWordAt(We):Ke=new sn(vt(We.line,0),V(e.doc,vt(We.line+1,0))),e.setSelection(Ke.anchor,Ke.head),e.focus(),ye(pe)}U()}),Re(t.scroller,"touchcancel",U),Re(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xa(e,t.scroller.scrollTop),Wi(e,t.scroller.scrollLeft,!0),$e(e,"scroll",e))}),Re(t.scroller,"mousewheel",function(pe){return lo(e,pe)}),Re(t.scroller,"DOMMouseScroll",function(pe){return lo(e,pe)}),Re(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(pe){qe(e,pe)||Pe(pe)},over:function(pe){qe(e,pe)||(Rl(e,pe),Pe(pe))},start:function(pe){return Al(e,pe)},drop:Gn(e,Ol),leave:function(pe){qe(e,pe)||Ws(e)}};var fe=t.input.getField();Re(fe,"keyup",function(pe){return Zs.call(e,pe)}),Re(fe,"keydown",Gn(e,Qs)),Re(fe,"keypress",Gn(e,el)),Re(fe,"focus",function(pe){return aa(e,pe)}),Re(fe,"blur",function(pe){return va(e,pe)})}var ds=[];jn.defineInitHook=function(e){return ds.push(e)};function So(e,t,D,O){var U=e.doc,$;D==null&&(D="add"),D=="smart"&&(U.mode.indent?$=ot(e,t).state:D="prev");var oe=e.options.tabSize,fe=Ct(U,t),pe=K(fe.text,null,oe);fe.stateAfter&&(fe.stateAfter=null);var Ee=fe.text.match(/^\s*/)[0],We;if(!O&&!/\S/.test(fe.text))We=0,D="not";else if(D=="smart"&&(We=U.mode.indent($,fe.text.slice(Ee.length),fe.text),We==Ce||We>150)){if(!O)return;D="prev"}D=="prev"?t>U.first?We=K(Ct(U,t-1).text,null,oe):We=0:D=="add"?We=pe+e.options.indentUnit:D=="subtract"?We=pe-e.options.indentUnit:typeof D=="number"&&(We=pe+D),We=Math.max(0,We);var Ke="",ut=0;if(e.options.indentWithTabs)for(var at=Math.floor(We/oe);at;--at)ut+=oe,Ke+=" ";if(ut<We&&(Ke+=ce(We-ut)),Ke!=Ee)return Va(U,Ke,vt(t,0),vt(t,Ee.length),"+input"),fe.stateAfter=null,!0;for(var mt=0;mt<U.sel.ranges.length;mt++){var yt=U.sel.ranges[mt];if(yt.head.line==t&&yt.head.ch<Ee.length){var _t=vt(t,Ee.length);is(U,mt,new sn(_t,_t));break}}}var ea=null;function Ko(e){ea=e}function hs(e,t,D,O,U){var $=e.doc;e.display.shift=!1,O||(O=$.sel);var oe=+new Date-200,fe=U=="paste"||e.state.pasteIncoming>oe,pe=Ot(t),Ee=null;if(fe&&O.ranges.length>1)if(ea&&ea.text.join(`
|
|
|
`)==t){if(O.ranges.length%ea.text.length==0){Ee=[];for(var We=0;We<ea.text.length;We++)Ee.push($.splitLines(ea.text[We]))}}else pe.length==O.ranges.length&&e.options.pasteLinesPerSelection&&(Ee=Se(pe,function(kt){return[kt]}));for(var Ke=e.curOp.updateInput,ut=O.ranges.length-1;ut>=0;ut--){var at=O.ranges[ut],mt=at.from(),yt=at.to();at.empty()&&(D&&D>0?mt=vt(mt.line,mt.ch-D):e.state.overwrite&&!fe?yt=vt(yt.line,Math.min(Ct($,yt.line).text.length,yt.ch+ae(pe).length)):fe&&ea&&ea.lineWise&&ea.text.join(`
|
|
|
`)==pe.join(`
|
|
|
`)&&(mt=yt=vt(mt.line,0)));var _t={from:mt,to:yt,text:Ee?Ee[ut%Ee.length]:pe,origin:U||(fe?"paste":e.state.cutIncoming>oe?"cut":"+input")};Ga(e.doc,_t),sr(e,"inputRead",e,_t)}t&&!fe&&ll(e,t),ya(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ke),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var D=e.clipboardData&&e.clipboardData.getData("Text");if(D)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ci(t,function(){return hs(t,D,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var D=e.doc.sel,O=D.ranges.length-1;O>=0;O--){var U=D.ranges[O];if(U.head.ch>100||O&&D.ranges[O-1].head.line==U.head.line)continue;var $=e.getModeAt(U.head),oe=!1;if($.electricChars){for(var fe=0;fe<$.electricChars.length;fe++)if(t.indexOf($.electricChars.charAt(fe))>-1){oe=So(e,U.head.line,"smart");break}}else $.electricInput&&($.electricInput.test(Ct(e.doc,U.head.line).text.slice(0,U.head.ch))&&(oe=So(e,U.head.line,"smart")));oe&&sr(e,"electricInput",e,U.head.line)}}function ul(e){for(var t=[],D=[],O=0;O<e.doc.sel.ranges.length;O++){var U=e.doc.sel.ranges[O].head.line,$={anchor:vt(U,0),head:vt(U+1,0)};D.push($),t.push(e.getRange($.anchor,$.head))}return{text:t,ranges:D}}function cl(e,t,D,O){e.setAttribute("autocorrect",D?"":"off"),e.setAttribute("autocapitalize",O?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return a?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),cl(e),t}function eu(e){var t=e.optionHandlers,D=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(O,U){var $=this.options,oe=$[O];if($[O]==U&&O!="mode")return;$[O]=U,t.hasOwnProperty(O)&&Gn(this,t[O])(this,U,oe),$e(this,"optionChange",this,O)},getOption:function(O){return this.options[O]},getDoc:function(){return this.doc},addKeyMap:function(O,U){this.state.keyMaps[U?"push":"unshift"](Wo(O))},removeKeyMap:function(O){for(var U=this.state.keyMaps,$=0;$<U.length;++$)if(U[$]==O||U[$].name==O)return U.splice($,1),!0},addOverlay:mi(function(O,U){var $=O.token?O:e.getMode(this.options,O);if($.startState)throw new Error("Overlays may not be stateful.");te(this.state.overlays,{mode:$,modeSpec:O,opaque:U&&U.opaque,priority:U&&U.priority||0},function(oe){return oe.priority}),this.state.modeGen++,bn(this)}),removeOverlay:mi(function(O){for(var U=this.state.overlays,$=0;$<U.length;++$){var oe=U[$].modeSpec;if(oe==O||typeof O=="string"&&oe.name==O){U.splice($,1),this.state.modeGen++,bn(this);return}}}),indentLine:mi(function(O,U,$){typeof U!="string"&&typeof U!="number"&&(U==null?U=this.options.smartIndent?"smart":"prev":U=U?"add":"subtract"),_n(this.doc,O)&&So(this,O,U,$)}),indentSelection:mi(function(O){for(var U=this.doc.sel.ranges,$=-1,oe=0;oe<U.length;oe++){var fe=U[oe];if(fe.empty())fe.head.line>$&&(So(this,fe.head.line,O,!0),$=fe.head.line,oe==this.doc.sel.primIndex&&ya(this));else{var pe=fe.from(),Ee=fe.to(),We=Math.max($,pe.line);$=Math.min(this.lastLine(),Ee.line-(Ee.ch?0:1))+1;for(var Ke=We;Ke<$;++Ke)So(this,Ke,O);var ut=this.doc.sel.ranges;pe.ch==0&&U.length==ut.length&&ut[oe].from().ch>0&&is(this.doc,oe,new sn(pe,ut[oe].to()),xe)}}}),getTokenAt:function(O,U){return Sr(this,O,U)},getLineTokens:function(O,U){return Sr(this,vt(O),U,!0)},getTokenTypeAt:function(O){O=V(this.doc,O);var U=pt(this,Ct(this.doc,O.line)),$=0,oe=(U.length-1)/2,fe=O.ch,pe;if(fe==0)pe=U[2];else for(;;){var Ee=$+oe>>1;if((Ee?U[Ee*2-1]:0)>=fe)oe=Ee;else if(U[Ee*2+1]<fe)$=Ee+1;else{pe=U[Ee*2+2];break}}var We=pe?pe.indexOf("overlay "):-1;return We<0?pe:We==0?null:pe.slice(0,We-1)},getModeAt:function(O){var U=this.doc.mode;return U.innerMode?e.innerMode(U,this.getTokenAt(O).state).mode:U},getHelper:function(O,U){return this.getHelpers(O,U)[0]},getHelpers:function(O,U){var $=[];if(!D.hasOwnProperty(U))return $;var oe=D[U],fe=this.getModeAt(O);if(typeof fe[U]=="string")oe[fe[U]]&&$.push(oe[fe[U]]);else if(fe[U])for(var pe=0;pe<fe[U].length;pe++){var Ee=oe[fe[U][pe]];Ee&&$.push(Ee)}else fe.helperType&&oe[fe.helperType]?$.push(oe[fe.helperType]):oe[fe.name]&&$.push(oe[fe.name]);for(var We=0;We<oe._global.length;We++){var Ke=oe._global[We];Ke.pred(fe,this)&&re($,Ke.val)==-1&&$.push(Ke.val)}return $},getStateAfter:function(O,U){var $=this.doc;return O=se($,O==null?$.first+$.size-1:O),ot(this,O+1,U).state},cursorCoords:function(O,U){var $,oe=this.doc.sel.primary();return O==null?$=oe.head:typeof O=="object"?$=V(this.doc,O):$=O?oe.from():oe.to(),Ir(this,$,U||"page")},charCoords:function(O,U){return kn(this,V(this.doc,O),U||"page")},coordsChar:function(O,U){return O=Pr(this,O,U||"page"),Nr(this,O.left,O.top)},lineAtHeight:function(O,U){return O=Pr(this,{top:O,left:0},U||"page").top,Ur(this.doc,O+this.display.viewOffset)},heightAtLine:function(O,U,$){var oe=!1,fe;if(typeof O=="number"){var pe=this.doc.first+this.doc.size-1;O<this.doc.first?O=this.doc.first:O>pe&&(O=pe,oe=!0),fe=Ct(this.doc,O)}else fe=O;return zr(this,fe,{top:0,left:0},U||"page",$||oe).top+(oe?this.doc.height-zn(fe):0)},defaultTextHeight:function(){return Wn(this.display)},defaultCharWidth:function(){return ti(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(O,U,$,oe,fe){var pe=this.display;O=Ir(this,V(this.doc,O));var Ee=O.bottom,We=O.left;if(U.style.position="absolute",U.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(U),pe.sizer.appendChild(U),oe=="over")Ee=O.top;else if(oe=="above"||oe=="near"){var Ke=Math.max(pe.wrapper.clientHeight,this.doc.height),ut=Math.max(pe.sizer.clientWidth,pe.lineSpace.clientWidth);(oe=="above"||O.bottom+U.offsetHeight>Ke)&&O.top>U.offsetHeight?Ee=O.top-U.offsetHeight:O.bottom+U.offsetHeight<=Ke&&(Ee=O.bottom),We+U.offsetWidth>ut&&(We=ut-U.offsetWidth)}U.style.top=Ee+"px",U.style.left=U.style.right="",fe=="right"?(We=pe.sizer.clientWidth-U.offsetWidth,U.style.right="0px"):(fe=="left"?We=0:fe=="middle"&&(We=(pe.sizer.clientWidth-U.offsetWidth)/2),U.style.left=We+"px"),$&&_o(this,{left:We,top:Ee,right:We+U.offsetWidth,bottom:Ee+U.offsetHeight})},triggerOnKeyDown:mi(Qs),triggerOnKeyPress:mi(el),triggerOnKeyUp:Zs,triggerOnMouseDown:mi(tl),execCommand:function(O){if(xo.hasOwnProperty(O))return xo[O].call(null,this)},triggerElectric:mi(function(O){ll(this,O)}),findPosH:function(O,U,$,oe){var fe=1;U<0&&(fe=-1,U=-U);for(var pe=V(this.doc,O),Ee=0;Ee<U&&!(pe=fs(this.doc,pe,fe,$,oe),pe.hitSide);++Ee);return pe},moveH:mi(function(O,U){var $=this;this.extendSelectionsBy(function(oe){return $.display.shift||$.doc.extend||oe.empty()?fs($.doc,oe.head,O,U,$.options.rtlMoveVisually):O<0?oe.from():oe.to()},ke)}),deleteH:mi(function(O,U){var $=this.doc.sel,oe=this.doc;$.somethingSelected()?oe.replaceSelection("",null,"+delete"):$a(this,function(fe){var pe=fs(oe,fe.head,O,U,!1);return O<0?{from:pe,to:fe.head}:{from:fe.head,to:pe}})}),findPosV:function(O,U,$,oe){var fe=1,pe=oe;U<0&&(fe=-1,U=-U);for(var Ee=V(this.doc,O),We=0;We<U;++We){var Ke=Ir(this,Ee,"div");if(pe==null?pe=Ke.left:Ke.left=pe,Ee=hl(this,Ke,fe,$),Ee.hitSide)break}return Ee},moveV:mi(function(O,U){var $=this,oe=this.doc,fe=[],pe=!this.display.shift&&!oe.extend&&oe.sel.somethingSelected();if(oe.extendSelectionsBy(function(We){if(pe)return O<0?We.from():We.to();var Ke=Ir($,We.head,"div");We.goalColumn!=null&&(Ke.left=We.goalColumn),fe.push(Ke.left);var ut=hl($,Ke,O,U);return U=="page"&&We==oe.sel.primary()&&no($,kn($,ut,"div").top-Ke.top),ut},ke),fe.length)for(var Ee=0;Ee<oe.sel.ranges.length;Ee++)oe.sel.ranges[Ee].goalColumn=fe[Ee]}),findWordAt:function(O){var U=this.doc,$=Ct(U,O.line).text,oe=O.ch,fe=O.ch;if($){var pe=this.getHelper(O,"wordChars");(O.sticky=="before"||fe==$.length)&&oe?--oe:++fe;for(var Ee=$.charAt(oe),We=Y(Ee,pe)?function(Ke){return Y(Ke,pe)}:/\s/.test(Ee)?function(Ke){return/\s/.test(Ke)}:function(Ke){return!/\s/.test(Ke)&&!Y(Ke)};oe>0&&We($.charAt(oe-1));)--oe;for(;fe<$.length&&We($.charAt(fe));)++fe}return new sn(vt(O.line,oe),vt(O.line,fe))},toggleOverwrite:function(O){if(O!=null&&O==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):x(this.display.cursorDiv,"CodeMirror-overwrite"),$e(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==z()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:mi(function(O,U){ba(this,O,U)}),getScrollInfo:function(){var O=this.display.scroller;return{left:O.scrollLeft,top:O.scrollTop,height:O.scrollHeight-Je(this)-this.display.barHeight,width:O.scrollWidth-Je(this)-this.display.barWidth,clientHeight:ve(this),clientWidth:Fe(this)}},scrollIntoView:mi(function(O,U){O==null?(O={from:this.doc.sel.primary().head,to:null},U==null&&(U=this.options.cursorScrollMargin)):typeof O=="number"?O={from:vt(O,0),to:null}:O.from==null&&(O={from:O,to:null}),O.to||(O.to=O.from),O.margin=U||0,O.from.line!=null?$o(this,O):Oa(this,O.from,O.to,O.margin)}),setSize:mi(function(O,U){var $=this,oe=function(pe){return typeof pe=="number"||/^\d+$/.test(String(pe))?pe+"px":pe};O!=null&&(this.display.wrapper.style.width=oe(O)),U!=null&&(this.display.wrapper.style.height=oe(U)),this.options.lineWrapping&&yr(this);var fe=this.display.viewFrom;this.doc.iter(fe,this.display.viewTo,function(pe){if(pe.widgets){for(var Ee=0;Ee<pe.widgets.length;Ee++)if(pe.widgets[Ee].noHScroll){Nn($,fe,"widget");break}}++fe}),this.curOp.forceUpdate=!0,$e(this,"refresh",this)}),operation:function(O){return Ci(this,O)},startOperation:function(){return sa(this)},endOperation:function(){return ha(this)},refresh:mi(function(){var O=this.display.cachedTextHeight;bn(this),this.curOp.forceUpdate=!0,wr(this),ba(this,this.doc.scrollLeft,this.doc.scrollTop),Ba(this.display),(O==null||Math.abs(O-Wn(this.display))>.5||this.options.lineWrapping)&&wi(this),$e(this,"refresh",this)}),swapDoc:mi(function(O){var U=this.doc;return U.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,O),wr(this),this.display.input.reset(),ba(this,O.scrollLeft,O.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,U),U}),phrase:function(O){var U=this.options.phrases;return U&&Object.prototype.hasOwnProperty.call(U,O)?U[O]:O},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}},Ie(e),e.registerHelper=function(O,U,$){D.hasOwnProperty(O)||(D[O]=e[O]={_global:[]}),D[O][U]=$},e.registerGlobalHelper=function(O,U,$,oe){e.registerHelper(O,U,oe),D[O]._global.push({pred:$,val:oe})}}function fs(e,t,D,O,U){var $=t,oe=D,fe=Ct(e,t.line),pe=U&&e.direction=="rtl"?-D:D;function Ee(){var Ut=t.line+pe;return Ut<e.first||Ut>=e.first+e.size?!1:(t=new vt(Ut,t.ch,t.sticky),fe=Ct(e,Ut))}function We(Ut){var Lt;if(O=="codepoint"){var Wt=fe.text.charCodeAt(t.ch+(O>0?0:-1));isNaN(Wt)?Lt=null:Lt=new vt(t.line,Math.max(0,Math.min(fe.text.length,t.ch+D*(Wt>=55296&&Wt<56320?2:1))),-D)}else U?Lt=Il(e.cm,fe,t,D):Lt=os(fe,t,D);if(Lt==null)if(!Ut&&Ee())t=ss(U,e.cm,fe,t.line,pe);else return!1;else t=Lt;return!0}if(O=="char"||O=="codepoint")We();else if(O=="column")We(!0);else if(O=="word"||O=="group")for(var Ke=null,ut=O=="group",at=e.cm&&e.cm.getHelper(t,"wordChars"),mt=!0;!(D<0&&!We(!mt));mt=!1){var yt=fe.text.charAt(t.ch)||`
|
|
|
`,_t=Y(yt,at)?"w":ut&&yt==`
|
|
|
`?"n":!ut||/\s/.test(yt)?null:"p";if(ut&&!mt&&!_t&&(_t="s"),Ke&&Ke!=_t){D<0&&(D=1,We(),t.sticky="after");break}if(_t&&(Ke=_t),D>0&&!We(!mt))break}var kt=Uo(e,t,$,oe,!0);return rn($,kt)&&(kt.hitSide=!0),kt}function hl(e,t,D,O){var U=e.doc,$=t.left,oe;if(O=="page"){var fe=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),pe=Math.max(fe-.5*Wn(e.display),3);oe=(D>0?t.bottom:t.top)+D*pe}else O=="line"&&(oe=D>0?t.bottom+3:t.top-3);for(var Ee;!(Ee=Nr(e,$,oe),!Ee.outside);){if(D<0?oe<=0:oe>=U.height){Ee.hitSide=!0;break}oe+=D*5}return Ee}var xn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};xn.prototype.init=function(e){var t=this,D=this,O=D.cm,U=D.div=e.lineDiv;cl(U,O.options.spellcheck,O.options.autocorrect,O.options.autocapitalize);function $(fe){for(var pe=fe.target;pe;pe=pe.parentNode){if(pe==U)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(pe.className))break}return!1}Re(U,"paste",function(fe){if(!$(fe)||qe(O,fe)||sl(fe,O))return;c<=11&&setTimeout(Gn(O,function(){return t.updateFromDOM()}),20)}),Re(U,"compositionstart",function(fe){t.composing={data:fe.data,done:!1}}),Re(U,"compositionupdate",function(fe){t.composing||(t.composing={data:fe.data,done:!1})}),Re(U,"compositionend",function(fe){t.composing&&(fe.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Re(U,"touchstart",function(){return D.forceCompositionEnd()}),Re(U,"input",function(){t.composing||t.readFromDOMSoon()});function oe(fe){if(!$(fe)||qe(O,fe))return;if(O.somethingSelected())Ko({lineWise:!1,text:O.getSelections()}),fe.type=="cut"&&O.replaceSelection("",null,"cut");else if(O.options.lineWiseCopyCut){var pe=ul(O);Ko({lineWise:!0,text:pe.text}),fe.type=="cut"&&O.operation(function(){O.setSelections(pe.ranges,0,xe),O.replaceSelection("",null,"cut")})}else return;if(fe.clipboardData){fe.clipboardData.clearData();var Ee=ea.text.join(`
|
|
|
`);if(fe.clipboardData.setData("Text",Ee),fe.clipboardData.getData("Text")==Ee){fe.preventDefault();return}}var We=dl(),Ke=We.firstChild;O.display.lineSpace.insertBefore(We,O.display.lineSpace.firstChild),Ke.value=ea.text.join(`
|
|
|
`);var ut=document.activeElement;G(Ke),setTimeout(function(){O.display.lineSpace.removeChild(We),ut.focus(),ut==U&&D.showPrimarySelection()},50)}Re(U,"copy",oe),Re(U,"cut",oe)},xn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},xn.prototype.prepareSelection=function(){var e=Yi(this.cm,!1);return e.focus=document.activeElement==this.div,e},xn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},xn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,D=t.doc.sel.primary(),O=D.from(),U=D.to();if(t.display.viewTo==t.display.viewFrom||O.line>=t.display.viewTo||U.line<t.display.viewFrom){e.removeAllRanges();return}var $=Go(t,e.anchorNode,e.anchorOffset),oe=Go(t,e.focusNode,e.focusOffset);if($&&!$.bad&&oe&&!oe.bad&&Ft(Rn($,oe),O)==0&&Ft(An($,oe),U)==0)return;var fe=t.display.view,pe=O.line>=t.display.viewFrom&&fl(t,O)||{node:fe[0].measure.map[2],offset:0},Ee=U.line<t.display.viewTo&&fl(t,U);if(!Ee){var We=fe[fe.length-1].measure,Ke=We.maps?We.maps[We.maps.length-1]:We.map;Ee={node:Ke[Ke.length-1],offset:Ke[Ke.length-2]-Ke[Ke.length-3]}}if(!pe||!Ee){e.removeAllRanges();return}var ut=e.rangeCount&&e.getRangeAt(0),at;try{at=j(pe.node,pe.offset,Ee.offset,Ee.node)}catch(mt){}at&&(!S&&t.state.focused?(e.collapse(pe.node,pe.offset),at.collapsed||(e.removeAllRanges(),e.addRange(at))):(e.removeAllRanges(),e.addRange(at)),ut&&e.anchorNode==null?e.addRange(ut):S&&this.startGracePeriod()),this.rememberSelection()},xn.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)},xn.prototype.showMultipleSelections=function(e){w(this.cm.display.cursorDiv,e.cursors),w(this.cm.display.selectionDiv,e.selection)},xn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},xn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return k(this.div,t)},xn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},xn.prototype.blur=function(){this.div.blur()},xn.prototype.getField=function(){return this.div},xn.prototype.supportsTouch=function(){return!0},xn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ci(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},xn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},xn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(m&&r&&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 D=Go(t,e.anchorNode,e.anchorOffset),O=Go(t,e.focusNode,e.focusOffset);D&&O&&Ci(t,function(){yi(t.doc,Zi(D,O),xe),(D.bad||O.bad)&&(t.curOp.selectionChanged=!0)})},xn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,D=e.doc.sel.primary(),O=D.from(),U=D.to();if(O.ch==0&&O.line>e.firstLine()&&(O=vt(O.line-1,Ct(e.doc,O.line-1).length)),U.ch==Ct(e.doc,U.line).text.length&&U.line<e.lastLine()&&(U=vt(U.line+1,0)),O.line<t.viewFrom||U.line>t.viewTo-1)return!1;var $,oe,fe;O.line==t.viewFrom||($=Sn(e,O.line))==0?(oe=jt(t.view[0].line),fe=t.view[0].node):(oe=jt(t.view[$].line),fe=t.view[$-1].node.nextSibling);var pe=Sn(e,U.line),Ee,We;if(pe==t.view.length-1?(Ee=t.viewTo-1,We=t.lineDiv.lastChild):(Ee=jt(t.view[pe+1].line)-1,We=t.view[pe+1].node.previousSibling),!fe)return!1;for(var Ke=e.doc.splitLines(ru(e,fe,We,oe,Ee)),ut=Rr(e.doc,vt(oe,0),vt(Ee,Ct(e.doc,Ee).text.length));Ke.length>1&&ut.length>1;)if(ae(Ke)==ae(ut))Ke.pop(),ut.pop(),Ee--;else if(Ke[0]==ut[0])Ke.shift(),ut.shift(),oe++;else break;for(var at=0,mt=0,yt=Ke[0],_t=ut[0],kt=Math.min(yt.length,_t.length);at<kt&&yt.charCodeAt(at)==_t.charCodeAt(at);)++at;for(var Ut=ae(Ke),Lt=ae(ut),Wt=Math.min(Ut.length-(Ke.length==1?at:0),Lt.length-(ut.length==1?at:0));mt<Wt&&Ut.charCodeAt(Ut.length-mt-1)==Lt.charCodeAt(Lt.length-mt-1);)++mt;if(Ke.length==1&&ut.length==1&&oe==O.line)for(;at&&at>O.ch&&Ut.charCodeAt(Ut.length-mt-1)==Lt.charCodeAt(Lt.length-mt-1);)at--,mt++;Ke[Ke.length-1]=Ut.slice(0,Ut.length-mt).replace(/^\u200b+/,""),Ke[0]=Ke[0].slice(at).replace(/\u200b+$/,"");var lr=vt(oe,at),er=vt(Ee,ut.length?ae(ut).length-mt:0);if(Ke.length>1||Ke[0]||Ft(lr,er))return Va(e.doc,Ke,lr,er,"+input"),!0},xn.prototype.ensurePolled=function(){this.forceCompositionEnd()},xn.prototype.reset=function(){this.forceCompositionEnd()},xn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},xn.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)},xn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ci(this.cm,function(){return bn(e.cm)})},xn.prototype.setUneditable=function(e){e.contentEditable="false"},xn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gn(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},xn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},xn.prototype.onContextMenu=function(){},xn.prototype.resetPosition=function(){},xn.prototype.needsContentAttribute=!0;function fl(e,t){var D=Ye(e,t.line);if(!D||D.hidden)return null;var O=Ct(e.doc,t.line),U=we(D,O,t.line),$=st(O,e.doc.direction),oe="left";if($){var fe=tt($,t.ch);oe=fe%2?"right":"left"}var pe=Et(U.map,t.ch,oe);return pe.offset=pe.collapse=="right"?pe.end:pe.start,pe}function tu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Qa(e,t){return t&&(e.bad=!0),e}function ru(e,t,D,O,U){var $="",oe=!1,fe=e.doc.lineSeparator(),pe=!1;function Ee(at){return function(mt){return mt.id==at}}function We(){oe&&($+=fe,pe&&($+=fe),oe=pe=!1)}function Ke(at){at&&(We(),$+=at)}function ut(at){if(at.nodeType==1){var mt=at.getAttribute("cm-text");if(mt){Ke(mt);return}var yt=at.getAttribute("cm-marker"),_t;if(yt){var kt=e.findMarks(vt(O,0),vt(U+1,0),Ee(+yt));kt.length&&(_t=kt[0].find(0))&&Ke(Rr(e.doc,_t.from,_t.to).join(fe));return}if(at.getAttribute("contenteditable")=="false")return;var Ut=/^(pre|div|p|li|table|br)$/i.test(at.nodeName);if(!/^br$/i.test(at.nodeName)&&at.textContent.length==0)return;Ut&&We();for(var Lt=0;Lt<at.childNodes.length;Lt++)ut(at.childNodes[Lt]);/^(pre|p)$/i.test(at.nodeName)&&(pe=!0),Ut&&(oe=!0)}else at.nodeType==3&&Ke(at.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ut(t),t==D);)t=t.nextSibling,pe=!1;return $}function Go(e,t,D){var O;if(t==e.display.lineDiv){if(O=e.display.lineDiv.childNodes[D],!O)return Qa(e.clipPos(vt(e.display.viewTo-1)),!0);t=null,D=0}else for(O=t;;O=O.parentNode){if(!O||O==e.display.lineDiv)return null;if(O.parentNode&&O.parentNode==e.display.lineDiv)break}for(var U=0;U<e.display.view.length;U++){var $=e.display.view[U];if($.node==O)return nu($,t,D)}}function nu(e,t,D){var O=e.text.firstChild,U=!1;if(!t||!k(O,t))return Qa(vt(jt(e.line),0),!0);if(t==O&&(U=!0,t=O.childNodes[D],D=0,!t)){var $=e.rest?ae(e.rest):e.line;return Qa(vt(jt($),$.text.length),U)}var oe=t.nodeType==3?t:null,fe=t;for(!oe&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(oe=t.firstChild,D&&(D=oe.nodeValue.length));fe.parentNode!=O;)fe=fe.parentNode;var pe=e.measure,Ee=pe.maps;function We(_t,kt,Ut){for(var Lt=-1;Lt<(Ee?Ee.length:0);Lt++)for(var Wt=Lt<0?pe.map:Ee[Lt],lr=0;lr<Wt.length;lr+=3){var er=Wt[lr+2];if(er==_t||er==kt){var kr=jt(Lt<0?e.line:e.rest[Lt]),Tn=Wt[lr]+Ut;return(Ut<0||er!=_t)&&(Tn=Wt[lr+(Ut?1:0)]),vt(kr,Tn)}}}var Ke=We(oe,fe,D);if(Ke)return Qa(Ke,U);for(var ut=fe.nextSibling,at=oe?oe.nodeValue.length-D:0;ut;ut=ut.nextSibling){if(Ke=We(ut,ut.firstChild,0),Ke)return Qa(vt(Ke.line,Ke.ch-at),U);at+=ut.textContent.length}for(var mt=fe.previousSibling,yt=D;mt;mt=mt.previousSibling){if(Ke=We(mt,mt.firstChild,-1),Ke)return Qa(vt(Ke.line,Ke.ch+yt),U);yt+=mt.textContent.length}}var Xn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null};Xn.prototype.init=function(e){var t=this,D=this,O=this.cm;this.createField(e);var U=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(U.style.width="0px"),Re(U,"input",function(){C&&c>=9&&t.hasSelection&&(t.hasSelection=null),D.poll()}),Re(U,"paste",function(oe){if(qe(O,oe)||sl(oe,O))return;O.state.pasteIncoming=+new Date,D.fastPoll()});function $(oe){if(qe(O,oe))return;if(O.somethingSelected())Ko({lineWise:!1,text:O.getSelections()});else if(O.options.lineWiseCopyCut){var fe=ul(O);Ko({lineWise:!0,text:fe.text}),oe.type=="cut"?O.setSelections(fe.ranges,null,xe):(D.prevInput="",U.value=fe.text.join(`
|
|
|
`),G(U))}else return;oe.type=="cut"&&(O.state.cutIncoming=+new Date)}Re(U,"cut",$),Re(U,"copy",$),Re(e.scroller,"paste",function(oe){if($n(e,oe)||qe(O,oe))return;if(!U.dispatchEvent){O.state.pasteIncoming=+new Date,D.focus();return}var fe=new Event("paste");fe.clipboardData=oe.clipboardData,U.dispatchEvent(fe)}),Re(e.lineSpace,"selectstart",function(oe){$n(e,oe)||ye(oe)}),Re(U,"compositionstart",function(){var oe=O.getCursor("from");D.composing&&D.composing.range.clear(),D.composing={start:oe,range:O.markText(oe,O.getCursor("to"),{className:"CodeMirror-composing"})}}),Re(U,"compositionend",function(){D.composing&&(D.poll(),D.composing.range.clear(),D.composing=null)})},Xn.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},Xn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Xn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,D=e.doc,O=Yi(e);if(e.options.moveInputWithCursor){var U=Ir(e,D.sel.primary().head,"div"),$=t.wrapper.getBoundingClientRect(),oe=t.lineDiv.getBoundingClientRect();O.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,U.top+oe.top-$.top)),O.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,U.left+oe.left-$.left))}return O},Xn.prototype.showSelection=function(e){var t=this.cm,D=t.display;w(D.cursorDiv,e.cursors),w(D.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var D=t.getSelection();this.textarea.value=D,t.state.focused&&G(this.textarea),C&&c>=9&&(this.hasSelection=D)}else e||(this.prevInput=this.textarea.value="",C&&c>=9&&(this.hasSelection=null))},Xn.prototype.getField=function(){return this.textarea},Xn.prototype.supportsTouch=function(){return!1},Xn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||z()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xn.prototype.blur=function(){this.textarea.blur()},Xn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xn.prototype.receivedFocus=function(){this.slowPoll()},Xn.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()})},Xn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function D(){var O=t.poll();!O&&!e?(e=!0,t.polling.set(60,D)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,D)},Xn.prototype.poll=function(){var e=this,t=this.cm,D=this.textarea,O=this.prevInput;if(this.contextMenuPending||!t.state.focused||bt(D)&&!O&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var U=D.value;if(U==O&&!t.somethingSelected())return!1;if(C&&c>=9&&this.hasSelection===U||d&&/[\uf700-\uf7ff]/.test(U))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var $=U.charCodeAt(0);if($==8203&&!O&&(O="\u200B"),$==8666)return this.reset(),this.cm.execCommand("undo")}for(var oe=0,fe=Math.min(O.length,U.length);oe<fe&&O.charCodeAt(oe)==U.charCodeAt(oe);)++oe;return Ci(t,function(){hs(t,U.slice(oe),O.length-oe,null,e.composing?"*compose":null),U.length>1e3||U.indexOf(`
|
|
|
`)>-1?D.value=e.prevInput="":e.prevInput=U,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xn.prototype.onKeyPress=function(){C&&c>=9&&(this.hasSelection=null),this.fastPoll()},Xn.prototype.onContextMenu=function(e){var t=this,D=t.cm,O=D.display,U=t.textarea;t.contextMenuPending&&t.contextMenuPending();var $=ri(D,e),oe=O.scroller.scrollTop;if(!$||l)return;var fe=D.options.resetSelectionOnContextMenu;fe&&D.doc.sel.contains($)==-1&&Gn(D,yi)(D.doc,Zi($),xe);var pe=U.style.cssText,Ee=t.wrapper.style.cssText,We=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",U.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-We.top-5)+"px; left: "+(e.clientX-We.left-5)+`px;
|
|
|
z-index: 1000; background: `+(C?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ke;a&&(Ke=window.scrollY),O.input.focus(),a&&window.scrollTo(null,Ke),O.input.reset(),D.somethingSelected()||(U.value=t.prevInput=" "),t.contextMenuPending=at,O.selForContextMenu=D.doc.sel,clearTimeout(O.detectingSelectAll);function ut(){if(U.selectionStart!=null){var yt=D.somethingSelected(),_t="\u200B"+(yt?U.value:"");U.value="\u21DA",U.value=_t,t.prevInput=yt?"":"\u200B",U.selectionStart=1,U.selectionEnd=_t.length,O.selForContextMenu=D.doc.sel}}function at(){if(t.contextMenuPending!=at)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Ee,U.style.cssText=pe,C&&c<9&&O.scrollbars.setScrollTop(O.scroller.scrollTop=oe),U.selectionStart!=null){(!C||C&&c<9)&&ut();var yt=0,_t=function(){O.selForContextMenu==D.doc.sel&&U.selectionStart==0&&U.selectionEnd>0&&t.prevInput=="\u200B"?Gn(D,Ds)(D):yt++<10?O.detectingSelectAll=setTimeout(_t,500):(O.selForContextMenu=null,O.input.reset())};O.detectingSelectAll=setTimeout(_t,200)}}if(C&&c>=9&&ut(),M){Pe(e);var mt=function(){ct(window,"mouseup",mt),setTimeout(at,20)};Re(window,"mouseup",mt)}else setTimeout(at,50)},Xn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Xn.prototype.setUneditable=function(){},Xn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?W(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var D=z();t.autofocus=D==e||e.getAttribute("autofocus")!=null&&D==document.body}function O(){e.value=fe.getValue()}var U;if(e.form&&(Re(e.form,"submit",O),!t.leaveSubmitMethodAlone)){var $=e.form;U=$.submit;try{var oe=$.submit=function(){O(),$.submit=U,$.submit(),$.submit=oe}}catch(pe){}}t.finishInit=function(pe){pe.save=O,pe.getTextArea=function(){return e},pe.toTextArea=function(){pe.toTextArea=isNaN,O(),e.parentNode.removeChild(pe.getWrapperElement()),e.style.display="",e.form&&(ct(e.form,"submit",O),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=U))}},e.style.display="none";var fe=jn(function(pe){return e.parentNode.insertBefore(pe,e.nextSibling)},t);return fe}function au(e){e.off=ct,e.on=Re,e.wheelEventPixels=so,e.Doc=Li,e.splitLines=Ot,e.countColumn=K,e.findColumn=_e,e.isWordChar=Q,e.Pass=Ce,e.signal=$e,e.Line=ei,e.changeEnd=qi,e.scrollbarModel=io,e.Pos=vt,e.cmpPos=Ft,e.modes=dr,e.mimeModes=Nt,e.resolveMode=wt,e.getMode=hr,e.modeExtensions=Qr,e.extendMode=Gr,e.copyState=Lr,e.startState=Tt,e.innerMode=si,e.commands=xo,e.keyMap=ma,e.keyName=Vs,e.isModifierKey=Ks,e.lookupKey=Ya,e.normalizeKeyMap=Pl,e.StringStream=Dt,e.SharedTextMarker=vo,e.TextMarker=Sa,e.LineWidget=go,e.e_preventDefault=ye,e.e_stopPropagation=Te,e.e_stop=Pe,e.addClass=H,e.contains=k,e.rmClass=x,e.keyNames=Ta}Jl(jn),eu(jn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Vo in Li.prototype)Li.prototype.hasOwnProperty(Vo)&&re(ou,Vo)<0&&(jn.prototype[Vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[Vo]));return Ie(Li),jn.inputStyles={textarea:Xn,contenteditable:xn},jn.defineMode=function(e){!jn.defaults.mode&&e!="null"&&(jn.defaults.mode=e),br.apply(this,arguments)},jn.defineMIME=ur,jn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jn.defineMIME("text/plain","null"),jn.defineExtension=function(e,t){jn.prototype[e]=t},jn.defineDocExtension=function(e,t){Li.prototype[e]=t},jn.fromTextArea=iu,au(jn),jn.version="5.58.2",jn})},WYAk:function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){(function(){var u=L,S=u.lib,R=S.Base,h=u.enc,o=h.Utf8,C=u.algo,c=C.HMAC=R.extend({init:function(a,i){a=this._hasher=new a.init,typeof i=="string"&&(i=o.parse(i));var r=a.blockSize,l=r*4;i.sigBytes>l&&(i=a.finalize(i)),i.clamp();for(var p=this._oKey=i.clone(),f=this._iKey=i.clone(),b=p.words,v=f.words,m=0;m<r;m++)b[m]^=1549556828,v[m]^=909522486;p.sigBytes=f.sigBytes=l,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 i=this._hasher,r=i.finalize(a);i.reset();var l=i.finalize(this._oKey.clone().concat(r));return l}})})()})},WaYH:function(I,J,P){"use strict";var L=P("rePB"),u=P("Ff2n"),S=P("VTBJ"),R=P("1OyB"),h=P("vuIU"),o=P("JX7q"),C=P("Ji7U"),c=P("LK+K"),a=P("q1tI"),i=P("TSYQ"),r=P.n(i),l=P("sboe"),p=P("OZM5"),f=function(M){var A=M.prefixCls,x=M.level,E=M.isStart,w=M.isEnd;if(!x)return null;for(var _="".concat(A,"-indent-unit"),N=[],j=0;j<x;j+=1){var k;N.push(a.createElement("span",{key:j,className:r()(_,(k={},Object(L.a)(k,"".concat(_,"-start"),E[j+1]),Object(L.a)(k,"".concat(_,"-end"),w[j+1]),Object(L.a)(k,"".concat(_,"-end-first-level"),!j&&w[0]),k))}))}return a.createElement("span",{"aria-hidden":"true",className:"".concat(A,"-indent")},N)},b=f,v=P("815F"),m="open",n="close",d="---",g=function(s){Object(C.a)(A,s);var M=Object(c.a)(A);function A(){var x;return Object(R.a)(this,A),x=M.apply(this,arguments),x.state={dragNodeHighlight:!1},x.onSelectorClick=function(E){var w=x.props.context.onNodeClick;w(E,Object(v.b)(x.props)),x.isSelectable()?x.onSelect(E):x.onCheck(E)},x.onSelectorDoubleClick=function(E){var w=x.props.context.onNodeDoubleClick;w(E,Object(v.b)(x.props))},x.onSelect=function(E){if(x.isDisabled())return;var w=x.props.context.onNodeSelect;E.preventDefault(),w(E,Object(v.b)(x.props))},x.onCheck=function(E){if(x.isDisabled())return;var w=x.props,_=w.disableCheckbox,N=w.checked,j=x.props.context.onNodeCheck;if(!x.isCheckable()||_)return;E.preventDefault();var k=!N;j(E,Object(v.b)(x.props),k)},x.onMouseEnter=function(E){var w=x.props.context.onNodeMouseEnter;w(E,Object(v.b)(x.props))},x.onMouseLeave=function(E){var w=x.props.context.onNodeMouseLeave;w(E,Object(v.b)(x.props))},x.onContextMenu=function(E){var w=x.props.context.onNodeContextMenu;w(E,Object(v.b)(x.props))},x.onDragStart=function(E){var w=x.props.context.onNodeDragStart;E.stopPropagation(),x.setState({dragNodeHighlight:!0}),w(E,Object(o.a)(x));try{E.dataTransfer.setData("text/plain","")}catch(_){}},x.onDragEnter=function(E){var w=x.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),w(E,Object(o.a)(x))},x.onDragOver=function(E){var w=x.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),w(E,Object(o.a)(x))},x.onDragLeave=function(E){var w=x.props.context.onNodeDragLeave;E.stopPropagation(),w(E,Object(o.a)(x))},x.onDragEnd=function(E){var w=x.props.context.onNodeDragEnd;E.stopPropagation(),x.setState({dragNodeHighlight:!1}),w(E,Object(o.a)(x))},x.onDrop=function(E){var w=x.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),x.setState({dragNodeHighlight:!1}),w(E,Object(o.a)(x))},x.onExpand=function(E){var w=x.props.context.onNodeExpand;w(E,Object(v.b)(x.props))},x.setSelectHandle=function(E){x.selectHandle=E},x.getNodeState=function(){var E=x.props.expanded;return x.isLeaf()?null:E?m:n},x.hasChildren=function(){var E=x.props.eventKey,w=x.props.context.keyEntities,_=w[E]||{},N=_.children;return!!(N||[]).length},x.isLeaf=function(){var E=x.props,w=E.isLeaf,_=E.loaded,N=x.props.context.loadData,j=x.hasChildren();return w===!1?!1:w||!N&&!j||N&&_&&!j},x.isDisabled=function(){var E=x.props.disabled,w=x.props.context.disabled;return!!(w||E)},x.isCheckable=function(){var E=x.props.checkable,w=x.props.context.checkable;return!w||E===!1?!1:w},x.syncLoadData=function(E){var w=E.expanded,_=E.loading,N=E.loaded,j=x.props.context,k=j.loadData,z=j.onNodeLoad;if(_)return;k&&w&&!x.isLeaf()&&(!x.hasChildren()&&!N&&z(Object(v.b)(x.props)))},x.renderSwitcher=function(){var E=x.props,w=E.expanded,_=E.switcherIcon,N=x.props.context,j=N.prefixCls,k=N.switcherIcon,z=_||k;if(x.isLeaf())return a.createElement("span",{className:r()("".concat(j,"-switcher"),"".concat(j,"-switcher-noop"))},typeof z=="function"?z(Object(S.a)(Object(S.a)({},x.props),{},{isLeaf:!0})):z);var H=r()("".concat(j,"-switcher"),"".concat(j,"-switcher_").concat(w?m:n));return a.createElement("span",{onClick:x.onExpand,className:H},typeof z=="function"?z(Object(S.a)(Object(S.a)({},x.props),{},{isLeaf:!1})):z)},x.renderCheckbox=function(){var E=x.props,w=E.checked,_=E.halfChecked,N=E.disableCheckbox,j=x.props.context.prefixCls,k=x.isDisabled(),z=x.isCheckable();if(!z)return null;var H=typeof z!="boolean"?z:null;return a.createElement("span",{className:r()("".concat(j,"-checkbox"),w&&"".concat(j,"-checkbox-checked"),!w&&_&&"".concat(j,"-checkbox-indeterminate"),(k||N)&&"".concat(j,"-checkbox-disabled")),onClick:x.onCheck},H)},x.renderIcon=function(){var E=x.props.loading,w=x.props.context.prefixCls;return a.createElement("span",{className:r()("".concat(w,"-iconEle"),"".concat(w,"-icon__").concat(x.getNodeState()||"docu"),E&&"".concat(w,"-icon_loading"))})},x.renderSelector=function(){var E=x.state.dragNodeHighlight,w=x.props,_=w.title,N=w.selected,j=w.icon,k=w.loading,z=w.data,H=x.props.context,F=H.prefixCls,G=H.showIcon,B=H.icon,W=H.draggable,K=H.loadData,q=H.titleRender,re=x.isDisabled(),ee="".concat(F,"-node-content-wrapper"),Ce;if(G){var xe=j||B;Ce=xe?a.createElement("span",{className:r()("".concat(F,"-iconEle"),"".concat(F,"-icon__customize"))},typeof xe=="function"?xe(x.props):xe):x.renderIcon()}else K&&k&&(Ce=x.renderIcon());var he;typeof _=="function"?he=_(z):q?he=q(z):he=_;var ke=a.createElement("span",{className:"".concat(F,"-title")},he);return a.createElement("span",{ref:x.setSelectHandle,title:typeof _=="string"?_:"",className:r()("".concat(ee),"".concat(ee,"-").concat(x.getNodeState()||"normal"),!re&&(N||E)&&"".concat(F,"-node-selected"),!re&&W&&"draggable"),draggable:!re&&W||void 0,"aria-grabbed":!re&&W||void 0,onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onContextMenu:x.onContextMenu,onClick:x.onSelectorClick,onDoubleClick:x.onSelectorDoubleClick,onDragStart:W?x.onDragStart:void 0},Ce,ke)},x}return Object(h.a)(A,[{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,w=this.props.context.selectable;return typeof E=="boolean"?E:w}},{key:"render",value:function(){var E,w=this.props,_=w.eventKey,N=w.className,j=w.style,k=w.dragOver,z=w.dragOverGapTop,H=w.dragOverGapBottom,F=w.isLeaf,G=w.isStart,B=w.isEnd,W=w.expanded,K=w.selected,q=w.checked,re=w.halfChecked,ee=w.loading,Ce=w.domRef,xe=w.active,he=w.onMouseMove,ke=Object(u.a)(w,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),_e=this.props.context,de=_e.prefixCls,ce=_e.filterTreeNode,ae=_e.draggable,Se=_e.keyEntities,te=this.isDisabled(),ue=Object(p.f)(ke),Oe=Se[_]||{},le=Oe.level,Q=B[B.length-1];return a.createElement("div",Object.assign({ref:Ce,className:r()(N,"".concat(de,"-treenode"),(E={},Object(L.a)(E,"".concat(de,"-treenode-disabled"),te),Object(L.a)(E,"".concat(de,"-treenode-switcher-").concat(W?"open":"close"),!F),Object(L.a)(E,"".concat(de,"-treenode-checkbox-checked"),q),Object(L.a)(E,"".concat(de,"-treenode-checkbox-indeterminate"),re),Object(L.a)(E,"".concat(de,"-treenode-selected"),K),Object(L.a)(E,"".concat(de,"-treenode-loading"),ee),Object(L.a)(E,"".concat(de,"-treenode-active"),xe),Object(L.a)(E,"".concat(de,"-treenode-leaf-last"),Q),Object(L.a)(E,"drag-over",!te&&k),Object(L.a)(E,"drag-over-gap-top",!te&&z),Object(L.a)(E,"drag-over-gap-bottom",!te&&H),Object(L.a)(E,"filter-node",ce&&ce(Object(v.b)(this.props))),E)),style:j,onDragEnter:ae?this.onDragEnter:void 0,onDragOver:ae?this.onDragOver:void 0,onDragLeave:ae?this.onDragLeave:void 0,onDrop:ae?this.onDrop:void 0,onDragEnd:ae?this.onDragEnd:void 0,onMouseMove:he},ue),a.createElement(b,{prefixCls:de,level:le,isStart:G,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),A}(a.Component),T=function(M){return a.createElement(l.a.Consumer,null,function(A){return a.createElement(g,Object.assign({},M,{context:A}))})};T.displayName="TreeNode",T.defaultProps={title:d},T.isTreeNode=1;var y=J.a=T},XIdC:function(I,J,P){"use strict";var L=P("rePB"),u=P("ODXe"),S=P("Ff2n"),R=P("q1tI"),h=P.n(R),o=P("TSYQ"),C=P.n(o),c=P("6cGi"),a=P("4IlW"),i=R.forwardRef(function(r,l){var p,f=r.prefixCls,b=f===void 0?"rc-switch":f,v=r.className,m=r.checked,n=r.defaultChecked,d=r.disabled,g=r.loadingIcon,T=r.checkedChildren,y=r.unCheckedChildren,s=r.onClick,M=r.onChange,A=r.onKeyDown,x=Object(S.a)(r,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),E=Object(c.a)(!1,{value:m,defaultValue:n}),w=Object(u.a)(E,2),_=w[0],N=w[1];function j(F,G){var B=_;return d||(B=F,N(B),M==null||M(B,G)),B}function k(F){F.which===a.a.LEFT?j(!1,F):F.which===a.a.RIGHT&&j(!0,F),A==null||A(F)}function z(F){var G=j(!_,F);s==null||s(G,F)}var H=C()(b,v,(p={},Object(L.a)(p,"".concat(b,"-checked"),_),Object(L.a)(p,"".concat(b,"-disabled"),d),p));return R.createElement("button",Object.assign({},x,{type:"button",role:"switch","aria-checked":_,disabled:d,className:H,ref:l,onKeyDown:k,onClick:z}),g,R.createElement("span",{className:"".concat(b,"-inner")},_?T:y))});i.displayName="Switch",J.a=i},Y1PL:function(I,J,P){"use strict";P.r(J),P.d(J,"ResizableTextArea",function(){return re});var L=P("wx14"),u=P("1OyB"),S=P("vuIU"),R=P("Ji7U"),h=P("LK+K"),o=P("q1tI"),C=P("VTBJ"),c=P("rePB"),a=P("Zm9Q"),i=P("Kwbf"),r=P("c+Xe"),l=P("m+aA"),p=P("bdgK"),f=new Map;function b(xe){xe.forEach(function(he){var ke,_e=he.target;(ke=f.get(_e))===null||ke===void 0||ke.forEach(function(de){return de(_e)})})}var v=new p.default(b),m=null,n=null;function d(xe,he){f.has(xe)||(f.set(xe,new Set),v.observe(xe)),f.get(xe).add(he)}function g(xe,he){f.has(xe)&&(f.get(xe).delete(he),f.get(xe).size||(v.unobserve(xe),f.delete(xe)))}var T=function(xe){Object(R.a)(ke,xe);var he=Object(h.a)(ke);function ke(){return Object(u.a)(this,ke),he.apply(this,arguments)}return Object(S.a)(ke,[{key:"render",value:function(){return this.props.children}}]),ke}(o.Component),y=o.createContext(null);function s(xe){var he=xe.children,ke=xe.onBatchResize,_e=o.useRef(0),de=o.useRef([]),ce=o.useContext(y),ae=o.useCallback(function(Se,te,ue){_e.current+=1;var Oe=_e.current;de.current.push({size:Se,element:te,data:ue}),Promise.resolve().then(function(){Oe===_e.current&&(ke==null||ke(de.current),de.current=[])}),ce==null||ce(Se,te,ue)},[ke,ce]);return o.createElement(y.Provider,{value:ae},he)}function M(xe){var he=xe.children,ke=xe.disabled,_e=o.useRef(null),de=o.useRef(null),ce=o.useContext(y),ae=o.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Se=o.isValidElement(he)&&Object(r.c)(he),te=Se?he.ref:null,ue=o.useMemo(function(){return Object(r.a)(te,_e)},[te,_e]),Oe=o.useRef(xe);Oe.current=xe;var le=o.useCallback(function(Q){var Y=Oe.current,Z=Y.onResize,be=Y.data,ge=Q.getBoundingClientRect(),De=ge.width,Qe=ge.height,Ze=Q.offsetWidth,nt=Q.offsetHeight,tt=Math.floor(De),lt=Math.floor(Qe);if(ae.current.width!==tt||ae.current.height!==lt||ae.current.offsetWidth!==Ze||ae.current.offsetHeight!==nt){var st={width:tt,height:lt,offsetWidth:Ze,offsetHeight:nt};ae.current=st;var je=Ze===Math.round(De)?De:Ze,Re=nt===Math.round(Qe)?Qe:nt,et=Object(C.a)(Object(C.a)({},st),{},{offsetWidth:je,offsetHeight:Re});ce==null||ce(et,Q,be),Z&&Promise.resolve().then(function(){Z(et,Q)})}},[]);return o.useEffect(function(){var Q=Object(l.a)(_e.current)||Object(l.a)(de.current);return Q&&!ke&&d(Q,le),function(){return g(Q,le)}},[_e.current,ke]),o.createElement(T,{ref:de},Se?o.cloneElement(he,{ref:ue}):he)}var A="rc-observer-key";function x(xe){var he=xe.children,ke=Object(a.a)(he);return ke.map(function(_e,de){var ce=(_e==null?void 0:_e.key)||"".concat(A,"-").concat(de);return o.createElement(M,Object(L.a)({},xe,{key:ce}),_e)})}x.Collection=s;var E=x,w=P("bT9E"),_=P("TSYQ"),N=P.n(_),j=`
|
|
|
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
|
|
|
`,k=["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"],z={},H;function F(xe){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ke=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(he&&z[ke])return z[ke];var _e=window.getComputedStyle(xe),de=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),ae=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),Se=k.map(function(ue){return"".concat(ue,":").concat(_e.getPropertyValue(ue))}).join(";"),te={sizingStyle:Se,paddingSize:ce,borderSize:ae,boxSizing:de};return he&&ke&&(z[ke]=te),te}function G(xe){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),xe.getAttribute("wrap")?H.setAttribute("wrap",xe.getAttribute("wrap")):H.removeAttribute("wrap");var de=F(xe,he),ce=de.paddingSize,ae=de.borderSize,Se=de.boxSizing,te=de.sizingStyle;H.setAttribute("style","".concat(te,";").concat(j)),H.value=xe.value||xe.placeholder||"";var ue=Number.MIN_SAFE_INTEGER,Oe=Number.MAX_SAFE_INTEGER,le=H.scrollHeight,Q;if(Se==="border-box"?le+=ae:Se==="content-box"&&(le-=ce),ke!==null||_e!==null){H.value=" ";var Y=H.scrollHeight-ce;ke!==null&&(ue=Y*ke,Se==="border-box"&&(ue=ue+ce+ae),le=Math.max(ue,le)),_e!==null&&(Oe=Y*_e,Se==="border-box"&&(Oe=Oe+ce+ae),Q=le>Oe?"":"hidden",le=Math.min(Oe,le))}return{height:le,minHeight:ue,maxHeight:Oe,overflowY:Q,resize:"none"}}var B=P("Gytx"),W=P.n(B),K;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(K||(K={}));var q=function(xe){Object(R.a)(ke,xe);var he=Object(h.a)(ke);function ke(_e){var de;return Object(u.a)(this,ke),de=he.call(this,_e),de.nextFrameActionId=void 0,de.resizeFrameId=void 0,de.textArea=void 0,de.saveTextArea=function(ce){de.textArea=ce},de.handleResize=function(ce){var ae=de.state.resizeStatus,Se=de.props,te=Se.autoSize,ue=Se.onResize;if(ae!==K.NONE)return;typeof ue=="function"&&ue(ce),te&&de.resizeOnNextFrame()},de.resizeOnNextFrame=function(){cancelAnimationFrame(de.nextFrameActionId),de.nextFrameActionId=requestAnimationFrame(de.resizeTextarea)},de.resizeTextarea=function(){var ce=de.props.autoSize;if(!ce||!de.textArea)return;var ae=ce.minRows,Se=ce.maxRows,te=G(de.textArea,!1,ae,Se);de.setState({textareaStyles:te,resizeStatus:K.RESIZING},function(){cancelAnimationFrame(de.resizeFrameId),de.resizeFrameId=requestAnimationFrame(function(){de.setState({resizeStatus:K.RESIZED},function(){de.resizeFrameId=requestAnimationFrame(function(){de.setState({resizeStatus:K.NONE}),de.fixFirefoxAutoScroll()})})})})},de.renderTextArea=function(){var ce=de.props,ae=ce.prefixCls,Se=ae===void 0?"rc-textarea":ae,te=ce.autoSize,ue=ce.onResize,Oe=ce.className,le=ce.disabled,Q=de.state,Y=Q.textareaStyles,Z=Q.resizeStatus,be=Object(w.a)(de.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ge=N()(Se,Oe,Object(c.a)({},"".concat(Se,"-disabled"),le));"value"in be&&(be.value=be.value||"");var De=Object(C.a)(Object(C.a)(Object(C.a)({},de.props.style),Y),Z===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return o.createElement(E,{onResize:de.handleResize,disabled:!(te||ue)},o.createElement("textarea",Object(L.a)({},be,{className:ge,style:De,ref:de.saveTextArea})))},de.state={textareaStyles:{},resizeStatus:K.NONE},de}return Object(S.a)(ke,[{key:"componentDidUpdate",value:function(de){(de.value!==this.props.value||!W()(de.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 de=this.textArea.selectionStart,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(de,ce)}}catch(ae){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ke}(o.Component),re=q,ee=function(xe){Object(R.a)(ke,xe);var he=Object(h.a)(ke);function ke(_e){var de;Object(u.a)(this,ke),de=he.call(this,_e),de.resizableTextArea=void 0,de.focus=function(){de.resizableTextArea.textArea.focus()},de.saveTextArea=function(ae){de.resizableTextArea=ae},de.handleChange=function(ae){var Se=de.props.onChange;de.setValue(ae.target.value,function(){de.resizableTextArea.resizeTextarea()}),Se&&Se(ae)},de.handleKeyDown=function(ae){var Se=de.props,te=Se.onPressEnter,ue=Se.onKeyDown;ae.keyCode===13&&te&&te(ae),ue&&ue(ae)};var ce=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return de.state={value:ce},de}return Object(S.a)(ke,[{key:"setValue",value:function(de,ce){"value"in this.props||this.setState({value:de},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return o.createElement(re,Object(L.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(de){return"value"in de?{value:de.value}:null}}]),ke}(o.Component),Ce=J.default=ee},ZD9Y:function(I,J,P){"use strict";var L=P("BoS7"),u=P("Sdc0"),S=P("OaEy"),R=P("2fM7"),h=P("q1tI"),o=P.n(h),C=P("lOMy"),c=P.n(C),a=R.a.Option;J.a=function(i){var r=i.onFontSizeChange,l=i.cmFontSize,p=i.cmCodeMode,f=i.onCodeModeChange,b=i.onTabToSpace,v=i.className,m=v===void 0?"":v,n=i.tabToSpace,d=i.children;return o.a.createElement("div",{className:"tpi-code-setting ".concat(m)},o.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),o.a.createElement("section",null,o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),o.a.createElement(R.a,{bordered:!1,size:"small",value:p,onChange:f},o.a.createElement(a,{value:"vs"},"\u767D\u8272\u80CC\u666F"),o.a.createElement(a,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),o.a.createElement(R.a,{bordered:!1,size:"small",value:l,onChange:r},o.a.createElement(a,{value:12},"12px"),o.a.createElement(a,{value:14},"14px"),o.a.createElement(a,{value:16},"16px"),o.a.createElement(a,{value:18},"18px"),o.a.createElement(a,{value:20},"20px"),o.a.createElement(a,{value:22},"22px"))),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"Tab\u8F6C\u6362"),o.a.createElement(u.a,{checked:n,onChange:b}))),o.a.createElement("h3",null,"\u5FEB\u6377\u952E"),o.a.createElement("section",null,o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),o.a.createElement("span",null,"Ctrl + S")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),o.a.createElement("span",null,"F1 / Alt + F1")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),o.a.createElement("span",null,"Ctrl + ]/[")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),o.a.createElement("span",null,"Ctrl + Shift + \\")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),o.a.createElement("span",null,"Home")),o.a.createElement("div",{className:"file-item"},o.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),o.a.createElement("span",null,"End"))),d)}},ZW9T:function(I,J,P){"use strict";P.d(J,"a",function(){return T});var L=P("k1fw"),u=P("miYZ"),S=P("tsqr"),R=P("rAM+"),h=P("tJVT"),o=P("PpiC"),C=P("q1tI"),c=P.n(C),a=P("bdgK");function i(y,s,M,A,x){var E=s.getWordUntilPosition(M),w={startLineNumber:M.lineNumber,endLineNumber:M.lineNumber,startColumn:E.startColumn,endColumn:E.endColumn},_=A.map(function(N){return{label:N,kind:y.languages.CompletionItemKind.Keyword,insertText:N,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:w}});return x.map(function(N){_.push(Object(L.a)(Object(L.a)({},N),{},{range:w}))}),_}var r=function(y){var s={label:"ifelse",kind:y.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet},M=["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"];y.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(w,_){var N=i(y,w,_,M,[s]);return{suggestions:N}}});var A=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];y.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(w,_){var N=[{label:"print",kind:y.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
|
`),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}],j=i(y,w,_,A,N);return{suggestions:j}}});var x=["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"];y.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(w,_){var N=[s,{label:"main",kind:y.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:y.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
|
`),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}],j=i(y,w,_,x,N);return{suggestions:j}}})},l="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",p=P("LvDl");function f(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function b(){}var v=!1,m={"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 y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=y;if(Array.isArray(y)){for(var M=0;M<y.length;M++){var A=m[y[M]];if(A)return A}return s[0]}return m[s]||s}var d=null,g=J.b=function(y){var s=y.width,M=s===void 0?"100%":s,A=y.height,x=A===void 0?"100%":A,E=y.value,w=y.language,_=w===void 0?"javascript":w,N=y.style,j=N===void 0?{}:N,k=y.options,z=k===void 0?{}:k,H=y.overrideServices,F=H===void 0?{}:H,G=y.theme,B=G===void 0?"vs-dark":G,W=y.onEditBlur,K=y.onSave,q=y.autoHeight,re=q===void 0?!1:q,ee=y.forbidCopy,Ce=ee===void 0?!1:ee,xe=y.onChange,he=xe===void 0?b:xe,ke=y.editorDidMount,_e=ke===void 0?b:ke,de=y.onFocus,ce=de===void 0?b:de,ae=y.filename,Se=ae===void 0?"educoder.txt":ae,te=Object(o.a)(y,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ue=Object(C.useRef)(),Oe=Object(C.useRef)({}),le=Object(C.useRef)(),Q=Object(C.useRef)(!1),Y=Object(C.useRef)(),Z=Object(C.useState)(!1),be=Object(h.a)(Z,2),ge=be[0],De=be[1];function Qe(){var Ae;return ue.current&&(Ae=new a.default(function(Pe){var Xe=Object(R.a)(Pe),rt;try{for(Xe.s();!(rt=Xe.n()).done;){var ft=rt.value;(ft.target.offsetHeight>0||ft.target.offsetWidth>0)&&Oe.current.instance.layout()}}catch(St){Xe.e(St)}finally{Xe.f()}}),Ae.observe(ue.current)),Ae}function Ze(){S.b.warn(decodeURIComponent(l))}var nt=function(){var Pe=Oe.current.instance;if(E!=null&&Pe&&ge){var Xe=Pe.getModel();Xe&&E!==Xe.getValue()&&(v=!0,Xe.setValue(E),Pe.layout(),v=!1)}};Object(C.useEffect)(function(){le.current&&clearTimeout(le.current),le.current=setTimeout(function(){nt()},500)},[E,ge,Oe.current]);function tt(){var Ae=Oe.current.instance;if(Ae){var Pe=Ae.getSelection(),Xe=Oe.current.pastePos||{},rt=new d.Range(Xe.startLineNumber||Pe.endLineNumber,Xe.startColumn||Pe.endColumn,Xe.endLineNumber||Pe.endLineNumber,Xe.endColumn||Pe.endColumn);setTimeout(function(){Ae.executeEdits("",[{range:rt,text:""}])},300)}}function lt(Ae){(window.navigator.platform.match("Mac")?Ae.metaKey:Ae.ctrlKey)&&Ae.keyCode==83&&(Ae.preventDefault(),K())}var st=function(){if(re&&Oe.current.instance){var Pe=Oe.current.instance.getContentHeight();ye(Pe<x?x:Pe)}else ye(x)};function je(Ae){var Pe=document.createEvent("MouseEvents");Pe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ae.dispatchEvent(Pe)}function Re(Ae,Pe){var Xe=window.URL||window.webkitURL||window,rt=new Blob([Pe]),ft=document.createElementNS("http://www.w3.org/1999/xhtml","a");ft.href=Xe.createObjectURL(rt),ft.download=Ae,je(ft)}Object(C.useEffect)(function(){st()},[st]),Object(C.useEffect)(function(){ue.current&&!ge&&P.e(27).then(P.t.bind(null,"M/lh",7)).then(function(Ae){try{d=Ae,Oe.current.instance=d.editor.create(ue.current,{value:E,language:n(_),theme:B,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},F);var Pe=Oe.current.instance;if(_e(Pe,d),setTimeout(function(){st(),Oe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Re(Se||"educoder.txt",Pe.getValue())}})},500),Oe.current.subscription=Pe.onDidChangeModelContent(function(rt){Q.current?clearTimeout(Y.current):(st(),he(Pe.getValue(),rt)),Y.current=setTimeout(function(){Q.current=!1},500)}),window.Monaco||r(d),Ce&&(Pe.addCommand(d.KeyMod.CtrlCmd|d.KeyMod.Shift|d.KeyCode.KEY_V,function(){return Ze(),null}),Pe.addCommand(d.KeyMod.CtrlCmd|d.KeyCode.KEY_C,function(){return Ze(),null})),window.Monaco=d,W&&Pe.onDidBlurEditorWidget(function(){W(Pe.getValue())}),ce&&Pe.onDidFocusEditorText(function(){ce(Pe.getValue())}),Ce){Pe.addCommand(d.KeyMod.CtrlCmd|d.KeyCode.KEY_V,function(){return Ze(),null}),Pe.onDidPaste(function(rt){Oe.current.pastePos=rt});try{window.addEventListener("paste",tt)}catch(rt){}}var Xe=Qe();return De(!0),function(){var rt=Oe.current.instance;rt.dispose();var ft=rt.getModel();ft&&ft.dispose(),Oe.current.subscription&&Oe.current.subscription.dispose(),Ce&&window.removeEventListener("paste",tt),Xe.unobserve(ue.current)}}catch(rt){}})},[]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;if(Ae&&ge)return document.addEventListener("keydown",lt,!1),function(){document.removeEventListener("keydown",lt)}},[K,ge]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;if(Ae&&ge){var Pe=n(_);d.editor.setModelLanguage(Ae.getModel(),Pe),console.log("language:",_,Ae.getModel(),Pe)}},[_,ge]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;Ae&&ge&&d.editor.setTheme(B)},[B,ge]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;Ae&&ge&&(Ae.updateOptions(Object(L.a)({},z)),setTimeout(function(){Ae.getModel().updateOptions(Object(L.a)({},z))},200))},[JSON.stringify(z),ge]),Object(C.useEffect)(function(){var Ae=Oe.current.instance;Ae&&ge&&Ae.layout()},[M,x,ge]);var et=Object(C.useState)(f(M)),ct=Object(h.a)(et,2),$e=ct[0],qe=ct[1],Ue=Object(C.useState)(f(x)),Me=Object(h.a)(Ue,2),Ie=Me[0],ye=Me[1],Te=Object(L.a)(Object(L.a)({},j),{},{width:$e,height:Ie});return c.a.createElement("div",{className:"my-monaco-editor",ref:ue,style:Te})};function T(y){var s=y.width,M=s===void 0?"100%":s,A=y.height,x=A===void 0?"100%":A,E=y.original,w=y.modified,_=y.language,N=y.options,j=N===void 0?{}:N,k=Object(C.useRef)(),z=Object(C.useState)(null),H=Object(h.a)(z,2),F=H[0],G=H[1];function B(re){var ee;return k.current&&(ee=new a.default(function(Ce){var xe=Object(R.a)(Ce),he;try{for(xe.s();!(he=xe.n()).done;){var ke=he.value;(ke.target.offsetHeight>0||ke.target.offsetWidth>0)&&re.layout()}}catch(_e){xe.e(_e)}finally{xe.f()}}),ee.observe(k.current)),ee}Object(C.useEffect)(function(){k.current&&P.e(27).then(P.t.bind(null,"M/lh",7)).then(function(re){d=re;var ee=d.editor.createDiffEditor(k.current,Object(L.a)(Object(L.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},j),{},{wordWrap:!0}));G(ee);var Ce=B(ee);return function(){ee.dispose();var xe=ee.getModel();xe&&xe.dispose(),Ce.unobserve(k.current)}})},[]),Object(C.useEffect)(function(){F&&F.setModel({original:d.editor.createModel(E,_),modified:d.editor.createModel(w,_)})},[E,w,_,F]);var W=f(M),K=f(x),q={width:W,height:K};return c.a.createElement("div",{className:"my-diff-editor",ref:k,style:q})}},ZpRC:function(I,J,P){"use strict";function L(r){return typeof r=="object"&&r!=null&&r.nodeType===1}function u(r,l){return(!l||r!=="hidden")&&r!=="visible"&&r!=="clip"}function S(r,l){if(r.clientHeight<r.scrollHeight||r.clientWidth<r.scrollWidth){var p=getComputedStyle(r,null);return u(p.overflowY,l)||u(p.overflowX,l)||function(f){var b=function(v){if(!v.ownerDocument||!v.ownerDocument.defaultView)return null;try{return v.ownerDocument.defaultView.frameElement}catch(m){return null}}(f);return!!b&&(b.clientHeight<f.scrollHeight||b.clientWidth<f.scrollWidth)}(r)}return!1}function R(r,l,p,f,b,v,m,n){return v<r&&m>l||v>r&&m<l?0:v<=r&&n<=p||m>=l&&n>=p?v-r-f:m>l&&n<p||v<r&&n>p?m-l+b:0}var h=function(r,l){var p=window,f=l.scrollMode,b=l.block,v=l.inline,m=l.boundary,n=l.skipOverflowHiddenElements,d=typeof m=="function"?m:function(Y){return Y!==m};if(!L(r))throw new TypeError("Invalid target");for(var g=document.scrollingElement||document.documentElement,T=[],y=r;L(y)&&d(y);){if((y=y.parentElement)===g){T.push(y);break}y!=null&&y===document.body&&S(y)&&!S(document.documentElement)||y!=null&&S(y,n)&&T.push(y)}for(var s=p.visualViewport?p.visualViewport.width:innerWidth,M=p.visualViewport?p.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,x=window.scrollY||pageYOffset,E=r.getBoundingClientRect(),w=E.height,_=E.width,N=E.top,j=E.right,k=E.bottom,z=E.left,H=b==="start"||b==="nearest"?N:b==="end"?k:N+w/2,F=v==="center"?z+_/2:v==="end"?j:z,G=[],B=0;B<T.length;B++){var W=T[B],K=W.getBoundingClientRect(),q=K.height,re=K.width,ee=K.top,Ce=K.right,xe=K.bottom,he=K.left;if(f==="if-needed"&&N>=0&&z>=0&&k<=M&&j<=s&&N>=ee&&k<=xe&&z>=he&&j<=Ce)return G;var ke=getComputedStyle(W),_e=parseInt(ke.borderLeftWidth,10),de=parseInt(ke.borderTopWidth,10),ce=parseInt(ke.borderRightWidth,10),ae=parseInt(ke.borderBottomWidth,10),Se=0,te=0,ue="offsetWidth"in W?W.offsetWidth-W.clientWidth-_e-ce:0,Oe="offsetHeight"in W?W.offsetHeight-W.clientHeight-de-ae:0;if(g===W)Se=b==="start"?H:b==="end"?H-M:b==="nearest"?R(x,x+M,M,de,ae,x+H,x+H+w,w):H-M/2,te=v==="start"?F:v==="center"?F-s/2:v==="end"?F-s:R(A,A+s,s,_e,ce,A+F,A+F+_,_),Se=Math.max(0,Se+x),te=Math.max(0,te+A);else{Se=b==="start"?H-ee-de:b==="end"?H-xe+ae+Oe:b==="nearest"?R(ee,xe,q,de,ae+Oe,H,H+w,w):H-(ee+q/2)+Oe/2,te=v==="start"?F-he-_e:v==="center"?F-(he+re/2)+ue/2:v==="end"?F-Ce+ce+ue:R(he,Ce,re,_e,ce+ue,F,F+_,_);var le=W.scrollLeft,Q=W.scrollTop;H+=Q-(Se=Math.max(0,Math.min(Q+Se,W.scrollHeight-q+Oe))),F+=le-(te=Math.max(0,Math.min(le+te,W.scrollWidth-re+ue)))}G.push({el:W,top:Se,left:te})}return G};function o(r){return r===Object(r)&&Object.keys(r).length!==0}function C(r,l){l===void 0&&(l="auto");var p="scrollBehavior"in document.body.style;r.forEach(function(f){var b=f.el,v=f.top,m=f.left;b.scroll&&p?b.scroll({top:v,left:m,behavior:l}):(b.scrollTop=v,b.scrollLeft=m)})}function c(r){return r===!1?{block:"end",inline:"nearest"}:o(r)?r:{block:"start",inline:"nearest"}}function a(r,l){var p=!r.ownerDocument.documentElement.contains(r);if(o(l)&&typeof l.behavior=="function")return l.behavior(p?[]:h(r,l));if(p)return;var f=c(l);return C(h(r,f),f.behavior)}var i=J.a=a},Zss7:function(I,J,P){var L;(function(u){var S=/^\s+/,R=/\s+$/,h=0,o=u.round,C=u.min,c=u.max,a=u.random;function i(ae,Se){if(ae=ae||"",Se=Se||{},ae instanceof i)return ae;if(!(this instanceof i))return new i(ae,Se);var te=r(ae);this._originalInput=ae,this._r=te.r,this._g=te.g,this._b=te.b,this._a=te.a,this._roundA=o(100*this._a)/100,this._format=Se.format||te.format,this._gradientType=Se.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=te.ok,this._tc_id=h++}i.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ae=this.toRgb();return(ae.r*299+ae.g*587+ae.b*114)/1e3},getLuminance:function(){var ae=this.toRgb(),Se,te,ue,Oe,le,Q;return Se=ae.r/255,te=ae.g/255,ue=ae.b/255,Se<=.03928?Oe=Se/12.92:Oe=u.pow((Se+.055)/1.055,2.4),te<=.03928?le=te/12.92:le=u.pow((te+.055)/1.055,2.4),ue<=.03928?Q=ue/12.92:Q=u.pow((ue+.055)/1.055,2.4),.2126*Oe+.7152*le+.0722*Q},setAlpha:function(ae){return this._a=G(ae),this._roundA=o(100*this._a)/100,this},toHsv:function(){var ae=b(this._r,this._g,this._b);return{h:ae.h*360,s:ae.s,v:ae.v,a:this._a}},toHsvString:function(){var ae=b(this._r,this._g,this._b),Se=o(ae.h*360),te=o(ae.s*100),ue=o(ae.v*100);return this._a==1?"hsv("+Se+", "+te+"%, "+ue+"%)":"hsva("+Se+", "+te+"%, "+ue+"%, "+this._roundA+")"},toHsl:function(){var ae=p(this._r,this._g,this._b);return{h:ae.h*360,s:ae.s,l:ae.l,a:this._a}},toHslString:function(){var ae=p(this._r,this._g,this._b),Se=o(ae.h*360),te=o(ae.s*100),ue=o(ae.l*100);return this._a==1?"hsl("+Se+", "+te+"%, "+ue+"%)":"hsla("+Se+", "+te+"%, "+ue+"%, "+this._roundA+")"},toHex:function(ae){return m(this._r,this._g,this._b,ae)},toHexString:function(ae){return"#"+this.toHex(ae)},toHex8:function(ae){return n(this._r,this._g,this._b,this._a,ae)},toHex8String:function(ae){return"#"+this.toHex8(ae)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(B(this._r,255)*100)+"%",g:o(B(this._g,255)*100)+"%",b:o(B(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+o(B(this._r,255)*100)+"%, "+o(B(this._g,255)*100)+"%, "+o(B(this._b,255)*100)+"%)":"rgba("+o(B(this._r,255)*100)+"%, "+o(B(this._g,255)*100)+"%, "+o(B(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:H[m(this._r,this._g,this._b,!0)]||!1},toFilter:function(ae){var Se="#"+d(this._r,this._g,this._b,this._a),te=Se,ue=this._gradientType?"GradientType = 1, ":"";if(ae){var Oe=i(ae);te="#"+d(Oe._r,Oe._g,Oe._b,Oe._a)}return"progid:DXImageTransform.Microsoft.gradient("+ue+"startColorstr="+Se+",endColorstr="+te+")"},toString:function(ae){var Se=!!ae;ae=ae||this._format;var te=!1,ue=this._a<1&&this._a>=0,Oe=!Se&&ue&&(ae==="hex"||ae==="hex6"||ae==="hex3"||ae==="hex4"||ae==="hex8"||ae==="name");return Oe?ae==="name"&&this._a===0?this.toName():this.toRgbString():(ae==="rgb"&&(te=this.toRgbString()),ae==="prgb"&&(te=this.toPercentageRgbString()),(ae==="hex"||ae==="hex6")&&(te=this.toHexString()),ae==="hex3"&&(te=this.toHexString(!0)),ae==="hex4"&&(te=this.toHex8String(!0)),ae==="hex8"&&(te=this.toHex8String()),ae==="name"&&(te=this.toName()),ae==="hsl"&&(te=this.toHslString()),ae==="hsv"&&(te=this.toHsvString()),te||this.toHexString())},clone:function(){return i(this.toString())},_applyModification:function(ae,Se){var te=ae.apply(null,[this].concat([].slice.call(Se)));return this._r=te._r,this._g=te._g,this._b=te._b,this.setAlpha(te._a),this},lighten:function(){return this._applyModification(s,arguments)},brighten:function(){return this._applyModification(M,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(T,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(ae,Se){return ae.apply(null,[this].concat([].slice.call(Se)))},analogous:function(){return this._applyCombination(j,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(N,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},i.fromRatio=function(ae,Se){if(typeof ae=="object"){var te={};for(var ue in ae)ae.hasOwnProperty(ue)&&(ue==="a"?te[ue]=ae[ue]:te[ue]=Ce(ae[ue]));ae=te}return i(ae,Se)};function r(ae){var Se={r:0,g:0,b:0},te=1,ue=null,Oe=null,le=null,Q=!1,Y=!1;return typeof ae=="string"&&(ae=de(ae)),typeof ae=="object"&&(_e(ae.r)&&_e(ae.g)&&_e(ae.b)?(Se=l(ae.r,ae.g,ae.b),Q=!0,Y=String(ae.r).substr(-1)==="%"?"prgb":"rgb"):_e(ae.h)&&_e(ae.s)&&_e(ae.v)?(ue=Ce(ae.s),Oe=Ce(ae.v),Se=v(ae.h,ue,Oe),Q=!0,Y="hsv"):_e(ae.h)&&_e(ae.s)&&_e(ae.l)&&(ue=Ce(ae.s),le=Ce(ae.l),Se=f(ae.h,ue,le),Q=!0,Y="hsl"),ae.hasOwnProperty("a")&&(te=ae.a)),te=G(te),{ok:Q,format:ae.format||Y,r:C(255,c(Se.r,0)),g:C(255,c(Se.g,0)),b:C(255,c(Se.b,0)),a:te}}function l(ae,Se,te){return{r:B(ae,255)*255,g:B(Se,255)*255,b:B(te,255)*255}}function p(ae,Se,te){ae=B(ae,255),Se=B(Se,255),te=B(te,255);var ue=c(ae,Se,te),Oe=C(ae,Se,te),le,Q,Y=(ue+Oe)/2;if(ue==Oe)le=Q=0;else{var Z=ue-Oe;Q=Y>.5?Z/(2-ue-Oe):Z/(ue+Oe);switch(ue){case ae:le=(Se-te)/Z+(Se<te?6:0);break;case Se:le=(te-ae)/Z+2;break;case te:le=(ae-Se)/Z+4;break}le/=6}return{h:le,s:Q,l:Y}}function f(ae,Se,te){var ue,Oe,le;ae=B(ae,360),Se=B(Se,100),te=B(te,100);function Q(be,ge,De){return De<0&&(De+=1),De>1&&(De-=1),De<1/6?be+(ge-be)*6*De:De<1/2?ge:De<2/3?be+(ge-be)*(2/3-De)*6:be}if(Se===0)ue=Oe=le=te;else{var Y=te<.5?te*(1+Se):te+Se-te*Se,Z=2*te-Y;ue=Q(Z,Y,ae+1/3),Oe=Q(Z,Y,ae),le=Q(Z,Y,ae-1/3)}return{r:ue*255,g:Oe*255,b:le*255}}function b(ae,Se,te){ae=B(ae,255),Se=B(Se,255),te=B(te,255);var ue=c(ae,Se,te),Oe=C(ae,Se,te),le,Q,Y=ue,Z=ue-Oe;if(Q=ue===0?0:Z/ue,ue==Oe)le=0;else{switch(ue){case ae:le=(Se-te)/Z+(Se<te?6:0);break;case Se:le=(te-ae)/Z+2;break;case te:le=(ae-Se)/Z+4;break}le/=6}return{h:le,s:Q,v:Y}}function v(ae,Se,te){ae=B(ae,360)*6,Se=B(Se,100),te=B(te,100);var ue=u.floor(ae),Oe=ae-ue,le=te*(1-Se),Q=te*(1-Oe*Se),Y=te*(1-(1-Oe)*Se),Z=ue%6,be=[te,Q,le,le,Y,te][Z],ge=[Y,te,te,Q,le,le][Z],De=[le,le,Y,te,te,Q][Z];return{r:be*255,g:ge*255,b:De*255}}function m(ae,Se,te,ue){var Oe=[ee(o(ae).toString(16)),ee(o(Se).toString(16)),ee(o(te).toString(16))];return ue&&Oe[0].charAt(0)==Oe[0].charAt(1)&&Oe[1].charAt(0)==Oe[1].charAt(1)&&Oe[2].charAt(0)==Oe[2].charAt(1)?Oe[0].charAt(0)+Oe[1].charAt(0)+Oe[2].charAt(0):Oe.join("")}function n(ae,Se,te,ue,Oe){var le=[ee(o(ae).toString(16)),ee(o(Se).toString(16)),ee(o(te).toString(16)),ee(xe(ue))];return Oe&&le[0].charAt(0)==le[0].charAt(1)&&le[1].charAt(0)==le[1].charAt(1)&&le[2].charAt(0)==le[2].charAt(1)&&le[3].charAt(0)==le[3].charAt(1)?le[0].charAt(0)+le[1].charAt(0)+le[2].charAt(0)+le[3].charAt(0):le.join("")}function d(ae,Se,te,ue){var Oe=[ee(xe(ue)),ee(o(ae).toString(16)),ee(o(Se).toString(16)),ee(o(te).toString(16))];return Oe.join("")}i.equals=function(ae,Se){return!ae||!Se?!1:i(ae).toRgbString()==i(Se).toRgbString()},i.random=function(){return i.fromRatio({r:a(),g:a(),b:a()})};function g(ae,Se){Se=Se===0?0:Se||10;var te=i(ae).toHsl();return te.s-=Se/100,te.s=W(te.s),i(te)}function T(ae,Se){Se=Se===0?0:Se||10;var te=i(ae).toHsl();return te.s+=Se/100,te.s=W(te.s),i(te)}function y(ae){return i(ae).desaturate(100)}function s(ae,Se){Se=Se===0?0:Se||10;var te=i(ae).toHsl();return te.l+=Se/100,te.l=W(te.l),i(te)}function M(ae,Se){Se=Se===0?0:Se||10;var te=i(ae).toRgb();return te.r=c(0,C(255,te.r-o(255*-(Se/100)))),te.g=c(0,C(255,te.g-o(255*-(Se/100)))),te.b=c(0,C(255,te.b-o(255*-(Se/100)))),i(te)}function A(ae,Se){Se=Se===0?0:Se||10;var te=i(ae).toHsl();return te.l-=Se/100,te.l=W(te.l),i(te)}function x(ae,Se){var te=i(ae).toHsl(),ue=(te.h+Se)%360;return te.h=ue<0?360+ue:ue,i(te)}function E(ae){var Se=i(ae).toHsl();return Se.h=(Se.h+180)%360,i(Se)}function w(ae){var Se=i(ae).toHsl(),te=Se.h;return[i(ae),i({h:(te+120)%360,s:Se.s,l:Se.l}),i({h:(te+240)%360,s:Se.s,l:Se.l})]}function _(ae){var Se=i(ae).toHsl(),te=Se.h;return[i(ae),i({h:(te+90)%360,s:Se.s,l:Se.l}),i({h:(te+180)%360,s:Se.s,l:Se.l}),i({h:(te+270)%360,s:Se.s,l:Se.l})]}function N(ae){var Se=i(ae).toHsl(),te=Se.h;return[i(ae),i({h:(te+72)%360,s:Se.s,l:Se.l}),i({h:(te+216)%360,s:Se.s,l:Se.l})]}function j(ae,Se,te){Se=Se||6,te=te||30;var ue=i(ae).toHsl(),Oe=360/te,le=[i(ae)];for(ue.h=(ue.h-(Oe*Se>>1)+720)%360;--Se;)ue.h=(ue.h+Oe)%360,le.push(i(ue));return le}function k(ae,Se){Se=Se||6;for(var te=i(ae).toHsv(),ue=te.h,Oe=te.s,le=te.v,Q=[],Y=1/Se;Se--;)Q.push(i({h:ue,s:Oe,v:le})),le=(le+Y)%1;return Q}i.mix=function(ae,Se,te){te=te===0?0:te||50;var ue=i(ae).toRgb(),Oe=i(Se).toRgb(),le=te/100,Q={r:(Oe.r-ue.r)*le+ue.r,g:(Oe.g-ue.g)*le+ue.g,b:(Oe.b-ue.b)*le+ue.b,a:(Oe.a-ue.a)*le+ue.a};return i(Q)},i.readability=function(ae,Se){var te=i(ae),ue=i(Se);return(u.max(te.getLuminance(),ue.getLuminance())+.05)/(u.min(te.getLuminance(),ue.getLuminance())+.05)},i.isReadable=function(ae,Se,te){var ue=i.readability(ae,Se),Oe,le;le=!1,Oe=ce(te);switch(Oe.level+Oe.size){case"AAsmall":case"AAAlarge":le=ue>=4.5;break;case"AAlarge":le=ue>=3;break;case"AAAsmall":le=ue>=7;break}return le},i.mostReadable=function(ae,Se,te){var ue=null,Oe=0,le,Q,Y,Z;te=te||{},Q=te.includeFallbackColors,Y=te.level,Z=te.size;for(var be=0;be<Se.length;be++)le=i.readability(ae,Se[be]),le>Oe&&(Oe=le,ue=i(Se[be]));return i.isReadable(ae,ue,{level:Y,size:Z})||!Q?ue:(te.includeFallbackColors=!1,i.mostReadable(ae,["#fff","#000"],te))};var z=i.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},H=i.hexNames=F(z);function F(ae){var Se={};for(var te in ae)ae.hasOwnProperty(te)&&(Se[ae[te]]=te);return Se}function G(ae){return ae=parseFloat(ae),(isNaN(ae)||ae<0||ae>1)&&(ae=1),ae}function B(ae,Se){q(ae)&&(ae="100%");var te=re(ae);return ae=C(Se,c(0,parseFloat(ae))),te&&(ae=parseInt(ae*Se,10)/100),u.abs(ae-Se)<1e-6?1:ae%Se/parseFloat(Se)}function W(ae){return C(1,c(0,ae))}function K(ae){return parseInt(ae,16)}function q(ae){return typeof ae=="string"&&ae.indexOf(".")!=-1&&parseFloat(ae)===1}function re(ae){return typeof ae=="string"&&ae.indexOf("%")!=-1}function ee(ae){return ae.length==1?"0"+ae:""+ae}function Ce(ae){return ae<=1&&(ae=ae*100+"%"),ae}function xe(ae){return u.round(parseFloat(ae)*255).toString(16)}function he(ae){return K(ae)/255}var ke=function(){var ae="[-\\+]?\\d+%?",Se="[-\\+]?\\d*\\.\\d+%?",te="(?:"+Se+")|(?:"+ae+")",ue="[\\s|\\(]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")\\s*\\)?",Oe="[\\s|\\(]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")\\s*\\)?";return{CSS_UNIT:new RegExp(te),rgb:new RegExp("rgb"+ue),rgba:new RegExp("rgba"+Oe),hsl:new RegExp("hsl"+ue),hsla:new RegExp("hsla"+Oe),hsv:new RegExp("hsv"+ue),hsva:new RegExp("hsva"+Oe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function _e(ae){return!!ke.CSS_UNIT.exec(ae)}function de(ae){ae=ae.replace(S,"").replace(R,"").toLowerCase();var Se=!1;if(z[ae])ae=z[ae],Se=!0;else if(ae=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var te;return(te=ke.rgb.exec(ae))?{r:te[1],g:te[2],b:te[3]}:(te=ke.rgba.exec(ae))?{r:te[1],g:te[2],b:te[3],a:te[4]}:(te=ke.hsl.exec(ae))?{h:te[1],s:te[2],l:te[3]}:(te=ke.hsla.exec(ae))?{h:te[1],s:te[2],l:te[3],a:te[4]}:(te=ke.hsv.exec(ae))?{h:te[1],s:te[2],v:te[3]}:(te=ke.hsva.exec(ae))?{h:te[1],s:te[2],v:te[3],a:te[4]}:(te=ke.hex8.exec(ae))?{r:K(te[1]),g:K(te[2]),b:K(te[3]),a:he(te[4]),format:Se?"name":"hex8"}:(te=ke.hex6.exec(ae))?{r:K(te[1]),g:K(te[2]),b:K(te[3]),format:Se?"name":"hex"}:(te=ke.hex4.exec(ae))?{r:K(te[1]+""+te[1]),g:K(te[2]+""+te[2]),b:K(te[3]+""+te[3]),a:he(te[4]+""+te[4]),format:Se?"name":"hex8"}:(te=ke.hex3.exec(ae))?{r:K(te[1]+""+te[1]),g:K(te[2]+""+te[2]),b:K(te[3]+""+te[3]),format:Se?"name":"hex"}:!1}function ce(ae){var Se,te;return ae=ae||{level:"AA",size:"small"},Se=(ae.level||"AA").toUpperCase(),te=(ae.size||"small").toLowerCase(),Se!=="AA"&&Se!=="AAA"&&(Se="AA"),te!=="small"&&te!=="large"&&(te="small"),{level:Se,size:te}}I.exports?I.exports=i:!(L=function(){return i}.call(J,P,J,I),L!==void 0&&(I.exports=L))})(Math)},aRTE:function(I,J){I.exports={L:1,M:0,Q:3,H:2}},bCnd:function(I,J,P){"use strict";P.d(J,"b",function(){return R}),P.d(J,"a",function(){return h});var L=P("je13"),u=P.n(L),S=!1;function R(o,C){var c=u.a.get("__ec");c||(c={}),c[o]=C,u.a.set("__ec",c)}function h(o,C){var c=u.a.get("__ec");return c?c[o]===void 0?C:c[o]:C}},bQjk:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return function(u){var S=L,R=S.lib,h=R.CipherParams,o=S.enc,C=o.Hex,c=S.format,a=c.Hex={stringify:function(i){return i.ciphertext.toString(C)},parse:function(i){var r=C.parse(i);return h.create({ciphertext:r})}}}(),L.format.Hex})},bT9E:function(I,J,P){"use strict";P.d(J,"a",function(){return u});var L=P("VTBJ");function u(S,R){var h=Object(L.a)({},S);return Array.isArray(R)&&R.forEach(function(o){delete h[o]}),h}},biw7:function(I,J,P){"use strict";var L=P("q1tI"),u=P.n(L),S=L.createContext(null);J.a=S},c5Ni:function(I,J,P){},cDPC:function(I,J,P){"use strict";var L=P("tJVT"),u=P("q1tI"),S=P.n(u),R=P("i3hx"),h=P.n(R);J.a=function(o){var C=o.defaultX,c=C===void 0?"40%":C,a=o.leftChild,i=o.rightChild,r=o.className,l=o.hideResize,p=l===void 0?!1:l,f=Object(u.useState)(c),b=Object(L.a)(f,2),v=b[0],m=b[1],n=Object(u.useRef)();function d(){n.current=!0}Object(u.useEffect)(function(){function y(M){n.current&&m(M.pageX)}function s(){n.current=!1}return window.addEventListener("mousemove",y),window.addEventListener("mouseup",s),function(){window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",s)}},[]);var g=typeof v=="number"&&v!==.01?"".concat(v,"px"):c,T="calc(100% - ".concat(p?"0px":"4px"," - ").concat(g,")");return S.a.createElement("div",{className:"split-panel-container ".concat(r)},S.a.createElement("section",{style:{width:g,display:v===.01?"none":""}},a),S.a.createElement("section",{className:"resize-x-bar",onMouseDown:d},S.a.createElement("a",{className:"btn-resize"},S.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},S.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"})))),S.a.createElement("section",{style:{width:T}},i))}},cv67:function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(u){var S=L,R=S.lib,h=R.WordArray,o=R.Hasher,C=S.algo,c=[];(function(){for(var f=0;f<64;f++)c[f]=u.abs(u.sin(f+1))*4294967296|0})();var a=C.MD5=o.extend({_doReset:function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(f,b){for(var v=0;v<16;v++){var m=b+v,n=f[m];f[m]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360}var d=this._hash.words,g=f[b+0],T=f[b+1],y=f[b+2],s=f[b+3],M=f[b+4],A=f[b+5],x=f[b+6],E=f[b+7],w=f[b+8],_=f[b+9],N=f[b+10],j=f[b+11],k=f[b+12],z=f[b+13],H=f[b+14],F=f[b+15],G=d[0],B=d[1],W=d[2],K=d[3];G=i(G,B,W,K,g,7,c[0]),K=i(K,G,B,W,T,12,c[1]),W=i(W,K,G,B,y,17,c[2]),B=i(B,W,K,G,s,22,c[3]),G=i(G,B,W,K,M,7,c[4]),K=i(K,G,B,W,A,12,c[5]),W=i(W,K,G,B,x,17,c[6]),B=i(B,W,K,G,E,22,c[7]),G=i(G,B,W,K,w,7,c[8]),K=i(K,G,B,W,_,12,c[9]),W=i(W,K,G,B,N,17,c[10]),B=i(B,W,K,G,j,22,c[11]),G=i(G,B,W,K,k,7,c[12]),K=i(K,G,B,W,z,12,c[13]),W=i(W,K,G,B,H,17,c[14]),B=i(B,W,K,G,F,22,c[15]),G=r(G,B,W,K,T,5,c[16]),K=r(K,G,B,W,x,9,c[17]),W=r(W,K,G,B,j,14,c[18]),B=r(B,W,K,G,g,20,c[19]),G=r(G,B,W,K,A,5,c[20]),K=r(K,G,B,W,N,9,c[21]),W=r(W,K,G,B,F,14,c[22]),B=r(B,W,K,G,M,20,c[23]),G=r(G,B,W,K,_,5,c[24]),K=r(K,G,B,W,H,9,c[25]),W=r(W,K,G,B,s,14,c[26]),B=r(B,W,K,G,w,20,c[27]),G=r(G,B,W,K,z,5,c[28]),K=r(K,G,B,W,y,9,c[29]),W=r(W,K,G,B,E,14,c[30]),B=r(B,W,K,G,k,20,c[31]),G=l(G,B,W,K,A,4,c[32]),K=l(K,G,B,W,w,11,c[33]),W=l(W,K,G,B,j,16,c[34]),B=l(B,W,K,G,H,23,c[35]),G=l(G,B,W,K,T,4,c[36]),K=l(K,G,B,W,M,11,c[37]),W=l(W,K,G,B,E,16,c[38]),B=l(B,W,K,G,N,23,c[39]),G=l(G,B,W,K,z,4,c[40]),K=l(K,G,B,W,g,11,c[41]),W=l(W,K,G,B,s,16,c[42]),B=l(B,W,K,G,x,23,c[43]),G=l(G,B,W,K,_,4,c[44]),K=l(K,G,B,W,k,11,c[45]),W=l(W,K,G,B,F,16,c[46]),B=l(B,W,K,G,y,23,c[47]),G=p(G,B,W,K,g,6,c[48]),K=p(K,G,B,W,E,10,c[49]),W=p(W,K,G,B,H,15,c[50]),B=p(B,W,K,G,A,21,c[51]),G=p(G,B,W,K,k,6,c[52]),K=p(K,G,B,W,s,10,c[53]),W=p(W,K,G,B,N,15,c[54]),B=p(B,W,K,G,T,21,c[55]),G=p(G,B,W,K,w,6,c[56]),K=p(K,G,B,W,F,10,c[57]),W=p(W,K,G,B,x,15,c[58]),B=p(B,W,K,G,z,21,c[59]),G=p(G,B,W,K,M,6,c[60]),K=p(K,G,B,W,j,10,c[61]),W=p(W,K,G,B,y,15,c[62]),B=p(B,W,K,G,_,21,c[63]),d[0]=d[0]+G|0,d[1]=d[1]+B|0,d[2]=d[2]+W|0,d[3]=d[3]+K|0},_doFinalize:function(){var f=this._data,b=f.words,v=this._nDataBytes*8,m=f.sigBytes*8;b[m>>>5]|=128<<24-m%32;var n=u.floor(v/4294967296),d=v;b[(m+64>>>9<<4)+15]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,b[(m+64>>>9<<4)+14]=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360,f.sigBytes=(b.length+1)*4,this._process();for(var g=this._hash,T=g.words,y=0;y<4;y++){var s=T[y];T[y]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}return g},clone:function(){var f=o.clone.call(this);return f._hash=this._hash.clone(),f}});function i(f,b,v,m,n,d,g){var T=f+(b&v|~b&m)+n+g;return(T<<d|T>>>32-d)+b}function r(f,b,v,m,n,d,g){var T=f+(b&m|v&~m)+n+g;return(T<<d|T>>>32-d)+b}function l(f,b,v,m,n,d,g){var T=f+(b^v^m)+n+g;return(T<<d|T>>>32-d)+b}function p(f,b,v,m,n,d,g){var T=f+(v^(b|~m))+n+g;return(T<<d|T>>>32-d)+b}S.MD5=o._createHelper(a),S.HmacMD5=o._createHmacHelper(a)}(Math),L.MD5})},dQei:function(I,J){for(var P={glog:function(u){if(u<1)throw new Error("glog("+u+")");return P.LOG_TABLE[u]},gexp:function(u){for(;u<0;)u+=255;for(;u>=256;)u-=255;return P.EXP_TABLE[u]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},L=0;L<8;L++)P.EXP_TABLE[L]=1<<L;for(var L=8;L<256;L++)P.EXP_TABLE[L]=P.EXP_TABLE[L-4]^P.EXP_TABLE[L-5]^P.EXP_TABLE[L-6]^P.EXP_TABLE[L-8];for(var L=0;L<255;L++)P.LOG_TABLE[P.EXP_TABLE[L]]=L;I.exports=P},dWSS:function(I,J,P){var L=P("dQei");function u(S,R){if(S.length==null)throw new Error(S.length+"/"+R);for(var h=0;h<S.length&&S[h]==0;)h++;this.num=new Array(S.length-h+R);for(var o=0;o<S.length-h;o++)this.num[o]=S[o+h]}u.prototype={get:function(S){return this.num[S]},getLength:function(){return this.num.length},multiply:function(S){for(var R=new Array(this.getLength()+S.getLength()-1),h=0;h<this.getLength();h++)for(var o=0;o<S.getLength();o++)R[h+o]^=L.gexp(L.glog(this.get(h))+L.glog(S.get(o)));return new u(R,0)},mod:function(S){if(this.getLength()-S.getLength()<0)return this;for(var R=L.glog(this.get(0))-L.glog(S.get(0)),h=new Array(this.getLength()),o=0;o<this.getLength();o++)h[o]=this.get(o);for(var o=0;o<S.getLength();o++)h[o]^=L.gexp(L.glog(S.get(o))+R);return new u(h,0).mod(S)}},I.exports=u},dejd:function(I,J,P){},dmUQ:function(I,J,P){"use strict";var L=P("Ff2n"),u=P("rePB"),S=P("1OyB"),R=P("vuIU"),h=P("Ji7U"),o=P("md7G"),C=P("foSv"),c=P("q1tI"),a=P.n(c),i=P("TSYQ"),r=P.n(i),l=P("4IlW");function p(w,_){var N=Object.keys(w);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(w);_&&(j=j.filter(function(k){return Object.getOwnPropertyDescriptor(w,k).enumerable})),N.push.apply(N,j)}return N}function f(w){for(var _=1;_<arguments.length;_++){var N=arguments[_]!=null?arguments[_]:{};_%2?p(Object(N),!0).forEach(function(j){Object(u.a)(w,j,N[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(N)):p(Object(N)).forEach(function(j){Object.defineProperty(w,j,Object.getOwnPropertyDescriptor(N,j))})}return w}function b(w){var _=v();return function(){var j=Object(C.a)(w),k;if(_){var z=Object(C.a)(this).constructor;k=Reflect.construct(j,arguments,z)}else k=j.apply(this,arguments);return Object(o.a)(this,k)}}function v(){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(w){return!1}}function m(){}function n(w){w.preventDefault()}var d=function(_){return _.replace(/[^\w.-]+/g,"")},g=200,T=600,y=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,s=function(_){return _!=null},M=function(_,N){return N===_||typeof N=="number"&&typeof _=="number"&&isNaN(N)&&isNaN(_)},A=function(w){Object(h.a)(N,w);var _=b(N);function N(j){var k;Object(S.a)(this,N),k=_.call(this,j),k.onKeyDown=function(F){var G=k.props,B=G.onKeyDown,W=G.onPressEnter;if(F.keyCode===l.a.UP){var K=k.getRatio(F);k.up(F,K,null),k.stop()}else if(F.keyCode===l.a.DOWN){var q=k.getRatio(F);k.down(F,q,null),k.stop()}else F.keyCode===l.a.ENTER&&W&&W(F);if(k.recordCursorPosition(),k.lastKeyCode=F.keyCode,B){for(var re=arguments.length,ee=new Array(re>1?re-1:0),Ce=1;Ce<re;Ce++)ee[Ce-1]=arguments[Ce];B.apply(void 0,[F].concat(ee))}},k.onKeyUp=function(F){var G=k.props.onKeyUp;if(k.stop(),k.recordCursorPosition(),G){for(var B=arguments.length,W=new Array(B>1?B-1:0),K=1;K<B;K++)W[K-1]=arguments[K];G.apply(void 0,[F].concat(W))}},k.onChange=function(F){var G=k.props.onChange;k.state.focused&&(k.inputting=!0),k.rawInput=k.props.parser(k.getValueFromEvent(F)),k.setState({inputValue:k.rawInput}),G(k.toNumber(k.rawInput))},k.onMouseUp=function(){var F=k.props.onMouseUp;k.recordCursorPosition(),F&&F.apply(void 0,arguments)},k.onFocus=function(){var F;k.setState({focused:!0}),(F=k.props).onFocus.apply(F,arguments)},k.onBlur=function(){var F=k.props.onBlur;k.inputting=!1,k.setState({focused:!1});var G=k.getCurrentValidValue(k.state.inputValue),B=k.setValue(G,m);if(F){var W=k.input.value,K=k.getInputDisplayValue({focus:!1,value:B});k.input.value=K&&Number(K),F.apply(void 0,arguments),k.input.value=W}},k.getRatio=function(F){var G=1;return F.metaKey||F.ctrlKey?G=.1:F.shiftKey&&(G=10),G},k.getFullNum=function(F){return isNaN(F)?F:/e/i.test(String(F))?Number(F).toFixed(18).replace(/\.?0+$/,""):F},k.getPrecision=function(F){if(s(k.props.precision))return k.props.precision;var G=String(F);if(G.indexOf("e-")>=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var B=0;return G.indexOf(".")>=0&&(B=G.length-G.indexOf(".")-1),B},k.getInputDisplayValue=function(F){var G=F||k.state,B=G.focused,W=G.inputValue,K=G.value,q;B?q=W:q=k.toPrecisionAsStep(K),q==null&&(q="");var re=k.formatWrapper(q);return s(k.props.decimalSeparator)&&(re=re.toString().replace(".",k.props.decimalSeparator)),re},k.recordCursorPosition=function(){try{k.cursorStart=k.input.selectionStart,k.cursorEnd=k.input.selectionEnd,k.currentValue=k.input.value,k.cursorBefore=k.input.value.substring(0,k.cursorStart),k.cursorAfter=k.input.value.substring(k.cursorEnd)}catch(F){}},k.restoreByAfter=function(F){if(F===void 0)return!1;var G=k.input.value,B=G.lastIndexOf(F);if(B===-1)return!1;var W=k.cursorBefore.length;return k.lastKeyCode===l.a.DELETE&&k.cursorBefore.charAt(W-1)===F[0]?(k.fixCaret(W,W),!0):B+F.length===G.length?(k.fixCaret(B,B),!0):!1},k.partRestoreByAfter=function(F){return F===void 0?!1:Array.prototype.some.call(F,function(G,B){var W=F.substring(B);return k.restoreByAfter(W)})},k.isNotCompleteNumber=function(F){return isNaN(F)||F===""||F===null||F&&F.toString().indexOf(".")===F.toString().length-1},k.stop=function(){k.autoStepTimer&&clearTimeout(k.autoStepTimer)},k.down=function(F,G,B){k.pressingUpOrDown=!0,k.step("down",F,G,B)},k.up=function(F,G,B){k.pressingUpOrDown=!0,k.step("up",F,G,B)},k.saveInput=function(F){k.input=F};var z=j.value;z===void 0&&(z=j.defaultValue),k.state={focused:j.autoFocus};var H=k.getValidValue(k.toNumber(z));return k.state=f(f({},k.state),{},{inputValue:k.toPrecisionAsStep(H),value:H}),k}return Object(R.a)(N,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(k){var z=this.props,H=z.value,F=z.onChange,G=z.max,B=z.min,W=this.state.focused;if(k){if(!M(k.value,H)||!M(k.max,G)||!M(k.min,B)){var K=W?H:this.getValidValue(H),q;this.pressingUpOrDown?q=K:this.inputting?q=this.rawInput:q=this.toPrecisionAsStep(K),this.setState({value:K,inputValue:q})}var re="value"in this.props?H:this.state.value;"max"in this.props&&k.max!==G&&typeof re=="number"&&re>G&&F&&F(G),"min"in this.props&&k.min!==B&&typeof re=="number"&&re<B&&F&&F(B)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===l.a.BACKSPACE?ee=this.cursorStart-1:this.lastKeyCode===l.a.DELETE&&(ee=this.cursorStart):ee=this.input.value.length,this.fixCaret(ee,ee)}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(Ce){}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(k){var z=k;return z===""?z="":this.isNotCompleteNumber(parseFloat(z))?z=this.state.value:z=this.getValidValue(z),this.toNumber(z)}},{key:"getValueFromEvent",value:function(k){var z=k.target.value.trim().replace(/。/g,".");return s(this.props.decimalSeparator)&&(z=z.replace(this.props.decimalSeparator,".")),z}},{key:"getValidValue",value:function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,F=parseFloat(k);return isNaN(F)?k:(F<z&&(F=z),F>H&&(F=H),F)}},{key:"setValue",value:function(k,z){var H=this.props.precision,F=this.isNotCompleteNumber(parseFloat(k))?null:parseFloat(k),G=this.state.value,B=G===void 0?null:G,W=this.state.inputValue,K=W===void 0?null:W,q=typeof F=="number"?F.toFixed(H):"".concat(F),re=F!==B||q!=="".concat(K);return"value"in this.props?(K=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:K},z)):this.setState({value:F,inputValue:this.toPrecisionAsStep(k)},z),re&&this.props.onChange(F),F}},{key:"getMaxPrecision",value:function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.props,F=H.precision,G=H.step;if(s(F))return F;var B=this.getPrecision(z),W=this.getPrecision(G),K=this.getPrecision(k);return k?Math.max(K,B+W):B+W}},{key:"getPrecisionFactor",value:function(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.getMaxPrecision(k,z);return Math.pow(10,H)}},{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(k){return this.props.formatter?this.props.formatter(k):k}},{key:"toPrecisionAsStep",value:function(k){if(this.isNotCompleteNumber(k)||k==="")return k;var z=Math.abs(this.getMaxPrecision(k));return isNaN(z)?k.toString():Number(k).toFixed(z)}},{key:"toNumber",value:function(k){var z=this.props.precision,H=this.state.focused,F=k&&k.length>16&&H;return this.isNotCompleteNumber(k)||F?k:s(z)?Math.round(k*Math.pow(10,z))/Math.pow(10,z):Number(k)}},{key:"upStep",value:function(k,z){var H=this.props.step,F=this.getPrecisionFactor(k,z),G=Math.abs(this.getMaxPrecision(k,z)),B=((F*k+F*H*z)/F).toFixed(G);return this.toNumber(B)}},{key:"downStep",value:function(k,z){var H=this.props.step,F=this.getPrecisionFactor(k,z),G=Math.abs(this.getMaxPrecision(k,z)),B=((F*k-F*H*z)/F).toFixed(G);return this.toNumber(B)}},{key:"step",value:function(k,z){var H=this,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),z&&(z.persist(),z.preventDefault());var B=this.props;if(B.disabled)return;var W=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(W))return;var K=this["".concat(k,"Step")](W,F),q=K>B.max||K<B.min;if(K>B.max?K=B.max:K<B.min&&(K=B.min),this.setValue(K,null),this.setState({focused:!0},function(){H.pressingUpOrDown=!1}),q)return;this.autoStepTimer=setTimeout(function(){H[k](z,F,!0)},G?g:T)}},{key:"fixCaret",value:function(k,z){if(k===void 0||z===void 0||!this.input||!this.input.value)return;try{var H=this.input.selectionStart,F=this.input.selectionEnd;(k!==H||z!==F)&&this.input.setSelectionRange(k,z)}catch(G){}}},{key:"render",value:function(){var k,z=this.props,H=z.prefixCls,F=z.disabled,G=z.readOnly,B=z.useTouch,W=z.autoComplete,K=z.upHandler,q=z.downHandler,re=z.className,ee=z.max,Ce=z.min,xe=z.style,he=z.title,ke=z.onMouseEnter,_e=z.onMouseLeave,de=z.onMouseOver,ce=z.onMouseOut,ae=z.required,Se=z.onClick,te=z.tabIndex,ue=z.type,Oe=z.placeholder,le=z.id,Q=z.inputMode,Y=z.pattern,Z=z.step,be=z.maxLength,ge=z.autoFocus,De=z.name,Qe=z.onPaste,Ze=z.onInput,nt=Object(L.a)(z,["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"]),tt=this.state,lt=tt.value,st=tt.focused,je=r()(H,(k={},Object(u.a)(k,re,!!re),Object(u.a)(k,"".concat(H,"-disabled"),F),Object(u.a)(k,"".concat(H,"-focused"),st),k)),Re={};Object.keys(nt).forEach(function(Pe){(Pe.substr(0,5)==="data-"||Pe.substr(0,5)==="aria-"||Pe==="role")&&(Re[Pe]=nt[Pe])});var et=!G&&!F,ct=this.getInputDisplayValue(null),$e=(lt||lt===0)&&(isNaN(lt)||Number(lt)>=ee),qe=(lt||lt===0)&&(isNaN(lt)||Number(lt)<=Ce),Ue=$e||F||G,Me=qe||F||G,Ie=r()("".concat(H,"-handler"),"".concat(H,"-handler-up"),Object(u.a)({},"".concat(H,"-handler-up-disabled"),Ue)),ye=r()("".concat(H,"-handler"),"".concat(H,"-handler-down"),Object(u.a)({},"".concat(H,"-handler-down-disabled"),Me)),Te=B?{onTouchStart:Ue?m:this.up,onTouchEnd:this.stop}:{onMouseDown:Ue?m:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ae=B?{onTouchStart:Me?m:this.down,onTouchEnd:this.stop}:{onMouseDown:Me?m:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return a.a.createElement("div",{className:je,style:xe,title:he,onMouseEnter:ke,onMouseLeave:_e,onMouseOver:de,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},a.a.createElement("div",{className:"".concat(H,"-handler-wrap")},a.a.createElement("span",Object.assign({unselectable:"on"},Te,{role:"button","aria-label":"Increase Value","aria-disabled":Ue,className:Ie}),K||a.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-up-inner"),onClick:n})),a.a.createElement("span",Object.assign({unselectable:"on"},Ae,{role:"button","aria-label":"Decrease Value","aria-disabled":Me,className:ye}),q||a.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-down-inner"),onClick:n}))),a.a.createElement("div",{className:"".concat(H,"-input-wrap")},a.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ce,"aria-valuemax":ee,"aria-valuenow":lt,required:ae,type:ue,placeholder:Oe,onPaste:Qe,onClick:Se,onMouseUp:this.onMouseUp,className:"".concat(H,"-input"),tabIndex:te,autoComplete:W,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:et?this.onKeyDown:m,onKeyUp:et?this.onKeyUp:m,autoFocus:ge,maxLength:be,readOnly:G,disabled:F,max:ee,min:Ce,step:Z,name:De,title:he,id:le,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ct),pattern:Y,inputMode:Q,onInput:Ze},Re))))}}]),N}(a.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:y,min:-y,step:1,style:{},onChange:m,onKeyDown:m,onPressEnter:m,onFocus:m,onBlur:m,parser:d,required:!1,autoComplete:"off"};var x=A,E=J.a=x},e7zE:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("3y9D"),P("WYAk"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.Base,h=S.WordArray,o=u.algo,C=o.SHA1,c=o.HMAC,a=o.PBKDF2=R.extend({cfg:R.extend({keySize:128/32,hasher:C,iterations:1}),init:function(i){this.cfg=this.cfg.extend(i)},compute:function(i,r){for(var l=this.cfg,p=c.create(l.hasher,i),f=h.create(),b=h.create([1]),v=f.words,m=b.words,n=l.keySize,d=l.iterations;v.length<n;){var g=p.update(r).finalize(b);p.reset();for(var T=g.words,y=T.length,s=g,M=1;M<d;M++){s=p.finalize(s),p.reset();for(var A=s.words,x=0;x<y;x++)T[x]^=A[x]}f.concat(g),m[0]++}return f.sigBytes=n*4,f}});u.PBKDF2=function(i,r,l){return a.create(l).compute(i,r)}}(),L.PBKDF2})},eRFJ:function(I,J,P){I.exports={header:"header___2DEfS",field:"field___2KFR1","oj-form-container":"oj-form-container___11-CJ","oj-left-panel":"oj-left-panel___2_COu","oj-form-info":"oj-form-info___3RmjJ",footer:"footer___13GF0",result:"result___2TPH2",passText:"passText___m4yU3",noPassText:"noPassText___bU8yW",pass:"pass___1qwzN",noPass:"noPass___35fR7","test-case-name":"test-case-name___JX6gg","btn-remove-case":"btn-remove-case___20q0s","icon-tag":"icon-tag___ahN2d",btn_back:"btn_back___2GR2u",testJi:"testJi___lY3ok",upBtn:"upBtn___14ov-","oj-problems":"oj-problems___3xexO",row:"row____2CFx",a:"a___1o_MZ",b:"b___2s_8T",inputTwo:"inputTwo___2QE50",inputOne:"inputOne___3VLjS",cusModal:"cusModal___3HaCu","oj-custom-large-spin":"oj-custom-large-spin___18Uw5",MdEditor:"MdEditor___2TQ6G"}},f4xo:function(I,J,P){var L=P("nVVt");function u(S){this.mode=L.MODE_8BIT_BYTE,this.data=S}u.prototype={getLength:function(S){return this.data.length},write:function(S){for(var R=0;R<this.data.length;R++)S.put(this.data.charCodeAt(R),8)}},I.exports=u},fcSX:function(I,J,P){"use strict";var L=P("Ff2n"),u=P("1OyB"),S=P("vuIU"),R=P("Ji7U"),h=P("md7G"),o=P("foSv"),C=P("1W/9"),c=P("q1tI"),a=P("rePB"),i=P("JX7q"),r=P("TSYQ"),l=P.n(r),p=P("qx4F"),f=P("4IlW");function b(F){return Array.isArray(F)?F:[F]}var v={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},m=Object.keys(v).filter(function(F){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return F in(G?G.style:{})})[0],n=v[m];function d(F,G,B,W){F.addEventListener?F.addEventListener(G,B,W):F.attachEvent&&F.attachEvent("on".concat(G),B)}function g(F,G,B,W){F.removeEventListener?F.removeEventListener(G,B,W):F.attachEvent&&F.detachEvent("on".concat(G),B)}function T(F,G){var B=typeof F=="function"?F(G):F;return Array.isArray(B)?B.length===2?B:[B[0],B[1]]:[B]}var y=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},s=!(typeof window!="undefined"&&window.document&&window.document.createElement),M=function F(G,B,W,K){if(!B||B===document||B instanceof Document)return!1;if(B===G.parentNode)return!0;var q=Math.max(Math.abs(W),Math.abs(K))===Math.abs(K),re=Math.max(Math.abs(W),Math.abs(K))===Math.abs(W),ee=B.scrollHeight-B.clientHeight,Ce=B.scrollWidth-B.clientWidth,xe=document.defaultView.getComputedStyle(B),he=xe.overflowY==="auto"||xe.overflowY==="scroll",ke=xe.overflowX==="auto"||xe.overflowX==="scroll",_e=ee&&he,de=Ce&&ke;return q&&(!_e||_e&&(B.scrollTop>=ee&&K<0||B.scrollTop<=0&&K>0))||re&&(!de||de&&(B.scrollLeft>=Ce&&W<0||B.scrollLeft<=0&&W>0))?F(G,B.parentNode,W,K):!1};function A(F){var G=x();return function(){var W=Object(o.a)(F),K;if(G){var q=Object(o.a)(this).constructor;K=Reflect.construct(W,arguments,q)}else K=W.apply(this,arguments);return Object(h.a)(this,K)}}function x(){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(F){return!1}}var E={},w=function(F){Object(R.a)(B,F);var G=A(B);function B(W){var K;return Object(u.a)(this,B),K=G.call(this,W),K.domFocus=function(){K.dom&&K.dom.focus()},K.removeStartHandler=function(q){if(q.touches.length>1)return;K.startPos={x:q.touches[0].clientX,y:q.touches[0].clientY}},K.removeMoveHandler=function(q){if(q.changedTouches.length>1)return;var re=q.currentTarget,ee=q.changedTouches[0].clientX-K.startPos.x,Ce=q.changedTouches[0].clientY-K.startPos.y;(re===K.maskDom||re===K.handlerDom||re===K.contentDom&&M(re,q.target,ee,Ce))&&q.cancelable&&q.preventDefault()},K.transitionEnd=function(q){var re=q.target;g(re,n,K.transitionEnd),re.style.transition=""},K.onKeyDown=function(q){if(q.keyCode===f.a.ESC){var re=K.props.onClose;q.stopPropagation(),re&&re(q)}},K.onWrapperTransitionEnd=function(q){var re=K.props,ee=re.open,Ce=re.afterVisibleChange;q.target===K.contentWrapper&&q.propertyName.match(/transform$/)&&(K.dom.style.transition="",!ee&&K.getCurrentDrawerSome()&&(document.body.style.overflowX="",K.maskDom&&(K.maskDom.style.left="",K.maskDom.style.width="")),Ce&&Ce(!!ee))},K.openLevelTransition=function(){var q=K.props,re=q.open,ee=q.width,Ce=q.height,xe=K.getHorizontalBoolAndPlacementName(),he=xe.isHorizontal,ke=xe.placementName,_e=K.contentDom?K.contentDom.getBoundingClientRect()[he?"width":"height"]:0,de=(he?ee:Ce)||_e;K.setLevelAndScrolling(re,ke,de)},K.setLevelTransform=function(q,re,ee,Ce){var xe=K.props,he=xe.placement,ke=xe.levelMove,_e=xe.duration,de=xe.ease,ce=xe.showMask;K.levelDom.forEach(function(ae){ae.style.transition="transform ".concat(_e," ").concat(de),d(ae,n,K.transitionEnd);var Se=q?ee:0;if(ke){var te=T(ke,{target:ae,open:q});Se=q?te[0]:te[1]||0}var ue=typeof Se=="number"?"".concat(Se,"px"):Se,Oe=he==="left"||he==="top"?ue:"-".concat(ue);Oe=ce&&he==="right"&&Ce?"calc(".concat(Oe," + ").concat(Ce,"px)"):Oe,ae.style.transform=Se?"".concat(re,"(").concat(Oe,")"):""})},K.setLevelAndScrolling=function(q,re,ee){var Ce=K.props.onChange;if(!s){var xe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(p.a)(!0):0;K.setLevelTransform(q,re,ee,xe),K.toggleScrollingToDrawerAndBody(xe)}Ce&&Ce(q)},K.toggleScrollingToDrawerAndBody=function(q){var re=K.props,ee=re.getOpenCount,Ce=re.getContainer,xe=re.showMask,he=re.open,ke=Ce&&Ce(),_e=ee&&ee();if(ke&&ke.parentNode===document.body&&xe){var de=["touchstart"],ce=[document.body,K.maskDom,K.handlerDom,K.contentDom];he&&document.body.style.overflow!=="hidden"?(q&&K.addScrollingEffect(q),_e===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ce.forEach(function(ae,Se){if(!ae)return;d(ae,de[Se]||"touchmove",Se?K.removeMoveHandler:K.removeStartHandler,K.passive)})):K.getCurrentDrawerSome()&&(_e||(document.body.style.overflow=""),document.body.style.touchAction="",q&&K.remScrollingEffect(q),ce.forEach(function(ae,Se){if(!ae)return;g(ae,de[Se]||"touchmove",Se?K.removeMoveHandler:K.removeStartHandler,K.passive)}))}},K.addScrollingEffect=function(q){var re=K.props,ee=re.placement,Ce=re.duration,xe=re.ease,he=re.getOpenCount,ke=re.switchScrollingEffect,_e=he&&he();_e===1&&ke();var de="width ".concat(Ce," ").concat(xe),ce="transform ".concat(Ce," ").concat(xe);K.dom.style.transition="none";switch(ee){case"right":K.dom.style.transform="translateX(-".concat(q,"px)");break;case"top":case"bottom":K.dom.style.width="calc(100% - ".concat(q,"px)"),K.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(K.timeout),K.timeout=setTimeout(function(){K.dom&&(K.dom.style.transition="".concat(ce,",").concat(de),K.dom.style.width="",K.dom.style.transform="")})},K.remScrollingEffect=function(q){var re=K.props,ee=re.placement,Ce=re.duration,xe=re.ease,he=re.getOpenCount,ke=re.switchScrollingEffect,_e=he&&he();_e||ke(!0),m&&(document.body.style.overflowX="hidden"),K.dom.style.transition="none";var de,ce="width ".concat(Ce," ").concat(xe),ae="transform ".concat(Ce," ").concat(xe);switch(ee){case"left":{K.dom.style.width="100%",ce="width 0s ".concat(xe," ").concat(Ce);break}case"right":{K.dom.style.transform="translateX(".concat(q,"px)"),K.dom.style.width="100%",ce="width 0s ".concat(xe," ").concat(Ce),K.maskDom&&(K.maskDom.style.left="-".concat(q,"px"),K.maskDom.style.width="calc(100% + ".concat(q,"px)"));break}case"top":case"bottom":{K.dom.style.width="calc(100% + ".concat(q,"px)"),K.dom.style.height="100%",K.dom.style.transform="translateZ(0)",de="height 0s ".concat(xe," ").concat(Ce);break}default:break}clearTimeout(K.timeout),K.timeout=setTimeout(function(){K.dom&&(K.dom.style.transition="".concat(ae,",").concat(de?"".concat(de,","):"").concat(ce),K.dom.style.transform="",K.dom.style.width="",K.dom.style.height="")})},K.getCurrentDrawerSome=function(){return!Object.keys(E).some(function(q){return E[q]})},K.getLevelDom=function(q){var re=q.level,ee=q.getContainer;if(s)return;var Ce=ee&&ee(),xe=Ce?Ce.parentNode:null;if(K.levelDom=[],re==="all"){var he=xe?Array.prototype.slice.call(xe.children):[];he.forEach(function(ke){ke.nodeName!=="SCRIPT"&&ke.nodeName!=="STYLE"&&ke.nodeName!=="LINK"&&ke!==Ce&&K.levelDom.push(ke)})}else re&&b(re).forEach(function(ke){document.querySelectorAll(ke).forEach(function(_e){K.levelDom.push(_e)})})},K.getHorizontalBoolAndPlacementName=function(){var q=K.props.placement,re=q==="left"||q==="right",ee="translate".concat(re?"X":"Y");return{isHorizontal:re,placementName:ee}},K.state={_self:Object(i.a)(K)},K}return Object(S.a)(B,[{key:"componentDidMount",value:function(){var K=this;if(!s){var q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return q=!0,null}}))}catch(he){}this.passive=q?{passive:!1}:!1}var re=this.props,ee=re.open,Ce=re.getContainer,xe=Ce&&Ce();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ee&&(xe&&xe.parentNode===document.body&&(E[this.drawerId]=ee),this.openLevelTransition(),this.forceUpdate(function(){K.domFocus()}))}},{key:"componentDidUpdate",value:function(K){var q=this.props,re=q.open,ee=q.getContainer,Ce=ee&&ee();re!==K.open&&(re&&this.domFocus(),Ce&&Ce.parentNode===document.body&&(E[this.drawerId]=!!re),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var K=this.props,q=K.getOpenCount,re=K.open,ee=K.switchScrollingEffect,Ce=typeof q=="function"&&q();delete E[this.drawerId],re&&(this.setLevelTransform(!1),document.body.style.touchAction=""),Ce||(document.body.style.overflow="",ee(!0))}},{key:"render",value:function(){var K,q=this,re=this.props,ee=re.className,Ce=re.children,xe=re.style,he=re.width,ke=re.height,_e=re.defaultOpen,de=re.open,ce=re.prefixCls,ae=re.placement,Se=re.level,te=re.levelMove,ue=re.ease,Oe=re.duration,le=re.getContainer,Q=re.handler,Y=re.onChange,Z=re.afterVisibleChange,be=re.showMask,ge=re.maskClosable,De=re.maskStyle,Qe=re.onClose,Ze=re.onHandleClick,nt=re.keyboard,tt=re.getOpenCount,lt=re.switchScrollingEffect,st=Object(L.a)(re,["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"]),je=this.dom?de:!1,Re=l()(ce,(K={},Object(a.a)(K,"".concat(ce,"-").concat(ae),!0),Object(a.a)(K,"".concat(ce,"-open"),je),Object(a.a)(K,ee||"",!!ee),Object(a.a)(K,"no-mask",!be),K)),et=this.getHorizontalBoolAndPlacementName(),ct=et.placementName,$e=ae==="left"||ae==="top"?"-100%":"100%",qe=je?"":"".concat(ct,"(").concat($e,")"),Ue=Q&&c.cloneElement(Q,{onClick:function(Ie){Q.props.onClick&&Q.props.onClick(),Ze&&Ze(Ie)},ref:function(Ie){q.handlerDom=Ie}});return c.createElement("div",Object.assign({},st,{tabIndex:-1,className:Re,style:xe,ref:function(Ie){q.dom=Ie},onKeyDown:je&&nt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),be&&c.createElement("div",{className:"".concat(ce,"-mask"),onClick:ge?Qe:void 0,style:De,ref:function(Ie){q.maskDom=Ie}}),c.createElement("div",{className:"".concat(ce,"-content-wrapper"),style:{transform:qe,msTransform:qe,width:y(he)?"".concat(he,"px"):he,height:y(ke)?"".concat(ke,"px"):ke},ref:function(Ie){q.contentWrapper=Ie}},c.createElement("div",{className:"".concat(ce,"-content"),ref:function(Ie){q.contentDom=Ie},onTouchStart:je&&be?this.removeStartHandler:void 0,onTouchMove:je&&be?this.removeMoveHandler:void 0},Ce),Ue))}}],[{key:"getDerivedStateFromProps",value:function(K,q){var re=q.prevProps,ee=q._self,Ce={prevProps:K};if(re!==void 0){var xe=K.placement,he=K.level;xe!==re.placement&&(ee.contentDom=null),he!==re.level&&ee.getLevelDom(K)}return Ce}}]),B}(c.Component);w.defaultProps={switchScrollingEffect:function(){}};var _=w;function N(F){var G=j();return function(){var W=Object(o.a)(F),K;if(G){var q=Object(o.a)(this).constructor;K=Reflect.construct(W,arguments,q)}else K=W.apply(this,arguments);return Object(h.a)(this,K)}}function j(){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(F){return!1}}var k=function(F){Object(R.a)(B,F);var G=N(B);function B(W){var K;Object(u.a)(this,B),K=G.call(this,W),K.onHandleClick=function(re){var ee=K.props,Ce=ee.onHandleClick,xe=ee.open;if(Ce&&Ce(re),typeof xe=="undefined"){var he=K.state.open;K.setState({open:!he})}},K.onClose=function(re){var ee=K.props,Ce=ee.onClose,xe=ee.open;Ce&&Ce(re),typeof xe=="undefined"&&K.setState({open:!1})};var q=typeof W.open!="undefined"?W.open:!!W.defaultOpen;return K.state={open:q},"onMaskClick"in W&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),K}return Object(S.a)(B,[{key:"render",value:function(){var K=this,q=this.props,re=q.defaultOpen,ee=q.getContainer,Ce=q.wrapperClassName,xe=q.forceRender,he=q.handler,ke=Object(L.a)(q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),_e=this.state.open;if(!ee)return c.createElement("div",{className:Ce,ref:function(ae){K.dom=ae}},c.createElement(_,Object.assign({},ke,{open:_e,handler:he,getContainer:function(){return K.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var de=!!he||xe;return c.createElement(C.a,{visible:_e,forceRender:de,getContainer:ee,wrapperClassName:Ce},function(ce){var ae=ce.visible,Se=ce.afterClose,te=Object(L.a)(ce,["visible","afterClose"]);return c.createElement(_,Object.assign({},ke,te,{open:ae!==void 0?ae:_e,afterVisibleChange:Se!==void 0?Se:ke.afterVisibleChange,handler:he,onClose:K.onClose,onHandleClick:K.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(K,q){var re=q.prevProps,ee={prevProps:K};return typeof re!="undefined"&&K.open!==re.open&&(ee.open=K.open),ee}}]),B}(c.Component);k.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 z=k,H=J.a=z},fyJ8:function(I,J,P){"use strict";var L=P("rePB"),u=P("VTBJ"),S=P("Ff2n"),R=P("U8pU"),h=P("q1tI"),o=P.n(h),C=P("TSYQ"),c=P.n(C),a=P("c+Xe"),i=P("sR1s");function r(v){return v&&Object(R.a)(v)==="object"&&!Array.isArray(v)&&!h.isValidElement(v)}function l(v){return typeof v=="string"?!0:Object(a.c)(v)}function p(v,m){var n,d=v.prefixCls,g=v.className,T=v.record,y=v.index,s=v.dataIndex,M=v.render,A=v.children,x=v.component,E=x===void 0?"td":x,w=v.colSpan,_=v.rowSpan,N=v.fixLeft,j=v.fixRight,k=v.firstFixLeft,z=v.lastFixLeft,H=v.firstFixRight,F=v.lastFixRight,G=v.appendNode,B=v.additionalProps,W=B===void 0?{}:B,K=v.ellipsis,q=v.align,re=v.rowType,ee=v.isSticky,Ce="".concat(d,"-cell"),xe,he;if(A)he=A;else{var ke=Object(i.b)(T,s);if(he=ke,M){var _e=M(ke,T,y);r(_e)?(he=_e.children,xe=_e.props):he=_e}}Object(R.a)(he)==="object"&&!Array.isArray(he)&&!h.isValidElement(he)&&(he=null),K&&(z||H)&&(he=h.createElement("span",{className:"".concat(Ce,"-content")},he));var de=xe||{},ce=de.colSpan,ae=de.rowSpan,Se=de.style,te=de.className,ue=Object(S.a)(de,["colSpan","rowSpan","style","className"]),Oe=ce!==void 0?ce:w,le=ae!==void 0?ae:_;if(Oe===0||le===0)return null;var Q={},Y=typeof N=="number",Z=typeof j=="number";Y&&(Q.position="sticky",Q.left=N),Z&&(Q.position="sticky",Q.right=j);var be={};q&&(be.textAlign=q);var ge,De=K===!0?{showTitle:!0}:K;De&&(De.showTitle||re==="header")&&(typeof he=="string"||typeof he=="number"?ge=he.toString():h.isValidElement(he)&&typeof he.props.children=="string"&&(ge=he.props.children));var Qe=Object(u.a)(Object(u.a)(Object(u.a)({title:ge},ue),W),{},{colSpan:Oe&&Oe!==1?Oe:null,rowSpan:le&&le!==1?le:null,className:c()(Ce,g,(n={},Object(L.a)(n,"".concat(Ce,"-fix-left"),Y),Object(L.a)(n,"".concat(Ce,"-fix-left-first"),k),Object(L.a)(n,"".concat(Ce,"-fix-left-last"),z),Object(L.a)(n,"".concat(Ce,"-fix-right"),Z),Object(L.a)(n,"".concat(Ce,"-fix-right-first"),H),Object(L.a)(n,"".concat(Ce,"-fix-right-last"),F),Object(L.a)(n,"".concat(Ce,"-ellipsis"),K),Object(L.a)(n,"".concat(Ce,"-with-append"),G),Object(L.a)(n,"".concat(Ce,"-fix-sticky"),(Y||Z)&&ee),n),W.className,te),style:Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)({},W.style),be),Q),Se),ref:l(E)?m:null});return h.createElement(E,Object.assign({},Qe),G,he)}var f=h.forwardRef(p);f.displayName="Cell";var b=h.memo(f,function(v,m){return m.shouldCellUpdate?!m.shouldCellUpdate(m.record,v.record):!1});J.a=b},gRFJ:function(I,J,P){I.exports=[P("rdUC"),P("ynwM"),P("RELg"),P("DlR+"),P("CrYA"),P("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(I){return I<10?"0"+I:I}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(I){return rx_escapable.lastIndex=0,rx_escapable.test(I)?'"'+I.replace(rx_escapable,function(J){var P=meta[J];return typeof P=="string"?P:"\\u"+("0000"+J.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+I+'"'}function str(I,J){var P,L,u,S,R=gap,h,o=J[I];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(I)),typeof rep=="function"&&(o=rep.call(J,I,o));switch(typeof o){case"string":return quote(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(gap+=indent,h=[],Object.prototype.toString.apply(o)==="[object Array]"){for(S=o.length,P=0;P<S;P+=1)h[P]=str(P,o)||"null";return u=h.length===0?"[]":gap?`[
|
|
|
`+gap+h.join(`,
|
|
|
`+gap)+`
|
|
|
`+R+"]":"["+h.join(",")+"]",gap=R,u}if(rep&&typeof rep=="object")for(S=rep.length,P=0;P<S;P+=1)typeof rep[P]=="string"&&(L=rep[P],u=str(L,o),u&&h.push(quote(L)+(gap?": ":":")+u));else for(L in o)Object.prototype.hasOwnProperty.call(o,L)&&(u=str(L,o),u&&h.push(quote(L)+(gap?": ":":")+u));return u=h.length===0?"{}":gap?`{
|
|
|
`+gap+h.join(`,
|
|
|
`+gap)+`
|
|
|
`+R+"}":"{"+h.join(",")+"}",gap=R,u}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(I,J,P){var L;if(gap="",indent="",typeof P=="number")for(L=0;L<P;L+=1)indent+=" ";else typeof P=="string"&&(indent=P);if(rep=J,J&&typeof J!="function"&&(typeof J!="object"||typeof J.length!="number"))throw new Error("JSON.stringify");return str("",{"":I})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(I,J){var P,L,u=I[J];if(u&&typeof u=="object")for(P in u)Object.prototype.hasOwnProperty.call(u,P)&&(L=walk(u,P),L!==void 0?u[P]=L:delete u[P]);return reviver.call(I,J,u)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(I){return"\\u"+("0000"+I.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")})}()},"gb/T":function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.mode.ECB=function(){var u=L.lib.BlockCipherMode.extend();return u.Encryptor=u.extend({processBlock:function(S,R){this._cipher.encryptBlock(S,R)}}),u.Decryptor=u.extend({processBlock:function(S,R){this._cipher.decryptBlock(S,R)}}),u}(),L.mode.ECB})},h78n:function(I,J,P){"use strict";P.d(J,"a",function(){return k});var L=P("q1tI"),u=P.n(L),S=P("TSYQ"),R=P.n(S),h={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},o=function(F){var G=F.map(function(){return Object(L.useRef)()}),B=Object(L.useRef)();return Object(L.useEffect)(function(){var W=Date.now(),K=!1;Object.keys(G).forEach(function(q){var re=G[q].current;if(!re)return;K=!0;var ee=re.style;ee.transitionDuration=".3s, .3s, .3s, .06s",B.current&&W-B.current<100&&(ee.transitionDuration="0s, 0s")}),K&&(B.current=Date.now())}),[G]};function C(){return C=Object.assign||function(H){for(var F=1;F<arguments.length;F++){var G=arguments[F];for(var B in G)Object.prototype.hasOwnProperty.call(G,B)&&(H[B]=G[B])}return H},C.apply(this,arguments)}function c(H,F){return p(H)||l(H,F)||i(H,F)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(H,F){if(!H)return;if(typeof H=="string")return r(H,F);var G=Object.prototype.toString.call(H).slice(8,-1);if(G==="Object"&&H.constructor&&(G=H.constructor.name),G==="Map"||G==="Set")return Array.from(H);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return r(H,F)}function r(H,F){(F==null||F>H.length)&&(F=H.length);for(var G=0,B=new Array(F);G<F;G++)B[G]=H[G];return B}function l(H,F){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(H)))return;var G=[],B=!0,W=!1,K=void 0;try{for(var q=H[Symbol.iterator](),re;!(B=(re=q.next()).done)&&!(G.push(re.value),F&&G.length===F);B=!0);}catch(ee){W=!0,K=ee}finally{try{!B&&q.return!=null&&q.return()}finally{if(W)throw K}}return G}function p(H){if(Array.isArray(H))return H}function f(H,F){if(H==null)return{};var G=b(H,F),B,W;if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(H);for(W=0;W<K.length;W++){if(B=K[W],F.indexOf(B)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(H,B))continue;G[B]=H[B]}}return G}function b(H,F){if(H==null)return{};var G={},B=Object.keys(H),W,K;for(K=0;K<B.length;K++){if(W=B[K],F.indexOf(W)>=0)continue;G[W]=H[W]}return G}var v=function(F){var G=F.className,B=F.percent,W=F.prefixCls,K=F.strokeColor,q=F.strokeLinecap,re=F.strokeWidth,ee=F.style,Ce=F.trailColor,xe=F.trailWidth,he=F.transition,ke=f(F,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ke.gapPosition;var _e=Array.isArray(B)?B:[B],de=Array.isArray(K)?K:[K],ce=o(_e),ae=c(ce,1),Se=ae[0],te=re/2,ue=100-re/2,Oe="M ".concat(q==="round"?te:0,",").concat(te,`
|
|
|
L `).concat(q==="round"?ue:100,",").concat(te),le="0 0 100 ".concat(re),Q=0;return u.a.createElement("svg",C({className:R()("".concat(W,"-line"),G),viewBox:le,preserveAspectRatio:"none",style:ee},ke),u.a.createElement("path",{className:"".concat(W,"-line-trail"),d:Oe,strokeLinecap:q,stroke:Ce,strokeWidth:xe||re,fillOpacity:"0"}),_e.map(function(Y,Z){var be={strokeDasharray:"".concat(Y,"px, 100px"),strokeDashoffset:"-".concat(Q,"px"),transition:he||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ge=de[Z]||de[de.length-1];return Q+=Y,u.a.createElement("path",{key:Z,className:"".concat(W,"-line-path"),d:Oe,strokeLinecap:q,stroke:ge,strokeWidth:re,fillOpacity:"0",ref:Se[Z],style:be})}))};v.defaultProps=h;var m=v;function n(){return n=Object.assign||function(H){for(var F=1;F<arguments.length;F++){var G=arguments[F];for(var B in G)Object.prototype.hasOwnProperty.call(G,B)&&(H[B]=G[B])}return H},n.apply(this,arguments)}function d(H,F){return M(H)||s(H,F)||T(H,F)||g()}function g(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(H,F){if(!H)return;if(typeof H=="string")return y(H,F);var G=Object.prototype.toString.call(H).slice(8,-1);if(G==="Object"&&H.constructor&&(G=H.constructor.name),G==="Map"||G==="Set")return Array.from(H);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return y(H,F)}function y(H,F){(F==null||F>H.length)&&(F=H.length);for(var G=0,B=new Array(F);G<F;G++)B[G]=H[G];return B}function s(H,F){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(H)))return;var G=[],B=!0,W=!1,K=void 0;try{for(var q=H[Symbol.iterator](),re;!(B=(re=q.next()).done)&&!(G.push(re.value),F&&G.length===F);B=!0);}catch(ee){W=!0,K=ee}finally{try{!B&&q.return!=null&&q.return()}finally{if(W)throw K}}return G}function M(H){if(Array.isArray(H))return H}function A(H,F){if(H==null)return{};var G=x(H,F),B,W;if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(H);for(W=0;W<K.length;W++){if(B=K[W],F.indexOf(B)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(H,B))continue;G[B]=H[B]}}return G}function x(H,F){if(H==null)return{};var G={},B=Object.keys(H),W,K;for(K=0;K<B.length;K++){if(W=B[K],F.indexOf(W)>=0)continue;G[W]=H[W]}return G}var E=0;function w(H){return+H.replace("%","")}function _(H){return Array.isArray(H)?H:[H]}function N(H,F,G,B){var W=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,K=arguments.length>5?arguments[5]:void 0,q=50-B/2,re=0,ee=-q,Ce=0,xe=-2*q;switch(K){case"left":re=-q,ee=0,Ce=2*q,xe=0;break;case"right":re=q,ee=0,Ce=-2*q,xe=0;break;case"bottom":ee=q,xe=2*q;break;default:}var he="M 50,50 m ".concat(re,",").concat(ee,`
|
|
|
a `).concat(q,",").concat(q," 0 1 1 ").concat(Ce,",").concat(-xe,`
|
|
|
a `).concat(q,",").concat(q," 0 1 1 ").concat(-Ce,",").concat(xe),ke=Math.PI*2*q,_e={stroke:G,strokeDasharray:"".concat(F/100*(ke-W),"px ").concat(ke,"px"),strokeDashoffset:"-".concat(W/2+H/100*(ke-W),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:he,pathStyle:_e}}var j=function(F){var G=F.prefixCls,B=F.strokeWidth,W=F.trailWidth,K=F.gapDegree,q=F.gapPosition,re=F.trailColor,ee=F.strokeLinecap,Ce=F.style,xe=F.className,he=F.strokeColor,ke=F.percent,_e=A(F,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),de=Object(L.useMemo)(function(){return E+=1,E},[]),ce=N(0,100,re,B,K,q),ae=ce.pathString,Se=ce.pathStyle,te=_(ke),ue=_(he),Oe=ue.find(function(be){return Object.prototype.toString.call(be)==="[object Object]"}),le=o(te),Q=d(le,1),Y=Q[0],Z=function(){var ge=0;return te.map(function(De,Qe){var Ze=ue[Qe]||ue[ue.length-1],nt=Object.prototype.toString.call(Ze)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(de,")"):"",tt=N(ge,De,Ze,B,K,q);return ge+=De,u.a.createElement("path",{key:Qe,className:"".concat(G,"-circle-path"),d:tt.pathString,stroke:nt,strokeLinecap:ee,strokeWidth:B,opacity:De===0?0:1,fillOpacity:"0",style:tt.pathStyle,ref:Y[Qe]})})};return u.a.createElement("svg",n({className:R()("".concat(G,"-circle"),xe),viewBox:"0 0 100 100",style:Ce},_e),Oe&&u.a.createElement("defs",null,u.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(de),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Oe).sort(function(be,ge){return w(be)-w(ge)}).map(function(be,ge){return u.a.createElement("stop",{key:ge,offset:be,stopColor:Oe[be]})}))),u.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:ae,stroke:re,strokeLinecap:ee,strokeWidth:W||B,fillOpacity:"0",style:Se}),Z().reverse())};j.defaultProps=h;var k=j,z={Line:m,Circle:k}},hW8S:function(I,J,P){"use strict";P.d(J,"a",function(){return R}),P.d(J,"c",function(){return h}),P.d(J,"b",function(){return o});var L=P("VTBJ"),u=P("Ff2n"),S=P("Kwbf"),R="RC_TABLE_INTERNAL_COL_DEFINE";function h(C){var c=C.expandable,a=Object(u.a)(C,["expandable"]);return"expandable"in C?Object(L.a)(Object(L.a)({},a),c):a}function o(C){return Object.keys(C).reduce(function(c,a){return(a.substr(0,5)==="data-"||a.substr(0,5)==="aria-")&&(c[a]=C[a]),c},{})}},i3hx:function(I,J,P){},jO9C:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.pad.Iso97971={pad:function(u,S){u.concat(L.lib.WordArray.create([2147483648],1)),L.pad.ZeroPadding.pad(u,S)},unpad:function(u){L.pad.ZeroPadding.unpad(u),u.sigBytes--}},L.pad.Iso97971})},je13:function(I,J,P){var L=P("5nXd"),u=P("gRFJ"),S=[P("uQRt")];I.exports=L.createStore(u,S)},k3GJ:function(I,J,P){"use strict";P.d(J,"a",function(){return Dn});var L=P("rePB"),u=P("ODXe"),S=P("Ff2n"),R=P("VTBJ"),h=P("q1tI"),o=P("TSYQ"),C=P.n(o),c=P("Zm9Q"),a=P("6cGi"),i=P("KQm4"),r=P("xEkU"),l=P.n(r),p=P("t23M");function f(Ne){var Ge=Object(h.useRef)(),Je=Object(h.useRef)(!1);function Fe(){for(var ve=arguments.length,Le=new Array(ve),we=0;we<ve;we++)Le[we]=arguments[we];Je.current||(l.a.cancel(Ge.current),Ge.current=l()(function(){Ne.apply(void 0,Le)}))}return Object(h.useEffect)(function(){return function(){Je.current=!0,l.a.cancel(Ge.current)}},[]),Fe}function b(Ne){var Ge=Object(h.useRef)([]),Je=Object(h.useState)({}),Fe=Object(u.a)(Je,2),ve=Fe[1],Le=Object(h.useRef)(typeof Ne=="function"?Ne():Ne),we=f(function(){var He=Le.current;Ge.current.forEach(function(Ye){He=Ye(He)}),Ge.current=[],Le.current=He,ve({})});function Be(He){Ge.current.push(He),we()}return[Le.current,Be]}var v=P("4IlW");function m(Ne,Ge){var Je,Fe=Ne.prefixCls,ve=Ne.id,Le=Ne.active,we=Ne.rtl,Be=Ne.tab,He=Be.key,Ye=Be.tab,Ve=Be.disabled,it=Be.closeIcon,ht=Ne.tabBarGutter,Et=Ne.tabPosition,xt=Ne.closable,Rt=Ne.renderWrapper,Yt=Ne.removeAriaLabel,gr=Ne.editable,yr=Ne.onClick,wr=Ne.onRemove,Ar=Ne.onFocus,_r="".concat(Fe,"-tab");h.useEffect(function(){return wr},[]);var Cr={};Et==="top"||Et==="bottom"?Cr[we?"marginLeft":"marginRight"]=ht:Cr.marginBottom=ht;var zr=gr&&xt!==!1&&!Ve;function Pr(nr){if(Ve)return;yr(nr)}function kn(nr){nr.preventDefault(),nr.stopPropagation(),gr.onEdit("remove",{key:He,event:nr})}var Ir=h.createElement("div",{key:He,ref:Ge,className:C()(_r,(Je={},Object(L.a)(Je,"".concat(_r,"-with-remove"),zr),Object(L.a)(Je,"".concat(_r,"-active"),Le),Object(L.a)(Je,"".concat(_r,"-disabled"),Ve),Je)),style:Cr,onClick:Pr},h.createElement("div",{role:"tab","aria-selected":Le,id:ve&&"".concat(ve,"-tab-").concat(He),className:"".concat(_r,"-btn"),"aria-controls":ve&&"".concat(ve,"-panel-").concat(He),"aria-disabled":Ve,tabIndex:Ve?null:0,onClick:function(qt){qt.stopPropagation(),Pr(qt)},onKeyDown:function(qt){[v.a.SPACE,v.a.ENTER].includes(qt.which)&&(qt.preventDefault(),Pr(qt))},onFocus:Ar},Ye),zr&&h.createElement("button",{type:"button","aria-label":Yt||"remove",tabIndex:0,className:"".concat(_r,"-remove"),onClick:function(qt){qt.stopPropagation(),kn(qt)}},it||gr.removeIcon||"\xD7"));return Rt&&(Ir=Rt(Ir)),Ir}var n=h.forwardRef(m),d={width:0,height:0,left:0,top:0};function g(Ne,Ge,Je){return Object(h.useMemo)(function(){for(var Fe,ve=new Map,Le=Ge.get((Fe=Ne[0])===null||Fe===void 0?void 0:Fe.key)||d,we=Le.left+Le.width,Be=0;Be<Ne.length;Be+=1){var He=Ne[Be].key,Ye=Ge.get(He);if(!Ye){var Ve;Ye=Ge.get((Ve=Ne[Be-1])===null||Ve===void 0?void 0:Ve.key)||d}var it=ve.get(He)||Object(R.a)({},Ye);it.right=we-it.left-it.width,ve.set(He,it)}return ve},[Ne.map(function(Fe){return Fe.key}).join("_"),Ge,Je])}var T={width:0,height:0,left:0,top:0,right:0};function y(Ne,Ge,Je,Fe,ve){var Le=ve.tabs,we=ve.tabPosition,Be=ve.rtl,He,Ye,Ve;["top","bottom"].includes(we)?(He="width",Ye=Be?"right":"left",Ve=Math.abs(Ge.left)):(He="height",Ye="top",Ve=-Ge.top);var it=Ge[He],ht=Je[He],Et=Fe[He],xt=it;return ht+Et>it&&(xt=it-Et),Object(h.useMemo)(function(){if(!Le.length)return[0,0];for(var Rt=Le.length,Yt=Rt,gr=0;gr<Rt;gr+=1){var yr=Ne.get(Le[gr].key)||T;if(yr[Ye]+yr[He]>Ve+xt){Yt=gr-1;break}}for(var wr=0,Ar=Rt-1;Ar>=0;Ar-=1){var _r=Ne.get(Le[Ar].key)||T;if(_r[Ye]<Ve){wr=Ar+1;break}}return[wr,Yt]},[Ne,Ve,xt,we,Le.map(function(Rt){return Rt.key}).join("_"),Be])}var s=P("wx14"),M=P("1OyB"),A=P("vuIU"),x=P("JX7q"),E=P("Ji7U"),w=P("LK+K"),_=P("I8Z2"),N=P("bT9E"),j=P("2GS6"),k=P("Gytx"),z=P.n(k),H=P("U8pU"),F=/iPhone/i,G=/iPod/i,B=/iPad/i,W=/\bAndroid(?:.+)Mobile\b/i,K=/Android/i,q=/\bAndroid(?:.+)SD4930UR\b/i,re=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ee=/Windows Phone/i,Ce=/\bWindows(?:.+)ARM\b/i,xe=/BlackBerry/i,he=/BB10/i,ke=/Opera Mini/i,_e=/\b(CriOS|Chrome)(?:.+)Mobile/i,de=/Mobile(?:.+)Firefox\b/i;function ce(Ne,Ge){return Ne.test(Ge)}function ae(Ne){var Ge=Ne||(typeof navigator!="undefined"?navigator.userAgent:""),Je=(Ge||"").split("[FBAN");if(typeof Je[1]!="undefined"){var Fe=Je,ve=Object(u.a)(Fe,1);Ge=ve[0]}if(Je=Ge.split("Twitter"),typeof Je[1]!="undefined"){var Le=Je,we=Object(u.a)(Le,1);Ge=we[0]}var Be={apple:{phone:ce(F,Ge)&&!ce(ee,Ge),ipod:ce(G,Ge),tablet:!ce(F,Ge)&&ce(B,Ge)&&!ce(ee,Ge),device:(ce(F,Ge)||ce(G,Ge)||ce(B,Ge))&&!ce(ee,Ge)},amazon:{phone:ce(q,Ge),tablet:!ce(q,Ge)&&ce(re,Ge),device:ce(q,Ge)||ce(re,Ge)},android:{phone:!ce(ee,Ge)&&ce(q,Ge)||!ce(ee,Ge)&&ce(W,Ge),tablet:!ce(ee,Ge)&&!ce(q,Ge)&&!ce(W,Ge)&&(ce(re,Ge)||ce(K,Ge)),device:!ce(ee,Ge)&&(ce(q,Ge)||ce(re,Ge)||ce(W,Ge)||ce(K,Ge))||ce(/\bokhttp\b/i,Ge)},windows:{phone:ce(ee,Ge),tablet:ce(Ce,Ge),device:ce(ee,Ge)||ce(Ce,Ge)},other:{blackberry:ce(xe,Ge),blackberry10:ce(he,Ge),opera:ce(ke,Ge),firefox:ce(de,Ge),chrome:ce(_e,Ge),device:ce(xe,Ge)||ce(he,Ge)||ce(ke,Ge)||ce(de,Ge)||ce(_e,Ge)},any:null,phone:null,tablet:null};return Be.any=Be.apple.device||Be.android.device||Be.windows.device||Be.other.device,Be.phone=Be.apple.phone||Be.android.phone||Be.windows.phone,Be.tablet=Be.apple.tablet||Be.android.tablet||Be.windows.tablet,Be}var Se=Object(R.a)(Object(R.a)({},ae()),{},{isMobile:ae}),te=Se;function ue(){}function Oe(Ne,Ge,Je){var Fe=Ge||"";return Ne.key||"".concat(Fe,"item_").concat(Je)}function le(Ne){return"".concat(Ne,"-menu-")}function Q(Ne,Ge){var Je=-1;h.Children.forEach(Ne,function(Fe){Je+=1,Fe&&Fe.type&&Fe.type.isMenuItemGroup?h.Children.forEach(Fe.props.children,function(ve){Je+=1,Ge(ve,Je)}):Ge(Fe,Je)})}function Y(Ne,Ge,Je){if(!Ne||Je.find)return;h.Children.forEach(Ne,function(Fe){if(Fe){var ve=Fe.type;if(!ve||!(ve.isSubMenu||ve.isMenuItem||ve.isMenuItemGroup))return;Ge.indexOf(Fe.key)!==-1?Je.find=!0:Fe.props.children&&Y(Fe.props.children,Ge,Je)}})}var Z=["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"],be=function(Ge){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=Ge&&typeof Ge.getBoundingClientRect=="function"&&Ge.getBoundingClientRect().width;if(Fe){if(Je){var ve=getComputedStyle(Ge),Le=ve.marginLeft,we=ve.marginRight;Fe+=+Le.replace("px","")+ +we.replace("px","")}Fe=+Fe.toFixed(6)}return Fe||0},ge=function(Ge,Je,Fe){Ge&&Object(H.a)(Ge.style)==="object"&&(Ge.style[Je]=Fe)},De=function(){return te.any},Qe=P("bdgK"),Ze=P("i8i4"),nt=P.n(Ze),tt=P("wgJM"),lt=P("l4aY"),st=P("m+aA"),je=P("c+Xe"),Re=P("zT1h"),et=P("QC+M");function ct(Ne,Ge,Je){return Je?Ne[0]===Ge[0]:Ne[0]===Ge[0]&&Ne[1]===Ge[1]}function $e(Ne,Ge,Je){var Fe=Ne[Ge]||{};return Object(R.a)(Object(R.a)({},Fe),Je)}function qe(Ne,Ge,Je,Fe){for(var ve=Je.points,Le=Object.keys(Ne),we=0;we<Le.length;we+=1){var Be=Le[we];if(ct(Ne[Be].points,ve,Fe))return"".concat(Ge,"-placement-").concat(Be)}return""}var Ue=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ne=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ne)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ne==null?void 0:Ne.substr(0,4)))},Me=P("MNnm");function Ie(Ne,Ge){var Je={};return Je[Ne.toLowerCase()]=Ge.toLowerCase(),Je["Webkit".concat(Ne)]="webkit".concat(Ge),Je["Moz".concat(Ne)]="moz".concat(Ge),Je["ms".concat(Ne)]="MS".concat(Ge),Je["O".concat(Ne)]="o".concat(Ge.toLowerCase()),Je}function ye(Ne,Ge){var Je={animationend:Ie("Animation","AnimationEnd"),transitionend:Ie("Transition","TransitionEnd")};return Ne&&("AnimationEvent"in Ge||delete Je.animationend.animation,"TransitionEvent"in Ge||delete Je.transitionend.transition),Je}var Te=ye(Object(Me.a)(),typeof window!="undefined"?window:{}),Ae={};if(Object(Me.a)()){var Pe=document.createElement("div");Ae=Pe.style}var Xe={};function rt(Ne){if(Xe[Ne])return Xe[Ne];var Ge=Te[Ne];if(Ge)for(var Je=Object.keys(Ge),Fe=Je.length,ve=0;ve<Fe;ve+=1){var Le=Je[ve];if(Object.prototype.hasOwnProperty.call(Ge,Le)&&Le in Ae)return Xe[Ne]=Ge[Le],Xe[Ne]}return""}var ft=rt("animationend"),St=rt("transitionend"),Pt=!!(ft&&St),dt=ft||"animationend",At=St||"transitionend";function Ot(Ne,Ge){if(!Ne)return null;if(Object(H.a)(Ne)==="object"){var Je=Ge.replace(/-\w/g,function(Fe){return Fe[1].toUpperCase()});return Ne[Je]}return"".concat(Ne,"-").concat(Ge)}var bt="none",Vt="appear",ir="enter",Qt="leave",dr="none",Nt="prepare",br="start",ur="active",wt="end";function hr(Ne){var Ge=Object(h.useRef)(!1),Je=Object(h.useState)(Ne),Fe=Object(u.a)(Je,2),ve=Fe[0],Le=Fe[1];function we(Be){Ge.current||Le(Be)}return Object(h.useEffect)(function(){return function(){Ge.current=!0}},[]),[ve,we]}var Qr=Object(Me.a)()?h.useLayoutEffect:h.useEffect,Gr=Qr,Lr=function(){var Ne=h.useRef(null);function Ge(){tt.a.cancel(Ne.current)}function Je(Fe){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ge();var Le=Object(tt.a)(function(){ve<=1?Fe({isCanceled:function(){return Le!==Ne.current}}):Je(Fe,ve-1)});Ne.current=Le}return h.useEffect(function(){return function(){Ge()}},[]),[Je,Ge]},si=[Nt,br,ur,wt],Tt=!1,Dt=!0;function Ct(Ne){return Ne===ur||Ne===wt}var Rr=function(Ne,Ge){var Je=h.useState(dr),Fe=Object(u.a)(Je,2),ve=Fe[0],Le=Fe[1],we=Lr(),Be=Object(u.a)(we,2),He=Be[0],Ye=Be[1];function Ve(){Le(Nt)}return Gr(function(){if(ve!==dr&&ve!==wt){var it=si.indexOf(ve),ht=si[it+1],Et=Ge(ve);Et===Tt?Le(ht):He(function(xt){function Rt(){if(xt.isCanceled())return;Le(ht)}Et===!0?Rt():Promise.resolve(Et).then(Rt)})}},[Ne,ve]),h.useEffect(function(){return function(){Ye()}},[]),[Ve,ve]},jr=function(Ne){var Ge=Object(h.useRef)(),Je=Object(h.useRef)(Ne);Je.current=Ne;var Fe=h.useCallback(function(we){Je.current(we)},[]);function ve(we){we&&(we.removeEventListener(At,Fe),we.removeEventListener(dt,Fe))}function Le(we){Ge.current&&Ge.current!==we&&ve(Ge.current),we&&we!==Ge.current&&(we.addEventListener(At,Fe),we.addEventListener(dt,Fe),Ge.current=we)}return h.useEffect(function(){return function(){ve(Ge.current)}},[]),[Le,ve]};function $t(Ne,Ge,Je,Fe){var ve=Fe.motionEnter,Le=ve===void 0?!0:ve,we=Fe.motionAppear,Be=we===void 0?!0:we,He=Fe.motionLeave,Ye=He===void 0?!0:He,Ve=Fe.motionDeadline,it=Fe.motionLeaveImmediately,ht=Fe.onAppearPrepare,Et=Fe.onEnterPrepare,xt=Fe.onLeavePrepare,Rt=Fe.onAppearStart,Yt=Fe.onEnterStart,gr=Fe.onLeaveStart,yr=Fe.onAppearActive,wr=Fe.onEnterActive,Ar=Fe.onLeaveActive,_r=Fe.onAppearEnd,Cr=Fe.onEnterEnd,zr=Fe.onLeaveEnd,Pr=Fe.onVisibleChanged,kn=hr(),Ir=Object(u.a)(kn,2),nr=Ir[0],qt=Ir[1],Nr=hr(bt),Kr=Object(u.a)(Nr,2),zt=Kr[0],Jr=Kr[1],Ln=hr(null),nn=Object(u.a)(Ln,2),yn=nn[0],fn=nn[1],Wn=Object(h.useRef)(!1),ti=Object(h.useRef)(null),In=Object(h.useRef)(!1),vi=Object(h.useRef)(null);function Fi(){var Cn=Je();return Cn||vi.current}var wi=Object(h.useRef)(!1);function ri(Cn){var dn=Fi();if(Cn&&!Cn.deadline&&Cn.target!==dn)return;var ni;zt===Vt&&wi.current?ni=_r==null?void 0:_r(dn,Cn):zt===ir&&wi.current?ni=Cr==null?void 0:Cr(dn,Cn):zt===Qt&&wi.current&&(ni=zr==null?void 0:zr(dn,Cn)),ni!==!1&&!In.current&&(Jr(bt),fn(null))}var Sn=jr(ri),bn=Object(u.a)(Sn,1),Nn=bn[0],Mn=h.useMemo(function(){var Cn,dn,ni;switch(zt){case"appear":return Cn={},Object(L.a)(Cn,Nt,ht),Object(L.a)(Cn,br,Rt),Object(L.a)(Cn,ur,yr),Cn;case"enter":return dn={},Object(L.a)(dn,Nt,Et),Object(L.a)(dn,br,Yt),Object(L.a)(dn,ur,wr),dn;case"leave":return ni={},Object(L.a)(ni,Nt,xt),Object(L.a)(ni,br,gr),Object(L.a)(ni,ur,Ar),ni;default:return{}}},[zt]),Bi=Rr(zt,function(Cn){if(Cn===Nt){var dn=Mn[Nt];return dn?dn(Fi()):Tt}if(pn in Mn){var ni;fn(((ni=Mn[pn])===null||ni===void 0?void 0:ni.call(Mn,Fi(),null))||null)}return pn===ur&&(Nn(Fi()),Ve>0&&(clearTimeout(ti.current),ti.current=setTimeout(function(){ri({deadline:!0})},Ve))),Dt}),ra=Object(u.a)(Bi,2),na=ra[0],pn=ra[1],Yi=Ct(pn);wi.current=Yi,Gr(function(){qt(Ge);var Cn=Wn.current;if(Wn.current=!0,!Ne)return;var dn;!Cn&&Ge&&Be&&(dn=Vt),Cn&&Ge&&Le&&(dn=ir),(Cn&&!Ge&&Ye||!Cn&&it&&!Ge&&Ye)&&(dn=Qt),dn&&(Jr(dn),na())},[Ge]),Object(h.useEffect)(function(){(zt===Vt&&!Be||zt===ir&&!Le||zt===Qt&&!Ye)&&Jr(bt)},[Be,Le,Ye]),Object(h.useEffect)(function(){return function(){clearTimeout(ti.current),In.current=!0}},[]),Object(h.useEffect)(function(){nr!==void 0&&zt===bt&&(Pr==null||Pr(nr))},[nr,zt]);var ia=yn;return Mn[Nt]&&pn===br&&(ia=Object(R.a)({transition:"none"},ia)),[zt,pn,ia,nr!=null?nr:Ge]}var jt=function(Ne){Object(E.a)(Je,Ne);var Ge=Object(w.a)(Je);function Je(){return Object(M.a)(this,Je),Ge.apply(this,arguments)}return Object(A.a)(Je,[{key:"render",value:function(){return this.props.children}}]),Je}(h.Component),Ur=jt;function _n(Ne){var Ge=Ne;Object(H.a)(Ne)==="object"&&(Ge=Ne.transitionSupport);function Je(ve){return!!(ve.motionName&&Ge)}var Fe=h.forwardRef(function(ve,Le){var we=ve.visible,Be=we===void 0?!0:we,He=ve.removeOnLeave,Ye=He===void 0?!0:He,Ve=ve.forceRender,it=ve.children,ht=ve.motionName,Et=ve.leavedClassName,xt=ve.eventProps,Rt=Je(ve),Yt=Object(h.useRef)(),gr=Object(h.useRef)();function yr(){try{return Object(st.a)(Yt.current||gr.current)}catch(Jr){return null}}var wr=$t(Rt,Be,yr,ve),Ar=Object(u.a)(wr,4),_r=Ar[0],Cr=Ar[1],zr=Ar[2],Pr=Ar[3],kn=h.useRef(Pr);Pr&&(kn.current=!0);var Ir=Object(h.useRef)(Le);Ir.current=Le;var nr=h.useCallback(function(Jr){Yt.current=Jr,Object(je.b)(Ir.current,Jr)},[]),qt,Nr=Object(R.a)(Object(R.a)({},xt),{},{visible:Be});if(!it)qt=null;else if(_r===bt||!Je(ve))Pr?qt=it(Object(R.a)({},Nr),nr):!Ye&&kn.current?qt=it(Object(R.a)(Object(R.a)({},Nr),{},{className:Et}),nr):Ve?qt=it(Object(R.a)(Object(R.a)({},Nr),{},{style:{display:"none"}}),nr):qt=null;else{var Kr,zt;Cr===Nt?zt="prepare":Ct(Cr)?zt="active":Cr===br&&(zt="start"),qt=it(Object(R.a)(Object(R.a)({},Nr),{},{className:C()(Ot(ht,_r),(Kr={},Object(L.a)(Kr,Ot(ht,"".concat(_r,"-").concat(zt)),zt),Object(L.a)(Kr,ht,typeof ht=="string"),Kr)),style:zr}),nr)}return h.createElement(Ur,{ref:gr},qt)});return Fe.displayName="CSSMotion",Fe}var Vr=_n(Pt),vt="add",Ft="keep",rn="remove",hn="removed";function An(Ne){var Ge;return Ne&&Object(H.a)(Ne)==="object"&&"key"in Ne?Ge=Ne:Ge={key:Ne},Object(R.a)(Object(R.a)({},Ge),{},{key:String(Ge.key)})}function Rn(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ne.map(An)}function se(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Je=[],Fe=0,ve=Ge.length,Le=Rn(Ne),we=Rn(Ge);Le.forEach(function(Ye){for(var Ve=!1,it=Fe;it<ve;it+=1){var ht=we[it];if(ht.key===Ye.key){Fe<it&&(Je=Je.concat(we.slice(Fe,it).map(function(Et){return Object(R.a)(Object(R.a)({},Et),{},{status:vt})})),Fe=it),Je.push(Object(R.a)(Object(R.a)({},ht),{},{status:Ft})),Fe+=1,Ve=!0;break}}Ve||Je.push(Object(R.a)(Object(R.a)({},Ye),{},{status:rn}))}),Fe<ve&&(Je=Je.concat(we.slice(Fe).map(function(Ye){return Object(R.a)(Object(R.a)({},Ye),{},{status:vt})})));var Be={};Je.forEach(function(Ye){var Ve=Ye.key;Be[Ve]=(Be[Ve]||0)+1});var He=Object.keys(Be).filter(function(Ye){return Be[Ye]>1});return He.forEach(function(Ye){Je=Je.filter(function(Ve){var it=Ve.key,ht=Ve.status;return it!==Ye||ht!==rn}),Je.forEach(function(Ve){Ve.key===Ye&&(Ve.status=Ft)})}),Je}var V=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function X(Ne){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vr,Je=function(Fe){Object(E.a)(Le,Fe);var ve=Object(w.a)(Le);function Le(){var we;return Object(M.a)(this,Le),we=ve.apply(this,arguments),we.state={keyEntities:[]},we.removeKey=function(Be){we.setState(function(He){var Ye=He.keyEntities;return{keyEntities:Ye.map(function(Ve){return Ve.key!==Be?Ve:Object(R.a)(Object(R.a)({},Ve),{},{status:hn})})}})},we}return Object(A.a)(Le,[{key:"render",value:function(){var Be=this,He=this.state.keyEntities,Ye=this.props,Ve=Ye.component,it=Ye.children,ht=Ye.onVisibleChanged,Et=Object(S.a)(Ye,["component","children","onVisibleChanged"]),xt=Ve||h.Fragment,Rt={};return V.forEach(function(Yt){Rt[Yt]=Et[Yt],delete Et[Yt]}),delete Et.keys,h.createElement(xt,Et,He.map(function(Yt){var gr=Yt.status,yr=Object(S.a)(Yt,["status"]),wr=gr===vt||gr===Ft;return h.createElement(Ge,Object(s.a)({},Rt,{key:yr.key,visible:wr,eventProps:yr,onVisibleChanged:function(_r){ht==null||ht(_r,{key:yr.key}),_r||Be.removeKey(yr.key)}}),it)}))}}],[{key:"getDerivedStateFromProps",value:function(Be,He){var Ye=Be.keys,Ve=He.keyEntities,it=Rn(Ye),ht=se(Ve,it);return{keyEntities:ht.filter(function(Et){var xt=Ve.find(function(Rt){var Yt=Rt.key;return Et.key===Yt});return!(xt&&xt.status===hn&&Et.status===rn)})}}}]),Le}(h.Component);return Je.defaultProps={component:"div"},Je}var ne=X(Pt),me=Vr;function ie(Ne){var Ge=Ne.prefixCls,Je=Ne.motion,Fe=Ne.animation,ve=Ne.transitionName;return Je||(Fe?{motionName:"".concat(Ge,"-").concat(Fe)}:ve?{motionName:ve}:null)}function ze(Ne){var Ge=Ne.prefixCls,Je=Ne.visible,Fe=Ne.zIndex,ve=Ne.mask,Le=Ne.maskMotion,we=Ne.maskAnimation,Be=Ne.maskTransitionName;if(!ve)return null;var He={};return(Le||Be||we)&&(He=Object(R.a)({motionAppear:!0},ie({motion:Le,prefixCls:Ge,transitionName:Be,animation:we}))),h.createElement(me,Object(s.a)({},He,{visible:Je,removeOnLeave:!0}),function(Ye){var Ve=Ye.className;return h.createElement("div",{style:{zIndex:Fe},className:C()("".concat(Ge,"-mask"),Ve)})})}var pt=P("9mu1"),ot=P("o0o1"),It=P.n(ot),gt=P("HaE+"),Ht=["measure","align",null,"motion"],Xt=function(Ne,Ge){var Je=Object(h.useState)(null),Fe=Object(u.a)(Je,2),ve=Fe[0],Le=Fe[1],we=Object(h.useRef)(),Be=Object(h.useRef)(!1);function He(it){Be.current||Le(it)}function Ye(){tt.a.cancel(we.current)}function Ve(it){Ye(),we.current=Object(tt.a)(function(){He(function(ht){switch(ve){case"align":return"motion";case"motion":return"stable";default:}return ht}),it==null||it()})}return Object(h.useEffect)(function(){He("measure")},[Ne]),Object(h.useEffect)(function(){switch(ve){case"measure":Ge();break;default:}ve&&(we.current=Object(tt.a)(Object(gt.a)(It.a.mark(function it(){var ht,Et;return It.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:ht=Ht.indexOf(ve),Et=Ht[ht+1],Et&&ht!==-1&&He(Et);case 3:case"end":return Rt.stop()}},it)}))))},[ve]),Object(h.useEffect)(function(){return function(){Be.current=!0,Ye()}},[]),[ve,Ve]},Sr=function(Ne){var Ge=h.useState({width:0,height:0}),Je=Object(u.a)(Ge,2),Fe=Je[0],ve=Je[1];function Le(Be){ve({width:Be.offsetWidth,height:Be.offsetHeight})}var we=h.useMemo(function(){var Be={};if(Ne){var He=Fe.width,Ye=Fe.height;Ne.indexOf("height")!==-1&&Ye?Be.height=Ye:Ne.indexOf("minHeight")!==-1&&Ye&&(Be.minHeight=Ye),Ne.indexOf("width")!==-1&&He?Be.width=He:Ne.indexOf("minWidth")!==-1&&He&&(Be.minWidth=He)}return Be},[Ne,Fe]);return[we,Le]},an=h.forwardRef(function(Ne,Ge){var Je=Ne.visible,Fe=Ne.prefixCls,ve=Ne.className,Le=Ne.style,we=Ne.children,Be=Ne.zIndex,He=Ne.stretch,Ye=Ne.destroyPopupOnHide,Ve=Ne.forceRender,it=Ne.align,ht=Ne.point,Et=Ne.getRootDomNode,xt=Ne.getClassNameFromAlign,Rt=Ne.onAlign,Yt=Ne.onMouseEnter,gr=Ne.onMouseLeave,yr=Ne.onMouseDown,wr=Ne.onTouchStart,Ar=Object(h.useRef)(),_r=Object(h.useRef)(),Cr=Object(h.useState)(),zr=Object(u.a)(Cr,2),Pr=zr[0],kn=zr[1],Ir=Sr(He),nr=Object(u.a)(Ir,2),qt=nr[0],Nr=nr[1];function Kr(){He&&Nr(Et())}var zt=Xt(Je,Kr),Jr=Object(u.a)(zt,2),Ln=Jr[0],nn=Jr[1],yn=Object(h.useRef)();function fn(){return ht||Et}function Wn(){var Sn;(Sn=Ar.current)===null||Sn===void 0||Sn.forceAlign()}function ti(Sn,bn){var Nn=xt(bn);Pr!==Nn&&kn(Nn),Ln==="align"&&(Pr!==Nn?Promise.resolve().then(function(){Wn()}):nn(function(){var Mn;(Mn=yn.current)===null||Mn===void 0||Mn.call(yn)}),Rt==null||Rt(Sn,bn))}var In=Object(R.a)({},ie(Ne));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Sn){var bn=In[Sn];In[Sn]=function(Nn,Mn){return nn(),bn==null?void 0:bn(Nn,Mn)}});function vi(){return new Promise(function(Sn){yn.current=Sn})}h.useEffect(function(){!In.motionName&&Ln==="motion"&&nn()},[In.motionName,Ln]),h.useImperativeHandle(Ge,function(){return{forceAlign:Wn,getElement:function(){return _r.current}}});var Fi=Object(R.a)(Object(R.a)({},qt),{},{zIndex:Be,opacity:Ln==="motion"||Ln==="stable"||!Je?void 0:0,pointerEvents:Ln==="stable"?void 0:"none"},Le),wi=!0;(it==null?void 0:it.points)&&(Ln==="align"||Ln==="stable")&&(wi=!1);var ri=we;return h.Children.count(we)>1&&(ri=h.createElement("div",{className:"".concat(Fe,"-content")},we)),h.createElement(me,Object(s.a)({visible:Je,ref:_r,leavedClassName:"".concat(Fe,"-hidden")},In,{onAppearPrepare:vi,onEnterPrepare:vi,removeOnLeave:Ye,forceRender:Ve}),function(Sn,bn){var Nn=Sn.className,Mn=Sn.style,Bi=C()(Fe,ve,Pr,Nn);return h.createElement(pt.a,{target:fn(),key:"popup",ref:Ar,monitorWindowResize:!0,disabled:wi,align:it,onAlign:ti},h.createElement("div",{ref:bn,className:Bi,onMouseEnter:Yt,onMouseLeave:gr,onMouseDownCapture:yr,onTouchStartCapture:wr,style:Object(R.a)(Object(R.a)({},Mn),Fi)},ri))})});an.displayName="PopupInner";var Zr=an,Zt=h.forwardRef(function(Ne,Ge){var Je=Ne.prefixCls,Fe=Ne.visible,ve=Ne.zIndex,Le=Ne.children,we=Ne.mobile;we=we===void 0?{}:we;var Be=we.popupClassName,He=we.popupStyle,Ye=we.popupMotion,Ve=Ye===void 0?{}:Ye,it=we.popupRender,ht=h.useRef();h.useImperativeHandle(Ge,function(){return{forceAlign:function(){},getElement:function(){return ht.current}}});var Et=Object(R.a)({zIndex:ve},He),xt=Le;return h.Children.count(Le)>1&&(xt=h.createElement("div",{className:"".concat(Je,"-content")},Le)),it&&(xt=it(xt)),h.createElement(me,Object(s.a)({visible:Fe,ref:ht,removeOnLeave:!0},Ve),function(Rt,Yt){var gr=Rt.className,yr=Rt.style,wr=C()(Je,Be,gr);return h.createElement("div",{ref:Yt,className:wr,style:Object(R.a)(Object(R.a)({},yr),Et)},xt)})});Zt.displayName="MobilePopupInner";var Hr=Zt,fr=["visible","mobile"],Jt=h.forwardRef(function(Ne,Ge){var Je=Ne.visible,Fe=Ne.mobile,ve=Object(S.a)(Ne,fr),Le=Object(h.useState)(Je),we=Object(u.a)(Le,2),Be=we[0],He=we[1],Ye=Object(h.useState)(!1),Ve=Object(u.a)(Ye,2),it=Ve[0],ht=Ve[1],Et=Object(R.a)(Object(R.a)({},ve),{},{visible:Be});Object(h.useEffect)(function(){He(Je),Je&&Fe&&ht(Ue())},[Je,Fe]);var xt=it?h.createElement(Hr,Object(s.a)({},Et,{mobile:Fe,ref:Ge})):h.createElement(Zr,Object(s.a)({},Et,{ref:Ge}));return h.createElement("div",null,h.createElement(ze,Et),xt)});Jt.displayName="Popup";var tr=Jt,vr=h.createContext(null),Xr=vr;function ln(){}function mn(){return""}function li(Ne){return Ne?Ne.ownerDocument:window.document}var Ki=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Ui(Ne){var Ge=function(Je){Object(E.a)(ve,Je);var Fe=Object(w.a)(ve);function ve(Le){var we;Object(M.a)(this,ve),we=Fe.call(this,Le),we.popupRef=h.createRef(),we.triggerRef=h.createRef(),we.attachId=void 0,we.clickOutsideHandler=void 0,we.touchOutsideHandler=void 0,we.contextMenuOutsideHandler1=void 0,we.contextMenuOutsideHandler2=void 0,we.mouseDownTimeout=void 0,we.focusTime=void 0,we.preClickTime=void 0,we.preTouchTime=void 0,we.delayTimer=void 0,we.hasPopupMouseDown=void 0,we.onMouseEnter=function(He){var Ye=we.props.mouseEnterDelay;we.fireEvents("onMouseEnter",He),we.delaySetPopupVisible(!0,Ye,Ye?null:He)},we.onMouseMove=function(He){we.fireEvents("onMouseMove",He),we.setPoint(He)},we.onMouseLeave=function(He){we.fireEvents("onMouseLeave",He),we.delaySetPopupVisible(!1,we.props.mouseLeaveDelay)},we.onPopupMouseEnter=function(){we.clearDelayTimer()},we.onPopupMouseLeave=function(He){var Ye;if(He.relatedTarget&&!He.relatedTarget.setTimeout&&Object(lt.a)((Ye=we.popupRef.current)===null||Ye===void 0?void 0:Ye.getElement(),He.relatedTarget))return;we.delaySetPopupVisible(!1,we.props.mouseLeaveDelay)},we.onFocus=function(He){we.fireEvents("onFocus",He),we.clearDelayTimer(),we.isFocusToShow()&&(we.focusTime=Date.now(),we.delaySetPopupVisible(!0,we.props.focusDelay))},we.onMouseDown=function(He){we.fireEvents("onMouseDown",He),we.preClickTime=Date.now()},we.onTouchStart=function(He){we.fireEvents("onTouchStart",He),we.preTouchTime=Date.now()},we.onBlur=function(He){we.fireEvents("onBlur",He),we.clearDelayTimer(),we.isBlurToHide()&&we.delaySetPopupVisible(!1,we.props.blurDelay)},we.onContextMenu=function(He){He.preventDefault(),we.fireEvents("onContextMenu",He),we.setPopupVisible(!0,He)},we.onContextMenuClose=function(){we.isContextMenuToShow()&&we.close()},we.onClick=function(He){if(we.fireEvents("onClick",He),we.focusTime){var Ye;if(we.preClickTime&&we.preTouchTime?Ye=Math.min(we.preClickTime,we.preTouchTime):we.preClickTime?Ye=we.preClickTime:we.preTouchTime&&(Ye=we.preTouchTime),Math.abs(Ye-we.focusTime)<20)return;we.focusTime=0}we.preClickTime=0,we.preTouchTime=0,we.isClickToShow()&&(we.isClickToHide()||we.isBlurToHide())&&He&&He.preventDefault&&He.preventDefault();var Ve=!we.state.popupVisible;(we.isClickToHide()&&!Ve||Ve&&we.isClickToShow())&&we.setPopupVisible(!we.state.popupVisible,He)},we.onPopupMouseDown=function(){if(we.hasPopupMouseDown=!0,clearTimeout(we.mouseDownTimeout),we.mouseDownTimeout=window.setTimeout(function(){we.hasPopupMouseDown=!1},0),we.context){var He;(He=we.context).onPopupMouseDown.apply(He,arguments)}},we.onDocumentClick=function(He){if(we.props.mask&&!we.props.maskClosable)return;var Ye=He.target,Ve=we.getRootDomNode(),it=we.getPopupDomNode();(!Object(lt.a)(Ve,Ye)||we.isContextMenuOnly())&&!Object(lt.a)(it,Ye)&&!we.hasPopupMouseDown&&we.close()},we.getRootDomNode=function(){var He=we.props.getTriggerDOMNode;if(He)return He(we.triggerRef.current);try{var Ye=Object(st.a)(we.triggerRef.current);if(Ye)return Ye}catch(Ve){}return nt.a.findDOMNode(Object(x.a)(we))},we.getPopupClassNameFromAlign=function(He){var Ye=[],Ve=we.props,it=Ve.popupPlacement,ht=Ve.builtinPlacements,Et=Ve.prefixCls,xt=Ve.alignPoint,Rt=Ve.getPopupClassNameFromAlign;return it&&ht&&Ye.push(qe(ht,Et,He,xt)),Rt&&Ye.push(Rt(He)),Ye.join(" ")},we.getComponent=function(){var He=we.props,Ye=He.prefixCls,Ve=He.destroyPopupOnHide,it=He.popupClassName,ht=He.onPopupAlign,Et=He.popupMotion,xt=He.popupAnimation,Rt=He.popupTransitionName,Yt=He.popupStyle,gr=He.mask,yr=He.maskAnimation,wr=He.maskTransitionName,Ar=He.maskMotion,_r=He.zIndex,Cr=He.popup,zr=He.stretch,Pr=He.alignPoint,kn=He.mobile,Ir=He.forceRender,nr=we.state,qt=nr.popupVisible,Nr=nr.point,Kr=we.getPopupAlign(),zt={};return we.isMouseEnterToShow()&&(zt.onMouseEnter=we.onPopupMouseEnter),we.isMouseLeaveToHide()&&(zt.onMouseLeave=we.onPopupMouseLeave),zt.onMouseDown=we.onPopupMouseDown,zt.onTouchStart=we.onPopupMouseDown,h.createElement(tr,Object(s.a)({prefixCls:Ye,destroyPopupOnHide:Ve,visible:qt,point:Pr&&Nr,className:it,align:Kr,onAlign:ht,animation:xt,getClassNameFromAlign:we.getPopupClassNameFromAlign},zt,{stretch:zr,getRootDomNode:we.getRootDomNode,style:Yt,mask:gr,zIndex:_r,transitionName:Rt,maskAnimation:yr,maskTransitionName:wr,maskMotion:Ar,ref:we.popupRef,motion:Et,mobile:kn,forceRender:Ir}),typeof Cr=="function"?Cr():Cr)},we.attachParent=function(He){tt.a.cancel(we.attachId);var Ye=we.props,Ve=Ye.getPopupContainer,it=Ye.getDocument,ht=we.getRootDomNode(),Et;Ve?(ht||Ve.length===0)&&(Et=Ve(ht)):Et=it(we.getRootDomNode()).body,Et?Et.appendChild(He):we.attachId=Object(tt.a)(function(){we.attachParent(He)})},we.getContainer=function(){var He=we.props.getDocument,Ye=He(we.getRootDomNode()).createElement("div");return Ye.style.position="absolute",Ye.style.top="0",Ye.style.left="0",Ye.style.width="100%",we.attachParent(Ye),Ye},we.setPoint=function(He){var Ye=we.props.alignPoint;if(!Ye||!He)return;we.setState({point:{pageX:He.pageX,pageY:He.pageY}})},we.handlePortalUpdate=function(){we.state.prevPopupVisible!==we.state.popupVisible&&we.props.afterPopupVisibleChange(we.state.popupVisible)},we.triggerContextValue={onPopupMouseDown:we.onPopupMouseDown};var Be;return"popupVisible"in Le?Be=!!Le.popupVisible:Be=!!Le.defaultPopupVisible,we.state={prevPopupVisible:Be,popupVisible:Be},Ki.forEach(function(He){we["fire".concat(He)]=function(Ye){we.fireEvents(He,Ye)}}),we}return Object(A.a)(ve,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var we=this.props,Be=this.state;if(Be.popupVisible){var He;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(He=we.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Re.a)(He,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(He=He||we.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Re.a)(He,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(He=He||we.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Re.a)(He,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Re.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var we;return((we=this.popupRef.current)===null||we===void 0?void 0:we.getElement())||null}},{key:"getPopupAlign",value:function(){var we=this.props,Be=we.popupPlacement,He=we.popupAlign,Ye=we.builtinPlacements;return Be&&Ye?$e(Ye,Be,He):He}},{key:"setPopupVisible",value:function(we,Be){var He=this.props.alignPoint,Ye=this.state.popupVisible;this.clearDelayTimer(),Ye!==we&&("popupVisible"in this.props||this.setState({popupVisible:we,prevPopupVisible:Ye}),this.props.onPopupVisibleChange(we)),He&&Be&&we&&this.setPoint(Be)}},{key:"delaySetPopupVisible",value:function(we,Be,He){var Ye=this,Ve=Be*1e3;if(this.clearDelayTimer(),Ve){var it=He?{pageX:He.pageX,pageY:He.pageY}:null;this.delayTimer=window.setTimeout(function(){Ye.setPopupVisible(we,it),Ye.clearDelayTimer()},Ve)}else this.setPopupVisible(we,He)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(we){var Be=this.props.children.props,He=this.props;return Be[we]&&He[we]?this["fire".concat(we)]:Be[we]||He[we]}},{key:"isClickToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("click")!==-1||He.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var we=this.props.action;return we==="contextMenu"||we.length===1&&we[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("contextMenu")!==-1||He.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("click")!==-1||He.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("hover")!==-1||He.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("hover")!==-1||He.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("focus")!==-1||He.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("focus")!==-1||He.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var we;(we=this.popupRef.current)===null||we===void 0||we.forceAlign()}}},{key:"fireEvents",value:function(we,Be){var He=this.props.children.props[we];He&&He(Be);var Ye=this.props[we];Ye&&Ye(Be)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var we=this.state.popupVisible,Be=this.props,He=Be.children,Ye=Be.forceRender,Ve=Be.alignPoint,it=Be.className,ht=Be.autoDestroy,Et=h.Children.only(He),xt={key:"trigger"};this.isContextMenuToShow()?xt.onContextMenu=this.onContextMenu:xt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(xt.onClick=this.onClick,xt.onMouseDown=this.onMouseDown,xt.onTouchStart=this.onTouchStart):(xt.onClick=this.createTwoChains("onClick"),xt.onMouseDown=this.createTwoChains("onMouseDown"),xt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(xt.onMouseEnter=this.onMouseEnter,Ve&&(xt.onMouseMove=this.onMouseMove)):xt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?xt.onMouseLeave=this.onMouseLeave:xt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(xt.onFocus=this.onFocus,xt.onBlur=this.onBlur):(xt.onFocus=this.createTwoChains("onFocus"),xt.onBlur=this.createTwoChains("onBlur"));var Rt=C()(Et&&Et.props&&Et.props.className,it);Rt&&(xt.className=Rt);var Yt=Object(R.a)({},xt);Object(je.c)(Et)&&(Yt.ref=Object(je.a)(this.triggerRef,Et.ref));var gr=h.cloneElement(Et,Yt),yr;return(we||this.popupRef.current||Ye)&&(yr=h.createElement(Ne,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!we&&ht&&(yr=null),h.createElement(Xr.Provider,{value:this.triggerContextValue},gr,yr)}}],[{key:"getDerivedStateFromProps",value:function(we,Be){var He=we.popupVisible,Ye={};return He!==void 0&&Be.popupVisible!==He&&(Ye.popupVisible=He,Ye.prevPopupVisible=Be.popupVisible),Ye}}]),ve}(h.Component);return Ge.contextType=Xr,Ge.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:mn,getDocument:li,onPopupVisibleChange:ln,afterPopupVisibleChange:ln,onPopupAlign:ln,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Ge}var Fn=Ui(et.a),qr={adjustX:1,adjustY:1},Oi={topLeft:{points:["bl","tl"],overflow:qr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qr,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:qr,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:qr,offset:[4,0]}},on={topLeft:{points:["bl","tl"],overflow:qr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qr,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:qr,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:qr,offset:[4,0]}},Zn=Oi,Yr=0,cr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},en=function(Ge,Je,Fe){var ve=le(Je),Le=Ge.getState();Ge.setState({defaultActiveFirst:Object(R.a)(Object(R.a)({},Le.defaultActiveFirst),{},Object(L.a)({},ve,Fe))})},Mr=function(Ne){Object(E.a)(Je,Ne);var Ge=Object(w.a)(Je);function Je(Fe){var ve;Object(M.a)(this,Je),ve=Ge.call(this,Fe),ve.onDestroy=function(Ve){ve.props.onDestroy(Ve)},ve.onKeyDown=function(Ve){var it=Ve.keyCode,ht=ve.menuInstance,Et=ve.props.store,xt=ve.getVisible();if(it===v.a.ENTER)return ve.onTitleClick(Ve),en(Et,ve.props.eventKey,!0),!0;if(it===v.a.RIGHT)return xt?ht.onKeyDown(Ve):(ve.triggerOpenChange(!0),en(Et,ve.props.eventKey,!0)),!0;if(it===v.a.LEFT){var Rt;if(xt)Rt=ht.onKeyDown(Ve);else return;return Rt||(ve.triggerOpenChange(!1),Rt=!0),Rt}return xt&&(it===v.a.UP||it===v.a.DOWN)?ht.onKeyDown(Ve):void 0},ve.onOpenChange=function(Ve){ve.props.onOpenChange(Ve)},ve.onPopupVisibleChange=function(Ve){ve.triggerOpenChange(Ve,Ve?"mouseenter":"mouseleave")},ve.onMouseEnter=function(Ve){var it=ve.props,ht=it.eventKey,Et=it.onMouseEnter,xt=it.store;en(xt,ve.props.eventKey,!1),Et({key:ht,domEvent:Ve})},ve.onMouseLeave=function(Ve){var it=ve.props,ht=it.parentMenu,Et=it.eventKey,xt=it.onMouseLeave;ht.subMenuInstance=Object(x.a)(ve),xt({key:Et,domEvent:Ve})},ve.onTitleMouseEnter=function(Ve){var it=ve.props,ht=it.eventKey,Et=it.onItemHover,xt=it.onTitleMouseEnter;Et({key:ht,hover:!0}),xt({key:ht,domEvent:Ve})},ve.onTitleMouseLeave=function(Ve){var it=ve.props,ht=it.parentMenu,Et=it.eventKey,xt=it.onItemHover,Rt=it.onTitleMouseLeave;ht.subMenuInstance=Object(x.a)(ve),xt({key:Et,hover:!1}),Rt({key:Et,domEvent:Ve})},ve.onTitleClick=function(Ve){var it=Object(x.a)(ve),ht=it.props;if(ht.onTitleClick({key:ht.eventKey,domEvent:Ve}),ht.triggerSubMenuAction==="hover")return;ve.triggerOpenChange(!ve.getVisible(),"click"),en(ht.store,ve.props.eventKey,!1)},ve.onSubMenuClick=function(Ve){typeof ve.props.onClick=="function"&&ve.props.onClick(ve.addKeyPath(Ve))},ve.onSelect=function(Ve){ve.props.onSelect(Ve)},ve.onDeselect=function(Ve){ve.props.onDeselect(Ve)},ve.getPrefixCls=function(){return"".concat(ve.props.rootPrefixCls,"-submenu")},ve.getActiveClassName=function(){return"".concat(ve.getPrefixCls(),"-active")},ve.getDisabledClassName=function(){return"".concat(ve.getPrefixCls(),"-disabled")},ve.getSelectedClassName=function(){return"".concat(ve.getPrefixCls(),"-selected")},ve.getOpenClassName=function(){return"".concat(ve.props.rootPrefixCls,"-submenu-open")},ve.getVisible=function(){return ve.state.isOpen},ve.getMode=function(){return ve.state.mode},ve.saveMenuInstance=function(Ve){ve.menuInstance=Ve},ve.addKeyPath=function(Ve){return Object(R.a)(Object(R.a)({},Ve),{},{keyPath:(Ve.keyPath||[]).concat(ve.props.eventKey)})},ve.triggerOpenChange=function(Ve,it){var ht=ve.props.eventKey,Et=function(){ve.onOpenChange({key:ht,item:Object(x.a)(ve),trigger:it,open:Ve})};it==="mouseenter"?ve.mouseenterTimeout=setTimeout(function(){Et()},0):Et()},ve.isChildrenSelected=function(){var Ve={find:!1};return Y(ve.props.children,ve.props.selectedKeys,Ve),Ve.find},ve.isInlineMode=function(){return ve.getMode()==="inline"},ve.adjustWidth=function(){if(!ve.subMenuTitle||!ve.menuInstance)return;var Ve=Ze.findDOMNode(ve.menuInstance);if(Ve.offsetWidth>=ve.subMenuTitle.offsetWidth)return;Ve.style.minWidth="".concat(ve.subMenuTitle.offsetWidth,"px")},ve.saveSubMenuTitle=function(Ve){ve.subMenuTitle=Ve},ve.getBaseProps=function(){var Ve=Object(x.a)(ve),it=Ve.props,ht=ve.getMode();return{mode:ht==="horizontal"?"vertical":ht,visible:ve.getVisible(),level:it.level+1,inlineIndent:it.inlineIndent,focusable:!1,onClick:ve.onSubMenuClick,onSelect:ve.onSelect,onDeselect:ve.onDeselect,onDestroy:ve.onDestroy,selectedKeys:it.selectedKeys,eventKey:"".concat(it.eventKey,"-menu-"),openKeys:it.openKeys,motion:it.motion,onOpenChange:ve.onOpenChange,subMenuOpenDelay:it.subMenuOpenDelay,parentMenu:Object(x.a)(ve),subMenuCloseDelay:it.subMenuCloseDelay,forceSubMenuRender:it.forceSubMenuRender,triggerSubMenuAction:it.triggerSubMenuAction,builtinPlacements:it.builtinPlacements,defaultActiveFirst:it.store.getState().defaultActiveFirst[le(it.eventKey)],multiple:it.multiple,prefixCls:it.rootPrefixCls,id:ve.internalMenuId,manualRef:ve.saveMenuInstance,itemIcon:it.itemIcon,expandIcon:it.expandIcon,direction:it.direction}},ve.getMotion=function(Ve,it){var ht=Object(x.a)(ve),Et=ht.haveRendered,xt=ve.props,Rt=xt.motion,Yt=xt.rootPrefixCls,gr=Object(R.a)(Object(R.a)({},Rt),{},{leavedClassName:"".concat(Yt,"-hidden"),removeOnLeave:!1,motionAppear:Et||!it||Ve!=="inline"});return gr};var Le=Fe.store,we=Fe.eventKey,Be=Le.getState(),He=Be.defaultActiveFirst;ve.isRootMenu=!1;var Ye=!1;return He&&(Ye=He[we]),en(Le,we,Ye),ve.state={mode:Fe.mode,isOpen:Fe.isOpen},ve}return Object(A.a)(Je,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ve=this,Le=this.props,we=Le.mode,Be=Le.parentMenu,He=Le.manualRef,Ye=Le.isOpen,Ve=function(){ve.setState({mode:we,isOpen:Ye})},it=Ye!==this.state.isOpen,ht=we!==this.state.mode;if((ht||it)&&(tt.a.cancel(this.updateStateRaf),ht?this.updateStateRaf=Object(tt.a)(Ve):Ve()),He&&He(this),we!=="horizontal"||!(Be==null?void 0:Be.isRootMenu)||!Ye)return;this.minWidthTimeout=setTimeout(function(){return ve.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ve=this.props,Le=ve.onDestroy,we=ve.eventKey;Le&&Le(we),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ve,Le){var we=this.getBaseProps();return h.createElement(pi,Object(s.a)({},we,{id:this.internalMenuId,className:ve,style:Le}),this.props.children)}},{key:"renderChildren",value:function(){var ve=this,Le=this.getBaseProps(),we=Le.mode,Be=Le.visible,He=Le.forceSubMenuRender,Ye=Le.direction,Ve=this.getMotion(we,Be);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Be||He,!this.haveOpened)return h.createElement("div",null);var it=C()("".concat(Le.prefixCls,"-sub"),Object(L.a)({},"".concat(Le.prefixCls,"-rtl"),Ye==="rtl"));return this.isInlineMode()?h.createElement(me,Object(s.a)({visible:Le.visible,forceRender:He},Ve),function(ht){var Et=ht.className,xt=ht.style,Rt=C()(it,Et);return ve.renderPopupMenu(Rt,xt)}):this.renderPopupMenu(it)}},{key:"render",value:function(){var ve,Le,we,Be=Object(R.a)({},this.props),He=this.getVisible(),Ye=this.getPrefixCls(),Ve=this.isInlineMode(),it=this.getMode(),ht=C()(Ye,"".concat(Ye,"-").concat(it),(ve={},Object(L.a)(ve,Be.className,!!Be.className),Object(L.a)(ve,this.getOpenClassName(),He),Object(L.a)(ve,this.getActiveClassName(),Be.active||He&&!Ve),Object(L.a)(ve,this.getDisabledClassName(),Be.disabled),Object(L.a)(ve,this.getSelectedClassName(),this.isChildrenSelected()),ve));this.internalMenuId||(Be.eventKey?this.internalMenuId="".concat(Be.eventKey,"$Menu"):(Yr+=1,this.internalMenuId="$__$".concat(Yr,"$Menu")));var Et={},xt={},Rt={};Be.disabled||(Et={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},xt={onClick:this.onTitleClick},Rt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Yt={},gr=Be.direction,yr=gr==="rtl";Ve&&(yr?Yt.paddingRight=Be.inlineIndent*Be.level:Yt.paddingLeft=Be.inlineIndent*Be.level);var wr={};this.getVisible()&&(wr={"aria-owns":this.internalMenuId});var Ar=null;it!=="horizontal"&&(Ar=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Ar=h.createElement(this.props.expandIcon,Object(R.a)({},this.props))));var _r=h.createElement("div",Object(s.a)({ref:this.saveSubMenuTitle,style:Yt,className:"".concat(Ye,"-title"),role:"button"},Rt,xt,{"aria-expanded":He},wr,{"aria-haspopup":"true",title:typeof Be.title=="string"?Be.title:void 0}),Be.title,Ar||h.createElement("i",{className:"".concat(Ye,"-arrow")})),Cr=this.renderChildren(),zr=((Le=Be.parentMenu)===null||Le===void 0?void 0:Le.isRootMenu)?Be.parentMenu.props.getPopupContainer:function(fn){return fn.parentNode},Pr=cr[it],kn=Be.popupOffset?{offset:Be.popupOffset}:{},Ir=C()((we={},Object(L.a)(we,Be.popupClassName,Be.popupClassName&&!Ve),Object(L.a)(we,"".concat(Ye,"-rtl"),yr),we)),nr=Be.disabled,qt=Be.triggerSubMenuAction,Nr=Be.subMenuOpenDelay,Kr=Be.forceSubMenuRender,zt=Be.subMenuCloseDelay,Jr=Be.builtinPlacements;Z.forEach(function(fn){return delete Be[fn]}),delete Be.onClick;var Ln=yr?Object(R.a)(Object(R.a)({},on),Jr):Object(R.a)(Object(R.a)({},Oi),Jr);delete Be.direction;var nn=this.getBaseProps(),yn=Ve?null:this.getMotion(nn.mode,nn.visible);return h.createElement("li",Object(s.a)({},Be,Et,{className:ht,role:"menuitem"}),h.createElement(Fn,{prefixCls:Ye,popupClassName:C()("".concat(Ye,"-popup"),Ir),getPopupContainer:zr,builtinPlacements:Ln,popupPlacement:Pr,popupVisible:Ve?!1:He,popupAlign:kn,popup:Ve?null:Cr,action:nr||Ve?[]:[qt],mouseEnterDelay:Nr,mouseLeaveDelay:zt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Kr,popupMotion:yn},_r),Ve?Cr:null)}}]),Je}(h.Component);Mr.defaultProps={onMouseEnter:ue,onMouseLeave:ue,onTitleMouseEnter:ue,onTitleMouseLeave:ue,onTitleClick:ue,manualRef:ue,mode:"vertical",title:""};var En=Object(_.b)(function(Ne,Ge){var Je=Ne.openKeys,Fe=Ne.activeKey,ve=Ne.selectedKeys,Le=Ge.eventKey,we=Ge.subMenuKey;return{isOpen:Je.indexOf(Le)>-1,active:Fe[we]===Le,selectedKeys:ve}})(Mr);En.isSubMenu=!0;var Fr=En,xi="menuitem-overflowed",gn=.5,On=function(Ne){Object(E.a)(Je,Ne);var Ge=Object(w.a)(Je);function Je(){var Fe;return Object(M.a)(this,Je),Fe=Ge.apply(this,arguments),Fe.resizeObserver=null,Fe.mutationObserver=null,Fe.originalTotalWidth=0,Fe.overflowedItems=[],Fe.menuItemSizes=[],Fe.cancelFrameId=null,Fe.state={lastVisibleIndex:void 0},Fe.childRef=h.createRef(),Fe.getMenuItemNodes=function(){var ve=Fe.props.prefixCls,Le=Fe.childRef.current;return Le?[].slice.call(Le.children).filter(function(we){return we.className.split(" ").indexOf("".concat(ve,"-overflowed-submenu"))<0}):[]},Fe.getOverflowedSubMenuItem=function(ve,Le,we){var Be=Fe.props,He=Be.overflowedIndicator,Ye=Be.level,Ve=Be.mode,it=Be.prefixCls,ht=Be.theme;if(Ye!==1||Ve!=="horizontal")return null;var Et=Fe.props.children[0],xt=Et.props,Rt=xt.children,Yt=xt.title,gr=xt.style,yr=Object(S.a)(xt,["children","title","style"]),wr=Object(R.a)({},gr),Ar="".concat(ve,"-overflowed-indicator"),_r="".concat(ve,"-overflowed-indicator");Le.length===0&&we!==!0?wr=Object(R.a)(Object(R.a)({},wr),{},{display:"none"}):we&&(wr=Object(R.a)(Object(R.a)({},wr),{},{visibility:"hidden",position:"absolute"}),Ar="".concat(Ar,"-placeholder"),_r="".concat(_r,"-placeholder"));var Cr=ht?"".concat(it,"-").concat(ht):"",zr={};return Z.forEach(function(Pr){yr[Pr]!==void 0&&(zr[Pr]=yr[Pr])}),h.createElement(Fr,Object(s.a)({title:He,className:"".concat(it,"-overflowed-submenu"),popupClassName:Cr},zr,{key:Ar,eventKey:_r,disabled:!1,style:wr}),Le)},Fe.setChildrenWidthAndResize=function(){if(Fe.props.mode!=="horizontal")return;var ve=Fe.childRef.current;if(!ve)return;var Le=ve.children;if(!Le||Le.length===0)return;var we=ve.children[Le.length-1];ge(we,"display","inline-block");var Be=Fe.getMenuItemNodes(),He=Be.filter(function(Ye){return Ye.className.split(" ").indexOf(xi)>=0});He.forEach(function(Ye){ge(Ye,"display","inline-block")}),Fe.menuItemSizes=Be.map(function(Ye){return be(Ye,!0)}),He.forEach(function(Ye){ge(Ye,"display","none")}),Fe.overflowedIndicatorWidth=be(ve.children[ve.children.length-1],!0),Fe.originalTotalWidth=Fe.menuItemSizes.reduce(function(Ye,Ve){return Ye+Ve},0),Fe.handleResize(),ge(we,"display","none")},Fe.handleResize=function(){if(Fe.props.mode!=="horizontal")return;var ve=Fe.childRef.current;if(!ve)return;var Le=be(ve);Fe.overflowedItems=[];var we=0,Be;Fe.originalTotalWidth>Le+gn&&(Be=-1,Fe.menuItemSizes.forEach(function(He){we+=He,we+Fe.overflowedIndicatorWidth<=Le&&(Be+=1)})),Fe.setState({lastVisibleIndex:Be})},Fe}return Object(A.a)(Je,[{key:"componentDidMount",value:function(){var ve=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Le=this.childRef.current;if(!Le)return;this.resizeObserver=new Qe.default(function(we){we.forEach(function(){var Be=ve.cancelFrameId;cancelAnimationFrame(Be),ve.cancelFrameId=requestAnimationFrame(ve.setChildrenWidthAndResize)})}),[].slice.call(Le.children).concat(Le).forEach(function(we){ve.resizeObserver.observe(we)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ve.resizeObserver.disconnect(),[].slice.call(Le.children).concat(Le).forEach(function(we){ve.resizeObserver.observe(we)}),ve.setChildrenWidthAndResize()}),this.mutationObserver.observe(Le,{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(ve){var Le=this,we=this.state.lastVisibleIndex;return(ve||[]).reduce(function(Be,He,Ye){var Ve=He;if(Le.props.mode==="horizontal"){var it=Le.getOverflowedSubMenuItem(He.props.eventKey,[]);we!==void 0&&Le.props.className.indexOf("".concat(Le.props.prefixCls,"-root"))!==-1&&(Ye>we&&(Ve=h.cloneElement(He,{style:{display:"none"},eventKey:"".concat(He.props.eventKey,"-hidden"),className:"".concat(xi)})),Ye===we+1&&(Le.overflowedItems=ve.slice(we+1).map(function(Et){return h.cloneElement(Et,{key:Et.props.eventKey,mode:"vertical-left"})}),it=Le.getOverflowedSubMenuItem(He.props.eventKey,Le.overflowedItems)));var ht=[].concat(Object(i.a)(Be),[it,Ve]);return Ye===ve.length-1&&ht.push(Le.getOverflowedSubMenuItem(He.props.eventKey,[],!0)),ht}return[].concat(Object(i.a)(Be),[Ve])},[])}},{key:"render",value:function(){var ve=this.props,Le=ve.visible,we=ve.prefixCls,Be=ve.overflowedIndicator,He=ve.mode,Ye=ve.level,Ve=ve.tag,it=ve.children,ht=ve.theme,Et=Object(S.a)(ve,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),xt=Ve;return h.createElement(xt,Object(s.a)({ref:this.childRef},Et),this.renderChildren(it))}}]),Je}(h.Component);On.defaultProps={tag:"div",className:""};var ui=On;function ci(Ne){return Ne.length?Ne.every(function(Ge){return!!Ge.props.disabled}):!0}function qn(Ne,Ge,Je){var Fe=Ne.getState();Ne.setState({activeKey:Object(R.a)(Object(R.a)({},Fe.activeKey),{},Object(L.a)({},Ge,Je))})}function Ei(Ne){return Ne.eventKey||"0-menu-"}function Yn(Ne,Ge){var Je=Ge,Fe=Ne.children,ve=Ne.eventKey;if(Je){var Le;if(Q(Fe,function(we,Be){we&&we.props&&!we.props.disabled&&Je===Oe(we,ve,Be)&&(Le=!0)}),Le)return Je}return Je=null,Ne.defaultActiveFirst&&Q(Fe,function(we,Be){!Je&&we&&!we.props.disabled&&(Je=Oe(we,ve,Be))}),Je}function Ai(Ne){if(!Ne)return;var Ge=this.instanceArray.indexOf(Ne);Ge!==-1?this.instanceArray[Ge]=Ne:this.instanceArray.push(Ne)}var zn=function(Ne){Object(E.a)(Je,Ne);var Ge=Object(w.a)(Je);function Je(Fe){var ve;return Object(M.a)(this,Je),ve=Ge.call(this,Fe),ve.onKeyDown=function(Le,we){var Be=Le.keyCode,He;if(ve.getFlatInstanceArray().forEach(function(Ve){Ve&&Ve.props.active&&Ve.onKeyDown&&(He=Ve.onKeyDown(Le))}),He)return 1;var Ye=null;return(Be===v.a.UP||Be===v.a.DOWN)&&(Ye=ve.step(Be===v.a.UP?-1:1)),Ye?(Le.preventDefault(),qn(ve.props.store,Ei(ve.props),Ye.props.eventKey),typeof we=="function"&&we(Ye),1):void 0},ve.onItemHover=function(Le){var we=Le.key,Be=Le.hover;qn(ve.props.store,Ei(ve.props),Be?we:null)},ve.onDeselect=function(Le){ve.props.onDeselect(Le)},ve.onSelect=function(Le){ve.props.onSelect(Le)},ve.onClick=function(Le){ve.props.onClick(Le)},ve.onOpenChange=function(Le){ve.props.onOpenChange(Le)},ve.onDestroy=function(Le){ve.props.onDestroy(Le)},ve.getFlatInstanceArray=function(){return ve.instanceArray},ve.step=function(Le){var we=ve.getFlatInstanceArray(),Be=ve.props.store.getState().activeKey[Ei(ve.props)],He=we.length;if(!He)return null;Le<0&&(we=we.concat().reverse());var Ye=-1;if(we.every(function(Et,xt){return Et&&Et.props.eventKey===Be?(Ye=xt,!1):!0}),!ve.props.defaultActiveFirst&&Ye!==-1&&ci(we.slice(Ye,He-1)))return;var Ve=(Ye+1)%He,it=Ve;do{var ht=we[it];if(!ht||ht.props.disabled)it=(it+1)%He;else return ht}while(it!==Ve);return null},ve.renderCommonMenuItem=function(Le,we,Be){var He=ve.props.store.getState(),Ye=Object(x.a)(ve),Ve=Ye.props,it=Oe(Le,Ve.eventKey,we),ht=Le.props;if(!ht||typeof Le.type=="string")return Le;var Et=it===He.activeKey,xt=Object(R.a)(Object(R.a)({mode:ht.mode||Ve.mode,level:Ve.level,inlineIndent:Ve.inlineIndent,renderMenuItem:ve.renderMenuItem,rootPrefixCls:Ve.prefixCls,index:we,parentMenu:Ve.parentMenu,manualRef:ht.disabled?void 0:Object(j.a)(Le.ref,Ai.bind(Object(x.a)(ve))),eventKey:it,active:!ht.disabled&&Et,multiple:Ve.multiple,onClick:function(Yt){(ht.onClick||ue)(Yt),ve.onClick(Yt)},onItemHover:ve.onItemHover,motion:Ve.motion,subMenuOpenDelay:Ve.subMenuOpenDelay,subMenuCloseDelay:Ve.subMenuCloseDelay,forceSubMenuRender:Ve.forceSubMenuRender,onOpenChange:ve.onOpenChange,onDeselect:ve.onDeselect,onSelect:ve.onSelect,builtinPlacements:Ve.builtinPlacements,itemIcon:ht.itemIcon||ve.props.itemIcon,expandIcon:ht.expandIcon||ve.props.expandIcon},Be),{},{direction:Ve.direction});return(Ve.mode==="inline"||De())&&(xt.triggerSubMenuAction="click"),h.cloneElement(Le,Object(R.a)(Object(R.a)({},xt),{},{key:it||we}))},ve.renderMenuItem=function(Le,we,Be){if(!Le)return null;var He=ve.props.store.getState(),Ye={openKeys:He.openKeys,selectedKeys:He.selectedKeys,triggerSubMenuAction:ve.props.triggerSubMenuAction,subMenuKey:Be};return ve.renderCommonMenuItem(Le,we,Ye)},Fe.store.setState({activeKey:Object(R.a)(Object(R.a)({},Fe.store.getState().activeKey),{},Object(L.a)({},Fe.eventKey,Yn(Fe,Fe.activeKey)))}),ve.instanceArray=[],ve}return Object(A.a)(Je,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ve){return this.props.visible||ve.visible||this.props.className!==ve.className||!z()(this.props.style,ve.style)}},{key:"componentDidUpdate",value:function(ve){var Le=this.props,we="activeKey"in Le?Le.activeKey:Le.store.getState().activeKey[Ei(Le)],Be=Yn(Le,we);if(Be!==we)qn(Le.store,Ei(Le),Be);else if("activeKey"in ve){var He=Yn(ve,ve.activeKey);Be!==He&&qn(Le.store,Ei(Le),Be)}}},{key:"render",value:function(){var ve=this,Le=Object(s.a)({},this.props);this.instanceArray=[];var we=C()(Le.prefixCls,Le.className,"".concat(Le.prefixCls,"-").concat(Le.mode)),Be={className:we,role:Le.role||"menu"};Le.id&&(Be.id=Le.id),Le.focusable&&(Be.tabIndex=0,Be.onKeyDown=this.onKeyDown);var He=Le.prefixCls,Ye=Le.eventKey,Ve=Le.visible,it=Le.level,ht=Le.mode,Et=Le.overflowedIndicator,xt=Le.theme;return Z.forEach(function(Rt){return delete Le[Rt]}),delete Le.onClick,h.createElement(ui,Object(s.a)({},Le,{prefixCls:He,mode:ht,tag:"ul",level:it,theme:xt,visible:Ve,overflowedIndicator:Et},Be),Object(c.a)(Le.children).map(function(Rt,Yt){return ve.renderMenuItem(Rt,Yt,Ye||"0-menu-")}))}}]),Je}(h.Component);zn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ue};var fi=Object(_.b)()(zn),pi=fi,ei=P("Kwbf");function $r(Ne,Ge,Je){var Fe=Ne.prefixCls,ve=Ne.motion,Le=Ne.defaultMotions,we=Le===void 0?{}:Le,Be=Ne.openAnimation,He=Ne.openTransitionName,Ye=Ge.switchingModeFromInline;if(ve)return ve;if(Object(H.a)(Be)==="object"&&Be)Object(ei.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Be=="string")return{motionName:"".concat(Fe,"-open-").concat(Be)};if(He)return{motionName:He};var Ve=we[Je];return Ve||(Ye?null:we.other)}var $i=function(Ne){Object(E.a)(Je,Ne);var Ge=Object(w.a)(Je);function Je(Fe){var ve;Object(M.a)(this,Je),ve=Ge.call(this,Fe),ve.onSelect=function(Be){var He=Object(x.a)(ve),Ye=He.props;if(Ye.selectable){var Ve=ve.store.getState(),it=Ve.selectedKeys,ht=Be.key;Ye.multiple?it=it.concat([ht]):it=[ht],"selectedKeys"in Ye||ve.store.setState({selectedKeys:it}),Ye.onSelect(Object(R.a)(Object(R.a)({},Be),{},{selectedKeys:it}))}},ve.onClick=function(Be){var He=ve.getRealMenuMode(),Ye=Object(x.a)(ve),Ve=Ye.store,it=Ye.props.onOpenChange;He!=="inline"&&!("openKeys"in ve.props)&&(Ve.setState({openKeys:[]}),it([])),ve.props.onClick(Be)},ve.onKeyDown=function(Be,He){ve.innerMenu.getWrappedInstance().onKeyDown(Be,He)},ve.onOpenChange=function(Be){var He=Object(x.a)(ve),Ye=He.props,Ve=ve.store.getState().openKeys.concat(),it=!1,ht=function(xt){var Rt=!1;if(xt.open)Rt=Ve.indexOf(xt.key)===-1,Rt&&Ve.push(xt.key);else{var Yt=Ve.indexOf(xt.key);Rt=Yt!==-1,Rt&&Ve.splice(Yt,1)}it=it||Rt};Array.isArray(Be)?Be.forEach(ht):ht(Be),it&&("openKeys"in ve.props||ve.store.setState({openKeys:Ve}),Ye.onOpenChange(Ve))},ve.onDeselect=function(Be){var He=Object(x.a)(ve),Ye=He.props;if(Ye.selectable){var Ve=ve.store.getState().selectedKeys.concat(),it=Be.key,ht=Ve.indexOf(it);ht!==-1&&Ve.splice(ht,1),"selectedKeys"in Ye||ve.store.setState({selectedKeys:Ve}),Ye.onDeselect(Object(R.a)(Object(R.a)({},Be),{},{selectedKeys:Ve}))}},ve.onMouseEnter=function(Be){ve.restoreModeVerticalFromInline();var He=ve.props.onMouseEnter;He&&He(Be)},ve.onTransitionEnd=function(Be){var He=Be.propertyName==="width"&&Be.target===Be.currentTarget,Ye=Be.target.className,Ve=Object.prototype.toString.call(Ye)==="[object SVGAnimatedString]"?Ye.animVal:Ye,it=Be.propertyName==="font-size"&&Ve.indexOf("anticon")>=0;(He||it)&&ve.restoreModeVerticalFromInline()},ve.setInnerMenu=function(Be){ve.innerMenu=Be},ve.isRootMenu=!0;var Le=Fe.defaultSelectedKeys,we=Fe.defaultOpenKeys;return"selectedKeys"in Fe&&(Le=Fe.selectedKeys||[]),"openKeys"in Fe&&(we=Fe.openKeys||[]),ve.store=Object(_.c)({selectedKeys:Le,openKeys:we,activeKey:{"0-menu-":Yn(Fe,Fe.activeKey)}}),ve.state={switchingModeFromInline:!1,prevProps:Fe,inlineOpenKeys:[],store:ve.store},ve}return Object(A.a)(Je,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ve){var Le=this.props,we=Le.siderCollapsed,Be=Le.inlineCollapsed,He=Le.onOpenChange;(!ve.inlineCollapsed&&Be||!ve.siderCollapsed&&we)&&He([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ve=this.props.collapsedWidth,Le=this.store,we=this.prevOpenKeys,Be=this.getInlineCollapsed()&&(ve===0||ve==="0"||ve==="0px");Be?(this.prevOpenKeys=Le.getState().openKeys.concat(),this.store.setState({openKeys:[]})):we&&(this.store.setState({openKeys:we}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ve=this.props.mode,Le=this.state.switchingModeFromInline,we=this.getInlineCollapsed();return Le&&we?"inline":we?"vertical":ve}},{key:"getInlineCollapsed",value:function(){var ve=this.props,Le=ve.inlineCollapsed,we=ve.siderCollapsed;return we!==void 0?we:Le}},{key:"restoreModeVerticalFromInline",value:function(){var ve=this.state.switchingModeFromInline;ve&&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 ve=Object(R.a)({},Object(N.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Le=this.getRealMenuMode();return ve.className+=" ".concat(ve.prefixCls,"-root"),ve.direction==="rtl"&&(ve.className+=" ".concat(ve.prefixCls,"-rtl")),ve=Object(R.a)(Object(R.a)({},ve),{},{mode:Le,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:$r(this.props,this.state,Le)}),delete ve.openAnimation,delete ve.openTransitionName,h.createElement(_.a,{store:this.store},h.createElement(pi,Object(s.a)({},ve,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ve,Le){var we=Le.prevProps,Be=Le.store,He=Be.getState(),Ye={},Ve={prevProps:ve};return we.mode==="inline"&&ve.mode!=="inline"&&(Ve.switchingModeFromInline=!0),"openKeys"in ve?Ye.openKeys=ve.openKeys||[]:((ve.inlineCollapsed&&!we.inlineCollapsed||ve.siderCollapsed&&!we.siderCollapsed)&&(Ve.switchingModeFromInline=!0,Ve.inlineOpenKeys=He.openKeys,Ye.openKeys=[]),(!ve.inlineCollapsed&&we.inlineCollapsed||!ve.siderCollapsed&&we.siderCollapsed)&&(Ye.openKeys=Le.inlineOpenKeys,Ve.inlineOpenKeys=[])),Object.keys(Ye).length&&Be.setState(Ye),Ve}}]),Je}(h.Component);$i.defaultProps={selectable:!0,onClick:ue,onSelect:ue,onOpenChange:ue,onDeselect:ue,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:h.createElement("span",null,"\xB7\xB7\xB7")};var ta=$i,Ni=function(Ne){Object(E.a)(Je,Ne);var Ge=Object(w.a)(Je);function Je(){var Fe;return Object(M.a)(this,Je),Fe=Ge.apply(this,arguments),Fe.onKeyDown=function(ve){var Le=ve.keyCode;return Le===v.a.ENTER?(Fe.onClick(ve),!0):void 0},Fe.onMouseLeave=function(ve){var Le=Fe.props,we=Le.eventKey,Be=Le.onItemHover,He=Le.onMouseLeave;Be({key:we,hover:!1}),He({key:we,domEvent:ve})},Fe.onMouseEnter=function(ve){var Le=Fe.props,we=Le.eventKey,Be=Le.onItemHover,He=Le.onMouseEnter;Be({key:we,hover:!0}),He({key:we,domEvent:ve})},Fe.onClick=function(ve){var Le=Fe.props,we=Le.eventKey,Be=Le.multiple,He=Le.onClick,Ye=Le.onSelect,Ve=Le.onDeselect,it=Le.isSelected,ht={key:we,keyPath:[we],item:Object(x.a)(Fe),domEvent:ve};He(ht),Be?it?Ve(ht):Ye(ht):it||Ye(ht)},Fe.saveNode=function(ve){Fe.node=ve},Fe}return Object(A.a)(Je,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ve=this.props;ve.onDestroy&&ve.onDestroy(ve.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 ve,Le=Object(R.a)({},this.props),we=C()(this.getPrefixCls(),Le.className,(ve={},Object(L.a)(ve,this.getActiveClassName(),!Le.disabled&&Le.active),Object(L.a)(ve,this.getSelectedClassName(),Le.isSelected),Object(L.a)(ve,this.getDisabledClassName(),Le.disabled),ve)),Be=Object(R.a)(Object(R.a)({},Le.attribute),{},{title:typeof Le.title=="string"?Le.title:void 0,className:we,role:Le.role||"menuitem","aria-disabled":Le.disabled});Le.role==="option"?Be=Object(R.a)(Object(R.a)({},Be),{},{role:"option","aria-selected":Le.isSelected}):(Le.role===null||Le.role==="none")&&(Be.role="none");var He={onClick:Le.disabled?null:this.onClick,onMouseLeave:Le.disabled?null:this.onMouseLeave,onMouseEnter:Le.disabled?null:this.onMouseEnter},Ye=Object(R.a)({},Le.style);Le.mode==="inline"&&(Le.direction==="rtl"?Ye.paddingRight=Le.inlineIndent*Le.level:Ye.paddingLeft=Le.inlineIndent*Le.level),Z.forEach(function(it){return delete Le[it]}),delete Le.direction;var Ve=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ve=h.createElement(this.props.itemIcon,this.props)),h.createElement("li",Object(s.a)({},Object(N.a)(Le,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Be,He,{style:Ye,ref:this.saveNode}),Le.children,Ve)}}]),Je}(h.Component);Ni.isMenuItem=!0,Ni.defaultProps={onSelect:ue,onMouseEnter:ue,onMouseLeave:ue,manualRef:ue};var Ji=Object(_.b)(function(Ne,Ge){var Je=Ne.activeKey,Fe=Ne.selectedKeys,ve=Ge.eventKey,Le=Ge.subMenuKey;return{active:Je[Le]===ve,isSelected:Array.isArray(Fe)?Fe.indexOf(ve)!==-1:Fe===ve}})(Ni),Gi=Ji,Bt=function(Ne){Object(E.a)(Je,Ne);var Ge=Object(w.a)(Je);function Je(){var Fe;return Object(M.a)(this,Je),Fe=Ge.apply(this,arguments),Fe.renderInnerMenuItem=function(ve){var Le=Fe.props,we=Le.renderMenuItem,Be=Le.index;return we(ve,Be,Fe.props.subMenuKey)},Fe}return Object(A.a)(Je,[{key:"render",value:function(){var ve=Object(s.a)({},this.props),Le=ve.className,we=Le===void 0?"":Le,Be=ve.rootPrefixCls,He="".concat(Be,"-item-group-title"),Ye="".concat(Be,"-item-group-list"),Ve=ve.title,it=ve.children;return Z.forEach(function(ht){return delete ve[ht]}),delete ve.direction,h.createElement("li",Object(s.a)({},ve,{onClick:function(Et){return Et.stopPropagation()},className:"".concat(we," ").concat(Be,"-item-group")}),h.createElement("div",{className:He,title:typeof Ve=="string"?Ve:void 0},Ve),h.createElement("ul",{className:Ye},h.Children.map(it,this.renderInnerMenuItem)))}}]),Je}(h.Component);Bt.isMenuItemGroup=!0,Bt.defaultProps={disabled:!0};var ar=Bt,Kt=function(Ge){var Je=Ge.className,Fe=Ge.rootPrefixCls,ve=Ge.style;return h.createElement("li",{className:"".concat(Je," ").concat(Fe,"-item-divider"),style:ve})};Kt.defaultProps={disabled:!0,className:"",style:{}};var xr=Kt,Dr=ta,Br=P("eDIo");function Or(Ne,Ge){var Je=Ne.prefixCls,Fe=Ne.editable,ve=Ne.locale,Le=Ne.style;return!Fe||Fe.showAdd===!1?null:h.createElement("button",{ref:Ge,type:"button",className:"".concat(Je,"-nav-add"),style:Le,"aria-label":(ve==null?void 0:ve.addAriaLabel)||"Add tab",onClick:function(Be){Fe.onEdit("add",{event:Be})}},Fe.addIcon||"+")}var un=h.forwardRef(Or);function Pn(Ne,Ge){var Je=Ne.prefixCls,Fe=Ne.id,ve=Ne.tabs,Le=Ne.locale,we=Ne.mobile,Be=Ne.moreIcon,He=Be===void 0?"More":Be,Ye=Ne.moreTransitionName,Ve=Ne.style,it=Ne.className,ht=Ne.editable,Et=Ne.tabBarGutter,xt=Ne.rtl,Rt=Ne.onTabClick,Yt=Object(h.useState)(!1),gr=Object(u.a)(Yt,2),yr=gr[0],wr=gr[1],Ar=Object(h.useState)(null),_r=Object(u.a)(Ar,2),Cr=_r[0],zr=_r[1],Pr="".concat(Fe,"-more-popup"),kn="".concat(Je,"-dropdown"),Ir=Cr!==null?"".concat(Pr,"-").concat(Cr):null,nr=Le==null?void 0:Le.dropdownAriaLabel,qt=h.createElement(Dr,{onClick:function(yn){var fn=yn.key,Wn=yn.domEvent;Rt(fn,Wn),wr(!1)},id:Pr,tabIndex:-1,role:"listbox","aria-activedescendant":Ir,selectedKeys:[Cr],"aria-label":nr!==void 0?nr:"expanded dropdown"},ve.map(function(nn){return h.createElement(Gi,{key:nn.key,id:"".concat(Pr,"-").concat(nn.key),role:"option","aria-controls":Fe&&"".concat(Fe,"-panel-").concat(nn.key),disabled:nn.disabled},nn.tab)}));function Nr(nn){for(var yn=ve.filter(function(vi){return!vi.disabled}),fn=yn.findIndex(function(vi){return vi.key===Cr})||0,Wn=yn.length,ti=0;ti<Wn;ti+=1){fn=(fn+nn+Wn)%Wn;var In=yn[fn];if(!In.disabled){zr(In.key);return}}}function Kr(nn){var yn=nn.which;if(!yr){[v.a.DOWN,v.a.SPACE,v.a.ENTER].includes(yn)&&(wr(!0),nn.preventDefault());return}switch(yn){case v.a.UP:Nr(-1),nn.preventDefault();break;case v.a.DOWN:Nr(1),nn.preventDefault();break;case v.a.ESC:wr(!1);break;case v.a.SPACE:case v.a.ENTER:Cr!==null&&Rt(Cr,nn);break}}Object(h.useEffect)(function(){var nn=document.getElementById(Ir);nn&&nn.scrollIntoView&&nn.scrollIntoView(!1)},[Cr]),Object(h.useEffect)(function(){yr||zr(null)},[yr]);var zt=Object(L.a)({},xt?"marginLeft":"marginRight",Et);ve.length||(zt.visibility="hidden",zt.order=1);var Jr=C()(Object(L.a)({},"".concat(kn,"-rtl"),xt)),Ln=we?null:h.createElement(Br.a,{prefixCls:kn,overlay:qt,trigger:["hover"],visible:yr,transitionName:Ye,onVisibleChange:wr,overlayClassName:Jr,mouseEnterDelay:.1,mouseLeaveDelay:.1},h.createElement("button",{type:"button",className:"".concat(Je,"-nav-more"),style:zt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Pr,id:"".concat(Fe,"-more"),"aria-expanded":yr,onKeyDown:Kr},He));return h.createElement("div",{className:C()("".concat(Je,"-nav-operations"),it),style:Ve,ref:Ge},Ln,h.createElement(un,{prefixCls:Je,locale:Le,editable:ht}))}var Er=h.forwardRef(Pn),Ri=Object(h.createContext)(null),Gt=.1,or=.01,sr=20,vn=Math.pow(.995,sr);function Di(){var Ne=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ne)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ne.substr(0,4)))}function Vi(Ne,Ge){var Je=Object(h.useState)(),Fe=Object(u.a)(Je,2),ve=Fe[0],Le=Fe[1],we=Object(h.useState)(0),Be=Object(u.a)(we,2),He=Be[0],Ye=Be[1],Ve=Object(h.useState)(0),it=Object(u.a)(Ve,2),ht=it[0],Et=it[1],xt=Object(h.useState)(),Rt=Object(u.a)(xt,2),Yt=Rt[0],gr=Rt[1],yr=Object(h.useRef)();function wr(nr){var qt=nr.touches[0],Nr=qt.screenX,Kr=qt.screenY;Le({x:Nr,y:Kr}),window.clearInterval(yr.current)}function Ar(nr){if(!ve)return;nr.preventDefault();var qt=nr.touches[0],Nr=qt.screenX,Kr=qt.screenY;Le({x:Nr,y:Kr});var zt=Nr-ve.x,Jr=Kr-ve.y;Ge(zt,Jr);var Ln=Date.now();Ye(Ln),Et(Ln-He),gr({x:zt,y:Jr})}function _r(){if(!ve)return;if(Le(null),gr(null),Yt){var nr=Yt.x/ht,qt=Yt.y/ht,Nr=Math.abs(nr),Kr=Math.abs(qt);if(Math.max(Nr,Kr)<Gt)return;var zt=nr,Jr=qt;yr.current=window.setInterval(function(){if(Math.abs(zt)<or&&Math.abs(Jr)<or){window.clearInterval(yr.current);return}zt*=vn,Jr*=vn,Ge(zt*sr,Jr*sr)},sr)}}var Cr=Object(h.useRef)(0),zr=Object(h.useRef)(!1),Pr=Object(h.useRef)();function kn(nr){var qt=nr.deltaX,Nr=nr.deltaY,Kr=0,zt=Math.abs(qt),Jr=Math.abs(Nr);zt===Jr?Kr=Pr.current==="x"?qt:Nr:zt>Jr?(Kr=qt,Pr.current="x"):(Kr=Nr,Pr.current="y");var Ln=Date.now();Ln-Cr.current>100&&(zr.current=!1),(Ge(-Kr,-Kr)||zr.current)&&(nr.preventDefault(),zr.current=!0),Cr.current=Ln}var Ir=Object(h.useRef)(null);Ir.current={onTouchStart:wr,onTouchMove:Ar,onTouchEnd:_r,onWheel:kn},h.useEffect(function(){function nr(zt){Ir.current.onTouchStart(zt)}function qt(zt){Ir.current.onTouchMove(zt)}function Nr(zt){Ir.current.onTouchEnd(zt)}function Kr(zt){Ir.current.onWheel(zt)}return document.addEventListener("touchmove",qt,{passive:!1}),document.addEventListener("touchend",Nr,{passive:!1}),Ne.current.addEventListener("touchstart",nr,{passive:!1}),Ne.current.addEventListener("wheel",Kr),function(){document.removeEventListener("touchmove",qt),document.removeEventListener("touchend",Nr)}},[])}function rr(){var Ne=Object(h.useRef)(new Map);function Ge(Fe){return Ne.current.has(Fe)||Ne.current.set(Fe,h.createRef()),Ne.current.get(Fe)}function Je(Fe){Ne.current.delete(Fe)}return[Ge,Je]}function Mt(Ne,Ge){var Je=h.useRef(Ne),Fe=h.useState({}),ve=Object(u.a)(Fe,2),Le=ve[1];function we(Be){var He=typeof Be=="function"?Be(Je.current):Be;He!==Je.current&&Ge(He,Je.current),Je.current=He,Le({})}return[Je.current,we]}var pr=function(Ge){var Je=Ge.position,Fe=Ge.prefixCls,ve=Ge.extra;if(!ve)return null;var Le,we=ve;return Je==="right"&&(Le=we.right||!we.left&&we||null),Je==="left"&&(Le=we.left||null),Le?h.createElement("div",{className:"".concat(Fe,"-extra-content")},Le):null};function mr(Ne,Ge){var Je,Fe=h.useContext(Ri),ve=Fe.prefixCls,Le=Fe.tabs,we=Ne.className,Be=Ne.style,He=Ne.id,Ye=Ne.animated,Ve=Ne.activeKey,it=Ne.rtl,ht=Ne.extra,Et=Ne.editable,xt=Ne.locale,Rt=Ne.tabPosition,Yt=Ne.tabBarGutter,gr=Ne.children,yr=Ne.onTabClick,wr=Ne.onTabScroll,Ar=Object(h.useRef)(),_r=Object(h.useRef)(),Cr=Object(h.useRef)(),zr=Object(h.useRef)(),Pr=rr(),kn=Object(u.a)(Pr,2),Ir=kn[0],nr=kn[1],qt=Rt==="top"||Rt==="bottom",Nr=Mt(0,function(cn,Wr){qt&&wr&&wr({direction:cn>Wr?"left":"right"})}),Kr=Object(u.a)(Nr,2),zt=Kr[0],Jr=Kr[1],Ln=Mt(0,function(cn,Wr){!qt&&wr&&wr({direction:cn>Wr?"top":"bottom"})}),nn=Object(u.a)(Ln,2),yn=nn[0],fn=nn[1],Wn=Object(h.useState)(0),ti=Object(u.a)(Wn,2),In=ti[0],vi=ti[1],Fi=Object(h.useState)(0),wi=Object(u.a)(Fi,2),ri=wi[0],Sn=wi[1],bn=Object(h.useState)(0),Nn=Object(u.a)(bn,2),Mn=Nn[0],Bi=Nn[1],ra=Object(h.useState)(0),na=Object(u.a)(ra,2),pn=na[0],Yi=na[1],ia=Object(h.useState)(null),Cn=Object(u.a)(ia,2),dn=Cn[0],ni=Cn[1],To=Object(h.useState)(null),eo=Object(u.a)(To,2),aa=eo[0],va=eo[1],Pa=Object(h.useState)(0),to=Object(u.a)(Pa,2),Ia=to[0],Xo=to[1],Yo=Object(h.useState)(0),_o=Object(u.a)(Yo,2),ro=_o[0],no=_o[1],ya=b(new Map),ba=Object(u.a)(ya,2),$o=ba[0],Na=ba[1],Oa=g(Le,$o,In),xa="".concat(ve,"-nav-operations-hidden"),Ea=0,Wi=0;qt?it?(Ea=0,Wi=Math.max(0,In-dn)):(Ea=Math.min(0,dn-In),Wi=0):(Ea=Math.min(0,aa-ri),Wi=0);function ca(cn){return cn<Ea?[Ea,!1]:cn>Wi?[Wi,!1]:[cn,!0]}var oa=Object(h.useRef)(),Aa=Object(h.useState)(),da=Object(u.a)(Aa,2),ja=da[0],io=da[1];function Ua(){io(Date.now())}function ao(){window.clearTimeout(oa.current)}Vi(Ar,function(cn,Wr){var ii=!1;function Si(wa,Qi){wa(function(ka){var la=ca(ka+Qi),ai=Object(u.a)(la,2),Wa=ai[0],so=ai[1];return ii=so,Wa})}if(qt){if(dn>=In)return ii;Si(Jr,cn)}else{if(aa>=ri)return ii;Si(fn,Wr)}return ao(),Ua(),ii}),Object(h.useEffect)(function(){return ao(),ja&&(oa.current=window.setTimeout(function(){io(0)},100)),ao},[ja]);function sa(){var cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ve,Wr=Oa.get(cn);if(!Wr)return;if(qt){var ii=zt;it?Wr.right<zt?ii=Wr.right:Wr.right+Wr.width>zt+dn&&(ii=Wr.right+Wr.width-dn):Wr.left<-zt?ii=-Wr.left:Wr.left+Wr.width>-zt+dn&&(ii=-(Wr.left+Wr.width-dn)),fn(0),Jr(ca(ii)[0])}else{var Si=yn;Wr.top<-yn?Si=-Wr.top:Wr.top+Wr.height>-yn+aa&&(Si=-(Wr.top+Wr.height-aa)),Jr(0),fn(ca(Si)[0])}}var ha=y(Oa,{width:dn,height:aa,left:zt,top:yn},{width:Mn,height:pn},{width:Ia,height:ro},Object(R.a)(Object(R.a)({},Ne),{},{tabs:Le})),Oo=Object(u.a)(ha,2),Jo=Oo[0],Qo=Oo[1],Zo=Le.map(function(cn){var Wr=cn.key;return h.createElement(n,{id:He,prefixCls:ve,key:Wr,rtl:it,tab:cn,closable:cn.closable,editable:Et,active:Wr===Ve,tabPosition:Rt,tabBarGutter:Yt,renderWrapper:gr,removeAriaLabel:xt==null?void 0:xt.removeAriaLabel,ref:Ir(Wr),onClick:function(Si){yr(Wr,Si)},onRemove:function(){nr(Wr)},onFocus:function(){sa(Wr),Ua(),it||(Ar.current.scrollLeft=0),Ar.current.scrollTop=0}})}),oo=f(function(){var cn,Wr,ii,Si,wa,Qi,ka,la,ai,Wa=((cn=Ar.current)===null||cn===void 0?void 0:cn.offsetWidth)||0,so=((Wr=Ar.current)===null||Wr===void 0?void 0:Wr.offsetHeight)||0,lo=((ii=zr.current)===null||ii===void 0?void 0:ii.offsetWidth)||0,Ti=((Si=zr.current)===null||Si===void 0?void 0:Si.offsetHeight)||0,sn=((wa=Cr.current)===null||wa===void 0?void 0:wa.offsetWidth)||0,zi=((Qi=Cr.current)===null||Qi===void 0?void 0:Qi.offsetHeight)||0;ni(Wa),va(so),Xo(lo),no(Ti);var Zi=(((ka=_r.current)===null||ka===void 0?void 0:ka.offsetWidth)||0)-lo,qi=(((la=_r.current)===null||la===void 0?void 0:la.offsetHeight)||0)-Ti;vi(Zi),Sn(qi);var uo=(ai=Cr.current)===null||ai===void 0?void 0:ai.className.includes(xa);Bi(Zi-(uo?0:sn)),Yi(qi-(uo?0:zi)),Na(function(){var Ha=new Map;return Le.forEach(function(Lo){var Mo=Lo.key,pa=Ir(Mo).current;pa&&Ha.set(Mo,{width:pa.offsetWidth,height:pa.offsetHeight,left:pa.offsetLeft,top:pa.offsetTop})}),Ha})}),qo=Le.slice(0,Jo),Ci=Le.slice(Qo+1),Gn=[].concat(Object(i.a)(qo),Object(i.a)(Ci)),mi=Object(h.useState)(),Vn=Object(u.a)(mi,2),Ra=Vn[0],es=Vn[1],Hi=Oa.get(Ve),Ao=Object(h.useRef)();function Ro(){l.a.cancel(Ao.current)}Object(h.useEffect)(function(){var cn={};return Hi&&(qt?(it?cn.right=Hi.right:cn.left=Hi.left,cn.width=Hi.width):(cn.top=Hi.top,cn.height=Hi.height)),Ro(),Ao.current=l()(function(){es(cn)}),Ro},[Hi,qt,it]),Object(h.useEffect)(function(){sa()},[Ve,Hi,Oa,qt]),Object(h.useEffect)(function(){oo()},[it,Yt,Ve,Le.map(function(cn){return cn.key}).join("_")]);var Do=!!Gn.length,fa="".concat(ve,"-nav-wrap"),Fa,Da,ko,Ba;return qt?it?(Da=zt>0,Fa=zt+dn<In):(Fa=zt<0,Da=-zt+dn<In):(ko=yn<0,Ba=-yn+aa<ri),h.createElement("div",{ref:Ge,role:"tablist",className:C()("".concat(ve,"-nav"),we),style:Be,onKeyDown:function(){Ua()}},h.createElement(pr,{position:"left",extra:ht,prefixCls:ve}),h.createElement(p.a,{onResize:oo},h.createElement("div",{className:C()(fa,(Je={},Object(L.a)(Je,"".concat(fa,"-ping-left"),Fa),Object(L.a)(Je,"".concat(fa,"-ping-right"),Da),Object(L.a)(Je,"".concat(fa,"-ping-top"),ko),Object(L.a)(Je,"".concat(fa,"-ping-bottom"),Ba),Je)),ref:Ar},h.createElement(p.a,{onResize:oo},h.createElement("div",{ref:_r,className:"".concat(ve,"-nav-list"),style:{transform:"translate(".concat(zt,"px, ").concat(yn,"px)"),transition:ja?"none":void 0}},Zo,h.createElement(un,{ref:zr,prefixCls:ve,locale:xt,editable:Et,style:{visibility:Do?"hidden":null}}),h.createElement("div",{className:C()("".concat(ve,"-ink-bar"),Object(L.a)({},"".concat(ve,"-ink-bar-animated"),Ye.inkBar)),style:Ra}))))),h.createElement(Er,Object.assign({},Ne,{ref:Cr,prefixCls:ve,tabs:Gn,className:!Do&&xa})),h.createElement(pr,{position:"right",extra:ht,prefixCls:ve}))}var tn=h.forwardRef(mr);function Tr(Ne){var Ge=Ne.id,Je=Ne.activeKey,Fe=Ne.animated,ve=Ne.tabPosition,Le=Ne.rtl,we=Ne.destroyInactiveTabPane,Be=h.useContext(Ri),He=Be.prefixCls,Ye=Be.tabs,Ve=Fe.tabPane,it=Ye.findIndex(function(ht){return ht.key===Je});return h.createElement("div",{className:C()("".concat(He,"-content-holder"))},h.createElement("div",{className:C()("".concat(He,"-content"),"".concat(He,"-content-").concat(ve),Object(L.a)({},"".concat(He,"-content-animated"),Ve)),style:it&&Ve?Object(L.a)({},Le?"marginRight":"marginLeft","-".concat(it,"00%")):null},Ye.map(function(ht){return h.cloneElement(ht.node,{key:ht.key,prefixCls:He,tabKey:ht.key,id:Ge,animated:Ve,active:ht.key===Je,destroyInactiveTabPane:we})})))}function Dn(Ne){var Ge=Ne.prefixCls,Je=Ne.forceRender,Fe=Ne.className,ve=Ne.style,Le=Ne.id,we=Ne.active,Be=Ne.animated,He=Ne.destroyInactiveTabPane,Ye=Ne.tabKey,Ve=Ne.children,it=h.useState(Je),ht=Object(u.a)(it,2),Et=ht[0],xt=ht[1];h.useEffect(function(){we?xt(!0):He&&xt(!1)},[we,He]);var Rt={};return we||(Be?(Rt.visibility="hidden",Rt.height=0,Rt.overflowY="hidden"):Rt.display="none"),h.createElement("div",{id:Le&&"".concat(Le,"-panel-").concat(Ye),role:"tabpanel",tabIndex:we?0:-1,"aria-labelledby":Le&&"".concat(Le,"-tab-").concat(Ye),"aria-hidden":!we,style:Object(R.a)(Object(R.a)({},Rt),ve),className:C()("".concat(Ge,"-tabpane"),we&&"".concat(Ge,"-tabpane-active"),Fe)},(we||Et||Je)&&Ve)}var wn=0;function ki(Ne){return Object(c.a)(Ne).map(function(Ge){if(h.isValidElement(Ge)){var Je=Ge.key!==void 0?String(Ge.key):void 0;return Object(R.a)(Object(R.a)({key:Je},Ge.props),{},{node:Ge})}return null}).filter(function(Ge){return Ge})}function Bn(Ne,Ge){var Je,Fe=Ne.id,ve=Ne.prefixCls,Le=ve===void 0?"rc-tabs":ve,we=Ne.className,Be=Ne.children,He=Ne.direction,Ye=Ne.activeKey,Ve=Ne.defaultActiveKey,it=Ne.editable,ht=Ne.animated,Et=Ne.tabPosition,xt=Et===void 0?"top":Et,Rt=Ne.tabBarGutter,Yt=Ne.tabBarStyle,gr=Ne.tabBarExtraContent,yr=Ne.locale,wr=Ne.moreIcon,Ar=Ne.moreTransitionName,_r=Ne.destroyInactiveTabPane,Cr=Ne.renderTabBar,zr=Ne.onChange,Pr=Ne.onTabClick,kn=Ne.onTabScroll,Ir=Object(S.a)(Ne,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),nr=ki(Be),qt=He==="rtl",Nr;ht===!1?Nr={inkBar:!1,tabPane:!1}:Nr=Object(R.a)({inkBar:!0,tabPane:!1},ht!==!0?ht:null);var Kr=Object(h.useState)(!1),zt=Object(u.a)(Kr,2),Jr=zt[0],Ln=zt[1];Object(h.useEffect)(function(){Ln(Di())},[]);var nn=Object(a.a)(function(){var pn;return(pn=nr[0])===null||pn===void 0?void 0:pn.key},{value:Ye,defaultValue:Ve}),yn=Object(u.a)(nn,2),fn=yn[0],Wn=yn[1],ti=Object(h.useState)(function(){return nr.findIndex(function(pn){return pn.key===fn})}),In=Object(u.a)(ti,2),vi=In[0],Fi=In[1];Object(h.useEffect)(function(){var pn=nr.findIndex(function(ia){return ia.key===fn});if(pn===-1){var Yi;pn=Math.max(0,Math.min(vi,nr.length-1)),Wn((Yi=nr[pn])===null||Yi===void 0?void 0:Yi.key)}Fi(pn)},[nr.map(function(pn){return pn.key}).join("_"),fn,vi]);var wi=Object(a.a)(null,{value:Fe}),ri=Object(u.a)(wi,2),Sn=ri[0],bn=ri[1],Nn=xt;Jr&&!["left","right"].includes(xt)&&(Nn="top"),Object(h.useEffect)(function(){Fe||(bn("rc-tabs-".concat(wn)),wn+=1)},[]);function Mn(pn,Yi){Pr==null||Pr(pn,Yi),Wn(pn),zr==null||zr(pn)}var Bi={id:Sn,activeKey:fn,animated:Nr,tabPosition:Nn,rtl:qt,mobile:Jr},ra,na=Object(R.a)(Object(R.a)({},Bi),{},{editable:it,locale:yr,moreIcon:wr,moreTransitionName:Ar,tabBarGutter:Rt,onTabClick:Mn,onTabScroll:kn,extra:gr,style:Yt,panes:Be});return Cr?ra=Cr(na,tn):ra=h.createElement(tn,Object.assign({},na)),h.createElement(Ri.Provider,{value:{tabs:nr,prefixCls:Le}},h.createElement("div",Object.assign({ref:Ge,id:Fe,className:C()(Le,"".concat(Le,"-").concat(Nn),(Je={},Object(L.a)(Je,"".concat(Le,"-mobile"),Jr),Object(L.a)(Je,"".concat(Le,"-editable"),it),Object(L.a)(Je,"".concat(Le,"-rtl"),qt),Je),we)},Ir),ra,h.createElement(Tr,Object.assign({destroyInactiveTabPane:_r},Bi,{animated:Nr}))))}var Kn=h.forwardRef(Bn);Kn.TabPane=Dn;var $n=Kn,Xi=J.b=$n},kSUc:function(I,J,P){},lOMy:function(I,J,P){},lPiR:function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(u){var S=L,R=S.lib,h=R.WordArray,o=R.Hasher,C=S.algo,c=[],a=[];(function(){function l(v){for(var m=u.sqrt(v),n=2;n<=m;n++)if(!(v%n))return!1;return!0}function p(v){return(v-(v|0))*4294967296|0}for(var f=2,b=0;b<64;)l(f)&&(b<8&&(c[b]=p(u.pow(f,1/2))),a[b]=p(u.pow(f,1/3)),b++),f++})();var i=[],r=C.SHA256=o.extend({_doReset:function(){this._hash=new h.init(c.slice(0))},_doProcessBlock:function(l,p){for(var f=this._hash.words,b=f[0],v=f[1],m=f[2],n=f[3],d=f[4],g=f[5],T=f[6],y=f[7],s=0;s<64;s++){if(s<16)i[s]=l[p+s]|0;else{var M=i[s-15],A=(M<<25|M>>>7)^(M<<14|M>>>18)^M>>>3,x=i[s-2],E=(x<<15|x>>>17)^(x<<13|x>>>19)^x>>>10;i[s]=A+i[s-7]+E+i[s-16]}var w=d&g^~d&T,_=b&v^b&m^v&m,N=(b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22),j=(d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25),k=y+j+w+a[s]+i[s],z=N+_;y=T,T=g,g=d,d=n+k|0,n=m,m=v,v=b,b=k+z|0}f[0]=f[0]+b|0,f[1]=f[1]+v|0,f[2]=f[2]+m|0,f[3]=f[3]+n|0,f[4]=f[4]+d|0,f[5]=f[5]+g|0,f[6]=f[6]+T|0,f[7]=f[7]+y|0},_doFinalize:function(){var l=this._data,p=l.words,f=this._nDataBytes*8,b=l.sigBytes*8;return p[b>>>5]|=128<<24-b%32,p[(b+64>>>9<<4)+14]=u.floor(f/4294967296),p[(b+64>>>9<<4)+15]=f,l.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var l=o.clone.call(this);return l._hash=this._hash.clone(),l}});S.SHA256=o._createHelper(r),S.HmacSHA256=o._createHmacHelper(r)}(Math),L.SHA256})},lZu9:function(I,J,P){(function(L){L(P("VrN/"),P("1eCo"),P("8EBN"))})(function(L){"use strict";L.defineMode("markdown",function(u,S){var R=L.getMode(u,"text/html"),h=R.name=="null";function o(B){if(L.findModeByName){var W=L.findModeByName(B);W&&(B=W.mime||W.mimes[0])}var K=L.getMode(u,B);return K.name=="null"?null:K}S.highlightFormatting===void 0&&(S.highlightFormatting=!1),S.maxBlockquoteDepth===void 0&&(S.maxBlockquoteDepth=0),S.taskLists===void 0&&(S.taskLists=!1),S.strikethrough===void 0&&(S.strikethrough=!1),S.emoji===void 0&&(S.emoji=!1),S.fencedCodeBlockHighlighting===void 0&&(S.fencedCodeBlockHighlighting=!0),S.fencedCodeBlockDefaultMode===void 0&&(S.fencedCodeBlockDefaultMode="text/plain"),S.xml===void 0&&(S.xml=!0),S.tokenTypeOverrides===void 0&&(S.tokenTypeOverrides={});var C={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 C)C.hasOwnProperty(c)&&S.tokenTypeOverrides[c]&&(C[c]=S.tokenTypeOverrides[c]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,i=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,r=/^\[(x| )\](?=\s)/i,l=S.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,b=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,v=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 d(B,W,K){return W.f=W.inline=K,K(B,W)}function g(B,W,K){return W.f=W.block=K,K(B,W)}function T(B){return!B||!/\S/.test(B.string)}function y(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==M){var W=h;if(!W){var K=L.innerMode(R,B.htmlState);W=K.mode.name=="xml"&&K.state.tagStart===null&&!K.state.context&&K.state.tokenize.isInText}W&&(B.f=w,B.block=s,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function s(B,W){var K=B.column()===W.indentation,q=T(W.prevLine.stream),re=W.indentedCode,ee=W.prevLine.hr,Ce=W.list!==!1,xe=(W.listStack[W.listStack.length-1]||0)+3;W.indentedCode=!1;var he=W.indentation;if(W.indentationDiff===null&&(W.indentationDiff=W.indentation,Ce)){for(W.list=null;he<W.listStack[W.listStack.length-1];)W.listStack.pop(),W.listStack.length?W.indentation=W.listStack[W.listStack.length-1]:W.list=!1;W.list!==!1&&(W.indentationDiff=he-W.listStack[W.listStack.length-1])}var ke=!q&&!ee&&!W.prevLine.header&&(!Ce||!re)&&!W.prevLine.fencedCodeEnd,_e=(W.list===!1||ee||q)&&W.indentation<=xe&&B.match(a),de=null;if(W.indentationDiff>=4&&(re||W.prevLine.fencedCodeEnd||W.prevLine.header||q))return B.skipToEnd(),W.indentedCode=!0,C.code;if(B.eatSpace())return null;if(K&&W.indentation<=xe&&(de=B.match(l))&&de[1].length<=6)return W.quote=0,W.header=de[1].length,W.thisLine.header=!0,S.highlightFormatting&&(W.formatting="header"),W.f=W.inline,x(W);if(W.indentation<=xe&&B.eat(">"))return W.quote=K?1:W.quote+1,S.highlightFormatting&&(W.formatting="quote"),B.eatSpace(),x(W);if(!_e&&!W.setext&&K&&W.indentation<=xe&&(de=B.match(i))){var ce=de[1]?"ol":"ul";return W.indentation=he+B.current().length,W.list=!0,W.quote=0,W.listStack.push(W.indentation),W.em=!1,W.strong=!1,W.code=!1,W.strikethrough=!1,S.taskLists&&B.match(r,!1)&&(W.taskList=!0),W.f=W.inline,S.highlightFormatting&&(W.formatting=["list","list-"+ce]),x(W)}else{if(K&&W.indentation<=xe&&(de=B.match(b,!0)))return W.quote=0,W.fencedEndRE=new RegExp(de[1]+"+ *$"),W.localMode=S.fencedCodeBlockHighlighting&&o(de[2]||S.fencedCodeBlockDefaultMode),W.localMode&&(W.localState=L.startState(W.localMode)),W.f=W.block=A,S.highlightFormatting&&(W.formatting="code-block"),W.code=-1,x(W);if(W.setext||(!ke||!Ce)&&!W.quote&&W.list===!1&&!W.code&&!_e&&!v.test(B.string)&&(de=B.lookAhead(1))&&(de=de.match(p)))return W.setext?(W.header=W.setext,W.setext=0,B.skipToEnd(),S.highlightFormatting&&(W.formatting="header")):(W.header=de[0].charAt(0)=="="?1:2,W.setext=W.header),W.thisLine.header=!0,W.f=W.inline,x(W);if(_e)return B.skipToEnd(),W.hr=!0,W.thisLine.hr=!0,C.hr;if(B.peek()==="[")return d(B,W,z)}return d(B,W,W.inline)}function M(B,W){var K=R.token(B,W.htmlState);if(!h){var q=L.innerMode(R,W.htmlState);(q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText||W.md_inside&&B.current().indexOf(">")>-1)&&(W.f=w,W.block=s,W.htmlState=null)}return K}function A(B,W){var K=W.listStack[W.listStack.length-1]||0,q=W.indentation<K,re=K+3;if(W.fencedEndRE&&W.indentation<=re&&(q||B.match(W.fencedEndRE))){S.highlightFormatting&&(W.formatting="code-block");var ee;return q||(ee=x(W)),W.localMode=W.localState=null,W.block=s,W.f=w,W.fencedEndRE=null,W.code=0,W.thisLine.fencedCodeEnd=!0,q?g(B,W,W.block):ee}else return W.localMode?W.localMode.token(B,W.localState):(B.skipToEnd(),C.code)}function x(B){var W=[];if(B.formatting){W.push(C.formatting),typeof B.formatting=="string"&&(B.formatting=[B.formatting]);for(var K=0;K<B.formatting.length;K++)W.push(C.formatting+"-"+B.formatting[K]),B.formatting[K]==="header"&&W.push(C.formatting+"-"+B.formatting[K]+"-"+B.header),B.formatting[K]==="quote"&&(!S.maxBlockquoteDepth||S.maxBlockquoteDepth>=B.quote?W.push(C.formatting+"-"+B.formatting[K]+"-"+B.quote):W.push("error"))}if(B.taskOpen)return W.push("meta"),W.length?W.join(" "):null;if(B.taskClosed)return W.push("property"),W.length?W.join(" "):null;if(B.linkHref?W.push(C.linkHref,"url"):(B.strong&&W.push(C.strong),B.em&&W.push(C.em),B.strikethrough&&W.push(C.strikethrough),B.emoji&&W.push(C.emoji),B.linkText&&W.push(C.linkText),B.code&&W.push(C.code),B.image&&W.push(C.image),B.imageAltText&&W.push(C.imageAltText,"link"),B.imageMarker&&W.push(C.imageMarker)),B.header&&W.push(C.header,C.header+"-"+B.header),B.quote&&(W.push(C.quote),!S.maxBlockquoteDepth||S.maxBlockquoteDepth>=B.quote?W.push(C.quote+"-"+B.quote):W.push(C.quote+"-"+S.maxBlockquoteDepth)),B.list!==!1){var q=(B.listStack.length-1)%3;q?q===1?W.push(C.list2):W.push(C.list3):W.push(C.list1)}return B.trailingSpaceNewLine?W.push("trailing-space-new-line"):B.trailingSpace&&W.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),W.length?W.join(" "):null}function E(B,W){return B.match(f,!0)?x(W):void 0}function w(B,W){var K=W.text(B,W);if(typeof K!="undefined")return K;if(W.list)return W.list=null,x(W);if(W.taskList){var q=B.match(r,!0)[1]===" ";return q?W.taskOpen=!0:W.taskClosed=!0,S.highlightFormatting&&(W.formatting="task"),W.taskList=!1,x(W)}if(W.taskOpen=!1,W.taskClosed=!1,W.header&&B.match(/^#+$/,!0))return S.highlightFormatting&&(W.formatting="header"),x(W);var re=B.next();if(W.linkTitle){W.linkTitle=!1;var ee=re;re==="("&&(ee=")"),ee=(ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ce="^\\s*(?:[^"+ee+"\\\\]+|\\\\\\\\|\\\\.)"+ee;if(B.match(new RegExp(Ce),!0))return C.linkHref}if(re==="`"){var xe=W.formatting;S.highlightFormatting&&(W.formatting="code"),B.eatWhile("`");var he=B.current().length;if(W.code==0&&(!W.quote||he==1))return W.code=he,x(W);if(he==W.code){var ke=x(W);return W.code=0,ke}else return W.formatting=xe,x(W)}else if(W.code)return x(W);if(re==="\\"&&(B.next(),S.highlightFormatting)){var _e=x(W),de=C.formatting+"-escape";return _e?_e+" "+de:de}if(re==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return W.imageMarker=!0,W.image=!0,S.highlightFormatting&&(W.formatting="image"),x(W);if(re==="["&&W.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return W.imageMarker=!1,W.imageAltText=!0,S.highlightFormatting&&(W.formatting="image"),x(W);if(re==="]"&&W.imageAltText){S.highlightFormatting&&(W.formatting="image");var _e=x(W);return W.imageAltText=!1,W.image=!1,W.inline=W.f=N,_e}if(re==="["&&!W.image)return W.linkText&&B.match(/^.*?\]/)||(W.linkText=!0,S.highlightFormatting&&(W.formatting="link")),x(W);if(re==="]"&&W.linkText){S.highlightFormatting&&(W.formatting="link");var _e=x(W);return W.linkText=!1,W.inline=W.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?N:w,_e}if(re==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){W.f=W.inline=_,S.highlightFormatting&&(W.formatting="link");var _e=x(W);return _e?_e+=" ":_e="",_e+C.linkInline}if(re==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){W.f=W.inline=_,S.highlightFormatting&&(W.formatting="link");var _e=x(W);return _e?_e+=" ":_e="",_e+C.linkEmail}if(S.xml&&re==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=B.string.indexOf(">",B.pos);if(ce!=-1){var ae=B.string.substring(B.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ae)&&(W.md_inside=!0)}return B.backUp(1),W.htmlState=L.startState(R),g(B,W,M)}if(S.xml&&re==="<"&&B.match(/^\/\w*?>/))return W.md_inside=!1,"tag";if(re==="*"||re==="_"){for(var Se=1,te=B.pos==1?" ":B.string.charAt(B.pos-2);Se<3&&B.eat(re);)Se++;var ue=B.peek()||" ",Oe=!/\s/.test(ue)&&(!m.test(ue)||/\s/.test(te)||m.test(te)),le=!/\s/.test(te)&&(!m.test(te)||/\s/.test(ue)||m.test(ue)),Q=null,Y=null;if(Se%2&&(!W.em&&Oe&&(re==="*"||!le||m.test(te))?Q=!0:W.em==re&&le&&(re==="*"||!Oe||m.test(ue))&&(Q=!1)),Se>1&&(!W.strong&&Oe&&(re==="*"||!le||m.test(te))?Y=!0:W.strong==re&&le&&(re==="*"||!Oe||m.test(ue))&&(Y=!1)),Y!=null||Q!=null){S.highlightFormatting&&(W.formatting=Q==null?"strong":Y==null?"em":"strong em"),Q===!0&&(W.em=re),Y===!0&&(W.strong=re);var ke=x(W);return Q===!1&&(W.em=!1),Y===!1&&(W.strong=!1),ke}}else if(re===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return x(W);B.backUp(1)}if(S.strikethrough){if(re==="~"&&B.eatWhile(re)){if(W.strikethrough){S.highlightFormatting&&(W.formatting="strikethrough");var ke=x(W);return W.strikethrough=!1,ke}else if(B.match(/^[^\s]/,!1))return W.strikethrough=!0,S.highlightFormatting&&(W.formatting="strikethrough"),x(W)}else if(re===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return x(W);B.backUp(2)}}if(S.emoji&&re===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){W.emoji=!0,S.highlightFormatting&&(W.formatting="emoji");var Z=x(W);return W.emoji=!1,Z}return re===" "&&(B.match(/^ +$/,!1)?W.trailingSpace++:W.trailingSpace&&(W.trailingSpaceNewLine=!0)),x(W)}function _(B,W){var K=B.next();if(K===">"){W.f=W.inline=w,S.highlightFormatting&&(W.formatting="link");var q=x(W);return q?q+=" ":q="",q+C.linkInline}return B.match(/^[^>]+/,!0),C.linkInline}function N(B,W){if(B.eatSpace())return null;var K=B.next();return K==="("||K==="["?(W.f=W.inline=k(K==="("?")":"]"),S.highlightFormatting&&(W.formatting="link-string"),W.linkHref=!0,x(W)):"error"}var j={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function k(B){return function(W,K){var q=W.next();if(q===B){K.f=K.inline=w,S.highlightFormatting&&(K.formatting="link-string");var re=x(K);return K.linkHref=!1,re}return W.match(j[B]),K.linkHref=!0,x(K)}}function z(B,W){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(W.f=H,B.next(),S.highlightFormatting&&(W.formatting="link"),W.linkText=!0,x(W)):d(B,W,w)}function H(B,W){if(B.match(/^\]:/,!0)){W.f=W.inline=F,S.highlightFormatting&&(W.formatting="link");var K=x(W);return W.linkText=!1,K}return B.match(/^([^\]\\]|\\.)+/,!0),C.linkText}function F(B,W){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?W.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),W.f=W.inline=w,C.linkHref+" url")}var G={startState:function(){return{f:s,prevLine:{stream:null},thisLine:{stream:null},block:s,htmlState:null,indentation:0,inline:w,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&&L.copyState(R,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?L.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,W){if(W.formatting=!1,B!=W.thisLine.stream){if(W.header=0,W.hr=!1,B.match(/^\s*$/,!0))return y(W),null;if(W.prevLine=W.thisLine,W.thisLine={stream:B},W.taskList=!1,W.trailingSpace=0,W.trailingSpaceNewLine=!1,!W.localState&&(W.f=W.block,W.f!=M)){var K=B.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(W.indentation=K,W.indentationDiff=null,K>0)return null}}return W.f(B,W)},innerMode:function(B){return B.block==M?{state:B.htmlState,mode:R}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:G}},indent:function(B,W,K){return B.block==M&&R.indent?R.indent(B.htmlState,W,K):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,W,K):L.Pass},blankLine:y,getType:x,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),L.defineMIME("text/markdown","markdown"),L.defineMIME("text/x-markdown","markdown")})},mxV5:function(module,exports,__webpack_require__){(function(global){var require,require;(function(I){if(!0)module.exports=I();else var J})(function(){var define,module,exports;return function(){function I(J,P,L){function u(h,o){if(!P[h]){if(!J[h]){var C=typeof require=="function"&&require;if(!o&&C)return require(h,!0);if(S)return S(h,!0);var c=new Error("Cannot find module '"+h+"'");throw c.code="MODULE_NOT_FOUND",c}var a=P[h]={exports:{}};J[h][0].call(a.exports,function(i){var r=J[h][1][i];return u(r||i)},a,a.exports,I,J,P,L)}return P[h].exports}for(var S=typeof require=="function"&&require,R=0;R<L.length;R++)u(L[R]);return u}return I}()({1:[function(I,J,P){"use strict";var L=I("./browser/client");L.Buffer=I("buffer").Buffer,L.urllib=I("../shims/xhr"),L.version=I("./browser/version").version,J.exports=L},{"../shims/xhr":291,"./browser/client":2,"./browser/version":5,buffer:73}],2:[function(I,J,P){(function(L,u){"use strict";var S=I("babel-runtime/core-js/promise"),R=a(S),h=I("babel-runtime/regenerator"),o=a(h),C=I("babel-runtime/core-js/object/assign"),c=a(C);function a(z){return z&&z.__esModule?z:{default:z}}var i=I("debug")("ali-oss"),r=I("copy-to"),l=I("xml2js"),p=I("agentkeepalive"),f=I("merge-descriptors"),b=I("url"),v=I("is-type-of"),m=I("platform"),n=I("utility"),d=I("urllib"),g=I("./version"),T=I("bowser"),y=I("../common/signUtils"),s=I("../common/utils/isIP"),M=s.isIP,A=I("../common/client/initOptions"),x=I("../common/utils/createRequest"),E=x.createRequest,w=new p;function _(){var z=m.name,H=m.version;z&&z.toLowerCase&&z.toLowerCase()==="ie"&&H.split(".")[0]<10&&console.warn("ali-oss does not support the current browser")}function N(){return location&&location.protocol==="https:"}function j(z,H){if(_(),!(this instanceof j))return new j(z,H);z&&z.inited?this.options=z:this.options=j.initOptions(z),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=d,this.agent=this.options.agent||w),this.ctx=H,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}J.exports=j,j.initOptions=function(H){H.stsToken||console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");var F=(0,c.default)({secure:N(),useFetch:!1},H);return A(F)};var k=j.prototype;k.debug=i,f(k,I("./object")),f(k,I("../common/bucket/getBucketWebsite")),f(k,I("../common/bucket/putBucketWebsite")),f(k,I("../common/bucket/deleteBucketWebsite")),f(k,I("../common/bucket/getBucketLifecycle")),f(k,I("../common/bucket/putBucketLifecycle")),f(k,I("../common/bucket/deleteBucketLifecycle")),f(k,I("../common/bucket/putBucketVersioning")),f(k,I("../common/bucket/getBucketVersioning")),f(k,I("./managed-upload")),f(k,I("../common/multipart")),f(k,I("../common/parallel")),k.signature=function(H){return this.debug("authorization stringToSign: %s",H,"info"),y.computeSignature(this.options.accessKeySecret,H)},k.authorization=function(H,F,G,B){var W=y.buildCanonicalString(H.toUpperCase(),F,{headers:B,parameters:G});return y.authorization(this.options.accessKeyId,this.options.accessKeySecret,W)},k.request=function(H){var F,G,B,W,K,q;return o.default.async(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return F=E.call(this,H),this.options.useFetch||(F.params.mode="disable-fetch"),G=void 0,B=void 0,W=!!H.stream,ee.prev=5,ee.next=8,o.default.awrap(this.urllib.request(F.url,F.params));case 8:G=ee.sent,this.debug("response %s %s, got %s, headers: %j",H.method,F.url,G.status,G.headers,"info"),ee.next=15;break;case 12:ee.prev=12,ee.t0=ee.catch(5),B=ee.t0;case 15:if(K=void 0,!(G&&H.successStatuses&&H.successStatuses.indexOf(G.status)===-1)){ee.next=28;break}return ee.next=19,o.default.awrap(this.requestError(G));case 19:if(K=ee.sent,!(K.code==="RequestTimeTooSkewed"&&!W)){ee.next=25;break}return this.options.amendTimeSkewed=+new Date(K.serverTime)-new Date,ee.next=24,o.default.awrap(this.request(H));case 24:return ee.abrupt("return",ee.sent);case 25:K.params=H,ee.next=32;break;case 28:if(!B){ee.next=32;break}return ee.next=31,o.default.awrap(this.requestError(B));case 31:K=ee.sent;case 32:if(!K){ee.next=34;break}throw K;case 34:if(!H.xmlResponse){ee.next=39;break}return ee.next=37,o.default.awrap(this.parseXML(G.data));case 37:q=ee.sent,G.data=q;case 39:return ee.abrupt("return",G);case 40:case"end":return ee.stop()}},null,this,[[5,12]])},k._getResource=function(H){var F="/";return H.bucket&&(F+=H.bucket+"/"),H.object&&(F+=H.object),F},k._isIP=M,k._escape=function(H){return n.encodeURIComponent(H).replace(/%2F/g,"/")},k._getReqUrl=function(H){var F={};r(this.options.endpoint).to(F);var G=this._isIP(F.hostname),B=this.options.cname;H.bucket&&!B&&!G&&(F.host=H.bucket+"."+F.host);var W="/";H.bucket&&G&&(W+=H.bucket+"/"),H.object&&(W+=this._escape(H.object).replace(/\+/g,"%2B")),F.pathname=W;var K={};if(H.query&&f(K,H.query),H.subres){var q={};v.string(H.subres)?q[H.subres]="":v.array(H.subres)?H.subres.forEach(function(re){q[re]=""}):q=H.subres,f(K,q)}return F.query=K,b.format(F)},k._getUserAgent=function(){var H=u&&u.browser?"js":"nodejs",F="aliyun-sdk-"+H+"/"+g.version,G=m.description;return!G&&u&&(G="Node.js "+u.version.slice(1)+" on "+u.platform+" "+u.arch),this._checkUserAgent(F+" "+G)},k._checkUserAgent=function(H){var F=H.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta");return F},k.checkBrowserAndVersion=function(H,F){return T.name===H&&T.version.split(".")[0]===F},k.parseXML=function(H){return new R.default(function(F,G){L.isBuffer(H)&&(H=H.toString()),l.parseString(H,{explicitRoot:!1,explicitArray:!1},function(B,W){B?G(B):F(W)})})},k.requestError=function(H){var F,G,B,W;return o.default.async(function(q){for(;;)switch(q.prev=q.next){case 0:if(F=null,!(!H.data||!H.data.length)){q.next=5;break}H.status===-1||H.status===-2?(F=new Error(H.message),F.name=H.name,F.status=H.status,F.code=H.name):(H.status===404?(F=new Error("Object not exists"),F.name="NoSuchKeyError",F.status=404,F.code="NoSuchKey"):H.status===412?(F=new Error("Pre condition failed"),F.name="PreconditionFailedError",F.status=412,F.code="PreconditionFailed"):(F=new Error("Unknow error, status: "+H.status),F.name="UnknowError",F.status=H.status),F.requestId=H.headers["x-oss-request-id"],F.host=""),q.next=33;break;case 5:return G=String(H.data),this.debug("request response error data: %s",G,"error"),B=void 0,q.prev=8,q.next=11,o.default.awrap(this.parseXML(G));case 11:if(q.t0=q.sent,q.t0){q.next=14;break}q.t0={};case 14:B=q.t0,q.next=24;break;case 17:return q.prev=17,q.t1=q.catch(8),this.debug(G,"error"),q.t1.message+=`
|
|
|
raw xml: `+G,q.t1.status=H.status,q.t1.requestId=H.headers["x-oss-request-id"],q.abrupt("return",q.t1);case 24:W=B.Message||"unknow request error, status: "+H.status,B.Condition&&(W+=" (condition: "+B.Condition+")"),F=new Error(W),F.name=B.Code?B.Code+"Error":"UnknowError",F.status=H.status,F.code=B.Code,F.requestId=B.RequestId,F.hostId=B.HostId,F.serverTime=B.ServerTime;case 33:return this.debug("generate error %j",F,"error"),q.abrupt("return",F);case 35:case"end":return q.stop()}},null,this,[[8,17]])}}).call(this,{isBuffer:I("../../node_modules/is-buffer/index.js")},I("_process"))},{"../../node_modules/is-buffer/index.js":197,"../common/bucket/deleteBucketLifecycle":6,"../common/bucket/deleteBucketWebsite":7,"../common/bucket/getBucketLifecycle":8,"../common/bucket/getBucketVersioning":9,"../common/bucket/getBucketWebsite":10,"../common/bucket/putBucketLifecycle":11,"../common/bucket/putBucketVersioning":12,"../common/bucket/putBucketWebsite":13,"../common/client/initOptions":15,"../common/multipart":18,"../common/parallel":33,"../common/signUtils":34,"../common/utils/createRequest":38,"../common/utils/isIP":45,"./managed-upload":3,"./object":4,"./version":5,_process:208,agentkeepalive:48,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,bowser:70,"copy-to":76,debug:288,"is-type-of":289,"merge-descriptors":200,platform:206,url:238,urllib:291,utility:290,xml2js:249}],3:[function(I,J,P){(function(L){"use strict";var u=I("babel-runtime/core-js/array/from"),S=c(u),R=I("babel-runtime/core-js/promise"),h=c(R),o=I("babel-runtime/regenerator"),C=c(o);function c(y){return y&&y.__esModule?y:{default:y}}var a=I("is-type-of"),i=I("util"),r=I("path"),l=I("mime"),p=I("copy-to"),f=I("../common/utils/isBlob"),b=f.isBlob,v=I("../common/utils/isFile"),m=v.isFile,n=P;n.multipartUpload=function(s,M,A){var x,E,w,_,N,j,k,z,H;return C.default.async(function(G){for(;;)switch(G.prev=G.next){case 0:if(this.resetCancelFlag(),A=A||{},!(A.checkpoint&&A.checkpoint.uploadId)){G.next=6;break}return G.next=5,C.default.awrap(this._resumeMultipart(A.checkpoint,A));case 5:return G.abrupt("return",G.sent);case 6:return x=100*1024,A.mime||(m(M)?A.mime=l.getType(r.extname(M.name)):b(M)?A.mime=M.type:A.mime=l.getType(r.extname(M))),A.headers=A.headers||{},this._convertMetaToHeaders(A.meta,A.headers),G.next=12,C.default.awrap(this._getFileSize(M));case 12:if(E=G.sent,!(E<x)){G.next=25;break}return w=this._createStream(M,0,E),A.contentLength=E,G.next=18,C.default.awrap(this.putStream(s,w,A));case 18:if(_=G.sent,!(A&&A.progress)){G.next=22;break}return G.next=22,C.default.awrap(A.progress(1));case 22:return N={res:_.res,bucket:this.options.bucket,name:s,etag:_.res.headers.etag},(A.headers&&A.headers["x-oss-callback"]||A.callback)&&(N.data=_.data),G.abrupt("return",N);case 25:if(!(A.partSize&&!(parseInt(A.partSize,10)===A.partSize))){G.next=27;break}throw new Error("partSize must be int number");case 27:if(!(A.partSize&&A.partSize<x)){G.next=29;break}throw new Error("partSize must not be smaller than "+x);case 29:return G.next=31,C.default.awrap(this.initMultipartUpload(s,A));case 31:if(j=G.sent,k=j.uploadId,z=this._getPartSize(E,A.partSize),H={file:M,name:s,fileSize:E,partSize:z,uploadId:k,doneParts:[]},!(A&&A.progress)){G.next=38;break}return G.next=38,C.default.awrap(A.progress(0,H,j.res));case 38:return G.next=40,C.default.awrap(this._resumeMultipart(H,A));case 40:return G.abrupt("return",G.sent);case 41:case"end":return G.stop()}},null,this)},n._resumeMultipart=function(s,M){var A,x,E,w,_,N,j,k,z,H,F,G,B,W,K,q,re,ee;return C.default.async(function(xe){for(;;)switch(xe.prev=xe.next){case 0:if(A=this,!this.isCancel()){xe.next=3;break}throw this._makeCancelEvent();case 3:return x=s.file,E=s.fileSize,w=s.partSize,_=s.uploadId,N=s.doneParts,j=s.name,k=[],N.length>0&&p(N).to(k),z=this._divideParts(E,w),H=z.length,F=!1,G=function(ke,_e){var de=this;return new h.default(function(ae,Se){var te,ue,Oe,le;return C.default.async(function(Y){for(;;)switch(Y.prev=Y.next){case 0:if(Y.prev=0,ke.isCancel()){Y.next=18;break}return te=z[_e-1],ue={stream:ke._createStream(x,te.start,te.end),size:te.end-te.start},Y.next=6,C.default.awrap(ke._uploadPart(j,_,_e,ue));case 6:if(Oe=Y.sent,!(!ke.isCancel()&&!F)){Y.next=15;break}if(s.doneParts.push({number:_e,etag:Oe.res.headers.etag}),!M.progress){Y.next=12;break}return Y.next=12,C.default.awrap(M.progress(N.length/H,s,Oe.res));case 12:ae({number:_e,etag:Oe.res.headers.etag}),Y.next=16;break;case 15:ae();case 16:Y.next=19;break;case 18:ae();case 19:Y.next=30;break;case 21:Y.prev=21,Y.t0=Y.catch(0),le=new Error,le.name=Y.t0.name,le.message=Y.t0.message,le.stack=Y.t0.stack,le.partNum=_e,p(Y.t0).to(le),Se(le);case 30:case"end":return Y.stop()}},null,de,[[0,21]])})},B=(0,S.default)(new Array(H),function(he,ke){return ke+1}),W=k.map(function(he){return he.number}),K=B.filter(function(he){return W.indexOf(he)<0}),q=5,re=M.parallel||q,xe.next=17,C.default.awrap(this._parallel(K,re,function(he){return new h.default(function(ke,_e){G(A,he).then(function(de){de&&k.push(de),ke()}).catch(function(de){_e(de)})})}));case 17:if(ee=xe.sent,F=!0,!this.isCancel()){xe.next=22;break}throw G=null,this._makeCancelEvent();case 22:if(!(ee&&ee.length>0)){xe.next=25;break}throw ee[0].message="Failed to upload some parts with error: "+ee[0].toString()+" part_num: "+ee[0].partNum,ee[0];case 25:return xe.next=27,C.default.awrap(this.completeMultipartUpload(j,_,k,M));case 27:return xe.abrupt("return",xe.sent);case 28:case"end":return xe.stop()}},null,this)},n._getFileSize=function(s){return C.default.async(function(A){for(;;)switch(A.prev=A.next){case 0:if(!a.buffer(s)){A.next=4;break}return A.abrupt("return",s.length);case 4:if(!(b(s)||m(s))){A.next=6;break}return A.abrupt("return",s.size);case 6:throw new Error("_getFileSize requires Buffer/File/Blob.");case 7:case"end":return A.stop()}},null,this)};var d=I("stream"),g=d.Readable;function T(y,s){if(!(this instanceof T))return new T(y,s);g.call(this,s),this.file=y,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}i.inherits(T,g),T.prototype.readFileAndPush=function(s){if(this.fileBuffer)for(var M=!0;M&&this.fileBuffer&&this.start<this.fileBuffer.length;){var A=this.start,x=A+s;x=x>this.fileBuffer.length?this.fileBuffer.length:x,this.start=x,M=this.push(this.fileBuffer.slice(A,x))}},T.prototype._read=function(s){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file){this.finish||(this.fileBuffer=null,this.finish=!0),this.push(null);return}var M=16*1024;s=s||M;var A=this;this.reader.onload=function(E){A.fileBuffer=L.from(new Uint8Array(E.target.result)),A.file=null,A.readFileAndPush(s)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(s)},n._createStream=function(s,M,A){if(b(s)||m(s))return new T(s.slice(M,A));throw new Error("_createStream requires File/Blob.")},n._getPartSize=function(s,M){var A=10*1e3,x=1024*1024;return M?Math.max(Math.ceil(s/A),M):x},n._divideParts=function(s,M){for(var A=Math.ceil(s/M),x=[],E=0;E<A;E++){var w=M*E,_=Math.min(w+M,s);x.push({start:w,end:_})}return x}}).call(this,I("buffer").Buffer)},{"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/array/from":52,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,buffer:73,"copy-to":76,"is-type-of":289,mime:202,path:205,stream:230,util:243}],4:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/promise"),u=a(L),S=I("babel-runtime/core-js/object/keys"),R=a(S),h=I("babel-runtime/core-js/object/assign"),o=a(h),C=I("babel-runtime/regenerator"),c=a(C);function a(A){return A&&A.__esModule?A:{default:A}}var i=I("utility"),r=I("fs"),l=I("is-type-of"),p=I("url"),f=I("copy-to"),b=I("path"),v=I("mime"),m=I("../common/callback"),n=I("../common/signUtils"),d=I("merge-descriptors"),g=I("../common/utils/isBlob"),T=g.isBlob,y=I("../common/utils/isFile"),s=y.isFile,M=P;M.append=function(x,E,w){var _;return c.default.async(function(j){for(;;)switch(j.prev=j.next){case 0:return w=w||{},w.position===void 0&&(w.position="0"),w.subres={append:"",position:w.position},w.method="POST",j.next=6,c.default.awrap(this.put(x,E,w));case 6:return _=j.sent,_.nextAppendPosition=_.res.headers["x-oss-next-append-position"],j.abrupt("return",_);case 9:case"end":return j.stop()}},null,this)},M.put=function(x,E,w){var _,N,j,k,z,H,F;return c.default.async(function(B){for(;;)switch(B.prev=B.next){case 0:if(_=void 0,w=w||{},x=this._objectName(x),!l.buffer(E)){B.next=7;break}_=E,B.next=33;break;case 7:if(!(T(E)||s(E))){B.next=32;break}return w.mime||(s(E)?w.mime=v.getType(b.extname(E.name)):w.mime=E.type),N=this._createStream(E,0,E.size),B.next=12,c.default.awrap(this._getFileSize(E));case 12:return w.contentLength=B.sent,B.prev=13,B.next=16,c.default.awrap(this.putStream(x,N,w));case 16:return j=B.sent,B.abrupt("return",j);case 20:if(B.prev=20,B.t0=B.catch(13),!(B.t0.code==="RequestTimeTooSkewed")){B.next=29;break}return this.options.amendTimeSkewed=+new Date(B.t0.serverTime)-new Date,B.next=26,c.default.awrap(this.put(x,E,w));case 26:return B.abrupt("return",B.sent);case 29:throw B.t0;case 30:B.next=33;break;case 32:throw new TypeError("Must provide Buffer/Blob/File for put.");case 33:return w.headers=w.headers||{},this._convertMetaToHeaders(w.meta,w.headers),k=w.method||"PUT",z=this._objectRequestParams(k,x,w),m.encodeCallback(z,w),z.mime=w.mime,z.content=_,z.successStatuses=[200],B.next=43,c.default.awrap(this.request(z));case 43:return H=B.sent,F={name:x,url:this._objectUrl(x),res:H.res},z.headers&&z.headers["x-oss-callback"]&&(F.data=JSON.parse(H.data.toString())),B.abrupt("return",F);case 47:case"end":return B.stop()}},null,this,[[13,20]])},M.putStream=function(x,E,w){var _,N,j,k;return c.default.async(function(H){for(;;)switch(H.prev=H.next){case 0:return w=w||{},w.headers=w.headers||{},x=this._objectName(x),w.contentLength?w.headers["Content-Length"]=w.contentLength:w.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(w.meta,w.headers),_=w.method||"PUT",N=this._objectRequestParams(_,x,w),m.encodeCallback(N,w),N.mime=w.mime,N.stream=E,N.successStatuses=[200],H.next=13,c.default.awrap(this.request(N));case 13:return j=H.sent,k={name:x,url:this._objectUrl(x),res:j.res},N.headers&&N.headers["x-oss-callback"]&&(k.data=JSON.parse(j.data.toString())),H.abrupt("return",k);case 17:case"end":return H.stop()}},null,this)},d(M,I("../common/object/copyObject")),d(M,I("../common/object/getObjectTagging")),d(M,I("../common/object/putObjectTagging")),d(M,I("../common/object/deleteObjectTagging")),d(M,I("../common/image")),d(M,I("../common/object/getBucketVersions")),d(M,I("../common/object/getACL")),d(M,I("../common/object/putACL")),d(M,I("../common/object/head")),d(M,I("../common/object/delete")),d(M,I("../common/object/get")),d(M,I("../common/object/putSymlink")),d(M,I("../common/object/getSymlink")),d(M,I("../common/object/deleteMulti")),d(M,I("../common/object/getObjectMeta")),M.putMeta=function(x,E,w){var _;return c.default.async(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,c.default.awrap(this.copy(x,x,{meta:E||{},timeout:w&&w.timeout,ctx:w&&w.ctx}));case 2:return _=j.sent,j.abrupt("return",_);case 4:case"end":return j.stop()}},null,this)},M.list=function(x,E){var w,_,N,j,k;return c.default.async(function(H){for(;;)switch(H.prev=H.next){case 0:return w=this._objectRequestParams("GET","",E),w.query=x,w.xmlResponse=!0,w.successStatuses=[200],H.next=6,c.default.awrap(this.request(w));case 6:return _=H.sent,N=_.data.Contents,j=this,N&&(Array.isArray(N)||(N=[N]),N=N.map(function(F){return{name:F.Key,url:j._objectUrl(F.Key),lastModified:F.LastModified,etag:F.ETag,type:F.Type,size:Number(F.Size),storageClass:F.StorageClass,owner:{id:F.Owner.ID,displayName:F.Owner.DisplayName}}})),k=_.data.CommonPrefixes||null,k&&(Array.isArray(k)||(k=[k]),k=k.map(function(F){return F.Prefix})),H.abrupt("return",{res:_.res,objects:N,prefixes:k,nextMarker:_.data.NextMarker||null,isTruncated:_.data.IsTruncated==="true"});case 13:case"end":return H.stop()}},null,this)},M.restore=function(x,E){var w,_;return c.default.async(function(j){for(;;)switch(j.prev=j.next){case 0:return E=E||{},E.subres=(0,o.default)({restore:""},E.subres),E.versionId&&(E.subres.versionId=E.versionId),w=this._objectRequestParams("POST",x,E),w.successStatuses=[202],j.next=7,c.default.awrap(this.request(w));case 7:return _=j.sent,j.abrupt("return",{res:_.res});case 9:case"end":return j.stop()}},null,this)},M.signatureUrl=function(x,E){E=E||{},x=this._objectName(x),E.method=E.method||"GET";var w=i.timestamp()+(E.expires||1800),_={bucket:this.options.bucket,object:x},N=this._getResource(_);this.options.stsToken&&(E["security-token"]=this.options.stsToken);var j=n._signatureForURL(this.options.accessKeySecret,E,N,w),k=p.parse(this._getReqUrl(_));return k.query={OSSAccessKeyId:this.options.accessKeyId,Expires:w,Signature:j.Signature},f(j.subResource).to(k.query),k.format()},M.getObjectUrl=function(x,E){return E?E[E.length-1]!=="/"&&(E+="/"):E=this.options.endpoint.format(),E+this._escape(this._objectName(x))},M._objectUrl=function(x){return this._getReqUrl({bucket:this.options.bucket,object:x})},M.generateObjectUrl=function(A,x){if(x)x[x.length-1]!=="/"&&(x+="/");else{x=this.options.endpoint.format();var E=p.parse(x),w=this.options.bucket;E.hostname=w+"."+E.hostname,E.host=w+"."+E.host,x=E.format()}return x+this._escape(this._objectName(A))},M._objectRequestParams=function(x,E,w){if(!this.options.bucket)throw new Error("Please create a bucket first");w=w||{},E=this._objectName(E);var _={object:E,bucket:this.options.bucket,method:x,subres:w&&w.subres,timeout:w&&w.timeout,ctx:w&&w.ctx};return w.headers&&(_.headers={},f(w.headers).to(_.headers)),_},M._objectName=function(x){return x.replace(/^\/+/,"")},M._convertMetaToHeaders=function(x,E){if(!x)return;(0,R.default)(x).forEach(function(w){E["x-oss-meta-"+w]=x[w]})},M._deleteFileSafe=function(x){var E=this;return new u.default(function(w){r.exists(x,function(_){_?r.unlink(x,function(N){N&&E.debug("unlink %j error: %s",x,N,"error"),w()}):w()})})}},{"../common/callback":14,"../common/image":16,"../common/object/copyObject":19,"../common/object/delete":20,"../common/object/deleteMulti":21,"../common/object/deleteObjectTagging":22,"../common/object/get":23,"../common/object/getACL":24,"../common/object/getBucketVersions":25,"../common/object/getObjectMeta":26,"../common/object/getObjectTagging":27,"../common/object/getSymlink":28,"../common/object/head":29,"../common/object/putACL":30,"../common/object/putObjectTagging":31,"../common/object/putSymlink":32,"../common/signUtils":34,"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,"copy-to":76,fs:71,"is-type-of":289,"merge-descriptors":200,mime:202,path:205,url:238,utility:290}],5:[function(I,J,P){"use strict";P.version="6.10.0"},{}],6:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(C){return C&&C.__esModule?C:{default:C}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=P;o.deleteBucketLifecycle=function(c,a){var i,r;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return h(c),i=this._bucketRequestParams("DELETE",c,"lifecycle",a),i.successStatuses=[204],p.next=5,u.default.awrap(this.request(i));case 5:return r=p.sent,p.abrupt("return",{res:r.res});case 7:case"end":return p.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],7:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(C){return C&&C.__esModule?C:{default:C}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=P;o.deleteBucketWebsite=function(c,a){var i,r;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return h(c),i=this._bucketRequestParams("DELETE",c,"website",a),i.successStatuses=[204],p.next=5,u.default.awrap(this.request(i));case 5:return r=p.sent,p.abrupt("return",{res:r.res});case 7:case"end":return p.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],8:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(r){return r&&r.__esModule?r:{default:r}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=I("../utils/isArray"),C=o.isArray,c=I("../utils/formatObjKey"),a=c.formatObjKey,i=P;i.getBucketLifecycle=function(l,p){var f,b,v;return u.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return h(l),f=this._bucketRequestParams("GET",l,"lifecycle",p),f.successStatuses=[200],f.xmlResponse=!0,n.next=6,u.default.awrap(this.request(f));case 6:return b=n.sent,v=b.data.Rule||null,v&&(C(v)||(v=[v]),v=v.map(function(d){return d.ID&&(d.id=d.ID,delete d.ID),d.Tag&&!C(d.Tag)&&(d.Tag=[d.Tag]),a(d,"firstLowerCase")})),n.abrupt("return",{rules:v,res:b.res});case 10:case"end":return n.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/formatObjKey":40,"../utils/isArray":42,"babel-runtime/regenerator":68}],9:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(C){return C&&C.__esModule?C:{default:C}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=P;o.getBucketVersioning=function(c,a){var i,r,l;return u.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return h(c),i=this._bucketRequestParams("GET",c,"versioning",a),i.xmlResponse=!0,i.successStatuses=[200],f.next=6,u.default.awrap(this.request(i));case 6:return r=f.sent,l=r.data.Status,f.abrupt("return",{status:r.status,versionStatus:l,res:r.res});case 9:case"end":return f.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],10:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(a){return a&&a.__esModule?a:{default:a}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=I("../utils/isObject"),C=o.isObject,c=P;c.getBucketWebsite=function(i,r){var l,p,f;return u.default.async(function(v){for(;;)switch(v.prev=v.next){case 0:return h(i),l=this._bucketRequestParams("GET",i,"website",r),l.successStatuses=[200],l.xmlResponse=!0,v.next=6,u.default.awrap(this.request(l));case 6:return p=v.sent,f=[],p.data.RoutingRules&&p.data.RoutingRules.RoutingRule&&(C(p.data.RoutingRules.RoutingRule)?f=[p.data.RoutingRules.RoutingRule]:f=p.data.RoutingRules.RoutingRule),v.abrupt("return",{index:p.data.IndexDocument&&p.data.IndexDocument.Suffix||"",supportSubDir:p.data.IndexDocument&&p.data.IndexDocument.SupportSubDir||"false",type:p.data.IndexDocument&&p.data.IndexDocument.Type,routingRules:f,error:p.data.ErrorDocument&&p.data.ErrorDocument.Key||null,res:p.res});case 10:case"end":return v.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isObject":46,"babel-runtime/regenerator":68}],11:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(s){return s&&s.__esModule?s:{default:s}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=I("../utils/isArray"),C=o.isArray,c=I("../utils/deepCopy"),a=c.deepCopy,i=I("../utils/isObject"),r=i.isObject,l=I("../utils/obj2xml"),p=l.obj2xml,f=I("../utils/checkObjectTag"),b=f.checkObjectTag,v=I("../utils/getStrBytesCount"),m=v.getStrBytesCount,n=P;n.putBucketLifecycle=function(M,A,x){var E,w,_,N,j;return u.default.async(function(z){for(;;)switch(z.prev=z.next){case 0:if(h(M),C(A)){z.next=3;break}throw new Error("rules must be Array");case 3:return E=this._bucketRequestParams("PUT",M,"lifecycle",x),w=[],_={LifecycleConfiguration:{Rule:w}},A.forEach(function(H){d(H),y(H),H.id&&(H.ID=H.id,delete H.id),w.push(H)}),N=p(_,{headers:!0,firstUpperCase:!0}),E.content=N,E.mime="xml",E.successStatuses=[200],z.next=13,u.default.awrap(this.request(E));case 13:return j=z.sent,z.abrupt("return",{res:j.res});case 15:case"end":return z.stop()}},null,this)};function d(s){s.days&&(s.expiration={days:s.days}),s.date&&(s.expiration={createdBeforeDate:s.date})}function g(s,M){var A=s.days,x=s.createdBeforeDate;if(!A&&!x)throw new Error(M+" must includes days or createdBeforeDate");if(A&&!/^[1-9][0-9]*$/.test(A))throw new Error("days must be a positive integer");if(x&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(x))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function T(s){if(!C(s)&&!r(s))throw new Error("tag must be Object or Array");s=r(s)?[s]:s;var M={},A=a(s);A.forEach(function(x){M[x.key]=x.value}),b(M)}function y(s){if(s.id&&m(s.id)>255)throw new Error("ID is composed of 255 bytes at most");if(s.prefix===""||s.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(s.status))throw new Error("Status must be Enabled or Disabled");if(s.transition){if(!["IA","Archive"].includes(s.transition.storageClass))throw new Error("StorageClass must be IA or Archive");g(s.transition,"Transition")}if(s.expiration){if(!s.expiration.expiredObjectDeleteMarker)g(s.expiration,"Expiration");else if(s.expiration.days||s.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(s.abortMultipartUpload&&g(s.abortMultipartUpload,"AbortMultipartUpload"),!s.expiration&&!s.abortMultipartUpload&&!s.transition&&!s.noncurrentVersionTransition)throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(s.tag){if(s.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");T(s.tag)}}},{"../utils/checkBucketName":35,"../utils/checkObjectTag":36,"../utils/deepCopy":39,"../utils/getStrBytesCount":41,"../utils/isArray":42,"../utils/isObject":46,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],12:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(a){return a&&a.__esModule?a:{default:a}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=I("../utils/obj2xml"),C=o.obj2xml,c=P;c.putBucketVersioning=function(i,r){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p,f,b;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(h(i),["Enabled","Suspended"].includes(r)){m.next=3;break}throw new Error("status must be Enabled or Suspended");case 3:return p=this._bucketRequestParams("PUT",i,"versioning",l),f={VersioningConfiguration:{Status:r}},p.mime="xml",p.content=C(f,{headers:!0}),m.next=9,u.default.awrap(this.request(p));case 9:return b=m.sent,m.abrupt("return",{res:b.res,status:b.status});case 11:case"end":return m.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],13:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(r){return r&&r.__esModule?r:{default:r}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=I("../utils/obj2xml"),C=o.obj2xml,c=I("../utils/isArray"),a=c.isArray,i=P;i.putBucketWebsite=function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=arguments[2],b,v,m,n,d;return u.default.async(function(T){for(;;)switch(T.prev=T.next){case 0:if(h(l),b=this._bucketRequestParams("PUT",l,"website",f),v={Suffix:p.index||"index.html"},m={IndexDocument:v},n={WebsiteConfiguration:m},p.supportSubDir&&(v.SupportSubDir=p.supportSubDir),p.type&&(v.Type=p.type),p.error&&(m.ErrorDocument={Key:p.error}),!(p.routingRules!==void 0)){T.next=12;break}if(a(p.routingRules)){T.next=11;break}throw new Error("RoutingRules must be Array");case 11:m.RoutingRules={RoutingRule:p.routingRules};case 12:return n=C(n),b.content=n,b.mime="xml",b.successStatuses=[200],T.next=18,u.default.awrap(this.request(b));case 18:return d=T.sent,T.abrupt("return",{res:d.res});case 20:case"end":return T.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isArray":42,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],14:[function(I,J,P){(function(L){"use strict";var u=I("babel-runtime/core-js/object/keys"),S=o(u),R=I("babel-runtime/core-js/json/stringify"),h=o(R);function o(C){return C&&C.__esModule?C:{default:C}}P.encodeCallback=function(c,a){if(c.headers=c.headers||{},!Object.prototype.hasOwnProperty.call(c.headers,"x-oss-callback")&&a.callback){var i={callbackUrl:encodeURI(a.callback.url),callbackBody:a.callback.body};a.callback.host&&(i.callbackHost=a.callback.host),a.callback.contentType&&(i.callbackBodyType=a.callback.contentType);var r=L.from((0,h.default)(i)).toString("base64");if(c.headers["x-oss-callback"]=r,a.callback.customValue){var l={};(0,S.default)(a.callback.customValue).forEach(function(p){l["x:"+p]=a.callback.customValue[p]}),c.headers["x-oss-callback-var"]=L.from((0,h.default)(l)).toString("base64")}}}}).call(this,I("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,buffer:73}],15:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/assign"),u=S(L);function S(i){return i&&i.__esModule?i:{default:i}}var R=I("humanize-ms"),h=I("url"),o=I("../utils/checkBucketName"),C=o.checkBucketName;function c(i,r){var l=h.parse(i);if(l.protocol||(l=h.parse("http"+(r?"s":"")+"://"+i)),l.protocol!=="http:"&&l.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return l}function a(i,r,l){var p=l?"https://":"http://",f=r?"-internal.aliyuncs.com":".aliyuncs.com",b="vpc100-oss-cn-";return i.substr(0,b.length)===b&&(f=".aliyuncs.com"),h.parse(p+i+f)}J.exports=function(i){if(!i||!i.accessKeyId||!i.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");i.bucket&&C(i.bucket);var r=(0,u.default)({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1},i);if(r.accessKeyId=r.accessKeyId.trim(),r.accessKeySecret=r.accessKeySecret.trim(),r.timeout&&(r.timeout=R(r.timeout)),r.endpoint)r.endpoint=c(r.endpoint,r.secure);else if(r.region)r.endpoint=a(r.region,r.internal,r.secure);else throw new Error("require options.endpoint or options.region");return r.inited=!0,r}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/assign":54,"humanize-ms":194,url:238}],16:[function(I,J,P){"use strict";var L=I("merge-descriptors"),u=P;L(u,I("./processObjectSave"))},{"./processObjectSave":17,"merge-descriptors":200}],17:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(r){return r&&r.__esModule?r:{default:r}}var R=I("../utils/checkBucketName"),h=R.checkBucketName,o=I("querystring"),C=I("js-base64"),c=C.Base64.encode,a=P;a.processObjectSave=function(l,p,f,b){var v,m,n,d;return u.default.async(function(T){for(;;)switch(T.prev=T.next){case 0:return i(l,"sourceObject"),i(p,"targetObject"),i(f,"process"),p=this._objectName(p),b&&h(b),v=this._objectRequestParams("POST",l,{subres:"x-oss-process"}),m=b?",b_"+c(b):"",p=c(p),n={"x-oss-process":f+"|sys/saveas,o_"+p+m},v.content=o.stringify(n),T.next=12,u.default.awrap(this.request(v));case 12:return d=T.sent,T.abrupt("return",{res:d.res,status:d.res.status});case 14:case"end":return T.stop()}},null,this)};function i(r,l){if(!r)throw new Error(l+" is required");if(typeof r!="string")throw new Error(l+" must be String")}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68,"js-base64":199,querystring:212}],18:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=S(L);function S(a){return a&&a.__esModule?a:{default:a}}var R=I("copy-to"),h=I("./callback"),o=I("./utils/deepCopy"),C=o.deepCopy,c=P;c.listUploads=function(i,r){var l,p,f,b;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return r=r||{},l={},R(r).to(l),l.subres="uploads",p=this._objectRequestParams("GET","",l),p.query=i,p.xmlResponse=!0,p.successStatuses=[200],m.next=10,u.default.awrap(this.request(p));case 10:return f=m.sent,b=f.data.Upload||[],Array.isArray(b)||(b=[b]),b=b.map(function(n){return{name:n.Key,uploadId:n.UploadId,initiated:n.Initiated}}),m.abrupt("return",{res:f.res,uploads:b,bucket:f.data.Bucket,nextKeyMarker:f.data.NextKeyMarker,nextUploadIdMarker:f.data.NextUploadIdMarker,isTruncated:f.data.IsTruncated==="true"});case 15:case"end":return m.stop()}},null,this)},c.listParts=function(i,r,l,p){var f,b,v;return u.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return p=p||{},f={},R(p).to(f),f.subres={uploadId:r},b=this._objectRequestParams("GET",i,f),b.query=l,b.xmlResponse=!0,b.successStatuses=[200],n.next=10,u.default.awrap(this.request(b));case 10:return v=n.sent,n.abrupt("return",{res:v.res,uploadId:v.data.UploadId,bucket:v.data.Bucket,name:v.data.Key,partNumberMarker:v.data.PartNumberMarker,nextPartNumberMarker:v.data.NextPartNumberMarker,maxParts:v.data.MaxParts,isTruncated:v.data.IsTruncated,parts:v.data.Part||[]});case 12:case"end":return n.stop()}},null,this)},c.abortMultipartUpload=function(i,r,l){var p,f,b;return u.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return this._stop(),l=l||{},p={},R(l).to(p),p.subres={uploadId:r},f=this._objectRequestParams("DELETE",i,p),f.successStatuses=[204],m.next=9,u.default.awrap(this.request(f));case 9:return b=m.sent,m.abrupt("return",{res:b.res});case 11:case"end":return m.stop()}},null,this)},c.initMultipartUpload=function(i,r){var l,p,f;return u.default.async(function(v){for(;;)switch(v.prev=v.next){case 0:return r=r||{},l={},R(r).to(l),l.headers=l.headers||{},this._convertMetaToHeaders(r.meta,l.headers),l.subres="uploads",p=this._objectRequestParams("POST",i,l),p.mime=r.mime,p.xmlResponse=!0,p.successStatuses=[200],v.next=12,u.default.awrap(this.request(p));case 12:return f=v.sent,v.abrupt("return",{res:f.res,bucket:f.data.Bucket,name:f.data.Key,uploadId:f.data.UploadId});case 14:case"end":return v.stop()}},null,this)},c.uploadPart=function(i,r,l,p,f,b,v){var m;return u.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return m={stream:this._createStream(p,f,b),size:b-f},d.next=3,u.default.awrap(this._uploadPart(i,r,l,m,v));case 3:return d.abrupt("return",d.sent);case 4:case"end":return d.stop()}},null,this)},c.completeMultipartUpload=function(i,r,l,p){var f,b,v,m,n,d,g,T;return u.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:for(f=l.concat().sort(function(M,A){return M.number-A.number}).filter(function(M,A,x){return!A||M.number!==x[A-1].number}),b=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,v=0;v<f.length;v++)m=f[v],b+=`<Part>
|
|
|
`,b+="<PartNumber>"+m.number+`</PartNumber>
|
|
|
`,b+="<ETag>"+m.etag+`</ETag>
|
|
|
`,b+=`</Part>
|
|
|
`;return b+="</CompleteMultipartUpload>",p=p||{},n={},n=C(p),n.headers&&delete n.headers["x-oss-server-side-encryption"],n.subres={uploadId:r},d=this._objectRequestParams("POST",i,n),h.encodeCallback(d,n),d.mime="xml",d.content=b,d.headers&&d.headers["x-oss-callback"]||(d.xmlResponse=!0),d.successStatuses=[200],s.next=17,u.default.awrap(this.request(d));case 17:return g=s.sent,T={res:g.res,bucket:d.bucket,name:i,etag:g.res.headers.etag},d.headers&&d.headers["x-oss-callback"]&&(T.data=JSON.parse(g.data.toString())),s.abrupt("return",T);case 21:case"end":return s.stop()}},null,this)},c._uploadPart=function(i,r,l,p,f){var b,v,m;return u.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return f=f||{},b={},R(f).to(b),b.headers={"Content-Length":p.size},b.subres={partNumber:l,uploadId:r},v=this._objectRequestParams("PUT",i,b),v.mime=b.mime,v.stream=p.stream,v.successStatuses=[200],d.next=11,u.default.awrap(this.request(v));case 11:if(m=d.sent,m.res.headers.etag){d.next=14;break}throw new Error(`Please set the etag of expose-headers in OSS
|
|
|
https://help.aliyun.com/document_detail/32069.html`);case 14:return p.stream=null,v.stream=null,d.abrupt("return",{name:i,etag:m.res.headers.etag,res:m.res});case 17:case"end":return d.stop()}},null,this)}},{"./callback":14,"./utils/deepCopy":39,"babel-runtime/regenerator":68,"copy-to":76}],19:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=C(L),S=I("babel-runtime/core-js/object/keys"),R=C(S),h=I("babel-runtime/helpers/typeof"),o=C(h);function C(r){return r&&r.__esModule?r:{default:r}}var c=I("../utils/checkBucketName"),a=c.checkBucketName,i=P;i.copy=function(l,p,f,b){var v,m,n;return u.default.async(function(g){for(;;)switch(g.prev=g.next){case 0:return(typeof f=="undefined"?"undefined":(0,o.default)(f))==="object"&&(b=f),b=b||{},b.headers=b.headers||{},(0,R.default)(b.headers).forEach(function(T){b.headers["x-oss-copy-source-"+T.toLowerCase()]=b.headers[T]}),b.meta&&(b.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(b.meta,b.headers),p=this._getSourceName(p,f),b.versionId&&(p=p+"?versionId="+b.versionId),b.headers["x-oss-copy-source"]=p,v=this._objectRequestParams("PUT",l,b),v.xmlResponse=!0,v.successStatuses=[200,304],g.next=14,u.default.awrap(this.request(v));case 14:return m=g.sent,n=m.data,n&&(n={etag:n.ETag,lastModified:n.LastModified}),g.abrupt("return",{data:n,res:m.res});case 18:case"end":return g.stop()}},null,this)},i._getSourceName=function(l,p){return typeof p=="string"?l=this._objectName(l):l[0]!=="/"?p=this.options.bucket:(p=l.replace(/\/(.+?)(\/.*)/,"$1"),l=l.replace(/(\/.+?\/)(.*)/,"$2")),a(p),l=encodeURI(l),l="/"+p+"/"+l,l}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,"babel-runtime/regenerator":68}],20:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(C){return C&&C.__esModule?C:{default:C}}var o=P;o.delete=function(c){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,r;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return a.subres=(0,R.default)({},a.subres),a.versionId&&(a.subres.versionId=a.versionId),i=this._objectRequestParams("DELETE",c,a),i.successStatuses=[204],p.next=6,u.default.awrap(this.request(i));case 6:return r=p.sent,p.abrupt("return",{res:r.res});case 8:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],21:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(i){return i&&i.__esModule?i:{default:i}}var o=I("utility"),C=I("../utils/obj2xml"),c=C.obj2xml,a=P;a.deleteMulti=function(r){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p,f,b,v,m,n,d,g,T,y,s,M;return u.default.async(function(x){for(;;)switch(x.prev=x.next){case 0:if(p=[],!(!r||!r.length)){x.next=3;break}throw new Error("names is required");case 3:for(f=0;f<r.length;f++)b={},typeof r[f]=="string"?b.Key=o.escape(this._objectName(r[f])):(v=r[f],m=v.key,n=v.versionId,b.Key=o.escape(this._objectName(m)),b.VersionId=n),p.push(b);return d={Delete:{Quiet:!!l.quiet,Object:p}},g=c(d,{headers:!0}),l.subres=(0,R.default)({delete:""},l.subres),l.versionId&&(l.subres.versionId=l.versionId),T=this._objectRequestParams("POST","",l),T.mime="xml",T.content=g,T.xmlResponse=!0,T.successStatuses=[200],x.next=15,u.default.awrap(this.request(T));case 15:return y=x.sent,s=y.data,M=s&&s.Deleted||null,M&&(Array.isArray(M)||(M=[M])),x.abrupt("return",{res:y.res,deleted:M||[]});case 20:case"end":return x.stop()}},null,this)}},{"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,utility:290}],22:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(C){return C&&C.__esModule?C:{default:C}}var o=P;o.deleteObjectTagging=function(c){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,r;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return a.subres=(0,R.default)({tagging:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),c=this._objectName(c),i=this._objectRequestParams("DELETE",c,a),i.successStatuses=[204],p.next=7,u.default.awrap(this.request(i));case 7:return r=p.sent,p.abrupt("return",{status:r.status,res:r.res});case 9:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],23:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(a){return a&&a.__esModule?a:{default:a}}var o=I("fs"),C=I("is-type-of"),c=P;c.get=function(i,r){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p,f,b,v;return u.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return p=null,f=!1,C.writableStream(r)?p=r:C.string(r)?(p=o.createWriteStream(r),f=!0):l=r,l=l||{},l.subres=(0,R.default)({},l.subres),l.versionId&&(l.subres.versionId=l.versionId),l.process&&(l.subres["x-oss-process"]=l.process),b=void 0,n.prev=8,v=this._objectRequestParams("GET",i,l),v.writeStream=p,v.successStatuses=[200,206,304],n.next=14,u.default.awrap(this.request(v));case 14:b=n.sent,f&&p.destroy(),n.next=25;break;case 18:if(n.prev=18,n.t0=n.catch(8),!f){n.next=24;break}return p.destroy(),n.next=24,u.default.awrap(this._deleteFileSafe(r));case 24:throw n.t0;case 25:return n.abrupt("return",{res:b.res,content:b.data});case 26:case"end":return n.stop()}},null,this,[[8,18]])}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,fs:71,"is-type-of":289}],24:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(C){return C&&C.__esModule?C:{default:C}}var o=P;o.getACL=function(c){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,r;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return a.subres=(0,R.default)({acl:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),c=this._objectName(c),i=this._objectRequestParams("GET",c,a),i.successStatuses=[200],i.xmlResponse=!0,p.next=8,u.default.awrap(this.request(i));case 8:return r=p.sent,p.abrupt("return",{acl:r.data.AccessControlList.Grant,owner:{id:r.data.Owner.ID,displayName:r.data.Owner.DisplayName},res:r.res});case 10:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],25:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/keys"),u=C(L),S=I("babel-runtime/regenerator"),R=C(S),h=I("babel-runtime/core-js/object/assign"),o=C(h);function C(v){return v&&v.__esModule?v:{default:v}}var c=P,a=I("../utils/isObject"),i=a.isObject,r=I("../utils/isArray"),l=r.isArray;c.getBucketVersions=p,c.listObjectVersions=p;function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,d,g,T,y,s;return R.default.async(function(A){for(;;)switch(A.prev=A.next){case 0:if(!(v.versionIdMarker&&v.keyMarker===void 0)){A.next=2;break}throw new Error("A version-id marker cannot be specified without a key marker");case 2:return m.subres=(0,o.default)({versions:""},m.subres),m.versionId&&(m.subres.versionId=m.versionId),n=this._objectRequestParams("GET","",m),n.xmlResponse=!0,n.successStatuses=[200],n.query=b(v),A.next=10,R.default.awrap(this.request(n));case 10:return d=A.sent,g=d.data.Version||[],T=d.data.DeleteMarker||[],y=this,g&&(Array.isArray(g)||(g=[g]),g=g.map(function(x){return{name:x.Key,url:y._objectUrl(x.Key),lastModified:x.LastModified,isLatest:x.IsLatest==="true",versionId:x.VersionId,etag:x.ETag,type:x.Type,size:Number(x.Size),storageClass:x.StorageClass,owner:{id:x.Owner.ID,displayName:x.Owner.DisplayName}}})),T&&(l(T)||(T=[T]),T=T.map(function(x){return{name:x.Key,lastModified:x.LastModified,versionId:x.VersionId,owner:{id:x.Owner.ID,displayName:x.Owner.DisplayName}}})),s=d.data.CommonPrefixes||null,s&&(l(s)||(s=[s]),s=s.map(function(x){return x.Prefix})),A.abrupt("return",{res:d.res,objects:g,deleteMarker:T,prefixes:s,nextMarker:d.data.NextMarker||null,NextVersionIdMarker:d.data.NextVersionIdMarker||null,isTruncated:d.data.IsTruncated==="true"});case 19:case"end":return A.stop()}},null,this)}function f(v){return v.replace(/([A-Z])/g,"-$1").toLowerCase()}function b(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m={};return i(v)&&(0,u.default)(v).forEach(function(n){m[f(n)]=v[n]}),m}},{"../utils/isArray":42,"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],26:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(C){return C&&C.__esModule?C:{default:C}}var o=P;o.getObjectMeta=function(c,a){var i,r;return u.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return a=a||{},c=this._objectName(c),a.subres=(0,R.default)({objectMeta:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),i=this._objectRequestParams("HEAD",c,a),i.successStatuses=[200],p.next=8,u.default.awrap(this.request(i));case 8:return r=p.sent,p.abrupt("return",{status:r.status,res:r.res});case 10:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],27:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(a){return a&&a.__esModule?a:{default:a}}var o=P,C=I("../utils/isObject"),c=C.isObject;o.getObjectTagging=function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l,p,f,b,v;return u.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return r.subres=(0,R.default)({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),i=this._objectName(i),l=this._objectRequestParams("GET",i,r),l.successStatuses=[200],n.next=7,u.default.awrap(this.request(l));case 7:return p=n.sent,n.next=10,u.default.awrap(this.parseXML(p.data));case 10:return f=n.sent,b=f.TagSet.Tag,b=b&&c(b)?[b]:b||[],v={},b.forEach(function(d){v[d.Key]=d.Value}),n.abrupt("return",{status:p.status,res:p.res,tag:v});case 16:case"end":return n.stop()}},null,this)}},{"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],28:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(C){return C&&C.__esModule?C:{default:C}}var o=P;o.getSymlink=function(c){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,r,l;return u.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return a.subres=(0,R.default)({symlink:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),c=this._objectName(c),i=this._objectRequestParams("GET",c,a),i.successStatuses=[200],f.next=7,u.default.awrap(this.request(i));case 7:return r=f.sent,l=r.res.headers["x-oss-symlink-target"],f.abrupt("return",{targetName:decodeURIComponent(l),res:r.res});case 10:case"end":return f.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],29:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=C(L),S=I("babel-runtime/core-js/object/keys"),R=C(S),h=I("babel-runtime/core-js/object/assign"),o=C(h);function C(a){return a&&a.__esModule?a:{default:a}}var c=P;c.head=function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l,p,f;return u.default.async(function(v){for(;;)switch(v.prev=v.next){case 0:return r.subres=(0,o.default)({},r.subres),r.versionId&&(r.subres.versionId=r.versionId),l=this._objectRequestParams("HEAD",i,r),l.successStatuses=[200,304],v.next=6,u.default.awrap(this.request(l));case 6:return p=v.sent,f={meta:null,res:p.res,status:p.status},p.status===200&&(0,R.default)(p.headers).forEach(function(m){m.indexOf("x-oss-meta-")===0&&(f.meta||(f.meta={}),f.meta[m.substring(11)]=p.headers[m])}),v.abrupt("return",f);case 10:case"end":return v.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],30:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(C){return C&&C.__esModule?C:{default:C}}var o=P;o.putACL=function(c,a,i){var r,l;return u.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return i=i||{},i.subres=(0,R.default)({acl:""},i.subres),i.versionId&&(i.subres.versionId=i.versionId),i.headers=i.headers||{},i.headers["x-oss-object-acl"]=a,c=this._objectName(c),r=this._objectRequestParams("PUT",c,i),r.successStatuses=[200],f.next=10,u.default.awrap(this.request(r));case 10:return l=f.sent,f.abrupt("return",{res:l.res});case 12:case"end":return f.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],31:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=C(L),S=I("babel-runtime/core-js/object/keys"),R=C(S),h=I("babel-runtime/core-js/object/assign"),o=C(h);function C(p){return p&&p.__esModule?p:{default:p}}var c=I("../utils/obj2xml"),a=c.obj2xml,i=I("../utils/checkObjectTag"),r=i.checkObjectTag,l=P;l.putObjectTagging=function(f,b){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},m,n,d;return u.default.async(function(T){for(;;)switch(T.prev=T.next){case 0:return r(b),v.subres=(0,o.default)({tagging:""},v.subres),v.versionId&&(v.subres.versionId=v.versionId),f=this._objectName(f),m=this._objectRequestParams("PUT",f,v),m.successStatuses=[200],b=(0,R.default)(b).map(function(y){return{Key:y,Value:b[y]}}),n={Tagging:{TagSet:{Tag:b}}},m.mime="xml",m.content=a(n),T.next=12,u.default.awrap(this.request(m));case 12:return d=T.sent,T.abrupt("return",{res:d.res,status:d.status});case 14:case"end":return T.stop()}},null,this)}},{"../utils/checkObjectTag":36,"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],32:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/object/assign"),R=h(S);function h(C){return C&&C.__esModule?C:{default:C}}var o=P;o.putSymlink=function(c,a,i){var r,l;return u.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return i=i||{},i.headers=i.headers||{},a=this._escape(this._objectName(a)),this._convertMetaToHeaders(i.meta,i.headers),i.headers["x-oss-symlink-target"]=a,i.subres=(0,R.default)({symlink:""},i.subres),i.versionId&&(i.subres.versionId=i.versionId),i.storageClass&&(i.headers["x-oss-storage-class"]=i.storageClass),c=this._objectName(c),r=this._objectRequestParams("PUT",c,i),r.successStatuses=[200],f.next=13,u.default.awrap(this.request(r));case 13:return l=f.sent,f.abrupt("return",{res:l.res});case 15:case"end":return f.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],33:[function(I,J,P){"use strict";var L=I("babel-runtime/regenerator"),u=h(L),S=I("babel-runtime/core-js/promise"),R=h(S);function h(C){return C&&C.__esModule?C:{default:C}}var o=P;o._parallelNode=function(c,a,i,r){var l,p,f,b,v,m,n,d;return u.default.async(function(T){for(;;)switch(T.prev=T.next){case 0:l=this,p=[],f=[],b=c.length/a,v=c.length%a,m=v===0?b:(c.length-v)/a+1,n=1,d=0;case 8:if(!(d<c.length)){T.next=26;break}if(!l.isCancel()){T.next=11;break}return T.abrupt("break",26);case 11:if(r?f.push(i(l,c[d],r)):f.push(i(l,c[d])),!(f.length===a||n===m&&d===c.length-1)){T.next=23;break}return T.prev=13,n+=1,T.next=17,u.default.awrap(R.default.all(f));case 17:T.next=22;break;case 19:T.prev=19,T.t0=T.catch(13),p.push(T.t0);case 22:f=[];case 23:d++,T.next=8;break;case 26:return T.abrupt("return",p);case 27:case"end":return T.stop()}},null,this,[[13,19]])},o._parallel=function(c,a,i){var r=this;return new R.default(function(l){var p=[];if(a<=0||!c){l(p);return}function f(s){return function(){if(s===null)throw new Error("Callback was already called.");var M=s;s=null;for(var A=arguments.length,x=Array(A),E=0;E<A;E++)x[E]=arguments[E];M.apply(this,x)}}function b(s){var M=-1,A=s.length;return function(){return++M<A&&!r.isCancel()?{value:s[M],key:M}:null}}var v=b(c),m=!1,n=0,d=!1;function g(s,M){n-=1,s?(m=!0,p.push(s),l(p)):M==={}||m&&n<=0?(m=!0,l(p)):d||(r.isCancel()?l(p):y())}function T(s,M){i(s).then(function(A){M(null,A)}).catch(function(A){M(A)})}function y(){for(d=!0;n<a&&!m&&!r.isCancel();){var s=v();if(s===null||p.length>0){m=!0,n<=0&&l(p);return}n+=1,T(s.value,f(g))}d=!1}y()})},o.cancel=function(c){this.options.cancelFlag=!0,c&&this.abortMultipartUpload(c.name,c.uploadId,c.options)},o.isCancel=function(){return this.options.cancelFlag},o.resetCancelFlag=function(){this.options.cancelFlag=!1},o._stop=function(){this.options.cancelFlag=!0},o._makeCancelEvent=function(){var c={status:0,name:"cancel"};return c}},{"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68}],34:[function(I,J,P){(function(L){"use strict";var u=I("babel-runtime/core-js/json/stringify"),S=o(u),R=I("babel-runtime/core-js/object/keys"),h=o(R);function o(a){return a&&a.__esModule?a:{default:a}}var C=I("./../../shims/crypto/crypto.js"),c=I("is-type-of");P.buildCanonicalizedResource=function(i,r){var l=""+i,p="?";if(c.string(r)&&r.trim()!=="")l+=p+r;else if(c.array(r))r.sort(),l+=p+r.join("&");else if(r){var f=function(m,n){return m[0]>n[0]?1:m[0]<n[0]?-1:0},b=function(m){l+=p+m,r[m]&&(l+="="+r[m]),p="&"};(0,h.default)(r).sort(f).forEach(b)}return l},P.buildCanonicalString=function(i,r,l,p){l=l||{};var f=l.headers||{},b="x-oss-",v=[],m={},n=[i.toUpperCase(),f["Content-Md5"]||"",f["Content-Type"]||f["Content-Type".toLowerCase()],p||f["x-oss-date"]];return(0,h.default)(f).forEach(function(d){var g=d.toLowerCase();g.indexOf(b)===0&&(m[g]=String(f[d]).trim())}),(0,h.default)(m).sort().forEach(function(d){v.push(d+":"+m[d])}),n=n.concat(v),n.push(this.buildCanonicalizedResource(r,l.parameters)),n.join(`
|
|
|
`)},P.computeSignature=function(i,r){var l=C.createHmac("sha1",i);return l.update(L.from(r,"utf8")).digest("base64")},P.authorization=function(i,r,l){return"OSS "+i+":"+this.computeSignature(r,l)},P._signatureForURL=function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=arguments[2],p=arguments[3],f={},b=r.subResource,v=b===void 0?{}:b;if(r.process){var m="x-oss-process";v[m]=r.process}if(r.trafficLimit){var n="x-oss-traffic-limit";v[n]=r.trafficLimit}if(r.response&&(0,h.default)(r.response).forEach(function(y){var s="response-"+y.toLowerCase();v[s]=r.response[y]}),(0,h.default)(r).forEach(function(y){var s=y.toLowerCase(),M=r[y];s.indexOf("x-oss-")===0?f[s]=M:(s.indexOf("content-md5")===0||s.indexOf("content-type")===0)&&(f[y]=M)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(v["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){var d={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(d.callbackHost=r.callback.host),r.callback.contentType&&(d.callbackBodyType=r.callback.contentType),v.callback=L.from((0,S.default)(d)).toString("base64"),r.callback.customValue){var g={};(0,h.default)(r.callback.customValue).forEach(function(y){g["x:"+y]=r.callback.customValue[y]}),v["callback-var"]=L.from((0,S.default)(g)).toString("base64")}}var T=this.buildCanonicalString(r.method,l,{headers:f,parameters:v},p.toString());return{Signature:this.computeSignature(i,T),subResource:v}}}).call(this,I("buffer").Buffer)},{"./../../shims/crypto/crypto.js":284,"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,buffer:73,"is-type-of":289}],35:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.checkBucketName=void 0,P.checkBucketName=function(L,u){var S=u?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;if(!S.test(L))throw new Error("The bucket must be conform to the specifications")}},{}],36:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/entries"),u=S(L);function S(r){return r&&r.__esModule?r:{default:r}}Object.defineProperty(P,"__esModule",{value:!0}),P.checkObjectTag=void 0;var R=I("./checkValid"),h=R.checkValid,o=I("./isObject"),C=o.isObject,c=[{validator:function(l){if(typeof l!="string")throw new Error("the key and value of the tag must be String")}},{pattern:/^[a-zA-Z0-9 +-=._:/]+$/,msg:"tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)"}],a={key:[].concat(c,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(c,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};function i(r){if(!C(r))throw new Error("tag must be Object");var l=(0,u.default)(r);if(l.length>10)throw new Error("maximum of 10 tags for a object");var p=["key","value"];l.forEach(function(f){f.forEach(function(b,v){h(b,a[p[v]])})})}P.checkObjectTag=i},{"./checkValid":37,"./isObject":46,"babel-runtime/core-js/object/entries":57}],37:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.checkValid=void 0;function L(u,S){S.forEach(function(R){if(R.validator)R.validator(u);else if(R.pattern&&!R.pattern.test(u))throw new Error(R.msg)})}P.checkValid=L},{}],38:[function(I,J,P){(function(L){"use strict";var u=I("babel-runtime/core-js/object/assign"),S=R(u);function R(f){return f&&f.__esModule?f:{default:f}}Object.defineProperty(P,"__esModule",{value:!0}),P.createRequest=void 0;var h=I("./../../../shims/crypto/crypto.js"),o=I("debug")("ali-oss"),C=I("mime"),c=I("dateformat"),a=I("copy-to"),i=I("path");function r(f,b){return f[b]||f[b.toLowerCase()]}function l(f,b){delete f[b],delete f[b.toLowerCase()]}function p(f){var b=new Date;this.options.amendTimeSkewed&&(b=+new Date+this.options.amendTimeSkewed);var v={"x-oss-date":c(b,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.userAgent.includes("nodejs")&&(v["User-Agent"]=this.userAgent),this.options.isRequestPay&&(0,S.default)(v,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(v["x-oss-security-token"]=this.options.stsToken),a(f.headers).to(v),r(v,"Content-Type")||(f.mime&&f.mime.indexOf("/")>0?v["Content-Type"]=f.mime:v["Content-Type"]=C.getType(f.mime||i.extname(f.object||""))),r(v,"Content-Type")||l(v,"Content-Type"),f.content&&(v["Content-Md5"]=h.createHash("md5").update(L.from(f.content,"utf8")).digest("base64"),v["Content-Length"]||(v["Content-Length"]=f.content.length));var m=this._getResource(f);v.authorization=this.authorization(f.method,m,f.subres,v);var n=this._getReqUrl(f);o("request %s %s, with headers %j, !!stream: %s",f.method,n,v,!!f.stream);var d=f.timeout||this.options.timeout,g={method:f.method,content:f.content,stream:f.stream,headers:v,timeout:d,writeStream:f.writeStream,customResponse:f.customResponse,ctx:f.ctx||this.ctx};return this.agent&&(g.agent=this.agent),this.httpsAgent&&(g.httpsAgent=this.httpsAgent),{url:n,params:g}}P.createRequest=p}).call(this,I("buffer").Buffer)},{"./../../../shims/crypto/crypto.js":284,"babel-runtime/core-js/object/assign":54,buffer:73,"copy-to":76,dateformat:190,debug:288,mime:202,path:205}],39:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/keys"),u=h(L),S=I("babel-runtime/helpers/typeof"),R=h(S);function h(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(P,"__esModule",{value:!0}),P.deepCopy=void 0,P.deepCopy=function(o){if(o===null||(typeof o=="undefined"?"undefined":(0,R.default)(o))!=="object")return o;var C=Array.isArray(o)?[]:{};return(0,u.default)(o).forEach(function(c){C[c]=P.deepCopy(o[c])}),C}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],40:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/keys"),u=h(L),S=I("babel-runtime/helpers/typeof"),R=h(S);function h(c){return c&&c.__esModule?c:{default:c}}Object.defineProperty(P,"__esModule",{value:!0}),P.formatObjKey=void 0;function o(c,a){if(c===null||(typeof c=="undefined"?"undefined":(0,R.default)(c))!=="object")return c;var i=void 0;if(Array.isArray(c)){i=[];for(var r=0;r<c.length;r++)i.push(o(c[r],a))}else i={},(0,u.default)(c).forEach(function(l){i[C(l,a)]=o(c[l],a)});return i}P.formatObjKey=o;function C(c,a){return a==="firstUpperCase"?c=c.replace(/^./,function(i){return i.toUpperCase()}):a==="firstLowerCase"&&(c=c.replace(/^./,function(i){return i.toLowerCase()})),c}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],41:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.getStrBytesCount=void 0;function L(u){for(var S=0,R=0;R<u.length;R++){var h=u.charAt(R);/^[\u00-\uff]$/.test(h)?S+=1:S+=2}return S}P.getStrBytesCount=L},{}],42:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isArray=void 0,P.isArray=function(L){return Object.prototype.toString.call(L)==="[object Array]"}},{}],43:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isBlob=void 0;function L(u){return typeof Blob!="undefined"&&u instanceof Blob}P.isBlob=L},{}],44:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isFile=void 0,P.isFile=function(L){return typeof File!="undefined"&&L instanceof File}},{}],45:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isIP=void 0,P.isIP=function(L){var u=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,S=/^\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 u.test(L)||S.test(L)}},{}],46:[function(I,J,P){"use strict";Object.defineProperty(P,"__esModule",{value:!0}),P.isObject=void 0,P.isObject=function(L){return Object.prototype.toString.call(L)==="[object Object]"}},{}],47:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/keys"),u=S(L);function S(C){return C&&C.__esModule?C:{default:C}}Object.defineProperty(P,"__esModule",{value:!0}),P.obj2xml=void 0;var R=I("./formatObjKey");function h(C){return Object.prototype.toString.call(C).replace(/(.*? |])/g,"").toLowerCase()}function o(C,c){var a="";return c&&c.headers&&(a=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
`),c&&c.firstUpperCase&&(C=R.formatObjKey(C,"firstUpperCase")),h(C)==="object"?(0,u.default)(C).forEach(function(i){h(C[i])==="string"||h(C[i])==="number"?a+="<"+i+">"+C[i]+"</"+i+">":h(C[i])==="object"?a+="<"+i+">"+o(C[i])+"</"+i+">":h(C[i])==="array"?a+=C[i].map(function(r){return"<"+i+">"+o(r)+"</"+i+">"}).join(""):a+="<"+i+">"+C[i].toString()+"</"+i+">"}):a+=C.toString(),a}P.obj2xml=o},{"./formatObjKey":40,"babel-runtime/core-js/object/keys":60}],48:[function(I,J,P){J.exports=L,J.exports.HttpsAgent=L;function L(){}},{}],49:[function(I,J,P){J.exports=I("./register")().Promise},{"./register":51}],50:[function(I,J,P){"use strict";var L="@@any-promise/REGISTRATION",u=null;J.exports=function(S,R){return function(o,C){o=o||null,C=C||{};var c=C.global!==!1;if(u===null&&c&&(u=S[L]||null),u!==null&&o!==null&&u.implementation!==o)throw new Error('any-promise already defined as "'+u.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return u===null&&(o!==null&&typeof C.Promise!="undefined"?u={Promise:C.Promise,implementation:o}:u=R(o),c&&(S[L]=u)),u}}},{}],51:[function(I,J,P){"use strict";J.exports=I("./loader")(window,L);function L(){if(typeof window.Promise=="undefined")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"}}},{"./loader":50}],52:[function(I,J,P){J.exports={default:I("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":77}],53:[function(I,J,P){J.exports={default:I("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":78}],54:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":79}],55:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":80}],56:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":81}],57:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/entries"),__esModule:!0}},{"core-js/library/fn/object/entries":82}],58:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":83}],59:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":84}],60:[function(I,J,P){J.exports={default:I("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":85}],61:[function(I,J,P){J.exports={default:I("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":86}],62:[function(I,J,P){J.exports={default:I("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":87}],63:[function(I,J,P){J.exports={default:I("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":88}],64:[function(I,J,P){J.exports={default:I("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":90}],65:[function(I,J,P){J.exports={default:I("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":89}],66:[function(I,J,P){J.exports={default:I("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":91}],67:[function(I,J,P){"use strict";P.__esModule=!0;var L=I("../core-js/symbol/iterator"),u=o(L),S=I("../core-js/symbol"),R=o(S),h=typeof R.default=="function"&&typeof u.default=="symbol"?function(C){return typeof C}:function(C){return C&&typeof R.default=="function"&&C.constructor===R.default&&C!==R.default.prototype?"symbol":typeof C};function o(C){return C&&C.__esModule?C:{default:C}}P.default=typeof R.default=="function"&&h(u.default)==="symbol"?function(C){return typeof C=="undefined"?"undefined":h(C)}:function(C){return C&&typeof R.default=="function"&&C.constructor===R.default&&C!==R.default.prototype?"symbol":typeof C=="undefined"?"undefined":h(C)}},{"../core-js/symbol":64,"../core-js/symbol/iterator":66}],68:[function(I,J,P){J.exports=I("regenerator-runtime")},{"regenerator-runtime":226}],69:[function(I,J,P){"use strict";P.byteLength=c,P.toByteArray=i,P.fromByteArray=p;for(var L=[],u=[],S=typeof Uint8Array!="undefined"?Uint8Array:Array,R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,o=R.length;h<o;++h)L[h]=R[h],u[R.charCodeAt(h)]=h;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63;function C(f){var b=f.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=f.indexOf("=");v===-1&&(v=b);var m=v===b?0:4-v%4;return[v,m]}function c(f){var b=C(f),v=b[0],m=b[1];return(v+m)*3/4-m}function a(f,b,v){return(b+v)*3/4-v}function i(f){var b,v=C(f),m=v[0],n=v[1],d=new S(a(f,m,n)),g=0,T=n>0?m-4:m,y;for(y=0;y<T;y+=4)b=u[f.charCodeAt(y)]<<18|u[f.charCodeAt(y+1)]<<12|u[f.charCodeAt(y+2)]<<6|u[f.charCodeAt(y+3)],d[g++]=b>>16&255,d[g++]=b>>8&255,d[g++]=b&255;return n===2&&(b=u[f.charCodeAt(y)]<<2|u[f.charCodeAt(y+1)]>>4,d[g++]=b&255),n===1&&(b=u[f.charCodeAt(y)]<<10|u[f.charCodeAt(y+1)]<<4|u[f.charCodeAt(y+2)]>>2,d[g++]=b>>8&255,d[g++]=b&255),d}function r(f){return L[f>>18&63]+L[f>>12&63]+L[f>>6&63]+L[f&63]}function l(f,b,v){for(var m,n=[],d=b;d<v;d+=3)m=(f[d]<<16&16711680)+(f[d+1]<<8&65280)+(f[d+2]&255),n.push(r(m));return n.join("")}function p(f){for(var b,v=f.length,m=v%3,n=[],d=16383,g=0,T=v-m;g<T;g+=d)n.push(l(f,g,g+d>T?T:g+d));return m===1?(b=f[v-1],n.push(L[b>>2]+L[b<<4&63]+"==")):m===2&&(b=(f[v-2]<<8)+f[v-1],n.push(L[b>>10]+L[b>>4&63]+L[b<<2&63]+"=")),n.join("")}},{}],70:[function(I,J,P){/*!
|
|
|
* Bowser - a browser detector
|
|
|
* https://github.com/ded/bowser
|
|
|
* MIT License | (c) Dustin Diaz 2015
|
|
|
*/!function(L,u,S){typeof J!="undefined"&&J.exports?J.exports=S():typeof define=="function"&&define.amd?define(u,S):L[u]=S()}(this,"bowser",function(){var L=!0;function u(a){function i(G){var B=a.match(G);return B&&B.length>1&&B[1]||""}function r(G){var B=a.match(G);return B&&B.length>1&&B[2]||""}var l=i(/(ipod|iphone|ipad)/i).toLowerCase(),p=/like android/i.test(a),f=!p&&/android/i.test(a),b=/nexus\s*[0-6]\s*/i.test(a),v=!b&&/nexus\s*[0-9]+/i.test(a),m=/CrOS/.test(a),n=/silk/i.test(a),d=/sailfish/i.test(a),g=/tizen/i.test(a),T=/(web|hpw)(o|0)s/i.test(a),y=/windows phone/i.test(a),s=/SamsungBrowser/i.test(a),M=!y&&/windows/i.test(a),A=!l&&!n&&/macintosh/i.test(a),x=!f&&!d&&!g&&!T&&/linux/i.test(a),E=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=i(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(a)&&!/tablet pc/i.test(a),N=!_&&/[^-]mobi/i.test(a),j=/xbox/i.test(a),k;/opera/i.test(a)?k={name:"Opera",opera:L,version:w||i(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(a)?k={name:"Opera",opera:L,version:i(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(a)?k={name:"Samsung Internet for Android",samsungBrowser:L,version:w||i(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(a)?k={name:"NAVER Whale browser",whale:L,version:i(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(a)?k={name:"MZ Browser",mzbrowser:L,version:i(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(a)?k={name:"Opera Coast",coast:L,version:w||i(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(a)?k={name:"Focus",focus:L,version:i(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(a)?k={name:"Yandex Browser",yandexbrowser:L,version:w||i(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(a)?k={name:"UC Browser",ucbrowser:L,version:i(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(a)?k={name:"Maxthon",maxthon:L,version:i(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(a)?k={name:"Epiphany",epiphany:L,version:i(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(a)?k={name:"Puffin",puffin:L,version:i(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(a)?k={name:"Sleipnir",sleipnir:L,version:i(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(a)?k={name:"K-Meleon",kMeleon:L,version:i(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:y?(k={name:"Windows Phone",osname:"Windows Phone",windowsphone:L},E?(k.msedge=L,k.version=E):(k.msie=L,k.version=i(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(a)?k={name:"Internet Explorer",msie:L,version:i(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:m?k={name:"Chrome",osname:"Chrome OS",chromeos:L,chromeBook:L,chrome:L,version:i(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(a)?k={name:"Microsoft Edge",msedge:L,version:E}:/vivaldi/i.test(a)?k={name:"Vivaldi",vivaldi:L,version:i(/vivaldi\/(\d+(\.\d+)?)/i)||w}:d?k={name:"Sailfish",osname:"Sailfish OS",sailfish:L,version:i(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(a)?k={name:"SeaMonkey",seamonkey:L,version:i(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(a)?(k={name:"Firefox",firefox:L,version:i(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(a)&&(k.firefoxos=L,k.osname="Firefox OS")):n?k={name:"Amazon Silk",silk:L,version:i(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(a)?k={name:"PhantomJS",phantom:L,version:i(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(a)?k={name:"SlimerJS",slimer:L,version:i(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(a)||/rim\stablet/i.test(a)?k={name:"BlackBerry",osname:"BlackBerry OS",blackberry:L,version:w||i(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:T?(k={name:"WebOS",osname:"WebOS",webos:L,version:w||i(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(a)&&(k.touchpad=L)):/bada/i.test(a)?k={name:"Bada",osname:"Bada",bada:L,version:i(/dolfin\/(\d+(\.\d+)?)/i)}:g?k={name:"Tizen",osname:"Tizen",tizen:L,version:i(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(a)?k={name:"QupZilla",qupzilla:L,version:i(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(a)?k={name:"Chromium",chromium:L,version:i(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(a)?k={name:"Chrome",chrome:L,version:i(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:f?k={name:"Android",version:w}:/safari|applewebkit/i.test(a)?(k={name:"Safari",safari:L},w&&(k.version=w)):l?(k={name:l=="iphone"?"iPhone":l=="ipad"?"iPad":"iPod"},w&&(k.version=w)):/googlebot/i.test(a)?k={name:"Googlebot",googlebot:L,version:i(/googlebot\/(\d+(\.\d+))/i)||w}:k={name:i(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!k.msedge&&/(apple)?webkit/i.test(a)?(/(apple)?webkit\/537\.36/i.test(a)?(k.name=k.name||"Blink",k.blink=L):(k.name=k.name||"Webkit",k.webkit=L),!k.version&&w&&(k.version=w)):!k.opera&&/gecko\//i.test(a)&&(k.name=k.name||"Gecko",k.gecko=L,k.version=k.version||i(/gecko\/(\d+(\.\d+)?)/i)),!k.windowsphone&&(f||k.silk)?(k.android=L,k.osname="Android"):!k.windowsphone&&l?(k[l]=L,k.ios=L,k.osname="iOS"):A?(k.mac=L,k.osname="macOS"):j?(k.xbox=L,k.osname="Xbox"):M?(k.windows=L,k.osname="Windows"):x&&(k.linux=L,k.osname="Linux");function z(G){switch(G){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}}var H="";k.windows?H=z(i(/Windows ((NT|XP)( \d\d?.\d)?)/i)):k.windowsphone?H=i(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):k.mac?(H=i(/Mac OS X (\d+([_\.\s]\d+)*)/i),H=H.replace(/[_\s]/g,".")):l?(H=i(/os (\d+([_\s]\d+)*) like mac os x/i),H=H.replace(/[_\s]/g,".")):f?H=i(/android[ \/-](\d+(\.\d+)*)/i):k.webos?H=i(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):k.blackberry?H=i(/rim\stablet\sos\s(\d+(\.\d+)*)/i):k.bada?H=i(/bada\/(\d+(\.\d+)*)/i):k.tizen&&(H=i(/tizen[\/\s](\d+(\.\d+)*)/i)),H&&(k.osversion=H);var F=!k.windows&&H.split(".")[0];return _||v||l=="ipad"||f&&(F==3||F>=4&&!N)||k.silk?k.tablet=L:(N||l=="iphone"||l=="ipod"||f||b||k.blackberry||k.webos||k.bada)&&(k.mobile=L),k.msedge||k.msie&&k.version>=10||k.yandexbrowser&&k.version>=15||k.vivaldi&&k.version>=1||k.chrome&&k.version>=20||k.samsungBrowser&&k.version>=4||k.whale&&o([k.version,"1.0"])===1||k.mzbrowser&&o([k.version,"6.0"])===1||k.focus&&o([k.version,"1.0"])===1||k.firefox&&k.version>=20||k.safari&&k.version>=6||k.opera&&k.version>=10||k.ios&&k.osversion&&k.osversion.split(".")[0]>=6||k.blackberry&&k.version>=10.1||k.chromium&&k.version>=20?k.a=L:k.msie&&k.version<10||k.chrome&&k.version<20||k.firefox&&k.version<20||k.safari&&k.version<6||k.opera&&k.version<10||k.ios&&k.osversion&&k.osversion.split(".")[0]<6||k.chromium&&k.version<20?k.c=L:k.x=L,k}var S=u(typeof navigator!="undefined"&&navigator.userAgent||"");S.test=function(a){for(var i=0;i<a.length;++i){var r=a[i];if(typeof r=="string"&&r in S)return!0}return!1};function R(a){return a.split(".").length}function h(a,i){var r=[],l;if(Array.prototype.map)return Array.prototype.map.call(a,i);for(l=0;l<a.length;l++)r.push(i(a[l]));return r}function o(a){for(var i=Math.max(R(a[0]),R(a[1])),r=h(a,function(l){var p=i-R(l);return l=l+new Array(p+1).join(".0"),h(l.split("."),function(f){return new Array(20-f.length).join("0")+f}).reverse()});--i>=0;){if(r[0][i]>r[1][i])return 1;if(r[0][i]===r[1][i]){if(i===0)return 0}else return-1}}function C(a,i,r){var l=S;typeof i=="string"&&(r=i,i=void 0),i===void 0&&(i=!1),r&&(l=u(r));var p=""+l.version;for(var f in a)if(a.hasOwnProperty(f)&&l[f]){if(typeof a[f]!="string")throw new Error("Browser version in the minVersion map should be a string: "+f+": "+String(a));return o([p,a[f]])<0}return i}function c(a,i,r){return!C(a,i,r)}return S.isUnsupportedBrowser=C,S.compareVersions=o,S.check=c,S._detect=u,S.detect=u,S})},{}],71:[function(I,J,P){},{}],72:[function(I,J,P){var L=I("buffer").Buffer,u=L.isEncoding||function(c){switch(c&&c.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}};function S(c){if(c&&!u(c))throw new Error("Unknown encoding: "+c)}var R=P.StringDecoder=function(c){this.encoding=(c||"utf8").toLowerCase().replace(/[-_]/,""),S(c);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=C;break;default:this.write=h;return}this.charBuffer=new L(6),this.charReceived=0,this.charLength=0};R.prototype.write=function(c){for(var a="";this.charLength;){var i=c.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:c.length;if(c.copy(this.charBuffer,this.charReceived,0,i),this.charReceived+=i,this.charReceived<this.charLength)return"";c=c.slice(i,c.length),a=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var l=a.charCodeAt(a.length-1);if(l>=55296&&l<=56319){this.charLength+=this.surrogateSize,a="";continue}if(this.charReceived=this.charLength=0,c.length===0)return a;break}this.detectIncompleteChar(c);var r=c.length;this.charLength&&(c.copy(this.charBuffer,0,c.length-this.charReceived,r),r-=this.charReceived),a+=c.toString(this.encoding,0,r);var r=a.length-1,l=a.charCodeAt(r);if(l>=55296&&l<=56319){var p=this.surrogateSize;return this.charLength+=p,this.charReceived+=p,this.charBuffer.copy(this.charBuffer,p,0,p),c.copy(this.charBuffer,0,0,p),a.substring(0,r)}return a},R.prototype.detectIncompleteChar=function(c){for(var a=c.length>=3?3:c.length;a>0;a--){var i=c[c.length-a];if(a==1&&i>>5==6){this.charLength=2;break}if(a<=2&&i>>4==14){this.charLength=3;break}if(a<=3&&i>>3==30){this.charLength=4;break}}this.charReceived=a},R.prototype.end=function(c){var a="";if(c&&c.length&&(a=this.write(c)),this.charReceived){var i=this.charReceived,r=this.charBuffer,l=this.encoding;a+=r.slice(0,i).toString(l)}return a};function h(c){return c.toString(this.encoding)}function o(c){this.charReceived=c.length%2,this.charLength=this.charReceived?2:0}function C(c){this.charReceived=c.length%3,this.charLength=this.charReceived?3:0}},{buffer:73}],73:[function(I,J,P){(function(L,u){/*!
|
|
|
* The buffer module from node.js, for the browser.
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
|
* @license MIT
|
|
|
*/"use strict";var S=I("base64-js"),R=I("ieee754"),h=I("isarray");P.Buffer=u,P.SlowBuffer=n,P.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=L.TYPED_ARRAY_SUPPORT!==void 0?L.TYPED_ARRAY_SUPPORT:o(),P.kMaxLength=C();function o(){try{var le=new Uint8Array(1);return le.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},le.foo()===42&&typeof le.subarray=="function"&&le.subarray(1,1).byteLength===0}catch(Q){return!1}}function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(le,Q){if(C()<Q)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(le=new Uint8Array(Q),le.__proto__=u.prototype):(le===null&&(le=new u(Q)),le.length=Q),le}function u(le,Q,Y){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(le,Q,Y);if(typeof le=="number"){if(typeof Q=="string")throw new Error("If encoding is specified then the first argument must be a string");return l(this,le)}return a(this,le,Q,Y)}u.poolSize=8192,u._augment=function(le){return le.__proto__=u.prototype,le};function a(le,Q,Y,Z){if(typeof Q=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&Q instanceof ArrayBuffer?b(le,Q,Y,Z):typeof Q=="string"?p(le,Q,Y):v(le,Q)}u.from=function(le,Q,Y){return a(null,le,Q,Y)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0}));function i(le){if(typeof le!="number")throw new TypeError('"size" argument must be a number');if(le<0)throw new RangeError('"size" argument must not be negative')}function r(le,Q,Y,Z){return i(Q),Q<=0?c(le,Q):Y!==void 0?typeof Z=="string"?c(le,Q).fill(Y,Z):c(le,Q).fill(Y):c(le,Q)}u.alloc=function(le,Q,Y){return r(null,le,Q,Y)};function l(le,Q){if(i(Q),le=c(le,Q<0?0:m(Q)|0),!u.TYPED_ARRAY_SUPPORT)for(var Y=0;Y<Q;++Y)le[Y]=0;return le}u.allocUnsafe=function(le){return l(null,le)},u.allocUnsafeSlow=function(le){return l(null,le)};function p(le,Q,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!u.isEncoding(Y))throw new TypeError('"encoding" must be a valid string encoding');var Z=d(Q,Y)|0;le=c(le,Z);var be=le.write(Q,Y);return be!==Z&&(le=le.slice(0,be)),le}function f(le,Q){var Y=Q.length<0?0:m(Q.length)|0;le=c(le,Y);for(var Z=0;Z<Y;Z+=1)le[Z]=Q[Z]&255;return le}function b(le,Q,Y,Z){if(Q.byteLength,Y<0||Q.byteLength<Y)throw new RangeError("'offset' is out of bounds");if(Q.byteLength<Y+(Z||0))throw new RangeError("'length' is out of bounds");return Y===void 0&&Z===void 0?Q=new Uint8Array(Q):Z===void 0?Q=new Uint8Array(Q,Y):Q=new Uint8Array(Q,Y,Z),u.TYPED_ARRAY_SUPPORT?(le=Q,le.__proto__=u.prototype):le=f(le,Q),le}function v(le,Q){if(u.isBuffer(Q)){var Y=m(Q.length)|0;return le=c(le,Y),le.length===0||Q.copy(le,0,0,Y),le}if(Q){if(typeof ArrayBuffer!="undefined"&&Q.buffer instanceof ArrayBuffer||"length"in Q)return typeof Q.length!="number"||Oe(Q.length)?c(le,0):f(le,Q);if(Q.type==="Buffer"&&h(Q.data))return f(le,Q.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(le){if(le>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return le|0}function n(le){return+le!=le&&(le=0),u.alloc(+le)}u.isBuffer=function(Q){return!!(Q!=null&&Q._isBuffer)},u.compare=function(Q,Y){if(!u.isBuffer(Q)||!u.isBuffer(Y))throw new TypeError("Arguments must be Buffers");if(Q===Y)return 0;for(var Z=Q.length,be=Y.length,ge=0,De=Math.min(Z,be);ge<De;++ge)if(Q[ge]!==Y[ge]){Z=Q[ge],be=Y[ge];break}return Z<be?-1:be<Z?1:0},u.isEncoding=function(Q){switch(String(Q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(Q,Y){if(!h(Q))throw new TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return u.alloc(0);var Z;if(Y===void 0)for(Y=0,Z=0;Z<Q.length;++Z)Y+=Q[Z].length;var be=u.allocUnsafe(Y),ge=0;for(Z=0;Z<Q.length;++Z){var De=Q[Z];if(!u.isBuffer(De))throw new TypeError('"list" argument must be an Array of Buffers');De.copy(be,ge),ge+=De.length}return be};function d(le,Q){if(u.isBuffer(le))return le.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(le)||le instanceof ArrayBuffer))return le.byteLength;typeof le!="string"&&(le=""+le);var Y=le.length;if(Y===0)return 0;for(var Z=!1;;)switch(Q){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":case void 0:return ce(le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return te(le).length;default:if(Z)return ce(le).length;Q=(""+Q).toLowerCase(),Z=!0}}u.byteLength=d;function g(le,Q,Y){var Z=!1;if((Q===void 0||Q<0)&&(Q=0),Q>this.length)return"";if((Y===void 0||Y>this.length)&&(Y=this.length),Y<=0)return"";if(Y>>>=0,Q>>>=0,Y<=Q)return"";for(le||(le="utf8");;)switch(le){case"hex":return G(this,Q,Y);case"utf8":case"utf-8":return j(this,Q,Y);case"ascii":return H(this,Q,Y);case"latin1":case"binary":return F(this,Q,Y);case"base64":return N(this,Q,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,Q,Y);default:if(Z)throw new TypeError("Unknown encoding: "+le);le=(le+"").toLowerCase(),Z=!0}}u.prototype._isBuffer=!0;function T(le,Q,Y){var Z=le[Q];le[Q]=le[Y],le[Y]=Z}u.prototype.swap16=function(){var Q=this.length;if(Q%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Y=0;Y<Q;Y+=2)T(this,Y,Y+1);return this},u.prototype.swap32=function(){var Q=this.length;if(Q%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var Y=0;Y<Q;Y+=4)T(this,Y,Y+3),T(this,Y+1,Y+2);return this},u.prototype.swap64=function(){var Q=this.length;if(Q%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var Y=0;Y<Q;Y+=8)T(this,Y,Y+7),T(this,Y+1,Y+6),T(this,Y+2,Y+5),T(this,Y+3,Y+4);return this},u.prototype.toString=function(){var Q=this.length|0;return Q===0?"":arguments.length===0?j(this,0,Q):g.apply(this,arguments)},u.prototype.equals=function(Q){if(!u.isBuffer(Q))throw new TypeError("Argument must be a Buffer");return this===Q?!0:u.compare(this,Q)===0},u.prototype.inspect=function(){var Q="",Y=P.INSPECT_MAX_BYTES;return this.length>0&&(Q=this.toString("hex",0,Y).match(/.{2}/g).join(" "),this.length>Y&&(Q+=" ... ")),"<Buffer "+Q+">"},u.prototype.compare=function(Q,Y,Z,be,ge){if(!u.isBuffer(Q))throw new TypeError("Argument must be a Buffer");if(Y===void 0&&(Y=0),Z===void 0&&(Z=Q?Q.length:0),be===void 0&&(be=0),ge===void 0&&(ge=this.length),Y<0||Z>Q.length||be<0||ge>this.length)throw new RangeError("out of range index");if(be>=ge&&Y>=Z)return 0;if(be>=ge)return-1;if(Y>=Z)return 1;if(Y>>>=0,Z>>>=0,be>>>=0,ge>>>=0,this===Q)return 0;for(var De=ge-be,Qe=Z-Y,Ze=Math.min(De,Qe),nt=this.slice(be,ge),tt=Q.slice(Y,Z),lt=0;lt<Ze;++lt)if(nt[lt]!==tt[lt]){De=nt[lt],Qe=tt[lt];break}return De<Qe?-1:Qe<De?1:0};function y(le,Q,Y,Z,be){if(le.length===0)return-1;if(typeof Y=="string"?(Z=Y,Y=0):Y>2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Y=+Y,isNaN(Y)&&(Y=be?0:le.length-1),Y<0&&(Y=le.length+Y),Y>=le.length){if(be)return-1;Y=le.length-1}else if(Y<0)if(be)Y=0;else return-1;if(typeof Q=="string"&&(Q=u.from(Q,Z)),u.isBuffer(Q))return Q.length===0?-1:s(le,Q,Y,Z,be);if(typeof Q=="number")return Q=Q&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?be?Uint8Array.prototype.indexOf.call(le,Q,Y):Uint8Array.prototype.lastIndexOf.call(le,Q,Y):s(le,[Q],Y,Z,be);throw new TypeError("val must be string, number or Buffer")}function s(le,Q,Y,Z,be){var ge=1,De=le.length,Qe=Q.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(le.length<2||Q.length<2)return-1;ge=2,De/=2,Qe/=2,Y/=2}function Ze(je,Re){return ge===1?je[Re]:je.readUInt16BE(Re*ge)}var nt;if(be){var tt=-1;for(nt=Y;nt<De;nt++)if(Ze(le,nt)===Ze(Q,tt===-1?0:nt-tt)){if(tt===-1&&(tt=nt),nt-tt+1===Qe)return tt*ge}else tt!==-1&&(nt-=nt-tt),tt=-1}else for(Y+Qe>De&&(Y=De-Qe),nt=Y;nt>=0;nt--){for(var lt=!0,st=0;st<Qe;st++)if(Ze(le,nt+st)!==Ze(Q,st)){lt=!1;break}if(lt)return nt}return-1}u.prototype.includes=function(Q,Y,Z){return this.indexOf(Q,Y,Z)!==-1},u.prototype.indexOf=function(Q,Y,Z){return y(this,Q,Y,Z,!0)},u.prototype.lastIndexOf=function(Q,Y,Z){return y(this,Q,Y,Z,!1)};function M(le,Q,Y,Z){Y=Number(Y)||0;var be=le.length-Y;Z?(Z=Number(Z),Z>be&&(Z=be)):Z=be;var ge=Q.length;if(ge%2!==0)throw new TypeError("Invalid hex string");Z>ge/2&&(Z=ge/2);for(var De=0;De<Z;++De){var Qe=parseInt(Q.substr(De*2,2),16);if(isNaN(Qe))return De;le[Y+De]=Qe}return De}function A(le,Q,Y,Z){return ue(ce(Q,le.length-Y),le,Y,Z)}function x(le,Q,Y,Z){return ue(ae(Q),le,Y,Z)}function E(le,Q,Y,Z){return x(le,Q,Y,Z)}function w(le,Q,Y,Z){return ue(te(Q),le,Y,Z)}function _(le,Q,Y,Z){return ue(Se(Q,le.length-Y),le,Y,Z)}u.prototype.write=function(Q,Y,Z,be){if(Y===void 0)be="utf8",Z=this.length,Y=0;else if(Z===void 0&&typeof Y=="string")be=Y,Z=this.length,Y=0;else if(isFinite(Y))Y=Y|0,isFinite(Z)?(Z=Z|0,be===void 0&&(be="utf8")):(be=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ge=this.length-Y;if((Z===void 0||Z>ge)&&(Z=ge),Q.length>0&&(Z<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");be||(be="utf8");for(var De=!1;;)switch(be){case"hex":return M(this,Q,Y,Z);case"utf8":case"utf-8":return A(this,Q,Y,Z);case"ascii":return x(this,Q,Y,Z);case"latin1":case"binary":return E(this,Q,Y,Z);case"base64":return w(this,Q,Y,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,Q,Y,Z);default:if(De)throw new TypeError("Unknown encoding: "+be);be=(""+be).toLowerCase(),De=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(le,Q,Y){return Q===0&&Y===le.length?S.fromByteArray(le):S.fromByteArray(le.slice(Q,Y))}function j(le,Q,Y){Y=Math.min(le.length,Y);for(var Z=[],be=Q;be<Y;){var ge=le[be],De=null,Qe=ge>239?4:ge>223?3:ge>191?2:1;if(be+Qe<=Y){var Ze,nt,tt,lt;switch(Qe){case 1:ge<128&&(De=ge);break;case 2:Ze=le[be+1],(Ze&192)===128&&(lt=(ge&31)<<6|Ze&63,lt>127&&(De=lt));break;case 3:Ze=le[be+1],nt=le[be+2],(Ze&192)===128&&(nt&192)===128&&(lt=(ge&15)<<12|(Ze&63)<<6|nt&63,lt>2047&&(lt<55296||lt>57343)&&(De=lt));break;case 4:Ze=le[be+1],nt=le[be+2],tt=le[be+3],(Ze&192)===128&&(nt&192)===128&&(tt&192)===128&&(lt=(ge&15)<<18|(Ze&63)<<12|(nt&63)<<6|tt&63,lt>65535&<<1114112&&(De=lt))}}De===null?(De=65533,Qe=1):De>65535&&(De-=65536,Z.push(De>>>10&1023|55296),De=56320|De&1023),Z.push(De),be+=Qe}return z(Z)}var k=4096;function z(le){var Q=le.length;if(Q<=k)return String.fromCharCode.apply(String,le);for(var Y="",Z=0;Z<Q;)Y+=String.fromCharCode.apply(String,le.slice(Z,Z+=k));return Y}function H(le,Q,Y){var Z="";Y=Math.min(le.length,Y);for(var be=Q;be<Y;++be)Z+=String.fromCharCode(le[be]&127);return Z}function F(le,Q,Y){var Z="";Y=Math.min(le.length,Y);for(var be=Q;be<Y;++be)Z+=String.fromCharCode(le[be]);return Z}function G(le,Q,Y){var Z=le.length;(!Q||Q<0)&&(Q=0),(!Y||Y<0||Y>Z)&&(Y=Z);for(var be="",ge=Q;ge<Y;++ge)be+=de(le[ge]);return be}function B(le,Q,Y){for(var Z=le.slice(Q,Y),be="",ge=0;ge<Z.length;ge+=2)be+=String.fromCharCode(Z[ge]+Z[ge+1]*256);return be}u.prototype.slice=function(Q,Y){var Z=this.length;Q=~~Q,Y=Y===void 0?Z:~~Y,Q<0?(Q+=Z,Q<0&&(Q=0)):Q>Z&&(Q=Z),Y<0?(Y+=Z,Y<0&&(Y=0)):Y>Z&&(Y=Z),Y<Q&&(Y=Q);var be;if(u.TYPED_ARRAY_SUPPORT)be=this.subarray(Q,Y),be.__proto__=u.prototype;else{var ge=Y-Q;be=new u(ge,void 0);for(var De=0;De<ge;++De)be[De]=this[De+Q]}return be};function W(le,Q,Y){if(le%1!==0||le<0)throw new RangeError("offset is not uint");if(le+Q>Y)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(Q,Y,Z){Q=Q|0,Y=Y|0,Z||W(Q,Y,this.length);for(var be=this[Q],ge=1,De=0;++De<Y&&(ge*=256);)be+=this[Q+De]*ge;return be},u.prototype.readUIntBE=function(Q,Y,Z){Q=Q|0,Y=Y|0,Z||W(Q,Y,this.length);for(var be=this[Q+--Y],ge=1;Y>0&&(ge*=256);)be+=this[Q+--Y]*ge;return be},u.prototype.readUInt8=function(Q,Y){return Y||W(Q,1,this.length),this[Q]},u.prototype.readUInt16LE=function(Q,Y){return Y||W(Q,2,this.length),this[Q]|this[Q+1]<<8},u.prototype.readUInt16BE=function(Q,Y){return Y||W(Q,2,this.length),this[Q]<<8|this[Q+1]},u.prototype.readUInt32LE=function(Q,Y){return Y||W(Q,4,this.length),(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216},u.prototype.readUInt32BE=function(Q,Y){return Y||W(Q,4,this.length),this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])},u.prototype.readIntLE=function(Q,Y,Z){Q=Q|0,Y=Y|0,Z||W(Q,Y,this.length);for(var be=this[Q],ge=1,De=0;++De<Y&&(ge*=256);)be+=this[Q+De]*ge;return ge*=128,be>=ge&&(be-=Math.pow(2,8*Y)),be},u.prototype.readIntBE=function(Q,Y,Z){Q=Q|0,Y=Y|0,Z||W(Q,Y,this.length);for(var be=Y,ge=1,De=this[Q+--be];be>0&&(ge*=256);)De+=this[Q+--be]*ge;return ge*=128,De>=ge&&(De-=Math.pow(2,8*Y)),De},u.prototype.readInt8=function(Q,Y){return Y||W(Q,1,this.length),this[Q]&128?(255-this[Q]+1)*-1:this[Q]},u.prototype.readInt16LE=function(Q,Y){Y||W(Q,2,this.length);var Z=this[Q]|this[Q+1]<<8;return Z&32768?Z|4294901760:Z},u.prototype.readInt16BE=function(Q,Y){Y||W(Q,2,this.length);var Z=this[Q+1]|this[Q]<<8;return Z&32768?Z|4294901760:Z},u.prototype.readInt32LE=function(Q,Y){return Y||W(Q,4,this.length),this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24},u.prototype.readInt32BE=function(Q,Y){return Y||W(Q,4,this.length),this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]},u.prototype.readFloatLE=function(Q,Y){return Y||W(Q,4,this.length),R.read(this,Q,!0,23,4)},u.prototype.readFloatBE=function(Q,Y){return Y||W(Q,4,this.length),R.read(this,Q,!1,23,4)},u.prototype.readDoubleLE=function(Q,Y){return Y||W(Q,8,this.length),R.read(this,Q,!0,52,8)},u.prototype.readDoubleBE=function(Q,Y){return Y||W(Q,8,this.length),R.read(this,Q,!1,52,8)};function K(le,Q,Y,Z,be,ge){if(!u.isBuffer(le))throw new TypeError('"buffer" argument must be a Buffer instance');if(Q>be||Q<ge)throw new RangeError('"value" argument is out of bounds');if(Y+Z>le.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(Q,Y,Z,be){if(Q=+Q,Y=Y|0,Z=Z|0,!be){var ge=Math.pow(2,8*Z)-1;K(this,Q,Y,Z,ge,0)}var De=1,Qe=0;for(this[Y]=Q&255;++Qe<Z&&(De*=256);)this[Y+Qe]=Q/De&255;return Y+Z},u.prototype.writeUIntBE=function(Q,Y,Z,be){if(Q=+Q,Y=Y|0,Z=Z|0,!be){var ge=Math.pow(2,8*Z)-1;K(this,Q,Y,Z,ge,0)}var De=Z-1,Qe=1;for(this[Y+De]=Q&255;--De>=0&&(Qe*=256);)this[Y+De]=Q/Qe&255;return Y+Z},u.prototype.writeUInt8=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,1,255,0),u.TYPED_ARRAY_SUPPORT||(Q=Math.floor(Q)),this[Y]=Q&255,Y+1};function q(le,Q,Y,Z){Q<0&&(Q=65535+Q+1);for(var be=0,ge=Math.min(le.length-Y,2);be<ge;++be)le[Y+be]=(Q&255<<8*(Z?be:1-be))>>>(Z?be:1-be)*8}u.prototype.writeUInt16LE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q&255,this[Y+1]=Q>>>8):q(this,Q,Y,!0),Y+2},u.prototype.writeUInt16BE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q>>>8,this[Y+1]=Q&255):q(this,Q,Y,!1),Y+2};function re(le,Q,Y,Z){Q<0&&(Q=4294967295+Q+1);for(var be=0,ge=Math.min(le.length-Y,4);be<ge;++be)le[Y+be]=Q>>>(Z?be:3-be)*8&255}u.prototype.writeUInt32LE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[Y+3]=Q>>>24,this[Y+2]=Q>>>16,this[Y+1]=Q>>>8,this[Y]=Q&255):re(this,Q,Y,!0),Y+4},u.prototype.writeUInt32BE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q>>>24,this[Y+1]=Q>>>16,this[Y+2]=Q>>>8,this[Y+3]=Q&255):re(this,Q,Y,!1),Y+4},u.prototype.writeIntLE=function(Q,Y,Z,be){if(Q=+Q,Y=Y|0,!be){var ge=Math.pow(2,8*Z-1);K(this,Q,Y,Z,ge-1,-ge)}var De=0,Qe=1,Ze=0;for(this[Y]=Q&255;++De<Z&&(Qe*=256);)Q<0&&Ze===0&&this[Y+De-1]!==0&&(Ze=1),this[Y+De]=(Q/Qe>>0)-Ze&255;return Y+Z},u.prototype.writeIntBE=function(Q,Y,Z,be){if(Q=+Q,Y=Y|0,!be){var ge=Math.pow(2,8*Z-1);K(this,Q,Y,Z,ge-1,-ge)}var De=Z-1,Qe=1,Ze=0;for(this[Y+De]=Q&255;--De>=0&&(Qe*=256);)Q<0&&Ze===0&&this[Y+De+1]!==0&&(Ze=1),this[Y+De]=(Q/Qe>>0)-Ze&255;return Y+Z},u.prototype.writeInt8=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,1,127,-128),u.TYPED_ARRAY_SUPPORT||(Q=Math.floor(Q)),Q<0&&(Q=255+Q+1),this[Y]=Q&255,Y+1},u.prototype.writeInt16LE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q&255,this[Y+1]=Q>>>8):q(this,Q,Y,!0),Y+2},u.prototype.writeInt16BE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q>>>8,this[Y+1]=Q&255):q(this,Q,Y,!1),Y+2},u.prototype.writeInt32LE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q&255,this[Y+1]=Q>>>8,this[Y+2]=Q>>>16,this[Y+3]=Q>>>24):re(this,Q,Y,!0),Y+4},u.prototype.writeInt32BE=function(Q,Y,Z){return Q=+Q,Y=Y|0,Z||K(this,Q,Y,4,2147483647,-2147483648),Q<0&&(Q=4294967295+Q+1),u.TYPED_ARRAY_SUPPORT?(this[Y]=Q>>>24,this[Y+1]=Q>>>16,this[Y+2]=Q>>>8,this[Y+3]=Q&255):re(this,Q,Y,!1),Y+4};function ee(le,Q,Y,Z,be,ge){if(Y+Z>le.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function Ce(le,Q,Y,Z,be){return be||ee(le,Q,Y,4,34028234663852886e22,-34028234663852886e22),R.write(le,Q,Y,Z,23,4),Y+4}u.prototype.writeFloatLE=function(Q,Y,Z){return Ce(this,Q,Y,!0,Z)},u.prototype.writeFloatBE=function(Q,Y,Z){return Ce(this,Q,Y,!1,Z)};function xe(le,Q,Y,Z,be){return be||ee(le,Q,Y,8,17976931348623157e292,-17976931348623157e292),R.write(le,Q,Y,Z,52,8),Y+8}u.prototype.writeDoubleLE=function(Q,Y,Z){return xe(this,Q,Y,!0,Z)},u.prototype.writeDoubleBE=function(Q,Y,Z){return xe(this,Q,Y,!1,Z)},u.prototype.copy=function(Q,Y,Z,be){if(Z||(Z=0),!be&&be!==0&&(be=this.length),Y>=Q.length&&(Y=Q.length),Y||(Y=0),be>0&&be<Z&&(be=Z),be===Z)return 0;if(Q.length===0||this.length===0)return 0;if(Y<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("sourceStart out of bounds");if(be<0)throw new RangeError("sourceEnd out of bounds");be>this.length&&(be=this.length),Q.length-Y<be-Z&&(be=Q.length-Y+Z);var ge=be-Z,De;if(this===Q&&Z<Y&&Y<be)for(De=ge-1;De>=0;--De)Q[De+Y]=this[De+Z];else if(ge<1e3||!u.TYPED_ARRAY_SUPPORT)for(De=0;De<ge;++De)Q[De+Y]=this[De+Z];else Uint8Array.prototype.set.call(Q,this.subarray(Z,Z+ge),Y);return ge},u.prototype.fill=function(Q,Y,Z,be){if(typeof Q=="string"){if(typeof Y=="string"?(be=Y,Y=0,Z=this.length):typeof Z=="string"&&(be=Z,Z=this.length),Q.length===1){var ge=Q.charCodeAt(0);ge<256&&(Q=ge)}if(be!==void 0&&typeof be!="string")throw new TypeError("encoding must be a string");if(typeof be=="string"&&!u.isEncoding(be))throw new TypeError("Unknown encoding: "+be)}else typeof Q=="number"&&(Q=Q&255);if(Y<0||this.length<Y||this.length<Z)throw new RangeError("Out of range index");if(Z<=Y)return this;Y=Y>>>0,Z=Z===void 0?this.length:Z>>>0,Q||(Q=0);var De;if(typeof Q=="number")for(De=Y;De<Z;++De)this[De]=Q;else{var Qe=u.isBuffer(Q)?Q:ce(new u(Q,be).toString()),Ze=Qe.length;for(De=0;De<Z-Y;++De)this[De+Y]=Qe[De%Ze]}return this};var he=/[^+\/0-9A-Za-z-_]/g;function ke(le){if(le=_e(le).replace(he,""),le.length<2)return"";for(;le.length%4!==0;)le=le+"=";return le}function _e(le){return le.trim?le.trim():le.replace(/^\s+|\s+$/g,"")}function de(le){return le<16?"0"+le.toString(16):le.toString(16)}function ce(le,Q){Q=Q||Infinity;for(var Y,Z=le.length,be=null,ge=[],De=0;De<Z;++De){if(Y=le.charCodeAt(De),Y>55295&&Y<57344){if(!be){if(Y>56319){(Q-=3)>-1&&ge.push(239,191,189);continue}else if(De+1===Z){(Q-=3)>-1&&ge.push(239,191,189);continue}be=Y;continue}if(Y<56320){(Q-=3)>-1&&ge.push(239,191,189),be=Y;continue}Y=(be-55296<<10|Y-56320)+65536}else be&&((Q-=3)>-1&&ge.push(239,191,189));if(be=null,Y<128){if((Q-=1)<0)break;ge.push(Y)}else if(Y<2048){if((Q-=2)<0)break;ge.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((Q-=3)<0)break;ge.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((Q-=4)<0)break;ge.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw new Error("Invalid code point")}return ge}function ae(le){for(var Q=[],Y=0;Y<le.length;++Y)Q.push(le.charCodeAt(Y)&255);return Q}function Se(le,Q){for(var Y,Z,be,ge=[],De=0;De<le.length&&!((Q-=2)<0);++De)Y=le.charCodeAt(De),Z=Y>>8,be=Y%256,ge.push(be),ge.push(Z);return ge}function te(le){return S.toByteArray(ke(le))}function ue(le,Q,Y,Z){for(var be=0;be<Z&&!(be+Y>=Q.length||be>=le.length);++be)Q[be+Y]=le[be];return be}function Oe(le){return le!==le}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("buffer").Buffer)},{"base64-js":69,buffer:73,ieee754:195,isarray:198}],74:[function(I,J,P){J.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"}},{}],75:[function(I,J,P){J.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}},{}],76:[function(I,J,P){/*!
|
|
|
* copy-to - index.js
|
|
|
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var L=Array.prototype.slice;J.exports=u;function u(R,h){if(!(this instanceof u))return new u(R,h);this.src=R,this._withAccess=h}u.prototype.withAccess=function(R){return this._withAccess=R!==!1,this},u.prototype.pick=function(R){return Array.isArray(R)||(R=L.call(arguments)),R.length&&(this.keys=R),this},u.prototype.to=function(R){if(R=R||{},!this.src)return R;var h=this.keys||Object.keys(this.src);if(!this._withAccess){for(var o=0;o<h.length;o++){if(C=h[o],R[C]!==void 0)continue;R[C]=this.src[C]}return R}for(var o=0;o<h.length;o++){var C=h[o];if(!S(R,C))continue;var c=this.src.__lookupGetter__(C),a=this.src.__lookupSetter__(C);c&&R.__defineGetter__(C,c),a&&R.__defineSetter__(C,a),!c&&!a&&(R[C]=this.src[C])}return R},u.prototype.toCover=function(R){for(var h=this.keys||Object.keys(this.src),o=0;o<h.length;o++){var C=h[o];delete R[C];var c=this.src.__lookupGetter__(C),a=this.src.__lookupSetter__(C);c&&R.__defineGetter__(C,c),a&&R.__defineSetter__(C,a),!c&&!a&&(R[C]=this.src[C])}},u.prototype.override=u.prototype.toCover,u.prototype.and=function(R){var h={};return this.to(h),this.src=R,this.to(h),this.src=h,this};function S(R,h){return R[h]===void 0&&R.__lookupGetter__(h)===void 0&&R.__lookupSetter__(h)===void 0}},{}],77:[function(I,J,P){I("../../modules/es6.string.iterator"),I("../../modules/es6.array.from"),J.exports=I("../../modules/_core").Array.from},{"../../modules/_core":99,"../../modules/es6.array.from":168,"../../modules/es6.string.iterator":180}],78:[function(I,J,P){var L=I("../../modules/_core"),u=L.JSON||(L.JSON={stringify:JSON.stringify});J.exports=function(R){return u.stringify.apply(u,arguments)}},{"../../modules/_core":99}],79:[function(I,J,P){I("../../modules/es6.object.assign"),J.exports=I("../../modules/_core").Object.assign},{"../../modules/_core":99,"../../modules/es6.object.assign":171}],80:[function(I,J,P){I("../../modules/es6.object.create");var L=I("../../modules/_core").Object;J.exports=function(S,R){return L.create(S,R)}},{"../../modules/_core":99,"../../modules/es6.object.create":172}],81:[function(I,J,P){I("../../modules/es6.object.define-property");var L=I("../../modules/_core").Object;J.exports=function(S,R,h){return L.defineProperty(S,R,h)}},{"../../modules/_core":99,"../../modules/es6.object.define-property":173}],82:[function(I,J,P){I("../../modules/es7.object.entries"),J.exports=I("../../modules/_core").Object.entries},{"../../modules/_core":99,"../../modules/es7.object.entries":182}],83:[function(I,J,P){I("../../modules/es6.object.get-own-property-names");var L=I("../../modules/_core").Object;J.exports=function(S){return L.getOwnPropertyNames(S)}},{"../../modules/_core":99,"../../modules/es6.object.get-own-property-names":174}],84:[function(I,J,P){I("../../modules/es6.object.get-prototype-of"),J.exports=I("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":99,"../../modules/es6.object.get-prototype-of":175}],85:[function(I,J,P){I("../../modules/es6.object.keys"),J.exports=I("../../modules/_core").Object.keys},{"../../modules/_core":99,"../../modules/es6.object.keys":176}],86:[function(I,J,P){I("../modules/es6.object.to-string"),I("../modules/es6.string.iterator"),I("../modules/web.dom.iterable"),I("../modules/es6.promise"),I("../modules/es7.promise.finally"),I("../modules/es7.promise.try"),J.exports=I("../modules/_core").Promise},{"../modules/_core":99,"../modules/es6.object.to-string":177,"../modules/es6.promise":178,"../modules/es6.string.iterator":180,"../modules/es7.promise.finally":183,"../modules/es7.promise.try":184,"../modules/web.dom.iterable":187}],87:[function(I,J,P){I("../modules/web.immediate"),J.exports=I("../modules/_core").setImmediate},{"../modules/_core":99,"../modules/web.immediate":188}],88:[function(I,J,P){I("../../modules/es6.string.from-code-point"),J.exports=I("../../modules/_core").String.fromCodePoint},{"../../modules/_core":99,"../../modules/es6.string.from-code-point":179}],89:[function(I,J,P){I("../../modules/es6.function.has-instance"),J.exports=I("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":165,"../../modules/es6.function.has-instance":170}],90:[function(I,J,P){I("../../modules/es6.symbol"),I("../../modules/es6.object.to-string"),I("../../modules/es7.symbol.async-iterator"),I("../../modules/es7.symbol.observable"),J.exports=I("../../modules/_core").Symbol},{"../../modules/_core":99,"../../modules/es6.object.to-string":177,"../../modules/es6.symbol":181,"../../modules/es7.symbol.async-iterator":185,"../../modules/es7.symbol.observable":186}],91:[function(I,J,P){I("../../modules/es6.string.iterator"),I("../../modules/web.dom.iterable"),J.exports=I("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":165,"../../modules/es6.string.iterator":180,"../../modules/web.dom.iterable":187}],92:[function(I,J,P){J.exports=function(L){if(typeof L!="function")throw TypeError(L+" is not a function!");return L}},{}],93:[function(I,J,P){J.exports=function(){}},{}],94:[function(I,J,P){J.exports=function(L,u,S,R){if(!(L instanceof u)||R!==void 0&&R in L)throw TypeError(S+": incorrect invocation!");return L}},{}],95:[function(I,J,P){var L=I("./_is-object");J.exports=function(u){if(!L(u))throw TypeError(u+" is not an object!");return u}},{"./_is-object":119}],96:[function(I,J,P){var L=I("./_to-iobject"),u=I("./_to-length"),S=I("./_to-absolute-index");J.exports=function(R){return function(h,o,C){var c=L(h),a=u(c.length),i=S(C,a),r;if(R&&o!=o){for(;a>i;)if(r=c[i++],r!=r)return!0}else for(;a>i;i++)if((R||i in c)&&c[i]===o)return R||i||0;return!R&&-1}}},{"./_to-absolute-index":156,"./_to-iobject":158,"./_to-length":159}],97:[function(I,J,P){var L=I("./_cof"),u=I("./_wks")("toStringTag"),S=L(function(){return arguments}())=="Arguments",R=function(h,o){try{return h[o]}catch(C){}};J.exports=function(h){var o,C,c;return h===void 0?"Undefined":h===null?"Null":typeof(C=R(o=Object(h),u))=="string"?C:S?L(o):(c=L(o))=="Object"&&typeof o.callee=="function"?"Arguments":c}},{"./_cof":98,"./_wks":166}],98:[function(I,J,P){var L={}.toString;J.exports=function(u){return L.call(u).slice(8,-1)}},{}],99:[function(I,J,P){var L=J.exports={version:"2.6.11"};typeof __e=="number"&&(__e=L)},{}],100:[function(I,J,P){"use strict";var L=I("./_object-dp"),u=I("./_property-desc");J.exports=function(S,R,h){R in S?L.f(S,R,u(0,h)):S[R]=h}},{"./_object-dp":132,"./_property-desc":146}],101:[function(I,J,P){var L=I("./_a-function");J.exports=function(u,S,R){if(L(u),S===void 0)return u;switch(R){case 1:return function(h){return u.call(S,h)};case 2:return function(h,o){return u.call(S,h,o)};case 3:return function(h,o,C){return u.call(S,h,o,C)}}return function(){return u.apply(S,arguments)}}},{"./_a-function":92}],102:[function(I,J,P){J.exports=function(L){if(L==null)throw TypeError("Can't call method on "+L);return L}},{}],103:[function(I,J,P){J.exports=!I("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":108}],104:[function(I,J,P){var L=I("./_is-object"),u=I("./_global").document,S=L(u)&&L(u.createElement);J.exports=function(R){return S?u.createElement(R):{}}},{"./_global":110,"./_is-object":119}],105:[function(I,J,P){J.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],106:[function(I,J,P){var L=I("./_object-keys"),u=I("./_object-gops"),S=I("./_object-pie");J.exports=function(R){var h=L(R),o=u.f;if(o)for(var C=o(R),c=S.f,a=0,i;C.length>a;)c.call(R,i=C[a++])&&h.push(i);return h}},{"./_object-gops":137,"./_object-keys":140,"./_object-pie":141}],107:[function(I,J,P){var L=I("./_global"),u=I("./_core"),S=I("./_ctx"),R=I("./_hide"),h=I("./_has"),o="prototype",C=function(c,a,i){var r=c&C.F,l=c&C.G,p=c&C.S,f=c&C.P,b=c&C.B,v=c&C.W,m=l?u:u[a]||(u[a]={}),n=m[o],d=l?L:p?L[a]:(L[a]||{})[o],g,T,y;l&&(i=a);for(g in i){if(T=!r&&d&&d[g]!==void 0,T&&h(m,g))continue;y=T?d[g]:i[g],m[g]=l&&typeof d[g]!="function"?i[g]:b&&T?S(y,L):v&&d[g]==y?function(s){var M=function(A,x,E){if(this instanceof s){switch(arguments.length){case 0:return new s;case 1:return new s(A);case 2:return new s(A,x)}return new s(A,x,E)}return s.apply(this,arguments)};return M[o]=s[o],M}(y):f&&typeof y=="function"?S(Function.call,y):y,f&&((m.virtual||(m.virtual={}))[g]=y,c&C.R&&n&&!n[g]&&R(n,g,y))}};C.F=1,C.G=2,C.S=4,C.P=8,C.B=16,C.W=32,C.U=64,C.R=128,J.exports=C},{"./_core":99,"./_ctx":101,"./_global":110,"./_has":111,"./_hide":112}],108:[function(I,J,P){J.exports=function(L){try{return!!L()}catch(u){return!0}}},{}],109:[function(I,J,P){var L=I("./_ctx"),u=I("./_iter-call"),S=I("./_is-array-iter"),R=I("./_an-object"),h=I("./_to-length"),o=I("./core.get-iterator-method"),C={},c={},P=J.exports=function(a,i,r,l,p){var f=p?function(){return a}:o(a),b=L(r,l,i?2:1),v=0,m,n,d,g;if(typeof f!="function")throw TypeError(a+" is not iterable!");if(S(f)){for(m=h(a.length);m>v;v++)if(g=i?b(R(n=a[v])[0],n[1]):b(a[v]),g===C||g===c)return g}else for(d=f.call(a);!(n=d.next()).done;)if(g=u(d,b,n.value,i),g===C||g===c)return g};P.BREAK=C,P.RETURN=c},{"./_an-object":95,"./_ctx":101,"./_is-array-iter":117,"./_iter-call":120,"./_to-length":159,"./core.get-iterator-method":167}],110:[function(I,J,P){var L=J.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=L)},{}],111:[function(I,J,P){var L={}.hasOwnProperty;J.exports=function(u,S){return L.call(u,S)}},{}],112:[function(I,J,P){var L=I("./_object-dp"),u=I("./_property-desc");J.exports=I("./_descriptors")?function(S,R,h){return L.f(S,R,u(1,h))}:function(S,R,h){return S[R]=h,S}},{"./_descriptors":103,"./_object-dp":132,"./_property-desc":146}],113:[function(I,J,P){var L=I("./_global").document;J.exports=L&&L.documentElement},{"./_global":110}],114:[function(I,J,P){J.exports=!I("./_descriptors")&&!I("./_fails")(function(){return Object.defineProperty(I("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":103,"./_dom-create":104,"./_fails":108}],115:[function(I,J,P){J.exports=function(L,u,S){var R=S===void 0;switch(u.length){case 0:return R?L():L.call(S);case 1:return R?L(u[0]):L.call(S,u[0]);case 2:return R?L(u[0],u[1]):L.call(S,u[0],u[1]);case 3:return R?L(u[0],u[1],u[2]):L.call(S,u[0],u[1],u[2]);case 4:return R?L(u[0],u[1],u[2],u[3]):L.call(S,u[0],u[1],u[2],u[3])}return L.apply(S,u)}},{}],116:[function(I,J,P){var L=I("./_cof");J.exports=Object("z").propertyIsEnumerable(0)?Object:function(u){return L(u)=="String"?u.split(""):Object(u)}},{"./_cof":98}],117:[function(I,J,P){var L=I("./_iterators"),u=I("./_wks")("iterator"),S=Array.prototype;J.exports=function(R){return R!==void 0&&(L.Array===R||S[u]===R)}},{"./_iterators":125,"./_wks":166}],118:[function(I,J,P){var L=I("./_cof");J.exports=Array.isArray||function(S){return L(S)=="Array"}},{"./_cof":98}],119:[function(I,J,P){J.exports=function(L){return typeof L=="object"?L!==null:typeof L=="function"}},{}],120:[function(I,J,P){var L=I("./_an-object");J.exports=function(u,S,R,h){try{return h?S(L(R)[0],R[1]):S(R)}catch(C){var o=u.return;throw o!==void 0&&L(o.call(u)),C}}},{"./_an-object":95}],121:[function(I,J,P){"use strict";var L=I("./_object-create"),u=I("./_property-desc"),S=I("./_set-to-string-tag"),R={};I("./_hide")(R,I("./_wks")("iterator"),function(){return this}),J.exports=function(h,o,C){h.prototype=L(R,{next:u(1,C)}),S(h,o+" Iterator")}},{"./_hide":112,"./_object-create":131,"./_property-desc":146,"./_set-to-string-tag":150,"./_wks":166}],122:[function(I,J,P){"use strict";var L=I("./_library"),u=I("./_export"),S=I("./_redefine"),R=I("./_hide"),h=I("./_iterators"),o=I("./_iter-create"),C=I("./_set-to-string-tag"),c=I("./_object-gpo"),a=I("./_wks")("iterator"),i=!([].keys&&"next"in[].keys()),r="@@iterator",l="keys",p="values",f=function(){return this};J.exports=function(b,v,m,n,d,g,T){o(m,v,n);var y=function(H){if(!i&&H in x)return x[H];switch(H){case l:return function(){return new m(this,H)};case p:return function(){return new m(this,H)}}return function(){return new m(this,H)}},s=v+" Iterator",M=d==p,A=!1,x=b.prototype,E=x[a]||x[r]||d&&x[d],w=E||y(d),_=d?M?y("entries"):w:void 0,N=v=="Array"&&x.entries||E,j,k,z;if(N&&(z=c(N.call(new b)),z!==Object.prototype&&z.next&&(C(z,s,!0),!L&&typeof z[a]!="function"&&R(z,a,f))),M&&E&&E.name!==p&&(A=!0,w=function(){return E.call(this)}),(!L||T)&&(i||A||!x[a])&&R(x,a,w),h[v]=w,h[s]=f,d)if(j={values:M?w:y(p),keys:g?w:y(l),entries:_},T)for(k in j)k in x||S(x,k,j[k]);else u(u.P+u.F*(i||A),v,j);return j}},{"./_export":107,"./_hide":112,"./_iter-create":121,"./_iterators":125,"./_library":126,"./_object-gpo":138,"./_redefine":148,"./_set-to-string-tag":150,"./_wks":166}],123:[function(I,J,P){var L=I("./_wks")("iterator"),u=!1;try{var S=[7][L]();S.return=function(){u=!0},Array.from(S,function(){throw 2})}catch(R){}J.exports=function(R,h){if(!h&&!u)return!1;var o=!1;try{var C=[7],c=C[L]();c.next=function(){return{done:o=!0}},C[L]=function(){return c},R(C)}catch(a){}return o}},{"./_wks":166}],124:[function(I,J,P){J.exports=function(L,u){return{value:u,done:!!L}}},{}],125:[function(I,J,P){J.exports={}},{}],126:[function(I,J,P){J.exports=!0},{}],127:[function(I,J,P){var L=I("./_uid")("meta"),u=I("./_is-object"),S=I("./_has"),R=I("./_object-dp").f,h=0,o=Object.isExtensible||function(){return!0},C=!I("./_fails")(function(){return o(Object.preventExtensions({}))}),c=function(p){R(p,L,{value:{i:"O"+ ++h,w:{}}})},a=function(p,f){if(!u(p))return typeof p=="symbol"?p:(typeof p=="string"?"S":"P")+p;if(!S(p,L)){if(!o(p))return"F";if(!f)return"E";c(p)}return p[L].i},i=function(p,f){if(!S(p,L)){if(!o(p))return!0;if(!f)return!1;c(p)}return p[L].w},r=function(p){return C&&l.NEED&&o(p)&&!S(p,L)&&c(p),p},l=J.exports={KEY:L,NEED:!1,fastKey:a,getWeak:i,onFreeze:r}},{"./_fails":108,"./_has":111,"./_is-object":119,"./_object-dp":132,"./_uid":162}],128:[function(I,J,P){var L=I("./_global"),u=I("./_task").set,S=L.MutationObserver||L.WebKitMutationObserver,R=L.process,h=L.Promise,o=I("./_cof")(R)=="process";J.exports=function(){var C,c,a,i=function(){var f,b;for(o&&(f=R.domain)&&f.exit();C;){b=C.fn,C=C.next;try{b()}catch(v){throw C?a():c=void 0,v}}c=void 0,f&&f.enter()};if(o)a=function(){R.nextTick(i)};else if(S&&!(L.navigator&&L.navigator.standalone)){var r=!0,l=document.createTextNode("");new S(i).observe(l,{characterData:!0}),a=function(){l.data=r=!r}}else if(h&&h.resolve){var p=h.resolve(void 0);a=function(){p.then(i)}}else a=function(){u.call(L,i)};return function(f){var b={fn:f,next:void 0};c&&(c.next=b),C||(C=b,a()),c=b}}},{"./_cof":98,"./_global":110,"./_task":155}],129:[function(I,J,P){"use strict";var L=I("./_a-function");function u(S){var R,h;this.promise=new S(function(o,C){if(R!==void 0||h!==void 0)throw TypeError("Bad Promise constructor");R=o,h=C}),this.resolve=L(R),this.reject=L(h)}J.exports.f=function(S){return new u(S)}},{"./_a-function":92}],130:[function(I,J,P){"use strict";var L=I("./_descriptors"),u=I("./_object-keys"),S=I("./_object-gops"),R=I("./_object-pie"),h=I("./_to-object"),o=I("./_iobject"),C=Object.assign;J.exports=!C||I("./_fails")(function(){var c={},a={},i=Symbol(),r="abcdefghijklmnopqrst";return c[i]=7,r.split("").forEach(function(l){a[l]=l}),C({},c)[i]!=7||Object.keys(C({},a)).join("")!=r})?function(a,i){for(var r=h(a),l=arguments.length,p=1,f=S.f,b=R.f;l>p;)for(var v=o(arguments[p++]),m=f?u(v).concat(f(v)):u(v),n=m.length,d=0,g;n>d;)g=m[d++],(!L||b.call(v,g))&&(r[g]=v[g]);return r}:C},{"./_descriptors":103,"./_fails":108,"./_iobject":116,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_to-object":160}],131:[function(I,J,P){var L=I("./_an-object"),u=I("./_object-dps"),S=I("./_enum-bug-keys"),R=I("./_shared-key")("IE_PROTO"),h=function(){},o="prototype",C=function(){var c=I("./_dom-create")("iframe"),a=S.length,i="<",r=">",l;for(c.style.display="none",I("./_html").appendChild(c),c.src="javascript:",l=c.contentWindow.document,l.open(),l.write(i+"script"+r+"document.F=Object"+i+"/script"+r),l.close(),C=l.F;a--;)delete C[o][S[a]];return C()};J.exports=Object.create||function(a,i){var r;return a!==null?(h[o]=L(a),r=new h,h[o]=null,r[R]=a):r=C(),i===void 0?r:u(r,i)}},{"./_an-object":95,"./_dom-create":104,"./_enum-bug-keys":105,"./_html":113,"./_object-dps":133,"./_shared-key":151}],132:[function(I,J,P){var L=I("./_an-object"),u=I("./_ie8-dom-define"),S=I("./_to-primitive"),R=Object.defineProperty;P.f=I("./_descriptors")?Object.defineProperty:function(o,C,c){if(L(o),C=S(C,!0),L(c),u)try{return R(o,C,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(o[C]=c.value),o}},{"./_an-object":95,"./_descriptors":103,"./_ie8-dom-define":114,"./_to-primitive":161}],133:[function(I,J,P){var L=I("./_object-dp"),u=I("./_an-object"),S=I("./_object-keys");J.exports=I("./_descriptors")?Object.defineProperties:function(h,o){u(h);for(var C=S(o),c=C.length,a=0,i;c>a;)L.f(h,i=C[a++],o[i]);return h}},{"./_an-object":95,"./_descriptors":103,"./_object-dp":132,"./_object-keys":140}],134:[function(I,J,P){var L=I("./_object-pie"),u=I("./_property-desc"),S=I("./_to-iobject"),R=I("./_to-primitive"),h=I("./_has"),o=I("./_ie8-dom-define"),C=Object.getOwnPropertyDescriptor;P.f=I("./_descriptors")?C:function(a,i){if(a=S(a),i=R(i,!0),o)try{return C(a,i)}catch(r){}if(h(a,i))return u(!L.f.call(a,i),a[i])}},{"./_descriptors":103,"./_has":111,"./_ie8-dom-define":114,"./_object-pie":141,"./_property-desc":146,"./_to-iobject":158,"./_to-primitive":161}],135:[function(I,J,P){var L=I("./_to-iobject"),u=I("./_object-gopn").f,S={}.toString,R=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(o){try{return u(o)}catch(C){return R.slice()}};J.exports.f=function(C){return R&&S.call(C)=="[object Window]"?h(C):u(L(C))}},{"./_object-gopn":136,"./_to-iobject":158}],136:[function(I,J,P){var L=I("./_object-keys-internal"),u=I("./_enum-bug-keys").concat("length","prototype");P.f=Object.getOwnPropertyNames||function(R){return L(R,u)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],137:[function(I,J,P){P.f=Object.getOwnPropertySymbols},{}],138:[function(I,J,P){var L=I("./_has"),u=I("./_to-object"),S=I("./_shared-key")("IE_PROTO"),R=Object.prototype;J.exports=Object.getPrototypeOf||function(h){return h=u(h),L(h,S)?h[S]:typeof h.constructor=="function"&&h instanceof h.constructor?h.constructor.prototype:h instanceof Object?R:null}},{"./_has":111,"./_shared-key":151,"./_to-object":160}],139:[function(I,J,P){var L=I("./_has"),u=I("./_to-iobject"),S=I("./_array-includes")(!1),R=I("./_shared-key")("IE_PROTO");J.exports=function(h,o){var C=u(h),c=0,a=[],i;for(i in C)i!=R&&(L(C,i)&&a.push(i));for(;o.length>c;)L(C,i=o[c++])&&(~S(a,i)||a.push(i));return a}},{"./_array-includes":96,"./_has":111,"./_shared-key":151,"./_to-iobject":158}],140:[function(I,J,P){var L=I("./_object-keys-internal"),u=I("./_enum-bug-keys");J.exports=Object.keys||function(R){return L(R,u)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],141:[function(I,J,P){P.f={}.propertyIsEnumerable},{}],142:[function(I,J,P){var L=I("./_export"),u=I("./_core"),S=I("./_fails");J.exports=function(R,h){var o=(u.Object||{})[R]||Object[R],C={};C[R]=h(o),L(L.S+L.F*S(function(){o(1)}),"Object",C)}},{"./_core":99,"./_export":107,"./_fails":108}],143:[function(I,J,P){var L=I("./_descriptors"),u=I("./_object-keys"),S=I("./_to-iobject"),R=I("./_object-pie").f;J.exports=function(h){return function(o){for(var C=S(o),c=u(C),a=c.length,i=0,r=[],l;a>i;)l=c[i++],(!L||R.call(C,l))&&r.push(h?[l,C[l]]:C[l]);return r}}},{"./_descriptors":103,"./_object-keys":140,"./_object-pie":141,"./_to-iobject":158}],144:[function(I,J,P){J.exports=function(L){try{return{e:!1,v:L()}}catch(u){return{e:!0,v:u}}}},{}],145:[function(I,J,P){var L=I("./_an-object"),u=I("./_is-object"),S=I("./_new-promise-capability");J.exports=function(R,h){if(L(R),u(h)&&h.constructor===R)return h;var o=S.f(R),C=o.resolve;return C(h),o.promise}},{"./_an-object":95,"./_is-object":119,"./_new-promise-capability":129}],146:[function(I,J,P){J.exports=function(L,u){return{enumerable:!(L&1),configurable:!(L&2),writable:!(L&4),value:u}}},{}],147:[function(I,J,P){var L=I("./_hide");J.exports=function(u,S,R){for(var h in S)R&&u[h]?u[h]=S[h]:L(u,h,S[h]);return u}},{"./_hide":112}],148:[function(I,J,P){J.exports=I("./_hide")},{"./_hide":112}],149:[function(I,J,P){"use strict";var L=I("./_global"),u=I("./_core"),S=I("./_object-dp"),R=I("./_descriptors"),h=I("./_wks")("species");J.exports=function(o){var C=typeof u[o]=="function"?u[o]:L[o];R&&C&&!C[h]&&S.f(C,h,{configurable:!0,get:function(){return this}})}},{"./_core":99,"./_descriptors":103,"./_global":110,"./_object-dp":132,"./_wks":166}],150:[function(I,J,P){var L=I("./_object-dp").f,u=I("./_has"),S=I("./_wks")("toStringTag");J.exports=function(R,h,o){R&&!u(R=o?R:R.prototype,S)&&L(R,S,{configurable:!0,value:h})}},{"./_has":111,"./_object-dp":132,"./_wks":166}],151:[function(I,J,P){var L=I("./_shared")("keys"),u=I("./_uid");J.exports=function(S){return L[S]||(L[S]=u(S))}},{"./_shared":152,"./_uid":162}],152:[function(I,J,P){var L=I("./_core"),u=I("./_global"),S="__core-js_shared__",R=u[S]||(u[S]={});(J.exports=function(h,o){return R[h]||(R[h]=o!==void 0?o:{})})("versions",[]).push({version:L.version,mode:I("./_library")?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},{"./_core":99,"./_global":110,"./_library":126}],153:[function(I,J,P){var L=I("./_an-object"),u=I("./_a-function"),S=I("./_wks")("species");J.exports=function(R,h){var o=L(R).constructor,C;return o===void 0||(C=L(o)[S])==null?h:u(C)}},{"./_a-function":92,"./_an-object":95,"./_wks":166}],154:[function(I,J,P){var L=I("./_to-integer"),u=I("./_defined");J.exports=function(S){return function(R,h){var o=String(u(R)),C=L(h),c=o.length,a,i;return C<0||C>=c?S?"":void 0:(a=o.charCodeAt(C),a<55296||a>56319||C+1===c||(i=o.charCodeAt(C+1))<56320||i>57343?S?o.charAt(C):a:S?o.slice(C,C+2):(a-55296<<10)+(i-56320)+65536)}}},{"./_defined":102,"./_to-integer":157}],155:[function(I,J,P){var L=I("./_ctx"),u=I("./_invoke"),S=I("./_html"),R=I("./_dom-create"),h=I("./_global"),o=h.process,C=h.setImmediate,c=h.clearImmediate,a=h.MessageChannel,i=h.Dispatch,r=0,l={},p="onreadystatechange",f,b,v,m=function(){var d=+this;if(l.hasOwnProperty(d)){var g=l[d];delete l[d],g()}},n=function(d){m.call(d.data)};(!C||!c)&&(C=function(g){for(var T=[],y=1;arguments.length>y;)T.push(arguments[y++]);return l[++r]=function(){u(typeof g=="function"?g:Function(g),T)},f(r),r},c=function(g){delete l[g]},I("./_cof")(o)=="process"?f=function(d){o.nextTick(L(m,d,1))}:i&&i.now?f=function(d){i.now(L(m,d,1))}:a?(b=new a,v=b.port2,b.port1.onmessage=n,f=L(v.postMessage,v,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(f=function(d){h.postMessage(d+"","*")},h.addEventListener("message",n,!1)):p in R("script")?f=function(d){S.appendChild(R("script"))[p]=function(){S.removeChild(this),m.call(d)}}:f=function(d){setTimeout(L(m,d,1),0)}),J.exports={set:C,clear:c}},{"./_cof":98,"./_ctx":101,"./_dom-create":104,"./_global":110,"./_html":113,"./_invoke":115}],156:[function(I,J,P){var L=I("./_to-integer"),u=Math.max,S=Math.min;J.exports=function(R,h){return R=L(R),R<0?u(R+h,0):S(R,h)}},{"./_to-integer":157}],157:[function(I,J,P){var L=Math.ceil,u=Math.floor;J.exports=function(S){return isNaN(S=+S)?0:(S>0?u:L)(S)}},{}],158:[function(I,J,P){var L=I("./_iobject"),u=I("./_defined");J.exports=function(S){return L(u(S))}},{"./_defined":102,"./_iobject":116}],159:[function(I,J,P){var L=I("./_to-integer"),u=Math.min;J.exports=function(S){return S>0?u(L(S),9007199254740991):0}},{"./_to-integer":157}],160:[function(I,J,P){var L=I("./_defined");J.exports=function(u){return Object(L(u))}},{"./_defined":102}],161:[function(I,J,P){var L=I("./_is-object");J.exports=function(u,S){if(!L(u))return u;var R,h;if(S&&typeof(R=u.toString)=="function"&&!L(h=R.call(u)))return h;if(typeof(R=u.valueOf)=="function"&&!L(h=R.call(u)))return h;if(!S&&typeof(R=u.toString)=="function"&&!L(h=R.call(u)))return h;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":119}],162:[function(I,J,P){var L=0,u=Math.random();J.exports=function(S){return"Symbol(".concat(S===void 0?"":S,")_",(++L+u).toString(36))}},{}],163:[function(I,J,P){var L=I("./_global"),u=L.navigator;J.exports=u&&u.userAgent||""},{"./_global":110}],164:[function(I,J,P){var L=I("./_global"),u=I("./_core"),S=I("./_library"),R=I("./_wks-ext"),h=I("./_object-dp").f;J.exports=function(o){var C=u.Symbol||(u.Symbol=S?{}:L.Symbol||{});o.charAt(0)!="_"&&!(o in C)&&h(C,o,{value:R.f(o)})}},{"./_core":99,"./_global":110,"./_library":126,"./_object-dp":132,"./_wks-ext":165}],165:[function(I,J,P){P.f=I("./_wks")},{"./_wks":166}],166:[function(I,J,P){var L=I("./_shared")("wks"),u=I("./_uid"),S=I("./_global").Symbol,R=typeof S=="function",h=J.exports=function(o){return L[o]||(L[o]=R&&S[o]||(R?S:u)("Symbol."+o))};h.store=L},{"./_global":110,"./_shared":152,"./_uid":162}],167:[function(I,J,P){var L=I("./_classof"),u=I("./_wks")("iterator"),S=I("./_iterators");J.exports=I("./_core").getIteratorMethod=function(R){if(R!=null)return R[u]||R["@@iterator"]||S[L(R)]}},{"./_classof":97,"./_core":99,"./_iterators":125,"./_wks":166}],168:[function(I,J,P){"use strict";var L=I("./_ctx"),u=I("./_export"),S=I("./_to-object"),R=I("./_iter-call"),h=I("./_is-array-iter"),o=I("./_to-length"),C=I("./_create-property"),c=I("./core.get-iterator-method");u(u.S+u.F*!I("./_iter-detect")(function(a){Array.from(a)}),"Array",{from:function(i){var r=S(i),l=typeof this=="function"?this:Array,p=arguments.length,f=p>1?arguments[1]:void 0,b=f!==void 0,v=0,m=c(r),n,d,g,T;if(b&&(f=L(f,p>2?arguments[2]:void 0,2)),m!=null&&!(l==Array&&h(m)))for(T=m.call(r),d=new l;!(g=T.next()).done;v++)C(d,v,b?R(T,f,[g.value,v],!0):g.value);else for(n=o(r.length),d=new l(n);n>v;v++)C(d,v,b?f(r[v],v):r[v]);return d.length=v,d}})},{"./_create-property":100,"./_ctx":101,"./_export":107,"./_is-array-iter":117,"./_iter-call":120,"./_iter-detect":123,"./_to-length":159,"./_to-object":160,"./core.get-iterator-method":167}],169:[function(I,J,P){"use strict";var L=I("./_add-to-unscopables"),u=I("./_iter-step"),S=I("./_iterators"),R=I("./_to-iobject");J.exports=I("./_iter-define")(Array,"Array",function(h,o){this._t=R(h),this._i=0,this._k=o},function(){var h=this._t,o=this._k,C=this._i++;return!h||C>=h.length?(this._t=void 0,u(1)):o=="keys"?u(0,C):o=="values"?u(0,h[C]):u(0,[C,h[C]])},"values"),S.Arguments=S.Array,L("keys"),L("values"),L("entries")},{"./_add-to-unscopables":93,"./_iter-define":122,"./_iter-step":124,"./_iterators":125,"./_to-iobject":158}],170:[function(I,J,P){"use strict";var L=I("./_is-object"),u=I("./_object-gpo"),S=I("./_wks")("hasInstance"),R=Function.prototype;S in R||I("./_object-dp").f(R,S,{value:function(h){if(typeof this!="function"||!L(h))return!1;if(!L(this.prototype))return h instanceof this;for(;h=u(h);)if(this.prototype===h)return!0;return!1}})},{"./_is-object":119,"./_object-dp":132,"./_object-gpo":138,"./_wks":166}],171:[function(I,J,P){var L=I("./_export");L(L.S+L.F,"Object",{assign:I("./_object-assign")})},{"./_export":107,"./_object-assign":130}],172:[function(I,J,P){var L=I("./_export");L(L.S,"Object",{create:I("./_object-create")})},{"./_export":107,"./_object-create":131}],173:[function(I,J,P){var L=I("./_export");L(L.S+L.F*!I("./_descriptors"),"Object",{defineProperty:I("./_object-dp").f})},{"./_descriptors":103,"./_export":107,"./_object-dp":132}],174:[function(I,J,P){I("./_object-sap")("getOwnPropertyNames",function(){return I("./_object-gopn-ext").f})},{"./_object-gopn-ext":135,"./_object-sap":142}],175:[function(I,J,P){var L=I("./_to-object"),u=I("./_object-gpo");I("./_object-sap")("getPrototypeOf",function(){return function(R){return u(L(R))}})},{"./_object-gpo":138,"./_object-sap":142,"./_to-object":160}],176:[function(I,J,P){var L=I("./_to-object"),u=I("./_object-keys");I("./_object-sap")("keys",function(){return function(R){return u(L(R))}})},{"./_object-keys":140,"./_object-sap":142,"./_to-object":160}],177:[function(I,J,P){arguments[4][71][0].apply(P,arguments)},{dup:71}],178:[function(I,J,P){"use strict";var L=I("./_library"),u=I("./_global"),S=I("./_ctx"),R=I("./_classof"),h=I("./_export"),o=I("./_is-object"),C=I("./_a-function"),c=I("./_an-instance"),a=I("./_for-of"),i=I("./_species-constructor"),r=I("./_task").set,l=I("./_microtask")(),p=I("./_new-promise-capability"),f=I("./_perform"),b=I("./_user-agent"),v=I("./_promise-resolve"),m="Promise",n=u.TypeError,d=u.process,g=d&&d.versions,T=g&&g.v8||"",y=u[m],s=R(d)=="process",M=function(){},A,x,E,w,_=x=p.f,N=!!function(){try{var W=y.resolve(1),K=(W.constructor={})[I("./_wks")("species")]=function(q){q(M,M)};return(s||typeof PromiseRejectionEvent=="function")&&W.then(M)instanceof K&&T.indexOf("6.6")!==0&&b.indexOf("Chrome/66")===-1}catch(q){}}(),j=function(W){var K;return o(W)&&typeof(K=W.then)=="function"?K:!1},k=function(W,K){if(W._n)return;W._n=!0;var q=W._c;l(function(){for(var re=W._v,ee=W._s==1,Ce=0,xe=function(he){var ke=ee?he.ok:he.fail,_e=he.resolve,de=he.reject,ce=he.domain,ae,Se,te;try{ke?(ee||(W._h==2&&F(W),W._h=1),ke===!0?ae=re:(ce&&ce.enter(),ae=ke(re),ce&&(ce.exit(),te=!0)),ae===he.promise?de(n("Promise-chain cycle")):(Se=j(ae))?Se.call(ae,_e,de):_e(ae)):de(re)}catch(ue){ce&&!te&&ce.exit(),de(ue)}};q.length>Ce;)xe(q[Ce++]);W._c=[],W._n=!1,K&&!W._h&&z(W)})},z=function(W){r.call(u,function(){var K=W._v,q=H(W),re,ee,Ce;if(q&&(re=f(function(){s?d.emit("unhandledRejection",K,W):(ee=u.onunhandledrejection)?ee({promise:W,reason:K}):(Ce=u.console)&&Ce.error&&Ce.error("Unhandled promise rejection",K)}),W._h=s||H(W)?2:1),W._a=void 0,q&&re.e)throw re.v})},H=function(W){return W._h!==1&&(W._a||W._c).length===0},F=function(W){r.call(u,function(){var K;s?d.emit("rejectionHandled",W):(K=u.onrejectionhandled)&&K({promise:W,reason:W._v})})},G=function(W){var K=this;if(K._d)return;K._d=!0,K=K._w||K,K._v=W,K._s=2,K._a||(K._a=K._c.slice()),k(K,!0)},B=function(W){var K=this,q;if(K._d)return;K._d=!0,K=K._w||K;try{if(K===W)throw n("Promise can't be resolved itself");(q=j(W))?l(function(){var re={_w:K,_d:!1};try{q.call(W,S(B,re,1),S(G,re,1))}catch(ee){G.call(re,ee)}}):(K._v=W,K._s=1,k(K,!1))}catch(re){G.call({_w:K,_d:!1},re)}};N||(y=function(K){c(this,y,m,"_h"),C(K),A.call(this);try{K(S(B,this,1),S(G,this,1))}catch(q){G.call(this,q)}},A=function(K){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},A.prototype=I("./_redefine-all")(y.prototype,{then:function(K,q){var re=_(i(this,y));return re.ok=typeof K=="function"?K:!0,re.fail=typeof q=="function"&&q,re.domain=s?d.domain:void 0,this._c.push(re),this._a&&this._a.push(re),this._s&&k(this,!1),re.promise},catch:function(W){return this.then(void 0,W)}}),E=function(){var W=new A;this.promise=W,this.resolve=S(B,W,1),this.reject=S(G,W,1)},p.f=_=function(W){return W===y||W===w?new E(W):x(W)}),h(h.G+h.W+h.F*!N,{Promise:y}),I("./_set-to-string-tag")(y,m),I("./_set-species")(m),w=I("./_core")[m],h(h.S+h.F*!N,m,{reject:function(K){var q=_(this),re=q.reject;return re(K),q.promise}}),h(h.S+h.F*(L||!N),m,{resolve:function(K){return v(L&&this===w?y:this,K)}}),h(h.S+h.F*!(N&&I("./_iter-detect")(function(W){y.all(W).catch(M)})),m,{all:function(K){var q=this,re=_(q),ee=re.resolve,Ce=re.reject,xe=f(function(){var he=[],ke=0,_e=1;a(K,!1,function(de){var ce=ke++,ae=!1;he.push(void 0),_e++,q.resolve(de).then(function(Se){if(ae)return;ae=!0,he[ce]=Se,--_e||ee(he)},Ce)}),--_e||ee(he)});return xe.e&&Ce(xe.v),re.promise},race:function(K){var q=this,re=_(q),ee=re.reject,Ce=f(function(){a(K,!1,function(xe){q.resolve(xe).then(re.resolve,ee)})});return Ce.e&&ee(Ce.v),re.promise}})},{"./_a-function":92,"./_an-instance":94,"./_classof":97,"./_core":99,"./_ctx":101,"./_export":107,"./_for-of":109,"./_global":110,"./_is-object":119,"./_iter-detect":123,"./_library":126,"./_microtask":128,"./_new-promise-capability":129,"./_perform":144,"./_promise-resolve":145,"./_redefine-all":147,"./_set-species":149,"./_set-to-string-tag":150,"./_species-constructor":153,"./_task":155,"./_user-agent":163,"./_wks":166}],179:[function(I,J,P){var L=I("./_export"),u=I("./_to-absolute-index"),S=String.fromCharCode,R=String.fromCodePoint;L(L.S+L.F*(!!R&&R.length!=1),"String",{fromCodePoint:function(o){for(var C=[],c=arguments.length,a=0,i;c>a;){if(i=+arguments[a++],u(i,1114111)!==i)throw RangeError(i+" is not a valid code point");C.push(i<65536?S(i):S(((i-=65536)>>10)+55296,i%1024+56320))}return C.join("")}})},{"./_export":107,"./_to-absolute-index":156}],180:[function(I,J,P){"use strict";var L=I("./_string-at")(!0);I("./_iter-define")(String,"String",function(u){this._t=String(u),this._i=0},function(){var u=this._t,S=this._i,R;return S>=u.length?{value:void 0,done:!0}:(R=L(u,S),this._i+=R.length,{value:R,done:!1})})},{"./_iter-define":122,"./_string-at":154}],181:[function(I,J,P){"use strict";var L=I("./_global"),u=I("./_has"),S=I("./_descriptors"),R=I("./_export"),h=I("./_redefine"),o=I("./_meta").KEY,C=I("./_fails"),c=I("./_shared"),a=I("./_set-to-string-tag"),i=I("./_uid"),r=I("./_wks"),l=I("./_wks-ext"),p=I("./_wks-define"),f=I("./_enum-keys"),b=I("./_is-array"),v=I("./_an-object"),m=I("./_is-object"),n=I("./_to-object"),d=I("./_to-iobject"),g=I("./_to-primitive"),T=I("./_property-desc"),y=I("./_object-create"),s=I("./_object-gopn-ext"),M=I("./_object-gopd"),A=I("./_object-gops"),x=I("./_object-dp"),E=I("./_object-keys"),w=M.f,_=x.f,N=s.f,j=L.Symbol,k=L.JSON,z=k&&k.stringify,H="prototype",F=r("_hidden"),G=r("toPrimitive"),B={}.propertyIsEnumerable,W=c("symbol-registry"),K=c("symbols"),q=c("op-symbols"),re=Object[H],ee=typeof j=="function"&&!!A.f,Ce=L.QObject,xe=!Ce||!Ce[H]||!Ce[H].findChild,he=S&&C(function(){return y(_({},"a",{get:function(){return _(this,"a",{value:7}).a}})).a!=7})?function(ge,De,Qe){var Ze=w(re,De);Ze&&delete re[De],_(ge,De,Qe),Ze&&ge!==re&&_(re,De,Ze)}:_,ke=function(ge){var De=K[ge]=y(j[H]);return De._k=ge,De},_e=ee&&typeof j.iterator=="symbol"?function(ge){return typeof ge=="symbol"}:function(ge){return ge instanceof j},de=function(De,Qe,Ze){return De===re&&de(q,Qe,Ze),v(De),Qe=g(Qe,!0),v(Ze),u(K,Qe)?(Ze.enumerable?(u(De,F)&&De[F][Qe]&&(De[F][Qe]=!1),Ze=y(Ze,{enumerable:T(0,!1)})):(u(De,F)||_(De,F,T(1,{})),De[F][Qe]=!0),he(De,Qe,Ze)):_(De,Qe,Ze)},ce=function(De,Qe){v(De);for(var Ze=f(Qe=d(Qe)),nt=0,tt=Ze.length,lt;tt>nt;)de(De,lt=Ze[nt++],Qe[lt]);return De},ae=function(De,Qe){return Qe===void 0?y(De):ce(y(De),Qe)},Se=function(De){var Qe=B.call(this,De=g(De,!0));return this===re&&u(K,De)&&!u(q,De)?!1:Qe||!u(this,De)||!u(K,De)||u(this,F)&&this[F][De]?Qe:!0},te=function(De,Qe){if(De=d(De),Qe=g(Qe,!0),De===re&&u(K,Qe)&&!u(q,Qe))return;var Ze=w(De,Qe);return Ze&&u(K,Qe)&&!(u(De,F)&&De[F][Qe])&&(Ze.enumerable=!0),Ze},ue=function(De){for(var Qe=N(d(De)),Ze=[],nt=0,tt;Qe.length>nt;)!u(K,tt=Qe[nt++])&&tt!=F&&tt!=o&&Ze.push(tt);return Ze},Oe=function(De){for(var Qe=De===re,Ze=N(Qe?q:d(De)),nt=[],tt=0,lt;Ze.length>tt;)u(K,lt=Ze[tt++])&&(Qe?u(re,lt):!0)&&nt.push(K[lt]);return nt};ee||(j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var De=i(arguments.length>0?arguments[0]:void 0),Qe=function(Ze){this===re&&Qe.call(q,Ze),u(this,F)&&u(this[F],De)&&(this[F][De]=!1),he(this,De,T(1,Ze))};return S&&xe&&he(re,De,{configurable:!0,set:Qe}),ke(De)},h(j[H],"toString",function(){return this._k}),M.f=te,x.f=de,I("./_object-gopn").f=s.f=ue,I("./_object-pie").f=Se,A.f=Oe,S&&!I("./_library")&&h(re,"propertyIsEnumerable",Se,!0),l.f=function(ge){return ke(r(ge))}),R(R.G+R.W+R.F*!ee,{Symbol:j});for(var le="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Q=0;le.length>Q;)r(le[Q++]);for(var Y=E(r.store),Z=0;Y.length>Z;)p(Y[Z++]);R(R.S+R.F*!ee,"Symbol",{for:function(ge){return u(W,ge+="")?W[ge]:W[ge]=j(ge)},keyFor:function(De){if(!_e(De))throw TypeError(De+" is not a symbol!");for(var Qe in W)if(W[Qe]===De)return Qe},useSetter:function(){xe=!0},useSimple:function(){xe=!1}}),R(R.S+R.F*!ee,"Object",{create:ae,defineProperty:de,defineProperties:ce,getOwnPropertyDescriptor:te,getOwnPropertyNames:ue,getOwnPropertySymbols:Oe});var be=C(function(){A.f(1)});R(R.S+R.F*be,"Object",{getOwnPropertySymbols:function(De){return A.f(n(De))}}),k&&R(R.S+R.F*(!ee||C(function(){var ge=j();return z([ge])!="[null]"||z({a:ge})!="{}"||z(Object(ge))!="{}"})),"JSON",{stringify:function(De){for(var Qe=[De],Ze=1,nt,tt;arguments.length>Ze;)Qe.push(arguments[Ze++]);return tt=nt=Qe[1],!m(nt)&&De===void 0||_e(De)?void 0:(b(nt)||(nt=function(lt,st){if(typeof tt=="function"&&(st=tt.call(this,lt,st)),!_e(st))return st}),Qe[1]=nt,z.apply(k,Qe))}}),j[H][G]||I("./_hide")(j[H],G,j[H].valueOf),a(j,"Symbol"),a(Math,"Math",!0),a(L.JSON,"JSON",!0)},{"./_an-object":95,"./_descriptors":103,"./_enum-keys":106,"./_export":107,"./_fails":108,"./_global":110,"./_has":111,"./_hide":112,"./_is-array":118,"./_is-object":119,"./_library":126,"./_meta":127,"./_object-create":131,"./_object-dp":132,"./_object-gopd":134,"./_object-gopn":136,"./_object-gopn-ext":135,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_property-desc":146,"./_redefine":148,"./_set-to-string-tag":150,"./_shared":152,"./_to-iobject":158,"./_to-object":160,"./_to-primitive":161,"./_uid":162,"./_wks":166,"./_wks-define":164,"./_wks-ext":165}],182:[function(I,J,P){var L=I("./_export"),u=I("./_object-to-array")(!0);L(L.S,"Object",{entries:function(R){return u(R)}})},{"./_export":107,"./_object-to-array":143}],183:[function(I,J,P){"use strict";var L=I("./_export"),u=I("./_core"),S=I("./_global"),R=I("./_species-constructor"),h=I("./_promise-resolve");L(L.P+L.R,"Promise",{finally:function(o){var C=R(this,u.Promise||S.Promise),c=typeof o=="function";return this.then(c?function(a){return h(C,o()).then(function(){return a})}:o,c?function(a){return h(C,o()).then(function(){throw a})}:o)}})},{"./_core":99,"./_export":107,"./_global":110,"./_promise-resolve":145,"./_species-constructor":153}],184:[function(I,J,P){"use strict";var L=I("./_export"),u=I("./_new-promise-capability"),S=I("./_perform");L(L.S,"Promise",{try:function(R){var h=u.f(this),o=S(R);return(o.e?h.reject:h.resolve)(o.v),h.promise}})},{"./_export":107,"./_new-promise-capability":129,"./_perform":144}],185:[function(I,J,P){I("./_wks-define")("asyncIterator")},{"./_wks-define":164}],186:[function(I,J,P){I("./_wks-define")("observable")},{"./_wks-define":164}],187:[function(I,J,P){I("./es6.array.iterator");for(var L=I("./_global"),u=I("./_hide"),S=I("./_iterators"),R=I("./_wks")("toStringTag"),h="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),o=0;o<h.length;o++){var C=h[o],c=L[C],a=c&&c.prototype;a&&!a[R]&&u(a,R,C),S[C]=S.Array}},{"./_global":110,"./_hide":112,"./_iterators":125,"./_wks":166,"./es6.array.iterator":169}],188:[function(I,J,P){var L=I("./_export"),u=I("./_task");L(L.G+L.B,{setImmediate:u.set,clearImmediate:u.clear})},{"./_export":107,"./_task":155}],189:[function(I,J,P){(function(L){"use strict";var u=I("babel-runtime/helpers/typeof"),S=R(u);function R(g){return g&&g.__esModule?g:{default:g}}function h(g){return Array.isArray?Array.isArray(g):d(g)==="[object Array]"}P.isArray=h;function o(g){return typeof g=="boolean"}P.isBoolean=o;function C(g){return g===null}P.isNull=C;function c(g){return g==null}P.isNullOrUndefined=c;function a(g){return typeof g=="number"}P.isNumber=a;function i(g){return typeof g=="string"}P.isString=i;function r(g){return(typeof g=="undefined"?"undefined":(0,S.default)(g))==="symbol"}P.isSymbol=r;function l(g){return g===void 0}P.isUndefined=l;function p(g){return d(g)==="[object RegExp]"}P.isRegExp=p;function f(g){return(typeof g=="undefined"?"undefined":(0,S.default)(g))==="object"&&g!==null}P.isObject=f;function b(g){return d(g)==="[object Date]"}P.isDate=b;function v(g){return d(g)==="[object Error]"||g instanceof Error}P.isError=v;function m(g){return typeof g=="function"}P.isFunction=m;function n(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"||(typeof g=="undefined"?"undefined":(0,S.default)(g))==="symbol"||typeof g=="undefined"}P.isPrimitive=n,P.isBuffer=L.isBuffer;function d(g){return Object.prototype.toString.call(g)}}).call(this,{isBuffer:I("../../is-buffer/index.js")})},{"../../is-buffer/index.js":197,"babel-runtime/helpers/typeof":67}],190:[function(I,J,P){"use strict";var L=I("babel-runtime/helpers/typeof"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(R){"use strict";var h=function(){var i=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,r=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,l=/[^-+\dA-Z]/g;return function(p,f,b,v){if(arguments.length===1&&a(p)==="string"&&!/\d/.test(p)&&(f=p,p=void 0),p=p||new Date,p instanceof Date||(p=new Date(p)),isNaN(p))throw TypeError("Invalid date");f=String(h.masks[f]||f||h.masks.default);var m=f.slice(0,4);(m==="UTC:"||m==="GMT:")&&(f=f.slice(4),b=!0,m==="GMT:"&&(v=!0));var n=b?"getUTC":"get",d=p[n+"Date"](),g=p[n+"Day"](),T=p[n+"Month"](),y=p[n+"FullYear"](),s=p[n+"Hours"](),M=p[n+"Minutes"](),A=p[n+"Seconds"](),x=p[n+"Milliseconds"](),E=b?0:p.getTimezoneOffset(),w=C(p),_=c(p),N={d,dd:o(d),ddd:h.i18n.dayNames[g],dddd:h.i18n.dayNames[g+7],m:T+1,mm:o(T+1),mmm:h.i18n.monthNames[T],mmmm:h.i18n.monthNames[T+12],yy:String(y).slice(2),yyyy:y,h:s%12||12,hh:o(s%12||12),H:s,HH:o(s),M,MM:o(M),s:A,ss:o(A),l:o(x,3),L:o(Math.round(x/10)),t:s<12?"a":"p",tt:s<12?"am":"pm",T:s<12?"A":"P",TT:s<12?"AM":"PM",Z:v?"GMT":b?"UTC":(String(p).match(r)||[""]).pop().replace(l,""),o:(E>0?"-":"+")+o(Math.floor(Math.abs(E)/60)*100+Math.abs(E)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10],W:w,N:_};return f.replace(i,function(j){return j in N?N[j]:j.slice(1,j.length-1)})}}();h.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"},h.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"]};function o(i,r){for(i=String(i),r=r||2;i.length<r;)i="0"+i;return i}function C(i){var r=new Date(i.getFullYear(),i.getMonth(),i.getDate());r.setDate(r.getDate()-(r.getDay()+6)%7+3);var l=new Date(r.getFullYear(),0,4);l.setDate(l.getDate()-(l.getDay()+6)%7+3);var p=r.getTimezoneOffset()-l.getTimezoneOffset();r.setHours(r.getHours()-p);var f=(r-l)/(864e5*7);return 1+Math.floor(f)}function c(i){var r=i.getDay();return r===0&&(r=7),r}function a(i){return i===null?"null":i===void 0?"undefined":(typeof i=="undefined"?"undefined":(0,u.default)(i))!=="object"?typeof i=="undefined"?"undefined":(0,u.default)(i):Array.isArray(i)?"array":{}.toString.call(i).slice(8,-1).toLowerCase()}typeof define=="function"&&define.amd?define(function(){return h}):(typeof P=="undefined"?"undefined":(0,u.default)(P))==="object"?J.exports=h:R.dateFormat=h})(void 0)},{"babel-runtime/helpers/typeof":67}],191:[function(I,J,P){/*!
|
|
|
* escape-html
|
|
|
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
|
* Copyright(c) 2015 Andreas Lubbe
|
|
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var L=/["'&<>]/;J.exports=u;function u(S){var R=""+S,h=L.exec(R);if(!h)return R;var o,C="",c=0,a=0;for(c=h.index;c<R.length;c++){switch(R.charCodeAt(c)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}a!==c&&(C+=R.substring(a,c)),a=c+1,C+=o}return a!==c?C+R.substring(a,c):C}},{}],192:[function(I,J,P){function L(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}J.exports=L,L.EventEmitter=L,L.prototype._events=void 0,L.prototype._maxListeners=void 0,L.defaultMaxListeners=10,L.prototype.setMaxListeners=function(o){if(!S(o)||o<0||isNaN(o))throw TypeError("n must be a positive number");return this._maxListeners=o,this},L.prototype.emit=function(o){var C,c,a,i,r,l;if(this._events||(this._events={}),o==="error"&&(!this._events.error||R(this._events.error)&&!this._events.error.length)){if(C=arguments[1],C instanceof Error)throw C;var p=new Error('Uncaught, unspecified "error" event. ('+C+")");throw p.context=C,p}if(c=this._events[o],h(c))return!1;if(u(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),c.apply(this,i)}else if(R(c))for(i=Array.prototype.slice.call(arguments,1),l=c.slice(),a=l.length,r=0;r<a;r++)l[r].apply(this,i);return!0},L.prototype.addListener=function(o,C){var c;if(!u(C))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",o,u(C.listener)?C.listener:C),this._events[o]?R(this._events[o])?this._events[o].push(C):this._events[o]=[this._events[o],C]:this._events[o]=C,R(this._events[o])&&!this._events[o].warned&&(h(this._maxListeners)?c=L.defaultMaxListeners:c=this._maxListeners,c&&c>0&&this._events[o].length>c&&(this._events[o].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[o].length),typeof console.trace=="function"&&console.trace())),this},L.prototype.on=L.prototype.addListener,L.prototype.once=function(o,C){if(!u(C))throw TypeError("listener must be a function");var c=!1;function a(){this.removeListener(o,a),c||(c=!0,C.apply(this,arguments))}return a.listener=C,this.on(o,a),this},L.prototype.removeListener=function(o,C){var c,a,i,r;if(!u(C))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(c=this._events[o],i=c.length,a=-1,c===C||u(c.listener)&&c.listener===C)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,C);else if(R(c)){for(r=i;r-- >0;)if(c[r]===C||c[r].listener&&c[r].listener===C){a=r;break}if(a<0)return this;c.length===1?(c.length=0,delete this._events[o]):c.splice(a,1),this._events.removeListener&&this.emit("removeListener",o,C)}return this},L.prototype.removeAllListeners=function(o){var C,c;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[o]&&delete this._events[o],this;if(arguments.length===0){for(C in this._events){if(C==="removeListener")continue;this.removeAllListeners(C)}return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[o],u(c))this.removeListener(o,c);else if(c)for(;c.length;)this.removeListener(o,c[c.length-1]);return delete this._events[o],this},L.prototype.listeners=function(o){var C;return!this._events||!this._events[o]?C=[]:u(this._events[o])?C=[this._events[o]]:C=this._events[o].slice(),C},L.prototype.listenerCount=function(o){if(this._events){var C=this._events[o];if(u(C))return 1;if(C)return C.length}return 0},L.listenerCount=function(o,C){return o.listenerCount(C)};function u(o){return typeof o=="function"}function S(o){return typeof o=="number"}function R(o){return typeof o=="object"&&o!==null}function h(o){return o===void 0}},{}],193:[function(I,J,P){var L=I("http"),u=J.exports;for(var S in L)L.hasOwnProperty(S)&&(u[S]=L[S]);u.request=function(R,h){return R||(R={}),R.scheme="https",R.protocol="https:",L.request.call(this,R,h)}},{http:231}],194:[function(I,J,P){/*!
|
|
|
* humanize-ms - index.js
|
|
|
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var L=I("util"),u=I("ms");J.exports=function(S){if(typeof S=="number")return S;var R=u(S);if(R===void 0){var h=new Error(L.format("humanize-ms(%j) result undefined",S));console.warn(h.stack)}return R}},{ms:204,util:243}],195:[function(I,J,P){P.read=function(L,u,S,R,h){var o,C,c=h*8-R-1,a=(1<<c)-1,i=a>>1,r=-7,l=S?h-1:0,p=S?-1:1,f=L[u+l];for(l+=p,o=f&(1<<-r)-1,f>>=-r,r+=c;r>0;o=o*256+L[u+l],l+=p,r-=8);for(C=o&(1<<-r)-1,o>>=-r,r+=R;r>0;C=C*256+L[u+l],l+=p,r-=8);if(o===0)o=1-i;else{if(o===a)return C?NaN:(f?-1:1)*Infinity;C=C+Math.pow(2,R),o=o-i}return(f?-1:1)*C*Math.pow(2,o-R)},P.write=function(L,u,S,R,h,o){var C,c,a,i=o*8-h-1,r=(1<<i)-1,l=r>>1,p=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=R?0:o-1,b=R?1:-1,v=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===Infinity?(c=isNaN(u)?1:0,C=r):(C=Math.floor(Math.log(u)/Math.LN2),u*(a=Math.pow(2,-C))<1&&(C--,a*=2),C+l>=1?u+=p/a:u+=p*Math.pow(2,1-l),u*a>=2&&(C++,a/=2),C+l>=r?(c=0,C=r):C+l>=1?(c=(u*a-1)*Math.pow(2,h),C=C+l):(c=u*Math.pow(2,l-1)*Math.pow(2,h),C=0));h>=8;L[S+f]=c&255,f+=b,c/=256,h-=8);for(C=C<<h|c,i+=h;i>0;L[S+f]=C&255,f+=b,C/=256,i-=8);L[S+f-b]|=v*128}},{}],196:[function(I,J,P){typeof Object.create=="function"?J.exports=function(u,S){S&&(u.super_=S,u.prototype=Object.create(S.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}))}:J.exports=function(u,S){if(S){u.super_=S;var R=function(){};R.prototype=S.prototype,u.prototype=new R,u.prototype.constructor=u}}},{}],197:[function(I,J,P){/*!
|
|
|
* Determine if an object is a Buffer
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
|
* @license MIT
|
|
|
*/J.exports=function(S){return S!=null&&(L(S)||u(S)||!!S._isBuffer)};function L(S){return!!S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S)}function u(S){return typeof S.readFloatLE=="function"&&typeof S.slice=="function"&&L(S.slice(0,0))}},{}],198:[function(I,J,P){var L={}.toString;J.exports=Array.isArray||function(u){return L.call(u)=="[object Array]"}},{}],199:[function(require,module,exports){(function(global){(function(I,J){typeof exports=="object"&&typeof module!="undefined"?module.exports=J(I):typeof define=="function"&&define.amd?define(J):J(I)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:this,function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.2",buffer;if(typeof module!="undefined"&&module.exports)try{buffer=eval("require('buffer').Buffer")}catch(I){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(I){for(var J={},P=0,L=I.length;P<L;P++)J[I.charAt(P)]=P;return J}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(I){if(I.length<2){var J=I.charCodeAt(0);return J<128?I:J<2048?fromCharCode(192|J>>>6)+fromCharCode(128|J&63):fromCharCode(224|J>>>12&15)+fromCharCode(128|J>>>6&63)+fromCharCode(128|J&63)}else{var J=65536+(I.charCodeAt(0)-55296)*1024+(I.charCodeAt(1)-56320);return fromCharCode(240|J>>>18&7)+fromCharCode(128|J>>>12&63)+fromCharCode(128|J>>>6&63)+fromCharCode(128|J&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(I){return I.replace(re_utob,cb_utob)},cb_encode=function(I){var J=[0,2,1][I.length%3],P=I.charCodeAt(0)<<16|(I.length>1?I.charCodeAt(1):0)<<8|(I.length>2?I.charCodeAt(2):0),L=[b64chars.charAt(P>>>18),b64chars.charAt(P>>>12&63),J>=2?"=":b64chars.charAt(P>>>6&63),J>=1?"=":b64chars.charAt(P&63)];return L.join("")},btoa=global.btoa?function(I){return global.btoa(I)}:function(I){return I.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(I){var J=Object.prototype.toString.call(I)==="[object Uint8Array]";return J?I.toString("base64"):btoa(utob(String(I)))},encode=function(I,J){return J?_encode(String(I)).replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,""):_encode(I)},encodeURI=function(I){return encode(I,!0)},re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(I){switch(I.length){case 4:var J=(7&I.charCodeAt(0))<<18|(63&I.charCodeAt(1))<<12|(63&I.charCodeAt(2))<<6|63&I.charCodeAt(3),P=J-65536;return fromCharCode((P>>>10)+55296)+fromCharCode((P&1023)+56320);case 3:return fromCharCode((15&I.charCodeAt(0))<<12|(63&I.charCodeAt(1))<<6|63&I.charCodeAt(2));default:return fromCharCode((31&I.charCodeAt(0))<<6|63&I.charCodeAt(1))}},btou=function(I){return I.replace(re_btou,cb_btou)},cb_decode=function(I){var J=I.length,P=J%4,L=(J>0?b64tab[I.charAt(0)]<<18:0)|(J>1?b64tab[I.charAt(1)]<<12:0)|(J>2?b64tab[I.charAt(2)]<<6:0)|(J>3?b64tab[I.charAt(3)]:0),u=[fromCharCode(L>>>16),fromCharCode(L>>>8&255),fromCharCode(L&255)];return u.length-=[0,0,2,1][P],u.join("")},_atob=global.atob?function(I){return global.atob(I)}:function(I){return I.replace(/\S{1,4}/g,cb_decode)},atob=function(I){return _atob(String(I).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(I){return(I.constructor===buffer.constructor?I:buffer.from(I,"base64")).toString()}:function(I){return(I.constructor===buffer.constructor?I:new buffer(I,"base64")).toString()}:function(I){return btou(_atob(I))},decode=function(I){return _decode(String(I).replace(/[-_]/g,function(J){return J=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var I=global.Base64;return global.Base64=_Base64,I};if(global.Base64={VERSION:version,atob,btoa,fromBase64:decode,toBase64:encode,utob,encode,encodeURI,btou,decode,noConflict,__buffer__:buffer},typeof Object.defineProperty=="function"){var noEnum=function(I){return{value:I,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(I){return encode(this,I)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),typeof module!="undefined"&&module.exports?module.exports.Base64=global.Base64:typeof define=="function"&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}})}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],200:[function(I,J,P){/*!
|
|
|
* merge-descriptors
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
* MIT Licensed
|
|
|
*/"use strict";J.exports=u;var L=Object.prototype.hasOwnProperty;function u(S,R,h){if(!S)throw new TypeError("argument dest is required");if(!R)throw new TypeError("argument src is required");return h===void 0&&(h=!0),Object.getOwnPropertyNames(R).forEach(function(C){if(!h&&L.call(S,C))return;var c=Object.getOwnPropertyDescriptor(R,C);Object.defineProperty(S,C,c)}),S}},{}],201:[function(I,J,P){"use strict";function L(){this._types=Object.create(null),this._extensions=Object.create(null);for(var u=0;u<arguments.length;u++)this.define(arguments[u]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}L.prototype.define=function(u,S){for(var R in u){var h=u[R].map(function(c){return c.toLowerCase()});R=R.toLowerCase();for(var o=0;o<h.length;o++){var C=h[o];if(C[0]=="*")continue;if(!S&&C in this._types)throw new Error('Attempt to change mapping for "'+C+'" extension from "'+this._types[C]+'" to "'+R+'". Pass `force=true` to allow this, otherwise remove "'+C+'" from the list of extensions for "'+R+'".');this._types[C]=R}if(S||!this._extensions[R]){var C=h[0];this._extensions[R]=C[0]!="*"?C:C.substr(1)}}},L.prototype.getType=function(u){u=String(u);var S=u.replace(/^.*[/\\]/,"").toLowerCase(),R=S.replace(/^.*\./,"").toLowerCase(),h=S.length<u.length,o=R.length<S.length-1;return(o||!h)&&this._types[R]||null},L.prototype.getExtension=function(u){return u=/^\s*([^;\s]*)/.test(u)&&RegExp.$1,u&&this._extensions[u.toLowerCase()]||null},J.exports=L},{}],202:[function(I,J,P){"use strict";var L=I("./Mime");J.exports=new L(I("./types/standard"))},{"./Mime":201,"./types/standard":203}],203:[function(I,J,P){J.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"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","es"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"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/lgr+xml":["lgr"],"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/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/mrb-consumer+xml":["*xdf"],"application/mrb-publish+xml":["*xdf"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"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/p2p-overlay+xml":["relo"],"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/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"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/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"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/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"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/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/ttml+xml":["ttml"],"application/urc-ressheet+xml":["rsheet"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-error+xml":["xer"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"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":["*3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*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":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"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":["*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"]}},{}],204:[function(I,J,P){var L=1e3,u=L*60,S=u*60,R=S*24,h=R*7,o=R*365.25;J.exports=function(r,l){l=l||{};var p=typeof r;if(p==="string"&&r.length>0)return C(r);if(p==="number"&&isFinite(r))return l.long?a(r):c(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function C(r){if(r=String(r),r.length>100)return;var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(!l)return;var p=parseFloat(l[1]),f=(l[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return p*o;case"weeks":case"week":case"w":return p*h;case"days":case"day":case"d":return p*R;case"hours":case"hour":case"hrs":case"hr":case"h":return p*S;case"minutes":case"minute":case"mins":case"min":case"m":return p*u;case"seconds":case"second":case"secs":case"sec":case"s":return p*L;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}function c(r){var l=Math.abs(r);return l>=R?Math.round(r/R)+"d":l>=S?Math.round(r/S)+"h":l>=u?Math.round(r/u)+"m":l>=L?Math.round(r/L)+"s":r+"ms"}function a(r){var l=Math.abs(r);return l>=R?i(r,l,R,"day"):l>=S?i(r,l,S,"hour"):l>=u?i(r,l,u,"minute"):l>=L?i(r,l,L,"second"):r+" ms"}function i(r,l,p,f){var b=l>=p*1.5;return Math.round(r/p)+" "+f+(b?"s":"")}},{}],205:[function(I,J,P){(function(L){function u(o,C){for(var c=0,a=o.length-1;a>=0;a--){var i=o[a];i==="."?o.splice(a,1):i===".."?(o.splice(a,1),c++):c&&(o.splice(a,1),c--)}if(C)for(;c--;c)o.unshift("..");return o}P.resolve=function(){for(var o="",C=!1,c=arguments.length-1;c>=-1&&!C;c--){var a=c>=0?arguments[c]:L.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)continue;o=a+"/"+o,C=a.charAt(0)==="/"}return o=u(R(o.split("/"),function(i){return!!i}),!C).join("/"),(C?"/":"")+o||"."},P.normalize=function(o){var C=P.isAbsolute(o),c=h(o,-1)==="/";return o=u(R(o.split("/"),function(a){return!!a}),!C).join("/"),!o&&!C&&(o="."),o&&c&&(o+="/"),(C?"/":"")+o},P.isAbsolute=function(o){return o.charAt(0)==="/"},P.join=function(){var o=Array.prototype.slice.call(arguments,0);return P.normalize(R(o,function(C,c){if(typeof C!="string")throw new TypeError("Arguments to path.join must be strings");return C}).join("/"))},P.relative=function(o,C){o=P.resolve(o).substr(1),C=P.resolve(C).substr(1);function c(b){for(var v=0;v<b.length&&!(b[v]!=="");v++);for(var m=b.length-1;m>=0&&!(b[m]!=="");m--);return v>m?[]:b.slice(v,m-v+1)}for(var a=c(o.split("/")),i=c(C.split("/")),r=Math.min(a.length,i.length),l=r,p=0;p<r;p++)if(a[p]!==i[p]){l=p;break}for(var f=[],p=l;p<a.length;p++)f.push("..");return f=f.concat(i.slice(l)),f.join("/")},P.sep="/",P.delimiter=":",P.dirname=function(o){if(typeof o!="string"&&(o=o+""),o.length===0)return".";for(var C=o.charCodeAt(0),c=C===47,a=-1,i=!0,r=o.length-1;r>=1;--r)if(C=o.charCodeAt(r),C===47){if(!i){a=r;break}}else i=!1;return a===-1?c?"/":".":c&&a===1?"/":o.slice(0,a)};function S(o){typeof o!="string"&&(o=o+"");var C=0,c=-1,a=!0,i;for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!a){C=i+1;break}}else c===-1&&(a=!1,c=i+1);return c===-1?"":o.slice(C,c)}P.basename=function(o,C){var c=S(o);return C&&c.substr(-1*C.length)===C&&(c=c.substr(0,c.length-C.length)),c},P.extname=function(o){typeof o!="string"&&(o=o+"");for(var C=-1,c=0,a=-1,i=!0,r=0,l=o.length-1;l>=0;--l){var p=o.charCodeAt(l);if(p===47){if(!i){c=l+1;break}continue}a===-1&&(i=!1,a=l+1),p===46?C===-1?C=l:r!==1&&(r=1):C!==-1&&(r=-1)}return C===-1||a===-1||r===0||r===1&&C===a-1&&C===c+1?"":o.slice(C,a)};function R(o,C){if(o.filter)return o.filter(C);for(var c=[],a=0;a<o.length;a++)C(o[a],a,o)&&c.push(o[a]);return c}var h="ab".substr(-1)==="b"?function(o,C,c){return o.substr(C,c)}:function(o,C,c){return C<0&&(C=o.length+C),o.substr(C,c)}}).call(this,I("_process"))},{_process:208}],206:[function(I,J,P){(function(L){/*!
|
|
|
* Platform.js <https://mths.be/platform>
|
|
|
* Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/>
|
|
|
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
|
|
* Available under MIT license <https://mths.be/mit>
|
|
|
*/(function(){"use strict";var u={function:!0,object:!0},S=u[typeof window]&&window||this,R=S,h=u[typeof P]&&P,o=u[typeof J]&&J&&!J.nodeType&&J,C=h&&o&&typeof L=="object"&&L;C&&(C.global===C||C.window===C||C.self===C)&&(S=C);var c=Math.pow(2,53)-1,a=/\bOpera/,i=this,r=Object.prototype,l=r.hasOwnProperty,p=r.toString;function f(x){return x=String(x),x.charAt(0).toUpperCase()+x.slice(1)}function b(x,E,w){var _={"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 E&&w&&/^Win/i.test(x)&&!/^Windows Phone /i.test(x)&&(_=_[/[\d.]+$/.exec(x)])&&(x="Windows "+_),x=String(x),E&&w&&(x=x.replace(RegExp(E,"i"),w)),x=m(x.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]),x}function v(x,E){var w=-1,_=x?x.length:0;if(typeof _=="number"&&_>-1&&_<=c)for(;++w<_;)E(x[w],w,x);else n(x,E)}function m(x){return x=s(x),/^(?:webOS|i(?:OS|P))/.test(x)?x:f(x)}function n(x,E){for(var w in x)l.call(x,w)&&E(x[w],w,x)}function d(x){return x==null?f(x):p.call(x).slice(8,-1)}function g(x,E){var w=x!=null?typeof x[E]:"number";return!/^(?:boolean|number|string|undefined)$/.test(w)&&(w=="object"?!!x[E]:!0)}function T(x){return String(x).replace(/([ -])(?!$)/g,"$1?")}function y(x,E){var w=null;return v(x,function(_,N){w=E(w,_,N,x)}),w}function s(x){return String(x).replace(/^ +| +$/g,"")}function M(x){var E=S,w=x&&typeof x=="object"&&d(x)!="String";w&&(E=x,x=null);var _=E.navigator||{},N=_.userAgent||"";x||(x=N);var j=w||i==R,k=w?!!_.likeChrome:/\bChrome\b/.test(x)&&!/internal|\n/i.test(p.toString()),z="Object",H=w?z:"ScriptBridgingProxyObject",F=w?z:"Environment",G=w&&E.java?"JavaPackage":d(E.java),B=w?z:"RuntimeObject",W=/\bJava/.test(G)&&E.java,K=W&&d(E.environment)==F,q=W?"a":"\u03B1",re=W?"b":"\u03B2",ee=E.document||{},Ce=E.operamini||E.opera,xe=a.test(xe=w&&Ce?Ce["[[Class]]"]:d(Ce))?xe:Ce=null,he,ke=x,_e=[],de=null,ce=x==N,ae=ce&&Ce&&typeof Ce.version=="function"&&Ce.version(),Se,te=Y([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),ue=be(["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"]),Oe=De([{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"]),le=Z({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}}),Q=ge(["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 "]);function Y(tt){return y(tt,function(lt,st){return lt||RegExp("\\b"+(st.pattern||T(st))+"\\b","i").exec(x)&&(st.label||st)})}function Z(tt){return y(tt,function(lt,st,je){return lt||(st[Oe]||st[/^[a-z]+(?: +[a-z]+\b)*/i.exec(Oe)]||RegExp("\\b"+T(je)+"(?:\\b|\\w*\\d)","i").exec(x))&&je})}function be(tt){return y(tt,function(lt,st){return lt||RegExp("\\b"+(st.pattern||T(st))+"\\b","i").exec(x)&&(st.label||st)})}function ge(tt){return y(tt,function(lt,st){var je=st.pattern||T(st);return!lt&&(lt=RegExp("\\b"+je+"(?:/[\\d.]+|[ \\w.]*)","i").exec(x))&&(lt=b(lt,je,st.label||st)),lt})}function De(tt){return y(tt,function(lt,st){var je=st.pattern||T(st);return!lt&&(lt=RegExp("\\b"+je+" *\\d+[.\\w_]*","i").exec(x)||RegExp("\\b"+je+" *\\w+-[\\w]*","i").exec(x)||RegExp("\\b"+je+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(x))&&((lt=String(st.label&&!RegExp(je,"i").test(st.label)?st.label:lt).split("/"))[1]&&!/[\d.]+/.test(lt[0])&&(lt[0]+=" "+lt[1]),st=st.label||st,lt=m(lt[0].replace(RegExp(je,"i"),st).replace(RegExp("; *(?:"+st+"[_-])?","i")," ").replace(RegExp("("+st+")[-_.]?(\\w)","i"),"$1 $2"))),lt})}function Qe(tt){return y(tt,function(lt,st){return lt||(RegExp(st+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(x)||0)[1]||null})}function Ze(){return this.description||""}if(te&&(te=[te]),le&&!Oe&&(Oe=De([le])),(he=/\bGoogle TV\b/.exec(Oe))&&(Oe=he[0]),/\bSimulator\b/i.test(x)&&(Oe=(Oe?Oe+" ":"")+"Simulator"),ue=="Opera Mini"&&/\bOPiOS\b/.test(x)&&_e.push("running in Turbo/Uncompressed mode"),ue=="IE"&&/\blike iPhone OS\b/.test(x)?(he=M(x.replace(/like iPhone OS/,"")),le=he.manufacturer,Oe=he.product):/^iP/.test(Oe)?(ue||(ue="Safari"),Q="iOS"+((he=/ OS ([\d_]+)/i.exec(x))?" "+he[1].replace(/_/g,"."):"")):ue=="Konqueror"&&!/buntu/i.test(Q)?Q="Kubuntu":le&&le!="Google"&&(/Chrome/.test(ue)&&!/\bMobile Safari\b/i.test(x)||/\bVita\b/.test(Oe))||/\bAndroid\b/.test(Q)&&/^Chrome/.test(ue)&&/\bVersion\//i.test(x)?(ue="Android Browser",Q=/\bAndroid\b/.test(Q)?Q:"Android"):ue=="Silk"?(/\bMobi/i.test(x)||(Q="Android",_e.unshift("desktop mode")),/Accelerated *= *true/i.test(x)&&_e.unshift("accelerated")):ue=="PaleMoon"&&(he=/\bFirefox\/([\d.]+)\b/.exec(x))?_e.push("identifying as Firefox "+he[1]):ue=="Firefox"&&(he=/\b(Mobile|Tablet|TV)\b/i.exec(x))?(Q||(Q="Firefox OS"),Oe||(Oe=he[1])):!ue||(he=!/\bMinefield\b/i.test(x)&&/\b(?:Firefox|Safari)\b/.exec(ue))?(ue&&!Oe&&/[\/,]|^[^(]+?\)/.test(x.slice(x.indexOf(he+"/")+8))&&(ue=null),(he=Oe||le||Q)&&(Oe||le||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(Q))&&(ue=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(Q)?Q:he)+" Browser")):ue=="Electron"&&(he=(/\bChrome\/([\d.]+)\b/.exec(x)||0)[1])&&_e.push("Chromium "+he),ae||(ae=Qe(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",T(ue),"(?:Firefox|Minefield|NetFront)"])),(he=te=="iCab"&&parseFloat(ae)>3&&"WebKit"||/\bOpera\b/.test(ue)&&(/\bOPR\b/.test(x)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(x)&&!/^(?:Trident|EdgeHTML)$/.test(te)&&"WebKit"||!te&&/\bMSIE\b/i.test(x)&&(Q=="Mac OS"?"Tasman":"Trident")||te=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ue)&&"NetFront")&&(te=[he]),ue=="IE"&&(he=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(x)||0)[1])?(ue+=" Mobile",Q="Windows Phone "+(/\+$/.test(he)?he:he+".x"),_e.unshift("desktop mode")):/\bWPDesktop\b/i.test(x)?(ue="IE Mobile",Q="Windows Phone 8.x",_e.unshift("desktop mode"),ae||(ae=(/\brv:([\d.]+)/.exec(x)||0)[1])):ue!="IE"&&te=="Trident"&&(he=/\brv:([\d.]+)/.exec(x))&&(ue&&_e.push("identifying as "+ue+(ae?" "+ae:"")),ue="IE",ae=he[1]),ce){if(g(E,"global"))if(W&&(he=W.lang.System,ke=he.getProperty("os.arch"),Q=Q||he.getProperty("os.name")+" "+he.getProperty("os.version")),K){try{ae=E.require("ringo/engine").version.join("."),ue="RingoJS"}catch(tt){(he=E.system)&&he.global.system==E.system&&(ue="Narwhal",Q||(Q=he[0].os||null))}ue||(ue="Rhino")}else typeof E.process=="object"&&!E.process.browser&&(he=E.process)&&(typeof he.versions=="object"&&(typeof he.versions.electron=="string"?(_e.push("Node "+he.versions.node),ue="Electron",ae=he.versions.electron):typeof he.versions.nw=="string"&&(_e.push("Chromium "+ae,"Node "+he.versions.node),ue="NW.js",ae=he.versions.nw)),ue||(ue="Node.js",ke=he.arch,Q=he.platform,ae=/[\d.]+/.exec(he.version),ae=ae?ae[0]:null));else d(he=E.runtime)==H?(ue="Adobe AIR",Q=he.flash.system.Capabilities.os):d(he=E.phantom)==B?(ue="PhantomJS",ae=(he=he.version||null)&&he.major+"."+he.minor+"."+he.patch):typeof ee.documentMode=="number"&&(he=/\bTrident\/(\d+)/i.exec(x))?(ae=[ae,ee.documentMode],(he=+he[1]+4)!=ae[1]&&(_e.push("IE "+ae[1]+" mode"),te&&(te[1]=""),ae[1]=he),ae=ue=="IE"?String(ae[1].toFixed(1)):ae[0]):typeof ee.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ue)&&(_e.push("masking as "+ue+" "+ae),ue="IE",ae="11.0",te=["Trident"],Q="Windows");Q=Q&&m(Q)}if(ae&&(he=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(ae)||/(?:alpha|beta)(?: ?\d)?/i.exec(x+";"+(ce&&_.appMinorVersion))||/\bMinefield\b/i.test(x)&&"a")&&(de=/b/i.test(he)?"beta":"alpha",ae=ae.replace(RegExp(he+"\\+?$"),"")+(de=="beta"?re:q)+(/\d+\+?/.exec(he)||"")),ue=="Fennec"||ue=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(Q))ue="Firefox Mobile";else if(ue=="Maxthon"&&ae)ae=ae.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(Oe))Oe=="Xbox 360"&&(Q=null),Oe=="Xbox 360"&&/\bIEMobile\b/.test(x)&&_e.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(ue)||ue&&!Oe&&!/Browser|Mobi/.test(ue))&&(Q=="Windows CE"||/Mobi/i.test(x)))ue+=" Mobile";else if(ue=="IE"&&ce)try{E.external===null&&_e.unshift("platform preview")}catch(tt){_e.unshift("embedded")}else(/\bBlackBerry\b/.test(Oe)||/\bBB10\b/.test(x))&&(he=(RegExp(Oe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(x)||0)[1]||ae)?(he=[he,/BB10/.test(x)],Q=(he[1]?(Oe=null,le="BlackBerry"):"Device Software")+" "+he[0],ae=null):this!=n&&Oe!="Wii"&&(ce&&Ce||/Opera/.test(ue)&&/\b(?:MSIE|Firefox)\b/i.test(x)||ue=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(Q)||ue=="IE"&&(Q&&!/^Win/.test(Q)&&ae>5.5||/\bWindows XP\b/.test(Q)&&ae>8||ae==8&&!/\bTrident\b/.test(x)))&&!a.test(he=M.call(n,x.replace(a,"")+";"))&&he.name&&(he="ing as "+he.name+((he=he.version)?" "+he:""),a.test(ue)?(/\bIE\b/.test(he)&&Q=="Mac OS"&&(Q=null),he="identify"+he):(he="mask"+he,xe?ue=m(xe.replace(/([a-z])([A-Z])/g,"$1 $2")):ue="Opera",/\bIE\b/.test(he)&&(Q=null),ce||(ae=null)),te=["Presto"],_e.push(he));(he=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(x)||0)[1])&&(he=[parseFloat(he.replace(/\.(\d)$/,".0$1")),he],ue=="Safari"&&he[1].slice(-1)=="+"?(ue="WebKit Nightly",de="alpha",ae=he[1].slice(0,-1)):(ae==he[1]||ae==(he[2]=(/\bSafari\/([\d.]+\+?)/i.exec(x)||0)[1]))&&(ae=null),he[1]=(/\bChrome\/([\d.]+)/i.exec(x)||0)[1],he[0]==537.36&&he[2]==537.36&&parseFloat(he[1])>=28&&te=="WebKit"&&(te=["Blink"]),!ce||!k&&!he[1]?(te&&(te[1]="like Safari"),he=(he=he[0],he<400?1:he<500?2:he<526?3:he<533?4:he<534?"4+":he<535?5:he<537?6:he<538?7:he<601?8:"8")):(te&&(te[1]="like Chrome"),he=he[1]||(he=he[0],he<530?1:he<532?2:he<532.05?3:he<533?4:he<534.03?5:he<534.07?6:he<534.1?7:he<534.13?8:he<534.16?9:he<534.24?10:he<534.3?11:he<535.01?12:he<535.02?"13+":he<535.07?15:he<535.11?16:he<535.19?17:he<536.05?18:he<536.1?19:he<537.01?20:he<537.11?"21+":he<537.13?23:he<537.18?24:he<537.24?25:he<537.36?26:te!="Blink"?"27":"28")),te&&(te[1]+=" "+(he+=typeof he=="number"?".x":/[.+]/.test(he)?"":"+")),ue=="Safari"&&(!ae||parseInt(ae)>45)&&(ae=he)),ue=="Opera"&&(he=/\bzbov|zvav$/.exec(Q))?(ue+=" ",_e.unshift("desktop mode"),he=="zvav"?(ue+="Mini",ae=null):ue+="Mobile",Q=Q.replace(RegExp(" *"+he+"$"),"")):ue=="Safari"&&/\bChrome\b/.exec(te&&te[1])&&(_e.unshift("desktop mode"),ue="Chrome Mobile",ae=null,/\bOS X\b/.test(Q)?(le="Apple",Q="iOS 4.3+"):Q=null),ae&&ae.indexOf(he=/[\d.]+$/.exec(Q))==0&&x.indexOf("/"+he+"-")>-1&&(Q=s(Q.replace(he,""))),te&&!/\b(?:Avant|Nook)\b/.test(ue)&&(/Browser|Lunascape|Maxthon/.test(ue)||ue!="Safari"&&/^iOS/.test(Q)&&/\bSafari\b/.test(te[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(ue)&&te[1])&&((he=te[te.length-1])&&_e.push(he)),_e.length&&(_e=["("+_e.join("; ")+")"]),le&&Oe&&Oe.indexOf(le)<0&&_e.push("on "+le),Oe&&_e.push((/^on /.test(_e[_e.length-1])?"":"on ")+Oe),Q&&(he=/ ([\d.+]+)$/.exec(Q),Se=he&&Q.charAt(Q.length-he[0].length-1)=="/",Q={architecture:32,family:he&&!Se?Q.replace(he[0],""):Q,version:he?he[1]:null,toString:function(){var tt=this.version;return this.family+(tt&&!Se?" "+tt:"")+(this.architecture==64?" 64-bit":"")}}),(he=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(ke))&&!/\bi686\b/i.test(ke)?(Q&&(Q.architecture=64,Q.family=Q.family.replace(RegExp(" *"+he),"")),ue&&(/\bWOW64\b/i.test(x)||ce&&/\w(?:86|32)$/.test(_.cpuClass||_.platform)&&!/\bWin64; x64\b/i.test(x))&&_e.unshift("32-bit")):Q&&/^OS X/.test(Q.family)&&ue=="Chrome"&&parseFloat(ae)>=39&&(Q.architecture=64),x||(x=null);var nt={};return nt.description=x,nt.layout=te&&te[0],nt.manufacturer=le,nt.name=ue,nt.prerelease=de,nt.product=Oe,nt.ua=x,nt.version=ue&&ae,nt.os=Q||{architecture:null,family:null,version:null,toString:function(){return"null"}},nt.parse=M,nt.toString=Ze,nt.version&&_e.unshift(ae),nt.name&&_e.unshift(ue),Q&&ue&&!(Q==String(Q).split(" ")[0]&&(Q==ue.split(" ")[0]||Oe))&&_e.push(Oe?"("+Q+")":"on "+Q),_e.length&&(nt.description=_e.join(" ")),nt}var A=M();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(S.platform=A,define(function(){return A})):h&&o?n(A,function(x,E){h[E]=x}):S.platform=A}).call(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],207:[function(I,J,P){(function(L){"use strict";typeof L=="undefined"||!L.version||L.version.indexOf("v0.")===0||L.version.indexOf("v1.")===0&&L.version.indexOf("v1.8.")!==0?J.exports={nextTick:u}:J.exports=L;function u(S,R,h,o){if(typeof S!="function")throw new TypeError('"callback" argument must be a function');var C=arguments.length,c,a;switch(C){case 0:case 1:return L.nextTick(S);case 2:return L.nextTick(function(){S.call(null,R)});case 3:return L.nextTick(function(){S.call(null,R,h)});case 4:return L.nextTick(function(){S.call(null,R,h,o)});default:for(c=new Array(C-1),a=0;a<c.length;)c[a++]=arguments[a];return L.nextTick(function(){S.apply(null,c)})}}}).call(this,I("_process"))},{_process:208}],208:[function(I,J,P){var L=J.exports={},u,S;function R(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?u=setTimeout:u=R}catch(v){u=R}try{typeof clearTimeout=="function"?S=clearTimeout:S=h}catch(v){S=h}})();function o(v){if(u===setTimeout)return setTimeout(v,0);if((u===R||!u)&&setTimeout)return u=setTimeout,setTimeout(v,0);try{return u(v,0)}catch(m){try{return u.call(null,v,0)}catch(n){return u.call(this,v,0)}}}function C(v){if(S===clearTimeout)return clearTimeout(v);if((S===h||!S)&&clearTimeout)return S=clearTimeout,clearTimeout(v);try{return S(v)}catch(m){try{return S.call(null,v)}catch(n){return S.call(this,v)}}}var c=[],a=!1,i,r=-1;function l(){if(!a||!i)return;a=!1,i.length?c=i.concat(c):r=-1,c.length&&p()}function p(){if(a)return;var v=o(l);a=!0;for(var m=c.length;m;){for(i=c,c=[];++r<m;)i&&i[r].run();r=-1,m=c.length}i=null,a=!1,C(v)}L.nextTick=function(v){var m=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)m[n-1]=arguments[n];c.push(new f(v,m)),c.length===1&&!a&&o(p)};function f(v,m){this.fun=v,this.array=m}f.prototype.run=function(){this.fun.apply(null,this.array)},L.title="browser",L.browser=!0,L.env={},L.argv=[],L.version="",L.versions={};function b(){}L.on=b,L.addListener=b,L.once=b,L.off=b,L.removeListener=b,L.removeAllListeners=b,L.emit=b,L.prependListener=b,L.prependOnceListener=b,L.listeners=function(v){return[]},L.binding=function(v){throw new Error("process.binding is not supported")},L.cwd=function(){return"/"},L.chdir=function(v){throw new Error("process.chdir is not supported")},L.umask=function(){return 0}},{}],209:[function(I,J,P){(function(L){/*! https://mths.be/punycode v1.4.1 by @mathias */(function(u){var S=typeof P=="object"&&P&&!P.nodeType&&P,R=typeof J=="object"&&J&&!J.nodeType&&J,h=typeof L=="object"&&L;(h.global===h||h.window===h||h.self===h)&&(u=h);var o,C=2147483647,c=36,a=1,i=26,r=38,l=700,p=72,f=128,b="-",v=/^xn--/,m=/[^\x20-\x7E]/,n=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=c-a,T=Math.floor,y=String.fromCharCode,s;function M(G){throw new RangeError(d[G])}function A(G,B){for(var W=G.length,K=[];W--;)K[W]=B(G[W]);return K}function x(G,B){var W=G.split("@"),K="";W.length>1&&(K=W[0]+"@",G=W[1]),G=G.replace(n,".");var q=G.split("."),re=A(q,B).join(".");return K+re}function E(G){for(var B=[],W=0,K=G.length,q,re;W<K;)q=G.charCodeAt(W++),q>=55296&&q<=56319&&W<K?(re=G.charCodeAt(W++),(re&64512)==56320?B.push(((q&1023)<<10)+(re&1023)+65536):(B.push(q),W--)):B.push(q);return B}function w(G){return A(G,function(B){var W="";return B>65535&&(B-=65536,W+=y(B>>>10&1023|55296),B=56320|B&1023),W+=y(B),W}).join("")}function _(G){return G-48<10?G-22:G-65<26?G-65:G-97<26?G-97:c}function N(G,B){return G+22+75*(G<26)-((B!=0)<<5)}function j(G,B,W){var K=0;for(G=W?T(G/l):G>>1,G+=T(G/B);G>g*i>>1;K+=c)G=T(G/g);return T(K+(g+1)*G/(G+r))}function k(G){var B=[],W=G.length,K,q=0,re=f,ee=p,Ce,xe,he,ke,_e,de,ce,ae,Se;for(Ce=G.lastIndexOf(b),Ce<0&&(Ce=0),xe=0;xe<Ce;++xe)G.charCodeAt(xe)>=128&&M("not-basic"),B.push(G.charCodeAt(xe));for(he=Ce>0?Ce+1:0;he<W;){for(ke=q,_e=1,de=c;!(he>=W&&M("invalid-input"),ce=_(G.charCodeAt(he++)),(ce>=c||ce>T((C-q)/_e))&&M("overflow"),q+=ce*_e,ae=de<=ee?a:de>=ee+i?i:de-ee,ce<ae);de+=c)Se=c-ae,_e>T(C/Se)&&M("overflow"),_e*=Se;K=B.length+1,ee=j(q-ke,K,ke==0),T(q/K)>C-re&&M("overflow"),re+=T(q/K),q%=K,B.splice(q++,0,re)}return w(B)}function z(G){var B,W,K,q,re,ee,Ce,xe,he,ke,_e,de=[],ce,ae,Se,te;for(G=E(G),ce=G.length,B=f,W=0,re=p,ee=0;ee<ce;++ee)_e=G[ee],_e<128&&de.push(y(_e));for(K=q=de.length,q&&de.push(b);K<ce;){for(Ce=C,ee=0;ee<ce;++ee)_e=G[ee],_e>=B&&_e<Ce&&(Ce=_e);for(ae=K+1,Ce-B>T((C-W)/ae)&&M("overflow"),W+=(Ce-B)*ae,B=Ce,ee=0;ee<ce;++ee)if(_e=G[ee],_e<B&&++W>C&&M("overflow"),_e==B){for(xe=W,he=c;!(ke=he<=re?a:he>=re+i?i:he-re,xe<ke);he+=c)te=xe-ke,Se=c-ke,de.push(y(N(ke+te%Se,0))),xe=T(te/Se);de.push(y(N(xe,0))),re=j(W,ae,K==q),W=0,++K}++W,++B}return de.join("")}function H(G){return x(G,function(B){return v.test(B)?k(B.slice(4).toLowerCase()):B})}function F(G){return x(G,function(B){return m.test(B)?"xn--"+z(B):B})}if(o={version:"1.4.1",ucs2:{decode:E,encode:w},decode:k,encode:z,toASCII:F,toUnicode:H},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(S&&R)if(J.exports==S)R.exports=o;else for(s in o)o.hasOwnProperty(s)&&(S[s]=o[s]);else u.punycode=o})(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],210:[function(I,J,P){"use strict";function L(S,R){return Object.prototype.hasOwnProperty.call(S,R)}J.exports=function(S,R,h,o){R=R||"&",h=h||"=";var C={};if(typeof S!="string"||S.length===0)return C;var c=/\+/g;S=S.split(R);var a=1e3;o&&typeof o.maxKeys=="number"&&(a=o.maxKeys);var i=S.length;a>0&&i>a&&(i=a);for(var r=0;r<i;++r){var l=S[r].replace(c,"%20"),p=l.indexOf(h),f,b,v,m;p>=0?(f=l.substr(0,p),b=l.substr(p+1)):(f=l,b=""),v=decodeURIComponent(f),m=decodeURIComponent(b),L(C,v)?u(C[v])?C[v].push(m):C[v]=[C[v],m]:C[v]=m}return C};var u=Array.isArray||function(S){return Object.prototype.toString.call(S)==="[object Array]"}},{}],211:[function(I,J,P){"use strict";var L=function(h){switch(typeof h){case"string":return h;case"boolean":return h?"true":"false";case"number":return isFinite(h)?h:"";default:return""}};J.exports=function(h,o,C,c){return o=o||"&",C=C||"=",h===null&&(h=void 0),typeof h=="object"?S(R(h),function(a){var i=encodeURIComponent(L(a))+C;return u(h[a])?S(h[a],function(r){return i+encodeURIComponent(L(r))}).join(o):i+encodeURIComponent(L(h[a]))}).join(o):c?encodeURIComponent(L(c))+C+encodeURIComponent(L(h)):""};var u=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"};function S(h,o){if(h.map)return h.map(o);for(var C=[],c=0;c<h.length;c++)C.push(o(h[c],c));return C}var R=Object.keys||function(h){var o=[];for(var C in h)Object.prototype.hasOwnProperty.call(h,C)&&o.push(C);return o}},{}],212:[function(I,J,P){"use strict";P.decode=P.parse=I("./decode"),P.encode=P.stringify=I("./encode")},{"./decode":210,"./encode":211}],213:[function(I,J,P){J.exports=I("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":214}],214:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=h(L),S=I("babel-runtime/core-js/object/keys"),R=h(S);function h(m){return m&&m.__esModule?m:{default:m}}var o=I("process-nextick-args"),C=R.default||function(m){var n=[];for(var d in m)n.push(d);return n};J.exports=f;var c=(0,u.default)(I("core-util-is"));c.inherits=I("inherits");var a=I("./_stream_readable"),i=I("./_stream_writable");c.inherits(f,a);for(var r=C(i.prototype),l=0;l<r.length;l++){var p=r[l];f.prototype[p]||(f.prototype[p]=i.prototype[p])}function f(m){if(!(this instanceof f))return new f(m);a.call(this,m),i.call(this,m),m&&m.readable===!1&&(this.readable=!1),m&&m.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,m&&m.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",b)}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function b(){if(this.allowHalfOpen||this._writableState.ended)return;o.nextTick(v,this)}function v(m){m.end()}Object.defineProperty(f.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(n){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=n,this._writableState.destroyed=n}}),f.prototype._destroy=function(m,n){this.push(null),this.end(),o.nextTick(n,m)}},{"./_stream_readable":216,"./_stream_writable":218,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60,"core-util-is":189,inherits:196,"process-nextick-args":207}],215:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(C){return C&&C.__esModule?C:{default:C}}J.exports=o;var R=I("./_stream_transform"),h=(0,u.default)(I("core-util-is"));h.inherits=I("inherits"),h.inherits(o,R);function o(C){if(!(this instanceof o))return new o(C);R.call(this,C)}o.prototype._transform=function(C,c,a){a(null,C)}},{"./_stream_transform":217,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],216:[function(I,J,P){(function(L,u){"use strict";var S=I("babel-runtime/core-js/object/get-prototype-of"),R=C(S),h=I("babel-runtime/core-js/object/create"),o=C(h);function C(te){return te&&te.__esModule?te:{default:te}}var c=I("process-nextick-args");J.exports=E;var a=I("isarray"),i;E.ReadableState=x;var r=I("events").EventEmitter,l=function(ue,Oe){return ue.listeners(Oe).length},p=I("./internal/streams/stream"),f=I("safe-buffer").Buffer,b=u.Uint8Array||function(){};function v(te){return f.from(te)}function m(te){return f.isBuffer(te)||te instanceof b}var n=(0,o.default)(I("core-util-is"));n.inherits=I("inherits");var d=I("util"),g=void 0;d&&d.debuglog?g=d.debuglog("stream"):g=function(){};var T=I("./internal/streams/BufferList"),y=I("./internal/streams/destroy"),s;n.inherits(E,p);var M=["error","close","destroy","pause","resume"];function A(te,ue,Oe){if(typeof te.prependListener=="function")return te.prependListener(ue,Oe);!te._events||!te._events[ue]?te.on(ue,Oe):a(te._events[ue])?te._events[ue].unshift(Oe):te._events[ue]=[Oe,te._events[ue]]}function x(te,ue){i=i||I("./_stream_duplex"),te=te||{};var Oe=ue instanceof i;this.objectMode=!!te.objectMode,Oe&&(this.objectMode=this.objectMode||!!te.readableObjectMode);var le=te.highWaterMark,Q=te.readableHighWaterMark,Y=this.objectMode?16:16*1024;le||le===0?this.highWaterMark=le:Oe&&(Q||Q===0)?this.highWaterMark=Q:this.highWaterMark=Y,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new T,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=te.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,te.encoding&&(s||(s=I("string_decoder/").StringDecoder),this.decoder=new s(te.encoding),this.encoding=te.encoding)}function E(te){if(i=i||I("./_stream_duplex"),!(this instanceof E))return new E(te);this._readableState=new x(te,this),this.readable=!0,te&&(typeof te.read=="function"&&(this._read=te.read),typeof te.destroy=="function"&&(this._destroy=te.destroy)),p.call(this)}Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ue){if(!this._readableState)return;this._readableState.destroyed=ue}}),E.prototype.destroy=y.destroy,E.prototype._undestroy=y.undestroy,E.prototype._destroy=function(te,ue){this.push(null),ue(te)},E.prototype.push=function(te,ue){var Oe=this._readableState,le;return Oe.objectMode?le=!0:typeof te=="string"&&(ue=ue||Oe.defaultEncoding,ue!==Oe.encoding&&(te=f.from(te,ue),ue=""),le=!0),w(this,te,ue,!1,le)},E.prototype.unshift=function(te){return w(this,te,null,!0,!1)};function w(te,ue,Oe,le,Q){var Y=te._readableState;if(ue===null)Y.reading=!1,F(te,Y);else{var Z;Q||(Z=N(Y,ue)),Z?te.emit("error",Z):Y.objectMode||ue&&ue.length>0?(typeof ue!="string"&&!Y.objectMode&&(0,R.default)(ue)!==f.prototype&&(ue=v(ue)),le?Y.endEmitted?te.emit("error",new Error("stream.unshift() after end event")):_(te,Y,ue,!0):Y.ended?te.emit("error",new Error("stream.push() after EOF")):(Y.reading=!1,Y.decoder&&!Oe?(ue=Y.decoder.write(ue),Y.objectMode||ue.length!==0?_(te,Y,ue,!1):W(te,Y)):_(te,Y,ue,!1))):le||(Y.reading=!1)}return j(Y)}function _(te,ue,Oe,le){ue.flowing&&ue.length===0&&!ue.sync?(te.emit("data",Oe),te.read(0)):(ue.length+=ue.objectMode?1:Oe.length,le?ue.buffer.unshift(Oe):ue.buffer.push(Oe),ue.needReadable&&G(te)),W(te,ue)}function N(te,ue){var Oe;return!m(ue)&&typeof ue!="string"&&ue!==void 0&&!te.objectMode&&(Oe=new TypeError("Invalid non-string/buffer chunk")),Oe}function j(te){return!te.ended&&(te.needReadable||te.length<te.highWaterMark||te.length===0)}E.prototype.isPaused=function(){return this._readableState.flowing===!1},E.prototype.setEncoding=function(te){return s||(s=I("string_decoder/").StringDecoder),this._readableState.decoder=new s(te),this._readableState.encoding=te,this};var k=8388608;function z(te){return te>=k?te=k:(te--,te|=te>>>1,te|=te>>>2,te|=te>>>4,te|=te>>>8,te|=te>>>16,te++),te}function H(te,ue){return te<=0||ue.length===0&&ue.ended?0:ue.objectMode?1:te!==te?ue.flowing&&ue.length?ue.buffer.head.data.length:ue.length:(te>ue.highWaterMark&&(ue.highWaterMark=z(te)),te<=ue.length?te:ue.ended?ue.length:(ue.needReadable=!0,0))}E.prototype.read=function(te){g("read",te),te=parseInt(te,10);var ue=this._readableState,Oe=te;if(te!==0&&(ue.emittedReadable=!1),te===0&&ue.needReadable&&(ue.length>=ue.highWaterMark||ue.ended))return g("read: emitReadable",ue.length,ue.ended),ue.length===0&&ue.ended?ce(this):G(this),null;if(te=H(te,ue),te===0&&ue.ended)return ue.length===0&&ce(this),null;var le=ue.needReadable;g("need readable",le),(ue.length===0||ue.length-te<ue.highWaterMark)&&(le=!0,g("length less than watermark",le)),ue.ended||ue.reading?(le=!1,g("reading or ended",le)):le&&(g("do read"),ue.reading=!0,ue.sync=!0,ue.length===0&&(ue.needReadable=!0),this._read(ue.highWaterMark),ue.sync=!1,ue.reading||(te=H(Oe,ue)));var Q;return te>0?Q=he(te,ue):Q=null,Q===null?(ue.needReadable=!0,te=0):ue.length-=te,ue.length===0&&(ue.ended||(ue.needReadable=!0),Oe!==te&&ue.ended&&ce(this)),Q!==null&&this.emit("data",Q),Q};function F(te,ue){if(ue.ended)return;if(ue.decoder){var Oe=ue.decoder.end();Oe&&Oe.length&&(ue.buffer.push(Oe),ue.length+=ue.objectMode?1:Oe.length)}ue.ended=!0,G(te)}function G(te){var ue=te._readableState;ue.needReadable=!1,ue.emittedReadable||(g("emitReadable",ue.flowing),ue.emittedReadable=!0,ue.sync?c.nextTick(B,te):B(te))}function B(te){g("emit readable"),te.emit("readable"),xe(te)}function W(te,ue){ue.readingMore||(ue.readingMore=!0,c.nextTick(K,te,ue))}function K(te,ue){for(var Oe=ue.length;!ue.reading&&!ue.flowing&&!ue.ended&&ue.length<ue.highWaterMark&&!(g("maybeReadMore read 0"),te.read(0),Oe===ue.length);)Oe=ue.length;ue.readingMore=!1}E.prototype._read=function(te){this.emit("error",new Error("_read() is not implemented"))},E.prototype.pipe=function(te,ue){var Oe=this,le=this._readableState;switch(le.pipesCount){case 0:le.pipes=te;break;case 1:le.pipes=[le.pipes,te];break;default:le.pipes.push(te);break}le.pipesCount+=1,g("pipe count=%d opts=%j",le.pipesCount,ue);var Q=(!ue||ue.end!==!1)&&te!==L.stdout&&te!==L.stderr,Y=Q?be:je;le.endEmitted?c.nextTick(Y):Oe.once("end",Y),te.on("unpipe",Z);function Z(Re,et){g("onunpipe"),Re===Oe&&(et&&et.hasUnpiped===!1&&(et.hasUnpiped=!0,Qe()))}function be(){g("onend"),te.end()}var ge=q(Oe);te.on("drain",ge);var De=!1;function Qe(){g("cleanup"),te.removeListener("close",lt),te.removeListener("finish",st),te.removeListener("drain",ge),te.removeListener("error",tt),te.removeListener("unpipe",Z),Oe.removeListener("end",be),Oe.removeListener("end",je),Oe.removeListener("data",nt),De=!0,le.awaitDrain&&(!te._writableState||te._writableState.needDrain)&&ge()}var Ze=!1;Oe.on("data",nt);function nt(Re){g("ondata"),Ze=!1;var et=te.write(Re);et===!1&&!Ze&&((le.pipesCount===1&&le.pipes===te||le.pipesCount>1&&Se(le.pipes,te)!==-1)&&!De&&(g("false write response, pause",Oe._readableState.awaitDrain),Oe._readableState.awaitDrain++,Ze=!0),Oe.pause())}function tt(Re){g("onerror",Re),je(),te.removeListener("error",tt),l(te,"error")===0&&te.emit("error",Re)}A(te,"error",tt);function lt(){te.removeListener("finish",st),je()}te.once("close",lt);function st(){g("onfinish"),te.removeListener("close",lt),je()}te.once("finish",st);function je(){g("unpipe"),Oe.unpipe(te)}return te.emit("pipe",Oe),le.flowing||(g("pipe resume"),Oe.resume()),te};function q(te){return function(){var ue=te._readableState;g("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&l(te,"data")&&(ue.flowing=!0,xe(te))}}E.prototype.unpipe=function(te){var ue=this._readableState,Oe={hasUnpiped:!1};if(ue.pipesCount===0)return this;if(ue.pipesCount===1)return te&&te!==ue.pipes?this:(te||(te=ue.pipes),ue.pipes=null,ue.pipesCount=0,ue.flowing=!1,te&&te.emit("unpipe",this,Oe),this);if(!te){var le=ue.pipes,Q=ue.pipesCount;ue.pipes=null,ue.pipesCount=0,ue.flowing=!1;for(var Y=0;Y<Q;Y++)le[Y].emit("unpipe",this,Oe);return this}var Z=Se(ue.pipes,te);return Z===-1?this:(ue.pipes.splice(Z,1),ue.pipesCount-=1,ue.pipesCount===1&&(ue.pipes=ue.pipes[0]),te.emit("unpipe",this,Oe),this)},E.prototype.on=function(te,ue){var Oe=p.prototype.on.call(this,te,ue);if(te==="data")this._readableState.flowing!==!1&&this.resume();else if(te==="readable"){var le=this._readableState;!le.endEmitted&&!le.readableListening&&(le.readableListening=le.needReadable=!0,le.emittedReadable=!1,le.reading?le.length&&G(this):c.nextTick(re,this))}return Oe},E.prototype.addListener=E.prototype.on;function re(te){g("readable nexttick read 0"),te.read(0)}E.prototype.resume=function(){var te=this._readableState;return te.flowing||(g("resume"),te.flowing=!0,ee(this,te)),this};function ee(te,ue){ue.resumeScheduled||(ue.resumeScheduled=!0,c.nextTick(Ce,te,ue))}function Ce(te,ue){ue.reading||(g("resume read 0"),te.read(0)),ue.resumeScheduled=!1,ue.awaitDrain=0,te.emit("resume"),xe(te),ue.flowing&&!ue.reading&&te.read(0)}E.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function xe(te){var ue=te._readableState;for(g("flow",ue.flowing);ue.flowing&&te.read()!==null;);}E.prototype.wrap=function(te){var ue=this,Oe=this._readableState,le=!1;te.on("end",function(){if(g("wrapped end"),Oe.decoder&&!Oe.ended){var Z=Oe.decoder.end();Z&&Z.length&&ue.push(Z)}ue.push(null)}),te.on("data",function(Z){if(g("wrapped data"),Oe.decoder&&(Z=Oe.decoder.write(Z)),Oe.objectMode&&Z==null)return;if(!Oe.objectMode&&(!Z||!Z.length))return;var be=ue.push(Z);be||(le=!0,te.pause())});for(var Q in te)this[Q]===void 0&&typeof te[Q]=="function"&&(this[Q]=function(Z){return function(){return te[Z].apply(te,arguments)}}(Q));for(var Y=0;Y<M.length;Y++)te.on(M[Y],this.emit.bind(this,M[Y]));return this._read=function(Z){g("wrapped _read",Z),le&&(le=!1,te.resume())},this},Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),E._fromList=he;function he(te,ue){if(ue.length===0)return null;var Oe;return ue.objectMode?Oe=ue.buffer.shift():!te||te>=ue.length?(ue.decoder?Oe=ue.buffer.join(""):ue.buffer.length===1?Oe=ue.buffer.head.data:Oe=ue.buffer.concat(ue.length),ue.buffer.clear()):Oe=ke(te,ue.buffer,ue.decoder),Oe}function ke(te,ue,Oe){var le;return te<ue.head.data.length?(le=ue.head.data.slice(0,te),ue.head.data=ue.head.data.slice(te)):te===ue.head.data.length?le=ue.shift():le=Oe?_e(te,ue):de(te,ue),le}function _e(te,ue){var Oe=ue.head,le=1,Q=Oe.data;for(te-=Q.length;Oe=Oe.next;){var Y=Oe.data,Z=te>Y.length?Y.length:te;if(Z===Y.length?Q+=Y:Q+=Y.slice(0,te),te-=Z,te===0){Z===Y.length?(++le,Oe.next?ue.head=Oe.next:ue.head=ue.tail=null):(ue.head=Oe,Oe.data=Y.slice(Z));break}++le}return ue.length-=le,Q}function de(te,ue){var Oe=f.allocUnsafe(te),le=ue.head,Q=1;for(le.data.copy(Oe),te-=le.data.length;le=le.next;){var Y=le.data,Z=te>Y.length?Y.length:te;if(Y.copy(Oe,Oe.length-te,0,Z),te-=Z,te===0){Z===Y.length?(++Q,le.next?ue.head=le.next:ue.head=ue.tail=null):(ue.head=le,le.data=Y.slice(Z));break}++Q}return ue.length-=Q,Oe}function ce(te){var ue=te._readableState;if(ue.length>0)throw new Error('"endReadable()" called on non-empty stream');ue.endEmitted||(ue.ended=!0,c.nextTick(ae,ue,te))}function ae(te,ue){!te.endEmitted&&te.length===0&&(te.endEmitted=!0,ue.readable=!1,ue.emit("end"))}function Se(te,ue){for(var Oe=0,le=te.length;Oe<le;Oe++)if(te[Oe]===ue)return Oe;return-1}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":214,"./internal/streams/BufferList":219,"./internal/streams/destroy":220,"./internal/streams/stream":221,_process:208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/get-prototype-of":59,"core-util-is":189,events:192,inherits:196,isarray:198,"process-nextick-args":207,"safe-buffer":228,"string_decoder/":235,util:71}],217:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(i){return i&&i.__esModule?i:{default:i}}J.exports=C;var R=I("./_stream_duplex"),h=(0,u.default)(I("core-util-is"));h.inherits=I("inherits"),h.inherits(C,R);function o(i,r){var l=this._transformState;l.transforming=!1;var p=l.writecb;if(!p)return this.emit("error",new Error("write callback called multiple times"));l.writechunk=null,l.writecb=null,r!=null&&this.push(r),p(i);var f=this._readableState;f.reading=!1,(f.needReadable||f.length<f.highWaterMark)&&this._read(f.highWaterMark)}function C(i){if(!(this instanceof C))return new C(i);R.call(this,i),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,i&&(typeof i.transform=="function"&&(this._transform=i.transform),typeof i.flush=="function"&&(this._flush=i.flush)),this.on("prefinish",c)}function c(){var i=this;typeof this._flush=="function"?this._flush(function(r,l){a(i,r,l)}):a(this,null,null)}C.prototype.push=function(i,r){return this._transformState.needTransform=!1,R.prototype.push.call(this,i,r)},C.prototype._transform=function(i,r,l){throw new Error("_transform() is not implemented")},C.prototype._write=function(i,r,l){var p=this._transformState;if(p.writecb=l,p.writechunk=i,p.writeencoding=r,!p.transforming){var f=this._readableState;(p.needTransform||f.needReadable||f.length<f.highWaterMark)&&this._read(f.highWaterMark)}},C.prototype._read=function(i){var r=this._transformState;r.writechunk!==null&&r.writecb&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0},C.prototype._destroy=function(i,r){var l=this;R.prototype._destroy.call(this,i,function(p){r(p),l.emit("close")})};function a(i,r,l){if(r)return i.emit("error",r);if(l!=null&&i.push(l),i._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(i._transformState.transforming)throw new Error("Calling transform done when still transforming");return i.push(null)}},{"./_stream_duplex":214,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],218:[function(I,J,P){(function(L,u){"use strict";var S=I("babel-runtime/core-js/object/define-property"),R=p(S),h=I("babel-runtime/core-js/symbol/has-instance"),o=p(h),C=I("babel-runtime/core-js/symbol"),c=p(C),a=I("babel-runtime/core-js/object/create"),i=p(a),r=I("babel-runtime/core-js/set-immediate"),l=p(r);function p(de){return de&&de.__esModule?de:{default:de}}var f=I("process-nextick-args");J.exports=N;function b(de,ce,ae){this.chunk=de,this.encoding=ce,this.callback=ae,this.next=null}function v(de){var ce=this;this.next=null,this.entry=null,this.finish=function(){_e(ce,de)}}var m=!L.browser&&["v0.10","v0.9."].indexOf(L.version.slice(0,5))>-1?l.default:f.nextTick,n;N.WritableState=w;var d=(0,i.default)(I("core-util-is"));d.inherits=I("inherits");var g={deprecate:I("util-deprecate")},T=I("./internal/streams/stream"),y=I("safe-buffer").Buffer,s=u.Uint8Array||function(){};function M(de){return y.from(de)}function A(de){return y.isBuffer(de)||de instanceof s}var x=I("./internal/streams/destroy");d.inherits(N,T);function E(){}function w(de,ce){n=n||I("./_stream_duplex"),de=de||{};var ae=ce instanceof n;this.objectMode=!!de.objectMode,ae&&(this.objectMode=this.objectMode||!!de.writableObjectMode);var Se=de.highWaterMark,te=de.writableHighWaterMark,ue=this.objectMode?16:16*1024;Se||Se===0?this.highWaterMark=Se:ae&&(te||te===0)?this.highWaterMark=te:this.highWaterMark=ue,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 Oe=de.decodeStrings===!1;this.decodeStrings=!Oe,this.defaultEncoding=de.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(le){W(ce,le)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new v(this)}w.prototype.getBuffer=function(){for(var ce=this.bufferedRequest,ae=[];ce;)ae.push(ce),ce=ce.next;return ae},function(){try{Object.defineProperty(w.prototype,"buffer",{get:g.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(de){}}();var _;typeof c.default=="function"&&o.default&&typeof Function.prototype[o.default]=="function"?(_=Function.prototype[o.default],(0,R.default)(N,o.default,{value:function(ce){return _.call(this,ce)?!0:this!==N?!1:ce&&ce._writableState instanceof w}})):_=function(ce){return ce instanceof this};function N(de){if(n=n||I("./_stream_duplex"),!_.call(N,this)&&!(this instanceof n))return new N(de);this._writableState=new w(de,this),this.writable=!0,de&&(typeof de.write=="function"&&(this._write=de.write),typeof de.writev=="function"&&(this._writev=de.writev),typeof de.destroy=="function"&&(this._destroy=de.destroy),typeof de.final=="function"&&(this._final=de.final)),T.call(this)}N.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function j(de,ce){var ae=new Error("write after end");de.emit("error",ae),f.nextTick(ce,ae)}function k(de,ce,ae,Se){var te=!0,ue=!1;return ae===null?ue=new TypeError("May not write null values to stream"):typeof ae!="string"&&ae!==void 0&&!ce.objectMode&&(ue=new TypeError("Invalid non-string/buffer chunk")),ue&&(de.emit("error",ue),f.nextTick(Se,ue),te=!1),te}N.prototype.write=function(de,ce,ae){var Se=this._writableState,te=!1,ue=!Se.objectMode&&A(de);return ue&&!y.isBuffer(de)&&(de=M(de)),typeof ce=="function"&&(ae=ce,ce=null),ue?ce="buffer":ce||(ce=Se.defaultEncoding),typeof ae!="function"&&(ae=E),Se.ended?j(this,ae):(ue||k(this,Se,de,ae))&&(Se.pendingcb++,te=H(this,Se,ue,de,ce,ae)),te},N.prototype.cork=function(){var de=this._writableState;de.corked++},N.prototype.uncork=function(){var de=this._writableState;de.corked&&(de.corked--,!de.writing&&!de.corked&&!de.finished&&!de.bufferProcessing&&de.bufferedRequest&&re(this,de))},N.prototype.setDefaultEncoding=function(ce){if(typeof ce=="string"&&(ce=ce.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ce+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+ce);return this._writableState.defaultEncoding=ce,this};function z(de,ce,ae){return!de.objectMode&&de.decodeStrings!==!1&&typeof ce=="string"&&(ce=y.from(ce,ae)),ce}Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function H(de,ce,ae,Se,te,ue){if(!ae){var Oe=z(ce,Se,te);Se!==Oe&&(ae=!0,te="buffer",Se=Oe)}var le=ce.objectMode?1:Se.length;ce.length+=le;var Q=ce.length<ce.highWaterMark;if(Q||(ce.needDrain=!0),ce.writing||ce.corked){var Y=ce.lastBufferedRequest;ce.lastBufferedRequest={chunk:Se,encoding:te,isBuf:ae,callback:ue,next:null},Y?Y.next=ce.lastBufferedRequest:ce.bufferedRequest=ce.lastBufferedRequest,ce.bufferedRequestCount+=1}else F(de,ce,!1,le,Se,te,ue);return Q}function F(de,ce,ae,Se,te,ue,Oe){ce.writelen=Se,ce.writecb=Oe,ce.writing=!0,ce.sync=!0,ae?de._writev(te,ce.onwrite):de._write(te,ue,ce.onwrite),ce.sync=!1}function G(de,ce,ae,Se,te){--ce.pendingcb,ae?(f.nextTick(te,Se),f.nextTick(he,de,ce),de._writableState.errorEmitted=!0,de.emit("error",Se)):(te(Se),de._writableState.errorEmitted=!0,de.emit("error",Se),he(de,ce))}function B(de){de.writing=!1,de.writecb=null,de.length-=de.writelen,de.writelen=0}function W(de,ce){var ae=de._writableState,Se=ae.sync,te=ae.writecb;if(B(ae),ce)G(de,ae,Se,ce,te);else{var ue=ee(ae);!ue&&!ae.corked&&!ae.bufferProcessing&&ae.bufferedRequest&&re(de,ae),Se?m(K,de,ae,ue,te):K(de,ae,ue,te)}}function K(de,ce,ae,Se){ae||q(de,ce),ce.pendingcb--,Se(),he(de,ce)}function q(de,ce){ce.length===0&&ce.needDrain&&(ce.needDrain=!1,de.emit("drain"))}function re(de,ce){ce.bufferProcessing=!0;var ae=ce.bufferedRequest;if(de._writev&&ae&&ae.next){var Se=ce.bufferedRequestCount,te=new Array(Se),ue=ce.corkedRequestsFree;ue.entry=ae;for(var Oe=0,le=!0;ae;)te[Oe]=ae,ae.isBuf||(le=!1),ae=ae.next,Oe+=1;te.allBuffers=le,F(de,ce,!0,ce.length,te,"",ue.finish),ce.pendingcb++,ce.lastBufferedRequest=null,ue.next?(ce.corkedRequestsFree=ue.next,ue.next=null):ce.corkedRequestsFree=new v(ce),ce.bufferedRequestCount=0}else{for(;ae;){var Q=ae.chunk,Y=ae.encoding,Z=ae.callback,be=ce.objectMode?1:Q.length;if(F(de,ce,!1,be,Q,Y,Z),ae=ae.next,ce.bufferedRequestCount--,ce.writing)break}ae===null&&(ce.lastBufferedRequest=null)}ce.bufferedRequest=ae,ce.bufferProcessing=!1}N.prototype._write=function(de,ce,ae){ae(new Error("_write() is not implemented"))},N.prototype._writev=null,N.prototype.end=function(de,ce,ae){var Se=this._writableState;typeof de=="function"?(ae=de,de=null,ce=null):typeof ce=="function"&&(ae=ce,ce=null),de!=null&&this.write(de,ce),Se.corked&&(Se.corked=1,this.uncork()),!Se.ending&&!Se.finished&&ke(this,Se,ae)};function ee(de){return de.ending&&de.length===0&&de.bufferedRequest===null&&!de.finished&&!de.writing}function Ce(de,ce){de._final(function(ae){ce.pendingcb--,ae&&de.emit("error",ae),ce.prefinished=!0,de.emit("prefinish"),he(de,ce)})}function xe(de,ce){!ce.prefinished&&!ce.finalCalled&&(typeof de._final=="function"?(ce.pendingcb++,ce.finalCalled=!0,f.nextTick(Ce,de,ce)):(ce.prefinished=!0,de.emit("prefinish")))}function he(de,ce){var ae=ee(ce);return ae&&(xe(de,ce),ce.pendingcb===0&&(ce.finished=!0,de.emit("finish"))),ae}function ke(de,ce,ae){ce.ending=!0,he(de,ce),ae&&(ce.finished?f.nextTick(ae):de.once("finish",ae)),ce.ended=!0,de.writable=!1}function _e(de,ce,ae){var Se=de.entry;for(de.entry=null;Se;){var te=Se.callback;ce.pendingcb--,te(ae),Se=Se.next}ce.corkedRequestsFree?ce.corkedRequestsFree.next=de:ce.corkedRequestsFree=de}Object.defineProperty(N.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ce){if(!this._writableState)return;this._writableState.destroyed=ce}}),N.prototype.destroy=x.destroy,N.prototype._undestroy=x.undestroy,N.prototype._destroy=function(de,ce){this.end(),ce(de)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":214,"./internal/streams/destroy":220,"./internal/streams/stream":221,_process:208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/define-property":56,"babel-runtime/core-js/set-immediate":62,"babel-runtime/core-js/symbol":64,"babel-runtime/core-js/symbol/has-instance":65,"core-util-is":189,inherits:196,"process-nextick-args":207,"safe-buffer":228,"util-deprecate":240}],219:[function(I,J,P){"use strict";function L(h,o){if(!(h instanceof o))throw new TypeError("Cannot call a class as a function")}var u=I("safe-buffer").Buffer,S=I("util");function R(h,o,C){h.copy(o,C)}J.exports=function(){function h(){L(this,h),this.head=null,this.tail=null,this.length=0}return h.prototype.push=function(C){var c={data:C,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length},h.prototype.unshift=function(C){var c={data:C,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length},h.prototype.shift=function(){if(this.length===0)return;var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C},h.prototype.clear=function(){this.head=this.tail=null,this.length=0},h.prototype.join=function(C){if(this.length===0)return"";for(var c=this.head,a=""+c.data;c=c.next;)a+=C+c.data;return a},h.prototype.concat=function(C){if(this.length===0)return u.alloc(0);if(this.length===1)return this.head.data;for(var c=u.allocUnsafe(C>>>0),a=this.head,i=0;a;)R(a.data,c,i),i+=a.data.length,a=a.next;return c},h}(),S&&S.inspect&&S.inspect.custom&&(J.exports.prototype[S.inspect.custom]=function(){var h=S.inspect({length:this.length});return this.constructor.name+" "+h})},{"safe-buffer":228,util:71}],220:[function(I,J,P){"use strict";var L=I("process-nextick-args");function u(h,o){var C=this,c=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return c||a?(o?o(h):h&&(!this._writableState||!this._writableState.errorEmitted)&&L.nextTick(R,this,h),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(i){!o&&i?(L.nextTick(R,C,i),C._writableState&&(C._writableState.errorEmitted=!0)):o&&o(i)}),this)}function S(){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 R(h,o){h.emit("error",o)}J.exports={destroy:u,undestroy:S}},{"process-nextick-args":207}],221:[function(I,J,P){"use strict";J.exports=I("events").EventEmitter},{events:192}],222:[function(I,J,P){J.exports=I("./readable").PassThrough},{"./readable":223}],223:[function(I,J,P){P=J.exports=I("./lib/_stream_readable.js"),P.Stream=P,P.Readable=P,P.Writable=I("./lib/_stream_writable.js"),P.Duplex=I("./lib/_stream_duplex.js"),P.Transform=I("./lib/_stream_transform.js"),P.PassThrough=I("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":214,"./lib/_stream_passthrough.js":215,"./lib/_stream_readable.js":216,"./lib/_stream_transform.js":217,"./lib/_stream_writable.js":218}],224:[function(I,J,P){J.exports=I("./readable").Transform},{"./readable":223}],225:[function(I,J,P){J.exports=I("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":218}],226:[function(I,J,P){var L=function(){return this}()||Function("return this")(),u=L.regeneratorRuntime&&Object.getOwnPropertyNames(L).indexOf("regeneratorRuntime")>=0,S=u&&L.regeneratorRuntime;if(L.regeneratorRuntime=void 0,J.exports=I("./runtime"),u)L.regeneratorRuntime=S;else try{delete L.regeneratorRuntime}catch(R){L.regeneratorRuntime=void 0}},{"./runtime":227}],227:[function(I,J,P){!function(L){"use strict";var u=Object.prototype,S=u.hasOwnProperty,R,h=typeof Symbol=="function"?Symbol:{},o=h.iterator||"@@iterator",C=h.asyncIterator||"@@asyncIterator",c=h.toStringTag||"@@toStringTag",a=typeof J=="object",i=L.regeneratorRuntime;if(i){a&&(J.exports=i);return}i=L.regeneratorRuntime=a?J.exports:{};function r(H,F,G,B){var W=F&&F.prototype instanceof n?F:n,K=Object.create(W.prototype),q=new j(B||[]);return K._invoke=E(H,G,q),K}i.wrap=r;function l(H,F,G){try{return{type:"normal",arg:H.call(F,G)}}catch(B){return{type:"throw",arg:B}}}var p="suspendedStart",f="suspendedYield",b="executing",v="completed",m={};function n(){}function d(){}function g(){}var T={};T[o]=function(){return this};var y=Object.getPrototypeOf,s=y&&y(y(k([])));s&&s!==u&&S.call(s,o)&&(T=s);var M=g.prototype=n.prototype=Object.create(T);d.prototype=M.constructor=g,g.constructor=d,g[c]=d.displayName="GeneratorFunction";function A(H){["next","throw","return"].forEach(function(F){H[F]=function(G){return this._invoke(F,G)}})}i.isGeneratorFunction=function(H){var F=typeof H=="function"&&H.constructor;return F?F===d||(F.displayName||F.name)==="GeneratorFunction":!1},i.mark=function(H){return Object.setPrototypeOf?Object.setPrototypeOf(H,g):(H.__proto__=g,c in H||(H[c]="GeneratorFunction")),H.prototype=Object.create(M),H},i.awrap=function(H){return{__await:H}};function x(H){function F(W,K,q,re){var ee=l(H[W],H,K);if(ee.type==="throw")re(ee.arg);else{var Ce=ee.arg,xe=Ce.value;return xe&&typeof xe=="object"&&S.call(xe,"__await")?Promise.resolve(xe.__await).then(function(he){F("next",he,q,re)},function(he){F("throw",he,q,re)}):Promise.resolve(xe).then(function(he){Ce.value=he,q(Ce)},re)}}var G;function B(W,K){function q(){return new Promise(function(re,ee){F(W,K,re,ee)})}return G=G?G.then(q,q):q()}this._invoke=B}A(x.prototype),x.prototype[C]=function(){return this},i.AsyncIterator=x,i.async=function(H,F,G,B){var W=new x(r(H,F,G,B));return i.isGeneratorFunction(F)?W:W.next().then(function(K){return K.done?K.value:W.next()})};function E(H,F,G){var B=p;return function(K,q){if(B===b)throw new Error("Generator is already running");if(B===v){if(K==="throw")throw q;return z()}for(G.method=K,G.arg=q;;){var re=G.delegate;if(re){var ee=w(re,G);if(ee){if(ee===m)continue;return ee}}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(B===p)throw B=v,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);B=b;var Ce=l(H,F,G);if(Ce.type==="normal"){if(B=G.done?v:f,Ce.arg===m)continue;return{value:Ce.arg,done:G.done}}else Ce.type==="throw"&&(B=v,G.method="throw",G.arg=Ce.arg)}}}function w(H,F){var G=H.iterator[F.method];if(G===R){if(F.delegate=null,F.method==="throw"){if(H.iterator.return&&(F.method="return",F.arg=R,w(H,F),F.method==="throw"))return m;F.method="throw",F.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var B=l(G,H.iterator,F.arg);if(B.type==="throw")return F.method="throw",F.arg=B.arg,F.delegate=null,m;var W=B.arg;if(!W)return F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,m;if(W.done)F[H.resultName]=W.value,F.next=H.nextLoc,F.method!=="return"&&(F.method="next",F.arg=R);else return W;return F.delegate=null,m}A(M),M[c]="Generator",M[o]=function(){return this},M.toString=function(){return"[object Generator]"};function _(H){var F={tryLoc:H[0]};1 in H&&(F.catchLoc=H[1]),2 in H&&(F.finallyLoc=H[2],F.afterLoc=H[3]),this.tryEntries.push(F)}function N(H){var F=H.completion||{};F.type="normal",delete F.arg,H.completion=F}function j(H){this.tryEntries=[{tryLoc:"root"}],H.forEach(_,this),this.reset(!0)}i.keys=function(H){var F=[];for(var G in H)F.push(G);return F.reverse(),function B(){for(;F.length;){var W=F.pop();if(W in H)return B.value=W,B.done=!1,B}return B.done=!0,B}};function k(H){if(H){var F=H[o];if(F)return F.call(H);if(typeof H.next=="function")return H;if(!isNaN(H.length)){var G=-1,B=function W(){for(;++G<H.length;)if(S.call(H,G))return W.value=H[G],W.done=!1,W;return W.value=R,W.done=!0,W};return B.next=B}}return{next:z}}i.values=k;function z(){return{value:R,done:!0}}j.prototype={constructor:j,reset:function(H){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(N),!H)for(var F in this)F.charAt(0)==="t"&&S.call(this,F)&&!isNaN(+F.slice(1))&&(this[F]=R)},stop:function(){this.done=!0;var H=this.tryEntries[0],F=H.completion;if(F.type==="throw")throw F.arg;return this.rval},dispatchException:function(H){if(this.done)throw H;var F=this;function G(ee,Ce){return K.type="throw",K.arg=H,F.next=ee,Ce&&(F.method="next",F.arg=R),!!Ce}for(var B=this.tryEntries.length-1;B>=0;--B){var W=this.tryEntries[B],K=W.completion;if(W.tryLoc==="root")return G("end");if(W.tryLoc<=this.prev){var q=S.call(W,"catchLoc"),re=S.call(W,"finallyLoc");if(q&&re){if(this.prev<W.catchLoc)return G(W.catchLoc,!0);if(this.prev<W.finallyLoc)return G(W.finallyLoc)}else if(q){if(this.prev<W.catchLoc)return G(W.catchLoc,!0)}else if(re){if(this.prev<W.finallyLoc)return G(W.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(H,F){for(var G=this.tryEntries.length-1;G>=0;--G){var B=this.tryEntries[G];if(B.tryLoc<=this.prev&&S.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var W=B;break}}W&&(H==="break"||H==="continue")&&W.tryLoc<=F&&F<=W.finallyLoc&&(W=null);var K=W?W.completion:{};return K.type=H,K.arg=F,W?(this.method="next",this.next=W.finallyLoc,m):this.complete(K)},complete:function(H,F){if(H.type==="throw")throw H.arg;return H.type==="break"||H.type==="continue"?this.next=H.arg:H.type==="return"?(this.rval=this.arg=H.arg,this.method="return",this.next="end"):H.type==="normal"&&F&&(this.next=F),m},finish:function(H){for(var F=this.tryEntries.length-1;F>=0;--F){var G=this.tryEntries[F];if(G.finallyLoc===H)return this.complete(G.completion,G.afterLoc),N(G),m}},catch:function(H){for(var F=this.tryEntries.length-1;F>=0;--F){var G=this.tryEntries[F];if(G.tryLoc===H){var B=G.completion;if(B.type==="throw"){var W=B.arg;N(G)}return W}}throw new Error("illegal catch attempt")},delegateYield:function(H,F,G){return this.delegate={iterator:k(H),resultName:F,nextLoc:G},this.method==="next"&&(this.arg=R),m}}}(function(){return this}()||Function("return this")())},{}],228:[function(I,J,P){var L=I("buffer"),u=L.Buffer;function S(h,o){for(var C in h)o[C]=h[C]}u.from&&u.alloc&&u.allocUnsafe&&u.allocUnsafeSlow?J.exports=L:(S(L,P),P.Buffer=R);function R(h,o,C){return u(h,o,C)}S(u,R),R.from=function(h,o,C){if(typeof h=="number")throw new TypeError("Argument must not be a number");return u(h,o,C)},R.alloc=function(h,o,C){if(typeof h!="number")throw new TypeError("Argument must be a number");var c=u(h);return o!==void 0?typeof C=="string"?c.fill(o,C):c.fill(o):c.fill(0),c},R.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u(h)},R.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return L.SlowBuffer(h)}},{buffer:73}],229:[function(I,J,P){(function(L){"use strict";var u=I("babel-runtime/core-js/string/from-code-point"),S=f(u),R=I("babel-runtime/core-js/json/stringify"),h=f(R),o=I("babel-runtime/helpers/typeof"),C=f(o),c=I("babel-runtime/core-js/object/define-property"),a=f(c),i=I("babel-runtime/core-js/object/keys"),r=f(i),l=I("babel-runtime/core-js/object/create"),p=f(l);function f(b){return b&&b.__esModule?b:{default:b}}(function(b){b.parser=function(Y,Z){return new m(Y,Z)},b.SAXParser=m,b.SAXStream=M,b.createStream=s,b.MAX_BUFFER_LENGTH=64*1024;var v=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];b.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function m(Y,Z){if(!(this instanceof m))return new m(Y,Z);var be=this;d(be),be.q=be.c="",be.bufferCheckPosition=b.MAX_BUFFER_LENGTH,be.opt=Z||{},be.opt.lowercase=be.opt.lowercase||be.opt.lowercasetags,be.looseCase=be.opt.lowercase?"toLowerCase":"toUpperCase",be.tags=[],be.closed=be.closedRoot=be.sawRoot=!1,be.tag=be.error=null,be.strict=!!Y,be.noscript=!!(Y||be.opt.noscript),be.state=K.BEGIN,be.strictEntities=be.opt.strictEntities,be.ENTITIES=be.strictEntities?(0,p.default)(b.XML_ENTITIES):(0,p.default)(b.ENTITIES),be.attribList=[],be.opt.xmlns&&(be.ns=(0,p.default)(_)),be.trackPosition=be.opt.position!==!1,be.trackPosition&&(be.position=be.line=be.column=0),re(be,"onready")}p.default||(Object.create=function(Y){function Z(){}Z.prototype=Y;var be=new Z;return be}),r.default||(Object.keys=function(Y){var Z=[];for(var be in Y)Y.hasOwnProperty(be)&&Z.push(be);return Z});function n(Y){for(var Z=Math.max(b.MAX_BUFFER_LENGTH,10),be=0,ge=0,De=v.length;ge<De;ge++){var Qe=Y[v[ge]].length;if(Qe>Z)switch(v[ge]){case"textNode":Ce(Y);break;case"cdata":ee(Y,"oncdata",Y.cdata),Y.cdata="";break;case"script":ee(Y,"onscript",Y.script),Y.script="";break;default:he(Y,"Max buffer length exceeded: "+v[ge])}be=Math.max(be,Qe)}var Ze=b.MAX_BUFFER_LENGTH-be;Y.bufferCheckPosition=Ze+Y.position}function d(Y){for(var Z=0,be=v.length;Z<be;Z++)Y[v[Z]]=""}function g(Y){Ce(Y),Y.cdata!==""&&(ee(Y,"oncdata",Y.cdata),Y.cdata=""),Y.script!==""&&(ee(Y,"onscript",Y.script),Y.script="")}m.prototype={end:function(){ke(this)},write:Q,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){g(this)}};var T;try{T=I("stream").Stream}catch(Y){T=function(){}}var y=b.EVENTS.filter(function(Y){return Y!=="error"&&Y!=="end"});function s(Y,Z){return new M(Y,Z)}function M(Y,Z){if(!(this instanceof M))return new M(Y,Z);T.apply(this),this._parser=new m(Y,Z),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ge){be.emit("error",ge),be._parser.error=null},this._decoder=null,y.forEach(function(ge){(0,a.default)(be,"on"+ge,{get:function(){return be._parser["on"+ge]},set:function(Qe){if(!Qe)return be.removeAllListeners(ge),be._parser["on"+ge]=Qe,Qe;be.on(ge,Qe)},enumerable:!0,configurable:!1})})}M.prototype=(0,p.default)(T.prototype,{constructor:{value:M}}),M.prototype.write=function(Y){if(typeof L=="function"&&typeof L.isBuffer=="function"&&L.isBuffer(Y)){if(!this._decoder){var Z=I("string_decoder").StringDecoder;this._decoder=new Z("utf8")}Y=this._decoder.write(Y)}return this._parser.write(Y.toString()),this.emit("data",Y),!0},M.prototype.end=function(Y){return Y&&Y.length&&this.write(Y),this._parser.end(),!0},M.prototype.on=function(Y,Z){var be=this;return!be._parser["on"+Y]&&y.indexOf(Y)!==-1&&(be._parser["on"+Y]=function(){var ge=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ge.splice(0,0,Y),be.emit.apply(be,ge)}),T.prototype.on.call(be,Y,Z)};var A="[CDATA[",x="DOCTYPE",E="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",_={xml:E,xmlns:w},N=/[:_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]/,j=/[:_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-]/,k=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,z=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function H(Y){return Y===" "||Y===`
|
|
|
`||Y==="\r"||Y===" "}function F(Y){return Y==='"'||Y==="'"}function G(Y){return Y===">"||H(Y)}function B(Y,Z){return Y.test(Z)}function W(Y,Z){return!B(Y,Z)}var K=0;b.STATE={BEGIN:K++,BEGIN_WHITESPACE:K++,TEXT:K++,TEXT_ENTITY:K++,OPEN_WAKA:K++,SGML_DECL:K++,SGML_DECL_QUOTED:K++,DOCTYPE:K++,DOCTYPE_QUOTED:K++,DOCTYPE_DTD:K++,DOCTYPE_DTD_QUOTED:K++,COMMENT_STARTING:K++,COMMENT:K++,COMMENT_ENDING:K++,COMMENT_ENDED:K++,CDATA:K++,CDATA_ENDING:K++,CDATA_ENDING_2:K++,PROC_INST:K++,PROC_INST_BODY:K++,PROC_INST_ENDING:K++,OPEN_TAG:K++,OPEN_TAG_SLASH:K++,ATTRIB:K++,ATTRIB_NAME:K++,ATTRIB_NAME_SAW_WHITE:K++,ATTRIB_VALUE:K++,ATTRIB_VALUE_QUOTED:K++,ATTRIB_VALUE_CLOSED:K++,ATTRIB_VALUE_UNQUOTED:K++,ATTRIB_VALUE_ENTITY_Q:K++,ATTRIB_VALUE_ENTITY_U:K++,CLOSE_TAG:K++,CLOSE_TAG_SAW_WHITE:K++,SCRIPT:K++,SCRIPT_ENDING:K++},b.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},b.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,r.default)(b.ENTITIES).forEach(function(Y){var Z=b.ENTITIES[Y],be=typeof Z=="number"?String.fromCharCode(Z):Z;b.ENTITIES[Y]=be});for(var q in b.STATE)b.STATE[b.STATE[q]]=q;K=b.STATE;function re(Y,Z,be){Y[Z]&&Y[Z](be)}function ee(Y,Z,be){Y.textNode&&Ce(Y),re(Y,Z,be)}function Ce(Y){Y.textNode=xe(Y.opt,Y.textNode),Y.textNode&&re(Y,"ontext",Y.textNode),Y.textNode=""}function xe(Y,Z){return Y.trim&&(Z=Z.trim()),Y.normalize&&(Z=Z.replace(/\s+/g," ")),Z}function he(Y,Z){return Ce(Y),Y.trackPosition&&(Z+=`
|
|
|
Line: `+Y.line+`
|
|
|
Column: `+Y.column+`
|
|
|
Char: `+Y.c),Z=new Error(Z),Y.error=Z,re(Y,"onerror",Z),Y}function ke(Y){return Y.sawRoot&&!Y.closedRoot&&_e(Y,"Unclosed root tag"),Y.state!==K.BEGIN&&Y.state!==K.BEGIN_WHITESPACE&&Y.state!==K.TEXT&&he(Y,"Unexpected end"),Ce(Y),Y.c="",Y.closed=!0,re(Y,"onend"),m.call(Y,Y.strict,Y.opt),Y}function _e(Y,Z){if((typeof Y=="undefined"?"undefined":(0,C.default)(Y))!=="object"||!(Y instanceof m))throw new Error("bad call to strictFail");Y.strict&&he(Y,Z)}function de(Y){Y.strict||(Y.tagName=Y.tagName[Y.looseCase]());var Z=Y.tags[Y.tags.length-1]||Y,be=Y.tag={name:Y.tagName,attributes:{}};Y.opt.xmlns&&(be.ns=Z.ns),Y.attribList.length=0,ee(Y,"onopentagstart",be)}function ce(Y,Z){var be=Y.indexOf(":"),ge=be<0?["",Y]:Y.split(":"),De=ge[0],Qe=ge[1];return Z&&Y==="xmlns"&&(De="xmlns",Qe=""),{prefix:De,local:Qe}}function ae(Y){if(Y.strict||(Y.attribName=Y.attribName[Y.looseCase]()),Y.attribList.indexOf(Y.attribName)!==-1||Y.tag.attributes.hasOwnProperty(Y.attribName)){Y.attribName=Y.attribValue="";return}if(Y.opt.xmlns){var Z=ce(Y.attribName,!0),be=Z.prefix,ge=Z.local;if(be==="xmlns")if(ge==="xml"&&Y.attribValue!==E)_e(Y,"xml: prefix must be bound to "+E+`
|
|
|
Actual: `+Y.attribValue);else if(ge==="xmlns"&&Y.attribValue!==w)_e(Y,"xmlns: prefix must be bound to "+w+`
|
|
|
Actual: `+Y.attribValue);else{var De=Y.tag,Qe=Y.tags[Y.tags.length-1]||Y;De.ns===Qe.ns&&(De.ns=(0,p.default)(Qe.ns)),De.ns[ge]=Y.attribValue}Y.attribList.push([Y.attribName,Y.attribValue])}else Y.tag.attributes[Y.attribName]=Y.attribValue,ee(Y,"onattribute",{name:Y.attribName,value:Y.attribValue});Y.attribName=Y.attribValue=""}function Se(Y,Z){if(Y.opt.xmlns){var be=Y.tag,ge=ce(Y.tagName);be.prefix=ge.prefix,be.local=ge.local,be.uri=be.ns[ge.prefix]||"",be.prefix&&!be.uri&&(_e(Y,"Unbound namespace prefix: "+(0,h.default)(Y.tagName)),be.uri=ge.prefix);var De=Y.tags[Y.tags.length-1]||Y;be.ns&&De.ns!==be.ns&&(0,r.default)(be.ns).forEach(function($e){ee(Y,"onopennamespace",{prefix:$e,uri:be.ns[$e]})});for(var Qe=0,Ze=Y.attribList.length;Qe<Ze;Qe++){var nt=Y.attribList[Qe],tt=nt[0],lt=nt[1],st=ce(tt,!0),je=st.prefix,Re=st.local,et=je===""?"":be.ns[je]||"",ct={name:tt,value:lt,prefix:je,local:Re,uri:et};je&&je!=="xmlns"&&!et&&(_e(Y,"Unbound namespace prefix: "+(0,h.default)(je)),ct.uri=je),Y.tag.attributes[tt]=ct,ee(Y,"onattribute",ct)}Y.attribList.length=0}Y.tag.isSelfClosing=!!Z,Y.sawRoot=!0,Y.tags.push(Y.tag),ee(Y,"onopentag",Y.tag),Z||(!Y.noscript&&Y.tagName.toLowerCase()==="script"?Y.state=K.SCRIPT:Y.state=K.TEXT,Y.tag=null,Y.tagName=""),Y.attribName=Y.attribValue="",Y.attribList.length=0}function te(Y){if(!Y.tagName){_e(Y,"Weird empty close tag."),Y.textNode+="</>",Y.state=K.TEXT;return}if(Y.script){if(Y.tagName!=="script"){Y.script+="</"+Y.tagName+">",Y.tagName="",Y.state=K.SCRIPT;return}ee(Y,"onscript",Y.script),Y.script=""}var Z=Y.tags.length,be=Y.tagName;Y.strict||(be=be[Y.looseCase]());for(var ge=be;Z--;){var De=Y.tags[Z];if(De.name!==ge)_e(Y,"Unexpected close tag");else break}if(Z<0){_e(Y,"Unmatched closing tag: "+Y.tagName),Y.textNode+="</"+Y.tagName+">",Y.state=K.TEXT;return}Y.tagName=be;for(var Qe=Y.tags.length;Qe-- >Z;){var Ze=Y.tag=Y.tags.pop();Y.tagName=Y.tag.name,ee(Y,"onclosetag",Y.tagName);var nt={};for(var tt in Ze.ns)nt[tt]=Ze.ns[tt];var lt=Y.tags[Y.tags.length-1]||Y;Y.opt.xmlns&&Ze.ns!==lt.ns&&(0,r.default)(Ze.ns).forEach(function(st){var je=Ze.ns[st];ee(Y,"onclosenamespace",{prefix:st,uri:je})})}Z===0&&(Y.closedRoot=!0),Y.tagName=Y.attribValue=Y.attribName="",Y.attribList.length=0,Y.state=K.TEXT}function ue(Y){var Z=Y.entity,be=Z.toLowerCase(),ge,De="";return Y.ENTITIES[Z]?Y.ENTITIES[Z]:Y.ENTITIES[be]?Y.ENTITIES[be]:(Z=be,Z.charAt(0)==="#"&&(Z.charAt(1)==="x"?(Z=Z.slice(2),ge=parseInt(Z,16),De=ge.toString(16)):(Z=Z.slice(1),ge=parseInt(Z,10),De=ge.toString(10))),Z=Z.replace(/^0+/,""),isNaN(ge)||De.toLowerCase()!==Z?(_e(Y,"Invalid character entity"),"&"+Y.entity+";"):(0,S.default)(ge))}function Oe(Y,Z){Z==="<"?(Y.state=K.OPEN_WAKA,Y.startTagPosition=Y.position):H(Z)||(_e(Y,"Non-whitespace before first tag."),Y.textNode=Z,Y.state=K.TEXT)}function le(Y,Z){var be="";return Z<Y.length&&(be=Y.charAt(Z)),be}function Q(Y){var Z=this;if(this.error)throw this.error;if(Z.closed)return he(Z,"Cannot write after close. Assign an onready handler.");if(Y===null)return ke(Z);(typeof Y=="undefined"?"undefined":(0,C.default)(Y))==="object"&&(Y=Y.toString());for(var be=0,ge="";!(ge=le(Y,be++),Z.c=ge,!ge);){Z.trackPosition&&(Z.position++,ge===`
|
|
|
`?(Z.line++,Z.column=0):Z.column++);switch(Z.state){case K.BEGIN:if(Z.state=K.BEGIN_WHITESPACE,ge==="\uFEFF")continue;Oe(Z,ge);continue;case K.BEGIN_WHITESPACE:Oe(Z,ge);continue;case K.TEXT:if(Z.sawRoot&&!Z.closedRoot){for(var De=be-1;ge&&ge!=="<"&&ge!=="&";)ge=le(Y,be++),ge&&Z.trackPosition&&(Z.position++,ge===`
|
|
|
`?(Z.line++,Z.column=0):Z.column++);Z.textNode+=Y.substring(De,be-1)}ge==="<"&&!(Z.sawRoot&&Z.closedRoot&&!Z.strict)?(Z.state=K.OPEN_WAKA,Z.startTagPosition=Z.position):(!H(ge)&&(!Z.sawRoot||Z.closedRoot)&&_e(Z,"Text data outside of root node."),ge==="&"?Z.state=K.TEXT_ENTITY:Z.textNode+=ge);continue;case K.SCRIPT:ge==="<"?Z.state=K.SCRIPT_ENDING:Z.script+=ge;continue;case K.SCRIPT_ENDING:ge==="/"?Z.state=K.CLOSE_TAG:(Z.script+="<"+ge,Z.state=K.SCRIPT);continue;case K.OPEN_WAKA:if(ge==="!")Z.state=K.SGML_DECL,Z.sgmlDecl="";else if(!H(ge))if(B(N,ge))Z.state=K.OPEN_TAG,Z.tagName=ge;else if(ge==="/")Z.state=K.CLOSE_TAG,Z.tagName="";else if(ge==="?")Z.state=K.PROC_INST,Z.procInstName=Z.procInstBody="";else{if(_e(Z,"Unencoded <"),Z.startTagPosition+1<Z.position){var Qe=Z.position-Z.startTagPosition;ge=new Array(Qe).join(" ")+ge}Z.textNode+="<"+ge,Z.state=K.TEXT}continue;case K.SGML_DECL:(Z.sgmlDecl+ge).toUpperCase()===A?(ee(Z,"onopencdata"),Z.state=K.CDATA,Z.sgmlDecl="",Z.cdata=""):Z.sgmlDecl+ge==="--"?(Z.state=K.COMMENT,Z.comment="",Z.sgmlDecl=""):(Z.sgmlDecl+ge).toUpperCase()===x?(Z.state=K.DOCTYPE,(Z.doctype||Z.sawRoot)&&_e(Z,"Inappropriately located doctype declaration"),Z.doctype="",Z.sgmlDecl=""):ge===">"?(ee(Z,"onsgmldeclaration",Z.sgmlDecl),Z.sgmlDecl="",Z.state=K.TEXT):(F(ge)&&(Z.state=K.SGML_DECL_QUOTED),Z.sgmlDecl+=ge);continue;case K.SGML_DECL_QUOTED:ge===Z.q&&(Z.state=K.SGML_DECL,Z.q=""),Z.sgmlDecl+=ge;continue;case K.DOCTYPE:ge===">"?(Z.state=K.TEXT,ee(Z,"ondoctype",Z.doctype),Z.doctype=!0):(Z.doctype+=ge,ge==="["?Z.state=K.DOCTYPE_DTD:F(ge)&&(Z.state=K.DOCTYPE_QUOTED,Z.q=ge));continue;case K.DOCTYPE_QUOTED:Z.doctype+=ge,ge===Z.q&&(Z.q="",Z.state=K.DOCTYPE);continue;case K.DOCTYPE_DTD:Z.doctype+=ge,ge==="]"?Z.state=K.DOCTYPE:F(ge)&&(Z.state=K.DOCTYPE_DTD_QUOTED,Z.q=ge);continue;case K.DOCTYPE_DTD_QUOTED:Z.doctype+=ge,ge===Z.q&&(Z.state=K.DOCTYPE_DTD,Z.q="");continue;case K.COMMENT:ge==="-"?Z.state=K.COMMENT_ENDING:Z.comment+=ge;continue;case K.COMMENT_ENDING:ge==="-"?(Z.state=K.COMMENT_ENDED,Z.comment=xe(Z.opt,Z.comment),Z.comment&&ee(Z,"oncomment",Z.comment),Z.comment=""):(Z.comment+="-"+ge,Z.state=K.COMMENT);continue;case K.COMMENT_ENDED:ge!==">"?(_e(Z,"Malformed comment"),Z.comment+="--"+ge,Z.state=K.COMMENT):Z.state=K.TEXT;continue;case K.CDATA:ge==="]"?Z.state=K.CDATA_ENDING:Z.cdata+=ge;continue;case K.CDATA_ENDING:ge==="]"?Z.state=K.CDATA_ENDING_2:(Z.cdata+="]"+ge,Z.state=K.CDATA);continue;case K.CDATA_ENDING_2:ge===">"?(Z.cdata&&ee(Z,"oncdata",Z.cdata),ee(Z,"onclosecdata"),Z.cdata="",Z.state=K.TEXT):ge==="]"?Z.cdata+="]":(Z.cdata+="]]"+ge,Z.state=K.CDATA);continue;case K.PROC_INST:ge==="?"?Z.state=K.PROC_INST_ENDING:H(ge)?Z.state=K.PROC_INST_BODY:Z.procInstName+=ge;continue;case K.PROC_INST_BODY:if(!Z.procInstBody&&H(ge))continue;ge==="?"?Z.state=K.PROC_INST_ENDING:Z.procInstBody+=ge;continue;case K.PROC_INST_ENDING:ge===">"?(ee(Z,"onprocessinginstruction",{name:Z.procInstName,body:Z.procInstBody}),Z.procInstName=Z.procInstBody="",Z.state=K.TEXT):(Z.procInstBody+="?"+ge,Z.state=K.PROC_INST_BODY);continue;case K.OPEN_TAG:B(j,ge)?Z.tagName+=ge:(de(Z),ge===">"?Se(Z):ge==="/"?Z.state=K.OPEN_TAG_SLASH:(H(ge)||_e(Z,"Invalid character in tag name"),Z.state=K.ATTRIB));continue;case K.OPEN_TAG_SLASH:ge===">"?(Se(Z,!0),te(Z)):(_e(Z,"Forward-slash in opening tag not followed by >"),Z.state=K.ATTRIB);continue;case K.ATTRIB:if(H(ge))continue;ge===">"?Se(Z):ge==="/"?Z.state=K.OPEN_TAG_SLASH:B(N,ge)?(Z.attribName=ge,Z.attribValue="",Z.state=K.ATTRIB_NAME):_e(Z,"Invalid attribute name");continue;case K.ATTRIB_NAME:ge==="="?Z.state=K.ATTRIB_VALUE:ge===">"?(_e(Z,"Attribute without value"),Z.attribValue=Z.attribName,ae(Z),Se(Z)):H(ge)?Z.state=K.ATTRIB_NAME_SAW_WHITE:B(j,ge)?Z.attribName+=ge:_e(Z,"Invalid attribute name");continue;case K.ATTRIB_NAME_SAW_WHITE:if(ge==="=")Z.state=K.ATTRIB_VALUE;else{if(H(ge))continue;_e(Z,"Attribute without value"),Z.tag.attributes[Z.attribName]="",Z.attribValue="",ee(Z,"onattribute",{name:Z.attribName,value:""}),Z.attribName="",ge===">"?Se(Z):B(N,ge)?(Z.attribName=ge,Z.state=K.ATTRIB_NAME):(_e(Z,"Invalid attribute name"),Z.state=K.ATTRIB)}continue;case K.ATTRIB_VALUE:if(H(ge))continue;F(ge)?(Z.q=ge,Z.state=K.ATTRIB_VALUE_QUOTED):(_e(Z,"Unquoted attribute value"),Z.state=K.ATTRIB_VALUE_UNQUOTED,Z.attribValue=ge);continue;case K.ATTRIB_VALUE_QUOTED:if(ge!==Z.q){ge==="&"?Z.state=K.ATTRIB_VALUE_ENTITY_Q:Z.attribValue+=ge;continue}ae(Z),Z.q="",Z.state=K.ATTRIB_VALUE_CLOSED;continue;case K.ATTRIB_VALUE_CLOSED:H(ge)?Z.state=K.ATTRIB:ge===">"?Se(Z):ge==="/"?Z.state=K.OPEN_TAG_SLASH:B(N,ge)?(_e(Z,"No whitespace between attributes"),Z.attribName=ge,Z.attribValue="",Z.state=K.ATTRIB_NAME):_e(Z,"Invalid attribute name");continue;case K.ATTRIB_VALUE_UNQUOTED:if(!G(ge)){ge==="&"?Z.state=K.ATTRIB_VALUE_ENTITY_U:Z.attribValue+=ge;continue}ae(Z),ge===">"?Se(Z):Z.state=K.ATTRIB;continue;case K.CLOSE_TAG:if(Z.tagName)ge===">"?te(Z):B(j,ge)?Z.tagName+=ge:Z.script?(Z.script+="</"+Z.tagName,Z.tagName="",Z.state=K.SCRIPT):(H(ge)||_e(Z,"Invalid tagname in closing tag"),Z.state=K.CLOSE_TAG_SAW_WHITE);else{if(H(ge))continue;W(N,ge)?Z.script?(Z.script+="</"+ge,Z.state=K.SCRIPT):_e(Z,"Invalid tagname in closing tag."):Z.tagName=ge}continue;case K.CLOSE_TAG_SAW_WHITE:if(H(ge))continue;ge===">"?te(Z):_e(Z,"Invalid characters in closing tag");continue;case K.TEXT_ENTITY:case K.ATTRIB_VALUE_ENTITY_Q:case K.ATTRIB_VALUE_ENTITY_U:var Ze,nt;switch(Z.state){case K.TEXT_ENTITY:Ze=K.TEXT,nt="textNode";break;case K.ATTRIB_VALUE_ENTITY_Q:Ze=K.ATTRIB_VALUE_QUOTED,nt="attribValue";break;case K.ATTRIB_VALUE_ENTITY_U:Ze=K.ATTRIB_VALUE_UNQUOTED,nt="attribValue";break}ge===";"?(Z[nt]+=ue(Z),Z.entity="",Z.state=Ze):B(Z.entity.length?z:k,ge)?Z.entity+=ge:(_e(Z,"Invalid character in entity name"),Z[nt]+="&"+Z.entity+ge,Z.entity="",Z.state=Ze);continue;default:throw new Error(Z,"Unknown state: "+Z.state)}}return Z.position>=Z.bufferCheckPosition&&n(Z),Z}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */S.default||function(){var Y=String.fromCharCode,Z=Math.floor,be=function(){var De=16384,Qe=[],Ze,nt,tt=-1,lt=arguments.length;if(!lt)return"";for(var st="";++tt<lt;){var je=Number(arguments[tt]);if(!isFinite(je)||je<0||je>1114111||Z(je)!==je)throw RangeError("Invalid code point: "+je);je<=65535?Qe.push(je):(je-=65536,Ze=(je>>10)+55296,nt=je%1024+56320,Qe.push(Ze,nt)),(tt+1===lt||Qe.length>De)&&(st+=Y.apply(null,Qe),Qe.length=0)}return st};a.default?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be}()})(typeof P=="undefined"?(void 0).sax={}:P)}).call(this,I("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/define-property":56,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/string/from-code-point":63,"babel-runtime/helpers/typeof":67,buffer:73,stream:230,string_decoder:72}],230:[function(I,J,P){J.exports=S;var L=I("events").EventEmitter,u=I("inherits");u(S,L),S.Readable=I("readable-stream/readable.js"),S.Writable=I("readable-stream/writable.js"),S.Duplex=I("readable-stream/duplex.js"),S.Transform=I("readable-stream/transform.js"),S.PassThrough=I("readable-stream/passthrough.js"),S.Stream=S;function S(){L.call(this)}S.prototype.pipe=function(R,h){var o=this;function C(f){R.writable&&(R.write(f)===!1&&o.pause&&o.pause())}o.on("data",C);function c(){o.readable&&o.resume&&o.resume()}R.on("drain",c),!R._isStdio&&(!h||h.end!==!1)&&(o.on("end",i),o.on("close",r));var a=!1;function i(){if(a)return;a=!0,R.end()}function r(){if(a)return;a=!0,typeof R.destroy=="function"&&R.destroy()}function l(f){if(p(),L.listenerCount(this,"error")===0)throw f}o.on("error",l),R.on("error",l);function p(){o.removeListener("data",C),R.removeListener("drain",c),o.removeListener("end",i),o.removeListener("close",r),o.removeListener("error",l),R.removeListener("error",l),o.removeListener("end",p),o.removeListener("close",p),R.removeListener("close",p)}return o.on("end",p),o.on("close",p),R.on("close",p),R.emit("pipe",o),R}},{events:192,inherits:196,"readable-stream/duplex.js":213,"readable-stream/passthrough.js":222,"readable-stream/readable.js":223,"readable-stream/transform.js":224,"readable-stream/writable.js":225}],231:[function(I,J,P){(function(L){var u=I("./lib/request"),S=I("./lib/response"),R=I("xtend"),h=I("builtin-status-codes"),o=I("url"),C=P;C.request=function(c,a){typeof c=="string"?c=o.parse(c):c=R(c);var i=L.location.protocol.search(/^https?:$/)===-1?"http:":"",r=c.protocol||i,l=c.hostname||c.host,p=c.port,f=c.path||"/";l&&l.indexOf(":")!==-1&&(l="["+l+"]"),c.url=(l?r+"//"+l:"")+(p?":"+p:"")+f,c.method=(c.method||"GET").toUpperCase(),c.headers=c.headers||{};var b=new u(c);return a&&b.on("response",a),b},C.get=function(a,i){var r=C.request(a,i);return r.end(),r},C.ClientRequest=u,C.IncomingMessage=S.IncomingMessage,C.Agent=function(){},C.Agent.defaultMaxSockets=4,C.globalAgent=new C.Agent,C.STATUS_CODES=h,C.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 global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":233,"./lib/response":234,"builtin-status-codes":74,url:238,xtend:283}],232:[function(I,J,P){(function(L){"use strict";P.fetch=C(L.fetch)&&C(L.ReadableStream),P.writableStream=C(L.WritableStream),P.abortController=C(L.AbortController),P.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),P.blobConstructor=!0}catch(c){}var u;function S(){if(u!==void 0)return u;if(L.XMLHttpRequest){u=new L.XMLHttpRequest;try{u.open("GET",L.XDomainRequest?"/":"https://example.com")}catch(c){u=null}}else u=null;return u}function R(c){var a=S();if(!a)return!1;try{return a.responseType=c,a.responseType===c}catch(i){}return!1}var h=typeof L.ArrayBuffer!="undefined",o=h&&C(L.ArrayBuffer.prototype.slice);P.arraybuffer=P.fetch||h&&R("arraybuffer"),P.msstream=!P.fetch&&o&&R("ms-stream"),P.mozchunkedarraybuffer=!P.fetch&&h&&R("moz-chunked-arraybuffer"),P.overrideMimeType=P.fetch||(S()?C(S().overrideMimeType):!1),P.vbArray=C(L.VBArray);function C(c){return typeof c=="function"}u=null}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],233:[function(I,J,P){(function(L,u,S){"use strict";var R=I("babel-runtime/core-js/object/keys"),h=o(R);function o(n){return n&&n.__esModule?n:{default:n}}var C=I("./capability"),c=I("inherits"),a=I("./response"),i=I("readable-stream"),r=I("to-arraybuffer"),l=a.IncomingMessage,p=a.readyStates;function f(n,d){return C.fetch&&d?"fetch":C.mozchunkedarraybuffer?"moz-chunked-arraybuffer":C.msstream?"ms-stream":C.arraybuffer&&n?"arraybuffer":C.vbArray&&n?"text:vbarray":"text"}var b=J.exports=function(n){var d=this;i.Writable.call(d),d._opts=n,d._body=[],d._headers={},n.auth&&d.setHeader("Authorization","Basic "+new S(n.auth).toString("base64")),(0,h.default)(n.headers).forEach(function(y){d.setHeader(y,n.headers[y])});var g,T=!0;if(n.mode==="disable-fetch"||"requestTimeout"in n&&!C.abortController)T=!1,g=!0;else if(n.mode==="prefer-streaming")g=!1;else if(n.mode==="allow-wrong-content-type")g=!C.overrideMimeType;else if(!n.mode||n.mode==="default"||n.mode==="prefer-fast")g=!0;else throw new Error("Invalid value for opts.mode");d._mode=f(g,T),d._fetchTimer=null,d.on("finish",function(){d._onFinish()})};c(b,i.Writable),b.prototype.setHeader=function(n,d){var g=this,T=n.toLowerCase();if(m.indexOf(T)!==-1)return;g._headers[T]={name:n,value:d}},b.prototype.getHeader=function(n){var d=this._headers[n.toLowerCase()];return d?d.value:null},b.prototype.removeHeader=function(n){var d=this;delete d._headers[n.toLowerCase()]},b.prototype._onFinish=function(){var n=this;if(n._destroyed)return;var d=n._opts,g=n._headers,T=null;d.method!=="GET"&&d.method!=="HEAD"&&(C.arraybuffer?T=r(S.concat(n._body)):C.blobConstructor?T=new u.Blob(n._body.map(function(E){return r(E)}),{type:(g["content-type"]||{}).value||""}):T=S.concat(n._body).toString());var y=[];if((0,h.default)(g).forEach(function(E){var w=g[E].name,_=g[E].value;Array.isArray(_)?_.forEach(function(N){y.push([w,N])}):y.push([w,_])}),n._mode==="fetch"){var s=null,M=null;if(C.abortController){var A=new AbortController;s=A.signal,n._fetchAbortController=A,"requestTimeout"in d&&d.requestTimeout!==0&&(n._fetchTimer=u.setTimeout(function(){n.emit("requestTimeout"),n._fetchAbortController&&n._fetchAbortController.abort()},d.requestTimeout))}u.fetch(n._opts.url,{method:n._opts.method,headers:y,body:T||void 0,mode:"cors",credentials:d.withCredentials?"include":"same-origin",signal:s}).then(function(E){n._fetchResponse=E,n._connect()},function(E){u.clearTimeout(n._fetchTimer),n._destroyed||n.emit("error",E)})}else{var x=n._xhr=new u.XMLHttpRequest;try{x.open(n._opts.method,n._opts.url,!0)}catch(E){L.nextTick(function(){n.emit("error",E)});return}"responseType"in x&&(x.responseType=n._mode.split(":")[0]),"withCredentials"in x&&(x.withCredentials=!!d.withCredentials),n._mode==="text"&&"overrideMimeType"in x&&x.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in d&&(x.timeout=d.requestTimeout,x.ontimeout=function(){n.emit("requestTimeout")}),y.forEach(function(E){x.setRequestHeader(E[0],E[1])}),n._response=null,x.onreadystatechange=function(){switch(x.readyState){case p.LOADING:case p.DONE:n._onXHRProgress();break}},n._mode==="moz-chunked-arraybuffer"&&(x.onprogress=function(){n._onXHRProgress()}),x.onerror=function(){if(n._destroyed)return;n.emit("error",new Error("XHR error"))};try{x.send(T)}catch(E){L.nextTick(function(){n.emit("error",E)});return}}};function v(n){try{var d=n.status;return d!==null&&d!==0}catch(g){return!1}}b.prototype._onXHRProgress=function(){var n=this;if(!v(n._xhr)||n._destroyed)return;n._response||n._connect(),n._response._onXHRProgress()},b.prototype._connect=function(){var n=this;if(n._destroyed)return;n._response=new l(n._xhr,n._fetchResponse,n._mode,n._fetchTimer),n._response.on("error",function(d){n.emit("error",d)}),n.emit("response",n._response)},b.prototype._write=function(n,d,g){var T=this;T._body.push(n),g()},b.prototype.abort=b.prototype.destroy=function(){var n=this;n._destroyed=!0,u.clearTimeout(n._fetchTimer),n._response&&(n._response._destroyed=!0),n._xhr?n._xhr.abort():n._fetchAbortController&&n._fetchAbortController.abort()},b.prototype.end=function(n,d,g){var T=this;typeof n=="function"&&(g=n,n=void 0),i.Writable.prototype.end.call(T,n,d,g)},b.prototype.flushHeaders=function(){},b.prototype.setTimeout=function(){},b.prototype.setNoDelay=function(){},b.prototype.setSocketKeepAlive=function(){};var m=["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,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("buffer").Buffer)},{"./capability":232,"./response":234,_process:208,"babel-runtime/core-js/object/keys":60,buffer:73,inherits:196,"readable-stream":223,"to-arraybuffer":237}],234:[function(I,J,P){(function(L,u,S){"use strict";var R=I("babel-runtime/core-js/promise"),h=o(R);function o(l){return l&&l.__esModule?l:{default:l}}var C=I("./capability"),c=I("inherits"),a=I("readable-stream"),i=P.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},r=P.IncomingMessage=function(l,p,f,b){var v=this;if(a.Readable.call(v),v._mode=f,v.headers={},v.rawHeaders=[],v.trailers={},v.rawTrailers=[],v.on("end",function(){L.nextTick(function(){v.emit("close")})}),f==="fetch"){var m=function s(){d.read().then(function(M){if(v._destroyed)return;if(M.done){u.clearTimeout(b),v.push(null);return}v.push(new S(M.value)),s()}).catch(function(M){u.clearTimeout(b),v._destroyed||v.emit("error",M)})};if(v._fetchResponse=p,v.url=p.url,v.statusCode=p.status,v.statusMessage=p.statusText,p.headers.forEach(function(s,M){v.headers[M.toLowerCase()]=s,v.rawHeaders.push(M,s)}),C.writableStream){var n=new WritableStream({write:function(M){return new h.default(function(A,x){v._destroyed?x():v.push(new S(M))?A():v._resumeFetch=A})},close:function(){u.clearTimeout(b),v._destroyed||v.push(null)},abort:function(M){v._destroyed||v.emit("error",M)}});try{p.body.pipeTo(n).catch(function(s){u.clearTimeout(b),v._destroyed||v.emit("error",s)});return}catch(s){}}var d=p.body.getReader();m()}else{v._xhr=l,v._pos=0,v.url=l.responseURL,v.statusCode=l.status,v.statusMessage=l.statusText;var g=l.getAllResponseHeaders().split(/\r?\n/);if(g.forEach(function(s){var M=s.match(/^([^:]+):\s*(.*)/);if(M){var A=M[1].toLowerCase();A==="set-cookie"?(v.headers[A]===void 0&&(v.headers[A]=[]),v.headers[A].push(M[2])):v.headers[A]!==void 0?v.headers[A]+=", "+M[2]:v.headers[A]=M[2],v.rawHeaders.push(M[1],M[2])}}),v._charset="x-user-defined",!C.overrideMimeType){var T=v.rawHeaders["mime-type"];if(T){var y=T.match(/;\s*charset=([^;])(;|$)/);y&&(v._charset=y[1].toLowerCase())}v._charset||(v._charset="utf-8")}}};c(r,a.Readable),r.prototype._read=function(){var l=this,p=l._resumeFetch;p&&(l._resumeFetch=null,p())},r.prototype._onXHRProgress=function(){var l=this,p=l._xhr,f=null;switch(l._mode){case"text:vbarray":if(p.readyState!==i.DONE)break;try{f=new u.VBArray(p.responseBody).toArray()}catch(d){}if(f!==null){l.push(new S(f));break}case"text":try{f=p.responseText}catch(d){l._mode="text:vbarray";break}if(f.length>l._pos){var b=f.substr(l._pos);if(l._charset==="x-user-defined"){for(var v=new S(b.length),m=0;m<b.length;m++)v[m]=b.charCodeAt(m)&255;l.push(v)}else l.push(b,l._charset);l._pos=f.length}break;case"arraybuffer":if(p.readyState!==i.DONE||!p.response)break;f=p.response,l.push(new S(new Uint8Array(f)));break;case"moz-chunked-arraybuffer":if(f=p.response,p.readyState!==i.LOADING||!f)break;l.push(new S(new Uint8Array(f)));break;case"ms-stream":if(f=p.response,p.readyState!==i.LOADING)break;var n=new u.MSStreamReader;n.onprogress=function(){n.result.byteLength>l._pos&&(l.push(new S(new Uint8Array(n.result.slice(l._pos)))),l._pos=n.result.byteLength)},n.onload=function(){l.push(null)},n.readAsArrayBuffer(f);break}l._xhr.readyState===i.DONE&&l._mode!=="ms-stream"&&l.push(null)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("buffer").Buffer)},{"./capability":232,_process:208,"babel-runtime/core-js/promise":61,buffer:73,inherits:196,"readable-stream":223}],235:[function(I,J,P){"use strict";var L=I("safe-buffer").Buffer,u=L.isEncoding||function(n){n=""+n;switch(n&&n.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}};function S(n){if(!n)return"utf8";for(var d;;)switch(n){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 n;default:if(d)return;n=(""+n).toLowerCase(),d=!0}}function R(n){var d=S(n);if(typeof d!="string"&&(L.isEncoding===u||!u(n)))throw new Error("Unknown encoding: "+n);return d||n}P.StringDecoder=h;function h(n){this.encoding=R(n);var d;switch(this.encoding){case"utf16le":this.text=l,this.end=p,d=4;break;case"utf8":this.fillLast=a,d=4;break;case"base64":this.text=f,this.end=b,d=3;break;default:this.write=v,this.end=m;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=L.allocUnsafe(d)}h.prototype.write=function(n){if(n.length===0)return"";var d,g;if(this.lastNeed){if(d=this.fillLast(n),d===void 0)return"";g=this.lastNeed,this.lastNeed=0}else g=0;return g<n.length?d?d+this.text(n,g):this.text(n,g):d||""},h.prototype.end=r,h.prototype.text=i,h.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function o(n){return n<=127?0:n>>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function C(n,d,g){var T=d.length-1;if(T<g)return 0;var y=o(d[T]);return y>=0?(y>0&&(n.lastNeed=y-1),y):--T<g||y===-2?0:(y=o(d[T]),y>=0?(y>0&&(n.lastNeed=y-2),y):--T<g||y===-2?0:(y=o(d[T]),y>=0?(y>0&&(y===2?y=0:n.lastNeed=y-3),y):0))}function c(n,d,g){if((d[0]&192)!==128)return n.lastNeed=0,"\uFFFD";if(n.lastNeed>1&&d.length>1){if((d[1]&192)!==128)return n.lastNeed=1,"\uFFFD";if(n.lastNeed>2&&d.length>2&&(d[2]&192)!==128)return n.lastNeed=2,"\uFFFD"}}function a(n){var d=this.lastTotal-this.lastNeed,g=c(this,n,d);if(g!==void 0)return g;if(this.lastNeed<=n.length)return n.copy(this.lastChar,d,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,d,0,n.length),this.lastNeed-=n.length}function i(n,d){var g=C(this,n,d);if(!this.lastNeed)return n.toString("utf8",d);this.lastTotal=g;var T=n.length-(g-this.lastNeed);return n.copy(this.lastChar,0,T),n.toString("utf8",d,T)}function r(n){var d=n&&n.length?this.write(n):"";return this.lastNeed?d+"\uFFFD":d}function l(n,d){if((n.length-d)%2===0){var g=n.toString("utf16le",d);if(g){var T=g.charCodeAt(g.length-1);if(T>=55296&&T<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",d,n.length-1)}function p(n){var d=n&&n.length?this.write(n):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return d+this.lastChar.toString("utf16le",0,g)}return d}function f(n,d){var g=(n.length-d)%3;return g===0?n.toString("base64",d):(this.lastNeed=3-g,this.lastTotal=3,g===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",d,n.length-g))}function b(n){var d=n&&n.length?this.write(n):"";return this.lastNeed?d+this.lastChar.toString("base64",0,3-this.lastNeed):d}function v(n){return n.toString(this.encoding)}function m(n){return n&&n.length?this.write(n):""}},{"safe-buffer":228}],236:[function(I,J,P){(function(L,u){var S=I("process/browser.js").nextTick,R=Function.prototype.apply,h=Array.prototype.slice,o={},C=0;P.setTimeout=function(){return new c(R.call(setTimeout,window,arguments),clearTimeout)},P.setInterval=function(){return new c(R.call(setInterval,window,arguments),clearInterval)},P.clearTimeout=P.clearInterval=function(a){a.close()};function c(a,i){this._id=a,this._clearFn=i}c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},P.enroll=function(a,i){clearTimeout(a._idleTimeoutId),a._idleTimeout=i},P.unenroll=function(a){clearTimeout(a._idleTimeoutId),a._idleTimeout=-1},P._unrefActive=P.active=function(a){clearTimeout(a._idleTimeoutId);var i=a._idleTimeout;i>=0&&(a._idleTimeoutId=setTimeout(function(){a._onTimeout&&a._onTimeout()},i))},P.setImmediate=typeof L=="function"?L:function(a){var i=C++,r=arguments.length<2?!1:h.call(arguments,1);return o[i]=!0,S(function(){o[i]&&(r?a.apply(null,r):a.call(null),P.clearImmediate(i))}),i},P.clearImmediate=typeof u=="function"?u:function(a){delete o[a]}}).call(this,I("timers").setImmediate,I("timers").clearImmediate)},{"process/browser.js":208,timers:236}],237:[function(I,J,P){var L=I("buffer").Buffer;J.exports=function(u){if(u instanceof Uint8Array){if(u.byteOffset===0&&u.byteLength===u.buffer.byteLength)return u.buffer;if(typeof u.buffer.slice=="function")return u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)}if(L.isBuffer(u)){for(var S=new Uint8Array(u.length),R=u.length,h=0;h<R;h++)S[h]=u[h];return S.buffer}else throw new Error("Argument must be a Buffer")}},{buffer:73}],238:[function(I,J,P){"use strict";var L=I("punycode"),u=I("./util");P.parse=d,P.resolve=T,P.resolveObject=y,P.format=g,P.Url=S;function S(){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}var R=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,C=["<",">",'"',"`"," ","\r",`
|
|
|
`," "],c=["{","}","|","\\","^","`"].concat(C),a=["'"].concat(c),i=["%","/","?",";","#"].concat(a),r=["/","?","#"],l=255,p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},n=I("querystring");function d(s,M,A){if(s&&u.isObject(s)&&s instanceof S)return s;var x=new S;return x.parse(s,M,A),x}S.prototype.parse=function(s,M,A){if(!u.isString(s))throw new TypeError("Parameter 'url' must be a string, not "+typeof s);var x=s.indexOf("?"),E=x!==-1&&x<s.indexOf("#")?"?":"#",w=s.split(E),_=/\\/g;w[0]=w[0].replace(_,"/"),s=w.join(E);var N=s;if(N=N.trim(),!A&&s.split("#").length===1){var j=o.exec(N);if(j)return this.path=N,this.href=N,this.pathname=j[1],j[2]?(this.search=j[2],M?this.query=n.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var k=R.exec(N);if(k){k=k[0];var z=k.toLowerCase();this.protocol=z,N=N.substr(k.length)}if(A||k||N.match(/^\/\/[^@\/]+@[^@\/]+/)){var H=N.substr(0,2)==="//";H&&!(k&&v[k])&&(N=N.substr(2),this.slashes=!0)}if(!v[k]&&(H||k&&!m[k])){for(var F=-1,G=0;G<r.length;G++){var B=N.indexOf(r[G]);B!==-1&&(F===-1||B<F)&&(F=B)}var W,K;F===-1?K=N.lastIndexOf("@"):K=N.lastIndexOf("@",F),K!==-1&&(W=N.slice(0,K),N=N.slice(K+1),this.auth=decodeURIComponent(W)),F=-1;for(var G=0;G<i.length;G++){var B=N.indexOf(i[G]);B!==-1&&(F===-1||B<F)&&(F=B)}F===-1&&(F=N.length),this.host=N.slice(0,F),N=N.slice(F),this.parseHost(),this.hostname=this.hostname||"";var q=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!q)for(var re=this.hostname.split(/\./),G=0,ee=re.length;G<ee;G++){var Ce=re[G];if(!Ce)continue;if(!Ce.match(p)){for(var xe="",he=0,ke=Ce.length;he<ke;he++)Ce.charCodeAt(he)>127?xe+="x":xe+=Ce[he];if(!xe.match(p)){var _e=re.slice(0,G),de=re.slice(G+1),ce=Ce.match(f);ce&&(_e.push(ce[1]),de.unshift(ce[2])),de.length&&(N="/"+de.join(".")+N),this.hostname=_e.join(".");break}}}this.hostname.length>l?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=L.toASCII(this.hostname));var ae=this.port?":"+this.port:"",Se=this.hostname||"";this.host=Se+ae,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),N[0]!=="/"&&(N="/"+N))}if(!b[z])for(var G=0,ee=a.length;G<ee;G++){var te=a[G];if(N.indexOf(te)===-1)continue;var ue=encodeURIComponent(te);ue===te&&(ue=escape(te)),N=N.split(te).join(ue)}var Oe=N.indexOf("#");Oe!==-1&&(this.hash=N.substr(Oe),N=N.slice(0,Oe));var le=N.indexOf("?");if(le!==-1?(this.search=N.substr(le),this.query=N.substr(le+1),M&&(this.query=n.parse(this.query)),N=N.slice(0,le)):M&&(this.search="",this.query={}),N&&(this.pathname=N),m[z]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ae=this.pathname||"",Q=this.search||"";this.path=ae+Q}return this.href=this.format(),this};function g(s){return u.isString(s)&&(s=d(s)),s instanceof S?s.format():S.prototype.format.call(s)}S.prototype.format=function(){var s=this.auth||"";s&&(s=encodeURIComponent(s),s=s.replace(/%3A/i,":"),s+="@");var M=this.protocol||"",A=this.pathname||"",x=this.hash||"",E=!1,w="";this.host?E=s+this.host:this.hostname&&(E=s+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(E+=":"+this.port)),this.query&&u.isObject(this.query)&&Object.keys(this.query).length&&(w=n.stringify(this.query));var _=this.search||w&&"?"+w||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||m[M])&&E!==!1?(E="//"+(E||""),A&&A.charAt(0)!=="/"&&(A="/"+A)):E||(E=""),x&&x.charAt(0)!=="#"&&(x="#"+x),_&&_.charAt(0)!=="?"&&(_="?"+_),A=A.replace(/[?#]/g,function(N){return encodeURIComponent(N)}),_=_.replace("#","%23"),M+E+A+_+x};function T(s,M){return d(s,!1,!0).resolve(M)}S.prototype.resolve=function(s){return this.resolveObject(d(s,!1,!0)).format()};function y(s,M){return s?d(s,!1,!0).resolveObject(M):M}S.prototype.resolveObject=function(s){if(u.isString(s)){var M=new S;M.parse(s,!1,!0),s=M}for(var A=new S,x=Object.keys(this),E=0;E<x.length;E++){var w=x[E];A[w]=this[w]}if(A.hash=s.hash,s.href==="")return A.href=A.format(),A;if(s.slashes&&!s.protocol){for(var _=Object.keys(s),N=0;N<_.length;N++){var j=_[N];j!=="protocol"&&(A[j]=s[j])}return m[A.protocol]&&A.hostname&&!A.pathname&&(A.path=A.pathname="/"),A.href=A.format(),A}if(s.protocol&&s.protocol!==A.protocol){if(!m[s.protocol]){for(var k=Object.keys(s),z=0;z<k.length;z++){var H=k[z];A[H]=s[H]}return A.href=A.format(),A}if(A.protocol=s.protocol,!s.host&&!v[s.protocol]){for(var ee=(s.pathname||"").split("/");ee.length&&!(s.host=ee.shift()););s.host||(s.host=""),s.hostname||(s.hostname=""),ee[0]!==""&&ee.unshift(""),ee.length<2&&ee.unshift(""),A.pathname=ee.join("/")}else A.pathname=s.pathname;if(A.search=s.search,A.query=s.query,A.host=s.host||"",A.auth=s.auth,A.hostname=s.hostname||s.host,A.port=s.port,A.pathname||A.search){var F=A.pathname||"",G=A.search||"";A.path=F+G}return A.slashes=A.slashes||s.slashes,A.href=A.format(),A}var B=A.pathname&&A.pathname.charAt(0)==="/",W=s.host||s.pathname&&s.pathname.charAt(0)==="/",K=W||B||A.host&&s.pathname,q=K,re=A.pathname&&A.pathname.split("/")||[],ee=s.pathname&&s.pathname.split("/")||[],Ce=A.protocol&&!m[A.protocol];if(Ce&&(A.hostname="",A.port=null,A.host&&(re[0]===""?re[0]=A.host:re.unshift(A.host)),A.host="",s.protocol&&(s.hostname=null,s.port=null,s.host&&(ee[0]===""?ee[0]=s.host:ee.unshift(s.host)),s.host=null),K=K&&(ee[0]===""||re[0]==="")),W)A.host=s.host||s.host===""?s.host:A.host,A.hostname=s.hostname||s.hostname===""?s.hostname:A.hostname,A.search=s.search,A.query=s.query,re=ee;else if(ee.length)re||(re=[]),re.pop(),re=re.concat(ee),A.search=s.search,A.query=s.query;else if(!u.isNullOrUndefined(s.search)){if(Ce){A.hostname=A.host=re.shift();var xe=A.host&&A.host.indexOf("@")>0?A.host.split("@"):!1;xe&&(A.auth=xe.shift(),A.host=A.hostname=xe.shift())}return A.search=s.search,A.query=s.query,(!u.isNull(A.pathname)||!u.isNull(A.search))&&(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.href=A.format(),A}if(!re.length)return A.pathname=null,A.search?A.path="/"+A.search:A.path=null,A.href=A.format(),A;for(var he=re.slice(-1)[0],ke=(A.host||s.host||re.length>1)&&(he==="."||he==="..")||he==="",_e=0,de=re.length;de>=0;de--)he=re[de],he==="."?re.splice(de,1):he===".."?(re.splice(de,1),_e++):_e&&(re.splice(de,1),_e--);if(!K&&!q)for(;_e--;_e)re.unshift("..");K&&re[0]!==""&&(!re[0]||re[0].charAt(0)!=="/")&&re.unshift(""),ke&&re.join("/").substr(-1)!=="/"&&re.push("");var ce=re[0]===""||re[0]&&re[0].charAt(0)==="/";if(Ce){A.hostname=A.host=ce?"":re.length?re.shift():"";var xe=A.host&&A.host.indexOf("@")>0?A.host.split("@"):!1;xe&&(A.auth=xe.shift(),A.host=A.hostname=xe.shift())}return K=K||A.host&&re.length,K&&!ce&&re.unshift(""),re.length?A.pathname=re.join("/"):(A.pathname=null,A.path=null),(!u.isNull(A.pathname)||!u.isNull(A.search))&&(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.auth=s.auth||A.auth,A.slashes=A.slashes||s.slashes,A.href=A.format(),A},S.prototype.parseHost=function(){var s=this.host,M=h.exec(s);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),s=s.substr(0,s.length-M.length)),s&&(this.hostname=s)}},{"./util":239,punycode:209,querystring:212}],239:[function(I,J,P){"use strict";J.exports={isString:function(L){return typeof L=="string"},isObject:function(L){return typeof L=="object"&&L!==null},isNull:function(L){return L===null},isNullOrUndefined:function(L){return L==null}}},{}],240:[function(I,J,P){(function(L){J.exports=u;function u(R,h){if(S("noDeprecation"))return R;var o=!1;function C(){if(!o){if(S("throwDeprecation"))throw new Error(h);S("traceDeprecation")?console.trace(h):console.warn(h),o=!0}return R.apply(this,arguments)}return C}function S(R){try{if(!L.localStorage)return!1}catch(o){return!1}var h=L.localStorage[R];return h==null?!1:String(h).toLowerCase()==="true"}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],241:[function(I,J,P){typeof Object.create=="function"?J.exports=function(u,S){u.super_=S,u.prototype=Object.create(S.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}})}:J.exports=function(u,S){u.super_=S;var R=function(){};R.prototype=S.prototype,u.prototype=new R,u.prototype.constructor=u}},{}],242:[function(I,J,P){J.exports=function(u){return u&&typeof u=="object"&&typeof u.copy=="function"&&typeof u.fill=="function"&&typeof u.readUInt8=="function"}},{}],243:[function(I,J,P){(function(L,u){var S=/%[sdj%]/g;P.format=function(F){if(!T(F)){for(var G=[],B=0;B<arguments.length;B++)G.push(o(arguments[B]));return G.join(" ")}for(var B=1,W=arguments,K=W.length,q=String(F).replace(S,function(ee){if(ee==="%%")return"%";if(B>=K)return ee;switch(ee){case"%s":return String(W[B++]);case"%d":return Number(W[B++]);case"%j":try{return JSON.stringify(W[B++])}catch(Ce){return"[Circular]"}default:return ee}}),re=W[B];B<K;re=W[++B])n(re)||!A(re)?q+=" "+re:q+=" "+o(re);return q},P.deprecate=function(F,G){if(s(u.process))return function(){return P.deprecate(F,G).apply(this,arguments)};if(L.noDeprecation===!0)return F;var B=!1;function W(){if(!B){if(L.throwDeprecation)throw new Error(G);L.traceDeprecation?console.trace(G):console.error(G),B=!0}return F.apply(this,arguments)}return W};var R={},h;P.debuglog=function(F){if(s(h)&&(h=L.env.NODE_DEBUG||""),F=F.toUpperCase(),!R[F])if(new RegExp("\\b"+F+"\\b","i").test(h)){var G=L.pid;R[F]=function(){var B=P.format.apply(P,arguments);console.error("%s %d: %s",F,G,B)}}else R[F]=function(){};return R[F]};function o(F,G){var B={seen:[],stylize:c};return arguments.length>=3&&(B.depth=arguments[2]),arguments.length>=4&&(B.colors=arguments[3]),m(G)?B.showHidden=G:G&&P._extend(B,G),s(B.showHidden)&&(B.showHidden=!1),s(B.depth)&&(B.depth=2),s(B.colors)&&(B.colors=!1),s(B.customInspect)&&(B.customInspect=!0),B.colors&&(B.stylize=C),i(B,F,B.depth)}P.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function C(F,G){var B=o.styles[G];return B?"["+o.colors[B][0]+"m"+F+"["+o.colors[B][1]+"m":F}function c(F,G){return F}function a(F){var G={};return F.forEach(function(B,W){G[B]=!0}),G}function i(F,G,B){if(F.customInspect&&G&&w(G.inspect)&&G.inspect!==P.inspect&&!(G.constructor&&G.constructor.prototype===G)){var W=G.inspect(B,F);return T(W)||(W=i(F,W,B)),W}var K=r(F,G);if(K)return K;var q=Object.keys(G),re=a(q);if(F.showHidden&&(q=Object.getOwnPropertyNames(G)),E(G)&&(q.indexOf("message")>=0||q.indexOf("description")>=0))return l(G);if(q.length===0){if(w(G)){var ee=G.name?": "+G.name:"";return F.stylize("[Function"+ee+"]","special")}if(M(G))return F.stylize(RegExp.prototype.toString.call(G),"regexp");if(x(G))return F.stylize(Date.prototype.toString.call(G),"date");if(E(G))return l(G)}var Ce="",xe=!1,he=["{","}"];if(v(G)&&(xe=!0,he=["[","]"]),w(G)){var ke=G.name?": "+G.name:"";Ce=" [Function"+ke+"]"}if(M(G)&&(Ce=" "+RegExp.prototype.toString.call(G)),x(G)&&(Ce=" "+Date.prototype.toUTCString.call(G)),E(G)&&(Ce=" "+l(G)),q.length===0&&(!xe||G.length==0))return he[0]+Ce+he[1];if(B<0)return M(G)?F.stylize(RegExp.prototype.toString.call(G),"regexp"):F.stylize("[Object]","special");F.seen.push(G);var _e;return xe?_e=p(F,G,B,re,q):_e=q.map(function(de){return f(F,G,B,re,de,xe)}),F.seen.pop(),b(_e,Ce,he)}function r(F,G){if(s(G))return F.stylize("undefined","undefined");if(T(G)){var B="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return F.stylize(B,"string")}if(g(G))return F.stylize(""+G,"number");if(m(G))return F.stylize(""+G,"boolean");if(n(G))return F.stylize("null","null")}function l(F){return"["+Error.prototype.toString.call(F)+"]"}function p(F,G,B,W,K){for(var q=[],re=0,ee=G.length;re<ee;++re)H(G,String(re))?q.push(f(F,G,B,W,String(re),!0)):q.push("");return K.forEach(function(Ce){Ce.match(/^\d+$/)||q.push(f(F,G,B,W,Ce,!0))}),q}function f(F,G,B,W,K,q){var re,ee,Ce;if(Ce=Object.getOwnPropertyDescriptor(G,K)||{value:G[K]},Ce.get?Ce.set?ee=F.stylize("[Getter/Setter]","special"):ee=F.stylize("[Getter]","special"):Ce.set&&(ee=F.stylize("[Setter]","special")),H(W,K)||(re="["+K+"]"),ee||(F.seen.indexOf(Ce.value)<0?(n(B)?ee=i(F,Ce.value,null):ee=i(F,Ce.value,B-1),ee.indexOf(`
|
|
|
`)>-1&&(q?ee=ee.split(`
|
|
|
`).map(function(xe){return" "+xe}).join(`
|
|
|
`).substr(2):ee=`
|
|
|
`+ee.split(`
|
|
|
`).map(function(xe){return" "+xe}).join(`
|
|
|
`))):ee=F.stylize("[Circular]","special")),s(re)){if(q&&K.match(/^\d+$/))return ee;re=JSON.stringify(""+K),re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(re=re.substr(1,re.length-2),re=F.stylize(re,"name")):(re=re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),re=F.stylize(re,"string"))}return re+": "+ee}function b(F,G,B){var W=0,K=F.reduce(function(q,re){return W++,re.indexOf(`
|
|
|
`)>=0&&W++,q+re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return K>60?B[0]+(G===""?"":G+`
|
|
|
`)+" "+F.join(`,
|
|
|
`)+" "+B[1]:B[0]+G+" "+F.join(", ")+" "+B[1]}function v(F){return Array.isArray(F)}P.isArray=v;function m(F){return typeof F=="boolean"}P.isBoolean=m;function n(F){return F===null}P.isNull=n;function d(F){return F==null}P.isNullOrUndefined=d;function g(F){return typeof F=="number"}P.isNumber=g;function T(F){return typeof F=="string"}P.isString=T;function y(F){return typeof F=="symbol"}P.isSymbol=y;function s(F){return F===void 0}P.isUndefined=s;function M(F){return A(F)&&N(F)==="[object RegExp]"}P.isRegExp=M;function A(F){return typeof F=="object"&&F!==null}P.isObject=A;function x(F){return A(F)&&N(F)==="[object Date]"}P.isDate=x;function E(F){return A(F)&&(N(F)==="[object Error]"||F instanceof Error)}P.isError=E;function w(F){return typeof F=="function"}P.isFunction=w;function _(F){return F===null||typeof F=="boolean"||typeof F=="number"||typeof F=="string"||typeof F=="symbol"||typeof F=="undefined"}P.isPrimitive=_,P.isBuffer=I("./support/isBuffer");function N(F){return Object.prototype.toString.call(F)}function j(F){return F<10?"0"+F.toString(10):F.toString(10)}var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function z(){var F=new Date,G=[j(F.getHours()),j(F.getMinutes()),j(F.getSeconds())].join(":");return[F.getDate(),k[F.getMonth()],G].join(" ")}P.log=function(){console.log("%s - %s",z(),P.format.apply(P,arguments))},P.inherits=I("inherits"),P._extend=function(F,G){if(!G||!A(G))return F;for(var B=Object.keys(G),W=B.length;W--;)F[B[W]]=G[B[W]];return F};function H(F,G){return Object.prototype.hasOwnProperty.call(F,G)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":242,_process:208,inherits:241}],244:[function(I,J,P){"use strict";(function(){"use strict";P.stripBOM=function(L){return L[0]==="\uFEFF"?L.substring(1):L}}).call(void 0)},{}],245:[function(I,J,P){"use strict";var L=I("babel-runtime/helpers/typeof"),u=h(L),S=I("babel-runtime/core-js/object/keys"),R=h(S);function h(o){return o&&o.__esModule?o:{default:o}}(function(){"use strict";var o,C,c,a,i,r={}.hasOwnProperty;o=I("xmlbuilder"),C=I("./defaults").defaults,a=function(p){return typeof p=="string"&&(p.indexOf("&")>=0||p.indexOf(">")>=0||p.indexOf("<")>=0)},i=function(p){return"<![CDATA["+c(p)+"]]>"},c=function(p){return p.replace("]]>","]]]]><![CDATA[>")},P.Builder=function(){function l(p){var f,b,v;this.options={},b=C["0.2"];for(f in b){if(!r.call(b,f))continue;v=b[f],this.options[f]=v}for(f in p){if(!r.call(p,f))continue;v=p[f],this.options[f]=v}}return l.prototype.buildObject=function(p){var f,b,v,m,n;return f=this.options.attrkey,b=this.options.charkey,(0,R.default)(p).length===1&&this.options.rootName===C["0.2"].rootName?(n=(0,R.default)(p)[0],p=p[n]):n=this.options.rootName,v=function(d){return function(g,T){var y,s,M,A,x,E;if((typeof T=="undefined"?"undefined":(0,u.default)(T))!=="object")d.options.cdata&&a(T)?g.raw(i(T)):g.txt(T);else if(Array.isArray(T))for(A in T){if(!r.call(T,A))continue;s=T[A];for(x in s)M=s[x],g=v(g.ele(x),M).up()}else for(x in T){if(!r.call(T,x))continue;if(s=T[x],x===f){if((typeof s=="undefined"?"undefined":(0,u.default)(s))==="object")for(y in s)E=s[y],g=g.att(y,E)}else if(x===b)d.options.cdata&&a(s)?g=g.raw(i(s)):g=g.txt(s);else if(Array.isArray(s))for(A in s){if(!r.call(s,A))continue;M=s[A],typeof M=="string"?d.options.cdata&&a(M)?g=g.ele(x).raw(i(M)).up():g=g.ele(x,M).up():g=v(g.ele(x),M).up()}else(typeof s=="undefined"?"undefined":(0,u.default)(s))==="object"?g=v(g.ele(x),s).up():typeof s=="string"&&d.options.cdata&&a(s)?g=g.ele(x).raw(i(s)).up():(s==null&&(s=""),g=g.ele(x,s.toString()).up())}return g}}(this),m=o.create(n,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),v(m,p).end(this.options.renderOpts)},l}()}).call(void 0)},{"./defaults":246,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,xmlbuilder:282}],246:[function(I,J,P){"use strict";(function(){P.defaults={"0.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:""},"0.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)},{}],247:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/promise"),u=a(L),S=I("babel-runtime/core-js/object/get-own-property-names"),R=a(S),h=I("babel-runtime/core-js/object/keys"),o=a(h),C=I("babel-runtime/helpers/typeof"),c=a(C);function a(i){return i&&i.__esModule?i:{default:i}}(function(){"use strict";var i,r,l,p,f,b,v,m,n=function(y,s){return function(){return y.apply(s,arguments)}},d=function(y,s){for(var M in s)g.call(s,M)&&(y[M]=s[M]);function A(){this.constructor=y}return A.prototype=s.prototype,y.prototype=new A,y.__super__=s.prototype,y},g={}.hasOwnProperty;v=I("sax"),l=I("events"),i=I("./bom"),b=I("./processors"),m=I("timers").setImmediate,r=I("./defaults").defaults,p=function(y){return(typeof y=="undefined"?"undefined":(0,c.default)(y))==="object"&&y!=null&&(0,o.default)(y).length===0},f=function(y,s,M){var A,x,E;for(A=0,x=y.length;A<x;A++)E=y[A],s=E(s,M);return s},P.Parser=function(T){d(y,T);function y(s){this.parseStringPromise=n(this.parseStringPromise,this),this.parseString=n(this.parseString,this),this.reset=n(this.reset,this),this.assignOrPush=n(this.assignOrPush,this),this.processAsync=n(this.processAsync,this);var M,A,x;if(!(this instanceof P.Parser))return new P.Parser(s);this.options={},A=r["0.2"];for(M in A){if(!g.call(A,M))continue;x=A[M],this.options[M]=x}for(M in s){if(!g.call(s,M))continue;x=s[M],this.options[M]=x}this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(b.normalize)),this.reset()}return y.prototype.processAsync=function(){var s,M;try{return this.remaining.length<=this.options.chunkSize?(s=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(s),this.saxParser.close()):(s=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(s),m(this.processAsync))}catch(A){if(M=A,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(M)}},y.prototype.assignOrPush=function(s,M,A){return M in s?(s[M]instanceof Array||(s[M]=[s[M]]),s[M].push(A)):this.options.explicitArray?s[M]=[A]:s[M]=A},y.prototype.reset=function(){var s,M,A,x;return this.removeAllListeners(),this.saxParser=v.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(E){return function(w){if(E.saxParser.resume(),!E.saxParser.errThrown)return E.saxParser.errThrown=!0,E.emit("error",w)}}(this),this.saxParser.onend=function(E){return function(){if(!E.saxParser.ended)return E.saxParser.ended=!0,E.emit("end",E.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,x=[],s=this.options.attrkey,M=this.options.charkey,this.saxParser.onopentag=function(E){return function(w){var _,N,j,k,z;if(j={},j[M]="",!E.options.ignoreAttrs){z=w.attributes;for(_ in z){if(!g.call(z,_))continue;!(s in j)&&!E.options.mergeAttrs&&(j[s]={}),N=E.options.attrValueProcessors?f(E.options.attrValueProcessors,w.attributes[_],_):w.attributes[_],k=E.options.attrNameProcessors?f(E.options.attrNameProcessors,_):_,E.options.mergeAttrs?E.assignOrPush(j,k,N):j[s][k]=N}}return j["#name"]=E.options.tagNameProcessors?f(E.options.tagNameProcessors,w.name):w.name,E.options.xmlns&&(j[E.options.xmlnskey]={uri:w.uri,local:w.local}),x.push(j)}}(this),this.saxParser.onclosetag=function(E){return function(){var w,_,N,j,k,z,H,F,G,B;if(z=x.pop(),k=z["#name"],(!E.options.explicitChildren||!E.options.preserveChildrenOrder)&&delete z["#name"],z.cdata===!0&&(w=z.cdata,delete z.cdata),G=x[x.length-1],z[M].match(/^\s*$/)&&!w?(_=z[M],delete z[M]):(E.options.trim&&(z[M]=z[M].trim()),E.options.normalize&&(z[M]=z[M].replace(/\s{2,}/g," ").trim()),z[M]=E.options.valueProcessors?f(E.options.valueProcessors,z[M],k):z[M],(0,o.default)(z).length===1&&M in z&&!E.EXPLICIT_CHARKEY&&(z=z[M])),p(z)&&(z=E.options.emptyTag!==""?E.options.emptyTag:_),E.options.validator!=null&&(B="/"+function(){var W,K,q;for(q=[],W=0,K=x.length;W<K;W++)j=x[W],q.push(j["#name"]);return q}().concat(k).join("/"),function(){var W;try{return z=E.options.validator(B,G&&G[k],z)}catch(K){return W=K,E.emit("error",W)}}()),E.options.explicitChildren&&!E.options.mergeAttrs&&(typeof z=="undefined"?"undefined":(0,c.default)(z))==="object"){if(!E.options.preserveChildrenOrder)j={},E.options.attrkey in z&&(j[E.options.attrkey]=z[E.options.attrkey],delete z[E.options.attrkey]),!E.options.charsAsChildren&&E.options.charkey in z&&(j[E.options.charkey]=z[E.options.charkey],delete z[E.options.charkey]),(0,R.default)(z).length>0&&(j[E.options.childkey]=z),z=j;else if(G){G[E.options.childkey]=G[E.options.childkey]||[],H={};for(N in z){if(!g.call(z,N))continue;H[N]=z[N]}G[E.options.childkey].push(H),delete z["#name"],(0,o.default)(z).length===1&&M in z&&!E.EXPLICIT_CHARKEY&&(z=z[M])}}return x.length>0?E.assignOrPush(G,k,z):(E.options.explicitRoot&&(F=z,z={},z[k]=F),E.resultObject=z,E.saxParser.ended=!0,E.emit("end",E.resultObject))}}(this),A=function(E){return function(w){var _,N;if(N=x[x.length-1],N)return N[M]+=w,E.options.explicitChildren&&E.options.preserveChildrenOrder&&E.options.charsAsChildren&&(E.options.includeWhiteChars||w.replace(/\\n/g,"").trim()!=="")&&(N[E.options.childkey]=N[E.options.childkey]||[],_={"#name":"__text__"},_[M]=w,E.options.normalize&&(_[M]=_[M].replace(/\s{2,}/g," ").trim()),N[E.options.childkey].push(_)),N}}(this),this.saxParser.ontext=A,this.saxParser.oncdata=function(E){return function(w){var _;if(_=A(w),_)return _.cdata=!0}}(this)},y.prototype.parseString=function(s,M){var A;M!=null&&typeof M=="function"&&(this.on("end",function(x){return this.reset(),M(null,x)}),this.on("error",function(x){return this.reset(),M(x)}));try{return s=s.toString(),s.trim()===""?(this.emit("end",null),!0):(s=i.stripBOM(s),this.options.async?(this.remaining=s,m(this.processAsync),this.saxParser):this.saxParser.write(s).close())}catch(x){if(A=x,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw A}else return this.emit("error",A),this.saxParser.errThrown=!0}},y.prototype.parseStringPromise=function(s){return new u.default(function(M){return function(A,x){return M.parseString(s,function(E,w){return E?x(E):A(w)})}}(this))},y}(l),P.parseString=function(T,y,s){var M,A,x;return s!=null?(typeof s=="function"&&(M=s),(typeof y=="undefined"?"undefined":(0,c.default)(y))==="object"&&(A=y)):(typeof y=="function"&&(M=y),A={}),x=new P.Parser(A),x.parseString(T,M)},P.parseStringPromise=function(T,y){var s,M;return(typeof y=="undefined"?"undefined":(0,c.default)(y))==="object"&&(s=y),M=new P.Parser(s),M.parseStringPromise(T)}}).call(void 0)},{"./bom":244,"./defaults":246,"./processors":248,"babel-runtime/core-js/object/get-own-property-names":58,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/helpers/typeof":67,events:192,sax:229,timers:236}],248:[function(I,J,P){"use strict";(function(){"use strict";var L;L=new RegExp(/(?!xmlns)^.*:/),P.normalize=function(u){return u.toLowerCase()},P.firstCharLowerCase=function(u){return u.charAt(0).toLowerCase()+u.slice(1)},P.stripPrefix=function(u){return u.replace(L,"")},P.parseNumbers=function(u){return isNaN(u)||(u=u%1===0?parseInt(u,10):parseFloat(u)),u},P.parseBooleans=function(u){return/^(?:true|false)$/i.test(u)&&(u=u.toLowerCase()==="true"),u}}).call(void 0)},{}],249:[function(I,J,P){"use strict";(function(){"use strict";var L,u,S,R,h=function(c,a){for(var i in a)o.call(a,i)&&(c[i]=a[i]);function r(){this.constructor=c}return r.prototype=a.prototype,c.prototype=new r,c.__super__=a.prototype,c},o={}.hasOwnProperty;u=I("./defaults"),L=I("./builder"),S=I("./parser"),R=I("./processors"),P.defaults=u.defaults,P.processors=R,P.ValidationError=function(C){h(c,C);function c(a){this.message=a}return c}(Error),P.Builder=L.Builder,P.Parser=S.Parser,P.parseString=S.parseString,P.parseStringPromise=S.parseStringPromise}).call(void 0)},{"./builder":245,"./defaults":246,"./parser":247,"./processors":248}],250:[function(I,J,P){"use strict";(function(){J.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(void 0)},{}],251:[function(I,J,P){"use strict";(function(){J.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(void 0)},{}],252:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/get-prototype-of"),u=C(L),S=I("babel-runtime/helpers/typeof"),R=C(S),h=I("babel-runtime/core-js/object/assign"),o=C(h);function C(c){return c&&c.__esModule?c:{default:c}}(function(){var c,a,i,r,l,p,f,b=[].slice,v={}.hasOwnProperty;c=function(){var n,d,g,T,y,s;if(s=arguments[0],y=2<=arguments.length?b.call(arguments,1):[],l(o.default))o.default.apply(null,arguments);else for(n=0,g=y.length;n<g;n++)if(T=y[n],T!=null)for(d in T){if(!v.call(T,d))continue;s[d]=T[d]}return s},l=function(n){return!!n&&Object.prototype.toString.call(n)==="[object Function]"},p=function(n){var d;return!!n&&((d=typeof n=="undefined"?"undefined":(0,R.default)(n))==="function"||d==="object")},i=function(n){return l(Array.isArray)?Array.isArray(n):Object.prototype.toString.call(n)==="[object Array]"},r=function(n){var d;if(i(n))return!n.length;for(d in n){if(!v.call(n,d))continue;return!1}return!0},f=function(n){var d,g;return p(n)&&(g=(0,u.default)(n))&&(d=g.constructor)&&typeof d=="function"&&d instanceof d&&Function.prototype.toString.call(d)===Function.prototype.toString.call(Object)},a=function(n){return l(n.valueOf)?n.valueOf():n},J.exports.assign=c,J.exports.isFunction=l,J.exports.isObject=p,J.exports.isArray=i,J.exports.isEmpty=r,J.exports.isPlainObject=f,J.exports.getValue=a}).call(void 0)},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/get-prototype-of":59,"babel-runtime/helpers/typeof":67}],253:[function(I,J,P){"use strict";(function(){J.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(void 0)},{}],254:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o;R=I("./NodeType"),o=I("./XMLNode"),J.exports=h=function(){function C(c,a,i){if(this.parent=c,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),a==null)throw new Error("Missing attribute name. "+this.debugInfo(a));this.name=this.stringify.name(a),this.value=this.stringify.attValue(i),this.type=R.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(C.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(C.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(C.prototype,"textContent",{get:function(){return this.value},set:function(a){return this.value=a||""}}),Object.defineProperty(C.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(C.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(C.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(C.prototype,"specified",{get:function(){return!0}}),C.prototype.clone=function(){return(0,u.default)(this)},C.prototype.toString=function(c){return this.options.writer.attribute(this,this.options.writer.filterOptions(c))},C.prototype.debugInfo=function(c){return c=c||this.name,c==null?"parent: <"+this.parent.name+">":"attribute: {"+c+"}, parent: <"+this.parent.name+">"},C.prototype.isEqualNode=function(c){return c.namespaceURI!==this.namespaceURI||(c.prefix!==this.prefix||c.localName!==this.localName)?!1:!(c.value!==this.value)},C}()}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],255:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o,C=function(i,r){for(var l in r)c.call(r,l)&&(i[l]=r[l]);function p(){this.constructor=i}return p.prototype=r.prototype,i.prototype=new p,i.__super__=r.prototype,i},c={}.hasOwnProperty;R=I("./NodeType"),o=I("./XMLCharacterData"),J.exports=h=function(a){C(i,a);function i(r,l){if(i.__super__.constructor.call(this,r),l==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=R.CData,this.value=this.stringify.cdata(l)}return i.prototype.clone=function(){return(0,u.default)(this)},i.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},i}(o)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],256:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o=function(a,i){for(var r in i)C.call(i,r)&&(a[r]=i[r]);function l(){this.constructor=a}return l.prototype=i.prototype,a.prototype=new l,a.__super__=i.prototype,a},C={}.hasOwnProperty;h=I("./XMLNode"),J.exports=R=function(c){o(a,c);function a(i){a.__super__.constructor.call(this,i),this.value=""}return Object.defineProperty(a.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}}),Object.defineProperty(a.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(a.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}}),a.prototype.clone=function(){return(0,u.default)(this)},a.prototype.substringData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.appendData=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.insertData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.deleteData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceData=function(i,r,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.isEqualNode=function(i){return a.__super__.isEqualNode.apply(this,arguments).isEqualNode(i)?!(i.data!==this.data):!1},a}(h)}).call(void 0)},{"./XMLNode":273,"babel-runtime/core-js/object/create":55}],257:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o,C=function(i,r){for(var l in r)c.call(r,l)&&(i[l]=r[l]);function p(){this.constructor=i}return p.prototype=r.prototype,i.prototype=new p,i.__super__=r.prototype,i},c={}.hasOwnProperty;R=I("./NodeType"),h=I("./XMLCharacterData"),J.exports=o=function(a){C(i,a);function i(r,l){if(i.__super__.constructor.call(this,r),l==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=R.Comment,this.value=this.stringify.comment(l)}return i.prototype.clone=function(){return(0,u.default)(this)},i.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},i}(h)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],258:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/keys"),u=h(L),S=I("babel-runtime/core-js/object/create"),R=h(S);function h(o){return o&&o.__esModule?o:{default:o}}(function(){var o,C,c;C=I("./XMLDOMErrorHandler"),c=I("./XMLDOMStringList"),J.exports=o=function(){function a(){var i;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new C,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=i=(0,R.default)(this.defaultParams)}return Object.defineProperty(a.prototype,"parameterNames",{get:function(){return new c((0,u.default)(this.defaultParams))}}),a.prototype.getParameter=function(i){return this.params.hasOwnProperty(i)?this.params[i]:null},a.prototype.canSetParameter=function(i,r){return!0},a.prototype.setParameter=function(i,r){return r!=null?this.params[i]=r:delete this.params[i]},a}()}).call(void 0)},{"./XMLDOMErrorHandler":259,"./XMLDOMStringList":261,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60}],259:[function(I,J,P){"use strict";(function(){var L;J.exports=L=function(){function u(){}return u.prototype.handleError=function(S){throw new Error(S)},u}()}).call(void 0)},{}],260:[function(I,J,P){"use strict";(function(){var L;J.exports=L=function(){function u(){}return u.prototype.hasFeature=function(S,R){return!0},u.prototype.createDocumentType=function(S,R,h){throw new Error("This DOM method is not implemented.")},u.prototype.createDocument=function(S,R,h){throw new Error("This DOM method is not implemented.")},u.prototype.createHTMLDocument=function(S){throw new Error("This DOM method is not implemented.")},u.prototype.getFeature=function(S,R){throw new Error("This DOM method is not implemented.")},u}()}).call(void 0)},{}],261:[function(I,J,P){"use strict";(function(){var L;J.exports=L=function(){function u(S){this.arr=S||[]}return Object.defineProperty(u.prototype,"length",{get:function(){return this.arr.length}}),u.prototype.item=function(S){return this.arr[S]||null},u.prototype.contains=function(S){return this.arr.indexOf(S)!==-1},u}()}).call(void 0)},{}],262:[function(I,J,P){"use strict";(function(){var L,u,S,R=function(C,c){for(var a in c)h.call(c,a)&&(C[a]=c[a]);function i(){this.constructor=C}return i.prototype=c.prototype,C.prototype=new i,C.__super__=c.prototype,C},h={}.hasOwnProperty;S=I("./XMLNode"),L=I("./NodeType"),J.exports=u=function(o){R(C,o);function C(c,a,i,r,l,p){if(C.__super__.constructor.call(this,c),a==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(i==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(a));if(!r)throw new Error("Missing DTD attribute type. "+this.debugInfo(a));if(!l)throw new Error("Missing DTD attribute default. "+this.debugInfo(a));if(l.indexOf("#")!==0&&(l="#"+l),!l.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(a));if(p&&!l.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(a));this.elementName=this.stringify.name(a),this.type=L.AttributeDeclaration,this.attributeName=this.stringify.name(i),this.attributeType=this.stringify.dtdAttType(r),p&&(this.defaultValue=this.stringify.dtdAttDefault(p)),this.defaultValueType=l}return C.prototype.toString=function(c){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(c))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],263:[function(I,J,P){"use strict";(function(){var L,u,S,R=function(C,c){for(var a in c)h.call(c,a)&&(C[a]=c[a]);function i(){this.constructor=C}return i.prototype=c.prototype,C.prototype=new i,C.__super__=c.prototype,C},h={}.hasOwnProperty;S=I("./XMLNode"),L=I("./NodeType"),J.exports=u=function(o){R(C,o);function C(c,a,i){if(C.__super__.constructor.call(this,c),a==null)throw new Error("Missing DTD element name. "+this.debugInfo());i||(i="(#PCDATA)"),Array.isArray(i)&&(i="("+i.join(",")+")"),this.name=this.stringify.name(a),this.type=L.ElementDeclaration,this.value=this.stringify.dtdElementValue(i)}return C.prototype.toString=function(c){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(c))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],264:[function(I,J,P){"use strict";(function(){var L,u,S,R,h=function(c,a){for(var i in a)o.call(a,i)&&(c[i]=a[i]);function r(){this.constructor=c}return r.prototype=a.prototype,c.prototype=new r,c.__super__=a.prototype,c},o={}.hasOwnProperty;R=I("./Utility").isObject,S=I("./XMLNode"),L=I("./NodeType"),J.exports=u=function(C){h(c,C);function c(a,i,r,l){if(c.__super__.constructor.call(this,a),r==null)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(l==null)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!i,this.name=this.stringify.name(r),this.type=L.EntityDeclaration,!R(l))this.value=this.stringify.dtdEntityValue(l),this.internal=!0;else{if(!l.pubID&&!l.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(l.pubID&&!l.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(this.internal=!1,l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID)),l.nData!=null&&(this.nData=this.stringify.dtdNData(l.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}}return Object.defineProperty(c.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(c.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(c.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(c.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(c.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(c.prototype,"xmlVersion",{get:function(){return null}}),c.prototype.toString=function(a){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(a))},c}(S)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],265:[function(I,J,P){"use strict";(function(){var L,u,S,R=function(C,c){for(var a in c)h.call(c,a)&&(C[a]=c[a]);function i(){this.constructor=C}return i.prototype=c.prototype,C.prototype=new i,C.__super__=c.prototype,C},h={}.hasOwnProperty;S=I("./XMLNode"),L=I("./NodeType"),J.exports=u=function(o){R(C,o);function C(c,a,i){if(C.__super__.constructor.call(this,c),a==null)throw new Error("Missing DTD notation name. "+this.debugInfo(a));if(!i.pubID&&!i.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(a));this.name=this.stringify.name(a),this.type=L.NotationDeclaration,i.pubID!=null&&(this.pubID=this.stringify.dtdPubID(i.pubID)),i.sysID!=null&&(this.sysID=this.stringify.dtdSysID(i.sysID))}return Object.defineProperty(C.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(C.prototype,"systemId",{get:function(){return this.sysID}}),C.prototype.toString=function(c){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(c))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],266:[function(I,J,P){"use strict";(function(){var L,u,S,R,h=function(c,a){for(var i in a)o.call(a,i)&&(c[i]=a[i]);function r(){this.constructor=c}return r.prototype=a.prototype,c.prototype=new r,c.__super__=a.prototype,c},o={}.hasOwnProperty;R=I("./Utility").isObject,S=I("./XMLNode"),L=I("./NodeType"),J.exports=u=function(C){h(c,C);function c(a,i,r,l){var p;c.__super__.constructor.call(this,a),R(i)&&(p=i,i=p.version,r=p.encoding,l=p.standalone),i||(i="1.0"),this.type=L.Declaration,this.version=this.stringify.xmlVersion(i),r!=null&&(this.encoding=this.stringify.xmlEncoding(r)),l!=null&&(this.standalone=this.stringify.xmlStandalone(l))}return c.prototype.toString=function(a){return this.options.writer.declaration(this,this.options.writer.filterOptions(a))},c}(S)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],267:[function(I,J,P){"use strict";(function(){var L,u,S,R,h,o,C,c,a,i=function(p,f){for(var b in f)r.call(f,b)&&(p[b]=f[b]);function v(){this.constructor=p}return v.prototype=f.prototype,p.prototype=new v,p.__super__=f.prototype,p},r={}.hasOwnProperty;a=I("./Utility").isObject,c=I("./XMLNode"),L=I("./NodeType"),u=I("./XMLDTDAttList"),R=I("./XMLDTDEntity"),S=I("./XMLDTDElement"),h=I("./XMLDTDNotation"),C=I("./XMLNamedNodeMap"),J.exports=o=function(l){i(p,l);function p(f,b,v){var m,n,d,g,T,y;if(p.__super__.constructor.call(this,f),this.type=L.DocType,f.children){for(g=f.children,n=0,d=g.length;n<d;n++)if(m=g[n],m.type===L.Element){this.name=m.name;break}}this.documentObject=f,a(b)&&(T=b,b=T.pubID,v=T.sysID),v==null&&(y=[b,v],v=y[0],b=y[1]),b!=null&&(this.pubID=this.stringify.dtdPubID(b)),v!=null&&(this.sysID=this.stringify.dtdSysID(v))}return Object.defineProperty(p.prototype,"entities",{get:function(){var b,v,m,n,d;for(n={},d=this.children,v=0,m=d.length;v<m;v++)b=d[v],b.type===L.EntityDeclaration&&!b.pe&&(n[b.name]=b);return new C(n)}}),Object.defineProperty(p.prototype,"notations",{get:function(){var b,v,m,n,d;for(n={},d=this.children,v=0,m=d.length;v<m;v++)b=d[v],b.type===L.NotationDeclaration&&(n[b.name]=b);return new C(n)}}),Object.defineProperty(p.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(p.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(p.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),p.prototype.element=function(f,b){var v;return v=new S(this,f,b),this.children.push(v),this},p.prototype.attList=function(f,b,v,m,n){var d;return d=new u(this,f,b,v,m,n),this.children.push(d),this},p.prototype.entity=function(f,b){var v;return v=new R(this,!1,f,b),this.children.push(v),this},p.prototype.pEntity=function(f,b){var v;return v=new R(this,!0,f,b),this.children.push(v),this},p.prototype.notation=function(f,b){var v;return v=new h(this,f,b),this.children.push(v),this},p.prototype.toString=function(f){return this.options.writer.docType(this,this.options.writer.filterOptions(f))},p.prototype.ele=function(f,b){return this.element(f,b)},p.prototype.att=function(f,b,v,m,n){return this.attList(f,b,v,m,n)},p.prototype.ent=function(f,b){return this.entity(f,b)},p.prototype.pent=function(f,b){return this.pEntity(f,b)},p.prototype.not=function(f,b){return this.notation(f,b)},p.prototype.up=function(){return this.root()||this.documentObject},p.prototype.isEqualNode=function(f){return p.__super__.isEqualNode.apply(this,arguments).isEqualNode(f)?f.name!==this.name||f.publicId!==this.publicId?!1:!(f.systemId!==this.systemId):!1},p}(c)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLNamedNodeMap":272,"./XMLNode":273}],268:[function(I,J,P){"use strict";(function(){var L,u,S,R,h,o,C,c,a=function(l,p){for(var f in p)i.call(p,f)&&(l[f]=p[f]);function b(){this.constructor=l}return b.prototype=p.prototype,l.prototype=new b,l.__super__=p.prototype,l},i={}.hasOwnProperty;c=I("./Utility").isPlainObject,S=I("./XMLDOMImplementation"),u=I("./XMLDOMConfiguration"),h=I("./XMLNode"),L=I("./NodeType"),C=I("./XMLStringifier"),o=I("./XMLStringWriter"),J.exports=R=function(r){a(l,r);function l(p){l.__super__.constructor.call(this,null),this.name="#document",this.type=L.Document,this.documentURI=null,this.domConfig=new u,p||(p={}),p.writer||(p.writer=new o),this.options=p,this.stringify=new C(p)}return Object.defineProperty(l.prototype,"implementation",{value:new S}),Object.defineProperty(l.prototype,"doctype",{get:function(){var f,b,v,m;for(m=this.children,b=0,v=m.length;b<v;b++)if(f=m[b],f.type===L.DocType)return f;return null}}),Object.defineProperty(l.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(l.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(l.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(l.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===L.Declaration?this.children[0].encoding:null}}),Object.defineProperty(l.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===L.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(l.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===L.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(l.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(l.prototype,"origin",{get:function(){return null}}),Object.defineProperty(l.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(l.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(l.prototype,"contentType",{get:function(){return null}}),l.prototype.end=function(p){var f;return f={},p?c(p)&&(f=p,p=this.options.writer):p=this.options.writer,p.document(this,p.filterOptions(f))},l.prototype.toString=function(p){return this.options.writer.document(this,this.options.writer.filterOptions(p))},l.prototype.createElement=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createTextNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createComment=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createCDATASection=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createProcessingInstruction=function(p,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createAttribute=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createEntityReference=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.getElementsByTagName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.importNode=function(p,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createElementNS=function(p,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createAttributeNS=function(p,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.getElementsByTagNameNS=function(p,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.getElementById=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.adoptNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.renameNode=function(p,f,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.getElementsByClassName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createEvent=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createNodeIterator=function(p,f,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createTreeWalker=function(p,f,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},l}(h)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDOMConfiguration":258,"./XMLDOMImplementation":260,"./XMLNode":273,"./XMLStringWriter":278,"./XMLStringifier":279}],269:[function(I,J,P){"use strict";(function(){var L,u,S,R,h,o,C,c,a,i,r,l,p,f,b,v,m,n,d,g,T,y,s,M,A={}.hasOwnProperty;M=I("./Utility"),y=M.isObject,T=M.isFunction,s=M.isPlainObject,g=M.getValue,L=I("./NodeType"),l=I("./XMLDocument"),f=I("./XMLElement"),R=I("./XMLCData"),h=I("./XMLComment"),v=I("./XMLRaw"),d=I("./XMLText"),b=I("./XMLProcessingInstruction"),i=I("./XMLDeclaration"),r=I("./XMLDocType"),o=I("./XMLDTDAttList"),c=I("./XMLDTDEntity"),C=I("./XMLDTDElement"),a=I("./XMLDTDNotation"),S=I("./XMLAttribute"),n=I("./XMLStringifier"),m=I("./XMLStringWriter"),u=I("./WriterState"),J.exports=p=function(){function x(E,w,_){var N;this.name="?xml",this.type=L.Document,E||(E={}),N={},E.writer?s(E.writer)&&(N=E.writer,E.writer=new m):E.writer=new m,this.options=E,this.writer=E.writer,this.writerOptions=this.writer.filterOptions(N),this.stringify=new n(E),this.onDataCallback=w||function(){},this.onEndCallback=_||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return x.prototype.createChildNode=function(E){var w,_,N,j,k,z,H,F;switch(E.type){case L.CData:this.cdata(E.value);break;case L.Comment:this.comment(E.value);break;case L.Element:N={},H=E.attribs;for(_ in H){if(!A.call(H,_))continue;w=H[_],N[_]=w.value}this.node(E.name,N);break;case L.Dummy:this.dummy();break;case L.Raw:this.raw(E.value);break;case L.Text:this.text(E.value);break;case L.ProcessingInstruction:this.instruction(E.target,E.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+E.constructor.name)}for(F=E.children,k=0,z=F.length;k<z;k++)j=F[k],this.createChildNode(j),j.type===L.Element&&this.up();return this},x.prototype.dummy=function(){return this},x.prototype.node=function(E,w,_){var N;if(E==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(E));return this.openCurrent(),E=g(E),w==null&&(w={}),w=g(w),y(w)||(N=[w,_],_=N[0],w=N[1]),this.currentNode=new f(this,E,w),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,_!=null&&this.text(_),this},x.prototype.element=function(E,w,_){var N,j,k,z,H,F;if(this.currentNode&&this.currentNode.type===L.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(E)||y(E)||T(E))for(z=this.options.noValidation,this.options.noValidation=!0,F=new l(this.options).element("TEMP_ROOT"),F.element(E),this.options.noValidation=z,H=F.children,j=0,k=H.length;j<k;j++)N=H[j],this.createChildNode(N),N.type===L.Element&&this.up();else this.node(E,w,_);return this},x.prototype.attribute=function(E,w){var _,N;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(E));if(E!=null&&(E=g(E)),y(E))for(_ in E){if(!A.call(E,_))continue;N=E[_],this.attribute(_,N)}else T(w)&&(w=w.apply()),this.options.keepNullAttributes&&w==null?this.currentNode.attribs[E]=new S(this,E,""):w!=null&&(this.currentNode.attribs[E]=new S(this,E,w));return this},x.prototype.text=function(E){var w;return this.openCurrent(),w=new d(this,E),this.onData(this.writer.text(w,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.cdata=function(E){var w;return this.openCurrent(),w=new R(this,E),this.onData(this.writer.cdata(w,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.comment=function(E){var w;return this.openCurrent(),w=new h(this,E),this.onData(this.writer.comment(w,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.raw=function(E){var w;return this.openCurrent(),w=new v(this,E),this.onData(this.writer.raw(w,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.instruction=function(E,w){var _,N,j,k,z;if(this.openCurrent(),E!=null&&(E=g(E)),w!=null&&(w=g(w)),Array.isArray(E))for(_=0,k=E.length;_<k;_++)N=E[_],this.instruction(N);else if(y(E))for(N in E){if(!A.call(E,N))continue;j=E[N],this.instruction(N,j)}else T(w)&&(w=w.apply()),z=new b(this,E,w),this.onData(this.writer.processingInstruction(z,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},x.prototype.declaration=function(E,w,_){var N;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return N=new i(this,E,w,_),this.onData(this.writer.declaration(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.doctype=function(E,w,_){if(this.openCurrent(),E==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 r(this,w,_),this.currentNode.rootNodeName=E,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},x.prototype.dtdElement=function(E,w){var _;return this.openCurrent(),_=new C(this,E,w),this.onData(this.writer.dtdElement(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.attList=function(E,w,_,N,j){var k;return this.openCurrent(),k=new o(this,E,w,_,N,j),this.onData(this.writer.dtdAttList(k,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.entity=function(E,w){var _;return this.openCurrent(),_=new c(this,!1,E,w),this.onData(this.writer.dtdEntity(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.pEntity=function(E,w){var _;return this.openCurrent(),_=new c(this,!0,E,w),this.onData(this.writer.dtdEntity(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.prototype.notation=function(E,w){var _;return this.openCurrent(),_=new a(this,E,w),this.onData(this.writer.dtdNotation(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},x.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},x.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},x.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},x.prototype.openNode=function(E){var w,_,N,j;if(!E.isOpen){if(!this.root&&this.currentLevel===0&&E.type===L.Element&&(this.root=E),_="",E.type===L.Element){this.writerOptions.state=u.OpenTag,_=this.writer.indent(E,this.writerOptions,this.currentLevel)+"<"+E.name,j=E.attribs;for(N in j){if(!A.call(j,N))continue;w=j[N],_+=this.writer.attribute(w,this.writerOptions,this.currentLevel)}_+=(E.children?">":"/>")+this.writer.endline(E,this.writerOptions,this.currentLevel),this.writerOptions.state=u.InsideTag}else this.writerOptions.state=u.OpenTag,_=this.writer.indent(E,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+E.rootNodeName,E.pubID&&E.sysID?_+=' PUBLIC "'+E.pubID+'" "'+E.sysID+'"':E.sysID&&(_+=' SYSTEM "'+E.sysID+'"'),E.children?(_+=" [",this.writerOptions.state=u.InsideTag):(this.writerOptions.state=u.CloseTag,_+=">"),_+=this.writer.endline(E,this.writerOptions,this.currentLevel);return this.onData(_,this.currentLevel),E.isOpen=!0}},x.prototype.closeNode=function(E){var w;if(!E.isClosed)return w="",this.writerOptions.state=u.CloseTag,E.type===L.Element?w=this.writer.indent(E,this.writerOptions,this.currentLevel)+"</"+E.name+">"+this.writer.endline(E,this.writerOptions,this.currentLevel):w=this.writer.indent(E,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(E,this.writerOptions,this.currentLevel),this.writerOptions.state=u.None,this.onData(w,this.currentLevel),E.isClosed=!0},x.prototype.onData=function(E,w){return this.documentStarted=!0,this.onDataCallback(E,w+1)},x.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},x.prototype.debugInfo=function(E){return E==null?"":"node: <"+E+">"},x.prototype.ele=function(){return this.element.apply(this,arguments)},x.prototype.nod=function(E,w,_){return this.node(E,w,_)},x.prototype.txt=function(E){return this.text(E)},x.prototype.dat=function(E){return this.cdata(E)},x.prototype.com=function(E){return this.comment(E)},x.prototype.ins=function(E,w){return this.instruction(E,w)},x.prototype.dec=function(E,w,_){return this.declaration(E,w,_)},x.prototype.dtd=function(E,w,_){return this.doctype(E,w,_)},x.prototype.e=function(E,w,_){return this.element(E,w,_)},x.prototype.n=function(E,w,_){return this.node(E,w,_)},x.prototype.t=function(E){return this.text(E)},x.prototype.d=function(E){return this.cdata(E)},x.prototype.c=function(E){return this.comment(E)},x.prototype.r=function(E){return this.raw(E)},x.prototype.i=function(E,w){return this.instruction(E,w)},x.prototype.att=function(){return this.currentNode&&this.currentNode.type===L.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.a=function(){return this.currentNode&&this.currentNode.type===L.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.ent=function(E,w){return this.entity(E,w)},x.prototype.pent=function(E,w){return this.pEntity(E,w)},x.prototype.not=function(E,w){return this.notation(E,w)},x}()}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLAttribute":254,"./XMLCData":255,"./XMLComment":257,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDocument":268,"./XMLElement":271,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLStringWriter":278,"./XMLStringifier":279,"./XMLText":280}],270:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o,C=function(i,r){for(var l in r)c.call(r,l)&&(i[l]=r[l]);function p(){this.constructor=i}return p.prototype=r.prototype,i.prototype=new p,i.__super__=r.prototype,i},c={}.hasOwnProperty;o=I("./XMLNode"),R=I("./NodeType"),J.exports=h=function(a){C(i,a);function i(r){i.__super__.constructor.call(this,r),this.type=R.Dummy}return i.prototype.clone=function(){return(0,u.default)(this)},i.prototype.toString=function(r){return""},i}(o)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],271:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o,C,c,a,i,r,l,p=function(v,m){for(var n in m)f.call(m,n)&&(v[n]=m[n]);function d(){this.constructor=v}return d.prototype=m.prototype,v.prototype=new d,v.__super__=m.prototype,v},f={}.hasOwnProperty;l=I("./Utility"),r=l.isObject,i=l.isFunction,a=l.getValue,c=I("./XMLNode"),R=I("./NodeType"),h=I("./XMLAttribute"),C=I("./XMLNamedNodeMap"),J.exports=o=function(b){p(v,b);function v(m,n,d){var g,T,y,s;if(v.__super__.constructor.call(this,m),n==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(n),this.type=R.Element,this.attribs={},this.schemaTypeInfo=null,d!=null&&this.attribute(d),m.type===R.Document&&(this.isRoot=!0,this.documentObject=m,m.rootObject=this,m.children)){for(s=m.children,T=0,y=s.length;T<y;T++)if(g=s[T],g.type===R.DocType){g.name=this.name;break}}}return Object.defineProperty(v.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(v.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(v.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(v.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(v.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(v.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(v.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(v.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new C(this.attribs)),this.attributeMap}}),v.prototype.clone=function(){var m,n,d,g;d=(0,u.default)(this),d.isRoot&&(d.documentObject=null),d.attribs={},g=this.attribs;for(n in g){if(!f.call(g,n))continue;m=g[n],d.attribs[n]=m.clone()}return d.children=[],this.children.forEach(function(T){var y;return y=T.clone(),y.parent=d,d.children.push(y)}),d},v.prototype.attribute=function(m,n){var d,g;if(m!=null&&(m=a(m)),r(m))for(d in m){if(!f.call(m,d))continue;g=m[d],this.attribute(d,g)}else i(n)&&(n=n.apply()),this.options.keepNullAttributes&&n==null?this.attribs[m]=new h(this,m,""):n!=null&&(this.attribs[m]=new h(this,m,n));return this},v.prototype.removeAttribute=function(m){var n,d,g;if(m==null)throw new Error("Missing attribute name. "+this.debugInfo());if(m=a(m),Array.isArray(m))for(d=0,g=m.length;d<g;d++)n=m[d],delete this.attribs[n];else delete this.attribs[m];return this},v.prototype.toString=function(m){return this.options.writer.element(this,this.options.writer.filterOptions(m))},v.prototype.att=function(m,n){return this.attribute(m,n)},v.prototype.a=function(m,n){return this.attribute(m,n)},v.prototype.getAttribute=function(m){return this.attribs.hasOwnProperty(m)?this.attribs[m].value:null},v.prototype.setAttribute=function(m,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getAttributeNode=function(m){return this.attribs.hasOwnProperty(m)?this.attribs[m]:null},v.prototype.setAttributeNode=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.removeAttributeNode=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getElementsByTagName=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getAttributeNS=function(m,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.setAttributeNS=function(m,n,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.removeAttributeNS=function(m,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getAttributeNodeNS=function(m,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.setAttributeNodeNS=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getElementsByTagNameNS=function(m,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.hasAttribute=function(m){return this.attribs.hasOwnProperty(m)},v.prototype.hasAttributeNS=function(m,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.setIdAttribute=function(m,n){return this.attribs.hasOwnProperty(m)?this.attribs[m].isId:n},v.prototype.setIdAttributeNS=function(m,n,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.setIdAttributeNode=function(m,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getElementsByTagName=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getElementsByTagNameNS=function(m,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.getElementsByClassName=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},v.prototype.isEqualNode=function(m){var n,d,g;if(!v.__super__.isEqualNode.apply(this,arguments).isEqualNode(m))return!1;if(m.namespaceURI!==this.namespaceURI)return!1;if(m.prefix!==this.prefix)return!1;if(m.localName!==this.localName)return!1;if(m.attribs.length!==this.attribs.length)return!1;for(n=d=0,g=this.attribs.length-1;0<=g?d<=g:d>=g;n=0<=g?++d:--d)if(!this.attribs[n].isEqualNode(m.attribs[n]))return!1;return!0},v}(c)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLAttribute":254,"./XMLNamedNodeMap":272,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],272:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/keys"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R;J.exports=R=function(){function h(o){this.nodes=o}return Object.defineProperty(h.prototype,"length",{get:function(){return(0,u.default)(this.nodes).length||0}}),h.prototype.clone=function(){return this.nodes=null},h.prototype.getNamedItem=function(o){return this.nodes[o]},h.prototype.setNamedItem=function(o){var C;return C=this.nodes[o.nodeName],this.nodes[o.nodeName]=o,C||null},h.prototype.removeNamedItem=function(o){var C;return C=this.nodes[o],delete this.nodes[o],C||null},h.prototype.item=function(o){return this.nodes[(0,u.default)(this.nodes)[o]]||null},h.prototype.getNamedItemNS=function(o,C){throw new Error("This DOM method is not implemented.")},h.prototype.setNamedItemNS=function(o){throw new Error("This DOM method is not implemented.")},h.prototype.removeNamedItemNS=function(o,C){throw new Error("This DOM method is not implemented.")},h}()}).call(void 0)},{"babel-runtime/core-js/object/keys":60}],273:[function(I,J,P){"use strict";(function(){var L,u,S,R,h,o,C,c,a,i,r,l,p,f,b,v,m,n,d,g={}.hasOwnProperty;d=I("./Utility"),n=d.isObject,m=d.isFunction,v=d.isEmpty,b=d.getValue,c=null,S=null,R=null,h=null,o=null,p=null,f=null,l=null,C=null,u=null,r=null,a=null,L=null,J.exports=i=function(){function T(y){this.parent=y,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,c||(c=I("./XMLElement"),S=I("./XMLCData"),R=I("./XMLComment"),h=I("./XMLDeclaration"),o=I("./XMLDocType"),p=I("./XMLRaw"),f=I("./XMLText"),l=I("./XMLProcessingInstruction"),C=I("./XMLDummy"),u=I("./NodeType"),r=I("./XMLNodeList"),a=I("./XMLNamedNodeMap"),L=I("./DocumentPosition"))}return Object.defineProperty(T.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(T.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(T.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(T.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(T.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new r(this.children)),this.childNodeList}}),Object.defineProperty(T.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(T.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(T.prototype,"previousSibling",{get:function(){var s;return s=this.parent.children.indexOf(this),this.parent.children[s-1]||null}}),Object.defineProperty(T.prototype,"nextSibling",{get:function(){var s;return s=this.parent.children.indexOf(this),this.parent.children[s+1]||null}}),Object.defineProperty(T.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(T.prototype,"textContent",{get:function(){var s,M,A,x,E;if(this.nodeType===u.Element||this.nodeType===u.DocumentFragment){for(E="",x=this.children,M=0,A=x.length;M<A;M++)s=x[M],s.textContent&&(E+=s.textContent);return E}else return null},set:function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),T.prototype.setParent=function(y){var s,M,A,x,E;for(this.parent=y,y&&(this.options=y.options,this.stringify=y.stringify),x=this.children,E=[],M=0,A=x.length;M<A;M++)s=x[M],E.push(s.setParent(this));return E},T.prototype.element=function(y,s,M){var A,x,E,w,_,N,j,k,z,H,F;if(N=null,s===null&&M==null&&(z=[{},null],s=z[0],M=z[1]),s==null&&(s={}),s=b(s),n(s)||(H=[s,M],M=H[0],s=H[1]),y!=null&&(y=b(y)),Array.isArray(y))for(E=0,j=y.length;E<j;E++)x=y[E],N=this.element(x);else if(m(y))N=this.element(y.apply());else if(n(y))for(_ in y){if(!g.call(y,_))continue;if(F=y[_],m(F)&&(F=F.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&_.indexOf(this.stringify.convertAttKey)===0)N=this.attribute(_.substr(this.stringify.convertAttKey.length),F);else if(!this.options.separateArrayItems&&Array.isArray(F)&&v(F))N=this.dummy();else if(n(F)&&v(F))N=this.element(_);else if(!this.options.keepNullNodes&&F==null)N=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(F))for(w=0,k=F.length;w<k;w++)x=F[w],A={},A[_]=x,N=this.element(A);else n(F)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&_.indexOf(this.stringify.convertTextKey)===0?N=this.element(F):(N=this.element(_),N.element(F)):N=this.element(_,F)}else!this.options.keepNullNodes&&M===null?N=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&y.indexOf(this.stringify.convertTextKey)===0?N=this.text(M):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&y.indexOf(this.stringify.convertCDataKey)===0?N=this.cdata(M):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&y.indexOf(this.stringify.convertCommentKey)===0?N=this.comment(M):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&y.indexOf(this.stringify.convertRawKey)===0?N=this.raw(M):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&y.indexOf(this.stringify.convertPIKey)===0?N=this.instruction(y.substr(this.stringify.convertPIKey.length),M):N=this.node(y,s,M);if(N==null)throw new Error("Could not create any elements with: "+y+". "+this.debugInfo());return N},T.prototype.insertBefore=function(y,s,M){var A,x,E,w,_;if(y!=null?y.type:void 0)return E=y,w=s,E.setParent(this),w?(x=children.indexOf(w),_=children.splice(x),children.push(E),Array.prototype.push.apply(children,_)):children.push(E),E;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(y));return x=this.parent.children.indexOf(this),_=this.parent.children.splice(x),A=this.parent.element(y,s,M),Array.prototype.push.apply(this.parent.children,_),A},T.prototype.insertAfter=function(y,s,M){var A,x,E;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(y));return x=this.parent.children.indexOf(this),E=this.parent.children.splice(x+1),A=this.parent.element(y,s,M),Array.prototype.push.apply(this.parent.children,E),A},T.prototype.remove=function(){var y,s;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return y=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[y,y-y+1].concat(s=[])),this.parent},T.prototype.node=function(y,s,M){var A,x;return y!=null&&(y=b(y)),s||(s={}),s=b(s),n(s)||(x=[s,M],M=x[0],s=x[1]),A=new c(this,y,s),M!=null&&A.text(M),this.children.push(A),A},T.prototype.text=function(y){var s;return n(y)&&this.element(y),s=new f(this,y),this.children.push(s),this},T.prototype.cdata=function(y){var s;return s=new S(this,y),this.children.push(s),this},T.prototype.comment=function(y){var s;return s=new R(this,y),this.children.push(s),this},T.prototype.commentBefore=function(y){var s,M,A;return M=this.parent.children.indexOf(this),A=this.parent.children.splice(M),s=this.parent.comment(y),Array.prototype.push.apply(this.parent.children,A),this},T.prototype.commentAfter=function(y){var s,M,A;return M=this.parent.children.indexOf(this),A=this.parent.children.splice(M+1),s=this.parent.comment(y),Array.prototype.push.apply(this.parent.children,A),this},T.prototype.raw=function(y){var s;return s=new p(this,y),this.children.push(s),this},T.prototype.dummy=function(){var y;return y=new C(this),y},T.prototype.instruction=function(y,s){var M,A,x,E,w;if(y!=null&&(y=b(y)),s!=null&&(s=b(s)),Array.isArray(y))for(E=0,w=y.length;E<w;E++)M=y[E],this.instruction(M);else if(n(y))for(M in y){if(!g.call(y,M))continue;A=y[M],this.instruction(M,A)}else m(s)&&(s=s.apply()),x=new l(this,y,s),this.children.push(x);return this},T.prototype.instructionBefore=function(y,s){var M,A,x;return A=this.parent.children.indexOf(this),x=this.parent.children.splice(A),M=this.parent.instruction(y,s),Array.prototype.push.apply(this.parent.children,x),this},T.prototype.instructionAfter=function(y,s){var M,A,x;return A=this.parent.children.indexOf(this),x=this.parent.children.splice(A+1),M=this.parent.instruction(y,s),Array.prototype.push.apply(this.parent.children,x),this},T.prototype.declaration=function(y,s,M){var A,x;return A=this.document(),x=new h(A,y,s,M),A.children.length===0?A.children.unshift(x):A.children[0].type===u.Declaration?A.children[0]=x:A.children.unshift(x),A.root()||A},T.prototype.dtd=function(y,s){var M,A,x,E,w,_,N,j,k,z;for(A=this.document(),x=new o(A,y,s),k=A.children,E=w=0,N=k.length;w<N;E=++w)if(M=k[E],M.type===u.DocType)return A.children[E]=x,x;for(z=A.children,E=_=0,j=z.length;_<j;E=++_)if(M=z[E],M.isRoot)return A.children.splice(E,0,x),x;return A.children.push(x),x},T.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},T.prototype.root=function(){var y;for(y=this;y;){if(y.type===u.Document)return y.rootObject;if(y.isRoot)return y;y=y.parent}},T.prototype.document=function(){var y;for(y=this;y;){if(y.type===u.Document)return y;y=y.parent}},T.prototype.end=function(y){return this.document().end(y)},T.prototype.prev=function(){var y;if(y=this.parent.children.indexOf(this),y<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[y-1]},T.prototype.next=function(){var y;if(y=this.parent.children.indexOf(this),y===-1||y===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[y+1]},T.prototype.importDocument=function(y){var s;return s=y.root().clone(),s.parent=this,s.isRoot=!1,this.children.push(s),this},T.prototype.debugInfo=function(y){var s,M;return y=y||this.name,y==null&&!((s=this.parent)!=null?s.name:void 0)?"":y==null?"parent: <"+this.parent.name+">":((M=this.parent)!=null?M.name:void 0)?"node: <"+y+">, parent: <"+this.parent.name+">":"node: <"+y+">"},T.prototype.ele=function(y,s,M){return this.element(y,s,M)},T.prototype.nod=function(y,s,M){return this.node(y,s,M)},T.prototype.txt=function(y){return this.text(y)},T.prototype.dat=function(y){return this.cdata(y)},T.prototype.com=function(y){return this.comment(y)},T.prototype.ins=function(y,s){return this.instruction(y,s)},T.prototype.doc=function(){return this.document()},T.prototype.dec=function(y,s,M){return this.declaration(y,s,M)},T.prototype.e=function(y,s,M){return this.element(y,s,M)},T.prototype.n=function(y,s,M){return this.node(y,s,M)},T.prototype.t=function(y){return this.text(y)},T.prototype.d=function(y){return this.cdata(y)},T.prototype.c=function(y){return this.comment(y)},T.prototype.r=function(y){return this.raw(y)},T.prototype.i=function(y,s){return this.instruction(y,s)},T.prototype.u=function(){return this.up()},T.prototype.importXMLBuilder=function(y){return this.importDocument(y)},T.prototype.replaceChild=function(y,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.removeChild=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.appendChild=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.hasChildNodes=function(){return this.children.length!==0},T.prototype.cloneNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.isSupported=function(y,s){return!0},T.prototype.hasAttributes=function(){return this.attribs.length!==0},T.prototype.compareDocumentPosition=function(y){var s,M;return s=this,s===y?0:this.document()!==y.document()?(M=L.Disconnected|L.ImplementationSpecific,Math.random()<.5?M|=L.Preceding:M|=L.Following,M):s.isAncestor(y)?L.Contains|L.Preceding:s.isDescendant(y)?L.Contains|L.Following:s.isPreceding(y)?L.Preceding:L.Following},T.prototype.isSameNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.lookupPrefix=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.isDefaultNamespace=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.lookupNamespaceURI=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.isEqualNode=function(y){var s,M,A;if(y.nodeType!==this.nodeType)return!1;if(y.children.length!==this.children.length)return!1;for(s=M=0,A=this.children.length-1;0<=A?M<=A:M>=A;s=0<=A?++M:--M)if(!this.children[s].isEqualNode(y.children[s]))return!1;return!0},T.prototype.getFeature=function(y,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.setUserData=function(y,s,M){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.getUserData=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.contains=function(y){return y?y===this||this.isDescendant(y):!1},T.prototype.isDescendant=function(y){var s,M,A,x,E;for(E=this.children,A=0,x=E.length;A<x;A++){if(s=E[A],y===s)return!0;if(M=s.isDescendant(y),M)return!0}return!1},T.prototype.isAncestor=function(y){return y.isDescendant(this)},T.prototype.isPreceding=function(y){var s,M;return s=this.treePosition(y),M=this.treePosition(this),s===-1||M===-1?!1:s<M},T.prototype.isFollowing=function(y){var s,M;return s=this.treePosition(y),M=this.treePosition(this),s===-1||M===-1?!1:s>M},T.prototype.treePosition=function(y){var s,M;return M=0,s=!1,this.foreachTreeNode(this.document(),function(A){if(M++,!s&&A===y)return s=!0}),s?M:-1},T.prototype.foreachTreeNode=function(y,s){var M,A,x,E,w;for(y||(y=this.document()),E=y.children,A=0,x=E.length;A<x;A++){if(M=E[A],w=s(M))return w;if(w=this.foreachTreeNode(M,s),w)return w}},T}()}).call(void 0)},{"./DocumentPosition":250,"./NodeType":251,"./Utility":252,"./XMLCData":255,"./XMLComment":257,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLNamedNodeMap":272,"./XMLNodeList":274,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],274:[function(I,J,P){"use strict";(function(){var L;J.exports=L=function(){function u(S){this.nodes=S}return Object.defineProperty(u.prototype,"length",{get:function(){return this.nodes.length||0}}),u.prototype.clone=function(){return this.nodes=null},u.prototype.item=function(S){return this.nodes[S]||null},u}()}).call(void 0)},{}],275:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o,C=function(i,r){for(var l in r)c.call(r,l)&&(i[l]=r[l]);function p(){this.constructor=i}return p.prototype=r.prototype,i.prototype=new p,i.__super__=r.prototype,i},c={}.hasOwnProperty;R=I("./NodeType"),h=I("./XMLCharacterData"),J.exports=o=function(a){C(i,a);function i(r,l,p){if(i.__super__.constructor.call(this,r),l==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=R.ProcessingInstruction,this.target=this.stringify.insTarget(l),this.name=this.target,p&&(this.value=this.stringify.insValue(p))}return i.prototype.clone=function(){return(0,u.default)(this)},i.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))},i.prototype.isEqualNode=function(r){return i.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)?!(r.target!==this.target):!1},i}(h)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],276:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o,C=function(i,r){for(var l in r)c.call(r,l)&&(i[l]=r[l]);function p(){this.constructor=i}return p.prototype=r.prototype,i.prototype=new p,i.__super__=r.prototype,i},c={}.hasOwnProperty;R=I("./NodeType"),h=I("./XMLNode"),J.exports=o=function(a){C(i,a);function i(r,l){if(i.__super__.constructor.call(this,r),l==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=R.Raw,this.value=this.stringify.raw(l)}return i.prototype.clone=function(){return(0,u.default)(this)},i.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))},i}(h)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],277:[function(I,J,P){"use strict";(function(){var L,u,S,R,h=function(c,a){for(var i in a)o.call(a,i)&&(c[i]=a[i]);function r(){this.constructor=c}return r.prototype=a.prototype,c.prototype=new r,c.__super__=a.prototype,c},o={}.hasOwnProperty;L=I("./NodeType"),R=I("./XMLWriterBase"),u=I("./WriterState"),J.exports=S=function(C){h(c,C);function c(a,i){this.stream=a,c.__super__.constructor.call(this,i)}return c.prototype.endline=function(a,i,r){return a.isLastRootNode&&i.state===u.CloseTag?"":c.__super__.endline.call(this,a,i,r)},c.prototype.document=function(a,i){var r,l,p,f,b,v,m,n,d;for(m=a.children,l=p=0,b=m.length;p<b;l=++p)r=m[l],r.isLastRootNode=l===a.children.length-1;for(i=this.filterOptions(i),n=a.children,d=[],f=0,v=n.length;f<v;f++)r=n[f],d.push(this.writeChildNode(r,i,0));return d},c.prototype.attribute=function(a,i,r){return this.stream.write(c.__super__.attribute.call(this,a,i,r))},c.prototype.cdata=function(a,i,r){return this.stream.write(c.__super__.cdata.call(this,a,i,r))},c.prototype.comment=function(a,i,r){return this.stream.write(c.__super__.comment.call(this,a,i,r))},c.prototype.declaration=function(a,i,r){return this.stream.write(c.__super__.declaration.call(this,a,i,r))},c.prototype.docType=function(a,i,r){var l,p,f,b;if(r||(r=0),this.openNode(a,i,r),i.state=u.OpenTag,this.stream.write(this.indent(a,i,r)),this.stream.write("<!DOCTYPE "+a.root().name),a.pubID&&a.sysID?this.stream.write(' PUBLIC "'+a.pubID+'" "'+a.sysID+'"'):a.sysID&&this.stream.write(' SYSTEM "'+a.sysID+'"'),a.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(a,i,r)),i.state=u.InsideTag,b=a.children,p=0,f=b.length;p<f;p++)l=b[p],this.writeChildNode(l,i,r+1);i.state=u.CloseTag,this.stream.write("]")}return i.state=u.CloseTag,this.stream.write(i.spaceBeforeSlash+">"),this.stream.write(this.endline(a,i,r)),i.state=u.None,this.closeNode(a,i,r)},c.prototype.element=function(a,i,r){var l,p,f,b,v,m,n,d,g,T;r||(r=0),this.openNode(a,i,r),i.state=u.OpenTag,this.stream.write(this.indent(a,i,r)+"<"+a.name),g=a.attribs;for(n in g){if(!o.call(g,n))continue;l=g[n],this.attribute(l,i,r)}if(f=a.children.length,b=f===0?null:a.children[0],f===0||a.children.every(function(y){return(y.type===L.Text||y.type===L.Raw)&&y.value===""}))i.allowEmpty?(this.stream.write(">"),i.state=u.CloseTag,this.stream.write("</"+a.name+">")):(i.state=u.CloseTag,this.stream.write(i.spaceBeforeSlash+"/>"));else if(i.pretty&&f===1&&(b.type===L.Text||b.type===L.Raw)&&b.value!=null)this.stream.write(">"),i.state=u.InsideTag,i.suppressPrettyCount++,d=!0,this.writeChildNode(b,i,r+1),i.suppressPrettyCount--,d=!1,i.state=u.CloseTag,this.stream.write("</"+a.name+">");else{for(this.stream.write(">"+this.endline(a,i,r)),i.state=u.InsideTag,T=a.children,v=0,m=T.length;v<m;v++)p=T[v],this.writeChildNode(p,i,r+1);i.state=u.CloseTag,this.stream.write(this.indent(a,i,r)+"</"+a.name+">")}return this.stream.write(this.endline(a,i,r)),i.state=u.None,this.closeNode(a,i,r)},c.prototype.processingInstruction=function(a,i,r){return this.stream.write(c.__super__.processingInstruction.call(this,a,i,r))},c.prototype.raw=function(a,i,r){return this.stream.write(c.__super__.raw.call(this,a,i,r))},c.prototype.text=function(a,i,r){return this.stream.write(c.__super__.text.call(this,a,i,r))},c.prototype.dtdAttList=function(a,i,r){return this.stream.write(c.__super__.dtdAttList.call(this,a,i,r))},c.prototype.dtdElement=function(a,i,r){return this.stream.write(c.__super__.dtdElement.call(this,a,i,r))},c.prototype.dtdEntity=function(a,i,r){return this.stream.write(c.__super__.dtdEntity.call(this,a,i,r))},c.prototype.dtdNotation=function(a,i,r){return this.stream.write(c.__super__.dtdNotation.call(this,a,i,r))},c}(R)}).call(void 0)},{"./NodeType":251,"./WriterState":253,"./XMLWriterBase":281}],278:[function(I,J,P){"use strict";(function(){var L,u,S=function(o,C){for(var c in C)R.call(C,c)&&(o[c]=C[c]);function a(){this.constructor=o}return a.prototype=C.prototype,o.prototype=new a,o.__super__=C.prototype,o},R={}.hasOwnProperty;u=I("./XMLWriterBase"),J.exports=L=function(h){S(o,h);function o(C){o.__super__.constructor.call(this,C)}return o.prototype.document=function(C,c){var a,i,r,l,p;for(c=this.filterOptions(c),l="",p=C.children,i=0,r=p.length;i<r;i++)a=p[i],l+=this.writeChildNode(a,c,0);return c.pretty&&l.slice(-c.newline.length)===c.newline&&(l=l.slice(0,-c.newline.length)),l},o}(u)}).call(void 0)},{"./XMLWriterBase":281}],279:[function(I,J,P){"use strict";(function(){var L,u=function(h,o){return function(){return h.apply(o,arguments)}},S={}.hasOwnProperty;J.exports=L=function(){function R(h){this.assertLegalName=u(this.assertLegalName,this),this.assertLegalChar=u(this.assertLegalChar,this);var o,C,c;h||(h={}),this.options=h,this.options.version||(this.options.version="1.0"),C=h.stringify||{};for(o in C){if(!S.call(C,o))continue;c=C[o],this[o]=c}}return R.prototype.name=function(h){return this.options.noValidation?h:this.assertLegalName(""+h||"")},R.prototype.text=function(h){return this.options.noValidation?h:this.assertLegalChar(this.textEscape(""+h||""))},R.prototype.cdata=function(h){return this.options.noValidation?h:(h=""+h||"",h=h.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(h))},R.prototype.comment=function(h){if(this.options.noValidation)return h;if(h=""+h||"",h.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+h);return this.assertLegalChar(h)},R.prototype.raw=function(h){return this.options.noValidation?h:""+h||""},R.prototype.attValue=function(h){return this.options.noValidation?h:this.assertLegalChar(this.attEscape(h=""+h||""))},R.prototype.insTarget=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},R.prototype.insValue=function(h){if(this.options.noValidation)return h;if(h=""+h||"",h.match(/\?>/))throw new Error("Invalid processing instruction value: "+h);return this.assertLegalChar(h)},R.prototype.xmlVersion=function(h){if(this.options.noValidation)return h;if(h=""+h||"",!h.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+h);return h},R.prototype.xmlEncoding=function(h){if(this.options.noValidation)return h;if(h=""+h||"",!h.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+h);return this.assertLegalChar(h)},R.prototype.xmlStandalone=function(h){return this.options.noValidation?h:h?"yes":"no"},R.prototype.dtdPubID=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},R.prototype.dtdSysID=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},R.prototype.dtdElementValue=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},R.prototype.dtdAttType=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},R.prototype.dtdAttDefault=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},R.prototype.dtdEntityValue=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},R.prototype.dtdNData=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},R.prototype.convertAttKey="@",R.prototype.convertPIKey="?",R.prototype.convertTextKey="#text",R.prototype.convertCDataKey="#cdata",R.prototype.convertCommentKey="#comment",R.prototype.convertRawKey="#raw",R.prototype.assertLegalChar=function(h){var o,C;if(this.options.noValidation)return h;if(o="",this.options.version==="1.0"){if(o=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=h.match(o))throw new Error("Invalid character in string: "+h+" at index "+C.index)}else if(this.options.version==="1.1"&&(o=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=h.match(o)))throw new Error("Invalid character in string: "+h+" at index "+C.index);return h},R.prototype.assertLegalName=function(h){var o;if(this.options.noValidation)return h;if(this.assertLegalChar(h),o=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!h.match(o))throw new Error("Invalid character in name");return h},R.prototype.textEscape=function(h){var o;return this.options.noValidation?h:(o=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,h.replace(o,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},R.prototype.attEscape=function(h){var o;return this.options.noValidation?h:(o=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,h.replace(o,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},R}()}).call(void 0)},{}],280:[function(I,J,P){"use strict";var L=I("babel-runtime/core-js/object/create"),u=S(L);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,h,o,C=function(i,r){for(var l in r)c.call(r,l)&&(i[l]=r[l]);function p(){this.constructor=i}return p.prototype=r.prototype,i.prototype=new p,i.__super__=r.prototype,i},c={}.hasOwnProperty;R=I("./NodeType"),h=I("./XMLCharacterData"),J.exports=o=function(a){C(i,a);function i(r,l){if(i.__super__.constructor.call(this,r),l==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=R.Text,this.value=this.stringify.text(l)}return Object.defineProperty(i.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"wholeText",{get:function(){var l,p,f;for(f="",p=this.previousSibling;p;)f=p.data+f,p=p.previousSibling;for(f+=this.data,l=this.nextSibling;l;)f=f+l.data,l=l.nextSibling;return f}}),i.prototype.clone=function(){return(0,u.default)(this)},i.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))},i.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i}(h)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],281:[function(I,J,P){"use strict";(function(){var L,u,S,R,h,o,C,c,a,i,r,l,p,f,b,v,m,n={}.hasOwnProperty;m=I("./Utility").assign,L=I("./NodeType"),a=I("./XMLDeclaration"),i=I("./XMLDocType"),S=I("./XMLCData"),R=I("./XMLComment"),l=I("./XMLElement"),f=I("./XMLRaw"),b=I("./XMLText"),p=I("./XMLProcessingInstruction"),r=I("./XMLDummy"),h=I("./XMLDTDAttList"),o=I("./XMLDTDElement"),C=I("./XMLDTDEntity"),c=I("./XMLDTDNotation"),u=I("./WriterState"),J.exports=v=function(){function d(g){var T,y,s;g||(g={}),this.options=g,y=g.writer||{};for(T in y){if(!n.call(y,T))continue;s=y[T],this["_"+T]=this[T],this[T]=s}}return d.prototype.filterOptions=function(g){var T,y,s,M,A,x,E,w;return g||(g={}),g=m({},this.options,g),T={writer:this},T.pretty=g.pretty||!1,T.allowEmpty=g.allowEmpty||!1,T.indent=(y=g.indent)!=null?y:" ",T.newline=(s=g.newline)!=null?s:`
|
|
|
`,T.offset=(M=g.offset)!=null?M:0,T.dontPrettyTextNodes=(A=(x=g.dontPrettyTextNodes)!=null?x:g.dontprettytextnodes)!=null?A:0,T.spaceBeforeSlash=(E=(w=g.spaceBeforeSlash)!=null?w:g.spacebeforeslash)!=null?E:"",T.spaceBeforeSlash===!0&&(T.spaceBeforeSlash=" "),T.suppressPrettyCount=0,T.user={},T.state=u.None,T},d.prototype.indent=function(g,T,y){var s;return!T.pretty||T.suppressPrettyCount?"":T.pretty&&(s=(y||0)+T.offset+1,s>0)?new Array(s).join(T.indent):""},d.prototype.endline=function(g,T,y){return!T.pretty||T.suppressPrettyCount?"":T.newline},d.prototype.attribute=function(g,T,y){var s;return this.openAttribute(g,T,y),s=" "+g.name+'="'+g.value+'"',this.closeAttribute(g,T,y),s},d.prototype.cdata=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y)+"<![CDATA[",T.state=u.InsideTag,s+=g.value,T.state=u.CloseTag,s+="]]>"+this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.comment=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y)+"<!-- ",T.state=u.InsideTag,s+=g.value,T.state=u.CloseTag,s+=" -->"+this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.declaration=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y)+"<?xml",T.state=u.InsideTag,s+=' version="'+g.version+'"',g.encoding!=null&&(s+=' encoding="'+g.encoding+'"'),g.standalone!=null&&(s+=' standalone="'+g.standalone+'"'),T.state=u.CloseTag,s+=T.spaceBeforeSlash+"?>",s+=this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.docType=function(g,T,y){var s,M,A,x,E;if(y||(y=0),this.openNode(g,T,y),T.state=u.OpenTag,x=this.indent(g,T,y),x+="<!DOCTYPE "+g.root().name,g.pubID&&g.sysID?x+=' PUBLIC "'+g.pubID+'" "'+g.sysID+'"':g.sysID&&(x+=' SYSTEM "'+g.sysID+'"'),g.children.length>0){for(x+=" [",x+=this.endline(g,T,y),T.state=u.InsideTag,E=g.children,M=0,A=E.length;M<A;M++)s=E[M],x+=this.writeChildNode(s,T,y+1);T.state=u.CloseTag,x+="]"}return T.state=u.CloseTag,x+=T.spaceBeforeSlash+">",x+=this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),x},d.prototype.element=function(g,T,y){var s,M,A,x,E,w,_,N,j,k,z,H,F,G;y||(y=0),k=!1,z="",this.openNode(g,T,y),T.state=u.OpenTag,z+=this.indent(g,T,y)+"<"+g.name,H=g.attribs;for(j in H){if(!n.call(H,j))continue;s=H[j],z+=this.attribute(s,T,y)}if(A=g.children.length,x=A===0?null:g.children[0],A===0||g.children.every(function(B){return(B.type===L.Text||B.type===L.Raw)&&B.value===""}))T.allowEmpty?(z+=">",T.state=u.CloseTag,z+="</"+g.name+">"+this.endline(g,T,y)):(T.state=u.CloseTag,z+=T.spaceBeforeSlash+"/>"+this.endline(g,T,y));else if(T.pretty&&A===1&&(x.type===L.Text||x.type===L.Raw)&&x.value!=null)z+=">",T.state=u.InsideTag,T.suppressPrettyCount++,k=!0,z+=this.writeChildNode(x,T,y+1),T.suppressPrettyCount--,k=!1,T.state=u.CloseTag,z+="</"+g.name+">"+this.endline(g,T,y);else{if(T.dontPrettyTextNodes){for(F=g.children,E=0,_=F.length;E<_;E++)if(M=F[E],(M.type===L.Text||M.type===L.Raw)&&M.value!=null){T.suppressPrettyCount++,k=!0;break}}for(z+=">"+this.endline(g,T,y),T.state=u.InsideTag,G=g.children,w=0,N=G.length;w<N;w++)M=G[w],z+=this.writeChildNode(M,T,y+1);T.state=u.CloseTag,z+=this.indent(g,T,y)+"</"+g.name+">",k&&T.suppressPrettyCount--,z+=this.endline(g,T,y),T.state=u.None}return this.closeNode(g,T,y),z},d.prototype.writeChildNode=function(g,T,y){switch(g.type){case L.CData:return this.cdata(g,T,y);case L.Comment:return this.comment(g,T,y);case L.Element:return this.element(g,T,y);case L.Raw:return this.raw(g,T,y);case L.Text:return this.text(g,T,y);case L.ProcessingInstruction:return this.processingInstruction(g,T,y);case L.Dummy:return"";case L.Declaration:return this.declaration(g,T,y);case L.DocType:return this.docType(g,T,y);case L.AttributeDeclaration:return this.dtdAttList(g,T,y);case L.ElementDeclaration:return this.dtdElement(g,T,y);case L.EntityDeclaration:return this.dtdEntity(g,T,y);case L.NotationDeclaration:return this.dtdNotation(g,T,y);default:throw new Error("Unknown XML node type: "+g.constructor.name)}},d.prototype.processingInstruction=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y)+"<?",T.state=u.InsideTag,s+=g.target,g.value&&(s+=" "+g.value),T.state=u.CloseTag,s+=T.spaceBeforeSlash+"?>",s+=this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.raw=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y),T.state=u.InsideTag,s+=g.value,T.state=u.CloseTag,s+=this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.text=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y),T.state=u.InsideTag,s+=g.value,T.state=u.CloseTag,s+=this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.dtdAttList=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y)+"<!ATTLIST",T.state=u.InsideTag,s+=" "+g.elementName+" "+g.attributeName+" "+g.attributeType,g.defaultValueType!=="#DEFAULT"&&(s+=" "+g.defaultValueType),g.defaultValue&&(s+=' "'+g.defaultValue+'"'),T.state=u.CloseTag,s+=T.spaceBeforeSlash+">"+this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.dtdElement=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y)+"<!ELEMENT",T.state=u.InsideTag,s+=" "+g.name+" "+g.value,T.state=u.CloseTag,s+=T.spaceBeforeSlash+">"+this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.dtdEntity=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y)+"<!ENTITY",T.state=u.InsideTag,g.pe&&(s+=" %"),s+=" "+g.name,g.value?s+=' "'+g.value+'"':(g.pubID&&g.sysID?s+=' PUBLIC "'+g.pubID+'" "'+g.sysID+'"':g.sysID&&(s+=' SYSTEM "'+g.sysID+'"'),g.nData&&(s+=" NDATA "+g.nData)),T.state=u.CloseTag,s+=T.spaceBeforeSlash+">"+this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.dtdNotation=function(g,T,y){var s;return this.openNode(g,T,y),T.state=u.OpenTag,s=this.indent(g,T,y)+"<!NOTATION",T.state=u.InsideTag,s+=" "+g.name,g.pubID&&g.sysID?s+=' PUBLIC "'+g.pubID+'" "'+g.sysID+'"':g.pubID?s+=' PUBLIC "'+g.pubID+'"':g.sysID&&(s+=' SYSTEM "'+g.sysID+'"'),T.state=u.CloseTag,s+=T.spaceBeforeSlash+">"+this.endline(g,T,y),T.state=u.None,this.closeNode(g,T,y),s},d.prototype.openNode=function(g,T,y){},d.prototype.closeNode=function(g,T,y){},d.prototype.openAttribute=function(g,T,y){},d.prototype.closeAttribute=function(g,T,y){},d}()}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLCData":255,"./XMLComment":257,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],282:[function(I,J,P){"use strict";(function(){var L,u,S,R,h,o,C,c,a,i;i=I("./Utility"),c=i.assign,a=i.isFunction,S=I("./XMLDOMImplementation"),R=I("./XMLDocument"),h=I("./XMLDocumentCB"),C=I("./XMLStringWriter"),o=I("./XMLStreamWriter"),L=I("./NodeType"),u=I("./WriterState"),J.exports.create=function(r,l,p,f){var b,v;if(r==null)throw new Error("Root element needs a name.");return f=c({},l,p,f),b=new R(f),v=b.element(r),f.headless||(b.declaration(f),(f.pubID!=null||f.sysID!=null)&&b.dtd(f)),v},J.exports.begin=function(r,l,p){var f;return a(r)&&(f=[r,l],l=f[0],p=f[1],r={}),l?new h(r,l,p):new R(r)},J.exports.stringWriter=function(r){return new C(r)},J.exports.streamWriter=function(r,l){return new o(r,l)},J.exports.implementation=new S,J.exports.nodeType=L,J.exports.writerState=u}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLDOMImplementation":260,"./XMLDocument":268,"./XMLDocumentCB":269,"./XMLStreamWriter":277,"./XMLStringWriter":278}],283:[function(I,J,P){J.exports=u;var L=Object.prototype.hasOwnProperty;function u(){for(var S={},R=0;R<arguments.length;R++){var h=arguments[R];for(var o in h)L.call(h,o)&&(S[o]=h[o])}return S}},{}],284:[function(I,J,P){"use strict";var L=I("buffer").Buffer,u=I("./sha"),S=I("./md5"),R={sha1:u,md5:S},h=64,o=L.alloc(h);o.fill(0);function C(i,r,l){L.isBuffer(r)||(r=L.from(r)),L.isBuffer(l)||(l=L.from(l)),r.length>h?r=i(r):r.length<h&&(r=L.concat([r,o],h));for(var p=L.alloc(h),f=L.alloc(h),b=0;b<h;b++)p[b]=r[b]^54,f[b]=r[b]^92;var v=i(L.concat([p,l]));return i(L.concat([f,v]))}function c(i,r){i=i||"sha1";var l=R[i],p=[],f=0;return l||a("algorithm:",i,"is not yet supported"),{update:function(v){return L.isBuffer(v)||(v=L.from(v)),p.push(v),f+=v.length,this},digest:function(v){var m=L.concat(p),n=r?C(l,r,m):l(m);return p=null,v?n.toString(v):n}}}function a(){var i=[].slice.call(arguments).join(" ");throw new Error([i,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}P.createHash=function(i){return c(i)},P.createHmac=function(i,r){return c(i,r)},P.createCredentials=function(){a("sorry,createCredentials is not implemented yet")},P.createCipher=function(){a("sorry,createCipher is not implemented yet")},P.createCipheriv=function(){a("sorry,createCipheriv is not implemented yet")},P.createDecipher=function(){a("sorry,createDecipher is not implemented yet")},P.createDecipheriv=function(){a("sorry,createDecipheriv is not implemented yet")},P.createSign=function(){a("sorry,createSign is not implemented yet")},P.createVerify=function(){a("sorry,createVerify is not implemented yet")},P.createDiffieHellman=function(){a("sorry,createDiffieHellman is not implemented yet")},P.pbkdf2=function(){a("sorry,pbkdf2 is not implemented yet")}},{"./md5":286,"./sha":287,buffer:73}],285:[function(I,J,P){"use strict";var L=I("buffer").Buffer,u=4,S=L.alloc(u);S.fill(0);var R=8;function h(c,a){if(c.length%u!==0){var i=c.length+(u-c.length%u);c=L.concat([c,S],i)}for(var r=[],l=a?c.readInt32BE:c.readInt32LE,p=0;p<c.length;p+=u)r.push(l.call(c,p));return r}function o(c,a,i){for(var r=L.alloc(a),l=i?r.writeInt32BE:r.writeInt32LE,p=0;p<c.length;p++)l.call(r,c[p],p*4,!0);return r}function C(c,a,i,r){L.isBuffer(c)||(c=L.from(c));var l=a(h(c,r),c.length*R);return o(l,i,r)}J.exports={hash:C}},{buffer:73}],286:[function(I,J,P){"use strict";var L=I("./helpers");function u(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function S(r,l){r[l>>5]|=128<<l%32,r[(l+64>>>9<<4)+14]=l;for(var p=1732584193,f=-271733879,b=-1732584194,v=271733878,m=0;m<r.length;m+=16){var n=p,d=f,g=b,T=v;p=h(p,f,b,v,r[m+0],7,-680876936),v=h(v,p,f,b,r[m+1],12,-389564586),b=h(b,v,p,f,r[m+2],17,606105819),f=h(f,b,v,p,r[m+3],22,-1044525330),p=h(p,f,b,v,r[m+4],7,-176418897),v=h(v,p,f,b,r[m+5],12,1200080426),b=h(b,v,p,f,r[m+6],17,-1473231341),f=h(f,b,v,p,r[m+7],22,-45705983),p=h(p,f,b,v,r[m+8],7,1770035416),v=h(v,p,f,b,r[m+9],12,-1958414417),b=h(b,v,p,f,r[m+10],17,-42063),f=h(f,b,v,p,r[m+11],22,-1990404162),p=h(p,f,b,v,r[m+12],7,1804603682),v=h(v,p,f,b,r[m+13],12,-40341101),b=h(b,v,p,f,r[m+14],17,-1502002290),f=h(f,b,v,p,r[m+15],22,1236535329),p=o(p,f,b,v,r[m+1],5,-165796510),v=o(v,p,f,b,r[m+6],9,-1069501632),b=o(b,v,p,f,r[m+11],14,643717713),f=o(f,b,v,p,r[m+0],20,-373897302),p=o(p,f,b,v,r[m+5],5,-701558691),v=o(v,p,f,b,r[m+10],9,38016083),b=o(b,v,p,f,r[m+15],14,-660478335),f=o(f,b,v,p,r[m+4],20,-405537848),p=o(p,f,b,v,r[m+9],5,568446438),v=o(v,p,f,b,r[m+14],9,-1019803690),b=o(b,v,p,f,r[m+3],14,-187363961),f=o(f,b,v,p,r[m+8],20,1163531501),p=o(p,f,b,v,r[m+13],5,-1444681467),v=o(v,p,f,b,r[m+2],9,-51403784),b=o(b,v,p,f,r[m+7],14,1735328473),f=o(f,b,v,p,r[m+12],20,-1926607734),p=C(p,f,b,v,r[m+5],4,-378558),v=C(v,p,f,b,r[m+8],11,-2022574463),b=C(b,v,p,f,r[m+11],16,1839030562),f=C(f,b,v,p,r[m+14],23,-35309556),p=C(p,f,b,v,r[m+1],4,-1530992060),v=C(v,p,f,b,r[m+4],11,1272893353),b=C(b,v,p,f,r[m+7],16,-155497632),f=C(f,b,v,p,r[m+10],23,-1094730640),p=C(p,f,b,v,r[m+13],4,681279174),v=C(v,p,f,b,r[m+0],11,-358537222),b=C(b,v,p,f,r[m+3],16,-722521979),f=C(f,b,v,p,r[m+6],23,76029189),p=C(p,f,b,v,r[m+9],4,-640364487),v=C(v,p,f,b,r[m+12],11,-421815835),b=C(b,v,p,f,r[m+15],16,530742520),f=C(f,b,v,p,r[m+2],23,-995338651),p=c(p,f,b,v,r[m+0],6,-198630844),v=c(v,p,f,b,r[m+7],10,1126891415),b=c(b,v,p,f,r[m+14],15,-1416354905),f=c(f,b,v,p,r[m+5],21,-57434055),p=c(p,f,b,v,r[m+12],6,1700485571),v=c(v,p,f,b,r[m+3],10,-1894986606),b=c(b,v,p,f,r[m+10],15,-1051523),f=c(f,b,v,p,r[m+1],21,-2054922799),p=c(p,f,b,v,r[m+8],6,1873313359),v=c(v,p,f,b,r[m+15],10,-30611744),b=c(b,v,p,f,r[m+6],15,-1560198380),f=c(f,b,v,p,r[m+13],21,1309151649),p=c(p,f,b,v,r[m+4],6,-145523070),v=c(v,p,f,b,r[m+11],10,-1120210379),b=c(b,v,p,f,r[m+2],15,718787259),f=c(f,b,v,p,r[m+9],21,-343485551),p=a(p,n),f=a(f,d),b=a(b,g),v=a(v,T)}return Array(p,f,b,v)}function R(r,l,p,f,b,v){return a(i(a(a(l,r),a(f,v)),b),p)}function h(r,l,p,f,b,v,m){return R(l&p|~l&f,r,l,b,v,m)}function o(r,l,p,f,b,v,m){return R(l&f|p&~f,r,l,b,v,m)}function C(r,l,p,f,b,v,m){return R(l^p^f,r,l,b,v,m)}function c(r,l,p,f,b,v,m){return R(p^(l|~f),r,l,b,v,m)}function a(r,l){var p=(r&65535)+(l&65535),f=(r>>16)+(l>>16)+(p>>16);return f<<16|p&65535}function i(r,l){return r<<l|r>>>32-l}J.exports=function(l){return L.hash(l,S,16)}},{"./helpers":285}],287:[function(I,J,P){"use strict";var L=I("./helpers");function u(C,c){C[c>>5]|=128<<24-c%32,C[(c+64>>9<<4)+15]=c;for(var a=Array(80),i=1732584193,r=-271733879,l=-1732584194,p=271733878,f=-1009589776,b=0;b<C.length;b+=16){for(var v=i,m=r,n=l,d=p,g=f,T=0;T<80;T++){T<16?a[T]=C[b+T]:a[T]=o(a[T-3]^a[T-8]^a[T-14]^a[T-16],1);var y=h(h(o(i,5),S(T,r,l,p)),h(h(f,a[T]),R(T)));f=p,p=l,l=o(r,30),r=i,i=y}i=h(i,v),r=h(r,m),l=h(l,n),p=h(p,d),f=h(f,g)}return Array(i,r,l,p,f)}function S(C,c,a,i){return C<20?c&a|~c&i:C<40?c^a^i:C<60?c&a|c&i|a&i:c^a^i}function R(C){return C<20?1518500249:C<40?1859775393:C<60?-1894007588:-899497514}function h(C,c){var a=(C&65535)+(c&65535),i=(C>>16)+(c>>16)+(a>>16);return i<<16|a&65535}function o(C,c){return C<<c|C>>>32-c}J.exports=function(c){return L.hash(c,u,20,!0)}},{"./helpers":285}],288:[function(I,J,P){"use strict";J.exports=function(){return function(){}}},{}],289:[function(I,J,P){(function(L){"use strict";var u=I("babel-runtime/helpers/typeof"),S=R(u);function R(i){return i&&i.__esModule?i:{default:i}}var h=I("stream"),o=h.Stream,C=I("../lib/common/utils/isArray"),c=C.isArray;J.exports.string=function(r){return typeof r=="string"},J.exports.array=c,J.exports.buffer=L.isBuffer;function a(i){return i instanceof o}J.exports.writableStream=function(r){return a(r)&&typeof r._write=="function"&&(0,S.default)(r._writableState)==="object"}}).call(this,{isBuffer:I("../node_modules/is-buffer/index.js")})},{"../lib/common/utils/isArray":42,"../node_modules/is-buffer/index.js":197,"babel-runtime/helpers/typeof":67,stream:230}],290:[function(I,J,P){"use strict";P.encodeURIComponent=function(L){try{return encodeURIComponent(L)}catch(u){return L}},P.escape=I("escape-html"),P.timestamp=function(u){if(u){var S=u;return typeof S=="string"&&(S=Number(S)),String(u).length===10&&(S*=1e3),new Date(S)}return Math.round(Date.now()/1e3)}},{"escape-html":191}],291:[function(I,J,P){(function(L,u){"use strict";var S=I("babel-runtime/core-js/json/stringify"),R=C(S),h=I("babel-runtime/helpers/typeof"),o=C(h);function C(T){return T&&T.__esModule?T:{default:T}}var c=I("util"),a=I("url"),i=I("http"),r=I("https"),l=I("debug")("urllib"),p=I("humanize-ms"),f,b=0,v=Math.pow(2,31)-10,m=/^https?:\/\//i;function n(T,y){return T===void 0?y:T}function d(T,y){return function(s,M,A){if(s)return y(s);T({data:M,status:A.statusCode,headers:A.headers,res:A})}}P.TIMEOUTS=[p("300s"),p("300s")];var g=["json","text"];P.request=function(y,s,M){return arguments.length===2&&typeof s=="function"&&(M=s,s=null),typeof M=="function"?P.requestWithCallback(y,s,M):(f||(f=I("any-promise")),new f(function(A,x){P.requestWithCallback(y,s,d(A,x))}))},P.requestWithCallback=function(y,s,M){if(!y||typeof y!="string"&&(typeof y=="undefined"?"undefined":(0,o.default)(y))!=="object"){var A=c.format("expect request url to be a string or a http request options, but got %j",y);throw new Error(A)}arguments.length===2&&typeof s=="function"&&(M=s,s=null),s=s||{},b>=v&&(b=0);var x=++b;s.requestUrls=s.requestUrls||[];var E={requestId:x,url:y,args:s,ctx:s.ctx};s.emitter&&s.emitter.emit("request",E),s.timeout=s.timeout||P.TIMEOUTS,s.maxRedirects=s.maxRedirects||10,s.streaming=s.streaming||s.customResponse;var w=Date.now(),_;typeof y=="string"?(m.test(y)||(y="http://"+y),_=a.parse(y)):_=y;var N=(s.type||s.method||_.method||"GET").toUpperCase(),j=_.port||80,k=i,z=n(s.agent,P.agent),H=s.fixJSONCtlChars;_.protocol==="https:"&&(k=r,z=n(s.httpsAgent,P.httpsAgent),_.port||(j=443));var F={host:_.hostname||_.host||"localhost",path:_.path||"/",method:N,port:j,agent:z,headers:s.headers||{},lookup:s.lookup};Array.isArray(s.timeout)?F.requestTimeout=s.timeout[s.timeout.length-1]:typeof s.timeout!="undefined"&&(F.requestTimeout=s.timeout);for(var G=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],B=0;B<G.length;B++){var W=G[B];s.hasOwnProperty(W)&&(F[W]=s[W])}F.rejectUnauthorized===!1&&!F.hasOwnProperty("secureOptions")&&(F.secureOptions=I("constants").SSL_OP_NO_TLSv1_2);var K=s.auth||_.auth;K&&(F.auth=K);var q=s.content||s.data,re=N==="GET"||N==="HEAD"||s.dataAsQueryString;if(!s.content&&(q&&!(typeof q=="string"||u.isBuffer(q))))if(re)q=s.nestedQuerystring?qs.stringify(q):querystring.stringify(q);else{var ee=F.headers["Content-Type"]||F.headers["content-type"];ee||(s.contentType==="json"?ee="application/json":ee="application/x-www-form-urlencoded",F.headers["Content-Type"]=ee),parseContentType(ee).type==="application/json"?q=(0,R.default)(q):q=s.nestedQuerystring?qs.stringify(q):querystring.stringify(q)}re&&q&&(F.path+=(_.query?"&":"?")+q,q=null);var Ce=0;if(q){var xe=q.length;u.isBuffer(q)||(xe=u.byteLength(q)),Ce=F.headers["Content-Length"]=xe}s.dataType==="json"&&(F.headers.Accept="application/json"),typeof s.beforeRequest=="function"&&s.beforeRequest(F);var he=null,ke=null,_e=null,de=!1,ce=!1,ae=0,Se=-1,te=!1,ue="",Oe="",le=null;s.timing&&(le={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0});function Q(){he&&(clearTimeout(he),he=null)}function Y(){ke&&(clearTimeout(ke),ke=null)}function Z(Re,et,ct){if(Y(),!M){console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),x,L.pid,F.method,y),Re&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),x,L.pid,Re.name,Re.message,Re.stack);return}var $e=M;M=null;var qe={};if(ct&&(Se=ct.statusCode,qe=ct.headers),Se===401&&qe["www-authenticate"]&&(!s.headers||!s.headers.Authorization)&&s.digestAuth){var Ue=qe["www-authenticate"];if(Ue.indexOf("Digest ")>=0)return l("Request#%d %s: got digest auth header WWW-Authenticate: %s",x,y,Ue),s.headers=s.headers||{},s.headers.Authorization=digestAuthHeader(F.method,F.path,Ue,s.digestAuth),l("Request#%d %s: auth with digest header: %s",x,y,s.headers.Authorization),ct.headers["set-cookie"]&&(s.headers.Cookie=ct.headers["set-cookie"].join(";")),P.requestWithCallback(y,s,$e)}var Me=Date.now()-w;le&&(le.contentDownload=Me),l("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Me,ae,Se,F.method,F.host,F.path,ce,le);var Ie={status:Se,statusCode:Se,headers:qe,size:ae,aborted:te,rt:Me,keepAliveSocket:ce,data:et,requestUrls:s.requestUrls,timing:le,remoteAddress:ue,remotePort:Oe};if(Re){var ye="";z&&typeof z.getCurrentStatus=="function"&&(ye=", agent status: "+(0,R.default)(z.getCurrentStatus())),Re.message+=", "+F.method+" "+y+" "+Se+" (connected: "+de+", keepalive socket: "+ce+ye+`)
|
|
|
headers: `+(0,R.default)(qe),Re.data=et,Re.path=F.path,Re.status=Se,Re.headers=qe,Re.res=Ie}$e(Re,et,s.streaming?ct:Ie),s.emitter&&(E.url=y,E.socket=st&&st.connection,E.options=F,E.size=Ce,s.emitter.emit("response",{requestId:x,error:Re,ctx:s.ctx,req:E,res:Ie}))}function be(Re){var et=null;if(s.followRedirect&&statuses.redirect[Re.statusCode]){s._followRedirectCount=(s._followRedirectCount||0)+1;var ct=Re.headers.location;if(!ct)et=new Error("Got statusCode "+Re.statusCode+" but cannot resolve next location from headers"),et.name="FollowRedirectError";else if(s._followRedirectCount>s.maxRedirects)et=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+y),et.name="MaxRedirectError";else{var $e=s.formatRedirectUrl?s.formatRedirectUrl(y,ct):a.resolve(y,ct);l("Request#%d %s: `redirected` from %s to %s",x,F.path,y,$e),Y(),s.headers&&s.headers.Host&&m.test(ct)&&(s.headers.Host=null);var qe=M;return M=null,P.requestWithCallback($e,s,qe),{redirect:!0,error:null}}}return{redirect:!1,error:et}}!F.headers["User-Agent"]&&!F.headers["user-agent"]&&(F.headers["User-Agent"]=navigator.userAgent),s.gzip&&(!F.headers["Accept-Encoding"]&&!F.headers["accept-encoding"]&&(F.headers["Accept-Encoding"]="gzip"));function ge(Re,et,ct){var $e=Re.headers["content-encoding"];return ct(null,et,$e)}var De=s.writeStream;l("Request#%d %s %s with headers %j, options.path: %s",x,N,y,F.headers,F.path),s.requestUrls.push(y);function Qe(Re){if(le&&(le.waiting=Date.now()-w),l("Request#%d %s `req response` event emit: status %d, headers: %j",x,y,Re.statusCode,Re.headers),s.streaming){var et=be(Re);if(et.redirect){Re.resume();return}return et.error?(Re.resume(),Z(et.error,null,Re)):Z(null,null,Re)}if(Re.on("close",function(){l("Request#%d %s: `res close` event emit, total size %d",x,y,ae)}),Re.on("error",function(){l("Request#%d %s: `res error` event emit, total size %d",x,y,ae)}),Re.on("aborted",function(){te=!0,l("Request#%d %s: `res aborted` event emit, total size %d",x,y,ae)}),De){var et=be(Re);if(et.redirect){Re.resume();return}return et.error?(Re.resume(),De.end(),Z(et.error,null,Re)):(s.consumeWriteStream===!1?Re.on("end",Z.bind(null,null,null,Re)):isNode010||isNode012?first([[De,"close"],[Re,"aborted"]],function(qe,Ue,Me){l("Request#%d %s: writeStream or res %s event emitted",x,y,Me),Z(_e||null,null,Re)}):De.on("close",function(){l("Request#%d %s: writeStream close event emitted",x,y),Z(_e||null,null,Re)}),Re.pipe(De))}var ct=[];Re.on("data",function($e){l("Request#%d %s: `res data` event emit, size %d",x,y,$e.length),ae+=$e.length,ct.push($e)}),Re.on("end",function(){var $e=u.concat(ct,ae);if(l("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",x,y,ae,Re._dumped),_e)return Z(_e,$e,Re);var qe=be(Re);if(qe.error)return Z(qe.error,$e,Re);if(qe.redirect)return;ge(Re,$e,function(Ue,Me,Ie){if(Ue)return Z(Ue,$e,Re);if(!Ie&&g.indexOf(s.dataType)>=0){try{Me=decodeBodyByCharset(Me,Re)}catch(Te){return l("decodeBodyByCharset error: %s",Te),Z(null,Me,Re)}if(s.dataType==="json")if(ae===0)Me=null;else{var ye=parseJSON(Me,H);ye.error?Ue=ye.error:Me=ye.data}}te&&l("Request#%d %s: Remote socket was terminated before `response.end()` was called",x,y),Z(Ue,Me,Re)})})}var Ze,nt;Array.isArray(s.timeout)?(Ze=p(s.timeout[0]),nt=p(s.timeout[1])):Ze=nt=p(s.timeout),l("ConnectTimeout: %d, ResponseTimeout: %d",Ze,nt);function tt(){l("Connect timer ticking, timeout: %d",Ze),he=setTimeout(function(){he=null,Se===-1&&(Se=-2);var Re="Connect timeout for "+Ze+"ms",et="ConnectionTimeoutError";st.socket||(et="SocketAssignTimeoutError",Re+=", working sockets is full"),_e=new Error(Re),_e.name=et,_e.requestId=x,l("ConnectTimeout: Request#%d %s %s: %s, connected: %s",x,y,_e.name,Re,de),je()},Ze)}function lt(){l("Response timer ticking, timeout: %d",nt),ke=setTimeout(function(){ke=null;var Re="Response timeout for "+nt+"ms",et="ResponseTimeoutError";_e=new Error(Re),_e.name=et,_e.requestId=x,l("ResponseTimeout: Request#%d %s %s: %s, connected: %s",x,y,_e.name,Re,de),je()},nt)}var st;F.mode=s.mode?s.mode:"";try{st=k.request(F,Qe)}catch(Re){return Z(Re)}typeof window=="undefined"?tt():st.on("requestTimeout",function(){Se===-1&&(Se=-2);var Re="Connect timeout for "+Ze+"ms",et="ConnectionTimeoutError";_e=new Error(Re),_e.name=et,_e.requestId=x,je()});function je(){l("Request#%d %s abort, connected: %s",x,y,de),st.socket||(_e.noSocket=!0,Z(_e)),st.abort()}return le&&st.on("finish",function(){le.requestSent=Date.now()-w}),st.once("socket",function(Re){le&&(le.queuing=Date.now()-w),isNode010&&Re.socket&&(Re=Re.socket);var et=Re.readyState;if(et==="opening"){Re.once("lookup",function(ct,$e,qe){l("Request#%d %s lookup: %s, %s, %s",x,y,ct,$e,qe),le&&(le.dnslookup=Date.now()-w),$e&&(ue=$e)}),Re.once("connect",function(){le&&(le.connected=Date.now()-w),Q(),lt(),l("Request#%d %s new socket connected",x,y),de=!0,ue||(ue=Re.remoteAddress),Oe=Re.remotePort});return}l("Request#%d %s reuse socket connected, readyState: %s",x,y,et),de=!0,ce=!0,ue||(ue=Re.remoteAddress),Oe=Re.remotePort,Q(),lt()}),st.on("error",function(Re){(Re.name==="Error"||Re.name==="TypeError")&&(Re.name=de?"ResponseError":"RequestError"),Re.message+=' (req "error")',l("Request#%d %s `req error` event emit, %s: %s",x,y,Re.name,Re.message),Z(_e||Re)}),De&&De.once("error",function(Re){Re.message+=' (writeStream "error")',_e=Re,l("Request#%d %s `writeStream error` event emit, %s: %s",x,y,Re.name,Re.message),je()}),s.stream?(s.stream.pipe(st),s.stream.once("error",function(Re){Re.message+=' (stream "error")',_e=Re,l("Request#%d %s `readStream error` event emit, %s: %s",x,y,Re.name,Re.message),je()})):st.end(q),st.requestId=x,st}}).call(this,I("_process"),I("buffer").Buffer)},{_process:208,"any-promise":49,"babel-runtime/core-js/json/stringify":53,"babel-runtime/helpers/typeof":67,buffer:73,constants:75,debug:288,http:231,https:193,"humanize-ms":194,url:238,util:243}]},{},[1])(1)})}).call(this,__webpack_require__("IyRk"))},n6Qo:function(I,J,P){"use strict";P.d(J,"a",function(){return c});var L=P("q1tI"),u=P("biw7"),S=P("fyJ8");function R(a){var i=a.className,r=a.index,l=a.children,p=a.colSpan,f=a.rowSpan,b=L.useContext(u.a),v=b.prefixCls,m=b.fixedInfoList,n=m[r];return L.createElement(S.a,Object.assign({className:i,index:r,component:"td",prefixCls:v,record:null,dataIndex:null,render:function(){return{children:l,props:{colSpan:p,rowSpan:f}}}},n))}function h(a){return L.createElement("tr",Object.assign({},a))}function o(a){var i=a.children,r=L.useContext(u.a),l=r.prefixCls;return L.createElement("tfoot",{className:"".concat(l,"-summary")},i)}var C=J.b=o,c={Cell:R,Row:h}},nVVt:function(I,J){I.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},nj2k:function(I,J,P){I.exports=P.p+"static/nodata.c3b0b86c.svg"},oRuE:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.pad.Iso10126={pad:function(u,S){var R=S*4,h=R-u.sigBytes%R;u.concat(L.lib.WordArray.random(h-1)).concat(L.lib.WordArray.create([h<<24],1))},unpad:function(u){var S=u.words[u.sigBytes-1>>>2]&255;u.sigBytes-=S}},L.pad.Iso10126})},osHv:function(I,J,P){(function(L){L(P("VrN/"))})(function(L){"use strict";var u=L.Pos;function S(m,n){return m.line-n.line||m.ch-n.ch}var R="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",h=R+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",o=new RegExp("<(/?)(["+R+"]["+h+"]*)","g");function C(m,n,d,g){this.line=n,this.ch=d,this.cm=m,this.text=m.getLine(n),this.min=g?Math.max(g.from,m.firstLine()):m.firstLine(),this.max=g?Math.min(g.to-1,m.lastLine()):m.lastLine()}function c(m,n){var d=m.cm.getTokenTypeAt(u(m.line,n));return d&&/\btag\b/.test(d)}function a(m){return m.line>=m.max?void 0:(m.ch=0,m.text=m.cm.getLine(++m.line),!0)}function i(m){return m.line<=m.min?void 0:(m.text=m.cm.getLine(--m.line),m.ch=m.text.length,!0)}function r(m){for(;;){var n=m.text.indexOf(">",m.ch);if(n==-1){if(a(m))continue;return}if(!c(m,n+1)){m.ch=n+1;continue}var d=m.text.lastIndexOf("/",n),g=d>-1&&!/\S/.test(m.text.slice(d+1,n));return m.ch=n+1,g?"selfClose":"regular"}}function l(m){for(;;){var n=m.ch?m.text.lastIndexOf("<",m.ch-1):-1;if(n==-1){if(i(m))continue;return}if(!c(m,n+1)){m.ch=n;continue}o.lastIndex=n,m.ch=n;var d=o.exec(m.text);if(d&&d.index==n)return d}}function p(m){for(;;){o.lastIndex=m.ch;var n=o.exec(m.text);if(!n){if(a(m))continue;return}if(!c(m,n.index+1)){m.ch=n.index+1;continue}return m.ch=n.index+n[0].length,n}}function f(m){for(;;){var n=m.ch?m.text.lastIndexOf(">",m.ch-1):-1;if(n==-1){if(i(m))continue;return}if(!c(m,n+1)){m.ch=n;continue}var d=m.text.lastIndexOf("/",n),g=d>-1&&!/\S/.test(m.text.slice(d+1,n));return m.ch=n+1,g?"selfClose":"regular"}}function b(m,n){for(var d=[];;){var g=p(m),T,y=m.line,s=m.ch-(g?g[0].length:0);if(!g||!(T=r(m)))return;if(T=="selfClose")continue;if(g[1]){for(var M=d.length-1;M>=0;--M)if(d[M]==g[2]){d.length=M;break}if(M<0&&(!n||n==g[2]))return{tag:g[2],from:u(y,s),to:u(m.line,m.ch)}}else d.push(g[2])}}function v(m,n){for(var d=[];;){var g=f(m);if(!g)return;if(g=="selfClose"){l(m);continue}var T=m.line,y=m.ch,s=l(m);if(!s)return;if(s[1])d.push(s[2]);else{for(var M=d.length-1;M>=0;--M)if(d[M]==s[2]){d.length=M;break}if(M<0&&(!n||n==s[2]))return{tag:s[2],from:u(m.line,m.ch),to:u(T,y)}}}}L.registerHelper("fold","xml",function(m,n){for(var d=new C(m,n.line,0);;){var g=p(d);if(!g||d.line!=n.line)return;var T=r(d);if(!T)return;if(!g[1]&&T!="selfClose"){var y=u(d.line,d.ch),s=b(d,g[2]);return s&&S(s.from,y)>0?{from:y,to:s.from}:null}}}),L.findMatchingTag=function(m,n,d){var g=new C(m,n.line,n.ch,d);if(g.text.indexOf(">")==-1&&g.text.indexOf("<")==-1)return;var T=r(g),y=T&&u(g.line,g.ch),s=T&&l(g);if(!T||!s||S(g,n)>0)return;var M={from:u(g.line,g.ch),to:y,tag:s[2]};return T=="selfClose"?{open:M,close:null,at:"open"}:s[1]?{open:v(g,s[2]),close:M,at:"close"}:(g=new C(m,y.line,y.ch,d),{open:M,close:b(g,s[2]),at:"open"})},L.findEnclosingTag=function(m,n,d,g){for(var T=new C(m,n.line,n.ch,d);;){var y=v(T,g);if(!y)break;var s=new C(m,n.line,n.ch,d),M=b(s,y.tag);if(M)return{open:y,close:M}}},L.scanForClosingTag=function(m,n,d,g){var T=new C(m,n.line,n.ch,g?{from:0,to:g}:null);return b(T,d)}})},p5ED:function(I,J,P){"use strict";var L=P("+L6B"),u=P("2/Rp"),S=P("5Dmo"),R=P("3S7+"),h=P("k1fw"),o=P("tJVT"),C=P("q1tI"),c=P.n(C),a=P("vHTk"),i=P.n(a),r=P("yEEn"),l=P("ZW9T"),p=P("1vsH");J.a=function(f){var b=f.name,v=f.data,m=f.theme,n=f.type,d=f.filename,g=f.monacoEditor,T=f.className,y=f.style,s=f.close,M=f.onClose,A=f.hasMask,x=Object(C.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),E=Object(o.a)(x,2),w=E[0],_=E[1],N=Object(C.useState)(""),j=Object(o.a)(N,2),k=j[0],z=j[1],H=Object(C.useRef)();d&&(g.filename=d),Object(C.useEffect)(function(){var B,W,K=(B=document.cookie)===null||B===void 0||((W=B.replace(/\s/g,""))===null||W===void 0)?void 0:W.split(";");K==null||K.map(function(q){var re=q.split("=");re[0]==="_educoder_session"&&z(re[1])})},[]);var F=function(){if(v.startsWith("http")||v.startsWith("/")){G();return}Object(p.x)(d||"educoder",v,d)},G=function(){Object(p.v)(d||b,v)};return console.log("data:",v,"fileanme:",d," name:",b),c.a.createElement("div",{style:Object(h.a)({},y||{}),className:"".concat(A&&i.a.bgBlack," ").concat(n?i.a.wrp:"hide")},s&&c.a.createElement("div",{className:i.a.close,ref:H},c.a.createElement(R.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return H.current}},c.a.createElement("span",{onClick:G},c.a.createElement("i",{className:"icon-quxiaozhiding"}))),c.a.createElement(R.a,{title:"\u5173\u95ED",getPopupContainer:function(){return H.current}},c.a.createElement("span",{className:"",onClick:M},c.a.createElement("i",{className:"icon-guanbi1"})))),c.a.createElement("div",{className:"".concat(i.a[T]," ").concat(T," ").concat(i.a.monaco," ").concat(n==="txt"?"show":"hide")},n==="txt"&&c.a.createElement(l.b,g)),n==="audio"&&c.a.createElement("audio",{src:"".concat(v!=null&&v.startsWith("/")||(v==null?void 0:v.indexOf("https://"))>-1?v:"data:audio/mp3;base64,").concat(v),autoPlay:!0}),n==="video"&&c.a.createElement(c.a.Fragment,null,v!=null&&v.startsWith("/")?c.a.createElement("video",{controls:!0,src:"".concat(v),autoPlay:!0}):c.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(v),autoPlay:!0})),n==="html"&&c.a.createElement("iframe",{src:v+"&disposition=inline"}),n==="pdf"&&c.a.createElement("embed",{className:i.a.embed,src:v}),n==="image"&&c.a.createElement(c.a.Fragment,null,c.a.createElement("img",{src:"".concat(v!=null&&v.startsWith("/")||(v==null?void 0:v.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(v)})),n==="other"&&c.a.createElement("div",null,c.a.createElement(u.a,{type:"primary",size:"large",onClick:F},c.a.createElement(r.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(n==="download"||n==="office")&&c.a.createElement(u.a,{type:"primary",size:"large",onClick:F},c.a.createElement(r.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(I,J,P){},pA7S:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.WordArray,h=S.BlockCipher,o=u.algo,C=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],a=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],i=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],r=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=o.DES=h.extend({_doReset:function(){for(var v=this._key,m=v.words,n=[],d=0;d<56;d++){var g=C[d]-1;n[d]=m[g>>>5]>>>31-g%32&1}for(var T=this._subKeys=[],y=0;y<16;y++){for(var s=T[y]=[],M=a[y],d=0;d<24;d++)s[d/6|0]|=n[(c[d]-1+M)%28]<<31-d%6,s[4+(d/6|0)]|=n[28+(c[d+24]-1+M)%28]<<31-d%6;s[0]=s[0]<<1|s[0]>>>31;for(var d=1;d<7;d++)s[d]=s[d]>>>(d-1)*4+3;s[7]=s[7]<<5|s[7]>>>27}for(var A=this._invSubKeys=[],d=0;d<16;d++)A[d]=T[15-d]},encryptBlock:function(v,m){this._doCryptBlock(v,m,this._subKeys)},decryptBlock:function(v,m){this._doCryptBlock(v,m,this._invSubKeys)},_doCryptBlock:function(v,m,n){this._lBlock=v[m],this._rBlock=v[m+1],p.call(this,4,252645135),p.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),p.call(this,1,1431655765);for(var d=0;d<16;d++){for(var g=n[d],T=this._lBlock,y=this._rBlock,s=0,M=0;M<8;M++)s|=i[M][((y^g[M])&r[M])>>>0];this._lBlock=y,this._rBlock=T^s}var A=this._lBlock;this._lBlock=this._rBlock,this._rBlock=A,p.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),v[m]=this._lBlock,v[m+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function p(v,m){var n=(this._lBlock>>>v^this._rBlock)&m;this._rBlock^=n,this._lBlock^=n<<v}function f(v,m){var n=(this._rBlock>>>v^this._lBlock)&m;this._lBlock^=n,this._rBlock^=n<<v}u.DES=h._createHelper(l);var b=o.TripleDES=h.extend({_doReset:function(){var v=this._key,m=v.words;if(m.length!==2&&m.length!==4&&m.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var n=m.slice(0,2),d=m.length<4?m.slice(0,2):m.slice(2,4),g=m.length<6?m.slice(0,2):m.slice(4,6);this._des1=l.createEncryptor(R.create(n)),this._des2=l.createEncryptor(R.create(d)),this._des3=l.createEncryptor(R.create(g))},encryptBlock:function(v,m){this._des1.encryptBlock(v,m),this._des2.decryptBlock(v,m),this._des3.encryptBlock(v,m)},decryptBlock:function(v,m){this._des3.decryptBlock(v,m),this._des2.encryptBlock(v,m),this._des1.decryptBlock(v,m)},keySize:192/32,ivSize:64/32,blockSize:64/32});u.TripleDES=h._createHelper(b)}(),L.TripleDES})},qBft:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.pad.AnsiX923={pad:function(u,S){var R=u.sigBytes,h=S*4,o=h-R%h,C=R+o-1;u.clamp(),u.words[C>>>2]|=o<<24-C%4*8,u.sigBytes+=o},unpad:function(u){var S=u.words[u.sigBytes-1>>>2]&255;u.sigBytes-=S}},L.pad.Ansix923})},qM6L:function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.WordArray,h=u.enc,o=h.Utf16=h.Utf16BE={stringify:function(c){for(var a=c.words,i=c.sigBytes,r=[],l=0;l<i;l+=2){var p=a[l>>>2]>>>16-l%4*8&65535;r.push(String.fromCharCode(p))}return r.join("")},parse:function(c){for(var a=c.length,i=[],r=0;r<a;r++)i[r>>>1]|=c.charCodeAt(r)<<16-r%2*16;return R.create(i,a*2)}};h.Utf16LE={stringify:function(c){for(var a=c.words,i=c.sigBytes,r=[],l=0;l<i;l+=2){var p=C(a[l>>>2]>>>16-l%4*8&65535);r.push(String.fromCharCode(p))}return r.join("")},parse:function(c){for(var a=c.length,i=[],r=0;r<a;r++)i[r>>>1]|=C(c.charCodeAt(r)<<16-r%2*16);return R.create(i,a*2)}};function C(c){return c<<8&4278255360|c>>>8&16711935}}(),L.enc.Utf16})},qu8F:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){/** @preserve
|
|
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
|
* derived from CryptoJS.mode.CTR
|
|
|
* Jan Hruby jhruby.web@gmail.com
|
|
|
*/return L.mode.CTRGladman=function(){var u=L.lib.BlockCipherMode.extend();function S(o){if((o>>24&255)===255){var C=o>>16&255,c=o>>8&255,a=o&255;C===255?(C=0,c===255?(c=0,a===255?a=0:++a):++c):++C,o=0,o+=C<<16,o+=c<<8,o+=a}else o+=1<<24;return o}function R(o){return(o[0]=S(o[0]))===0&&(o[1]=S(o[1])),o}var h=u.Encryptor=u.extend({processBlock:function(o,C){var c=this._cipher,a=c.blockSize,i=this._iv,r=this._counter;i&&(r=this._counter=i.slice(0),this._iv=void 0),R(r);var l=r.slice(0);c.encryptBlock(l,0);for(var p=0;p<a;p++)o[C+p]^=l[p]}});return u.Decryptor=h,u}(),L.mode.CTRGladman})},"rAM+":function(I,J,P){"use strict";P.d(J,"a",function(){return u});var L=P("Qw5x");function u(S,R){var h;if(typeof Symbol=="undefined"||S[Symbol.iterator]==null){if(Array.isArray(S)||(h=Object(L.a)(S))||R&&S&&typeof S.length=="number"){h&&(S=h);var o=0,C=function(){};return{s:C,n:function(){return o>=S.length?{done:!0}:{done:!1,value:S[o++]}},e:function(l){throw l},f:C}}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,a=!1,i;return{s:function(){h=S[Symbol.iterator]()},n:function(){var l=h.next();return c=l.done,l},e:function(l){a=!0,i=l},f:function(){try{!c&&h.return!=null&&h.return()}finally{if(a)throw i}}}}},rUJ1:function(I,J){const P=/[&<>"']/,L=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,R={"&":"&","<":"<",">":">",'"':""","'":"'"},h=A=>R[A];function o(A,x){if(x){if(P.test(A))return A.replace(L,h)}else if(u.test(A))return A.replace(S,h);return A}const C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function c(A){return A.replace(C,(x,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 a=/(^|[^\[])\^/g;function i(A,x){A=A.source||A,x=x||"";const E={replace:(w,_)=>(_=_.source||_,_=_.replace(a,"$1"),A=A.replace(w,_),E),getRegex:()=>new RegExp(A,x)};return E}const r=/[^\w:]/g,l=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(A,x,E){if(A){let w;try{w=decodeURIComponent(c(E)).replace(r,"").toLowerCase()}catch(_){return null}if(w.indexOf("javascript:")===0||w.indexOf("vbscript:")===0||w.indexOf("data:")===0)return null}x&&!l.test(E)&&(E=n(x,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(w){return null}return E}const f={},b=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(A,x){f[" "+A]||(b.test(A)?f[" "+A]=A+"/":f[" "+A]=y(A,"/",!0)),A=f[" "+A];const E=A.indexOf(":")===-1;return x.substring(0,2)==="//"?E?x:A.replace(v,"$1")+x:x.charAt(0)==="/"?E?x:A.replace(m,"$1")+x:A+x}const d={exec:function(){}};function g(A){let x=1,E,w;for(;x<arguments.length;x++){E=arguments[x];for(w in E)Object.prototype.hasOwnProperty.call(E,w)&&(A[w]=E[w])}return A}function T(A,x){const E=A.replace(/\|/g,(N,j,k)=>{let z=!1,H=j;for(;--H>=0&&k[H]==="\\";)z=!z;return z?"|":" |"}),w=E.split(/ \|/);let _=0;if(w.length>x)w.splice(x);else for(;w.length<x;)w.push("");for(;_<w.length;_++)w[_]=w[_].trim().replace(/\\\|/g,"|");return w}function y(A,x,E){const w=A.length;if(w===0)return"";let _=0;for(;_<w;){const N=A.charAt(w-_-1);if(N===x&&!E)_++;else if(N!==x&&E)_++;else break}return A.substr(0,w-_)}function s(A,x){if(A.indexOf(x[1])===-1)return-1;const E=A.length;let w=0,_=0;for(;_<E;_++)if(A[_]==="\\")_++;else if(A[_]===x[0])w++;else if(A[_]===x[1]&&(w--,w<0))return _;return-1}function M(A){A&&A.sanitize&&!A.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")}I.exports={escape:o,unescape:c,edit:i,cleanUrl:p,resolveUrl:n,noopTest:d,merge:g,splitCells:T,rtrim:y,findClosingBracket:s,checkSanitizeDeprecation:M}},rWjI:function(I,J,P){"use strict";P.r(J),P.d(J,"Types",function(){return hr});var L=P("P2fV"),u=P("NJEC"),S=P("CiB2"),R=P("DYRE"),h=P("zeV3"),o=P("sRBo"),C=P("kaz8"),c=P("7Kak"),a=P("9yH6"),i=P("giR+"),r=P("fyUT"),l=P("OaEy"),p=P("2fM7"),f=P("oBTY"),b=P("rAM+"),v=P("T2oS"),m=P("W9HT"),n=P("g9YV"),d=P("wCAj"),g=P("+L6B"),T=P("2/Rp"),y=P("14J3"),s=P("BMrR"),M=P("jCWc"),A=P("kPKH"),x=P("miYZ"),E=P("tsqr"),w=P("9og8"),_=P("y8nQ"),N=P("Vl3Y"),j=P("tJVT"),k=P("k1fw"),z=P("fu2T"),H=P("gK9i"),F=P("2qtc"),G=P("kLXV"),B=P("5NDa"),W=P("5rEg"),K=P("WmNS"),q=P.n(K),re=P("q1tI"),ee=P.n(re),Ce=P("eRFJ"),xe=P.n(Ce),he=P("jrin"),ke,_e=p.a.Option,de;(function(Tt){Tt[Tt.language=0]="language",Tt[Tt.difficulty=1]="difficulty",Tt[Tt.category=2]="category",Tt[Tt.openOrNot=3]="openOrNot"})(de||(de={}));var ce=(ke={},Object(he.a)(ke,de.language,[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}]),Object(he.a)(ke,de.difficulty,[{title:"\u7B80\u5355",key:1},{title:"\u9002\u4E2D",key:2},{title:"\u56F0\u96BE",key:3}]),Object(he.a)(ke,de.category,[{title:"\u7A0B\u5E8F\u8BBE\u8BA1",key:1},{title:"\u7B97\u6CD5",key:2}]),Object(he.a)(ke,de.openOrNot,[{title:"\u516C\u5F00",key:1},{title:"\u79C1\u6709",key:0}]),ke);function ae(Tt){return ce[Tt].map(function(Dt){return ee.a.createElement(_e,{key:Dt.title,value:Dt.key}," ",Dt.title," ")})}function Se(Tt,Dt){Tt.map(function(Ct){var Rr=Ct.id,jr=Ct.name,$t=Ct.sub_disciplines,jt={value:Rr,label:jr};Dt.push(jt),$t&&$t.length>0&&(jt.children=[],Se($t,jt.children))})}function te(Tt,Dt){for(var Ct=[],Rr=0;Rr<Tt.length;Rr++){var jr,$t=Tt[Rr];if(((jr=$t.sub_disciplines)===null||jr===void 0?void 0:jr.length)>0){Ct[0]=$t.id;for(var jt=0;jt<$t.sub_disciplines.length;jt++){var Ur=$t.sub_disciplines[jt];if(Ur.id===Dt)return Ct[1]=Ur.id,[Ct,Ur.tag_disciplines||Ur.sub_disciplines||[]]}}}return[Ct,[]]}var ue=P("Ty5D"),Oe=P("9kvl"),le=P("J66h"),Q=P("GIiI"),Y=P("2BaD"),Z=P("Ot1p"),be=P("ErOA");function ge(Tt){return Object(be.f)("practices.json",Tt)}function De(){return Object(be.c)("problems/new.json")}function Qe(Tt){return Object(be.c)("practices/".concat(Tt,"/edit.json"))}function Ze(Tt,Dt){return Object(be.g)("practices/".concat(Tt),Dt)}function nt(Tt,Dt){return Object(be.f)("exercises/".concat(Tt,"/exercise_questions.json"),Dt)}function tt(Tt,Dt){return Object(be.g)("exercise_questions/".concat(Tt,".json"),Dt)}var lt=P("cDPC"),st=P("bbsP"),je=P("/wGt"),Re=P("0Owb"),et=P("ZW9T"),ct=P("ZD9Y"),$e=P("M8RZ"),qe=P("bCnd"),Ue=P("1T2W"),Me=P.n(Ue),Ie={theme:Object(qe.a)("cmCodeMode","vs-dark"),fontSize:Object(qe.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(qe.a)("cmTabToSpace",!0)},ye;(function(Tt){Tt[Tt.set_font_size=0]="set_font_size",Tt[Tt.set_theme=1]="set_theme",Tt[Tt.on_tab_to_space=2]="on_tab_to_space",Tt[Tt.set_show_editor_setting=3]="set_show_editor_setting"})(ye||(ye={}));function Te(Tt,Dt){switch(Dt.type){case ye.set_show_editor_setting:return Object(k.a)(Object(k.a)({},Tt),{},{showEditorSetting:Dt.payload});case ye.set_theme:return Object(k.a)(Object(k.a)({},Tt),{},{theme:Dt.payload});case ye.set_font_size:return Object(k.a)(Object(k.a)({},Tt),{},{fontSize:Dt.payload});case ye.on_tab_to_space:return Object(k.a)(Object(k.a)({},Tt),{},{tabToSpace:Dt.payload});default:throw new Error}}var Ae=function(Tt){var Dt=Tt.value,Ct=Tt.onChange,Rr=Tt.language,jr=Tt.onLanguage,$t=Tt.languageItems,jt=Tt.ActionBarRender,Ur=jt===void 0?function(me){return ee.a.createElement(Pe,{languageItems:$t,onLanguage:jr,language:Rr,onShowCodeSetting:me})}:jt,_n=Object(re.useReducer)(Te,Ie),Vr=Object(j.a)(_n,2),vt=Vr[0],Ft=Vr[1],rn=vt.theme,hn=vt.fontSize,An=vt.showEditorSetting,Rn=vt.tabToSpace;console.log(Dt,Rr,"value");var se={onFontSizeChange:function(ie){Ft({type:ye.set_font_size,payload:ie}),Object(qe.b)("cmFontSize",ie)},tabToSpace:Rn,cmFontSize:hn,className:"oj",cmCodeMode:rn,onTabToSpace:function(ie){Ft({type:ye.on_tab_to_space,payload:ie}),Object(qe.b)("cmTabToSpace",ie)},onCodeModeChange:function(ie){Ft({type:ye.set_theme,payload:ie}),Object(qe.b)("cmCodeMode",ie)}};function V(){Ft({type:ye.set_show_editor_setting,payload:!1})}function X(){Ft({type:ye.set_show_editor_setting,payload:!0})}var ne={value:Dt,language:Rr,onChange:Ct,theme:rn,height:"calc(100% - 56px)",options:{fontSize:hn,insertSpaces:Rn}};return ee.a.createElement(re.Fragment,null,ee.a.createElement("div",{className:Me.a["code-panel-container"]},Ur(X),ee.a.createElement(et.b,Object(Re.a)({key:Rr},ne))),ee.a.createElement($e.a,null,ee.a.createElement(je.a,{className:"oj",title:null,placement:"right",closable:!1,visible:An,onClose:V},ee.a.createElement(ct.a,se))))};function Pe(Tt){var Dt=Tt.languageItems,Ct=Tt.language,Rr=Tt.onShowCodeSetting,jr=Tt.onLanguage;return ee.a.createElement("div",{className:Me.a["action-oj-bar"]},Dt==null?void 0:Dt.map(function($t){return ee.a.createElement("div",{className:Ct===($t==null?void 0:$t.language)?Me.a.active:"",onClick:function(){return jr($t==null?void 0:$t.language)},key:$t==null?void 0:$t.language},$t==null?void 0:$t.language)}),ee.a.createElement("a",{onClick:Rr},ee.a.createElement("i",{className:"iconfont icon-shezhi"})))}var Xe=P("Znn+"),rt=P("ZTPi"),ft=P("L9qf"),St=P.n(ft),Pt=function(Dt){var Ct=Dt.visible,Rr=Dt.onOK,jr=Dt.onCancel,$t=Object(re.useState)(!1),jt=Object(j.a)($t,2),Ur=jt[0],_n=jt[1],Vr=Object(re.useState)(!1),vt=Object(j.a)(Vr,2),Ft=vt[0],rn=vt[1],hn=Object(re.useState)("1"),An=Object(j.a)(hn,2),Rn=An[0],se=An[1],V=Object(re.useState)(""),X=Object(j.a)(V,2),ne=X[0],me=X[1],ie=Object(re.useState)([]),ze=Object(j.a)(ie,2),pt=ze[0],ot=ze[1],It=function(){var Zr=Object(w.a)(q.a.mark(function Zt(){var Hr;return q.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:if(ne){Jt.next=3;break}return E.b.warn("\u9898\u76EE".concat(an,"\u4E0D\u80FD\u4E3A\u7A7A")),Jt.abrupt("return");case 3:return rn(!0),Jt.next=6,Object(be.a)("/api/tag_disciplines.json",{method:"post",body:{target:Ct,name:ne}});case 6:if(Hr=Jt.sent,!((Hr==null?void 0:Hr.status)===0)){Jt.next=10;break}return Rr(),Jt.abrupt("return");case 10:rn(!1);case 11:case"end":return Jt.stop()}},Zt)}));return function(){return Zr.apply(this,arguments)}}(),gt=function(){var Zr=Object(w.a)(q.a.mark(function Zt(){var Hr,fr,Jt=arguments;return q.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return Hr=Jt.length>0&&Jt[0]!==void 0?Jt[0]:"",_n(!0),vr.next=4,Object(be.a)("/api/tag_disciplines.json",{method:"get",params:{target:Ct,search:Hr}});case 4:fr=vr.sent,ot(fr.tag_disciplines||[]),_n(!1);case 7:case"end":return vr.stop()}},Zt)}));return function(){return Zr.apply(this,arguments)}}(),Ht=function(Zt){var Hr=Zt.name;G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u91CD\u547D\u540D",content:ee.a.createElement("div",null,ee.a.createElement(W.a,{defaultValue:Hr,placeholder:"\u8BF7\u8F93\u5165".concat(an,"\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57"),maxLength:20,onChange:function(Jt){Hr=Jt.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var fr=Object(w.a)(q.a.mark(function tr(){var vr;return q.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:if(Hr){ln.next=3;break}return E.b.warn("\u9898\u76EE".concat(an,"\u4E0D\u80FD\u4E3A\u7A7A")),ln.abrupt("return",Promise.reject());case 3:return ln.next=5,Object(be.a)("/api/tag_disciplines/".concat(Zt.id,"/rename.json"),{method:"post",body:{id:Zt.id,name:Hr}});case 5:vr=ln.sent,(vr==null?void 0:vr.status)===0&>();case 7:case"end":return ln.stop()}},tr)}));function Jt(){return fr.apply(this,arguments)}return Jt}()})},Xt=function(Zt){G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,width:570,title:"\u5220\u9664",content:Ct==="practice"?ee.a.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u6765\u6E90\u201C",ee.a.createElement("span",{className:"c-light-primary"},Zt.name),"\u201D\u5220\u9664\u5417\uFF1F",ee.a.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u6765\u6E90\u8FDB\u884C\u6E05\u9664\u3002"):ee.a.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u77E5\u8BC6\u70B9\u201C",ee.a.createElement("span",{className:"c-light-primary"},Zt.name),"\u201D\u5220\u9664\u5417\uFF1F",ee.a.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u77E5\u8BC6\u70B9\u8FDB\u884C\u6E05\u9664\u3002"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Hr=Object(w.a)(q.a.mark(function Jt(){var tr;return q.a.wrap(function(Xr){for(;;)switch(Xr.prev=Xr.next){case 0:return Xr.next=2,Object(be.a)("/api/tag_disciplines/".concat(Zt.id,".json"),{method:"delete",body:{id:Zt.id}});case 2:tr=Xr.sent,(tr==null?void 0:tr.status)===0&>();case 4:case"end":return Xr.stop()}},Jt)}));function fr(){return Hr.apply(this,arguments)}return fr}()})},Sr=function(Zt){gt(Zt)},an=Ct==="practice"?"\u77E5\u8BC6\u70B9":"\u6765\u6E90";return ee.a.createElement(G.a,{afterClose:function(){rn(!1),_n(!1),me(""),se("1"),ot([])},centered:!0,keyboard:!1,width:600,title:"".concat(an,"\u7BA1\u7406"),visible:!!Ct,className:St.a.customModal,footer:null,onCancel:jr},ee.a.createElement("section",{className:St.a.wrap},ee.a.createElement(rt.a,{activeKey:Rn,onChange:function(Zt){me(""),se(Zt),gt()}},ee.a.createElement(rt.a.TabPane,{tab:"\u65B0\u589E".concat(an),key:"1"},ee.a.createElement(W.a,{value:ne,onChange:function(Zt){return me(Zt.target.value)},className:St.a.in,placeholder:"\u8F93\u5165".concat(an,"\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57"),maxLength:20}),ee.a.createElement("div",{className:St.a.btns},ee.a.createElement(T.a,{onClick:jr,className:"mr20"},"\u53D6\u6D88 "),ee.a.createElement(T.a,{loading:Ft,onClick:It,type:"primary"},"\u786E\u8BA4\u65B0\u5EFA"))),ee.a.createElement(rt.a.TabPane,{tab:"\u5DF2\u6709".concat(an),key:"2"},ee.a.createElement(W.a.Search,{allowClear:!0,onSearch:Sr,value:ne,onChange:function(Zt){return me(Zt.target.value)},className:St.a.in,placeholder:"\u8F93\u5165".concat(an,"\u540D\u79F0\u8FDB\u884C\u67E5\u8BE2")}),ee.a.createElement(d.a,{dataSource:pt,bordered:!1,loading:Ur,scroll:pt.length>7?{y:300}:{},style:{padding:"0 40px 20px 40px"},columns:[{title:"".concat(an,"\u540D\u79F0"),dataIndex:"name",ellipsis:!0},{title:"\u64CD\u4F5C",dataIndex:"action",width:120,render:function(Zt,Hr){return ee.a.createElement("span",null,ee.a.createElement("span",{onClick:function(){return Ht(Hr)},className:"current mr10 c-light-primary"},"\u91CD\u547D\u540D"),ee.a.createElement("span",{onClick:function(){return Xt(Hr)},className:"current c-grey-666"},"\u5220\u9664"))}}],pagination:!1})))))},dt=Pt,At=P("m3rI"),Ot=P("B7Ph"),bt=P("wd/R"),Vt=P.n(bt),ir=P("1vsH"),Qt=P("9Bee"),dr=P("xKgJ"),Nt=W.a.TextArea,br=G.a.confirm,ur=H.a.Panel,wt={loading:!0,user:null,status:0,data:void 0,lastedUpdateTime:0},hr;(function(Tt){Tt[Tt.SET_INITAL_DATA=0]="SET_INITAL_DATA",Tt[Tt.SET_LOADING=1]="SET_LOADING",Tt[Tt.SET_STATUS=2]="SET_STATUS"})(hr||(hr={}));var Qr="#### \u9898\u76EE\u63CF\u8FF0\n\u73B0\u6709\u4E00\u4E2A\u6574\u578B\u6570\u7EC4 `nums`\uFF0C\u8BF7\u7F16\u5199\u7A0B\u5E8F\u5C06\u6570\u7EC4 `nums` \u4E2D\u7684\u6240\u6709 `$$0$$` \u79FB\u52A8\u5230\u6570\u7EC4\u7684\u672B\u5C3E\uFF0C\u4F46\u4E0D\u6539\u53D8\u975E\u96F6\u5143\u7D20\u5728\u6570\u7EC4\u4E2D\u7684\u76F8\u5BF9\u4F4D\u7F6E\u3002\u8BF7\u5728\u539F\u6570\u7EC4 `nums` \u4E0A\u8FDB\u884C\u64CD\u4F5C\u3002\n#### \u8F93\u5165\u8F93\u51FA\u683C\u5F0F\n**\u8F93\u5165\u683C\u5F0F**\n\u7B2C\u4E00\u884C\u6709\u4E00\u4E2A\u6574\u6570 `numsSize`\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u5927\u5C0F\uFF1B\n\u7B2C\u4E8C\u884C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n**\u8F93\u51FA\u683C\u5F0F**\n\u4E00\u884C\u8F93\u51FA\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B1\n**\u8F93\u5165**\n`4`\n`0 1 2 3`\n**\u8F93\u51FA**\n`1 2 3 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B2\n**\u8F93\u5165**\n`5`\n`1 1 0 1 0`\n**\u8F93\u51FA**\n`1 1 1 0 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8BF4\u660E\u63D0\u793A\n-`1\u2264n\u2264100`";function Gr(Tt,Dt){switch(Dt.type){case hr.SET_INITAL_DATA:return Object(k.a)(Object(k.a)({},Tt),Dt.payload);case hr.SET_LOADING:return Object(k.a)(Object(k.a)({},Tt),{},{loading:Dt.payload});case hr.SET_STATUS:return Object(k.a)(Object(k.a)({},Tt),{},{status:Dt.payload});default:throw new Error}}var Lr=J.default=function(){var Tt,Dt,Ct,Rr=Object(ue.h)(),jr=Object(ue.g)(),$t=Object(ue.i)(),jt=$t.id,Ur=N.a.useForm(),_n=Object(j.a)(Ur,1),Vr=_n[0],vt=Object(re.useState)(),Ft=Object(j.a)(vt,2),rn=Ft[0],hn=Ft[1],An=Object(re.useState)(!1),Rn=Object(j.a)(An,2),se=Rn[0],V=Rn[1],X=Object(re.useState)([]),ne=Object(j.a)(X,2),me=ne[0],ie=ne[1],ze=Object(re.useState)([]),pt=Object(j.a)(ze,2),ot=pt[0],It=pt[1],gt=Object(re.useState)([]),Ht=Object(j.a)(gt,2),Xt=Ht[0],Sr=Ht[1],an=Object(re.useState)([]),Zr=Object(j.a)(an,2),Zt=Zr[0],Hr=Zr[1],fr=Object(re.useState)([]),Jt=Object(j.a)(fr,2),tr=Jt[0],vr=Jt[1],Xr=Object(re.useState)("C"),ln=Object(j.a)(Xr,2),mn=ln[0],li=ln[1],Ki=Object(re.useReducer)(Gr,wt),Ui=Object(j.a)(Ki,2),Fn=Ui[0],qr=Ui[1],Oi=Fn.loading,on=Fn.data,Zn=Fn.user,Yr=Fn.status,cr=on==null?void 0:on.hack_sets,en=on==null||((Tt=on.hack)===null||Tt===void 0)?void 0:Tt.test_set_average,Mr=Object(re.useState)(!1),En=Object(j.a)(Mr,2),Fr=En[0],xi=En[1],gn=Object(re.useRef)([]),On=Object(re.useState)(!1),ui=Object(j.a)(On,2),ci=ui[0],qn=ui[1],Ei=Object(re.useState)(!1),Yn=Object(j.a)(Ei,2),Ai=Yn[0],zn=Yn[1],fi=Object(re.useRef)(!0),pi=Object(re.useState)({}),ei=Object(j.a)(pi,2),$r=ei[0],$i=ei[1];Object(re.useEffect)(function(){return Object(Oe.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(Oe.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(Oe.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(Oe.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(re.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)});var ta=function(){var rr=Object(w.a)(q.a.mark(function Mt(){var pr,mr;return q.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:return Tr.next=2,Object(be.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice"}});case 2:return pr=Tr.sent,Tr.next=5,Object(be.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice_source"}});case 5:mr=Tr.sent,It(pr.tag_disciplines||[]),Sr(mr.tag_disciplines||[]);case 8:case"end":return Tr.stop()}},Mt)}));return function(){return rr.apply(this,arguments)}}(),Ni=[{language:"C",code:""},{language:"C++",code:""},{language:"Java",code:""},{language:"Python",code:""}],Ji=Object(re.useCallback)(Object(w.a)(q.a.mark(function rr(){var Mt,pr,mr,tn,Tr,Dn,wn,ki,Bn,Kn,$n,Xi,Ne,Ge,Je,Fe,ve,Le,we,Be,He,Ye,Ve,it,ht,Et,xt;return q.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(qr({type:hr.SET_LOADING,payload:!0}),!jt){Yt.next=19;break}return Yt.next=4,Qe(jt);case 4:Mt=Yt.sent,pr=Mt.user,mr=Mt.language,tn=Mt.practice_sets,Tr=Mt.practice_codes,Dn=Mt.description,wn=Mt.difficulty,ki=Mt.name,Bn=Mt.open_or_not,Kn=Mt.time_limit,$n=Mt.test_set_average,Xi=Mt.test_set_score,Ne=Mt.status,Ge=Mt.tag_discipline_ids,Je=Mt.source_discipline_ids,Fe=Mt.item_banks_group_id,ve=Mt.is_file,Le=ve===void 0?!1:ve,we=Mt.hide_actual_output,Be=Mt.review_privilege,He=Mt.review_description,Ye={review_privilege:Be,status:Ne,review_description:He,name:ki},$i(Ye),xi(we),Ve=Le?[{input:"",output:"",score:100,position:1}]:tn,Le?(ie(tn),Vr.setFieldsValue({hack_sets:Ve})):ie([]),it={loading:!0,user:pr,status:Ne,data:{hack:{difficulty:wn,name:ki,description:Dn,open_or_not:Bn,time_limit:Kn,test_set_average:$n,test_set_score:Xi,tag_discipline_ids:Ge,source_discipline_ids:Je,is_file:Le},hack_sets:Ve}},qr({type:hr.SET_INITAL_DATA,payload:it}),hn({hack:{difficulty:wn,name:ki,description:Dn,open_or_not:Bn,time_limit:Kn,test_set_average:$n,test_set_score:Xi,tag_discipline_ids:Ge,source_discipline_ids:Je,is_file:Le}}),ht=Tr==null?void 0:Tr.map(function(gr){return Object(k.a)(Object(k.a)({},gr),{},{code:le.Base64.decode(gr==null?void 0:gr.code)})}),vr(ht),gn.current=ht,Yt.next=27;break;case 19:return Yt.next=21,De();case 21:Et=Yt.sent,xt=Et.user,qr({type:hr.SET_INITAL_DATA,payload:{loading:!0,status:0,user:xt,data:{hack:{difficulty:"",time_limit:3,description:Qr,test_set_score:!0,test_set_average:!0,open_or_not:!0,name:"",is_file:!1},hack_sets:[{input:"",output:"",score:100,position:1}]}}}),hn({hack:{difficulty:"",time_limit:3,description:"",test_set_average:!0,open_or_not:!0,name:"",is_file:!1}}),vr(Ni),gn.current=Ni;case 27:qr({type:hr.SET_LOADING,payload:!1});case 28:case"end":return Yt.stop()}},rr)})),[jt]);Object(re.useEffect)(function(){try{Ji(),ta()}catch(rr){console.log(rr,"----")}},[]);function Gi(rr,Mt){return Bt.apply(this,arguments)}function Bt(){return Bt=Object(w.a)(q.a.mark(function rr(Mt,pr){var mr,tn,Tr,Dn,wn,ki,Bn,Kn,$n,Xi,Ne,Ge,Je,Fe,ve,Le,we,Be;return q.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:tn=Object(k.a)({},Mt),Tr=tn.hack_sets,Dn=tn.hack,Dn.hide_actual_output=Fr,wn=[],ki=[],Bn=0,Kn=Dn!=null&&Dn.is_file?me.map(function(Ve,it){return Object(k.a)(Object(k.a)({},Ve),{},{position:it+1})}):Tr.map(function(Ve){return Object(k.a)(Object(k.a)({},Ve),{},{is_file:!1})}),$n=Object(b.a)(Kn);try{for($n.s();!(Xi=$n.n()).done;)Ne=Xi.value,Bn+=Ne.score,Ne.id&&Ne.id>=0?wn.push(Ne):ki.push(Ne)}catch(Ve){$n.e(Ve)}finally{$n.f()}if(Kn!=null&&Kn.length){Ye.next=11;break}return E.b.error("\u6D4B\u8BD5\u96C6\u4E0D\u80FD\u4E3A\u7A7A"),Ye.abrupt("return");case 11:if(!(Bn!==100&&!Dn.test_set_score)){Ye.next=14;break}return E.b.error("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),Ye.abrupt("return");case 14:if(!(Kn!=null&&Kn.some(function(Ve){return!Ve.output}))){Ye.next=17;break}return E.b.error("\u6D4B\u8BD5\u96C6\u8F93\u51FA\u4E0D\u80FD\u4E3A\u7A7A"),Ye.abrupt("return");case 17:if(fi.current?qn(!0):zn(!0),Je=tr==null?void 0:tr.map(function(Ve){return Object(k.a)(Object(k.a)({},Ve),{},{code:le.Base64.encode(Ve==null?void 0:Ve.code)})}),!jt){Ye.next=25;break}return Ye.next=22,Ze(jt,{practice:Dn,practice_codes:Je,practice_sets:ki,update_practice_sets:wn});case 22:Ge=Ye.sent,Ye.next=28;break;case 25:return Ye.next=27,ge({practice:Dn,practice_codes:Je,practice_sets:Kn,publish:!fi.current});case 27:Ge=Ye.sent;case 28:if(qn(!1),zn(!1),!(((mr=Ge)===null||mr===void 0?void 0:mr.status)===0)){Ye.next=46;break}if(!((Fe=Ge)!==null&&Fe!==void 0&&(ve=Fe.similar_practice)!==null&&ve!==void 0&&ve.length)){Ye.next=35;break}return V(!0),Hr((Le=Ge)===null||Le===void 0?void 0:Le.similar_practice),Ye.abrupt("return");case 35:if(!jt){Ye.next=44;break}if(E.b.success("\u4FDD\u5B58\u6210\u529F"),fi.current){Ye.next=42;break}return Ye.next=40,Object(be.a)("/api/practices/".concat(jt,"/start"),{method:"get"});case 40:we=Ye.sent,(we==null?void 0:we.status)===0&&jr.push("/problems/".concat(we==null?void 0:we.identifier,"/oj/").concat(jt));case 42:Ye.next=46;break;case 44:E.b.success("\u65B0\u5EFA\u6210\u529F"),jr.replace("/problems/".concat((Be=Ge)===null||Be===void 0?void 0:Be.identifier,"/ojedit"));case 46:case"end":return Ye.stop()}},rr)})),Bt.apply(this,arguments)}function ar(){jr.replace("/problems")}var Kt=function(Mt){var pr=Math.floor(100/Mt.length),mr=pr+100%Mt.length;Mt=Mt.map(function(tn,Tr){return Tr===Mt.length-1?Object(k.a)(Object(k.a)({},tn),{},{score:mr}):Object(k.a)(Object(k.a)({},tn),{},{score:pr})}),ie(Mt)};function xr(rr){rr.target.value||Kt(me),qr({type:hr.SET_INITAL_DATA,payload:{data:Object(k.a)(Object(k.a)({},on),{},{hack:Object(k.a)(Object(k.a)({},on.hack),{},{test_set_score:rr.target.value})})}})}function Dr(rr){qr({type:hr.SET_INITAL_DATA,payload:{data:Object(k.a)(Object(k.a)({},on),{},{hack:Object(k.a)(Object(k.a)({},on.hack),{},{is_file:rr.target.value})})}})}function Br(rr){xi(rr.target.checked)}function Or(rr){var Mt=rr.target.value;Mt&&Kt(me),qr({type:hr.SET_INITAL_DATA,payload:{data:Object(k.a)(Object(k.a)({},on),{},{hack:Object(k.a)(Object(k.a)({},on.hack),{},{test_set_average:Mt})})}})}function un(){var rr=Vr.getFieldValue("hack_sets"),Mt=rr.length+1,pr=Math.floor(100/Mt),mr=100%Mt;rr.map(function(tn,Tr){return en&&(tn.score=pr),tn.position=Tr+1,tn}),rr.push({input:"",output:"",position:Mt,score:en?pr+mr:0}),Vr.setFieldsValue({hack_sets:rr}),qr({type:hr.SET_INITAL_DATA,payload:{data:Object(k.a)(Object(k.a)({},on),{},{hack_sets:rr})}})}Object(re.useEffect)(function(){if(en){var rr=cr==null?void 0:cr.length,Mt=Math.floor(100/rr),pr=100%rr;cr==null||cr.map(function(mr,tn){return mr.score=Mt,mr.position=tn+1,tn===rr-1&&(mr.score=Mt+pr),mr}),qr({type:hr.SET_INITAL_DATA,payload:{data:Object(k.a)(Object(k.a)({},on),{},{hack_sets:cr})}}),Vr.setFieldsValue({hack_sets:cr})}},[en]);function Pn(rr){var Mt=Vr.getFieldValue("hack_sets"),pr=(Mt==null?void 0:Mt.length)-1,mr=Math.ceil(100/pr),tn=100%pr;Mt.splice(rr,1),Mt==null||Mt.map(function(Tr,Dn){return en&&(Tr.score=mr,Dn===pr-1&&(Tr.score=mr+tn)),Tr.position=Dn+1,Tr}),qr({type:hr.SET_INITAL_DATA,payload:{data:Object(k.a)(Object(k.a)({},on),{},{hack_sets:Mt})}}),Vr.setFieldsValue({hack_sets:Mt})}function Er(rr){li(rr)}var Ri=function(Mt){var pr,mr=(pr=gn.current)===null||pr===void 0?void 0:pr.findIndex(function(tn){return tn.language===mn});gn.current[mr].code=Mt,vr(gn.current)},Gt=function(Mt){hn(Object(k.a)({},Vr.getFieldsValue()))},or=function(){var rr=Object(w.a)(q.a.mark(function Mt(pr){var mr;return q.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:return Tr.next=2,Object(be.a)("/api/practices/".concat(pr,"/start"),{method:"get"});case 2:mr=Tr.sent,(mr==null?void 0:mr.status)===0&&Object(ir.Q)("/problems/".concat(mr==null?void 0:mr.identifier,"/oj/").concat(pr));case 4:case"end":return Tr.stop()}},Mt)}));return function(pr){return rr.apply(this,arguments)}}(),sr=function(){var rr=Object(w.a)(q.a.mark(function Mt(){var pr,mr,tn,Tr,Dn,wn;return q.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Qe(jt);case 2:pr=Bn.sent,mr=pr.name,tn=pr.status,Tr=pr.review_privilege,Dn=pr.review_description,wn={review_privilege:Tr,status:tn,review_description:Dn,name:mr},$i(wn);case 6:case"end":return Bn.stop()}},Mt)}));return function(){return rr.apply(this,arguments)}}(),vn=function(){var Mt="";G.a.confirm({icon:null,width:700,className:"custom-modal-divider",centered:!0,title:"\u4E0D\u901A\u8FC7\u539F\u56E0",content:ee.a.createElement("div",{className:"mt20"},ee.a.createElement(Z.a,{className:xe.a.MdEditor,defaultValue:Mt,onChange:function(mr){Mt=mr}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var pr=Object(w.a)(q.a.mark(function tn(){var Tr;return q.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(Mt){wn.next=3;break}return E.b.warn("\u4E0D\u901A\u8FC7\u539F\u56E0\u4E0D\u80FD\u4E3A\u7A7A"),wn.abrupt("return",Promise.reject());case 3:return wn.next=5,Object(be.a)("/api/practices/".concat(jt,"/review.json"),{method:"post",body:{op:"fail",description:Mt}});case 5:Tr=wn.sent,(Tr==null?void 0:Tr.status)===0&&(E.b.success("\u63D0\u4EA4\u6210\u529F"),sr());case 7:case"end":return wn.stop()}},tn)}));function mr(){return pr.apply(this,arguments)}return mr}()})},Di=function(){var rr=Object(w.a)(q.a.mark(function Mt(){return q.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u63D0\u793A",content:"\u786E\u8BA4\u5C06\u9898\u76EE\u300A".concat($r==null?void 0:$r.name,"\u300B\u7684\u5BA1\u6838\u901A\u8FC7\u5417\uFF1F"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var tn=Object(w.a)(q.a.mark(function Dn(){var wn;return q.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Object(be.a)("/api/practices/".concat(jt,"/review.json"),{method:"post",body:{op:"pass"}});case 2:wn=Bn.sent,(wn==null?void 0:wn.status)===0&&(E.b.success("\u63D0\u4EA4\u6210\u529F"),sr());case 4:case"end":return Bn.stop()}},Dn)}));function Tr(){return tn.apply(this,arguments)}return Tr}()});case 1:case"end":return mr.stop()}},Mt)}));return function(){return rr.apply(this,arguments)}}(),Vi=function(){var Mt=G.a.confirm({icon:null,width:700,className:"".concat(xe.a.cusModal," custom-modal-divider"),centered:!0,title:ee.a.createElement(s.a,null,ee.a.createElement(A.a,{flex:"1"},"\u4E0D\u901A\u8FC7\u539F\u56E0"),ee.a.createElement(A.a,null,ee.a.createElement("span",{className:"iconfont icon-guanbi7 font12 current c-grey-c",onClick:function(){return Mt.destroy()}}))),content:ee.a.createElement("div",null,ee.a.createElement(Qt.a,{className:"mt20",value:($r==null?void 0:$r.review_description)||""}))})};return ee.a.createElement(m.a,{spinning:Oi,size:"large",className:xe.a["oj-custom-large-spin"]},on?ee.a.createElement(re.Fragment,null,ee.a.createElement("header",{className:xe.a.header},ee.a.createElement("div",null,ee.a.createElement("img",{src:"".concat(At.a.IMG_SERVER,"/images/").concat(Zn==null?void 0:Zn.image_url),alt:"user",width:30}),ee.a.createElement("span",null,Zn==null?void 0:Zn.name)),ee.a.createElement("h2",null," ",on==null||((Dt=on.hack)===null||Dt===void 0)?void 0:Dt.name," "),jt?ee.a.createElement("a",{className:xe.a.btn_back,onClick:ar}," ",ee.a.createElement(Q.a,null),"\u9000\u51FA"):null),ee.a.createElement(N.a,{form:Vr,initialValues:on,layout:"vertical",className:xe.a["oj-form-container"],onValuesChange:Gt,onFinish:Gi},ee.a.createElement(lt.a,{hideResize:!0,className:xe.a["oj-problems"],leftChild:ee.a.createElement(si,{formValue:rn,onRemoveTestCase:Pn,onAddTestCase:un,hack:on.hack,onChangeScore:xr,onChangehide:Br,onChangeAverage:Or,onChangeFile:Dr,uploadData:me,setUploadData:ie,handleUploadRatio:Kt,ischecked:Fr,pointData:ot,sourceData:Xt,getPointData:ta}),rightChild:ee.a.createElement(Ae,{value:tr==null||((Ct=tr.find(function(rr){return rr.language===mn}))===null||Ct===void 0)?void 0:Ct.code,onChange:Ri,onLanguage:Er,languageItems:tr,language:mn})}),ee.a.createElement("div",{className:xe.a.footer},!!jt&&ee.a.createElement("div",{className:xe.a.result},ee.a.createElement("span",null,"\u5BA1\u6838\u7ED3\u679C:"),$r!=null&&$r.review_privilege?ee.a.createElement(ee.a.Fragment,null,ee.a.createElement("div",{onClick:Di,className:xe.a.pass},"\u901A\u8FC7"),ee.a.createElement("div",{onClick:vn,className:xe.a.noPass},"\u4E0D\u901A\u8FC7")):ee.a.createElement(ee.a.Fragment,null,($r==null?void 0:$r.status)===0&&ee.a.createElement("div",{className:xe.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u53D1\u5E03"),($r==null?void 0:$r.status)===1&&ee.a.createElement("div",{className:xe.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5DF2\u516C\u5F00"),($r==null?void 0:$r.status)===2&&ee.a.createElement("div",{className:xe.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u5BA1\u6279"),($r==null?void 0:$r.status)===3&&ee.a.createElement("div",{className:xe.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u4E2D"),($r==null?void 0:$r.status)===4&&ee.a.createElement("div",{className:xe.a.passText},ee.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u5B8C\u6210\u5F85\u516C\u5F00"),($r==null?void 0:$r.status)===5&&ee.a.createElement("div",{className:xe.a.noPassText},ee.a.createElement("i",{className:"iconfont icon-weitongguo1"}),"\u5BA1\u6838\u4E0D\u901A\u8FC7",ee.a.createElement("span",{onClick:Vi},"\u67E5\u770B\u539F\u56E0")))),ee.a.createElement(T.a,{type:"primary",ghost:!0,onClick:ar},"\u9000\u51FA\u7F16\u8F91"),ee.a.createElement(T.a,{disabled:Ai,loading:ci,type:"primary",onClick:function(){fi.current=!0,Vr.submit()}},"\u4FDD\u5B58 "),jt?ee.a.createElement(T.a,{disabled:ci,loading:Ai,style:{background:"#2FC25B",border:0},type:"primary",onClick:function(){fi.current=!1,Vr.submit()}},"\u7ACB\u5373\u4F53\u9A8C"):ee.a.createElement(T.a,{disabled:ci,loading:Ai,type:"primary",onClick:function(){fi.current=!1,Vr.submit()}},"\u4FDD\u5B58\u5E76\u53D1\u5E03\u5BA1\u6838")))):null,ee.a.createElement(G.a,{centered:!0,destroyOnClose:!0,footer:null,visible:se,onCancel:function(){return V(!1)},title:"\u76F8\u4F3C\u6027\u68C0\u6D4B",width:"600px"},ee.a.createElement("div",null,ee.a.createElement("p",{className:"font14"},"\u7ECF\u7CFB\u7EDF\u68C0\u6D4B\u53D1\u73B0\uFF0C\u672C\u9898\u76EE\u4E0E\u7CFB\u7EDF\u4E2D\u5DF2\u521B\u5EFA\u7684\u9898\u76EE\u9AD8\u5EA6\u96F7\u540C\uFF0C\u8BF7\u8C03\u6574\u9898\u76EE\u540E\u518D\u8FDB\u884C\u4FDD\u5B58"),ee.a.createElement(d.a,{dataSource:Zt,bordered:!1,scroll:Zt.length>7?{y:300}:{},columns:[{title:"\u76F8\u4F3C\u9898\u9898\u76EE",dataIndex:"name",ellipsis:!0,render:function(Mt,pr){return ee.a.createElement("span",{onClick:function(){return or(pr==null?void 0:pr.identifier)},style:{textDecorationLine:"underline"},className:"current c-light-primary"},Mt)}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"create_time",width:170,render:function(Mt){var pr;return(pr=Vt()(Mt))===null||pr===void 0?void 0:pr.format("YYYY-MM-DD HH:mm")}}],pagination:!1}))))};function si(Tt){var Dt,Ct,Rr=Tt.ischecked,jr=Tt.formValue,$t=Tt.hack,jt=Tt.onChangeAverage,Ur=Tt.onChangeScore,_n=Tt.onChangehide,Vr=Tt.onChangeFile,vt=Tt.onAddTestCase,Ft=Tt.onRemoveTestCase,rn=Tt.uploadData,hn=Tt.setUploadData,An=Tt.handleUploadRatio,Rn=Tt.pointData,se=Tt.sourceData,V=Tt.getPointData,X=$t.test_set_average,ne=$t.test_set_score,me=Object(re.useState)(!1),ie=Object(j.a)(me,2),ze=ie[0],pt=ie[1],ot=Object(re.useState)(!1),It=Object(j.a)(ot,2),gt=It[0],Ht=It[1],Xt=function(Jt,tr){var vr=Object(f.a)(rn);vr.splice(tr,1),X?An(vr):hn(vr)},Sr=function(Jt,tr){console.log(Jt,tr);var vr=rn.map(function(Xr,ln){return ln===tr?Object(k.a)(Object(k.a)({},Xr),{},{score:Jt.target.value?Number(Jt.target.value):0}):Xr});hn(vr)},an=function(Jt){var tr=rn.concat(Jt);$t.test_set_average?An(tr):hn(tr)};function Zr(fr){fr.stopPropagation()}function Zt(){if(Object(dr.w)()){Ht("practice");return}var fr="";G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",content:ee.a.createElement("div",null,ee.a.createElement(W.a,{placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:function(tr){fr=tr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Jt=Object(w.a)(q.a.mark(function vr(){var Xr;return q.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Object(be.a)("/api/tag_disciplines.json",{method:"post",body:{target:"practice",name:fr}});case 2:Xr=mn.sent,(Xr==null?void 0:Xr.status)===0&&V();case 4:case"end":return mn.stop()}},vr)}));function tr(){return Jt.apply(this,arguments)}return tr}()})}function Hr(){if(Object(dr.w)()){Ht("practice_source");return}var fr="";G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u6765\u6E90",content:ee.a.createElement("div",null,ee.a.createElement(W.a,{placeholder:"\u8BF7\u8F93\u5165\u6765\u6E90\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:function(tr){fr=tr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Jt=Object(w.a)(q.a.mark(function vr(){var Xr;return q.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Object(be.a)("/api/tag_disciplines.json",{method:"post",body:{target:"practice_source",name:fr}});case 2:Xr=mn.sent,(Xr==null?void 0:Xr.status)===0&&V();case 4:case"end":return mn.stop()}},vr)}));function tr(){return Jt.apply(this,arguments)}return tr}()})}return ee.a.createElement("div",{className:xe.a["oj-left-panel"]},ee.a.createElement("div",{className:xe.a["oj-form-info"]},ee.a.createElement(N.a.Item,{label:"\u9898\u76EE\u540D\u79F0",name:["hack","name"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0"}],className:xe.a.inputOne},ee.a.createElement(W.a,{bordered:!1,maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0",suffix:ee.a.createElement("span",null,(jr==null||((Dt=jr.hack)===null||Dt===void 0||((Ct=Dt.name)===null||Ct===void 0))?void 0:Ct.length)||0,"/",ee.a.createElement("span",{className:"c-grey-999"},"60"))})),ee.a.createElement(N.a.Item,{name:["hack","description"],valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},ee.a.createElement(Z.a,{placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u63CF\u8FF0\u2026",miniToolbar:!0,id:"moop_cases_content",noStorage:!0,height:200})),ee.a.createElement("div",{className:xe.a.row},ee.a.createElement("div",{className:xe.a.a},ee.a.createElement(N.a.Item,{label:"\u96BE\u6613\u5EA6",name:["hack","difficulty"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},ee.a.createElement(p.a,null,ae(de.difficulty)))),ee.a.createElement("div",{className:xe.a.b},ee.a.createElement(N.a.Item,{label:"\u9898\u76EE\u6765\u6E90",name:["hack","source_discipline_ids"]},ee.a.createElement(p.a,{placeholder:"\u9009\u62E9\u9898\u76EE\u6765\u6E90",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:function(Jt){return Jt.parentNode}},se.map(function(fr){return ee.a.createElement(p.a.Option,{key:fr.id,value:fr.id},fr.name)}))),ee.a.createElement(T.a,{style:{padding:"0 18px"},type:"primary",ghost:!0,onClick:function(){return Hr()}},Object(dr.w)()?"\u6765\u6E90\u7BA1\u7406":"\u65B0\u5EFA\u6765\u6E90"))),ee.a.createElement("div",{className:xe.a.row},ee.a.createElement("div",{className:xe.a.b,style:{width:"100%",marginLeft:0}},ee.a.createElement(N.a.Item,{label:"\u77E5\u8BC6\u70B9",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"}],name:["hack","tag_discipline_ids"]},ee.a.createElement(p.a,{placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:function(Jt){return Jt.parentNode}},Rn.map(function(fr){return ee.a.createElement(p.a.Option,{key:fr.id,value:fr.id},fr.name)}))),ee.a.createElement(T.a,{type:"primary",ghost:!0,onClick:function(){return Zt()}},Object(dr.w)()?"\u77E5\u8BC6\u70B9\u7BA1\u7406":"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))),ee.a.createElement("div",{className:xe.a.field},ee.a.createElement(N.a.Item,{label:"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236",name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],className:xe.a.inputTwo,extra:ee.a.createElement("span",{style:{position:"absolute",left:200,top:11,color:"#333"}},"\u79D2",ee.a.createElement("span",{className:"ml5 c-grey-999"},"(\u4EE3\u7801\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F)"))},ee.a.createElement(r.a,{style:{width:185},min:3}))),ee.a.createElement("div",{className:"tst-case-info"},ee.a.createElement("h3",{className:"flex-container",style:{justifyContent:"space-between"}}," ","\u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219",!$t.is_file&&ee.a.createElement(T.a,{style:{height:40},type:"primary",ghost:!0,onClick:vt},"\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B")),ee.a.createElement(N.a.Item,{name:["hack","test_set_score"]},ee.a.createElement(a.a.Group,{onChange:Ur},ee.a.createElement(a.a,{value:!0},"\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6",ee.a.createElement("span",{className:"tip"}," ","\uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u4EC5\u5F53\u6240\u6709\u6D4B\u8BD5\u96C6\u90FD\u6B63\u786E\u65F6\uFF0C\u624D\u83B7\u5F97\u4E00\u6B21\u6027\u5956\u52B1\uFF09")),ee.a.createElement(a.a,{value:!1},"\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6",ee.a.createElement("span",{className:"tip"}," ","\uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u901A\u8FC7\u6D4B\u8BD5\u96C6\u5373\u53EF\u83B7\u5F97\u5BF9\u5E94\u5956\u52B1\uFF09")))),ee.a.createElement(C.a,{style:{marginBottom:"5px"},checked:Rr,onChange:_n},"\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u505A\u9898\u8FC7\u7A0B\u4E2D\u65E0\u6CD5\u770B\u5230\u5B9E\u9645\u8F93\u51FA\u7ED3\u679C\uFF0C\u4EC5\u5C55\u793A\u662F\u5426\u8BC4\u6D4B\u662F\u5426\u901A\u8FC7\uFF09"),ee.a.createElement(N.a.Item,{className:xe.a.testJi,name:["hack","is_file"],label:"\u7528\u4F8B\u7C7B\u578B:"},ee.a.createElement(a.a.Group,{onChange:Vr},ee.a.createElement(h.a,{direction:"horizontal"},ee.a.createElement(a.a,{value:!1},"\u6587\u672C"),ee.a.createElement(a.a,{value:!0},"\u6587\u4EF6")))),!$t.test_set_score&&ee.a.createElement(N.a.Item,{name:["hack","test_set_average"],label:"\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4"},ee.a.createElement(a.a.Group,{onChange:jt},ee.a.createElement(a.a,{value:!0},"\u5747\u5206\u6BD4\u4F8B"),ee.a.createElement(a.a,{value:!1},"\u81EA\u5B9A\u4E49\u6BD4\u4F8B"))),$t.is_file&&ee.a.createElement("div",{className:xe.a.upBtn},ee.a.createElement(T.a,{ghost:!0,type:"primary",className:"mb20",onClick:function(){return pt(!0)}},"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"),ee.a.createElement(Ot.a,{disabled:$t==null?void 0:$t.test_set_average,inputChange:Sr,showScore:!$t.test_set_score,data:rn,onRemove:Xt})),!$t.is_file&&ee.a.createElement(N.a.List,{name:"hack_sets"},function(fr,Jt){return Object(S.a)(Jt),ee.a.createElement(H.a,{accordion:!0},fr.map(function(tr,vr){return ee.a.createElement(ur,{key:"".concat(tr.key,"--").concat(vr),header:ee.a.createElement("a",{className:xe.a["test-case-name"]},ee.a.createElement("span",null,"\u6D4B\u8BD5\u7528\u4F8B",vr+1),ne?null:ee.a.createElement(ee.a.Fragment,null,ee.a.createElement(N.a.Item,{name:[tr.name,"score"],fieldKey:[tr.fieldKey,"score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6".concat(vr+1,"\u8BC4\u5206")}]},ee.a.createElement(r.a,{onClick:Zr,min:0,max:100,disabled:X})),ee.a.createElement("span",null,"%"))),extra:vr>0?ee.a.createElement("div",{onClick:Zr},ee.a.createElement(u.a,{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u5B9A\u5220\u9664\u6D4B\u8BD5\u96C6\b"+(vr+1),onConfirm:function(){Ft(vr)}},ee.a.createElement(Y.a,{className:xe.a["btn-remove-case"]}))):null},ee.a.createElement(N.a.Item,{label:"\u8F93\u5165",name:[tr.name,"input"],fieldKey:[tr.fieldKey,"input"]},ee.a.createElement(Nt,null)),ee.a.createElement(N.a.Item,{label:"\u8F93\u51FA",name:[tr.name,"output"],fieldKey:[tr.fieldKey,"output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},ee.a.createElement(Nt,null)))}))}))),ee.a.createElement(Ot.b,{rootIdentifier:null,visible:ze,onClose:function(){return pt(!1)},onOK:an}),ee.a.createElement(dt,{visible:gt,onCancel:function(){Ht(!1),V()},onOK:function(){Ht(!1),V()}}))}},rcnY:function(I,J,P){var L=P("aRTE");function u(S,R){this.totalCount=S,this.dataCount=R}u.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],u.getRSBlocks=function(S,R){var h=u.getRsBlockTable(S,R);if(h==null)throw new Error("bad rs block @ typeNumber:"+S+"/errorCorrectLevel:"+R);for(var o=h.length/3,C=new Array,c=0;c<o;c++)for(var a=h[c*3+0],i=h[c*3+1],r=h[c*3+2],l=0;l<a;l++)C.push(new u(i,r));return C},u.getRsBlockTable=function(S,R){switch(R){case L.L:return u.RS_BLOCK_TABLE[(S-1)*4+0];case L.M:return u.RS_BLOCK_TABLE[(S-1)*4+1];case L.Q:return u.RS_BLOCK_TABLE[(S-1)*4+2];case L.H:return u.RS_BLOCK_TABLE[(S-1)*4+3];default:return}},I.exports=u},rdUC:function(I,J,P){var L=P("MFOe"),u=L.Global;I.exports={name:"localStorage",read:R,write:h,each:o,remove:C,clearAll:c};function S(){return u.localStorage}function R(a){return S().getItem(a)}function h(a,i){return S().setItem(a,i)}function o(a){for(var i=S().length-1;i>=0;i--){var r=S().key(i);a(R(r),r)}}function C(a){return S().removeItem(a)}function c(){return S().clear()}},sR1s:function(I,J,P){"use strict";P.d(J,"b",function(){return R}),P.d(J,"a",function(){return h}),P.d(J,"c",function(){return o}),P.d(J,"d",function(){return C});var L=P("U8pU"),u="RC_TABLE_KEY";function S(c){return c==null?[]:Array.isArray(c)?c:[c]}function R(c,a){if(!a&&typeof a!="number")return c;for(var i=S(a),r=c,l=0;l<i.length;l+=1){if(!r)return null;var p=i[l];r=r[p]}return r}function h(c){var a=[],i={};return c.forEach(function(r){for(var l=r||{},p=l.key,f=l.dataIndex,b=p||S(f).join("-")||u;i[b];)b="".concat(b,"_next");i[b]=!0,a.push(b)}),a}function o(){var c={};function a(p,f){f&&Object.keys(f).forEach(function(b){var v=f[b];v&&Object(L.a)(v)==="object"?(p[b]=p[b]||{},a(p[b],v)):p[b]=v})}for(var i=arguments.length,r=new Array(i),l=0;l<i;l++)r[l]=arguments[l];return r.forEach(function(p){a(c,p)}),c}function C(c){return c!=null}},sboe:function(I,J,P){"use strict";P.d(J,"a",function(){return S});var L=P("q1tI"),u=P.n(L),S=L.createContext(null)},t23M:function(I,J,P){"use strict";var L=P("VTBJ"),u=P("1OyB"),S=P("vuIU"),R=P("Ji7U"),h=P("LK+K"),o=P("q1tI"),C=P.n(o),c=P("m+aA"),a=P("Zm9Q"),i=P("Kwbf"),r=P("c+Xe"),l=P("bdgK"),p="rc-observer-key",f=function(b){Object(R.a)(m,b);var v=Object(h.a)(m);function m(){var n;return Object(u.a)(this,m),n=v.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(d){var g=n.props.onResize,T=d[0].target,y=T.getBoundingClientRect(),s=y.width,M=y.height,A=T.offsetWidth,x=T.offsetHeight,E=Math.floor(s),w=Math.floor(M);if(n.state.width!==E||n.state.height!==w||n.state.offsetWidth!==A||n.state.offsetHeight!==x){var _={width:E,height:w,offsetWidth:A,offsetHeight:x};n.setState(_),g&&Promise.resolve().then(function(){g(Object(L.a)(Object(L.a)({},_),{},{offsetWidth:A,offsetHeight:x}))})}},n.setChildNode=function(d){n.childNode=d},n}return Object(S.a)(m,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var d=this.props.disabled;if(d){this.destroyObserver();return}var g=Object(c.a)(this.childNode||this),T=g!==this.currentElement;T&&(this.destroyObserver(),this.currentElement=g),!this.resizeObserver&&g&&(this.resizeObserver=new l.default(this.onResize),this.resizeObserver.observe(g))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var d=this.props.children,g=Object(a.a)(d);if(g.length>1)Object(i.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(g.length===0)return Object(i.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var T=g[0];if(o.isValidElement(T)&&Object(r.c)(T)){var y=T.ref;g[0]=o.cloneElement(T,{ref:Object(r.a)(y,this.setChildNode)})}return g.length===1?g[0]:g.map(function(s,M){return!o.isValidElement(s)||"key"in s&&s.key!==null?s:o.cloneElement(s,{key:"".concat(p,"-").concat(M)})})}}]),m}(o.Component);f.displayName="ResizeObserver",J.a=f},uGsb:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("MlIO"),P("1uat"))})(this,function(L){return function(){var u=L,S=u.x64,R=S.Word,h=S.WordArray,o=u.algo,C=o.SHA512,c=o.SHA384=C.extend({_doReset:function(){this._hash=new h.init([new R.init(3418070365,3238371032),new R.init(1654270250,914150663),new R.init(2438529370,812702999),new R.init(355462360,4144912697),new R.init(1731405415,4290775857),new R.init(2394180231,1750603025),new R.init(3675008525,1694076839),new R.init(1203062813,3204075428)])},_doFinalize:function(){var a=C._doFinalize.call(this);return a.sigBytes-=16,a}});u.SHA384=C._createHelper(c),u.HmacSHA384=C._createHmacHelper(c)}(),L.SHA384})},uGxW:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.pad.NoPadding={pad:function(){},unpad:function(){}},L.pad.NoPadding})},uQRt:function(I,J,P){I.exports=L;function L(){return P("gaXo"),{}}},ulZh:function(I,J,P){typeof window!="undefined"&&function(u,S){I.exports=S()}(this,function(){return function(L){var u={};function S(R){if(u[R])return u[R].exports;var h=u[R]={i:R,l:!1,exports:{}};return L[R].call(h.exports,h,h.exports,S),h.l=!0,h.exports}return S.m=L,S.c=u,S.d=function(R,h,o){S.o(R,h)||Object.defineProperty(R,h,{enumerable:!0,get:o})},S.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})},S.t=function(R,h){if(h&1&&(R=S(R)),h&8)return R;if(h&4&&typeof R=="object"&&R&&R.__esModule)return R;var o=Object.create(null);if(S.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:R}),h&2&&typeof R!="string")for(var C in R)S.d(o,C,function(c){return R[c]}.bind(null,C));return o},S.n=function(R){var h=R&&R.__esModule?function(){return R.default}:function(){return R};return S.d(h,"a",h),h},S.o=function(R,h){return Object.prototype.hasOwnProperty.call(R,h)},S.p="/dist/",S(S.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(L,u,S){"use strict";var R=Object.prototype.hasOwnProperty,h="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(h=!1));function C(r,l,p){this.fn=r,this.context=l,this.once=p||!1}function c(r,l,p,f,b){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new C(p,f||r,b),m=h?h+l:l;return r._events[m]?r._events[m].fn?r._events[m]=[r._events[m],v]:r._events[m].push(v):(r._events[m]=v,r._eventsCount++),r}function a(r,l){--r._eventsCount===0?r._events=new o:delete r._events[l]}function i(){this._events=new o,this._eventsCount=0}i.prototype.eventNames=function(){var l=[],p,f;if(this._eventsCount===0)return l;for(f in p=this._events)R.call(p,f)&&l.push(h?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(p)):l},i.prototype.listeners=function(l){var p=h?h+l:l,f=this._events[p];if(!f)return[];if(f.fn)return[f.fn];for(var b=0,v=f.length,m=new Array(v);b<v;b++)m[b]=f[b].fn;return m},i.prototype.listenerCount=function(l){var p=h?h+l:l,f=this._events[p];return f?f.fn?1:f.length:0},i.prototype.emit=function(l,p,f,b,v,m){var n=h?h+l:l;if(!this._events[n])return!1;var d=this._events[n],g=arguments.length,T,y;if(d.fn){d.once&&this.removeListener(l,d.fn,void 0,!0);switch(g){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,p),!0;case 3:return d.fn.call(d.context,p,f),!0;case 4:return d.fn.call(d.context,p,f,b),!0;case 5:return d.fn.call(d.context,p,f,b,v),!0;case 6:return d.fn.call(d.context,p,f,b,v,m),!0}for(y=1,T=new Array(g-1);y<g;y++)T[y-1]=arguments[y];d.fn.apply(d.context,T)}else{var s=d.length,M;for(y=0;y<s;y++){d[y].once&&this.removeListener(l,d[y].fn,void 0,!0);switch(g){case 1:d[y].fn.call(d[y].context);break;case 2:d[y].fn.call(d[y].context,p);break;case 3:d[y].fn.call(d[y].context,p,f);break;case 4:d[y].fn.call(d[y].context,p,f,b);break;default:if(!T)for(M=1,T=new Array(g-1);M<g;M++)T[M-1]=arguments[M];d[y].fn.apply(d[y].context,T)}}}return!0},i.prototype.on=function(l,p,f){return c(this,l,p,f,!1)},i.prototype.once=function(l,p,f){return c(this,l,p,f,!0)},i.prototype.removeListener=function(l,p,f,b){var v=h?h+l:l;if(!this._events[v])return this;if(!p)return a(this,v),this;var m=this._events[v];if(m.fn)m.fn===p&&(!b||m.once)&&(!f||m.context===f)&&a(this,v);else{for(var n=0,d=[],g=m.length;n<g;n++)(m[n].fn!==p||b&&!m[n].once||f&&m[n].context!==f)&&d.push(m[n]);d.length?this._events[v]=d.length===1?d[0]:d:a(this,v)}return this},i.prototype.removeAllListeners=function(l){var p;return l?(p=h?h+l:l,this._events[p]&&a(this,p)):(this._events=new o,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=h,i.EventEmitter=i,L.exports=i},"./node_modules/url-toolkit/src/url-toolkit.js":function(L,u,S){(function(R){var h=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,o=/^([^\/?#]*)([^]*)$/,C=/(?:\/|^)\.(?=\/)/g,c=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(i,r,l){if(l=l||{},i=i.trim(),r=r.trim(),!r){if(!l.alwaysNormalize)return i;var p=a.parseURL(i);if(!p)throw new Error("Error trying to parse base URL.");return p.path=a.normalizePath(p.path),a.buildURLFromParts(p)}var f=a.parseURL(r);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return l.alwaysNormalize?(f.path=a.normalizePath(f.path),a.buildURLFromParts(f)):r;var b=a.parseURL(i);if(!b)throw new Error("Error trying to parse base URL.");if(!b.netLoc&&b.path&&b.path[0]!=="/"){var v=o.exec(b.path);b.netLoc=v[1],b.path=v[2]}b.netLoc&&!b.path&&(b.path="/");var m={scheme:b.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(m.netLoc=b.netLoc,f.path[0]!=="/"))if(!f.path)m.path=b.path,f.params||(m.params=b.params,f.query||(m.query=b.query));else{var n=b.path,d=n.substring(0,n.lastIndexOf("/")+1)+f.path;m.path=a.normalizePath(d)}return m.path===null&&(m.path=l.alwaysNormalize?a.normalizePath(f.path):f.path),a.buildURLFromParts(m)},parseURL:function(i){var r=h.exec(i);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(i){for(i=i.split("").reverse().join("").replace(C,"");i.length!==(i=i.replace(c,"")).length;);return i.split("").reverse().join("")},buildURLFromParts:function(i){return i.scheme+i.netLoc+i.path+i.params+i.query+i.fragment}};L.exports=a})(this)},"./node_modules/webworkify-webpack/index.js":function(L,u,S){function R(l){var p={};function f(v){if(p[v])return p[v].exports;var m=p[v]={i:v,l:!1,exports:{}};return l[v].call(m.exports,m,m.exports,f),m.l=!0,m.exports}f.m=l,f.c=p,f.i=function(v){return v},f.d=function(v,m,n){f.o(v,m)||Object.defineProperty(v,m,{configurable:!1,enumerable:!0,get:n})},f.r=function(v){Object.defineProperty(v,"__esModule",{value:!0})},f.n=function(v){var m=v&&v.__esModule?function(){return v.default}:function(){return v};return f.d(m,"a",m),m},f.o=function(v,m){return Object.prototype.hasOwnProperty.call(v,m)},f.p="/",f.oe=function(v){throw console.error(v),v};var b=f(f.s=ENTRY_MODULE);return b.default||b}var h="[\\.|\\-|\\+|\\w|/|@]+",o="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+h+").*?\\)";function C(l){return(l+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function c(l){return!isNaN(1*l)}function a(l,p,f){var b={};b[f]=[];var v=p.toString(),m=v.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return b;for(var n=m[1],d=new RegExp("(\\\\n|\\W)"+C(n)+o,"g"),g;g=d.exec(v);){if(g[3]==="dll-reference")continue;b[f].push(g[3])}for(d=new RegExp("\\("+C(n)+'\\("(dll-reference\\s('+h+'))"\\)\\)'+o,"g");g=d.exec(v);)l[g[2]]||(b[f].push(g[1]),l[g[2]]=S(g[1]).m),b[g[2]]=b[g[2]]||[],b[g[2]].push(g[4]);for(var T=Object.keys(b),y=0;y<T.length;y++)for(var s=0;s<b[T[y]].length;s++)c(b[T[y]][s])&&(b[T[y]][s]=1*b[T[y]][s]);return b}function i(l){var p=Object.keys(l);return p.reduce(function(f,b){return f||l[b].length>0},!1)}function r(l,p){for(var f={main:[p]},b={main:[]},v={main:{}};i(f);)for(var m=Object.keys(f),n=0;n<m.length;n++){var d=m[n],g=f[d],T=g.pop();if(v[d]=v[d]||{},v[d][T]||!l[d][T])continue;v[d][T]=!0,b[d]=b[d]||[],b[d].push(T);for(var y=a(l,l[d][T],d),s=Object.keys(y),M=0;M<s.length;M++)f[s[M]]=f[s[M]]||[],f[s[M]]=f[s[M]].concat(y[s[M]])}return b}L.exports=function(l,p){p=p||{};var f={main:S.m},b=p.all?{main:Object.keys(f.main)}:r(f,l),v="";Object.keys(b).filter(function(T){return T!=="main"}).forEach(function(T){for(var y=0;b[T][y];)y++;b[T].push(y),f[T][y]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",v=v+"var "+T+" = ("+R.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+b[T].map(function(s){return""+JSON.stringify(s)+": "+f[T][s].toString()}).join(",")+`});
|
|
|
`}),v=v+"new (("+R.toString().replace("ENTRY_MODULE",JSON.stringify(l))+")({"+b.main.map(function(T){return""+JSON.stringify(T)+": "+f.main[T].toString()}).join(",")+"}))(self);";var m=new window.Blob([v],{type:"text/javascript"});if(p.bare)return m;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,d=n.createObjectURL(m),g=new window.Worker(d);return g.objectURL=d,g}},"./src/config.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"hlsDefaultConfig",function(){return M}),S.d(u,"mergeConfig",function(){return x}),S.d(u,"enableStreamingMode",function(){return E});var R=S("./src/controller/abr-controller.ts"),h=S("./src/controller/audio-stream-controller.ts"),o=S("./src/controller/audio-track-controller.ts"),C=S("./src/controller/subtitle-stream-controller.ts"),c=S("./src/controller/subtitle-track-controller.ts"),a=S("./src/controller/buffer-controller.ts"),i=S("./src/controller/timeline-controller.ts"),r=S("./src/controller/cap-level-controller.ts"),l=S("./src/controller/fps-controller.ts"),p=S("./src/controller/eme-controller.ts"),f=S("./src/controller/cmcd-controller.ts"),b=S("./src/utils/xhr-loader.ts"),v=S("./src/utils/fetch-loader.ts"),m=S("./src/utils/cues.ts"),n=S("./src/utils/mediakeys-helper.ts"),d=S("./src/utils/logger.ts");function g(){return g=Object.assign||function(w){for(var _=1;_<arguments.length;_++){var N=arguments[_];for(var j in N)Object.prototype.hasOwnProperty.call(N,j)&&(w[j]=N[j])}return w},g.apply(this,arguments)}function T(w,_){var N=Object.keys(w);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(w);_&&(j=j.filter(function(k){return Object.getOwnPropertyDescriptor(w,k).enumerable})),N.push.apply(N,j)}return N}function y(w){for(var _=1;_<arguments.length;_++){var N=arguments[_]!=null?arguments[_]:{};_%2?T(Object(N),!0).forEach(function(j){s(w,j,N[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(N)):T(Object(N)).forEach(function(j){Object.defineProperty(w,j,Object.getOwnPropertyDescriptor(N,j))})}return w}function s(w,_,N){return _ in w?Object.defineProperty(w,_,{value:N,enumerable:!0,configurable:!0,writable:!0}):w[_]=N,w}var M=y(y({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:b.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:R.default,bufferController:a.default,capLevelController:r.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},A()),{},{subtitleStreamController:C.SubtitleStreamController,subtitleTrackController:c.default,timelineController:i.TimelineController,audioStreamController:h.default,audioTrackController:o.default,emeController:p.default,cmcdController:f.default});function A(){return{cueHandler:m.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 x(w,_){if((_.liveSyncDurationCount||_.liveMaxLatencyDurationCount)&&(_.liveSyncDuration||_.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(_.liveMaxLatencyDurationCount!==void 0&&(_.liveSyncDurationCount===void 0||_.liveMaxLatencyDurationCount<=_.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(_.liveMaxLatencyDuration!==void 0&&(_.liveSyncDuration===void 0||_.liveMaxLatencyDuration<=_.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return g({},w,_)}function E(w){var _=w.loader;if(_!==v.default&&_!==b.default)d.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),w.progressive=!1;else{var N=Object(v.fetchSupported)();N&&(w.loader=v.default,w.progressive=!0,w.enableSoftwareAES=!0,d.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/polyfills/number.ts"),h=S("./src/utils/ewma-bandwidth-estimator.ts"),o=S("./src/events.ts"),C=S("./src/utils/buffer-helper.ts"),c=S("./src/errors.ts"),a=S("./src/types/loader.ts"),i=S("./src/utils/logger.ts");function r(f,b){for(var v=0;v<b.length;v++){var m=b[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}function l(f,b,v){return b&&r(f.prototype,b),v&&r(f,v),f}var p=function(){function f(v){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=v;var m=v.config;this.bwEstimator=new h.default(m.abrEwmaSlowVoD,m.abrEwmaFastVoD,m.abrEwmaDefaultEstimate),this.registerListeners()}var b=f.prototype;return b.registerListeners=function(){var m=this.hls;m.on(o.Events.FRAG_LOADING,this.onFragLoading,this),m.on(o.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(o.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){var m=this.hls;m.off(o.Events.FRAG_LOADING,this.onFragLoading,this),m.off(o.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(o.Events.ERROR,this.onError,this)},b.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},b.onFragLoading=function(m,n){var d=n.frag;if(d.type===a.PlaylistLevelType.MAIN&&!this.timer){var g;this.fragCurrent=d,this.partCurrent=(g=n.part)!=null?g:null,this.timer=self.setInterval(this.onCheck,100)}},b.onLevelLoaded=function(m,n){var d=this.hls.config;n.details.live?this.bwEstimator.update(d.abrEwmaSlowLive,d.abrEwmaFastLive):this.bwEstimator.update(d.abrEwmaSlowVoD,d.abrEwmaFastVoD)},b._abandonRulesCheck=function(){var m=this.fragCurrent,n=this.partCurrent,d=this.hls,g=d.autoLevelEnabled,T=d.config,y=d.media;if(!m||!y)return;var s=n?n.stats:m.stats,M=n?n.duration:m.duration;if(s.aborted){i.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!g||y.paused||!y.playbackRate||!y.readyState)return;var A=performance.now()-s.loading.start,x=Math.abs(y.playbackRate);if(A<=500*M/x)return;var E=d.levels,w=d.minAutoLevel,_=E[m.level],N=s.total||Math.max(s.loaded,Math.round(M*_.maxBitrate/8)),j=Math.max(1,s.bwEstimate?s.bwEstimate/8:s.loaded*1e3/A),k=(N-s.loaded)/j,z=y.currentTime,H=(C.BufferHelper.bufferInfo(y,z,T.maxBufferHole).end-z)/x;if(H>=2*M/x||k<=H)return;var F=Number.POSITIVE_INFINITY,G;for(G=m.level-1;G>w;G--){var B=E[G].maxBitrate;if(F=M*B/(8*.8*j),F<H)break}if(F>=k)return;var W=this.bwEstimator.getEstimate();i.logger.warn("Fragment "+m.sn+(n?" part "+n.index:"")+" of level "+m.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
|
|
|
Current BW estimate: `+(Object(R.isFiniteNumber)(W)?(W/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+k.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+F.toFixed(3)+` s
|
|
|
Time to underbuffer: `+H.toFixed(3)+" s"),d.nextLoadLevel=G,this.bwEstimator.sample(A,s.loaded),this.clearTimer(),m.loader&&(this.fragCurrent=this.partCurrent=null,m.loader.abort()),d.trigger(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:m,part:n,stats:s})},b.onFragLoaded=function(m,n){var d=n.frag,g=n.part;if(d.type===a.PlaylistLevelType.MAIN&&Object(R.isFiniteNumber)(d.sn)){var T=g?g.stats:d.stats,y=g?g.duration:d.duration;if(this.clearTimer(),this.lastLoadedFragLevel=d.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var s=this.hls.levels[d.level],M=(s.loaded?s.loaded.bytes:0)+T.loaded,A=(s.loaded?s.loaded.duration:0)+y;s.loaded={bytes:M,duration:A},s.realBitrate=Math.round(8*M/A)}if(d.bitrateTest){var x={stats:T,frag:d,part:g,id:d.type};this.onFragBuffered(o.Events.FRAG_BUFFERED,x),d.bitrateTest=!1}}},b.onFragBuffered=function(m,n){var d=n.frag,g=n.part,T=g?g.stats:d.stats;if(T.aborted)return;if(d.type!==a.PlaylistLevelType.MAIN||d.sn==="initSegment")return;var y=T.parsing.end-T.loading.start;this.bwEstimator.sample(y,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),d.bitrateTest?this.bitrateTestDelay=y/1e3:this.bitrateTestDelay=0},b.onError=function(m,n){switch(n.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},b.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},b.getNextABRAutoLevel=function(){var m=this.fragCurrent,n=this.partCurrent,d=this.hls,g=d.maxAutoLevel,T=d.config,y=d.minAutoLevel,s=d.media,M=n?n.duration:m?m.duration:0,A=s?s.currentTime:0,x=s&&s.playbackRate!==0?Math.abs(s.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,w=(C.BufferHelper.bufferInfo(s,A,T.maxBufferHole).end-A)/x,_=this.findBestLevel(E,y,g,w,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(_>=0)return _;i.logger.trace((w?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var N=M?Math.min(M,T.maxStarvationDelay):T.maxStarvationDelay,j=T.abrBandWidthFactor,k=T.abrBandWidthUpFactor;if(!w){var z=this.bitrateTestDelay;if(z){var H=M?Math.min(M,T.maxLoadingDelay):T.maxLoadingDelay;N=H-z,i.logger.trace("bitrate test took "+Math.round(1e3*z)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*N)+" ms"),j=k=1}}return _=this.findBestLevel(E,y,g,w+N,j,k),Math.max(_,0)},b.findBestLevel=function(m,n,d,g,T,y){for(var s,M=this.fragCurrent,A=this.partCurrent,x=this.lastLoadedFragLevel,E=this.hls.levels,w=E[x],_=!!(w!=null&&(s=w.details)!==null&&s!==void 0&&s.live),N=w==null?void 0:w.codecSet,j=A?A.duration:M?M.duration:0,k=d;k>=n;k--){var z=E[k];if(!z||N&&z.codecSet!==N)continue;var H=z.details,F=(A?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||j,G=void 0;k<=x?G=T*m:G=y*m;var B=E[k].maxBitrate,W=B*F/G;if(i.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+k+"/"+Math.round(G)+"/"+B+"/"+F+"/"+g+"/"+W),G>B&&(!W||_&&!this.bitrateTestDelay||W<g))return k}return-1},l(f,[{key:"nextAutoLevel",get:function(){var m=this._nextAutoLevel,n=this.bwEstimator;if(m!==-1&&(!n||!n.canEstimate()))return m;var d=this.getNextABRAutoLevel();return m!==-1&&(d=Math.min(m,d)),d},set:function(m){this._nextAutoLevel=m}}]),f}();u.default=p},"./src/controller/audio-stream-controller.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/polyfills/number.ts"),h=S("./src/controller/base-stream-controller.ts"),o=S("./src/events.ts"),C=S("./src/utils/buffer-helper.ts"),c=S("./src/controller/fragment-tracker.ts"),a=S("./src/types/level.ts"),i=S("./src/types/loader.ts"),r=S("./src/loader/fragment.ts"),l=S("./src/demux/chunk-cache.ts"),p=S("./src/demux/transmuxer-interface.ts"),f=S("./src/types/transmuxer.ts"),b=S("./src/controller/fragment-finders.ts"),v=S("./src/utils/discontinuities.ts"),m=S("./src/errors.ts"),n=S("./src/utils/logger.ts");function d(){return d=Object.assign||function(M){for(var A=1;A<arguments.length;A++){var x=arguments[A];for(var E in x)Object.prototype.hasOwnProperty.call(x,E)&&(M[E]=x[E])}return M},d.apply(this,arguments)}function g(M,A){M.prototype=Object.create(A.prototype),M.prototype.constructor=M,T(M,A)}function T(M,A){return T=Object.setPrototypeOf||function(E,w){return E.__proto__=w,E},T(M,A)}var y=100,s=function(M){g(A,M);function A(E,w){var _;return _=M.call(this,E,w,"[audio-stream-controller]")||this,_.videoBuffer=null,_.videoTrackCC=-1,_.waitingVideoCC=-1,_.audioSwitch=!1,_.trackId=-1,_.waitingData=null,_.mainDetails=null,_.bufferFlushed=!1,_._registerListeners(),_}var x=A.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var w=this.hls;w.on(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(o.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),w.on(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.on(o.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),w.on(o.Events.ERROR,this.onError,this),w.on(o.Events.BUFFER_RESET,this.onBufferReset,this),w.on(o.Events.BUFFER_CREATED,this.onBufferCreated,this),w.on(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.on(o.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),w.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x._unregisterListeners=function(){var w=this.hls;w.off(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(o.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),w.off(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),w.off(o.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),w.off(o.Events.ERROR,this.onError,this),w.off(o.Events.BUFFER_RESET,this.onBufferReset,this),w.off(o.Events.BUFFER_CREATED,this.onBufferCreated,this),w.off(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),w.off(o.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),w.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x.onInitPtsFound=function(w,_){var N=_.frag,j=_.id,k=_.initPTS;if(j==="main"){var z=N.cc;this.initPTS[N.cc]=k,this.log("InitPTS for cc: "+z+" found from main: "+k),this.videoTrackCC=z,this.state===h.State.WAITING_INIT_PTS&&this.tick()}},x.startLoad=function(w){if(!this.levels){this.startPosition=w,this.state=h.State.STOPPED;return}var _=this.lastCurrentTime;this.stopLoad(),this.setInterval(y),this.fragLoadError=0,_>0&&w===-1?(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),this.state=h.State.IDLE):(this.loadedmetadata=!1,this.state=h.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=w,this.tick()},x.doTick=function(){switch(this.state){case h.State.IDLE:this.doTickIdle();break;case h.State.WAITING_TRACK:{var w,_=this.levels,N=this.trackId,j=_==null||((w=_[N])===null||w===void 0)?void 0:w.details;if(j){if(this.waitForCdnTuneIn(j))break;this.state=h.State.WAITING_INIT_PTS}break}case h.State.FRAG_LOADING_WAITING_RETRY:{var k,z=performance.now(),H=this.retryDate;(!H||z>=H||(k=this.media)!==null&&k!==void 0&&k.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=h.State.IDLE);break}case h.State.WAITING_INIT_PTS:{var F=this.waitingData;if(F){var G=F.frag,B=F.part,W=F.cache,K=F.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=h.State.FRAG_LOADING;var q=W.flush(),re={frag:G,part:B,payload:q,networkDetails:null};this._handleFragmentLoadProgress(re),K&&M.prototype._handleFragmentLoadComplete.call(this,re)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ee=this.getLoadPosition(),Ce=C.BufferHelper.bufferInfo(this.mediaBuffer,ee,this.config.maxBufferHole),xe=Object(b.fragmentWithinToleranceTest)(Ce.end,this.config.maxFragLookUpTolerance,G);xe<0&&(n.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+Ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=h.State.IDLE}}this.onTickEnd()},x.clearWaitingFragment=function(){var w=this.waitingData;w&&(this.fragmentTracker.removeFragment(w.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=h.State.IDLE)},x.onTickEnd=function(){var w=this.media;if(!w||!w.readyState)return;var _=this.mediaBuffer?this.mediaBuffer:w,N=_.buffered;!this.loadedmetadata&&N.length&&(this.loadedmetadata=!0),this.lastCurrentTime=w.currentTime},x.doTickIdle=function(){var w,_,N=this.hls,j=this.levels,k=this.media,z=this.trackId,H=N.config;if(!j||!j[z])return;if(!k&&(this.startFragRequested||!H.startFragPrefetch))return;var F=j[z],G=F.details;if(!G||G.live&&this.levelLastLoaded!==z||this.waitForCdnTuneIn(G)){this.state=h.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,r.ElementaryStreamTypes.AUDIO,i.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,i.PlaylistLevelType.AUDIO);if(B===null)return;var W=B.len,K=this.getMaxBufferLength(),q=this.audioSwitch;if(W>=K&&!q)return;if(!q&&this._streamEnded(B,G)){N.trigger(o.Events.BUFFER_EOS,{type:"audio"}),this.state=h.State.ENDED;return}var re=G.fragments,ee=re[0].start,Ce=B.end;if(q){var xe=this.getLoadPosition();Ce=xe,G.PTSKnown&&xe<ee&&((B.end>ee||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),k.currentTime=ee+.05))}var he=this.getNextFragment(Ce,G);if(!he){this.bufferFlushed=!0;return}((w=he.decryptdata)===null||w===void 0?void 0:w.keyFormat)==="identity"&&!((_=he.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(he,G):this.loadFragment(he,G,Ce)},x.getMaxBufferLength=function(){var w=M.prototype.getMaxBufferLength.call(this),_=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,i.PlaylistLevelType.MAIN);return _===null?w:Math.max(w,_.len)},x.onMediaDetaching=function(){this.videoBuffer=null,M.prototype.onMediaDetaching.call(this)},x.onAudioTracksUpdated=function(w,_){var N=_.audioTracks;this.resetTransmuxer(),this.levels=N.map(function(j){return new a.Level(j)})},x.onAudioTrackSwitching=function(w,_){var N=!!_.url;this.trackId=_.id;var j=this.fragCurrent;j!=null&&j.loader&&j.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),N?this.setInterval(y):this.resetTransmuxer(),N?(this.audioSwitch=!0,this.state=h.State.IDLE):this.state=h.State.STOPPED,this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},x.onLevelLoaded=function(w,_){this.mainDetails=_.details},x.onAudioTrackLoaded=function(w,_){var N,j=this.levels,k=_.details,z=_.id;if(!j){this.warn("Audio tracks were reset while loading level "+z);return}this.log("Track "+z+" loaded ["+k.startSN+","+k.endSN+"],duration:"+k.totalduration);var H=j[z],F=0;if(k.live||(N=H.details)!==null&&N!==void 0&&N.live){var G=this.mainDetails;if(k.fragments[0]||(k.deltaUpdateFailed=!0),k.deltaUpdateFailed||!G)return;!H.details&&k.hasProgramDateTime&&G.hasProgramDateTime?(Object(v.alignMediaPlaylistByPDT)(k,G),F=k.fragments[0].start):F=this.alignPlaylists(k,H.details)}H.details=k,this.levelLastLoaded=z,!this.startFragRequested&&(this.mainDetails||!k.live)&&this.setStartPosition(H.details,F),this.state===h.State.WAITING_TRACK&&!this.waitForCdnTuneIn(k)&&(this.state=h.State.IDLE),this.tick()},x._handleFragmentLoadProgress=function(w){var _,N=w.frag,j=w.part,k=w.payload,z=this.config,H=this.trackId,F=this.levels;if(!F){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+N.sn+" of level "+N.level+" will not be buffered");return}var G=F[H];console.assert(G,"Audio track is defined on fragment load progress");var B=G.details;console.assert(B,"Audio track details are defined on fragment load progress");var W=z.defaultAudioCodec||G.audioCodec||"mp4a.40.2",K=this.transmuxer;K||(K=this.transmuxer=new p.default(this.hls,i.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var q=this.initPTS[N.cc],re=(_=N.initSegment)===null||_===void 0?void 0:_.data;if(q!==void 0){var ee=!1,Ce=j?j.index:-1,xe=Ce!==-1,he=new f.ChunkMetadata(N.level,N.sn,N.stats.chunkCount,k.byteLength,Ce,xe);K.push(k,re,W,"",N,j,B.totalduration,ee,he,q)}else{n.logger.log("Unknown video PTS for cc "+N.cc+", waiting for video PTS before demuxing audio frag "+N.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+H);var ke=this.waitingData=this.waitingData||{frag:N,part:j,cache:new l.default,complete:!1},_e=ke.cache;_e.push(new Uint8Array(k)),this.waitingVideoCC=this.videoTrackCC,this.state=h.State.WAITING_INIT_PTS}},x._handleFragmentLoadComplete=function(w){if(this.waitingData){this.waitingData.complete=!0;return}M.prototype._handleFragmentLoadComplete.call(this,w)},x.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},x.onBufferCreated=function(w,_){var N=_.tracks.audio;N&&(this.mediaBuffer=N.buffer),_.tracks.video&&(this.videoBuffer=_.tracks.video.buffer)},x.onFragBuffered=function(w,_){var N=_.frag,j=_.part;if(N.type!==i.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(N)){this.warn("Fragment "+N.sn+(j?" p: "+j.index:"")+" of level "+N.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}N.sn!=="initSegment"&&(this.fragPrevious=N,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(N,j)},x.onError=function(w,_){switch(_.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(i.PlaylistLevelType.AUDIO,_);break;case m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case m.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==h.State.ERROR&&this.state!==h.State.STOPPED&&(this.state=_.fatal?h.State.ERROR:h.State.IDLE,this.warn(_.details+" while loading frag, switching to "+this.state+" state"));break;case m.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="audio"&&(this.state===h.State.PARSING||this.state===h.State.PARSED)){var N=!0,j=this.getFwdBufferInfo(this.mediaBuffer,i.PlaylistLevelType.AUDIO);j&&j.len>.5&&(N=!this.reduceMaxBufferLength(j.len)),N&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,M.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},x.onBufferFlushed=function(w,_){var N=_.type;N===r.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},x._handleTransmuxComplete=function(w){var _,N="audio",j=this.hls,k=w.remuxResult,z=w.chunkMeta,H=this.getCurrentContext(z);if(!H){this.warn("The loading context changed while buffering fragment "+z.sn+" of level "+z.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(z.level);return}var F=H.frag,G=H.part,B=k.audio,W=k.text,K=k.id3,q=k.initSegment;if(this.fragContextChanged(F))return;if(this.state=h.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),q!=null&&q.tracks&&(this._bufferInitSegment(q.tracks,F,z),j.trigger(o.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:N,tracks:q.tracks})),B){var re=B.startPTS,ee=B.endPTS,Ce=B.startDTS,xe=B.endDTS;G&&(G.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:re,endPTS:ee,startDTS:Ce,endDTS:xe}),F.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,re,ee,Ce,xe),this.bufferFragmentData(B,F,G,z)}if(K!=null&&(_=K.samples)!==null&&_!==void 0&&_.length){var he=d({frag:F,id:N},K);j.trigger(o.Events.FRAG_PARSING_METADATA,he)}if(W){var ke=d({frag:F,id:N},W);j.trigger(o.Events.FRAG_PARSING_USERDATA,ke)}},x._bufferInitSegment=function(w,_,N){if(this.state!==h.State.PARSING)return;w.video&&delete w.video;var j=w.audio;if(!j)return;j.levelCodec=j.codec,j.id="audio",this.log("Init audio buffer, container:"+j.container+", codecs[parsed]=["+j.codec+"]"),this.hls.trigger(o.Events.BUFFER_CODECS,w);var k=j.initSegment;if(k!=null&&k.byteLength){var z={type:"audio",frag:_,part:null,chunkMeta:N,parent:_.type,data:k};this.hls.trigger(o.Events.BUFFER_APPENDING,z)}this.tick()},x.loadFragment=function(w,_,N){var j=this.fragmentTracker.getState(w);this.fragCurrent=w,(this.audioSwitch||j===c.FragmentState.NOT_LOADED||j===c.FragmentState.PARTIAL)&&(w.sn==="initSegment"?this._loadInitSegment(w):_.live&&!Object(R.isFiniteNumber)(this.initPTS[w.cc])?(this.log("Waiting for video PTS in continuity counter "+w.cc+" of live stream before loading audio fragment "+w.sn+" of level "+this.trackId),this.state=h.State.WAITING_INIT_PTS):(this.startFragRequested=!0,M.prototype.loadFragment.call(this,w,_,N)))},x.completeAudioSwitch=function(){var w=this.hls,_=this.media,N=this.trackId;_&&(this.log("Switching audio track : flushing all audio"),M.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,w.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:N})},A}(h.default);u.default=s},"./src/controller/audio-track-controller.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/events.ts"),h=S("./src/errors.ts"),o=S("./src/controller/base-playlist-controller.ts"),C=S("./src/types/loader.ts");function c(p,f){for(var b=0;b<f.length;b++){var v=f[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(p,v.key,v)}}function a(p,f,b){return f&&c(p.prototype,f),b&&c(p,b),p}function i(p,f){p.prototype=Object.create(f.prototype),p.prototype.constructor=p,r(p,f)}function r(p,f){return r=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},r(p,f)}var l=function(p){i(f,p);function f(v){var m;return m=p.call(this,v,"[audio-track-controller]")||this,m.tracks=[],m.groupId=null,m.tracksInGroup=[],m.trackId=-1,m.trackName="",m.selectDefaultTrack=!0,m.registerListeners(),m}var b=f.prototype;return b.registerListeners=function(){var m=this.hls;m.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),m.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),m.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.on(R.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){var m=this.hls;m.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),m.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),m.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.off(R.Events.ERROR,this.onError,this)},b.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},b.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},b.onManifestParsed=function(m,n){this.tracks=n.audioTracks||[]},b.onAudioTrackLoaded=function(m,n){var d=n.id,g=n.details,T=this.tracksInGroup[d];if(!T){this.warn("Invalid audio track id "+d);return}var y=T.details;T.details=n.details,this.log("audioTrack "+d+" loaded ["+g.startSN+"-"+g.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,n,y))},b.onLevelLoading=function(m,n){this.switchLevel(n.level)},b.onLevelSwitching=function(m,n){this.switchLevel(n.level)},b.switchLevel=function(m){var n=this.hls.levels[m];if(!(n!=null&&n.audioGroupIds))return;var d=n.audioGroupIds[n.urlId];if(this.groupId!==d){this.groupId=d;var g=this.tracks.filter(function(y){return!d||y.groupId===d});this.selectDefaultTrack&&!g.some(function(y){return y.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=g;var T={audioTracks:g};this.log("Updating audio tracks, "+g.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(R.Events.AUDIO_TRACKS_UPDATED,T),this.selectInitialTrack()}},b.onError=function(m,n){if(p.prototype.onError.call(this,m,n),n.fatal||!n.context)return;n.context.type===C.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},b.setAudioTrack=function(m){var n=this.tracksInGroup;if(m<0||m>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var d=n[this.trackId];this.log("Now switching to audio-track index "+m);var g=n[m],T=g.id,y=g.groupId,s=y===void 0?"":y,M=g.name,A=g.type,x=g.url;if(this.trackId=m,this.trackName=M,this.selectDefaultTrack=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:s,name:M,type:A,url:x}),g.details&&!g.details.live)return;var E=this.switchParams(g.url,d==null?void 0:d.details);this.loadPlaylist(E)},b.selectInitialTrack=function(){var m=this.tracksInGroup;console.assert(m.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,d=this.findTrackId(n)||this.findTrackId();d!==-1?this.setAudioTrack(d):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},b.findTrackId=function(m){for(var n=this.tracksInGroup,d=0;d<n.length;d++){var g=n[d];if((!this.selectDefaultTrack||g.default)&&(!m||m===g.name))return g.id}return-1},b.loadPlaylist=function(m){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var d=n.id,g=n.groupId,T=n.url;if(m)try{T=m.addDirectives(T)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("loading audio-track playlist for id: "+d),this.clearTimer(),this.hls.trigger(R.Events.AUDIO_TRACK_LOADING,{url:T,id:d,groupId:g,deliveryDirectives:m||null})}},a(f,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(m){this.selectDefaultTrack=!1,this.setAudioTrack(m)}}]),f}(o.default);u.default=l},"./src/controller/base-playlist-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return a});var R=S("./src/polyfills/number.ts"),h=S("./src/types/level.ts"),o=S("./src/controller/level-helper.ts"),C=S("./src/utils/logger.ts"),c=S("./src/errors.ts"),a=function(){function i(l,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=C.logger.log.bind(C.logger,p+":"),this.warn=C.logger.warn.bind(C.logger,p+":"),this.hls=l}var r=i.prototype;return r.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},r.onError=function(p,f){f.fatal&&f.type===c.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},r.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},r.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},r.stopLoad=function(){this.canLoad=!1,this.clearTimer()},r.switchParams=function(p,f){var b=f==null?void 0:f.renditionReports;if(b)for(var v=0;v<b.length;v++){var m=b[v],n=""+m.URI;if(n===p.substr(-n.length)){var d=parseInt(m["LAST-MSN"]),g=parseInt(m["LAST-PART"]);if(f&&this.hls.config.lowLatencyMode){var T=Math.min(f.age-f.partTarget,f.targetduration);g!==void 0&&T>f.partTarget&&(g+=1)}if(Object(R.isFiniteNumber)(d))return new h.HlsUrlParameters(d,Object(R.isFiniteNumber)(g)?g:void 0,h.HlsSkip.No)}}},r.loadPlaylist=function(p){},r.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},r.playlistLoaded=function(p,f,b){var v=this,m=f.details,n=f.stats,d=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(m.advancedDateTime=Date.now()-d,m.live||b!=null&&b.live){if(m.reloaded(b),b&&this.log("live playlist "+p+" "+(m.advanced?"REFRESHED "+m.lastPartSn+"-"+m.lastPartIndex:"MISSED")),b&&m.fragments.length>0&&Object(o.mergeDetails)(b,m),!this.canLoad||!m.live)return;var g,T=void 0,y=void 0;if(m.canBlockReload&&m.endSN&&m.advanced){var s=this.hls.config.lowLatencyMode,M=m.lastPartSn,A=m.endSN,x=m.lastPartIndex,E=x!==-1,w=M===A,_=s?0:x;E?(T=w?A+1:M,y=w?_:x+1):T=A+1;var N=m.age,j=N+m.ageHeader,k=Math.min(j-m.partTarget,m.targetduration*1.5);if(k>0){if(b&&k>b.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+b.tuneInGoal+" to: "+k+" with playlist age: "+m.age),k=0;else{var z=Math.floor(k/m.targetduration);if(T+=z,y!==void 0){var H=Math.round(k%m.targetduration/m.partTarget);y+=H}this.log("CDN Tune-in age: "+m.ageHeader+"s last advanced "+N.toFixed(2)+"s goal: "+k+" skip sn "+z+" to part "+y)}m.tuneInGoal=k}if(g=this.getDeliveryDirectives(m,f.deliveryDirectives,T,y),s||!w){this.loadPlaylist(g);return}}else g=this.getDeliveryDirectives(m,f.deliveryDirectives,T,y);var F=Object(o.computeReloadInterval)(m,n);T!==void 0&&m.canBlockReload&&(F-=m.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(F)+" ms"),this.timer=self.setTimeout(function(){return v.loadPlaylist(g)},F)}else this.clearTimer()},r.getDeliveryDirectives=function(p,f,b,v){var m=Object(h.getSkipValue)(p,b);return f!=null&&f.skip&&p.deltaUpdateFailed&&(b=f.msn,v=f.part,m=h.HlsSkip.No),new h.HlsUrlParameters(b,v,m)},r.retryLoadingOrFail=function(p){var f=this,b=this.hls.config,v=this.retryCount<b.levelLoadingMaxRetry;if(v){var m;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(m=p.context)!==null&&m!==void 0&&m.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*b.levelLoadingRetryDelay,b.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return f.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return v},i}()},"./src/controller/base-stream-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"State",function(){return A}),S.d(u,"default",function(){return x});var R=S("./src/polyfills/number.ts"),h=S("./src/task-loop.ts"),o=S("./src/controller/fragment-tracker.ts"),C=S("./src/utils/buffer-helper.ts"),c=S("./src/utils/logger.ts"),a=S("./src/events.ts"),i=S("./src/errors.ts"),r=S("./src/types/transmuxer.ts"),l=S("./src/utils/mp4-tools.ts"),p=S("./src/utils/discontinuities.ts"),f=S("./src/controller/fragment-finders.ts"),b=S("./src/controller/level-helper.ts"),v=S("./src/loader/fragment-loader.ts"),m=S("./src/crypt/decrypter.ts"),n=S("./src/utils/time-ranges.ts"),d=S("./src/types/loader.ts");function g(E,w){for(var _=0;_<w.length;_++){var N=w[_];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(E,N.key,N)}}function T(E,w,_){return w&&g(E.prototype,w),_&&g(E,_),E}function y(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function s(E,w){E.prototype=Object.create(w.prototype),E.prototype.constructor=E,M(E,w)}function M(E,w){return M=Object.setPrototypeOf||function(N,j){return N.__proto__=j,N},M(E,w)}var A={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"},x=function(E){s(w,E);function w(N,j,k){var z;return z=E.call(this)||this,z.hls=void 0,z.fragPrevious=null,z.fragCurrent=null,z.fragmentTracker=void 0,z.transmuxer=null,z._state=A.STOPPED,z.media=void 0,z.mediaBuffer=void 0,z.config=void 0,z.bitrateTest=!1,z.lastCurrentTime=0,z.nextLoadPosition=0,z.startPosition=0,z.loadedmetadata=!1,z.fragLoadError=0,z.retryDate=0,z.levels=null,z.fragmentLoader=void 0,z.levelLastLoaded=null,z.startFragRequested=!1,z.decrypter=void 0,z.initPTS=[],z.onvseeking=null,z.onvended=null,z.logPrefix="",z.log=void 0,z.warn=void 0,z.logPrefix=k,z.log=c.logger.log.bind(c.logger,k+":"),z.warn=c.logger.warn.bind(c.logger,k+":"),z.hls=N,z.fragmentLoader=new v.default(N.config),z.fragmentTracker=j,z.config=N.config,z.decrypter=new m.default(N,N.config),N.on(a.Events.KEY_LOADED,z.onKeyLoaded,y(z)),z}var _=w.prototype;return _.doTick=function(){this.onTickEnd()},_.onTickEnd=function(){},_.startLoad=function(j){},_.stopLoad=function(){this.fragmentLoader.abort();var j=this.fragCurrent;j&&this.fragmentTracker.removeFragment(j),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=A.STOPPED},_._streamEnded=function(j,k){var z=this.fragCurrent,H=this.fragmentTracker;if(!k.live&&z&&z.sn===k.endSN&&!j.nextStart){var F=H.getState(z);return F===o.FragmentState.PARTIAL||F===o.FragmentState.OK}return!1},_.onMediaAttached=function(j,k){var z=this.media=this.mediaBuffer=k.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),z.addEventListener("seeking",this.onvseeking),z.addEventListener("ended",this.onvended);var H=this.config;this.levels&&H.autoStartLoad&&this.state===A.STOPPED&&this.startLoad(H.startPosition)},_.onMediaDetaching=function(){var j=this.media;j!=null&&j.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),j&&(j.removeEventListener("seeking",this.onvseeking),j.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},_.onMediaSeeking=function(){var j=this.config,k=this.fragCurrent,z=this.media,H=this.mediaBuffer,F=this.state,G=z?z.currentTime:0,B=C.BufferHelper.bufferInfo(H||z,G,j.maxBufferHole);if(this.log("media seeking to "+(Object(R.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+F),F===A.ENDED)this.resetLoadingState();else if(k&&!B.len){var W=j.maxFragLookUpTolerance,K=k.start-W,q=k.start+k.duration+W,re=G>q;(G<K||re)&&(re&&k.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),k.loader.abort()),this.resetLoadingState())}z&&(this.lastCurrentTime=G),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},_.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},_.onKeyLoaded=function(j,k){if(this.state!==A.KEY_LOADING||k.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var z=this.levels[k.frag.level].details;z&&this.loadFragment(k.frag,z,k.frag.start)},_.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},_.onHandlerDestroyed=function(){this.state=A.STOPPED,this.hls.off(a.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)},_.loadKey=function(j,k){this.log("Loading key for "+j.sn+" of ["+k.startSN+"-"+k.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+j.level),this.state=A.KEY_LOADING,this.fragCurrent=j,this.hls.trigger(a.Events.KEY_LOADING,{frag:j})},_.loadFragment=function(j,k,z){this._loadFragForPlayback(j,k,z)},_._loadFragForPlayback=function(j,k,z){var H=this,F=function(B){if(H.fragContextChanged(j)){H.warn("Fragment "+j.sn+(B.part?" p: "+B.part.index:"")+" of level "+j.level+" was dropped during download."),H.fragmentTracker.removeFragment(j);return}j.stats.chunkCount++,H._handleFragmentLoadProgress(B)};this._doFragLoad(j,k,z,F).then(function(G){if(!G)return;H.fragLoadError=0;var B=H.state;if(H.fragContextChanged(j)){(B===A.FRAG_LOADING||B===A.BACKTRACKING||!H.fragCurrent&&B===A.PARSING)&&(H.fragmentTracker.removeFragment(j),H.state=A.IDLE);return}if("payload"in G&&(H.log("Loaded fragment "+j.sn+" of level "+j.level),H.hls.trigger(a.Events.FRAG_LOADED,G),H.state===A.BACKTRACKING)){H.fragmentTracker.backtrack(j,G),H.resetFragmentLoading(j);return}H._handleFragmentLoadComplete(G)}).catch(function(G){H.warn(G),H.resetFragmentLoading(j)})},_.flushMainBuffer=function(j,k,z){if(z===void 0&&(z=null),!(j-k))return;var H={startOffset:j,endOffset:k,type:z};this.fragLoadError=0,this.hls.trigger(a.Events.BUFFER_FLUSHING,H)},_._loadInitSegment=function(j){var k=this;this._doFragLoad(j).then(function(z){if(!z||k.fragContextChanged(j)||!k.levels)throw new Error("init load aborted");return z}).then(function(z){var H=k.hls,F=z.payload,G=j.decryptdata;if(F&&F.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var B=self.performance.now();return k.decrypter.webCryptoDecrypt(new Uint8Array(F),G.key.buffer,G.iv.buffer).then(function(W){var K=self.performance.now();return H.trigger(a.Events.FRAG_DECRYPTED,{frag:j,payload:W,stats:{tstart:B,tdecrypt:K}}),z.payload=W,z})}return z}).then(function(z){var H=k.fragCurrent,F=k.hls,G=k.levels;if(!G)throw new Error("init load aborted, missing levels");var B=G[j.level].details;console.assert(B,"Level details are defined when init segment is loaded");var W=j.stats;k.state=A.IDLE,k.fragLoadError=0,j.data=new Uint8Array(z.payload),W.parsing.start=W.buffering.start=self.performance.now(),W.parsing.end=W.buffering.end=self.performance.now(),z.frag===H&&F.trigger(a.Events.FRAG_BUFFERED,{stats:W,frag:H,part:null,id:j.type}),k.tick()}).catch(function(z){k.warn(z),k.resetFragmentLoading(j)})},_.fragContextChanged=function(j){var k=this.fragCurrent;return!j||!k||j.level!==k.level||j.sn!==k.sn||j.urlId!==k.urlId},_.fragBufferedComplete=function(j,k){var z=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+j.type+" sn: "+j.sn+(k?" part: "+k.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+j.level+" "+n.default.toString(C.BufferHelper.getBuffered(z))),this.state=A.IDLE,this.tick()},_._handleFragmentLoadComplete=function(j){var k=this.transmuxer;if(!k)return;var z=j.frag,H=j.part,F=j.partsLoaded,G=!F||F.length===0||F.some(function(W){return!W}),B=new r.ChunkMetadata(z.level,z.sn,z.stats.chunkCount+1,0,H?H.index:-1,!G);k.flush(B)},_._handleFragmentLoadProgress=function(j){},_._doFragLoad=function(j,k,z,H){var F=this;if(z===void 0&&(z=null),!this.levels)throw new Error("frag load aborted, missing levels");if(z=Math.max(j.start,z||0),this.config.lowLatencyMode&&k){var G=k.partList;if(G&&H){z>j.end&&k.fragmentHint&&(j=k.fragmentHint);var B=this.getNextPart(G,j,z);if(B>-1){var W=G[B];return this.log("Loading part sn: "+j.sn+" p: "+W.index+" cc: "+j.cc+" of playlist ["+k.startSN+"-"+k.endSN+"] parts [0-"+B+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+j.level+", target: "+parseFloat(z.toFixed(3))),this.nextLoadPosition=W.start+W.duration,this.state=A.FRAG_LOADING,this.hls.trigger(a.Events.FRAG_LOADING,{frag:j,part:G[B],targetBufferTime:z}),this.doFragPartsLoad(j,G,B,H).catch(function(K){return F.handleFragLoadError(K)})}else if(!j.url||this.loadedEndOfParts(G,z))return Promise.resolve(null)}}return this.log("Loading fragment "+j.sn+" cc: "+j.cc+" "+(k?"of ["+k.startSN+"-"+k.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+j.level+", target: "+parseFloat(z.toFixed(3))),Object(R.isFiniteNumber)(j.sn)&&!this.bitrateTest&&(this.nextLoadPosition=j.start+j.duration),this.state=A.FRAG_LOADING,this.hls.trigger(a.Events.FRAG_LOADING,{frag:j,targetBufferTime:z}),this.fragmentLoader.load(j,H).catch(function(K){return F.handleFragLoadError(K)})},_.doFragPartsLoad=function(j,k,z,H){var F=this;return new Promise(function(G,B){var W=[],K=function q(re){var ee=k[re];F.fragmentLoader.loadPart(j,ee,H).then(function(Ce){W[ee.index]=Ce;var xe=Ce.part;F.hls.trigger(a.Events.FRAG_LOADED,Ce);var he=k[re+1];if(he&&he.fragment===j)q(re+1);else return G({frag:j,part:xe,partsLoaded:W})}).catch(B)};K(z)})},_.handleFragLoadError=function(j){var k=j.data;return k&&k.details===i.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(k.frag,k.part):this.hls.trigger(a.Events.ERROR,k),null},_._handleTransmuxerFlush=function(j){var k=this.getCurrentContext(j);if(!k||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var z=k.frag,H=k.part,F=k.level,G=self.performance.now();z.stats.parsing.end=G,H&&(H.stats.parsing.end=G),this.updateLevelTiming(z,H,F,j.partial)},_.getCurrentContext=function(j){var k=this.levels,z=j.level,H=j.sn,F=j.part;if(!k||!k[z])return this.warn("Levels object was unset while buffering fragment "+H+" of level "+z+". The current chunk will not be buffered."),null;var G=k[z],B=F>-1?Object(b.getPartWith)(G,H,F):null,W=B?B.fragment:Object(b.getFragmentWithSN)(G,H,this.fragCurrent);return W?{frag:W,part:B,level:G}:null},_.bufferFragmentData=function(j,k,z,H){if(!j||this.state!==A.PARSING)return;var F=j.data1,G=j.data2,B=F;if(F&&G&&(B=Object(l.appendUint8Array)(F,G)),!B||!B.length)return;var W={type:j.type,frag:k,part:z,chunkMeta:H,parent:k.type,data:B};this.hls.trigger(a.Events.BUFFER_APPENDING,W),j.dropped&&j.independent&&!z&&this.flushBufferGap(k)},_.flushBufferGap=function(j){var k=this.media;if(!k)return;if(!C.BufferHelper.isBuffered(k,k.currentTime)){this.flushMainBuffer(0,j.start);return}var z=k.currentTime,H=C.BufferHelper.bufferInfo(k,z,0),F=j.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,F*.25),B=Math.max(Math.min(j.start-G,H.end-G),z+G);j.start-B>G&&this.flushMainBuffer(B,j.start)},_.getFwdBufferInfo=function(j,k){var z=this.config,H=this.getLoadPosition();if(!Object(R.isFiniteNumber)(H))return null;var F=C.BufferHelper.bufferInfo(j,H,z.maxBufferHole);if(F.len===0&&F.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(H,k);if(G&&F.nextStart<G.end)return C.BufferHelper.bufferInfo(j,H,Math.max(F.nextStart,z.maxBufferHole))}return F},_.getMaxBufferLength=function(j){var k=this.config,z;return j?z=Math.max(8*k.maxBufferSize/j,k.maxBufferLength):z=k.maxBufferLength,Math.min(z,k.maxMaxBufferLength)},_.reduceMaxBufferLength=function(j){var k=this.config,z=j||k.maxBufferLength;return k.maxMaxBufferLength>=z?(k.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+k.maxMaxBufferLength+"s"),!0):!1},_.getNextFragment=function(j,k){var z,H,F=k.fragments,G=F.length;if(!G)return null;var B=this.config,W=F[0].start,K;if(k.live){var q=B.initialLiveManifestSize;if(G<q)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+q+")"),null;!k.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(K=this.getInitialLiveFragment(k,F),this.startPosition=K?this.hls.liveSyncPosition||K.start:j)}else j<=W&&(K=F[0]);if(!K){var re=B.lowLatencyMode?k.partEnd:k.fragmentEnd;K=this.getFragmentAtPosition(j,re,k)}return(z=K)!==null&&z!==void 0&&z.initSegment&&!((H=K)!==null&&H!==void 0&&H.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},_.getNextPart=function(j,k,z){for(var H=-1,F=!1,G=!0,B=0,W=j.length;B<W;B++){var K=j[B];if(G=G&&!K.independent,H>-1&&z<K.start)break;var q=K.loaded;!q&&(F||K.independent||G)&&K.fragment===k&&(H=B),F=q}return H},_.loadedEndOfParts=function(j,k){var z=j[j.length-1];return z&&k>z.start&&z.loaded},_.getInitialLiveFragment=function(j,k){var z=this.fragPrevious,H=null;if(z){if(j.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+z.programDateTime),H=Object(f.findFragmentByPDT)(k,z.endProgramDateTime,this.config.maxFragLookUpTolerance)),!H){var F=z.sn+1;if(F>=j.startSN&&F<=j.endSN){var G=k[F-j.startSN];z.cc===G.cc&&(H=G,this.log("Live playlist, switching playlist, load frag with next SN: "+H.sn))}H||(H=Object(f.findFragWithCC)(k,z.cc),H&&this.log("Live playlist, switching playlist, load frag with same CC: "+H.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(H=this.getFragmentAtPosition(B,this.bitrateTest?j.fragmentEnd:j.edge,j))}return H},_.getFragmentAtPosition=function(j,k,z){var H=this.config,F=this.fragPrevious,G=z.fragments,B=z.endSN,W=z.fragmentHint,K=H.maxFragLookUpTolerance,q=!!(H.lowLatencyMode&&z.partList&&W);q&&W&&!this.bitrateTest&&(G=G.concat(W),B=W.sn);var re;if(j<k){var ee=j>k-K?0:K;re=Object(f.findFragmentByPTS)(F,G,j,ee)}else re=G[G.length-1];if(re){var Ce=re.sn-z.startSN,xe=F&&re.level===F.level,he=G[Ce+1],ke=this.fragmentTracker.getState(re);if(ke===o.FragmentState.BACKTRACKED){re=null;for(var _e=Ce;G[_e]&&this.fragmentTracker.getState(G[_e])===o.FragmentState.BACKTRACKED;)F?re=G[_e--]:re=G[--_e];re||(re=he)}else F&&re.sn===F.sn&&!q&&(xe&&(re.sn<B&&this.fragmentTracker.getState(he)!==o.FragmentState.OK?(this.log("SN "+re.sn+" just loaded, load next one: "+he.sn),re=he):re=null))}return re},_.synchronizeToLiveEdge=function(j){var k=this.config,z=this.media;if(!z)return;var H=this.hls.liveSyncPosition,F=z.currentTime,G=j.fragments[0].start,B=j.edge,W=F>=G-k.maxFragLookUpTolerance&&F<=B;if(H!==null&&z.duration>H&&(F<H||!W)){var K=k.liveMaxLatencyDuration!==void 0?k.liveMaxLatencyDuration:k.liveMaxLatencyDurationCount*j.targetduration;(!W&&z.readyState<4||F<B-K)&&(this.loadedmetadata||(this.nextLoadPosition=H),z.readyState&&(this.warn("Playback: "+F.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+H.toFixed(3)),z.currentTime=H))}},_.alignPlaylists=function(j,k){var z=this.levels,H=this.levelLastLoaded,F=this.fragPrevious,G=H!==null?z[H]:null,B=j.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var W=j.fragments[0].start,K=!k,q=j.alignedSliding&&Object(R.isFiniteNumber)(W);if(K||!q&&!W){Object(p.alignStream)(F,G,j);var re=j.fragments[0].start;return this.log("Live playlist sliding: "+re.toFixed(2)+" start-sn: "+(k?k.startSN:"na")+"->"+j.startSN+" prev-sn: "+(F?F.sn:"na")+" fragments: "+B),re}return W},_.waitForCdnTuneIn=function(j){var k=3;return j.live&&j.canBlockReload&&j.tuneInGoal>Math.max(j.partHoldBack,j.partTarget*k)},_.setStartPosition=function(j,k){var z=this.startPosition;if(z<k&&(z=-1),z===-1||this.lastCurrentTime===-1){var H=j.startTimeOffset;Object(R.isFiniteNumber)(H)?(z=k+H,H<0&&(z+=j.totalduration),z=Math.min(Math.max(k,z),k+j.totalduration),this.log("Start time offset "+H+" found in playlist, adjust startPosition to "+z),this.startPosition=z):j.live?z=this.hls.liveSyncPosition||k:this.startPosition=z=0,this.lastCurrentTime=z}this.nextLoadPosition=z},_.getLoadPosition=function(){var j=this.media,k=0;return this.loadedmetadata&&j?k=j.currentTime:this.nextLoadPosition&&(k=this.nextLoadPosition),k},_.handleFragLoadAborted=function(j,k){this.transmuxer&&j.sn!=="initSegment"&&j.stats.aborted&&(this.warn("Fragment "+j.sn+(k?" part"+k.index:"")+" of level "+j.level+" was aborted"),this.resetFragmentLoading(j))},_.resetFragmentLoading=function(j){(!this.fragCurrent||!this.fragContextChanged(j))&&(this.state=A.IDLE)},_.onFragmentOrKeyLoadError=function(j,k){if(k.fatal)return;var z=k.frag;if(!z||z.type!==j)return;var H=this.fragCurrent;console.assert(H&&z.sn===H.sn&&z.level===H.level&&z.urlId===H.urlId,"Frag load error must match current frag to retry");var F=this.config;if(this.fragLoadError+1<=F.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(z.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*F.fragLoadingRetryDelay,F.fragLoadingMaxRetryTimeout);this.warn("Fragment "+z.sn+" of "+j+" "+z.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else k.levelRetry?(j===d.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(c.logger.error(k.details+" reaches max retry, redispatch as fatal ..."),k.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},_.afterBufferFlushed=function(j,k,z){if(!j)return;var H=C.BufferHelper.getBuffered(j);this.fragmentTracker.detectEvictedFragments(k,H,z),this.state===A.ENDED&&this.resetLoadingState()},_.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},_.resetLiveStartWhenNotLoaded=function(j){if(!this.loadedmetadata){this.startFragRequested=!1;var k=this.levels?this.levels[j].details:null;if(k!=null&&k.live)return this.startPosition=-1,this.setStartPosition(k,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},_.updateLevelTiming=function(j,k,z,H){var F=this,G=z.details;console.assert(!!G,"level.details must be defined");var B=Object.keys(j.elementaryStreams).reduce(function(W,K){var q=j.elementaryStreams[K];if(q){var re=q.endPTS-q.startPTS;if(re<=0)return F.warn("Could not parse fragment "+j.sn+" "+K+" duration reliably ("+re+") resetting transmuxer to fallback to playlist timing"),F.resetTransmuxer(),W||!1;var ee=H?0:Object(b.updateFragPTSDTS)(G,j,q.startPTS,q.endPTS,q.startDTS,q.endDTS);return F.hls.trigger(a.Events.LEVEL_PTS_UPDATED,{details:G,level:z,drift:ee,type:K,frag:j,start:q.startPTS,end:q.endPTS}),!0}return W},!1);B?(this.state=A.PARSED,this.hls.trigger(a.Events.FRAG_PARSED,{frag:j,part:k})):this.resetLoadingState()},_.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},T(w,[{key:"state",get:function(){return this._state},set:function(j){var k=this._state;k!==j&&(this._state=j,this.log(k+"->"+j))}}]),w}(h.default)},"./src/controller/buffer-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return f});var R=S("./src/polyfills/number.ts"),h=S("./src/events.ts"),o=S("./src/utils/logger.ts"),C=S("./src/errors.ts"),c=S("./src/utils/buffer-helper.ts"),a=S("./src/utils/mediasource-helper.ts"),i=S("./src/loader/fragment.ts"),r=S("./src/controller/buffer-operation-queue.ts"),l=Object(a.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,f=function(){function b(m){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 d=n.hls,g=n.media,T=n.mediaSource;o.logger.log("[buffer-controller]: Media source opened"),g&&(n.updateMediaElementDuration(),d.trigger(h.Events.MEDIA_ATTACHED,{media:g})),T&&T.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){o.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){o.logger.log("[buffer-controller]: Media source ended")},this.hls=m,this._initSourceBuffer(),this.registerListeners()}var v=b.prototype;return v.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},v.destroy=function(){this.unregisterListeners(),this.details=null},v.registerListeners=function(){var n=this.hls;n.on(h.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(h.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(h.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(h.Events.BUFFER_RESET,this.onBufferReset,this),n.on(h.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(h.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(h.Events.BUFFER_EOS,this.onBufferEos,this),n.on(h.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(h.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(h.Events.FRAG_PARSED,this.onFragParsed,this),n.on(h.Events.FRAG_CHANGED,this.onFragChanged,this)},v.unregisterListeners=function(){var n=this.hls;n.off(h.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(h.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(h.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(h.Events.BUFFER_RESET,this.onBufferReset,this),n.off(h.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(h.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(h.Events.BUFFER_EOS,this.onBufferEos,this),n.off(h.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(h.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(h.Events.FRAG_PARSED,this.onFragParsed,this),n.off(h.Events.FRAG_CHANGED,this.onFragChanged,this)},v._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new r.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},v.onManifestParsed=function(n,d){var g=2;(d.audio&&!d.video||!d.altAudio)&&(g=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=g,this.details=null,o.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},v.onMediaAttaching=function(n,d){var g=this.media=d.media;if(g&&l){var T=this.mediaSource=new l;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),g.src=self.URL.createObjectURL(T),this._objectUrl=g.src}},v.onMediaDetaching=function(){var n=this.media,d=this.mediaSource,g=this._objectUrl;if(d){if(o.logger.log("[buffer-controller]: media source detaching"),d.readyState==="open")try{d.endOfStream()}catch(T){o.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),d.removeEventListener("sourceopen",this._onMediaSourceOpen),d.removeEventListener("sourceended",this._onMediaSourceEnded),d.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(g&&self.URL.revokeObjectURL(g),n.src===g?(n.removeAttribute("src"),n.load()):o.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(h.Events.MEDIA_DETACHED,void 0)},v.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(d){var g=n.sourceBuffer[d];try{g&&(n.removeBufferListeners(d),n.mediaSource&&n.mediaSource.removeSourceBuffer(g),n.sourceBuffer[d]=void 0)}catch(T){o.logger.warn("[buffer-controller]: Failed to reset the "+d+" buffer",T)}}),this._initSourceBuffer()},v.onBufferCodecs=function(n,d){var g=this,T=this.getSourceBufferTypes().length;if(Object.keys(d).forEach(function(y){if(T){var s=g.tracks[y];if(s&&typeof s.buffer.changeType=="function"){var M=d[y],A=M.codec,x=M.levelCodec,E=M.container,w=(s.levelCodec||s.codec).replace(p,"$1"),_=(x||A).replace(p,"$1");if(w!==_){var N=E+";codecs="+(x||A);g.appendChangeType(y,N)}}}else g.pendingTracks[y]=d[y]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},v.appendChangeType=function(n,d){var g=this,T=this.operationQueue,y={execute:function(){var M=g.sourceBuffer[n];M&&(o.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+d),M.changeType(d)),T.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(M){o.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",M)}};T.append(y,n)},v.onBufferAppending=function(n,d){var g=this,T=this.hls,y=this.operationQueue,s=this.tracks,M=d.data,A=d.type,x=d.frag,E=d.part,w=d.chunkMeta,_=w.buffering[A],N=self.performance.now();_.start=N;var j=x.stats.buffering,k=E?E.stats.buffering:null;j.start===0&&(j.start=N),k&&k.start===0&&(k.start=N);var z=s.audio,H=A==="audio"&&w.id===1&&(z==null?void 0:z.container)==="audio/mpeg",F={execute:function(){if(_.executeStart=self.performance.now(),H){var B=g.sourceBuffer[A];if(B){var W=x.start-B.timestampOffset;Math.abs(W)>=.1&&(o.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+x.start+" (delta: "+W+") sn: "+x.sn+")"),B.timestampOffset=x.start)}}g.appendExecutor(M,A)},onStart:function(){},onComplete:function(){var B=self.performance.now();_.executeEnd=_.end=B,j.first===0&&(j.first=B),k&&k.first===0&&(k.first=B);var W=g.sourceBuffer,K={};for(var q in W)K[q]=c.BufferHelper.getBuffered(W[q]);g.appendError=0,g.hls.trigger(h.Events.BUFFER_APPENDED,{type:A,frag:x,part:E,chunkMeta:w,parent:x.type,timeRanges:K})},onError:function(B){o.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",B);var W={type:C.ErrorTypes.MEDIA_ERROR,parent:x.type,details:C.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?W.details=C.ErrorDetails.BUFFER_FULL_ERROR:(g.appendError++,W.details=C.ErrorDetails.BUFFER_APPEND_ERROR,g.appendError>T.config.appendErrorMaxRetry&&(o.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),W.fatal=!0)),T.trigger(h.Events.ERROR,W)}};y.append(F,A)},v.onBufferFlushing=function(n,d){var g=this,T=this.operationQueue,y=function(M){return{execute:g.removeExecutor.bind(g,M,d.startOffset,d.endOffset),onStart:function(){},onComplete:function(){g.hls.trigger(h.Events.BUFFER_FLUSHED,{type:M})},onError:function(x){o.logger.warn("[buffer-controller]: Failed to remove from "+M+" SourceBuffer",x)}}};d.type?T.append(y(d.type),d.type):this.getSourceBufferTypes().forEach(function(s){T.append(y(s),s)})},v.onFragParsed=function(n,d){var g=this,T=d.frag,y=d.part,s=[],M=y?y.elementaryStreams:T.elementaryStreams;M[i.ElementaryStreamTypes.AUDIOVIDEO]?s.push("audiovideo"):(M[i.ElementaryStreamTypes.AUDIO]&&s.push("audio"),M[i.ElementaryStreamTypes.VIDEO]&&s.push("video"));var A=function(){var E=self.performance.now();T.stats.buffering.end=E,y&&(y.stats.buffering.end=E);var w=y?y.stats:T.stats;g.hls.trigger(h.Events.FRAG_BUFFERED,{frag:T,part:y,stats:w,id:T.type})};s.length===0&&o.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(A,s)},v.onFragChanged=function(n,d){this.flushBackBuffer()},v.onBufferEos=function(n,d){var g=this,T=this.getSourceBufferTypes().reduce(function(y,s){var M=g.sourceBuffer[s];return(!d.type||d.type===s)&&(M&&!M.ended&&(M.ended=!0,o.logger.log("[buffer-controller]: "+s+" sourceBuffer now EOS"))),y&&!!(!M||M.ended)},!0);T&&this.blockBuffers(function(){var y=g.mediaSource;if(!y||y.readyState!=="open")return;y.endOfStream()})},v.onLevelUpdated=function(n,d){var g=d.details;if(!g.fragments.length)return;this.details=g,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},v.flushBackBuffer=function(){var n=this.hls,d=this.details,g=this.media,T=this.sourceBuffer;if(!g||d===null)return;var y=this.getSourceBufferTypes();if(!y.length)return;var s=d.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(R.isFiniteNumber)(s)||s<0)return;var M=g.currentTime,A=d.levelTargetDuration,x=Math.max(s,A),E=Math.floor(M/A)*A-x;y.forEach(function(w){var _=T[w];if(_){var N=c.BufferHelper.getBuffered(_);N.length>0&&E>N.start(0)&&(n.trigger(h.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),d.live&&n.trigger(h.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),n.trigger(h.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:w}))}})},v.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,d=this.hls,g=this.media,T=this.mediaSource,y=n.fragments[0].start+n.totalduration,s=g.duration,M=Object(R.isFiniteNumber)(T.duration)?T.duration:0;n.live&&d.config.liveDurationInfinity?(o.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(n)):(y>M&&y>s||!Object(R.isFiniteNumber)(s))&&(o.logger.log("[buffer-controller]: Updating Media Source duration to "+y.toFixed(3)),T.duration=y)},v.updateSeekableRange=function(n){var d=this.mediaSource,g=n.fragments,T=g.length;if(T&&n.live&&d!==null&&d!==void 0&&d.setLiveSeekableRange){var y=Math.max(0,g[0].start),s=Math.max(y,y+n.totalduration);d.setLiveSeekableRange(y,s)}},v.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,d=this.operationQueue,g=this.pendingTracks,T=Object.keys(g).length;if(T&&!n||T===2){this.createSourceBuffers(g),this.pendingTracks={};var y=this.getSourceBufferTypes();if(y.length===0){this.hls.trigger(h.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}y.forEach(function(s){d.executeNext(s)})}},v.createSourceBuffers=function(n){var d=this.sourceBuffer,g=this.mediaSource;if(!g)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var y in n)if(!d[y]){var s=n[y];if(!s)throw Error("source buffer exists for track "+y+", however track does not");var M=s.levelCodec||s.codec,A=s.container+";codecs="+M;o.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var x=d[y]=g.addSourceBuffer(A),E=y;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[y]={buffer:x,codec:M,container:s.container,levelCodec:s.levelCodec,id:s.id},T++}catch(w){o.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+w.message),this.hls.trigger(h.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:w,mimeType:A})}}T&&this.hls.trigger(h.Events.BUFFER_CREATED,{tracks:this.tracks})},v._onSBUpdateStart=function(n){var d=this.operationQueue,g=d.current(n);g.onStart()},v._onSBUpdateEnd=function(n){var d=this.operationQueue,g=d.current(n);g.onComplete(),d.shiftAndExecuteNext(n)},v._onSBUpdateError=function(n,d){o.logger.error("[buffer-controller]: "+n+" SourceBuffer error",d),this.hls.trigger(h.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var g=this.operationQueue.current(n);g&&g.onError(d)},v.removeExecutor=function(n,d,g){var T=this.media,y=this.mediaSource,s=this.operationQueue,M=this.sourceBuffer,A=M[n];if(!T||!y||!A){o.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(n);return}var x=Object(R.isFiniteNumber)(T.duration)?T.duration:Infinity,E=Object(R.isFiniteNumber)(y.duration)?y.duration:Infinity,w=Math.max(0,d),_=Math.min(g,x,E);_>w?(o.logger.log("[buffer-controller]: Removing ["+w+","+_+"] from the "+n+" SourceBuffer"),console.assert(!A.updating,n+" sourceBuffer must not be updating"),A.remove(w,_)):s.shiftAndExecuteNext(n)},v.appendExecutor=function(n,d){var g=this.operationQueue,T=this.sourceBuffer,y=T[d];if(!y){o.logger.warn("[buffer-controller]: Attempting to append to the "+d+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(d);return}y.ended=!1,console.assert(!y.updating,d+" sourceBuffer must not be updating"),y.appendBuffer(n)},v.blockBuffers=function(n,d){var g=this;if(d===void 0&&(d=this.getSourceBufferTypes()),!d.length){o.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var T=this.operationQueue,y=d.map(function(s){return T.appendBlocker(s)});Promise.all(y).then(function(){n(),d.forEach(function(s){var M=g.sourceBuffer[s];(!M||!M.updating)&&T.shiftAndExecuteNext(s)})})},v.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},v.addBufferListener=function(n,d,g){var T=this.sourceBuffer[n];if(!T)return;var y=g.bind(this,n);this.listeners[n].push({event:d,listener:y}),T.addEventListener(d,y)},v.removeBufferListeners=function(n){var d=this.sourceBuffer[n];if(!d)return;this.listeners[n].forEach(function(g){d.removeEventListener(g.event,g.listener)})},b}()},"./src/controller/buffer-operation-queue.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return h});var R=S("./src/utils/logger.ts"),h=function(){function o(c){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=c}var C=o.prototype;return C.append=function(a,i){var r=this.queues[i];r.push(a),r.length===1&&this.buffers[i]&&this.executeNext(i)},C.insertAbort=function(a,i){var r=this.queues[i];r.unshift(a),this.executeNext(i)},C.appendBlocker=function(a){var i,r=new Promise(function(p){i=p}),l={execute:i,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(l,a),r},C.executeNext=function(a){var i=this.buffers,r=this.queues,l=i[a],p=r[a];if(p.length){var f=p[0];try{f.execute()}catch(b){R.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),f.onError(b),(!l||!l.updating)&&(p.shift(),this.executeNext(a))}}},C.shiftAndExecuteNext=function(a){this.queues[a].shift(),this.executeNext(a)},C.current=function(a){return this.queues[a][0]},o}()},"./src/controller/cap-level-controller.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/events.ts");function h(c,a){for(var i=0;i<a.length;i++){var r=a[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(c,r.key,r)}}function o(c,a,i){return a&&h(c.prototype,a),i&&h(c,i),c}var C=function(){function c(i){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=i,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var a=c.prototype;return a.setStreamController=function(r){this.streamController=r},a.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},a.registerListeners=function(){var r=this.hls;r.on(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},a.unregisterListener=function(){var r=this.hls;r.off(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},a.onFpsDropLevelCapping=function(r,l){c.isLevelAllowed(l.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(l.droppedLevel)},a.onMediaAttaching=function(r,l){this.media=l.media instanceof HTMLVideoElement?l.media:null},a.onManifestParsed=function(r,l){var p=this.hls;this.restrictedLevels=[],this.firstLevel=l.firstLevel,p.config.capLevelToPlayerSize&&l.video&&this.startCapping()},a.onBufferCodecs=function(r,l){var p=this.hls;p.config.capLevelToPlayerSize&&l.video&&this.startCapping()},a.onMediaDetaching=function(){this.stopCapping()},a.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var r=this.hls.levels;if(r.length){var l=this.hls;l.autoLevelCapping=this.getMaxLevel(r.length-1),l.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=l.autoLevelCapping}}},a.getMaxLevel=function(r){var l=this,p=this.hls.levels;if(!p.length)return-1;var f=p.filter(function(b,v){return c.isLevelAllowed(v,l.restrictedLevels)&&v<=r});return this.clientRect=null,c.getMaxLevelByMediaSize(f,this.mediaWidth,this.mediaHeight)},a.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()},a.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},a.getDimensions=function(){if(this.clientRect)return this.clientRect;var r=this.media,l={width:0,height:0};if(r){var p=r.getBoundingClientRect();l.width=p.width,l.height=p.height,!l.width&&!l.height&&(l.width=p.right-p.left||r.width||0,l.height=p.bottom-p.top||r.height||0)}return this.clientRect=l,l},c.isLevelAllowed=function(r,l){return l===void 0&&(l=[]),l.indexOf(r)===-1},c.getMaxLevelByMediaSize=function(r,l,p){if(!r||!r.length)return-1;for(var f=function(d,g){return g?d.width!==g.width||d.height!==g.height:!0},b=r.length-1,v=0;v<r.length;v+=1){var m=r[v];if((m.width>=l||m.height>=p)&&f(m,r[v+1])){b=v;break}}return b},o(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 r=1;try{r=self.devicePixelRatio}catch(l){}return r}}]),c}();u.default=C},"./src/controller/cmcd-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return f});var R=S("./src/events.ts"),h=S("./src/types/cmcd.ts"),o=S("./src/utils/buffer-helper.ts"),C=S("./src/utils/logger.ts");function c(b,v){for(var m=0;m<v.length;m++){var n=v[m];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(b,n.key,n)}}function a(b,v,m){return v&&c(b.prototype,v),m&&c(b,m),b}function i(b,v){var m=typeof Symbol!="undefined"&&b[Symbol.iterator]||b["@@iterator"];if(m)return(m=m.call(b)).next.bind(m);if(Array.isArray(b)||(m=r(b))||v&&b&&typeof b.length=="number"){m&&(b=m);var n=0;return function(){return n>=b.length?{done:!0}:{done:!1,value:b[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 r(b,v){if(!b)return;if(typeof b=="string")return l(b,v);var m=Object.prototype.toString.call(b).slice(8,-1);if(m==="Object"&&b.constructor&&(m=b.constructor.name),m==="Map"||m==="Set")return Array.from(b);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return l(b,v)}function l(b,v){(v==null||v>b.length)&&(v=b.length);for(var m=0,n=new Array(v);m<v;m++)n[m]=b[m];return n}function p(){return p=Object.assign||function(b){for(var v=1;v<arguments.length;v++){var m=arguments[v];for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&(b[n]=m[n])}return b},p.apply(this,arguments)}var f=function(){function b(m){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(T){try{n.apply(T,{ot:h.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(y){C.logger.warn("Could not generate manifest CMCD data.",y)}},this.applyFragmentData=function(T){try{var y=T.frag,s=n.hls.levels[y.level],M=n.getObjectType(y),A={d:y.duration*1e3,ot:M};(M===h.CMCDObjectType.VIDEO||M===h.CMCDObjectType.AUDIO||M==h.CMCDObjectType.MUXED)&&(A.br=s.bitrate/1e3,A.tb=n.getTopBandwidth(M),A.bl=n.getBufferLength(M)),n.apply(T,A)}catch(x){C.logger.warn("Could not generate segment CMCD data.",x)}},this.hls=m;var d=this.config=m.config,g=d.cmcd;g!=null&&(d.pLoader=this.createPlaylistLoader(),d.fLoader=this.createFragmentLoader(),this.sid=g.sessionId||b.uuid(),this.cid=g.contentId,this.useHeaders=g.useHeaders===!0,this.registerListeners())}var v=b.prototype;return v.registerListeners=function(){var n=this.hls;n.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this)},v.unregisterListeners=function(){var n=this.hls;n.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},v.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},v.onMediaAttached=function(n,d){this.media=d.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},v.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},v.onBufferCreated=function(n,d){var g,T;this.audioBuffer=(g=d.tracks.audio)===null||g===void 0?void 0:g.buffer,this.videoBuffer=(T=d.tracks.video)===null||T===void 0?void 0:T.buffer},v.createData=function(){var n;return{v:h.CMCDVersion,sf:h.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}},v.apply=function(n,d){d===void 0&&(d={}),p(d,this.createData());var g=d.ot===h.CMCDObjectType.INIT||d.ot===h.CMCDObjectType.VIDEO||d.ot===h.CMCDObjectType.MUXED;if(this.starved&&g&&(d.bs=!0,d.su=!0,this.starved=!1),d.su==null&&(d.su=this.buffering),this.useHeaders){var T=b.toHeaders(d);if(!Object.keys(T).length)return;n.headers||(n.headers={}),p(n.headers,T)}else{var y=b.toQuery(d);if(!y)return;n.url=b.appendQueryToUri(n.url,y)}},v.getObjectType=function(n){var d=n.type;return d==="subtitle"?h.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?h.CMCDObjectType.INIT:d==="audio"?h.CMCDObjectType.AUDIO:d==="main"?this.hls.audioTracks.length?h.CMCDObjectType.VIDEO:h.CMCDObjectType.MUXED:void 0},v.getTopBandwidth=function(n){for(var d=0,g=n===h.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,T=i(g),y;!(y=T()).done;){var s=y.value;s.bitrate>d&&(d=s.bitrate)}return d>0?d:NaN},v.getBufferLength=function(n){var d=this.hls.media,g=n===h.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!g||!d)return NaN;var T=o.BufferHelper.bufferInfo(g,d.currentTime,this.config.maxBufferHole);return T.len*1e3},v.createPlaylistLoader=function(){var n=this.config.pLoader,d=this.applyPlaylistData,g=n||this.config.loader;return function(){function T(s){this.loader=void 0,this.loader=new g(s)}var y=T.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(M,A,x){d(M),this.loader.load(M,A,x)},a(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},v.createFragmentLoader=function(){var n=this.config.fLoader,d=this.applyFragmentData,g=n||this.config.loader;return function(){function T(s){this.loader=void 0,this.loader=new g(s)}var y=T.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(M,A,x){d(M),this.loader.load(M,A,x)},a(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},b.uuid=function(){var n=URL.createObjectURL(new Blob),d=n.toString();return URL.revokeObjectURL(n),d.substr(d.lastIndexOf("/")+1)},b.serialize=function(n){for(var d=[],g=function(H){return!Number.isNaN(H)&&H!=null&&H!==""&&H!==!1},T=function(H){return Math.round(H)},y=function(H){return T(H/100)*100},s=function(H){return encodeURIComponent(H)},M={br:T,d:T,bl:y,dl:y,mtp:y,nor:s,rtp:y,tb:T},A=Object.keys(n||{}).sort(),x=i(A),E;!(E=x()).done;){var w=E.value,_=n[w];if(!g(_))continue;if(w==="v"&&_===1)continue;if(w=="pr"&&_===1)continue;var N=M[w];N&&(_=N(_));var j=typeof _,k=void 0;w==="ot"||w==="sf"||w==="st"?k=w+"="+_:j==="boolean"?k=w:j==="number"?k=w+"="+_:k=w+"="+JSON.stringify(_),d.push(k)}return d.join(",")},b.toHeaders=function(n){for(var d=Object.keys(n),g={},T=["Object","Request","Session","Status"],y=[{},{},{},{}],s={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},M=0,A=d;M<A.length;M++){var x=A[M],E=s[x]!=null?s[x]:1;y[E][x]=n[x]}for(var w=0;w<y.length;w++){var _=b.serialize(y[w]);_&&(g["CMCD-"+T[w]]=_)}return g},b.toQuery=function(n){return"CMCD="+encodeURIComponent(b.serialize(n))},b.appendQueryToUri=function(n,d){if(!d)return n;var g=n.includes("?")?"&":"?";return""+n+g+d},b}()},"./src/controller/eme-controller.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/events.ts"),h=S("./src/errors.ts"),o=S("./src/utils/logger.ts"),C=S("./src/utils/mediakeys-helper.ts");function c(f,b){for(var v=0;v<b.length;v++){var m=b[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}function a(f,b,v){return b&&c(f.prototype,b),v&&c(f,v),f}var i=3,r=function(b,v,m){var n={audioCapabilities:[],videoCapabilities:[]};return b.forEach(function(d){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+d+'"',robustness:m.audioRobustness||""})}),v.forEach(function(d){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+d+'"',robustness:m.videoRobustness||""})}),[n]},l=function(b,v,m,n){switch(b){case C.KeySystems.WIDEVINE:return r(v,m,n);default:throw new Error("Unknown key-system: "+b)}},p=function(){function f(v){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=v,this._config=v.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 b=f.prototype;return b.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},b._registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this)},b._unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this)},b.getLicenseServerUrl=function(m){switch(m){case C.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+m+'"')},b._attemptKeySystemAccess=function(m,n,d){var g=this,T=l(m,n,d,this._drmSystemOptions);o.logger.log("Requesting encrypted media key-system access");var y=this.requestMediaKeySystemAccess(m,T);this.mediaKeysPromise=y.then(function(s){return g._onMediaKeySystemAccessObtained(m,s)}),y.catch(function(s){o.logger.error('Failed to obtain key-system "'+m+'" access:',s)})},b._onMediaKeySystemAccessObtained=function(m,n){var d=this;o.logger.log('Access for key-system "'+m+'" obtained');var g={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:m};this._mediaKeysList.push(g);var T=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(y){return g.mediaKeys=y,o.logger.log('Media-keys created for key-system "'+m+'"'),d._onMediaKeysCreated(),y});return T.catch(function(y){o.logger.error("Failed to create media-keys:",y)}),T},b._onMediaKeysCreated=function(){var m=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),m._onNewMediaKeySession(n.mediaKeysSession))})},b._onNewMediaKeySession=function(m){var n=this;o.logger.log("New key-system session "+m.sessionId),m.addEventListener("message",function(d){n._onKeySessionMessage(m,d.message)},!1)},b._onKeySessionMessage=function(m,n){o.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(d){o.logger.log("Received license data (length: "+(d&&d.byteLength)+"), updating key-session"),m.update(d)})},b.onMediaEncrypted=function(m){var n=this;if(o.logger.log('Media is encrypted using "'+m.initDataType+'" init data type'),!this.mediaKeysPromise){o.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var d=function(T){if(!n._media)return;n._attemptSetMediaKeys(T),n._generateRequestWithPreferredKeySession(m.initDataType,m.initData)};this.mediaKeysPromise.then(d).catch(d)},b._attemptSetMediaKeys=function(m){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){o.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}o.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},b._generateRequestWithPreferredKeySession=function(m,n){var d=this,g=this._mediaKeysList[0];if(!g){o.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(g.mediaKeysSessionInitialized){o.logger.warn("Key-Session already initialized but requested again");return}var T=g.mediaKeysSession;if(!T){o.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){o.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}o.logger.log('Generating key-session request for "'+m+'" init data type'),g.mediaKeysSessionInitialized=!0,T.generateRequest(m,n).then(function(){o.logger.debug("Key-session generation succeeded")}).catch(function(y){o.logger.error("Error generating key-session request:",y),d.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},b._createLicenseXhr=function(m,n,d){var g=new XMLHttpRequest;g.responseType="arraybuffer",g.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,g,m,n,d);var T=this._licenseXhrSetup;if(T)try{T.call(this.hls,g,m),T=void 0}catch(y){o.logger.error(y)}try{g.readyState||g.open("POST",m,!0),T&&T.call(this.hls,g,m)}catch(y){throw new Error("issue setting up KeySystem license XHR "+y)}return g},b._onLicenseRequestReadyStageChange=function(m,n,d,g){switch(m.readyState){case 4:if(m.status===200){this._requestLicenseFailureCount=0,o.logger.log("License request succeeded");var T=m.response,y=this._licenseResponseCallback;if(y)try{T=y.call(this.hls,m,n)}catch(M){o.logger.error(M)}g(T)}else{if(o.logger.error("License Request XHR failed ("+n+"). Status: "+m.status+" ("+m.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>i){this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var s=i-this._requestLicenseFailureCount+1;o.logger.warn("Retrying license request, "+s+" attempts left"),this._requestLicense(d,g)}break}},b._generateLicenseRequestChallenge=function(m,n){switch(m.mediaKeySystemDomain){case C.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+m.mediaKeySystemDomain)},b._requestLicense=function(m,n){o.logger.log("Requesting content license for key-system");var d=this._mediaKeysList[0];if(!d){o.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var g=this.getLicenseServerUrl(d.mediaKeySystemDomain),T=this._createLicenseXhr(g,m,n);o.logger.log("Sending license request to URL: "+g);var y=this._generateLicenseRequestChallenge(d,m);T.send(y)}catch(s){o.logger.error("Failure requesting DRM license: "+s),this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.KEY_SYSTEM_ERROR,details:h.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},b.onMediaAttached=function(m,n){if(!this._emeEnabled)return;var d=n.media;this._media=d,d.addEventListener("encrypted",this._onMediaEncrypted)},b.onMediaDetached=function(){var m=this._media,n=this._mediaKeysList;if(!m)return;m.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(d){if(d.mediaKeysSession)return d.mediaKeysSession.close().catch(function(){})})).then(function(){return m.setMediaKeys(null)}).catch(function(){})},b.onManifestParsed=function(m,n){if(!this._emeEnabled)return;var d=n.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),g=n.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(C.KeySystems.WIDEVINE,d,g)},a(f,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),f}();u.default=p},"./src/controller/fps-controller.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/events.ts"),h=S("./src/utils/logger.ts"),o=function(){function C(a){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=a,this.registerListeners()}var c=C.prototype;return c.setStreamController=function(i){this.streamController=i},c.registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},c.unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching)},c.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},c.onMediaAttaching=function(i,r){var l=this.hls.config;if(l.capLevelOnFPSDrop){var p=r.media instanceof self.HTMLVideoElement?r.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),l.fpsDroppedMonitoringPeriod)}},c.checkFPS=function(i,r,l){var p=performance.now();if(r){if(this.lastTime){var f=p-this.lastTime,b=l-this.lastDroppedFrames,v=r-this.lastDecodedFrames,m=1e3*b/f,n=this.hls;if(n.trigger(R.Events.FPS_DROP,{currentDropped:b,currentDecoded:v,totalDroppedFrames:l}),m>0&&b>n.config.fpsDroppedMonitoringThreshold*v){var d=n.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=d)&&(d=d-1,n.trigger(R.Events.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:n.currentLevel}),n.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=l,this.lastDecodedFrames=r}},c.checkFPSInterval=function(){var i=this.media;if(i)if(this.isVideoPlaybackQualityAvailable){var r=i.getVideoPlaybackQuality();this.checkFPS(i,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(i,i.webkitDecodedFrameCount,i.webkitDroppedFrameCount)},C}();u.default=o},"./src/controller/fragment-finders.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"findFragmentByPDT",function(){return o}),S.d(u,"findFragmentByPTS",function(){return C}),S.d(u,"fragmentWithinToleranceTest",function(){return c}),S.d(u,"pdtWithinToleranceTest",function(){return a}),S.d(u,"findFragWithCC",function(){return i});var R=S("./src/polyfills/number.ts"),h=S("./src/utils/binary-search.ts");function o(r,l,p){if(l===null||!Array.isArray(r)||!r.length||!Object(R.isFiniteNumber)(l))return null;var f=r[0].programDateTime;if(l<(f||0))return null;var b=r[r.length-1].endProgramDateTime;if(l>=(b||0))return null;p=p||0;for(var v=0;v<r.length;++v){var m=r[v];if(a(l,p,m))return m}return null}function C(r,l,p,f){p===void 0&&(p=0),f===void 0&&(f=0);var b=null;if(r?b=l[r.sn-l[0].sn+1]||null:p===0&&l[0].start===0&&(b=l[0]),b&&c(p,f,b)===0)return b;var v=h.default.search(l,c.bind(null,p,f));return v||b}function c(r,l,p){r===void 0&&(r=0),l===void 0&&(l=0);var f=Math.min(l,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-f<=r?1:p.start-f>r&&p.start?-1:0}function a(r,l,p){var f=Math.min(l,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,b=p.endProgramDateTime||0;return b-f>r}function i(r,l){return h.default.search(r,function(p){return p.cc<l?1:p.cc>l?-1:0})}},"./src/controller/fragment-tracker.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"FragmentState",function(){return o}),S.d(u,"FragmentTracker",function(){return C});var R=S("./src/events.ts"),h=S("./src/types/loader.ts"),o;(function(i){i.NOT_LOADED="NOT_LOADED",i.BACKTRACKED="BACKTRACKED",i.APPENDING="APPENDING",i.PARTIAL="PARTIAL",i.OK="OK"})(o||(o={}));var C=function(){function i(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 r=i.prototype;return r._registerListeners=function(){var p=this.hls;p.on(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(R.Events.FRAG_LOADED,this.onFragLoaded,this)},r._unregisterListeners=function(){var p=this.hls;p.off(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(R.Events.FRAG_LOADED,this.onFragLoaded,this)},r.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},r.getAppendedFrag=function(p,f){if(f===h.PlaylistLevelType.MAIN){var b=this.activeFragment,v=this.activeParts;if(!b)return null;if(v)for(var m=v.length;m--;){var n=v[m],d=n?n.end:b.appendedPTS;if(n.start<=p&&d!==void 0&&p<=d)return m>9&&(this.activeParts=v.slice(m-9)),n}else if(b.start<=p&&b.appendedPTS!==void 0&&p<=b.appendedPTS)return b}return this.getBufferedFrag(p,f)},r.getBufferedFrag=function(p,f){for(var b=this.fragments,v=Object.keys(b),m=v.length;m--;){var n=b[v[m]];if((n==null?void 0:n.body.type)===f&&n.buffered){var d=n.body;if(d.start<=p&&p<=d.end)return d}}return null},r.detectEvictedFragments=function(p,f,b){var v=this;Object.keys(this.fragments).forEach(function(m){var n=v.fragments[m];if(!n)return;if(!n.buffered){n.body.type===b&&v.removeFragment(n.body);return}var d=n.range[p];if(!d)return;d.time.some(function(g){var T=!v.isTimeBuffered(g.startPTS,g.endPTS,f);return T&&v.removeFragment(n.body),T})})},r.detectPartialFragments=function(p){var f=this,b=this.timeRanges,v=p.frag,m=p.part;if(!b||v.sn==="initSegment")return;var n=a(v),d=this.fragments[n];if(!d)return;Object.keys(b).forEach(function(g){var T=v.elementaryStreams[g];if(!T)return;var y=b[g],s=m!==null||T.partial===!0;d.range[g]=f.getBufferedTimes(v,m,s,y)}),d.backtrack=d.loaded=null,Object.keys(d.range).length?d.buffered=!0:this.removeFragment(d.body)},r.fragBuffered=function(p){var f=a(p),b=this.fragments[f];b&&(b.backtrack=b.loaded=null,b.buffered=!0)},r.getBufferedTimes=function(p,f,b,v){for(var m={time:[],partial:b},n=f?f.start:p.start,d=f?f.end:p.end,g=p.minEndPTS||d,T=p.maxStartPTS||n,y=0;y<v.length;y++){var s=v.start(y)-this.bufferPadding,M=v.end(y)+this.bufferPadding;if(T>=s&&g<=M){m.time.push({startPTS:Math.max(n,v.start(y)),endPTS:Math.min(d,v.end(y))});break}else if(n<M&&d>s)m.partial=!0,m.time.push({startPTS:Math.max(n,v.start(y)),endPTS:Math.min(d,v.end(y))});else if(d<=s)break}return m},r.getPartialFragment=function(p){var f=null,b,v,m,n=0,d=this.bufferPadding,g=this.fragments;return Object.keys(g).forEach(function(T){var y=g[T];if(!y)return;c(y)&&(v=y.body.start-d,m=y.body.end+d,p>=v&&p<=m&&(b=Math.min(p-v,m-p),n<=b&&(f=y.body,n=b)))}),f},r.getState=function(p){var f=a(p),b=this.fragments[f];return b?b.buffered?c(b)?o.PARTIAL:o.OK:b.backtrack?o.BACKTRACKED:o.APPENDING:o.NOT_LOADED},r.backtrack=function(p,f){var b=a(p),v=this.fragments[b];if(!v||v.backtrack)return null;var m=v.backtrack=f||v.loaded;return v.loaded=null,m},r.getBacktrackData=function(p){var f=a(p),b=this.fragments[f];if(b){var v,m=b.backtrack;if(m!=null&&(v=m.payload)!==null&&v!==void 0&&v.byteLength)return m;this.removeFragment(p)}return null},r.isTimeBuffered=function(p,f,b){for(var v,m,n=0;n<b.length;n++){if(v=b.start(n)-this.bufferPadding,m=b.end(n)+this.bufferPadding,p>=v&&f<=m)return!0;if(f<=v)return!1}return!1},r.onFragLoaded=function(p,f){var b=f.frag,v=f.part;if(b.sn==="initSegment"||b.bitrateTest||v)return;var m=a(b);this.fragments[m]={body:b,loaded:f,backtrack:null,buffered:!1,range:Object.create(null)}},r.onBufferAppended=function(p,f){var b=this,v=f.frag,m=f.part,n=f.timeRanges;if(v.type===h.PlaylistLevelType.MAIN)if(this.activeFragment=v,m){var d=this.activeParts;d||(this.activeParts=d=[]),d.push(m)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(g){var T=n[g];if(b.detectEvictedFragments(g,T),!m)for(var y=0;y<T.length;y++)v.appendedPTS=Math.max(T.end(y),v.appendedPTS||0)})},r.onFragBuffered=function(p,f){this.detectPartialFragments(f)},r.hasFragment=function(p){var f=a(p);return!!this.fragments[f]},r.removeFragmentsInRange=function(p,f,b){var v=this;Object.keys(this.fragments).forEach(function(m){var n=v.fragments[m];if(!n)return;if(n.buffered){var d=n.body;d.type===b&&d.start<f&&d.end>p&&v.removeFragment(d)}})},r.removeFragment=function(p){var f=a(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[f]},r.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},i}();function c(i){var r,l;return i.buffered&&(((r=i.range.video)===null||r===void 0?void 0:r.partial)||((l=i.range.audio)===null||l===void 0?void 0:l.partial))}function a(i){return i.type+"_"+i.level+"_"+i.urlId+"_"+i.sn}},"./src/controller/gap-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"STALL_MINIMUM_DURATION_MS",function(){return c}),S.d(u,"MAX_START_GAP_JUMP",function(){return a}),S.d(u,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return i}),S.d(u,"SKIP_BUFFER_RANGE_START",function(){return r}),S.d(u,"default",function(){return l});var R=S("./src/utils/buffer-helper.ts"),h=S("./src/errors.ts"),o=S("./src/events.ts"),C=S("./src/utils/logger.ts"),c=250,a=2,i=.1,r=.05,l=function(){function p(b,v,m,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=b,this.media=v,this.fragmentTracker=m,this.hls=n}var f=p.prototype;return f.destroy=function(){this.hls=this.fragmentTracker=this.media=null},f.poll=function(v){var m=this.config,n=this.media,d=this.stalled,g=n.currentTime,T=n.seeking,y=this.seeking&&!T,s=!this.seeking&&T;if(this.seeking=T,g!==v){if(this.moved=!0,d!==null){if(this.stallReported){var M=self.performance.now()-d;C.logger.warn("playback not stuck anymore @"+g+", after "+Math.round(M)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((s||y)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!R.BufferHelper.getBuffered(n).length)return;var A=R.BufferHelper.bufferInfo(n,g,0),x=A.len>0,E=A.nextStart||0;if(!x&&!E)return;if(T){var w=A.len>a,_=!E||E-g>a&&!this.fragmentTracker.getPartialFragment(g);if(w||_)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var N,j=Math.max(E,A.start||0)-g,k=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,z=k==null||((N=k.details)===null||N===void 0)?void 0:N.live,H=z?k.details.targetduration*2:a;if(j>0&&j<=H){this._trySkipBufferHole(null);return}}var F=self.performance.now();if(d===null){this.stalled=F;return}var G=F-d;!T&&G>=c&&this._reportStall(A.len);var B=R.BufferHelper.bufferInfo(n,g,m.maxBufferHole);this._tryFixBufferStall(B,G)},f._tryFixBufferStall=function(v,m){var n=this.config,d=this.fragmentTracker,g=this.media,T=g.currentTime,y=d.getPartialFragment(T);if(y){var s=this._trySkipBufferHole(y);if(s)return}v.len>n.maxBufferHole&&m>n.highBufferWatchdogPeriod*1e3&&(C.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},f._reportStall=function(v){var m=this.hls,n=this.media,d=this.stallReported;d||(this.stallReported=!0,C.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+v+")"),m.trigger(o.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:v}))},f._trySkipBufferHole=function(v){for(var m=this.config,n=this.hls,d=this.media,g=d.currentTime,T=0,y=R.BufferHelper.getBuffered(d),s=0;s<y.length;s++){var M=y.start(s);if(g+m.maxBufferHole>=T&&g<M){var A=Math.max(M+r,d.currentTime+i);return C.logger.warn("skipping hole, adjusting currentTime from "+g+" to "+A),this.moved=!0,this.stalled=null,d.currentTime=A,v&&n.trigger(o.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+g+" to "+A,frag:v}),A}T=y.end(s)}return 0},f._tryNudgeBuffer=function(){var v=this.config,m=this.hls,n=this.media,d=n.currentTime,g=(this.nudgeRetry||0)+1;if(this.nudgeRetry=g,g<v.nudgeMaxRetry){var T=d+g*v.nudgeOffset;C.logger.warn("Nudging 'currentTime' from "+d+" to "+T),n.currentTime=T,m.trigger(o.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else C.logger.error("Playhead still not moving while enough data buffered @"+d+" after "+v.nudgeMaxRetry+" nudges"),m.trigger(o.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/events.ts"),h=S("./src/utils/texttrack-utils.ts"),o=S("./src/demux/id3.ts"),C=.25,c=function(){function a(r){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=r,this._registerListeners()}var i=a.prototype;return i.destroy=function(){this._unregisterListeners()},i._registerListeners=function(){var l=this.hls;l.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(R.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),l.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},i._unregisterListeners=function(){var l=this.hls;l.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(R.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),l.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},i.onMediaAttached=function(l,p){this.media=p.media},i.onMediaDetaching=function(){if(!this.id3Track)return;Object(h.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},i.getID3Track=function(l){if(!this.media)return;for(var p=0;p<l.length;p++){var f=l[p];if(f.kind==="metadata"&&f.label==="id3")return Object(h.sendAddTrackEvent)(f,this.media),f}return this.media.addTextTrack("metadata","id3")},i.onFragParsingMetadata=function(l,p){if(!this.media)return;var f=p.frag,b=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var v=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,m=0;m<b.length;m++){var n=o.getID3Frames(b[m].data);if(n){var d=b[m].pts,g=m<b.length-1?b[m+1].pts:f.end,T=g-d;T<=0&&(g=d+C);for(var y=0;y<n.length;y++){var s=n[y];if(!o.isTimeStampFrame(s)){var M=new v(d,g,"");M.value=s,this.id3Track.addCue(M)}}}}},i.onBufferFlushing=function(l,p){var f=p.startOffset,b=p.endOffset,v=p.type;if(!v||v==="audio"){var m=this.id3Track;m&&Object(h.removeCuesInRange)(m,f,b)}},a}();u.default=c},"./src/controller/latency-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return a});var R=S("./src/errors.ts"),h=S("./src/events.ts"),o=S("./src/utils/logger.ts");function C(i,r){for(var l=0;l<r.length;l++){var p=r[l];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(i,p.key,p)}}function c(i,r,l){return r&&C(i.prototype,r),l&&C(i,l),i}var a=function(){function i(l){var p=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 p.timeupdate()},this.hls=l,this.config=l.config,this.registerListeners()}var r=i.prototype;return r.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},r.registerListeners=function(){this.hls.on(h.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(h.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(h.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(h.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(h.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){this.hls.off(h.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(h.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(h.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(h.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(h.Events.ERROR,this.onError)},r.onMediaAttached=function(p,f){this.media=f.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},r.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},r.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},r.onLevelUpdated=function(p,f){var b=f.details;this.levelDetails=b,b.advanced&&this.timeupdate(),!b.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},r.onError=function(p,f){if(f.details!==R.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,o.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},r.timeupdate=function(){var p=this.media,f=this.levelDetails;if(!p||!f)return;this.currentTime=p.currentTime;var b=this.computeLatency();if(b===null)return;this._latency=b;var v=this.config,m=v.lowLatencyMode,n=v.maxLiveSyncPlaybackRate;if(!m||n===1)return;var d=this.targetLatency;if(d===null)return;var g=b-d,T=Math.min(this.maxLatency,d+f.targetduration),y=g<T;if(f.live&&y&&g>.05&&this.forwardBufferLength>1){var s=Math.min(2,Math.max(1,n)),M=Math.round(2/(1+Math.exp(-.75*g-this.edgeStalled))*20)/20;p.playbackRate=Math.min(s,Math.max(1,M))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},r.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},r.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},c(i,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,f=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:f?p.liveMaxLatencyDurationCount*f.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var f=p.holdBack,b=p.partHoldBack,v=p.targetduration,m=this.config,n=m.liveSyncDuration,d=m.liveSyncDurationCount,g=m.lowLatencyMode,T=this.hls.userConfig,y=g&&b||f;(T.liveSyncDuration||T.liveSyncDurationCount||y===0)&&(y=n!==void 0?n:d*v);var s=v,M=1;return y+Math.min(this.stallCount*M,s)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),f=this.targetLatency,b=this.levelDetails;if(p===null||f===null||b===null)return null;var v=b.edge,m=p-f-this.edgeStalled,n=v-b.totalduration,d=v-(this.config.lowLatencyMode&&b.partTarget||b.targetduration);return Math.min(Math.max(n,m),d)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var f=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-f,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,f=this.levelDetails;if(!p||!f)return 0;var b=p.buffered.length;return b?p.buffered.end(b-1):f.edge-this.currentTime}}]),i}()},"./src/controller/level-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return m});var R=S("./src/types/level.ts"),h=S("./src/events.ts"),o=S("./src/errors.ts"),C=S("./src/utils/codecs.ts"),c=S("./src/controller/level-helper.ts"),a=S("./src/controller/base-playlist-controller.ts"),i=S("./src/types/loader.ts");function r(){return r=Object.assign||function(n){for(var d=1;d<arguments.length;d++){var g=arguments[d];for(var T in g)Object.prototype.hasOwnProperty.call(g,T)&&(n[T]=g[T])}return n},r.apply(this,arguments)}function l(n,d){for(var g=0;g<d.length;g++){var T=d[g];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(n,T.key,T)}}function p(n,d,g){return d&&l(n.prototype,d),g&&l(n,g),n}function f(n,d){n.prototype=Object.create(d.prototype),n.prototype.constructor=n,b(n,d)}function b(n,d){return b=Object.setPrototypeOf||function(T,y){return T.__proto__=y,T},b(n,d)}var v=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),m=function(n){f(d,n);function d(T){var y;return y=n.call(this,T,"[level-controller]")||this,y._levels=[],y._firstLevel=-1,y._startLevel=void 0,y.currentLevelIndex=-1,y.manualLevelIndex=-1,y.onParsedComplete=void 0,y._registerListeners(),y}var g=d.prototype;return g._registerListeners=function(){var y=this.hls;y.on(h.Events.MANIFEST_LOADED,this.onManifestLoaded,this),y.on(h.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(h.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.on(h.Events.FRAG_LOADED,this.onFragLoaded,this),y.on(h.Events.ERROR,this.onError,this)},g._unregisterListeners=function(){var y=this.hls;y.off(h.Events.MANIFEST_LOADED,this.onManifestLoaded,this),y.off(h.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(h.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.off(h.Events.FRAG_LOADED,this.onFragLoaded,this),y.off(h.Events.ERROR,this.onError,this)},g.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},g.startLoad=function(){var y=this._levels;y.forEach(function(s){s.loadError=0}),n.prototype.startLoad.call(this)},g.onManifestLoaded=function(y,s){var M=[],A=[],x=[],E,w={},_,N=!1,j=!1,k=!1;if(s.levels.forEach(function(G){var B=G.attrs;N=N||!!(G.width&&G.height),j=j||!!G.videoCodec,k=k||!!G.audioCodec,v&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var W=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;_=w[W],_?_.url.push(G.url):(_=new R.Level(G),w[W]=_,M.push(_)),B&&(B.AUDIO&&Object(c.addGroupId)(_,"audio",B.AUDIO),B.SUBTITLES&&Object(c.addGroupId)(_,"text",B.SUBTITLES))}),(N||j)&&k&&(M=M.filter(function(G){var B=G.videoCodec,W=G.width,K=G.height;return!!B||!!(W&&K)})),M=M.filter(function(G){var B=G.audioCodec,W=G.videoCodec;return(!B||Object(C.isCodecSupportedInMp4)(B,"audio"))&&(!W||Object(C.isCodecSupportedInMp4)(W,"video"))}),s.audioTracks&&(A=s.audioTracks.filter(function(G){return!G.audioCodec||Object(C.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(c.assignTrackIdsByGroup)(A)),s.subtitles&&(x=s.subtitles,Object(c.assignTrackIdsByGroup)(x)),M.length>0){E=M[0].bitrate,M.sort(function(G,B){return G.bitrate-B.bitrate}),this._levels=M;for(var z=0;z<M.length;z++)if(M[z].bitrate===E){this._firstLevel=z,this.log("manifest loaded, "+M.length+" level(s) found, first bitrate: "+E);break}var H=k&&!j,F={levels:M,audioTracks:A,subtitleTracks:x,firstLevel:this._firstLevel,stats:s.stats,audio:k,video:j,altAudio:!H&&A.some(function(G){return!!G.url})};this.hls.trigger(h.Events.MANIFEST_PARSED,F),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(h.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:s.url,reason:"no level with compatible codecs found in manifest"})},g.onError=function(y,s){if(n.prototype.onError.call(this,y,s),s.fatal)return;var M=s.context,A=this._levels[this.currentLevelIndex];if(M&&(M.type===i.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&M.groupId===A.audioGroupIds[A.urlId]||M.type===i.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&M.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var x=!1,E=!0,w;switch(s.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:if(s.frag){var _=this._levels[s.frag.level];_?(_.fragmentError++,_.fragmentError>this.hls.config.fragLoadingMaxRetry&&(w=s.frag.level)):w=s.frag.level}break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:M&&(M.deliveryDirectives&&(E=!1),w=M.level),x=!0;break;case o.ErrorDetails.REMUX_ALLOC_ERROR:w=s.level,x=!0;break}w!==void 0&&this.recoverLevel(s,w,x,E)},g.recoverLevel=function(y,s,M,A){var x=y.details,E=this._levels[s];if(E.loadError++,M){var w=this.retryLoadingOrFail(y);if(w)y.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var _=E.url.length;if(_>1&&E.loadError<_)y.levelRetry=!0,this.redundantFailover(s);else if(this.manualLevelIndex===-1){var N=s===0?this._levels.length-1:s-1;this.currentLevelIndex!==N&&this._levels[N].loadError===0&&(this.warn(x+": switch to "+N),y.levelRetry=!0,this.hls.nextAutoLevel=N)}}},g.redundantFailover=function(y){var s=this._levels[y],M=s.url.length;if(M>1){var A=(s.urlId+1)%M;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(x){x.urlId=A}),this.level=y}},g.onFragLoaded=function(y,s){var M=s.frag;if(M!==void 0&&M.type===i.PlaylistLevelType.MAIN){var A=this._levels[M.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},g.onLevelLoaded=function(y,s){var M,A=s.level,x=s.details,E=this._levels[A];if(!E){var w;this.warn("Invalid level index "+A),(w=s.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(x.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(A,s,E.details)):(M=s.deliveryDirectives)!==null&&M!==void 0&&M.skip&&(x.deltaUpdateFailed=!0)},g.onAudioTrackSwitched=function(y,s){var M=this.hls.levels[this.currentLevelIndex];if(!M)return;if(M.audioGroupIds){for(var A=-1,x=this.hls.audioTracks[s.id].groupId,E=0;E<M.audioGroupIds.length;E++)if(M.audioGroupIds[E]===x){A=E;break}A!==M.urlId&&(M.urlId=A,this.startLoad())}},g.loadPlaylist=function(y){var s=this.currentLevelIndex,M=this._levels[s];if(this.canLoad&&M&&M.url.length>0){var A=M.urlId,x=M.url[A];if(y)try{x=y.addDirectives(x)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+s+(y?" at sn "+y.msn+" part "+y.part:"")+" with URL-id "+A+" "+x),this.clearTimer(),this.hls.trigger(h.Events.LEVEL_LOADING,{url:x,level:s,id:A,deliveryDirectives:y||null})}},g.removeLevel=function(y,s){var M=function(E,w){return w!==s},A=this._levels.filter(function(x,E){return E!==y?!0:x.url.length>1&&s!==void 0?(x.url=x.url.filter(M),x.audioGroupIds&&(x.audioGroupIds=x.audioGroupIds.filter(M)),x.textGroupIds&&(x.textGroupIds=x.textGroupIds.filter(M)),x.urlId=0,!0):!1}).map(function(x,E){var w=x.details;return w!=null&&w.fragments&&w.fragments.forEach(function(_){_.level=E}),x});this._levels=A,this.hls.trigger(h.Events.LEVELS_UPDATED,{levels:A})},p(d,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(y){var s,M=this._levels;if(M.length===0)return;if(this.currentLevelIndex===y&&(s=M[y])!==null&&s!==void 0&&s.details)return;if(y<0||y>=M.length){var A=y<0;if(this.hls.trigger(h.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.LEVEL_SWITCH_ERROR,level:y,fatal:A,reason:"invalid level idx"}),A)return;y=Math.min(y,M.length-1)}this.clearTimer();var x=this.currentLevelIndex,E=M[x],w=M[y];this.log("switching to level "+y+" from "+x),this.currentLevelIndex=y;var _=r({},w,{level:y,maxBitrate:w.maxBitrate,uri:w.uri,urlId:w.urlId});delete _._urlId,this.hls.trigger(h.Events.LEVEL_SWITCHING,_);var N=w.details;if(!N||N.live){var j=this.switchParams(w.uri,E==null?void 0:E.details);this.loadPlaylist(j)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(y){this.manualLevelIndex=y,this._startLevel===void 0&&(this._startLevel=y),y!==-1&&(this.level=y)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(y){this._firstLevel=y}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var y=this.hls.config.startLevel;return y!==void 0?y:this._firstLevel}else return this._startLevel},set:function(y){this._startLevel=y}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(y){this.level=y,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=y)}}]),d}(a.default)},"./src/controller/level-helper.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"addGroupId",function(){return o}),S.d(u,"assignTrackIdsByGroup",function(){return C}),S.d(u,"updatePTS",function(){return c}),S.d(u,"updateFragPTSDTS",function(){return i}),S.d(u,"mergeDetails",function(){return r}),S.d(u,"mapPartIntersection",function(){return l}),S.d(u,"mapFragmentIntersection",function(){return p}),S.d(u,"adjustSliding",function(){return f}),S.d(u,"addSliding",function(){return b}),S.d(u,"computeReloadInterval",function(){return v}),S.d(u,"getFragmentWithSN",function(){return m}),S.d(u,"getPartWith",function(){return n});var R=S("./src/polyfills/number.ts"),h=S("./src/utils/logger.ts");function o(d,g,T){switch(g){case"audio":d.audioGroupIds||(d.audioGroupIds=[]),d.audioGroupIds.push(T);break;case"text":d.textGroupIds||(d.textGroupIds=[]),d.textGroupIds.push(T);break}}function C(d){var g={};d.forEach(function(T){var y=T.groupId||"";T.id=g[y]=g[y]||0,g[y]++})}function c(d,g,T){var y=d[g],s=d[T];a(y,s)}function a(d,g){var T=g.startPTS;if(Object(R.isFiniteNumber)(T)){var y=0,s;g.sn>d.sn?(y=T-d.start,s=d):(y=d.start-T,s=g),s.duration!==y&&(s.duration=y)}else if(g.sn>d.sn){var M=d.cc===g.cc;M&&d.minEndPTS?g.start=d.start+(d.minEndPTS-d.start):g.start=d.start+d.duration}else g.start=Math.max(d.start-g.duration,0)}function i(d,g,T,y,s,M){var A=y-T;A<=0&&(h.logger.warn("Fragment should have a positive duration",g),y=T+g.duration,M=s+g.duration);var x=T,E=y,w=g.startPTS,_=g.endPTS;if(Object(R.isFiniteNumber)(w)){var N=Math.abs(w-T);Object(R.isFiniteNumber)(g.deltaPTS)?g.deltaPTS=Math.max(N,g.deltaPTS):g.deltaPTS=N,x=Math.max(T,w),T=Math.min(T,w),s=Math.min(s,g.startDTS),E=Math.min(y,_),y=Math.max(y,_),M=Math.max(M,g.endDTS)}g.duration=y-T;var j=T-g.start;g.appendedPTS=y,g.start=g.startPTS=T,g.maxStartPTS=x,g.startDTS=s,g.endPTS=y,g.minEndPTS=E,g.endDTS=M;var k=g.sn;if(!d||k<d.startSN||k>d.endSN)return 0;var z,H=k-d.startSN,F=d.fragments;for(F[H]=g,z=H;z>0;z--)a(F[z],F[z-1]);for(z=H;z<F.length-1;z++)a(F[z],F[z+1]);return d.fragmentHint&&a(F[F.length-1],d.fragmentHint),d.PTSKnown=d.alignedSliding=!0,j}function r(d,g){for(var T=null,y=d.fragments,s=y.length-1;s>=0;s--){var M=y[s].initSegment;if(M){T=M;break}}d.fragmentHint&&delete d.fragmentHint.endPTS;var A=0,x;if(p(d,g,function(z,H){z.relurl&&(A=z.cc-H.cc),Object(R.isFiniteNumber)(z.startPTS)&&Object(R.isFiniteNumber)(z.endPTS)&&(H.start=H.startPTS=z.startPTS,H.startDTS=z.startDTS,H.appendedPTS=z.appendedPTS,H.maxStartPTS=z.maxStartPTS,H.endPTS=z.endPTS,H.endDTS=z.endDTS,H.minEndPTS=z.minEndPTS,H.duration=z.endPTS-z.startPTS,H.duration&&(x=H),g.PTSKnown=g.alignedSliding=!0),H.elementaryStreams=z.elementaryStreams,H.loader=z.loader,H.stats=z.stats,H.urlId=z.urlId,z.initSegment&&(H.initSegment=z.initSegment,T=z.initSegment)}),T){var E=g.fragmentHint?g.fragments.concat(g.fragmentHint):g.fragments;E.forEach(function(z){var H;(!z.initSegment||z.initSegment.relurl===((H=T)===null||H===void 0?void 0:H.relurl))&&(z.initSegment=T)})}if(g.skippedSegments&&(g.deltaUpdateFailed=g.fragments.some(function(z){return!z}),g.deltaUpdateFailed)){h.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var w=g.skippedSegments;w--;)g.fragments.shift();g.startSN=g.fragments[0].sn,g.startCC=g.fragments[0].cc}var _=g.fragments;if(A){h.logger.warn("discontinuity sliding from playlist, take drift into account");for(var N=0;N<_.length;N++)_[N].cc+=A}g.skippedSegments&&(g.startCC=g.fragments[0].cc),l(d.partList,g.partList,function(z,H){H.elementaryStreams=z.elementaryStreams,H.stats=z.stats}),x?i(g,x,x.startPTS,x.endPTS,x.startDTS,x.endDTS):f(d,g),_.length&&(g.totalduration=g.edge-_[0].start),g.driftStartTime=d.driftStartTime,g.driftStart=d.driftStart;var j=g.advancedDateTime;if(g.advanced&&j){var k=g.edge;g.driftStart||(g.driftStartTime=j,g.driftStart=k),g.driftEndTime=j,g.driftEnd=k}else g.driftEndTime=d.driftEndTime,g.driftEnd=d.driftEnd,g.advancedDateTime=d.advancedDateTime}function l(d,g,T){if(d&&g)for(var y=0,s=0,M=d.length;s<=M;s++){var A=d[s],x=g[s+y];A&&x&&A.index===x.index&&A.fragment.sn===x.fragment.sn?T(A,x):y--}}function p(d,g,T){for(var y=g.skippedSegments,s=Math.max(d.startSN,g.startSN)-g.startSN,M=(d.fragmentHint?1:0)+(y?g.endSN:Math.min(d.endSN,g.endSN))-g.startSN,A=g.startSN-d.startSN,x=g.fragmentHint?g.fragments.concat(g.fragmentHint):g.fragments,E=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,w=s;w<=M;w++){var _=E[A+w],N=x[w];y&&!N&&w<y&&(N=g.fragments[w]=_),_&&N&&T(_,N)}}function f(d,g){var T=g.startSN+g.skippedSegments-d.startSN,y=d.fragments;if(T<0||T>=y.length)return;b(g,y[T].start)}function b(d,g){if(g){for(var T=d.fragments,y=d.skippedSegments;y<T.length;y++)T[y].start+=g;d.fragmentHint&&(d.fragmentHint.start+=g)}}function v(d,g){var T=1e3*d.levelTargetDuration,y=T/2,s=d.age,M=s>0&&s<T*3,A=g.loading.end-g.loading.start,x,E=d.availabilityDelay;if(d.updated===!1)if(M){var w=333*d.misses;x=Math.max(Math.min(y,A*2),w),d.availabilityDelay=(d.availabilityDelay||0)+x}else x=y;else M?(E=Math.min(E||T/2,s),d.availabilityDelay=E,x=E+T-s):x=T-A;return Math.round(x)}function m(d,g,T){if(!d||!d.details)return null;var y=d.details,s=y.fragments[g-y.startSN];return s||(s=y.fragmentHint,s&&s.sn===g?s:g<y.startSN&&T&&T.sn===g?T:null)}function n(d,g,T){if(!d||!d.details)return null;var y=d.details.partList;if(y)for(var s=y.length;s--;){var M=y[s];if(M.index===T&&M.fragment.sn===g)return M}return null}},"./src/controller/stream-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return y});var R=S("./src/polyfills/number.ts"),h=S("./src/controller/base-stream-controller.ts"),o=S("./src/is-supported.ts"),C=S("./src/events.ts"),c=S("./src/utils/buffer-helper.ts"),a=S("./src/controller/fragment-tracker.ts"),i=S("./src/types/loader.ts"),r=S("./src/loader/fragment.ts"),l=S("./src/demux/transmuxer-interface.ts"),p=S("./src/types/transmuxer.ts"),f=S("./src/controller/gap-controller.ts"),b=S("./src/errors.ts"),v=S("./src/utils/logger.ts");function m(s,M){for(var A=0;A<M.length;A++){var x=M[A];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(s,x.key,x)}}function n(s,M,A){return M&&m(s.prototype,M),A&&m(s,A),s}function d(s,M){s.prototype=Object.create(M.prototype),s.prototype.constructor=s,g(s,M)}function g(s,M){return g=Object.setPrototypeOf||function(x,E){return x.__proto__=E,x},g(s,M)}var T=100,y=function(s){d(M,s);function M(x,E){var w;return w=s.call(this,x,E,"[stream-controller]")||this,w.audioCodecSwap=!1,w.gapController=null,w.level=-1,w._forceStartLoad=!1,w.altAudio=!1,w.audioOnly=!1,w.fragPlaying=null,w.onvplaying=null,w.onvseeked=null,w.fragLastKbps=0,w.stalled=!1,w.couldBacktrack=!1,w.audioCodecSwitch=!1,w.videoBuffer=null,w._registerListeners(),w}var A=M.prototype;return A._registerListeners=function(){var E=this.hls;E.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(C.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(C.Events.ERROR,this.onError,this),E.on(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(C.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(C.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var E=this.hls;E.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(C.Events.ERROR,this.onError,this),E.off(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(C.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(C.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(E){if(this.levels){var w=this.lastCurrentTime,_=this.hls;if(this.stopLoad(),this.setInterval(T),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var N=_.startLevel;N===-1&&(_.config.testBandwidth?(N=0,this.bitrateTest=!0):N=_.nextAutoLevel),this.level=_.nextLoadLevel=N,this.loadedmetadata=!1}w>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+w.toFixed(3)),E=w),this.state=h.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=h.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,s.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case h.State.IDLE:this.doTickIdle();break;case h.State.WAITING_LEVEL:{var E,w=this.levels,_=this.level,N=w==null||((E=w[_])===null||E===void 0)?void 0:E.details;if(N&&(!N.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(N))break;this.state=h.State.IDLE;break}break}case h.State.FRAG_LOADING_WAITING_RETRY:{var j,k=self.performance.now(),z=this.retryDate;(!z||k>=z||(j=this.media)!==null&&j!==void 0&&j.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=h.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){s.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var E,w,_=this.hls,N=this.levelLastLoaded,j=this.levels,k=this.media,z=_.config,H=_.nextLoadLevel;if(N===null||!k&&(this.startFragRequested||!z.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!j||!j[H])return;var F=j[H];this.level=_.nextLoadLevel=H;var G=F.details;if(!G||this.state===h.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==H){this.state=h.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:k,i.PlaylistLevelType.MAIN);if(B===null)return;var W=B.len,K=this.getMaxBufferLength(F.maxBitrate);if(W>=K)return;if(this._streamEnded(B,G)){var q={};this.altAudio&&(q.type="video"),this.hls.trigger(C.Events.BUFFER_EOS,q),this.state=h.State.ENDED;return}var re=B.end,ee=this.getNextFragment(re,G);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"){var Ce=ee.sn-G.startSN;Ce>1&&(ee=G.fragments[Ce-1],this.fragmentTracker.removeFragment(ee))}if(ee&&this.fragmentTracker.getState(ee)===a.FragmentState.OK&&this.nextLoadPosition>re){var xe=this.audioOnly&&!this.altAudio?r.ElementaryStreamTypes.AUDIO:r.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(k,xe,i.PlaylistLevelType.MAIN),ee=this.getNextFragment(this.nextLoadPosition,G)}if(!ee)return;ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),((E=ee.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((w=ee.decryptdata)!==null&&w!==void 0&&w.key)?this.loadKey(ee,G):this.loadFragment(ee,G,re)},A.loadFragment=function(E,w,_){var N,j=this.fragmentTracker.getState(E);if(this.fragCurrent=E,j===a.FragmentState.BACKTRACKED){var k=this.fragmentTracker.getBacktrackData(E);if(k){this._handleFragmentLoadProgress(k),this._handleFragmentLoadComplete(k);return}else j=a.FragmentState.NOT_LOADED}j===a.FragmentState.NOT_LOADED||j===a.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,s.prototype.loadFragment.call(this,E,w,_)):j===a.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((N=this.media)===null||N===void 0?void 0:N.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(E){var w=this.fragmentTracker.getAppendedFrag(E,i.PlaylistLevelType.MAIN);return w&&"fragment"in w?w.fragment:w},A.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,i.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var E=this.levels,w=this.media;if(w!=null&&w.readyState){var _,N=this.getAppendedFrag(w.currentTime);if(N&&N.start>1&&this.flushMainBuffer(0,N.start-1),!w.paused&&E){var j=this.hls.nextLoadLevel,k=E[j],z=this.fragLastKbps;z&&this.fragCurrent?_=this.fragCurrent.duration*k.maxBitrate/(1e3*z)+1:_=0}else _=0;var H=this.getBufferedFrag(w.currentTime+_);if(H){var F=this.followingBufferedFrag(H);if(F){this.abortCurrentFrag();var G=F.maxStartPTS?F.maxStartPTS:F.start,B=F.duration,W=Math.max(H.end,G+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(W,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===h.State.KEY_LOADING&&(this.state=h.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(E,w){s.prototype.flushMainBuffer.call(this,E,w,this.altAudio?"video":null)},A.onMediaAttached=function(E,w){s.prototype.onMediaAttached.call(this,E,w);var _=w.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),_.addEventListener("playing",this.onvplaying),_.addEventListener("seeked",this.onvseeked),this.gapController=new f.default(this.config,_,this.fragmentTracker,this.hls)},A.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),s.prototype.onMediaDetaching.call(this)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var E=this.media,w=E?E.currentTime:null;Object(R.isFiniteNumber)(w)&&this.log("Media seeked to "+w.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(C.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(E,w){var _=!1,N=!1,j;w.levels.forEach(function(k){j=k.audioCodec,j&&(j.indexOf("mp4a.40.2")!==-1&&(_=!0),j.indexOf("mp4a.40.5")!==-1&&(N=!0))}),this.audioCodecSwitch=_&&N&&!Object(o.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=w.levels,this.startFragRequested=!1},A.onLevelLoading=function(E,w){var _=this.levels;if(!_||this.state!==h.State.IDLE)return;var N=_[w.level];(!N.details||N.details.live&&this.levelLastLoaded!==w.level||this.waitForCdnTuneIn(N.details))&&(this.state=h.State.WAITING_LEVEL)},A.onLevelLoaded=function(E,w){var _,N=this.levels,j=w.level,k=w.details,z=k.totalduration;if(!N){this.warn("Levels were reset while loading level "+j);return}this.log("Level "+j+" loaded ["+k.startSN+","+k.endSN+"], cc ["+k.startCC+", "+k.endCC+"] duration:"+z);var H=this.fragCurrent;H&&(this.state===h.State.FRAG_LOADING||this.state===h.State.FRAG_LOADING_WAITING_RETRY)&&(H.level!==w.level&&H.loader&&(this.state=h.State.IDLE,H.loader.abort()));var F=N[j],G=0;if(k.live||(_=F.details)!==null&&_!==void 0&&_.live){if(k.fragments[0]||(k.deltaUpdateFailed=!0),k.deltaUpdateFailed)return;G=this.alignPlaylists(k,F.details)}if(F.details=k,this.levelLastLoaded=j,this.hls.trigger(C.Events.LEVEL_UPDATED,{details:k,level:j}),this.state===h.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(k))return;this.state=h.State.IDLE}this.startFragRequested?k.live&&this.synchronizeToLiveEdge(k):this.setStartPosition(k,G),this.tick()},A._handleFragmentLoadProgress=function(E){var w,_=E.frag,N=E.part,j=E.payload,k=this.levels;if(!k){this.warn("Levels were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var z=k[_.level],H=z.details;if(!H){this.warn("Dropping fragment "+_.sn+" of level "+_.level+" after level details were reset");return}var F=z.videoCodec,G=H.PTSKnown||!H.live,B=(w=_.initSegment)===null||w===void 0?void 0:w.data,W=this._getAudioCodec(z),K=this.transmuxer=this.transmuxer||new l.default(this.hls,i.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),q=N?N.index:-1,re=q!==-1,ee=new p.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,j.byteLength,q,re),Ce=this.initPTS[_.cc];K.push(j,B,W,F,_,N,H.totalduration,G,ee,Ce)},A.onAudioTrackSwitching=function(E,w){var _=this.altAudio,N=!!w.url,j=w.id;if(!N){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var k=this.fragCurrent;k!=null&&k.loader&&(this.log("Switching to main audio track, cancel main fragment load"),k.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var z=this.hls;_&&z.trigger(C.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),z.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:j})}},A.onAudioTrackSwitched=function(E,w){var _=w.id,N=!!this.hls.audioTracks[_].url;if(N){var j=this.videoBuffer;j&&this.mediaBuffer!==j&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=j)}this.altAudio=N,this.tick()},A.onBufferCreated=function(E,w){var _=w.tracks,N,j,k=!1;for(var z in _){var H=_[z];if(H.id==="main"){if(j=z,N=H,z==="video"){var F=_[z];F&&(this.videoBuffer=F.buffer)}}else k=!0}k&&N?(this.log("Alternate track found, use "+j+".buffered to schedule main fragment loading"),this.mediaBuffer=N.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(E,w){var _=w.frag,N=w.part;if(_&&_.type!==i.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(N?" p: "+N.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state),this.state===h.State.PARSED&&(this.state=h.State.IDLE);return}var j=N?N.stats:_.stats;this.fragLastKbps=Math.round(8*j.total/(j.buffering.end-j.loading.first)),_.sn!=="initSegment"&&(this.fragPrevious=_),this.fragBufferedComplete(_,N)},A.onError=function(E,w){switch(w.details){case b.ErrorDetails.FRAG_LOAD_ERROR:case b.ErrorDetails.FRAG_LOAD_TIMEOUT:case b.ErrorDetails.KEY_LOAD_ERROR:case b.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(i.PlaylistLevelType.MAIN,w);break;case b.ErrorDetails.LEVEL_LOAD_ERROR:case b.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==h.State.ERROR&&(w.fatal?(this.warn(""+w.details),this.state=h.State.ERROR):!w.levelRetry&&this.state===h.State.WAITING_LEVEL&&(this.state=h.State.IDLE));break;case b.ErrorDetails.BUFFER_FULL_ERROR:if(w.parent==="main"&&(this.state===h.State.PARSING||this.state===h.State.PARSED)){var _=!0,N=this.getFwdBufferInfo(this.media,i.PlaylistLevelType.MAIN);N&&N.len>.5&&(_=!this.reduceMaxBufferLength(N.len)),_&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var E=this.media,w=this.gapController;if(!E||!w||!E.readyState)return;var _=c.BufferHelper.getBuffered(E);!this.loadedmetadata&&_.length?(this.loadedmetadata=!0,this.seekToStartPos()):w.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=h.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(E,w){var _=w.type;if(_!==r.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var N=(_===r.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(N,_,i.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(E,w){this.levels=w.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var E=this.media,w=E.currentTime,_=this.startPosition;if(_>=0&&w<_){if(E.seeking){v.logger.log("could not seek to "+_+", already seeking at "+w);return}var N=c.BufferHelper.getBuffered(E),j=N.length?N.start(0):0,k=j-_;k>0&&(k<this.config.maxBufferHole||k<this.config.maxFragLookUpTolerance)&&(v.logger.log("adjusting start position by "+k+" to match buffer start"),_+=k,this.startPosition=_),this.log("seek to target start position "+_+" from current time "+w),E.currentTime=_}},A._getAudioCodec=function(E){var w=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&w&&(this.log("Swapping audio codec"),w.indexOf("mp4a.40.5")!==-1?w="mp4a.40.2":w="mp4a.40.5"),w},A._loadBitrateTestFrag=function(E){var w=this;this._doFragLoad(E).then(function(_){var N=w.hls;if(!_||N.nextLoadLevel||w.fragContextChanged(E))return;w.fragLoadError=0,w.state=h.State.IDLE,w.startFragRequested=!1,w.bitrateTest=!1;var j=E.stats;j.parsing.start=j.parsing.end=j.buffering.start=j.buffering.end=self.performance.now(),N.trigger(C.Events.FRAG_LOADED,_)})},A._handleTransmuxComplete=function(E){var w,_="main",N=this.hls,j=E.remuxResult,k=E.chunkMeta,z=this.getCurrentContext(k);if(!z){this.warn("The loading context changed while buffering fragment "+k.sn+" of level "+k.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(k.level);return}var H=z.frag,F=z.part,G=z.level,B=j.video,W=j.text,K=j.id3,q=j.initSegment,re=this.altAudio?void 0:j.audio;if(this.fragContextChanged(H))return;if(this.state=h.State.PARSING,q){q.tracks&&(this._bufferInitSegment(G,q.tracks,H,k),N.trigger(C.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:_,tracks:q.tracks}));var ee=q.initPTS,Ce=q.timescale;Object(R.isFiniteNumber)(ee)&&(this.initPTS[H.cc]=ee,N.trigger(C.Events.INIT_PTS_FOUND,{frag:H,id:_,initPTS:ee,timescale:Ce}))}if(B&&j.independent!==!1){if(G.details){var xe=B.startPTS,he=B.endPTS,ke=B.startDTS,_e=B.endDTS;if(F)F.elementaryStreams[B.type]={startPTS:xe,endPTS:he,startDTS:ke,endDTS:_e};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var de=this.getLoadPosition()+this.config.maxBufferHole;if(de<xe){this.backtrack(H);return}H.setElementaryStreamInfo(B.type,H.start,he,H.start,_e,!0)}H.setElementaryStreamInfo(B.type,xe,he,ke,_e),this.bufferFragmentData(B,H,F,k)}}else if(j.independent===!1){this.backtrack(H);return}if(re){var ce=re.startPTS,ae=re.endPTS,Se=re.startDTS,te=re.endDTS;F&&(F.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:ae,startDTS:Se,endDTS:te}),H.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,ce,ae,Se,te),this.bufferFragmentData(re,H,F,k)}if(K!=null&&(w=K.samples)!==null&&w!==void 0&&w.length){var ue={frag:H,id:_,samples:K.samples};N.trigger(C.Events.FRAG_PARSING_METADATA,ue)}if(W){var Oe={frag:H,id:_,samples:W.samples};N.trigger(C.Events.FRAG_PARSING_USERDATA,Oe)}},A._bufferInitSegment=function(E,w,_,N){var j=this;if(this.state!==h.State.PARSING)return;this.audioOnly=!!w.audio&&!w.video,this.altAudio&&!this.audioOnly&&delete w.audio;var k=w.audio,z=w.video,H=w.audiovideo;if(k){var F=E.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(F&&(F.indexOf("mp4a.40.5")!==-1?F="mp4a.40.2":F="mp4a.40.5"),k.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(F="mp4a.40.5")),G.indexOf("android")!==-1&&k.container!=="audio/mpeg"&&(F="mp4a.40.2",this.log("Android: force audio codec to "+F)),E.audioCodec&&E.audioCodec!==F&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+F+'"'),k.levelCodec=F,k.id="main",this.log("Init audio buffer, container:"+k.container+", codecs[selected/level/parsed]=["+(F||"")+"/"+(E.audioCodec||"")+"/"+k.codec+"]")}z&&(z.levelCodec=E.videoCodec,z.id="main",this.log("Init video buffer, container:"+z.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+z.codec+"]")),H&&this.log("Init audiovideo buffer, container:"+H.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+H.codec+"]"),this.hls.trigger(C.Events.BUFFER_CODECS,w),Object.keys(w).forEach(function(B){var W=w[B],K=W.initSegment;K!=null&&K.byteLength&&j.hls.trigger(C.Events.BUFFER_APPENDING,{type:B,data:K,frag:_,part:null,chunkMeta:N,parent:_.type})}),this.tick()},A.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var w=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,w?this.resetFragmentLoading(E):this.state=h.State.BACKTRACKING},A.checkFragmentChanged=function(){var E=this.media,w=null;if(E&&E.readyState>1&&E.seeking===!1){var _=E.currentTime;if(c.BufferHelper.isBuffered(E,_)?w=this.getAppendedFrag(_):c.BufferHelper.isBuffered(E,_+.1)&&(w=this.getAppendedFrag(_+.1)),w){var N=this.fragPlaying,j=w.level;(!N||w.sn!==N.sn||N.level!==j||w.urlId!==N.urlId)&&(this.hls.trigger(C.Events.FRAG_CHANGED,{frag:w}),(!N||N.level!==j)&&this.hls.trigger(C.Events.LEVEL_SWITCHED,{level:j}),this.fragPlaying=w)}}},n(M,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var w=this.getAppendedFrag(E.currentTime);if(w)return w.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var w=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(w)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),M}(h.default)},"./src/controller/subtitle-stream-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"SubtitleStreamController",function(){return d});var R=S("./src/events.ts"),h=S("./src/utils/logger.ts"),o=S("./src/utils/buffer-helper.ts"),C=S("./src/controller/fragment-finders.ts"),c=S("./src/utils/discontinuities.ts"),a=S("./src/controller/level-helper.ts"),i=S("./src/controller/fragment-tracker.ts"),r=S("./src/controller/base-stream-controller.ts"),l=S("./src/types/loader.ts"),p=S("./src/types/level.ts");function f(g,T){for(var y=0;y<T.length;y++){var s=T[y];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(g,s.key,s)}}function b(g,T,y){return T&&f(g.prototype,T),y&&f(g,y),g}function v(g,T){g.prototype=Object.create(T.prototype),g.prototype.constructor=g,m(g,T)}function m(g,T){return m=Object.setPrototypeOf||function(s,M){return s.__proto__=M,s},m(g,T)}var n=500,d=function(g){v(T,g);function T(s,M){var A;return A=g.call(this,s,M,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var y=T.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var M=this.hls;M.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),M.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),M.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),M.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),M.on(R.Events.ERROR,this.onError,this),M.on(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),M.on(R.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),M.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),M.on(R.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),M.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y._unregisterListeners=function(){var M=this.hls;M.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),M.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),M.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),M.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),M.off(R.Events.ERROR,this.onError,this),M.off(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),M.off(R.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),M.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),M.off(R.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),M.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y.startLoad=function(){this.stopLoad(),this.state=r.State.IDLE,this.setInterval(n),this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},y.onLevelLoaded=function(M,A){this.mainDetails=A.details},y.onSubtitleFragProcessed=function(M,A){var x=A.frag,E=A.success;if(this.fragPrevious=x,this.state=r.State.IDLE,!E)return;var w=this.tracksBuffered[this.currentTrackId];if(!w)return;for(var _,N=x.start,j=0;j<w.length;j++)if(N>=w[j].start&&N<=w[j].end){_=w[j];break}var k=x.start+x.duration;_?_.end=k:(_={start:N,end:k},w.push(_)),this.fragmentTracker.fragBuffered(x)},y.onBufferFlushing=function(M,A){var x=A.startOffset,E=A.endOffset;if(x===0&&E!==Number.POSITIVE_INFINITY){var w=this.currentTrackId,_=this.levels;if(!_.length||!_[w]||!_[w].details)return;var N=_[w].details,j=N.targetduration,k=E-j;if(k<=0)return;A.endOffsetSubtitles=Math.max(0,k),this.tracksBuffered.forEach(function(z){for(var H=0;H<z.length;){if(z[H].end<=k){z.shift();continue}else if(z[H].start<k)z[H].start=k;else break;H++}}),this.fragmentTracker.removeFragmentsInRange(x,k,l.PlaylistLevelType.SUBTITLE)}},y.onError=function(M,A){var x,E=A.frag;if(!E||E.type!==l.PlaylistLevelType.SUBTITLE)return;(x=this.fragCurrent)!==null&&x!==void 0&&x.loader&&this.fragCurrent.loader.abort(),this.state=r.State.IDLE},y.onSubtitleTracksUpdated=function(M,A){var x=this,E=A.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(w){return new p.Level(w)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(w){x.tracksBuffered[w.id]=[]}),this.mediaBuffer=null},y.onSubtitleTrackSwitch=function(M,A){if(this.currentTrackId=A.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var x=this.levels[this.currentTrackId];x!=null&&x.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,x&&this.setInterval(n)},y.onSubtitleTrackLoaded=function(M,A){var x,E=A.details,w=A.id,_=this.currentTrackId,N=this.levels;if(!N.length)return;var j=N[_];if(w>=N.length||w!==_||!j)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(x=j.details)!==null&&x!==void 0&&x.live){var k=this.mainDetails;if(E.deltaUpdateFailed||!k)return;var z=k.fragments[0];if(!j.details)E.hasProgramDateTime&&k.hasProgramDateTime?Object(c.alignMediaPlaylistByPDT)(E,k):z&&Object(a.addSliding)(E,z.start);else{var H=this.alignPlaylists(E,j.details);H===0&&z&&Object(a.addSliding)(E,z.start)}}if(j.details=E,this.levelLastLoaded=w,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===r.State.IDLE){var F=Object(C.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);F||(this.warn("Subtitle playlist not aligned with playback"),j.details=void 0)}},y._handleFragmentLoadComplete=function(M){var A=M.frag,x=M.payload,E=A.decryptdata,w=this.hls;if(this.fragContextChanged(A))return;if(x&&x.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var _=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(x),E.key.buffer,E.iv.buffer).then(function(N){var j=performance.now();w.trigger(R.Events.FRAG_DECRYPTED,{frag:A,payload:N,stats:{tstart:_,tdecrypt:j}})})}},y.doTick=function(){if(!this.media){this.state=r.State.IDLE;return}if(this.state===r.State.IDLE){var M,A=this.currentTrackId,x=this.levels;if(!x.length||!x[A]||!x[A].details)return;var E=x[A].details,w=E.targetduration,_=this.config,N=this.media,j=o.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,N.currentTime-w,_.maxBufferHole),k=j.end,z=j.len,H=this.getMaxBufferLength()+w;if(z>H)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var F=E.fragments,G=F.length,B=E.edge,W,K=this.fragPrevious;if(k<B){var q=_.maxFragLookUpTolerance;K&&E.hasProgramDateTime&&(W=Object(C.findFragmentByPDT)(F,K.endProgramDateTime,q)),W||(W=Object(C.findFragmentByPTS)(K,F,k,q),!W&&K&&K.start<F[0].start&&(W=F[0]))}else W=F[G-1];(M=W)!==null&&M!==void 0&&M.encrypted?(h.logger.log("Loading key for "+W.sn),this.state=r.State.KEY_LOADING,this.hls.trigger(R.Events.KEY_LOADING,{frag:W})):W&&this.fragmentTracker.getState(W)===i.FragmentState.NOT_LOADED&&this.loadFragment(W,E,k)}},y.loadFragment=function(M,A,x){this.fragCurrent=M,g.prototype.loadFragment.call(this,M,A,x)},b(T,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),T}(r.default)},"./src/controller/subtitle-track-controller.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/events.ts"),h=S("./src/utils/texttrack-utils.ts"),o=S("./src/controller/base-playlist-controller.ts"),C=S("./src/types/loader.ts");function c(f,b){for(var v=0;v<b.length;v++){var m=b[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}function a(f,b,v){return b&&c(f.prototype,b),v&&c(f,v),f}function i(f,b){f.prototype=Object.create(b.prototype),f.prototype.constructor=f,r(f,b)}function r(f,b){return r=Object.setPrototypeOf||function(m,n){return m.__proto__=n,m},r(f,b)}var l=function(f){i(b,f);function b(m){var n;return n=f.call(this,m,"[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 v=b.prototype;return v.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,f.prototype.destroy.call(this)},v.registerListeners=function(){var n=this.hls;n.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(R.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){var n=this.hls;n.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(R.Events.ERROR,this.onError,this)},v.onMediaAttached=function(n,d){if(this.media=d.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)},v.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},v.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=p(this.media.textTracks);n.forEach(function(d){Object(h.clearCurrentCues)(d)}),this.subtitleTrack=-1,this.media=null},v.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},v.onManifestParsed=function(n,d){this.tracks=d.subtitleTracks},v.onSubtitleTrackLoaded=function(n,d){var g=d.id,T=d.details,y=this.trackId,s=this.tracksInGroup[y];if(!s){this.warn("Invalid subtitle track id "+g);return}var M=s.details;s.details=d.details,this.log("subtitle track "+g+" loaded ["+T.startSN+"-"+T.endSN+"]"),g===this.trackId&&(this.retryCount=0,this.playlistLoaded(g,d,M))},v.onLevelLoading=function(n,d){this.switchLevel(d.level)},v.onLevelSwitching=function(n,d){this.switchLevel(d.level)},v.switchLevel=function(n){var d=this.hls.levels[n];if(!(d!=null&&d.textGroupIds))return;var g=d.textGroupIds[d.urlId];if(this.groupId!==g){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,y=this.tracks.filter(function(A){return!g||A.groupId===g});this.tracksInGroup=y;var s=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=g;var M={subtitleTracks:y};this.log("Updating subtitle tracks, "+y.length+' track(s) found in "'+g+'" group-id'),this.hls.trigger(R.Events.SUBTITLE_TRACKS_UPDATED,M),s!==-1&&this.setSubtitleTrack(s,T)}},v.findTrackId=function(n){for(var d=this.tracksInGroup,g=0;g<d.length;g++){var T=d[g];if((!this.selectDefaultTrack||T.default)&&(!n||n===T.name))return T.id}return-1},v.onError=function(n,d){if(f.prototype.onError.call(this,n,d),d.fatal||!d.context)return;d.context.type===C.PlaylistContextType.SUBTITLE_TRACK&&d.context.id===this.trackId&&d.context.groupId===this.groupId&&this.retryLoadingOrFail(d)},v.loadPlaylist=function(n){var d=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(d)){var g=d.id,T=d.groupId,y=d.url;if(n)try{y=n.addDirectives(y)}catch(s){this.warn("Could not construct new URL with HLS Delivery Directives: "+s)}this.log("Loading subtitle playlist for id "+g),this.hls.trigger(R.Events.SUBTITLE_TRACK_LOADING,{url:y,id:g,groupId:T,deliveryDirectives:n||null})}},v.toggleTrackModes=function(n){var d=this,g=this.media,T=this.subtitleDisplay,y=this.trackId;if(!g)return;var s=p(g.textTracks),M=s.filter(function(E){return E.groupId===d.groupId});if(n===-1)[].slice.call(s).forEach(function(E){E.mode="disabled"});else{var A=M[y];A&&(A.mode="disabled")}var x=M[n];x&&(x.mode=T?"showing":"hidden")},v.setSubtitleTrack=function(n,d){var g,T=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(g=T[n])!==null&&g!==void 0&&g.details)||n<-1||n>=T.length)return;this.clearTimer();var y=T[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,y){var s=y.id,M=y.groupId,A=M===void 0?"":M,x=y.name,E=y.type,w=y.url;this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:s,groupId:A,name:x,type:E,url:w});var _=this.switchParams(y.url,d==null?void 0:d.details);this.loadPlaylist(_)}else this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:n})},v.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,d=p(this.media.textTracks),g=0;g<d.length;g++)if(d[g].mode==="hidden")n=g;else if(d[g].mode==="showing"){n=g;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},a(b,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var d=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,d)}}]),b}(o.default);function p(f){for(var b=[],v=0;v<f.length;v++){var m=f[v];m.kind==="subtitles"&&m.label&&b.push(f[v])}return b}u.default=l},"./src/controller/timeline-controller.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"TimelineController",function(){return p});var R=S("./src/polyfills/number.ts"),h=S("./src/events.ts"),o=S("./src/utils/cea-608-parser.ts"),C=S("./src/utils/output-filter.ts"),c=S("./src/utils/webvtt-parser.ts"),a=S("./src/utils/texttrack-utils.ts"),i=S("./src/utils/imsc1-ttml-parser.ts"),r=S("./src/types/loader.ts"),l=S("./src/utils/logger.ts"),p=function(){function m(d){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=v(),this.captionsProperties=void 0,this.hls=d,this.config=d.config,this.Cues=d.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 g=new C.default(this,"textTrack1"),T=new C.default(this,"textTrack2"),y=new C.default(this,"textTrack3"),s=new C.default(this,"textTrack4");this.cea608Parser1=new o.default(1,g,T),this.cea608Parser2=new o.default(3,y,s)}d.on(h.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(h.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(h.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(h.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.on(h.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.on(h.Events.FRAG_LOADING,this.onFragLoading,this),d.on(h.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(h.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.on(h.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.on(h.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.on(h.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.on(h.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=m.prototype;return n.destroy=function(){var g=this.hls;g.off(h.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(h.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(h.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(h.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.off(h.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),g.off(h.Events.FRAG_LOADING,this.onFragLoading,this),g.off(h.Events.FRAG_LOADED,this.onFragLoaded,this),g.off(h.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),g.off(h.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),g.off(h.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(h.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),g.off(h.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(g,T,y,s,M){for(var A=!1,x=M.length;x--;){var E=M[x],w=b(E[0],E[1],T,y);if(w>=0&&(E[0]=Math.min(E[0],T),E[1]=Math.max(E[1],y),A=!0,w/(y-T)>.5))return}if(A||M.push([T,y]),this.config.renderTextTracksNatively){var _=this.captionsTracks[g];this.Cues.newCue(_,T,y,s)}else{var N=this.Cues.newCue(null,T,y,s);this.hls.trigger(h.Events.CUES_PARSED,{type:"captions",cues:N,track:g})}},n.onInitPtsFound=function(g,T){var y=this,s=T.frag,M=T.id,A=T.initPTS,x=T.timescale,E=this.unparsedVttFrags;M==="main"&&(this.initPTS[s.cc]=A,this.timescale[s.cc]=x),E.length&&(this.unparsedVttFrags=[],E.forEach(function(w){y.onFragLoaded(h.Events.FRAG_LOADED,w)}))},n.getExistingTrack=function(g){var T=this.media;if(T)for(var y=0;y<T.textTracks.length;y++){var s=T.textTracks[y];if(s[g])return s}return null},n.createCaptionsTrack=function(g){this.config.renderTextTracksNatively?this.createNativeTrack(g):this.createNonNativeTrack(g)},n.createNativeTrack=function(g){if(this.captionsTracks[g])return;var T=this.captionsProperties,y=this.captionsTracks,s=this.media,M=T[g],A=M.label,x=M.languageCode,E=this.getExistingTrack(g);if(E)y[g]=E,Object(a.clearCurrentCues)(y[g]),Object(a.sendAddTrackEvent)(y[g],s);else{var w=this.createTextTrack("captions",A,x);w&&(w[g]=!0,y[g]=w)}},n.createNonNativeTrack=function(g){if(this.nonNativeCaptionsTracks[g])return;var T=this.captionsProperties[g];if(!T)return;var y=T.label,s={_id:g,label:y,kind:"captions",default:T.media?!!T.media.default:!1,closedCaptions:T.media};this.nonNativeCaptionsTracks[g]=s,this.hls.trigger(h.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[s]})},n.createTextTrack=function(g,T,y){var s=this.media;return s?s.addTextTrack(g,T,y):void 0},n.onMediaAttaching=function(g,T){this.media=T.media,this._cleanTracks()},n.onMediaDetaching=function(){var g=this.captionsTracks;Object.keys(g).forEach(function(T){Object(a.clearCurrentCues)(g[T]),delete g[T]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=v(),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 g=this.media;if(!g)return;var T=g.textTracks;if(T)for(var y=0;y<T.length;y++)Object(a.clearCurrentCues)(T[y])},n.onSubtitleTracksUpdated=function(g,T){var y=this;this.textTracks=[];var s=T.subtitleTracks||[],M=s.some(function(w){return w.textCodec===i.IMSC1_CODEC});if(this.config.enableWebVTT||M&&this.config.enableIMSC1){var A=this.tracks&&s&&this.tracks.length===s.length;if(this.tracks=s||[],this.config.renderTextTracksNatively){var x=this.media?this.media.textTracks:[];this.tracks.forEach(function(w,_){var N;if(_<x.length){for(var j=null,k=0;k<x.length;k++)if(f(x[k],w)){j=x[k];break}j&&(N=j)}N?Object(a.clearCurrentCues)(N):(N=y.createTextTrack("subtitles",w.name,w.lang),N&&(N.mode="disabled")),N&&(N.groupId=w.groupId,y.textTracks.push(N))})}else if(!A&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(w){return{label:w.name,kind:w.type.toLowerCase(),default:w.default,subtitleTrack:w}});this.hls.trigger(h.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},n.onManifestLoaded=function(g,T){var y=this;this.config.enableCEA708Captions&&T.captions&&T.captions.forEach(function(s){var M=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!M)return;var A="textTrack"+M[1],x=y.captionsProperties[A];if(!x)return;x.label=s.name,s.lang&&(x.languageCode=s.lang),x.media=s})},n.onFragLoading=function(g,T){var y=this.cea608Parser1,s=this.cea608Parser2,M=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(y&&s))return;if(T.frag.type===r.PlaylistLevelType.MAIN){var x,E,w=T.frag.sn,_=(x=T==null||((E=T.part)===null||E===void 0)?void 0:E.index)!=null?x:-1;w===M+1||w===M&&_===A+1||(y.reset(),s.reset()),this.lastSn=w,this.lastPartIndex=_}},n.onFragLoaded=function(g,T){var y=T.frag,s=T.payload,M=this.initPTS,A=this.unparsedVttFrags;if(y.type===r.PlaylistLevelType.SUBTITLE)if(s.byteLength){if(!Object(R.isFiniteNumber)(M[y.cc])){A.push(T),M.length&&this.hls.trigger(h.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y,error:new Error("Missing initial subtitle PTS")});return}var x=y.decryptdata;if(x==null||x.key==null||x.method!=="AES-128"){var E=this.tracks[y.level],w=this.vttCCs;w[y.cc]||(w[y.cc]={start:y.start,prevCC:this.prevCC,new:!0},this.prevCC=y.cc),E&&E.textCodec===i.IMSC1_CODEC?this._parseIMSC1(y,s):this._parseVTTs(y,s,w)}}else this.hls.trigger(h.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(g,T){var y=this,s=this.hls;Object(i.parseIMSC1)(T,this.initPTS[g.cc],this.timescale[g.cc],function(M){y._appendCues(M,g.level),s.trigger(h.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:g})},function(M){l.logger.log("Failed to parse IMSC1: "+M),s.trigger(h.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:M})})},n._parseVTTs=function(g,T,y){var s=this,M=this.hls;Object(c.parseWebVTT)(T,this.initPTS[g.cc],this.timescale[g.cc],y,g.cc,g.start,function(A){s._appendCues(A,g.level),M.trigger(h.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:g})},function(A){s._fallbackToIMSC1(g,T),l.logger.log("Failed to parse VTT cue: "+A),M.trigger(h.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:A})})},n._fallbackToIMSC1=function(g,T){var y=this,s=this.tracks[g.level];s.textCodec||Object(i.parseIMSC1)(T,this.initPTS[g.cc],this.timescale[g.cc],function(){s.textCodec=i.IMSC1_CODEC,y._parseIMSC1(g,T)},function(){s.textCodec="wvtt"})},n._appendCues=function(g,T){var y=this.hls;if(this.config.renderTextTracksNatively){var s=this.textTracks[T];if(s.mode==="disabled")return;g.forEach(function(x){return Object(a.addCueToTrack)(s,x)})}else{var M=this.tracks[T],A=M.default?"default":"subtitles"+T;y.trigger(h.Events.CUES_PARSED,{type:"subtitles",cues:g,track:A})}},n.onFragDecrypted=function(g,T){var y=T.frag;if(y.type===r.PlaylistLevelType.SUBTITLE){if(!Object(R.isFiniteNumber)(this.initPTS[y.cc])){this.unparsedVttFrags.push(T);return}this.onFragLoaded(h.Events.FRAG_LOADED,T)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(g,T){var y=this.cea608Parser1,s=this.cea608Parser2;if(!this.enabled||!(y&&s))return;for(var M=0;M<T.samples.length;M++){var A=T.samples[M].bytes;if(A){var x=this.extractCea608Data(A);y.addData(T.samples[M].pts,x[0]),s.addData(T.samples[M].pts,x[1])}}},n.onBufferFlushing=function(g,T){var y=T.startOffset,s=T.endOffset,M=T.endOffsetSubtitles,A=T.type,x=this.media;if(!x||x.currentTime<s)return;if(!A||A==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(_){return Object(a.removeCuesInRange)(E[_],y,s)})}if(this.config.renderTextTracksNatively&&(y===0&&M!==void 0)){var w=this.textTracks;Object.keys(w).forEach(function(_){return Object(a.removeCuesInRange)(w[_],y,M)})}},n.extractCea608Data=function(g){for(var T=g[0]&31,y=2,s=[[],[]],M=0;M<T;M++){var A=g[y++],x=127&g[y++],E=127&g[y++],w=(4&A)!==0,_=3&A;if(x===0&&E===0)continue;w&&((_===0||_===1)&&(s[_].push(x),s[_].push(E)))}return s},m}();function f(m,n){return m&&m.label===n.name&&!(m.textTrack1||m.textTrack2)}function b(m,n,d,g){return Math.min(n,g)-Math.max(m,d)}function v(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return R});var R=function(){function h(C,c){this.subtle=void 0,this.aesIV=void 0,this.subtle=C,this.aesIV=c}var o=h.prototype;return o.decrypt=function(c,a){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},a,c)},h}()},"./src/crypt/aes-decryptor.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"removePadding",function(){return h}),S.d(u,"default",function(){return o});var R=S("./src/utils/typed-array.ts");function h(C){var c=C.byteLength,a=c&&new DataView(C.buffer).getUint8(c-1);return a?Object(R.sliceUint8)(C,0,c-a):C}var o=function(){function C(){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=C.prototype;return c.uint8ArrayToUint32Array_=function(i){for(var r=new DataView(i),l=new Uint32Array(4),p=0;p<4;p++)l[p]=r.getUint32(p*4);return l},c.initTable=function(){var i=this.sBox,r=this.invSBox,l=this.subMix,p=l[0],f=l[1],b=l[2],v=l[3],m=this.invSubMix,n=m[0],d=m[1],g=m[2],T=m[3],y=new Uint32Array(256),s=0,M=0,A=0;for(A=0;A<256;A++)A<128?y[A]=A<<1:y[A]=A<<1^283;for(A=0;A<256;A++){var x=M^M<<1^M<<2^M<<3^M<<4;x=x>>>8^x&255^99,i[s]=x,r[x]=s;var E=y[s],w=y[E],_=y[w],N=y[x]*257^x*16843008;p[s]=N<<24|N>>>8,f[s]=N<<16|N>>>16,b[s]=N<<8|N>>>24,v[s]=N,N=_*16843009^w*65537^E*257^s*16843008,n[x]=N<<24|N>>>8,d[x]=N<<16|N>>>16,g[x]=N<<8|N>>>24,T[x]=N,s?(s=E^y[y[y[_^E]]],M^=y[y[M]]):s=M=1}},c.expandKey=function(i){for(var r=this.uint8ArrayToUint32Array_(i),l=!0,p=0;p<r.length&&l;)l=r[p]===this.key[p],p++;if(l)return;this.key=r;var f=this.keySize=r.length;if(f!==4&&f!==6&&f!==8)throw new Error("Invalid aes key size="+f);var b=this.ksRows=(f+6+1)*4,v,m,n=this.keySchedule=new Uint32Array(b),d=this.invKeySchedule=new Uint32Array(b),g=this.sBox,T=this.rcon,y=this.invSubMix,s=y[0],M=y[1],A=y[2],x=y[3],E,w;for(v=0;v<b;v++){if(v<f){E=n[v]=r[v];continue}w=E,v%f===0?(w=w<<8|w>>>24,w=g[w>>>24]<<24|g[w>>>16&255]<<16|g[w>>>8&255]<<8|g[w&255],w^=T[v/f|0]<<24):f>6&&v%f===4&&(w=g[w>>>24]<<24|g[w>>>16&255]<<16|g[w>>>8&255]<<8|g[w&255]),n[v]=E=(n[v-f]^w)>>>0}for(m=0;m<b;m++)v=b-m,m&3?w=n[v]:w=n[v-4],m<4||v<=4?d[m]=w:d[m]=s[g[w>>>24]]^M[g[w>>>16&255]]^A[g[w>>>8&255]]^x[g[w&255]],d[m]=d[m]>>>0},c.networkToHostOrderSwap=function(i){return i<<24|(i&65280)<<8|(i&16711680)>>8|i>>>24},c.decrypt=function(i,r,l){for(var p=this.keySize+6,f=this.invKeySchedule,b=this.invSBox,v=this.invSubMix,m=v[0],n=v[1],d=v[2],g=v[3],T=this.uint8ArrayToUint32Array_(l),y=T[0],s=T[1],M=T[2],A=T[3],x=new Int32Array(i),E=new Int32Array(x.length),w,_,N,j,k,z,H,F,G,B,W,K,q,re,ee=this.networkToHostOrderSwap;r<x.length;){for(G=ee(x[r]),B=ee(x[r+1]),W=ee(x[r+2]),K=ee(x[r+3]),k=G^f[0],z=K^f[1],H=W^f[2],F=B^f[3],q=4,re=1;re<p;re++)w=m[k>>>24]^n[z>>16&255]^d[H>>8&255]^g[F&255]^f[q],_=m[z>>>24]^n[H>>16&255]^d[F>>8&255]^g[k&255]^f[q+1],N=m[H>>>24]^n[F>>16&255]^d[k>>8&255]^g[z&255]^f[q+2],j=m[F>>>24]^n[k>>16&255]^d[z>>8&255]^g[H&255]^f[q+3],k=w,z=_,H=N,F=j,q=q+4;w=b[k>>>24]<<24^b[z>>16&255]<<16^b[H>>8&255]<<8^b[F&255]^f[q],_=b[z>>>24]<<24^b[H>>16&255]<<16^b[F>>8&255]<<8^b[k&255]^f[q+1],N=b[H>>>24]<<24^b[F>>16&255]<<16^b[k>>8&255]<<8^b[z&255]^f[q+2],j=b[F>>>24]<<24^b[k>>16&255]<<16^b[z>>8&255]<<8^b[H&255]^f[q+3],E[r]=ee(w^y),E[r+1]=ee(j^s),E[r+2]=ee(N^M),E[r+3]=ee(_^A),y=G,s=B,M=W,A=K,r=r+4}return E.buffer},C}()},"./src/crypt/decrypter.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return r});var R=S("./src/crypt/aes-crypto.ts"),h=S("./src/crypt/fast-aes-key.ts"),o=S("./src/crypt/aes-decryptor.ts"),C=S("./src/utils/logger.ts"),c=S("./src/utils/mp4-tools.ts"),a=S("./src/utils/typed-array.ts"),i=16,r=function(){function l(f,b,v){var m=v===void 0?{}:v,n=m.removePKCS7Padding,d=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=f,this.config=b,this.removePKCS7Padding=d,d)try{var g=self.crypto;g&&(this.subtle=g.subtle||g.webkitSubtle)}catch(T){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=l.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var b=this.currentResult;if(!b){this.reset();return}var v=new Uint8Array(b);return this.reset(),this.removePKCS7Padding?Object(o.removePadding)(v):v},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(b,v,m,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(b),v,m);var d=this.flush();d&&n(d.buffer)}else this.webCryptoDecrypt(new Uint8Array(b),v,m).then(n)},p.softwareDecrypt=function(b,v,m){var n=this.currentIV,d=this.currentResult,g=this.remainderData;this.logOnce("JS AES decrypt"),g&&(b=Object(c.appendUint8Array)(g,b),this.remainderData=null);var T=this.getValidChunk(b);if(!T.length)return null;n&&(m=n);var y=this.softwareDecrypter;y||(y=this.softwareDecrypter=new o.default),y.expandKey(v);var s=d;return this.currentResult=y.decrypt(T.buffer,0,m),this.currentIV=Object(a.sliceUint8)(T,-16).buffer,s||null},p.webCryptoDecrypt=function(b,v,m){var n=this,d=this.subtle;return(this.key!==v||!this.fastAesKey)&&(this.key=v,this.fastAesKey=new h.default(d,v)),this.fastAesKey.expandKey().then(function(g){if(!d)return Promise.reject(new Error("web crypto not initialized"));var T=new R.default(d,m);return T.decrypt(b.buffer,g)}).catch(function(g){return n.onWebCryptoError(g,b,v,m)})},p.onWebCryptoError=function(b,v,m,n){return C.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",b),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(v,m,n)},p.getValidChunk=function(b){var v=b,m=b.length-b.length%i;return m!==b.length&&(v=Object(a.sliceUint8)(b,0,m),this.remainderData=Object(a.sliceUint8)(b,m)),v},p.logOnce=function(b){if(!this.logEnabled)return;C.logger.log("[decrypter.ts]: "+b),this.logEnabled=!1},l}()},"./src/crypt/fast-aes-key.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return R});var R=function(){function h(C,c){this.subtle=void 0,this.key=void 0,this.subtle=C,this.key=c}var o=h.prototype;return o.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},h}()},"./src/demux/aacdemuxer.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/demux/base-audio-demuxer.ts"),h=S("./src/demux/adts.ts"),o=S("./src/utils/logger.ts"),C=S("./src/demux/id3.ts");function c(r,l){r.prototype=Object.create(l.prototype),r.prototype.constructor=r,a(r,l)}function a(r,l){return a=Object.setPrototypeOf||function(f,b){return f.__proto__=b,f},a(r,l)}var i=function(r){c(l,r);function l(f,b){var v;return v=r.call(this)||this,v.observer=void 0,v.config=void 0,v.observer=f,v.config=b,v}var p=l.prototype;return p.resetInitSegment=function(b,v,m){r.prototype.resetInitSegment.call(this,b,v,m),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:b,duration:m,inputTimeScale:9e4,dropped:0}},l.probe=function(b){if(!b)return!1;for(var v=C.getID3Data(b,0)||[],m=v.length,n=b.length;m<n;m++)if(h.probe(b,m))return o.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(b,v){return h.canParse(b,v)},p.appendFrame=function(b,v,m){h.initTrackConfig(b,this.observer,v,m,b.manifestCodec);var n=h.appendFrame(b,v,m,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},l}(R.default);i.minProbeByteLength=9,u.default=i},"./src/demux/adts.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"getAudioConfig",function(){return C}),S.d(u,"isHeaderPattern",function(){return c}),S.d(u,"getHeaderLength",function(){return a}),S.d(u,"getFullFrameLength",function(){return i}),S.d(u,"canGetFrameLength",function(){return r}),S.d(u,"isHeader",function(){return l}),S.d(u,"canParse",function(){return p}),S.d(u,"probe",function(){return f}),S.d(u,"initTrackConfig",function(){return b}),S.d(u,"getFrameDuration",function(){return v}),S.d(u,"parseFrameHeader",function(){return m}),S.d(u,"appendFrame",function(){return n});var R=S("./src/utils/logger.ts"),h=S("./src/errors.ts"),o=S("./src/events.ts");function C(d,g,T,y){var s,M,A,x,E=navigator.userAgent.toLowerCase(),w=y,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=((g[T+2]&192)>>>6)+1;var N=(g[T+2]&60)>>>2;if(N>_.length-1){d.trigger(o.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+N});return}return A=(g[T+2]&1)<<2,A|=(g[T+3]&192)>>>6,R.logger.log("manifest codec:"+y+", ADTS type:"+s+", samplingIndex:"+N),/firefox/i.test(E)?N>=6?(s=5,x=new Array(4),M=N-3):(s=2,x=new Array(2),M=N):E.indexOf("android")!==-1?(s=2,x=new Array(2),M=N):(s=5,x=new Array(4),y&&(y.indexOf("mp4a.40.29")!==-1||y.indexOf("mp4a.40.5")!==-1)||!y&&N>=6?M=N-3:((y&&y.indexOf("mp4a.40.2")!==-1&&(N>=6&&A===1||/vivaldi/i.test(E))||!y&&A===1)&&(s=2,x=new Array(2)),M=N)),x[0]=s<<3,x[0]|=(N&14)>>1,x[1]|=(N&1)<<7,x[1]|=A<<3,s===5&&(x[1]|=(M&14)>>1,x[2]=(M&1)<<7,x[2]|=2<<2,x[3]=0),{config:x,samplerate:_[N],channelCount:A,codec:"mp4a.40."+s,manifestCodec:w}}function c(d,g){return d[g]===255&&(d[g+1]&246)===240}function a(d,g){return d[g+1]&1?7:9}function i(d,g){return(d[g+3]&3)<<11|d[g+4]<<3|(d[g+5]&224)>>>5}function r(d,g){return g+5<d.length}function l(d,g){return g+1<d.length&&c(d,g)}function p(d,g){return r(d,g)&&c(d,g)&&i(d,g)<=d.length-g}function f(d,g){if(l(d,g)){var T=a(d,g);if(g+T>=d.length)return!1;var y=i(d,g);if(y<=T)return!1;var s=g+y;return s===d.length||l(d,s)}return!1}function b(d,g,T,y,s){if(!d.samplerate){var M=C(g,T,y,s);if(!M)return;d.config=M.config,d.samplerate=M.samplerate,d.channelCount=M.channelCount,d.codec=M.codec,d.manifestCodec=M.manifestCodec,R.logger.log("parsed codec:"+d.codec+", rate:"+M.samplerate+", channels:"+M.channelCount)}}function v(d){return 1024*9e4/d}function m(d,g,T,y,s){var M=a(d,g),A=i(d,g);if(A-=M,A>0){var x=T+y*s;return{headerLength:M,frameLength:A,stamp:x}}}function n(d,g,T,y,s){var M=v(d.samplerate),A=m(g,T,y,s,M);if(A){var x=A.frameLength,E=A.headerLength,w=A.stamp,_=E+x,N=Math.max(0,T+_-g.length),j;N?(j=new Uint8Array(_-E),j.set(g.subarray(T+E,g.length),0)):j=g.subarray(T+E,T+_);var k={unit:j,pts:w};return N||d.samples.push(k),{sample:k,length:_,missing:N}}}},"./src/demux/base-audio-demuxer.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"initPTSFn",function(){return i});var R=S("./src/polyfills/number.ts"),h=S("./src/demux/id3.ts"),o=S("./src/demux/dummy-demuxed-track.ts"),C=S("./src/utils/mp4-tools.ts"),c=S("./src/utils/typed-array.ts"),a=function(){function r(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var l=r.prototype;return l.resetInitSegment=function(f,b,v){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},l.resetTimeStamp=function(){},l.resetContiguity=function(){},l.canParse=function(f,b){return!1},l.appendFrame=function(f,b,v){},l.demux=function(f,b){this.cachedData&&(f=Object(C.appendUint8Array)(this.cachedData,f),this.cachedData=null);var v=h.getID3Data(f,0),m=v?v.length:0,n,d,g=this._audioTrack,T=this._id3Track,y=v?h.getTimeStamp(v):void 0,s=f.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=i(y,b)),v&&v.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:v}),d=this.initPTS;m<s;){if(this.canParse(f,m)){var M=this.appendFrame(g,f,m);M?(this.frameIndex++,d=M.sample.pts,m+=M.length,n=m):m=s}else h.canParse(f,m)?(v=h.getID3Data(f,m),T.samples.push({pts:d,dts:d,data:v}),m+=v.length,n=m):m++;if(m===s&&n!==s){var A=Object(c.sliceUint8)(f,n);this.cachedData?this.cachedData=Object(C.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:g,avcTrack:Object(o.dummyTrack)(),id3Track:T,textTrack:Object(o.dummyTrack)()}},l.demuxSampleAes=function(f,b,v){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},l.flush=function(f){var b=this.cachedData;return b&&(this.cachedData=null,this.demux(b,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(o.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(o.dummyTrack)()}},l.destroy=function(){},r}(),i=function(l,p){return Object(R.isFiniteNumber)(l)?l*90:p*9e4};u.default=a},"./src/demux/chunk-cache.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return R});var R=function(){function o(){this.chunks=[],this.dataLength=0}var C=o.prototype;return C.push=function(a){this.chunks.push(a),this.dataLength+=a.length},C.flush=function(){var a=this.chunks,i=this.dataLength,r;if(a.length)a.length===1?r=a[0]:r=h(a,i);else return new Uint8Array(0);return this.reset(),r},C.reset=function(){this.chunks.length=0,this.dataLength=0},o}();function h(o,C){for(var c=new Uint8Array(C),a=0,i=0;i<o.length;i++){var r=o[i];c.set(r,a),a+=r.length}return c}},"./src/demux/dummy-demuxed-track.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"dummyTrack",function(){return R});function R(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/utils/logger.ts"),h=function(){function o(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 C=o.prototype;return C.loadWord=function(){var a=this.data,i=this.bytesAvailable,r=a.byteLength-i,l=new Uint8Array(4),p=Math.min(4,i);if(p===0)throw new Error("no bytes available");l.set(a.subarray(r,r+p)),this.word=new DataView(l.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},C.skipBits=function(a){var i;this.bitsAvailable>a?(this.word<<=a,this.bitsAvailable-=a):(a-=this.bitsAvailable,i=a>>3,a-=i>>3,this.bytesAvailable-=i,this.loadWord(),this.word<<=a,this.bitsAvailable-=a)},C.readBits=function(a){var i=Math.min(this.bitsAvailable,a),r=this.word>>>32-i;return a>32&&R.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=i,this.bitsAvailable>0?this.word<<=i:this.bytesAvailable>0&&this.loadWord(),i=a-i,i>0&&this.bitsAvailable?r<<i|this.readBits(i):r},C.skipLZ=function(){var a;for(a=0;a<this.bitsAvailable;++a)if((this.word&2147483648>>>a)!==0)return this.word<<=a,this.bitsAvailable-=a,a;return this.loadWord(),a+this.skipLZ()},C.skipUEG=function(){this.skipBits(1+this.skipLZ())},C.skipEG=function(){this.skipBits(1+this.skipLZ())},C.readUEG=function(){var a=this.skipLZ();return this.readBits(a+1)-1},C.readEG=function(){var a=this.readUEG();return 1&a?1+a>>>1:-1*(a>>>1)},C.readBoolean=function(){return this.readBits(1)===1},C.readUByte=function(){return this.readBits(8)},C.readUShort=function(){return this.readBits(16)},C.readUInt=function(){return this.readBits(32)},C.skipScalingList=function(a){for(var i=8,r=8,l,p=0;p<a;p++)r!==0&&(l=this.readEG(),r=(i+l+256)%256),i=r===0?i:r},C.readSPS=function(){var a=0,i=0,r=0,l=0,p,f,b,v=this.readUByte.bind(this),m=this.readBits.bind(this),n=this.readUEG.bind(this),d=this.readBoolean.bind(this),g=this.skipBits.bind(this),T=this.skipEG.bind(this),y=this.skipUEG.bind(this),s=this.skipScalingList.bind(this);v();var M=v();if(m(5),g(3),v(),y(),M===100||M===110||M===122||M===244||M===44||M===83||M===86||M===118||M===128){var A=n();if(A===3&&g(1),y(),y(),g(1),d())for(f=A!==3?8:12,b=0;b<f;b++)d()&&(b<6?s(16):s(64))}y();var x=n();if(x===0)n();else if(x===1)for(g(1),T(),T(),p=n(),b=0;b<p;b++)T();y(),g(1);var E=n(),w=n(),_=m(1);_===0&&g(1),g(1),d()&&(a=n(),i=n(),r=n(),l=n());var N=[1,1];if(d()&&d()){var j=v();switch(j){case 1:N=[1,1];break;case 2:N=[12,11];break;case 3:N=[10,11];break;case 4:N=[16,11];break;case 5:N=[40,33];break;case 6:N=[24,11];break;case 7:N=[20,11];break;case 8:N=[32,11];break;case 9:N=[80,33];break;case 10:N=[18,11];break;case 11:N=[15,11];break;case 12:N=[64,33];break;case 13:N=[160,99];break;case 14:N=[4,3];break;case 15:N=[3,2];break;case 16:N=[2,1];break;case 255:{N=[v()<<8|v(),v()<<8|v()];break}}}return{width:Math.ceil((E+1)*16-a*2-i*2),height:(2-_)*(w+1)*16-(_?2:4)*(r+l),pixelRatio:N}},C.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},o}();u.default=h},"./src/demux/id3.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"isHeader",function(){return R}),S.d(u,"isFooter",function(){return h}),S.d(u,"getID3Data",function(){return o}),S.d(u,"canParse",function(){return c}),S.d(u,"getTimeStamp",function(){return a}),S.d(u,"isTimeStampFrame",function(){return i}),S.d(u,"getID3Frames",function(){return l}),S.d(u,"decodeFrame",function(){return p}),S.d(u,"utf8ArrayToStr",function(){return n}),S.d(u,"testables",function(){return d});var R=function(s,M){return M+10<=s.length&&(s[M]===73&&s[M+1]===68&&s[M+2]===51&&(s[M+3]<255&&s[M+4]<255&&(s[M+6]<128&&s[M+7]<128&&s[M+8]<128&&s[M+9]<128)))},h=function(s,M){return M+10<=s.length&&(s[M]===51&&s[M+1]===68&&s[M+2]===73&&(s[M+3]<255&&s[M+4]<255&&(s[M+6]<128&&s[M+7]<128&&s[M+8]<128&&s[M+9]<128)))},o=function(s,M){for(var A=M,x=0;R(s,M);){x+=10;var E=C(s,M+6);x+=E,h(s,M+10)&&(x+=10),M+=x}return x>0?s.subarray(A,A+x):void 0},C=function(s,M){var A=0;return A=(s[M]&127)<<21,A|=(s[M+1]&127)<<14,A|=(s[M+2]&127)<<7,A|=s[M+3]&127,A},c=function(s,M){return R(s,M)&&C(s,M+6)+10<=s.length-M},a=function(s){for(var M=l(s),A=0;A<M.length;A++){var x=M[A];if(i(x))return m(x)}return},i=function(s){return s&&s.key==="PRIV"&&s.info==="com.apple.streaming.transportStreamTimestamp"},r=function(s){var M=String.fromCharCode(s[0],s[1],s[2],s[3]),A=C(s,4),x=10;return{type:M,size:A,data:s.subarray(x,x+A)}},l=function(s){for(var M=0,A=[];R(s,M);){var x=C(s,M+6);M+=10;for(var E=M+x;M+8<E;){var w=r(s.subarray(M)),_=p(w);_&&A.push(_),M+=w.size+10}h(s,M)&&(M+=10)}return A},p=function(s){return s.type==="PRIV"?f(s):s.type[0]==="W"?v(s):b(s)},f=function(s){if(s.size<2)return;var M=n(s.data,!0),A=new Uint8Array(s.data.subarray(M.length+1));return{key:s.type,info:M,data:A.buffer}},b=function(s){if(s.size<2)return;if(s.type==="TXXX"){var M=1,A=n(s.data.subarray(M),!0);M+=A.length+1;var x=n(s.data.subarray(M));return{key:s.type,info:A,data:x}}var E=n(s.data.subarray(1));return{key:s.type,data:E}},v=function(s){if(s.type==="WXXX"){if(s.size<2)return;var M=1,A=n(s.data.subarray(M),!0);M+=A.length+1;var x=n(s.data.subarray(M));return{key:s.type,info:A,data:x}}var E=n(s.data);return{key:s.type,data:E}},m=function(s){if(s.data.byteLength===8){var M=new Uint8Array(s.data),A=M[3]&1,x=(M[4]<<23)+(M[5]<<15)+(M[6]<<7)+M[7];return x/=45,A&&(x+=4772185884e-2),Math.round(x)}return},n=function(s,M){M===void 0&&(M=!1);var A=T();if(A){var x=A.decode(s);if(M){var E=x.indexOf("\0");return E!==-1?x.substring(0,E):x}return x.replace(/\0/g,"")}for(var w=s.length,_,N,j,k="",z=0;z<w;){if(_=s[z++],_===0&&M)return k;if(_===0||_===3)continue;switch(_>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:k+=String.fromCharCode(_);break;case 12:case 13:N=s[z++],k+=String.fromCharCode((_&31)<<6|N&63);break;case 14:N=s[z++],j=s[z++],k+=String.fromCharCode((_&15)<<12|(N&63)<<6|(j&63)<<0);break;default:}}return k},d={decodeTextFrame:b},g;function T(){return!g&&typeof self.TextDecoder!="undefined"&&(g=new self.TextDecoder("utf-8")),g}},"./src/demux/mp3demuxer.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/demux/base-audio-demuxer.ts"),h=S("./src/demux/id3.ts"),o=S("./src/utils/logger.ts"),C=S("./src/demux/mpegaudio.ts");function c(r,l){r.prototype=Object.create(l.prototype),r.prototype.constructor=r,a(r,l)}function a(r,l){return a=Object.setPrototypeOf||function(f,b){return f.__proto__=b,f},a(r,l)}var i=function(r){c(l,r);function l(){return r.apply(this,arguments)||this}var p=l.prototype;return p.resetInitSegment=function(b,v,m){r.prototype.resetInitSegment.call(this,b,v,m),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:b,duration:m,inputTimeScale:9e4,dropped:0}},l.probe=function(b){if(!b)return!1;for(var v=h.getID3Data(b,0)||[],m=v.length,n=b.length;m<n;m++)if(C.probe(b,m))return o.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(b,v){return C.canParse(b,v)},p.appendFrame=function(b,v,m){return this.initPTS===null?void 0:C.appendFrame(b,v,m,this.initPTS,this.frameIndex)},l}(R.default);i.minProbeByteLength=4,u.default=i},"./src/demux/mp4demuxer.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/utils/mp4-tools.ts"),h=S("./src/demux/dummy-demuxed-track.ts"),o=function(){function C(a,i){this.remainderData=null,this.config=void 0,this.config=i}var c=C.prototype;return c.resetTimeStamp=function(){},c.resetInitSegment=function(){},c.resetContiguity=function(){},C.probe=function(i){return Object(R.findBox)({data:i,start:0,end:Math.min(i.length,16384)},["moof"]).length>0},c.demux=function(i){var r=i,l=Object(h.dummyTrack)();if(this.config.progressive){this.remainderData&&(r=Object(R.appendUint8Array)(this.remainderData,i));var p=Object(R.segmentValidRange)(r);this.remainderData=p.remainder,l.samples=p.valid||new Uint8Array}else l.samples=r;return{audioTrack:Object(h.dummyTrack)(),avcTrack:l,id3Track:Object(h.dummyTrack)(),textTrack:Object(h.dummyTrack)()}},c.flush=function(){var i=Object(h.dummyTrack)();return i.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(h.dummyTrack)(),avcTrack:i,id3Track:Object(h.dummyTrack)(),textTrack:Object(h.dummyTrack)()}},c.demuxSampleAes=function(i,r,l){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},c.destroy=function(){},C}();o.minProbeByteLength=1024,u.default=o},"./src/demux/mpegaudio.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"appendFrame",function(){return a}),S.d(u,"parseHeader",function(){return i}),S.d(u,"isHeaderPattern",function(){return r}),S.d(u,"isHeader",function(){return l}),S.d(u,"canParse",function(){return p}),S.d(u,"probe",function(){return f});var R=null,h=[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],o=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],c=[0,1,1,4];function a(b,v,m,n,d){if(m+24>v.length)return;var g=i(v,m);if(g&&m+g.frameLength<=v.length){var T=g.samplesPerFrame*9e4/g.sampleRate,y=n+d*T,s={unit:v.subarray(m,m+g.frameLength),pts:y,dts:y};return b.config=[],b.channelCount=g.channelCount,b.samplerate=g.sampleRate,b.samples.push(s),{sample:s,length:g.frameLength,missing:0}}}function i(b,v){var m=b[v+1]>>3&3,n=b[v+1]>>1&3,d=b[v+2]>>4&15,g=b[v+2]>>2&3;if(m!==1&&d!==0&&d!==15&&g!==3){var T=b[v+2]>>1&1,y=b[v+3]>>6,s=m===3?3-n:n===3?3:4,M=h[s*14+d-1]*1e3,A=m===3?0:m===2?1:2,x=o[A*3+g],E=y===3?1:2,w=C[m][n],_=c[n],N=w*8*_,j=Math.floor(w*M/x+T)*_;if(R===null){var k=navigator.userAgent||"",z=k.match(/Chrome\/(\d+)/i);R=z?parseInt(z[1]):0}var H=!!R&&R<=87;return H&&n===2&&M>=224e3&&y===0&&(b[v+3]=b[v+3]|128),{sampleRate:x,channelCount:E,frameLength:j,samplesPerFrame:N}}}function r(b,v){return b[v]===255&&(b[v+1]&224)===224&&(b[v+1]&6)!==0}function l(b,v){return v+1<b.length&&r(b,v)}function p(b,v){var m=4;return r(b,v)&&m<=b.length-v}function f(b,v){if(v+1<b.length&&r(b,v)){var m=4,n=i(b,v),d=m;n!=null&&n.frameLength&&(d=n.frameLength);var g=v+d;return g===b.length||l(b,g)}return!1}},"./src/demux/sample-aes.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/crypt/decrypter.ts"),h=S("./src/demux/tsdemuxer.ts"),o=function(){function C(a,i,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new R.default(a,i,{removePKCS7Padding:!1})}var c=C.prototype;return c.decryptBuffer=function(i,r){this.decrypter.decrypt(i,this.keyData.key.buffer,this.keyData.iv.buffer,r)},c.decryptAacSample=function(i,r,l,p){var f=i[r].unit,b=f.subarray(16,f.length-f.length%16),v=b.buffer.slice(b.byteOffset,b.byteOffset+b.length),m=this;this.decryptBuffer(v,function(n){var d=new Uint8Array(n);f.set(d,16),p||m.decryptAacSamples(i,r+1,l)})},c.decryptAacSamples=function(i,r,l){for(;;r++){if(r>=i.length){l();return}if(i[r].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(i,r,l,p),!p)return}},c.getAvcEncryptedData=function(i){for(var r=Math.floor((i.length-48)/160)*16+16,l=new Int8Array(r),p=0,f=32;f<=i.length-16;f+=160,p+=16)l.set(i.subarray(f,f+16),p);return l},c.getAvcDecryptedUnit=function(i,r){for(var l=new Uint8Array(r),p=0,f=32;f<=i.length-16;f+=160,p+=16)i.set(l.subarray(p,p+16),f);return i},c.decryptAvcSample=function(i,r,l,p,f,b){var v=Object(h.discardEPB)(f.data),m=this.getAvcEncryptedData(v),n=this;this.decryptBuffer(m.buffer,function(d){f.data=n.getAvcDecryptedUnit(v,d),b||n.decryptAvcSamples(i,r,l+1,p)})},c.decryptAvcSamples=function(i,r,l,p){if(i instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;r++,l=0){if(r>=i.length){p();return}for(var f=i[r].units;!(l>=f.length);l++){var b=f[l];if(b.data.length<=48||b.type!==1&&b.type!==5)continue;var v=this.decrypter.isSync();if(this.decryptAvcSample(i,r,l,p,b,v),!v)return}}},C}();u.default=o},"./src/demux/transmuxer-interface.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return f});var R=S("./node_modules/webworkify-webpack/index.js"),h=S.n(R),o=S("./src/events.ts"),C=S("./src/demux/transmuxer.ts"),c=S("./src/utils/logger.ts"),a=S("./src/errors.ts"),i=S("./src/utils/mediasource-helper.ts"),r=S("./node_modules/eventemitter3/index.js"),l=S.n(r),p=Object(i.getMediaSource)()||{isTypeSupported:function(){return!1}},f=function(){function b(m,n,d,g){var T=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=m,this.id=n,this.onTransmuxComplete=d,this.onFlush=g;var y=m.config,s=function(w,_){_=_||{},_.frag=T.frag,_.id=T.id,m.trigger(w,_)};this.observer=new r.EventEmitter,this.observer.on(o.Events.FRAG_DECRYPTED,s),this.observer.on(o.Events.ERROR,s);var M={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(y.enableWorker&&typeof Worker!="undefined"){c.logger.log("demuxing in webworker");var x;try{x=this.worker=R("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),x.addEventListener("message",this.onwmsg),x.onerror=function(E){m.trigger(o.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},x.postMessage({cmd:"init",typeSupported:M,vendor:A,id:n,config:JSON.stringify(y)})}catch(E){c.logger.warn("Error in worker:",E),c.logger.error("Error while initializing DemuxerWorker, fallback to inline"),x&&self.URL.revokeObjectURL(x.objectURL),this.transmuxer=new C.default(this.observer,M,y,A,n),this.worker=null}}else this.transmuxer=new C.default(this.observer,M,y,A,n)}var v=b.prototype;return v.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var d=this.transmuxer;d&&(d.destroy(),this.transmuxer=null)}var g=this.observer;g&&g.removeAllListeners(),this.observer=null},v.push=function(n,d,g,T,y,s,M,A,x,E){var w=this;x.transmuxing.start=self.performance.now();var _=this.transmuxer,N=this.worker,j=s?s.start:y.start,k=y.decryptdata,z=this.frag,H=!(z&&y.cc===z.cc),F=!(z&&x.level===z.level),G=z?x.sn-z.sn:-1,B=this.part?x.part-this.part.index:1,W=!F&&(G===1||G===0&&B===1),K=self.performance.now();(F||G||y.stats.parsing.start===0)&&(y.stats.parsing.start=K),s&&(B||!W)&&(s.stats.parsing.start=K);var q=new C.TransmuxState(H,W,A,F,j);if(!W||H){c.logger.log("[transmuxer-interface, "+y.type+"]: Starting new transmux session for sn: "+x.sn+" p: "+x.part+" level: "+x.level+" id: "+x.id+`
|
|
|
discontinuity: `+H+`
|
|
|
trackSwitch: `+F+`
|
|
|
contiguous: `+W+`
|
|
|
accurateTimeOffset: `+A+`
|
|
|
timeOffset: `+j);var re=new C.TransmuxConfig(g,T,d,M,E);this.configureTransmuxer(re)}if(this.frag=y,this.part=s,N)N.postMessage({cmd:"demux",data:n,decryptdata:k,chunkMeta:x,state:q},n instanceof ArrayBuffer?[n]:[]);else if(_){var ee=_.push(n,k,x,q);Object(C.isPromise)(ee)?ee.then(function(Ce){w.handleTransmuxComplete(Ce)}):this.handleTransmuxComplete(ee)}},v.flush=function(n){var d=this;n.transmuxing.start=self.performance.now();var g=this.transmuxer,T=this.worker;if(T)T.postMessage({cmd:"flush",chunkMeta:n});else if(g){var y=g.flush(n);Object(C.isPromise)(y)?y.then(function(s){d.handleFlushResult(s,n)}):this.handleFlushResult(y,n)}},v.handleFlushResult=function(n,d){var g=this;n.forEach(function(T){g.handleTransmuxComplete(T)}),this.onFlush(d)},v.onWorkerMessage=function(n){var d=n.data,g=this.hls;switch(d.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(d.data);break}case"flush":{this.onFlush(d.data);break}default:{d.data=d.data||{},d.data.frag=this.frag,d.data.id=this.id,g.trigger(d.event,d.data);break}}},v.configureTransmuxer=function(n){var d=this.worker,g=this.transmuxer;d?d.postMessage({cmd:"configure",config:n}):g&&g.configure(n)},v.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},b}()},"./src/demux/transmuxer-worker.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return a});var R=S("./src/demux/transmuxer.ts"),h=S("./src/events.ts"),o=S("./src/utils/logger.ts"),C=S("./node_modules/eventemitter3/index.js"),c=S.n(C);function a(f){var b=new C.EventEmitter,v=function(n,d){f.postMessage({event:n,data:d})};b.on(h.Events.FRAG_DECRYPTED,v),b.on(h.Events.ERROR,v),f.addEventListener("message",function(m){var n=m.data;switch(n.cmd){case"init":{var d=JSON.parse(n.config);f.transmuxer=new R.default(b,n.typeSupported,d,n.vendor,n.id),Object(o.enableLogs)(d.debug),v("init",null);break}case"configure":{f.transmuxer.configure(n.config);break}case"demux":{var g=f.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(R.isPromise)(g)?g.then(function(s){i(f,s)}):i(f,g);break}case"flush":{var T=n.chunkMeta,y=f.transmuxer.flush(T);Object(R.isPromise)(y)?y.then(function(s){l(f,s,T)}):l(f,y,T);break}default:break}})}function i(f,b){if(p(b.remuxResult))return;var v=[],m=b.remuxResult,n=m.audio,d=m.video;n&&r(v,n),d&&r(v,d),f.postMessage({event:"transmuxComplete",data:b},v)}function r(f,b){b.data1&&f.push(b.data1.buffer),b.data2&&f.push(b.data2.buffer)}function l(f,b,v){b.forEach(function(m){i(f,m)}),f.postMessage({event:"flush",data:v})}function p(f){return!f.audio&&!f.video&&!f.text&&!f.id3&&!f.initSegment}},"./src/demux/transmuxer.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return d}),S.d(u,"isPromise",function(){return y}),S.d(u,"TransmuxConfig",function(){return s}),S.d(u,"TransmuxState",function(){return M});var R=S("./src/events.ts"),h=S("./src/errors.ts"),o=S("./src/crypt/decrypter.ts"),C=S("./src/demux/aacdemuxer.ts"),c=S("./src/demux/mp4demuxer.ts"),a=S("./src/demux/tsdemuxer.ts"),i=S("./src/demux/mp3demuxer.ts"),r=S("./src/remux/mp4-remuxer.ts"),l=S("./src/remux/passthrough-remuxer.ts"),p=S("./src/demux/chunk-cache.ts"),f=S("./src/utils/mp4-tools.ts"),b=S("./src/utils/logger.ts"),v;try{v=self.performance.now.bind(self.performance)}catch(A){b.logger.debug("Unable to use Performance API on this environment"),v=self.Date.now}var m=[{demux:a.default,remux:r.default},{demux:c.default,remux:l.default},{demux:C.default,remux:r.default},{demux:i.default,remux:r.default}],n=1024;m.forEach(function(A){var x=A.demux;n=Math.max(n,x.minProbeByteLength)});var d=function(){function A(E,w,_,N,j){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 p.default,this.observer=E,this.typeSupported=w,this.config=_,this.vendor=N,this.id=j}var x=A.prototype;return x.configure=function(w){this.transmuxConfig=w,this.decrypter&&this.decrypter.reset()},x.push=function(w,_,N,j){var k=this,z=N.transmuxing;z.executeStart=v();var H=new Uint8Array(w),F=this.cache,G=this.config,B=this.currentTransmuxState,W=this.transmuxConfig;j&&(this.currentTransmuxState=j);var K=g(H,_);if(K&&K.method==="AES-128"){var q=this.getDecrypter();if(G.enableSoftwareAES){var re=q.softwareDecrypt(H,K.key.buffer,K.iv.buffer);if(!re)return z.executeEnd=v(),T(N);H=new Uint8Array(re)}else return this.decryptionPromise=q.webCryptoDecrypt(H,K.key.buffer,K.iv.buffer).then(function(Q){var Y=k.push(Q,null,N);return k.decryptionPromise=null,Y}),this.decryptionPromise}var ee=j||B,Ce=ee.contiguous,xe=ee.discontinuity,he=ee.trackSwitch,ke=ee.accurateTimeOffset,_e=ee.timeOffset,de=W.audioCodec,ce=W.videoCodec,ae=W.defaultInitPts,Se=W.duration,te=W.initSegmentData;if((xe||he)&&this.resetInitSegment(te,de,ce,Se),xe&&this.resetInitialTimestamp(ae),Ce||this.resetContiguity(),this.needsProbing(H,xe,he)){if(F.dataLength){var ue=F.flush();H=Object(f.appendUint8Array)(ue,H)}this.configureTransmuxer(H,W)}var Oe=this.transmux(H,K,_e,ke,N),le=this.currentTransmuxState;return le.contiguous=!0,le.discontinuity=!1,le.trackSwitch=!1,z.executeEnd=v(),Oe},x.flush=function(w){var _=this,N=w.transmuxing;N.executeStart=v();var j=this.decrypter,k=this.cache,z=this.currentTransmuxState,H=this.decryptionPromise;if(H)return H.then(function(){return _.flush(w)});var F=[],G=z.timeOffset;if(j){var B=j.flush();B&&F.push(this.push(B,null,w))}var W=k.dataLength;k.reset();var K=this.demuxer,q=this.remuxer;if(!K||!q)return W>=n&&this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),N.executeEnd=v(),[T(w)];var re=K.flush(G);return y(re)?re.then(function(ee){return _.flushRemux(F,ee,w),F}):(this.flushRemux(F,re,w),F)},x.flushRemux=function(w,_,N){var j=_.audioTrack,k=_.avcTrack,z=_.id3Track,H=_.textTrack,F=this.currentTransmuxState,G=F.accurateTimeOffset,B=F.timeOffset;b.logger.log("[transmuxer.ts]: Flushed fragment "+N.sn+(N.part>-1?" p: "+N.part:"")+" of level "+N.level);var W=this.remuxer.remux(j,k,z,H,B,G,!0,this.id);w.push({remuxResult:W,chunkMeta:N}),N.transmuxing.executeEnd=v()},x.resetInitialTimestamp=function(w){var _=this.demuxer,N=this.remuxer;if(!_||!N)return;_.resetTimeStamp(w),N.resetTimeStamp(w)},x.resetContiguity=function(){var w=this.demuxer,_=this.remuxer;if(!w||!_)return;w.resetContiguity(),_.resetNextTimestamp()},x.resetInitSegment=function(w,_,N,j){var k=this.demuxer,z=this.remuxer;if(!k||!z)return;k.resetInitSegment(_,N,j),z.resetInitSegment(w,_,N)},x.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},x.transmux=function(w,_,N,j,k){var z;return _&&_.method==="SAMPLE-AES"?z=this.transmuxSampleAes(w,_,N,j,k):z=this.transmuxUnencrypted(w,N,j,k),z},x.transmuxUnencrypted=function(w,_,N,j){var k=this.demuxer.demux(w,_,!1,!this.config.progressive),z=k.audioTrack,H=k.avcTrack,F=k.id3Track,G=k.textTrack,B=this.remuxer.remux(z,H,F,G,_,N,!1,this.id);return{remuxResult:B,chunkMeta:j}},x.transmuxSampleAes=function(w,_,N,j,k){var z=this;return this.demuxer.demuxSampleAes(w,_,N).then(function(H){var F=z.remuxer.remux(H.audioTrack,H.avcTrack,H.id3Track,H.textTrack,N,j,!1,z.id);return{remuxResult:F,chunkMeta:k}})},x.configureTransmuxer=function(w,_){for(var N=this.config,j=this.observer,k=this.typeSupported,z=this.vendor,H=_.audioCodec,F=_.defaultInitPts,G=_.duration,B=_.initSegmentData,W=_.videoCodec,K,q=0,re=m.length;q<re;q++)if(m[q].demux.probe(w)){K=m[q];break}K||(b.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:c.default,remux:l.default});var ee=this.demuxer,Ce=this.remuxer,xe=K.remux,he=K.demux;(!Ce||!(Ce instanceof xe))&&(this.remuxer=new xe(j,N,k,z)),(!ee||!(ee instanceof he))&&(this.demuxer=new he(j,N,k),this.probe=he.probe),this.resetInitSegment(B,H,W,G),this.resetInitialTimestamp(F)},x.needsProbing=function(w,_,N){return!this.demuxer||!this.remuxer||_||N},x.getDecrypter=function(){var w=this.decrypter;return w||(w=this.decrypter=new o.default(this.observer,this.config)),w},A}();function g(A,x){var E=null;return A.byteLength>0&&x!=null&&x.key!=null&&x.iv!==null&&x.method!=null&&(E=x),E}var T=function(x){return{remuxResult:{},chunkMeta:x}};function y(A){return"then"in A&&A.then instanceof Function}var s=function(x,E,w,_,N){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=x,this.videoCodec=E,this.initSegmentData=w,this.duration=_,this.defaultInitPts=N},M=function(x,E,w,_,N){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=x,this.contiguous=E,this.accurateTimeOffset=w,this.trackSwitch=_,this.timeOffset=N}},"./src/demux/tsdemuxer.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"discardEPB",function(){return T});var R=S("./src/demux/adts.ts"),h=S("./src/demux/mpegaudio.ts"),o=S("./src/demux/exp-golomb.ts"),C=S("./src/demux/id3.ts"),c=S("./src/demux/sample-aes.ts"),a=S("./src/events.ts"),i=S("./src/utils/mp4-tools.ts"),r=S("./src/utils/logger.ts"),l=S("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},f=function(){function y(M,A,x){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=M,this.config=A,this.typeSupported=x}y.probe=function(A){var x=y.syncOffset(A);return x<0?!1:(x&&r.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},y.syncOffset=function(A){for(var x=Math.min(1e3,A.length-3*188),E=0;E<x;){if(A[E]===71&&A[E+188]===71&&A[E+2*188]===71)return E;E++}return-1},y.createTrack=function(A,x){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:p[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?x:void 0}};var s=y.prototype;return s.resetInitSegment=function(A,x,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=y.createTrack("video",E),this._audioTrack=y.createTrack("audio",E),this._id3Track=y.createTrack("id3",E),this._txtTrack=y.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=x,this._duration=E},s.resetTimeStamp=function(){},s.resetContiguity=function(){var A=this._audioTrack,x=this._avcTrack,E=this._id3Track;A&&(A.pesData=null),x&&(x.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},s.demux=function(A,x,E,w){E===void 0&&(E=!1),w===void 0&&(w=!1),E||(this.sampleAes=null);var _,N=this._avcTrack,j=this._audioTrack,k=this._id3Track,z=N.pid,H=N.pesData,F=j.pid,G=k.pid,B=j.pesData,W=k.pesData,K=!1,q=this.pmtParsed,re=this._pmtId,ee=A.length;if(this.remainderData&&(A=Object(i.appendUint8Array)(this.remainderData,A),ee=A.length,this.remainderData=null),ee<188&&!w)return this.remainderData=A,{audioTrack:j,avcTrack:N,id3Track:k,textTrack:this._txtTrack};var Ce=Math.max(0,y.syncOffset(A));ee-=(ee+Ce)%188,ee<A.byteLength&&!w&&(this.remainderData=new Uint8Array(A.buffer,ee,A.buffer.byteLength-ee));for(var xe=Ce;xe<ee;xe+=188)if(A[xe]===71){var he=!!(A[xe+1]&64),ke=((A[xe+1]&31)<<8)+A[xe+2],_e=(A[xe+3]&48)>>4,de=void 0;if(_e>1){if(de=xe+5+A[xe+4],de===xe+188)continue}else de=xe+4;switch(ke){case z:he&&(H&&(_=n(H))&&this.parseAVCPES(_,!1),H={data:[],size:0}),H&&(H.data.push(A.subarray(de,xe+188)),H.size+=xe+188-de);break;case F:he&&(B&&(_=n(B))&&(j.isAAC?this.parseAACPES(_):this.parseMPEGPES(_)),B={data:[],size:0}),B&&(B.data.push(A.subarray(de,xe+188)),B.size+=xe+188-de);break;case G:he&&(W&&(_=n(W))&&this.parseID3PES(_),W={data:[],size:0}),W&&(W.data.push(A.subarray(de,xe+188)),W.size+=xe+188-de);break;case 0:he&&(de+=A[de]+1),re=this._pmtId=v(A,de);break;case re:{he&&(de+=A[de]+1);var ce=m(A,de,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);z=ce.avc,z>0&&(N.pid=z),F=ce.audio,F>0&&(j.pid=F,j.isAAC=ce.isAAC),G=ce.id3,G>0&&(k.pid=G),K&&!q&&(r.logger.log("reparse from beginning"),K=!1,xe=Ce-188),q=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(a.Events.ERROR,a.Events.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});N.pesData=H,j.pesData=B,k.pesData=W;var ae={audioTrack:j,avcTrack:N,id3Track:k,textTrack:this._txtTrack};return w&&this.extractRemainingSamples(ae),ae},s.flush=function(){var A=this.remainderData;this.remainderData=null;var x;return A?x=this.demux(A,-1,!1,!0):x={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(x),this.sampleAes?this.decrypt(x,this.sampleAes):x},s.extractRemainingSamples=function(A){var x=A.audioTrack,E=A.avcTrack,w=A.id3Track,_=E.pesData,N=x.pesData,j=w.pesData,k;_&&(k=n(_))?(this.parseAVCPES(k,!0),E.pesData=null):E.pesData=_,N&&(k=n(N))?(x.isAAC?this.parseAACPES(k):this.parseMPEGPES(k),x.pesData=null):(N!=null&&N.size&&r.logger.log("last AAC PES packet truncated,might overlap between fragments"),x.pesData=N),j&&(k=n(j))?(this.parseID3PES(k),w.pesData=null):w.pesData=j},s.demuxSampleAes=function(A,x,E){var w=this.demux(A,E,!0,!this.config.progressive),_=this.sampleAes=new c.default(this.observer,this.config,x);return this.decrypt(w,_)},s.decrypt=function(A,x){return new Promise(function(E){var w=A.audioTrack,_=A.avcTrack;w.samples&&w.isAAC?x.decryptAacSamples(w.samples,0,function(){_.samples?x.decryptAvcSamples(_.samples,0,0,function(){E(A)}):E(A)}):_.samples&&x.decryptAvcSamples(_.samples,0,0,function(){E(A)})})},s.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},s.parseAVCPES=function(A,x){var E=this,w=this._avcTrack,_=this.parseAVCNALu(A.data),N=!1,j=this.avcSample,k,z=!1;A.data=null,j&&_.length&&!w.audFound&&(d(j,w),j=this.avcSample=b(!1,A.pts,A.dts,"")),_.forEach(function(H){switch(H.type){case 1:{k=!0,j||(j=E.avcSample=b(!0,A.pts,A.dts,"")),N&&(j.debug+="NDR "),j.frame=!0;var F=H.data;if(z&&F.length>4){var G=new o.default(F).readSliceType();(G===2||G===4||G===7||G===9)&&(j.key=!0)}break}case 5:k=!0,j||(j=E.avcSample=b(!0,A.pts,A.dts,"")),N&&(j.debug+="IDR "),j.key=!0,j.frame=!0;break;case 6:{k=!0,N&&j&&(j.debug+="SEI ");var B=new o.default(T(H.data));B.readUByte();for(var W=0,K=0,q=!1,re=0;!q&&B.bytesAvailable>1;){W=0;do re=B.readUByte(),W+=re;while(re===255);K=0;do re=B.readUByte(),K+=re;while(re===255);if(W===4&&B.bytesAvailable!==0){q=!0;var ee=B.readUByte();if(ee===181){var Ce=B.readUShort();if(Ce===49){var xe=B.readUInt();if(xe===1195456820){var he=B.readUByte();if(he===3){for(var ke=B.readUByte(),_e=B.readUByte(),de=31&ke,ce=[ke,_e],ae=0;ae<de;ae++)ce.push(B.readUByte()),ce.push(B.readUByte()),ce.push(B.readUByte());g(E._txtTrack.samples,{type:3,pts:A.pts,bytes:ce})}}}}}else if(W===5&&B.bytesAvailable!==0){if(q=!0,K>16){for(var Se=[],te=0;te<16;te++)Se.push(B.readUByte().toString(16)),(te===3||te===5||te===7||te===9)&&Se.push("-");for(var ue=K-16,Oe=new Uint8Array(ue),le=0;le<ue;le++)Oe[le]=B.readUByte();g(E._txtTrack.samples,{pts:A.pts,payloadType:W,uuid:Se.join(""),userData:Object(C.utf8ArrayToStr)(Oe),userDataBytes:Oe})}}else if(K<B.bytesAvailable)for(var Q=0;Q<K;Q++)B.readUByte()}break}case 7:if(k=!0,z=!0,N&&j&&(j.debug+="SPS "),!w.sps){var Y=new o.default(H.data),Z=Y.readSPS();w.width=Z.width,w.height=Z.height,w.pixelRatio=Z.pixelRatio,w.sps=[H.data],w.duration=E._duration;for(var be=H.data.subarray(1,4),ge="avc1.",De=0;De<3;De++){var Qe=be[De].toString(16);Qe.length<2&&(Qe="0"+Qe),ge+=Qe}w.codec=ge}break;case 8:k=!0,N&&j&&(j.debug+="PPS "),w.pps||(w.pps=[H.data]);break;case 9:k=!1,w.audFound=!0,j&&d(j,w),j=E.avcSample=b(!1,A.pts,A.dts,N?"AUD ":"");break;case 12:k=!1;break;default:k=!1,j&&(j.debug+="unknown NAL "+H.type+" ");break}if(j&&k){var Ze=j.units;Ze.push(H)}}),x&&j&&(d(j,w),this.avcSample=null)},s.getLastNalUnit=function(){var A,x=this.avcSample,E;if(!x||x.units.length===0){var w=this._avcTrack.samples;x=w[w.length-1]}if((A=x)!==null&&A!==void 0&&A.units){var _=x.units;E=_[_.length-1]}return E},s.parseAVCNALu=function(A){var x=A.byteLength,E=this._avcTrack,w=E.naluState||0,_=w,N=[],j=0,k,z,H,F=-1,G=0;for(w===-1&&(F=0,G=A[0]&31,w=0,j=1);j<x;){if(k=A[j++],!w){w=k?0:1;continue}if(w===1){w=k?0:2;continue}if(!k)w=3;else if(k===1){if(F>=0){var B={data:A.subarray(F,j-w-1),type:G};N.push(B)}else{var W=this.getLastNalUnit();if(W&&(_&&j<=4-_&&(W.state&&(W.data=W.data.subarray(0,W.data.byteLength-_))),z=j-w-1,z>0)){var K=new Uint8Array(W.data.byteLength+z);K.set(W.data,0),K.set(A.subarray(0,z),W.data.byteLength),W.data=K,W.state=0}}j<x?(H=A[j]&31,F=j,G=H,w=0):w=-1}else w=0}if(F>=0&&w>=0){var q={data:A.subarray(F,x),type:G,state:w};N.push(q)}if(N.length===0){var re=this.getLastNalUnit();if(re){var ee=new Uint8Array(re.data.byteLength+A.byteLength);ee.set(re.data,0),ee.set(A,re.data.byteLength),re.data=ee}}return E.naluState=w,N},s.parseAACPES=function(A){var x=0,E=this._audioTrack,w=this.aacOverFlow,_=A.data;if(w){this.aacOverFlow=null;var N=w.sample.unit.byteLength,j=Math.min(w.missing,N),k=N-j;w.sample.unit.set(_.subarray(0,j),k),E.samples.push(w.sample),x=w.missing}var z,H;for(z=x,H=_.length;z<H-1&&!R.isHeader(_,z);z++);if(z!==x){var F,G;if(z<H-1?(F="AAC PES did not start with ADTS header,offset:"+z,G=!1):(F="no ADTS header found in AAC PES",G=!0),r.logger.warn("parsing error:"+F),this.observer.emit(a.Events.ERROR,a.Events.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:F}),G)return}R.initTrackConfig(E,this.observer,_,z,this.audioCodec);var B;if(A.pts!==void 0)B=A.pts;else if(w){var W=R.getFrameDuration(E.samplerate);B=w.sample.pts+W}else{r.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;z<H;)if(R.isHeader(_,z)){if(z+5<H){var q=R.appendFrame(E,_,z,B,K);if(q)if(q.missing)this.aacOverFlow=q;else{z+=q.length,K++;continue}}break}else z++},s.parseMPEGPES=function(A){var x=A.data,E=x.length,w=0,_=0,N=A.pts;if(N===void 0){r.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;_<E;)if(h.isHeader(x,_)){var j=h.appendFrame(this._audioTrack,x,_,N,w);if(j)_+=j.length,w++;else break}else _++},s.parseID3PES=function(A){if(A.pts===void 0){r.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},y}();f.minProbeByteLength=188;function b(y,s,M,A){return{key:y,frame:!1,pts:s,dts:M,units:[],debug:A,length:0}}function v(y,s){return(y[s+10]&31)<<8|y[s+11]}function m(y,s,M,A){var x={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(y[s+1]&15)<<8|y[s+2],w=s+3+E-4,_=(y[s+10]&15)<<8|y[s+11];for(s+=12+_;s<w;){var N=(y[s+1]&31)<<8|y[s+2];switch(y[s]){case 207:if(!A){r.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:x.audio===-1&&(x.audio=N);break;case 21:x.id3===-1&&(x.id3=N);break;case 219:if(!A){r.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:x.avc===-1&&(x.avc=N);break;case 3:case 4:M?x.audio===-1&&(x.audio=N,x.isAAC=!1):r.logger.log("MPEG audio found, not supported in this browser");break;case 36:r.logger.warn("Unsupported HEVC stream type found");break;default:break}s+=((y[s+3]&15)<<8|y[s+4])+5}return x}function n(y){var s=0,M,A,x,E,w,_=y.data;if(!y||y.size===0)return null;for(;_[0].length<19&&_.length>1;){var N=new Uint8Array(_[0].length+_[1].length);N.set(_[0]),N.set(_[1],_[0].length),_[0]=N,_.splice(1,1)}M=_[0];var j=(M[0]<<16)+(M[1]<<8)+M[2];if(j===1){if(A=(M[4]<<8)+M[5],A&&A>y.size-6)return null;var k=M[7];k&192&&(E=(M[9]&14)*536870912+(M[10]&255)*4194304+(M[11]&254)*16384+(M[12]&255)*128+(M[13]&254)/2,k&64?(w=(M[14]&14)*536870912+(M[15]&255)*4194304+(M[16]&254)*16384+(M[17]&255)*128+(M[18]&254)/2,E-w>60*9e4&&(r.logger.warn(Math.round((E-w)/9e4)+"s delta between PTS and DTS, align them"),E=w)):w=E),x=M[8];var z=x+9;if(y.size<=z)return null;y.size-=z;for(var H=new Uint8Array(y.size),F=0,G=_.length;F<G;F++){M=_[F];var B=M.byteLength;if(z)if(z>B){z-=B;continue}else M=M.subarray(z),B-=z,z=0;H.set(M,s),s+=B}return A&&(A-=x+3),{data:H,pts:E,dts:w,len:A}}return null}function d(y,s){if(y.units.length&&y.frame){if(y.pts===void 0){var M=s.samples,A=M.length;if(A){var x=M[A-1];y.pts=x.pts,y.dts=x.dts}else{s.dropped++;return}}s.samples.push(y)}y.debug.length&&r.logger.log(y.pts+"/"+y.dts+":"+y.debug)}function g(y,s){var M=y.length;if(M>0){if(s.pts>=y[M-1].pts)y.push(s);else for(var A=M-1;A>=0;A--)if(s.pts<y[A].pts){y.splice(A,0,s);break}}else y.push(s)}function T(y){for(var s=y.byteLength,M=[],A=1;A<s-2;)y[A]===0&&y[A+1]===0&&y[A+2]===3?(M.push(A+2),A+=2):A++;if(M.length===0)return y;var x=s-M.length,E=new Uint8Array(x),w=0;for(A=0;A<x;w++,A++)w===M[0]&&(w++,M.shift()),E[A]=y[w];return E}u.default=f},"./src/errors.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"ErrorTypes",function(){return R}),S.d(u,"ErrorDetails",function(){return h});var R;(function(o){o.NETWORK_ERROR="networkError",o.MEDIA_ERROR="mediaError",o.KEY_SYSTEM_ERROR="keySystemError",o.MUX_ERROR="muxError",o.OTHER_ERROR="otherError"})(R||(R={}));var h;(function(o){o.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",o.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",o.KEY_SYSTEM_NO_SESSION="keySystemNoSession",o.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",o.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",o.MANIFEST_LOAD_ERROR="manifestLoadError",o.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",o.MANIFEST_PARSING_ERROR="manifestParsingError",o.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",o.LEVEL_EMPTY_ERROR="levelEmptyError",o.LEVEL_LOAD_ERROR="levelLoadError",o.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",o.LEVEL_SWITCH_ERROR="levelSwitchError",o.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",o.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",o.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",o.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",o.FRAG_LOAD_ERROR="fragLoadError",o.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",o.FRAG_DECRYPT_ERROR="fragDecryptError",o.FRAG_PARSING_ERROR="fragParsingError",o.REMUX_ALLOC_ERROR="remuxAllocError",o.KEY_LOAD_ERROR="keyLoadError",o.KEY_LOAD_TIMEOUT="keyLoadTimeOut",o.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",o.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",o.BUFFER_APPEND_ERROR="bufferAppendError",o.BUFFER_APPENDING_ERROR="bufferAppendingError",o.BUFFER_STALLED_ERROR="bufferStalledError",o.BUFFER_FULL_ERROR="bufferFullError",o.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",o.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",o.INTERNAL_EXCEPTION="internalException",o.INTERNAL_ABORTED="aborted",o.UNKNOWN="unknown"})(h||(h={}))},"./src/events.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"Events",function(){return R});var R;(function(h){h.MEDIA_ATTACHING="hlsMediaAttaching",h.MEDIA_ATTACHED="hlsMediaAttached",h.MEDIA_DETACHING="hlsMediaDetaching",h.MEDIA_DETACHED="hlsMediaDetached",h.BUFFER_RESET="hlsBufferReset",h.BUFFER_CODECS="hlsBufferCodecs",h.BUFFER_CREATED="hlsBufferCreated",h.BUFFER_APPENDING="hlsBufferAppending",h.BUFFER_APPENDED="hlsBufferAppended",h.BUFFER_EOS="hlsBufferEos",h.BUFFER_FLUSHING="hlsBufferFlushing",h.BUFFER_FLUSHED="hlsBufferFlushed",h.MANIFEST_LOADING="hlsManifestLoading",h.MANIFEST_LOADED="hlsManifestLoaded",h.MANIFEST_PARSED="hlsManifestParsed",h.LEVEL_SWITCHING="hlsLevelSwitching",h.LEVEL_SWITCHED="hlsLevelSwitched",h.LEVEL_LOADING="hlsLevelLoading",h.LEVEL_LOADED="hlsLevelLoaded",h.LEVEL_UPDATED="hlsLevelUpdated",h.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",h.LEVELS_UPDATED="hlsLevelsUpdated",h.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",h.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",h.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",h.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",h.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",h.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",h.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",h.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",h.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",h.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",h.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",h.CUES_PARSED="hlsCuesParsed",h.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",h.INIT_PTS_FOUND="hlsInitPtsFound",h.FRAG_LOADING="hlsFragLoading",h.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",h.FRAG_LOADED="hlsFragLoaded",h.FRAG_DECRYPTED="hlsFragDecrypted",h.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",h.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",h.FRAG_PARSING_METADATA="hlsFragParsingMetadata",h.FRAG_PARSED="hlsFragParsed",h.FRAG_BUFFERED="hlsFragBuffered",h.FRAG_CHANGED="hlsFragChanged",h.FPS_DROP="hlsFpsDrop",h.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",h.ERROR="hlsError",h.DESTROYING="hlsDestroying",h.KEY_LOADING="hlsKeyLoading",h.KEY_LOADED="hlsKeyLoaded",h.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",h.BACK_BUFFER_REACHED="hlsBackBufferReached"})(R||(R={}))},"./src/hls.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return y});var R=S("./node_modules/url-toolkit/src/url-toolkit.js"),h=S.n(R),o=S("./src/loader/playlist-loader.ts"),C=S("./src/loader/key-loader.ts"),c=S("./src/controller/id3-track-controller.ts"),a=S("./src/controller/latency-controller.ts"),i=S("./src/controller/level-controller.ts"),r=S("./src/controller/fragment-tracker.ts"),l=S("./src/controller/stream-controller.ts"),p=S("./src/is-supported.ts"),f=S("./src/utils/logger.ts"),b=S("./src/config.ts"),v=S("./node_modules/eventemitter3/index.js"),m=S.n(v),n=S("./src/events.ts"),d=S("./src/errors.ts");function g(s,M){for(var A=0;A<M.length;A++){var x=M[A];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(s,x.key,x)}}function T(s,M,A){return M&&g(s.prototype,M),A&&g(s,A),s}var y=function(){s.isSupported=function(){return Object(p.isSupported)()};function s(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new v.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 x=this.config=Object(b.mergeConfig)(s.DefaultConfig,A);this.userConfig=A,Object(f.enableLogs)(x.debug),this._autoLevelCapping=-1,x.progressive&&Object(b.enableStreamingMode)(x);var E=x.abrController,w=x.bufferController,_=x.capLevelController,N=x.fpsController,j=this.abrController=new E(this),k=this.bufferController=new w(this),z=this.capLevelController=new _(this),H=new N(this),F=new o.default(this),G=new C.default(this),B=new c.default(this),W=this.levelController=new i.default(this),K=new r.FragmentTracker(this),q=this.streamController=new l.default(this,K);z.setStreamController(q),H.setStreamController(q);var re=[W,q];this.networkControllers=re;var ee=[F,G,j,k,z,H,B,K];this.audioTrackController=this.createController(x.audioTrackController,null,re),this.createController(x.audioStreamController,K,re),this.subtitleTrackController=this.createController(x.subtitleTrackController,null,re),this.createController(x.subtitleStreamController,K,re),this.createController(x.timelineController,null,ee),this.emeController=this.createController(x.emeController,null,ee),this.cmcdController=this.createController(x.cmcdController,null,ee),this.latencyController=this.createController(a.default,null,ee),this.coreComponents=ee}var M=s.prototype;return M.createController=function(x,E,w){if(x){var _=E?new x(this,E):new x(this);return w&&w.push(_),_}return null},M.on=function(x,E,w){w===void 0&&(w=this),this._emitter.on(x,E,w)},M.once=function(x,E,w){w===void 0&&(w=this),this._emitter.once(x,E,w)},M.removeAllListeners=function(x){this._emitter.removeAllListeners(x)},M.off=function(x,E,w,_){w===void 0&&(w=this),this._emitter.off(x,E,w,_)},M.listeners=function(x){return this._emitter.listeners(x)},M.emit=function(x,E,w){return this._emitter.emit(x,E,w)},M.trigger=function(x,E){if(this.config.debug)return this.emit(x,x,E);try{return this.emit(x,x,E)}catch(w){f.logger.error("An internal error happened while handling event "+x+'. Error message: "'+w.message+'". Here is a stacktrace:',w),this.trigger(n.Events.ERROR,{type:d.ErrorTypes.OTHER_ERROR,details:d.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:x,error:w})}return!1},M.listenerCount=function(x){return this._emitter.listenerCount(x)},M.destroy=function(){f.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(x){return x.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(x){return x.destroy()}),this.coreComponents.length=0},M.attachMedia=function(x){f.logger.log("attachMedia"),this._media=x,this.trigger(n.Events.MEDIA_ATTACHING,{media:x})},M.detachMedia=function(){f.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},M.loadSource=function(x){this.stopLoad();var E=this.media,w=this.url,_=this.url=R.buildAbsoluteURL(self.location.href,x,{alwaysNormalize:!0});f.logger.log("loadSource:"+_),E&&w&&w!==_&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(n.Events.MANIFEST_LOADING,{url:x})},M.startLoad=function(x){x===void 0&&(x=-1),f.logger.log("startLoad("+x+")"),this.networkControllers.forEach(function(E){E.startLoad(x)})},M.stopLoad=function(){f.logger.log("stopLoad"),this.networkControllers.forEach(function(x){x.stopLoad()})},M.swapAudioCodec=function(){f.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},M.recoverMediaError=function(){f.logger.log("recoverMediaError");var x=this._media;this.detachMedia(),x&&this.attachMedia(x)},M.removeLevel=function(x,E){E===void 0&&(E=0),this.levelController.removeLevel(x,E)},T(s,[{key:"levels",get:function(){var x=this.levelController.levels;return x||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(x){f.logger.log("set currentLevel:"+x),this.loadLevel=x,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(x){f.logger.log("set nextLevel:"+x),this.levelController.manualLevel=x,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(x){f.logger.log("set loadLevel:"+x),this.levelController.manualLevel=x}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(x){this.levelController.nextLoadLevel=x}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(x){f.logger.log("set firstLevel:"+x),this.levelController.firstLevel=x}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(x){f.logger.log("set startLevel:"+x),x!==-1&&(x=Math.max(x,this.minAutoLevel)),this.levelController.startLevel=x}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(x){var E=!!x;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(x){this._autoLevelCapping!==x&&(f.logger.log("set autoLevelCapping:"+x),this._autoLevelCapping=x)}},{key:"bandwidthEstimate",get:function(){var x=this.abrController.bwEstimator;return x?x.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var x=this.levels,E=this.config.minAutoBitrate;if(!x)return 0;for(var w=x.length,_=0;_<w;_++)if(x[_].maxBitrate>E)return _;return 0}},{key:"maxAutoLevel",get:function(){var x=this.levels,E=this.autoLevelCapping,w;return E===-1&&x&&x.length?w=x.length-1:w=E,w}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(x){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,x)}},{key:"audioTracks",get:function(){var x=this.audioTrackController;return x?x.audioTracks:[]}},{key:"audioTrack",get:function(){var x=this.audioTrackController;return x?x.audioTrack:-1},set:function(x){var E=this.audioTrackController;E&&(E.audioTrack=x)}},{key:"subtitleTracks",get:function(){var x=this.subtitleTrackController;return x?x.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var x=this.subtitleTrackController;return x?x.subtitleTrack:-1},set:function(x){var E=this.subtitleTrackController;E&&(E.subtitleTrack=x)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var x=this.subtitleTrackController;return x?x.subtitleDisplay:!1},set:function(x){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=x)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(x){this.config.lowLatencyMode=x}},{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 d.ErrorTypes}},{key:"ErrorDetails",get:function(){return d.ErrorDetails}},{key:"DefaultConfig",get:function(){return s.defaultConfig?s.defaultConfig:b.hlsDefaultConfig},set:function(x){s.defaultConfig=x}}]),s}();y.defaultConfig=void 0},"./src/is-supported.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"isSupported",function(){return o}),S.d(u,"changeTypeSupported",function(){return C});var R=S("./src/utils/mediasource-helper.ts");function h(){return self.SourceBuffer||self.WebKitSourceBuffer}function o(){var c=Object(R.getMediaSource)();if(!c)return!1;var a=h(),i=c&&typeof c.isTypeSupported=="function"&&c.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!a||a.prototype&&typeof a.prototype.appendBuffer=="function"&&typeof a.prototype.remove=="function";return!!i&&!!r}function C(){var c,a=h();return typeof(a==null||((c=a.prototype)===null||c===void 0)?void 0:c.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return f}),S.d(u,"LoadError",function(){return v});var R=S("./src/polyfills/number.ts"),h=S("./src/errors.ts");function o(m,n){m.prototype=Object.create(n.prototype),m.prototype.constructor=m,r(m,n)}function C(m){var n=typeof Map=="function"?new Map:void 0;return C=function(g){if(g===null||!i(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(g))return n.get(g);n.set(g,T)}function T(){return c(g,arguments,l(this).constructor)}return T.prototype=Object.create(g.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),r(T,g)},C(m)}function c(m,n,d){return a()?c=Reflect.construct:c=function(T,y,s){var M=[null];M.push.apply(M,y);var A=Function.bind.apply(T,M),x=new A;return s&&r(x,s.prototype),x},c.apply(null,arguments)}function a(){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(m){return!1}}function i(m){return Function.toString.call(m).indexOf("[native code]")!==-1}function r(m,n){return r=Object.setPrototypeOf||function(g,T){return g.__proto__=T,g},r(m,n)}function l(m){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},l(m)}var p=Math.pow(2,17),f=function(){function m(d){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=d}var n=m.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(g,T){var y=this,s=g.url;if(!s)return Promise.reject(new v({type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:g,networkDetails:null},"Fragment does not have a "+(s?"part list":"url")));this.abort();var M=this.config,A=M.fLoader,x=M.loader;return new Promise(function(E,w){y.loader&&y.loader.destroy();var _=y.loader=g.loader=A?new A(M):new x(M),N=b(g),j={timeout:M.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:M.fragLoadingMaxRetryTimeout,highWaterMark:p};g.stats=_.stats,_.load(N,j,{onSuccess:function(z,H,F,G){y.resetLoader(g,_),E({frag:g,part:null,payload:z.data,networkDetails:G})},onError:function(z,H,F){y.resetLoader(g,_),w(new v({type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:g,response:z,networkDetails:F}))},onAbort:function(z,H,F){y.resetLoader(g,_),w(new v({type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:g,networkDetails:F}))},onTimeout:function(z,H,F){y.resetLoader(g,_),w(new v({type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:g,networkDetails:F}))},onProgress:function(z,H,F,G){T&&T({frag:g,part:null,payload:F,networkDetails:G})}})})},n.loadPart=function(g,T,y){var s=this;this.abort();var M=this.config,A=M.fLoader,x=M.loader;return new Promise(function(E,w){s.loader&&s.loader.destroy();var _=s.loader=g.loader=A?new A(M):new x(M),N=b(g,T),j={timeout:M.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:M.fragLoadingMaxRetryTimeout,highWaterMark:p};T.stats=_.stats,_.load(N,j,{onSuccess:function(z,H,F,G){s.resetLoader(g,_),s.updateStatsFromPart(g,T);var B={frag:g,part:T,payload:z.data,networkDetails:G};y(B),E(B)},onError:function(z,H,F){s.resetLoader(g,_),w(new v({type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:g,part:T,response:z,networkDetails:F}))},onAbort:function(z,H,F){g.stats.aborted=T.stats.aborted,s.resetLoader(g,_),w(new v({type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:g,part:T,networkDetails:F}))},onTimeout:function(z,H,F){s.resetLoader(g,_),w(new v({type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:g,part:T,networkDetails:F}))}})})},n.updateStatsFromPart=function(g,T){var y=g.stats,s=T.stats,M=s.total;if(y.loaded+=s.loaded,M){var A=Math.round(g.duration/T.duration),x=Math.min(Math.round(y.loaded/M),A),E=A-x,w=E*Math.round(y.loaded/x);y.total=y.loaded+w}else y.total=Math.max(y.loaded,y.total);var _=y.loading,N=s.loading;_.start?_.first+=N.first-N.start:(_.start=N.start,_.first=N.first),_.end=N.end},n.resetLoader=function(g,T){g.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},m}();function b(m,n){n===void 0&&(n=null);var d=n||m,g={frag:m,part:n,responseType:"arraybuffer",url:d.url,headers:{},rangeStart:0,rangeEnd:0},T=d.byteRangeStartOffset,y=d.byteRangeEndOffset;return Object(R.isFiniteNumber)(T)&&Object(R.isFiniteNumber)(y)&&(g.rangeStart=T,g.rangeEnd=y),g}var v=function(m){o(n,m);function n(d){for(var g,T=arguments.length,y=new Array(T>1?T-1:0),s=1;s<T;s++)y[s-1]=arguments[s];return g=m.call.apply(m,[this].concat(y))||this,g.data=void 0,g.data=d,g}return n}(C(Error))},"./src/loader/fragment.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"ElementaryStreamTypes",function(){return f}),S.d(u,"BaseSegment",function(){return b}),S.d(u,"Fragment",function(){return v}),S.d(u,"Part",function(){return m});var R=S("./src/polyfills/number.ts"),h=S("./node_modules/url-toolkit/src/url-toolkit.js"),o=S.n(h),C=S("./src/utils/logger.ts"),c=S("./src/loader/level-key.ts"),a=S("./src/loader/load-stats.ts");function i(n,d){n.prototype=Object.create(d.prototype),n.prototype.constructor=n,r(n,d)}function r(n,d){return r=Object.setPrototypeOf||function(T,y){return T.__proto__=y,T},r(n,d)}function l(n,d){for(var g=0;g<d.length;g++){var T=d[g];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(n,T.key,T)}}function p(n,d,g){return d&&l(n.prototype,d),g&&l(n,g),n}var f;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(f||(f={}));var b=function(){function n(g){var T;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(T={},T[f.AUDIO]=null,T[f.VIDEO]=null,T[f.AUDIOVIDEO]=null,T),this.baseurl=g}var d=n.prototype;return d.setByteRange=function(T,y){var s=T.split("@",2),M=[];s.length===1?M[0]=y?y.byteRangeEndOffset:0:M[0]=parseInt(s[1]),M[1]=parseInt(s[0])+M[0],this._byteRange=M},p(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(h.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(T){this._url=T}}]),n}(),v=function(n){i(d,n);function d(T,y){var s;return s=n.call(this,y)||this,s._decryptdata=null,s.rawProgramDateTime=null,s.programDateTime=null,s.tagList=[],s.duration=0,s.sn=0,s.levelkey=void 0,s.type=void 0,s.loader=null,s.level=-1,s.cc=0,s.startPTS=void 0,s.endPTS=void 0,s.appendedPTS=void 0,s.startDTS=void 0,s.endDTS=void 0,s.start=0,s.deltaPTS=void 0,s.maxStartPTS=void 0,s.minEndPTS=void 0,s.stats=new a.LoadStats,s.urlId=0,s.data=void 0,s.bitrateTest=!1,s.title=null,s.initSegment=null,s.type=T,s}var g=d.prototype;return g.createInitializationVector=function(y){for(var s=new Uint8Array(16),M=12;M<16;M++)s[M]=y>>8*(15-M)&255;return s},g.setDecryptDataFromLevelKey=function(y,s){var M=y;return(y==null?void 0:y.method)==="AES-128"&&y.uri&&!y.iv&&(M=c.LevelKey.fromURI(y.uri),M.method=y.method,M.iv=this.createInitializationVector(s),M.keyFormat="identity"),M},g.setElementaryStreamInfo=function(y,s,M,A,x,E){E===void 0&&(E=!1);var w=this.elementaryStreams,_=w[y];if(!_){w[y]={startPTS:s,endPTS:M,startDTS:A,endDTS:x,partial:E};return}_.startPTS=Math.min(_.startPTS,s),_.endPTS=Math.max(_.endPTS,M),_.startDTS=Math.min(_.startDTS,A),_.endDTS=Math.max(_.endDTS,x)},g.clearElementaryStreamInfo=function(){var y=this.elementaryStreams;y[f.AUDIO]=null,y[f.VIDEO]=null,y[f.AUDIOVIDEO]=null},p(d,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var y=this.sn;typeof y!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&C.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),y=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,y)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(R.isFiniteNumber)(this.programDateTime))return null;var y=Object(R.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+y*1e3}},{key:"encrypted",get:function(){var y;return!!((y=this.decryptdata)!==null&&y!==void 0&&y.keyFormat&&this.decryptdata.uri)}}]),d}(b),m=function(n){i(d,n);function d(g,T,y,s,M){var A;A=n.call(this,y)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new a.LoadStats,A.duration=g.decimalFloatingPoint("DURATION"),A.gap=g.bool("GAP"),A.independent=g.bool("INDEPENDENT"),A.relurl=g.enumeratedString("URI"),A.fragment=T,A.index=s;var x=g.enumeratedString("BYTERANGE");return x&&A.setByteRange(x,M),M&&(A.fragOffset=M.fragOffset+M.duration),A}return p(d,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var T=this.elementaryStreams;return!!(T.audio||T.video||T.audiovideo)}}]),d}(b)},"./src/loader/key-loader.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return C});var R=S("./src/events.ts"),h=S("./src/errors.ts"),o=S("./src/utils/logger.ts"),C=function(){function c(i){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=i,this._registerListeners()}var a=c.prototype;return a._registerListeners=function(){this.hls.on(R.Events.KEY_LOADING,this.onKeyLoading,this)},a._unregisterListeners=function(){this.hls.off(R.Events.KEY_LOADING,this.onKeyLoading)},a.destroy=function(){this._unregisterListeners();for(var r in this.loaders){var l=this.loaders[r];l&&l.destroy()}this.loaders={}},a.onKeyLoading=function(r,l){var p=l.frag,f=p.type,b=this.loaders[f];if(!p.decryptdata){o.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var v=p.decryptdata.uri;if(v!==this.decrypturl||this.decryptkey===null){var m=this.hls.config;if(b&&(o.logger.warn("abort previous key loader for type:"+f),b.abort()),!v){o.logger.warn("key uri is falsy");return}var n=m.loader,d=p.loader=this.loaders[f]=new n(m);this.decrypturl=v,this.decryptkey=null;var g={url:v,frag:p,responseType:"arraybuffer"},T={timeout:m.fragLoadingTimeOut,maxRetry:0,retryDelay:m.fragLoadingRetryDelay,maxRetryDelay:m.fragLoadingMaxRetryTimeout,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};d.load(g,T,y)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(R.Events.KEY_LOADED,{frag:p}))},a.loadsuccess=function(r,l,p){var f=p.frag;if(!f.decryptdata){o.logger.error("after key load, decryptdata unset");return}this.decryptkey=f.decryptdata.key=new Uint8Array(r.data),f.loader=null,delete this.loaders[f.type],this.hls.trigger(R.Events.KEY_LOADED,{frag:f})},a.loaderror=function(r,l){var p=l.frag,f=p.loader;f&&f.abort(),delete this.loaders[p.type],this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:r})},a.loadtimeout=function(r,l){var p=l.frag,f=p.loader;f&&f.abort(),delete this.loaders[p.type],this.hls.trigger(R.Events.ERROR,{type:h.ErrorTypes.NETWORK_ERROR,details:h.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},c}()},"./src/loader/level-details.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"LevelDetails",function(){return c});var R=S("./src/polyfills/number.ts");function h(a,i){for(var r=0;r<i.length;r++){var l=i[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}function o(a,i,r){return i&&h(a.prototype,i),r&&h(a,r),a}var C=10,c=function(){function a(r){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=r}var i=a.prototype;return i.reloaded=function(l){if(!l){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-l.lastPartSn,f=this.lastPartIndex-l.lastPartIndex;this.updated=this.endSN!==l.endSN||!!f||!!p,this.advanced=this.endSN>l.endSN||p>0||p===0&&f>0,this.updated||this.advanced?this.misses=Math.floor(l.misses*.6):this.misses=l.misses+1,this.availabilityDelay=l.availabilityDelay},o(a,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(R.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||C}},{key:"drift",get:function(){var l=this.driftEndTime-this.driftStartTime;if(l>0){var p=this.driftEnd-this.driftStart;return p*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}}]),a}()},"./src/loader/level-key.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"LevelKey",function(){return c});var R=S("./node_modules/url-toolkit/src/url-toolkit.js"),h=S.n(R);function o(a,i){for(var r=0;r<i.length;r++){var l=i[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}function C(a,i,r){return i&&o(a.prototype,i),r&&o(a,r),a}var c=function(){a.fromURL=function(r,l){return new a(r,l)},a.fromURI=function(r){return new a(r)};function a(i,r){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,r?this._uri=Object(R.buildAbsoluteURL)(i,r,{alwaysNormalize:!0}):this._uri=i}return C(a,[{key:"uri",get:function(){return this._uri}}]),a}()},"./src/loader/load-stats.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"LoadStats",function(){return R});var R=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(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return d});var R=S("./src/polyfills/number.ts"),h=S("./node_modules/url-toolkit/src/url-toolkit.js"),o=S.n(h),C=S("./src/loader/fragment.ts"),c=S("./src/loader/level-details.ts"),a=S("./src/loader/level-key.ts"),i=S("./src/utils/attr-list.ts"),r=S("./src/utils/logger.ts"),l=S("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,f=/#EXT-X-MEDIA:(.*)/g,b=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),v=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("|")),m=/\.(mp4|m4s|m4v|m4a)$/i;function n(M){var A,x;return m.test((A=(x=h.parseURL(M))===null||x===void 0?void 0:x.path)!=null?A:"")}var d=function(){function M(){}return M.findGroup=function(x,E){for(var w=0;w<x.length;w++){var _=x[w];if(_.id===E)return _}},M.convertAVC1ToAVCOTI=function(x){var E=x.split(".");if(E.length>2){var w=E.shift()+".";return w+=parseInt(E.shift()).toString(16),w+=("000"+parseInt(E.shift()).toString(16)).substr(-4),w}return x},M.resolve=function(x,E){return h.buildAbsoluteURL(E,x,{alwaysNormalize:!0})},M.parseMasterPlaylist=function(x,E){var w=[],_={},N=!1;p.lastIndex=0;for(var j;(j=p.exec(x))!=null;)if(j[1]){var k=new i.AttrList(j[1]),z={attrs:k,bitrate:k.decimalInteger("AVERAGE-BANDWIDTH")||k.decimalInteger("BANDWIDTH"),name:k.NAME,url:M.resolve(j[2],E)},H=k.decimalResolution("RESOLUTION");H&&(z.width=H.width,z.height=H.height),g((k.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),z),z.videoCodec&&z.videoCodec.indexOf("avc1")!==-1&&(z.videoCodec=M.convertAVC1ToAVCOTI(z.videoCodec)),w.push(z)}else if(j[3]){var F=new i.AttrList(j[3]);F["DATA-ID"]&&(N=!0,_[F["DATA-ID"]]=F)}return{levels:w,sessionData:N?_:null}},M.parseMasterPlaylistMedia=function(x,E,w,_){_===void 0&&(_=[]);var N,j=[],k=0;for(f.lastIndex=0;(N=f.exec(x))!==null;){var z=new i.AttrList(N[1]);if(z.TYPE===w){var H={attrs:z,bitrate:0,id:k++,groupId:z["GROUP-ID"],instreamId:z["INSTREAM-ID"],name:z.NAME||z.LANGUAGE||"",type:w,default:z.bool("DEFAULT"),autoselect:z.bool("AUTOSELECT"),forced:z.bool("FORCED"),lang:z.LANGUAGE,url:z.URI?M.resolve(z.URI,E):""};if(_.length){var F=M.findGroup(_,H.groupId)||_[0];T(H,F,"audioCodec"),T(H,F,"textCodec")}j.push(H)}}return j},M.parseLevelPlaylist=function(x,E,w,_,N){var j=new c.LevelDetails(E),k=j.fragments,z=null,H=0,F=0,G=0,B=0,W=null,K=new C.Fragment(_,E),q,re,ee,Ce=-1,xe=!1;for(b.lastIndex=0,j.m3u8=x;(q=b.exec(x))!==null;){xe&&(xe=!1,K=new C.Fragment(_,E),K.start=G,K.sn=H,K.cc=B,K.level=w,z&&(K.initSegment=z,K.rawProgramDateTime=z.rawProgramDateTime));var he=q[1];if(he){K.duration=parseFloat(he);var ke=(" "+q[2]).slice(1);K.title=ke||null,K.tagList.push(ke?["INF",he,ke]:["INF",he])}else if(q[3])Object(R.isFiniteNumber)(K.duration)&&(K.start=G,ee&&(K.levelkey=ee),K.sn=H,K.level=w,K.cc=B,K.urlId=N,k.push(K),K.relurl=(" "+q[3]).slice(1),s(K,W),W=K,G+=K.duration,H++,F=0,xe=!0);else if(q[4]){var _e=(" "+q[4]).slice(1);W?K.setByteRange(_e,W):K.setByteRange(_e)}else if(q[5])K.rawProgramDateTime=(" "+q[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),Ce===-1&&(Ce=k.length);else{if(q=q[0].match(v),!q){r.logger.warn("No matches on slow regex match for level playlist!");continue}for(re=1;re<q.length&&!(typeof q[re]!="undefined");re++);var de=(" "+q[re]).slice(1),ce=(" "+q[re+1]).slice(1),ae=q[re+2]?(" "+q[re+2]).slice(1):"";switch(de){case"PLAYLIST-TYPE":j.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":H=j.startSN=parseInt(ce);break;case"SKIP":{var Se=new i.AttrList(ce),te=Se.decimalInteger("SKIPPED-SEGMENTS");if(Object(R.isFiniteNumber)(te)){j.skippedSegments=te;for(var ue=te;ue--;)k.unshift(null);H+=te}var Oe=Se.enumeratedString("RECENTLY-REMOVED-DATERANGES");Oe&&(j.recentlyRemovedDateranges=Oe.split(" "));break}case"TARGETDURATION":j.targetduration=parseFloat(ce);break;case"VERSION":j.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":j.live=!1;break;case"#":(ce||ae)&&K.tagList.push(ae?[ce,ae]:[ce]);break;case"DIS":B++;case"GAP":K.tagList.push([de]);break;case"BITRATE":K.tagList.push([de,ce]);break;case"DISCONTINUITY-SEQ":B=parseInt(ce);break;case"KEY":{var le,Q=new i.AttrList(ce),Y=Q.enumeratedString("METHOD"),Z=Q.URI,be=Q.hexadecimalInteger("IV"),ge=Q.enumeratedString("KEYFORMATVERSIONS"),De=Q.enumeratedString("KEYID"),Qe=(le=Q.enumeratedString("KEYFORMAT"))!=null?le:"identity",Ze=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ze.indexOf(Qe)>-1){r.logger.warn("Keyformat "+Qe+" is not supported from the manifest");continue}else if(Qe!=="identity")continue;Y&&(ee=a.LevelKey.fromURL(E,Z),Z&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Y)>=0&&(ee.method=Y,ee.keyFormat=Qe,De&&(ee.keyID=De),ge&&(ee.keyFormatVersions=ge),ee.iv=be));break}case"START":{var nt=new i.AttrList(ce),tt=nt.decimalFloatingPoint("TIME-OFFSET");Object(R.isFiniteNumber)(tt)&&(j.startTimeOffset=tt);break}case"MAP":{var lt=new i.AttrList(ce);K.relurl=lt.URI,lt.BYTERANGE&&K.setByteRange(lt.BYTERANGE),K.level=w,K.sn="initSegment",ee&&(K.levelkey=ee),K.initSegment=null,z=K,xe=!0;break}case"SERVER-CONTROL":{var st=new i.AttrList(ce);j.canBlockReload=st.bool("CAN-BLOCK-RELOAD"),j.canSkipUntil=st.optionalFloat("CAN-SKIP-UNTIL",0),j.canSkipDateRanges=j.canSkipUntil>0&&st.bool("CAN-SKIP-DATERANGES"),j.partHoldBack=st.optionalFloat("PART-HOLD-BACK",0),j.holdBack=st.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var je=new i.AttrList(ce);j.partTarget=je.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Re=j.partList;Re||(Re=j.partList=[]);var et=F>0?Re[Re.length-1]:void 0,ct=F++,$e=new C.Part(new i.AttrList(ce),K,E,ct,et);Re.push($e),K.duration+=$e.duration;break}case"PRELOAD-HINT":{var qe=new i.AttrList(ce);j.preloadHint=qe;break}case"RENDITION-REPORT":{var Ue=new i.AttrList(ce);j.renditionReports=j.renditionReports||[],j.renditionReports.push(Ue);break}default:r.logger.warn("line parsed but not handled: "+q);break}}}W&&!W.relurl?(k.pop(),G-=W.duration,j.partList&&(j.fragmentHint=W)):j.partList&&(s(K,W),K.cc=B,j.fragmentHint=K);var Me=k.length,Ie=k[0],ye=k[Me-1];if(G+=j.skippedSegments*j.targetduration,G>0&&Me&&ye){j.averagetargetduration=G/Me;var Te=ye.sn;j.endSN=Te!=="initSegment"?Te:0,Ie&&(j.startCC=Ie.cc,Ie.initSegment||j.fragments.every(function(Ae){return Ae.relurl&&n(Ae.relurl)})&&(r.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new C.Fragment(_,E),K.relurl=ye.relurl,K.level=w,K.sn="initSegment",Ie.initSegment=K,j.needSidxRanges=!0))}else j.endSN=0,j.startCC=0;return j.fragmentHint&&(G+=j.fragmentHint.duration),j.totalduration=G,j.endCC=B,Ce>0&&y(k,Ce),j},M}();function g(M,A){["video","audio","text"].forEach(function(x){var E=M.filter(function(_){return Object(l.isCodecType)(_,x)});if(E.length){var w=E.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});A[x+"Codec"]=w.length>0?w[0]:E[0],M=M.filter(function(_){return E.indexOf(_)===-1})}}),A.unknownCodecs=M}function T(M,A,x){var E=A[x];E&&(M[x]=E)}function y(M,A){for(var x=M[A],E=A;E--;){var w=M[E];if(!w)return;w.programDateTime=x.programDateTime-w.duration*1e3,x=w}}function s(M,A){M.rawProgramDateTime?M.programDateTime=Date.parse(M.rawProgramDateTime):A!=null&&A.programDateTime&&(M.programDateTime=A.endProgramDateTime),Object(R.isFiniteNumber)(M.programDateTime)||(M.programDateTime=null,M.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/polyfills/number.ts"),h=S("./src/events.ts"),o=S("./src/errors.ts"),C=S("./src/utils/logger.ts"),c=S("./src/utils/mp4-tools.ts"),a=S("./src/loader/m3u8-parser.ts"),i=S("./src/types/loader.ts"),r=S("./src/utils/attr-list.ts");function l(b){var v=b.type;switch(v){case i.PlaylistContextType.AUDIO_TRACK:return i.PlaylistLevelType.AUDIO;case i.PlaylistContextType.SUBTITLE_TRACK:return i.PlaylistLevelType.SUBTITLE;default:return i.PlaylistLevelType.MAIN}}function p(b,v){var m=b.url;return(m===void 0||m.indexOf("data:")===0)&&(m=v.url),m}var f=function(){function b(m){this.hls=void 0,this.loaders=Object.create(null),this.hls=m,this.registerListeners()}var v=b.prototype;return v.registerListeners=function(){var n=this.hls;n.on(h.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(h.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(h.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(h.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},v.unregisterListeners=function(){var n=this.hls;n.off(h.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(h.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(h.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(h.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},v.createInternalLoader=function(n){var d=this.hls.config,g=d.pLoader,T=d.loader,y=g||T,s=new y(d);return n.loader=s,this.loaders[n.type]=s,s},v.getInternalLoader=function(n){return this.loaders[n.type]},v.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},v.destroyInternalLoaders=function(){for(var n in this.loaders){var d=this.loaders[n];d&&d.destroy(),this.resetInternalLoader(n)}},v.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},v.onManifestLoading=function(n,d){var g=d.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:i.PlaylistContextType.MANIFEST,url:g,deliveryDirectives:null})},v.onLevelLoading=function(n,d){var g=d.id,T=d.level,y=d.url,s=d.deliveryDirectives;this.load({id:g,groupId:null,level:T,responseType:"text",type:i.PlaylistContextType.LEVEL,url:y,deliveryDirectives:s})},v.onAudioTrackLoading=function(n,d){var g=d.id,T=d.groupId,y=d.url,s=d.deliveryDirectives;this.load({id:g,groupId:T,level:null,responseType:"text",type:i.PlaylistContextType.AUDIO_TRACK,url:y,deliveryDirectives:s})},v.onSubtitleTrackLoading=function(n,d){var g=d.id,T=d.groupId,y=d.url,s=d.deliveryDirectives;this.load({id:g,groupId:T,level:null,responseType:"text",type:i.PlaylistContextType.SUBTITLE_TRACK,url:y,deliveryDirectives:s})},v.load=function(n){var d,g=this.hls.config,T=this.getInternalLoader(n);if(T){var y=T.context;if(y&&y.url===n.url){C.logger.trace("[playlist-loader]: playlist request ongoing");return}C.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),T.abort()}var s,M,A,x;switch(n.type){case i.PlaylistContextType.MANIFEST:s=g.manifestLoadingMaxRetry,M=g.manifestLoadingTimeOut,A=g.manifestLoadingRetryDelay,x=g.manifestLoadingMaxRetryTimeout;break;case i.PlaylistContextType.LEVEL:case i.PlaylistContextType.AUDIO_TRACK:case i.PlaylistContextType.SUBTITLE_TRACK:s=0,M=g.levelLoadingTimeOut;break;default:s=g.levelLoadingMaxRetry,M=g.levelLoadingTimeOut,A=g.levelLoadingRetryDelay,x=g.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(n),(d=n.deliveryDirectives)!==null&&d!==void 0&&d.part){var E;if(n.type===i.PlaylistContextType.LEVEL&&n.level!==null?E=this.hls.levels[n.level].details:n.type===i.PlaylistContextType.AUDIO_TRACK&&n.id!==null?E=this.hls.audioTracks[n.id].details:n.type===i.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(E=this.hls.subtitleTracks[n.id].details),E){var w=E.partTarget,_=E.targetduration;w&&_&&(M=Math.min(Math.max(w*3,_*.8)*1e3,M))}}var N={timeout:M,maxRetry:s,retryDelay:A,maxRetryDelay:x,highWaterMark:0},j={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(n,N,j)},v.loadsuccess=function(n,d,g,T){if(T===void 0&&(T=null),g.isSidxRequest){this.handleSidxRequest(n,g),this.handlePlaylistLoaded(n,d,g,T);return}this.resetInternalLoader(g.type);var y=n.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,g,"no EXTM3U delimiter",T);return}d.parsing.start=performance.now(),y.indexOf("#EXTINF:")>0||y.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,d,g,T):this.handleMasterPlaylist(n,d,g,T)},v.loaderror=function(n,d,g){g===void 0&&(g=null),this.handleNetworkError(d,g,!1,n)},v.loadtimeout=function(n,d,g){g===void 0&&(g=null),this.handleNetworkError(d,g,!0)},v.handleMasterPlaylist=function(n,d,g,T){var y=this.hls,s=n.data,M=p(n,g),A=a.default.parseMasterPlaylist(s,M),x=A.levels,E=A.sessionData;if(!x.length){this.handleManifestParsingError(n,g,"no level found in manifest",T);return}var w=x.map(function(H){return{id:H.attrs.AUDIO,audioCodec:H.audioCodec}}),_=x.map(function(H){return{id:H.attrs.SUBTITLES,textCodec:H.textCodec}}),N=a.default.parseMasterPlaylistMedia(s,M,"AUDIO",w),j=a.default.parseMasterPlaylistMedia(s,M,"SUBTITLES",_),k=a.default.parseMasterPlaylistMedia(s,M,"CLOSED-CAPTIONS");if(N.length){var z=N.some(function(H){return!H.url});!z&&x[0].audioCodec&&!x[0].attrs.AUDIO&&(C.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),N.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new r.AttrList({}),bitrate:0,url:""}))}y.trigger(h.Events.MANIFEST_LOADED,{levels:x,audioTracks:N,subtitles:j,captions:k,url:M,stats:d,networkDetails:T,sessionData:E})},v.handleTrackOrLevelPlaylist=function(n,d,g,T){var y=this.hls,s=g.id,M=g.level,A=g.type,x=p(n,g),E=Object(R.isFiniteNumber)(s)?s:0,w=Object(R.isFiniteNumber)(M)?M:E,_=l(g),N=a.default.parseLevelPlaylist(n.data,x,w,_,E);if(!N.fragments.length){y.trigger(h.Events.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:x,reason:"no fragments found in level",level:typeof g.level=="number"?g.level:void 0});return}if(A===i.PlaylistContextType.MANIFEST){var j={attrs:new r.AttrList({}),bitrate:0,details:N,name:"",url:x};y.trigger(h.Events.MANIFEST_LOADED,{levels:[j],audioTracks:[],url:x,stats:d,networkDetails:T,sessionData:null})}if(d.parsing.end=performance.now(),N.needSidxRanges){var k,z=(k=N.fragments[0].initSegment)===null||k===void 0?void 0:k.url;this.load({url:z,isSidxRequest:!0,type:A,level:M,levelDetails:N,id:s,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}g.levelDetails=N,this.handlePlaylistLoaded(n,d,g,T)},v.handleSidxRequest=function(n,d){var g=Object(c.parseSegmentIndex)(new Uint8Array(n.data));if(!g)return;var T=g.references,y=d.levelDetails;T.forEach(function(s,M){var A=s.info,x=y.fragments[M];x.byteRange.length===0&&x.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),x.initSegment&&x.initSegment.setByteRange(String(g.moovEndOffset)+"@0")})},v.handleManifestParsingError=function(n,d,g,T){this.hls.trigger(h.Events.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:d.type===i.PlaylistContextType.MANIFEST,url:n.url,reason:g,response:n,context:d,networkDetails:T})},v.handleNetworkError=function(n,d,g,T){g===void 0&&(g=!1),C.logger.warn("[playlist-loader]: A network "+(g?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var y=o.ErrorDetails.UNKNOWN,s=!1,M=this.getInternalLoader(n);switch(n.type){case i.PlaylistContextType.MANIFEST:y=g?o.ErrorDetails.MANIFEST_LOAD_TIMEOUT:o.ErrorDetails.MANIFEST_LOAD_ERROR,s=!0;break;case i.PlaylistContextType.LEVEL:y=g?o.ErrorDetails.LEVEL_LOAD_TIMEOUT:o.ErrorDetails.LEVEL_LOAD_ERROR,s=!1;break;case i.PlaylistContextType.AUDIO_TRACK:y=g?o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,s=!1;break;case i.PlaylistContextType.SUBTITLE_TRACK:y=g?o.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:o.ErrorDetails.SUBTITLE_LOAD_ERROR,s=!1;break}M&&this.resetInternalLoader(n.type);var A={type:o.ErrorTypes.NETWORK_ERROR,details:y,fatal:s,url:n.url,loader:M,context:n,networkDetails:d};T&&(A.response=T),this.hls.trigger(h.Events.ERROR,A)},v.handlePlaylistLoaded=function(n,d,g,T){var y=g.type,s=g.level,M=g.id,A=g.groupId,x=g.loader,E=g.levelDetails,w=g.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(n,g,"invalid target duration",T);return}if(!x)return;E.live&&(x.getCacheAge&&(E.ageHeader=x.getCacheAge()||0),(!x.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(y){case i.PlaylistContextType.MANIFEST:case i.PlaylistContextType.LEVEL:this.hls.trigger(h.Events.LEVEL_LOADED,{details:E,level:s||0,id:M||0,stats:d,networkDetails:T,deliveryDirectives:w});break;case i.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(h.Events.AUDIO_TRACK_LOADED,{details:E,id:M||0,groupId:A||"",stats:d,networkDetails:T,deliveryDirectives:w});break;case i.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(h.Events.SUBTITLE_TRACK_LOADED,{details:E,id:M||0,groupId:A||"",stats:d,networkDetails:T,deliveryDirectives:w});break}},b}();u.default=f},"./src/polyfills/number.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"isFiniteNumber",function(){return R}),S.d(u,"MAX_SAFE_INTEGER",function(){return h});var R=Number.isFinite||function(o){return typeof o=="number"&&isFinite(o)},h=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(L,u,S){"use strict";S.r(u);var R=function(){function h(){}return h.getSilentFrame=function(C,c){switch(C){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},h}();u.default=R},"./src/remux/mp4-generator.ts":function(L,u,S){"use strict";S.r(u);var R=Math.pow(2,32)-1,h=function(){function o(){}return o.init=function(){o.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 o.types)o.types.hasOwnProperty(c)&&(o.types[c]=[c.charCodeAt(0),c.charCodeAt(1),c.charCodeAt(2),c.charCodeAt(3)]);var a=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]),i=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]);o.HDLR_TYPES={video:a,audio:i};var r=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]);o.STTS=o.STSC=o.STCO=l,o.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),o.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),o.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),o.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),f=new Uint8Array([97,118,99,49]),b=new Uint8Array([0,0,0,1]);o.FTYP=o.box(o.types.ftyp,p,b,p,f),o.DINF=o.box(o.types.dinf,o.box(o.types.dref,r))},o.box=function(c){for(var a=8,i=arguments.length,r=new Array(i>1?i-1:0),l=1;l<i;l++)r[l-1]=arguments[l];for(var p=r.length,f=p;p--;)a+=r[p].byteLength;var b=new Uint8Array(a);for(b[0]=a>>24&255,b[1]=a>>16&255,b[2]=a>>8&255,b[3]=a&255,b.set(c,4),p=0,a=8;p<f;p++)b.set(r[p],a),a+=r[p].byteLength;return b},o.hdlr=function(c){return o.box(o.types.hdlr,o.HDLR_TYPES[c])},o.mdat=function(c){return o.box(o.types.mdat,c)},o.mdhd=function(c,a){a*=c;var i=Math.floor(a/(R+1)),r=Math.floor(a%(R+1));return o.box(o.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,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))},o.mdia=function(c){return o.box(o.types.mdia,o.mdhd(c.timescale,c.duration),o.hdlr(c.type),o.minf(c))},o.mfhd=function(c){return o.box(o.types.mfhd,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255]))},o.minf=function(c){return c.type==="audio"?o.box(o.types.minf,o.box(o.types.smhd,o.SMHD),o.DINF,o.stbl(c)):o.box(o.types.minf,o.box(o.types.vmhd,o.VMHD),o.DINF,o.stbl(c))},o.moof=function(c,a,i){return o.box(o.types.moof,o.mfhd(c),o.traf(i,a))},o.moov=function(c){for(var a=c.length,i=[];a--;)i[a]=o.trak(c[a]);return o.box.apply(null,[o.types.moov,o.mvhd(c[0].timescale,c[0].duration)].concat(i).concat(o.mvex(c)))},o.mvex=function(c){for(var a=c.length,i=[];a--;)i[a]=o.trex(c[a]);return o.box.apply(null,[o.types.mvex].concat(i))},o.mvhd=function(c,a){a*=c;var i=Math.floor(a/(R+1)),r=Math.floor(a%(R+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,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&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 o.box(o.types.mvhd,l)},o.sdtp=function(c){var a=c.samples||[],i=new Uint8Array(4+a.length),r,l;for(r=0;r<a.length;r++)l=a[r].flags,i[r+4]=l.dependsOn<<4|l.isDependedOn<<2|l.hasRedundancy;return o.box(o.types.sdtp,i)},o.stbl=function(c){return o.box(o.types.stbl,o.stsd(c),o.box(o.types.stts,o.STTS),o.box(o.types.stsc,o.STSC),o.box(o.types.stsz,o.STSZ),o.box(o.types.stco,o.STCO))},o.avc1=function(c){var a=[],i=[],r,l,p;for(r=0;r<c.sps.length;r++)l=c.sps[r],p=l.byteLength,a.push(p>>>8&255),a.push(p&255),a=a.concat(Array.prototype.slice.call(l));for(r=0;r<c.pps.length;r++)l=c.pps[r],p=l.byteLength,i.push(p>>>8&255),i.push(p&255),i=i.concat(Array.prototype.slice.call(l));var f=o.box(o.types.avcC,new Uint8Array([1,a[3],a[4],a[5],252|3,224|c.sps.length].concat(a).concat([c.pps.length]).concat(i))),b=c.width,v=c.height,m=c.pixelRatio[0],n=c.pixelRatio[1];return o.box(o.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,b>>8&255,b&255,v>>8&255,v&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]),f,o.box(o.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),o.box(o.types.pasp,new Uint8Array([m>>24,m>>16&255,m>>8&255,m&255,n>>24,n>>16&255,n>>8&255,n&255])))},o.esds=function(c){var a=c.config.length;return new Uint8Array([0,0,0,0,3,23+a,0,1,0,4,15+a,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([a]).concat(c.config).concat([6,1,2]))},o.mp4a=function(c){var a=c.samplerate;return o.box(o.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,a>>8&255,a&255,0,0]),o.box(o.types.esds,o.esds(c)))},o.mp3=function(c){var a=c.samplerate;return o.box(o.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,a>>8&255,a&255,0,0]))},o.stsd=function(c){return c.type==="audio"?!c.isAAC&&c.codec==="mp3"?o.box(o.types.stsd,o.STSD,o.mp3(c)):o.box(o.types.stsd,o.STSD,o.mp4a(c)):o.box(o.types.stsd,o.STSD,o.avc1(c))},o.tkhd=function(c){var a=c.id,i=c.duration*c.timescale,r=c.width,l=c.height,p=Math.floor(i/(R+1)),f=Math.floor(i%(R+1));return o.box(o.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,a>>24&255,a>>16&255,a>>8&255,a&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,f>>24,f>>16&255,f>>8&255,f&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,r>>8&255,r&255,0,0,l>>8&255,l&255,0,0]))},o.traf=function(c,a){var i=o.sdtp(c),r=c.id,l=Math.floor(a/(R+1)),p=Math.floor(a%(R+1));return o.box(o.types.traf,o.box(o.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),o.box(o.types.tfdt,new Uint8Array([1,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,p>>24,p>>16&255,p>>8&255,p&255])),o.trun(c,i.length+16+20+8+16+8+8),i)},o.trak=function(c){return c.duration=c.duration||4294967295,o.box(o.types.trak,o.tkhd(c),o.mdia(c))},o.trex=function(c){var a=c.id;return o.box(o.types.trex,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},o.trun=function(c,a){var i=c.samples||[],r=i.length,l=12+16*r,p=new Uint8Array(l),f,b,v,m,n,d;for(a+=8+l,p.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255],0),f=0;f<r;f++)b=i[f],v=b.duration,m=b.size,n=b.flags,d=b.cts,p.set([v>>>24&255,v>>>16&255,v>>>8&255,v&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*f);return o.box(o.types.trun,p)},o.initSegment=function(c){o.types||o.init();var a=o.moov(c),i=new Uint8Array(o.FTYP.byteLength+a.byteLength);return i.set(o.FTYP),i.set(a,o.FTYP.byteLength),i},o}();h.types=void 0,h.HDLR_TYPES=void 0,h.STTS=void 0,h.STSC=void 0,h.STCO=void 0,h.STSZ=void 0,h.VMHD=void 0,h.SMHD=void 0,h.STSD=void 0,h.FTYP=void 0,h.DINF=void 0,u.default=h},"./src/remux/mp4-remuxer.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return d}),S.d(u,"normalizePts",function(){return g});var R=S("./src/polyfills/number.ts"),h=S("./src/remux/aac-helper.ts"),o=S("./src/remux/mp4-generator.ts"),C=S("./src/events.ts"),c=S("./src/errors.ts"),a=S("./src/utils/logger.ts"),i=S("./src/types/loader.ts"),r=S("./src/utils/timescale-conversion.ts");function l(){return l=Object.assign||function(M){for(var A=1;A<arguments.length;A++){var x=arguments[A];for(var E in x)Object.prototype.hasOwnProperty.call(x,E)&&(M[E]=x[E])}return M},l.apply(this,arguments)}var p=10*1e3,f=1024,b=1152,v=null,m=null,n=!1,d=function(){function M(x,E,w,_){if(_===void 0&&(_=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=x,this.config=E,this.typeSupported=w,this.ISGenerated=!1,v===null){var N=navigator.userAgent||"",j=N.match(/Chrome\/(\d+)/i);v=j?parseInt(j[1]):0}if(m===null){var k=navigator.userAgent.match(/Safari\/(\d+)/i);m=k?parseInt(k[1]):0}n=!!v&&v<75||!!m&&m<600}var A=M.prototype;return A.destroy=function(){},A.resetTimeStamp=function(E){a.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},A.resetNextTimestamp=function(){a.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){a.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(E){var w=!1,_=E.reduce(function(N,j){var k=j.pts-N;return k<-4294967296?(w=!0,g(N,j.pts)):k>0?N:j.pts},E[0].pts);return w&&a.logger.debug("PTS rollover detected"),_},A.remux=function(E,w,_,N,j,k,z,H){var F,G,B,W,K,q,re=j,ee=j,Ce=E.pid>-1,xe=w.pid>-1,he=w.samples.length,ke=E.samples.length>0,_e=he>1,de=(!Ce||ke)&&(!xe||_e)||this.ISGenerated||z;if(de){this.ISGenerated||(B=this.generateIS(E,w,j));var ce=this.isVideoContiguous,ae=-1;if(_e&&(ae=T(w.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if(q=!0,ae>0){a.logger.warn("[mp4-remuxer]: Dropped "+ae+" out of "+he+" video samples due to a missing keyframe");var Se=this.getVideoStartPts(w.samples);w.samples=w.samples.slice(ae),w.dropped+=ae,ee+=(w.samples[0].pts-Se)/(w.timescale||9e4)}else ae===-1&&(a.logger.warn("[mp4-remuxer]: No keyframe found out of "+he+" video samples"),q=!1);if(this.ISGenerated){if(ke&&_e){var te=this.getVideoStartPts(w.samples),ue=g(E.samples[0].pts,te)-te,Oe=ue/w.inputTimeScale;re+=Math.max(0,Oe),ee+=Math.max(0,-Oe)}if(ke){if(E.samplerate||(a.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(E,w,j)),G=this.remuxAudio(E,re,this.isAudioContiguous,k,xe||_e||H===i.PlaylistLevelType.AUDIO?ee:void 0),_e){var le=G?G.endPTS-G.startPTS:0;w.inputTimeScale||(a.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(E,w,j)),F=this.remuxVideo(w,ee,ce,le)}}else _e&&(F=this.remuxVideo(w,ee,ce,0));F&&(F.firstKeyFrame=ae,F.independent=ae!==-1)}}return this.ISGenerated&&(_.samples.length&&(K=this.remuxID3(_,j)),N.samples.length&&(W=this.remuxText(N,j))),{audio:G,video:F,initSegment:B,independent:q,text:W,id3:K}},A.generateIS=function(E,w,_){var N=E.samples,j=w.samples,k=this.typeSupported,z={},H=!Object(R.isFiniteNumber)(this._initPTS),F="audio/mp4",G,B,W;if(H&&(G=B=Infinity),E.config&&N.length&&(E.timescale=E.samplerate,E.isAAC||(k.mpeg?(F="audio/mpeg",E.codec=""):k.mp3&&(E.codec="mp3")),z.audio={id:"audio",container:F,codec:E.codec,initSegment:!E.isAAC&&k.mpeg?new Uint8Array(0):o.default.initSegment([E]),metadata:{channelCount:E.channelCount}},H&&(W=E.inputTimeScale,G=B=N[0].pts-Math.round(W*_))),w.sps&&w.pps&&j.length&&(w.timescale=w.inputTimeScale,z.video={id:"main",container:"video/mp4",codec:w.codec,initSegment:o.default.initSegment([w]),metadata:{width:w.width,height:w.height}},H)){W=w.inputTimeScale;var K=this.getVideoStartPts(j),q=Math.round(W*_);B=Math.min(B,g(j[0].dts,K)-q),G=Math.min(G,K-q)}if(Object.keys(z).length)return this.ISGenerated=!0,H&&(this._initPTS=G,this._initDTS=B),{tracks:z,initPTS:G,timescale:W}},A.remuxVideo=function(E,w,_,N){var j=E.inputTimeScale,k=E.samples,z=[],H=k.length,F=this._initPTS,G=this.nextAvcDts,B=8,W,K,q,re=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,Ce=0,xe=!1;if(!_||G===null){var he=w*j,ke=k[0].pts-g(k[0].dts,k[0].pts);G=he-ke}for(var _e=0;_e<H;_e++){var de=k[_e];if(de.pts=g(de.pts-F,G),de.dts=g(de.dts-F,G),de.dts>de.pts){var ce=9e4*.2;Ce=Math.max(Math.min(Ce,de.pts-de.dts),-1*ce)}de.dts<k[_e>0?_e-1:_e].dts&&(xe=!0)}xe&&k.sort(function(At,Ot){var bt=At.dts-Ot.dts,Vt=At.pts-Ot.pts;return bt||Vt}),K=k[0].dts,q=k[k.length-1].dts;var ae=Math.round((q-K)/(H-1));if(Ce<0){if(Ce<ae*-2){a.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(r.toMsFromMpegTsClock)(-ae,!0)+" ms");for(var Se=Ce,te=0;te<H;te++)k[te].dts=Se=Math.max(Se,k[te].pts-ae),k[te].pts=Math.max(Se,k[te].pts)}else{a.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(r.toMsFromMpegTsClock)(Ce,!0)+" ms to overcome this issue");for(var ue=0;ue<H;ue++)k[ue].dts=k[ue].dts+Ce}K=k[0].dts}if(_){var Oe=K-G,le=Oe>ae,Q=Oe<-1;if(le||Q){le?a.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(Oe,!0)+" ms ("+Oe+"dts) hole between fragments detected, filling it"):a.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(-Oe,!0)+" ms ("+Oe+"dts) overlapping between fragments detected"),K=G;var Y=k[0].pts-Oe;k[0].dts=K,k[0].pts=Y,a.logger.log("Video: First PTS/DTS adjusted: "+Object(r.toMsFromMpegTsClock)(Y,!0)+"/"+Object(r.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(r.toMsFromMpegTsClock)(Oe,!0)+" ms")}}n&&(K=Math.max(0,K));for(var Z=0,be=0,ge=0;ge<H;ge++){for(var De=k[ge],Qe=De.units,Ze=Qe.length,nt=0,tt=0;tt<Ze;tt++)nt+=Qe[tt].data.length;be+=nt,Z+=Ze,De.length=nt,De.dts=Math.max(De.dts,K),De.pts=Math.max(De.pts,De.dts,0),re=Math.min(De.pts,re),ee=Math.max(De.pts,ee)}q=k[H-1].dts;var lt=be+4*Z+8,st;try{st=new Uint8Array(lt)}catch(At){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:c.ErrorTypes.MUX_ERROR,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:lt,reason:"fail allocating video mdat "+lt});return}var je=new DataView(st.buffer);je.setUint32(0,lt),st.set(o.default.types.mdat,4);for(var Re=0;Re<H;Re++){for(var et=k[Re],ct=et.units,$e=0,qe=0,Ue=ct.length;qe<Ue;qe++){var Me=ct[qe],Ie=Me.data,ye=Me.data.byteLength;je.setUint32(B,ye),B+=4,st.set(Ie,B),B+=ye,$e+=4+ye}if(Re<H-1)W=k[Re+1].dts-et.dts;else{var Te=this.config,Ae=et.dts-k[Re>0?Re-1:Re].dts;if(Te.stretchShortVideoTrack&&this.nextAudioPts!==null){var Pe=Math.floor(Te.maxBufferHole*j),Xe=(N?re+N*j:this.nextAudioPts)-et.pts;Xe>Pe?(W=Xe-Ae,W<0&&(W=Ae),a.logger.log("[mp4-remuxer]: It is approximately "+Xe/90+" ms to the next segment; using duration "+W/90+" ms for the last video frame.")):W=Ae}else W=Ae}var rt=Math.round(et.pts-et.dts);z.push(new y(et.key,W,$e,rt))}if(z.length&&v&&v<70){var ft=z[0].flags;ft.dependsOn=2,ft.isNonSync=0}console.assert(W!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=q+W,this.isVideoContiguous=!0;var St=o.default.moof(E.sequenceNumber++,K,l({},E,{samples:z})),Pt="video",dt={data1:St,data2:st,startPTS:re/j,endPTS:(ee+W)/j,startDTS:K/j,endDTS:G/j,type:Pt,hasAudio:!1,hasVideo:!0,nb:z.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(st.length,"MDAT length must not be zero"),dt},A.remuxAudio=function(E,w,_,N,j){var k=E.inputTimeScale,z=E.samplerate?E.samplerate:k,H=k/z,F=E.isAAC?f:b,G=F*H,B=this._initPTS,W=!E.isAAC&&this.typeSupported.mpeg,K=[],q=E.samples,re=W?0:8,ee=this.nextAudioPts||-1,Ce=w*k;if(this.isAudioContiguous=_=_||q.length&&ee>0&&(N&&Math.abs(Ce-ee)<9e3||Math.abs(g(q[0].pts-B,Ce)-ee)<20*G),q.forEach(function(Ie){Ie.pts=g(Ie.pts-B,Ce)}),!_||ee<0){if(q=q.filter(function(Ie){return Ie.pts>=0}),!q.length)return;j===0?ee=0:N?ee=Math.max(0,Ce):ee=q[0].pts}if(E.isAAC)for(var xe=j!==void 0,he=this.config.maxAudioFramesDrift,ke=0,_e=ee;ke<q.length;ke++){var de=q[ke],ce=de.pts,ae=ce-_e,Se=Math.abs(1e3*ae/k);if(ae<=-he*G&&xe)ke===0&&(a.logger.warn("Audio frame @ "+(ce/k).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ae/k)+" ms."),this.nextAudioPts=ee=_e=ce);else if(ae>=he*G&&Se<p&&xe){var te=Math.round(ae/G);_e=ce-te*G,_e<0&&(te--,_e+=G),ke===0&&(this.nextAudioPts=ee=_e),a.logger.warn("[mp4-remuxer]: Injecting "+te+" audio frame @ "+(_e/k).toFixed(3)+"s due to "+Math.round(1e3*ae/k)+" ms gap.");for(var ue=0;ue<te;ue++){var Oe=Math.max(_e,0),le=h.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);le||(a.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),le=de.unit.subarray()),q.splice(ke,0,{unit:le,pts:Oe}),_e+=G,ke++}}de.pts=_e,_e+=G}for(var Q=null,Y=null,Z,be=0,ge=q.length;ge--;)be+=q[ge].unit.byteLength;for(var De=0,Qe=q.length;De<Qe;De++){var Ze=q[De],nt=Ze.unit,tt=Ze.pts;if(Y!==null){var lt=K[De-1];lt.duration=Math.round((tt-Y)/H)}else if(_&&E.isAAC&&(tt=ee),Q=tt,be>0){be+=re;try{Z=new Uint8Array(be)}catch(Ie){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:c.ErrorTypes.MUX_ERROR,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:be,reason:"fail allocating audio mdat "+be});return}if(!W){var st=new DataView(Z.buffer);st.setUint32(0,be),Z.set(o.default.types.mdat,4)}}else return;Z.set(nt,re);var je=nt.byteLength;re+=je,K.push(new y(!0,F,je,0)),Y=tt}var Re=K.length;if(!Re)return;var et=K[K.length-1];this.nextAudioPts=ee=Y+H*et.duration;var ct=W?new Uint8Array(0):o.default.moof(E.sequenceNumber++,Q/H,l({},E,{samples:K}));E.samples=[];var $e=Q/k,qe=ee/k,Ue="audio",Me={data1:ct,data2:Z,startPTS:$e,endPTS:qe,startDTS:$e,endDTS:qe,type:Ue,hasAudio:!0,hasVideo:!1,nb:Re};return this.isAudioContiguous=!0,console.assert(Z.length,"MDAT length must not be zero"),Me},A.remuxEmptyAudio=function(E,w,_,N){var j=E.inputTimeScale,k=E.samplerate?E.samplerate:j,z=j/k,H=this.nextAudioPts,F=(H!==null?H:N.startDTS*j)+this._initDTS,G=N.endDTS*j+this._initDTS,B=z*f,W=Math.ceil((G-F)/B),K=h.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(a.logger.warn("[mp4-remuxer]: remux empty Audio"),!K){a.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var q=[],re=0;re<W;re++){var ee=F+re*B;q.push({unit:K,pts:ee,dts:ee})}return E.samples=q,this.remuxAudio(E,w,_,!1)},A.remuxID3=function(E,w){var _=E.samples.length;if(!_)return;for(var N=E.inputTimeScale,j=this._initPTS,k=this._initDTS,z=0;z<_;z++){var H=E.samples[z];H.pts=g(H.pts-j,w*N)/N,H.dts=g(H.dts-k,w*N)/N}var F=E.samples;return E.samples=[],{samples:F}},A.remuxText=function(E,w){var _=E.samples.length;if(!_)return;for(var N=E.inputTimeScale,j=this._initPTS,k=0;k<_;k++){var z=E.samples[k];z.pts=g(z.pts-j,w*N)/N}E.samples.sort(function(F,G){return F.pts-G.pts});var H=E.samples;return E.samples=[],{samples:H}},M}();function g(M,A){var x;if(A===null)return M;for(A<M?x=-8589934592:x=8589934592;Math.abs(M-A)>4294967296;)M+=x;return M}function T(M){for(var A=0;A<M.length;A++)if(M[A].key)return A;return-1}var y=function(A,x,E,w){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=x,this.size=E,this.cts=w,this.flags=new s(A)},s=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/polyfills/number.ts"),h=S("./src/utils/mp4-tools.ts"),o=S("./src/loader/fragment.ts"),C=S("./src/utils/logger.ts"),c=function(){function r(){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=r.prototype;return l.destroy=function(){},l.resetTimeStamp=function(f){this.initPTS=f,this.lastEndDTS=null},l.resetNextTimestamp=function(){this.lastEndDTS=null},l.resetInitSegment=function(f,b,v){this.audioCodec=b,this.videoCodec=v,this.generateInitSegment(f),this.emitInitSegment=!0},l.generateInitSegment=function(f){var b=this.audioCodec,v=this.videoCodec;if(!f||!f.byteLength){this.initTracks=void 0,this.initData=void 0;return}var m=this.initData=Object(h.parseInitSegment)(f);b||(b=i(m.audio,o.ElementaryStreamTypes.AUDIO)),v||(v=i(m.video,o.ElementaryStreamTypes.VIDEO));var n={};m.audio&&m.video?n.audiovideo={container:"video/mp4",codec:b+","+v,initSegment:f,id:"main"}:m.audio?n.audio={container:"audio/mp4",codec:b,initSegment:f,id:"audio"}:m.video?n.video={container:"video/mp4",codec:v,initSegment:f,id:"main"}:C.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},l.remux=function(f,b,v,m,n){var d=this.initPTS,g=this.lastEndDTS,T={audio:void 0,video:void 0,text:m,id3:v,initSegment:void 0};Object(R.isFiniteNumber)(g)||(g=this.lastEndDTS=n||0);var y=b.samples;if(!y||!y.length)return T;var s={initPTS:void 0,timescale:1},M=this.initData;if((!M||!M.length)&&(this.generateInitSegment(y),M=this.initData),!M||!M.length)return C.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),T;this.emitInitSegment&&(s.tracks=this.initTracks,this.emitInitSegment=!1),Object(R.isFiniteNumber)(d)||(this.initPTS=s.initPTS=d=a(M,y,g));var A=Object(h.getDuration)(y,M),x=g,E=A+x;Object(h.offsetStartDTS)(M,y,d),A>0?this.lastEndDTS=E:(C.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var w=!!M.audio,_=!!M.video,N="";w&&(N+="audio"),_&&(N+="video");var j={data1:y,startPTS:x,startDTS:x,endPTS:E,endDTS:E,type:N,hasAudio:w,hasVideo:_,nb:1,dropped:0};return T.audio=j.type==="audio"?j:void 0,T.video=j.type!=="audio"?j:void 0,T.text=m,T.id3=v,T.initSegment=s,T},r}(),a=function(l,p,f){return Object(h.getStartDTS)(l,p)-f};function i(r,l){var p=r==null?void 0:r.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||l===o.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}u.default=c},"./src/task-loop.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return R});var R=function(){function h(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var o=h.prototype;return o.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},o.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},o.onHandlerDestroyed=function(){},o.hasInterval=function(){return!!this._tickInterval},o.hasNextTick=function(){return!!this._tickTimer},o.setInterval=function(c){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,c),!0)},o.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},o.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},o.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},o.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},o.doTick=function(){},h}()},"./src/types/cmcd.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"CMCDVersion",function(){return R}),S.d(u,"CMCDObjectType",function(){return h}),S.d(u,"CMCDStreamingFormat",function(){return o}),S.d(u,"CMCDStreamType",function(){return C});var R=1,h;(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"})(h||(h={}));var o;(function(c){c.DASH="d",c.HLS="h",c.SMOOTH="s",c.OTHER="o"})(o||(o={}));var C;(function(c){c.VOD="v",c.LIVE="l"})(C||(C={}))},"./src/types/level.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"HlsSkip",function(){return o}),S.d(u,"getSkipValue",function(){return C}),S.d(u,"HlsUrlParameters",function(){return c}),S.d(u,"Level",function(){return a});function R(i,r){for(var l=0;l<r.length;l++){var p=r[l];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(i,p.key,p)}}function h(i,r,l){return r&&R(i.prototype,r),l&&R(i,l),i}var o;(function(i){i.No="",i.Yes="YES",i.v2="v2"})(o||(o={}));function C(i,r){var l=i.canSkipUntil,p=i.canSkipDateRanges,f=i.endSN,b=r!==void 0?r-f:0;return l&&b<l?p?o.v2:o.Yes:o.No}var c=function(){function i(l,p,f){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=l,this.part=p,this.skip=f}var r=i.prototype;return r.addDirectives=function(p){var f=new self.URL(p);return this.msn!==void 0&&f.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&f.searchParams.set("_HLS_part",this.part.toString()),this.skip&&f.searchParams.set("_HLS_skip",this.skip),f.toString()},i}(),a=function(){function i(r){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=[r.url],this.attrs=r.attrs,this.bitrate=r.bitrate,r.details&&(this.details=r.details),this.id=r.id||0,this.name=r.name,this.width=r.width||0,this.height=r.height||0,this.audioCodec=r.audioCodec,this.videoCodec=r.videoCodec,this.unknownCodecs=r.unknownCodecs,this.codecSet=[r.videoCodec,r.audioCodec].filter(function(l){return l}).join(",").replace(/\.[^.,]+/g,"")}return h(i,[{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 p=l%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),i}()},"./src/types/loader.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"PlaylistContextType",function(){return R}),S.d(u,"PlaylistLevelType",function(){return h});var R;(function(o){o.MANIFEST="manifest",o.LEVEL="level",o.AUDIO_TRACK="audioTrack",o.SUBTITLE_TRACK="subtitleTrack"})(R||(R={}));var h;(function(o){o.MAIN="main",o.AUDIO="audio",o.SUBTITLE="subtitle"})(h||(h={}))},"./src/types/transmuxer.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"ChunkMetadata",function(){return R});var R=function(C,c,a,i,r,l){i===void 0&&(i=0),r===void 0&&(r=-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=h(),this.buffering={audio:h(),video:h(),audiovideo:h()},this.level=C,this.sn=c,this.id=a,this.size=i,this.part=r,this.partial=l};function h(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"AttrList",function(){return o});var R=/^(\d+)x(\d+)$/,h=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,o=function(){function C(a){typeof a=="string"&&(a=C.parseAttrList(a));for(var i in a)a.hasOwnProperty(i)&&(this[i]=a[i])}var c=C.prototype;return c.decimalInteger=function(i){var r=parseInt(this[i],10);return r>Number.MAX_SAFE_INTEGER?Infinity:r},c.hexadecimalInteger=function(i){if(this[i]){var r=(this[i]||"0x").slice(2);r=(r.length&1?"0":"")+r;for(var l=new Uint8Array(r.length/2),p=0;p<r.length/2;p++)l[p]=parseInt(r.slice(p*2,p*2+2),16);return l}else return null},c.hexadecimalIntegerAsNumber=function(i){var r=parseInt(this[i],16);return r>Number.MAX_SAFE_INTEGER?Infinity:r},c.decimalFloatingPoint=function(i){return parseFloat(this[i])},c.optionalFloat=function(i,r){var l=this[i];return l?parseFloat(l):r},c.enumeratedString=function(i){return this[i]},c.bool=function(i){return this[i]==="YES"},c.decimalResolution=function(i){var r=R.exec(this[i]);return r===null?void 0:{width:parseInt(r[1],10),height:parseInt(r[2],10)}},C.parseAttrList=function(i){var r,l={},p='"';for(h.lastIndex=0;(r=h.exec(i))!==null;){var f=r[2];f.indexOf(p)===0&&f.lastIndexOf(p)===f.length-1&&(f=f.slice(1,-1)),l[r[1]]=f}return l},C}()},"./src/utils/binary-search.ts":function(L,u,S){"use strict";S.r(u);var R={search:function(o,C){for(var c=0,a=o.length-1,i=null,r=null;c<=a;){i=(c+a)/2|0,r=o[i];var l=C(r);if(l>0)c=i+1;else if(l<0)a=i-1;else return r}return null}};u.default=R},"./src/utils/buffer-helper.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"BufferHelper",function(){return o});var R=S("./src/utils/logger.ts"),h={length:0,start:function(){return 0},end:function(){return 0}},o=function(){function C(){}return C.isBuffered=function(a,i){try{if(a){for(var r=C.getBuffered(a),l=0;l<r.length;l++)if(i>=r.start(l)&&i<=r.end(l))return!0}}catch(p){}return!1},C.bufferInfo=function(a,i,r){try{if(a){var l=C.getBuffered(a),p=[],f;for(f=0;f<l.length;f++)p.push({start:l.start(f),end:l.end(f)});return this.bufferedInfo(p,i,r)}}catch(b){}return{len:0,start:i,end:i,nextStart:void 0}},C.bufferedInfo=function(a,i,r){i=Math.max(0,i),a.sort(function(s,M){var A=s.start-M.start;return A||M.end-s.end});var l=[];if(r)for(var p=0;p<a.length;p++){var f=l.length;if(f){var b=l[f-1].end;a[p].start-b<r?a[p].end>b&&(l[f-1].end=a[p].end):l.push(a[p])}else l.push(a[p])}else l=a;for(var v=0,m,n=i,d=i,g=0;g<l.length;g++){var T=l[g].start,y=l[g].end;if(i+r>=T&&i<y)n=T,d=y,v=d-i;else if(i+r<T){m=T;break}}return{len:v,start:n||0,end:d||0,nextStart:m}},C.getBuffered=function(a){try{return a.buffered}catch(i){return R.logger.log("failed to get media.buffered",i),h}},C}()},"./src/utils/cea-608-parser.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"Row",function(){return d}),S.d(u,"CaptionScreen",function(){return g});var R=S("./src/utils/logger.ts"),h={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},o=function(E){var w=E;return h.hasOwnProperty(E)&&(w=h[E]),String.fromCharCode(w)},C=15,c=100,a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},i={17:2,18:4,21:6,22:8,23:10,19:13,20:15},r={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},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],f;(function(x){x[x.ERROR=0]="ERROR",x[x.TEXT=1]="TEXT",x[x.WARNING=2]="WARNING",x[x.INFO=2]="INFO",x[x.DEBUG=3]="DEBUG",x[x.DATA=3]="DATA"})(f||(f={}));var b=function(){function x(){this.time=null,this.verboseLevel=f.ERROR}var E=x.prototype;return E.log=function(_,N){this.verboseLevel>=_&&R.logger.log(this.time+" ["+_+"] "+N)},x}(),v=function(E){for(var w=[],_=0;_<E.length;_++)w.push(E[_].toString(16));return w},m=function(){function x(w,_,N,j,k){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=w||"white",this.underline=_||!1,this.italics=N||!1,this.background=j||"black",this.flash=k||!1}var E=x.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(_){for(var N=["foreground","underline","italics","background","flash"],j=0;j<N.length;j++){var k=N[j];_.hasOwnProperty(k)&&(this[k]=_[k])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(_){return this.foreground===_.foreground&&this.underline===_.underline&&this.italics===_.italics&&this.background===_.background&&this.flash===_.flash},E.copy=function(_){this.foreground=_.foreground,this.underline=_.underline,this.italics=_.italics,this.background=_.background,this.flash=_.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},x}(),n=function(){function x(w,_,N,j,k,z){this.uchar=void 0,this.penState=void 0,this.uchar=w||" ",this.penState=new m(_,N,j,k,z)}var E=x.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(_,N){this.uchar=_,this.penState.copy(N)},E.setPenState=function(_){this.penState.copy(_)},E.equals=function(_){return this.uchar===_.uchar&&this.penState.equals(_.penState)},E.copy=function(_){this.uchar=_.uchar,this.penState.copy(_.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},x}(),d=function(){function x(w){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var _=0;_<c;_++)this.chars.push(new n);this.logger=w,this.pos=0,this.currPenState=new m}var E=x.prototype;return E.equals=function(_){for(var N=!0,j=0;j<c;j++)if(!this.chars[j].equals(_.chars[j])){N=!1;break}return N},E.copy=function(_){for(var N=0;N<c;N++)this.chars[N].copy(_.chars[N])},E.isEmpty=function(){for(var _=!0,N=0;N<c;N++)if(!this.chars[N].isEmpty()){_=!1;break}return _},E.setCursor=function(_){this.pos!==_&&(this.pos=_),this.pos<0?(this.logger.log(f.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>c&&(this.logger.log(f.DEBUG,"Too large cursor position "+this.pos),this.pos=c)},E.moveCursor=function(_){var N=this.pos+_;if(_>1)for(var j=this.pos+1;j<N+1;j++)this.chars[j].setPenState(this.currPenState);this.setCursor(N)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(_){_>=144&&this.backSpace();var N=o(_);if(this.pos>=c){this.logger.log(f.ERROR,"Cannot insert "+_.toString(16)+" ("+N+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(N,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(_){var N;for(N=_;N<c;N++)this.chars[N].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 _=[],N=!0,j=0;j<c;j++){var k=this.chars[j].uchar;k!==" "&&(N=!1),_.push(k)}return N?"":_.join("")},E.setPenStyles=function(_){this.currPenState.setStyles(_);var N=this.chars[this.pos];N.setPenState(this.currPenState)},x}(),g=function(){function x(w){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var _=0;_<C;_++)this.rows.push(new d(w));this.logger=w,this.currRow=C-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=x.prototype;return E.reset=function(){for(var _=0;_<C;_++)this.rows[_].clear();this.currRow=C-1},E.equals=function(_){for(var N=!0,j=0;j<C;j++)if(!this.rows[j].equals(_.rows[j])){N=!1;break}return N},E.copy=function(_){for(var N=0;N<C;N++)this.rows[N].copy(_.rows[N])},E.isEmpty=function(){for(var _=!0,N=0;N<C;N++)if(!this.rows[N].isEmpty()){_=!1;break}return _},E.backSpace=function(){var _=this.rows[this.currRow];_.backSpace()},E.clearToEndOfRow=function(){var _=this.rows[this.currRow];_.clearToEndOfRow()},E.insertChar=function(_){var N=this.rows[this.currRow];N.insertChar(_)},E.setPen=function(_){var N=this.rows[this.currRow];N.setPenStyles(_)},E.moveCursor=function(_){var N=this.rows[this.currRow];N.moveCursor(_)},E.setCursor=function(_){this.logger.log(f.INFO,"setCursor: "+_);var N=this.rows[this.currRow];N.setCursor(_)},E.setPAC=function(_){this.logger.log(f.INFO,"pacData = "+JSON.stringify(_));var N=_.row-1;if(this.nrRollUpRows&&N<this.nrRollUpRows-1&&(N=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==N){for(var j=0;j<C;j++)this.rows[j].clear();var k=this.currRow+1-this.nrRollUpRows,z=this.lastOutputScreen;if(z){var H=z.rows[k].cueStartTime,F=this.logger.time;if(H&&F!==null&&H<F)for(var G=0;G<this.nrRollUpRows;G++)this.rows[N-this.nrRollUpRows+G+1].copy(z.rows[k+G])}}this.currRow=N;var B=this.rows[this.currRow];if(_.indent!==null){var W=_.indent,K=Math.max(W-1,0);B.setCursor(_.indent),_.color=B.chars[K].penState.foreground}var q={foreground:_.color,underline:_.underline,italics:_.italics,background:"black",flash:!1};this.setPen(q)},E.setBkgData=function(_){this.logger.log(f.INFO,"bkgData = "+JSON.stringify(_)),this.backSpace(),this.setPen(_),this.insertChar(32)},E.setRollUpRows=function(_){this.nrRollUpRows=_},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(f.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(f.TEXT,this.getDisplayText());var _=this.currRow+1-this.nrRollUpRows,N=this.rows.splice(_,1)[0];N.clear(),this.rows.splice(this.currRow,0,N),this.logger.log(f.INFO,"Rolling up")},E.getDisplayText=function(_){_=_||!1;for(var N=[],j="",k=-1,z=0;z<C;z++){var H=this.rows[z].getTextString();H&&(k=z+1,_?N.push("Row "+k+": '"+H+"'"):N.push(H.trim()))}return N.length>0&&(_?j="["+N.join(" | ")+"]":j=N.join(`
|
|
|
`)),j},E.getTextAndFormat=function(){return this.rows},x}(),T=function(){function x(w,_,N){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=w,this.outputFilter=_,this.mode=null,this.verbose=0,this.displayedMemory=new g(N),this.nonDisplayedMemory=new g(N),this.lastOutputScreen=new g(N),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=N}var E=x.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[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(_){this.outputFilter=_},E.setPAC=function(_){this.writeScreen.setPAC(_)},E.setBkgData=function(_){this.writeScreen.setBkgData(_)},E.setMode=function(_){if(_===this.mode)return;this.mode=_,this.logger.log(f.INFO,"MODE="+_),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=_},E.insertChars=function(_){for(var N=0;N<_.length;N++)this.writeScreen.insertChar(_[N]);var j=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(f.INFO,j+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(f.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(f.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(f.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(f.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(_){this.logger.log(f.INFO,"RU("+_+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(_)},E.ccFON=function(){this.logger.log(f.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(f.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(f.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(f.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(f.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(f.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(f.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(f.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var _=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=_,this.writeScreen=this.nonDisplayedMemory,this.logger.log(f.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(_){this.logger.log(f.INFO,"TO("+_+") - Tab Offset"),this.writeScreen.moveCursor(_)},E.ccMIDROW=function(_){var N={flash:!1};if(N.underline=_%2===1,N.italics=_>=46,N.italics)N.foreground="white";else{var j=Math.floor(_/2)-16,k=["white","green","blue","cyan","red","yellow","magenta"];N.foreground=k[j]}this.logger.log(f.INFO,"MIDROW: "+JSON.stringify(N)),this.writeScreen.setPen(N)},E.outputDataUpdate=function(_){_===void 0&&(_=!1);var N=this.logger.time;if(N===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=N:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,N,this.lastOutputScreen),_&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:N),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(_){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,_,this.displayedMemory),this.cueStartTime=_))},x}(),y=function(){function x(w,_,N){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var j=new b;this.channels=[null,new T(w,_,j),new T(w+1,N,j)],this.cmdHistory=A(),this.logger=j}var E=x.prototype;return E.getHandler=function(_){return this.channels[_].getHandler()},E.setHandler=function(_,N){this.channels[_].setHandler(N)},E.addData=function(_,N){var j,k,z,H=!1;this.logger.time=_;for(var F=0;F<N.length;F+=2){if(k=N[F]&127,z=N[F+1]&127,k===0&&z===0)continue;if(this.logger.log(f.DATA,"["+v([N[F],N[F+1]])+"] -> ("+v([k,z])+")"),j=this.parseCmd(k,z),j||(j=this.parseMidrow(k,z)),j||(j=this.parsePAC(k,z)),j||(j=this.parseBackgroundAttributes(k,z)),!j&&(H=this.parseChars(k,z),H)){var G=this.currentChannel;if(G&&G>0){var B=this.channels[G];B.insertChars(H)}else this.logger.log(f.WARNING,"No channel found yet. TEXT-MODE?")}!j&&!H&&this.logger.log(f.WARNING,"Couldn't parse cleaned data "+v([k,z])+" orig: "+v([N[F],N[F+1]]))}},E.parseCmd=function(_,N){var j=this.cmdHistory,k=(_===20||_===28||_===21||_===29)&&N>=32&&N<=47,z=(_===23||_===31)&&N>=33&&N<=35;if(!(k||z))return!1;if(M(_,N,j))return s(null,null,j),this.logger.log(f.DEBUG,"Repeated command ("+v([_,N])+") is dropped"),!0;var H=_===20||_===21||_===23?1:2,F=this.channels[H];return _===20||_===21||_===28||_===29?N===32?F.ccRCL():N===33?F.ccBS():N===34?F.ccAOF():N===35?F.ccAON():N===36?F.ccDER():N===37?F.ccRU(2):N===38?F.ccRU(3):N===39?F.ccRU(4):N===40?F.ccFON():N===41?F.ccRDC():N===42?F.ccTR():N===43?F.ccRTD():N===44?F.ccEDM():N===45?F.ccCR():N===46?F.ccENM():N===47&&F.ccEOC():F.ccTO(N-32),s(_,N,j),this.currentChannel=H,!0},E.parseMidrow=function(_,N){var j=0;if((_===17||_===25)&&N>=32&&N<=47){if(_===17?j=1:j=2,j!==this.currentChannel)return this.logger.log(f.ERROR,"Mismatch channel in midrow parsing"),!1;var k=this.channels[j];return k?(k.ccMIDROW(N),this.logger.log(f.DEBUG,"MIDROW ("+v([_,N])+")"),!0):!1}return!1},E.parsePAC=function(_,N){var j,k=this.cmdHistory,z=(_>=17&&_<=23||_>=25&&_<=31)&&N>=64&&N<=127,H=(_===16||_===24)&&N>=64&&N<=95;if(!(z||H))return!1;if(M(_,N,k))return s(null,null,k),!0;var F=_<=23?1:2;N>=64&&N<=95?j=F===1?a[_]:r[_]:j=F===1?i[_]:l[_];var G=this.channels[F];return G?(G.setPAC(this.interpretPAC(j,N)),s(_,N,k),this.currentChannel=F,!0):!1},E.interpretPAC=function(_,N){var j,k={color:null,italics:!1,indent:null,underline:!1,row:_};return N>95?j=N-96:j=N-64,k.underline=(j&1)===1,j<=13?k.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(j/2)]:j<=15?(k.italics=!0,k.color="white"):k.indent=Math.floor((j-16)/2)*4,k},E.parseChars=function(_,N){var j,k=null,z=null;if(_>=25?(j=2,z=_-8):(j=1,z=_),z>=17&&z<=19){var H;z===17?H=N+80:z===18?H=N+112:H=N+144,this.logger.log(f.INFO,"Special char '"+o(H)+"' in channel "+j),k=[H]}else _>=32&&_<=127&&(k=N===0?[_]:[_,N]);if(k){var F=v(k);this.logger.log(f.DEBUG,"Char codes = "+F.join(",")),s(_,N,this.cmdHistory)}return k},E.parseBackgroundAttributes=function(_,N){var j=(_===16||_===24)&&N>=32&&N<=47,k=(_===23||_===31)&&N>=45&&N<=47;if(!(j||k))return!1;var z,H={};_===16||_===24?(z=Math.floor((N-32)/2),H.background=p[z],N%2===1&&(H.background=H.background+"_semi")):N===45?H.background="transparent":(H.foreground="black",N===47&&(H.underline=!0));var F=_<=23?1:2,G=this.channels[F];return G.setBkgData(H),s(_,N,this.cmdHistory),!0},E.reset=function(){for(var _=0;_<Object.keys(this.channels).length;_++){var N=this.channels[_];N&&N.reset()}this.cmdHistory=A()},E.cueSplitAtTime=function(_){for(var N=0;N<this.channels.length;N++){var j=this.channels[N];j&&j.cueSplitAtTime(_)}},x}();function s(x,E,w){w.a=x,w.b=E}function M(x,E,w){return w.a===x&&w.b===E}function A(){return{a:null,b:null}}u.default=y},"./src/utils/codecs.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"isCodecType",function(){return h}),S.d(u,"isCodecSupportedInMp4",function(){return o});var R={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 h(C,c){var a=R[c];return!!a&&a[C.slice(0,4)]===!0}function o(C,c){return MediaSource.isTypeSupported((c||"video")+'/mp4;codecs="'+C+'"')}},"./src/utils/cues.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/utils/vttparser.ts"),h=S("./src/utils/webvtt-parser.ts"),o=S("./src/utils/texttrack-utils.ts"),C=/\s/,c={newCue:function(i,r,l,p){for(var f=[],b,v,m,n,d,g=self.VTTCue||self.TextTrackCue,T=0;T<p.rows.length;T++)if(b=p.rows[T],m=!0,n=0,d="",!b.isEmpty()){for(var y=0;y<b.chars.length;y++)C.test(b.chars[y].uchar)&&m?n++:(d+=b.chars[y].uchar,m=!1);b.cueStartTime=r,r===l&&(l+=1e-4),n>=16?n--:n++;var s=Object(R.fixLineBreaks)(d.trim()),M=Object(h.generateCueId)(r,l,s);(!i||!i.cues||!i.cues.getCueById(M))&&(v=new g(r,l,s),v.id=M,v.line=T+1,v.align="left",v.position=10+Math.min(80,Math.floor(n*8/32)*10),f.push(v))}return i&&f.length&&(f.sort(function(A,x){return A.line==="auto"||x.line==="auto"?0:A.line>8&&x.line>8?x.line-A.line:A.line-x.line}),f.forEach(function(A){return Object(o.addCueToTrack)(i,A)})),f}};u.default=c},"./src/utils/discontinuities.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"findFirstFragWithCC",function(){return C}),S.d(u,"shouldAlignOnDiscontinuities",function(){return c}),S.d(u,"findDiscontinuousReferenceFrag",function(){return a}),S.d(u,"adjustSlidingStart",function(){return r}),S.d(u,"alignStream",function(){return l}),S.d(u,"alignPDT",function(){return f}),S.d(u,"alignFragmentByPDTDelta",function(){return b}),S.d(u,"alignMediaPlaylistByPDT",function(){return v});var R=S("./src/polyfills/number.ts"),h=S("./src/utils/logger.ts"),o=S("./src/controller/level-helper.ts");function C(m,n){for(var d=null,g=0,T=m.length;g<T;g++){var y=m[g];if(y&&y.cc===n){d=y;break}}return d}function c(m,n,d){return!!(n.details&&(d.endCC>d.startCC||m&&m.cc<d.startCC))}function a(m,n){var d=m.fragments,g=n.fragments;if(!g.length||!d.length){h.logger.log("No fragments to align");return}var T=C(d,g[0].cc);if(!T||T&&!T.startPTS){h.logger.log("No frag in previous level to align on");return}return T}function i(m,n){if(m){var d=m.start+n;m.start=m.startPTS=d,m.endPTS=d+m.duration}}function r(m,n){for(var d=n.fragments,g=0,T=d.length;g<T;g++)i(d[g],m);n.fragmentHint&&i(n.fragmentHint,m),n.alignedSliding=!0}function l(m,n,d){if(!n)return;p(m,d,n),!d.alignedSliding&&n.details&&f(d,n.details),!d.alignedSliding&&n.details&&!d.skippedSegments&&Object(o.adjustSliding)(n.details,d)}function p(m,n,d){if(c(m,d,n)){var g=a(d.details,n);g&&Object(R.isFiniteNumber)(g.start)&&(h.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),r(g.start,n))}}function f(m,n){if(!n.fragments.length||!m.hasProgramDateTime||!n.hasProgramDateTime)return;var d=n.fragments[0].programDateTime,g=m.fragments[0].programDateTime,T=(g-d)/1e3+n.fragments[0].start;T&&Object(R.isFiniteNumber)(T)&&(h.logger.log("Adjusting PTS using programDateTime delta "+(g-d)+"ms, sliding:"+T.toFixed(3)+" "+m.url+" "),r(T,m))}function b(m,n){var d=m.programDateTime;if(!d)return;var g=(d-n)/1e3;m.start=m.startPTS=g,m.endPTS=g+m.duration}function v(m,n){if(!n.fragments.length||!m.hasProgramDateTime||!n.hasProgramDateTime)return;var d=n.fragments[0].programDateTime,g=n.fragments[0].start,T=d-g*1e3;m.fragments.forEach(function(y){b(y,T)}),m.fragmentHint&&b(m.fragmentHint,T),m.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/utils/ewma.ts"),h=function(){function o(c,a,i){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new R.default(c),this.fast_=new R.default(a)}var C=o.prototype;return C.update=function(a,i){var r=this.slow_,l=this.fast_;this.slow_.halfLife!==a&&(this.slow_=new R.default(a,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==i&&(this.fast_=new R.default(i,l.getEstimate(),l.getTotalWeight()))},C.sample=function(a,i){a=Math.max(a,this.minDelayMs_);var r=8*i,l=a/1e3,p=r/l;this.fast_.sample(l,p),this.slow_.sample(l,p)},C.canEstimate=function(){var a=this.fast_;return a&&a.getTotalWeight()>=this.minWeight_},C.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},C.destroy=function(){},o}();u.default=h},"./src/utils/ewma.ts":function(L,u,S){"use strict";S.r(u);var R=function(){function h(C,c,a){c===void 0&&(c=0),a===void 0&&(a=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=C,this.alpha_=C?Math.exp(Math.log(.5)/C):0,this.estimate_=c,this.totalWeight_=a}var o=h.prototype;return o.sample=function(c,a){var i=Math.pow(this.alpha_,c);this.estimate_=a*(1-i)+i*this.estimate_,this.totalWeight_+=c},o.getTotalWeight=function(){return this.totalWeight_},o.getEstimate=function(){if(this.alpha_){var c=1-Math.pow(this.alpha_,this.totalWeight_);if(c)return this.estimate_/c}return this.estimate_},h}();u.default=R},"./src/utils/fetch-loader.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"fetchSupported",function(){return b});var R=S("./src/polyfills/number.ts"),h=S("./src/loader/load-stats.ts"),o=S("./src/demux/chunk-cache.ts");function C(g,T){g.prototype=Object.create(T.prototype),g.prototype.constructor=g,l(g,T)}function c(g){var T=typeof Map=="function"?new Map:void 0;return c=function(s){if(s===null||!r(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof T!="undefined"){if(T.has(s))return T.get(s);T.set(s,M)}function M(){return a(s,arguments,p(this).constructor)}return M.prototype=Object.create(s.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),l(M,s)},c(g)}function a(g,T,y){return i()?a=Reflect.construct:a=function(M,A,x){var E=[null];E.push.apply(E,A);var w=Function.bind.apply(M,E),_=new w;return x&&l(_,x.prototype),_},a.apply(null,arguments)}function i(){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(g){return!1}}function r(g){return Function.toString.call(g).indexOf("[native code]")!==-1}function l(g,T){return l=Object.setPrototypeOf||function(s,M){return s.__proto__=M,s},l(g,T)}function p(g){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},p(g)}function f(){return f=Object.assign||function(g){for(var T=1;T<arguments.length;T++){var y=arguments[T];for(var s in y)Object.prototype.hasOwnProperty.call(y,s)&&(g[s]=y[s])}return g},f.apply(this,arguments)}function b(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(g){}return!1}var v=function(){function g(y){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=y.fetchSetup||n,this.controller=new self.AbortController,this.stats=new h.LoadStats}var T=g.prototype;return T.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},T.abortInternal=function(){var s=this.response;(!s||!s.ok)&&(this.stats.aborted=!0,this.controller.abort())},T.abort=function(){var s;this.abortInternal(),(s=this.callbacks)!==null&&s!==void 0&&s.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},T.load=function(s,M,A){var x=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var w=m(s,this.controller.signal),_=A.onProgress,N=s.responseType==="arraybuffer",j=N?"byteLength":"length";this.context=s,this.config=M,this.callbacks=A,this.request=this.fetchSetup(s,w),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){x.abortInternal(),A.onTimeout(E,s,x.response)},M.timeout),self.fetch(this.request).then(function(k){if(x.response=x.loader=k,!k.ok){var z=k.status,H=k.statusText;throw new d(H||"fetch, bad network response",z,k)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(k.headers.get("Content-Length")||"0"),_&&Object(R.isFiniteNumber)(M.highWaterMark)?x.loadProgressively(k,E,s,M.highWaterMark,_):N?k.arrayBuffer():k.text()}).then(function(k){var z=x.response;self.clearTimeout(x.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=k[j];var H={url:z.url,data:k};_&&!Object(R.isFiniteNumber)(M.highWaterMark)&&_(E,s,k,z),A.onSuccess(H,E,s,z)}).catch(function(k){if(self.clearTimeout(x.requestTimeout),E.aborted)return;var z=k.code||0;A.onError({code:z,text:k.message},s,k.details)})},T.getCacheAge=function(){var s=null;if(this.response){var M=this.response.headers.get("age");s=M?parseFloat(M):null}return s},T.loadProgressively=function(s,M,A,x,E){x===void 0&&(x=0);var w=new o.default,_=s.body.getReader(),N=function j(){return _.read().then(function(k){if(k.done)return w.dataLength&&E(M,A,w.flush(),s),Promise.resolve(new ArrayBuffer(0));var z=k.value,H=z.length;return M.loaded+=H,H<x||w.dataLength?(w.push(z),w.dataLength>=x&&E(M,A,w.flush(),s)):E(M,A,z,s),j()}).catch(function(){return Promise.reject()})};return N()},g}();function m(g,T){var y={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(f({},g.headers))};return g.rangeEnd&&y.headers.set("Range","bytes="+g.rangeStart+"-"+String(g.rangeEnd-1)),y}function n(g,T){return new self.Request(g.url,T)}var d=function(g){C(T,g);function T(y,s,M){var A;return A=g.call(this,y)||this,A.code=void 0,A.details=void 0,A.code=s,A.details=M,A}return T}(c(Error));u.default=v},"./src/utils/imsc1-ttml-parser.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"IMSC1_CODEC",function(){return r}),S.d(u,"parseIMSC1",function(){return b});var R=S("./src/utils/mp4-tools.ts"),h=S("./src/utils/vttparser.ts"),o=S("./src/utils/vttcue.ts"),C=S("./src/demux/id3.ts"),c=S("./src/utils/timescale-conversion.ts"),a=S("./src/utils/webvtt-parser.ts");function i(){return i=Object.assign||function(x){for(var E=1;E<arguments.length;E++){var w=arguments[E];for(var _ in w)Object.prototype.hasOwnProperty.call(w,_)&&(x[_]=w[_])}return x},i.apply(this,arguments)}var r="stpp.ttml.im1t",l=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function b(x,E,w,_,N){var j=Object(R.findBox)(new Uint8Array(x),["mdat"]);if(j.length===0){N(new Error("Could not parse IMSC1 mdat"));return}var k=j[0],z=Object(C.utf8ArrayToStr)(new Uint8Array(x,k.start,k.end-k.start)),H=Object(c.toTimescaleFromScale)(E,1,w);try{_(v(z,H))}catch(F){N(F)}}function v(x,E){var w=new DOMParser,_=w.parseFromString(x,"text/xml"),N=_.getElementsByTagName("tt")[0];if(!N)throw new Error("Invalid ttml");var j={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},k=Object.keys(j).reduce(function(B,W){return B[W]=N.getAttribute("ttp:"+W)||j[W],B},{}),z=N.getAttribute("xml:space")!=="preserve",H=n(m(N,"styling","style")),F=n(m(N,"layout","region")),G=m(N,"body","[begin]");return[].map.call(G,function(B){var W=d(B,z);if(!W||!B.hasAttribute("begin"))return null;var K=s(B.getAttribute("begin"),k),q=s(B.getAttribute("dur"),k),re=s(B.getAttribute("end"),k);if(K===null)throw y(B);if(re===null){if(q===null)throw y(B);re=K+q}var ee=new o.default(K-E,re-E,W);ee.id=Object(a.generateCueId)(ee.startTime,ee.endTime,ee.text);var Ce=F[B.getAttribute("region")],xe=H[B.getAttribute("style")];ee.position=10,ee.size=80;var he=g(Ce,xe),ke=he.textAlign;if(ke){var _e=f[ke];_e&&(ee.lineAlign=_e),ee.align=ke}return i(ee,he),ee}).filter(function(B){return B!==null})}function m(x,E,w){var _=x.getElementsByTagName(E)[0];return _?[].slice.call(_.querySelectorAll(w)):[]}function n(x){return x.reduce(function(E,w){var _=w.getAttribute("xml:id");return _&&(E[_]=w),E},{})}function d(x,E){return[].slice.call(x.childNodes).reduce(function(w,_,N){var j;return _.nodeName==="br"&&N?w+`
|
|
|
`:(j=_.childNodes)!==null&&j!==void 0&&j.length?d(_,E):E?w+_.textContent.trim().replace(/\s+/g," "):w+_.textContent},"")}function g(x,E){var w="http://www.w3.org/ns/ttml#styling",_=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return _.reduce(function(N,j){var k=T(E,w,j)||T(x,w,j);return k&&(N[j]=k),N},{})}function T(x,E,w){return x.hasAttributeNS(E,w)?x.getAttributeNS(E,w):null}function y(x){return new Error("Could not parse ttml timestamp "+x)}function s(x,E){if(!x)return null;var w=Object(h.parseTimeStamp)(x);return w===null&&(l.test(x)?w=M(x,E):p.test(x)&&(w=A(x,E))),w}function M(x,E){var w=l.exec(x),_=(w[4]|0)+(w[5]|0)/E.subFrameRate;return(w[1]|0)*3600+(w[2]|0)*60+(w[3]|0)+_/E.frameRate}function A(x,E){var w=p.exec(x),_=Number(w[1]),N=w[2];switch(N){case"h":return _*3600;case"m":return _*60;case"ms":return _*1e3;case"f":return _/E.frameRate;case"t":return _/E.tickRate}return _}},"./src/utils/logger.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"enableLogs",function(){return a}),S.d(u,"logger",function(){return i});var R=function(){},h={trace:R,debug:R,log:R,warn:R,info:R,error:R},o=h;function C(r){var l=self.console[r];return l?l.bind(self.console,"["+r+"] >"):R}function c(r){for(var l=arguments.length,p=new Array(l>1?l-1:0),f=1;f<l;f++)p[f-1]=arguments[f];p.forEach(function(b){o[b]=r[b]?r[b].bind(r):C(b)})}function a(r){if(self.console&&r===!0||typeof r=="object"){c(r,"debug","log","info","warn","error");try{o.log()}catch(l){o=h}}else o=h}var i=o},"./src/utils/mediakeys-helper.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"KeySystems",function(){return R}),S.d(u,"requestMediaKeySystemAccess",function(){return h});var R;(function(o){o.WIDEVINE="com.widevine.alpha",o.PLAYREADY="com.microsoft.playready"})(R||(R={}));var h=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"getMediaSource",function(){return R});function R(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"bin2str",function(){return c}),S.d(u,"readUint16",function(){return a}),S.d(u,"readUint32",function(){return i}),S.d(u,"writeUint32",function(){return r}),S.d(u,"findBox",function(){return l}),S.d(u,"parseSegmentIndex",function(){return p}),S.d(u,"parseInitSegment",function(){return f}),S.d(u,"getStartDTS",function(){return b}),S.d(u,"getDuration",function(){return v}),S.d(u,"computeRawDurationFromSamples",function(){return m}),S.d(u,"offsetStartDTS",function(){return n}),S.d(u,"segmentValidRange",function(){return d}),S.d(u,"appendUint8Array",function(){return g});var R=S("./src/utils/typed-array.ts"),h=S("./src/loader/fragment.ts"),o=Math.pow(2,32)-1,C=[].push;function c(T){return String.fromCharCode.apply(null,T)}function a(T,y){"data"in T&&(y+=T.start,T=T.data);var s=T[y]<<8|T[y+1];return s<0?65536+s:s}function i(T,y){"data"in T&&(y+=T.start,T=T.data);var s=T[y]<<24|T[y+1]<<16|T[y+2]<<8|T[y+3];return s<0?4294967296+s:s}function r(T,y,s){"data"in T&&(y+=T.start,T=T.data),T[y]=s>>24,T[y+1]=s>>16&255,T[y+2]=s>>8&255,T[y+3]=s&255}function l(T,y){var s=[];if(!y.length)return s;var M,A,x;"data"in T?(M=T.data,A=T.start,x=T.end):(M=T,A=0,x=M.byteLength);for(var E=A;E<x;){var w=i(M,E),_=c(M.subarray(E+4,E+8)),N=w>1?E+w:x;if(_===y[0])if(y.length===1)s.push({data:M,start:E+8,end:N});else{var j=l({data:M,start:E+8,end:N},y.slice(1));j.length&&C.apply(s,j)}E=N}return s}function p(T){var y=l(T,["moov"]),s=y[0],M=s?s.end:null,A=l(T,["sidx"]);if(!A||!A[0])return null;var x=[],E=A[0],w=E.data[0],_=w===0?8:16,N=i(E,_);_+=4;var j=0,k=0;w===0?_+=8:_+=16,_+=2;var z=E.end+k,H=a(E,_);_+=2;for(var F=0;F<H;F++){var G=_,B=i(E,G);G+=4;var W=B&2147483647,K=(B&2147483648)>>>31;if(K===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var q=i(E,G);G+=4,x.push({referenceSize:W,subsegmentDuration:q,info:{duration:q/N,start:z,end:z+W-1}}),z+=W,G+=4,_=G}return{earliestPresentationTime:j,timescale:N,version:w,referencesCount:H,references:x,moovEndOffset:M}}function f(T){for(var y=[],s=l(T,["moov","trak"]),M=0;M<s.length;M++){var A=s[M],x=l(A,["tkhd"])[0];if(x){var E=x.data[x.start],w=E===0?12:20,_=i(x,w),N=l(A,["mdia","mdhd"])[0];if(N){E=N.data[N.start],w=E===0?12:20;var j=i(N,w),k=l(A,["mdia","hdlr"])[0];if(k){var z=c(k.data.subarray(k.start+8,k.start+12)),H={soun:h.ElementaryStreamTypes.AUDIO,vide:h.ElementaryStreamTypes.VIDEO}[z];if(H){var F=l(A,["mdia","minf","stbl","stsd"])[0],G=void 0;F&&(G=c(F.data.subarray(F.start+12,F.start+16))),y[_]={timescale:j,type:H},y[H]={timescale:j,id:_,codec:G}}}}}}var B=l(T,["moov","mvex","trex"]);return B.forEach(function(W){var K=i(W,4),q=y[K];q&&(q.default={duration:i(W,12),flags:i(W,20)})}),y}function b(T,y){return l(y,["moof","traf"]).reduce(function(s,M){var A=l(M,["tfdt"])[0],x=A.data[A.start],E=l(M,["tfhd"]).reduce(function(w,_){var N=i(_,4),j=T[N];if(j){var k=i(A,4);x===1&&(k*=Math.pow(2,32),k+=i(A,8));var z=j.timescale||9e4,H=k/z;if(isFinite(H)&&(w===null||H<w))return H}return w},null);return E!==null&&isFinite(E)&&(s===null||E<s)?E:s},null)||0}function v(T,y){for(var s=0,M=0,A=0,x=l(T,["moof","traf"]),E=0;E<x.length;E++){var w=x[E],_=l(w,["tfhd"])[0],N=i(_,4),j=y[N];if(!j)continue;var k=j.default,z=i(_,0)|(k==null?void 0:k.flags),H=k==null?void 0:k.duration;z&8&&(z&2?H=i(_,12):H=i(_,8));for(var F=j.timescale||9e4,G=l(w,["trun"]),B=0;B<G.length;B++){if(H){var W=i(G[B],4);s=H*W}else s=m(G[B]);j.type===h.ElementaryStreamTypes.VIDEO?M+=s/F:j.type===h.ElementaryStreamTypes.AUDIO&&(A+=s/F)}}if(M===0&&A===0){var K=p(T);if(K!=null&&K.references)return K.references.reduce(function(q,re){return q+re.info.duration||0},0)}return M||A}function m(T){var y=i(T,0),s=8;y&1&&(s+=4),y&4&&(s+=4);for(var M=0,A=i(T,4),x=0;x<A;x++){if(y&256){var E=i(T,s);M+=E,s+=4}y&512&&(s+=4),y&1024&&(s+=4),y&2048&&(s+=4)}return M}function n(T,y,s){l(y,["moof","traf"]).forEach(function(M){l(M,["tfhd"]).forEach(function(A){var x=i(A,4),E=T[x];if(!E)return;var w=E.timescale||9e4;l(M,["tfdt"]).forEach(function(_){var N=_.data[_.start],j=i(_,4);if(N===0)r(_,4,j-s*w);else{j*=Math.pow(2,32),j+=i(_,8),j-=s*w,j=Math.max(j,0);var k=Math.floor(j/(o+1)),z=Math.floor(j%(o+1));r(_,4,k),r(_,8,z)}})})})}function d(T){var y={valid:null,remainder:null},s=l(T,["moof"]);if(s){if(s.length<2)return y.remainder=T,y}else return y;var M=s[s.length-1];return y.valid=Object(R.sliceUint8)(T,0,M.start-8),y.remainder=Object(R.sliceUint8)(T,M.start-8),y}function g(T,y){var s=new Uint8Array(T.length+y.length);return s.set(T),s.set(y,T.length),s}},"./src/utils/output-filter.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"default",function(){return R});var R=function(){function h(C,c){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=C,this.trackName=c}var o=h.prototype;return o.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},o.newCue=function(c,a,i){(this.startTime===null||this.startTime>c)&&(this.startTime=c),this.endTime=a,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)},o.reset=function(){this.cueRanges=[]},h}()},"./src/utils/texttrack-utils.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"sendAddTrackEvent",function(){return h}),S.d(u,"addCueToTrack",function(){return o}),S.d(u,"clearCurrentCues",function(){return C}),S.d(u,"removeCuesInRange",function(){return c}),S.d(u,"getCuesInRange",function(){return i});var R=S("./src/utils/logger.ts");function h(r,l){var p;try{p=new Event("addtrack")}catch(f){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=r,l.dispatchEvent(p)}function o(r,l){var p=r.mode;if(p==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(l.id))try{if(r.addCue(l),!r.cues.getCueById(l.id))throw new Error("addCue is failed for: "+l)}catch(b){R.logger.debug("[texttrack-utils]: "+b);var f=new self.TextTrackCue(l.startTime,l.endTime,l.text);f.id=l.id,r.addCue(f)}p==="disabled"&&(r.mode=p)}function C(r){var l=r.mode;if(l==="disabled"&&(r.mode="hidden"),r.cues)for(var p=r.cues.length;p--;)r.removeCue(r.cues[p]);l==="disabled"&&(r.mode=l)}function c(r,l,p){var f=r.mode;if(f==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0)for(var b=i(r.cues,l,p),v=0;v<b.length;v++)r.removeCue(b[v]);f==="disabled"&&(r.mode=f)}function a(r,l){if(l<r[0].startTime)return 0;var p=r.length-1;if(l>r[p].endTime)return-1;for(var f=0,b=p;f<=b;){var v=Math.floor((b+f)/2);if(l<r[v].startTime)b=v-1;else if(l>r[v].startTime&&f<p)f=v+1;else return v}return r[f].startTime-l<l-r[b].startTime?f:b}function i(r,l,p){var f=[],b=a(r,l);if(b>-1)for(var v=b,m=r.length;v<m;v++){var n=r[v];if(n.startTime>=l&&n.endTime<=p)f.push(n);else if(n.startTime>p)return f}return f}},"./src/utils/time-ranges.ts":function(L,u,S){"use strict";S.r(u);var R={toString:function(o){for(var C="",c=o.length,a=0;a<c;a++)C+="["+o.start(a).toFixed(3)+","+o.end(a).toFixed(3)+"]";return C}};u.default=R},"./src/utils/timescale-conversion.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"toTimescaleFromBase",function(){return h}),S.d(u,"toTimescaleFromScale",function(){return o}),S.d(u,"toMsFromMpegTsClock",function(){return C}),S.d(u,"toMpegTsClockFromTimescale",function(){return c});var R=9e4;function h(a,i,r,l){r===void 0&&(r=1),l===void 0&&(l=!1);var p=a*i*r;return l?Math.round(p):p}function o(a,i,r,l){return r===void 0&&(r=1),l===void 0&&(l=!1),h(a,i,1/r,l)}function C(a,i){return i===void 0&&(i=!1),h(a,1e3,1/R,i)}function c(a,i){return i===void 0&&(i=1),h(a,R,1/i)}},"./src/utils/typed-array.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"sliceUint8",function(){return R});function R(h,o,C){return Uint8Array.prototype.slice?h.slice(o,C):new Uint8Array(Array.prototype.slice.call(h,o,C))}},"./src/utils/vttcue.ts":function(L,u,S){"use strict";S.r(u),u.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var R=["","lr","rl"],h=["start","middle","end","left","right"];function o(r,l){if(typeof l!="string")return!1;if(!Array.isArray(r))return!1;var p=l.toLowerCase();return~r.indexOf(p)?p:!1}function C(r){return o(R,r)}function c(r){return o(h,r)}function a(r){for(var l=arguments.length,p=new Array(l>1?l-1:0),f=1;f<l;f++)p[f-1]=arguments[f];for(var b=1;b<arguments.length;b++){var v=arguments[b];for(var m in v)r[m]=v[m]}return r}function i(r,l,p){var f=this,b={enumerable:!0};f.hasBeenReset=!1;var v="",m=!1,n=r,d=l,g=p,T=null,y="",s=!0,M="auto",A="start",x=50,E="middle",w=50,_="middle";Object.defineProperty(f,"id",a({},b,{get:function(){return v},set:function(j){v=""+j}})),Object.defineProperty(f,"pauseOnExit",a({},b,{get:function(){return m},set:function(j){m=!!j}})),Object.defineProperty(f,"startTime",a({},b,{get:function(){return n},set:function(j){if(typeof j!="number")throw new TypeError("Start time must be set to a number.");n=j,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",a({},b,{get:function(){return d},set:function(j){if(typeof j!="number")throw new TypeError("End time must be set to a number.");d=j,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",a({},b,{get:function(){return g},set:function(j){g=""+j,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",a({},b,{get:function(){return T},set:function(j){T=j,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",a({},b,{get:function(){return y},set:function(j){var k=C(j);if(k===!1)throw new SyntaxError("An invalid or illegal string was specified.");y=k,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",a({},b,{get:function(){return s},set:function(j){s=!!j,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",a({},b,{get:function(){return M},set:function(j){if(typeof j!="number"&&j!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");M=j,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",a({},b,{get:function(){return A},set:function(j){var k=c(j);if(!k)throw new SyntaxError("An invalid or illegal string was specified.");A=k,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",a({},b,{get:function(){return x},set:function(j){if(j<0||j>100)throw new Error("Position must be between 0 and 100.");x=j,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",a({},b,{get:function(){return E},set:function(j){var k=c(j);if(!k)throw new SyntaxError("An invalid or illegal string was specified.");E=k,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",a({},b,{get:function(){return w},set:function(j){if(j<0||j>100)throw new Error("Size must be between 0 and 100.");w=j,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",a({},b,{get:function(){return _},set:function(j){var k=c(j);if(!k)throw new SyntaxError("An invalid or illegal string was specified.");_=k,this.hasBeenReset=!0}})),f.displayState=void 0}return i.prototype.getCueAsHTML=function(){var r=self.WebVTT;return r.convertCueToDOMTree(self,this.text)},i}()},"./src/utils/vttparser.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"parseTimeStamp",function(){return o}),S.d(u,"fixLineBreaks",function(){return l}),S.d(u,"VTTParser",function(){return p});var R=S("./src/utils/vttcue.ts"),h=function(){function f(){}var b=f.prototype;return b.decode=function(m,n){if(!m)return"";if(typeof m!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(m))},f}();function o(f){function b(m,n,d,g){return(m|0)*3600+(n|0)*60+(d|0)+parseFloat(g||0)}var v=f.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return v?parseFloat(v[2])>59?b(v[2],v[3],0,v[4]):b(v[1],v[2],v[3],v[4]):null}var C=function(){function f(){this.values=Object.create(null)}var b=f.prototype;return b.set=function(m,n){!this.get(m)&&n!==""&&(this.values[m]=n)},b.get=function(m,n,d){return d?this.has(m)?this.values[m]:n[d]:this.has(m)?this.values[m]:n},b.has=function(m){return m in this.values},b.alt=function(m,n,d){for(var g=0;g<d.length;++g)if(n===d[g]){this.set(m,n);break}},b.integer=function(m,n){/^-?\d+$/.test(n)&&this.set(m,parseInt(n,10))},b.percent=function(m,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var d=parseFloat(n);if(d>=0&&d<=100)return this.set(m,d),!0}return!1},f}();function c(f,b,v,m){var n=m?f.split(m):[f];for(var d in n){if(typeof n[d]!="string")continue;var g=n[d].split(v);if(g.length!==2)continue;var T=g[0],y=g[1];b(T,y)}}var a=new R.default(0,0,""),i=a.align==="middle"?"middle":"center";function r(f,b,v){var m=f;function n(){var T=o(f);if(T===null)throw new Error("Malformed timestamp: "+m);return f=f.replace(/^[^\sa-zA-Z-]+/,""),T}function d(T,y){var s=new C;c(T,function(x,E){var w;switch(x){case"region":for(var _=v.length-1;_>=0;_--)if(v[_].id===E){s.set(x,v[_].region);break}break;case"vertical":s.alt(x,E,["rl","lr"]);break;case"line":w=E.split(","),s.integer(x,w[0]),s.percent(x,w[0])&&s.set("snapToLines",!1),s.alt(x,w[0],["auto"]),w.length===2&&s.alt("lineAlign",w[1],["start",i,"end"]);break;case"position":w=E.split(","),s.percent(x,w[0]),w.length===2&&s.alt("positionAlign",w[1],["start",i,"end","line-left","line-right","auto"]);break;case"size":s.percent(x,E);break;case"align":s.alt(x,E,["start",i,"end","left","right"]);break}},/:/,/\s/),y.region=s.get("region",null),y.vertical=s.get("vertical","");var M=s.get("line","auto");M==="auto"&&a.line===-1&&(M=-1),y.line=M,y.lineAlign=s.get("lineAlign","start"),y.snapToLines=s.get("snapToLines",!0),y.size=s.get("size",100),y.align=s.get("align",i);var A=s.get("position","auto");A==="auto"&&a.position===50&&(A=y.align==="start"||y.align==="left"?0:y.align==="end"||y.align==="right"?100:50),y.position=A}function g(){f=f.replace(/^\s+/,"")}if(g(),b.startTime=n(),g(),f.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+m);f=f.substr(3),g(),b.endTime=n(),g(),d(f,b)}function l(f){return f.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var p=function(){function f(){this.state="INITIAL",this.buffer="",this.decoder=new h,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var b=f.prototype;return b.parse=function(m){var n=this;m&&(n.buffer+=n.decoder.decode(m,{stream:!0}));function d(){var A=n.buffer,x=0;for(A=l(A);x<A.length&&A[x]!=="\r"&&A[x]!==`
|
|
|
`;)++x;var E=A.substr(0,x);return A[x]==="\r"&&++x,A[x]===`
|
|
|
`&&++x,n.buffer=A.substr(x),E}function g(A){c(A,function(x,E){},/:/)}try{var T="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;T=d();var y=T.match(/^()?WEBVTT([ \t].*)?$/);if(!y||!y[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var s=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;s?s=!1:T=d();switch(n.state){case"HEADER":/:/.test(T)?g(T):T||(n.state="ID");continue;case"NOTE":T||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(T)){n.state="NOTE";break}if(!T)continue;if(n.cue=new R.default(0,0,""),n.state="CUE",T.indexOf("-->")===-1){n.cue.id=T;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{r(T,n.cue,n.regionList)}catch(A){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var M=T.indexOf("-->")!==-1;if(!T||M&&(s=!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+=T}continue;case"BADCUE":T||(n.state="ID")}}}catch(A){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},b.flush=function(){var m=this;try{if((m.cue||m.state==="HEADER")&&(m.buffer+=`
|
|
|
|
|
|
`,m.parse()),m.state==="INITIAL"||m.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){m.onparsingerror&&m.onparsingerror(n)}return m.onflush&&m.onflush(),this},f}()},"./src/utils/webvtt-parser.ts":function(L,u,S){"use strict";S.r(u),S.d(u,"generateCueId",function(){return p}),S.d(u,"parseWebVTT",function(){return b});var R=S("./src/polyfills/number.ts"),h=S("./src/utils/vttparser.ts"),o=S("./src/demux/id3.ts"),C=S("./src/utils/timescale-conversion.ts"),c=S("./src/remux/mp4-remuxer.ts"),a=/\r\n|\n\r|\n|\r/g,i=function(m,n,d){return d===void 0&&(d=0),m.substr(d,n.length)===n},r=function(m){var n=parseInt(m.substr(-3)),d=parseInt(m.substr(-6,2)),g=parseInt(m.substr(-9,2)),T=m.length>9?parseInt(m.substr(0,m.indexOf(":"))):0;if(!Object(R.isFiniteNumber)(n)||!Object(R.isFiniteNumber)(d)||!Object(R.isFiniteNumber)(g)||!Object(R.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+m);return n+=1e3*d,n+=60*1e3*g,n+=60*60*1e3*T,n},l=function(m){for(var n=5381,d=m.length;d;)n=n*33^m.charCodeAt(--d);return(n>>>0).toString()};function p(v,m,n){return l(v.toString())+l(m.toString())+l(n)}var f=function(m,n,d){var g=m[n],T=m[g.prevCC];if(!T||!T.new&&g.new){m.ccOffset=m.presentationOffset=g.start,g.new=!1;return}for(;(y=T)!==null&&y!==void 0&&y.new;){var y;m.ccOffset+=g.start-T.start,g.new=!1,g=T,T=m[g.prevCC]}m.presentationOffset=d};function b(v,m,n,d,g,T,y,s){var M=new h.VTTParser,A=Object(o.utf8ArrayToStr)(new Uint8Array(v)).trim().replace(a,`
|
|
|
`).split(`
|
|
|
`),x=[],E=Object(C.toMpegTsClockFromTimescale)(m,n),w="00:00.000",_=0,N=0,j,k=!0,z=!1;M.oncue=function(H){var F=d[g],G=d.ccOffset,B=(_-E)/9e4;if(F!=null&&F.new&&(N!==void 0?G=d.ccOffset=F.start:f(d,g,B)),B&&(G=B-d.presentationOffset),z){var W=H.endTime-H.startTime,K=Object(c.normalizePts)((H.startTime+G-N)*9e4,T*9e4)/9e4;H.startTime=K,H.endTime=K+W}var q=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(q)),H.id||(H.id=p(H.startTime,H.endTime,q)),H.endTime>0&&x.push(H)},M.onparsingerror=function(H){j=H},M.onflush=function(){if(j){s(j);return}y(x)},A.forEach(function(H){if(k)if(i(H,"X-TIMESTAMP-MAP=")){k=!1,z=!0,H.substr(16).split(",").forEach(function(F){i(F,"LOCAL:")?w=F.substr(6):i(F,"MPEGTS:")&&(_=parseInt(F.substr(7)))});try{N=r(w)/1e3}catch(F){z=!1,j=F}return}else H===""&&(k=!1);M.parse(H+`
|
|
|
`)}),M.flush()}},"./src/utils/xhr-loader.ts":function(L,u,S){"use strict";S.r(u);var R=S("./src/utils/logger.ts"),h=S("./src/loader/load-stats.ts"),o=/^age:\s*[\d.]+\s*$/m,C=function(){function c(i){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=i?i.xhrSetup:null,this.stats=new h.LoadStats,this.retryDelay=0}var a=c.prototype;return a.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},a.abortInternal=function(){var r=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),r&&(r.onreadystatechange=null,r.onprogress=null,r.readyState!==4&&(this.stats.aborted=!0,r.abort()))},a.abort=function(){var r;this.abortInternal(),(r=this.callbacks)!==null&&r!==void 0&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},a.load=function(r,l,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=r,this.config=l,this.callbacks=p,this.retryDelay=l.retryDelay,this.loadInternal()},a.loadInternal=function(){var r=this.config,l=this.context;if(!r)return;var p=this.loader=new self.XMLHttpRequest,f=this.stats;f.loading.first=0,f.loaded=0;var b=this.xhrSetup;try{if(b)try{b(p,l.url)}catch(n){p.open("GET",l.url,!0),b(p,l.url)}p.readyState||p.open("GET",l.url,!0);var v=this.context.headers;if(v)for(var m in v)p.setRequestHeader(m,v[m])}catch(n){this.callbacks.onError({code:p.status,text:n.message},l,p);return}l.rangeEnd&&p.setRequestHeader("Range","bytes="+l.rangeStart+"-"+(l.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=l.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),p.send()},a.readystatechange=function(){var r=this.context,l=this.loader,p=this.stats;if(!r||!l)return;var f=l.readyState,b=this.config;if(p.aborted)return;if(f>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),f===4){l.onreadystatechange=null,l.onprogress=null;var v=l.status;if(v>=200&&v<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var m,n;if(r.responseType==="arraybuffer"?(m=l.response,n=m.byteLength):(m=l.responseText,n=m.length),p.loaded=p.total=n,!this.callbacks)return;var d=this.callbacks.onProgress;if(d&&d(p,r,m,l),!this.callbacks)return;var g={url:l.responseURL,data:m};this.callbacks.onSuccess(g,p,r,l)}else p.retry>=b.maxRetry||v>=400&&v<499?(R.logger.error(v+" while loading "+r.url),this.callbacks.onError({code:v,text:l.statusText},r,l)):(R.logger.warn(v+" while loading "+r.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,b.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout)},a.loadtimeout=function(){R.logger.warn("timeout while loading "+this.context.url);var r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))},a.loadprogress=function(r){var l=this.stats;l.loaded=r.loaded,r.lengthComputable&&(l.total=r.total)},a.getCacheAge=function(){var r=null;if(this.loader&&o.test(this.loader.getAllResponseHeaders())){var l=this.loader.getResponseHeader("age");r=l?parseFloat(l):null}return r},c}();u.default=C}}).default})},vHTk:function(I,J,P){I.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},w7YG:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.StreamCipher,h=u.algo,o=h.RC4=R.extend({_doReset:function(){for(var a=this._key,i=a.words,r=a.sigBytes,l=this._S=[],p=0;p<256;p++)l[p]=p;for(var p=0,f=0;p<256;p++){var b=p%r,v=i[b>>>2]>>>24-b%4*8&255;f=(f+l[p]+v)%256;var m=l[p];l[p]=l[f],l[f]=m}this._i=this._j=0},_doProcessBlock:function(a,i){a[i]^=C.call(this)},keySize:256/32,ivSize:0});function C(){for(var a=this._S,i=this._i,r=this._j,l=0,p=0;p<4;p++){i=(i+1)%256,r=(r+a[i])%256;var f=a[i];a[i]=a[r],a[r]=f,l|=a[(a[i]+a[r])%256]<<24-p*8}return this._i=i,this._j=r,l}u.RC4=R._createHelper(o);var c=h.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var a=this.cfg.drop;a>0;a--)C.call(this)}});u.RC4Drop=R._createHelper(c)}(),L.RC4})},wCXF:function(I,J,P){"use strict";P.d(J,"a",function(){return nt});var L=P("rePB"),u=P("VTBJ"),S=P("KQm4"),R=P("U8pU"),h=P("ODXe"),o=P("q1tI"),C=P("TSYQ"),c=P.n(C),a=P("Gytx"),i=P.n(a),r=P("Kwbf"),l=P("t23M"),p=P("qx4F"),f=P("6eGT"),b=P("IBYe"),v=P("Ff2n"),m=P("c+Xe"),n=P("fyJ8"),d=P("biw7");function g(je,Re,et,ct,$e){var qe=et[je]||{},Ue=et[Re]||{},Me,Ie;qe.fixed==="left"?Me=ct.left[je]:Ue.fixed==="right"&&(Ie=ct.right[Re]);var ye=!1,Te=!1,Ae=!1,Pe=!1,Xe=et[Re+1],rt=et[je-1];if($e==="rtl"){if(Me!==void 0){var ft=rt&&rt.fixed==="left";Pe=!ft}else if(Ie!==void 0){var St=Xe&&Xe.fixed==="right";Ae=!St}}else if(Me!==void 0){var Pt=Xe&&Xe.fixed==="left";ye=!Pt}else if(Ie!==void 0){var dt=rt&&rt.fixed==="right";Te=!dt}return{fixLeft:Me,fixRight:Ie,lastFixLeft:ye,firstFixRight:Te,lastFixRight:Ae,firstFixLeft:Pe,isSticky:ct.isSticky}}var T=P("sR1s");function y(je){var Re=je.cells,et=je.stickyOffsets,ct=je.flattenColumns,$e=je.rowComponent,qe=je.cellComponent,Ue=je.onHeaderRow,Me=je.index,Ie=o.useContext(d.a),ye=Ie.prefixCls,Te=Ie.direction,Ae;Ue&&(Ae=Ue(Re.map(function(Xe){return Xe.column}),Me));var Pe=Object(T.a)(Re.map(function(Xe){return Xe.column}));return o.createElement($e,Object.assign({},Ae),Re.map(function(Xe,rt){var ft=Xe.column,St=g(Xe.colStart,Xe.colEnd,ct,et,Te),Pt;return ft&&ft.onHeaderCell&&(Pt=Xe.column.onHeaderCell(ft)),o.createElement(n.a,Object.assign({},Xe,{ellipsis:ft.ellipsis,align:ft.align,component:qe,prefixCls:ye,key:Pe[rt]},St,{additionalProps:Pt,rowType:"header"}))}))}y.displayName="HeaderRow";var s=y;function M(je){var Re=[];function et(Ue,Me){var Ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Re[Ie]=Re[Ie]||[];var ye=Me,Te=Ue.filter(Boolean).map(function(Ae){var Pe={key:Ae.key,className:Ae.className||"",children:Ae.title,column:Ae,colStart:ye},Xe=1,rt=Ae.children;return rt&&rt.length>0&&(Xe=et(rt,ye,Ie+1).reduce(function(ft,St){return ft+St},0),Pe.hasSubColumns=!0),"colSpan"in Ae&&(Xe=Ae.colSpan),"rowSpan"in Ae&&(Pe.rowSpan=Ae.rowSpan),Pe.colSpan=Xe,Pe.colEnd=Pe.colStart+Xe-1,Re[Ie].push(Pe),ye+=Xe,Xe});return Te}et(je,0);for(var ct=Re.length,$e=function(Me){Re[Me].forEach(function(Ie){!("rowSpan"in Ie)&&!Ie.hasSubColumns&&(Ie.rowSpan=ct-Me)})},qe=0;qe<ct;qe+=1)$e(qe);return Re}function A(je){var Re=je.stickyOffsets,et=je.columns,ct=je.flattenColumns,$e=je.onHeaderRow,qe=o.useContext(d.a),Ue=qe.prefixCls,Me=qe.getComponent,Ie=o.useMemo(function(){return M(et)},[et]),ye=Me(["header","wrapper"],"thead"),Te=Me(["header","row"],"tr"),Ae=Me(["header","cell"],"th");return o.createElement(ye,{className:"".concat(Ue,"-thead")},Ie.map(function(Pe,Xe){var rt=o.createElement(s,{key:Xe,flattenColumns:ct,cells:Pe,stickyOffsets:Re,rowComponent:Te,cellComponent:Ae,onHeaderRow:$e,index:Xe});return rt}))}var x=A,E=P("hW8S");function w(je){for(var Re=je.colWidths,et=je.columns,ct=je.columCount,$e=[],qe=ct||et.length,Ue=!1,Me=qe-1;Me>=0;Me-=1){var Ie=Re[Me],ye=et&&et[Me],Te=ye&&ye[E.a];(Ie||Te||Ue)&&($e.unshift(o.createElement("col",Object.assign({key:Me,style:{width:Ie,minWidth:Ie}},Te))),Ue=!0)}return o.createElement("colgroup",null,$e)}var _=w;function N(je,Re){return Object(o.useMemo)(function(){for(var et=[],ct=0;ct<Re;ct+=1){var $e=je[ct];if($e!==void 0)et[ct]=$e;else return null}return et},[je.join("_"),Re])}var j=o.forwardRef(function(je,Re){var et=je.noData,ct=je.columns,$e=je.flattenColumns,qe=je.colWidths,Ue=je.columCount,Me=je.stickyOffsets,Ie=je.direction,ye=je.fixHeader,Te=je.offsetHeader,Ae=je.stickyClassName,Pe=je.onScroll,Xe=Object(v.a)(je,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),rt=o.useContext(d.a),ft=rt.prefixCls,St=rt.scrollbarSize,Pt=rt.isSticky,dt=Pt&&!ye?0:St,At=o.useRef(null),Ot=o.useCallback(function(br){Object(m.b)(Re,br),Object(m.b)(At,br)},[]);o.useEffect(function(){var br;function ur(wt){var hr=wt.currentTarget,Qr=wt.deltaX;Qr&&(Pe({currentTarget:hr,scrollLeft:hr.scrollLeft+Qr}),wt.preventDefault())}return(br=At.current)===null||br===void 0||br.addEventListener("wheel",ur),function(){var wt;(wt=At.current)===null||wt===void 0||wt.removeEventListener("wheel",ur)}},[]);var bt=$e[$e.length-1],Vt={fixed:bt?bt.fixed:null,onHeaderCell:function(){return{className:"".concat(ft,"-cell-scrollbar")}}},ir=Object(o.useMemo)(function(){return dt?[].concat(Object(S.a)(ct),[Vt]):ct},[dt,ct]),Qt=Object(o.useMemo)(function(){return dt?[].concat(Object(S.a)($e),[Vt]):$e},[dt,$e]),dr=Object(o.useMemo)(function(){var br=Me.right,ur=Me.left;return Object(u.a)(Object(u.a)({},Me),{},{left:Ie==="rtl"?[].concat(Object(S.a)(ur.map(function(wt){return wt+dt})),[0]):ur,right:Ie==="rtl"?br:[].concat(Object(S.a)(br.map(function(wt){return wt+dt})),[0]),isSticky:Pt})},[dt,Me,Pt]),Nt=N(qe,Ue);return o.createElement("div",{style:Object(u.a)({overflow:"hidden"},Pt?{top:Te}:{}),ref:Ot,className:c()("".concat(ft,"-header"),Object(L.a)({},Ae,!!Ae))},o.createElement("table",{style:{tableLayout:"fixed",visibility:et||Nt?null:"hidden"}},o.createElement(_,{colWidths:Nt?[].concat(Object(S.a)(Nt),[dt]):[],columCount:Ue+1,columns:Qt}),o.createElement(x,Object.assign({},Xe,{stickyOffsets:dr,columns:ir,flattenColumns:Qt}))))});j.displayName="FixedHeader";var k=j,z=o.createContext(null),H=z;function F(je){var Re=je.prefixCls,et=je.children,ct=je.component,$e=je.cellComponent,qe=je.fixHeader,Ue=je.fixColumn,Me=je.horizonScroll,Ie=je.className,ye=je.expanded,Te=je.componentWidth,Ae=je.colSpan,Pe=o.useContext(d.a),Xe=Pe.scrollbarSize;return o.useMemo(function(){var rt=et;return Ue&&(rt=o.createElement("div",{style:{width:Te-(qe?Xe:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Re,"-expanded-row-fixed")},rt)),o.createElement(ct,{className:Ie,style:{display:ye?null:"none"}},o.createElement(n.a,{component:$e,prefixCls:Re,colSpan:Ae},rt))},[et,ct,qe,Me,Ie,ye,Te,Ae,Xe])}var G=F;function B(je){var Re=je.className,et=je.style,ct=je.record,$e=je.index,qe=je.rowKey,Ue=je.getRowKey,Me=je.rowExpandable,Ie=je.expandedKeys,ye=je.onRow,Te=je.indent,Ae=Te===void 0?0:Te,Pe=je.rowComponent,Xe=je.cellComponent,rt=je.childrenColumnName,ft=o.useContext(d.a),St=ft.prefixCls,Pt=ft.fixedInfoList,dt=o.useContext(H),At=dt.fixHeader,Ot=dt.fixColumn,bt=dt.horizonScroll,Vt=dt.componentWidth,ir=dt.flattenColumns,Qt=dt.expandableType,dr=dt.expandRowByClick,Nt=dt.onTriggerExpand,br=dt.rowClassName,ur=dt.expandedRowClassName,wt=dt.indentSize,hr=dt.expandIcon,Qr=dt.expandedRowRender,Gr=dt.expandIconColumnIndex,Lr=o.useState(!1),si=Object(h.a)(Lr,2),Tt=si[0],Dt=si[1],Ct=Ie&&Ie.has(je.recordKey);o.useEffect(function(){Ct&&Dt(!0)},[Ct]);var Rr=Qt==="row"&&(!Me||Me(ct)),jr=Qt==="nest",$t=rt&&ct&&ct[rt],jt=Rr||jr,Ur;ye&&(Ur=ye(ct,$e));var _n=function(V){if(dr&&jt&&Nt(ct,V),Ur&&Ur.onClick){for(var X,ne=arguments.length,me=new Array(ne>1?ne-1:0),ie=1;ie<ne;ie++)me[ie-1]=arguments[ie];(X=Ur).onClick.apply(X,[V].concat(me))}},Vr;typeof br=="string"?Vr=br:typeof br=="function"&&(Vr=br(ct,$e,Ae));var vt=Object(T.a)(ir),Ft=o.createElement(Pe,Object.assign({},Ur,{"data-row-key":qe,className:c()(Re,"".concat(St,"-row"),"".concat(St,"-row-level-").concat(Ae),Vr,Ur&&Ur.className),style:Object(u.a)(Object(u.a)({},et),Ur?Ur.style:null),onClick:_n}),ir.map(function(se,V){var X=se.render,ne=se.dataIndex,me=se.className,ie=vt[V],ze=Pt[V],pt;V===(Gr||0)&&jr&&(pt=o.createElement(o.Fragment,null,o.createElement("span",{style:{paddingLeft:"".concat(wt*Ae,"px")},className:"".concat(St,"-row-indent indent-level-").concat(Ae)}),hr({prefixCls:St,expanded:Ct,expandable:$t,record:ct,onExpand:Nt})));var ot;return se.onCell&&(ot=se.onCell(ct,$e)),o.createElement(n.a,Object.assign({className:me,ellipsis:se.ellipsis,align:se.align,component:Xe,prefixCls:St,key:ie,record:ct,index:$e,dataIndex:ne,render:X,shouldCellUpdate:se.shouldCellUpdate},ze,{appendNode:pt,additionalProps:ot}))})),rn;if(Rr&&(Tt||Ct)){var hn=Qr(ct,$e,Ae+1,Ct),An=ur&&ur(ct,$e,Ae);rn=o.createElement(G,{expanded:Ct,className:c()("".concat(St,"-expanded-row"),"".concat(St,"-expanded-row-level-").concat(Ae+1),An),prefixCls:St,fixHeader:At,fixColumn:Ot,horizonScroll:bt,component:Pe,componentWidth:Vt,cellComponent:Xe,colSpan:ir.length},hn)}var Rn;return $t&&Ct&&(Rn=(ct[rt]||[]).map(function(se,V){var X=Ue(se,V);return o.createElement(B,Object.assign({},je,{key:X,rowKey:X,record:se,recordKey:X,index:V,indent:Ae+1}))})),o.createElement(o.Fragment,null,Ft,rn,Rn)}B.displayName="BodyRow";var W=B,K=o.createContext(null),q=K;function re(je){var Re=je.columnKey,et=je.onColumnResize,ct=o.useRef();return o.useEffect(function(){ct.current&&et(Re,ct.current.offsetWidth)},[]),o.createElement(l.a,{onResize:function(qe){var Ue=qe.offsetWidth;et(Re,Ue)}},o.createElement("td",{ref:ct,style:{padding:0,border:0,height:0}},o.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ee(je){var Re=je.data,et=je.getRowKey,ct=je.measureColumnWidth,$e=je.expandedKeys,qe=je.onRow,Ue=je.rowExpandable,Me=je.emptyNode,Ie=je.childrenColumnName,ye=o.useContext(q),Te=ye.onColumnResize,Ae=o.useContext(d.a),Pe=Ae.prefixCls,Xe=Ae.getComponent,rt=o.useContext(H),ft=rt.fixHeader,St=rt.horizonScroll,Pt=rt.flattenColumns,dt=rt.componentWidth;return o.useMemo(function(){var At=Xe(["body","wrapper"],"tbody"),Ot=Xe(["body","row"],"tr"),bt=Xe(["body","cell"],"td"),Vt;Re.length?Vt=Re.map(function(Qt,dr){var Nt=et(Qt,dr);return o.createElement(W,{key:Nt,rowKey:Nt,record:Qt,recordKey:Nt,index:dr,rowComponent:Ot,cellComponent:bt,expandedKeys:$e,onRow:qe,getRowKey:et,rowExpandable:Ue,childrenColumnName:Ie})}):Vt=o.createElement(G,{expanded:!0,className:"".concat(Pe,"-placeholder"),prefixCls:Pe,fixHeader:ft,fixColumn:St,horizonScroll:St,component:Ot,componentWidth:dt,cellComponent:bt,colSpan:Pt.length},Me);var ir=Object(T.a)(Pt);return o.createElement(At,{className:"".concat(Pe,"-tbody")},ct&&o.createElement("tr",{"aria-hidden":"true",className:"".concat(Pe,"-measure-row"),style:{height:0}},ir.map(function(Qt){return o.createElement(re,{key:Qt,columnKey:Qt,onColumnResize:Te})})),Vt)},[Re,Pe,qe,ct,$e,et,Xe,dt,Me,Pt])}var Ce=o.memo(ee);Ce.displayName="Body";var xe=Ce,he=P("wRmb"),ke=P("xEkU"),_e=P.n(ke);function de(je){var Re=Object(o.useRef)(je),et=Object(o.useState)({}),ct=Object(h.a)(et,2),$e=ct[1],qe=Object(o.useRef)(null),Ue=Object(o.useRef)([]);function Me(Ie){qe.current===null&&(Ue.current=[],qe.current=_e()(function(){Ue.current.forEach(function(ye){Re.current=ye(Re.current)}),qe.current=null,$e({})})),Ue.current.push(Ie)}return Object(o.useEffect)(function(){return function(){_e.a.cancel(qe.current)}},[]),[Re.current,Me]}function ce(je){var Re=Object(o.useRef)(je),et=Object(o.useRef)(null);function ct(){window.clearTimeout(et.current)}function $e(Ue){Re.current=Ue,ct(),et.current=window.setTimeout(function(){Re.current=null,et.current=null},100)}function qe(){return Re.current}return Object(o.useEffect)(function(){return ct},[]),[$e,qe]}function ae(je,Re,et){var ct=Object(o.useMemo)(function(){for(var $e=[],qe=[],Ue=0,Me=0,Ie=0;Ie<Re;Ie+=1)if(et==="rtl"){qe[Ie]=Me,Me+=je[Ie]||0;var ye=Re-Ie-1;$e[ye]=Ue,Ue+=je[ye]||0}else{$e[Ie]=Ue,Ue+=je[Ie]||0;var Te=Re-Ie-1;qe[Te]=Me,Me+=je[Te]||0}return{left:$e,right:qe}},[je,Re,et]);return ct}var Se=ae;function te(je){var Re=je.className,et=je.children;return o.createElement("div",{className:Re},et)}var ue=te,Oe=P("n6Qo");function le(je){var Re,et=je.prefixCls,ct=je.record,$e=je.onExpand,qe=je.expanded,Ue=je.expandable,Me="".concat(et,"-row-expand-icon");if(!Ue)return o.createElement("span",{className:c()(Me,"".concat(et,"-row-spaced"))});var Ie=function(Te){$e(ct,Te),Te.stopPropagation()};return o.createElement("span",{className:c()(Me,(Re={},Object(L.a)(Re,"".concat(et,"-row-expanded"),qe),Object(L.a)(Re,"".concat(et,"-row-collapsed"),!qe),Re)),onClick:Ie})}function Q(je,Re,et){var ct=[];function $e(qe){(qe||[]).forEach(function(Ue,Me){ct.push(Re(Ue,Me)),$e(Ue[et])})}return $e(je),ct}var Y=P("zT1h"),Z=P("y0+3"),be=function(Re,et){var ct,$e,qe=Re.scrollBodyRef,Ue=Re.onScroll,Me=Re.offsetScroll,Ie=o.useContext(d.a),ye=Ie.prefixCls,Te=((ct=qe.current)===null||ct===void 0?void 0:ct.scrollWidth)||0,Ae=(($e=qe.current)===null||$e===void 0?void 0:$e.clientWidth)||0,Pe=Te&&Ae*(Ae/Te),Xe=o.useRef(),rt=de({scrollLeft:0,isHiddenScrollBar:!1}),ft=Object(h.a)(rt,2),St=ft[0],Pt=ft[1],dt=o.useRef({delta:0,x:0}),At=o.useState(!1),Ot=Object(h.a)(At,2),bt=Ot[0],Vt=Ot[1],ir=function(){Vt(!1)},Qt=function(wt){wt.persist(),dt.current.delta=wt.pageX-St.scrollLeft,dt.current.x=0,Vt(!0),wt.preventDefault()},dr=function(wt){var hr,Qr=wt||((hr=window)===null||hr===void 0?void 0:hr.event),Gr=Qr.buttons;if(!bt||Gr===0){bt&&Vt(!1);return}var Lr=dt.current.x+wt.pageX-dt.current.x-dt.current.delta;Lr<=0&&(Lr=0),Lr+Pe>=Ae&&(Lr=Ae-Pe),Ue({scrollLeft:Lr/Ae*(Te+2)}),dt.current.x=wt.pageX},Nt=function(){var wt=Object(Z.b)(qe.current).top,hr=wt+qe.current.offsetHeight,Qr=document.documentElement.scrollTop+window.innerHeight;hr-Object(p.a)()<=Qr||wt>=Qr-Me?Pt(function(Gr){return Object(u.a)(Object(u.a)({},Gr),{},{isHiddenScrollBar:!0})}):Pt(function(Gr){return Object(u.a)(Object(u.a)({},Gr),{},{isHiddenScrollBar:!1})})},br=function(wt){Pt(function(hr){return Object(u.a)(Object(u.a)({},hr),{},{scrollLeft:wt/Te*Ae||0})})};return o.useImperativeHandle(et,function(){return{setScrollLeft:br}}),o.useEffect(function(){var ur=Object(Y.a)(document.body,"mouseup",ir,!1),wt=Object(Y.a)(document.body,"mousemove",dr,!1);return Nt(),function(){ur.remove(),wt.remove()}},[Pe,bt]),o.useEffect(function(){var ur=Object(Y.a)(window,"scroll",Nt,!1),wt=Object(Y.a)(window,"resize",Nt,!1);return function(){ur.remove(),wt.remove()}},[]),o.useEffect(function(){St.isHiddenScrollBar||Pt(function(ur){var wt,hr;return Object(u.a)(Object(u.a)({},ur),{},{scrollLeft:qe.current.scrollLeft/((wt=qe.current)===null||wt===void 0?void 0:wt.scrollWidth)*((hr=qe.current)===null||hr===void 0?void 0:hr.clientWidth)})})},[St.isHiddenScrollBar]),Te<=Ae||!Pe||St.isHiddenScrollBar?null:o.createElement("div",{style:{height:Object(p.a)(),width:Ae,bottom:Me},className:"".concat(ye,"-sticky-scroll")},o.createElement("div",{onMouseDown:Qt,ref:Xe,className:c()("".concat(ye,"-sticky-scroll-bar"),Object(L.a)({},"".concat(ye,"-sticky-scroll-bar-active"),bt)),style:{width:"".concat(Pe,"px"),transform:"translate3d(".concat(St.scrollLeft,"px, 0, 0)")}}))},ge=o.forwardRef(be);function De(je,Re){return o.useMemo(function(){var et=!!je;return{isSticky:et,stickyClassName:et?"".concat(Re,"-sticky-header"):"",offsetHeader:Object(R.a)(je)==="object"&&je.offsetHeader||0,offsetScroll:Object(R.a)(je)==="object"&&je.offsetScroll||0}},[je,Re])}var Qe=[],Ze={},nt="rc-table-internal-hook",tt=o.memo(function(je){var Re=je.children;return Re},function(je,Re){return i()(je.props,Re.props)?je.pingLeft!==Re.pingLeft||je.pingRight!==Re.pingRight:!1});function lt(je){var Re,et=je.prefixCls,ct=je.className,$e=je.rowClassName,qe=je.style,Ue=je.data,Me=je.rowKey,Ie=je.scroll,ye=je.tableLayout,Te=je.direction,Ae=je.title,Pe=je.footer,Xe=je.summary,rt=je.id,ft=je.showHeader,St=je.components,Pt=je.emptyText,dt=je.onRow,At=je.onHeaderRow,Ot=je.internalHooks,bt=je.transformColumns,Vt=je.internalRefs,ir=je.sticky,Qt=Ue||Qe,dr=!!Qt.length,Nt=o.useState(0),br=Object(h.a)(Nt,2),ur=br[0],wt=br[1];o.useEffect(function(){wt(Object(p.a)())});var hr=o.useMemo(function(){return Object(T.c)(St,{})},[St]),Qr=o.useCallback(function(Gt,or){return Object(T.b)(hr,Gt)||or},[hr]),Gr=o.useMemo(function(){return typeof Me=="function"?Me:function(Gt){var or=Gt&&Gt[Me];return or}},[Me]),Lr=Object(E.c)(je),si=Lr.expandIcon,Tt=Lr.expandedRowKeys,Dt=Lr.defaultExpandedRowKeys,Ct=Lr.defaultExpandAllRows,Rr=Lr.expandedRowRender,jr=Lr.onExpand,$t=Lr.onExpandedRowsChange,jt=Lr.expandRowByClick,Ur=Lr.rowExpandable,_n=Lr.expandIconColumnIndex,Vr=Lr.expandedRowClassName,vt=Lr.childrenColumnName,Ft=Lr.indentSize,rn=si||le,hn=vt||"children",An=o.useMemo(function(){return Rr?"row":je.expandable&&Ot===nt&&je.expandable.__PARENT_RENDER_ICON__||Qt.some(function(Gt){return Gt&&Object(R.a)(Gt)==="object"&&Gt[hn]})?"nest":!1},[!!Rr,Qt]),Rn=o.useState(function(){return Dt||(Ct?Q(Qt,Gr,hn):[])}),se=Object(h.a)(Rn,2),V=se[0],X=se[1],ne=o.useMemo(function(){return new Set(Tt||V||[])},[Tt,V]),me=o.useCallback(function(Gt){var or=Gr(Gt,Qt.indexOf(Gt)),sr,vn=ne.has(or);vn?(ne.delete(or),sr=Object(S.a)(ne)):sr=[].concat(Object(S.a)(ne),[or]),X(sr),jr&&jr(!vn,Gt),$t&&$t(sr)},[Gr,ne,Qt,jr,$t]),ie=o.useState(0),ze=Object(h.a)(ie,2),pt=ze[0],ot=ze[1],It=Object(he.b)(Object(u.a)(Object(u.a)(Object(u.a)({},je),Lr),{},{expandable:!!Rr,expandedKeys:ne,getRowKey:Gr,onTriggerExpand:me,expandIcon:rn,expandIconColumnIndex:_n,direction:Te}),Ot===nt?bt:null),gt=Object(h.a)(It,2),Ht=gt[0],Xt=gt[1],Sr=o.useMemo(function(){return{columns:Ht,flattenColumns:Xt}},[Ht,Xt]),an=o.useRef(),Zr=o.useRef(),Zt=o.useRef(),Hr=o.useState(!1),fr=Object(h.a)(Hr,2),Jt=fr[0],tr=fr[1],vr=o.useState(!1),Xr=Object(h.a)(vr,2),ln=Xr[0],mn=Xr[1],li=de(new Map),Ki=Object(h.a)(li,2),Ui=Ki[0],Fn=Ki[1],qr=Object(T.a)(Xt),Oi=qr.map(function(Gt){return Ui.get(Gt)}),on=o.useMemo(function(){return Oi},[Oi.join("_")]),Zn=Se(on,Xt.length,Te),Yr=Ie&&Object(T.d)(Ie.y),cr=Ie&&Object(T.d)(Ie.x),en=cr&&Xt.some(function(Gt){var or=Gt.fixed;return or}),Mr=o.useRef(),En=De(ir,et),Fr=En.isSticky,xi=En.offsetHeader,gn=En.offsetScroll,On=En.stickyClassName,ui,ci,qn;Yr&&(ci={overflowY:"scroll",maxHeight:Ie.y}),cr&&(ui={overflowX:"auto"},Yr||(ci={overflowY:"hidden"}),qn={width:Ie.x===!0?"auto":Ie.x,minWidth:"100%"});var Ei=o.useCallback(function(Gt,or){Fn(function(sr){var vn=new Map(sr);return vn.set(Gt,or),vn})},[]),Yn=ce(null),Ai=Object(h.a)(Yn,2),zn=Ai[0],fi=Ai[1];function pi(Gt,or){if(!or)return;typeof or=="function"?or(Gt):or.scrollLeft!==Gt&&(or.scrollLeft=Gt)}var ei=function(or){var sr=or.currentTarget,vn=or.scrollLeft,Di=typeof vn=="number"?vn:sr.scrollLeft,Vi=sr||Ze;if(!fi()||fi()===Vi){var rr;zn(Vi),pi(Di,Zr.current),pi(Di,Zt.current),pi(Di,(rr=Mr.current)===null||rr===void 0?void 0:rr.setScrollLeft)}if(sr){var Mt=sr.scrollWidth,pr=sr.clientWidth;tr(Di>0),mn(Di<Mt-pr)}},$r=function(){Zt.current&&ei({currentTarget:Zt.current})},$i=function(or){var sr=or.width;$r(),ot(an.current?an.current.offsetWidth:sr)};o.useEffect(function(){return $r},[]),o.useEffect(function(){cr&&$r()},[cr]),o.useEffect(function(){Ot===nt&&Vt&&(Vt.body.current=Zt.current)});var ta=Qr(["table"],"table"),Ni=o.useMemo(function(){return ye||(en?Ie.x==="max-content"?"auto":"fixed":Yr||Xt.some(function(Gt){var or=Gt.ellipsis;return or})?"fixed":"auto")},[Yr,en,Xt,ye]),Ji,Gi={colWidths:on,columCount:Xt.length,stickyOffsets:Zn,onHeaderRow:At,fixHeader:Yr},Bt=o.useMemo(function(){return dr?null:typeof Pt=="function"?Pt():Pt},[dr,Pt]),ar=o.createElement(xe,{data:Qt,measureColumnWidth:Yr||cr||Fr,expandedKeys:ne,rowExpandable:Ur,getRowKey:Gr,onRow:dt,emptyNode:Bt,childrenColumnName:hn}),Kt=o.createElement(_,{colWidths:Xt.map(function(Gt){var or=Gt.width;return or}),columns:Xt}),xr=Xe&&o.createElement(Oe.b,null,Xe(Qt)),Dr=Qr(["body"]);if(Yr||Fr){var Br;typeof Dr=="function"?(Br=Dr(Qt,{scrollbarSize:ur,ref:Zt,onScroll:ei}),Gi.colWidths=Xt.map(function(Gt,or){var sr=Gt.width,vn=or===Ht.length-1?sr-ur:sr;return typeof vn=="number"&&!Number.isNaN(vn)?vn:(Object(r.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Br=o.createElement("div",{style:Object(u.a)(Object(u.a)({},ui),ci),onScroll:ei,ref:Zt,className:c()("".concat(et,"-body"))},o.createElement(ta,{style:Object(u.a)(Object(u.a)({},qn),{},{tableLayout:Ni})},Kt,ar,xr),Fr&&o.createElement(ge,{ref:Mr,offsetScroll:gn,scrollBodyRef:Zt,onScroll:ei})),Ji=o.createElement(o.Fragment,null,ft!==!1&&o.createElement(k,Object.assign({noData:!Qt.length},Gi,Sr,{direction:Te,offsetHeader:xi,stickyClassName:On,ref:Zr,onScroll:ei})),Br)}else Ji=o.createElement("div",{style:Object(u.a)(Object(u.a)({},ui),ci),className:c()("".concat(et,"-content")),onScroll:ei,ref:Zt},o.createElement(ta,{style:Object(u.a)(Object(u.a)({},qn),{},{tableLayout:Ni})},Kt,ft!==!1&&o.createElement(x,Object.assign({},Gi,Sr)),ar,xr));var Or=Object(E.b)(je),un=o.createElement("div",Object.assign({className:c()(et,ct,(Re={},Object(L.a)(Re,"".concat(et,"-rtl"),Te==="rtl"),Object(L.a)(Re,"".concat(et,"-ping-left"),Jt),Object(L.a)(Re,"".concat(et,"-ping-right"),ln),Object(L.a)(Re,"".concat(et,"-layout-fixed"),ye==="fixed"),Object(L.a)(Re,"".concat(et,"-fixed-header"),Yr),Object(L.a)(Re,"".concat(et,"-fixed-column"),en),Object(L.a)(Re,"".concat(et,"-scroll-horizontal"),cr),Object(L.a)(Re,"".concat(et,"-has-fix-left"),Xt[0]&&Xt[0].fixed),Object(L.a)(Re,"".concat(et,"-has-fix-right"),Xt[Xt.length-1]&&Xt[Xt.length-1].fixed==="right"),Re)),style:qe,id:rt,ref:an},Or),o.createElement(tt,{pingLeft:Jt,pingRight:ln,props:Object(u.a)(Object(u.a)({},je),{},{stickyOffsets:Zn,mergedExpandedKeys:ne})},Ae&&o.createElement(ue,{className:"".concat(et,"-title")},Ae(Qt)),o.createElement("div",{className:"".concat(et,"-container")},Ji),Pe&&o.createElement(ue,{className:"".concat(et,"-footer")},Pe(Qt))));cr&&(un=o.createElement(l.a,{onResize:$i},un));var Pn=o.useMemo(function(){return{prefixCls:et,getComponent:Qr,scrollbarSize:ur,direction:Te,fixedInfoList:Xt.map(function(Gt,or){return g(or,or,Xt,Zn,Te)}),isSticky:Fr}},[et,Qr,ur,Te,Xt,Zn,Te,Fr]),Er=o.useMemo(function(){return Object(u.a)(Object(u.a)({},Sr),{},{tableLayout:Ni,rowClassName:$e,expandedRowClassName:Vr,componentWidth:pt,fixHeader:Yr,fixColumn:en,horizonScroll:cr,expandIcon:rn,expandableType:An,expandRowByClick:jt,expandedRowRender:Rr,onTriggerExpand:me,expandIconColumnIndex:_n,indentSize:Ft})},[Sr,Ni,$e,Vr,pt,Yr,en,cr,rn,An,jt,Rr,me,_n,Ft]),Ri=o.useMemo(function(){return{onColumnResize:Ei}},[Ei]);return o.createElement(d.a.Provider,{value:Pn},o.createElement(H.Provider,{value:Er},o.createElement(q.Provider,{value:Ri},un)))}lt.Column=b.a,lt.ColumnGroup=f.a,lt.Summary=Oe.a,lt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var st=J.b=lt},wRmb:function(I,J,P){"use strict";P.d(J,"a",function(){return i});var L=P("rePB"),u=P("KQm4"),S=P("VTBJ"),R=P("Ff2n"),h=P("q1tI"),o=P.n(h),C=P("Kwbf"),c=P("Zm9Q"),a=P("hW8S");function i(b){return Object(c.a)(b).filter(function(v){return h.isValidElement(v)}).map(function(v){var m=v.key,n=v.props,d=n.children,g=Object(R.a)(n,["children"]),T=Object(S.a)({key:m},g);return d&&(T.children=i(d)),T})}function r(b){return b.reduce(function(v,m){var n=m.fixed,d=n===!0?"left":n,g=m.children;return g&&g.length>0?[].concat(Object(u.a)(v),Object(u.a)(r(g).map(function(T){return Object(S.a)({fixed:d},T)}))):[].concat(Object(u.a)(v),[Object(S.a)(Object(S.a)({},m),{},{fixed:d})])},[])}function l(b){for(var v=!0,m=0;m<b.length;m+=1){var n=b[m];if(v&&n.fixed!=="left")v=!1;else if(!v&&n.fixed==="left"){Object(C.a)(!1,"Index ".concat(m-1," of `columns` missing `fixed='left'` prop."));break}}for(var d=!0,g=b.length-1;g>=0;g-=1){var T=b[g];if(d&&T.fixed!=="right")d=!1;else if(!d&&T.fixed==="right"){Object(C.a)(!1,"Index ".concat(g+1," of `columns` missing `fixed='right'` prop."));break}}}function p(b){return b.map(function(v){var m=v.fixed,n=Object(R.a)(v,["fixed"]),d=m;return m==="left"?d="right":m==="right"&&(d="left"),Object(S.a)({fixed:d},n)})}function f(b,v){var m=b.prefixCls,n=b.columns,d=b.children,g=b.expandable,T=b.expandedKeys,y=b.getRowKey,s=b.onTriggerExpand,M=b.expandIcon,A=b.rowExpandable,x=b.expandIconColumnIndex,E=b.direction,w=b.expandRowByClick,_=h.useMemo(function(){return n||i(d)},[n,d]),N=h.useMemo(function(){if(g){var z,H=x||0,F=_[H],G=(z={},Object(L.a)(z,a.a,{className:"".concat(m,"-expand-icon-col")}),Object(L.a)(z,"title",""),Object(L.a)(z,"fixed",F?F.fixed:null),Object(L.a)(z,"className","".concat(m,"-row-expand-icon-cell")),Object(L.a)(z,"render",function(K,q,re){var ee=y(q,re),Ce=T.has(ee),xe=A?A(q):!0,he=M({prefixCls:m,expanded:Ce,expandable:xe,record:q,onExpand:s});return w?h.createElement("span",{onClick:function(_e){return _e.stopPropagation()}},he):he}),z),B=_.slice();return H>=0&&B.splice(H,0,G),B}return _},[g,_,y,T,M,E]),j=h.useMemo(function(){var z=N;return v&&(z=v(z)),z.length||(z=[{render:function(){return null}}]),z},[v,N,E]),k=h.useMemo(function(){return E==="rtl"?p(r(j)):r(j)},[j,E]);return[j,k]}J.b=f},wU8J:function(I,J){function P(){this.buffer=new Array,this.length=0}P.prototype={get:function(L){var u=Math.floor(L/8);return(this.buffer[u]>>>7-L%8&1)==1},put:function(L,u){for(var S=0;S<u;S++)this.putBit((L>>>u-S-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(L){var u=Math.floor(this.length/8);this.buffer.length<=u&&this.buffer.push(0),L&&(this.buffer[u]|=128>>>this.length%8),this.length++}},I.exports=P},wZgz:function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("ETIr"),P("cv67"),P("K3mO"),P("OLod"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.BlockCipher,h=u.algo,o=[],C=[],c=[],a=[],i=[],r=[],l=[],p=[],f=[],b=[];(function(){for(var n=[],d=0;d<256;d++)d<128?n[d]=d<<1:n[d]=d<<1^283;for(var g=0,T=0,d=0;d<256;d++){var y=T^T<<1^T<<2^T<<3^T<<4;y=y>>>8^y&255^99,o[g]=y,C[y]=g;var s=n[g],M=n[s],A=n[M],x=n[y]*257^y*16843008;c[g]=x<<24|x>>>8,a[g]=x<<16|x>>>16,i[g]=x<<8|x>>>24,r[g]=x;var x=A*16843009^M*65537^s*257^g*16843008;l[y]=x<<24|x>>>8,p[y]=x<<16|x>>>16,f[y]=x<<8|x>>>24,b[y]=x,g?(g=s^n[n[n[A^s]]],T^=n[n[T]]):g=T=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],m=h.AES=R.extend({_doReset:function(){var n;if(this._nRounds&&this._keyPriorReset===this._key)return;for(var d=this._keyPriorReset=this._key,g=d.words,T=d.sigBytes/4,y=this._nRounds=T+6,s=(y+1)*4,M=this._keySchedule=[],A=0;A<s;A++)A<T?M[A]=g[A]:(n=M[A-1],A%T?T>6&&A%T==4&&(n=o[n>>>24]<<24|o[n>>>16&255]<<16|o[n>>>8&255]<<8|o[n&255]):(n=n<<8|n>>>24,n=o[n>>>24]<<24|o[n>>>16&255]<<16|o[n>>>8&255]<<8|o[n&255],n^=v[A/T|0]<<24),M[A]=M[A-T]^n);for(var x=this._invKeySchedule=[],E=0;E<s;E++){var A=s-E;if(E%4)var n=M[A];else var n=M[A-4];E<4||A<=4?x[E]=n:x[E]=l[o[n>>>24]]^p[o[n>>>16&255]]^f[o[n>>>8&255]]^b[o[n&255]]}},encryptBlock:function(n,d){this._doCryptBlock(n,d,this._keySchedule,c,a,i,r,o)},decryptBlock:function(n,d){var g=n[d+1];n[d+1]=n[d+3],n[d+3]=g,this._doCryptBlock(n,d,this._invKeySchedule,l,p,f,b,C);var g=n[d+1];n[d+1]=n[d+3],n[d+3]=g},_doCryptBlock:function(n,d,g,T,y,s,M,A){for(var x=this._nRounds,E=n[d]^g[0],w=n[d+1]^g[1],_=n[d+2]^g[2],N=n[d+3]^g[3],j=4,k=1;k<x;k++){var z=T[E>>>24]^y[w>>>16&255]^s[_>>>8&255]^M[N&255]^g[j++],H=T[w>>>24]^y[_>>>16&255]^s[N>>>8&255]^M[E&255]^g[j++],F=T[_>>>24]^y[N>>>16&255]^s[E>>>8&255]^M[w&255]^g[j++],G=T[N>>>24]^y[E>>>16&255]^s[w>>>8&255]^M[_&255]^g[j++];E=z,w=H,_=F,N=G}var z=(A[E>>>24]<<24|A[w>>>16&255]<<16|A[_>>>8&255]<<8|A[N&255])^g[j++],H=(A[w>>>24]<<24|A[_>>>16&255]<<16|A[N>>>8&255]<<8|A[E&255])^g[j++],F=(A[_>>>24]<<24|A[N>>>16&255]<<16|A[E>>>8&255]<<8|A[w&255])^g[j++],G=(A[N>>>24]<<24|A[E>>>16&255]<<16|A[w>>>8&255]<<8|A[_&255])^g[j++];n[d]=z,n[d+1]=H,n[d+2]=F,n[d+3]=G},keySize:256/32});u.AES=R._createHelper(m)}(),L.AES})},wbyO:function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.WordArray,h=u.enc,o=h.Base64url={stringify:function(c,a=!0){var i=c.words,r=c.sigBytes,l=a?this._safe_map:this._map;c.clamp();for(var p=[],f=0;f<r;f+=3)for(var b=i[f>>>2]>>>24-f%4*8&255,v=i[f+1>>>2]>>>24-(f+1)%4*8&255,m=i[f+2>>>2]>>>24-(f+2)%4*8&255,n=b<<16|v<<8|m,d=0;d<4&&f+d*.75<r;d++)p.push(l.charAt(n>>>6*(3-d)&63));var g=l.charAt(64);if(g)for(;p.length%4;)p.push(g);return p.join("")},parse:function(c,a=!0){var i=c.length,r=a?this._safe_map:this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var p=0;p<r.length;p++)l[r.charCodeAt(p)]=p}var f=r.charAt(64);if(f){var b=c.indexOf(f);b!==-1&&(i=b)}return C(c,i,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function C(c,a,i){for(var r=[],l=0,p=0;p<a;p++)if(p%4){var f=i[c.charCodeAt(p-1)]<<p%4*2,b=i[c.charCodeAt(p)]>>>6-p%4*2,v=f|b;r[l>>>2]|=v<<24-l%4*8,l++}return R.create(r,l)}}(),L.enc.Base64url})},"y0+3":function(I,J,P){"use strict";P.d(J,"a",function(){return r}),P.d(J,"b",function(){return p});var L=/margin|padding|width|height|max|min|offset/,u={left:!0,top:!0},S={cssFloat:1,styleFloat:1,float:1};function R(f){return f.nodeType===1?f.ownerDocument.defaultView.getComputedStyle(f,null):{}}function h(f,b,v){if(b=b.toLowerCase(),v==="auto"){if(b==="height")return f.offsetHeight;if(b==="width")return f.offsetWidth}return b in u||(u[b]=L.test(b)),u[b]?parseFloat(v)||0:v}function o(f,b){var v=arguments.length,m=R(f);return b=S[b]?"cssFloat"in f.style?"cssFloat":"styleFloat":b,v===1?m:h(f,b,m[b]||f.style[b])}function C(f,b,v){var m=arguments.length;if(b=S[b]?"cssFloat"in f.style?"cssFloat":"styleFloat":b,m===3)return typeof v=="number"&&L.test(b)&&(v="".concat(v,"px")),f.style[b]=v,v;for(var n in b)b.hasOwnProperty(n)&&C(f,n,b[n]);return R(f)}function c(f){return f===document.body?document.documentElement.clientWidth:f.offsetWidth}function a(f){return f===document.body?window.innerHeight||document.documentElement.clientHeight:f.offsetHeight}function i(){var f=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:f,height:b}}function r(){var f=document.documentElement.clientWidth,b=window.innerHeight||document.documentElement.clientHeight;return{width:f,height:b}}function l(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function p(f){var b=f.getBoundingClientRect(),v=document.documentElement;return{left:b.left+(window.pageXOffset||v.scrollLeft)-(v.clientLeft||document.body.clientLeft||0),top:b.top+(window.pageYOffset||v.scrollTop)-(v.clientTop||document.body.clientTop||0)}}},ynwM:function(I,J,P){var L=P("MFOe"),u=L.Global;I.exports={name:"oldFF-globalStorage",read:R,write:h,each:o,remove:C,clearAll:c};var S=u.globalStorage;function R(a){return S[a]}function h(a,i){S[a]=i}function o(a){for(var i=S.length-1;i>=0;i--){var r=S.key(i);a(S[r],r)}}function C(a){return S.removeItem(a)}function c(){o(function(a,i){delete S[a]})}}}]);
|