(window.webpackJsonp=window.webpackJsonp||[]).push([[206,6,7,19,20],{"+NIl":function(I,q,N){(function(P){P(N("VrN/"))})(function(P){"use strict";P.defineMode("stex",function(m,S){"use strict";function R(d,E){d.cmdState.push(E)}function T(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function g(d){var E=d.cmdState.pop();E&&E.closeBracket()}function C(d){for(var E=d.cmdState,y=E.length-1;y>=0;y--){var l=E[y];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function h(d,E,y){return function(){this.name=d,this.bracketNo=0,this.style=E,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var s={};s.importmodule=h("importmodule","tag",["string","builtin"]),s.documentclass=h("documentclass","tag",["","atom"]),s.usepackage=h("usepackage","tag",["atom"]),s.begin=h("begin","tag",["atom"]),s.end=h("end","tag",["atom"]),s.label=h("label","tag",["atom"]),s.ref=h("ref","tag",["atom"]),s.eqref=h("eqref","tag",["atom"]),s.cite=h("cite","tag",["atom"]),s.bibitem=h("bibitem","tag",["atom"]),s.Bibitem=h("Bibitem","tag",["atom"]),s.RBibitem=h("RBibitem","tag",["atom"]),s.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function a(d,E){d.f=E}function r(d,E){var y;if(d.match(/^\\[a-zA-Z@]+/)){var l=d.current().slice(1);return y=s.hasOwnProperty(l)?s[l]:s.DEFAULT,y=new y,R(E,y),a(E,p),y.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return a(E,function(o,u){return f(o,u,"\\]")}),"keyword";if(d.match("\\("))return a(E,function(o,u){return f(o,u,"\\)")}),"keyword";if(d.match("$$"))return a(E,function(o,u){return f(o,u,"$$")}),"keyword";if(d.match("$"))return a(E,function(o,u){return f(o,u,"$")}),"keyword";var n=d.next();if(n=="%")return d.skipToEnd(),"comment";if(n=="}"||n=="]"){if(y=T(E),y)y.closeBracket(n),a(E,p);else return"error";return"bracket"}else return n=="{"||n=="["?(y=s.DEFAULT,y=new y,R(E,y),"bracket"):/\d/.test(n)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),y=C(E),y.name=="begin"&&(y.argument=d.current()),y.styleIdentifier())}function f(d,E,y){if(d.eatSpace())return null;if(y&&d.match(y))return a(E,r),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=d.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(d.skipToEnd(),"comment"):"error"}function p(d,E){var y=d.peek(),l;return y=="{"||y=="["?(l=T(E),l.openBracket(y),d.eat(y),a(E,r),"bracket"):/[ \t\r]/.test(y)?(d.eat(y),null):(a(E,r),g(E),r(d,E))}return{startState:function(){var d=S.inMathMode?function(E,y){return f(E,y)}:r;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,E){return E.f(d,E)},blankLine:function(d){d.f=r,d.cmdState.length=0},lineComment:"%"}}),P.defineMIME("text/x-stex","stex"),P.defineMIME("text/x-latex","stex")})},"19Vz":function(I,q,N){(function(P){P(N("VrN/"))})(function(P){P.defineOption("placeholder","",function(h,s,a){var r=a&&a!=P.Init;if(s&&!r)h.on("blur",T),h.on("change",g),h.on("swapDoc",g),P.on(h.getInputField(),"compositionupdate",h.state.placeholderCompose=function(){R(h)}),g(h);else if(!s&&r){h.off("blur",T),h.off("change",g),h.off("swapDoc",g),P.off(h.getInputField(),"compositionupdate",h.state.placeholderCompose),m(h);var f=h.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}s&&!h.hasFocus()&&T(h)});function m(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function S(h){m(h);var s=h.state.placeholder=document.createElement("pre");s.style.cssText="height: 0; overflow: visible",s.style.direction=h.getOption("direction"),s.className="CodeMirror-placeholder CodeMirror-line-like";var a=h.getOption("placeholder");typeof a=="string"&&(a=document.createTextNode(a)),s.appendChild(a),h.display.lineSpace.insertBefore(s,h.display.lineSpace.firstChild)}function R(h){setTimeout(function(){var s=!1,a=h.getInputField();a.nodeName=="TEXTAREA"?s=!a.value:h.lineCount()==1&&(s=!/[^\u200b]/.test(a.querySelector(".CodeMirror-line").textContent)),s?S(h):m(h)},20)}function T(h){C(h)&&S(h)}function g(h){var s=h.getWrapperElement(),a=C(h);s.className=s.className.replace(" CodeMirror-empty","")+(a?" CodeMirror-empty":""),a?S(h):m(h)}function C(h){return h.lineCount()===1&&h.getLine(0)===""}})},"1eCo":function(I,q,N){(function(P){P(N("VrN/"))})(function(P){"use strict";var m={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};P.defineMode("xml",function(R,T){var g=R.indentUnit,C={},h=T.htmlMode?m:S;for(var s in h)C[s]=h[s];for(var s in T)C[s]=T[s];var a,r;function f(_,j){function F(z){return j.tokenize=z,z(_,j)}var L=_.next();if(L=="<")return _.eat("!")?_.eat("[")?_.match("CDATA[")?F(E("atom","]]>")):null:_.match("--")?F(E("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),F(y(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),j.tokenize=E("meta","?>"),"meta"):(a=_.eat("/")?"closeTag":"openTag",j.tokenize=p,"tag bracket");if(L=="&"){var X;return _.eat("#")?_.eat("x")?X=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):X=_.eatWhile(/[\d]/)&&_.eat(";"):X=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),X?"atom":"error"}else return _.eatWhile(/[^&<]/),null}f.isInText=!0;function p(_,j){var F=_.next();if(F==">"||F=="/"&&_.eat(">"))return j.tokenize=f,a=F==">"?"endTag":"selfcloseTag","tag bracket";if(F=="=")return a="equals",null;if(F=="<"){j.tokenize=f,j.state=u,j.tagName=j.tagStart=null;var L=j.tokenize(_,j);return L?L+" tag error":"tag error"}else return/[\'\"]/.test(F)?(j.tokenize=d(F),j.stringStartCol=_.column(),j.tokenize(_,j)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(_){var j=function(F,L){for(;!F.eol();)if(F.next()==_){L.tokenize=p;break}return"string"};return j.isInAttribute=!0,j}function E(_,j){return function(F,L){for(;!F.eol();){if(F.match(j)){L.tokenize=f;break}F.next()}return _}}function y(_){return function(j,F){for(var L;(L=j.next())!=null;){if(L=="<")return F.tokenize=y(_+1),F.tokenize(j,F);if(L==">")if(_==1){F.tokenize=f;break}else return F.tokenize=y(_-1),F.tokenize(j,F)}return"meta"}}function l(_,j,F){this.prev=_.context,this.tagName=j,this.indent=_.indented,this.startOfLine=F,(C.doNotIndent.hasOwnProperty(j)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function n(_){_.context&&(_.context=_.context.prev)}function o(_,j){for(var F;;){if(!_.context)return;if(F=_.context.tagName,!C.contextGrabbers.hasOwnProperty(F)||!C.contextGrabbers[F].hasOwnProperty(j))return;n(_)}}function u(_,j,F){return _=="openTag"?(F.tagStart=j.column(),w):_=="closeTag"?v:u}function w(_,j,F){return _=="word"?(F.tagName=j.current(),r="tag",k):C.allowMissingTagName&&_=="endTag"?(r="tag bracket",k(_,j,F)):(r="error",w)}function v(_,j,F){if(_=="word"){var L=j.current();return F.context&&F.context.tagName!=L&&C.implicitlyClosed.hasOwnProperty(F.context.tagName)&&n(F),F.context&&F.context.tagName==L||C.matchClosing===!1?(r="tag",i):(r="tag error",D)}else return C.allowMissingTagName&&_=="endTag"?(r="tag bracket",i(_,j,F)):(r="error",D)}function i(_,j,F){return _!="endTag"?(r="error",i):(n(F),u)}function D(_,j,F){return r="error",i(_,j,F)}function k(_,j,F){if(_=="word")return r="attribute",c;if(_=="endTag"||_=="selfcloseTag"){var L=F.tagName,X=F.tagStart;return F.tagName=F.tagStart=null,_=="selfcloseTag"||C.autoSelfClosers.hasOwnProperty(L)?o(F,L):(o(F,L),F.context=new l(F,L,X==F.indented)),u}return r="error",k}function c(_,j,F){return _=="equals"?b:(C.allowMissing||(r="error"),k(_,j,F))}function b(_,j,F){return _=="string"?x:_=="word"&&C.allowUnquoted?(r="string",k):(r="error",k(_,j,F))}function x(_,j,F){return _=="string"?x:k(_,j,F)}return{startState:function(_){var j={tokenize:f,state:u,indented:_||0,tagName:null,tagStart:null,context:null};return _!=null&&(j.baseIndent=_),j},token:function(_,j){if(!j.tagName&&_.sol()&&(j.indented=_.indentation()),_.eatSpace())return null;a=null;var F=j.tokenize(_,j);return(F||a)&&F!="comment"&&(r=null,j.state=j.state(a||F,_,j),r&&(F=r=="error"?F+" error":r)),F},indent:function(_,j,F){var L=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+g;if(L&&L.noIndent)return P.Pass;if(_.tokenize!=p&&_.tokenize!=f)return F?F.match(/^(\s*)/)[0].length:0;if(_.tagName)return C.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+g*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/$/,blockCommentStart:"",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(_){_.state==b&&(_.state=k)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var j=[],F=_.context;F;F=F.prev)F.tagName&&j.push(F.tagName);return j.reverse()}}}),P.defineMIME("text/xml","xml"),P.defineMIME("application/xml","xml"),P.mimeModes.hasOwnProperty("text/html")||P.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("MlIO"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.Hasher,T=m.x64,g=T.Word,C=T.WordArray,h=m.algo;function s(){return g.create.apply(g,arguments)}var a=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],r=[];(function(){for(var p=0;p<80;p++)r[p]=s()})();var f=h.SHA512=R.extend({_doReset:function(){this._hash=new C.init([new g.init(1779033703,4089235720),new g.init(3144134277,2227873595),new g.init(1013904242,4271175723),new g.init(2773480762,1595750129),new g.init(1359893119,2917565137),new g.init(2600822924,725511199),new g.init(528734635,4215389547),new g.init(1541459225,327033209)])},_doProcessBlock:function(p,d){for(var E=this._hash.words,y=E[0],l=E[1],n=E[2],o=E[3],u=E[4],w=E[5],v=E[6],i=E[7],D=y.high,k=y.low,c=l.high,b=l.low,x=n.high,_=n.low,j=o.high,F=o.low,L=u.high,X=u.low,z=w.high,H=w.low,G=v.high,U=v.low,B=i.high,W=i.low,te=D,de=k,fe=c,be=b,Ce=x,ue=_,ge=j,pe=F,oe=L,ae=X,re=z,he=H,Q=G,ie=U,we=B,ne=W,J=0;J<80;J++){var V,Z,Ee=r[J];if(J<16)Z=Ee.high=p[d+J*2]|0,V=Ee.low=p[d+J*2+1]|0;else{var xe=r[J-15],_e=xe.high,je=xe.low,Be=(_e>>>1|je<<31)^(_e>>>8|je<<24)^_e>>>7,He=(je>>>1|_e<<31)^(je>>>8|_e<<24)^(je>>>7|_e<<25),Ue=r[J-2],ze=Ue.high,Ge=Ue.low,Ye=(ze>>>19|Ge<<13)^(ze<<3|Ge>>>29)^ze>>>6,Re=(Ge>>>19|ze<<13)^(Ge<<3|ze>>>29)^(Ge>>>6|ze<<26),tt=r[J-7],rt=tt.high,We=tt.low,$e=r[J-16],Ie=$e.high,Oe=$e.low;V=He+We,Z=Be+rt+(V>>>0>>0?1:0),V=V+Re,Z=Z+Ye+(V>>>0>>0?1:0),V=V+Oe,Z=Z+Ie+(V>>>0>>0?1:0),Ee.high=Z,Ee.low=V}var Le=oe&re^~oe&Q,Te=ae&he^~ae&ie,Ae=te&fe^te&Ce^fe&Ce,ke=de&be^de&ue^be&ue,Me=(te>>>28|de<<4)^(te<<30|de>>>2)^(te<<25|de>>>7),Fe=(de>>>28|te<<4)^(de<<30|te>>>2)^(de<<25|te>>>7),Xe=(oe>>>14|ae<<18)^(oe>>>18|ae<<14)^(oe<<23|ae>>>9),qe=(ae>>>14|oe<<18)^(ae>>>18|oe<<14)^(ae<<23|oe>>>9),pt=a[J],at=pt.high,ft=pt.low,Et=ne+qe,xt=we+Xe+(Et>>>0>>0?1:0),Et=Et+Te,xt=xt+Le+(Et>>>0>>0?1:0),Et=Et+ft,xt=xt+at+(Et>>>0>>0?1:0),Et=Et+V,xt=xt+Z+(Et>>>0>>0?1:0),lt=Fe+ke,Wt=Me+Ae+(lt>>>0>>0?1:0);we=Q,ne=ie,Q=re,ie=he,re=oe,he=ae,ae=pe+Et|0,oe=ge+xt+(ae>>>0>>0?1:0)|0,ge=Ce,pe=ue,Ce=fe,ue=be,fe=te,be=de,de=Et+lt|0,te=xt+Wt+(de>>>0>>0?1:0)|0}k=y.low=k+de,y.high=D+te+(k>>>0>>0?1:0),b=l.low=b+be,l.high=c+fe+(b>>>0>>0?1:0),_=n.low=_+ue,n.high=x+Ce+(_>>>0>>0?1:0),F=o.low=F+pe,o.high=j+ge+(F>>>0>>0?1:0),X=u.low=X+ae,u.high=L+oe+(X>>>0>>0?1:0),H=w.low=H+he,w.high=z+re+(H>>>0>>0?1:0),U=v.low=U+ie,v.high=G+Q+(U>>>0>>0?1:0),W=i.low=W+ne,i.high=B+we+(W>>>0>>0?1:0)},_doFinalize:function(){var p=this._data,d=p.words,E=this._nDataBytes*8,y=p.sigBytes*8;d[y>>>5]|=128<<24-y%32,d[(y+128>>>10<<5)+30]=Math.floor(E/4294967296),d[(y+128>>>10<<5)+31]=E,p.sigBytes=d.length*4,this._process();var l=this._hash.toX32();return l},clone:function(){var p=R.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});m.SHA512=R._createHelper(f),m.HmacSHA512=R._createHmacHelper(f)}(),P.SHA512})},"3y9D":function(I,q,N){(function(P,m){I.exports=q=m(N("Ib8C"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=S.Hasher,g=m.algo,C=[],h=g.SHA1=T.extend({_doReset:function(){this._hash=new R.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(s,a){for(var r=this._hash.words,f=r[0],p=r[1],d=r[2],E=r[3],y=r[4],l=0;l<80;l++){if(l<16)C[l]=s[a+l]|0;else{var n=C[l-3]^C[l-8]^C[l-14]^C[l-16];C[l]=n<<1|n>>>31}var o=(f<<5|f>>>27)+y+C[l];l<20?o+=(p&d|~p&E)+1518500249:l<40?o+=(p^d^E)+1859775393:l<60?o+=(p&d|p&E|d&E)-1894007588:o+=(p^d^E)-899497514,y=E,E=d,d=p<<30|p>>>2,p=f,f=o}r[0]=r[0]+f|0,r[1]=r[1]+p|0,r[2]=r[2]+d|0,r[3]=r[3]+E|0,r[4]=r[4]+y|0},_doFinalize:function(){var s=this._data,a=s.words,r=this._nDataBytes*8,f=s.sigBytes*8;return a[f>>>5]|=128<<24-f%32,a[(f+64>>>9<<4)+14]=Math.floor(r/4294967296),a[(f+64>>>9<<4)+15]=r,s.sigBytes=a.length*4,this._process(),this._hash},clone:function(){var s=T.clone.call(this);return s._hash=this._hash.clone(),s}});m.SHA1=T._createHelper(h),m.HmacSHA1=T._createHmacHelper(h)}(),P.SHA1})},4:function(I,q){},"5hvy":function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("MlIO"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.WordArray,g=R.Hasher,C=S.x64,h=C.Word,s=S.algo,a=[],r=[],f=[];(function(){for(var E=1,y=0,l=0;l<24;l++){a[E+5*y]=(l+1)*(l+2)/2%64;var n=y%5,o=(2*E+3*y)%5;E=n,y=o}for(var E=0;E<5;E++)for(var y=0;y<5;y++)r[E+5*y]=y+(2*E+3*y)%5*5;for(var u=1,w=0;w<24;w++){for(var v=0,i=0,D=0;D<7;D++){if(u&1){var k=(1<>>24)&16711935|(u<<24|u>>>8)&4278255360,w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360;var v=l[o];v.high^=w,v.low^=u}for(var i=0;i<24;i++){for(var D=0;D<5;D++){for(var k=0,c=0,b=0;b<5;b++){var v=l[D+5*b];k^=v.high,c^=v.low}var x=p[D];x.high=k,x.low=c}for(var D=0;D<5;D++)for(var _=p[(D+4)%5],j=p[(D+1)%5],F=j.high,L=j.low,k=_.high^(F<<1|L>>>31),c=_.low^(L<<1|F>>>31),b=0;b<5;b++){var v=l[D+5*b];v.high^=k,v.low^=c}for(var X=1;X<25;X++){var k,c,v=l[X],z=v.high,H=v.low,G=a[X];G<32?(k=z<>>32-G,c=H<>>32-G):(k=H<>>64-G,c=z<>>64-G);var U=p[r[X]];U.high=k,U.low=c}var B=p[0],W=l[0];B.high=W.high,B.low=W.low;for(var D=0;D<5;D++)for(var b=0;b<5;b++){var X=D+5*b,v=l[X],te=p[X],de=p[(D+1)%5+5*b],fe=p[(D+2)%5+5*b];v.high=te.high^~de.high&fe.high,v.low=te.low^~de.low&fe.low}var v=l[0],be=f[i];v.high^=be.high,v.low^=be.low}},_doFinalize:function(){var E=this._data,y=E.words,l=this._nDataBytes*8,n=E.sigBytes*8,o=this.blockSize*32;y[n>>>5]|=1<<24-n%32,y[(m.ceil((n+1)/o)*o>>>5)-1]|=128,E.sigBytes=y.length*4,this._process();for(var u=this._state,w=this.cfg.outputLength/8,v=w/8,i=[],D=0;D>>24)&16711935|(c<<24|c>>>8)&4278255360,b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,i.push(b),i.push(c)}return new T.init(i,w)},clone:function(){for(var E=g.clone.call(this),y=E._state=this._state.slice(0),l=0;l<25;l++)y[l]=y[l].clone();return E}});S.SHA3=g._createHelper(d),S.HmacSHA3=g._createHmacHelper(d)}(Math),P.SHA3})},"5nXd":function(I,q,N){var P=N("MFOe"),m=P.slice,S=P.pluck,R=P.each,T=P.bind,g=P.create,C=P.isList,h=P.isFunction,s=P.isObject;I.exports={createStore:f};var a={version:"2.0.12",enabled:!1,get:function(p,d){var E=this.storage.read(this._namespacePrefix+p);return this._deserialize(E,d)},set:function(p,d){return d===void 0?this.remove(p):(this.storage.write(this._namespacePrefix+p,this._serialize(d)),d)},remove:function(p){this.storage.remove(this._namespacePrefix+p)},each:function(p){var d=this;this.storage.each(function(E,y){p.call(d,d._deserialize(E),(y||"").replace(d._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(p){return this._namespacePrefix=="__storejs_"+p+"_"},createStore:function(){return f.apply(this,arguments)},addPlugin:function(p){this._addPlugin(p)},namespace:function(p){return f(this.storage,this.plugins,p)}};function r(){var p=typeof console=="undefined"?null:console;if(!p)return;var d=p.warn?p.warn:p.log;d.apply(p,arguments)}function f(p,d,E){E||(E=""),p&&!C(p)&&(p=[p]),d&&!C(d)&&(d=[d]);var y=E?"__storejs_"+E+"_":"",l=E?new RegExp("^"+y):null,n=/^[a-zA-Z0-9_\-]*$/;if(!n.test(E))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:y,_namespaceRegexp:l,_testStorage:function(w){try{var v="__storejs__test__";w.write(v,v);var i=w.read(v)===v;return w.remove(v),i}catch(D){return!1}},_assignPluginFnProp:function(w,v){var i=this[v];this[v]=function(){var k=m(arguments,0),c=this;function b(){return i?(R(arguments,function(_,j){k[j]=_}),i.apply(c,k)):void 0}var x=[b].concat(k);return w.apply(c,x)}},_serialize:function(w){return JSON.stringify(w)},_deserialize:function(w,v){if(!w)return v;var i="";try{i=JSON.parse(w)}catch(D){i=w}return i!==void 0?i:v},_addStorage:function(w){if(this.enabled)return;this._testStorage(w)&&(this.storage=w,this.enabled=!0)},_addPlugin:function(w){var v=this;if(C(w)){R(w,function(k){v._addPlugin(k)});return}var i=S(this.plugins,function(k){return w===k});if(i)return;if(this.plugins.push(w),!h(w))throw new Error("Plugins must be function values that return objects");var D=w.call(this);if(!s(D))throw new Error("Plugins must return an object of function properties");R(D,function(k,c){if(!h(k))throw new Error("Bad plugin property: "+c+" from plugin "+w.name+". Plugins should only return functions.");v._assignPluginFnProp(k,c)})},addStorage:function(w){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(w)}},u=g(o,a,{plugins:[]});return u.raw={},R(u,function(w,v){h(w)&&(u.raw[v]=T(u,w))}),R(p,function(w){u._addStorage(w)}),R(d,function(w){u._addPlugin(w)}),u}},"7Cbv":function(I,q,N){"use strict";var P=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),m=new Uint8Array(16);function S(){if(!P)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return P(m)}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 T(p){return typeof p=="string"&&R.test(p)}for(var g=T,C=[],h=0;h<256;++h)C.push((h+256).toString(16).substr(1));function s(p){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,E=(C[p[d+0]]+C[p[d+1]]+C[p[d+2]]+C[p[d+3]]+"-"+C[p[d+4]]+C[p[d+5]]+"-"+C[p[d+6]]+C[p[d+7]]+"-"+C[p[d+8]]+C[p[d+9]]+"-"+C[p[d+10]]+C[p[d+11]]+C[p[d+12]]+C[p[d+13]]+C[p[d+14]]+C[p[d+15]]).toLowerCase();if(!g(E))throw TypeError("Stringified UUID is invalid");return E}var a=s;function r(p,d,E){p=p||{};var y=p.random||(p.rng||S)();if(y[6]=y[6]&15|64,y[8]=y[8]&63|128,d){E=E||0;for(var l=0;l<16;++l)d[E+l]=y[l];return d}return a(y)}var f=q.a=r},"7ahc":function(I,q,N){"use strict";N.d(q,"a",function(){return w});var P=N("k1fw"),m=N("0Owb"),S=N("+L6B"),R=N("2/Rp"),T=N("y8nQ"),g=N("Vl3Y"),C=N("tJVT"),h=N("OaEy"),s=N("2fM7"),a=N("q1tI"),r=N.n(a),f=N("VrN/"),p=N.n(f),d=N("p77/"),E=N.n(d),y=N("c5Ni"),l=N.n(y),n=s.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},u={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"]};q.b=function(v){var i=v.callback,D=v.onCancel,k=Object(a.useState)("python"),c=Object(C.a)(k,2),b=c[0],x=c[1];function _(F){x(u[F][1])}function j(F){i(F)}return r.a.createElement(g.a,Object(m.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:j}),r.a.createElement(g.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},r.a.createElement(s.a,{onChange:_},Object.keys(u).map(function(F){return r.a.createElement(n,{key:F,value:F},u[F][0])}))),r.a.createElement(g.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},r.a.createElement(w,{mode:b})),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:D},"\u53D6\u6D88")))};function w(v){var i=v.value,D=v.onChange,k=v.mode,c=v.options,b=c===void 0?{}:c,x=Object(a.useRef)(),_=Object(a.useState)(),j=Object(C.a)(_,2),F=j[0],L=j[1];return Object(a.useEffect)(function(){if(F){function X(z){var H=z.getValue();D&&D(H)}return F.on("change",X),function(){F.off("change",X)}}},[F,D]),Object(a.useEffect)(function(){F&&F.setOption("mode",k)},[F,k]),Object(a.useEffect)(function(){F&&((i!==F.getValue()||i==="")&&setTimeout(function(){F.setValue(i||" ")},300))},[F,i]),Object(a.useEffect)(function(){if(x.current&&!F){var X=p.a.fromTextArea(x.current,Object(P.a)({mode:k,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));L(X)}},[x.current,F]),r.a.createElement("div",{className:"my-codemirror-container"},r.a.createElement("textarea",{ref:x}))}},"7ixt":function(I,q,N){"use strict";N.d(q,"a",function(){return S});var P={adjustX:1,adjustY:1},m=[0,0],S={left:{points:["cr","cl"],overflow:P,offset:[-4,0],targetOffset:m},right:{points:["cl","cr"],overflow:P,offset:[4,0],targetOffset:m},top:{points:["bc","tc"],overflow:P,offset:[0,-4],targetOffset:m},bottom:{points:["tc","bc"],overflow:P,offset:[0,4],targetOffset:m},topLeft:{points:["bl","tl"],overflow:P,offset:[0,-4],targetOffset:m},leftTop:{points:["tr","tl"],overflow:P,offset:[-4,0],targetOffset:m},topRight:{points:["br","tr"],overflow:P,offset:[0,-4],targetOffset:m},rightTop:{points:["tl","tr"],overflow:P,offset:[4,0],targetOffset:m},bottomRight:{points:["tr","br"],overflow:P,offset:[0,4],targetOffset:m},rightBottom:{points:["bl","br"],overflow:P,offset:[4,0],targetOffset:m},bottomLeft:{points:["tl","bl"],overflow:P,offset:[0,4],targetOffset:m},leftBottom:{points:["br","bl"],overflow:P,offset:[-4,0],targetOffset:m}},R=S},"815F":function(I,q,N){"use strict";N.d(q,"e",function(){return C}),N.d(q,"c",function(){return s}),N.d(q,"d",function(){return a}),N.d(q,"a",function(){return f}),N.d(q,"f",function(){return p}),N.d(q,"b",function(){return d});var P=N("KQm4"),m=N("VTBJ"),S=N("Ff2n"),R=N("Zm9Q"),T=N("Kwbf"),g=N("OZM5");function C(E,y){return E!=null?E:y}function h(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=new Map;function l(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(u){var w=u.key,v=u.children;Object(T.a)(w!=null,"Tree node must have a certain key: [".concat(o).concat(w,"]"));var i=String(w);Object(T.a)(!y.has(i)||w===null||w===void 0,"Same 'key' exist in the Tree: ".concat(i)),y.set(i,!0),l(v,"".concat(o).concat(i," > "))})}l(E)}function s(E){function y(l){var n=Object(R.a)(l);return n.map(function(o){if(!Object(g.i)(o))return Object(T.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var u=o.key,w=o.props,v=w.children,i=Object(S.a)(w,["children"]),D=Object(m.a)({key:u},i),k=y(v);return k.length&&(D.children=k),D}).filter(function(o){return o})}return y(E)}function a(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(y===!0?[]:y),n=[];function o(u){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(v,i){var D=Object(g.h)(w?w.pos:"0",i),k=C(v.key,D),c=Object(m.a)(Object(m.a)({},v),{},{parent:w,pos:D,children:null,data:v,isStart:[].concat(Object(P.a)(w?w.isStart:[]),[i===0]),isEnd:[].concat(Object(P.a)(w?w.isEnd:[]),[i===u.length-1])});return n.push(c),y===!0||l.has(k)?c.children=o(v.children||[],c):c.children=[],c})}return o(E),n}function r(E,y,l){var n;l?typeof l=="string"?n=function(w){return w[l]}:typeof l=="function"&&(n=function(w){return l(w)}):n=function(w,v){return C(w.key,v)};function o(u,w,v){var i=u?u.children:E,D=u?Object(g.h)(v.pos,w):"0";if(u){var k=n(u,D),c={node:u,index:w,pos:D,key:k,parentPos:v.node?v.pos:null,level:v.level+1};y(c)}i&&i.forEach(function(b,x){o(b,x,{node:u,pos:D,level:v?v.level+1:-1})})}o(null)}function f(E){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=y.initWrapper,n=y.processEntity,o=y.onProcessFinished,u=arguments.length>2?arguments[2]:void 0,w={},v={},i={posEntities:w,keyEntities:v};return l&&(i=l(i)||i),r(E,function(D){var k=D.node,c=D.index,b=D.pos,x=D.key,_=D.parentPos,j=D.level,F={node:k,index:c,key:x,pos:b,level:j},L=C(x,b);w[b]=F,v[L]=F,F.parent=w[_],F.parent&&(F.parent.children=F.parent.children||[],F.parent.children.push(F)),n&&n(F,i)},u),o&&o(i),i}function p(E,y){var l=y.expandedKeys,n=y.selectedKeys,o=y.loadedKeys,u=y.loadingKeys,w=y.checkedKeys,v=y.halfCheckedKeys,i=y.dragOverNodeKey,D=y.dropPosition,k=y.keyEntities,c=k[E],b={eventKey:E,expanded:l.indexOf(E)!==-1,selected:n.indexOf(E)!==-1,loaded:o.indexOf(E)!==-1,loading:u.indexOf(E)!==-1,checked:w.indexOf(E)!==-1,halfChecked:v.indexOf(E)!==-1,pos:String(c?c.pos:""),dragOver:i===E&&D===0,dragOverGapTop:i===E&&D===-1,dragOverGapBottom:i===E&&D===1};return b}function d(E){var y=E.data,l=E.expanded,n=E.selected,o=E.checked,u=E.loaded,w=E.loading,v=E.halfChecked,i=E.dragOver,D=E.dragOverGapTop,k=E.dragOverGapBottom,c=E.pos,b=E.active,x=Object(m.a)(Object(m.a)({},y),{},{expanded:l,selected:n,checked:o,loaded:u,loading:w,halfChecked:v,dragOver:i,dragOverGapTop:D,dragOverGapBottom:k,pos:c,active:b});return"props"in x||Object.defineProperty(x,"props",{get:function(){return Object(T.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),E}}),x}},"8EBN":function(I,q,N){(function(P){P(N("VrN/"))})(function(P){"use strict";P.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 m=0;m-1&&R.substring(C+1,R.length);if(h)return P.findModeByExtension(h)},P.findModeByName=function(R){R=R.toLowerCase();for(var T=0;T=ee.length?ye.slice(ee.length):ye}).join(` `)}var l=[],n=["
    "],o=new d.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){l.length=0,n=["
      "]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function i(ce,K,Y,ee){if(K>=ce.length||ce[K].level<=Y)return K;var ye=ce[K];ee.push("
    • "+ye.text+""),K++;var se=[];return K=i(ce,K,ye.level,se),se.length>0&&(ee.push("
        "),se.forEach(function(Pe){ee.push(Pe)}),ee.push("
      ")),ee.push("
    • "),K=i(ce,K,Y,ee),K}function D(){return i(l,0,0,n),n.push("
    "),n.join("")}var k={heading:function(K){var Y=u.exec(K);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},fences:function(K){var Y=this.rules.block.fences.exec(K);if(Y){var ee=Y[0],ye=y(ee,Y[3]||""),se=Y[2]?Y[2].trim():Y[2];if(["latex","katex","math"].indexOf(se)>=0){var Pe=x(),Ze=ye;ye=Pe,_[Pe]={type:"block",expression:Ze}}return{type:"code",raw:ee,lang:se,text:ye}}}},c=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,x=function(){return"__special_katext_id_".concat(b++,"__")},_={};function j(){return _}function F(){b=0,_={}}function L(ce){return ce=ce.replace(c,function(K,Y){var ee=x();return _[ee]={type:"inline",expression:Y},ee}),ce}var X=o.listitem;o.listitem=function(ce){return X(L(ce))};var z=o.paragraph;o.paragraph=function(ce){return z(L(ce))};var H=o.tablecell;o.tablecell=function(ce,K){return H(L(ce),K)},o.code=function(ce,K,Y){var ee=(K||"").match(/\S*/)[0];return ee?["latex","katex","math"].indexOf(ee)>=0?"

    ".concat(ce,"

    "):'
    ').concat(Y?ce:Object(E.escape)(ce,!0),`
    `):'
    '+(Y?ce:Object(E.escape)(ce,!0))+"
    "},o.heading=function(ce,K,Y){var ee=this.options.headerPrefix+Y.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:ee,level:K,text:ce}),"'+ce+""},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:k,renderer:o});var G=d.a,U=N("SJMd"),B=N("ulZh"),W=N.n(B),te=N("m3rI"),de=N("Oy/b"),fe=N("p5ED"),be=N("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 Ce=function(ce,K){return(Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,ee){Y.__proto__=ee}||function(Y,ee){for(var ye in ee)Object.prototype.hasOwnProperty.call(ee,ye)&&(Y[ye]=ee[ye])})(ce,K)};function ue(ce,K){function Y(){this.constructor=ce}Ce(ce,K),ce.prototype=K===null?Object.create(K):(Y.prototype=K.prototype,new Y)}function ge(ce,K,Y,ee){return new(Y||(Y=Promise))(function(ye,se){function Pe(Tt){try{mt(ee.next(Tt))}catch(et){se(et)}}function Ze(Tt){try{mt(ee.throw(Tt))}catch(et){se(et)}}function mt(Tt){var et;Tt.done?ye(Tt.value):(et=Tt.value,et instanceof Y?et:new Y(function(kt){kt(et)})).then(Pe,Ze)}mt((ee=ee.apply(ce,K||[])).next())})}function pe(ce,K){var Y,ee,ye,se,Pe={label:0,sent:function(){if(1&ye[0])throw ye[1];return ye[1]},trys:[],ops:[]};return se={next:Ze(0),throw:Ze(1),return:Ze(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Ze(mt){return function(Tt){return function(et){if(Y)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(Y=1,ee&&(ye=2&et[0]?ee.return:et[0]?ee.throw||((ye=ee.return)&&ye.call(ee),0):ee.next)&&!(ye=ye.call(ee,et[1])).done)return ye;switch(ee=0,ye&&(et=[2&et[0],ye.value]),et[0]){case 0:case 1:ye=et;break;case 4:return Pe.label++,{value:et[1],done:!1};case 5:Pe.label++,ee=et[1],et=[0];continue;case 7:et=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(ye=Pe.trys,(ye=ye.length>0&&ye[ye.length-1])||et[0]!==6&&et[0]!==2)){Pe=0;continue}if(et[0]===3&&(!ye||et[1]>ye[0]&&et[1]',"select"),this.addActionButton(ee,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ee,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ee,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ee,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ee,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ee,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ee,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(se){var Pe=document.createElement("div");Pe.className=""+Y.toolbarButtonStyleClass.name,Pe.setAttribute("data-type-name",se.typeName),Pe.innerHTML=se.icon,Pe.addEventListener("click",function(){Y.markerToolbarButtonClicked(Pe,se)}),Y.buttons.push(Pe),Y.markerButtons.push(Pe)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ye=document.createElement("div");ye.className=this.toolbarBlockStyleClass.name,ye.style.whiteSpace="nowrap",ye.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ye),this.addActionButton(ye,'',"render"),this.addActionButton(ye,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ce.prototype.addButtonClickListener=function(K){this.buttonClickListeners.push(K)},ce.prototype.removeButtonClickListener=function(K){this.buttonClickListeners.indexOf(K)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(K),1)},ce.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ce.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var K=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Y=0;Y0&&this.buttonClickListeners.forEach(function(ee){return ee("marker",Y)}),this.markerButtonOverflowBlock.style.display="none"},ce.prototype.actionToolbarButtonClicked=function(K,Y){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("action",Y)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ce.prototype.setActiveButton=function(K){this.resetButtonStyles(),K.className=K.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),K.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ce.prototype.setActiveMarkerButton=function(K){var Y=this.markerButtons.find(function(ee){return ee.getAttribute("data-type-name")===K});Y&&this.setActiveButton(Y)},ce.prototype.setCurrentMarker=function(K){var Y=this;this.currentMarker=K,this.buttons.filter(function(ee){return/delete|notes/.test(ee.getAttribute("data-action"))}).forEach(function(ee){Y.currentMarker===void 0?(ee.style.fillOpacity="0.4",ee.style.pointerEvents="none"):(ee.style.fillOpacity="1",ee.style.pointerEvents="all")})},ce}(),V=function(){function ce(K,Y,ee,ye){this.panels=[],this.panelButtons=[],this.markerjsContainer=K,this.displayMode=Y,this.uiStyleSettings=ee,this.styles=ye,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ce.prototype.addStyles=function(){var K;this.toolboxStyleClass=this.styles.addClass(new ne("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 ne("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var Y=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ne("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ne("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ne("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 ne("toolbox-panel-row_colors",` background-color: `+((K=this.uiStyleSettings.toolboxBackgroundColor)!==null&&K!==void 0?K:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new ne("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*Y)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*Y)+`px; padding: `+Y+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new we("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new we("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},ce.prototype.show=function(K){var Y;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=K,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ce.prototype.setPanelButtons=function(K){var Y,ee,ye=this;this.panels=K,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ee=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ee!==void 0?ee:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(se){var Pe;se.uiStyleSettings=ye.uiStyleSettings;var Ze=document.createElement("div");Ze.className=ye.toolboxButtonStyleClass.name+" "+((Pe=ye.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:ye.toolboxButtonStyleColorsClass.name),Ze.innerHTML=se.icon,Ze.title=se.title,Ze.addEventListener("click",function(){ye.panelButtonClick(se)}),ye.panelButtons.push(Ze),ye.buttonRow.appendChild(Ze)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ce.prototype.panelButtonClick=function(K){var Y=this,ee=-1;if(K!==this.activePanel){ee=this.panels.indexOf(K),this.panelRow.innerHTML="";var ye=K.getUi();ye.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ye),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=K}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Y.displayMode==="inline"?Y.panelRow.style.display="none":Y.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,Pe){var Ze,mt;se.className=Y.toolboxButtonStyleClass.name+" "+(Pe===ee?""+((Ze=Y.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ze!==void 0?Ze:Y.toolboxActiveButtonStyleColorsClass.name):""+((mt=Y.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&mt!==void 0?mt:Y.toolboxButtonStyleColorsClass.name))})},ce}(),Z=function(ce,K){this.title=ce,this.icon=K},Ee=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'')||this;return Pe.colors=[],Pe.addTransparent=!1,Pe.colorBoxes=[],Pe.colors=ee,Pe.currentColor=ye,Pe.setCurrentColor=Pe.setCurrentColor.bind(Pe),Pe.getColorBox=Pe.getColorBox.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.whiteSpace="nowrap",this.colors.forEach(function(ye){var se=Y.getColorBox(ye);ee.appendChild(se),Y.colorBoxes.push(se)}),ee},K.prototype.getColorBox=function(Y){var ee=this,ye=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-ye,Pe=document.createElement("div");Pe.style.display="inline-block",Pe.style.boxSizing="content-box",Pe.style.width=se-2+"px",Pe.style.height=se-2+"px",Pe.style.padding="1px",Pe.style.marginRight="2px",Pe.style.marginBottom="2px",Pe.style.borderWidth="2px",Pe.style.borderStyle="solid",Pe.style.borderRadius=(se+2)/2+"px",Pe.style.borderColor=Y===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Pe.addEventListener("click",function(){ee.setCurrentColor(Y,Pe)});var Ze=document.createElement("div");return Ze.style.display="inline-block",Ze.style.width=se-2+"px",Ze.style.height=se-2+"px",Ze.style.backgroundColor=Y,Ze.style.borderRadius=se/2+"px",Y==="transparent"&&(Ze.style.fill=this.uiStyleSettings.toolboxAccentColor,Ze.innerHTML=` `),Pe.appendChild(Ze),Pe},K.prototype.setCurrentColor=function(Y,ee){var ye=this;this.currentColor=Y,this.colorBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Y)},K}(Z),xe=function(){function ce(K,Y,ee){this._state="new",this._isSelected=!1,this._container=K,this._overlayContainer=Y,this.globalSettings=ee,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ce.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ce.prototype.ownsTarget=function(K){return!1},Object.defineProperty(ce.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ce.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ce.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ce.prototype.pointerDown=function(K,Y){},ce.prototype.dblClick=function(K,Y){},ce.prototype.manipulate=function(K){},ce.prototype.pointerUp=function(K){this.stateChanged()},ce.prototype.dispose=function(){},ce.prototype.addMarkerVisualToContainer=function(K){this.container.childNodes.length>0?this.container.insertBefore(K,this.container.childNodes[0]):this.container.appendChild(K)},ce.prototype.getState=function(){return{typeName:ce.typeName,state:this.state,notes:this.notes}},ce.prototype.restoreState=function(K){this._state=K.state,this.notes=K.notes},ce.prototype.scale=function(K,Y){},ce.prototype.colorChanged=function(K){this.onColorChanged&&this.onColorChanged(K),this.stateChanged()},ce.prototype.fillColorChanged=function(K){this.onFillColorChanged&&this.onFillColorChanged(K),this.stateChanged()},ce.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var K=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),K.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(K)&&this.onStateChanged(this)}},ce.typeName="MarkerBase",ce}(),_e=function(){function ce(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ce.prototype.findGripByVisual=function(K){return this.topLeft.ownsTarget(K)?this.topLeft:this.topCenter.ownsTarget(K)?this.topCenter:this.topRight.ownsTarget(K)?this.topRight:this.centerLeft.ownsTarget(K)?this.centerLeft:this.centerRight.ownsTarget(K)?this.centerRight:this.bottomLeft.ownsTarget(K)?this.bottomLeft:this.bottomCenter.ownsTarget(K)?this.bottomCenter:this.bottomRight.ownsTarget(K)?this.bottomRight:void 0},ce}(),je=function(){function ce(){this.GRIP_SIZE=10,this.visual=ae.createGroup(),this.visual.appendChild(ae.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ae.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ce.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},ce}(),Be=function(){function ce(){}return ce.toITransformMatrix=function(K){return{a:K.a,b:K.b,c:K.c,d:K.d,e:K.e,f:K.f}},ce.toSVGMatrix=function(K,Y){return K.a=Y.a,K.b=Y.b,K.c=Y.c,K.d=Y.d,K.e=Y.e,K.f=Y.f,K},ce}(),He=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.left=0,se.top=0,se.width=0,se.height=0,se.defaultSize={x:50,y:20},se.offsetX=0,se.offsetY=0,se.rotationAngle=0,se.CB_DISTANCE=10,se._suppressMarkerCreateEvent=!1,se.container.transform.baseVal.appendItem(ae.createTransform()),se.setupControlBox(),se}return ue(K,ce),Object.defineProperty(K.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"visual",{get:function(){return this._visual},set:function(Y){this._visual=Y;var ee=ae.createTransform();this._visual.transform.baseVal.appendItem(ee)},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(Y){return!!ce.prototype.ownsTarget.call(this,Y)||!!(this.controlGrips.findGripByVisual(Y)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Y))},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="new"&&(this.left=Y.x,this.top=Y.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ye=this.unrotatePoint(Y);if(this.manipulationStartX=ye.x,this.manipulationStartY=ye.y,this.offsetX=ye.x-this.left,this.offsetY=ye.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ee),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ee)){this.activeGrip=this.rotatorGrip;var se=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=se.x-this.width/2,this.top=se.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Pe=this.container.transform.baseVal.getItem(0);Pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},K.prototype.pointerUp=function(Y){var ee=this.state;ce.prototype.pointerUp.call(this,Y),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Y),this._state="select",ee==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},K.prototype.moveVisual=function(Y){this.visual.style.transform="translate("+Y.x+"px, "+Y.y+"px)"},K.prototype.manipulate=function(Y){var ee=this.unrotatePoint(Y);this.state==="creating"?this.resize(Y):this.state==="move"?(this.left=this.manipulationStartLeft+(ee.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ee.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ee):this.state==="rotate"&&this.rotate(Y)},K.prototype.resize=function(Y){var ee=this.manipulationStartLeft,ye=this.manipulationStartWidth,se=this.manipulationStartTop,Pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ee=this.manipulationStartLeft+Y.x-this.manipulationStartX,ye=this.manipulationStartWidth+this.manipulationStartLeft-ee;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ye=this.manipulationStartWidth+Y.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+Y.y-this.manipulationStartY,Pe=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Pe=this.manipulationStartHeight+Y.y-this.manipulationStartY}ye>=0?(this.left=ee,this.width=ye):(this.left=ee+ye,this.width=-ye),Pe>=0?(this.top=se,this.height=Pe):(this.top=se+Pe,this.height=-Pe),this.setSize()},K.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},K.prototype.rotate=function(Y){if(Math.abs(Y.x-this.centerX)>.1){var ee=Math.sign(Y.x-this.centerX);this.rotationAngle=180*Math.atan((Y.y-this.centerY)/(Y.x-this.centerX))/Math.PI+90*ee,this.applyRotation()}},K.prototype.applyRotation=function(){var Y=this.container.transform.baseVal.getItem(0);Y.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Y,0)},K.prototype.rotatePoint=function(Y){if(this.rotationAngle===0)return Y;var ee=this.container.getCTM(),ye=ae.createPoint(Y.x,Y.y);return{x:(ye=ye.matrixTransform(ee)).x,y:ye.y}},K.prototype.unrotatePoint=function(Y){if(this.rotationAngle===0)return Y;var ee=this.container.getCTM();ee=ee.inverse();var ye=ae.createPoint(Y.x,Y.y);return{x:(ye=ye.matrixTransform(ee)).x,y:ye.y}},K.prototype.select=function(){ce.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},K.prototype.deselect=function(){ce.prototype.deselect.call(this),this.controlBox.style.display="none"},K.prototype.setupControlBox=function(){this.controlBox=ae.createGroup();var Y=ae.createTransform();Y.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Y),this.container.appendChild(this.controlBox),this.controlRect=ae.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=ae.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 _e,this.addControlGrips(),this.controlBox.style.display="none"},K.prototype.adjustControlBox=function(){var Y=this.controlBox.transform.baseVal.getItem(0);Y.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Y,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()},K.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()},K.prototype.createGrip=function(){var Y=new je;return Y.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(Y.visual),Y},K.prototype.positionGrips=function(){var Y=this.controlGrips.topLeft.GRIP_SIZE,ee=-Y/2,ye=ee,se=(this.width+this.CB_DISTANCE)/2-Y/2,Pe=(this.height+this.CB_DISTANCE)/2-Y/2,Ze=this.height+this.CB_DISTANCE-Y/2,mt=this.width+this.CB_DISTANCE-Y/2;this.positionGrip(this.controlGrips.topLeft.visual,ee,ye),this.positionGrip(this.controlGrips.topCenter.visual,se,ye),this.positionGrip(this.controlGrips.topRight.visual,mt,ye),this.positionGrip(this.controlGrips.centerLeft.visual,ee,Pe),this.positionGrip(this.controlGrips.centerRight.visual,mt,Pe),this.positionGrip(this.controlGrips.bottomLeft.visual,ee,Ze),this.positionGrip(this.controlGrips.bottomCenter.visual,se,Ze),this.positionGrip(this.controlGrips.bottomRight.visual,mt,Ze),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,ye-3*this.CB_DISTANCE)},K.prototype.positionGrip=function(Y,ee,ye){var se=Y.transform.baseVal.getItem(0);se.setTranslate(ee,ye),Y.transform.baseVal.replaceItem(se,0)},K.prototype.hideControlBox=function(){this.controlBox.style.display="none"},K.prototype.showControlBox=function(){this.controlBox.style.display=""},K.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Be.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Be.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ce.prototype.getState.call(this))},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;this.left=ee.left,this.top=ee.top,this.width=ee.width,this.height=ee.height,this.rotationAngle=ee.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Be.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ee.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Be.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ee.containerTransformMatrix))},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee);var ye=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:ye.x*Y,y:ye.y*ee});this.left=se.x,this.top=se.y,this.width=this.width*Y,this.height=this.height*ee,this.adjustControlBox()},K}(xe),Ue=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.createVisual=se.createVisual.bind(se),se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual)},K.prototype.createVisual=function(){this.visual=ae.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)},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(Y),this._state="creating")},K.prototype.manipulate=function(Y){ce.prototype.manipulate.call(this,Y)},K.prototype.resize=function(Y){ce.prototype.resize.call(this,Y),this.setSize()},K.prototype.setSize=function(){ce.prototype.setSize.call(this),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},K.prototype.pointerUp=function(Y){ce.prototype.pointerUp.call(this,Y),this.setSize()},K.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Y),this.stateChanged()},K.prototype.setFillColor=function(Y){this.fillColor=Y,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},K.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},K.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},K.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ce.prototype.getState.call(this))},K.prototype.restoreState=function(Y){var ee=Y;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),ce.prototype.restoreState.call(this,Y),this.setSize()},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee),this.setSize()},K.title="Rectangle marker",K}(He),ze=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'')||this;return Pe.widths=[],Pe.widthBoxes=[],Pe.widths=ee,Pe.currentWidth=ye,Pe.setCurrentWidth=Pe.setCurrentWidth.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.widths.forEach(function(ye){var se=document.createElement("div");se.style.display="flex",se.style.flexGrow="2",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=ye===Y.currentWidth?Y.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){Y.setCurrentWidth(ye,se)}),ee.appendChild(se);var Pe=document.createElement("div");Pe.innerText=ye.toString(),Pe.style.marginRight="5px",se.appendChild(Pe);var Ze=document.createElement("div");Ze.style.minHeight="20px",Ze.style.flexGrow="2",Ze.style.display="flex",Ze.style.alignItems="center";var mt=document.createElement("hr");mt.style.minWidth="20px",mt.style.border="0px",mt.style.borderTop=ye+"px solid "+Y.uiStyleSettings.toolboxColor,mt.style.flexGrow="2",Ze.appendChild(mt),se.appendChild(Ze),Y.widthBoxes.push(se)}),ee},K.prototype.setCurrentWidth=function(Y,ee){var ye=this;this.currentWidth=Y,this.widthBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},K}(Z),Ge=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'')||this;return Pe.styles=[],Pe.styleBoxes=[],Pe.styles=ee,Pe.currentStyle=ye,Pe.setCurrentStyle=Pe.setCurrentStyle.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.styles.forEach(function(ye){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/Y.styles.length-5+"%",se.style.borderColor=ye===Y.currentStyle?Y.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){Y.setCurrentStyle(ye,se)}),ee.appendChild(se);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.overflow="hidden";var Ze=` `;Pe.innerHTML=Ze,se.appendChild(Pe),Y.styleBoxes.push(se)}),ee},K.prototype.setCurrentStyle=function(Y,ee){var ye=this;this.currentStyle=Y,this.styleBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},K}(Z),Ye=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.strokeColor=ye.defaultColor,se.strokeWidth=ye.defaultStrokeWidth,se.strokeDasharray=ye.defaultStrokeDasharray,se.strokePanel=new Ee("Line color",ye.defaultColorSet,ye.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new Ge("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return ue(K,ce),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},K.typeName="FrameMarker",K.title="Frame marker",K.icon='',K}(Ue),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},tt=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.x1=0,se.y1=0,se.x2=0,se.y2=0,se.defaultLength=50,se.manipulationStartX=0,se.manipulationStartY=0,se.manipulationStartX1=0,se.manipulationStartY1=0,se.manipulationStartX2=0,se.manipulationStartY2=0,se.setupControlBox(),se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!!ce.prototype.ownsTarget.call(this,Y)||!(!this.grip1.ownsTarget(Y)&&!this.grip2.ownsTarget(Y))},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.manipulationStartX=Y.x,this.manipulationStartY=Y.y,this.state==="new"&&(this.x1=Y.x,this.y1=Y.y,this.x2=Y.x,this.y2=Y.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(ee)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ee)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},K.prototype.pointerUp=function(Y){var ee=this.state;ce.prototype.pointerUp.call(this,Y),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(Y),this._state="select",ee==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},K.prototype.adjustVisual=function(){},K.prototype.manipulate=function(Y){this.state==="creating"?this.resize(Y):this.state==="move"?(this.x1=this.manipulationStartX1+Y.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Y.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Y.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Y.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Y)},K.prototype.resize=function(Y){switch(this.activeGrip){case this.grip1:this.x1=Y.x,this.y1=Y.y;break;case this.grip2:case void 0:this.x2=Y.x,this.y2=Y.y}this.adjustVisual(),this.adjustControlBox()},K.prototype.select=function(){ce.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},K.prototype.deselect=function(){ce.prototype.deselect.call(this),this.controlBox.style.display="none"},K.prototype.setupControlBox=function(){this.controlBox=ae.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},K.prototype.adjustControlBox=function(){this.positionGrips()},K.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},K.prototype.createGrip=function(){var Y=new je;return Y.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(Y.visual),Y},K.prototype.positionGrips=function(){var Y=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Y/2,this.y1-Y/2),this.positionGrip(this.grip2.visual,this.x2-Y/2,this.y2-Y/2)},K.prototype.positionGrip=function(Y,ee,ye){var se=Y.transform.baseVal.getItem(0);se.setTranslate(ee,ye),Y.transform.baseVal.replaceItem(se,0)},K.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ce.prototype.getState.call(this))},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;this.x1=ee.x1,this.y1=ee.y1,this.x2=ee.x2,this.y2=ee.y2},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee),this.x1=this.x1*Y,this.y1=this.y1*ee,this.x2=this.x2*Y,this.y2=this.y2*ee,this.adjustVisual(),this.adjustControlBox()},K}(xe),rt=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.strokeColor=ye.defaultColor,se.strokeWidth=ye.defaultStrokeWidth,se.strokeDasharray=ye.defaultStrokeDasharray,se.strokePanel=new Ee("Line color",ye.defaultColorSet,ye.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new Ge("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.selectorLine&&Y!==this.visibleLine)},K.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorLine=ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ae.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)},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},K.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()),ae.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},K.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.adjustVisual(),this.colorChanged(Y)},K.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.adjustVisual()},K.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.adjustVisual(),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.createVisual(),this.adjustVisual()},K.typeName="LineMarker",K.title="Line marker",K.icon='',K}(tt),We=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'')||this;return Pe.fonts=[],Pe.fontBoxes=[],Pe.fonts=ee,Pe.currentFont=ye,Pe.setCurrentFont=Pe.setCurrentFont.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.flexGrow="2",this.fonts.forEach(function(ye){var se=document.createElement("div");se.style.display="inline-block",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/Y.fonts.length-5+"%",se.style.borderColor=ye===Y.currentFont?Y.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){Y.setCurrentFont(ye,se)}),ee.appendChild(se);var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.fontFamily=ye,Pe.style.overflow="hidden";var Ze=document.createElement("div");Ze.style.whiteSpace="nowrap",Ze.style.overflow="hidden",Ze.style.textOverflow="ellipsis",Ze.innerHTML="The quick brown fox jumps over the lazy dog",Pe.appendChild(Ze),se.appendChild(Pe),Y.fontBoxes.push(se)}),ee},K.prototype.setCurrentFont=function(Y,ee){var ye=this;this.currentFont=Y,this.fontBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},K}(Z),$e=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=ye.defaultColor,se.fontFamily=ye.defaultFontFamily,se.defaultSize={x:100,y:30},se.setColor=se.setColor.bind(se),se.setFont=se.setFont.bind(se),se.renderText=se.renderText.bind(se),se.sizeText=se.sizeText.bind(se),se.textEditDivClicked=se.textEditDivClicked.bind(se),se.showTextEditor=se.showTextEditor.bind(se),se.setSize=se.setSize.bind(se),se.positionTextEditor=se.positionTextEditor.bind(se),se.colorPanel=new Ee("Color",ye.defaultColorSet,ye.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new We("Font",ye.defaultFontFamilies,ye.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){if(ce.prototype.ownsTarget.call(this,Y)||Y===this.visual||Y===this.textElement||Y===this.bgRectangle)return!0;var ee=!1;return this.textElement.childNodes.forEach(function(ye){ye===Y&&(ee=!0)}),ee},K.prototype.createVisual=function(){this.visual=ae.createGroup(),this.bgRectangle=ae.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ae.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.isMoved=!1,this.pointerDownPoint=Y,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Y),this._state="creating")},K.prototype.renderText=function(){var Y=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(ee){Y.textElement.appendChild(ae.createTSpan(ee.trim()===""?" ":ee.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},K.prototype.getTextScale=function(){var Y=this.textElement.getBBox(),ee=1;if(Y.width>0&&Y.height>0){var ye=(1*this.width-this.width*this.padding*2/100)/Y.width,se=(1*this.height-this.height*this.padding*2/100)/Y.height;ee=Math.min(ye,se)}return ee},K.prototype.getTextPosition=function(Y){var ee=this.textElement.getBBox(),ye=0,se=0;return ee.width>0&&ee.height>0&&(ye=(this.width-ee.width*Y)/2,se=this.height/2-ee.height*Y/2),{x:ye,y:se}},K.prototype.sizeText=function(){var Y=this.textElement.getBBox(),ee=this.getTextScale(),ye=this.getTextPosition(ee);ye.y-=Y.y*ee,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ye.x+"px, "+ye.y+"px) scale("+ee+", "+ee+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ye.x,ye.y),this.textElement.transform.baseVal.getItem(1).setScale(ee,ee))},K.prototype.manipulate=function(Y){ce.prototype.manipulate.call(this,Y),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Y.x-this.pointerDownPoint.x)>5||Math.abs(Y.y-this.pointerDownPoint.y)>5)},K.prototype.resize=function(Y){ce.prototype.resize.call(this,Y),this.isMoved=!0,this.setSize(),this.sizeText()},K.prototype.setSize=function(){ce.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},K.prototype.pointerUp=function(Y){var ee=this.state;ee==="creating"&&(this._suppressMarkerCreateEvent=!0),ce.prototype.pointerUp.call(this,Y),this.setSize(),(ee==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},K.prototype.showTextEditor=function(){var Y=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(ee){ee.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ee=Number.parseFloat(Y.textEditor.style.fontSize);Y.textEditor.clientWidth>=Number.parseInt(Y.textEditor.style.maxWidth)&&ee>.9;)ee-=.1,Y.textEditor.style.fontSize=Math.max(ee,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ee){ee.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ee){if(ee.clipboardData){var ye=ee.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(ye)),ee.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Y.textEditDivClicked(Y.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},K.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Y=this.getTextScale(),ee=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ye=this.textElement.getBBox(),se={x:ye.width*Y,y:ye.height*Y};ee.x-=se.x/2,ee.y-=se.y/2,this.textEditor.style.top=ee.y+"px",this.textEditor.style.left=ee.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ee.x+"px",this.textEditor.style.fontSize=Math.max(16*Y,12)+"px",this.textElement.style.display="none"}},K.prototype.textEditDivClicked=function(Y){this.text=Y.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},K.prototype.select=function(){ce.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},K.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ce.prototype.deselect.call(this)},K.prototype.dblClick=function(Y,ee){ce.prototype.dblClick.call(this,Y,ee),this.showTextEditor()},K.prototype.setColor=function(Y){this.textElement&&ae.setAttributes(this.textElement,[["fill",Y]]),this.color=Y,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Y)},K.prototype.setFont=function(Y){this.textElement&&ae.setAttributes(this.textElement,[["font-family",Y]]),this.fontFamily=Y,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},K.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},K.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){var ee=Y;this.color=ee.color,this.fontFamily=ee.fontFamily,this.padding=ee.padding,this.text=ee.text,this.createVisual(),ce.prototype.restoreState.call(this,Y),this.setSize()},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee),this.setSize(),this.sizeText(),this.positionTextEditor()},K.typeName="TextMarker",K.title="Text marker",K.icon='',K}(He),Ie=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=ye.defaultColor,se.lineWidth=ye.defaultStrokeWidth,se.pixelRatio=ye.freehandPixelRatio,se.setColor=se.setColor.bind(se),se.addCanvas=se.addCanvas.bind(se),se.finishCreation=se.finishCreation.bind(se),se.setLineWidth=se.setLineWidth.bind(se),se.colorPanel=new Ee("Color",ye.defaultColorSet,ye.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.drawingImage)},K.prototype.createVisual=function(){this.visual=ae.createGroup(),this.drawingImage=ae.createImage(),this.visual.appendChild(this.drawingImage);var Y=ae.createTransform();this.visual.transform.baseVal.appendItem(Y),this.addMarkerVisualToContainer(this.visual)},K.prototype.pointerDown=function(Y,ee){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(Y.x,Y.y),this.drawing=!0):ce.prototype.pointerDown.call(this,Y,ee)},K.prototype.manipulate=function(Y){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Y.x,Y.y),this.canvasContext.stroke()):ce.prototype.manipulate.call(this,Y)},K.prototype.resize=function(Y){ce.prototype.resize.call(this,Y),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},K.prototype.pointerUp=function(Y){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ce.prototype.pointerUp.call(this,Y)},K.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)},K.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ce.prototype.select.call(this)},K.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ce.prototype.deselect.call(this)},K.prototype.finishCreation=function(){for(var Y=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ee=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ye=ee[0],se=ee[1],Pe=ee[2],Ze=ee[3],mt=!1,Tt=0;Tt0&&(mt=!0,TtZe&&(Ze=Tt),et>Pe&&(Pe=et));if(mt){this.left=ye/this.pixelRatio,this.top=se/this.pixelRatio,this.width=(Pe-ye)/this.pixelRatio,this.height=(Ze-se)/this.pixelRatio;var kt=document.createElement("canvas");kt.width=Pe-ye,kt.height=Ze-se,kt.getContext("2d").putImageData(this.canvasContext.getImageData(ye,se,Pe-ye,Ze-se),0,0),this.drawingImgUrl=kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},K.prototype.setDrawingImage=function(){ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},K.prototype.setColor=function(Y){this.color=Y,this.colorChanged(Y)},K.prototype.setLineWidth=function(Y){this.lineWidth=Y},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=Object.assign({drawingImgUrl:this.drawingImgUrl},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){this.createVisual(),ce.prototype.restoreState.call(this,Y),this.drawingImgUrl=Y.drawingImgUrl,this.setDrawingImage()},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee),this.setDrawingImage()},K.typeName="FreehandMarker",K.title="Freehand marker",K.icon='',K}(He),Oe=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ye||'')||this;return se.typeBoxes=[],se.currentType=ee,se.setCurrentType=se.setCurrentType.bind(se),se}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2";for(var ye=function(Ze){var mt="both";switch(Ze){case 0:mt="both";break;case 1:mt="start";break;case 2:mt="end";break;case 3:mt="none"}var Tt=document.createElement("div");if(Tt.style.display="flex",Tt.style.flexGrow="2",Tt.style.alignItems="center",Tt.style.justifyContent="space-between",Tt.style.padding="5px",Tt.style.borderWidth="2px",Tt.style.borderStyle="solid",Tt.style.borderColor=mt===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",Tt.addEventListener("click",function(){Y.setCurrentType(mt,Tt)}),ee.appendChild(Tt),mt==="both"||mt==="start"){var et=document.createElement("div");et.style.display="flex",et.style.alignItems="center",et.style.minHeight="20px",et.innerHTML=` `,et.style.marginLeft="5px",Tt.appendChild(et)}var kt=document.createElement("div");kt.style.display="flex",kt.style.alignItems="center",kt.style.minHeight="20px",kt.style.flexGrow="2";var Zt=document.createElement("hr");if(Zt.style.minWidth="20px",Zt.style.border="0px",Zt.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),Zt.style.flexGrow="2",kt.appendChild(Zt),Tt.appendChild(kt),mt==="both"||mt==="end"){var Yt=document.createElement("div");Yt.style.display="flex",Yt.style.alignItems="center",Yt.style.minHeight="20px",Yt.innerHTML=` `,Yt.style.marginRight="5px",Tt.appendChild(Yt)}se.typeBoxes.push(Tt)},se=this,Pe=0;Pe<4;Pe++)ye(Pe);return ee},K.prototype.setCurrentType=function(Y,ee){var ye=this;this.currentType=Y,this.typeBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings!==void 0?ye.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},K}(Z),Le=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.arrowType="end",se.arrowBaseHeight=10,se.arrowBaseWidth=10,se.getArrowPoints=se.getArrowPoints.bind(se),se.setArrowType=se.setArrowType.bind(se),se.arrowTypePanel=new Oe("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.arrow1&&Y!==this.arrow2)},K.prototype.getArrowPoints=function(Y,ee){var ye=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return Y-ye/2+","+(ee+se/2)+" "+Y+","+(ee-se/2)+" "+(Y+ye/2)+","+(ee+se/2)},K.prototype.createTips=function(){this.arrow1=ae.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ae.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow2)},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="creating"&&this.createTips()},K.prototype.adjustVisual=function(){if(ce.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",ae.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ae.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var Y=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ee=this.arrow1.transform.baseVal.getItem(0);ee.setRotate(Y,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ee,0);var ye=this.arrow2.transform.baseVal.getItem(0);ye.setRotate(Y+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ye,0)}},K.prototype.setArrowType=function(Y){this.arrowType=Y,this.adjustVisual(),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=Object.assign({arrowType:this.arrowType},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;this.arrowType=ee.arrowType,this.createTips(),this.adjustVisual()},K.typeName="ArrowMarker",K.title="Arrow marker",K.icon='',K}(rt),Te=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.fillColor=ye.defaultFillColor,se.strokeWidth=0,se.fillPanel=new Ee("Color",ye.defaultColorSet,ye.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return ue(K,ce),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},K.typeName="CoverMarker",K.title="Cover marker",K.icon='',K}(Ue),Ae=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'')||this;return Pe.opacities=[],Pe.opacityBoxes=[],Pe.opacities=ee,Pe.currentOpacity=ye,Pe.setCurrentOpacity=Pe.setCurrentOpacity.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",ee.style.justifyContent="space-between",this.opacities.forEach(function(ye){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=ye===Y.currentOpacity?Y.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){Y.setCurrentOpacity(ye,se)}),ee.appendChild(se);var Pe=document.createElement("div");Pe.innerText=100*ye+"%",se.appendChild(Pe),Y.opacityBoxes.push(se)}),ee},K.prototype.setCurrentOpacity=function(Y,ee){var ye=this;this.currentOpacity=Y,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},K}(Z),ke=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=ye.defaultHighlightColor,se.strokeWidth=0,se.opacity=ye.defaultHighlightOpacity,se.fillPanel=new Ee("Color",ye.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ae("Opacity",ye.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return ue(K,ce),K.prototype.setOpacity=function(Y){this.opacity=Y,this.visual&&ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},K.typeName="HighlightMarker",K.title="Highlight marker",K.icon='',K}(Te),Me='',Fe=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.bgColor="transparent",se.tipPosition={x:0,y:0},se.tipBase1Position={x:0,y:0},se.tipBase2Position={x:0,y:0},se.tipMoving=!1,se.color=ye.defaultStrokeColor,se.bgColor=ye.defaultFillColor,se.fontFamily=ye.defaultFontFamily,se.defaultSize={x:100,y:30},se.setBgColor=se.setBgColor.bind(se),se.getTipPoints=se.getTipPoints.bind(se),se.positionTip=se.positionTip.bind(se),se.setTipPoints=se.setTipPoints.bind(se),se.colorPanel=new Ee("Text color",ye.defaultColorSet,se.color,''),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new Ee("Fill color",ye.defaultColorSet,se.bgColor,Me),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new We("Font",ye.defaultFontFamilies,ye.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new je,se.tipGrip.visual.transform.baseVal.appendItem(ae.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return ce.prototype.ownsTarget.call(this,Y)||this.tipGrip.ownsTarget(Y)||this.tip===Y},K.prototype.createTip=function(){ae.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ae.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},K.prototype.pointerDown=function(Y,ee){this.state==="new"&&ce.prototype.pointerDown.call(this,Y,ee),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ee)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ce.prototype.pointerDown.call(this,Y,ee)},K.prototype.pointerUp=function(Y){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ce.prototype.pointerUp.call(this,Y);else{var ee=this.state==="creating";ce.prototype.pointerUp.call(this,Y),this.setTipPoints(ee),this.positionTip()}},K.prototype.manipulate=function(Y){if(this.tipMoving){var ee=this.unrotatePoint(Y);this.tipPosition={x:ee.x-this.manipulationStartLeft,y:ee.y-this.manipulationStartTop},this.positionTip()}else ce.prototype.manipulate.call(this,Y)},K.prototype.setBgColor=function(Y){this.bgRectangle&&this.tip&&(ae.setAttributes(this.bgRectangle,[["fill",Y]]),ae.setAttributes(this.tip,[["fill",Y]])),this.bgColor=Y,this.fillColorChanged(Y)},K.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},K.prototype.setTipPoints=function(Y){Y===void 0&&(Y=!1);var ee=Math.min(this.height/2,15),ye=this.height/5;Y&&(this.tipPosition={x:ee+ye/2,y:this.height+20});var se=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?se.1)){var Y=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ee=this.tip1.transform.baseVal.getItem(0);ee.setRotate(Y,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ee,0);var ye=this.tip2.transform.baseVal.getItem(0);ye.setRotate(Y+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ye,0)}},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y),this.createTips(),this.adjustVisual()},K.typeName="MeasurementMarker",K.title="Measurement marker",K.icon='',K}(rt),pt=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.strokePanel.colors=ye.defaultColorSet,se.fillColor="transparent",se}return ue(K,ce),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},K.typeName="EllipseFrameMarker",K.title="Ellipse frame marker",K.icon='',K}(Xe),at=function(){function ce(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ce.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ce.prototype.addUndoStep=function(K){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(K)||(this.undoStack.push(K),JSON.stringify(this.lastRedoStep)!==JSON.stringify(K)&&this.redoStack.splice(0,this.redoStack.length))},ce.prototype.replaceLastUndoStep=function(K){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=K)},ce.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ce.prototype.undo=function(){if(this.undoStack.length>1){var K=this.undoStack.pop();return K!==void 0&&this.redoStack.push(K),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ce.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ce}(),ft=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.curveX=0,se.curveY=0,se.manipulationStartCurveX=0,se.manipulationStartCurveY=0,se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.positionGrips=se.positionGrips.bind(se),se.addControlGrips=se.addControlGrips.bind(se),se.adjustVisual=se.adjustVisual.bind(se),se.setupControlBox=se.setupControlBox.bind(se),se.resize=se.resize.bind(se),se.strokeColor=ye.defaultColor,se.strokeWidth=ye.defaultStrokeWidth,se.strokeDasharray=ye.defaultStrokeDasharray,se.strokePanel=new Ee("Line color",ye.defaultColorSet,ye.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new Ge("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.selectorCurve&&Y!==this.visibleCurve&&!this.curveGrip.ownsTarget(Y))},K.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},K.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorCurve=ae.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ae.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)},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Y.x,this.curveY=Y.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ee)&&(this.activeGrip=this.curveGrip,this._state="resize")},K.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ae.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},K.prototype.setupControlBox=function(){ce.prototype.setupControlBox.call(this),this.curveControlLine1=ae.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ae.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)},K.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ce.prototype.addControlGrips.call(this)},K.prototype.positionGrips=function(){ce.prototype.positionGrips.call(this);var Y=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Y/2,this.curveY-Y/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()))},K.prototype.manipulate=function(Y){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Y.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Y.y-this.manipulationStartY),ce.prototype.manipulate.call(this,Y)},K.prototype.resize=function(Y){this.activeGrip===this.curveGrip&&(this.curveX=Y.x,this.curveY=Y.y),ce.prototype.resize.call(this,Y),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},K.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.adjustVisual(),this.colorChanged(Y)},K.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.adjustVisual()},K.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.adjustVisual()},K.prototype.scale=function(Y,ee){this.curveX=this.curveX*Y,this.curveY=this.curveY*ee,ce.prototype.scale.call(this,Y,ee)},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.curveX=ee.curveX,this.curveY=ee.curveY,this.createVisual(),this.adjustVisual()},K.typeName="CurveMarker",K.title="Curve marker",K.icon='',K}(tt),Et=function(){function ce(K,Y){Y===void 0&&(Y=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=K,this.cancelable=Y}return Object.defineProperty(ce.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ce.prototype.preventDefault=function(){this._defaultPrevented=!0},ce}(),xt=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,!1)||this;return se.dataUrl=ee,se.state=ye,se}return ue(K,ce),K}(Et),lt=function(ce){function K(Y,ee,ye){ye===void 0&&(ye=!1);var se=ce.call(this,Y,ye)||this;return se.marker=ee,se}return ue(K,ce),K}(Et),Wt=function(){function ce(){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 ce.prototype.addEventListener=function(K,Y){this[K].push(Y)},ce.prototype.removeEventListener=function(K,Y){var ee=this[K].indexOf(Y);ee>-1&&this[K].splice(ee,1)},ce}(),It=function(){function ce(K){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 at,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 Wt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ce.instanceCounter++,this.styles=new ie(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=K,this.targetRoot=document.body,this.width=K.clientWidth,this.height=K.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(ce.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ye,Ie,Le,$e,pt,Xe,ke,Fe,qe,Te,rt,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ye,Ie,Le,$e,Xe,ke,Fe]},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ye,Ie,Le,$e,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(K){var Y=this;this._availableMarkerTypes.splice(0),K.forEach(function(ee){if(typeof ee=="string"){var ye=Y.ALL_MARKER_TYPES.find(function(se){return se.typeName===ee});ye!==void 0&&Y._availableMarkerTypes.push(ye)}else Y._availableMarkerTypes.push(ee)})},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(K){this._zoomLevel=K,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(ce.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ce.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ce.prototype.show=function(){var K=this;this.styles.styleSheetRoot===void 0&&Q.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Q.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Y){return Y(new Et(K))})},ce.prototype.render=function(){return ge(this,void 0,void 0,function(){var K;return pe(this,function(Y){switch(Y.label){case 0:return this.setCurrentMarker(),(K=new he).naturalSize=this.renderAtNaturalSize,K.imageType=this.renderImageType,K.imageQuality=this.renderImageQuality,K.markersOnly=this.renderMarkersOnly,K.width=this.renderWidth,K.height=this.renderHeight,[4,K.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Y.sent(),[4,K.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Y.sent()]}})})},ce.prototype.close=function(K){var Y=this;if(K===void 0&&(K=!1),this.isOpen){var ee=!1;K||this.eventListeners.beforeclose.forEach(function(ye){var se=new Et(Y,!0);ye(se),se.defaultPrevented&&(ee=!0)}),ee||(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(ye){return ye(new Et(Y))}),this.detachEvents(),this._isOpen=!1)}},ce.prototype.addMarkersToToolbar=function(){for(var K,Y=[],ee=0;eethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*K:this.editorCanvas.clientWidth,ee=Y',K.title="Powered by marker.js",K.style.display="grid",K.style.alignItems="center",K.style.justifyItems="center",K.style.padding="3px",K.style.width="20px",K.style.height="20px",this.logoUI.appendChild(K),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ce.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")},ce.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"},ce.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ce.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 K=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=K+"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 J(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-1&&this.markers.splice(this.markers.indexOf(K),1),K.dispose()},ce.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())},ce.prototype.toolbarButtonClicked=function(K,Y){if(K==="marker"&&Y!==void 0)this.createNewMarker(Y);else if(K==="action")switch(Y){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()}},ce.prototype.deleteSelectedMarker=function(){var K=this;if(this._currentMarker!==void 0){var Y=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ye){var se=new lt(K,K._currentMarker,!0);ye(se),se.defaultPrevented&&(Y=!0)}),!Y){var ee=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(ye){return ye(new lt(K,ee))})}}},ce.prototype.clear=function(){var K=this,Y=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Pe){var Ze=new lt(K,void 0,!0);Pe(Ze),Ze.defaultPrevented&&(Y=!0)}),!Y)){this.setCurrentMarker();for(var ee=function(Pe){var Ze=ye.markers[Pe];ye.setCurrentMarker(ye.markers[Pe]),ye._currentMarker.dispose(),ye.markerImage.removeChild(ye._currentMarker.container),ye.markers.splice(ye.markers.indexOf(ye._currentMarker),1),ye.eventListeners.markerdelete.forEach(function(mt){return mt(new lt(K,Ze))})},ye=this,se=this.markers.length-1;se>=0;se--)ee(se);this.addUndoStep()}},Object.defineProperty(ce.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ce.prototype.showNotesEditor=function(){var K;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=(K=this._currentMarker.notes)!==null&&K!==void 0?K:"",this.overlayContainer.appendChild(this.notesArea))},ce.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)},ce.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ce.prototype.addUndoStep=function(){var K=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Y=this.getState(),ee=this.undoRedoManager.getLastUndoStep();if(!ee||ee.width===Y.width&&ee.height===Y.height){var ye=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Y),ye1&&this.panTo({x:K.clientX,y:K.clientY}))},ce.prototype.onPointerUp=function(K){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(K.clientX,K.clientY)),this.isDragging=!1,this.addUndoStep()},ce.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ce.prototype.onKeyUp=function(K){this._currentMarker===void 0||this.notesArea!==void 0||K.key!=="Delete"&&K.key!=="Backspace"||this.deleteSelectedMarker()},ce.prototype.clientToLocalCoordinates=function(K,Y){var ee=this.markerImage.getBoundingClientRect();return{x:(K-ee.left)/this.zoomLevel,y:(Y-ee.top)/this.zoomLevel}},ce.prototype.onWindowResize=function(){this.positionUI()},ce.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var K=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=K+"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()},ce.prototype.addLicenseKey=function(K){re.addKey(K)},ce.prototype.addEventListener=function(K,Y){this.eventListeners.addEventListener(K,Y)},ce.prototype.removeEventListener=function(K,Y){this.eventListeners.removeEventListener(K,Y)},ce.prototype.renderState=function(K){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(K),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ce.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ce.prototype.focus=function(){var K=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Y){return Y(new Et(K))}))},ce.prototype.blur=function(){var K=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Y){return Y(new Et(K))}))},ce.instanceCounter=0,ce}();/* ********************************** 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 ir=function(ce,K){return(ir=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,ee){Y.__proto__=ee}||function(Y,ee){for(var ye in ee)Object.prototype.hasOwnProperty.call(ee,ye)&&(Y[ye]=ee[ye])})(ce,K)};function $t(ce,K){if(typeof K!="function"&&K!==null)throw new TypeError("Class extends value "+String(K)+" is not a constructor or null");function Y(){this.constructor=ce}ir(ce,K),ce.prototype=K===null?Object.create(K):(Y.prototype=K.prototype,new Y)}function At(ce,K,Y,ee){return new(Y||(Y=Promise))(function(ye,se){function Pe(Tt){try{mt(ee.next(Tt))}catch(et){se(et)}}function Ze(Tt){try{mt(ee.throw(Tt))}catch(et){se(et)}}function mt(Tt){var et;Tt.done?ye(Tt.value):(et=Tt.value,et instanceof Y?et:new Y(function(kt){kt(et)})).then(Pe,Ze)}mt((ee=ee.apply(ce,K||[])).next())})}function Rt(ce,K){var Y,ee,ye,se,Pe={label:0,sent:function(){if(1&ye[0])throw ye[1];return ye[1]},trys:[],ops:[]};return se={next:Ze(0),throw:Ze(1),return:Ze(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Ze(mt){return function(Tt){return function(et){if(Y)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(Y=1,ee&&(ye=2&et[0]?ee.return:et[0]?ee.throw||((ye=ee.return)&&ye.call(ee),0):ee.next)&&!(ye=ye.call(ee,et[1])).done)return ye;switch(ee=0,ye&&(et=[2&et[0],ye.value]),et[0]){case 0:case 1:ye=et;break;case 4:return Pe.label++,{value:et[1],done:!1};case 5:Pe.label++,ee=et[1],et=[0];continue;case 7:et=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(ye=Pe.trys,(ye=ye.length>0&&ye[ye.length-1])||et[0]!==6&&et[0]!==2)){Pe=0;continue}if(et[0]===3&&(!ye||et[1]>ye[0]&&et[1]0&&Y>0){var ee=new Bt(K,Y),ye=ee.ratio>=1?20:ee.getHorizontalLength(20),se=ee.ratio<1?20:ee.getVerticalLength(20),Pe=document.createElementNS("http://www.w3.org/2000/svg","svg");Pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Pe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Pe);var Ze=St.createDefs();Pe.appendChild(Ze);var mt=St.createElement("clipPath",[["id","text-bg-clip"]]);Ze.appendChild(mt);var Tt=St.createPath(St.getHollowRectanglePath((24-ye)/2,(24-se)/2,ye,se,(24-ye)/2+2,(24-se)/2+2,ye-4,se-4));Pe.appendChild(Tt);var et=St.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);et.appendChild(St.createTSpan(K+":"+Y)),Pe.appendChild(et);var kt=et.getBBox();St.setAttributes(et,[["x",((24-kt.width)/2).toString()],["y",((24-kt.height)/2-kt.y).toString()]]);var Zt=St.createPath(St.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(kt.width))/2,(24-Math.ceil(kt.height))/2,Math.ceil(kt.width),Math.ceil(kt.height)));return mt.appendChild(Zt),St.setAttributes(Tt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Pe),Pe.outerHTML}return''},ce}(),ar=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=ye,se}return $t(K,ce),K.prototype.setupDropdown=function(){var Y=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ee){ee.className=Y.className,ee.colorsClassName=Y.colorsClassName,Y.dropdownBlock.appendChild(ee.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},K.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},K.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},K.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},K.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},K.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},K}(Pt),Gt=function(){function ce(K,Y){this.GRIP_SIZE=10,this.color=K,this.fillColor=Y,this.visual=St.createGroup(),this.visual.appendChild(St.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(St.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ce.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},ce.prototype.setCenter=function(K,Y){this.visual.childNodes.forEach(function(ee){return St.setAttributes(ee,[["cx",K.toString()],["cy",Y.toString()]])})},ce}(),mr=function(){function ce(K,Y,ee,ye){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=K,this.canvasHeight=Y,this.margin=ee,this.container=ye,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(ce.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(K){this._aspectRatio=K,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.gridContainer&&St.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(K){this._zoomFactor=K,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ce.prototype.open=function(){var K=this;this.cropShadeElement=St.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=St.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var Y=0;Ythis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-Y.height/2),St.setAttributes(this.cropRectElement,[["x",Y.x.toString()],["y",Y.y.toString()],["width",Y.width.toString()],["height",Y.height.toString()]]);var ee=Y.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,Pe){var Ze=Y.y+ee*(Pe+1);St.setAttributes(se,[["x1",""+Y.x],["y1",""+Ze],["x2",""+(Y.x+Y.width)],["y2",""+Ze]])});var ye=Y.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,Pe){var Ze=Y.x+ye*(Pe+1);St.setAttributes(se,[["x1",""+Ze],["y1",""+Y.y],["x2",""+Ze],["y2",""+(Y.y+Y.height)]])}),St.setAttributes(this.cropShadeElement,[["d",St.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,Y.x,Y.y,Y.width,Y.height)]]),this.topLeftGrip.setCenter(Y.x,Y.y),this.topRightGrip.setCenter(Y.x+Y.width,Y.y),this.bottomLeftGrip.setCenter(Y.x,Y.y+Y.height),this.bottomRightGrip.setCenter(Y.x+Y.width,Y.y+Y.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ce.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)},ce.prototype.clientToLocalCoordinates=function(K,Y){var ee=this.container.getBoundingClientRect();return{x:K-ee.left+this.margin,y:Y-ee.top+this.margin}},ce.prototype.onPointerDown=function(K){this.container.setPointerCapture(K.pointerId),this.previousPoint=this.clientToLocalCoordinates(K.clientX,K.clientY),this.cropRectElement===K.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(K.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(K.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(K.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(K.target)&&(this.activeGrip=this.bottomRightGrip)},ce.prototype.onPointerMove=function(K){if(this.isMoving)this.move(this.clientToLocalCoordinates(K.clientX,K.clientY));else if(this.activeGrip){var Y=this.clientToLocalCoordinates(K.clientX,K.clientY);this.resize(Y)}K.preventDefault()},ce.prototype.onPointerUp=function(K){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(K.pointerId)},ce.prototype.move=function(K){var Y=K.x-this.previousPoint.x,ee=K.y-this.previousPoint.y;this.zoomFactor!==1&&(Y=-Y/this.zoomFactor,ee=-ee/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+Y),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ee),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=K},ce.prototype.resize=function(K){var Y=Object.assign({},this.cropRect),ee=K.x-this.previousPoint.x,ye=K.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:Y.x+eethis.canvasWidth*this.zoomFactor&&(ee=this.canvasWidth*this.zoomFactor-Y.width),Y.width+=ee}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(Y.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ee),Y.height=this.aspectRatio.getVerticalLength(Y.width)):(Y.y+=ye,Y.height=this.cropRect.y+this.cropRect.height-Y.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?Y.height=this.aspectRatio.getVerticalLength(Y.width):Y.height+=ye}Y.width<10&&(Y.x=this.cropRect.x,Y.width=10),Y.height<10&&(Y.y=this.cropRect.y,Y.height=10),this.previousPoint=K,Y.x>=this.margin&&Y.y>=this.margin&&Y.x-this.margin+Y.width<=this.canvasWidth&&Y.y-this.margin+Y.height<=this.canvasHeight&&(this.cropRect=Y,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ce.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var K=this.cropRect.x+this.cropRect.width/2,Y=this.cropRect.y+this.cropRect.height/2,ee=this.aspectRatio.getHorizontalLength(this.cropRect.height),ye=this.aspectRatio.getVerticalLength(this.cropRect.width);ee/this.canvasWidththis.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=K-this.cropRect.width/2,this.cropRect.y=Y-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)}},ce.prototype.getRescaledRect=function(K,Y,ee,ye,se,Pe){var Ze=ee/K,mt=ye/Y;return{x:(se.x-Pe)*Ze+Pe,y:(se.y-Pe)*mt+Pe,width:se.width*Ze,height:se.height*mt}},ce.prototype.scaleCanvas=function(K,Y){var ee=this.getRescaledRect(this.canvasWidth,this.canvasHeight,K,Y,this.cropRect,this.margin);this.canvasWidth=K,this.canvasHeight=Y,this.onCropChange&&this.onCropChange(ee),this.setCropRectangle(ee)},ce}(),zt=function(){function ce(K){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=K,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(ce.prototype,"angle",{get:function(){return this._angle},set:function(K){this._angle=K,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ce.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},ce.prototype.onPointerDown=function(K){this.controlContainer.setPointerCapture(K.pointerId),this.isDragging=!0,this.previousPoint={x:K.clientX,y:K.clientY}},ce.prototype.onPointerMove=function(K){this.isDragging&&(this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.previousPoint.x=K.clientX)},ce.prototype.onPointerUp=function(K){this.isDragging&&this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(K.pointerId)},ce.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var K=this.angleLabelText.getBBox();St.setAttributes(this.angleLabelElement,[["x",((this.width-K.width)/2).toString()],["y",(this.height/2).toString()]])}},ce.prototype.positionScaleShape=function(){if(this.scaleShape){var K=this.scaleShape.transform.baseVal.getItem(0);K.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(K,0)}},ce.prototype.getVisual=function(){var K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("xmlns","http://www.w3.org/2000/svg"),K.setAttribute("width",this.width+"px"),K.setAttribute("height",this.height+"px"),K.setAttribute("viewBox","0 0 "+this.width+" "+this.height),K.style.flexShrink="0",document.body.appendChild(K);for(var Y="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ee=1;ee<=this.width/5+10;ee++){var ye=ee%5==0?this.height/3:this.height/6;Y+="h4v"+-ye+"h1v"+ye}Y+="v1H0Z",this.scaleShape=St.createPath(Y);var se=St.createTransform();this.scaleShape.transform.baseVal.appendItem(se),K.appendChild(this.scaleShape),this.angleLabelElement=St.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=St.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Pe=St.createTSpan("");return Pe.innerHTML="°",this.angleLabelElement.appendChild(Pe),K.appendChild(this.angleLabelElement),document.body.removeChild(K),K},ce}(),Ur=function(){function ce(){this.naturalSize=!1,this.imageType="image/png"}return ce.prototype.rasterize=function(K,Y,ee,ye,se,Pe,Ze){var mt=this;return new Promise(function(Tt){var et=document.createElement("canvas");et.width=K.width.baseVal.value-2*ye,et.height=K.height.baseVal.value-2*ye;var kt=1,Zt=1;mt.naturalSize===!0?(kt=Y.naturalWidth/(K.width.baseVal.value-2*ye)/Pe,Zt=Y.naturalHeight/(K.height.baseVal.value-2*ye)/Ze,et.width=Y.naturalWidth/Pe,et.height=Y.naturalHeight/Ze):mt.width!==void 0&&mt.height!==void 0&&(kt=mt.width/ee.width,Zt=mt.height/ee.height,et.width*=kt,et.height*=Zt);var Yt=et.getContext("2d");Yt.translate(et.width/2,et.height/2),Yt.rotate(se*Math.PI/180),Yt.scale(Pe,Ze),Yt.translate(-et.width/2,-et.height/2),Yt.drawImage(Y,0,0,et.width,et.height);var Cr=document.createElement("canvas");Cr.width=ee.width*kt,Cr.height=ee.height*Zt,Cr.getContext("2d").putImageData(Yt.getImageData((ee.x-ye)*kt,(ee.y-ye)*Zt,ee.width*kt,ee.height*Zt),0,0),Tt(Cr.toDataURL(mt.imageType,mt.imageQuality))})},ce}(),nt=function(){function ce(K){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=ce.instanceCounter++,this.styles=new Je(this.instanceNo),this.target=K,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(ce.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(K){this._zoomToCropEnabled=K,K?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"gridLines",{get:function(){return this._gridLines},set:function(K){this._gridLines=K,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(K){this._rotationAngle=K,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"aspectRatio",{get:function(){var K;return(K=this._aspectRatio)!==null&&K!==void 0?K:this.aspectRatios[0]},set:function(K){this._aspectRatio=K},enumerable:!1,configurable:!0}),ce.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},ce.prototype.show=function(){this.showUI(),this.open()},ce.prototype.close=function(K){K===void 0&&(K=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),K||this.closeEventListeners.forEach(function(Y){return Y()}),this._isOpen=!1)},ce.prototype.addRenderEventListener=function(K){this.renderEventListeners.push(K)},ce.prototype.removeRenderEventListener=function(K){this.renderEventListeners.indexOf(K)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(K),1)},ce.prototype.addCloseEventListener=function(K){this.closeEventListeners.push(K)},ce.prototype.removeCloseEventListener=function(K){this.closeEventListeners.indexOf(K)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(K),1)},ce.prototype.setupResizeObserver=function(){var K=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){K.resize(K.target.clientWidth,K.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))},ce.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var K=1*this.target.clientWidth/this.target.clientHeight,Y=this.contentDiv.clientWidth/K>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*K:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ee=Y+2*this.CANVAS_MARGINK+this.CANVAS_MARGIN?this.target.offsetTop-(K+this.CANVAS_MARGIN):0;this.coverDiv.style.top=Y+"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},ce.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ce.prototype.addTopToolbar=function(){var K=this;this.topToolbar=new Xt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var Y=new Mt;Y.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(Y);var ee=[];this.aspectRatios.forEach(function(Zt){var Yt=new Pt(fr.getIcon(Zt.horizontal,Zt.vertical),Zt.horizontal===0&&Zt.vertical===0?"FREE":Zt.horizontal+":"+Zt.vertical);Yt.onClick=function(){return K.ratioButtonClicked(Zt)},ee.push(Yt)}),this.aspectRatioButton=new ar(fr.getIcon(0,0),"Aspect ratio",ee),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,Y.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ye=new Pt('',"Toggle grid");ye.isActive=this.isGridVisible,ye.onClick=function(){K.isGridVisible=!K.isGridVisible,ye.isActive=K.isGridVisible},Y.addButton(ye);var se=new Pt('',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){K.zoomToCropEnabled=!K.zoomToCropEnabled,se.isActive=K.zoomToCropEnabled},Y.addButton(se),!hr.isLicensed){var Pe=new gt;this.topToolbar.addElementBlock(Pe);var Ze=document.createElement("div");Ze.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var mt=document.createElement("a");mt.style.color="currentColor",mt.href="https://markerjs.com/products/cropro",mt.target="_blank",mt.innerHTML='',Ze.appendChild(mt),Pe.addElement(Ze)}var Tt=new Mt;Tt.minWidth=3*this.toolbarHeight+"px",Tt.contentAlign="end",this.topToolbar.addButtonBlock(Tt);var et=new Pt('',"OK");et.onClick=this.startRenderAndClose,Tt.addButton(et),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(et.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var kt=new Pt('',"Close");kt.onClick=this.close,Tt.addButton(kt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(kt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ce.prototype.addBottomToolbar=function(){var K=this;this.bottomToolbar=new Xt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var Y=new Mt;Y.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(Y);var ee=new Pt('',"Rotate left");ee.onClick=this.rotateLeftButtonClicked,Y.addButton(ee);var ye=new Pt('',"Rotate right");ye.onClick=this.rotateRightButtonClicked,Y.addButton(ye);var se=new gt;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new zt("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(Tt){K.rotateBy(Tt),K.straightener.angle=K.rotationAngle},se.addElement(this.straightener.getUI());var Pe=new Mt;Pe.minWidth=2*this.toolbarHeight+"px",Pe.contentAlign="end",this.bottomToolbar.addButtonBlock(Pe);var Ze=new Pt('',"Flip horizontal");Ze.onClick=this.flipHorizontallyButtonClicked,Pe.addButton(Ze);var mt=new Pt('',"Flip vertical");mt.onClick=this.flipVerticallyButtonClicked,Pe.addButton(mt)},ce.prototype.ratioButtonClicked=function(K){this.aspectRatio=K,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ce.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=fr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ce.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Bt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ce.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ce.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ce.prototype.restoreState=function(K){if(K){var Y=this.cropLayer.getRescaledRect(K.width,K.height,this.imageWidth,this.imageHeight,K.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(Y),this.cropRectChanged(Y),this.flippedHorizontally=K.flippedHorizontally,this.flippedVertically=K.flippedVertically,this.applyFlip(),this.rotationAngle=K.rotationAngle,this.applyRotation()}},ce.prototype.clientToLocalCoordinates=function(K,Y){var ee=this.cropImage.getBoundingClientRect();return{x:K-ee.left,y:Y-ee.top}},ce.prototype.onWindowResize=function(){this.positionUI()},ce.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var K=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=K+"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()},ce.prototype.rotateLeftButtonClicked=function(){var K=this.rotationAngle-90;this.rotationAngle%90!=0&&(K+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(K)},ce.prototype.rotateRightButtonClicked=function(){var K=this.rotationAngle+90;this.rotationAngle%90!=0&&(K-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(K)},ce.prototype.rotateTo=function(K){K=(K=K>180?K-360:K)<=-180?K+360:K,this.rotationAngle=K,this.applyRotation()},ce.prototype.rotateBy=function(K){this.rotateTo((this.rotationAngle+K)%360)},ce.prototype.applyRotation=function(){var K=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var Y=this.editingTargetRotationContainer.transform.baseVal.getItem(0);Y.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(Y,0);var ee=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ee.width,this.imageHeight/ee.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=K},ce.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ce.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ce.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ce.prototype.startRenderAndClose=function(){return At(this,void 0,void 0,function(){var K,Y;return Rt(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return K=ee.sent(),Y=this.getState(),this.renderEventListeners.forEach(function(ye){return ye(K,Y)}),this.close(!0),[2]}})})},ce.prototype.render=function(){return At(this,void 0,void 0,function(){var K;return Rt(this,function(Y){switch(Y.label){case 0:return(K=new Ur).naturalSize=this.renderAtNaturalSize,K.imageType=this.renderImageType,K.imageQuality=this.renderImageQuality,K.width=this.renderWidth,K.height=this.renderHeight,this.unzoomFromCrop(),St.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,K.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 Y.sent(),[4,K.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,Y.sent()]}})})},ce.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new Ct("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var K=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ct("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*K)+`px; height: `+(this.toolbarHeight-2*K)+`px; padding: `+K+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ct("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ct("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new dt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new dt("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*K)+`px; padding: `+K+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ct("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},ce.instanceCounter=0,ce}(),Dt=N("8hTe"),zr=N.n(Dt),Pr=/]*>/g;function Xr(ce){var K=document.createElement("div");return K.innerHTML=ce,K.childNodes.length===0?"":K.childNodes[0].nodeValue}var Yr=q.a=function(ce){var K=ce.value,Y=K===void 0?"":K,ee=ce.edit,ye=ee===void 0?!1:ee,se=ce.className,Pe=ce.showTextOnly,Ze=ce.showLines,mt=ce.replaces,Tt=ce.zoomImg,et=ce.hasMask,kt=ce.style,Zt=kt===void 0?{}:kt,Yt=ce.stylesPrev,Cr=Yt===void 0?{}:Yt,Tr=String(Y),_r=Object(a.useRef)(),en=Object(a.useRef)(),Rn=Object(a.useState)(""),gr=Object(C.a)(Rn,2),$r=gr[0],mn=gr[1],gn=Object(a.useState)("office"),jr=Object(C.a)(gn,2),Ar=jr[0],rr=jr[1],br=function(){var tr=new nt(en.current);tr.displayMode="popup",tr.addRenderEventListener(function(){var kr=Object(g.a)(s.a.mark(function er(wr){var nr;return s.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return _r.current.style.display="none",Ir.next=3,Object(be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:wr}});case 3:nr=Ir.sent,nr!=null&&nr.id&&mt(en.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(nr==null?void 0:nr.id,"?type=").concat(nr.content_type));case 5:case"end":return Ir.stop()}},er)}));return function(er){return kr.apply(this,arguments)}}()),tr.show()},Or=function(){var tr=new It(en.current);tr.settings.displayMode="popup",tr.addEventListener("render",function(){var kr=Object(g.a)(s.a.mark(function er(wr){var nr;return s.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:if(_r.current.style.display="none",!en.current){Ir.next=6;break}return Ir.next=4,Object(be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:wr.dataUrl}});case 4:nr=Ir.sent,nr!=null&&nr.id&&mt(en.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(nr==null?void 0:nr.id,"?type=").concat(nr.content_type));case 6:case"end":return Ir.stop()}},er)}));return function(er){return kr.apply(this,arguments)}}()),tr.show(),window.markerArea=tr},Jr=Object(a.useMemo)(function(){_r.current&&(_r.current.style.zIndex=-1);try{var vr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,tr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,kr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Tr=Tr.replace(vr,"("+te.a.API_SERVER+"/api/attachments/").replace(tr,'"'+te.a.API_SERVER+"/api/attachments/").replace(kr,'"'+te.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(Cn){}var er=G(Tr),wr=j();if(Tr.match(/\[TOC\]/)&&(er=er.replace("

    [TOC]

    ",D()),w()),er=er.replace(/(__special_katext_id_\d+__)/g,function(Cn,Ir){var Fr=wr[Ir],Bn=Fr.type,Tn=Fr.expression;return Object(de.renderToString)(Xr(Tn)||"",{displayMode:Bn==="block",throwOnError:!1,output:"html"})}),er=er.replace(/▁/g,"\u2581\u2581\u2581"),F(),Pe){var nr=document.createElement("div");return nr.innerHTML=er,nr.innerText}return setTimeout(function(){return li()},500),er},[Tr]),tn=Object(a.useRef)();v.WebkitLineClamp=Ze,Ze&&(Zt=Object(T.a)(Object(T.a)({},Zt),v));function rn(vr){var tr=vr.target;if(tr.tagName.toUpperCase()==="IMG"){if(Tt){var kr=tr.getAttribute("src");mn(kr),rr("image")}}else if(tr.tagName.toUpperCase()==="A"){var er=tr.getAttribute("href");if(er.indexOf("office")>-1)vr.preventDefault(),mn(er),rr("office");else if(er.indexOf("application/pdf")>-1)vr.preventDefault(),mn(er),rr("pdf");else if(er.indexOf("text/html")>-1)vr.preventDefault(),mn(er),rr("html");else if(er.startsWith("#")){vr.preventDefault();var wr=document.getElementById(er.replace("#",""));wr&&wr.scrollIntoView(!0)}}}var li=function(){var tr,kr=(tr=tn.current)===null||tr===void 0?void 0:tr.querySelectorAll("video");kr==null||kr.forEach(function(er){if(er.oncontextmenu=function(){return!1},er.src.indexOf(".m3u8")>-1&&!er.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var wr=new W.a;wr.loadSource(er.src),wr.attachMedia(er)}}})};Object(a.useEffect)(function(){if(tn.current&&Jr&&(Jr.match(Pr)&&window.PR.prettyPrint()),tn.current)return tn.current.addEventListener("click",rn),function(){tn.current.removeEventListener("click",rn),F(),w()}},[Jr,tn.current,rn]);var Ln=function(tr){if(!ye)return;tr.target.nodeName==="IMG"?(_r.current.style.zIndex=1,_r.current.style.display="flex",_r.current.style.width=tr.target.clientWidth+"px",_r.current.style.height=tr.target.clientHeight+"px",_r.current.style.top=tr.target.offsetTop+"px",_r.current.style.left=tr.target.offsetLeft+"px",en.current.src=tr.target.getAttribute("src")):_r.current.style.display="none"};return r.a.createElement("div",{style:{position:"relative"}},r.a.createElement("div",{ref:tn,style:Object(T.a)({},Zt),className:"".concat(se||""," markdown-body ").concat(zr.a.mdBody),onMouseOver:Ln,dangerouslySetInnerHTML:{__html:Jr}}),r.a.createElement("div",{ref:_r,className:zr.a.button},r.a.createElement(m.a,null,r.a.createElement(R.a,{onClick:function(){return br()}},"\u88C1\u526A"),r.a.createElement(R.a,{onClick:function(){return Or()}},"\u7F16\u8F91"))),r.a.createElement("img",{ref:en,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),r.a.createElement(fe.a,{close:!0,data:$r,type:$r!=null&&$r.length?Ar:"",style:Object(T.a)({},Cr),onClose:function(){return mn("")}}))}},"9OqN":function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){return P.mode.CTR=function(){var m=P.lib.BlockCipherMode.extend(),S=m.Encryptor=m.extend({processBlock:function(R,T){var g=this._cipher,C=g.blockSize,h=this._iv,s=this._counter;h&&(s=this._counter=h.slice(0),this._iv=void 0);var a=s.slice(0);g.encryptBlock(a,0),s[C-1]=s[C-1]+1|0;for(var r=0;r0&&Ie.current===ne.length){He(!1);var St=W(hr);St=St.filter(function(Je){var dt,Ct;return!!((dt=Je[0])!==null&&dt!==void 0&&dt.name&&(Ct=Je[1])!==null&&Ct!==void 0&&Ct.name)}),St=St.map(function(Je){return Object(l.a)(Object(l.a)(Object(l.a)({},Je[0]),Je[1]),{},{is_file:!1})}),ue(St),Ce()}}else He(!1),Ce()});return}if(rt){var xt=new FormData;xt.append("file",at.file),xt.append("identifier",oe);var lt=Object(z.a)("/api/attachments.json",{method:"post",body:xt},!0);lt.then(function(Rt){if(Rt.filename){Ie.current=Ie.current+1;var hr=$e.current.map(function(Je){if(Je.name===(Rt==null?void 0:Rt.filename)){var dt,Ct=Object(l.a)(Object(l.a)({},Je),{},{is_oss:!rt});return Rt!=null&&(dt=Rt.filename)!==null&&dt!==void 0&&dt.includes(".in")?(Ct.in_object_key=Rt==null?void 0:Rt.object,Ct.in_object_size=Rt==null?void 0:Rt.size,Ct.input=Rt==null?void 0:Rt.filename,Ct.in_file=at):(Ct.out_object_key=Rt==null?void 0:Rt.object,Ct.out_object_size=Rt==null?void 0:Rt.size,Ct.output=Rt==null?void 0:Rt.filename,Ct.out_file=at),Ct}return Je});if($e.current=Object(u.a)(hr),J(Object(u.a)(hr)),Ie.current>0&&Ie.current===ne.length){He(!1);var St=W(hr);St=St.filter(function(Je){var dt,Ct;return!!((dt=Je[0])!==null&&dt!==void 0&&dt.name&&(Ct=Je[1])!==null&&Ct!==void 0&&Ct.name)}),St=St.map(function(Je){return Object(l.a)(Object(l.a)(Object(l.a)({},Je[0]),Je[1]),{},{is_file:!0})}),ue(St),Ce()}}else He(!1),Ce()});return}var Wt=new L.a({endpoint:Ee.end_point,region:Ee.region,accessKeyId:Ee.access_key_id,accessKeySecret:Ee.access_key_secret,bucket:Ee.bucket,stsToken:Ee.security_token}),It=at.name,ir={container_type:"TestSet",file_name:It},$t=Object(H.a)(),At="testsets/".concat(oe,"/").concat($t).concat(It.indexOf(".")>-1?"."+It.split(".").pop():"");oe===null&&(At="testsets/".concat($t).concat(It.indexOf(".")>-1?"."+It.split(".").pop():"")),Wt.multipartUpload(At,new Blob([at.file],{type:at.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:It+""},url:Ee==null?void 0:Ee.callback_url,host:Ee==null?void 0:Ee.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(z.e)(ir)}}).then(function(Rt){if(Rt.data.status===0){Ie.current=Ie.current+1;var hr=$e.current.map(function(Je){var dt,Ct;if(Je.name===((dt=Rt.data)===null||dt===void 0||((Ct=dt.data)===null||Ct===void 0)?void 0:Ct.file_name)){var Xt,Jt,Mt,Pt=Object(l.a)(Object(l.a)({},Je),{},{is_oss:!rt});if((Xt=Rt.data)!==null&&Xt!==void 0&&(Jt=Xt.data)!==null&&Jt!==void 0&&(Mt=Jt.file_name)!==null&&Mt!==void 0&&Mt.includes(".in")){var gt,Bt,fr,ar,Gt,mr;Pt.in_object_key=(gt=Rt.data)===null||gt===void 0||((Bt=gt.data)===null||Bt===void 0)?void 0:Bt.object,Pt.in_object_size=(fr=Rt.data)===null||fr===void 0||((ar=fr.data)===null||ar===void 0)?void 0:ar.size,Pt.input=(Gt=Rt.data)===null||Gt===void 0||((mr=Gt.data)===null||mr===void 0)?void 0:mr.file_name,Pt.in_file=at}else{var zt,Ur,nt,Dt,zr,Pr;Pt.out_object_key=(zt=Rt.data)===null||zt===void 0||((Ur=zt.data)===null||Ur===void 0)?void 0:Ur.object,Pt.out_object_size=(nt=Rt.data)===null||nt===void 0||((Dt=nt.data)===null||Dt===void 0)?void 0:Dt.size,Pt.output=(zr=Rt.data)===null||zr===void 0||((Pr=zr.data)===null||Pr===void 0)?void 0:Pr.file_name,Pt.out_file=at}return Pt}return Je});if($e.current=Object(u.a)(hr),J(Object(u.a)(hr)),Ie.current>0&&Ie.current===ne.length){He(!1);var St=W(hr);St=St.filter(function(Je){var dt,Ct;return!!((dt=Je[0])!==null&&dt!==void 0&&dt.name&&(Ct=Je[1])!==null&&Ct!==void 0&&Ct.name)}),St=St.map(function(Je){return Object(l.a)(Object(l.a)(Object(l.a)({},Je[0]),Je[1]),{},{is_file:!0})}),ue(St),Ce()}}})},Me=function(at){return new Promise(function(ft,Et){for(var xt=0,lt=[],Wt=function($t){at[$t].file.slice(0,1).arrayBuffer().then(function(){xt++,xt===at.length&&(lt.length?(y.b.warn("".concat(lt.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),Et()):ft(at))}).catch(function(At){console.log("\u9519\u8BEF\u4FE1\u606F\uFF1A",At),xt++,lt.push(at[$t].name),xt===at.length&&(lt.length?(y.b.warn("".concat(lt.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),Et()):ft(at))})},It=0;It100)return y.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(at.name))return y.b.warn("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;var ft={name:at.name,uid:at.uid,file:at,percent:0};return ne.push(ft),$e.current=Object(u.a)(ne),J(Object(u.a)(ne)),!1}},qe=W(ne);return console.log(ne,qe,"fileList"),c.a.createElement(d.a,{visible:ge,wrapClassName:pe,onOk:Fe,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:Be},onCancel:Oe,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},c.a.createElement("div",{className:x.a.wrap},ne.length?c.a.createElement("div",null,c.a.createElement(h.a,{justify:"space-between",align:"middle",className:"mb20"},c.a.createElement("div",{style:{visibility:re?"visible":"hidden"}},"\u6D4B\u8BD5\u7528\u4F8B\u7C7B\u578B\uFF1A",c.a.createElement(a.a.Group,{className:"ml10",value:Ge,onChange:function(at){return Ye(at.target.value)}},c.a.createElement(a.a,{value:!1},"\u6587\u672C"),c.a.createElement(a.a,{value:!0},"\u6587\u4EF6"))),c.a.createElement(v.a,Xe,c.a.createElement(f.a,{className:x.a.btnS},"\u4E0A\u4F20\u6587\u4EF6"))),c.a.createElement(de,{data:qe,onRemove:Ae})):c.a.createElement("div",{className:x.a.noData},c.a.createElement("img",{src:j.a,alt:""}),c.a.createElement(v.a,Xe,c.a.createElement(f.a,{className:x.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),c.a.createElement("div",{className:x.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",c.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",c.a.createElement("br",null),"2\u3001\u4E0A\u4F20\u7684\u6587\u4EF6\u7F16\u7801\u4EC5\u652F\u6301UTF-8\uFF0C\u5426\u5219\u53EF\u80FD\u4F1A\u51FA\u73B0\u6587\u672C\u4E71\u7801\u3002",c.a.createElement("br",null),"3\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",c.a.createElement("br",null),"4\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002",c.a.createElement("br",null))))},de=function(be){var Ce=be.data,ue=Ce===void 0?[]:Ce,ge=be.onRemove,pe=be.width,oe=pe===void 0?"auto":pe,ae=be.showScore,re=ae===void 0?!1:ae,he=be.disabled,Q=he===void 0?!1:he,ie=be.inputChange,we=be.onEvaluatingChange,ne=be.showEvaluatingSetting,J=ne===void 0?!1:ne,V={value:"",filename:"",dataUrl:""},Z=Object(k.useState)(Object(l.a)({},V)),Ee=Object(o.a)(Z,2),xe=Ee[0],_e=Ee[1],je=function(ze){var Ge=document.createElement("a");document.body.appendChild(Ge);var Ye=URL.createObjectURL(ze.file);Ge.href=Ye,Ge.download=ze.name,Ge.click(),URL.revokeObjectURL(Ye),document.body.removeChild(Ge)},Be=function(ze,Ge){Object(G.y)(ze,Ge)},He=function(ze,Ge){d.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:c.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){ge(ze,Ge)},onCancel:function(){}})};return ue.length?c.a.createElement("div",{style:{width:oe}},c.a.createElement("div",{className:x.a.head},J&&c.a.createElement("div",{style:{width:"10%"}},"\u9690\u85CF",c.a.createElement(g.a,{title:'\u9690\u85CF\u6D4B\u8BD5\u96C6\u53EF\u4EE5\u9632\u6B62\u5B66\u751F\u901A\u8FC7"print"\u7B49\u624B\u6BB5\u76F4\u63A5\u901A\u5173'},c.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),c.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),c.a.createElement("div",{style:{width:re?"25%":"35%",padding:"0 12px"}},"\u8F93\u5165"),c.a.createElement("div",{style:{width:re?"25%":"35%",padding:"0 12px"}},"\u8F93\u51FA"),re&&c.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),J&&c.a.createElement("div",{style:{width:"20%"}},"\u9884\u671F\u8F93\u51FA",c.a.createElement(g.a,{title:"\u52FE\u9009\u540E\uFF0C\u9884\u671F\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"},c.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),J&&c.a.createElement("div",{style:{width:"20%"}},"\u7279\u6B8A\u5224\u5B9A",c.a.createElement(g.a,{title:"\u52FE\u9009\u540E\uFF0C\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u6700\u540E\u4E00\u884C\u76F8\u540C\u5373\u53EF\u901A\u5173"},c.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),c.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),ue.map(function(Ue,ze){var Ge,Ye,Re,tt;return c.a.createElement("div",{key:ze,className:x.a.list},J&&c.a.createElement("div",{style:{width:"10%"}},c.a.createElement(R.a,{checked:!!Ue.hidden,onChange:function(We){we(We.target.checked?1:0,ze,"hidden")}})),c.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",ze+1),c.a.createElement("div",{className:x.a.info,style:{width:re?"25%":"35%"}},c.a.createElement("span",{title:Ue.input||((Ge=Ue[0])===null||Ge===void 0?void 0:Ge.name),onClick:Object(n.a)(D.a.mark(function rt(){var We,$e;return D.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(Ue.input?Ue.input_file_url?We=Ue.input_file_url:We=Ue.in_file:We=Ue[0],!(typeof We=="string")){Oe.next=14;break}return Oe.next=4,fetch(We,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return $e=Oe.sent,Oe.t0=_e,Oe.next=8,$e.text();case 8:Oe.t1=Oe.sent,Oe.t2=We,Oe.t3={value:Oe.t1,filename:"",dataUrl:Oe.t2},(0,Oe.t0)(Oe.t3),Oe.next=18;break;case 14:return Oe.next=16,Object(G.G)(We.file);case 16:$e=Oe.sent,_e({value:$e.text,filename:We.name,dataUrl:$e.link});case 18:case"end":return Oe.stop()}},rt)}))},Ue.input||((Ye=Ue[0])===null||Ye===void 0?void 0:Ye.name))),c.a.createElement("div",{className:x.a.info,style:{width:re?"25%":"35%"}},c.a.createElement("span",{title:Ue.output||((Re=Ue[1])===null||Re===void 0?void 0:Re.name),onClick:Object(n.a)(D.a.mark(function rt(){var We,$e;return D.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(Ue.input?Ue.output_file_url?We=Ue.output_file_url:We=Ue.out_file:We=Ue[1],!(typeof We=="string")){Oe.next=14;break}return Oe.next=4,fetch(We,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return $e=Oe.sent,Oe.t0=_e,Oe.next=8,$e.text();case 8:Oe.t1=Oe.sent,Oe.t2=We,Oe.t3={value:Oe.t1,filename:"",dataUrl:Oe.t2},(0,Oe.t0)(Oe.t3),Oe.next=18;break;case 14:return Oe.next=16,Object(G.G)(We.file);case 16:$e=Oe.sent,_e({value:$e.text,filename:We.name,dataUrl:$e.link});case 18:case"end":return Oe.stop()}},rt)}))},Ue.output||((tt=Ue[1])===null||tt===void 0?void 0:tt.name))),re&&c.a.createElement("div",{style:{width:"20%"}},c.a.createElement(m.a,{disabled:Q,style:{width:"70%"},onChange:function(We){return ie(We,ze)},value:Ue.score}),c.a.createElement("span",null,"\xA0%")),J&&c.a.createElement("div",{style:{width:"20%"}},c.a.createElement(R.a,{checked:Ue.is_invisible||!1,onChange:function(We){we(We.target.checked,ze,"is_invisible")},className:"font14"},"\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1")),J&&c.a.createElement("div",{style:{width:"20%"}},c.a.createElement(R.a,{checked:Ue.last_match_rule||!1,onChange:function(We){we(We.target.checked,ze,"last_match_rule")},className:"font14"},"\u672B\u5C3E\u5339\u914D")),c.a.createElement("div",{onClick:function(){return He(Ue,ze)},style:{width:"10%"}},c.a.createElement("span",{className:x.a.del},"\u5220\u9664")))}),c.a.createElement(U.a,{close:!0,data:xe.dataUrl,filename:xe.filename,type:xe.dataUrl.length?"txt":"",onClose:function(){return _e(Object(l.a)({},V))},monacoEditor:{value:xe.value,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}})):c.a.createElement(c.a.Fragment,null)};q.b=te},Bd2K:function(I,q,N){(function(P){P(N("VrN/"),N("osHv"))})(function(P){P.defineOption("autoCloseTags",!1,function(s,a,r){if(r!=P.Init&&r&&s.removeKeyMap("autoCloseTags"),!a)return;var f={name:"autoCloseTags"};(typeof a!="object"||a.whenClosing!==!1)&&(f["'/'"]=function(p){return g(p)}),(typeof a!="object"||a.whenOpening!==!1)&&(f["'>'"]=function(p){return R(p)}),s.addKeyMap(f)});var m=["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(s){if(s.getOption("disableInput"))return P.Pass;for(var a=s.listSelections(),r=[],f=s.getOption("autoCloseTags"),p=0;pd.ch&&(o=o.slice(0,o.length-E.end+d.ch));var i=o.toLowerCase();if(!o||E.type=="string"&&(E.end!=d.ch||!/[\"\']/.test(E.string.charAt(E.string.length-1))||E.string.length==1)||E.type=="tag"&&n.close||E.string.indexOf("/")==d.ch-E.start-1||w&&C(w,i)>-1||h(s,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(l)||[],o,d,!0))return P.Pass;var D=typeof f=="object"&&f.emptyTags;if(D&&C(D,o)>-1){r[p]={text:"/>",newPos:P.Pos(d.line,d.ch+2)};continue}var k=v&&C(v,i)>-1;r[p]={indent:k,text:">"+(k?` `:"")+"",newPos:k?P.Pos(d.line+1,0):P.Pos(d.line,d.ch+1)}}for(var c=typeof f=="object"&&f.dontIndentOnAutoClose,p=a.length-1;p>=0;p--){var b=r[p];s.replaceRange(b.text,a[p].head,a[p].anchor,"+insert");var x=s.listSelections().slice(0);x[p]={head:b.newPos,anchor:b.newPos},s.setSelections(x),!c&&b.indent&&(s.indentLine(b.newPos.line,null,!0),s.indentLine(b.newPos.line+1,null,!0))}}function T(s,a){for(var r=s.listSelections(),f=[],p=a?"/":""&&(w+=">"),f[y]=w}if(s.replaceSelections(f),r=s.listSelections(),!E)for(var y=0;y=0&&a[l]==r;l--)++y;f=E.to;for(var l=1;l0){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:"",a=[],r=0;r=0;a--){var r=S().key(a);s(R(r),r)}}function C(s){return S().removeItem(s)}function h(){return S().clear()}},DlQD:function(I,q,N){(function(P,m){I.exports=m()})(this,function(){"use strict";function P(Ie,Oe){for(var Le=0;LeIe.length)&&(Oe=Ie.length);for(var Le=0,Te=new Array(Oe);Le=Ie.length?{done:!0}:{done:!1,value:Ie[Te++]}}}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 Le=Ie[Symbol.iterator](),Le.next.bind(Le)}function g(Ie,Oe){return Oe={exports:{}},Ie(Oe,Oe.exports),Oe.exports}var C=g(function(Ie){function Oe(){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 Le(Te){Ie.exports.defaults=Te}Ie.exports={defaults:Oe(),getDefaults:Oe,changeDefaults:Le}}),h=C.defaults,s=C.getDefaults,a=C.changeDefaults,r=/[&<>"']/,f=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,E={"&":"&","<":"<",">":">",'"':""","'":"'"},y=function(Oe){return E[Oe]};function l(Ie,Oe){if(Oe){if(r.test(Ie))return Ie.replace(f,y)}else if(p.test(Ie))return Ie.replace(d,y);return Ie}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(Ie){return Ie.replace(n,function(Oe,Le){return Le=Le.toLowerCase(),Le==="colon"?":":Le.charAt(0)==="#"?Le.charAt(1)==="x"?String.fromCharCode(parseInt(Le.substring(2),16)):String.fromCharCode(+Le.substring(1)):""})}var u=/(^|[^\[])\^/g;function w(Ie,Oe){Ie=Ie.source||Ie,Oe=Oe||"";var Le={replace:function(Ae,ke){return ke=ke.source||ke,ke=ke.replace(u,"$1"),Ie=Ie.replace(Ae,ke),Le},getRegex:function(){return new RegExp(Ie,Oe)}};return Le}var v=/[^\w:]/g,i=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Ie,Oe,Le){if(Ie){var Te;try{Te=decodeURIComponent(o(Le)).replace(v,"").toLowerCase()}catch(Ae){return null}if(Te.indexOf("javascript:")===0||Te.indexOf("vbscript:")===0||Te.indexOf("data:")===0)return null}Oe&&!i.test(Le)&&(Le=_(Oe,Le));try{Le=encodeURI(Le).replace(/%25/g,"%")}catch(Ae){return null}return Le}var k={},c=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(Ie,Oe){k[" "+Ie]||(c.test(Ie)?k[" "+Ie]=Ie+"/":k[" "+Ie]=X(Ie,"/",!0)),Ie=k[" "+Ie];var Le=Ie.indexOf(":")===-1;return Oe.substring(0,2)==="//"?Le?Oe:Ie.replace(b,"$1")+Oe:Oe.charAt(0)==="/"?Le?Oe:Ie.replace(x,"$1")+Oe:Ie+Oe}var j={exec:function(){}};function F(Ie){for(var Oe=1,Le,Te;Oe=0&&Fe[qe]==="\\";)Xe=!Xe;return Xe?"|":" |"}),Te=Le.split(/ \|/),Ae=0;if(Te.length>Oe)Te.splice(Oe);else for(;Te.length=Te.length?Ae.slice(Te.length):Ae}).join(` `)}var Ce=function(){function Ie(Le){this.options=Le||U}var Oe=Ie.prototype;return Oe.space=function(Te){var Ae=this.rules.block.newline.exec(Te);if(Ae)return Ae[0].length>1?{type:"space",raw:Ae[0]}:{raw:` `}},Oe.code=function(Te,Ae){var ke=this.rules.block.code.exec(Te);if(ke){var Me=Ae[Ae.length-1];if(Me&&Me.type==="paragraph")return{raw:ke[0],text:ke[0].trimRight()};var Fe=ke[0].replace(/^ {4}/gm,"");return{type:"code",raw:ke[0],codeBlockStyle:"indented",text:this.options.pedantic?Fe:B(Fe,` `)}}},Oe.fences=function(Te){var Ae=this.rules.block.fences.exec(Te);if(Ae){var ke=Ae[0],Me=be(ke,Ae[3]||"");return{type:"code",raw:ke,lang:Ae[2]?Ae[2].trim():Ae[2],text:Me}}},Oe.heading=function(Te){var Ae=this.rules.block.heading.exec(Te);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[1].length,text:Ae[2]}},Oe.nptable=function(Te){var Ae=this.rules.block.nptable.exec(Te);if(Ae){var ke={type:"table",header:W(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(` `):[],raw:Ae[0]};if(ke.header.length===ke.align.length){var Me=ke.align.length,Fe;for(Fe=0;Fe ?/gm,"");return{type:"blockquote",raw:Ae[0],text:ke}}},Oe.list=function(Te){var Ae=this.rules.block.list.exec(Te);if(Ae){for(var ke=Ae[0],Me=Ae[2],Fe=Me.length>1,Xe=Me[Me.length-1]===")",qe={type:"list",raw:ke,ordered:Fe,start:Fe?+Me.slice(0,-1):"",loose:!1,items:[]},pt=Ae[0].match(this.rules.block.item),at=!1,ft,Et,xt,lt,Wt,It,ir,$t=pt.length,At=0;At<$t;At++)ft=pt[At],ke=ft,Et=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(` `)&&(Et-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+Et+"}","gm"),"")),At!==$t-1&&(xt=this.rules.block.bullet.exec(pt[At+1])[0],(Fe?xt.length===1||!Xe&&xt[xt.length-1]===")":xt.length>1||this.options.smartLists&&xt!==Me)&&(lt=pt.slice(At+1).join(` `),qe.raw=qe.raw.substring(0,qe.raw.length-lt.length),At=$t-1)),Wt=at||/\n\n(?!\s*$)/.test(ft),At!==$t-1&&(at=ft.charAt(ft.length-1)===` `,Wt||(Wt=at)),Wt&&(qe.loose=!0),It=/^\[[ xX]\] /.test(ft),ir=void 0,It&&(ir=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),qe.items.push({type:"list_item",raw:ke,task:It,checked:ir,loose:Wt,text:ft});return qe}},Oe.html=function(Te){var Ae=this.rules.block.html.exec(Te);if(Ae)return{type:this.options.sanitize?"paragraph":"html",raw:Ae[0],pre:!this.options.sanitizer&&(Ae[1]==="pre"||Ae[1]==="script"||Ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):te(Ae[0]):Ae[0]}},Oe.def=function(Te){var Ae=this.rules.block.def.exec(Te);if(Ae){Ae[3]&&(Ae[3]=Ae[3].substring(1,Ae[3].length-1));var ke=Ae[1].toLowerCase().replace(/\s+/g," ");return{tag:ke,raw:Ae[0],href:Ae[2],title:Ae[3]}}},Oe.table=function(Te){var Ae=this.rules.block.table.exec(Te);if(Ae){var ke={type:"table",header:W(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(` `):[]};if(ke.header.length===ke.align.length){ke.raw=Ae[0];var Me=ke.align.length,Fe;for(Fe=0;Fe/i.test(Me[0])&&(Ae=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(Me[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Me[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:Me[0],inLink:Ae,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Me[0]):te(Me[0]):Me[0]}},Oe.link=function(Te){var Ae=this.rules.inline.link.exec(Te);if(Ae){var ke=de(Ae[2],"()");if(ke>-1){var Me=Ae[0].indexOf("!")===0?5:4,Fe=Me+Ae[1].length+ke;Ae[2]=Ae[2].substring(0,ke),Ae[0]=Ae[0].substring(0,Fe).trim(),Ae[3]=""}var Xe=Ae[2],qe="";if(this.options.pedantic){var pt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Xe);pt?(Xe=pt[1],qe=pt[3]):qe=""}else qe=Ae[3]?Ae[3].slice(1,-1):"";Xe=Xe.trim().replace(/^<([\s\S]*)>$/,"$1");var at=fe(Ae,{href:Xe&&Xe.replace(this.rules.inline._escapes,"$1"),title:qe&&qe.replace(this.rules.inline._escapes,"$1")},Ae[0]);return at}},Oe.reflink=function(Te,Ae){var ke;if((ke=this.rules.inline.reflink.exec(Te))||(ke=this.rules.inline.nolink.exec(Te))){var Me=(ke[2]||ke[1]).replace(/\s+/g," ");if(Me=Ae[Me.toLowerCase()],!Me||!Me.href){var Fe=ke[0].charAt(0);return{type:"text",raw:Fe,text:Fe}}var Xe=fe(ke,Me,ke[0]);return Xe}},Oe.strong=function(Te,Ae,ke){ke===void 0&&(ke="");var Me=this.rules.inline.strong.start.exec(Te);if(Me&&(!Me[1]||Me[1]&&(ke===""||this.rules.inline.punctuation.exec(ke)))){Ae=Ae.slice(-1*Te.length);var Fe=Me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Fe.lastIndex=0;for(var Xe;(Me=Fe.exec(Ae))!=null;)if(Xe=this.rules.inline.strong.middle.exec(Ae.slice(0,Me.index+3)),Xe)return{type:"strong",raw:Te.slice(0,Xe[0].length),text:Te.slice(2,Xe[0].length-2)}}},Oe.em=function(Te,Ae,ke){ke===void 0&&(ke="");var Me=this.rules.inline.em.start.exec(Te);if(Me&&(!Me[1]||Me[1]&&(ke===""||this.rules.inline.punctuation.exec(ke)))){Ae=Ae.slice(-1*Te.length);var Fe=Me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Fe.lastIndex=0;for(var Xe;(Me=Fe.exec(Ae))!=null;)if(Xe=this.rules.inline.em.middle.exec(Ae.slice(0,Me.index+2)),Xe)return{type:"em",raw:Te.slice(0,Xe[0].length),text:Te.slice(1,Xe[0].length-1)}}},Oe.codespan=function(Te){var Ae=this.rules.inline.code.exec(Te);if(Ae){var ke=Ae[2].replace(/\n/g," "),Me=/[^ ]/.test(ke),Fe=ke.startsWith(" ")&&ke.endsWith(" ");return Me&&Fe&&(ke=ke.substring(1,ke.length-1)),ke=te(ke,!0),{type:"codespan",raw:Ae[0],text:ke}}},Oe.br=function(Te){var Ae=this.rules.inline.br.exec(Te);if(Ae)return{type:"br",raw:Ae[0]}},Oe.del=function(Te){var Ae=this.rules.inline.del.exec(Te);if(Ae)return{type:"del",raw:Ae[0],text:Ae[1]}},Oe.autolink=function(Te,Ae){var ke=this.rules.inline.autolink.exec(Te);if(ke){var Me,Fe;return ke[2]==="@"?(Me=te(this.options.mangle?Ae(ke[1]):ke[1]),Fe="mailto:"+Me):(Me=te(ke[1]),Fe=Me),{type:"link",raw:ke[0],text:Me,href:Fe,tokens:[{type:"text",raw:Me,text:Me}]}}},Oe.url=function(Te,Ae){var ke;if(ke=this.rules.inline.url.exec(Te)){var Me,Fe;if(ke[2]==="@")Me=te(this.options.mangle?Ae(ke[0]):ke[0]),Fe="mailto:"+Me;else{var Xe;do Xe=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0];while(Xe!==ke[0]);Me=te(ke[0]),ke[1]==="www."?Fe="http://"+Me:Fe=Me}return{type:"link",raw:ke[0],text:Me,href:Fe,tokens:[{type:"text",raw:Me,text:Me}]}}},Oe.inlineText=function(Te,Ae,ke){var Me=this.rules.inline.text.exec(Te);if(Me){var Fe;return Ae?Fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Me[0]):te(Me[0]):Me[0]:Fe=te(this.options.smartypants?ke(Me[0]):Me[0]),{type:"text",raw:Me[0],text:Fe}}},Ie}(),ue=G.noopTest,ge=G.edit,pe=G.merge,oe={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ue,table:ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};oe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,oe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,oe.def=ge(oe.def).replace("label",oe._label).replace("title",oe._title).getRegex(),oe.bullet=/(?:[*+-]|\d{1,9}[.)])/,oe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,oe.item=ge(oe.item,"gm").replace(/bull/g,oe.bullet).getRegex(),oe.list=ge(oe.list).replace(/bull/g,oe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oe.def.source+")").getRegex(),oe._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",oe._comment=//,oe.html=ge(oe.html,"i").replace("comment",oe._comment).replace("tag",oe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe.paragraph=ge(oe._paragraph).replace("hr",oe.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",")|<(?:script|pre|style|!--)").replace("tag",oe._tag).getRegex(),oe.blockquote=ge(oe.blockquote).replace("paragraph",oe.paragraph).getRegex(),oe.normal=pe({},oe),oe.gfm=pe({},oe.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*|$)"}),oe.gfm.nptable=ge(oe.gfm.nptable).replace("hr",oe.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",")|<(?:script|pre|style|!--)").replace("tag",oe._tag).getRegex(),oe.gfm.table=ge(oe.gfm.table).replace("hr",oe.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",")|<(?:script|pre|style|!--)").replace("tag",oe._tag).getRegex(),oe.pedantic=pe({},oe.normal,{html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oe._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ue,paragraph:ge(oe.normal._paragraph).replace("hr",oe.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",oe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ue,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ae.punctuation=ge(ae.punctuation).replace(/punctuation/g,ae._punctuation).getRegex(),ae._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ae._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ae.em.start=ge(ae.em.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.middle=ge(ae.em.middle).replace(/punctuation/g,ae._punctuation).replace(/overlapSkip/g,ae._overlapSkip).getRegex(),ae.em.endAst=ge(ae.em.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.endUnd=ge(ae.em.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.start=ge(ae.strong.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.middle=ge(ae.strong.middle).replace(/punctuation/g,ae._punctuation).replace(/blockSkip/g,ae._blockSkip).getRegex(),ae.strong.endAst=ge(ae.strong.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.endUnd=ge(ae.strong.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=ge(ae._blockSkip,"g").getRegex(),ae.overlapSkip=ge(ae._overlapSkip,"g").getRegex(),ae._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._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])?)+(?![-_])/,ae.autolink=ge(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=ge(ae.tag).replace("comment",oe._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=ge(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=ge(ae.reflink).replace("label",ae._label).getRegex(),ae.reflinkSearch=ge(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal=pe({},ae),ae.pedantic=pe({},ae.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:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()}),ae.gfm=pe({},ae.normal,{escape:ge(ae.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]*?(?:(?=[\\.5&&(Te="x"+Te.toString(16)),Oe+="&#"+Te+";";return Oe}var J=function(){function Ie(Le){this.tokens=[],this.tokens.links=Object.create(null),this.options=Le||he,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Te={block:Q.normal,inline:ie.normal};this.options.pedantic?(Te.block=Q.pedantic,Te.inline=ie.pedantic):this.options.gfm&&(Te.block=Q.gfm,this.options.breaks?Te.inline=ie.breaks:Te.inline=ie.gfm),this.tokenizer.rules=Te}Ie.lex=function(Te,Ae){var ke=new Ie(Ae);return ke.lex(Te)};var Oe=Ie.prototype;return Oe.lex=function(Te){return Te=Te.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(Te,this.tokens,!0),this.inline(this.tokens),this.tokens},Oe.blockTokens=function(Te,Ae,ke){Ae===void 0&&(Ae=[]),ke===void 0&&(ke=!0),Te=Te.replace(/^ +$/gm,"");for(var Me,Fe,Xe,qe;Te;){if(Me=this.tokenizer.space(Te)){Te=Te.substring(Me.raw.length),Me.type&&Ae.push(Me);continue}if(Me=this.tokenizer.code(Te,Ae)){Te=Te.substring(Me.raw.length),Me.type?Ae.push(Me):(qe=Ae[Ae.length-1],qe.raw+=` `+Me.raw,qe.text+=` `+Me.text);continue}if(Me=this.tokenizer.fences(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.heading(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.nptable(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.hr(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.blockquote(Te)){Te=Te.substring(Me.raw.length),Me.tokens=this.blockTokens(Me.text,[],ke),Ae.push(Me);continue}if(Me=this.tokenizer.list(Te)){for(Te=Te.substring(Me.raw.length),Xe=Me.items.length,Fe=0;Fe0)for(;(pt=this.tokenizer.rules.inline.reflinkSearch.exec(qe))!=null;)at.includes(pt[0].slice(pt[0].lastIndexOf("[")+1,-1))&&(qe=qe.slice(0,pt.index)+"["+"a".repeat(pt[0].length-2)+"]"+qe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(pt=this.tokenizer.rules.inline.blockSkip.exec(qe))!=null;)qe=qe.slice(0,pt.index)+"["+"a".repeat(pt[0].length-2)+"]"+qe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Te;){if(Xe=this.tokenizer.escape(Te)){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(Xe=this.tokenizer.tag(Te,ke,Me)){Te=Te.substring(Xe.raw.length),ke=Xe.inLink,Me=Xe.inRawBlock,Ae.push(Xe);continue}if(Xe=this.tokenizer.link(Te)){Te=Te.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,Me)),Ae.push(Xe);continue}if(Xe=this.tokenizer.reflink(Te,this.tokens.links)){Te=Te.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,Me)),Ae.push(Xe);continue}if(Xe=this.tokenizer.strong(Te,qe,Fe)){Te=Te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ke,Me),Ae.push(Xe);continue}if(Xe=this.tokenizer.em(Te,qe,Fe)){Te=Te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ke,Me),Ae.push(Xe);continue}if(Xe=this.tokenizer.codespan(Te)){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(Xe=this.tokenizer.br(Te)){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(Xe=this.tokenizer.del(Te)){Te=Te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ke,Me),Ae.push(Xe);continue}if(Xe=this.tokenizer.autolink(Te,ne)){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(!ke&&(Xe=this.tokenizer.url(Te,ne))){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(Xe=this.tokenizer.inlineText(Te,Me,we)){Te=Te.substring(Xe.raw.length),Fe=Xe.raw.slice(-1),Ae.push(Xe);continue}if(Te){var ft="Infinite loop on byte: "+Te.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return Ae},m(Ie,null,[{key:"rules",get:function(){return{block:Q,inline:ie}}}]),Ie}(),V=C.defaults,Z=G.cleanUrl,Ee=G.escape,xe=function(){function Ie(Le){this.options=Le||V}var Oe=Ie.prototype;return Oe.code=function(Te,Ae,ke){var Me=(Ae||"").match(/\S*/)[0];if(this.options.highlight){var Fe=this.options.highlight(Te,Me);Fe!=null&&Fe!==Te&&(ke=!0,Te=Fe)}return Me?'
    '+(ke?Te:Ee(Te,!0))+`
    `:"
    "+(ke?Te:Ee(Te,!0))+`
    `},Oe.blockquote=function(Te){return`
    `+Te+`
    `},Oe.html=function(Te){return Te},Oe.heading=function(Te,Ae,ke,Me){return this.options.headerIds?"'+Te+" `:""+Te+" `},Oe.hr=function(){return this.options.xhtml?`
    `:`
    `},Oe.list=function(Te,Ae,ke){var Me=Ae?"ol":"ul",Fe=Ae&&ke!==1?' start="'+ke+'"':"";return"<"+Me+Fe+`> `+Te+" `},Oe.listitem=function(Te){return"
  • "+Te+`
  • `},Oe.checkbox=function(Te){return" "},Oe.paragraph=function(Te){return"

    "+Te+`

    `},Oe.table=function(Te,Ae){return Ae&&(Ae=""+Ae+""),` `+Te+` `+Ae+`
    `},Oe.tablerow=function(Te){return` `+Te+` `},Oe.tablecell=function(Te,Ae){var ke=Ae.header?"th":"td",Me=Ae.align?"<"+ke+' align="'+Ae.align+'">':"<"+ke+">";return Me+Te+" `},Oe.strong=function(Te){return""+Te+""},Oe.em=function(Te){return""+Te+""},Oe.codespan=function(Te){return""+Te+""},Oe.br=function(){return this.options.xhtml?"
    ":"
    "},Oe.del=function(Te){return""+Te+""},Oe.link=function(Te,Ae,ke){if(Te=Z(this.options.sanitize,this.options.baseUrl,Te),Te===null)return ke;var Me='",Me},Oe.image=function(Te,Ae,ke){if(Te=Z(this.options.sanitize,this.options.baseUrl,Te),Te===null)return ke;var Me=''+ke+'":">",Me},Oe.text=function(Te){return Te},Ie}(),_e=function(){function Ie(){}var Oe=Ie.prototype;return Oe.strong=function(Te){return Te},Oe.em=function(Te){return Te},Oe.codespan=function(Te){return Te},Oe.del=function(Te){return Te},Oe.html=function(Te){return Te},Oe.text=function(Te){return Te},Oe.link=function(Te,Ae,ke){return""+ke},Oe.image=function(Te,Ae,ke){return""+ke},Oe.br=function(){return""},Ie}(),je=function(){function Ie(){this.seen={}}var Oe=Ie.prototype;return Oe.slug=function(Te){var Ae=Te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ae)){var ke=Ae;do this.seen[ke]++,Ae=ke+"-"+this.seen[ke];while(this.seen.hasOwnProperty(Ae))}return this.seen[Ae]=0,Ae},Ie}(),Be=C.defaults,He=G.unescape,Ue=function(){function Ie(Le){this.options=Le||Be,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _e,this.slugger=new je}Ie.parse=function(Te,Ae){var ke=new Ie(Ae);return ke.parse(Te)};var Oe=Ie.prototype;return Oe.parse=function(Te,Ae){Ae===void 0&&(Ae=!0);var ke="",Me,Fe,Xe,qe,pt,at,ft,Et,xt,lt,Wt,It,ir,$t,At,Rt,hr,St,Je=Te.length;for(Me=0;Me0&&At.tokens[0].type==="text"?(At.tokens[0].text=St+" "+At.tokens[0].text,At.tokens[0].tokens&&At.tokens[0].tokens.length>0&&At.tokens[0].tokens[0].type==="text"&&(At.tokens[0].tokens[0].text=St+" "+At.tokens[0].tokens[0].text)):At.tokens.unshift({type:"text",text:St}):$t+=St),$t+=this.parse(At.tokens,ir),xt+=this.renderer.listitem($t,hr,Rt);ke+=this.renderer.list(xt,Wt,It);continue}case"html":{ke+=this.renderer.html(lt.text);continue}case"paragraph":{ke+=this.renderer.paragraph(this.parseInline(lt.tokens));continue}case"text":{for(xt=lt.tokens?this.parseInline(lt.tokens):lt.text;Me+1An error occurred:

    "+Ye(Xe.message+"",!0)+"
    ";throw Xe}}We.options=We.setOptions=function(Ie){return ze(We.defaults,Ie),tt(We.defaults),We},We.getDefaults=Re,We.defaults=rt,We.use=function(Ie){var Oe=ze({},Ie);if(Ie.renderer&&function(){var Te=We.defaults.renderer||new xe,Ae=function(Fe){var Xe=Te[Fe];Te[Fe]=function(){for(var qe=arguments.length,pt=new Array(qe),at=0;at=0;p--){if(!S(f[p]))continue;var d=f[p].split("="),E=unescape(d[0]),y=unescape(d[1]);r(y,E)}}function C(r,f){if(!r)return;R.cookie=escape(r)+"="+escape(f)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function h(r){if(!r||!a(r))return;R.cookie=escape(r)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function s(){g(function(r,f){h(f)})}function a(r){return new RegExp("(?:^|;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(R.cookie)}},E4JC:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.StreamCipher,T=m.algo,g=[],C=[],h=[],s=T.Rabbit=R.extend({_doReset:function(){for(var r=this._key.words,f=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 d=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],E=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++)a.call(this);for(var p=0;p<8;p++)E[p]^=d[p+4&7];if(f){var y=f.words,l=y[0],n=y[1],o=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,u=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,w=o>>>16|u&4294901760,v=u<<16|o&65535;E[0]^=o,E[1]^=w,E[2]^=u,E[3]^=v,E[4]^=o,E[5]^=w,E[6]^=u,E[7]^=v;for(var p=0;p<4;p++)a.call(this)}},_doProcessBlock:function(r,f){var p=this._X;a.call(this),g[0]=p[0]^p[5]>>>16^p[3]<<16,g[1]=p[2]^p[7]>>>16^p[5]<<16,g[2]=p[4]^p[1]>>>16^p[7]<<16,g[3]=p[6]^p[3]>>>16^p[1]<<16;for(var d=0;d<4;d++)g[d]=(g[d]<<8|g[d]>>>24)&16711935|(g[d]<<24|g[d]>>>8)&4278255360,r[f+d]^=g[d]},blockSize:128/32,ivSize:64/32});function a(){for(var r=this._X,f=this._C,p=0;p<8;p++)C[p]=f[p];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0>>0?1:0)|0,this._b=f[7]>>>0>>0?1:0;for(var p=0;p<8;p++){var d=r[p]+f[p],E=d&65535,y=d>>>16,l=((E*E>>>17)+E*y>>>15)+y*y,n=((d&4294901760)*d|0)+((d&65535)*d|0);h[p]=l^n}r[0]=h[0]+(h[7]<<16|h[7]>>>16)+(h[6]<<16|h[6]>>>16)|0,r[1]=h[1]+(h[0]<<8|h[0]>>>24)+h[7]|0,r[2]=h[2]+(h[1]<<16|h[1]>>>16)+(h[0]<<16|h[0]>>>16)|0,r[3]=h[3]+(h[2]<<8|h[2]>>>24)+h[1]|0,r[4]=h[4]+(h[3]<<16|h[3]>>>16)+(h[2]<<16|h[2]>>>16)|0,r[5]=h[5]+(h[4]<<8|h[4]>>>24)+h[3]|0,r[6]=h[6]+(h[5]<<16|h[5]>>>16)+(h[4]<<16|h[4]>>>16)|0,r[7]=h[7]+(h[6]<<8|h[6]>>>24)+h[5]|0}m.Rabbit=R._createHelper(s)}(),P.Rabbit})},EHPI:function(I,q,N){"use strict";var P=N("bbsP"),m=N("/wGt"),S=N("tJVT"),R=N("k1fw"),T=N("q1tI"),g=N.n(T),C=N("ZW9T"),h=N("ZD9Y"),s=N("M8RZ"),a=N("bCnd"),r=N("fcyK"),f=N.n(r),p={theme:Object(a.a)("cmCodeMode","vs-dark"),fontSize:Object(a.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(a.a)("cmTabToSpace",!0)},d;(function(l){l[l.set_font_size=0]="set_font_size",l[l.set_theme=1]="set_theme",l[l.on_tab_to_space=2]="on_tab_to_space",l[l.set_show_editor_setting=3]="set_show_editor_setting"})(d||(d={}));function E(l,n){switch(n.type){case d.set_show_editor_setting:return Object(R.a)(Object(R.a)({},l),{},{showEditorSetting:n.payload});case d.set_theme:return Object(R.a)(Object(R.a)({},l),{},{theme:n.payload});case d.set_font_size:return Object(R.a)(Object(R.a)({},l),{},{fontSize:n.payload});case d.on_tab_to_space:return Object(R.a)(Object(R.a)({},l),{},{tabToSpace:n.payload});default:throw new Error}}q.a=function(l){var n=l.isLoading,o=l.value,u=l.onChange,w=l.language,v=l.ActionBarRender,i=v===void 0?function(G){return g.a.createElement(y,{onShowCodeSetting:G})}:v,D=Object(T.useReducer)(E,p),k=Object(S.a)(D,2),c=k[0],b=k[1],x=c.theme,_=c.fontSize,j=c.showEditorSetting,F=c.tabToSpace,L={onFontSizeChange:function(U){b({type:d.set_font_size,payload:U}),Object(a.b)("cmFontSize",U)},tabToSpace:F,cmFontSize:_,className:"oj",cmCodeMode:x,onTabToSpace:function(U){b({type:d.on_tab_to_space,payload:U}),Object(a.b)("cmTabToSpace",U)},onCodeModeChange:function(U){b({type:d.set_theme,payload:U}),Object(a.b)("cmCodeMode",U)}};function X(){b({type:d.set_show_editor_setting,payload:!1})}function z(){b({type:d.set_show_editor_setting,payload:!0})}var H={value:o,language:w,onChange:u,theme:x,height:"calc(100% - 56px)",options:{fontSize:_,insertSpaces:F}};return g.a.createElement(T.Fragment,null,g.a.createElement("div",{className:"code-panel-container"},i(z),!n&&g.a.createElement(C.b,H)),g.a.createElement(s.a,null,g.a.createElement(m.a,{className:"oj",title:null,placement:"right",closable:!1,visible:j,onClose:X},g.a.createElement(h.a,L))))};function y(l){var n=l.onShowCodeSetting;return g.a.createElement("div",{className:"action-bar"},g.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),g.a.createElement("a",{onClick:n},g.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(I,q,N){(function(P){P(N("VrN/"))})(function(P){var m={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},S=P.Pos;P.defineOption("autoCloseBrackets",!1,function(E,y,l){l&&l!=P.Init&&(E.removeKeyMap(T),E.state.closeBrackets=null),y&&(g(R(y,"pairs")),E.state.closeBrackets=y,E.addKeyMap(T))});function R(E,y){return y=="pairs"&&typeof E=="string"?E:typeof E=="object"&&E[y]!=null?E[y]:m[y]}var T={Backspace:s,Enter:a};function g(E){for(var y=0;y=0;o--){var w=n[o].head;E.replaceRange("",S(w.line,w.ch-1),S(w.line,w.ch+1),"+delete")}}function a(E){var y=h(E),l=y&&R(y,"explode");if(!l||E.getOption("disableInput"))return P.Pass;for(var n=E.listSelections(),o=0;o0;return{anchor:new S(E.anchor.line,E.anchor.ch+(y?-1:1)),head:new S(E.head.line,E.head.ch+(y?1:-1))}}function f(E,y){var l=h(E);if(!l||E.getOption("disableInput"))return P.Pass;var n=R(l,"pairs"),o=n.indexOf(y);if(o==-1)return P.Pass;for(var u=R(l,"closeBefore"),w=R(l,"triples"),v=n.charAt(o+1)==y,i=E.listSelections(),D=o%2==0,k,c=0;c=0&&E.getRange(x,S(x.line,x.ch+3))==y+y+y?_="skipThree":_="skip";else if(v&&x.ch>1&&w.indexOf(y)>=0&&E.getRange(S(x.line,x.ch-2),x)==y+y){if(x.ch>2&&/\bstring/.test(E.getTokenTypeAt(S(x.line,x.ch-2))))return P.Pass;_="addFour"}else if(v){var F=x.ch==0?" ":E.getRange(S(x.line,x.ch-1),x);if(!P.isWordChar(j)&&F!=y&&!P.isWordChar(F))_="both";else return P.Pass}else if(D&&(j.length===0||/\s/.test(j)||u.indexOf(j)>-1))_="both";else return P.Pass;if(!k)k=_;else if(k!=_)return P.Pass}var L=o%2?n.charAt(o-1):y,X=o%2?y:n.charAt(o+1);E.operation(function(){if(k=="skip")E.execCommand("goCharRight");else if(k=="skipThree")for(var z=0;z<3;z++)E.execCommand("goCharRight");else if(k=="surround"){for(var H=E.getSelections(),z=0;z>>24)&16711935|(k<<24|k>>>8)&4278255360}var c=this._hash.words,b=f.words,x=p.words,_=h.words,j=s.words,F=a.words,L=r.words,X,z,H,G,U,B,W,te,de,fe;B=X=c[0],W=z=c[1],te=H=c[2],de=G=c[3],fe=U=c[4];for(var be,i=0;i<80;i+=1)be=X+w[v+_[i]]|0,i<16?be+=E(z,H,G)+b[0]:i<32?be+=y(z,H,G)+b[1]:i<48?be+=l(z,H,G)+b[2]:i<64?be+=n(z,H,G)+b[3]:be+=o(z,H,G)+b[4],be=be|0,be=u(be,F[i]),be=be+U|0,X=U,U=G,G=u(H,10),H=z,z=be,be=B+w[v+j[i]]|0,i<16?be+=o(W,te,de)+x[0]:i<32?be+=n(W,te,de)+x[1]:i<48?be+=l(W,te,de)+x[2]:i<64?be+=y(W,te,de)+x[3]:be+=E(W,te,de)+x[4],be=be|0,be=u(be,L[i]),be=be+fe|0,B=fe,fe=de,de=u(te,10),te=W,W=be;be=c[1]+H+de|0,c[1]=c[2]+G+fe|0,c[2]=c[3]+U+B|0,c[3]=c[4]+X+W|0,c[4]=c[0]+z+te|0,c[0]=be},_doFinalize:function(){var w=this._data,v=w.words,i=this._nDataBytes*8,D=w.sigBytes*8;v[D>>>5]|=128<<24-D%32,v[(D+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,w.sigBytes=(v.length+1)*4,this._process();for(var k=this._hash,c=k.words,b=0;b<5;b++){var x=c[b];c[b]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}return k},clone:function(){var w=g.clone.call(this);return w._hash=this._hash.clone(),w}});function E(w,v,i){return w^v^i}function y(w,v,i){return w&v|~w&i}function l(w,v,i){return(w|~v)^i}function n(w,v,i){return w&i|v&~i}function o(w,v,i){return w^(v|~i)}function u(w,v){return w<>>32-v}S.RIPEMD160=g._createHelper(d),S.HmacRIPEMD160=g._createHmacHelper(d)}(Math),P.RIPEMD160})},ETIr:function(I,q,N){(function(P,m){I.exports=q=m(N("Ib8C"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=m.enc,g=T.Base64={stringify:function(h){var s=h.words,a=h.sigBytes,r=this._map;h.clamp();for(var f=[],p=0;p>>2]>>>24-p%4*8&255,E=s[p+1>>>2]>>>24-(p+1)%4*8&255,y=s[p+2>>>2]>>>24-(p+2)%4*8&255,l=d<<16|E<<8|y,n=0;n<4&&p+n*.75>>6*(3-n)&63));var o=r.charAt(64);if(o)for(;f.length%4;)f.push(o);return f.join("")},parse:function(h){var s=h.length,a=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var f=0;f>>6-p%4*2,y=d|E;r[f>>>2]|=y<<24-f%4*8,f++}return R.create(r,f)}}(),P.enc.Base64})},"F+F2":function(I,q,N){(function(P,m){I.exports=q=m(N("Ib8C"))})(this,function(P){return function(){if(typeof ArrayBuffer!="function")return;var m=P,S=m.lib,R=S.WordArray,T=R.init,g=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 h=C.byteLength,s=[],a=0;a>>2]|=C[a]<<24-a%4*8;T.call(this,s,h)}else T.apply(this,arguments)};g.prototype=R}(),P.lib.WordArray})},GRuw:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("lPiR"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=m.algo,g=T.SHA256,C=T.SHA224=g.extend({_doReset:function(){this._hash=new R.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var h=g._doFinalize.call(this);return h.sigBytes-=4,h}});m.SHA224=g._createHelper(C),m.HmacSHA224=g._createHmacHelper(C)}(),P.SHA224})},GfqC:function(I,q,N){"use strict";var P=N("q1tI"),m=N.n(P),S=N("TSYQ"),R=N.n(S);function T(G,U){var B="cannot "+G.method+" "+G.action+" "+U.status+"'",W=new Error(B);return W.status=U.status,W.method=G.method,W.url=G.action,W}function g(G){var U=G.responseText||G.response;if(!U)return U;try{return JSON.parse(U)}catch(B){return U}}function C(G){var U=new XMLHttpRequest;G.onProgress&&U.upload&&(U.upload.onprogress=function(de){de.total>0&&(de.percent=de.loaded/de.total*100),G.onProgress(de)});var B=new FormData;G.data&&Object.keys(G.data).forEach(function(te){var de=G.data[te];if(Array.isArray(de)){de.forEach(function(fe){B.append(te+"[]",fe)});return}B.append(te,G.data[te])}),G.file instanceof Blob?B.append(G.filename,G.file,G.file.name):B.append(G.filename,G.file),U.onerror=function(de){G.onError(de)},U.onload=function(){return U.status<200||U.status>=300?G.onError(T(G,U),g(U)):G.onSuccess(g(U),U)},U.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in U&&(U.withCredentials=!0);var W=G.headers||{};return W["X-Requested-With"]!==null&&U.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(te){W[te]!==null&&U.setRequestHeader(te,W[te])}),U.send(B),{abort:function(){U.abort()}}}var h=+new Date,s=0;function a(){return"rc-upload-"+h+"-"+ ++s}function r(G,U){return G.indexOf(U,G.length-U.length)!==-1}var f=function(G,U){if(G&&U){var B=Array.isArray(U)?U:U.split(","),W=G.name||"",te=G.type||"",de=te.replace(/\/.*$/,"");return B.some(function(fe){var be=fe.trim();return be.charAt(0)==="."?r(W.toLowerCase(),be.toLowerCase()):/\/\*$/.test(be)?de===be.replace(/\/.*$/,""):te===be})}return!0};function p(G,U){var B=G.createReader(),W=[];function te(){B.readEntries(function(de){var fe=Array.prototype.slice.apply(de);W=W.concat(fe);var be=!fe.length;be?U(W):te()})}te()}var d=function(U,B,W){var te=function de(fe,be){be=be||"",fe.isFile?fe.file(function(Ce){W(Ce)&&(fe.fullPath&&!Ce.webkitRelativePath&&(Object.defineProperties(Ce,{webkitRelativePath:{writable:!0}}),Ce.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(Ce,{webkitRelativePath:{writable:!1}})),B([Ce]))}):fe.isDirectory&&p(fe,function(Ce){Ce.forEach(function(ue){de(ue,""+be+fe.name+"/")})})};U.forEach(function(de){te(de.webkitGetAsEntry())})},E=d,y=Object.assign||function(G){for(var U=1;U=0)continue;if(!Object.prototype.hasOwnProperty.call(G,W))continue;B[W]=G[W]}return B}function w(G,U){if(!(G instanceof U))throw new TypeError("Cannot call a class as a function")}function v(G,U){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:G}function i(G,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);G.prototype=Object.create(U&&U.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(G,U):G.__proto__=U)}var D=function(U){return Object.keys(U).reduce(function(B,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(B[W]=U[W]),B},{})},k=function(G){i(U,G);function U(){var B,W,te,de;w(this,U);for(var fe=arguments.length,be=Array(fe),Ce=0;Ce>>2]>>>24-D%4*8&255;u[v+D>>>2]|=k<<24-(v+D)%4*8}else for(var c=0;c>>2]=w[c>>>2];return this.sigBytes+=i,this},clamp:function(){var o=this.words,u=this.sigBytes;o[u>>>2]&=4294967295<<32-u%4*8,o.length=S.ceil(u/4)},clone:function(){var o=a.clone.call(this);return o.words=this.words.slice(0),o},random:function(o){for(var u=[],w=0;w>>2]>>>24-i%4*8&255;v.push((D>>>4).toString(16)),v.push((D&15).toString(16))}return v.join("")},parse:function(o){for(var u=o.length,w=[],v=0;v>>3]|=parseInt(o.substr(v,2),16)<<24-v%8*4;return new r.init(w,u/2)}},d=f.Latin1={stringify:function(o){for(var u=o.words,w=o.sigBytes,v=[],i=0;i>>2]>>>24-i%4*8&255;v.push(String.fromCharCode(D))}return v.join("")},parse:function(o){for(var u=o.length,w=[],v=0;v>>2]|=(o.charCodeAt(v)&255)<<24-v%4*8;return new r.init(w,u)}},E=f.Utf8={stringify:function(o){try{return decodeURIComponent(escape(d.stringify(o)))}catch(u){throw new Error("Malformed UTF-8 data")}},parse:function(o){return d.parse(unescape(encodeURIComponent(o)))}},y=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(o){typeof o=="string"&&(o=E.parse(o)),this._data.concat(o),this._nDataBytes+=o.sigBytes},_process:function(o){var u,w=this._data,v=w.words,i=w.sigBytes,D=this.blockSize,k=D*4,c=i/k;o?c=S.ceil(c):c=S.max((c|0)-this._minBufferSize,0);var b=c*D,x=S.min(b*4,i);if(b){for(var _=0;_>>6)+s(128|X&63):s(224|X>>>12&15)+s(128|X>>>6&63)+s(128|X&63)}else{var X=65536+(L.charCodeAt(0)-55296)*1024+(L.charCodeAt(1)-56320);return s(240|X>>>18&7)+s(128|X>>>12&63)+s(128|X>>>6&63)+s(128|X&63)}},r=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(L){return L.replace(r,a)},p=function(L){var X=[0,2,1][L.length%3],z=L.charCodeAt(0)<<16|(L.length>1?L.charCodeAt(1):0)<<8|(L.length>2?L.charCodeAt(2):0),H=[C.charAt(z>>>18),C.charAt(z>>>12&63),X>=2?"=":C.charAt(z>>>6&63),X>=1?"=":C.charAt(z&63)];return H.join("")},d=R.btoa&&typeof R.btoa=="function"?function(L){return R.btoa(L)}:function(L){if(L.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return L.replace(/[\s\S]{1,3}/g,p)},E=function(L){return d(f(String(L)))},y=function(L){return L.replace(/[+\/]/g,function(X){return X=="+"?"-":"_"}).replace(/=/g,"")},l=function(L,X){return X?y(E(L)):E(L)},n=function(L){return l(L,!0)},o;R.Uint8Array&&(o=function(L,X){for(var z="",H=0,G=L.length;H>>18)+C.charAt(te>>>12&63)+(typeof B!="undefined"?C.charAt(te>>>6&63):"=")+(typeof W!="undefined"?C.charAt(te&63):"=")}return X?y(z):z});var u=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(L){switch(L.length){case 4:var X=(7&L.charCodeAt(0))<<18|(63&L.charCodeAt(1))<<12|(63&L.charCodeAt(2))<<6|63&L.charCodeAt(3),z=X-65536;return s((z>>>10)+55296)+s((z&1023)+56320);case 3:return s((15&L.charCodeAt(0))<<12|(63&L.charCodeAt(1))<<6|63&L.charCodeAt(2));default:return s((31&L.charCodeAt(0))<<6|63&L.charCodeAt(1))}},v=function(L){return L.replace(u,w)},i=function(L){var X=L.length,z=X%4,H=(X>0?h[L.charAt(0)]<<18:0)|(X>1?h[L.charAt(1)]<<12:0)|(X>2?h[L.charAt(2)]<<6:0)|(X>3?h[L.charAt(3)]:0),G=[s(H>>>16),s(H>>>8&255),s(H&255)];return G.length-=[0,0,2,1][z],G.join("")},D=R.atob&&typeof R.atob=="function"?function(L){return R.atob(L)}:function(L){return L.replace(/\S{1,4}/g,i)},k=function(L){return D(String(L).replace(/[^A-Za-z0-9\+\/]/g,""))},c=function(L){return v(D(L))},b=function(L){return String(L).replace(/[-_]/g,function(X){return X=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},x=function(L){return c(b(L))},_;R.Uint8Array&&(_=function(L){return Uint8Array.from(k(b(L)),function(X){return X.charCodeAt(0)})});var j=function(){var L=R.Base64;return R.Base64=T,L};if(R.Base64={VERSION:g,atob:k,btoa:d,fromBase64:x,toBase64:l,utob:f,encode:l,encodeURI:n,btou:v,decode:x,noConflict:j,fromUint8Array:o,toUint8Array:_},typeof Object.defineProperty=="function"){var F=function(L){return{value:L,enumerable:!1,writable:!0,configurable:!0}};R.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",F(function(){return x(this)})),Object.defineProperty(String.prototype,"toBase64",F(function(L){return l(this,L)})),Object.defineProperty(String.prototype,"toBase64URI",F(function(){return l(this,!0)}))}}return R.Meteor&&(Base64=R.Base64),I.exports?I.exports.Base64=R.Base64:!(m=[],S=function(){return R.Base64}.apply(q,m),S!==void 0&&(I.exports=S)),{Base64:R.Base64}})}).call(this,N("IyRk"))},K3mO:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("3y9D"),N("WYAk"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.Base,T=S.WordArray,g=m.algo,C=g.MD5,h=g.EvpKDF=R.extend({cfg:R.extend({keySize:128/32,hasher:C,iterations:1}),init:function(s){this.cfg=this.cfg.extend(s)},compute:function(s,a){for(var r,f=this.cfg,p=f.hasher.create(),d=T.create(),E=d.words,y=f.keySize,l=f.iterations;E.lengthpe)){ae.next=7;break}return S.b.info("\u6587\u4EF6\u8D85\u8FC7".concat(pe/1024/1024/1024,"GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")),ae.abrupt("return",!1);case 7:return H.push({name:ge.name,file:ge}),G(Object(R.a)(H)),L.onChange(H),ae.abrupt("return",!1);case 11:case"end":return ae.stop()}},ue)}));function Ce(ue){return be.apply(this,arguments)}return Ce}()},fe=function(){var be=Object(h.a)(f.a.mark(function Ce(ue,ge){var pe,oe,ae,re,he,Q,ie,we,ne,J;return f.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return ge.file_name=ue.name,ie=ue.name,Z.next=4,Object(E.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 4:if(we=Z.sent,we.data=JSON.parse(i(we.data)),!((we==null?void 0:we.status)!==0)){Z.next=12;break}return H[H.findIndex(function(Ee){return Ee.name===ie})].status="error",H[H.findIndex(function(Ee){return Ee.name===ie})].file.status="error",L.onChange(H),S.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),Z.abrupt("return");case 12:return W=new w.a({endpoint:we==null||((pe=we.data)===null||pe===void 0)?void 0:pe.end_point,region:we==null||((oe=we.data)===null||oe===void 0)?void 0:oe.region,accessKeyId:we==null||((ae=we.data)===null||ae===void 0)?void 0:ae.access_key_id,accessKeySecret:we==null||((re=we.data)===null||re===void 0)?void 0:re.access_key_secret,bucket:we==null||((he=we.data)===null||he===void 0)?void 0:he.bucket,stsToken:we==null||((Q=we.data)===null||Q===void 0)?void 0:Q.security_token}),console.log(ue,"file"),te(W),ne=ue.name.split("."),ne.pop(),J=ge.realFileName?ne:Object(n.a)(),Z.abrupt("return",new Promise(function(Ee,xe){try{var _e;W.multipartUpload("".concat(L.identifier,"/").concat(J).concat(ie.indexOf(".")>-1?"."+ie.split(".").pop():""),new Blob([ue.file],{type:ue.file.type}),{timeout:3600*1e3,partSize:1002400,progress:function(Be,He,Ue){try{console.log("\u8FDB\u5EA6",Be,He,Ue);var ze=H.findIndex(function(Ge){return Ge.name===ie});H[ze].file.percent=Be*100,H[ze].tempCheckpoint=He,G(Object(R.a)(H))}catch(Ge){}},checkpoint:H[H.findIndex(function(je){return je.name===ie})].tempCheckpoint,callback:{customValue:{id:ie+""},url:we==null||((_e=we.data)===null||_e===void 0)?void 0:_e.callback_url,host:we==null?void 0:we.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(E.e)(ge)}}).then(function(je){var Be,He=H.findIndex(function(Re){return Re.name===ie}),Ue="done";if(((Be=je.data)===null||Be===void 0?void 0:Be.status)===0){var ze;ue.response=(ze=je.data)===null||ze===void 0?void 0:ze.data;var Ge=H.findIndex(function(Re){return Re.name===ie});H[Ge].status="done",H[Ge].file.status="done"}else{var Ye;S.b.warn((Ye=je.data)===null||Ye===void 0?void 0:Ye.message),Ue="error"}H[He].status=Ue,H[He].file.status=Ue,L.onChange(H),Ee(je==null?void 0:je.data)}).catch(function(je){H[H.findIndex(function(Be){return Be.name===ie})].status="error",H[H.findIndex(function(Be){return Be.name===ie})].file.status="error",S.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),G(Object(R.a)(H)),L.onChange(H),xe(je),console.log("err:",je)})}catch(je){}}));case 19:case"end":return Z.stop()}},Ce)}));return function(ue,ge){return be.apply(this,arguments)}}();return Object(p.useEffect)(function(){H.every(function(be){return be==="done"||be==="error"})&&L.onComplete(H)},[H]),Object(p.useEffect)(function(){if(F){var be;(be=W)===null||be===void 0||be.cancel()}},[F]),Object(p.useEffect)(function(){L.uploading&&H.map(function(){var be=Object(h.a)(f.a.mark(function Ce(ue){var ge,pe;return f.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:if(!((!ue.status||ue.status==="error")&&!F)){ae.next=6;break}return ue.status="uploading",ue.file.status="uploading",ae.next=5,fe(ue,{login:j==null||((ge=j.userInfo)===null||ge===void 0)?void 0:ge.login,container_type:L.container_type,container_id:L.container_id,description:L.description,realFileName:L.realFileName});case 5:pe=ae.sent;case 6:case"end":return ae.stop()}},Ce)}));return function(Ce){return be.apply(this,arguments)}}())},[L.uploading]),d.a.createElement(v,Object(P.a)({},de,{height:L.height,className:L.className}),d.a.createElement("p",{className:"ant-upload-hint"},L.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};q.b=Object(o.a)(function(x){var _=x.loading,j=x.globalSetting,F=x.user;return{globalSetting:j,loading:_.models.competitions,user:F}})(b)},KmYQ:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){return P.pad.ZeroPadding={pad:function(m,S){var R=S*4;m.clamp(),m.sigBytes+=R-(m.sigBytes%R||R)},unpad:function(m){for(var S=m.words,R=m.sigBytes-1,R=m.sigBytes-1;R>=0;R--)if(S[R>>>2]>>>24-R%4*8&255){m.sigBytes=R+1;break}}},P.pad.ZeroPadding})},LdHM:function(I,q,N){"use strict";N.d(q,"b",function(){return u}),N.d(q,"a",function(){return v});var P=N("1OyB"),m=N("vuIU"),S=N("Ji7U"),R=N("LK+K"),T=N("q1tI"),g=N("rePB"),C=N("Ff2n"),h=N("ODXe"),s=N("4IlW"),a=N("bX4T"),r=N("YrtM"),f=N("TSYQ"),p=N.n(f),d=N("+nKL"),E=N("8OUc"),y=function(W,te){var de=W.prefixCls,fe=W.id,be=W.flattenOptions,Ce=W.childrenAsData,ue=W.values,ge=W.searchValue,pe=W.multiple,oe=W.defaultActiveFirstOption,ae=W.height,re=W.itemHeight,he=W.notFoundContent,Q=W.open,ie=W.menuItemSelectedIcon,we=W.virtual,ne=W.onSelect,J=W.onToggleOpen,V=W.onActiveValue,Z=W.onScroll,Ee=W.onMouseEnter,xe="".concat(de,"-item"),_e=Object(r.a)(function(){return be},[Q,be],function($e,Ie){return Ie[0]&&$e[1]!==Ie[1]}),je=T.useRef(null),Be=function(Ie){Ie.preventDefault()},He=function(Ie){je.current&&je.current.scrollTo({index:Ie})},Ue=function(Ie){for(var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Le=_e.length,Te=0;Te1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(B).map(function(te,de){if(!T.isValidElement(te)||!te.type)return null;var fe=te.type.isSelectOptGroup,be=te.key,Ce=te.props,ue=Ce.children,ge=Object(C.a)(Ce,["children"]);return W||!fe?k(te):Object(i.a)(Object(i.a)({key:"__RC_SELECT_GRP__".concat(be===null?de:be,"__"),label:be},ge),{},{options:c(ue)})}).filter(function(te){return te})}var b=N("2Qr1"),x=N("qNPg"),_=N("U8pU"),j=N("Kwbf"),F=N("WKfj");function L(B){var W=B.mode,te=B.options,de=B.children,fe=B.backfill,be=B.allowClear,Ce=B.placeholder,ue=B.getInputElement,ge=B.showSearch,pe=B.onSearch,oe=B.defaultOpen,ae=B.autoFocus,re=B.labelInValue,he=B.value,Q=B.inputValue,ie=B.optionLabelProp,we=W==="multiple"||W==="tags",ne=ge!==void 0?ge:we||W==="combobox",J=te||c(de);if(Object(j.a)(W!=="tags"||J.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var V=J.some(function(xe){return xe.options?xe.options.some(function(_e){return typeof("value"in _e?_e.value:_e.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(j.a)(!V,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(j.a)(W!=="combobox"||!ie,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(j.a)(W==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(j.a)(W==="combobox"||!ue,"`getInputElement` only work with `combobox` mode."),Object(j.b)(W!=="combobox"||!ue||!be||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),pe&&!ne&&W!=="combobox"&&W!=="tags"&&Object(j.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(j.b)(!oe||ae,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),he!=null){var Z=Object(F.d)(he);Object(j.a)(!re||Z.every(function(xe){return Object(_.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(j.a)(!we||Array.isArray(he),"`value` should be array when `mode` is `multiple` or `tags`")}if(de){var Ee=null;Object(D.a)(de).some(function(xe){if(!T.isValidElement(xe)||!xe.type)return!1;var _e=xe.type;if(_e.isSelectOption)return!1;if(_e.isSelectOptGroup){var je=Object(D.a)(xe.props.children).every(function(Be){return!T.isValidElement(Be)||!xe.type||Be.type.isSelectOption?!0:(Ee=Be.type,!1)});return!je}return Ee=_e,!0}),Ee&&Object(j.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ee.displayName||Ee.name||Ee,"`.")),Object(j.a)(Q===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var X=L,z=Object(x.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:c,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:X,fillOptionsWithMissingValue:b.a}),H=function(B){Object(S.a)(te,B);var W=Object(R.a)(te);function te(){var de;return Object(P.a)(this,te),de=W.apply(this,arguments),de.selectRef=T.createRef(),de.focus=function(){de.selectRef.current.focus()},de.blur=function(){de.selectRef.current.blur()},de}return Object(m.a)(te,[{key:"render",value:function(){return T.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),te}(T.Component);H.Option=u,H.OptGroup=v;var G=H,U=q.c=G},M8RZ:function(I,q,N){"use strict";N.d(q,"a",function(){return s});var P=N("fWQN"),m=N("mtLc"),S=N("yKVA"),R=N("879j"),T=N("q1tI"),g=N.n(T),C=N("i8i4"),h=N.n(C),s=function(a){Object(S.a)(f,a);var r=Object(R.a)(f);function f(p){var d;Object(P.a)(this,f),d=r.call(this,p);var E=window.document;return d.node=E.createElement("div"),E.body.appendChild(d.node),d}return Object(m.a)(f,[{key:"render",value:function(){var d=this.props.children;return Object(C.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(g.a.Component)},MFOe:function(I,q,N){(function(P){var m=g(),S=C(),R=h(),T=typeof window!="undefined"?window:P;I.exports={assign:m,create:S,trim:R,bind:s,slice:a,each:r,map:f,pluck:p,isList:d,isFunction:E,isObject:y,Global:T};function g(){return Object.assign?Object.assign:function(n,o,u,w){for(var v=1;v=0;y-=1){var l=h.get(y)||new Set;l.forEach(function(n){var o=n.parent,u=n.node;if(a(u)||!n.parent||E.has(n.parent.key))return;if(a(n.parent.node)){E.add(o.key);return}var w=!0,v=!1;(o.children||[]).filter(function(i){return!a(i.node)}).forEach(function(i){var D=i.key,k=r.has(D);w&&!k&&(w=!1),!v&&(k||f.has(D))&&(v=!0)}),w&&r.add(o.key),v&&f.add(o.key),E.add(o.key)})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(m(f,r))}}function T(C,h,s,a,r){for(var f=new Set(C),p=new Set(h),d=0;d<=a;d+=1){var E=s.get(d)||new Set;E.forEach(function(o){var u=o.key,w=o.node,v=o.children,i=v===void 0?[]:v;!f.has(u)&&!p.has(u)&&!r(w)&&i.filter(function(D){return!r(D.node)}).forEach(function(D){f.delete(D.key)})})}p=new Set;for(var y=new Set,l=a;l>=0;l-=1){var n=s.get(l)||new Set;n.forEach(function(o){var u=o.parent,w=o.node;if(r(w)||!o.parent||y.has(o.parent.key))return;if(r(o.parent.node)){y.add(u.key);return}var v=!0,i=!1;(u.children||[]).filter(function(D){return!r(D.node)}).forEach(function(D){var k=D.key,c=f.has(k);v&&!c&&(v=!1),!i&&(c||p.has(k))&&(i=!0)}),v||f.delete(u.key),i&&p.add(u.key),y.add(u.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(m(p,f))}}function g(C,h,s,a){var r=[],f;a?f=a:f=S;var p=new Set(C.filter(function(l){var n=!!s[l];return n||r.push(l),n})),d=new Map,E=0;Object.keys(s).forEach(function(l){var n=s[l],o=n.level,u=d.get(o);u||(u=new Set,d.set(o,u)),u.add(n),E=Math.max(E,o)}),Object(P.a)(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var y;return h===!0?y=R(p,d,E,f):y=T(p,h.halfCheckedKeys,d,E,f),y}},OLES:function(I,q,N){"use strict";var P=N("U8pU"),m=N("VTBJ"),S=N("Ff2n"),R=N("q1tI"),T=N("uciX"),g=N("7ixt"),C=function(p){var d=p.overlay,E=p.prefixCls,y=p.id,l=p.overlayInnerStyle;return R.createElement("div",{className:"".concat(E,"-inner"),id:y,role:"tooltip",style:l},typeof d=="function"?d():d)},h=C,s=function(p,d){var E=p.overlayClassName,y=p.trigger,l=y===void 0?["hover"]:y,n=p.mouseEnterDelay,o=n===void 0?0:n,u=p.mouseLeaveDelay,w=u===void 0?.1:u,v=p.overlayStyle,i=p.prefixCls,D=i===void 0?"rc-tooltip":i,k=p.children,c=p.onVisibleChange,b=p.afterVisibleChange,x=p.transitionName,_=p.animation,j=p.placement,F=j===void 0?"right":j,L=p.align,X=L===void 0?{}:L,z=p.destroyTooltipOnHide,H=z===void 0?!1:z,G=p.defaultVisible,U=p.getTooltipContainer,B=p.overlayInnerStyle,W=Object(S.a)(p,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(R.useRef)(null);Object(R.useImperativeHandle)(d,function(){return te.current});var de=Object(m.a)({},W);"visible"in p&&(de.popupVisible=p.visible);var fe=function(){var pe=p.arrowContent,oe=pe===void 0?null:pe,ae=p.overlay,re=p.id;return[R.createElement("div",{className:"".concat(D,"-arrow"),key:"arrow"},oe),R.createElement(h,{key:"content",prefixCls:D,id:re,overlay:ae,overlayInnerStyle:B})]},be=!1,Ce=!1;if(typeof H=="boolean")be=H;else if(H&&Object(P.a)(H)==="object"){var ue=H.keepParent;be=ue===!0,Ce=ue===!1}return R.createElement(T.a,Object.assign({popupClassName:E,prefixCls:D,popup:fe,action:l,builtinPlacements:g.a,popupPlacement:F,ref:te,popupAlign:X,getPopupContainer:U,onPopupVisibleChange:c,afterPopupVisibleChange:b,popupTransitionName:x,popupAnimation:_,defaultPopupVisible:G,destroyPopupOnHide:be,autoDestroy:Ce,mouseLeaveDelay:w,popupStyle:v,mouseEnterDelay:o},de),k)},a=Object(R.forwardRef)(s),r=q.a=a},OLod:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("K3mO"))})(this,function(P){P.lib.Cipher||function(m){var S=P,R=S.lib,T=R.Base,g=R.WordArray,C=R.BufferedBlockAlgorithm,h=S.enc,s=h.Utf8,a=h.Base64,r=S.algo,f=r.EvpKDF,p=R.Cipher=C.extend({cfg:T.extend(),createEncryptor:function(x,_){return this.create(this._ENC_XFORM_MODE,x,_)},createDecryptor:function(x,_){return this.create(this._DEC_XFORM_MODE,x,_)},init:function(x,_,j){this.cfg=this.cfg.extend(j),this._xformMode=x,this._key=_,this.reset()},reset:function(){C.reset.call(this),this._doReset()},process:function(x){return this._append(x),this._process()},finalize:function(x){x&&this._append(x);var _=this._doFinalize();return _},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function x(_){return typeof _=="string"?b:D}return function(_){return{encrypt:function(j,F,L){return x(F).encrypt(_,j,F,L)},decrypt:function(j,F,L){return x(F).decrypt(_,j,F,L)}}}}()}),d=R.StreamCipher=p.extend({_doFinalize:function(){var x=this._process(!0);return x},blockSize:1}),E=S.mode={},y=R.BlockCipherMode=T.extend({createEncryptor:function(x,_){return this.Encryptor.create(x,_)},createDecryptor:function(x,_){return this.Decryptor.create(x,_)},init:function(x,_){this._cipher=x,this._iv=_}}),l=E.CBC=function(){var x=y.extend();x.Encryptor=x.extend({processBlock:function(j,F){var L=this._cipher,X=L.blockSize;_.call(this,j,F,X),L.encryptBlock(j,F),this._prevBlock=j.slice(F,F+X)}}),x.Decryptor=x.extend({processBlock:function(j,F){var L=this._cipher,X=L.blockSize,z=j.slice(F,F+X);L.decryptBlock(j,F),_.call(this,j,F,X),this._prevBlock=z}});function _(j,F,L){var X,z=this._iv;z?(X=z,this._iv=m):X=this._prevBlock;for(var H=0;H>>2]&255;x.sigBytes-=_}},u=R.BlockCipher=p.extend({cfg:p.cfg.extend({mode:l,padding:o}),reset:function(){var x;p.reset.call(this);var _=this.cfg,j=_.iv,F=_.mode;this._xformMode==this._ENC_XFORM_MODE?x=F.createEncryptor:(x=F.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==x?this._mode.init(this,j&&j.words):(this._mode=x.call(F,this,j&&j.words),this._mode.__creator=x)},_doProcessBlock:function(x,_){this._mode.processBlock(x,_)},_doFinalize:function(){var x,_=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(_.pad(this._data,this.blockSize),x=this._process(!0)):(x=this._process(!0),_.unpad(x)),x},blockSize:128/32}),w=R.CipherParams=T.extend({init:function(x){this.mixIn(x)},toString:function(x){return(x||this.formatter).stringify(this)}}),v=S.format={},i=v.OpenSSL={stringify:function(x){var _,j=x.ciphertext,F=x.salt;return F?_=g.create([1398893684,1701076831]).concat(F).concat(j):_=j,_.toString(a)},parse:function(x){var _,j=a.parse(x),F=j.words;return F[0]==1398893684&&F[1]==1701076831&&(_=g.create(F.slice(2,4)),F.splice(0,4),j.sigBytes-=16),w.create({ciphertext:j,salt:_})}},D=R.SerializableCipher=T.extend({cfg:T.extend({format:i}),encrypt:function(x,_,j,F){F=this.cfg.extend(F);var L=x.createEncryptor(j,F),X=L.finalize(_),z=L.cfg;return w.create({ciphertext:X,key:j,iv:z.iv,algorithm:x,mode:z.mode,padding:z.padding,blockSize:x.blockSize,formatter:F.format})},decrypt:function(x,_,j,F){F=this.cfg.extend(F),_=this._parse(_,F.format);var L=x.createDecryptor(j,F).finalize(_.ciphertext);return L},_parse:function(x,_){return typeof x=="string"?_.parse(x,this):x}}),k=S.kdf={},c=k.OpenSSL={execute:function(x,_,j,F){F||(F=g.random(64/8));var L=f.create({keySize:_+j}).compute(x,F),X=g.create(L.words.slice(_),j*4);return L.sigBytes=_*4,w.create({key:L,iv:X,salt:F})}},b=R.PasswordBasedCipher=D.extend({cfg:D.cfg.extend({kdf:c}),encrypt:function(x,_,j,F){F=this.cfg.extend(F);var L=F.kdf.execute(j,x.keySize,x.ivSize);F.iv=L.iv;var X=D.encrypt.call(this,x,_,L.key,F);return X.mixIn(L),X},decrypt:function(x,_,j,F){F=this.cfg.extend(F),_=this._parse(_,F.format);var L=F.kdf.execute(j,x.keySize,x.ivSize,_.salt);F.iv=L.iv;var X=D.decrypt.call(this,x,_,L.key,F);return X}})}()})},OZM5:function(I,q,N){"use strict";N.d(q,"b",function(){return a}),N.d(q,"a",function(){return r}),N.d(q,"k",function(){return f}),N.d(q,"h",function(){return p}),N.d(q,"i",function(){return d}),N.d(q,"g",function(){return E}),N.d(q,"c",function(){return y}),N.d(q,"d",function(){return l}),N.d(q,"j",function(){return u}),N.d(q,"e",function(){return w}),N.d(q,"f",function(){return v});var P=N("KQm4"),m=N("U8pU"),S=N("Ff2n"),R=N("q1tI"),T=N.n(R),g=N("Kwbf"),C=N("WaYH"),h=.25,s=2;function a(i,D){var k=i.slice(),c=k.indexOf(D);return c>=0&&k.splice(c,1),k}function r(i,D){var k=i.slice();return k.indexOf(D)===-1&&k.push(D),k}function f(i){return i.split("-")}function p(i,D){return"".concat(i,"-").concat(D)}function d(i){return i&&i.type&&i.type.isTreeNode}function E(i,D){var k=[i],c=D[i];function b(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];x.forEach(function(_){var j=_.key,F=_.children;k.push(j),b(F)})}return b(c.children),k}function y(i,D){var k=i.clientY,c=D.selectHandle.getBoundingClientRect(),b=c.top,x=c.bottom,_=c.height,j=Math.max(_*h,s);return k<=b+j?-1:k>=x-j?1:0}function l(i,D){if(!i)return;var k=D.multiple;return k?i.slice():i.length?[i[0]]:i}var n=function(D){return D};function o(i,D){if(!i)return[];var k=D||{},c=k.processProps,b=c===void 0?n:c,x=Array.isArray(i)?i:[i];return x.map(function(_){var j=_.children,F=Object(S.a)(_,["children"]),L=o(j,D);return T.a.createElement(C.a,Object.assign({},b(F)),L)})}function u(i){if(!i)return null;var D;if(Array.isArray(i))D={checkedKeys:i,halfCheckedKeys:void 0};else if(Object(m.a)(i)==="object")D={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return Object(g.a)(!1,"`checkedKeys` is not an array or an object"),null;return D}function w(i,D){var k=new Set;function c(b){if(k.has(b))return;var x=D[b];if(!x)return;k.add(b);var _=x.parent,j=x.node;if(j.disabled)return;_&&c(_.key)}return(i||[]).forEach(function(b){c(b)}),Object(P.a)(k)}function v(i){var D={};return Object.keys(i).forEach(function(k){(k.startsWith("data-")||k.startsWith("aria-"))&&(D[k]=i[k])}),D}},Ot1p:function(I,q,N){"use strict";var P=N("2qtc"),m=N("kLXV"),S=N("rAM+"),R=N("miYZ"),T=N("tsqr"),g=N("9og8"),C=N("tJVT"),h=N("jrin"),s=N("WmNS"),a=N.n(s),r=N("q1tI"),f=N.n(r),p=N("VrN/"),d=N.n(p),E=N("bdgK"),y=N("p77/"),l=N("Bd2K"),n=N("ELLl"),o=N("19Vz"),u=N("lZu9"),w=N("+NIl"),v=N("kSUc"),i=N("9Bee"),D=function(Fe){var Xe=Fe.value,qe=Xe===void 0?"":Xe,pt=Fe.className,at=Fe.showTextOnly,ft=Fe.showLines,Et=Fe.style,xt=Et===void 0?{}:Et,lt=Object(r.useMemo)(function(){return""},[qe]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:lt}}))},k=N("0Owb"),c=N("dejd"),b=N("C+DQ"),x=N("1vsH"),_=N("m3rI"),j=[{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(Fe){var Xe=Fe.onActionCallback,qe=Fe.title,pt=Fe.icon,at=Fe.actionName,ft=Fe.className,Et=ft===void 0?"":ft,xt=Fe.children;function lt(){Xe(at)}return f.a.createElement("a",{title:qe,className:Et,onClick:lt},f.a.createElement("i",{className:"md-iconfont ".concat(pt)}),xt)}var L=function(Fe){var Xe=Fe.watch,qe=Fe.showNullButton,pt=Fe.onActionCallback,at=Fe.fullScreen,ft=Fe.insertTemp,Et=Fe.hidetoolBar,xt=Fe.uuid,lt=Fe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(xt,"&api=").concat(encodeURIComponent(_.a.PROXY_SERVER)));var Wt=[].concat(j,[{title:"".concat(Xe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Xe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!Et&&Wt.map(function(It,ir){return f.a.createElement("li",{key:ir},It.actionName?f.a.createElement(F,Object(k.a)({},It,{onActionCallback:pt})):f.a.createElement("span",{className:"v-line"}))}),qe?f.a.createElement("li",null,f.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:pt},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&f.a.createElement("li",null,f.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:pt},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(F,{icon:"".concat(at?"icon-shrink":"icon-enlarge"),title:at?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:pt})))},X=N("M8RZ"),z=N("+L6B"),H=N("2/Rp"),G=N("y8nQ"),U=N("Vl3Y"),B=N("5NDa"),W=N("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},de=function(Fe){var Xe=Fe.callback,qe=Fe.onCancel;function pt(at){Xe(at)}return f.a.createElement(U.a,Object(k.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:pt}),f.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(W.a,null)),f.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(W.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(H.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))},fe=N("7ahc"),be=N("HmJG"),Ce=N("BjJ7"),ue=U.a.useForm,ge={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},oe=function(Fe){var Xe=Fe.callback,qe=Fe.onCancel,pt=ue(),at=Object(C.a)(pt,1),ft=at[0];function Et(Wt){Xe(Wt)}function xt(Wt,It){if(Wt.status===-1){T.b.error(Wt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Wt.id),type:It.type})}function lt(Wt){var It=Wt.target.files[0];re(It,xt)}return f.a.createElement(U.a,Object(k.a)({form:ft},pe,{className:"upload-image-panel",onFinish:Et}),f.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(W.a,{style:ge})),f.a.createElement(ae,{onFileChange:lt}))),f.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(W.a,{style:{width:264}})),f.a.createElement(U.a.Item,{style:{textAlign:"right"}},f.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(H.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))};function ae(Fe){var Xe=Fe.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Xe}))}function re(Fe,Xe){if(!Fe)throw new String("\u6CA1\u6709\u6587\u4EF6");var qe=new FormData;qe.append("editormd-image-file",Fe),qe.append("file_param_name","editormd-image-file"),qe.append("byxhr","true");var pt=new window.XMLHttpRequest;pt.withCredentials=!0,pt.addEventListener("load",function(at){Xe(JSON.parse(at.target.responseText),Fe)},!1),pt.addEventListener("error",function(at){console.error(at)},!1),pt.open("POST","".concat(Ce.a,"/api/attachments.json")),pt.send(qe)}var he=N("giR+"),Q=N("fyUT"),ie=N("7Kak"),we=N("9yH6"),ne=we.a.Group,J={margin:"0 8px"},V=function(Fe){var Xe=Fe.callback,qe=Fe.onCancel;function pt(at){Xe(at)}return f.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:pt},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:J},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:J},"\u884C\u6570"),f.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(Q.a,null)),f.a.createElement("span",{style:J},"\u5217\u6570"),f.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(Q.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:J},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(U.a.Item,{name:"align"},f.a.createElement(ne,null,f.a.createElement(we.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(we.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(we.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(we.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(H.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))},Z=N("ErOA"),Ee=N("7Cbv"),xe="link",_e="upload-image",je="code-block",Be="add-table",He="------------",Ue={default:He,left:":".concat(He),center:":".concat(He,":"),right:"".concat(He,":")},ze=N("9VGf"),Ge,Ye;function Re(){}var tt=0,rt=1e4,We="\u2581",$e=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ie(Fe){return/^\d+$/.test(Fe)?"".concat(Fe,"px"):Fe}var Oe=navigator.platform.toUpperCase().indexOf("MAC")>=0,Le=Oe?"Cmd":"Ctrl",Te=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Ae=(Ge={},Object(h.a)(Ge,Le+"-B","bold"),Object(h.a)(Ge,Le+"-I","italic"),Ge),ke=(Ye={},Object(h.a)(Ye,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(h.a)(Ye,je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(h.a)(Ye,_e,"\u6DFB\u52A0\u6587\u4EF6"),Object(h.a)(Ye,Be,"\u6DFB\u52A0\u8868\u683C"),Ye),Me=q.a=function(Fe){var Xe=Fe.defaultValue,qe=Xe===void 0?"":Xe,pt=Fe.onChange,at=Fe.width,ft=at===void 0?"100%":at,Et=Fe.height,xt=Et===void 0?400:Et,lt=Fe.miniToolbar,Wt=lt===void 0?!1:lt,It=Fe.isFocus,ir=It===void 0?!1:It,$t=Fe.watch,At=Fe.insertTemp,Rt=Fe.mode,hr=Rt===void 0?"markdown":Rt,St=Fe.id,Je=St===void 0?"markdown-editor-id":St,dt=Fe.showResizeBar,Ct=dt===void 0?!1:dt,Xt=Fe.noStorage,Jt=Xt===void 0?!1:Xt,Mt=Fe.showNullButton,Pt=Mt===void 0?!1:Mt,gt=Fe.hidetoolBar,Bt=gt===void 0?!1:gt,fr=Fe.fullScreen,ar=fr===void 0?!1:fr,Gt=Fe.onBlur,mr=Fe.onCMBeforeChange,zt=Fe.onFullScreen,Ur=Fe.className,nt=Ur===void 0?"":Ur,Dt=Fe.disablePaste,zr=Dt===void 0?!1:Dt,Pr=Fe.placeholder,Xr=Pr===void 0?"":Pr,Yr=Fe.values,ce=Yr===void 0?"":Yr,K=Object(r.useState)(null),Y=Object(C.a)(K,2),ee=Y[0],ye=Y[1],se=Object(r.useState)(qe),Pe=Object(C.a)(se,2),Ze=Pe[0],mt=Pe[1],Tt=Object(r.useState)($t),et=Object(C.a)(Tt,2),kt=et[0],Zt=et[1],Yt=Object(r.useState)(ar),Cr=Object(C.a)(Yt,2),Tr=Cr[0],_r=Cr[1],en=Object(r.useState)(""),Rn=Object(C.a)(en,2),gr=Rn[0],$r=Rn[1],mn=Object(r.useState)(0),gn=Object(C.a)(mn,2),jr=gn[0],Ar=gn[1],rr=Object(r.useState)(xt),br=Object(C.a)(rr,2),Or=br[0],Jr=br[1],tn=Object(r.useState)(!1),rn=Object(C.a)(tn,2),li=rn[0],Ln=rn[1],vr=Object(r.useRef)(Object(Ee.a)()),tr=Object(r.useRef)(!1),kr=Object(r.useRef)(),er=Object(r.useRef)(),wr=Object(r.useRef)(),nr=Object(r.useRef)(),Cn=Object(r.useRef)(),Ir=function(){var Lt=Object(g.a)(a.a.mark(function Ht(){var Ft,Qt;return a.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(Z.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:vr.current}});case 2:Qt=ot.sent,Qt!=null&&(Ft=Qt.attachments)!==null&&Ft!==void 0&&Ft.length&&(console.log("cm:",ee,er),Qt.attachments.map(function(ut){ut.content_type.indexOf("image")>-1?ee.replaceSelection("![,](/api/attachments/".concat(ut.id,"?type=").concat(ut.content_type,")")):ut.content_type.indexOf("video")>-1?ee.replaceSelection('')):ut.content_type.indexOf("pdf")>-1?ee.replaceSelection('
    ').concat(ut.name,"")):ee.replaceSelection("[".concat(ut.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,"?type=").concat(ut.content_type,")"))}));case 4:case"end":return ot.stop()}},Ht)}));return function(){return Lt.apply(this,arguments)}}();Object(r.useEffect)(function(){mt(ce),ee==null||ee.setValue(ce)},[ce]),Object(r.useEffect)(function(){zt==null||zt(Tr)},[Tr]),Object(r.useEffect)(function(){if(er.current){var Lt=d.a.fromTextArea(er.current,{mode:hr,lineNumbers:!Wt,lineWrapping:!0,value:qe,autoCloseTags:!0,autoCloseBrackets:!0});ir&&Lt.focus();function Ht(Ft,Qt){if(zr){Qt.preventDefault();return}var ct=Qt.clipboardData;if(ct){var ot=ct.types.toString(),ut=ct.items;if(ot==="Files"||ct.types.indexOf("Files")>-1){if(Qt.preventDefault(),hr=="stex")return;try{var wt,Nt=ut[1];((wt=ut[0])===null||wt===void 0?void 0:wt.kind)==="file"&&(Nt=ut[0]);var st=Nt.getAsFile(),Kt=st.name.split(".").pop();re(st,function(vt){if(vt.id){var or,ur,xr;(st==null||((or=st.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?Lt.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):(st==null||((ur=st.type)===null||ur===void 0)?void 0:ur.indexOf("video"))>-1?Lt.replaceSelection('')):(st==null||((xr=st.type)===null||xr===void 0)?void 0:xr.indexOf("pdf"))>-1?Lt.replaceSelection('').concat(st.name,"")):Te.includes(Kt)?Lt.replaceSelection('').concat(st.name,"")):Lt.replaceSelection("[".concat(st.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})}catch(vt){T.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Lt.on("paste",Ht),Lt.on("dragleave",function(Ft,Qt){wr.current.classList.remove("mouse-hover-md")}),Lt.on("dragover",function(Ft,Qt){wr.current.classList.add("mouse-hover-md")}),Lt.on("drop",function(Ft,Qt){wr.current.classList.add("mouse-hover-md");var ct;if(ct=Qt.dataTransfer.files,ct.length>0){Qt.preventDefault(),Qt.stopPropagation();for(var ot=function(Nt){var st=ct[Nt],Kt=st.name.split(".").pop();re(st,function(vt){if(vt.id){var or,ur,xr;(st==null||((or=st.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?Lt.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):(st==null||((ur=st.type)===null||ur===void 0)?void 0:ur.indexOf("video"))>-1?Lt.replaceSelection('')):(st==null||((xr=st.type)===null||xr===void 0)?void 0:xr.indexOf("pdf"))>-1?Lt.replaceSelection('').concat(st.name,"")):Te.includes(Kt)?Lt.replaceSelection('').concat(st.name,"")):Lt.replaceSelection("[".concat(st.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})},ut=0;ut0||ut.target.offsetWidth>0)&&(Fr(),ee.setSize("100%","100%"),ee.refresh())}}catch(wt){ct.e(wt)}finally{ct.f()}});return Ft.observe(er.current.parentElement),Ft}if(ee){var Ht=Lt();return function(){Ht.unobserve(er.current.parentElement)}}},[ee,Fr]),Object(r.useEffect)(function(){if(ee){for(var Lt=[],Ht=function(){var ut=Qt[Ft];ct=Object(C.a)(ut,2);var wt=ct[0],Nt=ct[1],st=Object(h.a)({},wt,function(){Bn(Nt)});Lt.push(st),ee.addKeyMap(st)},Ft=0,Qt=Object.entries(Ae);Ft0){var Lt=new Date().getTime(),Ht=window.sessionStorage.getItem(Je);Lt>=jr+rt&&(!Ht||Ht!==Ze)&&(window.sessionStorage.setItem(Je,Ze),Ln(!0))}},rt),Object(r.useEffect)(function(){Zt($t)},[ee,$t]),Object(r.useEffect)(function(){ee&&(ir&&ee.focus())},[ee,ir]),Object(r.useEffect)(function(){if(kt&&ee){var Lt=ee.getScrollerElement();function Ht(Ft){var Qt=Ft.target;if(Cn.current){var ct=Qt.scrollTop/Qt.scrollHeight;Cn.current.scrollTop=Cn.current.scrollHeight*ct}}return Lt.addEventListener("scroll",Ht),function(){Lt.removeEventListener("scroll",Ht)}}},[ee,kt]),Object(r.useEffect)(function(){if(ee&&mr){function Lt(Ht,Ft){mr(Ht,Ft)}return ee.on("beforeChange",Lt),function(){ee.off("beforeChange",Lt)}}},[ee,mr]),Object(r.useEffect)(function(){if(ee&&Gt){function Lt(){Gt(ee.getValue())}return ee.on("blur",Lt),function(){ee.off("blur",Lt)}}},[ee,Gt]),Object(r.useEffect)(function(){if(ee){function Lt(Ht){var Ft=Ht.getValue();mt(Ft),Ar(new Date().getTime()),Ht.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),pt&&pt(Ft)}return ee.on("change",Lt),function(){ee.off("change",Lt)}}},[ee,pt]),Object(r.useEffect)(function(){ee&&(qe==null?(ee.setValue(""),mt("")):qe!==ee.getValue()&&(ee.setValue(qe),mt(qe),ee.setCursor(ee.lineCount(),0)))},[ee,qe]);var Bn=Object(r.useCallback)(function(Lt){var Ht=ee.getCursor(),Ft=ee.getSelection(),Qt=Ft.split(` `);switch(Lt){case"bold":return ee.replaceSelection("**"+Ft+"**"),Ft===""&&ee.setCursor(Ht.line,Ht.ch+2),ee.focus();case"italic":return ee.replaceSelection("*"+Ft+"*"),Ft===""&&ee.setCursor(Ht.line,Ht.ch+1),ee.focus();case"code":return ee.replaceSelection("`"+Ft+"`"),Ft===""&&ee.setCursor(Ht.line,Ht.ch+1),ee.focus();case"inline-latex":return ee.replaceSelection("`$$"+Ft+"$$`"),Ft===""&&ee.setCursor(Ht.line,Ht.ch+3),ee.focus();case"latex":return ee.replaceSelection("```latex\n"+Ft+"\n```"),ee.setCursor(Ht.line+1,Ft.length+1),ee.focus();case"line-break":return ee.replaceSelection(`
    `),ee.focus();case"list-ul":return Ft===""?ee.replaceSelection("- "+Ft):ee.replaceSelection(Qt.map(function(ct){return ct===""?"":"- ".concat(ct)}).join(` `)),ee.focus();case"list-ol":return Ft===""?ee.replaceSelection("1. "+Ft):ee.replaceSelection(Qt.map(function(ct,ot){return ct===""?"":"".concat(ot+1,". ").concat(ct)}).join(` `)),ee.focus();case"add-null-ch":return Ft===""&&ee.setCursor(Ht.line,Ht.ch+1),ee.replaceSelection(We),ee.focus();case"inster-template-1":return Ft===""&&ee.setCursor(Ht.line,Ht.ch),ee.replaceSelection($e),ee.focus();case"eraser":return ee.setValue(""),ee.focus();case"trigger-watch":return Zt(!kt),ee.focus();case"trigger-full-screen":return _r(!Tr),ee.focus();case xe:$r(xe);return;case je:$r(je);return;case _e:$r(_e);return;case Be:$r(Be);return;default:throw new Error}},[ee,kt,Tr]),Tn=Object(r.useCallback)(function(Lt){$r("");switch(gr){case xe:var Ht=Lt.title,Ft=Lt.link;return ee.replaceSelection("[".concat(Ht,"](").concat(Ft,")")),ee.focus();case je:var Qt=Lt.language,ct=Lt.content;return ee.replaceSelection(["```"+Qt,ct,"```"].join(` `)),ee.focus();case _e:var ot=Lt.src,ut=Lt.alt;return ut?ee.replaceSelection("![ ".concat(ut," ]( ").concat(ot,' "').concat(ut,'" )')):ee.replaceSelection("![,](".concat(ot,")")),ee.focus();case Be:for(var wt=Lt.row,Nt=Lt.col,st=Lt.align,Kt=` `,vt=0;vt300&&(wt=300);var Nt=xt+wt+"px";Jr(Nt)}}return Lt.addEventListener("mousedown",Qt),document.addEventListener("mousemove",ot),document.addEventListener("mouseup",ct),function(){Lt.removeEventListener("mousedown",Qt),document.removeEventListener("mousemove",ot),document.removeEventListener("mouseup",ct)}}},[ee,nr]),Object(r.useEffect)(function(){Jr(xt)},[xt]);var _n=Ie(ft),ci=Ie(Or),vn={width:_n,height:ci},di=Object(r.useMemo)(function(){if(jr){var Lt=new Date(jr),Ht=Lt.getHours(),Ft=Lt.getMinutes(),Qt=Lt.getSeconds();return Ht=Ht<10?"0"+Ht:Ht,Ft=Ft<10?"0"+Ft:Ft,Qt=Qt<10?"0"+Qt:Qt,"".concat(Ht,":").concat(Ft,":").concat(Qt)}return 0},[jr]);function Ti(){window.sessionStorage.removeItem(Je),Ln(!1),Ar(0)}function Kn(){Ln(!1),Ar(0),ee.setValue(window.sessionStorage.getItem(Je))}function Xi(Lt,Ht){var Ft=ee.getValue();Ft=Ft.replace(Lt,Ht),mt(Ft),ee==null||ee.setValue(Ft)}return f.a.createElement(r.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:wr},f.a.createElement("div",{className:"markdown-editor-container ".concat(nt," ").concat(kt?"on-preview":""," ").concat(Wt?"mini":""," ").concat(Tr?"full-screen":""),style:vn},f.a.createElement(L,{insertTemp:At,watch:kt,fullScreen:Tr,showNullButton:Pt,onActionCallback:Bn,hidetoolBar:Bt,uuid:vr.current,setOpenPhones:function(){tr.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:er,placeholder:Xr})),kt?f.a.createElement("div",{ref:Cn,className:"preview-container"},hr==="stex"&&f.a.createElement(D,{value:Ze}),hr!=="stex"&&f.a.createElement(i.a,{edit:!0,value:Ze,replaces:Xi})):null))),Ct?f.a.createElement("a",{ref:nr,className:"editor-resize"}):null,f.a.createElement(X.a,null,ke[gr]?f.a.createElement(m.a,{centered:!0,title:ke[gr],visible:!0,onCancel:Un,footer:null,className:"markdown-popup-form"},ui):null))}},"P/tu":function(I,q,N){"use strict";var P=N("ozfa"),m=N("MJZm"),S=N("0Owb"),R=N("9og8"),T=N("tJVT"),g=N("PpiC"),C=N("WmNS"),h=N.n(C),s=N("q1tI"),a=N.n(s),r=N("WCUW"),f=N("spXi"),p=N.n(f),d=function(y){var l=y.value,n=y.onChange,o=y.defaultValue,u=y.disabled,w=Object(g.a)(y,["value","onChange","defaultValue","disabled"]),v=Object(s.useState)([]),i=Object(T.a)(v,2),D=i[0],k=i[1],c=Object(s.useState)("1"),b=Object(T.a)(c,2),x=b[0],_=b[1];Object(s.useEffect)(function(){j()},[]);var j=function(){var X=Object(R.a)(h.a.mark(function z(){var H,G;return h.a.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,Object(r.A)({});case 2:H=B.sent,H!=null&&H.data&&(G=[{title:a.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:p.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:a.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:F(H.data||[])}],k(G),_("2"));case 4:case"end":return B.stop()}},z)}));return function(){return X.apply(this,arguments)}}(),F=function(z){function H(G){var U=G.children,B=Array.isArray(U)&&U.length>0,W=G==null?void 0:G.group_id;return{title:a.a.createElement("div",{title:G==null?void 0:G.name,className:p.a.name},G==null?void 0:G.name),value:W,key:W,icon:a.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:B?U==null?void 0:U.map(function(te){return H(te)}):[]}}return z==null?void 0:z.map(function(G){return H(G)})},L=o?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return a.a.createElement("div",{className:p.a.customTree},a.a.createElement(m.a,Object(S.a)({key:x},L,{showIcon:!0,treeData:D,onSelect:n,disabled:u},w)))};q.a=d},PD8m:function(I,q){I.exports={name:"memoryStorage",read:P,write:m,each:S,remove:R,clearAll:T};var N={};function P(g){return N[g]}function m(g,C){N[g]=C}function S(g){for(var C in N)N.hasOwnProperty(C)&&g(N[C],C)}function R(g){delete N[g]}function T(g){N={}}},PHyj:function(I,q,N){"use strict";N.r(q),N.d(q,"Types",function(){return At});var P=N("P2fV"),m=N("NJEC"),S=N("CiB2"),R=N("DYRE"),T=N("zeV3"),g=N("7Kak"),C=N("9yH6"),h=N("sRBo"),s=N("kaz8"),a=N("giR+"),r=N("fyUT"),f=N("6UJt"),p=N("DFOY"),d=N("OaEy"),E=N("2fM7"),y=N("rAM+"),l=N("T2oS"),n=N("W9HT"),o=N("+L6B"),u=N("2/Rp"),w=N("oBTY"),v=N("miYZ"),i=N("tsqr"),D=N("9og8"),k=N("y8nQ"),c=N("Vl3Y"),b=N("tJVT"),x=N("k1fw"),_=N("fu2T"),j=N("gK9i"),F=N("2qtc"),L=N("kLXV"),X=N("5NDa"),z=N("5rEg"),H=N("WmNS"),G=N.n(H),U=N("q1tI"),B=N.n(U),W=N("uMZB"),te=N.n(W),de=N("jrin"),fe,be=E.a.Option,Ce;(function(Je){Je[Je.language=0]="language",Je[Je.difficult=1]="difficult",Je[Je.category=2]="category",Je[Je.openOrNot=3]="openOrNot"})(Ce||(Ce={}));var ue=(fe={},Object(de.a)(fe,Ce.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(de.a)(fe,Ce.difficult,[{title:"\u7B80\u5355",key:1},{title:"\u4E2D\u7B49",key:2},{title:"\u56F0\u96BE",key:3}]),Object(de.a)(fe,Ce.category,[{title:"\u7A0B\u5E8F\u8BBE\u8BA1",key:1},{title:"\u7B97\u6CD5",key:2}]),Object(de.a)(fe,Ce.openOrNot,[{title:"\u516C\u5F00",key:1},{title:"\u79C1\u6709",key:0}]),fe);function ge(Je){return ue[Je].map(function(dt){return B.a.createElement(be,{key:dt.title,value:dt.key}," ",dt.title," ")})}function pe(Je,dt){Je.map(function(Ct){var Xt=Ct.id,Jt=Ct.name,Mt=Ct.sub_disciplines,Pt={value:Xt,label:Jt};dt.push(Pt),Mt&&Mt.length>0&&(Pt.children=[],pe(Mt,Pt.children))})}function oe(Je,dt){for(var Ct=[],Xt=0;Xt0){Ct[0]=Mt.id;for(var Pt=0;Pt0&&arguments[0]!==void 0?arguments[0]:"question";return Object(we.c)("disciplines.json",{source:Je})}function V(Je){return Object(we.c)("problems/".concat(Je,"/edit.json"))}function Z(Je,dt){return Object(we.g)("problems/".concat(Je,".json"),dt)}function Ee(Je){return Object(we.f)("problems.json",Je)}function xe(Je,dt){return Object(we.f)("exercises/".concat(Je,"/exercise_questions.json"),dt)}function _e(Je,dt){return Object(we.g)("exercise_questions/".concat(Je,".json"),dt)}function je(Je){return Object(we.f)("problems/".concat(Je,"/publish.json"))}function Be(Je){return Object(we.f)("problems/".concat(Je,"/cancel_publish.json"))}function He(Je){return Object(we.c)("problems/".concat(Je,"/start.json"))}function Ue(Je,dt){return Object(we.f)("tag_disciplines.json",{name:dt,sub_discipline_id:Je})}var ze=N("V0Rq"),Ge=N("cDPC"),Ye=N("EHPI"),Re=N("bbsP"),tt=N("/wGt"),rt=N("ZW9T"),We=N("ZD9Y"),$e=N("M8RZ"),Ie=N("bCnd"),Oe=N("b8wu"),Le=N.n(Oe),Te=N("LvDl"),Ae={theme:Object(Ie.a)("cmCodeMode","vs-dark"),fontSize:Object(Ie.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(Ie.a)("cmTabToSpace",!0)},ke;(function(Je){Je[Je.set_font_size=0]="set_font_size",Je[Je.set_theme=1]="set_theme",Je[Je.on_tab_to_space=2]="on_tab_to_space",Je[Je.set_show_editor_setting=3]="set_show_editor_setting"})(ke||(ke={}));function Me(Je,dt){switch(dt.type){case ke.set_show_editor_setting:return Object(x.a)(Object(x.a)({},Je),{},{showEditorSetting:dt.payload});case ke.set_theme:return Object(x.a)(Object(x.a)({},Je),{},{theme:dt.payload});case ke.set_font_size:return Object(x.a)(Object(x.a)({},Je),{},{fontSize:dt.payload});case ke.on_tab_to_space:return Object(x.a)(Object(x.a)({},Je),{},{tabToSpace:dt.payload});default:throw new Error}}var Fe=function(Je){var dt,Ct=Je.isLoading,Xt=Je.value,Jt=Xt===void 0?[]:Xt,Mt=Je.onChange,Pt=Object(U.useReducer)(Me,Ae),gt=Object(b.a)(Pt,2),Bt=gt[0],fr=gt[1],ar=Bt.theme,Gt=Bt.fontSize,mr=Bt.showEditorSetting,zt=Bt.tabToSpace,Ur=Object(U.useState)("c"),nt=Object(b.a)(Ur,2),Dt=nt[0],zr=nt[1],Pr=Object(U.useRef)([]);Object(U.useEffect)(function(){Jt!=null&&Jt.length&&(Pr.current=Object(Te.cloneDeep)(Jt))},[Jt]);var Xr={onFontSizeChange:function(ye){fr({type:ke.set_font_size,payload:ye}),Object(Ie.b)("cmFontSize",ye)},tabToSpace:zt,cmFontSize:Gt,className:"oj",cmCodeMode:ar,onTabToSpace:function(ye){fr({type:ke.on_tab_to_space,payload:ye}),Object(Ie.b)("cmTabToSpace",ye)},onCodeModeChange:function(ye){fr({type:ke.set_theme,payload:ye}),Object(Ie.b)("cmCodeMode",ye)}};function Yr(){fr({type:ke.set_show_editor_setting,payload:!1})}function ce(){fr({type:ke.set_show_editor_setting,payload:!0})}function K(ee){var ye,se=(ye=Pr.current)===null||ye===void 0?void 0:ye.map(function(Pe){return Pe.language===Dt&&(Pe.code=ee),Pe});Pr.current=Object(Te.cloneDeep)(se),Mt(se)}var Y={key:Dt,value:Jt==null||((dt=Jt.find(function(ee){return ee.language===Dt}))===null||dt===void 0)?void 0:dt.code,language:Dt,onChange:K,theme:ar,height:"calc(100% - 56px)",options:{fontSize:Gt,insertSpaces:zt}};return B.a.createElement(U.Fragment,null,B.a.createElement("div",{className:Le.a["code-panel-container"]},B.a.createElement(Xe,{languageItems:Jt,onLanguage:function(ye){return zr(ye)},language:Dt,onShowCodeSetting:ce}),!Ct&&B.a.createElement(rt.b,Y)),B.a.createElement($e.a,null,B.a.createElement(tt.a,{className:"oj",title:null,placement:"right",closable:!1,visible:mr,onClose:Yr},B.a.createElement(We.a,Xr))))};function Xe(Je){var dt=Je.languageItems,Ct=Je.language,Xt=Je.onShowCodeSetting,Jt=Je.onLanguage;return B.a.createElement("div",{className:Le.a["action-oj-bar"]},B.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),dt==null?void 0:dt.map(function(Mt){return B.a.createElement("div",{className:Ct===(Mt==null?void 0:Mt.language)?Le.a.active:"",onClick:function(){return Jt(Mt==null?void 0:Mt.language)},key:Mt==null?void 0:Mt.language},Mt==null?void 0:Mt.language)}),B.a.createElement("a",{onClick:Xt},B.a.createElement("i",{className:"iconfont icon-shezhi"})))}var qe=N("m3rI"),pt=N("u2Z1"),at=N("P/tu"),ft=N("B7Ph"),Et=N("vCeJ"),xt=N("hQp1"),lt=z.a.TextArea,Wt=L.a.confirm,It=j.a.Panel;function ir(){return new Date().getTime()}var $t={loading:!0,user:null,disciplines:[],dicts:null,status:0,data:void 0,lastedUpdateTime:0},At;(function(Je){Je[Je.SET_INITAL_DATA=0]="SET_INITAL_DATA",Je[Je.SET_LOADING=1]="SET_LOADING",Je[Je.SET_STATUS=2]="SET_STATUS"})(At||(At={}));function Rt(Je,dt){switch(dt.type){case At.SET_INITAL_DATA:return Object(x.a)(Object(x.a)({},Je),dt.payload);case At.SET_LOADING:return Object(x.a)(Object(x.a)({},Je),{},{loading:dt.payload});case At.SET_STATUS:return Object(x.a)(Object(x.a)({},Je),{},{status:dt.payload});default:throw new Error}}var hr=q.default=function(){var Je,dt,Ct=Object(ae.h)(),Xt=Object(ae.g)(),Jt=Object(ae.i)(),Mt=Jt.id,Pt=c.a.useForm(),gt=Object(b.a)(Pt,1),Bt=gt[0],fr=Object(U.useState)(),ar=Object(b.a)(fr,2),Gt=ar[0],mr=ar[1],zt=Object(U.useState)([]),Ur=Object(b.a)(zt,2),nt=Ur[0],Dt=Ur[1],zr=Object(U.useState)([]),Pr=Object(b.a)(zr,2),Xr=Pr[0],Yr=Pr[1],ce=Object(U.useReducer)(Rt,$t),K=Object(b.a)(ce,2),Y=K[0],ee=K[1],ye=Y.loading,se=Y.data,Pe=Y.user,Ze=Y.disciplines,mt=Y.dicts,Tt=Y.status,et=se==null?void 0:se.hack_sets,kt=se==null||((Je=se.hack)===null||Je===void 0)?void 0:Je.test_set_average,Zt=Ct.query,Yt=Zt.callback_url,Cr=Zt.express_id,Tr=Zt.score,_r=Zt.question_id,en=Zt.type,Rn=Object(U.useState)([]),gr=Object(b.a)(Rn,2),$r=gr[0],mn=gr[1],gn=Object(U.useState)(!1),jr=Object(b.a)(gn,2),Ar=jr[0],rr=jr[1],br=Object(U.useState)(!1),Or=Object(b.a)(br,2),Jr=Or[0],tn=Or[1],rn=en==="1",li=Object(U.useMemo)(function(){var ct=[];return Ze&&pe(Ze,ct),ct},[Ze]),Ln=Object(U.useCallback)(Object(D.a)(G.a.mark(function ct(){var ot,ut,wt,Nt,st,Kt,vt,or,ur,xr,Dr,dn,Rr,sr,hi,Pn,yn,$n,Gn,fi,An,On,Jn,Wn,Zn,zn,Yi,Vt,cr,Vn,pi,kn,bn,In,mi,$i,_i,Ji,Zi,Ai,xn,hn,Qi,Qn,Mn,xa,Ea,Oi,Dn,qn,ki,Di=arguments;return G.a.wrap(function(Zr){for(;;)switch(Zr.prev=Zr.next){case 0:if(ot=Di.length>0&&Di[0]!==void 0?Di[0]:0,ut=Ze,!(ut.length===0)){Zr.next=7;break}return Zr.next=5,J("new_question");case 5:wt=Zr.sent,ut=wt.disciplines;case 7:if(!Mt){Zr.next=15;break}return Nt={disciplines:ut},Zr.next=11,V(Mt);case 11:st=Zr.sent,st.message?st.status==="401"&&(document.location.href="/user/login"):(Kt=st.category,vt=st.user,or=st.code,ur=st.language,xr=st.hack_sets,Dr=st.description,dn=st.difficult,Rr=st.name,sr=st.open_or_not,hi=st.sub_discipline_id,Pn=st.tag_discipline_id,yn=st.time_limit,$n=st.test_set_average,Gn=st.test_set_score,fi=st.status,An=st.tag_discipline_ids,On=st.item_banks_group_id,Jn=st.is_file,Wn=Jn===void 0?!1:Jn,Zn=st.hide_actual_output,zn=st.code_compile_score,Yi=st.languages,Vt=st.is_my,cr=st.codes,Vn=oe(ut,hi),pi=Object(b.a)(Vn,2),kn=pi[0],bn=pi[1],rr(Zn),In=Wn?[{input:"",output:"",score:100,position:1}]:xr,Wn?(Yr(xr),Bt.setFieldsValue({hack_sets:In})):Yr([]),mi=Ct.query.lastedUpdateTime,$i=cr==null?void 0:cr.map(function(En){return Object(x.a)(Object(x.a)({},En),{},{code:re.Base64.decode(En==null?void 0:En.code)})}),Nt=Object(x.a)(Object(x.a)({},Nt),{},{loading:!1,user:vt,dicts:bn,status:fi,lastedUpdateTime:ot||(mi||0),data:{hack_codes:{language:ur,code:re.Base64.decode(or)},hack:{category:Kt,difficult:dn,name:Rr,description:Dr,open_or_not:sr,time_limit:yn,test_set_average:$n,test_set_score:Gn,sub_discipline_id:kn,tag_discipline_ids:An,languages:Yi,score:Tr||1,item_banks_group_ids:On,is_file:Wn,is_my:Vt,code_compile_score:zn},hack_sets:In,tags:An,codes:$i}}),parseInt(zn)>0&&tn(!0),ee({type:At.SET_INITAL_DATA,payload:Nt}),mr({hack:{category:Kt,difficult:dn,name:Rr,description:Dr,open_or_not:sr,time_limit:yn,test_set_average:$n,test_set_score:Gn,sub_discipline_id:kn,tag_discipline_ids:An,score:Tr||1,item_banks_group_ids:On,is_file:Wn},codes:$i}),vr(kn==null?void 0:kn[0],kn==null?void 0:kn[1],ut)),Zr.next=25;break;case 15:return Zr.next=17,ne();case 17:Zi=Zr.sent,Ai=Zi.user,xn=Ct.query,hn=xn.difficult,Qi=xn.sub_discipline_id,Qn=xn.tag_discipline_id,Mn=xn.tagIds,xa=xn.banksIds,Ea=oe(ut,parseInt(Qi,10)),Oi=Object(b.a)(Ea,2),Dn=Oi[0],qn=Oi[1],ki=[Number(xa)],ee({type:At.SET_INITAL_DATA,payload:{loading:!1,user:Ai,disciplines:ut,status:0,dicts:qn,data:{hack_codes:{language:"C",code:""},hack:{category:null,difficult:parseInt(hn,10),time_limit:3,description:"",test_set_score:!0,test_set_average:!0,open_or_not:!0,sub_discipline_id:Dn,tag_discipline_id:Mn&&(Mn==null||((_i=Mn.split(","))===null||_i===void 0)?void 0:_i.map(function(En){return Number(En)})),name:"",item_banks_group_ids:ki,is_file:!1},tags:Qn?Qn==null?void 0:Qn.split(",").map(function(En){return parseInt(En,10)}):[],hack_sets:[{input:"",output:"",score:100,position:1}]}}}),mr({hack:{category:null,difficult:parseInt(hn,10),time_limit:3,description:"",test_set_average:!0,open_or_not:!0,sub_discipline_id:Dn,tag_discipline_id:Mn&&(Mn==null||((Ji=Mn.split(","))===null||Ji===void 0)?void 0:Ji.map(function(En){return Number(En)})),name:"",item_banks_group_id:ki,is_file:!1}}),vr(Dn==null?void 0:Dn[0],Dn==null?void 0:Dn[1],ut);case 25:case"end":return Zr.stop()}},ct)})),[Mt,Ze]);Object(U.useEffect)(function(){try{Ln()}catch(ct){console.log(ct,"----")}},[]),Object(U.useEffect)(function(){function ct(){return ot.apply(this,arguments)}function ot(){return ot=Object(D.a)(G.a.mark(function ut(){var wt;return G.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.next=2,Object(we.c)("item_banks_groups/mine.json");case 2:wt=st.sent,mn(wt);case 4:case"end":return st.stop()}},ut)})),ot.apply(this,arguments)}ct()},[]);var vr=function(ot,ut,wt){var Nt,st,Kt,vt=wt==null||((Nt=wt.find(function(or){return or.id===ot}))===null||Nt===void 0||((st=Nt.sub_disciplines)===null||st===void 0||((Kt=st.find(function(or){return or.id===ut}))===null||Kt===void 0)))?void 0:Kt.tag_disciplines};function tr(ct,ot,ut){return kr.apply(this,arguments)}function kr(){return kr=Object(D.a)(G.a.mark(function ct(ot,ut,wt){var Nt,st,Kt,vt,or,ur,xr,Dr,dn,Rr,sr,hi,Pn,yn,$n,Gn,fi,An,On,Jn,Wn,Zn,zn;return G.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:Nt=Object(x.a)({},ot),st=Nt.hack_sets,Kt=Nt.hack_codes,vt=Nt.hack,or=Nt.tags,ur=Nt.codes,vt.hide_actual_output=Ar,xr=[],Dr=[],dn=0,Rr=vt!=null&&vt.is_file?Xr.map(function(cr,Vn){return Object(x.a)(Object(x.a)({},cr),{},{position:Vn+1})}):st.map(function(cr){return Object(x.a)(Object(x.a)({},cr),{},{is_file:!1})}),sr=Object(y.a)(Rr);try{for(sr.s();!(hi=sr.n()).done;)Pn=hi.value,dn+=Pn.score,Pn.id&&Pn.id>=0?xr.push(Pn):Dr.push(Pn)}catch(cr){sr.e(cr)}finally{sr.f()}if(Rr!=null&&Rr.length){Vt.next=11;break}return i.b.error("\u6D4B\u8BD5\u96C6\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 11:if(dn+=parseInt(vt.code_compile_score||0),!(dn!==100&&!vt.test_set_score)){Vt.next=15;break}return i.b.error("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),Vt.abrupt("return");case 15:if(!(Rr!=null&&Rr.some(function(cr){return!cr.output}))){Vt.next=18;break}return i.b.error("\u6D4B\u8BD5\u96C6\u8F93\u51FA\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 18:if(yn={},rn?ur==null||ur.forEach(function(cr){yn[cr.language]=cr!=null&&cr.code?re.Base64.encode(cr==null?void 0:cr.code):""}):Kt.code=re.Base64.encode(Kt==null?void 0:Kt.code),vt.sub_discipline_id=vt.sub_discipline_id[1],ee({type:At.SET_LOADING,payload:!0}),Yt||(vt.score=vt.difficult*100),!Mt){Vt.next=49;break}return Vt.next=26,Z(Mt,{hack:vt,hack_codes:Kt,hack_sets:Dr,update_hack_sets:xr,tags:or,is_cover:wt,languages:vt.languages,codes:yn});case 26:if(!Yt){Vt.next=45;break}return Vt.next=29,je(Mt);case 29:if(!Yt.includes("paperlibrary")){Vt.next=35;break}return Vt.next=32,Object(Et.f)({id:Cr,question_id:_r,item_type:xt.a.Program,name:vt.name,question_score:vt.score,difficulty:vt.difficult,sub_discipline_id:vt.sub_discipline_id,tag_discipline_ids:vt.tag_discipline_ids,item_banks_group_ids:vt.item_banks_group_ids});case 32:return $n=Vt.sent,$n.status===0&&Xt.replace(Yt),Vt.abrupt("return");case 35:return Vt.next=37,_e(_r,{question_type:6,question_score:vt.score,question_title:vt.name,description:vt.description,sub_discipline_id:vt.sub_discipline_id,tag_discipline_ids:vt.tag_discipline_ids,item_banks_group_ids:vt.item_banks_group_ids,identifier:Mt});case 37:if(Gn=Vt.sent,fi=Gn.status,!(fi===0)){Vt.next=43;break}if(!(ut==="start")){Vt.next=42;break}return Vt.abrupt("return");case 42:Xt.replace(Yt);case 43:Vt.next=46;break;case 45:Ln(ir());case 46:ee({type:At.SET_LOADING,payload:!1}),Vt.next=79;break;case 49:return Vt.next=51,Ee({hack:vt,hack_codes:Kt,hack_sets:Rr,tags:or,examination_bank_id:Cr||null});case 51:if(An=Vt.sent,On=An.identifier,Jn=An.exam_identifier,ee({type:At.SET_LOADING,payload:!1}),!(ut==="start")){Vt.next=57;break}return Vt.abrupt("return");case 57:if(!On){Vt.next=79;break}if(Yt){Vt.next=62;break}Xt.replace("/problems/".concat(On,"/edit?lastedUpdateTime=").concat(ir())),Vt.next=79;break;case 62:return Vt.next=64,je(On);case 64:if(Mt){Vt.next=78;break}if(!Yt.includes("paperlibrary")){Vt.next=71;break}return Vt.next=68,Object(Et.f)({id:Cr,item_type:xt.a.Program,name:vt.name,question_score:vt.score,difficulty:vt.difficult,sub_discipline_id:vt.sub_discipline_id,tag_discipline_ids:vt.tag_discipline_ids,identifier:Jn});case 68:return Wn=Vt.sent,Wn.status===0&&Xt.replace(Yt),Vt.abrupt("return");case 71:return Vt.next=73,xe(parseInt(Cr,10),{question_type:6,question_score:vt.score,question_title:vt.name,identifier:On,tag_discipline_ids:vt.tag_discipline_ids});case 73:Zn=Vt.sent,zn=Zn.status,zn===0&&Xt.replace(Yt),Vt.next=79;break;case 78:Xt.replace(Yt);case 79:case"end":return Vt.stop()}},ct)})),kr.apply(this,arguments)}function er(){Bt.submit(),setTimeout(Object(D.a)(G.a.mark(function ct(){var ot;return G.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,je(Mt);case 2:ot=wt.sent,ot.status===0?(i.b.success("\u53D1\u5E03\u6210\u529F"),ee({type:At.SET_STATUS,payload:1})):i.b.info(ot.message);case 4:case"end":return wt.stop()}},ct)})),400)}function wr(){return nr.apply(this,arguments)}function nr(){return nr=Object(D.a)(G.a.mark(function ct(){var ot;return G.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Be(Mt);case 2:ot=wt.sent,ot.status===0?(i.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),ee({type:At.SET_STATUS,payload:0})):i.b.info(ot.message);case 4:case"end":return wt.stop()}},ct)})),nr.apply(this,arguments)}function Cn(){Tt===0?Wt({title:"\u63D0\u793A",content:B.a.createElement(U.Fragment,null," ",B.a.createElement("div",null,"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802")," ",B.a.createElement("div",null," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")," "),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){er()}}):Wt({title:"\u63D0\u793A",content:B.a.createElement("p",null,"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){wr()}})}function Ir(){return Fr.apply(this,arguments)}function Fr(){return Fr=Object(D.a)(G.a.mark(function ct(){return G.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.t0=tr,ut.next=3,Bt.getFieldValue();case 3:ut.t1=ut.sent,(0,ut.t0)(ut.t1,"start"),setTimeout(Object(D.a)(G.a.mark(function wt(){var Nt,st;return G.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return vt.next=2,He(Mt);case 2:Nt=vt.sent,st=Nt.identifier,rn?window.location.href="/myproblems/".concat(st,"?type=1"):window.location.href="/myproblems/".concat(st);case 5:case"end":return vt.stop()}},wt)})),400);case 6:case"end":return ut.stop()}},ct)})),Fr.apply(this,arguments)}function Bn(){if(Yt)Xt.replace(Yt);else if(rn){var ct,ot=(ct=localStorage.getItem("program_homework"))===null||ct===void 0?void 0:ct.split(",");Xt.push("/classrooms/".concat(ot==null?void 0:ot[0],"/program_homework/").concat(ot==null?void 0:ot[1],"/detail"))}else Xt.replace("/problemset")}var Tn=function(ot){var ut=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,wt=Math.floor((100-ut)/ot.length),Nt=wt+(100-ut)%ot.length;ot=ot.map(function(st,Kt){return Kt===ot.length-1?Object(x.a)(Object(x.a)({},st),{},{score:Nt}):Object(x.a)(Object(x.a)({},st),{},{score:wt})}),Yr(ot)};function ui(ct){ct.target.value||Tn(Xr),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{test_set_score:ct.target.value})})}})}function Un(ct){ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{is_file:ct.target.value})})}})}function _n(ct){rr(ct.target.checked)}function ci(ct){var ot=ct.target.value;ot&&Tn(Xr),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{test_set_average:ot})})}})}function vn(){var ct=Bt.getFieldValue("hack_sets"),ot=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,ut=ct.length+1,wt=Math.floor((100-ot)/ut),Nt=(100-ot)%ut;ct.map(function(st,Kt){return kt&&(st.score=wt),st.position=Kt+1,st}),ct.push({input:"",output:"",position:ut,score:kt?wt+Nt:0}),Bt.setFieldsValue({hack_sets:ct}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:ct})}})}function di(){var ct=Bt.getFieldValue("hack_sets"),ot=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,ut=ct.length,wt=Math.floor((100-ot)/ut),Nt=(100-ot)%ut;ct.map(function(st,Kt){return kt&&(st.score=wt,Kt===ct.length-1&&(st.score=wt+Nt)),st.position=Kt+1,st}),Bt.setFieldsValue({hack_sets:ct}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:ct})}})}Object(U.useEffect)(function(){if(kt){var ct=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,ot=et==null?void 0:et.length,ut=Math.floor((100-ct)/ot),wt=(100-ct)%ot;et==null||et.map(function(Nt,st){return Nt.score=ut,Nt.position=st+1,st===ot-1&&(Nt.score=ut+wt),Nt}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:et})}}),Bt.setFieldsValue({hack_sets:et})}},[kt]);function Ti(ct){var ot=Bt.getFieldValue("hack_sets"),ut=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,wt=(ot==null?void 0:ot.length)-1,Nt=Math.floor((100-ut)/wt),st=(100-ut)%wt;ot.splice(ct,1),ot==null||ot.map(function(Kt,vt){return kt&&(Kt.score=Nt,vt===wt-1&&(Kt.score=Nt+st)),Kt.position=vt+1,Kt}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:ot})}}),Bt.setFieldsValue({hack_sets:ot})}function Kn(ct){ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_codes:Object(x.a)(Object(x.a)({},se.hack_codes),{},{language:ct})})}})}var Xi=function(ot){var ut;if(ot!=null&&(ut=ot.hack)!==null&&ut!==void 0&&ut.sub_discipline_id){var wt,Nt,st,Kt,vt,or=ot==null||((wt=ot.hack)===null||wt===void 0)?void 0:wt.sub_discipline_id,ur=Object(b.a)(or,2),xr=ur[0],Dr=ur[1],dn=Ze==null||((Nt=Ze.find(function(sr){return sr.id===xr}))===null||Nt===void 0||((st=Nt.sub_disciplines)===null||st===void 0||((Kt=st.find(function(sr){return sr.id===Dr}))===null||Kt===void 0)))?void 0:Kt.tag_disciplines,Rr=Object(x.a)(Object(x.a)({},Bt.getFieldsValue()),{},{hack:Object(x.a)(Object(x.a)({},(vt=Bt.getFieldsValue())===null||vt===void 0?void 0:vt.hack),{},{tag_discipline_ids:[]})});Bt.setFieldsValue(Rr),mr(Rr)}else mr(Object(x.a)({},Bt.getFieldsValue()))},Lt=function(ot){Dt([].concat(Object(w.a)(nt),[Object(x.a)({},ot)]))};Object(U.useEffect)(function(){var ct,ot;if(se!=null&&(ct=se.hack)!==null&&ct!==void 0&&(ot=ct.sub_discipline_id)!==null&&ot!==void 0&&ot[1]){var ut,wt;Ht(se==null||((ut=se.hack)===null||ut===void 0||((wt=ut.sub_discipline_id)===null||wt===void 0))?void 0:wt[1])}},[se==null||((dt=se.hack)===null||dt===void 0)?void 0:dt.sub_discipline_id]);var Ht=function(){var ct=Object(D.a)(G.a.mark(function ot(ut){var wt;return G.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.next=2,Object(ze.I)({sub_discipline_id:ut});case 2:wt=st.sent,Dt(wt.tag_disciplines);case 4:case"end":return st.stop()}},ot)}));return function(ut){return ct.apply(this,arguments)}}();function Ft(ct){var ot=ct[1],ut=oe(Ze,ot),wt=Object(b.a)(ut,2),Nt=wt[1];Bt.setFieldsValue({tags:[]}),ee({type:At.SET_INITAL_DATA,payload:{dicts:Nt,data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{sub_discipline_id:ct}),tags:[]})}})}var Qt=function(ot){var ut,wt,Nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Nt)return function(){ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{is_file:!0})})}}),Bt.setFieldsValue({hack:{is_file:!0}})};var st=ot==null?void 0:ot.map(function(Dr){return{input:Dr.input,output:Dr.output,score:0,position:1}}),Kt=(ut=Bt.getFieldValue("hack_sets"))===null||ut===void 0||((wt=ut.filter(function(Dr){return Dr.input||Dr.output}))===null||wt===void 0)?void 0:wt.concat(st),vt=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,or=Kt==null?void 0:Kt.length,ur=Math.floor((100-vt)/or),xr=(100-vt)%or;Kt==null||Kt.map(function(Dr,dn){return kt&&(Dr.score=ur,dn===or-1&&(Dr.score=ur+xr)),Dr.position=dn+1,Dr}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:Kt,hack:Object(x.a)(Object(x.a)({},se.hack),{},{is_file:!1})})}}),Bt.setFieldsValue({hack_sets:Kt,hack:{is_file:!1}})};return B.a.createElement(n.a,{spinning:ye,delay:500},se?B.a.createElement(U.Fragment,null,B.a.createElement("header",{className:te.a.header},B.a.createElement("div",null,B.a.createElement("img",{src:"".concat(qe.a.IMG_SERVER,"/images/").concat(Pe==null?void 0:Pe.image_url),alt:"user",width:30}),B.a.createElement("span",null,Pe==null?void 0:Pe.name)),B.a.createElement("h2",null," ",se==null?void 0:se.hack.name," "),Mt?B.a.createElement("a",{className:te.a.btn_back,onClick:Bn}," ",B.a.createElement(he.a,null),"\u9000\u51FA"):null),B.a.createElement(c.a,{form:Bt,initialValues:se,layout:"vertical",className:te.a["oj-form-container"],onValuesChange:Xi,onFinish:function(ot,ut){var wt;if(Ct!=null&&(wt=Ct.query)!==null&&wt!==void 0&&wt.exercise&&!Yt.includes("paperlibrary")){L.a.confirm({title:"\u4FDD\u5B58\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u8BD5\u9898\u5E93\u4E2D\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u8BD5\u9898\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",onOk:function(){return tr(ot,ut,1)},onCancel:function(){return tr(ot,ut,0)}});return}tr(ot,ut)}},B.a.createElement(Ge.a,{leftChild:B.a.createElement(St,{onAddTestCases:di,form:Bt,handleAddKnowledgeFinish:Lt,MyGroup:$r,formValue:Gt,knowledgeOptions:nt,onChangeLanguage:Kn,onChangeSubDiscipline:Ft,onRemoveTestCase:Ti,onAddTestCase:vn,dicts:mt,categorys:li,callback_url:Yt,hack:se.hack,onChangeScore:ui,onChangehide:_n,onChangeAverage:ci,onChangeFile:Un,uploadData:Xr,setUploadData:Yr,handleUploadRatio:Tn,ischecked:Ar,isshows:Jr,isProgram:rn,addUploadFnc:Qt,id:Mt}),rightChild:rn?B.a.createElement(c.a.Item,{name:"codes",style:{marginBottom:0}},B.a.createElement(Fe,null)):B.a.createElement(c.a.Item,{name:["hack_codes","code"],style:{marginBottom:0}},B.a.createElement(Ye.a,{language:se.hack_codes.language}))}),B.a.createElement("div",{className:te.a.footer},Mt?B.a.createElement(U.Fragment,null,rn&&B.a.createElement(u.a,{onClick:Bn,type:"primary",ghost:!0},"\u9000\u51FA\u7F16\u8F91"),Yt||rn?null:B.a.createElement(u.a,{type:Tt?"default":"primary",onClick:Cn},Tt?"\u64A4\u9500\u53D1\u5E03":"\u7ACB\u5373\u53D1\u5E03"),B.a.createElement(u.a,{loading:ye,type:"primary",htmlType:"submit"},"\u4FDD\u5B58"),B.a.createElement(u.a,{type:"primary",onClick:Ir},Tt?"\u5F00\u59CB\u6311\u6218":"\u6A21\u62DF\u6311\u6218")):B.a.createElement(U.Fragment,null,B.a.createElement(u.a,{onClick:Bn},"\u53D6\u6D88"),B.a.createElement(u.a,{loading:ye,type:"primary",htmlType:"submit"},"\u4FDD\u5B58"))))):null)};function St(Je){var dt,Ct,Xt,Jt,Mt=Je.form,Pt=Je.onAddTestCases,gt=Je.handleAddKnowledgeFinish,Bt=Je.ischecked,fr=Je.MyGroup,ar=Je.formValue,Gt=Je.knowledgeOptions,mr=Je.categorys,zt=Je.hack,Ur=Je.callback_url,nt=Je.onChangeAverage,Dt=Je.onChangeScore,zr=Je.onChangehide,Pr=Je.onChangeFile,Xr=Je.onAddTestCase,Yr=Je.onRemoveTestCase,ce=Je.onChangeSubDiscipline,K=Je.onChangeLanguage,Y=Je.uploadData,ee=Je.setUploadData,ye=Je.handleUploadRatio,se=Je.isshows,Pe=Je.isProgram,Ze=Je.addUploadFnc,mt=Je.id,Tt=((dt=location)===null||dt===void 0||((Ct=dt.search)===null||Ct===void 0)?void 0:Ct.includes("select"))||!1,et=Object(U.useState)(se),kt=Object(b.a)(et,2),Zt=kt[0],Yt=kt[1],Cr=zt.test_set_average,Tr=zt.test_set_score,_r=Object(U.useState)(!1),en=Object(b.a)(_r,2),Rn=en[0],gr=en[1],$r=function(rr,br){var Or=Object(w.a)(Y);Or.splice(br,1),Cr?ye(Or):ee(Or)},mn=function(rr,br){console.log(rr,br);var Or=Y.map(function(Jr,tn){return tn===br?Object(x.a)(Object(x.a)({},Jr),{},{score:rr.target.value?Number(rr.target.value):0}):Jr});ee(Or)},gn=function(rr){if(!(rr!=null&&rr.length))return;if(rr!=null&&rr[0].is_file){Ze(rr,!0)();var br=Y.concat(rr);zt.test_set_average?ye(br):ee(br)}rr!=null&&rr[0].is_file||Ze(rr)};function jr(Ar){Ar.stopPropagation()}return B.a.createElement("div",{className:te.a["oj-left-panel"]},B.a.createElement("div",{className:te.a["oj-form-info"]},B.a.createElement("div",{className:te.a.field},B.a.createElement(c.a.Item,{label:"\u96BE\u6613\u5EA6",name:["hack","difficult"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},B.a.createElement(E.a,{disabled:Tt},ge(Ce.difficult))),B.a.createElement(c.a.Item,{label:"\u8BFE\u7A0B(\u5408\u7406\u7684\u8BFE\u7A0B\u5206\u7C7B\u6709\u5229\u4E8E\u5FEB\u901F\u68C0\u7D22)",name:["hack","sub_discipline_id"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},B.a.createElement(p.a,{disabled:Tt,allowClear:!1,options:mr,placeholder:"\u8BF7\u9009\u62E9",onChange:ce}))),B.a.createElement("div",{className:te.a.field},Ur&&B.a.createElement(c.a.Item,{label:"\u5206\u6570",name:["hack","score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u6570"}],extra:B.a.createElement("span",{style:{position:"absolute",left:100,top:5}},"\u5206")},B.a.createElement(r.a,{disabled:Tt,min:1,max:100})),B.a.createElement(c.a.Item,{label:B.a.createElement("div",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236 ",B.a.createElement("span",{className:"c-grey-999"},"(\u4EE3\u7801\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F)")),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"}],extra:B.a.createElement("span",{style:{position:"absolute",left:100,top:5}},"\u79D2")},B.a.createElement(r.a,{min:3})),Pe?B.a.createElement(c.a.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",name:["hack","languages"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},B.a.createElement(s.a.Group,null,B.a.createElement(s.a,{value:"c"},"C"),B.a.createElement(s.a,{value:"c++"},"C++"),B.a.createElement(s.a,{value:"java"},"Java"),B.a.createElement(s.a,{value:"python"},"Python"))):B.a.createElement(c.a.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",name:["hack_codes","language"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},B.a.createElement(E.a,{onChange:K},ge(Ce.language)))),B.a.createElement(c.a.Item,{label:B.a.createElement("span",null,"\u77E5\u8BC6\u70B9\uFF1A",B.a.createElement("span",{className:"c-grey-999"},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),name:["hack","tag_discipline_ids"]},B.a.createElement(pt.a,{selectvalues:(zt==null?void 0:zt.tag_discipline_id)||(zt==null?void 0:zt.tag_discipline_ids),disabled:Tt,subId:ar==null||((Xt=ar.hack)===null||Xt===void 0||((Jt=Xt.sub_discipline_id)===null||Jt===void 0))?void 0:Jt[1],knowledgeOptions:Gt,onAddKnowledgeFinish:gt})),B.a.createElement(c.a.Item,{label:"\u52A0\u5165\u6587\u4EF6\u5939\u76EE\u5F55",name:["hack","item_banks_group_ids"],labelCol:{span:24},wrapperCol:{span:24}},B.a.createElement(at.a,{disabled:Tt})),B.a.createElement(c.a.Item,{label:"\u4EFB\u52A1\u540D\u79F0",name:["hack","name"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},B.a.createElement(z.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0",suffix:B.a.createElement("span",null,60-zt.name.length)})),B.a.createElement(c.a.Item,{name:["hack","description"],valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},B.a.createElement(ie.a,{miniToolbar:!0,id:"moop_cases_content",noStorage:!0,height:200})),B.a.createElement("div",{className:"tst-case-info"},B.a.createElement("h3",{className:"flex-container",style:{justifyContent:"space-between"}}," \u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219",!zt.is_file&&B.a.createElement(u.a,{type:"primary",ghost:!0,onClick:Xr},"\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B")),B.a.createElement(c.a.Item,{name:["hack","test_set_score"]},B.a.createElement(C.a.Group,{onChange:Dt},B.a.createElement(C.a,{value:!0},"\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6",B.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")),B.a.createElement(C.a,{value:!1},"\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6",B.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")))),B.a.createElement(s.a,{style:{marginBottom:"5px"},checked:Bt,onChange:zr},"\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u8003\u8BD5\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"),B.a.createElement(c.a.Item,{className:te.a.testJi,name:["hack","is_file"],label:"\u7528\u4F8B\u7C7B\u578B:"},B.a.createElement(C.a.Group,{onChange:Pr},B.a.createElement(T.a,{direction:"horizontal"},B.a.createElement(C.a,{value:!1},"\u6587\u672C"),B.a.createElement(C.a,{value:!0},"\u6587\u4EF6")))),!zt.test_set_score&&B.a.createElement(c.a.Item,{name:["hack","test_set_average"],label:"\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4"},B.a.createElement(C.a.Group,{onChange:nt},B.a.createElement(C.a,{value:!0},"\u5747\u5206\u6BD4\u4F8B"),B.a.createElement(C.a,{value:!1},"\u81EA\u5B9A\u4E49\u6BD4\u4F8B"))),!zt.test_set_score&&B.a.createElement("div",{style:{marginBottom:"20px",marginTop:"-10px"}},B.a.createElement("div",{style:{display:"flex",height:"30px",marginBottom:"10px"}},B.a.createElement(s.a,{checked:Zt,style:{display:"flex",alignItems:"center"},className:te.a.checkboxs,onChange:function(rr){Yt(rr.target.checked),Mt.setFieldsValue({hack:{code_compile_score:0}}),zt.test_set_average&&(zt.is_file?ye(Y):Pt())}},"\u542F\u7528\u7F16\u8BD1\u901A\u8FC7\u5373\u53EF\u5F97\u5206"),Zt&&B.a.createElement("span",{style:{display:"flex"}},B.a.createElement(c.a.Item,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7F16\u8BD1\u5F97\u5206"}],name:["hack","code_compile_score"]},B.a.createElement(r.a,{onChange:function(){zt.test_set_average&&(zt.is_file?ye(Y):Pt())},parser:function(rr){return isNaN(parseInt(rr))?"":parseInt(rr)},min:0,max:100,style:{width:"90px",margin:"5px 0px"}}))," ",B.a.createElement("span",{style:{display:"flex",alignItems:"center",marginLeft:"5px"}},"%"))),B.a.createElement("span",{style:{color:"#999",fontSize:"12px",marginLeft:"-8px"}},"\uFF08\u8BF7\u6CE8\u610F\u8BE5\u5B9E\u8BAD\u9898\u662F\u5426\u6709\u7F16\u8BD1\u8FC7\u7A0B\uFF0C\u82E5\u6CA1\u6709\u5219\u65E0\u6CD5\u83B7\u5F97\u7F16\u8BD1\u5F97\u5206\uFF09")),B.a.createElement("div",{className:te.a.upBtn},B.a.createElement(u.a,{ghost:!0,type:"primary",className:"mb20",onClick:function(){return gr(!0)}},"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"),(zt==null?void 0:zt.is_file)&&B.a.createElement(ft.a,{disabled:zt==null?void 0:zt.test_set_average,inputChange:mn,showScore:!zt.test_set_score,data:Y,onRemove:$r})),!zt.is_file&&B.a.createElement(c.a.List,{name:"hack_sets"},function(Ar,rr){return Object(S.a)(rr),B.a.createElement(j.a,{accordion:!0},Ar.map(function(br,Or){return B.a.createElement(It,{key:"".concat(br.key,"--").concat(Or),header:B.a.createElement("a",{className:te.a["test-case-name"]},B.a.createElement("span",null,"\u6D4B\u8BD5\u7528\u4F8B",Or+1,"\b"),Tr?null:B.a.createElement(B.a.Fragment,null,B.a.createElement(c.a.Item,{name:[br.name,"score"],fieldKey:[br.fieldKey,"score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6".concat(Or+1,"\u8BC4\u5206")}]},B.a.createElement(r.a,{onClick:jr,min:0,max:100,disabled:Cr})),B.a.createElement("span",null,"%"))),extra:Or>0?B.a.createElement("div",{onClick:jr},B.a.createElement(m.a,{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u5B9A\u5220\u9664\u6D4B\u8BD5\u96C6\b"+(Or+1),onConfirm:function(){Yr(Or)}},B.a.createElement(Q.a,{className:te.a["btn-remove-case"]}))):null},B.a.createElement(c.a.Item,{label:"\u8F93\u5165",name:[br.name,"input"],fieldKey:[br.fieldKey,"input"]},B.a.createElement(lt,null)),B.a.createElement(c.a.Item,{label:"\u8F93\u51FA",name:[br.name,"output"],fieldKey:[br.fieldKey,"output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},B.a.createElement(lt,null)))}))}))),B.a.createElement(ft.b,{rootIdentifier:mt,visible:Rn,onClose:function(){return gr(!1)},onOK:gn,multiple:!0,defaultMultipleValue:zt==null?void 0:zt.is_file}))}},PVpz:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.StreamCipher,T=m.algo,g=[],C=[],h=[],s=T.RabbitLegacy=R.extend({_doReset:function(){var r=this._key.words,f=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],d=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 E=0;E<4;E++)a.call(this);for(var E=0;E<8;E++)d[E]^=p[E+4&7];if(f){var y=f.words,l=y[0],n=y[1],o=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,u=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,w=o>>>16|u&4294901760,v=u<<16|o&65535;d[0]^=o,d[1]^=w,d[2]^=u,d[3]^=v,d[4]^=o,d[5]^=w,d[6]^=u,d[7]^=v;for(var E=0;E<4;E++)a.call(this)}},_doProcessBlock:function(r,f){var p=this._X;a.call(this),g[0]=p[0]^p[5]>>>16^p[3]<<16,g[1]=p[2]^p[7]>>>16^p[5]<<16,g[2]=p[4]^p[1]>>>16^p[7]<<16,g[3]=p[6]^p[3]>>>16^p[1]<<16;for(var d=0;d<4;d++)g[d]=(g[d]<<8|g[d]>>>24)&16711935|(g[d]<<24|g[d]>>>8)&4278255360,r[f+d]^=g[d]},blockSize:128/32,ivSize:64/32});function a(){for(var r=this._X,f=this._C,p=0;p<8;p++)C[p]=f[p];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0>>0?1:0)|0,this._b=f[7]>>>0>>0?1:0;for(var p=0;p<8;p++){var d=r[p]+f[p],E=d&65535,y=d>>>16,l=((E*E>>>17)+E*y>>>15)+y*y,n=((d&4294901760)*d|0)+((d&65535)*d|0);h[p]=l^n}r[0]=h[0]+(h[7]<<16|h[7]>>>16)+(h[6]<<16|h[6]>>>16)|0,r[1]=h[1]+(h[0]<<8|h[0]>>>24)+h[7]|0,r[2]=h[2]+(h[1]<<16|h[1]>>>16)+(h[0]<<16|h[0]>>>16)|0,r[3]=h[3]+(h[2]<<8|h[2]>>>24)+h[1]|0,r[4]=h[4]+(h[3]<<16|h[3]>>>16)+(h[2]<<16|h[2]>>>16)|0,r[5]=h[5]+(h[4]<<8|h[4]>>>24)+h[3]|0,r[6]=h[6]+(h[5]<<16|h[5]>>>16)+(h[4]<<16|h[4]>>>16)|0,r[7]=h[7]+(h[6]<<8|h[6]>>>24)+h[5]|0}m.RabbitLegacy=R._createHelper(s)}(),P.RabbitLegacy})},RELg:function(I,q,N){var P=N("MFOe"),m=P.Global;I.exports={name:"oldIE-userDataStorage",write:C,read:h,each:s,remove:a,clearAll:r};var S="storejs",R=m.document,T=d(),g=(m.navigator?m.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function C(E,y){if(g)return;var l=p(E);T(function(n){n.setAttribute(l,y),n.save(S)})}function h(E){if(g)return;var y=p(E),l=null;return T(function(n){l=n.getAttribute(y)}),l}function s(E){T(function(y){for(var l=y.XMLDocument.documentElement.attributes,n=l.length-1;n>=0;n--){var o=l[n];E(y.getAttribute(o.name),o.name)}})}function a(E){var y=p(E);T(function(l){l.removeAttribute(y),l.save(S)})}function r(){T(function(E){var y=E.XMLDocument.documentElement.attributes;E.load(S);for(var l=y.length-1;l>=0;l--)E.removeAttribute(y[l].name);E.save(S)})}var f=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function p(E){return E.replace(/^\d/,"___$&").replace(f,"___")}function d(){if(!R||!R.documentElement||!R.documentElement.addBehavior)return null;var E="script",y,l,n;try{l=new ActiveXObject("htmlfile"),l.open(),l.write("<"+E+">document.w=window'),l.close(),y=l.w.frames[0].document,n=y.createElement("div")}catch(o){n=R.createElement("div"),y=R.body}return function(o){var u=[].slice.call(arguments,0);u.unshift(n),y.appendChild(n),n.addBehavior("#default#userData"),n.load(S),o.apply(this,u),y.removeChild(n);return}}},RxwV:function(I,q,N){"use strict";var P=N("q1tI"),m=N("uciX"),S=N("2W6z"),R=N.n(S),T=N("4IlW"),g=N("uK0f"),C=N.n(g);function h(ge,pe){if(ge===pe)return!0;if(!ge||!pe)return!1;var oe=ge.length;if(pe.length!==oe)return!1;for(var ae=0;ae0;(Be||he.isLeaf===!1)&&(_e+=" ".concat(we,"-menu-item-expand"),he.loading||(je=P.createElement("span",{className:"".concat(we,"-menu-item-expand-icon")},J))),ne==="hover"&&(Be||he.isLeaf===!1)&&(xe={onMouseEnter:this.delayOnSelect.bind(this,Z),onMouseLeave:this.delayOnSelect.bind(this),onClick:Z}),this.isActiveOption(he,Q)&&(_e+=" ".concat(we,"-menu-item-active"),xe.ref=this.saveMenuItem(Q)),he.disabled&&(_e+=" ".concat(we,"-menu-item-disabled"));var He=null;he.loading&&(_e+=" ".concat(we,"-menu-item-loading"),He=V||null);var Ue="";return"title"in he?Ue=he.title:typeof he[this.getFieldName("label")]=="string"&&(Ue=he[this.getFieldName("label")]),P.createElement("li",Object.assign({key:he[this.getFieldName("value")],className:_e,title:Ue},xe,{role:"menuitem",onMouseDown:function(Ge){return Ge.preventDefault()}}),he[this.getFieldName("label")],je,He)}},{key:"getActiveOptions",value:function(he){var Q=this,ie=this.props.options,we=he||this.props.activeValue;return C()(ie,function(ne,J){return ne[Q.getFieldName("value")]===we[J]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var he=this,Q=this.props.options,ie=this.getActiveOptions().map(function(we){return we[he.getFieldName("children")]}).filter(function(we){return!!we});return ie.unshift(Q),ie}},{key:"delayOnSelect",value:function(he){for(var Q=this,ie=arguments.length,we=new Array(ie>1?ie-1:0),ne=1;ne=0)continue;if(!Object.prototype.propertyIsEnumerable.call(ge,ae))continue;oe[ae]=ge[ae]}}return oe}function c(ge,pe){if(ge==null)return{};var oe={},ae=Object.keys(ge),re,he;for(he=0;he=0)continue;oe[re]=ge[re]}return oe}function b(ge){return F(ge)||j(ge)||_(ge)||x()}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(ge,pe){if(!ge)return;if(typeof ge=="string")return L(ge,pe);var oe=Object.prototype.toString.call(ge).slice(8,-1);if(oe==="Object"&&ge.constructor&&(oe=ge.constructor.name),oe==="Map"||oe==="Set")return Array.from(ge);if(oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oe))return L(ge,pe)}function j(ge){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(ge))return Array.from(ge)}function F(ge){if(Array.isArray(ge))return L(ge)}function L(ge,pe){(pe==null||pe>ge.length)&&(pe=ge.length);for(var oe=0,ae=new Array(pe);oe=V.length?0:Ee):(Ee-=1,Ee=Ee<0?V.length-1:Ee):Ee=0,ne[J]=V[Ee][he.getFieldName("value")]}else if(ie.keyCode===T.a.LEFT||ie.keyCode===T.a.BACKSPACE)ie.preventDefault(),ne.splice(ne.length-1,1);else if(ie.keyCode===T.a.RIGHT)ie.preventDefault(),V[Z]&&V[Z][he.getFieldName("children")]&&ne.push(V[Z][he.getFieldName("children")][0][he.getFieldName("value")]);else if(ie.keyCode===T.a.ESC||ie.keyCode===T.a.TAB){he.setPopupVisible(!1);return}(!ne||ne.length===0)&&he.setPopupVisible(!1);var xe=he.getActiveOptions(ne),_e=xe[xe.length-1];he.handleMenuSelect(_e,xe.length-1,ie),he.props.onKeyDown&&he.props.onKeyDown(ie)},he.saveTrigger=function(ie){he.trigger=ie};var Q=[];return"value"in re?Q=re.value||[]:"defaultValue"in re&&(Q=re.defaultValue||[]),R()(!("filedNames"in re),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),he.state={popupVisible:re.popupVisible,activeValue:Q,value:Q,prevProps:re},he.defaultFieldNames={label:"label",value:"value",children:"children"},he}return H(ae,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(he){var Q=this.defaultFieldNames,ie=this.props,we=ie.fieldNames,ne=ie.filedNames;return"filedNames"in this.props?ne[he]||Q[he]:we[he]||Q[he]}},{key:"getFieldNames",value:function(){var he=this.props,Q=he.fieldNames,ie=he.filedNames;return"filedNames"in this.props?ie:Q}},{key:"getCurrentLevelOptions",value:function(){var he=this,Q=this.props.options,ie=Q===void 0?[]:Q,we=this.state.activeValue,ne=we===void 0?[]:we,J=C()(ie,function(V,Z){return V[he.getFieldName("value")]===ne[Z]},{childrenKeyName:this.getFieldName("children")});return J[J.length-2]?J[J.length-2][this.getFieldName("children")]:b(ie).filter(function(V){return!V.disabled})}},{key:"getActiveOptions",value:function(he){var Q=this;return C()(this.props.options||[],function(ie,we){return ie[Q.getFieldName("value")]===he[we]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var he=this.props,Q=he.prefixCls,ie=he.transitionName,we=he.popupClassName,ne=he.options,J=ne===void 0?[]:ne,V=he.disabled,Z=he.builtinPlacements,Ee=he.popupPlacement,xe=he.children,_e=he.dropdownRender,je=k(he,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Be=P.createElement("div",null),He="";J&&J.length>0?Be=P.createElement(w,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):He=" ".concat(Q,"-menus-empty");var Ue=Be;return _e&&(Ue=_e(Be)),P.createElement(m.a,Object.assign({ref:this.saveTrigger},je,{popupPlacement:Ee,builtinPlacements:Z,popupTransitionName:ie,action:V?[]:["click"],popupVisible:V?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(Q,"-menus"),popupClassName:we+He,popup:Ue}),P.cloneElement(xe,{onKeyDown:this.handleKeyDown,tabIndex:V?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(he,Q){var ie=Q.prevProps,we=ie===void 0?{}:ie,ne={prevProps:he};return"value"in he&&!h(we.value,he.value)&&(ne.value=he.value||[],"loadData"in he||(ne.activeValue=he.value||[])),"popupVisible"in he&&(ne.popupVisible=he.popupVisible),ne}}]),ae}(P.Component);return ge.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:i,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},ge}(),Ce=be,ue=q.a=Ce},S6kV:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){return P.mode.OFB=function(){var m=P.lib.BlockCipherMode.extend(),S=m.Encryptor=m.extend({processBlock:function(R,T){var g=this._cipher,C=g.blockSize,h=this._iv,s=this._keystream;h&&(s=this._keystream=h.slice(0),this._iv=void 0),g.encryptBlock(s,0);for(var a=0;a|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(ne){for(var J=0,V=!1,Z=!1,Ee=0,xe=ne.length;Ee122||(Te<65||Le>90||tt.push([Math.max(65,Le)|32,Math.min(Te,90)|32]),Te<97||Le>122||tt.push([Math.max(97,Le)&~32,Math.min(Te,122)&~32]))}}tt.sort(function(Fe,Xe){return Fe[0]-Xe[0]||Xe[1]-Fe[1]});for(var Ae=[],ke=[],$e=0;$eMe[0]&&(Me[1]+1>Me[0]&&We.push("-"),We.push(He(Me[1])))}return We.push("]"),We.join("")}function ze(Ye){for(var Re=Ye.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),tt=Re.length,rt=[],We=0,$e=0;We=2&&Le==="["?Re[We]=Ue(Ie):Le!=="\\"&&(Re[We]=Ie.replace(/[a-zA-Z]/g,function(ke){var Me=ke.charCodeAt(0);return"["+String.fromCharCode(Me&~32,Me|32)+"]"}))}return Re.join("")}for(var Ge=[],Ee=0,xe=ne.length;Ee=0;)V[Ge.charAt(Ye)]=ze;var Re=ze[1],tt=""+Re;Be.hasOwnProperty(tt)||(je.push(Re),Be[tt]=null)}je.push(/[\0-\uffff]/),Z=U(je)})();var Ee=J.length,xe=function(_e){for(var je=_e.sourceCode,Be=_e.basePos,He=_e.sourceNode,Ue=[Be,_],ze=0,Ge=je.match(Z)||[],Ye={},Re=0,tt=Ge.length;Re=5&&We.substring(0,5)==="lang-",Ie&&!($e&&typeof $e[1]=="string")&&(Ie=!1,We=L),Ie||(Ye[rt]=We)}var Te=ze;if(ze+=rt.length,!Ie)Ue.push(Be+Te,We);else{var Ae=$e[1],ke=rt.indexOf(Ae),Me=ke+Ae.length;$e[2]&&(Me=rt.length-$e[2].length,ke=Me-Ae.length);var Fe=We.substring(5);W(He,Be+Te,rt.substring(0,ke),xe,Ue),W(He,Be+Te+ke,Ae,ae(Fe,Ae),Ue),W(He,Be+Te+Me,rt.substring(Me),xe,Ue)}}_e.decorations=Ue};return xe}function be(ne){var J=[],V=[];ne.tripleQuotedStrings?J.push([i,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ne.multiLineStrings?J.push([i,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):J.push([i,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ne.verbatimStrings&&V.push([i,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Z=ne.hashComments;Z&&(ne.cStyleComments?(Z>1?J.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):J.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),V.push([i,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):J.push([k,/^#[^\r\n]*/,null,"#"])),ne.cStyleComments&&(V.push([k,/^\/\/[^\r\n]*/,null]),V.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ee=ne.regexLiterals;if(Ee){var xe=Ee>1?"":` \r`,_e=xe?".":"[\\S\\s]",je="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+_e+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+_e+")*(?:\\x5D|$))+/";V.push(["lang-regex",RegExp("^"+G+"("+je+")")])}var Be=ne.types;Be&&V.push([c,Be]);var He=(""+ne.keywords).replace(/^ | $/g,"");He.length&&V.push([D,new RegExp("^(?:"+He.replace(/[\s,]+/g,"|")+")\\b"),null]),J.push([_,/^\s+/,null,` \r \xA0`]);var Ue="^.[^\\s\\w.$@'\"`/\\\\]*";return ne.regexLiterals&&(Ue+="(?!s*/)"),V.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[c,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[_,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[_,/^\\[\s\S]?/,null],[x,new RegExp(Ue),null]),fe(J,V)}var Ce=be({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ue(ne,J,V){for(var Z=/(?:^|\s)nocode(?:\s|$)/,Ee=/\r\n?|\n/,xe=ne.ownerDocument,_e=xe.createElement("li");ne.firstChild;)_e.appendChild(ne.firstChild);var je=[_e];function Be(Re){var tt=Re.nodeType;if(tt==1&&!Z.test(Re.className))if(Re.nodeName==="br")He(Re),Re.parentNode&&Re.parentNode.removeChild(Re);else for(var rt=Re.firstChild;rt;rt=rt.nextSibling)Be(rt);else if((tt==3||tt==4)&&V){var We=Re.nodeValue,$e=We.match(Ee);if($e){var Ie=We.substring(0,$e.index);Re.nodeValue=Ie;var Oe=We.substring($e.index+$e[0].length);if(Oe){var Le=Re.parentNode;Le.insertBefore(xe.createTextNode(Oe),Re.nextSibling)}He(Re),Ie||Re.parentNode.removeChild(Re)}}}function He(Re){for(;!Re.nextSibling;)if(Re=Re.parentNode,!Re)return;function tt($e,Ie){var Oe=Ie?$e.cloneNode(!1):$e,Le=$e.parentNode;if(Le){var Te=tt(Le,1),Ae=$e.nextSibling;Te.appendChild(Oe);for(var ke=Ae;ke;ke=Ae)Ae=ke.nextSibling,Te.appendChild(ke)}return Oe}for(var rt=tt(Re.nextSibling,0),We;(We=rt.parentNode)&&We.nodeType===1;)rt=We;je.push(rt)}for(var Ue=0;Ue=Le&&(Be+=2),xe>=Te&&(ze+=2)}}finally{We&&(We.style.display=$e)}}var pe={};function oe(ne,J){for(var V=J.length;--V>=0;){var Z=J[V];pe.hasOwnProperty(Z)?h.console&&console.warn("cannot override language handler %s",Z):pe[Z]=ne}}function ae(ne,J){return ne&&pe.hasOwnProperty(ne)||(ne=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),oe(fe([[_,/^[\s]+/,null,` \r `],[z,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[j,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[X,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),oe(fe([],[[z,/^[\s\S]+/]]),["uq.val"]),oe(be({keywords:f,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),oe(be({keywords:"null,true,false"}),["json"]),oe(be({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),oe(be({keywords:p,cStyleComments:!0}),["java"]),oe(be({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),oe(be({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),oe(be({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),oe(be({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),oe(be({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),oe(be({keywords:E,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),oe(fe([],[[i,/^[\s\S]+/]]),["regex"]);function re(ne){var J=ne.langExtension;try{var V=B(ne.sourceNode,ne.pre),Z=V.sourceCode;ne.sourceCode=Z,ne.spans=V.spans,ne.basePos=0,ae(J,Z)(ne),ge(ne)}catch(Ee){h.console&&console.log(Ee&&Ee.stack||Ee)}}function he(ne,J,V){var Z=V||!1,Ee=J||null,xe=document.createElement("div");xe.innerHTML="
    "+ne+"
    ",xe=xe.firstChild,Z&&ue(xe,Z,!0);var _e={langExtension:Ee,numberLines:Z,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(_e),xe.innerHTML}function Q(ne,J){var V=J||document.body,Z=V.ownerDocument||document;function Ee(Oe){return V.getElementsByTagName(Oe)}for(var xe=[Ee("pre"),Ee("code"),Ee("xmp")],_e=[],je=0;je=15&&(f=!1,s=!0);var i=o&&(a||f&&(v==null||v<12.11)),D=S||C&&h>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var c=function(e,t){var O=e.className,A=k(t).exec(O);if(A){var M=O.slice(A.index+A[0].length);e.className=O.slice(0,A.index)+(M?A[1]+M:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return b(e).appendChild(t)}function _(e,t,O,A){var M=document.createElement(e);if(O&&(M.className=O),A&&(M.style.cssText=A),typeof t=="string")M.appendChild(document.createTextNode(t));else if(t)for(var $=0;$=t)return le+(t-$);le+=me-$,le+=O-le%O,$=me+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,t){this.f=t;var O=+new Date+e;(!this.id||O=t)return A+Math.min(le,t-M);if(M+=$-A,M+=O-M%O,A=$+1,M>=t)return A}}var oe=[""];function ae(e){for(;oe.length<=e;)oe.push(re(oe)+" ");return oe[e]}function re(e){return e[e.length-1]}function he(e,t){for(var O=[],A=0;A"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ne.test(e))}function V(e,t){return t?t.source.indexOf("\\w")>-1&&J(e)?!0:t.test(e):J(e)}function Z(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ee=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function xe(e){return e.charCodeAt(0)>=768&&Ee.test(e)}function _e(e,t,O){for(;(O<0?t>0:tO?-1:1;;){if(t==O)return t;var M=(t+O)/2,$=A<0?Math.ceil(M):Math.floor(M);if($==t)return e($)?t:O;e($)?O=$:t=$+A}}function Be(e,t,O,A){if(!e)return A(t,O,"ltr",0);for(var M=!1,$=0;$t||t==O&&le.to==t)&&(A(Math.max(le.from,t),Math.min(le.to,O),le.level==1?"rtl":"ltr",$),M=!0)}M||A(t,O,"ltr")}var He=null;function Ue(e,t,O){var A;He=null;for(var M=0;Mt)return M;$.to==t&&($.from!=$.to&&O=="before"?A=M:He=M),$.from==t&&($.from!=$.to&&O!="before"?A=M:He=M)}return A!=null?A:He}var ze=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function O(Se){return Se<=247?e.charAt(Se):1424<=Se&&Se<=1524?"R":1536<=Se&&Se<=1785?t.charAt(Se-1536):1774<=Se&&Se<=2220?"r":8192<=Se&&Se<=8203?"w":Se==8204?"b":"L"}var A=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,M=/[stwN]/,$=/[LRr]/,le=/[Lb1n]/,me=/[1n]/;function ve(Se,De,Ne){this.level=Se,this.from=De,this.to=Ne}return function(Se,De){var Ne=De=="ltr"?"L":"R";if(Se.length==0||De=="ltr"&&!A.test(Se))return!1;for(var Ve=Se.length,Ke=[],Qe=0;Qe-1&&(A[t]=M.slice(0,$).concat(M.slice($+1)))}}}function We(e,t){var O=tt(e,t);if(!O.length)return;for(var A=Array.prototype.slice.call(arguments,2),M=0;M0}function Le(e){e.prototype.on=function(t,O){Re(this,t,O)},e.prototype.off=function(t,O){rt(this,t,O)}}function Te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Me(e){Te(e),Ae(e)}function Fe(e){return e.target||e.srcElement}function Xe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var qe=function(){if(C&&h<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}(),pt;function at(e){if(pt==null){var t=_("span","\u200B");x(e,_("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(C&&h<8))}var O=pt?_("span","\u200B"):_("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return O.setAttribute("cm-text",""),O}var ft;function Et(e){if(ft!=null)return ft;var t=x(e,document.createTextNode("A\u062EA")),O=F(t,0,1).getBoundingClientRect(),A=F(t,1,2).getBoundingClientRect();return b(e),!O||O.left==O.right?!1:ft=A.right-O.right<3}var xt=` b`.split(/\n/).length!=3?function(e){for(var t=0,O=[],A=e.length;t<=A;){var M=e.indexOf(` `,t);M==-1&&(M=e.length);var $=e.slice(t,e.charAt(M-1)=="\r"?M-1:M),le=$.indexOf("\r");le!=-1?(O.push($.slice(0,le)),t+=le+1):(O.push($),t=M+1)}return O}:function(e){return e.split(/\r\n?|\n/)},lt=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(O){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Wt=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),It=null;function ir(e){if(It!=null)return It;var t=x(e,_("span","x")),O=t.getBoundingClientRect(),A=F(t,0,1).getBoundingClientRect();return It=Math.abs(O.left-A.left)>1}var $t={},At={};function Rt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),$t[e]=t}function hr(e,t){At[e]=t}function St(e){if(typeof e=="string"&&At.hasOwnProperty(e))e=At[e];else if(e&&typeof e.name=="string"&&At.hasOwnProperty(e.name)){var t=At[e.name];typeof t=="string"&&(t={name:t}),e=we(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return St("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return St("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Je(e,t){t=St(t);var O=$t[t.name];if(!O)return Je(e,"text/plain");var A=O(e,t);if(dt.hasOwnProperty(t.name)){var M=dt[t.name];for(var $ in M){if(!M.hasOwnProperty($))continue;A.hasOwnProperty($)&&(A["_"+$]=A[$]),A[$]=M[$]}}if(A.name=t.name,t.helperType&&(A.helperType=t.helperType),t.modeProps)for(var le in t.modeProps)A[le]=t.modeProps[le];return A}var dt={};function Ct(e,t){var O=dt.hasOwnProperty(e)?dt[e]:dt[e]={};B(t,O)}function Xt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var O={};for(var A in t){var M=t[A];M instanceof Array&&(M=M.concat([])),O[A]=M}return O}function Jt(e,t){for(var O;e.innerMode&&!(O=e.innerMode(t),!O||O.mode==e);)t=O.state,e=O.mode;return O||{mode:e,state:t}}function Mt(e,t,O){return e.startState?e.startState(t,O):!0}var Pt=function(e,t,O){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=O};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.post},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos0?null:($&&t!==!1&&(this.pos+=$[0].length),$)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function gt(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 O=e;!O.lines;)for(var A=0;;++A){var M=O.children[A],$=M.chunkSize();if(t<$){O=M;break}t-=$}return O.lines[t]}function Bt(e,t,O){var A=[],M=t.line;return e.iter(t.line,O.line+1,function($){var le=$.text;M==O.line&&(le=le.slice(0,O.ch)),M==t.line&&(le=le.slice(t.ch)),A.push(le),++M}),A}function fr(e,t,O){var A=[];return e.iter(t,O,function(M){A.push(M.text)}),A}function ar(e,t){var O=t-e.height;if(O)for(var A=e;A;A=A.parent)A.height+=O}function Gt(e){if(e.parent==null)return null;for(var t=e.parent,O=de(t.lines,e),A=t.parent;A;t=A,A=A.parent)for(var M=0;!(A.children[M]==t);++M)O+=A.children[M].chunkSize();return O+t.first}function mr(e,t){var O=e.first;e:do{for(var A=0;A=e.first&&tO?nt(O,gt(e,O).text.length):Y(t,gt(e,t.line).text.length)}function Y(e,t){var O=e.ch;return O==null||O>t?nt(e.line,t):O<0?nt(e.line,0):e}function ee(e,t){for(var O=[],A=0;Athis.maxLookAhead&&(this.maxLookAhead=e),t},se.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}},se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},se.fromSaved=function(e,t,O){return t instanceof ye?new se(e,Xt(e.mode,t.state),O,t.lookAhead):new se(e,Xt(e.mode,t),O)},se.prototype.save=function(e){var t=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ye(t,this.maxLookAhead):t};function Pe(e,t,O,A){var M=[e.state.modeGen],$={};Tr(e,t.text,e.doc.mode,O,function(Se,De){return M.push(Se,De)},$,A);for(var le=O.state,me=function(Se){O.baseTokens=M;var De=e.state.overlays[Se],Ne=1,Ve=0;O.state=!0,Tr(e,t.text,De.mode,O,function(Ke,Qe){for(var it=Ne;VeKe&&M.splice(Ne,1,Ke,M[Ne+1],ht),Ne+=2,Ve=Math.min(Ke,ht)}if(!Qe)return;if(De.opaque)M.splice(it,Ne-it,Ke,"overlay "+Qe),Ne=it+2;else for(;ite.options.maxHighlightLength&&Xt(e.doc.mode,A.state),$=Pe(e,t,A);M&&(A.state=M),t.stateAfter=A.save(!M),t.styles=$.styles,$.classes?t.styleClasses=$.classes:t.styleClasses&&(t.styleClasses=null),O===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function mt(e,t,O){var A=e.doc,M=e.display;if(!A.mode.startState)return new se(A,!0,t);var $=_r(e,t,O),le=$>A.first&>(A,$-1).stateAfter,me=le?se.fromSaved(A,le,$):new se(A,Mt(A.mode),$);return A.iter($,t,function(ve){Tt(e,ve.text,me);var Se=me.line;ve.stateAfter=Se==t-1||Se%5==0||Se>=M.viewFrom&&Set.start)return $}throw new Error("Mode "+e.name+" failed to advance stream.")}var Zt=function(e,t,O){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=O};function Yt(e,t,O,A){var M=e.doc,$=M.mode,le;t=K(M,t);var me=gt(M,t.line),ve=mt(e,t.line,O),Se=new Pt(me.text,e.options.tabSize,ve),De;for(A&&(De=[]);(A||Se.pose.options.maxHighlightLength?(me=!1,le&&Tt(e,t,A,De.pos),De.pos=t.length,Ne=null):Ne=Cr(kt(O,De,A.state,Ve),$),Ve){var Ke=Ve[0].name;Ke&&(Ne="m-"+(Ne?Ke+" "+Ne:Ke))}if(!me||Se!=Ne){for(;vele;--me){if(me<=$.first)return $.first;var ve=gt($,me-1),Se=ve.stateAfter;if(Se&&(!O||me+(Se instanceof ye?Se.lookAhead:0)<=$.modeFrontier))return me;var De=W(ve.text,null,e.options.tabSize);(M==null||A>De)&&(M=me-1,A=De)}return M}function en(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierO;A--){var M=gt(e,A).stateAfter;if(M&&(!(M instanceof ye)||A+M.lookAhead=t:$.to>t);(A||(A=[])).push(new gn(le,$.from,ve?null:$.to))}}return A}function Or(e,t,O){var A;if(e)for(var M=0;M=t:$.to>t);if(me||$.from==t&&le.type=="bookmark"&&(!O||$.marker.insertLeft)){var ve=$.from==null||(le.inclusiveLeft?$.from<=t:$.from0&&me)for(var Ot=0;Ot0)continue;var De=[ve,1],Ne=Dt(Se.from,me.from),Ve=Dt(Se.to,me.to);(Ne<0||!le.inclusiveLeft&&!Ne)&&De.push({from:Se.from,to:me.from}),(Ve>0||!le.inclusiveRight&&!Ve)&&De.push({from:me.to,to:Se.to}),M.splice.apply(M,De),ve+=De.length-3}return M}function li(e){var t=e.markedSpans;if(!t)return;for(var O=0;Ot)&&(!A||kr(A,$.marker)<0)&&(A=$.marker)}return A}function Ir(e,t,O,A,M){var $=gt(e,t),le=gr&&$.markedSpans;if(le)for(var me=0;me=0&&Ne<=0||De<=0&&Ne>=0)continue;if(De<=0&&(ve.marker.inclusiveRight&&M.inclusiveLeft?Dt(Se.to,O)>=0:Dt(Se.to,O)>0)||De>=0&&(ve.marker.inclusiveRight&&M.inclusiveLeft?Dt(Se.from,A)<=0:Dt(Se.from,A)<0))return!0}}function Fr(e){for(var t;t=wr(e);)e=t.find(-1,!0).line;return e}function Bn(e){for(var t;t=nr(e);)e=t.find(1,!0).line;return e}function Tn(e){for(var t,O;t=nr(e);)e=t.find(1,!0).line,(O||(O=[])).push(e);return O}function ui(e,t){var O=gt(e,t),A=Fr(O);return O==A?t:Gt(A)}function Un(e,t){if(t>e.lastLine())return t;var O=gt(e,t),A;if(!_n(e,O))return t;for(;A=nr(O);)O=A.find(1,!0).line;return Gt(O)+1}function _n(e,t){var O=gr&&t.markedSpans;if(O)for(var A=void 0,M=0;Mt.maxLineLength&&(t.maxLineLength=M,t.maxLine=A)})}var Kn=function(e,t,O){this.text=e,Ln(this,t),this.height=O?O(this):1};Kn.prototype.lineNo=function(){return Gt(this)},Le(Kn);function Xi(e,t,O,A){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),li(e),Ln(e,O);var M=A?A(e):1;M!=e.height&&ar(e,M)}function Lt(e){e.parent=null,li(e)}var Ht={},Ft={};function Qt(e,t){if(!e||/^\s*$/.test(e))return null;var O=t.addModeClass?Ft:Ht;return O[e]||(O[e]=e.replace(/\S+/g,"cm-$&"))}function ct(e,t){var O=j("span",null,null,s?"padding-right: .1px":null),A={pre:j("pre",[O],"CodeMirror-line"),content:O,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var M=0;M<=(t.rest?t.rest.length:0);M++){var $=M?t.rest[M-1]:t.line,le=void 0;A.pos=0,A.addToken=ut,Et(e.display.measure)&&(le=Ge($,e.doc.direction))&&(A.addToken=Nt(A.addToken,le)),A.map=[];var me=t!=e.display.externalMeasured&&Gt($);Kt($,A,Ze(e,$,me)),$.styleClasses&&($.styleClasses.bgClass&&(A.bgClass=H($.styleClasses.bgClass,A.bgClass||"")),$.styleClasses.textClass&&(A.textClass=H($.styleClasses.textClass,A.textClass||""))),A.map.length==0&&A.map.push(0,0,A.content.appendChild(at(e.display.measure))),M==0?(t.measure.map=A.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(A.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var ve=A.content.lastChild;(/\bcm-tab\b/.test(ve.className)||ve.querySelector&&ve.querySelector(".cm-tab"))&&(A.content.className="cm-tab-wrap-hack")}return We(e,"renderLine",e,t.line,A.pre),A.pre.className&&(A.textClass=H(A.pre.className,A.textClass||"")),A}function ot(e){var t=_("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ut(e,t,O,A,M,$,le){if(!t)return;var me=e.splitSpaces?wt(t,e.trailingSpace):t,ve=e.cm.state.specialChars,Se=!1,De;if(!ve.test(t))e.col+=t.length,De=document.createTextNode(me),e.map.push(e.pos,e.pos+t.length,De),C&&h<9&&(Se=!0),e.pos+=t.length;else{De=document.createDocumentFragment();for(var Ne=0;;){ve.lastIndex=Ne;var Ve=ve.exec(t),Ke=Ve?Ve.index-Ne:t.length-Ne;if(Ke){var Qe=document.createTextNode(me.slice(Ne,Ne+Ke));C&&h<9?De.appendChild(_("span",[Qe])):De.appendChild(Qe),e.map.push(e.pos,e.pos+Ke,Qe),e.col+=Ke,e.pos+=Ke}if(!Ve)break;Ne+=Ke+1;var it=void 0;if(Ve[0]==" "){var ht=e.cm.options.tabSize,yt=ht-e.col%ht;it=De.appendChild(_("span",ae(yt),"cm-tab")),it.setAttribute("role","presentation"),it.setAttribute("cm-text"," "),e.col+=yt}else Ve[0]=="\r"||Ve[0]==` `?(it=De.appendChild(_("span",Ve[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),it.setAttribute("cm-text",Ve[0]),e.col+=1):(it=e.cm.options.specialCharPlaceholder(Ve[0]),it.setAttribute("cm-text",Ve[0]),C&&h<9?De.appendChild(_("span",[it])):De.appendChild(it),e.col+=1);e.map.push(e.pos,e.pos+1,it),e.pos++}}if(e.trailingSpace=me.charCodeAt(t.length-1)==32,O||A||M||Se||$||le){var _t=O||"";A&&(_t+=A),M&&(_t+=M);var bt=_("span",[De],_t,$);if(le)for(var Ot in le)le.hasOwnProperty(Ot)&&Ot!="style"&&Ot!="class"&&bt.setAttribute(Ot,le[Ot]);return e.content.appendChild(bt)}e.content.appendChild(De)}function wt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var O=t,A="",M=0;MSe&&Ne.from<=Se);Ve++);if(Ne.to>=De)return e(O,A,M,$,le,me,ve);e(O,A.slice(0,Ne.to-Se),M,$,null,me,ve),$=null,A=A.slice(Ne.to-Se),Se=Ne.to}}}function st(e,t,O,A){var M=!A&&O.widgetNode;M&&e.map.push(e.pos,e.pos+t,M),!A&&e.cm.display.input.needsContentAttribute&&(M||(M=e.content.appendChild(document.createElement("span"))),M.setAttribute("cm-marker",O.id)),M&&(e.cm.display.input.setUneditable(M),e.content.appendChild(M)),e.pos+=t,e.trailingSpace=!1}function Kt(e,t,O){var A=e.markedSpans,M=e.text,$=0;if(!A){for(var le=1;leve||qt.collapsed&&jt.to==ve&&jt.from==ve)){if(jt.to!=null&&jt.to!=ve&&Ke>jt.to&&(Ke=jt.to,it=""),qt.className&&(Qe+=" "+qt.className),qt.css&&(Ve=(Ve?Ve+";":"")+qt.css),qt.startStyle&&jt.from==ve&&(ht+=" "+qt.startStyle),qt.endStyle&&jt.to==Ke&&(Ot||(Ot=[])).push(qt.endStyle,jt.to),qt.title&&((_t||(_t={})).title=qt.title),qt.attributes)for(var pr in qt.attributes)(_t||(_t={}))[pr]=qt.attributes[pr];qt.collapsed&&(!yt||kr(yt.marker,qt)<0)&&(yt=jt)}else jt.from>ve&&Ke>jt.from&&(Ke=jt.from)}if(Ot)for(var Kr=0;Kr=me)break;for(var pn=Math.min(me,Ke);;){if(De){var ln=ve+De.length;if(!yt){var Mr=ln>pn?De.slice(0,pn-ve):De;t.addToken(t,Mr,Ne?Ne+Qe:Qe,ht,ve+Mr.length==Ke?it:"",Ve,_t)}if(ln>=pn){De=De.slice(pn-ve),ve=pn;break}ve=ln,ht=""}De=M.slice($,$=O[Se++]),Ne=Qt(O[Se++],t.cm.options)}}}function vt(e,t,O){this.line=t,this.rest=Tn(t),this.size=this.rest?Gt(re(this.rest))-O+1:1,this.node=this.text=null,this.hidden=_n(e,t)}function or(e,t,O){for(var A=[],M,$=t;$2&&$.push((ve.bottom+Se.top)/2-O.top)}}$.push(O.bottom-O.top)}}function _i(e,t,O){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var A=0;AO)return{map:e.measure.maps[M],cache:e.measure.caches[M],before:!0}}function Ji(e,t){t=Fr(t);var O=Gt(t),A=e.display.externalMeasured=new vt(e.doc,t,O);A.lineN=O;var M=A.built=ct(e,A);return A.text=M.pre,x(e.display.lineMeasure,M.pre),A}function Zi(e,t,O,A){return hn(e,xn(e,t),O,A)}function Ai(e,t){if(t>=e.display.viewFrom&&t=O.lineN&&tt)&&($=ve-me,M=$-1,t>=ve&&(le="right")),M!=null){if(A=e[Se+2],me==ve&&O==(A.insertLeft?"left":"right")&&(le=O),O=="left"&&M==0)for(;Se&&e[Se-2]==e[Se-3]&&e[Se-1].insertLeft;)A=e[(Se-=3)+2],le="left";if(O=="right"&&M==ve-me)for(;Se=0&&!((O=e[M]).left!=O.right);M--);return O}function xa(e,t,O,A){var M=Qn(t.map,O,A),$=M.node,le=M.start,me=M.end,ve=M.collapse,Se;if($.nodeType==3){for(var De=0;De<4;De++){for(;le&&xe(t.line.text.charAt(M.coverStart+le));)--le;for(;M.coverStart+me0&&(ve=A="right");var Ne;e.options.lineWrapping&&(Ne=$.getClientRects()).length>1?Se=Ne[A=="right"?Ne.length-1:0]:Se=$.getBoundingClientRect()}if(C&&h<9&&!le&&(!Se||!Se.left&&!Se.right)){var Ve=$.parentNode.getClientRects()[0];Ve?Se={left:Ve.left,right:Ve.left+Li(e.display),top:Ve.top,bottom:Ve.bottom}:Se=Qi}for(var Ke=Se.top-t.rect.top,Qe=Se.bottom-t.rect.top,it=(Ke+Qe)/2,ht=t.view.measure.heights,yt=0;yt=A.text.length?(ve=A.text.length,Se="before"):ve<=0&&(ve=0,Se="after"),!me)return le(Se=="before"?ve-1:ve,Se=="before");function De(Qe,it,ht){var yt=me[it],_t=yt.level==1;return le(ht?Qe-1:Qe,_t!=ht)}var Ne=Ue(me,ve,Se),Ve=He,Ke=De(ve,Ne,Se=="before");return Ve!=null&&(Ke.other=De(ve,Ve,Se!="before")),Ke}function So(e,t){var O=0;t=K(e.doc,t),e.options.lineWrapping||(O=Li(e.display)*t.ch);var A=gt(e.doc,t.line),M=vn(A)+Vn(e.display);return{left:O,right:O,top:M,bottom:M+A.height}}function Ga(e,t,O,A,M){var $=nt(e,t,O);return $.xRel=M,A&&($.outside=A),$}function za(e,t,O){var A=e.doc;if(O+=e.display.viewOffset,O<0)return Ga(A.first,0,null,-1,-1);var M=mr(A,O),$=A.first+A.size-1;if(M>$)return Ga(A.first+A.size-1,gt(A,$).text.length,null,1,1);t<0&&(t=0);for(var le=gt(A,M);;){var me=Ks(e,le,M,t,O),ve=Cn(le,me.ch+(me.xRel>0||me.outside>0?1:0));if(!ve)return me;var Se=ve.find(1);if(Se.line==M)return Se;le=gt(A,M=Se.line)}}function Co(e,t,O,A){A-=wa(t);var M=t.text.length,$=je(function(le){return hn(e,O,le-1).bottom<=A},M,0);return M=je(function(le){return hn(e,O,le).top>A},$,M),{begin:$,end:M}}function To(e,t,O,A){O||(O=xn(e,t));var M=Zr(e,t,hn(e,O,A),"line").top;return Co(e,t,O,M)}function Va(e,t,O,A){return e.bottom<=O?!1:e.top>O?!0:(A?e.left:e.right)>t}function Ks(e,t,O,A,M){M-=vn(t);var $=xn(e,t),le=wa(t),me=0,ve=t.text.length,Se=!0,De=Ge(t,e.doc.direction);if(De){var Ne=(e.options.lineWrapping?zs:Gs)(e,t,O,$,De,A,M);Se=Ne.level!=1,me=Se?Ne.from:Ne.to-1,ve=Se?Ne.to:Ne.from-1}var Ve=null,Ke=null,Qe=je(function(Ut){var jt=hn(e,$,Ut);return jt.top+=le,jt.bottom+=le,Va(jt,A,M,!1)?(jt.top<=M&&jt.left<=A&&(Ve=Ut,Ke=jt),!0):!1},me,ve),it,ht,yt=!1;if(Ke){var _t=A-Ke.left=Ot.bottom?1:0}return Qe=_e(t.text,Qe,1),Ga(O,Qe,ht,yt,A-it)}function Gs(e,t,O,A,M,$,le){var me=je(function(Ne){var Ve=M[Ne],Ke=Ve.level!=1;return Va(Nn(e,nt(O,Ke?Ve.to:Ve.from,Ke?"before":"after"),"line",t,A),$,le,!0)},0,M.length-1),ve=M[me];if(me>0){var Se=ve.level!=1,De=Nn(e,nt(O,Se?ve.from:ve.to,Se?"after":"before"),"line",t,A);Va(De,$,le,!0)&&De.top>le&&(ve=M[me-1])}return ve}function zs(e,t,O,A,M,$,le){var me=Co(e,t,A,le),ve=me.begin,Se=me.end;/\s/.test(t.text.charAt(Se-1))&&Se--;for(var De=null,Ne=null,Ve=0;Ve=Se||Ke.to<=ve)continue;var Qe=Ke.level!=1,it=hn(e,A,Qe?Math.min(Se,Ke.to)-1:Math.max(ve,Ke.from)).right,ht=it<$?$-it+1e9:it-$;(!De||Ne>ht)&&(De=Ke,Ne=ht)}return De||(De=M[M.length-1]),De.fromSe&&(De={from:De.from,to:Se,level:De.level}),De}var gi;function Ri(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(gi==null){gi=_("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)gi.appendChild(document.createTextNode("x")),gi.appendChild(_("br"));gi.appendChild(document.createTextNode("x"))}x(e.measure,gi);var O=gi.offsetHeight/50;return O>3&&(e.cachedTextHeight=O),b(e.measure),O||1}function Li(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=_("span","xxxxxxxxxx"),O=_("pre",[t],"CodeMirror-line-like");x(e.measure,O);var A=t.getBoundingClientRect(),M=(A.right-A.left)/10;return M>2&&(e.cachedCharWidth=M),M||10}function Xa(e){for(var t=e.display,O={},A={},M=t.gutters.clientLeft,$=t.gutters.firstChild,le=0;$;$=$.nextSibling,++le){var me=e.display.gutterSpecs[le].className;O[me]=$.offsetLeft+$.clientLeft+M,A[me]=$.clientWidth}return{fixedPos:Ya(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:O,gutterWidth:A,wrapperWidth:t.wrapper.clientWidth}}function Ya(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function _o(e){var t=Ri(e.display),O=e.options.lineWrapping,A=O&&Math.max(5,e.display.scroller.clientWidth/Li(e.display)-3);return function(M){if(_n(e.doc,M))return 0;var $=0;if(M.widgets)for(var le=0;le0&&(Se=gt(e.doc,ve.line).text).length==ve.ch){var De=W(Se,Se.length,e.options.tabSize)-Se.length;ve=nt(ve.line,Math.max(0,Math.round(($-kn(e.display).left)/Li(e.display))-De))}return ve}function yi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var O=e.display.view,A=0;At)&&(M.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=M.viewTo)gr&&ui(e.doc,t)M.viewFrom?ti(e):(M.viewFrom+=A,M.viewTo+=A);else if(t<=M.viewFrom&&O>=M.viewTo)ti(e);else if(t<=M.viewFrom){var $=Sa(e,O,O+A,1);$?(M.view=M.view.slice($.index),M.viewFrom=$.lineN,M.viewTo+=A):ti(e)}else if(O>=M.viewTo){var le=Sa(e,t,t,-1);le?(M.view=M.view.slice(0,le.index),M.viewTo=le.lineN):ti(e)}else{var me=Sa(e,t,t,-1),ve=Sa(e,O,O+A,1);me&&ve?(M.view=M.view.slice(0,me.index).concat(or(e,me.lineN,ve.lineN)).concat(M.view.slice(ve.index)),M.viewTo+=A):ti(e)}var Se=M.externalMeasured;Se&&(O=M.lineN&&t=A.viewTo)return;var $=A.view[yi(e,t)];if($.node==null)return;var le=$.changes||($.changes=[]);de(le,O)==-1&&le.push(O)}function ti(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Sa(e,t,O,A){var M=yi(e,t),$,le=e.display.view;if(!gr||O==e.doc.first+e.doc.size)return{index:M,lineN:O};for(var me=e.display.viewFrom,ve=0;ve0){if(M==le.length-1)return null;$=me+le[M].size-t,M++}else $=me-t;t+=$,O+=$}for(;ui(e.doc,O)!=O;){if(M==(A<0?0:le.length-1))return null;O+=A*le[M-(A<0?1:0)].size,M+=A}return{index:M,lineN:O}}function Vs(e,t,O){var A=e.display,M=A.view;M.length==0||t>=A.viewTo||O<=A.viewFrom?(A.view=or(e,t,O),A.viewFrom=t):(A.viewFrom>t?A.view=or(e,t,A.viewFrom).concat(A.view):A.viewFromO&&(A.view=A.view.slice(0,yi(e,O)))),A.viewTo=O}function Ao(e){for(var t=e.display.view,O=0,A=0;A=e.display.viewTo||me.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Pi(e),t.cursorDiv.style.visibility=(O=!O)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Do(e){e.state.focused||(e.display.input.focus(),Za(e))}function Ro(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Pi(e))},100)}function Za(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(We(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),s&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ja(e)}function Pi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(We(e,"blur",e,t),e.state.focused=!1,c(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ta(e){for(var t=e.display,O=t.lineDiv.offsetTop,A=0;A.005||De<-.005)&&(ar(M.line,le),Lo(M.line),M.rest))for(var Ne=0;Nee.display.sizerWidth){var Ve=Math.ceil(me/Li(e.display));Ve>e.display.maxLineLength&&(e.display.maxLineLength=Ve,e.display.maxLine=M.line,e.display.maxLineChanged=!0)}}}function Lo(e){if(e.widgets)for(var t=0;t=le&&($=mr(t,vn(gt(t,ve))-e.wrapper.clientHeight),le=ve)}return{from:$,to:Math.max(le,$+1)}}function Ys(e,t){if($e(e,"scrollCursorIntoView"))return;var O=e.display,A=O.sizer.getBoundingClientRect(),M=null;if(t.top+A.top<0?M=!0:t.bottom+A.top>(window.innerHeight||document.documentElement.clientHeight)&&(M=!1),M!=null&&!E){var $=_("div","\u200B",null,`position: absolute; top: `+(t.top-O.viewOffset-Vn(e.display))+`px; height: `+(t.bottom-t.top+bn(e)+O.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild($),$.scrollIntoView(M),e.display.lineSpace.removeChild($)}}function $s(e,t,O,A){A==null&&(A=0);var M;!e.options.lineWrapping&&t==O&&(t=t.ch?nt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,O=t.sticky=="before"?nt(t.line,t.ch+1,"before"):t);for(var $=0;$<5;$++){var le=!1,me=Nn(e,t),ve=!O||O==t?me:Nn(e,O);M={left:Math.min(me.left,ve.left),top:Math.min(me.top,ve.top)-A,right:Math.max(me.left,ve.left),bottom:Math.max(me.bottom,ve.bottom)+A};var Se=Qa(e,M),De=e.doc.scrollTop,Ne=e.doc.scrollLeft;if(Se.scrollTop!=null&&(ta(e,Se.scrollTop),Math.abs(e.doc.scrollTop-De)>1&&(le=!0)),Se.scrollLeft!=null&&(bi(e,Se.scrollLeft),Math.abs(e.doc.scrollLeft-Ne)>1&&(le=!0)),!le)break}return M}function Js(e,t){var O=Qa(e,t);O.scrollTop!=null&&ta(e,O.scrollTop),O.scrollLeft!=null&&bi(e,O.scrollLeft)}function Qa(e,t){var O=e.display,A=Ri(e.display);t.top<0&&(t.top=0);var M=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:O.scroller.scrollTop,$=mi(e),le={};t.bottom-t.top>$&&(t.bottom=t.top+$);var me=e.doc.height+pi(O),ve=t.topme-A;if(t.topM+$){var De=Math.min(t.top,(Se?me:t.bottom)-$);De!=M&&(le.scrollTop=De)}var Ne=e.options.fixedGutter?0:O.gutters.offsetWidth,Ve=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:O.scroller.scrollLeft-Ne,Ke=In(e)-O.gutters.offsetWidth,Qe=t.right-t.left>Ke;return Qe&&(t.right=t.left+Ke),t.left<10?le.scrollLeft=0:t.leftKe+Ve-3&&(le.scrollLeft=t.right+(Qe?0:10)-Ke),le}function qa(e,t){if(t==null)return;Aa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ii(e){Aa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ea(e,t,O){(t!=null||O!=null)&&Aa(e),t!=null&&(e.curOp.scrollLeft=t),O!=null&&(e.curOp.scrollTop=O)}function Zs(e,t){Aa(e),e.curOp.scrollToPos=t}function Aa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var O=So(e,t.from),A=So(e,t.to);Po(e,O,A,t.margin)}}function Po(e,t,O,A){var M=Qa(e,{left:Math.min(t.left,O.left),top:Math.min(t.top,O.top)-A,right:Math.max(t.right,O.right),bottom:Math.max(t.bottom,O.bottom)+A});ea(e,M.scrollLeft,M.scrollTop)}function ta(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;S||to(e,{top:t}),Io(e,t,!0),S&&to(e),ia(e,100)}function Io(e,t,O){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!O)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function bi(e,t,O,A){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(O?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!A)return;e.doc.scrollLeft=t,Bo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ra(e){var t=e.display,O=t.gutters.offsetWidth,A=Math.round(e.doc.height+pi(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?O:0,docHeight:A,scrollHeight:A+bn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:O}}var xi=function(e,t,O){this.cm=O;var A=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),M=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");A.tabIndex=M.tabIndex=-1,e(A),e(M),Re(A,"scroll",function(){A.clientHeight&&t(A.scrollTop,"vertical")}),Re(M,"scroll",function(){M.clientWidth&&t(M.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,C&&h<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,O=e.scrollHeight>e.clientHeight+1,A=e.nativeBarWidth;if(O){this.vert.style.display="block",this.vert.style.bottom=t?A+"px":"0";var M=e.viewHeight-(t?A:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+M)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=O?A+"px":"0",this.horiz.style.left=e.barLeft+"px";var $=e.viewWidth-e.barLeft-(O?A: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&&(A==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:O?A:0,bottom:t?A:0}},xi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xi.prototype.zeroWidthHack=function(){var e=o&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},xi.prototype.enableZeroWidthBar=function(e,t,O){e.style.pointerEvents="auto";function A(){var M=e.getBoundingClientRect(),$=O=="vert"?document.elementFromPoint(M.right-1,(M.top+M.bottom)/2):document.elementFromPoint((M.right+M.left)/2,M.bottom-1);$!=e?e.style.pointerEvents="none":t.set(1e3,A)}t.set(1e3,A)},xi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var na=function(){};na.prototype.update=function(){return{bottom:0,right:0}},na.prototype.setScrollLeft=function(){},na.prototype.setScrollTop=function(){},na.prototype.clear=function(){};function Mi(e,t){t||(t=ra(e));var O=e.display.barWidth,A=e.display.barHeight;Mo(e,t);for(var M=0;M<4&&O!=e.display.barWidth||A!=e.display.barHeight;M++)O!=e.display.barWidth&&e.options.lineWrapping&&Ta(e),Mo(e,ra(e)),O=e.display.barWidth,A=e.display.barHeight}function Mo(e,t){var O=e.display,A=O.scrollbars.update(t);O.sizer.style.paddingRight=(O.barWidth=A.right)+"px",O.sizer.style.paddingBottom=(O.barHeight=A.bottom)+"px",O.heightForcer.style.borderBottom=A.bottom+"px solid transparent",A.right&&A.bottom?(O.scrollbarFiller.style.display="block",O.scrollbarFiller.style.height=A.bottom+"px",O.scrollbarFiller.style.width=A.right+"px"):O.scrollbarFiller.style.display="",A.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(O.gutterFiller.style.display="block",O.gutterFiller.style.height=A.bottom+"px",O.gutterFiller.style.width=t.gutterWidth+"px"):O.gutterFiller.style.display=""}var No={native:xi,null:na};function jo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&c(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new No[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,O){O=="horizontal"?bi(e,t):ta(e,t)},e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Ei(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:++Qs},xr(e.curOp)}function wi(e){var t=e.curOp;t&&dn(t,function(O){for(var A=0;A=O.viewTo)||O.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Oa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function rl(e){e.updatedDisplay=e.mustUpdate&&eo(e.cm,e.update)}function nl(e){var t=e.cm,O=t.display;e.updatedDisplay&&Ta(t),e.barMeasure=ra(t),O.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Zi(t,O.maxLine,O.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(O.scroller.clientWidth,O.sizer.offsetLeft+e.adjustWidthTo+bn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,O.sizer.offsetLeft+e.adjustWidthTo-In(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=O.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var O=+new Date+e.options.workTime,A=mt(e,t.highlightFrontier),M=[];t.iter(A.line,Math.min(t.first+t.size,e.display.viewTo+500),function($){if(A.line>=e.display.viewFrom){var le=$.styles,me=$.text.length>e.options.maxHighlightLength?Xt(t.mode,A.state):null,ve=Pe(e,$,A,!0);me&&(A.state=me),$.styles=ve.styles;var Se=$.styleClasses,De=ve.classes;De?$.styleClasses=De:Se&&($.styleClasses=null);for(var Ne=!le||le.length!=$.styles.length||Se!=De&&(!Se||!De||Se.bgClass!=De.bgClass||Se.textClass!=De.textClass),Ve=0;!Ne&&VeO)return ia(e,e.options.workDelay),!0}),t.highlightFrontier=A.line,t.modeFrontier=Math.max(t.modeFrontier,A.line),M.length&&fn(e,function(){for(var $=0;$=O.viewFrom&&t.visible.to<=O.viewTo&&(O.updateLineNumbers==null||O.updateLineNumbers>=O.viewTo)&&O.renderedView==O.view&&Ao(e)==0)return!1;Uo(e)&&(ti(e),t.dims=Xa(e));var M=A.first+A.size,$=Math.max(t.visible.from-e.options.viewportMargin,A.first),le=Math.min(M,t.visible.to+e.options.viewportMargin);O.viewFrom<$&&$-O.viewFrom<20&&($=Math.max(A.first,O.viewFrom)),O.viewTo>le&&O.viewTo-le<20&&(le=Math.min(M,O.viewTo)),gr&&($=ui(e.doc,$),le=Un(e.doc,le));var me=$!=O.viewFrom||le!=O.viewTo||O.lastWrapHeight!=t.wrapperHeight||O.lastWrapWidth!=t.wrapperWidth;Vs(e,$,le),O.viewOffset=vn(gt(e.doc,O.viewFrom)),e.display.mover.style.top=O.viewOffset+"px";var ve=Ao(e);if(!me&&ve==0&&!t.force&&O.renderedView==O.view&&(O.updateLineNumbers==null||O.updateLineNumbers>=O.viewTo))return!1;var Se=ll(e);return ve>4&&(O.lineDiv.style.display="none"),cl(e,O.updateLineNumbers,t.dims),ve>4&&(O.lineDiv.style.display=""),O.renderedView=O.view,ul(Se),b(O.cursorDiv),b(O.selectionDiv),O.gutters.style.height=O.sizer.style.minHeight=0,me&&(O.lastWrapHeight=t.wrapperHeight,O.lastWrapWidth=t.wrapperWidth,ia(e,400)),O.updateLineNumbers=null,!0}function Fo(e,t){for(var O=t.viewport,A=!0;;A=!1){if(!A||!e.options.lineWrapping||t.oldDisplayWidth==In(e)){if(O&&O.top!=null&&(O={top:Math.min(e.doc.height+pi(e.display)-mi(e),O.top)}),t.visible=_a(e.display,e.doc,O),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else A&&(t.visible=_a(e.display,e.doc,O));if(!eo(e,t))break;Ta(e);var M=ra(e);qi(e),Mi(e,M),no(e,M),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 to(e,t){var O=new Oa(e,t);if(eo(e,O)){Ta(e),Fo(e,O);var A=ra(e);qi(e),Mi(e,A),no(e,A),O.finish()}}function cl(e,t,O){var A=e.display,M=e.options.lineNumbers,$=A.lineDiv,le=$.firstChild;function me(Qe){var it=Qe.nextSibling;return s&&o&&e.display.currentWheelTarget==Qe?Qe.style.display="none":Qe.parentNode.removeChild(Qe),it}for(var ve=A.view,Se=A.viewFrom,De=0;De-1&&(Ke=!1),Pn(e,Ne,Se,O)),Ke&&(b(Ne.lineNumber),Ne.lineNumber.appendChild(document.createTextNode(Ur(e.options,Se)))),le=Ne.node.nextSibling}Se+=Ne.size}for(;le;)le=me(le)}function ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function no(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+bn(e)+"px"}function Bo(e){var t=e.display,O=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var A=Ya(t)-t.scroller.scrollLeft+e.doc.scrollLeft,M=t.gutters.offsetWidth,$=A+"px",le=0;lele.clientWidth,ve=le.scrollHeight>le.clientHeight;if(!(A&&me||M&&ve))return;if(M&&o&&s){e:for(var Se=t.target,De=$.view;Se!=le;Se=Se.parentNode)for(var Ne=0;Ne=0&&Dt(e,A.to())<=0)return O}return-1};var lr=function(e,t){this.anchor=e,this.head=t};lr.prototype.from=function(){return Yr(this.anchor,this.head)},lr.prototype.to=function(){return Xr(this.anchor,this.head)},lr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function jn(e,t,O){var A=e&&e.options.selectionsMayTouch,M=t[O];t.sort(function(Ve,Ke){return Dt(Ve.from(),Ke.from())}),O=de(t,M);for(var $=1;$0:ve>=0){var Se=Yr(me.from(),le.from()),De=Xr(me.to(),le.to()),Ne=me.empty()?le.from()==le.head:me.from()==me.head;$<=O&&--O,t.splice(--$,2,new lr(Ne?De:Se,Ne?Se:De))}}return new Sn(t,O)}function ri(e,t){return new Sn([new lr(e,t||e)],0)}function ni(e){return e.text?nt(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Go(e,t){if(Dt(e,t.from)<0)return e;if(Dt(e,t.to)<=0)return ni(t);var O=e.line+t.text.length-(t.to.line-t.from.line)-1,A=e.ch;return e.line==t.to.line&&(A+=ni(t).ch-t.to.ch),nt(O,A)}function ao(e,t){for(var O=[],A=0;A1&&e.remove(me.line+1,Qe-1),e.insert(me.line+1,yt)}sr(e,"change",e,t)}function ii(e,t,O){function A(M,$,le){if(M.linked)for(var me=0;me1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Jo(e,t,O,A){var M=e.history;M.undone.length=0;var $=+new Date,le,me;if((M.lastOp==A||M.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&M.lastModTime>$-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(le=ml(M,M.lastOp==A)))me=re(le.changes),Dt(t.from,t.to)==0&&Dt(t.from,me.to)==0?me.to=ni(t):le.changes.push(lo(e,t));else{var ve=re(M.done);for((!ve||!ve.ranges)&&Ra(e.sel,M.done),le={changes:[lo(e,t)],generation:M.generation},M.done.push(le);M.done.length>M.undoDepth;)M.done.shift(),M.done[0].ranges||M.done.shift()}M.done.push(O),M.generation=++M.maxGeneration,M.lastModTime=M.lastSelTime=$,M.lastOp=M.lastSelOp=A,M.lastOrigin=M.lastSelOrigin=t.origin,me||We(e,"historyAdded")}function gl(e,t,O,A){var M=t.charAt(0);return M=="*"||M=="+"&&O.ranges.length==A.ranges.length&&O.somethingSelected()==A.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,O,A){var M=e.history,$=A&&A.origin;O==M.lastSelOp||$&&M.lastSelOrigin==$&&(M.lastModTime==M.lastSelTime&&M.lastOrigin==$||gl(e,$,re(M.done),t))?M.done[M.done.length-1]=t:Ra(t,M.done),M.lastSelTime=+new Date,M.lastSelOrigin=$,M.lastSelOp=O,A&&A.clearRedo!==!1&&$o(M.undone)}function Ra(e,t){var O=re(t);O&&O.ranges&&O.equals(e)||t.push(e)}function Zo(e,t,O,A){var M=t["spans_"+e.id],$=0;e.iter(Math.max(e.first,O),Math.min(e.first+e.size,A),function(le){le.markedSpans&&((M||(M=t["spans_"+e.id]={}))[$]=le.markedSpans),++$})}function yl(e){if(!e)return null;for(var t,O=0;O-1&&(re(me)[Ne]=Se[Ne],delete Se[Ne]))}}return A}function uo(e,t,O,A){if(A){var M=e.anchor;if(O){var $=Dt(t,M)<0;$!=Dt(O,M)<0?(M=t,t=O):$!=Dt(t,O)<0&&(t=O)}return new lr(M,t)}else return new lr(O||t,t)}function La(e,t,O,A,M){M==null&&(M=e.cm&&(e.cm.display.shift||e.extend)),Qr(e,new Sn([uo(e.sel.primary(),t,O,M)],0),A)}function qo(e,t,O){for(var A=[],M=e.cm&&(e.cm.display.shift||e.extend),$=0;$=t.ch:me.to>t.ch))){if(M&&(We(ve,"beforeCursorEnter"),ve.explicitlyCleared))if($.markedSpans){--le;continue}else break;if(!ve.atomic)continue;if(O){var Ne=ve.find(A<0?1:-1),Ve=void 0;if((A<0?De:Se)&&(Ne=as(e,Ne,-A,Ne&&Ne.line==t.line?$:null)),Ne&&Ne.line==t.line&&(Ve=Dt(Ne,O))&&(A<0?Ve<0:Ve>0))return ji(e,Ne,t,A,M)}var Ke=ve.find(A<0?-1:1);return(A<0?Se:De)&&(Ke=as(e,Ke,A,Ke.line==t.line?$:null)),Ke?ji(e,Ke,t,A,M):null}}return t}function Ia(e,t,O,A,M){var $=A||1,le=ji(e,t,O,$,M)||!M&&ji(e,t,O,$,!0)||ji(e,t,O,-$,M)||!M&&ji(e,t,O,-$,!0);return le||(e.cantEdit=!0,nt(e.first,0))}function as(e,t,O,A){return O<0&&t.ch==0?t.line>e.first?K(e,nt(t.line-1)):null:O>0&&t.ch==(A||gt(e,t.line)).text.length?t.line=0;--M)ls(e,{from:A[M].from,to:A[M].to,text:M?[""]:t.text,origin:t.origin});else ls(e,t)}function ls(e,t){if(t.text.length==1&&t.text[0]==""&&Dt(t.from,t.to)==0)return;var O=ao(e,t);Jo(e,t,O,e.cm?e.cm.curOp.id:NaN),sa(e,t,O,Jr(e,t));var A=[];ii(e,function(M,$){!$&&de(A,M.history)==-1&&(hs(M.history,t),A.push(M.history)),sa(M,t,null,Jr(M,t))})}function Ma(e,t,O){var A=e.cm&&e.cm.state.suppressEdits;if(A&&!O)return;for(var M=e.history,$,le=e.sel,me=t=="undo"?M.done:M.undone,ve=t=="undo"?M.undone:M.done,Se=0;Se=0;--Ke){var Qe=Ve(Ke);if(Qe)return Qe.v}}function us(e,t){if(t==0)return;if(e.first+=t,e.sel=new Sn(he(e.sel.ranges,function(M){return new lr(nt(M.anchor.line+t,M.anchor.ch),nt(M.head.line+t,M.head.ch))}),e.sel.primIndex),e.cm){on(e.cm,e.first,e.first-t,t);for(var O=e.cm.display,A=O.viewFrom;Ae.lastLine())return;if(t.from.line$&&(t={from:t.from,to:nt($,gt(e,$).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Bt(e,t.from,t.to),O||(O=ao(e,t)),e.cm?El(e.cm,t,A):so(e,t,A),Pa(e,O,Ce),e.cantEdit&&Ia(e,nt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,O){var A=e.doc,M=e.display,$=t.from,le=t.to,me=!1,ve=$.line;e.options.lineWrapping||(ve=Gt(Fr(gt(A,$.line))),A.iter(ve,le.line+1,function(Ke){if(Ke==M.maxLine)return me=!0,!0})),A.sel.contains(t.from,t.to)>-1&&Ie(e),so(A,t,O,_o(e)),e.options.lineWrapping||(A.iter(ve,$.line+t.text.length,function(Ke){var Qe=di(Ke);Qe>M.maxLineLength&&(M.maxLine=Ke,M.maxLineLength=Qe,M.maxLineChanged=!0,me=!1)}),me&&(e.curOp.updateMaxLine=!0)),en(A,$.line),ia(e,400);var Se=t.text.length-(le.line-$.line)-1;t.full?on(e):$.line==le.line&&t.text.length==1&&!Vo(e.doc,t)?ei(e,$.line,"text"):on(e,$.line,le.line+1,Se);var De=Oe(e,"changes"),Ne=Oe(e,"change");if(Ne||De){var Ve={from:$,to:le,text:t.text,removed:t.removed,origin:t.origin};Ne&&sr(e,"change",e,Ve),De&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ve)}e.display.selForContextMenu=null}function Bi(e,t,O,A,M){var $;A||(A=O),Dt(A,O)<0&&($=[A,O],O=$[0],A=$[1]),typeof t=="string"&&(t=e.splitLines(t)),Fi(e,{from:O,to:A,text:t,origin:M})}function cs(e,t,O,A){O1||!(this.children[0]instanceof ua))){var me=[];this.collapse(me),this.children=[new ua(me)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var le=M.lines.length%25+25,me=le;me10);e.parent.maybeSpill()},iterN:function(e,t,O){for(var A=0;Ae.display.maxLineLength&&(e.display.maxLine=Se,e.display.maxLineLength=De,e.display.maxLineChanged=!0)}A!=null&&e&&this.collapsed&&on(e,A,M+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ns(e.doc)),e&&sr(e,"markerCleared",e,this,A,M),t&&wi(e),this.parent&&this.parent.clear()},ai.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var O,A,M=0;M0||le==0&&$.clearWhenEmpty!==!1)return $;if($.replacedWith&&($.collapsed=!0,$.widgetNode=j("span",[$.replacedWith],"CodeMirror-widget"),A.handleMouseEvents||$.widgetNode.setAttribute("cm-ignore-events","true"),A.insertLeft&&($.widgetNode.insertLeft=!0)),$.collapsed){if(Ir(e,t.line,t,O,$)||t.line!=O.line&&Ir(e,O.line,t,O,$))throw new Error("Inserting collapsed marker partially overlapping an existing one");mn()}$.addToHistory&&Jo(e,{from:t,to:O,origin:"markText"},e.sel,NaN);var me=t.line,ve=e.cm,Se;if(e.iter(me,O.line+1,function(Ne){ve&&$.collapsed&&!ve.options.lineWrapping&&Fr(Ne)==ve.display.maxLine&&(Se=!0),$.collapsed&&me!=t.line&&ar(Ne,0),rr(Ne,new gn($,me==t.line?t.ch:null,me==O.line?O.ch:null)),++me}),$.collapsed&&e.iter(t.line,O.line+1,function(Ne){_n(e,Ne)&&ar(Ne,0)}),$.clearOnEnter&&Re($,"beforeCursorEnter",function(){return $.clear()}),$.readOnly&&($r(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),$.collapsed&&($.id=++ps,$.atomic=!0),ve){if(Se&&(ve.curOp.updateMaxLine=!0),$.collapsed)on(ve,t.line,O.line+1);else if($.className||$.startStyle||$.endStyle||$.css||$.attributes||$.title)for(var De=t.line;De<=O.line;De++)ei(ve,De,"text");$.atomic&&ns(ve.doc),sr(ve,"markerAdded",ve,$)}return $}var ha=function(e,t){this.markers=e,this.primary=t;for(var O=0;O=0;ve--)Fi(this,A[ve]);me?ts(this,me):this.cm&&Ii(this.cm)}),undo:Hr(function(){Ma(this,"undo")}),redo:Hr(function(){Ma(this,"redo")}),undoSelection:Hr(function(){Ma(this,"undo",!0)}),redoSelection:Hr(function(){Ma(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,O=0,A=0;A=e.ch)&&t.push(M.marker.parent||M.marker)}return t},findMarks:function(e,t,O){e=K(this,e),t=K(this,t);var A=[],M=e.line;return this.iter(e.line,t.line+1,function($){var le=$.markedSpans;if(le)for(var me=0;me=ve.to||ve.from==null&&M!=e.line||ve.from!=null&&M==t.line&&ve.from>=t.ch)&&(!O||O(ve.marker))&&A.push(ve.marker.parent||ve.marker)}++M}),A},getAllMarks:function(){var e=[];return this.iter(function(t){var O=t.markedSpans;if(O)for(var A=0;Ae)return t=e,!0;e-=$,++O}),K(this,nt(O,t))},indexFromPos:function(e){e=K(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var De=e.dataTransfer.getData("Text");if(De){var Ne;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ne=t.listSelections()),Pa(t.doc,ri(O,O)),Ne)for(var Ve=0;Ve=0;me--)Bi(e.doc,"",A[me].from,A[me].to,"+delete");Ii(e)})}function ho(e,t,O){var A=_e(e.text,t+O,O);return A<0||A>e.text.length?null:A}function fo(e,t,O){var A=ho(e,t.ch,O);return A==null?null:new nt(t.line,A,O<0?"after":"before")}function po(e,t,O,A,M){if(e){t.doc.direction=="rtl"&&(M=-M);var $=Ge(O,t.doc.direction);if($){var le=M<0?re($):$[0],me=M<0==(le.level==1),ve=me?"after":"before",Se;if(le.level>0||t.doc.direction=="rtl"){var De=xn(t,O);Se=M<0?O.text.length-1:0;var Ne=hn(t,De,Se).top;Se=je(function(Ve){return hn(t,De,Ve).top==Ne},M<0==(le.level==1)?le.from:le.to-1,Se),ve=="before"&&(Se=ho(O,Se,1))}else Se=M<0?le.to:le.from;return new nt(A,Se,ve)}}return new nt(A,M<0?O.text.length:0,M<0?"before":"after")}function Ml(e,t,O,A){var M=Ge(t,e.doc.direction);if(!M)return fo(t,O,A);O.ch>=t.text.length?(O.ch=t.text.length,O.sticky="before"):O.ch<=0&&(O.ch=0,O.sticky="after");var $=Ue(M,O.ch,O.sticky),le=M[$];if(e.doc.direction=="ltr"&&le.level%2==0&&(A>0?le.to>O.ch:le.from=le.from&&Ve>=De.begin)){var Ke=Ne?"before":"after";return new nt(O.line,Ve,Ke)}}var Qe=function(yt,_t,bt){for(var Ot=function(pr,Kr){return Kr?new nt(O.line,me(pr,1),"before"):new nt(O.line,pr,"after")};yt>=0&&yt0==(Ut.level!=1),qt=jt?bt.begin:me(bt.end,-1);if(Ut.from<=qt&&qt0?De.end:me(De.begin,-1);return ht!=null&&!(A>0&&ht==t.text.length)&&(it=Qe(A>0?0:M.length-1,A,Se(ht)),it)?it:null}var ma={selectAll:os,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return Hi(e,function(t){if(t.empty()){var O=gt(e.doc,t.head.line).text.length;return t.head.ch==O&&t.head.line0)M=new nt(M.line,M.ch+1),e.replaceRange($.charAt(M.ch-1)+$.charAt(M.ch-2),nt(M.line,M.ch-2),M,"+transpose");else if(M.line>e.doc.first){var le=gt(e.doc,M.line-1).text;le&&(M=new nt(M.line,1),e.replaceRange($.charAt(0)+e.doc.lineSeparator()+le.charAt(le.length-1),nt(M.line-1,le.length-1),M,"+transpose"))}}O.push(new lr(M,M))}e.setSelections(O)})},newlineAndIndent:function(e){return fn(e,function(){for(var t=e.listSelections(),O=t.length-1;O>=0;O--)e.replaceRange(e.doc.lineSeparator(),t[O].anchor,t[O].head,"+input");t=e.listSelections();for(var A=0;Ae&&Dt(t,this.pos)==0&&O==this.button};var va,ya;function Hl(e,t){var O=+new Date;return ya&&ya.compare(O,e,t)?(va=ya=null,"triple"):va&&va.compare(O,e,t)?(ya=new go(O,e,t),va=null,"double"):(va=new go(O,e,t),ya=null,"single")}function Ds(e){var t=this,O=t.display;if($e(t,e)||O.activeTouch&&O.input.supportsTouch())return;if(O.input.ensurePolled(),O.shift=e.shiftKey,cr(O,e)){s||(O.scroller.draggable=!1,setTimeout(function(){return O.scroller.draggable=!0},100));return}if(vo(t,e))return;var A=vi(t,e),M=Xe(e),$=A?Hl(A,M):"single";if(window.focus(),M==1&&t.state.selectingText&&t.state.selectingText(e),A&&Kl(t,M,A,$,e))return;M==1?A?zl(t,A,$,e):Fe(e)==O.scroller&&Te(e):M==2?(A&&La(t.doc,A),setTimeout(function(){return O.input.focus()},20)):M==3&&(D?t.display.input.onContextMenu(e):Ro(t))}function Kl(e,t,O,A,M){var $="Click";return A=="double"?$="Double"+$:A=="triple"&&($="Triple"+$),$=(t==1?"Left":t==2?"Middle":"Right")+$,ga(e,Es($,M),M,function(le){if(typeof le=="string"&&(le=ma[le]),!le)return!1;var me=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),me=le(e,O)!=be}finally{e.state.suppressEdits=!1}return me})}function Gl(e,t,O){var A=e.getOption("configureMouse"),M=A?A(e,t,O):{};if(M.unit==null){var $=u?O.shiftKey&&O.metaKey:O.altKey;M.unit=$?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(M.extend==null||e.doc.extend)&&(M.extend=e.doc.extend||O.shiftKey),M.addNew==null&&(M.addNew=o?O.metaKey:O.ctrlKey),M.moveOnDrag==null&&(M.moveOnDrag=!(o?O.altKey:O.ctrlKey)),M}function zl(e,t,O,A){C?setTimeout(U(Do,e),0):e.curOp.focus=X();var M=Gl(e,O,A),$=e.doc.sel,le;e.options.dragDrop&&qe&&!e.isReadOnly()&&O=="single"&&(le=$.contains(t))>-1&&(Dt((le=$.ranges[le]).from(),t)<0||t.xRel>0)&&(Dt(le.to(),t)>0||t.xRel<0)?Vl(e,A,t,M):Xl(e,A,t,M)}function Vl(e,t,O,A){var M=e.display,$=!1,le=Wr(e,function(Se){s&&(M.scroller.draggable=!1),e.state.draggingText=!1,rt(M.wrapper.ownerDocument,"mouseup",le),rt(M.wrapper.ownerDocument,"mousemove",me),rt(M.scroller,"dragstart",ve),rt(M.scroller,"drop",le),$||(Te(Se),A.addNew||La(e.doc,O,null,null,A.extend),s&&!p||C&&h==9?setTimeout(function(){M.wrapper.ownerDocument.body.focus({preventScroll:!0}),M.input.focus()},20):M.input.focus())}),me=function(Se){$=$||Math.abs(t.clientX-Se.clientX)+Math.abs(t.clientY-Se.clientY)>=10},ve=function(){return $=!0};s&&(M.scroller.draggable=!0),e.state.draggingText=le,le.copy=!A.moveOnDrag,M.scroller.dragDrop&&M.scroller.dragDrop(),Re(M.wrapper.ownerDocument,"mouseup",le),Re(M.wrapper.ownerDocument,"mousemove",me),Re(M.scroller,"dragstart",ve),Re(M.scroller,"drop",le),Ro(e),setTimeout(function(){return M.input.focus()},20)}function Rs(e,t,O){if(O=="char")return new lr(t,t);if(O=="word")return e.findWordAt(t);if(O=="line")return new lr(nt(t.line,0),K(e.doc,nt(t.line+1,0)));var A=O(e,t);return new lr(A.from,A.to)}function Xl(e,t,O,A){var M=e.display,$=e.doc;Te(t);var le,me,ve=$.sel,Se=ve.ranges;if(A.addNew&&!A.extend?(me=$.sel.contains(O),me>-1?le=Se[me]:le=new lr(O,O)):(le=$.sel.primary(),me=$.sel.primIndex),A.unit=="rectangle")A.addNew||(le=new lr(O,O)),O=vi(e,t,!0,!0),me=-1;else{var De=Rs(e,O,A.unit);A.extend?le=uo(le,De.anchor,De.head,A.extend):le=De}A.addNew?me==-1?(me=Se.length,Qr($,jn(e,Se.concat([le]),me),{scroll:!1,origin:"*mouse"})):Se.length>1&&Se[me].empty()&&A.unit=="char"&&!A.extend?(Qr($,jn(e,Se.slice(0,me).concat(Se.slice(me+1)),0),{scroll:!1,origin:"*mouse"}),ve=$.sel):co($,me,le,ue):(me=0,Qr($,new Sn([le],0),ue),ve=$.sel);var Ne=O;function Ve(bt){if(Dt(Ne,bt)==0)return;if(Ne=bt,A.unit=="rectangle"){for(var Ot=[],Ut=e.options.tabSize,jt=W(gt($,O.line).text,O.ch,Ut),qt=W(gt($,bt.line).text,bt.ch,Ut),pr=Math.min(jt,qt),Kr=Math.max(jt,qt),Er=Math.min(O.line,bt.line),pn=Math.min(e.lastLine(),Math.max(O.line,bt.line));Er<=pn;Er++){var ln=gt($,Er).text,Mr=pe(ln,pr,Ut);pr==Kr?Ot.push(new lr(nt(Er,Mr),nt(Er,Mr))):ln.length>Mr&&Ot.push(new lr(nt(Er,Mr),nt(Er,pe(ln,Kr,Ut))))}Ot.length||Ot.push(new lr(O,O)),Qr($,jn(e,ve.ranges.slice(0,me).concat(Ot),me),{origin:"*mouse",scroll:!1}),e.scrollIntoView(bt)}else{var un=le,Vr=Rs(e,bt,A.unit),Br=un.anchor,Nr;Dt(Vr.anchor,Br)>0?(Nr=Vr.head,Br=Yr(un.from(),Vr.anchor)):(Nr=Vr.anchor,Br=Xr(un.to(),Vr.head));var Sr=ve.ranges.slice(0);Sr[me]=Yl(e,new lr(K($,Br),Nr)),Qr($,jn(e,Sr,me),ue)}}var Ke=M.wrapper.getBoundingClientRect(),Qe=0;function it(bt){var Ot=++Qe,Ut=vi(e,bt,!0,A.unit=="rectangle");if(!Ut)return;if(Dt(Ut,Ne)!=0){e.curOp.focus=X(),Ve(Ut);var jt=_a(M,$);(Ut.line>=jt.to||Ut.lineKe.bottom?20:0;qt&&setTimeout(Wr(e,function(){if(Qe!=Ot)return;M.scroller.scrollTop+=qt,it(bt)}),50)}}function ht(bt){e.state.selectingText=!1,Qe=Infinity,bt&&(Te(bt),M.input.focus()),rt(M.wrapper.ownerDocument,"mousemove",yt),rt(M.wrapper.ownerDocument,"mouseup",_t),$.history.lastSelOrigin=null}var yt=Wr(e,function(bt){bt.buttons===0||!Xe(bt)?ht(bt):it(bt)}),_t=Wr(e,ht);e.state.selectingText=_t,Re(M.wrapper.ownerDocument,"mousemove",yt),Re(M.wrapper.ownerDocument,"mouseup",_t)}function Yl(e,t){var O=t.anchor,A=t.head,M=gt(e.doc,O.line);if(Dt(O,A)==0&&O.sticky==A.sticky)return t;var $=Ge(M);if(!$)return t;var le=Ue($,O.ch,O.sticky),me=$[le];if(me.from!=O.ch&&me.to!=O.ch)return t;var ve=le+(me.from==O.ch==(me.level!=1)?0:1);if(ve==0||ve==$.length)return t;var Se;if(A.line!=O.line)Se=(A.line-O.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var De=Ue($,A.ch,A.sticky),Ne=De-le||(A.ch-O.ch)*(me.level==1?-1:1);De==ve-1||De==ve?Se=Ne<0:Se=Ne>0}var Ve=$[ve+(Se?-1:0)],Ke=Se==(Ve.level==1),Qe=Ke?Ve.from:Ve.to,it=Ke?"after":"before";return O.ch==Qe&&O.sticky==it?t:new lr(new nt(O.line,Qe,it),A)}function Ls(e,t,O,A){var M,$;if(t.touches)M=t.touches[0].clientX,$=t.touches[0].clientY;else try{M=t.clientX,$=t.clientY}catch(Ve){return!1}if(M>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;A&&Te(t);var le=e.display,me=le.lineDiv.getBoundingClientRect();if($>me.bottom||!Oe(e,O))return ke(t);$-=me.top-le.viewOffset;for(var ve=0;ve=M){var De=mr(e.doc,$),Ne=e.display.gutterSpecs[ve];return We(e,O,e,De,Ne.className,t),ke(t)}}}function vo(e,t){return Ls(e,t,"gutterClick",!0)}function Ps(e,t){if(cr(e.display,t)||$l(e,t))return;if($e(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function $l(e,t){return Oe(e,"gutterContextMenu")?Ls(e,t,"gutterContextMenu",!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qn(e)}var Ki={toString:function(){return"CodeMirror.Init"}},Ms={},Ba={};function Jl(e){var t=e.optionHandlers;function O(A,M,$,le){e.defaults[A]=M,$&&(t[A]=le?function(me,ve,Se){Se!=Ki&&$(me,ve,Se)}:$)}e.defineOption=O,e.Init=Ki,O("value","",function(A,M){return A.setValue(M)},!0),O("mode",null,function(A,M){A.doc.modeOption=M,oo(A)},!0),O("indentUnit",2,oo,!0),O("indentWithTabs",!1),O("smartIndent",!0),O("tabSize",4,function(A){oa(A),qn(A),on(A)},!0),O("lineSeparator",null,function(A,M){if(A.doc.lineSep=M,!M)return;var $=[],le=A.doc.first;A.doc.iter(function(ve){for(var Se=0;;){var De=ve.text.indexOf(M,Se);if(De==-1)break;Se=De+M.length,$.push(nt(le,De))}le++});for(var me=$.length-1;me>=0;me--)Bi(A.doc,M,$[me],nt($[me].line,$[me].ch+M.length))}),O("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(A,M,$){A.state.specialChars=new RegExp(M.source+(M.test(" ")?"":"| "),"g"),$!=Ki&&A.refresh()}),O("specialCharPlaceholder",ot,function(A){return A.refresh()},!0),O("electricChars",!0),O("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),O("spellcheck",!1,function(A,M){return A.getInputField().spellcheck=M},!0),O("autocorrect",!1,function(A,M){return A.getInputField().autocorrect=M},!0),O("autocapitalize",!1,function(A,M){return A.getInputField().autocapitalize=M},!0),O("rtlMoveVisually",!w),O("wholeLineUpdateBefore",!0),O("theme","default",function(A){Is(A),aa(A)},!0),O("keyMap","default",function(A,M,$){var le=ja(M),me=$!=Ki&&ja($);me&&me.detach&&me.detach(A,le),le.attach&&le.attach(A,me||null)}),O("extraKeys",null),O("configureMouse",null),O("lineWrapping",!1,Ql,!0),O("gutters",[],function(A,M){A.display.gutterSpecs=io(M,A.options.lineNumbers),aa(A)},!0),O("fixedGutter",!0,function(A,M){A.display.gutters.style.left=M?Ya(A.display)+"px":"0",A.refresh()},!0),O("coverGutterNextToScrollbar",!1,function(A){return Mi(A)},!0),O("scrollbarStyle","native",function(A){jo(A),Mi(A),A.display.scrollbars.setScrollTop(A.doc.scrollTop),A.display.scrollbars.setScrollLeft(A.doc.scrollLeft)},!0),O("lineNumbers",!1,function(A,M){A.display.gutterSpecs=io(A.options.gutters,M),aa(A)},!0),O("firstLineNumber",1,aa,!0),O("lineNumberFormatter",function(A){return A},aa,!0),O("showCursorWhenSelecting",!1,qi,!0),O("resetSelectionOnContextMenu",!0),O("lineWiseCopyCut",!0),O("pasteLinesPerSelection",!0),O("selectionsMayTouch",!1),O("readOnly",!1,function(A,M){M=="nocursor"&&(Pi(A),A.display.input.blur()),A.display.input.readOnlyChanged(M)}),O("screenReaderLabel",null,function(A,M){M=M===""?null:M,A.display.input.screenReaderLabelChanged(M)}),O("disableInput",!1,function(A,M){M||A.display.input.reset()},!0),O("dragDrop",!0,Zl),O("allowDropFileTypes",null),O("cursorBlinkRate",530),O("cursorScrollMargin",0),O("cursorHeight",1,qi,!0),O("singleCursorHeightPerLine",!0,qi,!0),O("workTime",100),O("workDelay",100),O("flattenSpans",!0,oa,!0),O("addModeClass",!1,oa,!0),O("pollInterval",100),O("undoDepth",200,function(A,M){return A.doc.history.undoDepth=M}),O("historyEventDelay",1250),O("viewportMargin",10,function(A){return A.refresh()},!0),O("maxHighlightLength",1e4,oa,!0),O("moveInputWithCursor",!0,function(A,M){M||A.display.input.resetPosition()}),O("tabindex",null,function(A,M){return A.display.input.getField().tabIndex=M||""}),O("autofocus",null),O("direction","ltr",function(A,M){return A.doc.setDirection(M)},!0),O("phrases",null)}function Zl(e,t,O){var A=O&&O!=Ki;if(!t!=!A){var M=e.display.dragFunctions,$=t?Re:rt;$(e.display.scroller,"dragstart",M.start),$(e.display.scroller,"dragenter",M.enter),$(e.display.scroller,"dragover",M.over),$(e.display.scroller,"dragleave",M.leave),$(e.display.scroller,"drop",M.drop)}}function Ql(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(c(e.display.wrapper,"CodeMirror-wrap"),Ti(e)),$a(e),on(e),qn(e),setTimeout(function(){return Mi(e)},100)}function yr(e,t){var O=this;if(!(this instanceof yr))return new yr(e,t);this.options=t=t?B(t):{},B(Ms,t,!1);var A=t.value;typeof A=="string"?A=new sn(A,t.mode,null,t.lineSeparator,t.direction):t.mode&&(A.modeOption=t.mode),this.doc=A;var M=new yr.inputStyles[t.inputStyle](this),$=this.display=new dl(e,A,M,t);$.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),jo(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 te,keySeq:null,specialChars:null},t.autofocus&&!n&&$.input.focus(),C&&h<11&&setTimeout(function(){return O.display.input.reset(!0)},20),ql(this),Dl(),Ei(this),this.curOp.forceUpdate=!0,Xo(this,A),t.autofocus&&!n||this.hasFocus()?setTimeout(function(){O.hasFocus()&&!O.state.focused&&Za(O)},20):Pi(this);for(var le in Ba)Ba.hasOwnProperty(le)&&Ba[le](this,t[le],Ki);Uo(this),t.finishInit&&t.finishInit(this);for(var me=0;me20*20}Re(t.scroller,"touchstart",function(ve){if(!$e(e,ve)&&!$(ve)&&!vo(e,ve)){t.input.ensurePolled(),clearTimeout(O);var Se=+new Date;t.activeTouch={start:Se,moved:!1,prev:Se-A.end<=300?A:null},ve.touches.length==1&&(t.activeTouch.left=ve.touches[0].pageX,t.activeTouch.top=ve.touches[0].pageY)}}),Re(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Re(t.scroller,"touchend",function(ve){var Se=t.activeTouch;if(Se&&!cr(t,ve)&&Se.left!=null&&!Se.moved&&new Date-Se.start<300){var De=e.coordsChar(t.activeTouch,"page"),Ne;!Se.prev||le(Se,Se.prev)?Ne=new lr(De,De):!Se.prev.prev||le(Se,Se.prev.prev)?Ne=e.findWordAt(De):Ne=new lr(nt(De.line,0),K(e.doc,nt(De.line+1,0))),e.setSelection(Ne.anchor,Ne.head),e.focus(),Te(ve)}M()}),Re(t.scroller,"touchcancel",M),Re(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ta(e,t.scroller.scrollTop),bi(e,t.scroller.scrollLeft,!0),We(e,"scroll",e))}),Re(t.scroller,"mousewheel",function(ve){return Ko(e,ve)}),Re(t.scroller,"DOMMouseScroll",function(ve){return Ko(e,ve)}),Re(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ve){$e(e,ve)||Me(ve)},over:function(ve){$e(e,ve)||(kl(e,ve),Me(ve))},start:function(ve){return Ol(e,ve)},drop:Wr(e,Al),leave:function(ve){$e(e,ve)||vs(e)}};var me=t.input.getField();Re(me,"keyup",function(ve){return Os.call(e,ve)}),Re(me,"keydown",Wr(e,As)),Re(me,"keypress",Wr(e,ks)),Re(me,"focus",function(ve){return Za(e,ve)}),Re(me,"blur",function(ve){return Pi(e,ve)})}var yo=[];yr.defineInitHook=function(e){return yo.push(e)};function ba(e,t,O,A){var M=e.doc,$;O==null&&(O="add"),O=="smart"&&(M.mode.indent?$=mt(e,t).state:O="prev");var le=e.options.tabSize,me=gt(M,t),ve=W(me.text,null,le);me.stateAfter&&(me.stateAfter=null);var Se=me.text.match(/^\s*/)[0],De;if(!A&&!/\S/.test(me.text))De=0,O="not";else if(O=="smart"&&(De=M.mode.indent($,me.text.slice(Se.length),me.text),De==be||De>150)){if(!A)return;O="prev"}O=="prev"?t>M.first?De=W(gt(M,t-1).text,null,le):De=0:O=="add"?De=ve+e.options.indentUnit:O=="subtract"?De=ve-e.options.indentUnit:typeof O=="number"&&(De=ve+O),De=Math.max(0,De);var Ne="",Ve=0;if(e.options.indentWithTabs)for(var Ke=Math.floor(De/le);Ke;--Ke)Ve+=le,Ne+=" ";if(Vele,ve=xt(t),Se=null;if(me&&A.ranges.length>1)if(Fn&&Fn.text.join(` `)==t){if(A.ranges.length%Fn.text.length==0){Se=[];for(var De=0;De=0;Ve--){var Ke=A.ranges[Ve],Qe=Ke.from(),it=Ke.to();Ke.empty()&&(O&&O>0?Qe=nt(Qe.line,Qe.ch-O):e.state.overwrite&&!me?it=nt(it.line,Math.min(gt($,it.line).text.length,it.ch+re(ve).length)):me&&Fn&&Fn.lineWise&&Fn.text.join(` `)==ve.join(` `)&&(Qe=it=nt(Qe.line,0)));var ht={from:Qe,to:it,text:Se?Se[Ve%Se.length]:ve,origin:M||(me?"paste":e.state.cutIncoming>le?"cut":"+input")};Fi(e.doc,ht),sr(e,"inputRead",e,ht)}t&&!me&&js(e,t),Ii(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ne),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ns(e,t){var O=e.clipboardData&&e.clipboardData.getData("Text");if(O)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&fn(t,function(){return bo(t,O,0,null,"paste")}),!0}function js(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var O=e.doc.sel,A=O.ranges.length-1;A>=0;A--){var M=O.ranges[A];if(M.head.ch>100||A&&O.ranges[A-1].head.line==M.head.line)continue;var $=e.getModeAt(M.head),le=!1;if($.electricChars){for(var me=0;me<$.electricChars.length;me++)if(t.indexOf($.electricChars.charAt(me))>-1){le=ba(e,M.head.line,"smart");break}}else $.electricInput&&($.electricInput.test(gt(e.doc,M.head.line).text.slice(0,M.head.ch))&&(le=ba(e,M.head.line,"smart")));le&&sr(e,"electricInput",e,M.head.line)}}function Fs(e){for(var t=[],O=[],A=0;A$&&(ba(this,me.head.line,A,!0),$=me.head.line,le==this.doc.sel.primIndex&&Ii(this));else{var ve=me.from(),Se=me.to(),De=Math.max($,ve.line);$=Math.min(this.lastLine(),Se.line-(Se.ch?0:1))+1;for(var Ne=De;Ne<$;++Ne)ba(this,Ne,A);var Ve=this.doc.sel.ranges;ve.ch==0&&M.length==Ve.length&&Ve[le].from().ch>0&&co(this.doc,le,new lr(ve,Ve[le].to()),Ce)}}}),getTokenAt:function(A,M){return Yt(this,A,M)},getLineTokens:function(A,M){return Yt(this,nt(A),M,!0)},getTokenTypeAt:function(A){A=K(this.doc,A);var M=Ze(this,gt(this.doc,A.line)),$=0,le=(M.length-1)/2,me=A.ch,ve;if(me==0)ve=M[2];else for(;;){var Se=$+le>>1;if((Se?M[Se*2-1]:0)>=me)le=Se;else if(M[Se*2+1]ve&&(A=ve,le=!0),me=gt(this.doc,A)}else me=A;return Zr(this,me,{top:0,left:0},M||"page",$||le).top+(le?this.doc.height-vn(me):0)},defaultTextHeight:function(){return Ri(this.display)},defaultCharWidth:function(){return Li(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(A,M,$,le,me){var ve=this.display;A=Nn(this,K(this.doc,A));var Se=A.bottom,De=A.left;if(M.style.position="absolute",M.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(M),ve.sizer.appendChild(M),le=="over")Se=A.top;else if(le=="above"||le=="near"){var Ne=Math.max(ve.wrapper.clientHeight,this.doc.height),Ve=Math.max(ve.sizer.clientWidth,ve.lineSpace.clientWidth);(le=="above"||A.bottom+M.offsetHeight>Ne)&&A.top>M.offsetHeight?Se=A.top-M.offsetHeight:A.bottom+M.offsetHeight<=Ne&&(Se=A.bottom),De+M.offsetWidth>Ve&&(De=Ve-M.offsetWidth)}M.style.top=Se+"px",M.style.left=M.style.right="",me=="right"?(De=ve.sizer.clientWidth-M.offsetWidth,M.style.right="0px"):(me=="left"?De=0:me=="middle"&&(De=(ve.sizer.clientWidth-M.offsetWidth)/2),M.style.left=De+"px"),$&&Js(this,{left:De,top:Se,right:De+M.offsetWidth,bottom:Se+M.offsetHeight})},triggerOnKeyDown:nn(As),triggerOnKeyPress:nn(ks),triggerOnKeyUp:Os,triggerOnMouseDown:nn(Ds),execCommand:function(A){if(ma.hasOwnProperty(A))return ma[A].call(null,this)},triggerElectric:nn(function(A){js(this,A)}),findPosH:function(A,M,$,le){var me=1;M<0&&(me=-1,M=-M);for(var ve=K(this.doc,A),Se=0;Se0&&De($.charAt(le-1));)--le;for(;me<$.length&&De($.charAt(me));)++me}return new lr(nt(A.line,le),nt(A.line,me))},toggleOverwrite:function(A){if(A!=null&&A==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):c(this.display.cursorDiv,"CodeMirror-overwrite"),We(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==X()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:nn(function(A,M){ea(this,A,M)}),getScrollInfo:function(){var A=this.display.scroller;return{left:A.scrollLeft,top:A.scrollTop,height:A.scrollHeight-bn(this)-this.display.barHeight,width:A.scrollWidth-bn(this)-this.display.barWidth,clientHeight:mi(this),clientWidth:In(this)}},scrollIntoView:nn(function(A,M){A==null?(A={from:this.doc.sel.primary().head,to:null},M==null&&(M=this.options.cursorScrollMargin)):typeof A=="number"?A={from:nt(A,0),to:null}:A.from==null&&(A={from:A,to:null}),A.to||(A.to=A.from),A.margin=M||0,A.from.line!=null?Zs(this,A):Po(this,A.from,A.to,A.margin)}),setSize:nn(function(A,M){var $=this,le=function(ve){return typeof ve=="number"||/^\d+$/.test(String(ve))?ve+"px":ve};A!=null&&(this.display.wrapper.style.width=le(A)),M!=null&&(this.display.wrapper.style.height=le(M)),this.options.lineWrapping&&Dn(this);var me=this.display.viewFrom;this.doc.iter(me,this.display.viewTo,function(ve){if(ve.widgets){for(var Se=0;Se.5||this.options.lineWrapping)&&$a(this),We(this,"refresh",this)}),swapDoc:nn(function(A){var M=this.doc;return M.cm=null,this.state.selectingText&&this.state.selectingText(),Xo(this,A),qn(this),this.display.input.reset(),ea(this,A.scrollLeft,A.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,M),M}),phrase:function(A){var M=this.options.phrases;return M&&Object.prototype.hasOwnProperty.call(M,A)?M[A]:A},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}},Le(e),e.registerHelper=function(A,M,$){O.hasOwnProperty(A)||(O[A]=e[A]={_global:[]}),O[A][M]=$},e.registerGlobalHelper=function(A,M,$,le){e.registerHelper(A,M,le),O[A]._global.push({pred:$,val:le})}}function xo(e,t,O,A,M){var $=t,le=O,me=gt(e,t.line),ve=M&&e.direction=="rtl"?-O:O;function Se(){var _t=t.line+ve;return _t=e.first+e.size?!1:(t=new nt(_t,t.ch,t.sticky),me=gt(e,_t))}function De(_t){var bt;if(A=="codepoint"){var Ot=me.text.charCodeAt(t.ch+(A>0?0:-1));isNaN(Ot)?bt=null:bt=new nt(t.line,Math.max(0,Math.min(me.text.length,t.ch+O*(Ot>=55296&&Ot<56320?2:1))),-O)}else M?bt=Ml(e.cm,me,t,O):bt=fo(me,t,O);if(bt==null)if(!_t&&Se())t=po(M,e.cm,me,t.line,ve);else return!1;else t=bt;return!0}if(A=="char"||A=="codepoint")De();else if(A=="column")De(!0);else if(A=="word"||A=="group")for(var Ne=null,Ve=A=="group",Ke=e.cm&&e.cm.getHelper(t,"wordChars"),Qe=!0;!(O<0&&!De(!Qe));Qe=!1){var it=me.text.charAt(t.ch)||` `,ht=V(it,Ke)?"w":Ve&&it==` `?"n":!Ve||/\s/.test(it)?null:"p";if(Ve&&!Qe&&!ht&&(ht="s"),Ne&&Ne!=ht){O<0&&(O=1,De(),t.sticky="after");break}if(ht&&(Ne=ht),O>0&&!De(!Qe))break}var yt=Ia(e,t,$,le,!0);return zr($,yt)&&(yt.hitSide=!0),yt}function Ws(e,t,O,A){var M=e.doc,$=t.left,le;if(A=="page"){var me=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ve=Math.max(me-.5*Ri(e.display),3);le=(O>0?t.bottom:t.top)+O*ve}else A=="line"&&(le=O>0?t.bottom+3:t.top-3);for(var Se;!(Se=za(e,$,le),!Se.outside);){if(O<0?le<=0:le>=M.height){Se.hitSide=!0;break}le+=O*5}return Se}var dr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};dr.prototype.init=function(e){var t=this,O=this,A=O.cm,M=O.div=e.lineDiv;Bs(M,A.options.spellcheck,A.options.autocorrect,A.options.autocapitalize);function $(me){for(var ve=me.target;ve;ve=ve.parentNode){if(ve==M)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ve.className))break}return!1}Re(M,"paste",function(me){if(!$(me)||$e(A,me)||Ns(me,A))return;h<=11&&setTimeout(Wr(A,function(){return t.updateFromDOM()}),20)}),Re(M,"compositionstart",function(me){t.composing={data:me.data,done:!1}}),Re(M,"compositionupdate",function(me){t.composing||(t.composing={data:me.data,done:!1})}),Re(M,"compositionend",function(me){t.composing&&(me.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Re(M,"touchstart",function(){return O.forceCompositionEnd()}),Re(M,"input",function(){t.composing||t.readFromDOMSoon()});function le(me){if(!$(me)||$e(A,me))return;if(A.somethingSelected())Ua({lineWise:!1,text:A.getSelections()}),me.type=="cut"&&A.replaceSelection("",null,"cut");else if(A.options.lineWiseCopyCut){var ve=Fs(A);Ua({lineWise:!0,text:ve.text}),me.type=="cut"&&A.operation(function(){A.setSelections(ve.ranges,0,Ce),A.replaceSelection("",null,"cut")})}else return;if(me.clipboardData){me.clipboardData.clearData();var Se=Fn.text.join(` `);if(me.clipboardData.setData("Text",Se),me.clipboardData.getData("Text")==Se){me.preventDefault();return}}var De=Us(),Ne=De.firstChild;A.display.lineSpace.insertBefore(De,A.display.lineSpace.firstChild),Ne.value=Fn.text.join(` `);var Ve=document.activeElement;G(Ne),setTimeout(function(){A.display.lineSpace.removeChild(De),Ve.focus(),Ve==M&&O.showPrimarySelection()},50)}Re(M,"copy",le),Re(M,"cut",le)},dr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},dr.prototype.prepareSelection=function(){var e=Oo(this.cm,!1);return e.focus=document.activeElement==this.div,e},dr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},dr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},dr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,O=t.doc.sel.primary(),A=O.from(),M=O.to();if(t.display.viewTo==t.display.viewFrom||A.line>=t.display.viewTo||M.line=t.display.viewFrom&&Hs(t,A)||{node:me[0].measure.map[2],offset:0},Se=M.linee.firstLine()&&(A=nt(A.line-1,gt(e.doc,A.line-1).length)),M.ch==gt(e.doc,M.line).text.length&&M.linet.viewTo-1)return!1;var $,le,me;A.line==t.viewFrom||($=yi(e,A.line))==0?(le=Gt(t.view[0].line),me=t.view[0].node):(le=Gt(t.view[$].line),me=t.view[$-1].node.nextSibling);var ve=yi(e,M.line),Se,De;if(ve==t.view.length-1?(Se=t.viewTo-1,De=t.lineDiv.lastChild):(Se=Gt(t.view[ve+1].line)-1,De=t.view[ve+1].node.previousSibling),!me)return!1;for(var Ne=e.doc.splitLines(ru(e,me,De,le,Se)),Ve=Bt(e.doc,nt(le,0),nt(Se,gt(e.doc,Se).text.length));Ne.length>1&&Ve.length>1;)if(re(Ne)==re(Ve))Ne.pop(),Ve.pop(),Se--;else if(Ne[0]==Ve[0])Ne.shift(),Ve.shift(),le++;else break;for(var Ke=0,Qe=0,it=Ne[0],ht=Ve[0],yt=Math.min(it.length,ht.length);KeA.ch&&_t.charCodeAt(_t.length-Qe-1)==bt.charCodeAt(bt.length-Qe-1);)Ke--,Qe++;Ne[Ne.length-1]=_t.slice(0,_t.length-Qe).replace(/^\u200b+/,""),Ne[0]=Ne[0].slice(Ke).replace(/\u200b+$/,"");var Ut=nt(le,Ke),jt=nt(Se,Ve.length?re(Ve).length-Qe:0);if(Ne.length>1||Ne[0]||Dt(Ut,jt))return Bi(e.doc,Ne,Ut,jt,"+input"),!0},dr.prototype.ensurePolled=function(){this.forceCompositionEnd()},dr.prototype.reset=function(){this.forceCompositionEnd()},dr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},dr.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)},dr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&fn(this.cm,function(){return on(e.cm)})},dr.prototype.setUneditable=function(e){e.contentEditable="false"},dr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Wr(this.cm,bo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},dr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},dr.prototype.onContextMenu=function(){},dr.prototype.resetPosition=function(){},dr.prototype.needsContentAttribute=!0;function Hs(e,t){var O=Ai(e,t.line);if(!O||O.hidden)return null;var A=gt(e.doc,t.line),M=_i(O,A,t.line),$=Ge(A,e.doc.direction),le="left";if($){var me=Ue($,t.ch);le=me%2?"right":"left"}var ve=Qn(M.map,t.ch,le);return ve.offset=ve.collapse=="right"?ve.end:ve.start,ve}function tu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Gi(e,t){return t&&(e.bad=!0),e}function ru(e,t,O,A,M){var $="",le=!1,me=e.doc.lineSeparator(),ve=!1;function Se(Ke){return function(Qe){return Qe.id==Ke}}function De(){le&&($+=me,ve&&($+=me),le=ve=!1)}function Ne(Ke){Ke&&(De(),$+=Ke)}function Ve(Ke){if(Ke.nodeType==1){var Qe=Ke.getAttribute("cm-text");if(Qe){Ne(Qe);return}var it=Ke.getAttribute("cm-marker"),ht;if(it){var yt=e.findMarks(nt(A,0),nt(M+1,0),Se(+it));yt.length&&(ht=yt[0].find(0))&&Ne(Bt(e.doc,ht.from,ht.to).join(me));return}if(Ke.getAttribute("contenteditable")=="false")return;var _t=/^(pre|div|p|li|table|br)$/i.test(Ke.nodeName);if(!/^br$/i.test(Ke.nodeName)&&Ke.textContent.length==0)return;_t&&De();for(var bt=0;bt=9&&t.hasSelection&&(t.hasSelection=null),O.poll()}),Re(M,"paste",function(le){if($e(A,le)||Ns(le,A))return;A.state.pasteIncoming=+new Date,O.fastPoll()});function $(le){if($e(A,le))return;if(A.somethingSelected())Ua({lineWise:!1,text:A.getSelections()});else if(A.options.lineWiseCopyCut){var me=Fs(A);Ua({lineWise:!0,text:me.text}),le.type=="cut"?A.setSelections(me.ranges,null,Ce):(O.prevInput="",M.value=me.text.join(` `),G(M))}else return;le.type=="cut"&&(A.state.cutIncoming=+new Date)}Re(M,"cut",$),Re(M,"copy",$),Re(e.scroller,"paste",function(le){if(cr(e,le)||$e(A,le))return;if(!M.dispatchEvent){A.state.pasteIncoming=+new Date,O.focus();return}var me=new Event("paste");me.clipboardData=le.clipboardData,M.dispatchEvent(me)}),Re(e.lineSpace,"selectstart",function(le){cr(e,le)||Te(le)}),Re(M,"compositionstart",function(){var le=A.getCursor("from");O.composing&&O.composing.range.clear(),O.composing={start:le,range:A.markText(le,A.getCursor("to"),{className:"CodeMirror-composing"})}}),Re(M,"compositionend",function(){O.composing&&(O.poll(),O.composing.range.clear(),O.composing=null)})},Lr.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},Lr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Lr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,O=e.doc,A=Oo(e);if(e.options.moveInputWithCursor){var M=Nn(e,O.sel.primary().head,"div"),$=t.wrapper.getBoundingClientRect(),le=t.lineDiv.getBoundingClientRect();A.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,M.top+le.top-$.top)),A.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,M.left+le.left-$.left))}return A},Lr.prototype.showSelection=function(e){var t=this.cm,O=t.display;x(O.cursorDiv,e.cursors),x(O.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Lr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var O=t.getSelection();this.textarea.value=O,t.state.focused&&G(this.textarea),C&&h>=9&&(this.hasSelection=O)}else e||(this.prevInput=this.textarea.value="",C&&h>=9&&(this.hasSelection=null))},Lr.prototype.getField=function(){return this.textarea},Lr.prototype.supportsTouch=function(){return!1},Lr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||X()!=this.textarea))try{this.textarea.focus()}catch(e){}},Lr.prototype.blur=function(){this.textarea.blur()},Lr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Lr.prototype.receivedFocus=function(){this.slowPoll()},Lr.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()})},Lr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function O(){var A=t.poll();!A&&!e?(e=!0,t.polling.set(60,O)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,O)},Lr.prototype.poll=function(){var e=this,t=this.cm,O=this.textarea,A=this.prevInput;if(this.contextMenuPending||!t.state.focused||lt(O)&&!A&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var M=O.value;if(M==A&&!t.somethingSelected())return!1;if(C&&h>=9&&this.hasSelection===M||o&&/[\uf700-\uf7ff]/.test(M))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var $=M.charCodeAt(0);if($==8203&&!A&&(A="\u200B"),$==8666)return this.reset(),this.cm.execCommand("undo")}for(var le=0,me=Math.min(A.length,M.length);le1e3||M.indexOf(` `)>-1?O.value=e.prevInput="":e.prevInput=M,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Lr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Lr.prototype.onKeyPress=function(){C&&h>=9&&(this.hasSelection=null),this.fastPoll()},Lr.prototype.onContextMenu=function(e){var t=this,O=t.cm,A=O.display,M=t.textarea;t.contextMenuPending&&t.contextMenuPending();var $=vi(O,e),le=A.scroller.scrollTop;if(!$||f)return;var me=O.options.resetSelectionOnContextMenu;me&&O.doc.sel.contains($)==-1&&Wr(O,Qr)(O.doc,ri($),Ce);var ve=M.style.cssText,Se=t.wrapper.style.cssText,De=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",M.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-De.top-5)+"px; left: "+(e.clientX-De.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 Ne;s&&(Ne=window.scrollY),A.input.focus(),s&&window.scrollTo(null,Ne),A.input.reset(),O.somethingSelected()||(M.value=t.prevInput=" "),t.contextMenuPending=Ke,A.selForContextMenu=O.doc.sel,clearTimeout(A.detectingSelectAll);function Ve(){if(M.selectionStart!=null){var it=O.somethingSelected(),ht="\u200B"+(it?M.value:"");M.value="\u21DA",M.value=ht,t.prevInput=it?"":"\u200B",M.selectionStart=1,M.selectionEnd=ht.length,A.selForContextMenu=O.doc.sel}}function Ke(){if(t.contextMenuPending!=Ke)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Se,M.style.cssText=ve,C&&h<9&&A.scrollbars.setScrollTop(A.scroller.scrollTop=le),M.selectionStart!=null){(!C||C&&h<9)&&Ve();var it=0,ht=function(){A.selForContextMenu==O.doc.sel&&M.selectionStart==0&&M.selectionEnd>0&&t.prevInput=="\u200B"?Wr(O,os)(O):it++<10?A.detectingSelectAll=setTimeout(ht,500):(A.selForContextMenu=null,A.input.reset())};A.detectingSelectAll=setTimeout(ht,200)}}if(C&&h>=9&&Ve(),D){Me(e);var Qe=function(){rt(window,"mouseup",Qe),setTimeout(Ke,20)};Re(window,"mouseup",Qe)}else setTimeout(Ke,50)},Lr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Lr.prototype.setUneditable=function(){},Lr.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?B(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 O=X();t.autofocus=O==e||e.getAttribute("autofocus")!=null&&O==document.body}function A(){e.value=me.getValue()}var M;if(e.form&&(Re(e.form,"submit",A),!t.leaveSubmitMethodAlone)){var $=e.form;M=$.submit;try{var le=$.submit=function(){A(),$.submit=M,$.submit(),$.submit=le}}catch(ve){}}t.finishInit=function(ve){ve.save=A,ve.getTextArea=function(){return e},ve.toTextArea=function(){ve.toTextArea=isNaN,A(),e.parentNode.removeChild(ve.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",A),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=M))}},e.style.display="none";var me=yr(function(ve){return e.parentNode.insertBefore(ve,e.nextSibling)},t);return me}function au(e){e.off=rt,e.on=Re,e.wheelEventPixels=hl,e.Doc=sn,e.splitLines=xt,e.countColumn=W,e.findColumn=pe,e.isWordChar=J,e.Pass=be,e.signal=We,e.Line=Kn,e.changeEnd=ni,e.scrollbarModel=No,e.Pos=nt,e.cmpPos=Dt,e.modes=$t,e.mimeModes=At,e.resolveMode=St,e.getMode=Je,e.modeExtensions=dt,e.extendMode=Ct,e.copyState=Xt,e.startState=Mt,e.innerMode=Jt,e.commands=ma,e.keyMap=Xn,e.keyName=ws,e.isModifierKey=xs,e.lookupKey=Wi,e.normalizeKeyMap=Il,e.StringStream=Pt,e.SharedTextMarker=ha,e.TextMarker=ai,e.LineWidget=da,e.e_preventDefault=Te,e.e_stopPropagation=Ae,e.e_stop=Me,e.addClass=z,e.contains=L,e.rmClass=c,e.keyNames=oi}Jl(yr),eu(yr);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Ha in sn.prototype)sn.prototype.hasOwnProperty(Ha)&&de(ou,Ha)<0&&(yr.prototype[Ha]=function(e){return function(){return e.apply(this.doc,arguments)}}(sn.prototype[Ha]));return Le(sn),yr.inputStyles={textarea:Lr,contenteditable:dr},yr.defineMode=function(e){!yr.defaults.mode&&e!="null"&&(yr.defaults.mode=e),Rt.apply(this,arguments)},yr.defineMIME=hr,yr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),yr.defineMIME("text/plain","null"),yr.defineExtension=function(e,t){yr.prototype[e]=t},yr.defineDocExtension=function(e,t){sn.prototype[e]=t},yr.fromTextArea=iu,au(yr),yr.version="5.58.2",yr})},WYAk:function(I,q,N){(function(P,m){I.exports=q=m(N("Ib8C"))})(this,function(P){(function(){var m=P,S=m.lib,R=S.Base,T=m.enc,g=T.Utf8,C=m.algo,h=C.HMAC=R.extend({init:function(s,a){s=this._hasher=new s.init,typeof a=="string"&&(a=g.parse(a));var r=s.blockSize,f=r*4;a.sigBytes>f&&(a=s.finalize(a)),a.clamp();for(var p=this._oKey=a.clone(),d=this._iKey=a.clone(),E=p.words,y=d.words,l=0;l1&&arguments[1]!==void 0?arguments[1]:!1,ge=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(ue&&X[ge])return X[ge];var pe=window.getComputedStyle(Ce),oe=pe.getPropertyValue("box-sizing")||pe.getPropertyValue("-moz-box-sizing")||pe.getPropertyValue("-webkit-box-sizing"),ae=parseFloat(pe.getPropertyValue("padding-bottom"))+parseFloat(pe.getPropertyValue("padding-top")),re=parseFloat(pe.getPropertyValue("border-bottom-width"))+parseFloat(pe.getPropertyValue("border-top-width")),he=L.map(function(ie){return"".concat(ie,":").concat(pe.getPropertyValue(ie))}).join(";"),Q={sizingStyle:he,paddingSize:ae,borderSize:re,boxSizing:oe};return ue&&ge&&(X[ge]=Q),Q}function G(Ce){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;z||(z=document.createElement("textarea"),z.setAttribute("tab-index","-1"),z.setAttribute("aria-hidden","true"),document.body.appendChild(z)),Ce.getAttribute("wrap")?z.setAttribute("wrap",Ce.getAttribute("wrap")):z.removeAttribute("wrap");var oe=H(Ce,ue),ae=oe.paddingSize,re=oe.borderSize,he=oe.boxSizing,Q=oe.sizingStyle;z.setAttribute("style","".concat(Q,";").concat(F)),z.value=Ce.value||Ce.placeholder||"";var ie=Number.MIN_SAFE_INTEGER,we=Number.MAX_SAFE_INTEGER,ne=z.scrollHeight,J;if(he==="border-box"?ne+=re:he==="content-box"&&(ne-=ae),ge!==null||pe!==null){z.value=" ";var V=z.scrollHeight-ae;ge!==null&&(ie=V*ge,he==="border-box"&&(ie=ie+ae+re),ne=Math.max(ie,ne)),pe!==null&&(we=V*pe,he==="border-box"&&(we=we+ae+re),J=ne>we?"":"hidden",ne=Math.min(we,ne))}return{height:ne,minHeight:ie,maxHeight:we,overflowY:J,resize:"none"}}var U=N("Gytx"),B=N.n(U),W;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(W||(W={}));var te=function(Ce){Object(R.a)(ge,Ce);var ue=Object(T.a)(ge);function ge(pe){var oe;return Object(m.a)(this,ge),oe=ue.call(this,pe),oe.nextFrameActionId=void 0,oe.resizeFrameId=void 0,oe.textArea=void 0,oe.saveTextArea=function(ae){oe.textArea=ae},oe.handleResize=function(ae){var re=oe.state.resizeStatus,he=oe.props,Q=he.autoSize,ie=he.onResize;if(re!==W.NONE)return;typeof ie=="function"&&ie(ae),Q&&oe.resizeOnNextFrame()},oe.resizeOnNextFrame=function(){cancelAnimationFrame(oe.nextFrameActionId),oe.nextFrameActionId=requestAnimationFrame(oe.resizeTextarea)},oe.resizeTextarea=function(){var ae=oe.props.autoSize;if(!ae||!oe.textArea)return;var re=ae.minRows,he=ae.maxRows,Q=G(oe.textArea,!1,re,he);oe.setState({textareaStyles:Q,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(oe.resizeFrameId),oe.resizeFrameId=requestAnimationFrame(function(){oe.setState({resizeStatus:W.RESIZED},function(){oe.resizeFrameId=requestAnimationFrame(function(){oe.setState({resizeStatus:W.NONE}),oe.fixFirefoxAutoScroll()})})})})},oe.renderTextArea=function(){var ae=oe.props,re=ae.prefixCls,he=re===void 0?"rc-textarea":re,Q=ae.autoSize,ie=ae.onResize,we=ae.className,ne=ae.disabled,J=oe.state,V=J.textareaStyles,Z=J.resizeStatus,Ee=Object(x.a)(oe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=j()(he,we,Object(h.a)({},"".concat(he,"-disabled"),ne));"value"in Ee&&(Ee.value=Ee.value||"");var _e=Object(C.a)(Object(C.a)(Object(C.a)({},oe.props.style),V),Z===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return g.createElement(b,{onResize:oe.handleResize,disabled:!(Q||ie)},g.createElement("textarea",Object(P.a)({},Ee,{className:xe,style:_e,ref:oe.saveTextArea})))},oe.state={textareaStyles:{},resizeStatus:W.NONE},oe}return Object(S.a)(ge,[{key:"componentDidUpdate",value:function(oe){(oe.value!==this.props.value||!B()(oe.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 oe=this.textArea.selectionStart,ae=this.textArea.selectionEnd;this.textArea.setSelectionRange(oe,ae)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ge}(g.Component),de=te,fe=function(Ce){Object(R.a)(ge,Ce);var ue=Object(T.a)(ge);function ge(pe){var oe;Object(m.a)(this,ge),oe=ue.call(this,pe),oe.resizableTextArea=void 0,oe.focus=function(){oe.resizableTextArea.textArea.focus()},oe.saveTextArea=function(re){oe.resizableTextArea=re},oe.handleChange=function(re){var he=oe.props.onChange;oe.setValue(re.target.value,function(){oe.resizableTextArea.resizeTextarea()}),he&&he(re)},oe.handleKeyDown=function(re){var he=oe.props,Q=he.onPressEnter,ie=he.onKeyDown;re.keyCode===13&&Q&&Q(re),ie&&ie(re)};var ae=typeof pe.value=="undefined"||pe.value===null?pe.defaultValue:pe.value;return oe.state={value:ae},oe}return Object(S.a)(ge,[{key:"setValue",value:function(oe,ae){"value"in this.props||this.setState({value:oe},ae)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return g.createElement(de,Object(P.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(oe){return"value"in oe?{value:oe.value}:null}}]),ge}(g.Component),be=q.default=fe},ZD9Y:function(I,q,N){"use strict";var P=N("BoS7"),m=N("Sdc0"),S=N("OaEy"),R=N("2fM7"),T=N("q1tI"),g=N.n(T),C=N("lOMy"),h=N.n(C),s=R.a.Option;q.a=function(a){var r=a.onFontSizeChange,f=a.cmFontSize,p=a.cmCodeMode,d=a.onCodeModeChange,E=a.onTabToSpace,y=a.className,l=y===void 0?"":y,n=a.tabToSpace,o=a.children;return g.a.createElement("div",{className:"tpi-code-setting ".concat(l)},g.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),g.a.createElement("section",null,g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),g.a.createElement(R.a,{bordered:!1,size:"small",value:p,onChange:d},g.a.createElement(s,{value:"vs"},"\u767D\u8272\u80CC\u666F"),g.a.createElement(s,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),g.a.createElement(R.a,{bordered:!1,size:"small",value:f,onChange:r},g.a.createElement(s,{value:12},"12px"),g.a.createElement(s,{value:14},"14px"),g.a.createElement(s,{value:16},"16px"),g.a.createElement(s,{value:18},"18px"),g.a.createElement(s,{value:20},"20px"),g.a.createElement(s,{value:22},"22px"))),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"Tab\u8F6C\u6362"),g.a.createElement(m.a,{checked:n,onChange:E}))),g.a.createElement("h3",null,"\u5FEB\u6377\u952E"),g.a.createElement("section",null,g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),g.a.createElement("span",null,"Ctrl + S")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),g.a.createElement("span",null,"F1 / Alt + F1")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),g.a.createElement("span",null,"Ctrl + ]/[")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),g.a.createElement("span",null,"Ctrl + Shift + \\")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),g.a.createElement("span",null,"Home")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),g.a.createElement("span",null,"End"))),o)}},ZpRC:function(I,q,N){"use strict";function P(r){return typeof r=="object"&&r!=null&&r.nodeType===1}function m(r,f){return(!f||r!=="hidden")&&r!=="visible"&&r!=="clip"}function S(r,f){if(r.clientHeightf||y>r&&l=f&&n>=p?y-r-d:l>f&&np?l-f+E:0}var T=function(r,f){var p=window,d=f.scrollMode,E=f.block,y=f.inline,l=f.boundary,n=f.skipOverflowHiddenElements,o=typeof l=="function"?l:function(V){return V!==l};if(!P(r))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,w=[],v=r;P(v)&&o(v);){if((v=v.parentElement)===u){w.push(v);break}v!=null&&v===document.body&&S(v)&&!S(document.documentElement)||v!=null&&S(v,n)&&w.push(v)}for(var i=p.visualViewport?p.visualViewport.width:innerWidth,D=p.visualViewport?p.visualViewport.height:innerHeight,k=window.scrollX||pageXOffset,c=window.scrollY||pageYOffset,b=r.getBoundingClientRect(),x=b.height,_=b.width,j=b.top,F=b.right,L=b.bottom,X=b.left,z=E==="start"||E==="nearest"?j:E==="end"?L:j+x/2,H=y==="center"?X+_/2:y==="end"?F:X,G=[],U=0;U=0&&X>=0&&L<=D&&F<=i&&j>=fe&&L<=Ce&&X>=ue&&F<=be)return G;var ge=getComputedStyle(B),pe=parseInt(ge.borderLeftWidth,10),oe=parseInt(ge.borderTopWidth,10),ae=parseInt(ge.borderRightWidth,10),re=parseInt(ge.borderBottomWidth,10),he=0,Q=0,ie="offsetWidth"in B?B.offsetWidth-B.clientWidth-pe-ae:0,we="offsetHeight"in B?B.offsetHeight-B.clientHeight-oe-re:0;if(u===B)he=E==="start"?z:E==="end"?z-D:E==="nearest"?R(c,c+D,D,oe,re,c+z,c+z+x,x):z-D/2,Q=y==="start"?H:y==="center"?H-i/2:y==="end"?H-i:R(k,k+i,i,pe,ae,k+H,k+H+_,_),he=Math.max(0,he+c),Q=Math.max(0,Q+k);else{he=E==="start"?z-fe-oe:E==="end"?z-Ce+re+we:E==="nearest"?R(fe,Ce,te,oe,re+we,z,z+x,x):z-(fe+te/2)+we/2,Q=y==="start"?H-ue-pe:y==="center"?H-(ue+de/2)+ie/2:y==="end"?H-be+ae+ie:R(ue,be,de,pe,ae+ie,H,H+_,_);var ne=B.scrollLeft,J=B.scrollTop;z+=J-(he=Math.max(0,Math.min(J+he,B.scrollHeight-te+we))),H+=ne-(Q=Math.max(0,Math.min(ne+Q,B.scrollWidth-de+ie)))}G.push({el:B,top:he,left:Q})}return G};function g(r){return r===Object(r)&&Object.keys(r).length!==0}function C(r,f){f===void 0&&(f="auto");var p="scrollBehavior"in document.body.style;r.forEach(function(d){var E=d.el,y=d.top,l=d.left;E.scroll&&p?E.scroll({top:y,left:l,behavior:f}):(E.scrollTop=y,E.scrollLeft=l)})}function h(r){return r===!1?{block:"end",inline:"nearest"}:g(r)?r:{block:"start",inline:"nearest"}}function s(r,f){var p=!r.ownerDocument.documentElement.contains(r);if(g(f)&&typeof f.behavior=="function")return f.behavior(p?[]:T(r,f));if(p)return;var d=h(f);return C(T(r,d),d.behavior)}var a=q.a=s},Zss7:function(I,q,N){var P;(function(m){var S=/^\s+/,R=/\s+$/,T=0,g=m.round,C=m.min,h=m.max,s=m.random;function a(re,he){if(re=re||"",he=he||{},re instanceof a)return re;if(!(this instanceof a))return new a(re,he);var Q=r(re);this._originalInput=re,this._r=Q.r,this._g=Q.g,this._b=Q.b,this._a=Q.a,this._roundA=g(100*this._a)/100,this._format=he.format||Q.format,this._gradientType=he.gradientType,this._r<1&&(this._r=g(this._r)),this._g<1&&(this._g=g(this._g)),this._b<1&&(this._b=g(this._b)),this._ok=Q.ok,this._tc_id=T++}a.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 re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),he,Q,ie,we,ne,J;return he=re.r/255,Q=re.g/255,ie=re.b/255,he<=.03928?we=he/12.92:we=m.pow((he+.055)/1.055,2.4),Q<=.03928?ne=Q/12.92:ne=m.pow((Q+.055)/1.055,2.4),ie<=.03928?J=ie/12.92:J=m.pow((ie+.055)/1.055,2.4),.2126*we+.7152*ne+.0722*J},setAlpha:function(re){return this._a=G(re),this._roundA=g(100*this._a)/100,this},toHsv:function(){var re=E(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=E(this._r,this._g,this._b),he=g(re.h*360),Q=g(re.s*100),ie=g(re.v*100);return this._a==1?"hsv("+he+", "+Q+"%, "+ie+"%)":"hsva("+he+", "+Q+"%, "+ie+"%, "+this._roundA+")"},toHsl:function(){var re=p(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=p(this._r,this._g,this._b),he=g(re.h*360),Q=g(re.s*100),ie=g(re.l*100);return this._a==1?"hsl("+he+", "+Q+"%, "+ie+"%)":"hsla("+he+", "+Q+"%, "+ie+"%, "+this._roundA+")"},toHex:function(re){return l(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return n(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:g(this._r),g:g(this._g),b:g(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+g(this._r)+", "+g(this._g)+", "+g(this._b)+")":"rgba("+g(this._r)+", "+g(this._g)+", "+g(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:g(U(this._r,255)*100)+"%",g:g(U(this._g,255)*100)+"%",b:g(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+g(U(this._r,255)*100)+"%, "+g(U(this._g,255)*100)+"%, "+g(U(this._b,255)*100)+"%)":"rgba("+g(U(this._r,255)*100)+"%, "+g(U(this._g,255)*100)+"%, "+g(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:z[l(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var he="#"+o(this._r,this._g,this._b,this._a),Q=he,ie=this._gradientType?"GradientType = 1, ":"";if(re){var we=a(re);Q="#"+o(we._r,we._g,we._b,we._a)}return"progid:DXImageTransform.Microsoft.gradient("+ie+"startColorstr="+he+",endColorstr="+Q+")"},toString:function(re){var he=!!re;re=re||this._format;var Q=!1,ie=this._a<1&&this._a>=0,we=!he&&ie&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return we?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(Q=this.toRgbString()),re==="prgb"&&(Q=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(Q=this.toHexString()),re==="hex3"&&(Q=this.toHexString(!0)),re==="hex4"&&(Q=this.toHex8String(!0)),re==="hex8"&&(Q=this.toHex8String()),re==="name"&&(Q=this.toName()),re==="hsl"&&(Q=this.toHslString()),re==="hsv"&&(Q=this.toHsvString()),Q||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(re,he){var Q=re.apply(null,[this].concat([].slice.call(he)));return this._r=Q._r,this._g=Q._g,this._b=Q._b,this.setAlpha(Q._a),this},lighten:function(){return this._applyModification(i,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(k,arguments)},desaturate:function(){return this._applyModification(u,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(c,arguments)},_applyCombination:function(re,he){return re.apply(null,[this].concat([].slice.call(he)))},analogous:function(){return this._applyCombination(F,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(L,arguments)},splitcomplement:function(){return this._applyCombination(j,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},a.fromRatio=function(re,he){if(typeof re=="object"){var Q={};for(var ie in re)re.hasOwnProperty(ie)&&(ie==="a"?Q[ie]=re[ie]:Q[ie]=be(re[ie]));re=Q}return a(re,he)};function r(re){var he={r:0,g:0,b:0},Q=1,ie=null,we=null,ne=null,J=!1,V=!1;return typeof re=="string"&&(re=oe(re)),typeof re=="object"&&(pe(re.r)&&pe(re.g)&&pe(re.b)?(he=f(re.r,re.g,re.b),J=!0,V=String(re.r).substr(-1)==="%"?"prgb":"rgb"):pe(re.h)&&pe(re.s)&&pe(re.v)?(ie=be(re.s),we=be(re.v),he=y(re.h,ie,we),J=!0,V="hsv"):pe(re.h)&&pe(re.s)&&pe(re.l)&&(ie=be(re.s),ne=be(re.l),he=d(re.h,ie,ne),J=!0,V="hsl"),re.hasOwnProperty("a")&&(Q=re.a)),Q=G(Q),{ok:J,format:re.format||V,r:C(255,h(he.r,0)),g:C(255,h(he.g,0)),b:C(255,h(he.b,0)),a:Q}}function f(re,he,Q){return{r:U(re,255)*255,g:U(he,255)*255,b:U(Q,255)*255}}function p(re,he,Q){re=U(re,255),he=U(he,255),Q=U(Q,255);var ie=h(re,he,Q),we=C(re,he,Q),ne,J,V=(ie+we)/2;if(ie==we)ne=J=0;else{var Z=ie-we;J=V>.5?Z/(2-ie-we):Z/(ie+we);switch(ie){case re:ne=(he-Q)/Z+(he1&&(_e-=1),_e<1/6?Ee+(xe-Ee)*6*_e:_e<1/2?xe:_e<2/3?Ee+(xe-Ee)*(2/3-_e)*6:Ee}if(he===0)ie=we=ne=Q;else{var V=Q<.5?Q*(1+he):Q+he-Q*he,Z=2*Q-V;ie=J(Z,V,re+1/3),we=J(Z,V,re),ne=J(Z,V,re-1/3)}return{r:ie*255,g:we*255,b:ne*255}}function E(re,he,Q){re=U(re,255),he=U(he,255),Q=U(Q,255);var ie=h(re,he,Q),we=C(re,he,Q),ne,J,V=ie,Z=ie-we;if(J=ie===0?0:Z/ie,ie==we)ne=0;else{switch(ie){case re:ne=(he-Q)/Z+(he>1)+720)%360;--he;)ie.h=(ie.h+we)%360,ne.push(a(ie));return ne}function L(re,he){he=he||6;for(var Q=a(re).toHsv(),ie=Q.h,we=Q.s,ne=Q.v,J=[],V=1/he;he--;)J.push(a({h:ie,s:we,v:ne})),ne=(ne+V)%1;return J}a.mix=function(re,he,Q){Q=Q===0?0:Q||50;var ie=a(re).toRgb(),we=a(he).toRgb(),ne=Q/100,J={r:(we.r-ie.r)*ne+ie.r,g:(we.g-ie.g)*ne+ie.g,b:(we.b-ie.b)*ne+ie.b,a:(we.a-ie.a)*ne+ie.a};return a(J)},a.readability=function(re,he){var Q=a(re),ie=a(he);return(m.max(Q.getLuminance(),ie.getLuminance())+.05)/(m.min(Q.getLuminance(),ie.getLuminance())+.05)},a.isReadable=function(re,he,Q){var ie=a.readability(re,he),we,ne;ne=!1,we=ae(Q);switch(we.level+we.size){case"AAsmall":case"AAAlarge":ne=ie>=4.5;break;case"AAlarge":ne=ie>=3;break;case"AAAsmall":ne=ie>=7;break}return ne},a.mostReadable=function(re,he,Q){var ie=null,we=0,ne,J,V,Z;Q=Q||{},J=Q.includeFallbackColors,V=Q.level,Z=Q.size;for(var Ee=0;Eewe&&(we=ne,ie=a(he[Ee]));return a.isReadable(re,ie,{level:V,size:Z})||!J?ie:(Q.includeFallbackColors=!1,a.mostReadable(re,["#fff","#000"],Q))};var X=a.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"},z=a.hexNames=H(X);function H(re){var he={};for(var Q in re)re.hasOwnProperty(Q)&&(he[re[Q]]=Q);return he}function G(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function U(re,he){te(re)&&(re="100%");var Q=de(re);return re=C(he,h(0,parseFloat(re))),Q&&(re=parseInt(re*he,10)/100),m.abs(re-he)<1e-6?1:re%he/parseFloat(he)}function B(re){return C(1,h(0,re))}function W(re){return parseInt(re,16)}function te(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function de(re){return typeof re=="string"&&re.indexOf("%")!=-1}function fe(re){return re.length==1?"0"+re:""+re}function be(re){return re<=1&&(re=re*100+"%"),re}function Ce(re){return m.round(parseFloat(re)*255).toString(16)}function ue(re){return W(re)/255}var ge=function(){var re="[-\\+]?\\d+%?",he="[-\\+]?\\d*\\.\\d+%?",Q="(?:"+he+")|(?:"+re+")",ie="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?",we="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?";return{CSS_UNIT:new RegExp(Q),rgb:new RegExp("rgb"+ie),rgba:new RegExp("rgba"+we),hsl:new RegExp("hsl"+ie),hsla:new RegExp("hsla"+we),hsv:new RegExp("hsv"+ie),hsva:new RegExp("hsva"+we),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function pe(re){return!!ge.CSS_UNIT.exec(re)}function oe(re){re=re.replace(S,"").replace(R,"").toLowerCase();var he=!1;if(X[re])re=X[re],he=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Q;return(Q=ge.rgb.exec(re))?{r:Q[1],g:Q[2],b:Q[3]}:(Q=ge.rgba.exec(re))?{r:Q[1],g:Q[2],b:Q[3],a:Q[4]}:(Q=ge.hsl.exec(re))?{h:Q[1],s:Q[2],l:Q[3]}:(Q=ge.hsla.exec(re))?{h:Q[1],s:Q[2],l:Q[3],a:Q[4]}:(Q=ge.hsv.exec(re))?{h:Q[1],s:Q[2],v:Q[3]}:(Q=ge.hsva.exec(re))?{h:Q[1],s:Q[2],v:Q[3],a:Q[4]}:(Q=ge.hex8.exec(re))?{r:W(Q[1]),g:W(Q[2]),b:W(Q[3]),a:ue(Q[4]),format:he?"name":"hex8"}:(Q=ge.hex6.exec(re))?{r:W(Q[1]),g:W(Q[2]),b:W(Q[3]),format:he?"name":"hex"}:(Q=ge.hex4.exec(re))?{r:W(Q[1]+""+Q[1]),g:W(Q[2]+""+Q[2]),b:W(Q[3]+""+Q[3]),a:ue(Q[4]+""+Q[4]),format:he?"name":"hex8"}:(Q=ge.hex3.exec(re))?{r:W(Q[1]+""+Q[1]),g:W(Q[2]+""+Q[2]),b:W(Q[3]+""+Q[3]),format:he?"name":"hex"}:!1}function ae(re){var he,Q;return re=re||{level:"AA",size:"small"},he=(re.level||"AA").toUpperCase(),Q=(re.size||"small").toLowerCase(),he!=="AA"&&he!=="AAA"&&(he="AA"),Q!=="small"&&Q!=="large"&&(Q="small"),{level:he,size:Q}}I.exports?I.exports=a:!(P=function(){return a}.call(q,N,q,I),P!==void 0&&(I.exports=P))})(Math)},b8wu:function(I,q,N){I.exports={"code-panel-container":"code-panel-container___pVbpU","action-oj-bar":"action-oj-bar___1NMjh",active:"active___2NiTj"}},bCnd:function(I,q,N){"use strict";N.d(q,"b",function(){return R}),N.d(q,"a",function(){return T});var P=N("je13"),m=N.n(P),S=!1;function R(g,C){var h=m.a.get("__ec");h||(h={}),h[g]=C,m.a.set("__ec",h)}function T(g,C){var h=m.a.get("__ec");return h?h[g]===void 0?C:h[g]:C}},bQjk:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.CipherParams,g=S.enc,C=g.Hex,h=S.format,s=h.Hex={stringify:function(a){return a.ciphertext.toString(C)},parse:function(a){var r=C.parse(a);return T.create({ciphertext:r})}}}(),P.format.Hex})},bT9E:function(I,q,N){"use strict";N.d(q,"a",function(){return m});var P=N("VTBJ");function m(S,R){var T=Object(P.a)({},S);return Array.isArray(R)&&R.forEach(function(g){delete T[g]}),T}},c5Ni:function(I,q,N){},cDPC:function(I,q,N){"use strict";var P=N("tJVT"),m=N("q1tI"),S=N.n(m),R=N("i3hx"),T=N.n(R);q.a=function(g){var C=g.defaultX,h=C===void 0?"40%":C,s=g.leftChild,a=g.rightChild,r=g.className,f=g.hideResize,p=f===void 0?!1:f,d=Object(m.useState)(h),E=Object(P.a)(d,2),y=E[0],l=E[1],n=Object(m.useRef)();function o(){n.current=!0}Object(m.useEffect)(function(){function v(D){n.current&&l(D.pageX)}function i(){n.current=!1}return window.addEventListener("mousemove",v),window.addEventListener("mouseup",i),function(){window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",i)}},[]);var u=typeof y=="number"&&y!==.01?"".concat(y,"px"):h,w="calc(100% - ".concat(p?"0px":"4px"," - ").concat(u,")");return S.a.createElement("div",{className:"split-panel-container ".concat(r)},S.a.createElement("section",{style:{width:u,display:y===.01?"none":""}},s),S.a.createElement("section",{className:"resize-x-bar",onMouseDown:o},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:w}},a))}},cv67:function(I,q,N){(function(P,m){I.exports=q=m(N("Ib8C"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.WordArray,g=R.Hasher,C=S.algo,h=[];(function(){for(var d=0;d<64;d++)h[d]=m.abs(m.sin(d+1))*4294967296|0})();var s=C.MD5=g.extend({_doReset:function(){this._hash=new T.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(d,E){for(var y=0;y<16;y++){var l=E+y,n=d[l];d[l]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360}var o=this._hash.words,u=d[E+0],w=d[E+1],v=d[E+2],i=d[E+3],D=d[E+4],k=d[E+5],c=d[E+6],b=d[E+7],x=d[E+8],_=d[E+9],j=d[E+10],F=d[E+11],L=d[E+12],X=d[E+13],z=d[E+14],H=d[E+15],G=o[0],U=o[1],B=o[2],W=o[3];G=a(G,U,B,W,u,7,h[0]),W=a(W,G,U,B,w,12,h[1]),B=a(B,W,G,U,v,17,h[2]),U=a(U,B,W,G,i,22,h[3]),G=a(G,U,B,W,D,7,h[4]),W=a(W,G,U,B,k,12,h[5]),B=a(B,W,G,U,c,17,h[6]),U=a(U,B,W,G,b,22,h[7]),G=a(G,U,B,W,x,7,h[8]),W=a(W,G,U,B,_,12,h[9]),B=a(B,W,G,U,j,17,h[10]),U=a(U,B,W,G,F,22,h[11]),G=a(G,U,B,W,L,7,h[12]),W=a(W,G,U,B,X,12,h[13]),B=a(B,W,G,U,z,17,h[14]),U=a(U,B,W,G,H,22,h[15]),G=r(G,U,B,W,w,5,h[16]),W=r(W,G,U,B,c,9,h[17]),B=r(B,W,G,U,F,14,h[18]),U=r(U,B,W,G,u,20,h[19]),G=r(G,U,B,W,k,5,h[20]),W=r(W,G,U,B,j,9,h[21]),B=r(B,W,G,U,H,14,h[22]),U=r(U,B,W,G,D,20,h[23]),G=r(G,U,B,W,_,5,h[24]),W=r(W,G,U,B,z,9,h[25]),B=r(B,W,G,U,i,14,h[26]),U=r(U,B,W,G,x,20,h[27]),G=r(G,U,B,W,X,5,h[28]),W=r(W,G,U,B,v,9,h[29]),B=r(B,W,G,U,b,14,h[30]),U=r(U,B,W,G,L,20,h[31]),G=f(G,U,B,W,k,4,h[32]),W=f(W,G,U,B,x,11,h[33]),B=f(B,W,G,U,F,16,h[34]),U=f(U,B,W,G,z,23,h[35]),G=f(G,U,B,W,w,4,h[36]),W=f(W,G,U,B,D,11,h[37]),B=f(B,W,G,U,b,16,h[38]),U=f(U,B,W,G,j,23,h[39]),G=f(G,U,B,W,X,4,h[40]),W=f(W,G,U,B,u,11,h[41]),B=f(B,W,G,U,i,16,h[42]),U=f(U,B,W,G,c,23,h[43]),G=f(G,U,B,W,_,4,h[44]),W=f(W,G,U,B,L,11,h[45]),B=f(B,W,G,U,H,16,h[46]),U=f(U,B,W,G,v,23,h[47]),G=p(G,U,B,W,u,6,h[48]),W=p(W,G,U,B,b,10,h[49]),B=p(B,W,G,U,z,15,h[50]),U=p(U,B,W,G,k,21,h[51]),G=p(G,U,B,W,L,6,h[52]),W=p(W,G,U,B,i,10,h[53]),B=p(B,W,G,U,j,15,h[54]),U=p(U,B,W,G,w,21,h[55]),G=p(G,U,B,W,x,6,h[56]),W=p(W,G,U,B,H,10,h[57]),B=p(B,W,G,U,c,15,h[58]),U=p(U,B,W,G,X,21,h[59]),G=p(G,U,B,W,D,6,h[60]),W=p(W,G,U,B,F,10,h[61]),B=p(B,W,G,U,v,15,h[62]),U=p(U,B,W,G,_,21,h[63]),o[0]=o[0]+G|0,o[1]=o[1]+U|0,o[2]=o[2]+B|0,o[3]=o[3]+W|0},_doFinalize:function(){var d=this._data,E=d.words,y=this._nDataBytes*8,l=d.sigBytes*8;E[l>>>5]|=128<<24-l%32;var n=m.floor(y/4294967296),o=y;E[(l+64>>>9<<4)+15]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,E[(l+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,d.sigBytes=(E.length+1)*4,this._process();for(var u=this._hash,w=u.words,v=0;v<4;v++){var i=w[v];w[v]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}return u},clone:function(){var d=g.clone.call(this);return d._hash=this._hash.clone(),d}});function a(d,E,y,l,n,o,u){var w=d+(E&y|~E&l)+n+u;return(w<>>32-o)+E}function r(d,E,y,l,n,o,u){var w=d+(E&l|y&~l)+n+u;return(w<>>32-o)+E}function f(d,E,y,l,n,o,u){var w=d+(E^y^l)+n+u;return(w<>>32-o)+E}function p(d,E,y,l,n,o,u){var w=d+(y^(E|~l))+n+u;return(w<>>32-o)+E}S.MD5=g._createHelper(s),S.HmacMD5=g._createHmacHelper(s)}(Math),P.MD5})},dejd:function(I,q,N){},dmUQ:function(I,q,N){"use strict";var P=N("Ff2n"),m=N("rePB"),S=N("1OyB"),R=N("vuIU"),T=N("Ji7U"),g=N("md7G"),C=N("foSv"),h=N("q1tI"),s=N.n(h),a=N("TSYQ"),r=N.n(a),f=N("4IlW");function p(x,_){var j=Object.keys(x);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(x);_&&(F=F.filter(function(L){return Object.getOwnPropertyDescriptor(x,L).enumerable})),j.push.apply(j,F)}return j}function d(x){for(var _=1;_1?de-1:0),be=1;be1?U-1:0),W=1;W=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var U=0;return G.indexOf(".")>=0&&(U=G.length-G.indexOf(".")-1),U},L.getInputDisplayValue=function(H){var G=H||L.state,U=G.focused,B=G.inputValue,W=G.value,te;U?te=B:te=L.toPrecisionAsStep(W),te==null&&(te="");var de=L.formatWrapper(te);return i(L.props.decimalSeparator)&&(de=de.toString().replace(".",L.props.decimalSeparator)),de},L.recordCursorPosition=function(){try{L.cursorStart=L.input.selectionStart,L.cursorEnd=L.input.selectionEnd,L.currentValue=L.input.value,L.cursorBefore=L.input.value.substring(0,L.cursorStart),L.cursorAfter=L.input.value.substring(L.cursorEnd)}catch(H){}},L.restoreByAfter=function(H){if(H===void 0)return!1;var G=L.input.value,U=G.lastIndexOf(H);if(U===-1)return!1;var B=L.cursorBefore.length;return L.lastKeyCode===f.a.DELETE&&L.cursorBefore.charAt(B-1)===H[0]?(L.fixCaret(B,B),!0):U+H.length===G.length?(L.fixCaret(U,U),!0):!1},L.partRestoreByAfter=function(H){return H===void 0?!1:Array.prototype.some.call(H,function(G,U){var B=H.substring(U);return L.restoreByAfter(B)})},L.isNotCompleteNumber=function(H){return isNaN(H)||H===""||H===null||H&&H.toString().indexOf(".")===H.toString().length-1},L.stop=function(){L.autoStepTimer&&clearTimeout(L.autoStepTimer)},L.down=function(H,G,U){L.pressingUpOrDown=!0,L.step("down",H,G,U)},L.up=function(H,G,U){L.pressingUpOrDown=!0,L.step("up",H,G,U)},L.saveInput=function(H){L.input=H};var X=F.value;X===void 0&&(X=F.defaultValue),L.state={focused:F.autoFocus};var z=L.getValidValue(L.toNumber(X));return L.state=d(d({},L.state),{},{inputValue:L.toPrecisionAsStep(z),value:z}),L}return Object(R.a)(j,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(L){var X=this.props,z=X.value,H=X.onChange,G=X.max,U=X.min,B=this.state.focused;if(L){if(!D(L.value,z)||!D(L.max,G)||!D(L.min,U)){var W=B?z:this.getValidValue(z),te;this.pressingUpOrDown?te=W:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:te})}var de="value"in this.props?z:this.state.value;"max"in this.props&&L.max!==G&&typeof de=="number"&&de>G&&H&&H(G),"min"in this.props&&L.min!==U&&typeof de=="number"&&de1&&arguments[1]!==void 0?arguments[1]:this.props.min,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,H=parseFloat(L);return isNaN(H)?L:(Hz&&(H=z),H)}},{key:"setValue",value:function(L,X){var z=this.props.precision,H=this.isNotCompleteNumber(parseFloat(L))?null:parseFloat(L),G=this.state.value,U=G===void 0?null:G,B=this.state.inputValue,W=B===void 0?null:B,te=typeof H=="number"?H.toFixed(z):"".concat(H),de=H!==U||te!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},X)):this.setState({value:H,inputValue:this.toPrecisionAsStep(L)},X),de&&this.props.onChange(H),H}},{key:"getMaxPrecision",value:function(L){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.props,H=z.precision,G=z.step;if(i(H))return H;var U=this.getPrecision(X),B=this.getPrecision(G),W=this.getPrecision(L);return L?Math.max(W,U+B):U+B}},{key:"getPrecisionFactor",value:function(L){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.getMaxPrecision(L,X);return Math.pow(10,z)}},{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(L){return this.props.formatter?this.props.formatter(L):L}},{key:"toPrecisionAsStep",value:function(L){if(this.isNotCompleteNumber(L)||L==="")return L;var X=Math.abs(this.getMaxPrecision(L));return isNaN(X)?L.toString():Number(L).toFixed(X)}},{key:"toNumber",value:function(L){var X=this.props.precision,z=this.state.focused,H=L&&L.length>16&&z;return this.isNotCompleteNumber(L)||H?L:i(X)?Math.round(L*Math.pow(10,X))/Math.pow(10,X):Number(L)}},{key:"upStep",value:function(L,X){var z=this.props.step,H=this.getPrecisionFactor(L,X),G=Math.abs(this.getMaxPrecision(L,X)),U=((H*L+H*z*X)/H).toFixed(G);return this.toNumber(U)}},{key:"downStep",value:function(L,X){var z=this.props.step,H=this.getPrecisionFactor(L,X),G=Math.abs(this.getMaxPrecision(L,X)),U=((H*L-H*z*X)/H).toFixed(G);return this.toNumber(U)}},{key:"step",value:function(L,X){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),X&&(X.persist(),X.preventDefault());var U=this.props;if(U.disabled)return;var B=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(B))return;var W=this["".concat(L,"Step")](B,H),te=W>U.max||WU.max?W=U.max:W=fe),$e=(ze||ze===0)&&(isNaN(ze)||Number(ze)<=be),Ie=We||H||G,Oe=$e||H||G,Le=r()("".concat(z,"-handler"),"".concat(z,"-handler-up"),Object(m.a)({},"".concat(z,"-handler-up-disabled"),Ie)),Te=r()("".concat(z,"-handler"),"".concat(z,"-handler-down"),Object(m.a)({},"".concat(z,"-handler-down-disabled"),Oe)),Ae=U?{onTouchStart:Ie?l:this.up,onTouchEnd:this.stop}:{onMouseDown:Ie?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ke=U?{onTouchStart:Oe?l:this.down,onTouchEnd:this.stop}:{onMouseDown:Oe?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return s.a.createElement("div",{className:Ye,style:Ce,title:ue,onMouseEnter:ge,onMouseLeave:pe,onMouseOver:oe,onMouseOut:ae,onFocus:function(){return null},onBlur:function(){return null}},s.a.createElement("div",{className:"".concat(z,"-handler-wrap")},s.a.createElement("span",Object.assign({unselectable:"on"},Ae,{role:"button","aria-label":"Increase Value","aria-disabled":Ie,className:Le}),W||s.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-up-inner"),onClick:n})),s.a.createElement("span",Object.assign({unselectable:"on"},ke,{role:"button","aria-label":"Decrease Value","aria-disabled":Oe,className:Te}),te||s.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-down-inner"),onClick:n}))),s.a.createElement("div",{className:"".concat(z,"-input-wrap")},s.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":be,"aria-valuemax":fe,"aria-valuenow":ze,required:re,type:ie,placeholder:we,onPaste:je,onClick:he,onMouseUp:this.onMouseUp,className:"".concat(z,"-input"),tabIndex:Q,autoComplete:B,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:l,onKeyUp:tt?this.onKeyUp:l,autoFocus:xe,maxLength:Ee,readOnly:G,disabled:H,max:fe,min:be,step:Z,name:_e,title:ue,id:ne,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(rt),pattern:V,inputMode:J,onInput:Be},Re))))}}]),j}(s.a.Component);k.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:o,required:!1,autoComplete:"off"};var c=k,b=q.a=c},e7zE:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("3y9D"),N("WYAk"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.Base,T=S.WordArray,g=m.algo,C=g.SHA1,h=g.HMAC,s=g.PBKDF2=R.extend({cfg:R.extend({keySize:128/32,hasher:C,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,r){for(var f=this.cfg,p=h.create(f.hasher,a),d=T.create(),E=T.create([1]),y=d.words,l=E.words,n=f.keySize,o=f.iterations;y.length0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ce=fe.length,ue=be.length;if(Math.abs(Ce-ue)!==1)return{add:!1,key:null};function ge(pe,oe){var ae=new Map;pe.forEach(function(he){ae.set(he,!0)});var re=oe.filter(function(he){return!ae.has(he)});return re.length===1?re[0]:null}return Ce ").concat(be);return be}var H=function(be,Ce){var ue=be.prefixCls,ge=be.data,pe=be.selectable,oe=be.checkable,ae=be.expandedKeys,re=be.selectedKeys,he=be.checkedKeys,Q=be.loadedKeys,ie=be.loadingKeys,we=be.halfCheckedKeys,ne=be.keyEntities,J=be.disabled,V=be.dragging,Z=be.dragOverNodeKey,Ee=be.dropPosition,xe=be.motion,_e=be.height,je=be.itemHeight,Be=be.virtual,He=be.focusable,Ue=be.activeItem,ze=be.focused,Ge=be.tabIndex,Ye=be.onKeyDown,Re=be.onFocus,tt=be.onBlur,rt=be.onActiveChange,We=be.onListChangeStart,$e=be.onListChangeEnd,Ie=Object(l.a)(be,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),Oe=h.useRef(null);h.useImperativeHandle(Ce,function(){return{scrollTo:function(Ct){Oe.current.scrollTo(Ct)}}});var Le=h.useState(ae),Te=Object(y.a)(Le,2),Ae=Te[0],ke=Te[1],Me=h.useState(ge),Fe=Object(y.a)(Me,2),Xe=Fe[0],qe=Fe[1],pt=h.useState(ge),at=Object(y.a)(pt,2),ft=at[0],Et=at[1],xt=h.useState([]),lt=Object(y.a)(xt,2),Wt=lt[0],It=lt[1],ir=h.useState(null),$t=Object(y.a)(ir,2),At=$t[0],Rt=$t[1];function hr(){qe(ge),Et(ge),It([]),Rt(null),$e()}h.useEffect(function(){ke(ae);var dt=D(Ae,ae);if(dt.key!==null)if(dt.add){var Ct=Xe.findIndex(function(Bt){var fr=Bt.data.key;return fr===dt.key}),Xt=L(k(Xe,ge,dt.key),Be,_e,je),Jt=Xe.slice();Jt.splice(Ct+1,0,F),Et(Jt),It(Xt),Rt("show")}else{var Mt=ge.findIndex(function(Bt){var fr=Bt.data.key;return fr===dt.key}),Pt=L(k(ge,Xe,dt.key),Be,_e,je),gt=ge.slice();gt.splice(Mt+1,0,F),Et(gt),It(Pt),Rt("hide")}else Xe!==ge&&(qe(ge),Et(ge))},[ae,ge]),h.useEffect(function(){V||hr()},[V]);var St=xe?ft:ge,Je={expandedKeys:ae,selectedKeys:re,loadedKeys:Q,loadingKeys:ie,checkedKeys:he,halfCheckedKeys:we,dragOverNodeKey:Z,dropPosition:Ee,keyEntities:ne};return h.createElement(h.Fragment,null,ze&&Ue&&h.createElement("span",{style:c,"aria-live":"assertive"},z(Ue)),h.createElement("div",{role:"tree"},h.createElement("input",{style:c,disabled:He===!1||J,tabIndex:He!==!1?Ge:null,onKeyDown:Ye,onFocus:Re,onBlur:tt,value:"",onChange:b})),h.createElement(n.a,Object.assign({},Ie,{data:St,itemKey:X,height:_e,fullHeight:!1,virtual:Be,itemHeight:je,prefixCls:"".concat(ue,"-list"),ref:Oe}),function(dt){var Ct=dt.pos,Xt=dt.data,Jt=Xt.key,Mt=Object(l.a)(Xt,["key"]),Pt=dt.isStart,gt=dt.isEnd,Bt=Object(E.e)(Jt,Ct);delete Mt.children;var fr=Object(E.f)(Bt,Je);return h.createElement(i,Object.assign({},Mt,fr,{active:Ue&&Jt===Ue.data.key,pos:Ct,data:dt.data,isStart:Pt,isEnd:gt,motion:xe,motionNodes:Jt===x?Wt:null,motionType:At,onMotionStart:We,onMotionEnd:hr,treeNodeRequiredProps:Je,onMouseMove:function(){rt(null)}}))}))},G=h.forwardRef(H);G.displayName="NodeList";var U=G,B=N("NvD2"),W=function(fe){Object(g.a)(Ce,fe);var be=Object(C.a)(Ce);function Ce(){var ue;return Object(R.a)(this,Ce),ue=be.apply(this,arguments),ue.destroyed=!1,ue.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ue.listRef=h.createRef(),ue.onNodeDragStart=function(ge,pe){var oe=ue.state,ae=oe.expandedKeys,re=oe.keyEntities,he=ue.props.onDragStart,Q=pe.props.eventKey;ue.dragNode=pe;var ie=Object(d.b)(ae,Q);ue.setState({dragging:!0,dragNodesKeys:Object(d.g)(Q,re)}),ue.setExpandedKeys(ie),he&&he({event:ge,node:Object(E.b)(pe.props)})},ue.onNodeDragEnter=function(ge,pe){var oe=ue.state,ae=oe.expandedKeys,re=oe.keyEntities,he=oe.dragNodesKeys,Q=ue.props.onDragEnter,ie=pe.props,we=ie.pos,ne=ie.eventKey;if(!ue.dragNode||he.indexOf(ne)!==-1)return;var J=Object(d.c)(ge,pe);if(ue.dragNode.props.eventKey===ne&&J===0){ue.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ue.setState({dragOverNodeKey:ne,dropPosition:J}),ue.delayedDragEnterLogic||(ue.delayedDragEnterLogic={}),Object.keys(ue.delayedDragEnterLogic).forEach(function(V){clearTimeout(ue.delayedDragEnterLogic[V])}),ue.delayedDragEnterLogic[we]=window.setTimeout(function(){if(!ue.state.dragging)return;var V=Object(S.a)(ae),Z=re[ne];Z&&(Z.children||[]).length&&(V=Object(d.a)(ae,ne)),"expandedKeys"in ue.props||ue.setExpandedKeys(V),Q&&Q({event:ge,node:Object(E.b)(pe.props),expandedKeys:V})},400)},0)},ue.onNodeDragOver=function(ge,pe){var oe=ue.state.dragNodesKeys,ae=ue.props.onDragOver,re=pe.props.eventKey;if(oe.indexOf(re)!==-1)return;if(ue.dragNode&&re===ue.state.dragOverNodeKey){var he=Object(d.c)(ge,pe);if(he===ue.state.dropPosition)return;ue.setState({dropPosition:he})}ae&&ae({event:ge,node:Object(E.b)(pe.props)})},ue.onNodeDragLeave=function(ge,pe){var oe=ue.props.onDragLeave;ue.setState({dragOverNodeKey:""}),oe&&oe({event:ge,node:Object(E.b)(pe.props)})},ue.onNodeDragEnd=function(ge,pe){var oe=ue.props.onDragEnd;ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),oe&&oe({event:ge,node:Object(E.b)(pe.props)}),ue.dragNode=null},ue.onNodeDrop=function(ge,pe){var oe=ue.state,ae=oe.dragNodesKeys,re=ae===void 0?[]:ae,he=oe.dropPosition,Q=ue.props.onDrop,ie=pe.props,we=ie.eventKey,ne=ie.pos;if(ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),re.indexOf(we)!==-1){Object(a.a)(!1,"Can not drop to dragNode(include it's children node)");return}var J=Object(d.k)(ne),V={event:ge,node:Object(E.b)(pe.props),dragNode:ue.dragNode?Object(E.b)(ue.dragNode.props):null,dragNodesKeys:re.slice(),dropPosition:he+Number(J[J.length-1]),dropToGap:!1};he!==0&&(V.dropToGap=!0),Q&&Q(V),ue.dragNode=null},ue.cleanDragState=function(){var ge=ue.state.dragging;ge&&ue.setState({dragging:!1})},ue.onNodeClick=function(ge,pe){var oe=ue.props.onClick;oe&&oe(ge,pe)},ue.onNodeDoubleClick=function(ge,pe){var oe=ue.props.onDoubleClick;oe&&oe(ge,pe)},ue.onNodeSelect=function(ge,pe){var oe=ue.state.selectedKeys,ae=ue.state.keyEntities,re=ue.props,he=re.onSelect,Q=re.multiple,ie=pe.selected,we=pe.key,ne=!ie;ne?Q?oe=Object(d.a)(oe,we):oe=[we]:oe=Object(d.b)(oe,we);var J=oe.map(function(V){var Z=ae[V];return Z?Z.node:null}).filter(function(V){return V});ue.setUncontrolledState({selectedKeys:oe}),he&&he(oe,{event:"select",selected:ne,node:pe,selectedNodes:J,nativeEvent:ge.nativeEvent})},ue.onNodeCheck=function(ge,pe,oe){var ae=ue.state,re=ae.keyEntities,he=ae.checkedKeys,Q=ae.halfCheckedKeys,ie=ue.props,we=ie.checkStrictly,ne=ie.onCheck,J=pe.key,V,Z={event:"check",node:pe,checked:oe,nativeEvent:ge.nativeEvent};if(we){var Ee=oe?Object(d.a)(he,J):Object(d.b)(he,J),xe=Object(d.b)(Q,J);V={checked:Ee,halfChecked:xe},Z.checkedNodes=Ee.map(function(ze){return re[ze]}).filter(function(ze){return ze}).map(function(ze){return ze.node}),ue.setUncontrolledState({checkedKeys:Ee})}else{var _e=Object(B.a)([].concat(Object(S.a)(he),[J]),!0,re),je=_e.checkedKeys,Be=_e.halfCheckedKeys;if(!oe){var He=new Set(je);He.delete(J);var Ue=Object(B.a)(Array.from(He),{checked:!1,halfCheckedKeys:Be},re);je=Ue.checkedKeys,Be=Ue.halfCheckedKeys}V=je,Z.checkedNodes=[],Z.checkedNodesPositions=[],Z.halfCheckedKeys=Be,je.forEach(function(ze){var Ge=re[ze];if(!Ge)return;var Ye=Ge.node,Re=Ge.pos;Z.checkedNodes.push(Ye),Z.checkedNodesPositions.push({node:Ye,pos:Re})}),ue.setUncontrolledState({checkedKeys:je},!1,{halfCheckedKeys:Be})}ne&&ne(V,Z)},ue.onNodeLoad=function(ge){return new Promise(function(pe){ue.setState(function(oe){var ae=oe.loadedKeys,re=ae===void 0?[]:ae,he=oe.loadingKeys,Q=he===void 0?[]:he,ie=ue.props,we=ie.loadData,ne=ie.onLoad,J=ge.key;if(!we||re.indexOf(J)!==-1||Q.indexOf(J)!==-1)return{};var V=we(ge);return V.then(function(){var Z=ue.state,Ee=Z.loadedKeys,xe=Z.loadingKeys,_e=Object(d.a)(Ee,J),je=Object(d.b)(xe,J);ne&&ne(_e,{event:"load",node:ge}),ue.setUncontrolledState({loadedKeys:_e}),ue.setState({loadingKeys:je}),pe()}),{loadingKeys:Object(d.a)(Q,J)}})})},ue.onNodeMouseEnter=function(ge,pe){var oe=ue.props.onMouseEnter;oe&&oe({event:ge,node:pe})},ue.onNodeMouseLeave=function(ge,pe){var oe=ue.props.onMouseLeave;oe&&oe({event:ge,node:pe})},ue.onNodeContextMenu=function(ge,pe){var oe=ue.props.onRightClick;oe&&(ge.preventDefault(),oe({event:ge,node:pe}))},ue.onFocus=function(){var ge=ue.props.onFocus;ue.setState({focused:!0}),ge&&ge.apply(void 0,arguments)},ue.onBlur=function(){var ge=ue.props.onBlur;ue.setState({focused:!1}),ue.onActiveChange(null),ge&&ge.apply(void 0,arguments)},ue.getTreeNodeRequiredProps=function(){var ge=ue.state,pe=ge.expandedKeys,oe=ge.selectedKeys,ae=ge.loadedKeys,re=ge.loadingKeys,he=ge.checkedKeys,Q=ge.halfCheckedKeys,ie=ge.dragOverNodeKey,we=ge.dropPosition,ne=ge.keyEntities;return{expandedKeys:pe||[],selectedKeys:oe||[],loadedKeys:ae||[],loadingKeys:re||[],checkedKeys:he||[],halfCheckedKeys:Q||[],dragOverNodeKey:ie,dropPosition:we,keyEntities:ne}},ue.setExpandedKeys=function(ge){var pe=ue.state.treeData,oe=Object(E.d)(pe,ge);ue.setUncontrolledState({expandedKeys:ge,flattenNodes:oe},!0)},ue.onNodeExpand=function(ge,pe){var oe=ue.state.expandedKeys,ae=ue.state.listChanging,re=ue.props,he=re.onExpand,Q=re.loadData,ie=pe.key,we=pe.expanded;if(ae)return;var ne=oe.indexOf(ie),J=!we;if(Object(a.a)(we&&ne!==-1||!we&&ne===-1,"Expand state not sync with index check"),J?oe=Object(d.a)(oe,ie):oe=Object(d.b)(oe,ie),ue.setExpandedKeys(oe),he&&he(oe,{node:pe,expanded:J,nativeEvent:ge.nativeEvent}),J&&Q){var V=ue.onNodeLoad(pe);V&&V.then(function(){var Z=Object(E.d)(ue.state.treeData,oe);ue.setUncontrolledState({flattenNodes:Z})})}},ue.onListChangeStart=function(){ue.setUncontrolledState({listChanging:!0})},ue.onListChangeEnd=function(){setTimeout(function(){ue.setUncontrolledState({listChanging:!1})})},ue.onActiveChange=function(ge){var pe=ue.state.activeKey,oe=ue.props.onActiveChange;if(pe===ge)return;ue.setState({activeKey:ge}),ge!==null&&ue.scrollTo({key:ge}),oe&&oe(ge)},ue.getActiveItem=function(){var ge=ue.state,pe=ge.activeKey,oe=ge.flattenNodes;return pe===null?null:oe.find(function(ae){var re=ae.data.key;return re===pe})||null},ue.offsetActiveKey=function(ge){var pe=ue.state,oe=pe.flattenNodes,ae=pe.activeKey,re=oe.findIndex(function(ie){var we=ie.data.key;return we===ae});re===-1&&ge<0&&(re=oe.length),re=(re+ge+oe.length)%oe.length;var he=oe[re];if(he){var Q=he.data.key;ue.onActiveChange(Q)}else ue.onActiveChange(null)},ue.onKeyDown=function(ge){var pe=ue.state,oe=pe.activeKey,ae=pe.expandedKeys,re=pe.checkedKeys,he=ue.props,Q=he.onKeyDown,ie=he.checkable,we=he.selectable;switch(ge.which){case s.a.UP:{ue.offsetActiveKey(-1),ge.preventDefault();break}case s.a.DOWN:{ue.offsetActiveKey(1),ge.preventDefault();break}}var ne=ue.getActiveItem();if(ne&&ne.data){var J=ue.getTreeNodeRequiredProps(),V=ne.data.isLeaf===!1||!!(ne.data.children||[]).length,Z=Object(E.b)(Object(m.a)(Object(m.a)({},Object(E.f)(oe,J)),{},{data:ne.data,active:!0}));switch(ge.which){case s.a.LEFT:{V&&ae.includes(oe)?ue.onNodeExpand({},Z):ne.parent&&ue.onActiveChange(ne.parent.data.key),ge.preventDefault();break}case s.a.RIGHT:{V&&!ae.includes(oe)?ue.onNodeExpand({},Z):ne.children&&ne.children.length&&ue.onActiveChange(ne.children[0].data.key),ge.preventDefault();break}case s.a.ENTER:case s.a.SPACE:{ie&&!Z.disabled&&Z.checkable!==!1&&!Z.disableCheckbox?ue.onNodeCheck({},Z,!re.includes(oe)):!ie&&we&&!Z.disabled&&Z.selectable!==!1&&ue.onNodeSelect({},Z);break}}}Q&&Q(ge)},ue.setUncontrolledState=function(ge){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ue.destroyed)return;var ae=!1,re=!0,he={};Object.keys(ge).forEach(function(Q){if(Q in ue.props){re=!1;return}ae=!0,he[Q]=ge[Q]}),ae&&(!pe||re)&&ue.setState(Object(m.a)(Object(m.a)({},he),oe))},ue.scrollTo=function(ge){ue.listRef.current.scrollTo(ge)},ue}return Object(T.a)(Ce,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ge,pe=this.state,oe=pe.focused,ae=pe.flattenNodes,re=pe.keyEntities,he=pe.dragging,Q=pe.activeKey,ie=this.props,we=ie.prefixCls,ne=ie.className,J=ie.style,V=ie.showLine,Z=ie.focusable,Ee=ie.tabIndex,xe=Ee===void 0?0:Ee,_e=ie.selectable,je=ie.showIcon,Be=ie.icon,He=ie.switcherIcon,Ue=ie.draggable,ze=ie.checkable,Ge=ie.checkStrictly,Ye=ie.disabled,Re=ie.motion,tt=ie.loadData,rt=ie.filterTreeNode,We=ie.height,$e=ie.itemHeight,Ie=ie.virtual,Oe=ie.titleRender,Le=ie.onContextMenu,Te=Object(d.f)(this.props);return h.createElement(p.a.Provider,{value:{prefixCls:we,selectable:_e,showIcon:je,icon:Be,switcherIcon:He,draggable:Ue,checkable:ze,checkStrictly:Ge,disabled:Ye,keyEntities:re,loadData:tt,filterTreeNode:rt,titleRender:Oe,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},h.createElement("div",{className:f()(we,ne,(ge={},Object(P.a)(ge,"".concat(we,"-show-line"),V),Object(P.a)(ge,"".concat(we,"-focused"),oe),Object(P.a)(ge,"".concat(we,"-active-focused"),Q!==null),ge))},h.createElement(U,Object.assign({ref:this.listRef,prefixCls:we,style:J,data:ae,disabled:Ye,selectable:_e,checkable:!!ze,motion:Re,dragging:he,height:We,itemHeight:$e,virtual:Ie,focusable:Z,focused:oe,tabIndex:xe,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Le},this.getTreeNodeRequiredProps(),Te))))}}],[{key:"getDerivedStateFromProps",value:function(ge,pe){var oe=pe.prevProps,ae={prevProps:ge};function re(Be){return!oe&&Be in ge||oe&&oe[Be]!==ge[Be]}var he;if(re("treeData")?he=ge.treeData:re("children")&&(Object(a.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),he=Object(E.c)(ge.children)),he){ae.treeData=he;var Q=Object(E.a)(he);ae.keyEntities=Object(m.a)(Object(P.a)({},x,j),Q.keyEntities)}var ie=ae.keyEntities||pe.keyEntities;if(re("expandedKeys")||oe&&re("autoExpandParent"))ae.expandedKeys=ge.autoExpandParent||!oe&&ge.defaultExpandParent?Object(d.e)(ge.expandedKeys,ie):ge.expandedKeys;else if(!oe&&ge.defaultExpandAll){var we=Object(m.a)({},ie);delete we[x],ae.expandedKeys=Object.keys(we).map(function(Be){return we[Be].key})}else!oe&&ge.defaultExpandedKeys&&(ae.expandedKeys=ge.autoExpandParent||ge.defaultExpandParent?Object(d.e)(ge.defaultExpandedKeys,ie):ge.defaultExpandedKeys);if(ae.expandedKeys||delete ae.expandedKeys,he||ae.expandedKeys){var ne=Object(E.d)(he||pe.treeData,ae.expandedKeys||pe.expandedKeys);ae.flattenNodes=ne}if(ge.selectable&&(re("selectedKeys")?ae.selectedKeys=Object(d.d)(ge.selectedKeys,ge):!oe&&ge.defaultSelectedKeys&&(ae.selectedKeys=Object(d.d)(ge.defaultSelectedKeys,ge))),ge.checkable){var J;if(re("checkedKeys")?J=Object(d.j)(ge.checkedKeys)||{}:!oe&&ge.defaultCheckedKeys?J=Object(d.j)(ge.defaultCheckedKeys)||{}:he&&(J=Object(d.j)(ge.checkedKeys)||{checkedKeys:pe.checkedKeys,halfCheckedKeys:pe.halfCheckedKeys}),J){var V=J,Z=V.checkedKeys,Ee=Z===void 0?[]:Z,xe=V.halfCheckedKeys,_e=xe===void 0?[]:xe;if(!ge.checkStrictly){var je=Object(B.a)(Ee,!0,ie);Ee=je.checkedKeys,_e=je.halfCheckedKeys}ae.checkedKeys=Ee,ae.halfCheckedKeys=_e}}return re("loadedKeys")&&(ae.loadedKeys=ge.loadedKeys),ae}}]),Ce}(h.Component);W.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},W.TreeNode=u.a;var te=W,de=q.b=te},fcSX:function(I,q,N){"use strict";var P=N("Ff2n"),m=N("1OyB"),S=N("vuIU"),R=N("Ji7U"),T=N("md7G"),g=N("foSv"),C=N("1W/9"),h=N("q1tI"),s=N("rePB"),a=N("JX7q"),r=N("TSYQ"),f=N.n(r),p=N("qx4F"),d=N("4IlW");function E(H){return Array.isArray(H)?H:[H]}var y={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(y).filter(function(H){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return H in(G?G.style:{})})[0],n=y[l];function o(H,G,U,B){H.addEventListener?H.addEventListener(G,U,B):H.attachEvent&&H.attachEvent("on".concat(G),U)}function u(H,G,U,B){H.removeEventListener?H.removeEventListener(G,U,B):H.attachEvent&&H.detachEvent("on".concat(G),U)}function w(H,G){var U=typeof H=="function"?H(G):H;return Array.isArray(U)?U.length===2?U:[U[0],U[1]]:[U]}var v=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},i=!(typeof window!="undefined"&&window.document&&window.document.createElement),D=function H(G,U,B,W){if(!U||U===document||U instanceof Document)return!1;if(U===G.parentNode)return!0;var te=Math.max(Math.abs(B),Math.abs(W))===Math.abs(W),de=Math.max(Math.abs(B),Math.abs(W))===Math.abs(B),fe=U.scrollHeight-U.clientHeight,be=U.scrollWidth-U.clientWidth,Ce=document.defaultView.getComputedStyle(U),ue=Ce.overflowY==="auto"||Ce.overflowY==="scroll",ge=Ce.overflowX==="auto"||Ce.overflowX==="scroll",pe=fe&&ue,oe=be&≥return te&&(!pe||pe&&(U.scrollTop>=fe&&W<0||U.scrollTop<=0&&W>0))||de&&(!oe||oe&&(U.scrollLeft>=be&&B<0||U.scrollLeft<=0&&B>0))?H(G,U.parentNode,B,W):!1};function k(H){var G=c();return function(){var B=Object(g.a)(H),W;if(G){var te=Object(g.a)(this).constructor;W=Reflect.construct(B,arguments,te)}else W=B.apply(this,arguments);return Object(T.a)(this,W)}}function c(){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(H){return!1}}var b={},x=function(H){Object(R.a)(U,H);var G=k(U);function U(B){var W;return Object(m.a)(this,U),W=G.call(this,B),W.domFocus=function(){W.dom&&W.dom.focus()},W.removeStartHandler=function(te){if(te.touches.length>1)return;W.startPos={x:te.touches[0].clientX,y:te.touches[0].clientY}},W.removeMoveHandler=function(te){if(te.changedTouches.length>1)return;var de=te.currentTarget,fe=te.changedTouches[0].clientX-W.startPos.x,be=te.changedTouches[0].clientY-W.startPos.y;(de===W.maskDom||de===W.handlerDom||de===W.contentDom&&D(de,te.target,fe,be))&&te.cancelable&&te.preventDefault()},W.transitionEnd=function(te){var de=te.target;u(de,n,W.transitionEnd),de.style.transition=""},W.onKeyDown=function(te){if(te.keyCode===d.a.ESC){var de=W.props.onClose;te.stopPropagation(),de&&de(te)}},W.onWrapperTransitionEnd=function(te){var de=W.props,fe=de.open,be=de.afterVisibleChange;te.target===W.contentWrapper&&te.propertyName.match(/transform$/)&&(W.dom.style.transition="",!fe&&W.getCurrentDrawerSome()&&(document.body.style.overflowX="",W.maskDom&&(W.maskDom.style.left="",W.maskDom.style.width="")),be&&be(!!fe))},W.openLevelTransition=function(){var te=W.props,de=te.open,fe=te.width,be=te.height,Ce=W.getHorizontalBoolAndPlacementName(),ue=Ce.isHorizontal,ge=Ce.placementName,pe=W.contentDom?W.contentDom.getBoundingClientRect()[ue?"width":"height"]:0,oe=(ue?fe:be)||pe;W.setLevelAndScrolling(de,ge,oe)},W.setLevelTransform=function(te,de,fe,be){var Ce=W.props,ue=Ce.placement,ge=Ce.levelMove,pe=Ce.duration,oe=Ce.ease,ae=Ce.showMask;W.levelDom.forEach(function(re){re.style.transition="transform ".concat(pe," ").concat(oe),o(re,n,W.transitionEnd);var he=te?fe:0;if(ge){var Q=w(ge,{target:re,open:te});he=te?Q[0]:Q[1]||0}var ie=typeof he=="number"?"".concat(he,"px"):he,we=ue==="left"||ue==="top"?ie:"-".concat(ie);we=ae&&ue==="right"&&be?"calc(".concat(we," + ").concat(be,"px)"):we,re.style.transform=he?"".concat(de,"(").concat(we,")"):""})},W.setLevelAndScrolling=function(te,de,fe){var be=W.props.onChange;if(!i){var Ce=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(p.a)(!0):0;W.setLevelTransform(te,de,fe,Ce),W.toggleScrollingToDrawerAndBody(Ce)}be&&be(te)},W.toggleScrollingToDrawerAndBody=function(te){var de=W.props,fe=de.getOpenCount,be=de.getContainer,Ce=de.showMask,ue=de.open,ge=be&&be(),pe=fe&&fe();if(ge&&ge.parentNode===document.body&&Ce){var oe=["touchstart"],ae=[document.body,W.maskDom,W.handlerDom,W.contentDom];ue&&document.body.style.overflow!=="hidden"?(te&&W.addScrollingEffect(te),pe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ae.forEach(function(re,he){if(!re)return;o(re,oe[he]||"touchmove",he?W.removeMoveHandler:W.removeStartHandler,W.passive)})):W.getCurrentDrawerSome()&&(pe||(document.body.style.overflow=""),document.body.style.touchAction="",te&&W.remScrollingEffect(te),ae.forEach(function(re,he){if(!re)return;u(re,oe[he]||"touchmove",he?W.removeMoveHandler:W.removeStartHandler,W.passive)}))}},W.addScrollingEffect=function(te){var de=W.props,fe=de.placement,be=de.duration,Ce=de.ease,ue=de.getOpenCount,ge=de.switchScrollingEffect,pe=ue&&ue();pe===1&&ge();var oe="width ".concat(be," ").concat(Ce),ae="transform ".concat(be," ").concat(Ce);W.dom.style.transition="none";switch(fe){case"right":W.dom.style.transform="translateX(-".concat(te,"px)");break;case"top":case"bottom":W.dom.style.width="calc(100% - ".concat(te,"px)"),W.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(W.timeout),W.timeout=setTimeout(function(){W.dom&&(W.dom.style.transition="".concat(ae,",").concat(oe),W.dom.style.width="",W.dom.style.transform="")})},W.remScrollingEffect=function(te){var de=W.props,fe=de.placement,be=de.duration,Ce=de.ease,ue=de.getOpenCount,ge=de.switchScrollingEffect,pe=ue&&ue();pe||ge(!0),l&&(document.body.style.overflowX="hidden"),W.dom.style.transition="none";var oe,ae="width ".concat(be," ").concat(Ce),re="transform ".concat(be," ").concat(Ce);switch(fe){case"left":{W.dom.style.width="100%",ae="width 0s ".concat(Ce," ").concat(be);break}case"right":{W.dom.style.transform="translateX(".concat(te,"px)"),W.dom.style.width="100%",ae="width 0s ".concat(Ce," ").concat(be),W.maskDom&&(W.maskDom.style.left="-".concat(te,"px"),W.maskDom.style.width="calc(100% + ".concat(te,"px)"));break}case"top":case"bottom":{W.dom.style.width="calc(100% + ".concat(te,"px)"),W.dom.style.height="100%",W.dom.style.transform="translateZ(0)",oe="height 0s ".concat(Ce," ").concat(be);break}default:break}clearTimeout(W.timeout),W.timeout=setTimeout(function(){W.dom&&(W.dom.style.transition="".concat(re,",").concat(oe?"".concat(oe,","):"").concat(ae),W.dom.style.transform="",W.dom.style.width="",W.dom.style.height="")})},W.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(te){return b[te]})},W.getLevelDom=function(te){var de=te.level,fe=te.getContainer;if(i)return;var be=fe&&fe(),Ce=be?be.parentNode:null;if(W.levelDom=[],de==="all"){var ue=Ce?Array.prototype.slice.call(Ce.children):[];ue.forEach(function(ge){ge.nodeName!=="SCRIPT"&&ge.nodeName!=="STYLE"&&ge.nodeName!=="LINK"&&ge!==be&&W.levelDom.push(ge)})}else de&&E(de).forEach(function(ge){document.querySelectorAll(ge).forEach(function(pe){W.levelDom.push(pe)})})},W.getHorizontalBoolAndPlacementName=function(){var te=W.props.placement,de=te==="left"||te==="right",fe="translate".concat(de?"X":"Y");return{isHorizontal:de,placementName:fe}},W.state={_self:Object(a.a)(W)},W}return Object(S.a)(U,[{key:"componentDidMount",value:function(){var W=this;if(!i){var te=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return te=!0,null}}))}catch(ue){}this.passive=te?{passive:!1}:!1}var de=this.props,fe=de.open,be=de.getContainer,Ce=be&&be();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),fe&&(Ce&&Ce.parentNode===document.body&&(b[this.drawerId]=fe),this.openLevelTransition(),this.forceUpdate(function(){W.domFocus()}))}},{key:"componentDidUpdate",value:function(W){var te=this.props,de=te.open,fe=te.getContainer,be=fe&&fe();de!==W.open&&(de&&this.domFocus(),be&&be.parentNode===document.body&&(b[this.drawerId]=!!de),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var W=this.props,te=W.getOpenCount,de=W.open,fe=W.switchScrollingEffect,be=typeof te=="function"&&te();delete b[this.drawerId],de&&(this.setLevelTransform(!1),document.body.style.touchAction=""),be||(document.body.style.overflow="",fe(!0))}},{key:"render",value:function(){var W,te=this,de=this.props,fe=de.className,be=de.children,Ce=de.style,ue=de.width,ge=de.height,pe=de.defaultOpen,oe=de.open,ae=de.prefixCls,re=de.placement,he=de.level,Q=de.levelMove,ie=de.ease,we=de.duration,ne=de.getContainer,J=de.handler,V=de.onChange,Z=de.afterVisibleChange,Ee=de.showMask,xe=de.maskClosable,_e=de.maskStyle,je=de.onClose,Be=de.onHandleClick,He=de.keyboard,Ue=de.getOpenCount,ze=de.switchScrollingEffect,Ge=Object(P.a)(de,["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"]),Ye=this.dom?oe:!1,Re=f()(ae,(W={},Object(s.a)(W,"".concat(ae,"-").concat(re),!0),Object(s.a)(W,"".concat(ae,"-open"),Ye),Object(s.a)(W,fe||"",!!fe),Object(s.a)(W,"no-mask",!Ee),W)),tt=this.getHorizontalBoolAndPlacementName(),rt=tt.placementName,We=re==="left"||re==="top"?"-100%":"100%",$e=Ye?"":"".concat(rt,"(").concat(We,")"),Ie=J&&h.cloneElement(J,{onClick:function(Le){J.props.onClick&&J.props.onClick(),Be&&Be(Le)},ref:function(Le){te.handlerDom=Le}});return h.createElement("div",Object.assign({},Ge,{tabIndex:-1,className:Re,style:Ce,ref:function(Le){te.dom=Le},onKeyDown:Ye&&He?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Ee&&h.createElement("div",{className:"".concat(ae,"-mask"),onClick:xe?je:void 0,style:_e,ref:function(Le){te.maskDom=Le}}),h.createElement("div",{className:"".concat(ae,"-content-wrapper"),style:{transform:$e,msTransform:$e,width:v(ue)?"".concat(ue,"px"):ue,height:v(ge)?"".concat(ge,"px"):ge},ref:function(Le){te.contentWrapper=Le}},h.createElement("div",{className:"".concat(ae,"-content"),ref:function(Le){te.contentDom=Le},onTouchStart:Ye&&Ee?this.removeStartHandler:void 0,onTouchMove:Ye&&Ee?this.removeMoveHandler:void 0},be),Ie))}}],[{key:"getDerivedStateFromProps",value:function(W,te){var de=te.prevProps,fe=te._self,be={prevProps:W};if(de!==void 0){var Ce=W.placement,ue=W.level;Ce!==de.placement&&(fe.contentDom=null),ue!==de.level&&fe.getLevelDom(W)}return be}}]),U}(h.Component);x.defaultProps={switchScrollingEffect:function(){}};var _=x;function j(H){var G=F();return function(){var B=Object(g.a)(H),W;if(G){var te=Object(g.a)(this).constructor;W=Reflect.construct(B,arguments,te)}else W=B.apply(this,arguments);return Object(T.a)(this,W)}}function F(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(H){return!1}}var L=function(H){Object(R.a)(U,H);var G=j(U);function U(B){var W;Object(m.a)(this,U),W=G.call(this,B),W.onHandleClick=function(de){var fe=W.props,be=fe.onHandleClick,Ce=fe.open;if(be&&be(de),typeof Ce=="undefined"){var ue=W.state.open;W.setState({open:!ue})}},W.onClose=function(de){var fe=W.props,be=fe.onClose,Ce=fe.open;be&&be(de),typeof Ce=="undefined"&&W.setState({open:!1})};var te=typeof B.open!="undefined"?B.open:!!B.defaultOpen;return W.state={open:te},"onMaskClick"in B&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),W}return Object(S.a)(U,[{key:"render",value:function(){var W=this,te=this.props,de=te.defaultOpen,fe=te.getContainer,be=te.wrapperClassName,Ce=te.forceRender,ue=te.handler,ge=Object(P.a)(te,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),pe=this.state.open;if(!fe)return h.createElement("div",{className:be,ref:function(re){W.dom=re}},h.createElement(_,Object.assign({},ge,{open:pe,handler:ue,getContainer:function(){return W.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var oe=!!ue||Ce;return h.createElement(C.a,{visible:pe,forceRender:oe,getContainer:fe,wrapperClassName:be},function(ae){var re=ae.visible,he=ae.afterClose,Q=Object(P.a)(ae,["visible","afterClose"]);return h.createElement(_,Object.assign({},ge,Q,{open:re!==void 0?re:pe,afterVisibleChange:he!==void 0?he:ge.afterVisibleChange,handler:ue,onClose:W.onClose,onHandleClick:W.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(W,te){var de=te.prevProps,fe={prevProps:W};return typeof de!="undefined"&&W.open!==de.open&&(fe.open=W.open),fe}}]),U}(h.Component);L.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:h.createElement("div",{className:"drawer-handle"},h.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var X=L,z=q.a=X},fcyK:function(I,q,N){},gRFJ:function(I,q,N){I.exports=[N("rdUC"),N("ynwM"),N("RELg"),N("DlR+"),N("CrYA"),N("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(q){var N=meta[q];return typeof N=="string"?N:"\\u"+("0000"+q.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+I+'"'}function str(I,q){var N,P,m,S,R=gap,T,g=q[I];g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(I)),typeof rep=="function"&&(g=rep.call(q,I,g));switch(typeof g){case"string":return quote(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(gap+=indent,T=[],Object.prototype.toString.apply(g)==="[object Array]"){for(S=g.length,N=0;Nz.length)&&(H=z.length);for(var G=0,U=new Array(H);G=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,U))continue;G[U]=z[U]}}return G}function E(z,H){if(z==null)return{};var G={},U=Object.keys(z),B,W;for(W=0;W=0)continue;G[B]=z[B]}return G}var y=function(H){var G=H.className,U=H.percent,B=H.prefixCls,W=H.strokeColor,te=H.strokeLinecap,de=H.strokeWidth,fe=H.style,be=H.trailColor,Ce=H.trailWidth,ue=H.transition,ge=d(H,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ge.gapPosition;var pe=Array.isArray(U)?U:[U],oe=Array.isArray(W)?W:[W],ae=g(pe),re=h(ae,1),he=re[0],Q=de/2,ie=100-de/2,we="M ".concat(te==="round"?Q:0,",").concat(Q,` L `).concat(te==="round"?ie:100,",").concat(Q),ne="0 0 100 ".concat(de),J=0;return m.a.createElement("svg",C({className:R()("".concat(B,"-line"),G),viewBox:ne,preserveAspectRatio:"none",style:fe},ge),m.a.createElement("path",{className:"".concat(B,"-line-trail"),d:we,strokeLinecap:te,stroke:be,strokeWidth:Ce||de,fillOpacity:"0"}),pe.map(function(V,Z){var Ee={strokeDasharray:"".concat(V,"px, 100px"),strokeDashoffset:"-".concat(J,"px"),transition:ue||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},xe=oe[Z]||oe[oe.length-1];return J+=V,m.a.createElement("path",{key:Z,className:"".concat(B,"-line-path"),d:we,strokeLinecap:te,stroke:xe,strokeWidth:de,fillOpacity:"0",ref:he[Z],style:Ee})}))};y.defaultProps=T;var l=y;function n(){return n=Object.assign||function(z){for(var H=1;Hz.length)&&(H=z.length);for(var G=0,U=new Array(H);G=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,U))continue;G[U]=z[U]}}return G}function c(z,H){if(z==null)return{};var G={},U=Object.keys(z),B,W;for(W=0;W=0)continue;G[B]=z[B]}return G}var b=0;function x(z){return+z.replace("%","")}function _(z){return Array.isArray(z)?z:[z]}function j(z,H,G,U){var B=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,te=50-U/2,de=0,fe=-te,be=0,Ce=-2*te;switch(W){case"left":de=-te,fe=0,be=2*te,Ce=0;break;case"right":de=te,fe=0,be=-2*te,Ce=0;break;case"bottom":fe=te,Ce=2*te;break;default:}var ue="M 50,50 m ".concat(de,",").concat(fe,` a `).concat(te,",").concat(te," 0 1 1 ").concat(be,",").concat(-Ce,` a `).concat(te,",").concat(te," 0 1 1 ").concat(-be,",").concat(Ce),ge=Math.PI*2*te,pe={stroke:G,strokeDasharray:"".concat(H/100*(ge-B),"px ").concat(ge,"px"),strokeDashoffset:"-".concat(B/2+z/100*(ge-B),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ue,pathStyle:pe}}var F=function(H){var G=H.prefixCls,U=H.strokeWidth,B=H.trailWidth,W=H.gapDegree,te=H.gapPosition,de=H.trailColor,fe=H.strokeLinecap,be=H.style,Ce=H.className,ue=H.strokeColor,ge=H.percent,pe=k(H,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),oe=Object(P.useMemo)(function(){return b+=1,b},[]),ae=j(0,100,de,U,W,te),re=ae.pathString,he=ae.pathStyle,Q=_(ge),ie=_(ue),we=ie.find(function(Ee){return Object.prototype.toString.call(Ee)==="[object Object]"}),ne=g(Q),J=o(ne,1),V=J[0],Z=function(){var xe=0;return Q.map(function(_e,je){var Be=ie[je]||ie[ie.length-1],He=Object.prototype.toString.call(Be)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(oe,")"):"",Ue=j(xe,_e,Be,U,W,te);return xe+=_e,m.a.createElement("path",{key:je,className:"".concat(G,"-circle-path"),d:Ue.pathString,stroke:He,strokeLinecap:fe,strokeWidth:U,opacity:_e===0?0:1,fillOpacity:"0",style:Ue.pathStyle,ref:V[je]})})};return m.a.createElement("svg",n({className:R()("".concat(G,"-circle"),Ce),viewBox:"0 0 100 100",style:be},pe),we&&m.a.createElement("defs",null,m.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(oe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(we).sort(function(Ee,xe){return x(Ee)-x(xe)}).map(function(Ee,xe){return m.a.createElement("stop",{key:xe,offset:Ee,stopColor:we[Ee]})}))),m.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:re,stroke:de,strokeLinecap:fe,strokeWidth:B||U,fillOpacity:"0",style:he}),Z().reverse())};F.defaultProps=T;var L=F,X={Line:l,Circle:L}},hQp1:function(I,q,N){"use strict";N.d(q,"a",function(){return m});var P;(function(S){S.FirstPage="firstPage",S.PrevPage="prevPage",S.NextPage="nextPage"})(P||(P={}));var m;(function(S){S[S.Single=0]="Single",S[S.Multiple=1]="Multiple",S[S.Judge=2]="Judge",S[S.Fill=3]="Fill",S[S.Subjective=4]="Subjective",S[S.Shixun=5]="Shixun",S[S.Program=6]="Program",S[S.Combine=7]="Combine"})(m||(m={}))},i3hx:function(I,q,N){},i58Z:function(I,q,N){I.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},jO9C:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){return P.pad.Iso97971={pad:function(m,S){m.concat(P.lib.WordArray.create([2147483648],1)),P.pad.ZeroPadding.pad(m,S)},unpad:function(m){P.pad.ZeroPadding.unpad(m),m.sigBytes--}},P.pad.Iso97971})},je13:function(I,q,N){var P=N("5nXd"),m=N("gRFJ"),S=[N("uQRt")];I.exports=P.createStore(m,S)},kSUc:function(I,q,N){},lOMy:function(I,q,N){},lPiR:function(I,q,N){(function(P,m){I.exports=q=m(N("Ib8C"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.WordArray,g=R.Hasher,C=S.algo,h=[],s=[];(function(){function f(y){for(var l=m.sqrt(y),n=2;n<=l;n++)if(!(y%n))return!1;return!0}function p(y){return(y-(y|0))*4294967296|0}for(var d=2,E=0;E<64;)f(d)&&(E<8&&(h[E]=p(m.pow(d,1/2))),s[E]=p(m.pow(d,1/3)),E++),d++})();var a=[],r=C.SHA256=g.extend({_doReset:function(){this._hash=new T.init(h.slice(0))},_doProcessBlock:function(f,p){for(var d=this._hash.words,E=d[0],y=d[1],l=d[2],n=d[3],o=d[4],u=d[5],w=d[6],v=d[7],i=0;i<64;i++){if(i<16)a[i]=f[p+i]|0;else{var D=a[i-15],k=(D<<25|D>>>7)^(D<<14|D>>>18)^D>>>3,c=a[i-2],b=(c<<15|c>>>17)^(c<<13|c>>>19)^c>>>10;a[i]=k+a[i-7]+b+a[i-16]}var x=o&u^~o&w,_=E&y^E&l^y&l,j=(E<<30|E>>>2)^(E<<19|E>>>13)^(E<<10|E>>>22),F=(o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25),L=v+F+x+s[i]+a[i],X=j+_;v=w,w=u,u=o,o=n+L|0,n=l,l=y,y=E,E=L+X|0}d[0]=d[0]+E|0,d[1]=d[1]+y|0,d[2]=d[2]+l|0,d[3]=d[3]+n|0,d[4]=d[4]+o|0,d[5]=d[5]+u|0,d[6]=d[6]+w|0,d[7]=d[7]+v|0},_doFinalize:function(){var f=this._data,p=f.words,d=this._nDataBytes*8,E=f.sigBytes*8;return p[E>>>5]|=128<<24-E%32,p[(E+64>>>9<<4)+14]=m.floor(d/4294967296),p[(E+64>>>9<<4)+15]=d,f.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var f=g.clone.call(this);return f._hash=this._hash.clone(),f}});S.SHA256=g._createHelper(r),S.HmacSHA256=g._createHmacHelper(r)}(Math),P.SHA256})},lZu9:function(I,q,N){(function(P){P(N("VrN/"),N("1eCo"),N("8EBN"))})(function(P){"use strict";P.defineMode("markdown",function(m,S){var R=P.getMode(m,"text/html"),T=R.name=="null";function g(U){if(P.findModeByName){var B=P.findModeByName(U);B&&(U=B.mime||B.mimes[0])}var W=P.getMode(m,U);return W.name=="null"?null:W}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 h in C)C.hasOwnProperty(h)&&S.tokenTypeOverrides[h]&&(C[h]=S.tokenTypeOverrides[h]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,a=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,r=/^\[(x| )\](?=\s)/i,f=S.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,y=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 o(U,B,W){return B.f=B.inline=W,W(U,B)}function u(U,B,W){return B.f=B.block=W,W(U,B)}function w(U){return!U||!/\S/.test(U.string)}function v(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==D){var B=T;if(!B){var W=P.innerMode(R,U.htmlState);B=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}B&&(U.f=x,U.block=i,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function i(U,B){var W=U.column()===B.indentation,te=w(B.prevLine.stream),de=B.indentedCode,fe=B.prevLine.hr,be=B.list!==!1,Ce=(B.listStack[B.listStack.length-1]||0)+3;B.indentedCode=!1;var ue=B.indentation;if(B.indentationDiff===null&&(B.indentationDiff=B.indentation,be)){for(B.list=null;ue=4&&(de||B.prevLine.fencedCodeEnd||B.prevLine.header||te))return U.skipToEnd(),B.indentedCode=!0,C.code;if(U.eatSpace())return null;if(W&&B.indentation<=Ce&&(oe=U.match(f))&&oe[1].length<=6)return B.quote=0,B.header=oe[1].length,B.thisLine.header=!0,S.highlightFormatting&&(B.formatting="header"),B.f=B.inline,c(B);if(B.indentation<=Ce&&U.eat(">"))return B.quote=W?1:B.quote+1,S.highlightFormatting&&(B.formatting="quote"),U.eatSpace(),c(B);if(!pe&&!B.setext&&W&&B.indentation<=Ce&&(oe=U.match(a))){var ae=oe[1]?"ol":"ul";return B.indentation=ue+U.current().length,B.list=!0,B.quote=0,B.listStack.push(B.indentation),B.em=!1,B.strong=!1,B.code=!1,B.strikethrough=!1,S.taskLists&&U.match(r,!1)&&(B.taskList=!0),B.f=B.inline,S.highlightFormatting&&(B.formatting=["list","list-"+ae]),c(B)}else{if(W&&B.indentation<=Ce&&(oe=U.match(E,!0)))return B.quote=0,B.fencedEndRE=new RegExp(oe[1]+"+ *$"),B.localMode=S.fencedCodeBlockHighlighting&&g(oe[2]||S.fencedCodeBlockDefaultMode),B.localMode&&(B.localState=P.startState(B.localMode)),B.f=B.block=k,S.highlightFormatting&&(B.formatting="code-block"),B.code=-1,c(B);if(B.setext||(!ge||!be)&&!B.quote&&B.list===!1&&!B.code&&!pe&&!y.test(U.string)&&(oe=U.lookAhead(1))&&(oe=oe.match(p)))return B.setext?(B.header=B.setext,B.setext=0,U.skipToEnd(),S.highlightFormatting&&(B.formatting="header")):(B.header=oe[0].charAt(0)=="="?1:2,B.setext=B.header),B.thisLine.header=!0,B.f=B.inline,c(B);if(pe)return U.skipToEnd(),B.hr=!0,B.thisLine.hr=!0,C.hr;if(U.peek()==="[")return o(U,B,X)}return o(U,B,B.inline)}function D(U,B){var W=R.token(U,B.htmlState);if(!T){var te=P.innerMode(R,B.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||B.md_inside&&U.current().indexOf(">")>-1)&&(B.f=x,B.block=i,B.htmlState=null)}return W}function k(U,B){var W=B.listStack[B.listStack.length-1]||0,te=B.indentation=U.quote?B.push(C.formatting+"-"+U.formatting[W]+"-"+U.quote):B.push("error"))}if(U.taskOpen)return B.push("meta"),B.length?B.join(" "):null;if(U.taskClosed)return B.push("property"),B.length?B.join(" "):null;if(U.linkHref?B.push(C.linkHref,"url"):(U.strong&&B.push(C.strong),U.em&&B.push(C.em),U.strikethrough&&B.push(C.strikethrough),U.emoji&&B.push(C.emoji),U.linkText&&B.push(C.linkText),U.code&&B.push(C.code),U.image&&B.push(C.image),U.imageAltText&&B.push(C.imageAltText,"link"),U.imageMarker&&B.push(C.imageMarker)),U.header&&B.push(C.header,C.header+"-"+U.header),U.quote&&(B.push(C.quote),!S.maxBlockquoteDepth||S.maxBlockquoteDepth>=U.quote?B.push(C.quote+"-"+U.quote):B.push(C.quote+"-"+S.maxBlockquoteDepth)),U.list!==!1){var te=(U.listStack.length-1)%3;te?te===1?B.push(C.list2):B.push(C.list3):B.push(C.list1)}return U.trailingSpaceNewLine?B.push("trailing-space-new-line"):U.trailingSpace&&B.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),B.length?B.join(" "):null}function b(U,B){return U.match(d,!0)?c(B):void 0}function x(U,B){var W=B.text(U,B);if(typeof W!="undefined")return W;if(B.list)return B.list=null,c(B);if(B.taskList){var te=U.match(r,!0)[1]===" ";return te?B.taskOpen=!0:B.taskClosed=!0,S.highlightFormatting&&(B.formatting="task"),B.taskList=!1,c(B)}if(B.taskOpen=!1,B.taskClosed=!1,B.header&&U.match(/^#+$/,!0))return S.highlightFormatting&&(B.formatting="header"),c(B);var de=U.next();if(B.linkTitle){B.linkTitle=!1;var fe=de;de==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var be="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(U.match(new RegExp(be),!0))return C.linkHref}if(de==="`"){var Ce=B.formatting;S.highlightFormatting&&(B.formatting="code"),U.eatWhile("`");var ue=U.current().length;if(B.code==0&&(!B.quote||ue==1))return B.code=ue,c(B);if(ue==B.code){var ge=c(B);return B.code=0,ge}else return B.formatting=Ce,c(B)}else if(B.code)return c(B);if(de==="\\"&&(U.next(),S.highlightFormatting)){var pe=c(B),oe=C.formatting+"-escape";return pe?pe+" "+oe:oe}if(de==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return B.imageMarker=!0,B.image=!0,S.highlightFormatting&&(B.formatting="image"),c(B);if(de==="["&&B.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return B.imageMarker=!1,B.imageAltText=!0,S.highlightFormatting&&(B.formatting="image"),c(B);if(de==="]"&&B.imageAltText){S.highlightFormatting&&(B.formatting="image");var pe=c(B);return B.imageAltText=!1,B.image=!1,B.inline=B.f=j,pe}if(de==="["&&!B.image)return B.linkText&&U.match(/^.*?\]/)||(B.linkText=!0,S.highlightFormatting&&(B.formatting="link")),c(B);if(de==="]"&&B.linkText){S.highlightFormatting&&(B.formatting="link");var pe=c(B);return B.linkText=!1,B.inline=B.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?j:x,pe}if(de==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){B.f=B.inline=_,S.highlightFormatting&&(B.formatting="link");var pe=c(B);return pe?pe+=" ":pe="",pe+C.linkInline}if(de==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){B.f=B.inline=_,S.highlightFormatting&&(B.formatting="link");var pe=c(B);return pe?pe+=" ":pe="",pe+C.linkEmail}if(S.xml&&de==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ae=U.string.indexOf(">",U.pos);if(ae!=-1){var re=U.string.substring(U.start,ae);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(B.md_inside=!0)}return U.backUp(1),B.htmlState=P.startState(R),u(U,B,D)}if(S.xml&&de==="<"&&U.match(/^\/\w*?>/))return B.md_inside=!1,"tag";if(de==="*"||de==="_"){for(var he=1,Q=U.pos==1?" ":U.string.charAt(U.pos-2);he<3&&U.eat(de);)he++;var ie=U.peek()||" ",we=!/\s/.test(ie)&&(!l.test(ie)||/\s/.test(Q)||l.test(Q)),ne=!/\s/.test(Q)&&(!l.test(Q)||/\s/.test(ie)||l.test(ie)),J=null,V=null;if(he%2&&(!B.em&&we&&(de==="*"||!ne||l.test(Q))?J=!0:B.em==de&&ne&&(de==="*"||!we||l.test(ie))&&(J=!1)),he>1&&(!B.strong&&we&&(de==="*"||!ne||l.test(Q))?V=!0:B.strong==de&&ne&&(de==="*"||!we||l.test(ie))&&(V=!1)),V!=null||J!=null){S.highlightFormatting&&(B.formatting=J==null?"strong":V==null?"em":"strong em"),J===!0&&(B.em=de),V===!0&&(B.strong=de);var ge=c(B);return J===!1&&(B.em=!1),V===!1&&(B.strong=!1),ge}}else if(de===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return c(B);U.backUp(1)}if(S.strikethrough){if(de==="~"&&U.eatWhile(de)){if(B.strikethrough){S.highlightFormatting&&(B.formatting="strikethrough");var ge=c(B);return B.strikethrough=!1,ge}else if(U.match(/^[^\s]/,!1))return B.strikethrough=!0,S.highlightFormatting&&(B.formatting="strikethrough"),c(B)}else if(de===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return c(B);U.backUp(2)}}if(S.emoji&&de===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){B.emoji=!0,S.highlightFormatting&&(B.formatting="emoji");var Z=c(B);return B.emoji=!1,Z}return de===" "&&(U.match(/^ +$/,!1)?B.trailingSpace++:B.trailingSpace&&(B.trailingSpaceNewLine=!0)),c(B)}function _(U,B){var W=U.next();if(W===">"){B.f=B.inline=x,S.highlightFormatting&&(B.formatting="link");var te=c(B);return te?te+=" ":te="",te+C.linkInline}return U.match(/^[^>]+/,!0),C.linkInline}function j(U,B){if(U.eatSpace())return null;var W=U.next();return W==="("||W==="["?(B.f=B.inline=L(W==="("?")":"]"),S.highlightFormatting&&(B.formatting="link-string"),B.linkHref=!0,c(B)):"error"}var F={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function L(U){return function(B,W){var te=B.next();if(te===U){W.f=W.inline=x,S.highlightFormatting&&(W.formatting="link-string");var de=c(W);return W.linkHref=!1,de}return B.match(F[U]),W.linkHref=!0,c(W)}}function X(U,B){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(B.f=z,U.next(),S.highlightFormatting&&(B.formatting="link"),B.linkText=!0,c(B)):o(U,B,x)}function z(U,B){if(U.match(/^\]:/,!0)){B.f=B.inline=H,S.highlightFormatting&&(B.formatting="link");var W=c(B);return B.linkText=!1,W}return U.match(/^([^\]\\]|\\.)+/,!0),C.linkText}function H(U,B){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?B.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),B.f=B.inline=x,C.linkHref+" url")}var G={startState:function(){return{f:i,prevLine:{stream:null},thisLine:{stream:null},block:i,htmlState:null,indentation:0,inline:x,text:b,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(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&P.copyState(R,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?P.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,B){if(B.formatting=!1,U!=B.thisLine.stream){if(B.header=0,B.hr=!1,U.match(/^\s*$/,!0))return v(B),null;if(B.prevLine=B.thisLine,B.thisLine={stream:U},B.taskList=!1,B.trailingSpace=0,B.trailingSpaceNewLine=!1,!B.localState&&(B.f=B.block,B.f!=D)){var W=U.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(B.indentation=W,B.indentationDiff=null,W>0)return null}}return B.f(U,B)},innerMode:function(U){return U.block==D?{state:U.htmlState,mode:R}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:G}},indent:function(U,B,W){return U.block==D&&R.indent?R.indent(U.htmlState,B,W):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,B,W):P.Pass},blankLine:v,getType:c,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),P.defineMIME("text/markdown","markdown"),P.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 q})(function(){var define,module,exports;return function(){function I(q,N,P){function m(T,g){if(!N[T]){if(!q[T]){var C=typeof require=="function"&&require;if(!g&&C)return require(T,!0);if(S)return S(T,!0);var h=new Error("Cannot find module '"+T+"'");throw h.code="MODULE_NOT_FOUND",h}var s=N[T]={exports:{}};q[T][0].call(s.exports,function(a){var r=q[T][1][a];return m(r||a)},s,s.exports,I,q,N,P)}return N[T].exports}for(var S=typeof require=="function"&&require,R=0;R0&&p(j).to(L),X=this._divideParts(b,x),z=X.length,H=!1,G=function(ge,pe){var oe=this;return new T.default(function(re,he){var Q,ie,we,ne;return C.default.async(function(V){for(;;)switch(V.prev=V.next){case 0:if(V.prev=0,ge.isCancel()){V.next=18;break}return Q=X[pe-1],ie={stream:ge._createStream(c,Q.start,Q.end),size:Q.end-Q.start},V.next=6,C.default.awrap(ge._uploadPart(F,_,pe,ie));case 6:if(we=V.sent,!(!ge.isCancel()&&!H)){V.next=15;break}if(i.doneParts.push({number:pe,etag:we.res.headers.etag}),!D.progress){V.next=12;break}return V.next=12,C.default.awrap(D.progress(j.length/z,i,we.res));case 12:re({number:pe,etag:we.res.headers.etag}),V.next=16;break;case 15:re();case 16:V.next=19;break;case 18:re();case 19:V.next=30;break;case 21:V.prev=21,V.t0=V.catch(0),ne=new Error,ne.name=V.t0.name,ne.message=V.t0.message,ne.stack=V.t0.stack,ne.partNum=pe,p(V.t0).to(ne),he(ne);case 30:case"end":return V.stop()}},null,oe,[[0,21]])})},U=(0,S.default)(new Array(z),function(ue,ge){return ge+1}),B=L.map(function(ue){return ue.number}),W=U.filter(function(ue){return B.indexOf(ue)<0}),te=5,de=D.parallel||te,Ce.next=17,C.default.awrap(this._parallel(W,de,function(ue){return new T.default(function(ge,pe){G(k,ue).then(function(oe){oe&&L.push(oe),ge()}).catch(function(oe){pe(oe)})})}));case 17:if(fe=Ce.sent,H=!0,!this.isCancel()){Ce.next=22;break}throw G=null,this._makeCancelEvent();case 22:if(!(fe&&fe.length>0)){Ce.next=25;break}throw fe[0].message="Failed to upload some parts with error: "+fe[0].toString()+" part_num: "+fe[0].partNum,fe[0];case 25:return Ce.next=27,C.default.awrap(this.completeMultipartUpload(F,_,L,D));case 27:return Ce.abrupt("return",Ce.sent);case 28:case"end":return Ce.stop()}},null,this)},n._getFileSize=function(i){return C.default.async(function(k){for(;;)switch(k.prev=k.next){case 0:if(!s.buffer(i)){k.next=4;break}return k.abrupt("return",i.length);case 4:if(!(E(i)||l(i))){k.next=6;break}return k.abrupt("return",i.size);case 6:throw new Error("_getFileSize requires Buffer/File/Blob.");case 7:case"end":return k.stop()}},null,this)};var o=I("stream"),u=o.Readable;function w(v,i){if(!(this instanceof w))return new w(v,i);u.call(this,i),this.file=v,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}a.inherits(w,u),w.prototype.readFileAndPush=function(i){if(this.fileBuffer)for(var D=!0;D&&this.fileBuffer&&this.startthis.fileBuffer.length?this.fileBuffer.length:c,this.start=c,D=this.push(this.fileBuffer.slice(k,c))}},w.prototype._read=function(i){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 D=16*1024;i=i||D;var k=this;this.reader.onload=function(b){k.fileBuffer=P.from(new Uint8Array(b.target.result)),k.file=null,k.readFileAndPush(i)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(i)},n._createStream=function(i,D,k){if(E(i)||l(i))return new w(i.slice(D,k));throw new Error("_createStream requires File/Blob.")},n._getPartSize=function(i,D){var k=10*1e3,c=1024*1024;return D?Math.max(Math.ceil(i/k),D):c},n._divideParts=function(i,D){for(var k=Math.ceil(i/D),c=[],b=0;b255)throw new Error("ID is composed of 255 bytes at most");if(i.prefix===""||i.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(i.status))throw new Error("Status must be Enabled or Disabled");if(i.transition){if(!["IA","Archive"].includes(i.transition.storageClass))throw new Error("StorageClass must be IA or Archive");u(i.transition,"Transition")}if(i.expiration){if(!i.expiration.expiredObjectDeleteMarker)u(i.expiration,"Expiration");else if(i.expiration.days||i.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(i.abortMultipartUpload&&u(i.abortMultipartUpload,"AbortMultipartUpload"),!i.expiration&&!i.abortMultipartUpload&&!i.transition&&!i.noncurrentVersionTransition)throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(i.tag){if(i.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");w(i.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,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(s){return s&&s.__esModule?s:{default:s}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("../utils/obj2xml"),C=g.obj2xml,h=N;h.putBucketVersioning=function(a,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p,d,E;return m.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:if(T(a),["Enabled","Suspended"].includes(r)){l.next=3;break}throw new Error("status must be Enabled or Suspended");case 3:return p=this._bucketRequestParams("PUT",a,"versioning",f),d={VersioningConfiguration:{Status:r}},p.mime="xml",p.content=C(d,{headers:!0}),l.next=9,m.default.awrap(this.request(p));case 9:return E=l.sent,l.abrupt("return",{res:E.res,status:E.status});case 11:case"end":return l.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],13:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(r){return r&&r.__esModule?r:{default:r}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("../utils/obj2xml"),C=g.obj2xml,h=I("../utils/isArray"),s=h.isArray,a=N;a.putBucketWebsite=function(f){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=arguments[2],E,y,l,n,o;return m.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(T(f),E=this._bucketRequestParams("PUT",f,"website",d),y={Suffix:p.index||"index.html"},l={IndexDocument:y},n={WebsiteConfiguration:l},p.supportSubDir&&(y.SupportSubDir=p.supportSubDir),p.type&&(y.Type=p.type),p.error&&(l.ErrorDocument={Key:p.error}),!(p.routingRules!==void 0)){w.next=12;break}if(s(p.routingRules)){w.next=11;break}throw new Error("RoutingRules must be Array");case 11:l.RoutingRules={RoutingRule:p.routingRules};case 12:return n=C(n),E.content=n,E.mime="xml",E.successStatuses=[200],w.next=18,m.default.awrap(this.request(E));case 18:return o=w.sent,w.abrupt("return",{res:o.res});case 20:case"end":return w.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isArray":42,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],14:[function(I,q,N){(function(P){"use strict";var m=I("babel-runtime/core-js/object/keys"),S=g(m),R=I("babel-runtime/core-js/json/stringify"),T=g(R);function g(C){return C&&C.__esModule?C:{default:C}}N.encodeCallback=function(h,s){if(h.headers=h.headers||{},!Object.prototype.hasOwnProperty.call(h.headers,"x-oss-callback")&&s.callback){var a={callbackUrl:encodeURI(s.callback.url),callbackBody:s.callback.body};s.callback.host&&(a.callbackHost=s.callback.host),s.callback.contentType&&(a.callbackBodyType=s.callback.contentType);var r=P.from((0,T.default)(a)).toString("base64");if(h.headers["x-oss-callback"]=r,s.callback.customValue){var f={};(0,S.default)(s.callback.customValue).forEach(function(p){f["x:"+p]=s.callback.customValue[p]}),h.headers["x-oss-callback-var"]=P.from((0,T.default)(f)).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,q,N){"use strict";var P=I("babel-runtime/core-js/object/assign"),m=S(P);function S(a){return a&&a.__esModule?a:{default:a}}var R=I("humanize-ms"),T=I("url"),g=I("../utils/checkBucketName"),C=g.checkBucketName;function h(a,r){var f=T.parse(a);if(f.protocol||(f=T.parse("http"+(r?"s":"")+"://"+a)),f.protocol!=="http:"&&f.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return f}function s(a,r,f){var p=f?"https://":"http://",d=r?"-internal.aliyuncs.com":".aliyuncs.com",E="vpc100-oss-cn-";return a.substr(0,E.length)===E&&(d=".aliyuncs.com"),T.parse(p+a+d)}q.exports=function(a){if(!a||!a.accessKeyId||!a.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");a.bucket&&C(a.bucket);var r=(0,m.default)({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1},a);if(r.accessKeyId=r.accessKeyId.trim(),r.accessKeySecret=r.accessKeySecret.trim(),r.timeout&&(r.timeout=R(r.timeout)),r.endpoint)r.endpoint=h(r.endpoint,r.secure);else if(r.region)r.endpoint=s(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,q,N){"use strict";var P=I("merge-descriptors"),m=N;P(m,I("./processObjectSave"))},{"./processObjectSave":17,"merge-descriptors":200}],17:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(r){return r&&r.__esModule?r:{default:r}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("querystring"),C=I("js-base64"),h=C.Base64.encode,s=N;s.processObjectSave=function(f,p,d,E){var y,l,n,o;return m.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:return a(f,"sourceObject"),a(p,"targetObject"),a(d,"process"),p=this._objectName(p),E&&T(E),y=this._objectRequestParams("POST",f,{subres:"x-oss-process"}),l=E?",b_"+h(E):"",p=h(p),n={"x-oss-process":d+"|sys/saveas,o_"+p+l},y.content=g.stringify(n),w.next=12,m.default.awrap(this.request(y));case 12:return o=w.sent,w.abrupt("return",{res:o.res,status:o.res.status});case 14:case"end":return w.stop()}},null,this)};function a(r,f){if(!r)throw new Error(f+" is required");if(typeof r!="string")throw new Error(f+" must be String")}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68,"js-base64":199,querystring:212}],18:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(s){return s&&s.__esModule?s:{default:s}}var R=I("copy-to"),T=I("./callback"),g=I("./utils/deepCopy"),C=g.deepCopy,h=N;h.listUploads=function(a,r){var f,p,d,E;return m.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return r=r||{},f={},R(r).to(f),f.subres="uploads",p=this._objectRequestParams("GET","",f),p.query=a,p.xmlResponse=!0,p.successStatuses=[200],l.next=10,m.default.awrap(this.request(p));case 10:return d=l.sent,E=d.data.Upload||[],Array.isArray(E)||(E=[E]),E=E.map(function(n){return{name:n.Key,uploadId:n.UploadId,initiated:n.Initiated}}),l.abrupt("return",{res:d.res,uploads:E,bucket:d.data.Bucket,nextKeyMarker:d.data.NextKeyMarker,nextUploadIdMarker:d.data.NextUploadIdMarker,isTruncated:d.data.IsTruncated==="true"});case 15:case"end":return l.stop()}},null,this)},h.listParts=function(a,r,f,p){var d,E,y;return m.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return p=p||{},d={},R(p).to(d),d.subres={uploadId:r},E=this._objectRequestParams("GET",a,d),E.query=f,E.xmlResponse=!0,E.successStatuses=[200],n.next=10,m.default.awrap(this.request(E));case 10:return y=n.sent,n.abrupt("return",{res:y.res,uploadId:y.data.UploadId,bucket:y.data.Bucket,name:y.data.Key,partNumberMarker:y.data.PartNumberMarker,nextPartNumberMarker:y.data.NextPartNumberMarker,maxParts:y.data.MaxParts,isTruncated:y.data.IsTruncated,parts:y.data.Part||[]});case 12:case"end":return n.stop()}},null,this)},h.abortMultipartUpload=function(a,r,f){var p,d,E;return m.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return this._stop(),f=f||{},p={},R(f).to(p),p.subres={uploadId:r},d=this._objectRequestParams("DELETE",a,p),d.successStatuses=[204],l.next=9,m.default.awrap(this.request(d));case 9:return E=l.sent,l.abrupt("return",{res:E.res});case 11:case"end":return l.stop()}},null,this)},h.initMultipartUpload=function(a,r){var f,p,d;return m.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:return r=r||{},f={},R(r).to(f),f.headers=f.headers||{},this._convertMetaToHeaders(r.meta,f.headers),f.subres="uploads",p=this._objectRequestParams("POST",a,f),p.mime=r.mime,p.xmlResponse=!0,p.successStatuses=[200],y.next=12,m.default.awrap(this.request(p));case 12:return d=y.sent,y.abrupt("return",{res:d.res,bucket:d.data.Bucket,name:d.data.Key,uploadId:d.data.UploadId});case 14:case"end":return y.stop()}},null,this)},h.uploadPart=function(a,r,f,p,d,E,y){var l;return m.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return l={stream:this._createStream(p,d,E),size:E-d},o.next=3,m.default.awrap(this._uploadPart(a,r,f,l,y));case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}},null,this)},h.completeMultipartUpload=function(a,r,f,p){var d,E,y,l,n,o,u,w;return m.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:for(d=f.concat().sort(function(D,k){return D.number-k.number}).filter(function(D,k,c){return!k||D.number!==c[k-1].number}),E=` `,y=0;y `,E+=""+l.number+` `,E+=""+l.etag+` `,E+=` `;return E+="",p=p||{},n={},n=C(p),n.headers&&delete n.headers["x-oss-server-side-encryption"],n.subres={uploadId:r},o=this._objectRequestParams("POST",a,n),T.encodeCallback(o,n),o.mime="xml",o.content=E,o.headers&&o.headers["x-oss-callback"]||(o.xmlResponse=!0),o.successStatuses=[200],i.next=17,m.default.awrap(this.request(o));case 17:return u=i.sent,w={res:u.res,bucket:o.bucket,name:a,etag:u.res.headers.etag},o.headers&&o.headers["x-oss-callback"]&&(w.data=JSON.parse(u.data.toString())),i.abrupt("return",w);case 21:case"end":return i.stop()}},null,this)},h._uploadPart=function(a,r,f,p,d){var E,y,l;return m.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return d=d||{},E={},R(d).to(E),E.headers={"Content-Length":p.size},E.subres={partNumber:f,uploadId:r},y=this._objectRequestParams("PUT",a,E),y.mime=E.mime,y.stream=p.stream,y.successStatuses=[200],o.next=11,m.default.awrap(this.request(y));case 11:if(l=o.sent,l.res.headers.etag){o.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,y.stream=null,o.abrupt("return",{name:a,etag:l.res.headers.etag,res:l.res});case 17:case"end":return o.stop()}},null,this)}},{"./callback":14,"./utils/deepCopy":39,"babel-runtime/regenerator":68,"copy-to":76}],19:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=C(P),S=I("babel-runtime/core-js/object/keys"),R=C(S),T=I("babel-runtime/helpers/typeof"),g=C(T);function C(r){return r&&r.__esModule?r:{default:r}}var h=I("../utils/checkBucketName"),s=h.checkBucketName,a=N;a.copy=function(f,p,d,E){var y,l,n;return m.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return(typeof d=="undefined"?"undefined":(0,g.default)(d))==="object"&&(E=d),E=E||{},E.headers=E.headers||{},(0,R.default)(E.headers).forEach(function(w){E.headers["x-oss-copy-source-"+w.toLowerCase()]=E.headers[w]}),E.meta&&(E.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(E.meta,E.headers),p=this._getSourceName(p,d),E.versionId&&(p=p+"?versionId="+E.versionId),E.headers["x-oss-copy-source"]=p,y=this._objectRequestParams("PUT",f,E),y.xmlResponse=!0,y.successStatuses=[200,304],u.next=14,m.default.awrap(this.request(y));case 14:return l=u.sent,n=l.data,n&&(n={etag:n.ETag,lastModified:n.LastModified}),u.abrupt("return",{data:n,res:l.res});case 18:case"end":return u.stop()}},null,this)},a._getSourceName=function(f,p){return typeof p=="string"?f=this._objectName(f):f[0]!=="/"?p=this.options.bucket:(p=f.replace(/\/(.+?)(\/.*)/,"$1"),f=f.replace(/(\/.+?\/)(.*)/,"$2")),s(p),f=encodeURI(f),f="/"+p+"/"+f,f}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,"babel-runtime/regenerator":68}],20:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=N;g.delete=function(h){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return m.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return s.subres=(0,R.default)({},s.subres),s.versionId&&(s.subres.versionId=s.versionId),a=this._objectRequestParams("DELETE",h,s),a.successStatuses=[204],p.next=6,m.default.awrap(this.request(a));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,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(a){return a&&a.__esModule?a:{default:a}}var g=I("utility"),C=I("../utils/obj2xml"),h=C.obj2xml,s=N;s.deleteMulti=function(r){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p,d,E,y,l,n,o,u,w,v,i,D;return m.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(p=[],!(!r||!r.length)){c.next=3;break}throw new Error("names is required");case 3:for(d=0;d1&&arguments[1]!==void 0?arguments[1]:{},a,r;return m.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return s.subres=(0,R.default)({tagging:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),h=this._objectName(h),a=this._objectRequestParams("DELETE",h,s),a.successStatuses=[204],p.next=7,m.default.awrap(this.request(a));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,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(s){return s&&s.__esModule?s:{default:s}}var g=I("fs"),C=I("is-type-of"),h=N;h.get=function(a,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p,d,E,y;return m.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return p=null,d=!1,C.writableStream(r)?p=r:C.string(r)?(p=g.createWriteStream(r),d=!0):f=r,f=f||{},f.subres=(0,R.default)({},f.subres),f.versionId&&(f.subres.versionId=f.versionId),f.process&&(f.subres["x-oss-process"]=f.process),E=void 0,n.prev=8,y=this._objectRequestParams("GET",a,f),y.writeStream=p,y.successStatuses=[200,206,304],n.next=14,m.default.awrap(this.request(y));case 14:E=n.sent,d&&p.destroy(),n.next=25;break;case 18:if(n.prev=18,n.t0=n.catch(8),!d){n.next=24;break}return p.destroy(),n.next=24,m.default.awrap(this._deleteFileSafe(r));case 24:throw n.t0;case 25:return n.abrupt("return",{res:E.res,content:E.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,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=N;g.getACL=function(h){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return m.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return s.subres=(0,R.default)({acl:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),h=this._objectName(h),a=this._objectRequestParams("GET",h,s),a.successStatuses=[200],a.xmlResponse=!0,p.next=8,m.default.awrap(this.request(a));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,q,N){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=C(P),S=I("babel-runtime/regenerator"),R=C(S),T=I("babel-runtime/core-js/object/assign"),g=C(T);function C(y){return y&&y.__esModule?y:{default:y}}var h=N,s=I("../utils/isObject"),a=s.isObject,r=I("../utils/isArray"),f=r.isArray;h.getBucketVersions=p,h.listObjectVersions=p;function p(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,o,u,w,v,i;return R.default.async(function(k){for(;;)switch(k.prev=k.next){case 0:if(!(y.versionIdMarker&&y.keyMarker===void 0)){k.next=2;break}throw new Error("A version-id marker cannot be specified without a key marker");case 2:return l.subres=(0,g.default)({versions:""},l.subres),l.versionId&&(l.subres.versionId=l.versionId),n=this._objectRequestParams("GET","",l),n.xmlResponse=!0,n.successStatuses=[200],n.query=E(y),k.next=10,R.default.awrap(this.request(n));case 10:return o=k.sent,u=o.data.Version||[],w=o.data.DeleteMarker||[],v=this,u&&(Array.isArray(u)||(u=[u]),u=u.map(function(c){return{name:c.Key,url:v._objectUrl(c.Key),lastModified:c.LastModified,isLatest:c.IsLatest==="true",versionId:c.VersionId,etag:c.ETag,type:c.Type,size:Number(c.Size),storageClass:c.StorageClass,owner:{id:c.Owner.ID,displayName:c.Owner.DisplayName}}})),w&&(f(w)||(w=[w]),w=w.map(function(c){return{name:c.Key,lastModified:c.LastModified,versionId:c.VersionId,owner:{id:c.Owner.ID,displayName:c.Owner.DisplayName}}})),i=o.data.CommonPrefixes||null,i&&(f(i)||(i=[i]),i=i.map(function(c){return c.Prefix})),k.abrupt("return",{res:o.res,objects:u,deleteMarker:w,prefixes:i,nextMarker:o.data.NextMarker||null,NextVersionIdMarker:o.data.NextVersionIdMarker||null,isTruncated:o.data.IsTruncated==="true"});case 19:case"end":return k.stop()}},null,this)}function d(y){return y.replace(/([A-Z])/g,"-$1").toLowerCase()}function E(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l={};return a(y)&&(0,m.default)(y).forEach(function(n){l[d(n)]=y[n]}),l}},{"../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,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=N;g.getObjectMeta=function(h,s){var a,r;return m.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return s=s||{},h=this._objectName(h),s.subres=(0,R.default)({objectMeta:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),a=this._objectRequestParams("HEAD",h,s),a.successStatuses=[200],p.next=8,m.default.awrap(this.request(a));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,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(s){return s&&s.__esModule?s:{default:s}}var g=N,C=I("../utils/isObject"),h=C.isObject;g.getObjectTagging=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f,p,d,E,y;return m.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),a=this._objectName(a),f=this._objectRequestParams("GET",a,r),f.successStatuses=[200],n.next=7,m.default.awrap(this.request(f));case 7:return p=n.sent,n.next=10,m.default.awrap(this.parseXML(p.data));case 10:return d=n.sent,E=d.TagSet.Tag,E=E&&h(E)?[E]:E||[],y={},E.forEach(function(o){y[o.Key]=o.Value}),n.abrupt("return",{status:p.status,res:p.res,tag:y});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,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=N;g.getSymlink=function(h){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r,f;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return s.subres=(0,R.default)({symlink:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),h=this._objectName(h),a=this._objectRequestParams("GET",h,s),a.successStatuses=[200],d.next=7,m.default.awrap(this.request(a));case 7:return r=d.sent,f=r.res.headers["x-oss-symlink-target"],d.abrupt("return",{targetName:decodeURIComponent(f),res:r.res});case 10:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],29:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=C(P),S=I("babel-runtime/core-js/object/keys"),R=C(S),T=I("babel-runtime/core-js/object/assign"),g=C(T);function C(s){return s&&s.__esModule?s:{default:s}}var h=N;h.head=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f,p,d;return m.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:return r.subres=(0,g.default)({},r.subres),r.versionId&&(r.subres.versionId=r.versionId),f=this._objectRequestParams("HEAD",a,r),f.successStatuses=[200,304],y.next=6,m.default.awrap(this.request(f));case 6:return p=y.sent,d={meta:null,res:p.res,status:p.status},p.status===200&&(0,R.default)(p.headers).forEach(function(l){l.indexOf("x-oss-meta-")===0&&(d.meta||(d.meta={}),d.meta[l.substring(11)]=p.headers[l])}),y.abrupt("return",d);case 10:case"end":return y.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],30:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=N;g.putACL=function(h,s,a){var r,f;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return a=a||{},a.subres=(0,R.default)({acl:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),a.headers=a.headers||{},a.headers["x-oss-object-acl"]=s,h=this._objectName(h),r=this._objectRequestParams("PUT",h,a),r.successStatuses=[200],d.next=10,m.default.awrap(this.request(r));case 10:return f=d.sent,d.abrupt("return",{res:f.res});case 12:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],31:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=C(P),S=I("babel-runtime/core-js/object/keys"),R=C(S),T=I("babel-runtime/core-js/object/assign"),g=C(T);function C(p){return p&&p.__esModule?p:{default:p}}var h=I("../utils/obj2xml"),s=h.obj2xml,a=I("../utils/checkObjectTag"),r=a.checkObjectTag,f=N;f.putObjectTagging=function(d,E){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l,n,o;return m.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:return r(E),y.subres=(0,g.default)({tagging:""},y.subres),y.versionId&&(y.subres.versionId=y.versionId),d=this._objectName(d),l=this._objectRequestParams("PUT",d,y),l.successStatuses=[200],E=(0,R.default)(E).map(function(v){return{Key:v,Value:E[v]}}),n={Tagging:{TagSet:{Tag:E}}},l.mime="xml",l.content=s(n),w.next=12,m.default.awrap(this.request(l));case 12:return o=w.sent,w.abrupt("return",{res:o.res,status:o.status});case 14:case"end":return w.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,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=N;g.putSymlink=function(h,s,a){var r,f;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return a=a||{},a.headers=a.headers||{},s=this._escape(this._objectName(s)),this._convertMetaToHeaders(a.meta,a.headers),a.headers["x-oss-symlink-target"]=s,a.subres=(0,R.default)({symlink:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),a.storageClass&&(a.headers["x-oss-storage-class"]=a.storageClass),h=this._objectName(h),r=this._objectRequestParams("PUT",h,a),r.successStatuses=[200],d.next=13,m.default.awrap(this.request(r));case 13:return f=d.sent,d.abrupt("return",{res:f.res});case 15:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],33:[function(I,q,N){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/promise"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=N;g._parallelNode=function(h,s,a,r){var f,p,d,E,y,l,n,o;return m.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:f=this,p=[],d=[],E=h.length/s,y=h.length%s,l=y===0?E:(h.length-y)/s+1,n=1,o=0;case 8:if(!(o0){l=!0,n<=0&&f(p);return}n+=1,w(i.value,d(u))}o=!1}v()})},g.cancel=function(h){this.options.cancelFlag=!0,h&&this.abortMultipartUpload(h.name,h.uploadId,h.options)},g.isCancel=function(){return this.options.cancelFlag},g.resetCancelFlag=function(){this.options.cancelFlag=!1},g._stop=function(){this.options.cancelFlag=!0},g._makeCancelEvent=function(){var h={status:0,name:"cancel"};return h}},{"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68}],34:[function(I,q,N){(function(P){"use strict";var m=I("babel-runtime/core-js/json/stringify"),S=g(m),R=I("babel-runtime/core-js/object/keys"),T=g(R);function g(s){return s&&s.__esModule?s:{default:s}}var C=I("./../../shims/crypto/crypto.js"),h=I("is-type-of");N.buildCanonicalizedResource=function(a,r){var f=""+a,p="?";if(h.string(r)&&r.trim()!=="")f+=p+r;else if(h.array(r))r.sort(),f+=p+r.join("&");else if(r){var d=function(l,n){return l[0]>n[0]?1:l[0]1&&arguments[1]!==void 0?arguments[1]:{},f=arguments[2],p=arguments[3],d={},E=r.subResource,y=E===void 0?{}:E;if(r.process){var l="x-oss-process";y[l]=r.process}if(r.trafficLimit){var n="x-oss-traffic-limit";y[n]=r.trafficLimit}if(r.response&&(0,T.default)(r.response).forEach(function(v){var i="response-"+v.toLowerCase();y[i]=r.response[v]}),(0,T.default)(r).forEach(function(v){var i=v.toLowerCase(),D=r[v];i.indexOf("x-oss-")===0?d[i]=D:(i.indexOf("content-md5")===0||i.indexOf("content-type")===0)&&(d[v]=D)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(y["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){var o={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(o.callbackHost=r.callback.host),r.callback.contentType&&(o.callbackBodyType=r.callback.contentType),y.callback=P.from((0,S.default)(o)).toString("base64"),r.callback.customValue){var u={};(0,T.default)(r.callback.customValue).forEach(function(v){u["x:"+v]=r.callback.customValue[v]}),y["callback-var"]=P.from((0,S.default)(u)).toString("base64")}}var w=this.buildCanonicalString(r.method,f,{headers:d,parameters:y},p.toString());return{Signature:this.computeSignature(a,w),subResource:y}}}).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,q,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.checkBucketName=void 0,N.checkBucketName=function(P,m){var S=m?/^[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(P))throw new Error("The bucket must be conform to the specifications")}},{}],36:[function(I,q,N){"use strict";var P=I("babel-runtime/core-js/object/entries"),m=S(P);function S(r){return r&&r.__esModule?r:{default:r}}Object.defineProperty(N,"__esModule",{value:!0}),N.checkObjectTag=void 0;var R=I("./checkValid"),T=R.checkValid,g=I("./isObject"),C=g.isObject,h=[{validator:function(f){if(typeof f!="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 (/)"}],s={key:[].concat(h,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(h,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};function a(r){if(!C(r))throw new Error("tag must be Object");var f=(0,m.default)(r);if(f.length>10)throw new Error("maximum of 10 tags for a object");var p=["key","value"];f.forEach(function(d){d.forEach(function(E,y){T(E,s[p[y]])})})}N.checkObjectTag=a},{"./checkValid":37,"./isObject":46,"babel-runtime/core-js/object/entries":57}],37:[function(I,q,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.checkValid=void 0;function P(m,S){S.forEach(function(R){if(R.validator)R.validator(m);else if(R.pattern&&!R.pattern.test(m))throw new Error(R.msg)})}N.checkValid=P},{}],38:[function(I,q,N){(function(P){"use strict";var m=I("babel-runtime/core-js/object/assign"),S=R(m);function R(d){return d&&d.__esModule?d:{default:d}}Object.defineProperty(N,"__esModule",{value:!0}),N.createRequest=void 0;var T=I("./../../../shims/crypto/crypto.js"),g=I("debug")("ali-oss"),C=I("mime"),h=I("dateformat"),s=I("copy-to"),a=I("path");function r(d,E){return d[E]||d[E.toLowerCase()]}function f(d,E){delete d[E],delete d[E.toLowerCase()]}function p(d){var E=new Date;this.options.amendTimeSkewed&&(E=+new Date+this.options.amendTimeSkewed);var y={"x-oss-date":h(E,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.userAgent.includes("nodejs")&&(y["User-Agent"]=this.userAgent),this.options.isRequestPay&&(0,S.default)(y,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(y["x-oss-security-token"]=this.options.stsToken),s(d.headers).to(y),r(y,"Content-Type")||(d.mime&&d.mime.indexOf("/")>0?y["Content-Type"]=d.mime:y["Content-Type"]=C.getType(d.mime||a.extname(d.object||""))),r(y,"Content-Type")||f(y,"Content-Type"),d.content&&(y["Content-Md5"]=T.createHash("md5").update(P.from(d.content,"utf8")).digest("base64"),y["Content-Length"]||(y["Content-Length"]=d.content.length));var l=this._getResource(d);y.authorization=this.authorization(d.method,l,d.subres,y);var n=this._getReqUrl(d);g("request %s %s, with headers %j, !!stream: %s",d.method,n,y,!!d.stream);var o=d.timeout||this.options.timeout,u={method:d.method,content:d.content,stream:d.stream,headers:y,timeout:o,writeStream:d.writeStream,customResponse:d.customResponse,ctx:d.ctx||this.ctx};return this.agent&&(u.agent=this.agent),this.httpsAgent&&(u.httpsAgent=this.httpsAgent),{url:n,params:u}}N.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,q,N){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=T(P),S=I("babel-runtime/helpers/typeof"),R=T(S);function T(g){return g&&g.__esModule?g:{default:g}}Object.defineProperty(N,"__esModule",{value:!0}),N.deepCopy=void 0,N.deepCopy=function(g){if(g===null||(typeof g=="undefined"?"undefined":(0,R.default)(g))!=="object")return g;var C=Array.isArray(g)?[]:{};return(0,m.default)(g).forEach(function(h){C[h]=N.deepCopy(g[h])}),C}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],40:[function(I,q,N){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=T(P),S=I("babel-runtime/helpers/typeof"),R=T(S);function T(h){return h&&h.__esModule?h:{default:h}}Object.defineProperty(N,"__esModule",{value:!0}),N.formatObjKey=void 0;function g(h,s){if(h===null||(typeof h=="undefined"?"undefined":(0,R.default)(h))!=="object")return h;var a=void 0;if(Array.isArray(h)){a=[];for(var r=0;r `),h&&h.firstUpperCase&&(C=R.formatObjKey(C,"firstUpperCase")),T(C)==="object"?(0,m.default)(C).forEach(function(a){T(C[a])==="string"||T(C[a])==="number"?s+="<"+a+">"+C[a]+"":T(C[a])==="object"?s+="<"+a+">"+g(C[a])+"":T(C[a])==="array"?s+=C[a].map(function(r){return"<"+a+">"+g(r)+""}).join(""):s+="<"+a+">"+C[a].toString()+""}):s+=C.toString(),s}N.obj2xml=g},{"./formatObjKey":40,"babel-runtime/core-js/object/keys":60}],48:[function(I,q,N){q.exports=P,q.exports.HttpsAgent=P;function P(){}},{}],49:[function(I,q,N){q.exports=I("./register")().Promise},{"./register":51}],50:[function(I,q,N){"use strict";var P="@@any-promise/REGISTRATION",m=null;q.exports=function(S,R){return function(g,C){g=g||null,C=C||{};var h=C.global!==!1;if(m===null&&h&&(m=S[P]||null),m!==null&&g!==null&&m.implementation!==g)throw new Error('any-promise already defined as "'+m.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return m===null&&(g!==null&&typeof C.Promise!="undefined"?m={Promise:C.Promise,implementation:g}:m=R(g),h&&(S[P]=m)),m}}},{}],51:[function(I,q,N){"use strict";q.exports=I("./loader")(window,P);function P(){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,q,N){q.exports={default:I("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":77}],53:[function(I,q,N){q.exports={default:I("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":78}],54:[function(I,q,N){q.exports={default:I("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":79}],55:[function(I,q,N){q.exports={default:I("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":80}],56:[function(I,q,N){q.exports={default:I("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":81}],57:[function(I,q,N){q.exports={default:I("core-js/library/fn/object/entries"),__esModule:!0}},{"core-js/library/fn/object/entries":82}],58:[function(I,q,N){q.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,q,N){q.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,q,N){q.exports={default:I("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":85}],61:[function(I,q,N){q.exports={default:I("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":86}],62:[function(I,q,N){q.exports={default:I("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":87}],63:[function(I,q,N){q.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,q,N){q.exports={default:I("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":90}],65:[function(I,q,N){q.exports={default:I("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":89}],66:[function(I,q,N){q.exports={default:I("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":91}],67:[function(I,q,N){"use strict";N.__esModule=!0;var P=I("../core-js/symbol/iterator"),m=g(P),S=I("../core-js/symbol"),R=g(S),T=typeof R.default=="function"&&typeof m.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 g(C){return C&&C.__esModule?C:{default:C}}N.default=typeof R.default=="function"&&T(m.default)==="symbol"?function(C){return typeof C=="undefined"?"undefined":T(C)}:function(C){return C&&typeof R.default=="function"&&C.constructor===R.default&&C!==R.default.prototype?"symbol":typeof C=="undefined"?"undefined":T(C)}},{"../core-js/symbol":64,"../core-js/symbol/iterator":66}],68:[function(I,q,N){q.exports=I("regenerator-runtime")},{"regenerator-runtime":226}],69:[function(I,q,N){"use strict";N.byteLength=h,N.toByteArray=a,N.fromByteArray=p;for(var P=[],m=[],S=typeof Uint8Array!="undefined"?Uint8Array:Array,R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=0,g=R.length;T0)throw new Error("Invalid string. Length must be a multiple of 4");var y=d.indexOf("=");y===-1&&(y=E);var l=y===E?0:4-y%4;return[y,l]}function h(d){var E=C(d),y=E[0],l=E[1];return(y+l)*3/4-l}function s(d,E,y){return(E+y)*3/4-y}function a(d){var E,y=C(d),l=y[0],n=y[1],o=new S(s(d,l,n)),u=0,w=n>0?l-4:l,v;for(v=0;v>16&255,o[u++]=E>>8&255,o[u++]=E&255;return n===2&&(E=m[d.charCodeAt(v)]<<2|m[d.charCodeAt(v+1)]>>4,o[u++]=E&255),n===1&&(E=m[d.charCodeAt(v)]<<10|m[d.charCodeAt(v+1)]<<4|m[d.charCodeAt(v+2)]>>2,o[u++]=E>>8&255,o[u++]=E&255),o}function r(d){return P[d>>18&63]+P[d>>12&63]+P[d>>6&63]+P[d&63]}function f(d,E,y){for(var l,n=[],o=E;ow?w:u+o));return l===1?(E=d[y-1],n.push(P[E>>2]+P[E<<4&63]+"==")):l===2&&(E=(d[y-2]<<8)+d[y-1],n.push(P[E>>10]+P[E>>4&63]+P[E<<2&63]+"=")),n.join("")}},{}],70:[function(I,q,N){/*! * Bowser - a browser detector * https://github.com/ded/bowser * MIT License | (c) Dustin Diaz 2015 */!function(P,m,S){typeof q!="undefined"&&q.exports?q.exports=S():typeof define=="function"&&define.amd?define(m,S):P[m]=S()}(this,"bowser",function(){var P=!0;function m(s){function a(G){var U=s.match(G);return U&&U.length>1&&U[1]||""}function r(G){var U=s.match(G);return U&&U.length>1&&U[2]||""}var f=a(/(ipod|iphone|ipad)/i).toLowerCase(),p=/like android/i.test(s),d=!p&&/android/i.test(s),E=/nexus\s*[0-6]\s*/i.test(s),y=!E&&/nexus\s*[0-9]+/i.test(s),l=/CrOS/.test(s),n=/silk/i.test(s),o=/sailfish/i.test(s),u=/tizen/i.test(s),w=/(web|hpw)(o|0)s/i.test(s),v=/windows phone/i.test(s),i=/SamsungBrowser/i.test(s),D=!v&&/windows/i.test(s),k=!f&&!n&&/macintosh/i.test(s),c=!d&&!o&&!u&&!w&&/linux/i.test(s),b=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),x=a(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(s)&&!/tablet pc/i.test(s),j=!_&&/[^-]mobi/i.test(s),F=/xbox/i.test(s),L;/opera/i.test(s)?L={name:"Opera",opera:P,version:x||a(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?L={name:"Opera",opera:P,version:a(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||x}:/SamsungBrowser/i.test(s)?L={name:"Samsung Internet for Android",samsungBrowser:P,version:x||a(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(s)?L={name:"NAVER Whale browser",whale:P,version:a(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(s)?L={name:"MZ Browser",mzbrowser:P,version:a(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(s)?L={name:"Opera Coast",coast:P,version:x||a(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(s)?L={name:"Focus",focus:P,version:a(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(s)?L={name:"Yandex Browser",yandexbrowser:P,version:x||a(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?L={name:"UC Browser",ucbrowser:P,version:a(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?L={name:"Maxthon",maxthon:P,version:a(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?L={name:"Epiphany",epiphany:P,version:a(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?L={name:"Puffin",puffin:P,version:a(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?L={name:"Sleipnir",sleipnir:P,version:a(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?L={name:"K-Meleon",kMeleon:P,version:a(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:v?(L={name:"Windows Phone",osname:"Windows Phone",windowsphone:P},b?(L.msedge=P,L.version=b):(L.msie=P,L.version=a(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?L={name:"Internet Explorer",msie:P,version:a(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:l?L={name:"Chrome",osname:"Chrome OS",chromeos:P,chromeBook:P,chrome:P,version:a(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?L={name:"Microsoft Edge",msedge:P,version:b}:/vivaldi/i.test(s)?L={name:"Vivaldi",vivaldi:P,version:a(/vivaldi\/(\d+(\.\d+)?)/i)||x}:o?L={name:"Sailfish",osname:"Sailfish OS",sailfish:P,version:a(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?L={name:"SeaMonkey",seamonkey:P,version:a(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(L={name:"Firefox",firefox:P,version:a(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(L.firefoxos=P,L.osname="Firefox OS")):n?L={name:"Amazon Silk",silk:P,version:a(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?L={name:"PhantomJS",phantom:P,version:a(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?L={name:"SlimerJS",slimer:P,version:a(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?L={name:"BlackBerry",osname:"BlackBerry OS",blackberry:P,version:x||a(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:w?(L={name:"WebOS",osname:"WebOS",webos:P,version:x||a(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(L.touchpad=P)):/bada/i.test(s)?L={name:"Bada",osname:"Bada",bada:P,version:a(/dolfin\/(\d+(\.\d+)?)/i)}:u?L={name:"Tizen",osname:"Tizen",tizen:P,version:a(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||x}:/qupzilla/i.test(s)?L={name:"QupZilla",qupzilla:P,version:a(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||x}:/chromium/i.test(s)?L={name:"Chromium",chromium:P,version:a(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||x}:/chrome|crios|crmo/i.test(s)?L={name:"Chrome",chrome:P,version:a(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:d?L={name:"Android",version:x}:/safari|applewebkit/i.test(s)?(L={name:"Safari",safari:P},x&&(L.version=x)):f?(L={name:f=="iphone"?"iPhone":f=="ipad"?"iPad":"iPod"},x&&(L.version=x)):/googlebot/i.test(s)?L={name:"Googlebot",googlebot:P,version:a(/googlebot\/(\d+(\.\d+))/i)||x}:L={name:a(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!L.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(L.name=L.name||"Blink",L.blink=P):(L.name=L.name||"Webkit",L.webkit=P),!L.version&&x&&(L.version=x)):!L.opera&&/gecko\//i.test(s)&&(L.name=L.name||"Gecko",L.gecko=P,L.version=L.version||a(/gecko\/(\d+(\.\d+)?)/i)),!L.windowsphone&&(d||L.silk)?(L.android=P,L.osname="Android"):!L.windowsphone&&f?(L[f]=P,L.ios=P,L.osname="iOS"):k?(L.mac=P,L.osname="macOS"):F?(L.xbox=P,L.osname="Xbox"):D?(L.windows=P,L.osname="Windows"):c&&(L.linux=P,L.osname="Linux");function X(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 z="";L.windows?z=X(a(/Windows ((NT|XP)( \d\d?.\d)?)/i)):L.windowsphone?z=a(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):L.mac?(z=a(/Mac OS X (\d+([_\.\s]\d+)*)/i),z=z.replace(/[_\s]/g,".")):f?(z=a(/os (\d+([_\s]\d+)*) like mac os x/i),z=z.replace(/[_\s]/g,".")):d?z=a(/android[ \/-](\d+(\.\d+)*)/i):L.webos?z=a(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):L.blackberry?z=a(/rim\stablet\sos\s(\d+(\.\d+)*)/i):L.bada?z=a(/bada\/(\d+(\.\d+)*)/i):L.tizen&&(z=a(/tizen[\/\s](\d+(\.\d+)*)/i)),z&&(L.osversion=z);var H=!L.windows&&z.split(".")[0];return _||y||f=="ipad"||d&&(H==3||H>=4&&!j)||L.silk?L.tablet=P:(j||f=="iphone"||f=="ipod"||d||E||L.blackberry||L.webos||L.bada)&&(L.mobile=P),L.msedge||L.msie&&L.version>=10||L.yandexbrowser&&L.version>=15||L.vivaldi&&L.version>=1||L.chrome&&L.version>=20||L.samsungBrowser&&L.version>=4||L.whale&&g([L.version,"1.0"])===1||L.mzbrowser&&g([L.version,"6.0"])===1||L.focus&&g([L.version,"1.0"])===1||L.firefox&&L.version>=20||L.safari&&L.version>=6||L.opera&&L.version>=10||L.ios&&L.osversion&&L.osversion.split(".")[0]>=6||L.blackberry&&L.version>=10.1||L.chromium&&L.version>=20?L.a=P:L.msie&&L.version<10||L.chrome&&L.version<20||L.firefox&&L.version<20||L.safari&&L.version<6||L.opera&&L.version<10||L.ios&&L.osversion&&L.osversion.split(".")[0]<6||L.chromium&&L.version<20?L.c=P:L.x=P,L}var S=m(typeof navigator!="undefined"&&navigator.userAgent||"");S.test=function(s){for(var a=0;a=0;){if(r[0][a]>r[1][a])return 1;if(r[0][a]===r[1][a]){if(a===0)return 0}else return-1}}function C(s,a,r){var f=S;typeof a=="string"&&(r=a,a=void 0),a===void 0&&(a=!1),r&&(f=m(r));var p=""+f.version;for(var d in s)if(s.hasOwnProperty(d)&&f[d]){if(typeof s[d]!="string")throw new Error("Browser version in the minVersion map should be a string: "+d+": "+String(s));return g([p,s[d]])<0}return a}function h(s,a,r){return!C(s,a,r)}return S.isUnsupportedBrowser=C,S.compareVersions=g,S.check=h,S._detect=m,S.detect=m,S})},{}],71:[function(I,q,N){},{}],72:[function(I,q,N){var P=I("buffer").Buffer,m=P.isEncoding||function(h){switch(h&&h.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(h){if(h&&!m(h))throw new Error("Unknown encoding: "+h)}var R=N.StringDecoder=function(h){this.encoding=(h||"utf8").toLowerCase().replace(/[-_]/,""),S(h);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=g;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=C;break;default:this.write=T;return}this.charBuffer=new P(6),this.charReceived=0,this.charLength=0};R.prototype.write=function(h){for(var s="";this.charLength;){var a=h.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:h.length;if(h.copy(this.charBuffer,this.charReceived,0,a),this.charReceived+=a,this.charReceived=55296&&f<=56319){this.charLength+=this.surrogateSize,s="";continue}if(this.charReceived=this.charLength=0,h.length===0)return s;break}this.detectIncompleteChar(h);var r=h.length;this.charLength&&(h.copy(this.charBuffer,0,h.length-this.charReceived,r),r-=this.charReceived),s+=h.toString(this.encoding,0,r);var r=s.length-1,f=s.charCodeAt(r);if(f>=55296&&f<=56319){var p=this.surrogateSize;return this.charLength+=p,this.charReceived+=p,this.charBuffer.copy(this.charBuffer,p,0,p),h.copy(this.charBuffer,0,0,p),s.substring(0,r)}return s},R.prototype.detectIncompleteChar=function(h){for(var s=h.length>=3?3:h.length;s>0;s--){var a=h[h.length-s];if(s==1&&a>>5==6){this.charLength=2;break}if(s<=2&&a>>4==14){this.charLength=3;break}if(s<=3&&a>>3==30){this.charLength=4;break}}this.charReceived=s},R.prototype.end=function(h){var s="";if(h&&h.length&&(s=this.write(h)),this.charReceived){var a=this.charReceived,r=this.charBuffer,f=this.encoding;s+=r.slice(0,a).toString(f)}return s};function T(h){return h.toString(this.encoding)}function g(h){this.charReceived=h.length%2,this.charLength=this.charReceived?2:0}function C(h){this.charReceived=h.length%3,this.charLength=this.charReceived?3:0}},{buffer:73}],73:[function(I,q,N){(function(P,m){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */"use strict";var S=I("base64-js"),R=I("ieee754"),T=I("isarray");N.Buffer=m,N.SlowBuffer=n,N.INSPECT_MAX_BYTES=50,m.TYPED_ARRAY_SUPPORT=P.TYPED_ARRAY_SUPPORT!==void 0?P.TYPED_ARRAY_SUPPORT:g(),N.kMaxLength=C();function g(){try{var ne=new Uint8Array(1);return ne.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},ne.foo()===42&&typeof ne.subarray=="function"&&ne.subarray(1,1).byteLength===0}catch(J){return!1}}function C(){return m.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(ne,J){if(C()=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return ne|0}function n(ne){return+ne!=ne&&(ne=0),m.alloc(+ne)}m.isBuffer=function(J){return!!(J!=null&&J._isBuffer)},m.compare=function(J,V){if(!m.isBuffer(J)||!m.isBuffer(V))throw new TypeError("Arguments must be Buffers");if(J===V)return 0;for(var Z=J.length,Ee=V.length,xe=0,_e=Math.min(Z,Ee);xe<_e;++xe)if(J[xe]!==V[xe]){Z=J[xe],Ee=V[xe];break}return Z>>1;case"base64":return Q(ne).length;default:if(Z)return ae(ne).length;J=(""+J).toLowerCase(),Z=!0}}m.byteLength=o;function u(ne,J,V){var Z=!1;if((J===void 0||J<0)&&(J=0),J>this.length)return"";if((V===void 0||V>this.length)&&(V=this.length),V<=0)return"";if(V>>>=0,J>>>=0,V<=J)return"";for(ne||(ne="utf8");;)switch(ne){case"hex":return G(this,J,V);case"utf8":case"utf-8":return F(this,J,V);case"ascii":return z(this,J,V);case"latin1":case"binary":return H(this,J,V);case"base64":return j(this,J,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,J,V);default:if(Z)throw new TypeError("Unknown encoding: "+ne);ne=(ne+"").toLowerCase(),Z=!0}}m.prototype._isBuffer=!0;function w(ne,J,V){var Z=ne[J];ne[J]=ne[V],ne[V]=Z}m.prototype.swap16=function(){var J=this.length;if(J%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var V=0;V0&&(J=this.toString("hex",0,V).match(/.{2}/g).join(" "),this.length>V&&(J+=" ... ")),""},m.prototype.compare=function(J,V,Z,Ee,xe){if(!m.isBuffer(J))throw new TypeError("Argument must be a Buffer");if(V===void 0&&(V=0),Z===void 0&&(Z=J?J.length:0),Ee===void 0&&(Ee=0),xe===void 0&&(xe=this.length),V<0||Z>J.length||Ee<0||xe>this.length)throw new RangeError("out of range index");if(Ee>=xe&&V>=Z)return 0;if(Ee>=xe)return-1;if(V>=Z)return 1;if(V>>>=0,Z>>>=0,Ee>>>=0,xe>>>=0,this===J)return 0;for(var _e=xe-Ee,je=Z-V,Be=Math.min(_e,je),He=this.slice(Ee,xe),Ue=J.slice(V,Z),ze=0;ze2147483647?V=2147483647:V<-2147483648&&(V=-2147483648),V=+V,isNaN(V)&&(V=Ee?0:ne.length-1),V<0&&(V=ne.length+V),V>=ne.length){if(Ee)return-1;V=ne.length-1}else if(V<0)if(Ee)V=0;else return-1;if(typeof J=="string"&&(J=m.from(J,Z)),m.isBuffer(J))return J.length===0?-1:i(ne,J,V,Z,Ee);if(typeof J=="number")return J=J&255,m.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Ee?Uint8Array.prototype.indexOf.call(ne,J,V):Uint8Array.prototype.lastIndexOf.call(ne,J,V):i(ne,[J],V,Z,Ee);throw new TypeError("val must be string, number or Buffer")}function i(ne,J,V,Z,Ee){var xe=1,_e=ne.length,je=J.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(ne.length<2||J.length<2)return-1;xe=2,_e/=2,je/=2,V/=2}function Be(Ye,Re){return xe===1?Ye[Re]:Ye.readUInt16BE(Re*xe)}var He;if(Ee){var Ue=-1;for(He=V;He<_e;He++)if(Be(ne,He)===Be(J,Ue===-1?0:He-Ue)){if(Ue===-1&&(Ue=He),He-Ue+1===je)return Ue*xe}else Ue!==-1&&(He-=He-Ue),Ue=-1}else for(V+je>_e&&(V=_e-je),He=V;He>=0;He--){for(var ze=!0,Ge=0;GeEe&&(Z=Ee)):Z=Ee;var xe=J.length;if(xe%2!==0)throw new TypeError("Invalid hex string");Z>xe/2&&(Z=xe/2);for(var _e=0;_exe)&&(Z=xe),J.length>0&&(Z<0||V<0)||V>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");for(var _e=!1;;)switch(Ee){case"hex":return D(this,J,V,Z);case"utf8":case"utf-8":return k(this,J,V,Z);case"ascii":return c(this,J,V,Z);case"latin1":case"binary":return b(this,J,V,Z);case"base64":return x(this,J,V,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,J,V,Z);default:if(_e)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),_e=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(ne,J,V){return J===0&&V===ne.length?S.fromByteArray(ne):S.fromByteArray(ne.slice(J,V))}function F(ne,J,V){V=Math.min(ne.length,V);for(var Z=[],Ee=J;Ee239?4:xe>223?3:xe>191?2:1;if(Ee+je<=V){var Be,He,Ue,ze;switch(je){case 1:xe<128&&(_e=xe);break;case 2:Be=ne[Ee+1],(Be&192)===128&&(ze=(xe&31)<<6|Be&63,ze>127&&(_e=ze));break;case 3:Be=ne[Ee+1],He=ne[Ee+2],(Be&192)===128&&(He&192)===128&&(ze=(xe&15)<<12|(Be&63)<<6|He&63,ze>2047&&(ze<55296||ze>57343)&&(_e=ze));break;case 4:Be=ne[Ee+1],He=ne[Ee+2],Ue=ne[Ee+3],(Be&192)===128&&(He&192)===128&&(Ue&192)===128&&(ze=(xe&15)<<18|(Be&63)<<12|(He&63)<<6|Ue&63,ze>65535&&ze<1114112&&(_e=ze))}}_e===null?(_e=65533,je=1):_e>65535&&(_e-=65536,Z.push(_e>>>10&1023|55296),_e=56320|_e&1023),Z.push(_e),Ee+=je}return X(Z)}var L=4096;function X(ne){var J=ne.length;if(J<=L)return String.fromCharCode.apply(String,ne);for(var V="",Z=0;ZZ)&&(V=Z);for(var Ee="",xe=J;xeZ&&(J=Z),V<0?(V+=Z,V<0&&(V=0)):V>Z&&(V=Z),VV)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUIntLE=function(J,V,Z){J=J|0,V=V|0,Z||B(J,V,this.length);for(var Ee=this[J],xe=1,_e=0;++_e0&&(xe*=256);)Ee+=this[J+--V]*xe;return Ee},m.prototype.readUInt8=function(J,V){return V||B(J,1,this.length),this[J]},m.prototype.readUInt16LE=function(J,V){return V||B(J,2,this.length),this[J]|this[J+1]<<8},m.prototype.readUInt16BE=function(J,V){return V||B(J,2,this.length),this[J]<<8|this[J+1]},m.prototype.readUInt32LE=function(J,V){return V||B(J,4,this.length),(this[J]|this[J+1]<<8|this[J+2]<<16)+this[J+3]*16777216},m.prototype.readUInt32BE=function(J,V){return V||B(J,4,this.length),this[J]*16777216+(this[J+1]<<16|this[J+2]<<8|this[J+3])},m.prototype.readIntLE=function(J,V,Z){J=J|0,V=V|0,Z||B(J,V,this.length);for(var Ee=this[J],xe=1,_e=0;++_e=xe&&(Ee-=Math.pow(2,8*V)),Ee},m.prototype.readIntBE=function(J,V,Z){J=J|0,V=V|0,Z||B(J,V,this.length);for(var Ee=V,xe=1,_e=this[J+--Ee];Ee>0&&(xe*=256);)_e+=this[J+--Ee]*xe;return xe*=128,_e>=xe&&(_e-=Math.pow(2,8*V)),_e},m.prototype.readInt8=function(J,V){return V||B(J,1,this.length),this[J]&128?(255-this[J]+1)*-1:this[J]},m.prototype.readInt16LE=function(J,V){V||B(J,2,this.length);var Z=this[J]|this[J+1]<<8;return Z&32768?Z|4294901760:Z},m.prototype.readInt16BE=function(J,V){V||B(J,2,this.length);var Z=this[J+1]|this[J]<<8;return Z&32768?Z|4294901760:Z},m.prototype.readInt32LE=function(J,V){return V||B(J,4,this.length),this[J]|this[J+1]<<8|this[J+2]<<16|this[J+3]<<24},m.prototype.readInt32BE=function(J,V){return V||B(J,4,this.length),this[J]<<24|this[J+1]<<16|this[J+2]<<8|this[J+3]},m.prototype.readFloatLE=function(J,V){return V||B(J,4,this.length),R.read(this,J,!0,23,4)},m.prototype.readFloatBE=function(J,V){return V||B(J,4,this.length),R.read(this,J,!1,23,4)},m.prototype.readDoubleLE=function(J,V){return V||B(J,8,this.length),R.read(this,J,!0,52,8)},m.prototype.readDoubleBE=function(J,V){return V||B(J,8,this.length),R.read(this,J,!1,52,8)};function W(ne,J,V,Z,Ee,xe){if(!m.isBuffer(ne))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>Ee||Jne.length)throw new RangeError("Index out of range")}m.prototype.writeUIntLE=function(J,V,Z,Ee){if(J=+J,V=V|0,Z=Z|0,!Ee){var xe=Math.pow(2,8*Z)-1;W(this,J,V,Z,xe,0)}var _e=1,je=0;for(this[V]=J&255;++je=0&&(je*=256);)this[V+_e]=J/je&255;return V+Z},m.prototype.writeUInt8=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,1,255,0),m.TYPED_ARRAY_SUPPORT||(J=Math.floor(J)),this[V]=J&255,V+1};function te(ne,J,V,Z){J<0&&(J=65535+J+1);for(var Ee=0,xe=Math.min(ne.length-V,2);Ee>>(Z?Ee:1-Ee)*8}m.prototype.writeUInt16LE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,2,65535,0),m.TYPED_ARRAY_SUPPORT?(this[V]=J&255,this[V+1]=J>>>8):te(this,J,V,!0),V+2},m.prototype.writeUInt16BE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,2,65535,0),m.TYPED_ARRAY_SUPPORT?(this[V]=J>>>8,this[V+1]=J&255):te(this,J,V,!1),V+2};function de(ne,J,V,Z){J<0&&(J=4294967295+J+1);for(var Ee=0,xe=Math.min(ne.length-V,4);Ee>>(Z?Ee:3-Ee)*8&255}m.prototype.writeUInt32LE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,4,4294967295,0),m.TYPED_ARRAY_SUPPORT?(this[V+3]=J>>>24,this[V+2]=J>>>16,this[V+1]=J>>>8,this[V]=J&255):de(this,J,V,!0),V+4},m.prototype.writeUInt32BE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,4,4294967295,0),m.TYPED_ARRAY_SUPPORT?(this[V]=J>>>24,this[V+1]=J>>>16,this[V+2]=J>>>8,this[V+3]=J&255):de(this,J,V,!1),V+4},m.prototype.writeIntLE=function(J,V,Z,Ee){if(J=+J,V=V|0,!Ee){var xe=Math.pow(2,8*Z-1);W(this,J,V,Z,xe-1,-xe)}var _e=0,je=1,Be=0;for(this[V]=J&255;++_e>0)-Be&255;return V+Z},m.prototype.writeIntBE=function(J,V,Z,Ee){if(J=+J,V=V|0,!Ee){var xe=Math.pow(2,8*Z-1);W(this,J,V,Z,xe-1,-xe)}var _e=Z-1,je=1,Be=0;for(this[V+_e]=J&255;--_e>=0&&(je*=256);)J<0&&Be===0&&this[V+_e+1]!==0&&(Be=1),this[V+_e]=(J/je>>0)-Be&255;return V+Z},m.prototype.writeInt8=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,1,127,-128),m.TYPED_ARRAY_SUPPORT||(J=Math.floor(J)),J<0&&(J=255+J+1),this[V]=J&255,V+1},m.prototype.writeInt16LE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,2,32767,-32768),m.TYPED_ARRAY_SUPPORT?(this[V]=J&255,this[V+1]=J>>>8):te(this,J,V,!0),V+2},m.prototype.writeInt16BE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,2,32767,-32768),m.TYPED_ARRAY_SUPPORT?(this[V]=J>>>8,this[V+1]=J&255):te(this,J,V,!1),V+2},m.prototype.writeInt32LE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,4,2147483647,-2147483648),m.TYPED_ARRAY_SUPPORT?(this[V]=J&255,this[V+1]=J>>>8,this[V+2]=J>>>16,this[V+3]=J>>>24):de(this,J,V,!0),V+4},m.prototype.writeInt32BE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,4,2147483647,-2147483648),J<0&&(J=4294967295+J+1),m.TYPED_ARRAY_SUPPORT?(this[V]=J>>>24,this[V+1]=J>>>16,this[V+2]=J>>>8,this[V+3]=J&255):de(this,J,V,!1),V+4};function fe(ne,J,V,Z,Ee,xe){if(V+Z>ne.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("Index out of range")}function be(ne,J,V,Z,Ee){return Ee||fe(ne,J,V,4,34028234663852886e22,-34028234663852886e22),R.write(ne,J,V,Z,23,4),V+4}m.prototype.writeFloatLE=function(J,V,Z){return be(this,J,V,!0,Z)},m.prototype.writeFloatBE=function(J,V,Z){return be(this,J,V,!1,Z)};function Ce(ne,J,V,Z,Ee){return Ee||fe(ne,J,V,8,17976931348623157e292,-17976931348623157e292),R.write(ne,J,V,Z,52,8),V+8}m.prototype.writeDoubleLE=function(J,V,Z){return Ce(this,J,V,!0,Z)},m.prototype.writeDoubleBE=function(J,V,Z){return Ce(this,J,V,!1,Z)},m.prototype.copy=function(J,V,Z,Ee){if(Z||(Z=0),!Ee&&Ee!==0&&(Ee=this.length),V>=J.length&&(V=J.length),V||(V=0),Ee>0&&Ee=this.length)throw new RangeError("sourceStart out of bounds");if(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),J.length-V=0;--_e)J[_e+V]=this[_e+Z];else if(xe<1e3||!m.TYPED_ARRAY_SUPPORT)for(_e=0;_e>>0,Z=Z===void 0?this.length:Z>>>0,J||(J=0);var _e;if(typeof J=="number")for(_e=V;_e55295&&V<57344){if(!Ee){if(V>56319){(J-=3)>-1&&xe.push(239,191,189);continue}else if(_e+1===Z){(J-=3)>-1&&xe.push(239,191,189);continue}Ee=V;continue}if(V<56320){(J-=3)>-1&&xe.push(239,191,189),Ee=V;continue}V=(Ee-55296<<10|V-56320)+65536}else Ee&&((J-=3)>-1&&xe.push(239,191,189));if(Ee=null,V<128){if((J-=1)<0)break;xe.push(V)}else if(V<2048){if((J-=2)<0)break;xe.push(V>>6|192,V&63|128)}else if(V<65536){if((J-=3)<0)break;xe.push(V>>12|224,V>>6&63|128,V&63|128)}else if(V<1114112){if((J-=4)<0)break;xe.push(V>>18|240,V>>12&63|128,V>>6&63|128,V&63|128)}else throw new Error("Invalid code point")}return xe}function re(ne){for(var J=[],V=0;V>8,Ee=V%256,xe.push(Ee),xe.push(Z);return xe}function Q(ne){return S.toByteArray(ge(ne))}function ie(ne,J,V,Z){for(var Ee=0;Ee=J.length||Ee>=ne.length);++Ee)J[Ee+V]=ne[Ee];return Ee}function we(ne){return ne!==ne}}).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,q,N){q.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,q,N){q.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,q,N){/*! * copy-to - index.js * Copyright(c) 2014 dead_horse * MIT Licensed */"use strict";var P=Array.prototype.slice;q.exports=m;function m(R,T){if(!(this instanceof m))return new m(R,T);this.src=R,this._withAccess=T}m.prototype.withAccess=function(R){return this._withAccess=R!==!1,this},m.prototype.pick=function(R){return Array.isArray(R)||(R=P.call(arguments)),R.length&&(this.keys=R),this},m.prototype.to=function(R){if(R=R||{},!this.src)return R;var T=this.keys||Object.keys(this.src);if(!this._withAccess){for(var g=0;ga;)if(r=h[a++],r!=r)return!0}else for(;s>a;a++)if((R||a in h)&&h[a]===g)return R||a||0;return!R&&-1}}},{"./_to-absolute-index":156,"./_to-iobject":158,"./_to-length":159}],97:[function(I,q,N){var P=I("./_cof"),m=I("./_wks")("toStringTag"),S=P(function(){return arguments}())=="Arguments",R=function(T,g){try{return T[g]}catch(C){}};q.exports=function(T){var g,C,h;return T===void 0?"Undefined":T===null?"Null":typeof(C=R(g=Object(T),m))=="string"?C:S?P(g):(h=P(g))=="Object"&&typeof g.callee=="function"?"Arguments":h}},{"./_cof":98,"./_wks":166}],98:[function(I,q,N){var P={}.toString;q.exports=function(m){return P.call(m).slice(8,-1)}},{}],99:[function(I,q,N){var P=q.exports={version:"2.6.11"};typeof __e=="number"&&(__e=P)},{}],100:[function(I,q,N){"use strict";var P=I("./_object-dp"),m=I("./_property-desc");q.exports=function(S,R,T){R in S?P.f(S,R,m(0,T)):S[R]=T}},{"./_object-dp":132,"./_property-desc":146}],101:[function(I,q,N){var P=I("./_a-function");q.exports=function(m,S,R){if(P(m),S===void 0)return m;switch(R){case 1:return function(T){return m.call(S,T)};case 2:return function(T,g){return m.call(S,T,g)};case 3:return function(T,g,C){return m.call(S,T,g,C)}}return function(){return m.apply(S,arguments)}}},{"./_a-function":92}],102:[function(I,q,N){q.exports=function(P){if(P==null)throw TypeError("Can't call method on "+P);return P}},{}],103:[function(I,q,N){q.exports=!I("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":108}],104:[function(I,q,N){var P=I("./_is-object"),m=I("./_global").document,S=P(m)&&P(m.createElement);q.exports=function(R){return S?m.createElement(R):{}}},{"./_global":110,"./_is-object":119}],105:[function(I,q,N){q.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],106:[function(I,q,N){var P=I("./_object-keys"),m=I("./_object-gops"),S=I("./_object-pie");q.exports=function(R){var T=P(R),g=m.f;if(g)for(var C=g(R),h=S.f,s=0,a;C.length>s;)h.call(R,a=C[s++])&&T.push(a);return T}},{"./_object-gops":137,"./_object-keys":140,"./_object-pie":141}],107:[function(I,q,N){var P=I("./_global"),m=I("./_core"),S=I("./_ctx"),R=I("./_hide"),T=I("./_has"),g="prototype",C=function(h,s,a){var r=h&C.F,f=h&C.G,p=h&C.S,d=h&C.P,E=h&C.B,y=h&C.W,l=f?m:m[s]||(m[s]={}),n=l[g],o=f?P:p?P[s]:(P[s]||{})[g],u,w,v;f&&(a=s);for(u in a){if(w=!r&&o&&o[u]!==void 0,w&&T(l,u))continue;v=w?o[u]:a[u],l[u]=f&&typeof o[u]!="function"?a[u]:E&&w?S(v,P):y&&o[u]==v?function(i){var D=function(k,c,b){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(k);case 2:return new i(k,c)}return new i(k,c,b)}return i.apply(this,arguments)};return D[g]=i[g],D}(v):d&&typeof v=="function"?S(Function.call,v):v,d&&((l.virtual||(l.virtual={}))[u]=v,h&C.R&&n&&!n[u]&&R(n,u,v))}};C.F=1,C.G=2,C.S=4,C.P=8,C.B=16,C.W=32,C.U=64,C.R=128,q.exports=C},{"./_core":99,"./_ctx":101,"./_global":110,"./_has":111,"./_hide":112}],108:[function(I,q,N){q.exports=function(P){try{return!!P()}catch(m){return!0}}},{}],109:[function(I,q,N){var P=I("./_ctx"),m=I("./_iter-call"),S=I("./_is-array-iter"),R=I("./_an-object"),T=I("./_to-length"),g=I("./core.get-iterator-method"),C={},h={},N=q.exports=function(s,a,r,f,p){var d=p?function(){return s}:g(s),E=P(r,f,a?2:1),y=0,l,n,o,u;if(typeof d!="function")throw TypeError(s+" is not iterable!");if(S(d)){for(l=T(s.length);l>y;y++)if(u=a?E(R(n=s[y])[0],n[1]):E(s[y]),u===C||u===h)return u}else for(o=d.call(s);!(n=o.next()).done;)if(u=m(o,E,n.value,a),u===C||u===h)return u};N.BREAK=C,N.RETURN=h},{"./_an-object":95,"./_ctx":101,"./_is-array-iter":117,"./_iter-call":120,"./_to-length":159,"./core.get-iterator-method":167}],110:[function(I,q,N){var P=q.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=P)},{}],111:[function(I,q,N){var P={}.hasOwnProperty;q.exports=function(m,S){return P.call(m,S)}},{}],112:[function(I,q,N){var P=I("./_object-dp"),m=I("./_property-desc");q.exports=I("./_descriptors")?function(S,R,T){return P.f(S,R,m(1,T))}:function(S,R,T){return S[R]=T,S}},{"./_descriptors":103,"./_object-dp":132,"./_property-desc":146}],113:[function(I,q,N){var P=I("./_global").document;q.exports=P&&P.documentElement},{"./_global":110}],114:[function(I,q,N){q.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,q,N){q.exports=function(P,m,S){var R=S===void 0;switch(m.length){case 0:return R?P():P.call(S);case 1:return R?P(m[0]):P.call(S,m[0]);case 2:return R?P(m[0],m[1]):P.call(S,m[0],m[1]);case 3:return R?P(m[0],m[1],m[2]):P.call(S,m[0],m[1],m[2]);case 4:return R?P(m[0],m[1],m[2],m[3]):P.call(S,m[0],m[1],m[2],m[3])}return P.apply(S,m)}},{}],116:[function(I,q,N){var P=I("./_cof");q.exports=Object("z").propertyIsEnumerable(0)?Object:function(m){return P(m)=="String"?m.split(""):Object(m)}},{"./_cof":98}],117:[function(I,q,N){var P=I("./_iterators"),m=I("./_wks")("iterator"),S=Array.prototype;q.exports=function(R){return R!==void 0&&(P.Array===R||S[m]===R)}},{"./_iterators":125,"./_wks":166}],118:[function(I,q,N){var P=I("./_cof");q.exports=Array.isArray||function(S){return P(S)=="Array"}},{"./_cof":98}],119:[function(I,q,N){q.exports=function(P){return typeof P=="object"?P!==null:typeof P=="function"}},{}],120:[function(I,q,N){var P=I("./_an-object");q.exports=function(m,S,R,T){try{return T?S(P(R)[0],R[1]):S(R)}catch(C){var g=m.return;throw g!==void 0&&P(g.call(m)),C}}},{"./_an-object":95}],121:[function(I,q,N){"use strict";var P=I("./_object-create"),m=I("./_property-desc"),S=I("./_set-to-string-tag"),R={};I("./_hide")(R,I("./_wks")("iterator"),function(){return this}),q.exports=function(T,g,C){T.prototype=P(R,{next:m(1,C)}),S(T,g+" Iterator")}},{"./_hide":112,"./_object-create":131,"./_property-desc":146,"./_set-to-string-tag":150,"./_wks":166}],122:[function(I,q,N){"use strict";var P=I("./_library"),m=I("./_export"),S=I("./_redefine"),R=I("./_hide"),T=I("./_iterators"),g=I("./_iter-create"),C=I("./_set-to-string-tag"),h=I("./_object-gpo"),s=I("./_wks")("iterator"),a=!([].keys&&"next"in[].keys()),r="@@iterator",f="keys",p="values",d=function(){return this};q.exports=function(E,y,l,n,o,u,w){g(l,y,n);var v=function(z){if(!a&&z in c)return c[z];switch(z){case f:return function(){return new l(this,z)};case p:return function(){return new l(this,z)}}return function(){return new l(this,z)}},i=y+" Iterator",D=o==p,k=!1,c=E.prototype,b=c[s]||c[r]||o&&c[o],x=b||v(o),_=o?D?v("entries"):x:void 0,j=y=="Array"&&c.entries||b,F,L,X;if(j&&(X=h(j.call(new E)),X!==Object.prototype&&X.next&&(C(X,i,!0),!P&&typeof X[s]!="function"&&R(X,s,d))),D&&b&&b.name!==p&&(k=!0,x=function(){return b.call(this)}),(!P||w)&&(a||k||!c[s])&&R(c,s,x),T[y]=x,T[i]=d,o)if(F={values:D?x:v(p),keys:u?x:v(f),entries:_},w)for(L in F)L in c||S(c,L,F[L]);else m(m.P+m.F*(a||k),y,F);return F}},{"./_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,q,N){var P=I("./_wks")("iterator"),m=!1;try{var S=[7][P]();S.return=function(){m=!0},Array.from(S,function(){throw 2})}catch(R){}q.exports=function(R,T){if(!T&&!m)return!1;var g=!1;try{var C=[7],h=C[P]();h.next=function(){return{done:g=!0}},C[P]=function(){return h},R(C)}catch(s){}return g}},{"./_wks":166}],124:[function(I,q,N){q.exports=function(P,m){return{value:m,done:!!P}}},{}],125:[function(I,q,N){q.exports={}},{}],126:[function(I,q,N){q.exports=!0},{}],127:[function(I,q,N){var P=I("./_uid")("meta"),m=I("./_is-object"),S=I("./_has"),R=I("./_object-dp").f,T=0,g=Object.isExtensible||function(){return!0},C=!I("./_fails")(function(){return g(Object.preventExtensions({}))}),h=function(p){R(p,P,{value:{i:"O"+ ++T,w:{}}})},s=function(p,d){if(!m(p))return typeof p=="symbol"?p:(typeof p=="string"?"S":"P")+p;if(!S(p,P)){if(!g(p))return"F";if(!d)return"E";h(p)}return p[P].i},a=function(p,d){if(!S(p,P)){if(!g(p))return!0;if(!d)return!1;h(p)}return p[P].w},r=function(p){return C&&f.NEED&&g(p)&&!S(p,P)&&h(p),p},f=q.exports={KEY:P,NEED:!1,fastKey:s,getWeak:a,onFreeze:r}},{"./_fails":108,"./_has":111,"./_is-object":119,"./_object-dp":132,"./_uid":162}],128:[function(I,q,N){var P=I("./_global"),m=I("./_task").set,S=P.MutationObserver||P.WebKitMutationObserver,R=P.process,T=P.Promise,g=I("./_cof")(R)=="process";q.exports=function(){var C,h,s,a=function(){var d,E;for(g&&(d=R.domain)&&d.exit();C;){E=C.fn,C=C.next;try{E()}catch(y){throw C?s():h=void 0,y}}h=void 0,d&&d.enter()};if(g)s=function(){R.nextTick(a)};else if(S&&!(P.navigator&&P.navigator.standalone)){var r=!0,f=document.createTextNode("");new S(a).observe(f,{characterData:!0}),s=function(){f.data=r=!r}}else if(T&&T.resolve){var p=T.resolve(void 0);s=function(){p.then(a)}}else s=function(){m.call(P,a)};return function(d){var E={fn:d,next:void 0};h&&(h.next=E),C||(C=E,s()),h=E}}},{"./_cof":98,"./_global":110,"./_task":155}],129:[function(I,q,N){"use strict";var P=I("./_a-function");function m(S){var R,T;this.promise=new S(function(g,C){if(R!==void 0||T!==void 0)throw TypeError("Bad Promise constructor");R=g,T=C}),this.resolve=P(R),this.reject=P(T)}q.exports.f=function(S){return new m(S)}},{"./_a-function":92}],130:[function(I,q,N){"use strict";var P=I("./_descriptors"),m=I("./_object-keys"),S=I("./_object-gops"),R=I("./_object-pie"),T=I("./_to-object"),g=I("./_iobject"),C=Object.assign;q.exports=!C||I("./_fails")(function(){var h={},s={},a=Symbol(),r="abcdefghijklmnopqrst";return h[a]=7,r.split("").forEach(function(f){s[f]=f}),C({},h)[a]!=7||Object.keys(C({},s)).join("")!=r})?function(s,a){for(var r=T(s),f=arguments.length,p=1,d=S.f,E=R.f;f>p;)for(var y=g(arguments[p++]),l=d?m(y).concat(d(y)):m(y),n=l.length,o=0,u;n>o;)u=l[o++],(!P||E.call(y,u))&&(r[u]=y[u]);return r}:C},{"./_descriptors":103,"./_fails":108,"./_iobject":116,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_to-object":160}],131:[function(I,q,N){var P=I("./_an-object"),m=I("./_object-dps"),S=I("./_enum-bug-keys"),R=I("./_shared-key")("IE_PROTO"),T=function(){},g="prototype",C=function(){var h=I("./_dom-create")("iframe"),s=S.length,a="<",r=">",f;for(h.style.display="none",I("./_html").appendChild(h),h.src="javascript:",f=h.contentWindow.document,f.open(),f.write(a+"script"+r+"document.F=Object"+a+"/script"+r),f.close(),C=f.F;s--;)delete C[g][S[s]];return C()};q.exports=Object.create||function(s,a){var r;return s!==null?(T[g]=P(s),r=new T,T[g]=null,r[R]=s):r=C(),a===void 0?r:m(r,a)}},{"./_an-object":95,"./_dom-create":104,"./_enum-bug-keys":105,"./_html":113,"./_object-dps":133,"./_shared-key":151}],132:[function(I,q,N){var P=I("./_an-object"),m=I("./_ie8-dom-define"),S=I("./_to-primitive"),R=Object.defineProperty;N.f=I("./_descriptors")?Object.defineProperty:function(g,C,h){if(P(g),C=S(C,!0),P(h),m)try{return R(g,C,h)}catch(s){}if("get"in h||"set"in h)throw TypeError("Accessors not supported!");return"value"in h&&(g[C]=h.value),g}},{"./_an-object":95,"./_descriptors":103,"./_ie8-dom-define":114,"./_to-primitive":161}],133:[function(I,q,N){var P=I("./_object-dp"),m=I("./_an-object"),S=I("./_object-keys");q.exports=I("./_descriptors")?Object.defineProperties:function(T,g){m(T);for(var C=S(g),h=C.length,s=0,a;h>s;)P.f(T,a=C[s++],g[a]);return T}},{"./_an-object":95,"./_descriptors":103,"./_object-dp":132,"./_object-keys":140}],134:[function(I,q,N){var P=I("./_object-pie"),m=I("./_property-desc"),S=I("./_to-iobject"),R=I("./_to-primitive"),T=I("./_has"),g=I("./_ie8-dom-define"),C=Object.getOwnPropertyDescriptor;N.f=I("./_descriptors")?C:function(s,a){if(s=S(s),a=R(a,!0),g)try{return C(s,a)}catch(r){}if(T(s,a))return m(!P.f.call(s,a),s[a])}},{"./_descriptors":103,"./_has":111,"./_ie8-dom-define":114,"./_object-pie":141,"./_property-desc":146,"./_to-iobject":158,"./_to-primitive":161}],135:[function(I,q,N){var P=I("./_to-iobject"),m=I("./_object-gopn").f,S={}.toString,R=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],T=function(g){try{return m(g)}catch(C){return R.slice()}};q.exports.f=function(C){return R&&S.call(C)=="[object Window]"?T(C):m(P(C))}},{"./_object-gopn":136,"./_to-iobject":158}],136:[function(I,q,N){var P=I("./_object-keys-internal"),m=I("./_enum-bug-keys").concat("length","prototype");N.f=Object.getOwnPropertyNames||function(R){return P(R,m)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],137:[function(I,q,N){N.f=Object.getOwnPropertySymbols},{}],138:[function(I,q,N){var P=I("./_has"),m=I("./_to-object"),S=I("./_shared-key")("IE_PROTO"),R=Object.prototype;q.exports=Object.getPrototypeOf||function(T){return T=m(T),P(T,S)?T[S]:typeof T.constructor=="function"&&T instanceof T.constructor?T.constructor.prototype:T instanceof Object?R:null}},{"./_has":111,"./_shared-key":151,"./_to-object":160}],139:[function(I,q,N){var P=I("./_has"),m=I("./_to-iobject"),S=I("./_array-includes")(!1),R=I("./_shared-key")("IE_PROTO");q.exports=function(T,g){var C=m(T),h=0,s=[],a;for(a in C)a!=R&&(P(C,a)&&s.push(a));for(;g.length>h;)P(C,a=g[h++])&&(~S(s,a)||s.push(a));return s}},{"./_array-includes":96,"./_has":111,"./_shared-key":151,"./_to-iobject":158}],140:[function(I,q,N){var P=I("./_object-keys-internal"),m=I("./_enum-bug-keys");q.exports=Object.keys||function(R){return P(R,m)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],141:[function(I,q,N){N.f={}.propertyIsEnumerable},{}],142:[function(I,q,N){var P=I("./_export"),m=I("./_core"),S=I("./_fails");q.exports=function(R,T){var g=(m.Object||{})[R]||Object[R],C={};C[R]=T(g),P(P.S+P.F*S(function(){g(1)}),"Object",C)}},{"./_core":99,"./_export":107,"./_fails":108}],143:[function(I,q,N){var P=I("./_descriptors"),m=I("./_object-keys"),S=I("./_to-iobject"),R=I("./_object-pie").f;q.exports=function(T){return function(g){for(var C=S(g),h=m(C),s=h.length,a=0,r=[],f;s>a;)f=h[a++],(!P||R.call(C,f))&&r.push(T?[f,C[f]]:C[f]);return r}}},{"./_descriptors":103,"./_object-keys":140,"./_object-pie":141,"./_to-iobject":158}],144:[function(I,q,N){q.exports=function(P){try{return{e:!1,v:P()}}catch(m){return{e:!0,v:m}}}},{}],145:[function(I,q,N){var P=I("./_an-object"),m=I("./_is-object"),S=I("./_new-promise-capability");q.exports=function(R,T){if(P(R),m(T)&&T.constructor===R)return T;var g=S.f(R),C=g.resolve;return C(T),g.promise}},{"./_an-object":95,"./_is-object":119,"./_new-promise-capability":129}],146:[function(I,q,N){q.exports=function(P,m){return{enumerable:!(P&1),configurable:!(P&2),writable:!(P&4),value:m}}},{}],147:[function(I,q,N){var P=I("./_hide");q.exports=function(m,S,R){for(var T in S)R&&m[T]?m[T]=S[T]:P(m,T,S[T]);return m}},{"./_hide":112}],148:[function(I,q,N){q.exports=I("./_hide")},{"./_hide":112}],149:[function(I,q,N){"use strict";var P=I("./_global"),m=I("./_core"),S=I("./_object-dp"),R=I("./_descriptors"),T=I("./_wks")("species");q.exports=function(g){var C=typeof m[g]=="function"?m[g]:P[g];R&&C&&!C[T]&&S.f(C,T,{configurable:!0,get:function(){return this}})}},{"./_core":99,"./_descriptors":103,"./_global":110,"./_object-dp":132,"./_wks":166}],150:[function(I,q,N){var P=I("./_object-dp").f,m=I("./_has"),S=I("./_wks")("toStringTag");q.exports=function(R,T,g){R&&!m(R=g?R:R.prototype,S)&&P(R,S,{configurable:!0,value:T})}},{"./_has":111,"./_object-dp":132,"./_wks":166}],151:[function(I,q,N){var P=I("./_shared")("keys"),m=I("./_uid");q.exports=function(S){return P[S]||(P[S]=m(S))}},{"./_shared":152,"./_uid":162}],152:[function(I,q,N){var P=I("./_core"),m=I("./_global"),S="__core-js_shared__",R=m[S]||(m[S]={});(q.exports=function(T,g){return R[T]||(R[T]=g!==void 0?g:{})})("versions",[]).push({version:P.version,mode:I("./_library")?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},{"./_core":99,"./_global":110,"./_library":126}],153:[function(I,q,N){var P=I("./_an-object"),m=I("./_a-function"),S=I("./_wks")("species");q.exports=function(R,T){var g=P(R).constructor,C;return g===void 0||(C=P(g)[S])==null?T:m(C)}},{"./_a-function":92,"./_an-object":95,"./_wks":166}],154:[function(I,q,N){var P=I("./_to-integer"),m=I("./_defined");q.exports=function(S){return function(R,T){var g=String(m(R)),C=P(T),h=g.length,s,a;return C<0||C>=h?S?"":void 0:(s=g.charCodeAt(C),s<55296||s>56319||C+1===h||(a=g.charCodeAt(C+1))<56320||a>57343?S?g.charAt(C):s:S?g.slice(C,C+2):(s-55296<<10)+(a-56320)+65536)}}},{"./_defined":102,"./_to-integer":157}],155:[function(I,q,N){var P=I("./_ctx"),m=I("./_invoke"),S=I("./_html"),R=I("./_dom-create"),T=I("./_global"),g=T.process,C=T.setImmediate,h=T.clearImmediate,s=T.MessageChannel,a=T.Dispatch,r=0,f={},p="onreadystatechange",d,E,y,l=function(){var o=+this;if(f.hasOwnProperty(o)){var u=f[o];delete f[o],u()}},n=function(o){l.call(o.data)};(!C||!h)&&(C=function(u){for(var w=[],v=1;arguments.length>v;)w.push(arguments[v++]);return f[++r]=function(){m(typeof u=="function"?u:Function(u),w)},d(r),r},h=function(u){delete f[u]},I("./_cof")(g)=="process"?d=function(o){g.nextTick(P(l,o,1))}:a&&a.now?d=function(o){a.now(P(l,o,1))}:s?(E=new s,y=E.port2,E.port1.onmessage=n,d=P(y.postMessage,y,1)):T.addEventListener&&typeof postMessage=="function"&&!T.importScripts?(d=function(o){T.postMessage(o+"","*")},T.addEventListener("message",n,!1)):p in R("script")?d=function(o){S.appendChild(R("script"))[p]=function(){S.removeChild(this),l.call(o)}}:d=function(o){setTimeout(P(l,o,1),0)}),q.exports={set:C,clear:h}},{"./_cof":98,"./_ctx":101,"./_dom-create":104,"./_global":110,"./_html":113,"./_invoke":115}],156:[function(I,q,N){var P=I("./_to-integer"),m=Math.max,S=Math.min;q.exports=function(R,T){return R=P(R),R<0?m(R+T,0):S(R,T)}},{"./_to-integer":157}],157:[function(I,q,N){var P=Math.ceil,m=Math.floor;q.exports=function(S){return isNaN(S=+S)?0:(S>0?m:P)(S)}},{}],158:[function(I,q,N){var P=I("./_iobject"),m=I("./_defined");q.exports=function(S){return P(m(S))}},{"./_defined":102,"./_iobject":116}],159:[function(I,q,N){var P=I("./_to-integer"),m=Math.min;q.exports=function(S){return S>0?m(P(S),9007199254740991):0}},{"./_to-integer":157}],160:[function(I,q,N){var P=I("./_defined");q.exports=function(m){return Object(P(m))}},{"./_defined":102}],161:[function(I,q,N){var P=I("./_is-object");q.exports=function(m,S){if(!P(m))return m;var R,T;if(S&&typeof(R=m.toString)=="function"&&!P(T=R.call(m)))return T;if(typeof(R=m.valueOf)=="function"&&!P(T=R.call(m)))return T;if(!S&&typeof(R=m.toString)=="function"&&!P(T=R.call(m)))return T;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":119}],162:[function(I,q,N){var P=0,m=Math.random();q.exports=function(S){return"Symbol(".concat(S===void 0?"":S,")_",(++P+m).toString(36))}},{}],163:[function(I,q,N){var P=I("./_global"),m=P.navigator;q.exports=m&&m.userAgent||""},{"./_global":110}],164:[function(I,q,N){var P=I("./_global"),m=I("./_core"),S=I("./_library"),R=I("./_wks-ext"),T=I("./_object-dp").f;q.exports=function(g){var C=m.Symbol||(m.Symbol=S?{}:P.Symbol||{});g.charAt(0)!="_"&&!(g in C)&&T(C,g,{value:R.f(g)})}},{"./_core":99,"./_global":110,"./_library":126,"./_object-dp":132,"./_wks-ext":165}],165:[function(I,q,N){N.f=I("./_wks")},{"./_wks":166}],166:[function(I,q,N){var P=I("./_shared")("wks"),m=I("./_uid"),S=I("./_global").Symbol,R=typeof S=="function",T=q.exports=function(g){return P[g]||(P[g]=R&&S[g]||(R?S:m)("Symbol."+g))};T.store=P},{"./_global":110,"./_shared":152,"./_uid":162}],167:[function(I,q,N){var P=I("./_classof"),m=I("./_wks")("iterator"),S=I("./_iterators");q.exports=I("./_core").getIteratorMethod=function(R){if(R!=null)return R[m]||R["@@iterator"]||S[P(R)]}},{"./_classof":97,"./_core":99,"./_iterators":125,"./_wks":166}],168:[function(I,q,N){"use strict";var P=I("./_ctx"),m=I("./_export"),S=I("./_to-object"),R=I("./_iter-call"),T=I("./_is-array-iter"),g=I("./_to-length"),C=I("./_create-property"),h=I("./core.get-iterator-method");m(m.S+m.F*!I("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(a){var r=S(a),f=typeof this=="function"?this:Array,p=arguments.length,d=p>1?arguments[1]:void 0,E=d!==void 0,y=0,l=h(r),n,o,u,w;if(E&&(d=P(d,p>2?arguments[2]:void 0,2)),l!=null&&!(f==Array&&T(l)))for(w=l.call(r),o=new f;!(u=w.next()).done;y++)C(o,y,E?R(w,d,[u.value,y],!0):u.value);else for(n=g(r.length),o=new f(n);n>y;y++)C(o,y,E?d(r[y],y):r[y]);return o.length=y,o}})},{"./_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,q,N){"use strict";var P=I("./_add-to-unscopables"),m=I("./_iter-step"),S=I("./_iterators"),R=I("./_to-iobject");q.exports=I("./_iter-define")(Array,"Array",function(T,g){this._t=R(T),this._i=0,this._k=g},function(){var T=this._t,g=this._k,C=this._i++;return!T||C>=T.length?(this._t=void 0,m(1)):g=="keys"?m(0,C):g=="values"?m(0,T[C]):m(0,[C,T[C]])},"values"),S.Arguments=S.Array,P("keys"),P("values"),P("entries")},{"./_add-to-unscopables":93,"./_iter-define":122,"./_iter-step":124,"./_iterators":125,"./_to-iobject":158}],170:[function(I,q,N){"use strict";var P=I("./_is-object"),m=I("./_object-gpo"),S=I("./_wks")("hasInstance"),R=Function.prototype;S in R||I("./_object-dp").f(R,S,{value:function(T){if(typeof this!="function"||!P(T))return!1;if(!P(this.prototype))return T instanceof this;for(;T=m(T);)if(this.prototype===T)return!0;return!1}})},{"./_is-object":119,"./_object-dp":132,"./_object-gpo":138,"./_wks":166}],171:[function(I,q,N){var P=I("./_export");P(P.S+P.F,"Object",{assign:I("./_object-assign")})},{"./_export":107,"./_object-assign":130}],172:[function(I,q,N){var P=I("./_export");P(P.S,"Object",{create:I("./_object-create")})},{"./_export":107,"./_object-create":131}],173:[function(I,q,N){var P=I("./_export");P(P.S+P.F*!I("./_descriptors"),"Object",{defineProperty:I("./_object-dp").f})},{"./_descriptors":103,"./_export":107,"./_object-dp":132}],174:[function(I,q,N){I("./_object-sap")("getOwnPropertyNames",function(){return I("./_object-gopn-ext").f})},{"./_object-gopn-ext":135,"./_object-sap":142}],175:[function(I,q,N){var P=I("./_to-object"),m=I("./_object-gpo");I("./_object-sap")("getPrototypeOf",function(){return function(R){return m(P(R))}})},{"./_object-gpo":138,"./_object-sap":142,"./_to-object":160}],176:[function(I,q,N){var P=I("./_to-object"),m=I("./_object-keys");I("./_object-sap")("keys",function(){return function(R){return m(P(R))}})},{"./_object-keys":140,"./_object-sap":142,"./_to-object":160}],177:[function(I,q,N){arguments[4][71][0].apply(N,arguments)},{dup:71}],178:[function(I,q,N){"use strict";var P=I("./_library"),m=I("./_global"),S=I("./_ctx"),R=I("./_classof"),T=I("./_export"),g=I("./_is-object"),C=I("./_a-function"),h=I("./_an-instance"),s=I("./_for-of"),a=I("./_species-constructor"),r=I("./_task").set,f=I("./_microtask")(),p=I("./_new-promise-capability"),d=I("./_perform"),E=I("./_user-agent"),y=I("./_promise-resolve"),l="Promise",n=m.TypeError,o=m.process,u=o&&o.versions,w=u&&u.v8||"",v=m[l],i=R(o)=="process",D=function(){},k,c,b,x,_=c=p.f,j=!!function(){try{var B=v.resolve(1),W=(B.constructor={})[I("./_wks")("species")]=function(te){te(D,D)};return(i||typeof PromiseRejectionEvent=="function")&&B.then(D)instanceof W&&w.indexOf("6.6")!==0&&E.indexOf("Chrome/66")===-1}catch(te){}}(),F=function(B){var W;return g(B)&&typeof(W=B.then)=="function"?W:!1},L=function(B,W){if(B._n)return;B._n=!0;var te=B._c;f(function(){for(var de=B._v,fe=B._s==1,be=0,Ce=function(ue){var ge=fe?ue.ok:ue.fail,pe=ue.resolve,oe=ue.reject,ae=ue.domain,re,he,Q;try{ge?(fe||(B._h==2&&H(B),B._h=1),ge===!0?re=de:(ae&&ae.enter(),re=ge(de),ae&&(ae.exit(),Q=!0)),re===ue.promise?oe(n("Promise-chain cycle")):(he=F(re))?he.call(re,pe,oe):pe(re)):oe(de)}catch(ie){ae&&!Q&&ae.exit(),oe(ie)}};te.length>be;)Ce(te[be++]);B._c=[],B._n=!1,W&&!B._h&&X(B)})},X=function(B){r.call(m,function(){var W=B._v,te=z(B),de,fe,be;if(te&&(de=d(function(){i?o.emit("unhandledRejection",W,B):(fe=m.onunhandledrejection)?fe({promise:B,reason:W}):(be=m.console)&&be.error&&be.error("Unhandled promise rejection",W)}),B._h=i||z(B)?2:1),B._a=void 0,te&&de.e)throw de.v})},z=function(B){return B._h!==1&&(B._a||B._c).length===0},H=function(B){r.call(m,function(){var W;i?o.emit("rejectionHandled",B):(W=m.onrejectionhandled)&&W({promise:B,reason:B._v})})},G=function(B){var W=this;if(W._d)return;W._d=!0,W=W._w||W,W._v=B,W._s=2,W._a||(W._a=W._c.slice()),L(W,!0)},U=function(B){var W=this,te;if(W._d)return;W._d=!0,W=W._w||W;try{if(W===B)throw n("Promise can't be resolved itself");(te=F(B))?f(function(){var de={_w:W,_d:!1};try{te.call(B,S(U,de,1),S(G,de,1))}catch(fe){G.call(de,fe)}}):(W._v=B,W._s=1,L(W,!1))}catch(de){G.call({_w:W,_d:!1},de)}};j||(v=function(W){h(this,v,l,"_h"),C(W),k.call(this);try{W(S(U,this,1),S(G,this,1))}catch(te){G.call(this,te)}},k=function(W){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},k.prototype=I("./_redefine-all")(v.prototype,{then:function(W,te){var de=_(a(this,v));return de.ok=typeof W=="function"?W:!0,de.fail=typeof te=="function"&&te,de.domain=i?o.domain:void 0,this._c.push(de),this._a&&this._a.push(de),this._s&&L(this,!1),de.promise},catch:function(B){return this.then(void 0,B)}}),b=function(){var B=new k;this.promise=B,this.resolve=S(U,B,1),this.reject=S(G,B,1)},p.f=_=function(B){return B===v||B===x?new b(B):c(B)}),T(T.G+T.W+T.F*!j,{Promise:v}),I("./_set-to-string-tag")(v,l),I("./_set-species")(l),x=I("./_core")[l],T(T.S+T.F*!j,l,{reject:function(W){var te=_(this),de=te.reject;return de(W),te.promise}}),T(T.S+T.F*(P||!j),l,{resolve:function(W){return y(P&&this===x?v:this,W)}}),T(T.S+T.F*!(j&&I("./_iter-detect")(function(B){v.all(B).catch(D)})),l,{all:function(W){var te=this,de=_(te),fe=de.resolve,be=de.reject,Ce=d(function(){var ue=[],ge=0,pe=1;s(W,!1,function(oe){var ae=ge++,re=!1;ue.push(void 0),pe++,te.resolve(oe).then(function(he){if(re)return;re=!0,ue[ae]=he,--pe||fe(ue)},be)}),--pe||fe(ue)});return Ce.e&&be(Ce.v),de.promise},race:function(W){var te=this,de=_(te),fe=de.reject,be=d(function(){s(W,!1,function(Ce){te.resolve(Ce).then(de.resolve,fe)})});return be.e&&fe(be.v),de.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,q,N){var P=I("./_export"),m=I("./_to-absolute-index"),S=String.fromCharCode,R=String.fromCodePoint;P(P.S+P.F*(!!R&&R.length!=1),"String",{fromCodePoint:function(g){for(var C=[],h=arguments.length,s=0,a;h>s;){if(a=+arguments[s++],m(a,1114111)!==a)throw RangeError(a+" is not a valid code point");C.push(a<65536?S(a):S(((a-=65536)>>10)+55296,a%1024+56320))}return C.join("")}})},{"./_export":107,"./_to-absolute-index":156}],180:[function(I,q,N){"use strict";var P=I("./_string-at")(!0);I("./_iter-define")(String,"String",function(m){this._t=String(m),this._i=0},function(){var m=this._t,S=this._i,R;return S>=m.length?{value:void 0,done:!0}:(R=P(m,S),this._i+=R.length,{value:R,done:!1})})},{"./_iter-define":122,"./_string-at":154}],181:[function(I,q,N){"use strict";var P=I("./_global"),m=I("./_has"),S=I("./_descriptors"),R=I("./_export"),T=I("./_redefine"),g=I("./_meta").KEY,C=I("./_fails"),h=I("./_shared"),s=I("./_set-to-string-tag"),a=I("./_uid"),r=I("./_wks"),f=I("./_wks-ext"),p=I("./_wks-define"),d=I("./_enum-keys"),E=I("./_is-array"),y=I("./_an-object"),l=I("./_is-object"),n=I("./_to-object"),o=I("./_to-iobject"),u=I("./_to-primitive"),w=I("./_property-desc"),v=I("./_object-create"),i=I("./_object-gopn-ext"),D=I("./_object-gopd"),k=I("./_object-gops"),c=I("./_object-dp"),b=I("./_object-keys"),x=D.f,_=c.f,j=i.f,F=P.Symbol,L=P.JSON,X=L&&L.stringify,z="prototype",H=r("_hidden"),G=r("toPrimitive"),U={}.propertyIsEnumerable,B=h("symbol-registry"),W=h("symbols"),te=h("op-symbols"),de=Object[z],fe=typeof F=="function"&&!!k.f,be=P.QObject,Ce=!be||!be[z]||!be[z].findChild,ue=S&&C(function(){return v(_({},"a",{get:function(){return _(this,"a",{value:7}).a}})).a!=7})?function(xe,_e,je){var Be=x(de,_e);Be&&delete de[_e],_(xe,_e,je),Be&&xe!==de&&_(de,_e,Be)}:_,ge=function(xe){var _e=W[xe]=v(F[z]);return _e._k=xe,_e},pe=fe&&typeof F.iterator=="symbol"?function(xe){return typeof xe=="symbol"}:function(xe){return xe instanceof F},oe=function(_e,je,Be){return _e===de&&oe(te,je,Be),y(_e),je=u(je,!0),y(Be),m(W,je)?(Be.enumerable?(m(_e,H)&&_e[H][je]&&(_e[H][je]=!1),Be=v(Be,{enumerable:w(0,!1)})):(m(_e,H)||_(_e,H,w(1,{})),_e[H][je]=!0),ue(_e,je,Be)):_(_e,je,Be)},ae=function(_e,je){y(_e);for(var Be=d(je=o(je)),He=0,Ue=Be.length,ze;Ue>He;)oe(_e,ze=Be[He++],je[ze]);return _e},re=function(_e,je){return je===void 0?v(_e):ae(v(_e),je)},he=function(_e){var je=U.call(this,_e=u(_e,!0));return this===de&&m(W,_e)&&!m(te,_e)?!1:je||!m(this,_e)||!m(W,_e)||m(this,H)&&this[H][_e]?je:!0},Q=function(_e,je){if(_e=o(_e),je=u(je,!0),_e===de&&m(W,je)&&!m(te,je))return;var Be=x(_e,je);return Be&&m(W,je)&&!(m(_e,H)&&_e[H][je])&&(Be.enumerable=!0),Be},ie=function(_e){for(var je=j(o(_e)),Be=[],He=0,Ue;je.length>He;)!m(W,Ue=je[He++])&&Ue!=H&&Ue!=g&&Be.push(Ue);return Be},we=function(_e){for(var je=_e===de,Be=j(je?te:o(_e)),He=[],Ue=0,ze;Be.length>Ue;)m(W,ze=Be[Ue++])&&(je?m(de,ze):!0)&&He.push(W[ze]);return He};fe||(F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor!");var _e=a(arguments.length>0?arguments[0]:void 0),je=function(Be){this===de&&je.call(te,Be),m(this,H)&&m(this[H],_e)&&(this[H][_e]=!1),ue(this,_e,w(1,Be))};return S&&Ce&&ue(de,_e,{configurable:!0,set:je}),ge(_e)},T(F[z],"toString",function(){return this._k}),D.f=Q,c.f=oe,I("./_object-gopn").f=i.f=ie,I("./_object-pie").f=he,k.f=we,S&&!I("./_library")&&T(de,"propertyIsEnumerable",he,!0),f.f=function(xe){return ge(r(xe))}),R(R.G+R.W+R.F*!fe,{Symbol:F});for(var ne="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),J=0;ne.length>J;)r(ne[J++]);for(var V=b(r.store),Z=0;V.length>Z;)p(V[Z++]);R(R.S+R.F*!fe,"Symbol",{for:function(xe){return m(B,xe+="")?B[xe]:B[xe]=F(xe)},keyFor:function(_e){if(!pe(_e))throw TypeError(_e+" is not a symbol!");for(var je in B)if(B[je]===_e)return je},useSetter:function(){Ce=!0},useSimple:function(){Ce=!1}}),R(R.S+R.F*!fe,"Object",{create:re,defineProperty:oe,defineProperties:ae,getOwnPropertyDescriptor:Q,getOwnPropertyNames:ie,getOwnPropertySymbols:we});var Ee=C(function(){k.f(1)});R(R.S+R.F*Ee,"Object",{getOwnPropertySymbols:function(_e){return k.f(n(_e))}}),L&&R(R.S+R.F*(!fe||C(function(){var xe=F();return X([xe])!="[null]"||X({a:xe})!="{}"||X(Object(xe))!="{}"})),"JSON",{stringify:function(_e){for(var je=[_e],Be=1,He,Ue;arguments.length>Be;)je.push(arguments[Be++]);return Ue=He=je[1],!l(He)&&_e===void 0||pe(_e)?void 0:(E(He)||(He=function(ze,Ge){if(typeof Ue=="function"&&(Ge=Ue.call(this,ze,Ge)),!pe(Ge))return Ge}),je[1]=He,X.apply(L,je))}}),F[z][G]||I("./_hide")(F[z],G,F[z].valueOf),s(F,"Symbol"),s(Math,"Math",!0),s(P.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,q,N){var P=I("./_export"),m=I("./_object-to-array")(!0);P(P.S,"Object",{entries:function(R){return m(R)}})},{"./_export":107,"./_object-to-array":143}],183:[function(I,q,N){"use strict";var P=I("./_export"),m=I("./_core"),S=I("./_global"),R=I("./_species-constructor"),T=I("./_promise-resolve");P(P.P+P.R,"Promise",{finally:function(g){var C=R(this,m.Promise||S.Promise),h=typeof g=="function";return this.then(h?function(s){return T(C,g()).then(function(){return s})}:g,h?function(s){return T(C,g()).then(function(){throw s})}:g)}})},{"./_core":99,"./_export":107,"./_global":110,"./_promise-resolve":145,"./_species-constructor":153}],184:[function(I,q,N){"use strict";var P=I("./_export"),m=I("./_new-promise-capability"),S=I("./_perform");P(P.S,"Promise",{try:function(R){var T=m.f(this),g=S(R);return(g.e?T.reject:T.resolve)(g.v),T.promise}})},{"./_export":107,"./_new-promise-capability":129,"./_perform":144}],185:[function(I,q,N){I("./_wks-define")("asyncIterator")},{"./_wks-define":164}],186:[function(I,q,N){I("./_wks-define")("observable")},{"./_wks-define":164}],187:[function(I,q,N){I("./es6.array.iterator");for(var P=I("./_global"),m=I("./_hide"),S=I("./_iterators"),R=I("./_wks")("toStringTag"),T="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(","),g=0;g0?"-":"+")+g(Math.floor(Math.abs(b)/60)*100+Math.abs(b)%60,4),S:["th","st","nd","rd"][o%10>3?0:(o%100-o%10!=10)*o%10],W:x,N:_};return d.replace(a,function(F){return F in j?j[F]:F.slice(1,F.length-1)})}}();T.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"},T.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 g(a,r){for(a=String(a),r=r||2;a.length]/;q.exports=m;function m(S){var R=""+S,T=P.exec(R);if(!T)return R;var g,C="",h=0,s=0;for(h=T.index;h0&&this._events[g].length>h&&(this._events[g].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[g].length),typeof console.trace=="function"&&console.trace())),this},P.prototype.on=P.prototype.addListener,P.prototype.once=function(g,C){if(!m(C))throw TypeError("listener must be a function");var h=!1;function s(){this.removeListener(g,s),h||(h=!0,C.apply(this,arguments))}return s.listener=C,this.on(g,s),this},P.prototype.removeListener=function(g,C){var h,s,a,r;if(!m(C))throw TypeError("listener must be a function");if(!this._events||!this._events[g])return this;if(h=this._events[g],a=h.length,s=-1,h===C||m(h.listener)&&h.listener===C)delete this._events[g],this._events.removeListener&&this.emit("removeListener",g,C);else if(R(h)){for(r=a;r-- >0;)if(h[r]===C||h[r].listener&&h[r].listener===C){s=r;break}if(s<0)return this;h.length===1?(h.length=0,delete this._events[g]):h.splice(s,1),this._events.removeListener&&this.emit("removeListener",g,C)}return this},P.prototype.removeAllListeners=function(g){var C,h;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[g]&&delete this._events[g],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(h=this._events[g],m(h))this.removeListener(g,h);else if(h)for(;h.length;)this.removeListener(g,h[h.length-1]);return delete this._events[g],this},P.prototype.listeners=function(g){var C;return!this._events||!this._events[g]?C=[]:m(this._events[g])?C=[this._events[g]]:C=this._events[g].slice(),C},P.prototype.listenerCount=function(g){if(this._events){var C=this._events[g];if(m(C))return 1;if(C)return C.length}return 0},P.listenerCount=function(g,C){return g.listenerCount(C)};function m(g){return typeof g=="function"}function S(g){return typeof g=="number"}function R(g){return typeof g=="object"&&g!==null}function T(g){return g===void 0}},{}],193:[function(I,q,N){var P=I("http"),m=q.exports;for(var S in P)P.hasOwnProperty(S)&&(m[S]=P[S]);m.request=function(R,T){return R||(R={}),R.scheme="https",R.protocol="https:",P.request.call(this,R,T)}},{http:231}],194:[function(I,q,N){/*! * humanize-ms - index.js * Copyright(c) 2014 dead_horse * MIT Licensed */"use strict";var P=I("util"),m=I("ms");q.exports=function(S){if(typeof S=="number")return S;var R=m(S);if(R===void 0){var T=new Error(P.format("humanize-ms(%j) result undefined",S));console.warn(T.stack)}return R}},{ms:204,util:243}],195:[function(I,q,N){N.read=function(P,m,S,R,T){var g,C,h=T*8-R-1,s=(1<>1,r=-7,f=S?T-1:0,p=S?-1:1,d=P[m+f];for(f+=p,g=d&(1<<-r)-1,d>>=-r,r+=h;r>0;g=g*256+P[m+f],f+=p,r-=8);for(C=g&(1<<-r)-1,g>>=-r,r+=R;r>0;C=C*256+P[m+f],f+=p,r-=8);if(g===0)g=1-a;else{if(g===s)return C?NaN:(d?-1:1)*Infinity;C=C+Math.pow(2,R),g=g-a}return(d?-1:1)*C*Math.pow(2,g-R)},N.write=function(P,m,S,R,T,g){var C,h,s,a=g*8-T-1,r=(1<>1,p=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=R?0:g-1,E=R?1:-1,y=m<0||m===0&&1/m<0?1:0;for(m=Math.abs(m),isNaN(m)||m===Infinity?(h=isNaN(m)?1:0,C=r):(C=Math.floor(Math.log(m)/Math.LN2),m*(s=Math.pow(2,-C))<1&&(C--,s*=2),C+f>=1?m+=p/s:m+=p*Math.pow(2,1-f),m*s>=2&&(C++,s/=2),C+f>=r?(h=0,C=r):C+f>=1?(h=(m*s-1)*Math.pow(2,T),C=C+f):(h=m*Math.pow(2,f-1)*Math.pow(2,T),C=0));T>=8;P[S+d]=h&255,d+=E,h/=256,T-=8);for(C=C<0;P[S+d]=C&255,d+=E,C/=256,a-=8);P[S+d-E]|=y*128}},{}],196:[function(I,q,N){typeof Object.create=="function"?q.exports=function(m,S){S&&(m.super_=S,m.prototype=Object.create(S.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}))}:q.exports=function(m,S){if(S){m.super_=S;var R=function(){};R.prototype=S.prototype,m.prototype=new R,m.prototype.constructor=m}}},{}],197:[function(I,q,N){/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */q.exports=function(S){return S!=null&&(P(S)||m(S)||!!S._isBuffer)};function P(S){return!!S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S)}function m(S){return typeof S.readFloatLE=="function"&&typeof S.slice=="function"&&P(S.slice(0,0))}},{}],198:[function(I,q,N){var P={}.toString;q.exports=Array.isArray||function(m){return P.call(m)=="[object Array]"}},{}],199:[function(require,module,exports){(function(global){(function(I,q){typeof exports=="object"&&typeof module!="undefined"?module.exports=q(I):typeof define=="function"&&define.amd?define(q):q(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 q={},N=0,P=I.length;N>>6)+fromCharCode(128|q&63):fromCharCode(224|q>>>12&15)+fromCharCode(128|q>>>6&63)+fromCharCode(128|q&63)}else{var q=65536+(I.charCodeAt(0)-55296)*1024+(I.charCodeAt(1)-56320);return fromCharCode(240|q>>>18&7)+fromCharCode(128|q>>>12&63)+fromCharCode(128|q>>>6&63)+fromCharCode(128|q&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 q=[0,2,1][I.length%3],N=I.charCodeAt(0)<<16|(I.length>1?I.charCodeAt(1):0)<<8|(I.length>2?I.charCodeAt(2):0),P=[b64chars.charAt(N>>>18),b64chars.charAt(N>>>12&63),q>=2?"=":b64chars.charAt(N>>>6&63),q>=1?"=":b64chars.charAt(N&63)];return P.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 q=Object.prototype.toString.call(I)==="[object Uint8Array]";return q?I.toString("base64"):btoa(utob(String(I)))},encode=function(I,q){return q?_encode(String(I)).replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).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 q=(7&I.charCodeAt(0))<<18|(63&I.charCodeAt(1))<<12|(63&I.charCodeAt(2))<<6|63&I.charCodeAt(3),N=q-65536;return fromCharCode((N>>>10)+55296)+fromCharCode((N&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 q=I.length,N=q%4,P=(q>0?b64tab[I.charAt(0)]<<18:0)|(q>1?b64tab[I.charAt(1)]<<12:0)|(q>2?b64tab[I.charAt(2)]<<6:0)|(q>3?b64tab[I.charAt(3)]:0),m=[fromCharCode(P>>>16),fromCharCode(P>>>8&255),fromCharCode(P&255)];return m.length-=[0,0,2,1][N],m.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(q){return q=="-"?"+":"/"}).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,q,N){/*! * merge-descriptors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */"use strict";q.exports=m;var P=Object.prototype.hasOwnProperty;function m(S,R,T){if(!S)throw new TypeError("argument dest is required");if(!R)throw new TypeError("argument src is required");return T===void 0&&(T=!0),Object.getOwnPropertyNames(R).forEach(function(C){if(!T&&P.call(S,C))return;var h=Object.getOwnPropertyDescriptor(R,C);Object.defineProperty(S,C,h)}),S}},{}],201:[function(I,q,N){"use strict";function P(){this._types=Object.create(null),this._extensions=Object.create(null);for(var m=0;m0)return C(r);if(p==="number"&&isFinite(r))return f.long?s(r):h(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 f=/^(-?(?:\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(!f)return;var p=parseFloat(f[1]),d=(f[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return p*g;case"weeks":case"week":case"w":return p*T;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*m;case"seconds":case"second":case"secs":case"sec":case"s":return p*P;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}function h(r){var f=Math.abs(r);return f>=R?Math.round(r/R)+"d":f>=S?Math.round(r/S)+"h":f>=m?Math.round(r/m)+"m":f>=P?Math.round(r/P)+"s":r+"ms"}function s(r){var f=Math.abs(r);return f>=R?a(r,f,R,"day"):f>=S?a(r,f,S,"hour"):f>=m?a(r,f,m,"minute"):f>=P?a(r,f,P,"second"):r+" ms"}function a(r,f,p,d){var E=f>=p*1.5;return Math.round(r/p)+" "+d+(E?"s":"")}},{}],205:[function(I,q,N){(function(P){function m(g,C){for(var h=0,s=g.length-1;s>=0;s--){var a=g[s];a==="."?g.splice(s,1):a===".."?(g.splice(s,1),h++):h&&(g.splice(s,1),h--)}if(C)for(;h--;h)g.unshift("..");return g}N.resolve=function(){for(var g="",C=!1,h=arguments.length-1;h>=-1&&!C;h--){var s=h>=0?arguments[h]:P.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!s)continue;g=s+"/"+g,C=s.charAt(0)==="/"}return g=m(R(g.split("/"),function(a){return!!a}),!C).join("/"),(C?"/":"")+g||"."},N.normalize=function(g){var C=N.isAbsolute(g),h=T(g,-1)==="/";return g=m(R(g.split("/"),function(s){return!!s}),!C).join("/"),!g&&!C&&(g="."),g&&h&&(g+="/"),(C?"/":"")+g},N.isAbsolute=function(g){return g.charAt(0)==="/"},N.join=function(){var g=Array.prototype.slice.call(arguments,0);return N.normalize(R(g,function(C,h){if(typeof C!="string")throw new TypeError("Arguments to path.join must be strings");return C}).join("/"))},N.relative=function(g,C){g=N.resolve(g).substr(1),C=N.resolve(C).substr(1);function h(E){for(var y=0;y=0&&!(E[l]!=="");l--);return y>l?[]:E.slice(y,l-y+1)}for(var s=h(g.split("/")),a=h(C.split("/")),r=Math.min(s.length,a.length),f=r,p=0;p=1;--r)if(C=g.charCodeAt(r),C===47){if(!a){s=r;break}}else a=!1;return s===-1?h?"/":".":h&&s===1?"/":g.slice(0,s)};function S(g){typeof g!="string"&&(g=g+"");var C=0,h=-1,s=!0,a;for(a=g.length-1;a>=0;--a)if(g.charCodeAt(a)===47){if(!s){C=a+1;break}}else h===-1&&(s=!1,h=a+1);return h===-1?"":g.slice(C,h)}N.basename=function(g,C){var h=S(g);return C&&h.substr(-1*C.length)===C&&(h=h.substr(0,h.length-C.length)),h},N.extname=function(g){typeof g!="string"&&(g=g+"");for(var C=-1,h=0,s=-1,a=!0,r=0,f=g.length-1;f>=0;--f){var p=g.charCodeAt(f);if(p===47){if(!a){h=f+1;break}continue}s===-1&&(a=!1,s=f+1),p===46?C===-1?C=f:r!==1&&(r=1):C!==-1&&(r=-1)}return C===-1||s===-1||r===0||r===1&&C===s-1&&C===h+1?"":g.slice(C,s)};function R(g,C){if(g.filter)return g.filter(C);for(var h=[],s=0;s * Copyright 2014-2018 Benjamin Tan * Copyright 2011-2013 John-David Dalton * Available under MIT license */(function(){"use strict";var m={function:!0,object:!0},S=m[typeof window]&&window||this,R=S,T=m[typeof N]&&N,g=m[typeof q]&&q&&!q.nodeType&&q,C=T&&g&&typeof P=="object"&&P;C&&(C.global===C||C.window===C||C.self===C)&&(S=C);var h=Math.pow(2,53)-1,s=/\bOpera/,a=this,r=Object.prototype,f=r.hasOwnProperty,p=r.toString;function d(c){return c=String(c),c.charAt(0).toUpperCase()+c.slice(1)}function E(c,b,x){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 b&&x&&/^Win/i.test(c)&&!/^Windows Phone /i.test(c)&&(_=_[/[\d.]+$/.exec(c)])&&(c="Windows "+_),c=String(c),b&&x&&(c=c.replace(RegExp(b,"i"),x)),c=l(c.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]),c}function y(c,b){var x=-1,_=c?c.length:0;if(typeof _=="number"&&_>-1&&_<=h)for(;++x<_;)b(c[x],x,c);else n(c,b)}function l(c){return c=i(c),/^(?:webOS|i(?:OS|P))/.test(c)?c:d(c)}function n(c,b){for(var x in c)f.call(c,x)&&b(c[x],x,c)}function o(c){return c==null?d(c):p.call(c).slice(8,-1)}function u(c,b){var x=c!=null?typeof c[b]:"number";return!/^(?:boolean|number|string|undefined)$/.test(x)&&(x=="object"?!!c[b]:!0)}function w(c){return String(c).replace(/([ -])(?!$)/g,"$1?")}function v(c,b){var x=null;return y(c,function(_,j){x=b(x,_,j,c)}),x}function i(c){return String(c).replace(/^ +| +$/g,"")}function D(c){var b=S,x=c&&typeof c=="object"&&o(c)!="String";x&&(b=c,c=null);var _=b.navigator||{},j=_.userAgent||"";c||(c=j);var F=x||a==R,L=x?!!_.likeChrome:/\bChrome\b/.test(c)&&!/internal|\n/i.test(p.toString()),X="Object",z=x?X:"ScriptBridgingProxyObject",H=x?X:"Environment",G=x&&b.java?"JavaPackage":o(b.java),U=x?X:"RuntimeObject",B=/\bJava/.test(G)&&b.java,W=B&&o(b.environment)==H,te=B?"a":"\u03B1",de=B?"b":"\u03B2",fe=b.document||{},be=b.operamini||b.opera,Ce=s.test(Ce=x&&be?be["[[Class]]"]:o(be))?Ce:be=null,ue,ge=c,pe=[],oe=null,ae=c==j,re=ae&&be&&typeof be.version=="function"&&be.version(),he,Q=V([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),ie=Ee(["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"]),we=_e([{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"]),ne=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}}),J=xe(["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 V(Ue){return v(Ue,function(ze,Ge){return ze||RegExp("\\b"+(Ge.pattern||w(Ge))+"\\b","i").exec(c)&&(Ge.label||Ge)})}function Z(Ue){return v(Ue,function(ze,Ge,Ye){return ze||(Ge[we]||Ge[/^[a-z]+(?: +[a-z]+\b)*/i.exec(we)]||RegExp("\\b"+w(Ye)+"(?:\\b|\\w*\\d)","i").exec(c))&&Ye})}function Ee(Ue){return v(Ue,function(ze,Ge){return ze||RegExp("\\b"+(Ge.pattern||w(Ge))+"\\b","i").exec(c)&&(Ge.label||Ge)})}function xe(Ue){return v(Ue,function(ze,Ge){var Ye=Ge.pattern||w(Ge);return!ze&&(ze=RegExp("\\b"+Ye+"(?:/[\\d.]+|[ \\w.]*)","i").exec(c))&&(ze=E(ze,Ye,Ge.label||Ge)),ze})}function _e(Ue){return v(Ue,function(ze,Ge){var Ye=Ge.pattern||w(Ge);return!ze&&(ze=RegExp("\\b"+Ye+" *\\d+[.\\w_]*","i").exec(c)||RegExp("\\b"+Ye+" *\\w+-[\\w]*","i").exec(c)||RegExp("\\b"+Ye+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(c))&&((ze=String(Ge.label&&!RegExp(Ye,"i").test(Ge.label)?Ge.label:ze).split("/"))[1]&&!/[\d.]+/.test(ze[0])&&(ze[0]+=" "+ze[1]),Ge=Ge.label||Ge,ze=l(ze[0].replace(RegExp(Ye,"i"),Ge).replace(RegExp("; *(?:"+Ge+"[_-])?","i")," ").replace(RegExp("("+Ge+")[-_.]?(\\w)","i"),"$1 $2"))),ze})}function je(Ue){return v(Ue,function(ze,Ge){return ze||(RegExp(Ge+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(c)||0)[1]||null})}function Be(){return this.description||""}if(Q&&(Q=[Q]),ne&&!we&&(we=_e([ne])),(ue=/\bGoogle TV\b/.exec(we))&&(we=ue[0]),/\bSimulator\b/i.test(c)&&(we=(we?we+" ":"")+"Simulator"),ie=="Opera Mini"&&/\bOPiOS\b/.test(c)&&pe.push("running in Turbo/Uncompressed mode"),ie=="IE"&&/\blike iPhone OS\b/.test(c)?(ue=D(c.replace(/like iPhone OS/,"")),ne=ue.manufacturer,we=ue.product):/^iP/.test(we)?(ie||(ie="Safari"),J="iOS"+((ue=/ OS ([\d_]+)/i.exec(c))?" "+ue[1].replace(/_/g,"."):"")):ie=="Konqueror"&&!/buntu/i.test(J)?J="Kubuntu":ne&&ne!="Google"&&(/Chrome/.test(ie)&&!/\bMobile Safari\b/i.test(c)||/\bVita\b/.test(we))||/\bAndroid\b/.test(J)&&/^Chrome/.test(ie)&&/\bVersion\//i.test(c)?(ie="Android Browser",J=/\bAndroid\b/.test(J)?J:"Android"):ie=="Silk"?(/\bMobi/i.test(c)||(J="Android",pe.unshift("desktop mode")),/Accelerated *= *true/i.test(c)&&pe.unshift("accelerated")):ie=="PaleMoon"&&(ue=/\bFirefox\/([\d.]+)\b/.exec(c))?pe.push("identifying as Firefox "+ue[1]):ie=="Firefox"&&(ue=/\b(Mobile|Tablet|TV)\b/i.exec(c))?(J||(J="Firefox OS"),we||(we=ue[1])):!ie||(ue=!/\bMinefield\b/i.test(c)&&/\b(?:Firefox|Safari)\b/.exec(ie))?(ie&&!we&&/[\/,]|^[^(]+?\)/.test(c.slice(c.indexOf(ue+"/")+8))&&(ie=null),(ue=we||ne||J)&&(we||ne||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(J))&&(ie=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(J)?J:ue)+" Browser")):ie=="Electron"&&(ue=(/\bChrome\/([\d.]+)\b/.exec(c)||0)[1])&&pe.push("Chromium "+ue),re||(re=je(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",w(ie),"(?:Firefox|Minefield|NetFront)"])),(ue=Q=="iCab"&&parseFloat(re)>3&&"WebKit"||/\bOpera\b/.test(ie)&&(/\bOPR\b/.test(c)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(c)&&!/^(?:Trident|EdgeHTML)$/.test(Q)&&"WebKit"||!Q&&/\bMSIE\b/i.test(c)&&(J=="Mac OS"?"Tasman":"Trident")||Q=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ie)&&"NetFront")&&(Q=[ue]),ie=="IE"&&(ue=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(c)||0)[1])?(ie+=" Mobile",J="Windows Phone "+(/\+$/.test(ue)?ue:ue+".x"),pe.unshift("desktop mode")):/\bWPDesktop\b/i.test(c)?(ie="IE Mobile",J="Windows Phone 8.x",pe.unshift("desktop mode"),re||(re=(/\brv:([\d.]+)/.exec(c)||0)[1])):ie!="IE"&&Q=="Trident"&&(ue=/\brv:([\d.]+)/.exec(c))&&(ie&&pe.push("identifying as "+ie+(re?" "+re:"")),ie="IE",re=ue[1]),ae){if(u(b,"global"))if(B&&(ue=B.lang.System,ge=ue.getProperty("os.arch"),J=J||ue.getProperty("os.name")+" "+ue.getProperty("os.version")),W){try{re=b.require("ringo/engine").version.join("."),ie="RingoJS"}catch(Ue){(ue=b.system)&&ue.global.system==b.system&&(ie="Narwhal",J||(J=ue[0].os||null))}ie||(ie="Rhino")}else typeof b.process=="object"&&!b.process.browser&&(ue=b.process)&&(typeof ue.versions=="object"&&(typeof ue.versions.electron=="string"?(pe.push("Node "+ue.versions.node),ie="Electron",re=ue.versions.electron):typeof ue.versions.nw=="string"&&(pe.push("Chromium "+re,"Node "+ue.versions.node),ie="NW.js",re=ue.versions.nw)),ie||(ie="Node.js",ge=ue.arch,J=ue.platform,re=/[\d.]+/.exec(ue.version),re=re?re[0]:null));else o(ue=b.runtime)==z?(ie="Adobe AIR",J=ue.flash.system.Capabilities.os):o(ue=b.phantom)==U?(ie="PhantomJS",re=(ue=ue.version||null)&&ue.major+"."+ue.minor+"."+ue.patch):typeof fe.documentMode=="number"&&(ue=/\bTrident\/(\d+)/i.exec(c))?(re=[re,fe.documentMode],(ue=+ue[1]+4)!=re[1]&&(pe.push("IE "+re[1]+" mode"),Q&&(Q[1]=""),re[1]=ue),re=ie=="IE"?String(re[1].toFixed(1)):re[0]):typeof fe.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ie)&&(pe.push("masking as "+ie+" "+re),ie="IE",re="11.0",Q=["Trident"],J="Windows");J=J&&l(J)}if(re&&(ue=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(re)||/(?:alpha|beta)(?: ?\d)?/i.exec(c+";"+(ae&&_.appMinorVersion))||/\bMinefield\b/i.test(c)&&"a")&&(oe=/b/i.test(ue)?"beta":"alpha",re=re.replace(RegExp(ue+"\\+?$"),"")+(oe=="beta"?de:te)+(/\d+\+?/.exec(ue)||"")),ie=="Fennec"||ie=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(J))ie="Firefox Mobile";else if(ie=="Maxthon"&&re)re=re.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(we))we=="Xbox 360"&&(J=null),we=="Xbox 360"&&/\bIEMobile\b/.test(c)&&pe.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(ie)||ie&&!we&&!/Browser|Mobi/.test(ie))&&(J=="Windows CE"||/Mobi/i.test(c)))ie+=" Mobile";else if(ie=="IE"&&ae)try{b.external===null&&pe.unshift("platform preview")}catch(Ue){pe.unshift("embedded")}else(/\bBlackBerry\b/.test(we)||/\bBB10\b/.test(c))&&(ue=(RegExp(we.replace(/ +/g," *")+"/([.\\d]+)","i").exec(c)||0)[1]||re)?(ue=[ue,/BB10/.test(c)],J=(ue[1]?(we=null,ne="BlackBerry"):"Device Software")+" "+ue[0],re=null):this!=n&&we!="Wii"&&(ae&&be||/Opera/.test(ie)&&/\b(?:MSIE|Firefox)\b/i.test(c)||ie=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(J)||ie=="IE"&&(J&&!/^Win/.test(J)&&re>5.5||/\bWindows XP\b/.test(J)&&re>8||re==8&&!/\bTrident\b/.test(c)))&&!s.test(ue=D.call(n,c.replace(s,"")+";"))&&ue.name&&(ue="ing as "+ue.name+((ue=ue.version)?" "+ue:""),s.test(ie)?(/\bIE\b/.test(ue)&&J=="Mac OS"&&(J=null),ue="identify"+ue):(ue="mask"+ue,Ce?ie=l(Ce.replace(/([a-z])([A-Z])/g,"$1 $2")):ie="Opera",/\bIE\b/.test(ue)&&(J=null),ae||(re=null)),Q=["Presto"],pe.push(ue));(ue=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(c)||0)[1])&&(ue=[parseFloat(ue.replace(/\.(\d)$/,".0$1")),ue],ie=="Safari"&&ue[1].slice(-1)=="+"?(ie="WebKit Nightly",oe="alpha",re=ue[1].slice(0,-1)):(re==ue[1]||re==(ue[2]=(/\bSafari\/([\d.]+\+?)/i.exec(c)||0)[1]))&&(re=null),ue[1]=(/\bChrome\/([\d.]+)/i.exec(c)||0)[1],ue[0]==537.36&&ue[2]==537.36&&parseFloat(ue[1])>=28&&Q=="WebKit"&&(Q=["Blink"]),!ae||!L&&!ue[1]?(Q&&(Q[1]="like Safari"),ue=(ue=ue[0],ue<400?1:ue<500?2:ue<526?3:ue<533?4:ue<534?"4+":ue<535?5:ue<537?6:ue<538?7:ue<601?8:"8")):(Q&&(Q[1]="like Chrome"),ue=ue[1]||(ue=ue[0],ue<530?1:ue<532?2:ue<532.05?3:ue<533?4:ue<534.03?5:ue<534.07?6:ue<534.1?7:ue<534.13?8:ue<534.16?9:ue<534.24?10:ue<534.3?11:ue<535.01?12:ue<535.02?"13+":ue<535.07?15:ue<535.11?16:ue<535.19?17:ue<536.05?18:ue<536.1?19:ue<537.01?20:ue<537.11?"21+":ue<537.13?23:ue<537.18?24:ue<537.24?25:ue<537.36?26:Q!="Blink"?"27":"28")),Q&&(Q[1]+=" "+(ue+=typeof ue=="number"?".x":/[.+]/.test(ue)?"":"+")),ie=="Safari"&&(!re||parseInt(re)>45)&&(re=ue)),ie=="Opera"&&(ue=/\bzbov|zvav$/.exec(J))?(ie+=" ",pe.unshift("desktop mode"),ue=="zvav"?(ie+="Mini",re=null):ie+="Mobile",J=J.replace(RegExp(" *"+ue+"$"),"")):ie=="Safari"&&/\bChrome\b/.exec(Q&&Q[1])&&(pe.unshift("desktop mode"),ie="Chrome Mobile",re=null,/\bOS X\b/.test(J)?(ne="Apple",J="iOS 4.3+"):J=null),re&&re.indexOf(ue=/[\d.]+$/.exec(J))==0&&c.indexOf("/"+ue+"-")>-1&&(J=i(J.replace(ue,""))),Q&&!/\b(?:Avant|Nook)\b/.test(ie)&&(/Browser|Lunascape|Maxthon/.test(ie)||ie!="Safari"&&/^iOS/.test(J)&&/\bSafari\b/.test(Q[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(ie)&&Q[1])&&((ue=Q[Q.length-1])&&pe.push(ue)),pe.length&&(pe=["("+pe.join("; ")+")"]),ne&&we&&we.indexOf(ne)<0&&pe.push("on "+ne),we&&pe.push((/^on /.test(pe[pe.length-1])?"":"on ")+we),J&&(ue=/ ([\d.+]+)$/.exec(J),he=ue&&J.charAt(J.length-ue[0].length-1)=="/",J={architecture:32,family:ue&&!he?J.replace(ue[0],""):J,version:ue?ue[1]:null,toString:function(){var Ue=this.version;return this.family+(Ue&&!he?" "+Ue:"")+(this.architecture==64?" 64-bit":"")}}),(ue=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(ge))&&!/\bi686\b/i.test(ge)?(J&&(J.architecture=64,J.family=J.family.replace(RegExp(" *"+ue),"")),ie&&(/\bWOW64\b/i.test(c)||ae&&/\w(?:86|32)$/.test(_.cpuClass||_.platform)&&!/\bWin64; x64\b/i.test(c))&&pe.unshift("32-bit")):J&&/^OS X/.test(J.family)&&ie=="Chrome"&&parseFloat(re)>=39&&(J.architecture=64),c||(c=null);var He={};return He.description=c,He.layout=Q&&Q[0],He.manufacturer=ne,He.name=ie,He.prerelease=oe,He.product=we,He.ua=c,He.version=ie&&re,He.os=J||{architecture:null,family:null,version:null,toString:function(){return"null"}},He.parse=D,He.toString=Be,He.version&&pe.unshift(re),He.name&&pe.unshift(ie),J&&ie&&!(J==String(J).split(" ")[0]&&(J==ie.split(" ")[0]||we))&&pe.push(we?"("+J+")":"on "+J),pe.length&&(He.description=pe.join(" ")),He}var k=D();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(S.platform=k,define(function(){return k})):T&&g?n(k,function(c,b){T[b]=c}):S.platform=k}).call(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],207:[function(I,q,N){(function(P){"use strict";typeof P=="undefined"||!P.version||P.version.indexOf("v0.")===0||P.version.indexOf("v1.")===0&&P.version.indexOf("v1.8.")!==0?q.exports={nextTick:m}:q.exports=P;function m(S,R,T,g){if(typeof S!="function")throw new TypeError('"callback" argument must be a function');var C=arguments.length,h,s;switch(C){case 0:case 1:return P.nextTick(S);case 2:return P.nextTick(function(){S.call(null,R)});case 3:return P.nextTick(function(){S.call(null,R,T)});case 4:return P.nextTick(function(){S.call(null,R,T,g)});default:for(h=new Array(C-1),s=0;s1)for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},u=h-s,w=Math.floor,v=String.fromCharCode,i;function D(G){throw new RangeError(o[G])}function k(G,U){for(var B=G.length,W=[];B--;)W[B]=U(G[B]);return W}function c(G,U){var B=G.split("@"),W="";B.length>1&&(W=B[0]+"@",G=B[1]),G=G.replace(n,".");var te=G.split("."),de=k(te,U).join(".");return W+de}function b(G){for(var U=[],B=0,W=G.length,te,de;B=55296&&te<=56319&&B65535&&(U-=65536,B+=v(U>>>10&1023|55296),U=56320|U&1023),B+=v(U),B}).join("")}function _(G){return G-48<10?G-22:G-65<26?G-65:G-97<26?G-97:h}function j(G,U){return G+22+75*(G<26)-((U!=0)<<5)}function F(G,U,B){var W=0;for(G=B?w(G/f):G>>1,G+=w(G/U);G>u*a>>1;W+=h)G=w(G/u);return w(W+(u+1)*G/(G+r))}function L(G){var U=[],B=G.length,W,te=0,de=d,fe=p,be,Ce,ue,ge,pe,oe,ae,re,he;for(be=G.lastIndexOf(E),be<0&&(be=0),Ce=0;Ce=128&&D("not-basic"),U.push(G.charCodeAt(Ce));for(ue=be>0?be+1:0;ue=B&&D("invalid-input"),ae=_(G.charCodeAt(ue++)),(ae>=h||ae>w((C-te)/pe))&&D("overflow"),te+=ae*pe,re=oe<=fe?s:oe>=fe+a?a:oe-fe,aew(C/he)&&D("overflow"),pe*=he;W=U.length+1,fe=F(te-ge,W,ge==0),w(te/W)>C-de&&D("overflow"),de+=w(te/W),te%=W,U.splice(te++,0,de)}return x(U)}function X(G){var U,B,W,te,de,fe,be,Ce,ue,ge,pe,oe=[],ae,re,he,Q;for(G=b(G),ae=G.length,U=d,B=0,de=p,fe=0;fe=U&&pew((C-B)/re)&&D("overflow"),B+=(be-U)*re,U=be,fe=0;feC&&D("overflow"),pe==U){for(Ce=B,ue=h;!(ge=ue<=de?s:ue>=de+a?a:ue-de,Ce0&&a>s&&(a=s);for(var r=0;r=0?(d=f.substr(0,p),E=f.substr(p+1)):(d=f,E=""),y=decodeURIComponent(d),l=decodeURIComponent(E),P(C,y)?m(C[y])?C[y].push(l):C[y]=[C[y],l]:C[y]=l}return C};var m=Array.isArray||function(S){return Object.prototype.toString.call(S)==="[object Array]"}},{}],211:[function(I,q,N){"use strict";var P=function(T){switch(typeof T){case"string":return T;case"boolean":return T?"true":"false";case"number":return isFinite(T)?T:"";default:return""}};q.exports=function(T,g,C,h){return g=g||"&",C=C||"=",T===null&&(T=void 0),typeof T=="object"?S(R(T),function(s){var a=encodeURIComponent(P(s))+C;return m(T[s])?S(T[s],function(r){return a+encodeURIComponent(P(r))}).join(g):a+encodeURIComponent(P(T[s]))}).join(g):h?encodeURIComponent(P(h))+C+encodeURIComponent(P(T)):""};var m=Array.isArray||function(T){return Object.prototype.toString.call(T)==="[object Array]"};function S(T,g){if(T.map)return T.map(g);for(var C=[],h=0;h0?(typeof ie!="string"&&!V.objectMode&&(0,R.default)(ie)!==d.prototype&&(ie=y(ie)),ne?V.endEmitted?Q.emit("error",new Error("stream.unshift() after end event")):_(Q,V,ie,!0):V.ended?Q.emit("error",new Error("stream.push() after EOF")):(V.reading=!1,V.decoder&&!we?(ie=V.decoder.write(ie),V.objectMode||ie.length!==0?_(Q,V,ie,!1):B(Q,V)):_(Q,V,ie,!1))):ne||(V.reading=!1)}return F(V)}function _(Q,ie,we,ne){ie.flowing&&ie.length===0&&!ie.sync?(Q.emit("data",we),Q.read(0)):(ie.length+=ie.objectMode?1:we.length,ne?ie.buffer.unshift(we):ie.buffer.push(we),ie.needReadable&&G(Q)),B(Q,ie)}function j(Q,ie){var we;return!l(ie)&&typeof ie!="string"&&ie!==void 0&&!Q.objectMode&&(we=new TypeError("Invalid non-string/buffer chunk")),we}function F(Q){return!Q.ended&&(Q.needReadable||Q.length=L?Q=L:(Q--,Q|=Q>>>1,Q|=Q>>>2,Q|=Q>>>4,Q|=Q>>>8,Q|=Q>>>16,Q++),Q}function z(Q,ie){return Q<=0||ie.length===0&&ie.ended?0:ie.objectMode?1:Q!==Q?ie.flowing&&ie.length?ie.buffer.head.data.length:ie.length:(Q>ie.highWaterMark&&(ie.highWaterMark=X(Q)),Q<=ie.length?Q:ie.ended?ie.length:(ie.needReadable=!0,0))}b.prototype.read=function(Q){u("read",Q),Q=parseInt(Q,10);var ie=this._readableState,we=Q;if(Q!==0&&(ie.emittedReadable=!1),Q===0&&ie.needReadable&&(ie.length>=ie.highWaterMark||ie.ended))return u("read: emitReadable",ie.length,ie.ended),ie.length===0&&ie.ended?ae(this):G(this),null;if(Q=z(Q,ie),Q===0&&ie.ended)return ie.length===0&&ae(this),null;var ne=ie.needReadable;u("need readable",ne),(ie.length===0||ie.length-Q0?J=ue(Q,ie):J=null,J===null?(ie.needReadable=!0,Q=0):ie.length-=Q,ie.length===0&&(ie.ended||(ie.needReadable=!0),we!==Q&&ie.ended&&ae(this)),J!==null&&this.emit("data",J),J};function H(Q,ie){if(ie.ended)return;if(ie.decoder){var we=ie.decoder.end();we&&we.length&&(ie.buffer.push(we),ie.length+=ie.objectMode?1:we.length)}ie.ended=!0,G(Q)}function G(Q){var ie=Q._readableState;ie.needReadable=!1,ie.emittedReadable||(u("emitReadable",ie.flowing),ie.emittedReadable=!0,ie.sync?h.nextTick(U,Q):U(Q))}function U(Q){u("emit readable"),Q.emit("readable"),Ce(Q)}function B(Q,ie){ie.readingMore||(ie.readingMore=!0,h.nextTick(W,Q,ie))}function W(Q,ie){for(var we=ie.length;!ie.reading&&!ie.flowing&&!ie.ended&&ie.length1&&he(ne.pipes,Q)!==-1)&&!_e&&(u("false write response, pause",we._readableState.awaitDrain),we._readableState.awaitDrain++,Be=!0),we.pause())}function Ue(Re){u("onerror",Re),Ye(),Q.removeListener("error",Ue),f(Q,"error")===0&&Q.emit("error",Re)}k(Q,"error",Ue);function ze(){Q.removeListener("finish",Ge),Ye()}Q.once("close",ze);function Ge(){u("onfinish"),Q.removeListener("close",ze),Ye()}Q.once("finish",Ge);function Ye(){u("unpipe"),we.unpipe(Q)}return Q.emit("pipe",we),ne.flowing||(u("pipe resume"),we.resume()),Q};function te(Q){return function(){var ie=Q._readableState;u("pipeOnDrain",ie.awaitDrain),ie.awaitDrain&&ie.awaitDrain--,ie.awaitDrain===0&&f(Q,"data")&&(ie.flowing=!0,Ce(Q))}}b.prototype.unpipe=function(Q){var ie=this._readableState,we={hasUnpiped:!1};if(ie.pipesCount===0)return this;if(ie.pipesCount===1)return Q&&Q!==ie.pipes?this:(Q||(Q=ie.pipes),ie.pipes=null,ie.pipesCount=0,ie.flowing=!1,Q&&Q.emit("unpipe",this,we),this);if(!Q){var ne=ie.pipes,J=ie.pipesCount;ie.pipes=null,ie.pipesCount=0,ie.flowing=!1;for(var V=0;V=ie.length?(ie.decoder?we=ie.buffer.join(""):ie.buffer.length===1?we=ie.buffer.head.data:we=ie.buffer.concat(ie.length),ie.buffer.clear()):we=ge(Q,ie.buffer,ie.decoder),we}function ge(Q,ie,we){var ne;return QV.length?V.length:Q;if(Z===V.length?J+=V:J+=V.slice(0,Q),Q-=Z,Q===0){Z===V.length?(++ne,we.next?ie.head=we.next:ie.head=ie.tail=null):(ie.head=we,we.data=V.slice(Z));break}++ne}return ie.length-=ne,J}function oe(Q,ie){var we=d.allocUnsafe(Q),ne=ie.head,J=1;for(ne.data.copy(we),Q-=ne.data.length;ne=ne.next;){var V=ne.data,Z=Q>V.length?V.length:Q;if(V.copy(we,we.length-Q,0,Z),Q-=Z,Q===0){Z===V.length?(++J,ne.next?ie.head=ne.next:ie.head=ie.tail=null):(ie.head=ne,ne.data=V.slice(Z));break}++J}return ie.length-=J,we}function ae(Q){var ie=Q._readableState;if(ie.length>0)throw new Error('"endReadable()" called on non-empty stream');ie.endEmitted||(ie.ended=!0,h.nextTick(re,ie,Q))}function re(Q,ie){!Q.endEmitted&&Q.length===0&&(Q.endEmitted=!0,ie.readable=!1,ie.emit("end"))}function he(Q,ie){for(var we=0,ne=Q.length;we-1?f.default:d.nextTick,n;j.WritableState=x;var o=(0,a.default)(I("core-util-is"));o.inherits=I("inherits");var u={deprecate:I("util-deprecate")},w=I("./internal/streams/stream"),v=I("safe-buffer").Buffer,i=m.Uint8Array||function(){};function D(oe){return v.from(oe)}function k(oe){return v.isBuffer(oe)||oe instanceof i}var c=I("./internal/streams/destroy");o.inherits(j,w);function b(){}function x(oe,ae){n=n||I("./_stream_duplex"),oe=oe||{};var re=ae instanceof n;this.objectMode=!!oe.objectMode,re&&(this.objectMode=this.objectMode||!!oe.writableObjectMode);var he=oe.highWaterMark,Q=oe.writableHighWaterMark,ie=this.objectMode?16:16*1024;he||he===0?this.highWaterMark=he:re&&(Q||Q===0)?this.highWaterMark=Q:this.highWaterMark=ie,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 we=oe.decodeStrings===!1;this.decodeStrings=!we,this.defaultEncoding=oe.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ne){B(ae,ne)},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 y(this)}x.prototype.getBuffer=function(){for(var ae=this.bufferedRequest,re=[];ae;)re.push(ae),ae=ae.next;return re},function(){try{Object.defineProperty(x.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(oe){}}();var _;typeof h.default=="function"&&g.default&&typeof Function.prototype[g.default]=="function"?(_=Function.prototype[g.default],(0,R.default)(j,g.default,{value:function(ae){return _.call(this,ae)?!0:this!==j?!1:ae&&ae._writableState instanceof x}})):_=function(ae){return ae instanceof this};function j(oe){if(n=n||I("./_stream_duplex"),!_.call(j,this)&&!(this instanceof n))return new j(oe);this._writableState=new x(oe,this),this.writable=!0,oe&&(typeof oe.write=="function"&&(this._write=oe.write),typeof oe.writev=="function"&&(this._writev=oe.writev),typeof oe.destroy=="function"&&(this._destroy=oe.destroy),typeof oe.final=="function"&&(this._final=oe.final)),w.call(this)}j.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function F(oe,ae){var re=new Error("write after end");oe.emit("error",re),d.nextTick(ae,re)}function L(oe,ae,re,he){var Q=!0,ie=!1;return re===null?ie=new TypeError("May not write null values to stream"):typeof re!="string"&&re!==void 0&&!ae.objectMode&&(ie=new TypeError("Invalid non-string/buffer chunk")),ie&&(oe.emit("error",ie),d.nextTick(he,ie),Q=!1),Q}j.prototype.write=function(oe,ae,re){var he=this._writableState,Q=!1,ie=!he.objectMode&&k(oe);return ie&&!v.isBuffer(oe)&&(oe=D(oe)),typeof ae=="function"&&(re=ae,ae=null),ie?ae="buffer":ae||(ae=he.defaultEncoding),typeof re!="function"&&(re=b),he.ended?F(this,re):(ie||L(this,he,oe,re))&&(he.pendingcb++,Q=z(this,he,ie,oe,ae,re)),Q},j.prototype.cork=function(){var oe=this._writableState;oe.corked++},j.prototype.uncork=function(){var oe=this._writableState;oe.corked&&(oe.corked--,!oe.writing&&!oe.corked&&!oe.finished&&!oe.bufferProcessing&&oe.bufferedRequest&&de(this,oe))},j.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=ae.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ae+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+ae);return this._writableState.defaultEncoding=ae,this};function X(oe,ae,re){return!oe.objectMode&&oe.decodeStrings!==!1&&typeof ae=="string"&&(ae=v.from(ae,re)),ae}Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function z(oe,ae,re,he,Q,ie){if(!re){var we=X(ae,he,Q);he!==we&&(re=!0,Q="buffer",he=we)}var ne=ae.objectMode?1:he.length;ae.length+=ne;var J=ae.length0?this.tail.next=h:this.head=h,this.tail=h,++this.length},T.prototype.unshift=function(C){var h={data:C,next:this.head};this.length===0&&(this.tail=h),this.head=h,++this.length},T.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},T.prototype.clear=function(){this.head=this.tail=null,this.length=0},T.prototype.join=function(C){if(this.length===0)return"";for(var h=this.head,s=""+h.data;h=h.next;)s+=C+h.data;return s},T.prototype.concat=function(C){if(this.length===0)return m.alloc(0);if(this.length===1)return this.head.data;for(var h=m.allocUnsafe(C>>>0),s=this.head,a=0;s;)R(s.data,h,a),a+=s.data.length,s=s.next;return h},T}(),S&&S.inspect&&S.inspect.custom&&(q.exports.prototype[S.inspect.custom]=function(){var T=S.inspect({length:this.length});return this.constructor.name+" "+T})},{"safe-buffer":228,util:71}],220:[function(I,q,N){"use strict";var P=I("process-nextick-args");function m(T,g){var C=this,h=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return h||s?(g?g(T):T&&(!this._writableState||!this._writableState.errorEmitted)&&P.nextTick(R,this,T),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(T||null,function(a){!g&&a?(P.nextTick(R,C,a),C._writableState&&(C._writableState.errorEmitted=!0)):g&&g(a)}),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(T,g){T.emit("error",g)}q.exports={destroy:m,undestroy:S}},{"process-nextick-args":207}],221:[function(I,q,N){"use strict";q.exports=I("events").EventEmitter},{events:192}],222:[function(I,q,N){q.exports=I("./readable").PassThrough},{"./readable":223}],223:[function(I,q,N){N=q.exports=I("./lib/_stream_readable.js"),N.Stream=N,N.Readable=N,N.Writable=I("./lib/_stream_writable.js"),N.Duplex=I("./lib/_stream_duplex.js"),N.Transform=I("./lib/_stream_transform.js"),N.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,q,N){q.exports=I("./readable").Transform},{"./readable":223}],225:[function(I,q,N){q.exports=I("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":218}],226:[function(I,q,N){var P=function(){return this}()||Function("return this")(),m=P.regeneratorRuntime&&Object.getOwnPropertyNames(P).indexOf("regeneratorRuntime")>=0,S=m&&P.regeneratorRuntime;if(P.regeneratorRuntime=void 0,q.exports=I("./runtime"),m)P.regeneratorRuntime=S;else try{delete P.regeneratorRuntime}catch(R){P.regeneratorRuntime=void 0}},{"./runtime":227}],227:[function(I,q,N){!function(P){"use strict";var m=Object.prototype,S=m.hasOwnProperty,R,T=typeof Symbol=="function"?Symbol:{},g=T.iterator||"@@iterator",C=T.asyncIterator||"@@asyncIterator",h=T.toStringTag||"@@toStringTag",s=typeof q=="object",a=P.regeneratorRuntime;if(a){s&&(q.exports=a);return}a=P.regeneratorRuntime=s?q.exports:{};function r(z,H,G,U){var B=H&&H.prototype instanceof n?H:n,W=Object.create(B.prototype),te=new F(U||[]);return W._invoke=b(z,G,te),W}a.wrap=r;function f(z,H,G){try{return{type:"normal",arg:z.call(H,G)}}catch(U){return{type:"throw",arg:U}}}var p="suspendedStart",d="suspendedYield",E="executing",y="completed",l={};function n(){}function o(){}function u(){}var w={};w[g]=function(){return this};var v=Object.getPrototypeOf,i=v&&v(v(L([])));i&&i!==m&&S.call(i,g)&&(w=i);var D=u.prototype=n.prototype=Object.create(w);o.prototype=D.constructor=u,u.constructor=o,u[h]=o.displayName="GeneratorFunction";function k(z){["next","throw","return"].forEach(function(H){z[H]=function(G){return this._invoke(H,G)}})}a.isGeneratorFunction=function(z){var H=typeof z=="function"&&z.constructor;return H?H===o||(H.displayName||H.name)==="GeneratorFunction":!1},a.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,u):(z.__proto__=u,h in z||(z[h]="GeneratorFunction")),z.prototype=Object.create(D),z},a.awrap=function(z){return{__await:z}};function c(z){function H(B,W,te,de){var fe=f(z[B],z,W);if(fe.type==="throw")de(fe.arg);else{var be=fe.arg,Ce=be.value;return Ce&&typeof Ce=="object"&&S.call(Ce,"__await")?Promise.resolve(Ce.__await).then(function(ue){H("next",ue,te,de)},function(ue){H("throw",ue,te,de)}):Promise.resolve(Ce).then(function(ue){be.value=ue,te(be)},de)}}var G;function U(B,W){function te(){return new Promise(function(de,fe){H(B,W,de,fe)})}return G=G?G.then(te,te):te()}this._invoke=U}k(c.prototype),c.prototype[C]=function(){return this},a.AsyncIterator=c,a.async=function(z,H,G,U){var B=new c(r(z,H,G,U));return a.isGeneratorFunction(H)?B:B.next().then(function(W){return W.done?W.value:B.next()})};function b(z,H,G){var U=p;return function(W,te){if(U===E)throw new Error("Generator is already running");if(U===y){if(W==="throw")throw te;return X()}for(G.method=W,G.arg=te;;){var de=G.delegate;if(de){var fe=x(de,G);if(fe){if(fe===l)continue;return fe}}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(U===p)throw U=y,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);U=E;var be=f(z,H,G);if(be.type==="normal"){if(U=G.done?y:d,be.arg===l)continue;return{value:be.arg,done:G.done}}else be.type==="throw"&&(U=y,G.method="throw",G.arg=be.arg)}}}function x(z,H){var G=z.iterator[H.method];if(G===R){if(H.delegate=null,H.method==="throw"){if(z.iterator.return&&(H.method="return",H.arg=R,x(z,H),H.method==="throw"))return l;H.method="throw",H.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var U=f(G,z.iterator,H.arg);if(U.type==="throw")return H.method="throw",H.arg=U.arg,H.delegate=null,l;var B=U.arg;if(!B)return H.method="throw",H.arg=new TypeError("iterator result is not an object"),H.delegate=null,l;if(B.done)H[z.resultName]=B.value,H.next=z.nextLoc,H.method!=="return"&&(H.method="next",H.arg=R);else return B;return H.delegate=null,l}k(D),D[h]="Generator",D[g]=function(){return this},D.toString=function(){return"[object Generator]"};function _(z){var H={tryLoc:z[0]};1 in z&&(H.catchLoc=z[1]),2 in z&&(H.finallyLoc=z[2],H.afterLoc=z[3]),this.tryEntries.push(H)}function j(z){var H=z.completion||{};H.type="normal",delete H.arg,z.completion=H}function F(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(_,this),this.reset(!0)}a.keys=function(z){var H=[];for(var G in z)H.push(G);return H.reverse(),function U(){for(;H.length;){var B=H.pop();if(B in z)return U.value=B,U.done=!1,U}return U.done=!0,U}};function L(z){if(z){var H=z[g];if(H)return H.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var G=-1,U=function B(){for(;++G=0;--U){var B=this.tryEntries[U],W=B.completion;if(B.tryLoc==="root")return G("end");if(B.tryLoc<=this.prev){var te=S.call(B,"catchLoc"),de=S.call(B,"finallyLoc");if(te&&de){if(this.prev=0;--G){var U=this.tryEntries[G];if(U.tryLoc<=this.prev&&S.call(U,"finallyLoc")&&this.prev=0;--H){var G=this.tryEntries[H];if(G.finallyLoc===z)return this.complete(G.completion,G.afterLoc),j(G),l}},catch:function(z){for(var H=this.tryEntries.length-1;H>=0;--H){var G=this.tryEntries[H];if(G.tryLoc===z){var U=G.completion;if(U.type==="throw"){var B=U.arg;j(G)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(z,H,G){return this.delegate={iterator:L(z),resultName:H,nextLoc:G},this.method==="next"&&(this.arg=R),l}}}(function(){return this}()||Function("return this")())},{}],228:[function(I,q,N){var P=I("buffer"),m=P.Buffer;function S(T,g){for(var C in T)g[C]=T[C]}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?q.exports=P:(S(P,N),N.Buffer=R);function R(T,g,C){return m(T,g,C)}S(m,R),R.from=function(T,g,C){if(typeof T=="number")throw new TypeError("Argument must not be a number");return m(T,g,C)},R.alloc=function(T,g,C){if(typeof T!="number")throw new TypeError("Argument must be a number");var h=m(T);return g!==void 0?typeof C=="string"?h.fill(g,C):h.fill(g):h.fill(0),h},R.allocUnsafe=function(T){if(typeof T!="number")throw new TypeError("Argument must be a number");return m(T)},R.allocUnsafeSlow=function(T){if(typeof T!="number")throw new TypeError("Argument must be a number");return P.SlowBuffer(T)}},{buffer:73}],229:[function(I,q,N){(function(P){"use strict";var m=I("babel-runtime/core-js/string/from-code-point"),S=d(m),R=I("babel-runtime/core-js/json/stringify"),T=d(R),g=I("babel-runtime/helpers/typeof"),C=d(g),h=I("babel-runtime/core-js/object/define-property"),s=d(h),a=I("babel-runtime/core-js/object/keys"),r=d(a),f=I("babel-runtime/core-js/object/create"),p=d(f);function d(E){return E&&E.__esModule?E:{default:E}}(function(E){E.parser=function(V,Z){return new l(V,Z)},E.SAXParser=l,E.SAXStream=D,E.createStream=i,E.MAX_BUFFER_LENGTH=64*1024;var y=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];E.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function l(V,Z){if(!(this instanceof l))return new l(V,Z);var Ee=this;o(Ee),Ee.q=Ee.c="",Ee.bufferCheckPosition=E.MAX_BUFFER_LENGTH,Ee.opt=Z||{},Ee.opt.lowercase=Ee.opt.lowercase||Ee.opt.lowercasetags,Ee.looseCase=Ee.opt.lowercase?"toLowerCase":"toUpperCase",Ee.tags=[],Ee.closed=Ee.closedRoot=Ee.sawRoot=!1,Ee.tag=Ee.error=null,Ee.strict=!!V,Ee.noscript=!!(V||Ee.opt.noscript),Ee.state=W.BEGIN,Ee.strictEntities=Ee.opt.strictEntities,Ee.ENTITIES=Ee.strictEntities?(0,p.default)(E.XML_ENTITIES):(0,p.default)(E.ENTITIES),Ee.attribList=[],Ee.opt.xmlns&&(Ee.ns=(0,p.default)(_)),Ee.trackPosition=Ee.opt.position!==!1,Ee.trackPosition&&(Ee.position=Ee.line=Ee.column=0),de(Ee,"onready")}p.default||(Object.create=function(V){function Z(){}Z.prototype=V;var Ee=new Z;return Ee}),r.default||(Object.keys=function(V){var Z=[];for(var Ee in V)V.hasOwnProperty(Ee)&&Z.push(Ee);return Z});function n(V){for(var Z=Math.max(E.MAX_BUFFER_LENGTH,10),Ee=0,xe=0,_e=y.length;xe<_e;xe++){var je=V[y[xe]].length;if(je>Z)switch(y[xe]){case"textNode":be(V);break;case"cdata":fe(V,"oncdata",V.cdata),V.cdata="";break;case"script":fe(V,"onscript",V.script),V.script="";break;default:ue(V,"Max buffer length exceeded: "+y[xe])}Ee=Math.max(Ee,je)}var Be=E.MAX_BUFFER_LENGTH-Ee;V.bufferCheckPosition=Be+V.position}function o(V){for(var Z=0,Ee=y.length;Z"||z(V)}function U(V,Z){return V.test(Z)}function B(V,Z){return!U(V,Z)}var W=0;E.STATE={BEGIN:W++,BEGIN_WHITESPACE:W++,TEXT:W++,TEXT_ENTITY:W++,OPEN_WAKA:W++,SGML_DECL:W++,SGML_DECL_QUOTED:W++,DOCTYPE:W++,DOCTYPE_QUOTED:W++,DOCTYPE_DTD:W++,DOCTYPE_DTD_QUOTED:W++,COMMENT_STARTING:W++,COMMENT:W++,COMMENT_ENDING:W++,COMMENT_ENDED:W++,CDATA:W++,CDATA_ENDING:W++,CDATA_ENDING_2:W++,PROC_INST:W++,PROC_INST_BODY:W++,PROC_INST_ENDING:W++,OPEN_TAG:W++,OPEN_TAG_SLASH:W++,ATTRIB:W++,ATTRIB_NAME:W++,ATTRIB_NAME_SAW_WHITE:W++,ATTRIB_VALUE:W++,ATTRIB_VALUE_QUOTED:W++,ATTRIB_VALUE_CLOSED:W++,ATTRIB_VALUE_UNQUOTED:W++,ATTRIB_VALUE_ENTITY_Q:W++,ATTRIB_VALUE_ENTITY_U:W++,CLOSE_TAG:W++,CLOSE_TAG_SAW_WHITE:W++,SCRIPT:W++,SCRIPT_ENDING:W++},E.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},E.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)(E.ENTITIES).forEach(function(V){var Z=E.ENTITIES[V],Ee=typeof Z=="number"?String.fromCharCode(Z):Z;E.ENTITIES[V]=Ee});for(var te in E.STATE)E.STATE[E.STATE[te]]=te;W=E.STATE;function de(V,Z,Ee){V[Z]&&V[Z](Ee)}function fe(V,Z,Ee){V.textNode&&be(V),de(V,Z,Ee)}function be(V){V.textNode=Ce(V.opt,V.textNode),V.textNode&&de(V,"ontext",V.textNode),V.textNode=""}function Ce(V,Z){return V.trim&&(Z=Z.trim()),V.normalize&&(Z=Z.replace(/\s+/g," ")),Z}function ue(V,Z){return be(V),V.trackPosition&&(Z+=` Line: `+V.line+` Column: `+V.column+` Char: `+V.c),Z=new Error(Z),V.error=Z,de(V,"onerror",Z),V}function ge(V){return V.sawRoot&&!V.closedRoot&&pe(V,"Unclosed root tag"),V.state!==W.BEGIN&&V.state!==W.BEGIN_WHITESPACE&&V.state!==W.TEXT&&ue(V,"Unexpected end"),be(V),V.c="",V.closed=!0,de(V,"onend"),l.call(V,V.strict,V.opt),V}function pe(V,Z){if((typeof V=="undefined"?"undefined":(0,C.default)(V))!=="object"||!(V instanceof l))throw new Error("bad call to strictFail");V.strict&&ue(V,Z)}function oe(V){V.strict||(V.tagName=V.tagName[V.looseCase]());var Z=V.tags[V.tags.length-1]||V,Ee=V.tag={name:V.tagName,attributes:{}};V.opt.xmlns&&(Ee.ns=Z.ns),V.attribList.length=0,fe(V,"onopentagstart",Ee)}function ae(V,Z){var Ee=V.indexOf(":"),xe=Ee<0?["",V]:V.split(":"),_e=xe[0],je=xe[1];return Z&&V==="xmlns"&&(_e="xmlns",je=""),{prefix:_e,local:je}}function re(V){if(V.strict||(V.attribName=V.attribName[V.looseCase]()),V.attribList.indexOf(V.attribName)!==-1||V.tag.attributes.hasOwnProperty(V.attribName)){V.attribName=V.attribValue="";return}if(V.opt.xmlns){var Z=ae(V.attribName,!0),Ee=Z.prefix,xe=Z.local;if(Ee==="xmlns")if(xe==="xml"&&V.attribValue!==b)pe(V,"xml: prefix must be bound to "+b+` Actual: `+V.attribValue);else if(xe==="xmlns"&&V.attribValue!==x)pe(V,"xmlns: prefix must be bound to "+x+` Actual: `+V.attribValue);else{var _e=V.tag,je=V.tags[V.tags.length-1]||V;_e.ns===je.ns&&(_e.ns=(0,p.default)(je.ns)),_e.ns[xe]=V.attribValue}V.attribList.push([V.attribName,V.attribValue])}else V.tag.attributes[V.attribName]=V.attribValue,fe(V,"onattribute",{name:V.attribName,value:V.attribValue});V.attribName=V.attribValue=""}function he(V,Z){if(V.opt.xmlns){var Ee=V.tag,xe=ae(V.tagName);Ee.prefix=xe.prefix,Ee.local=xe.local,Ee.uri=Ee.ns[xe.prefix]||"",Ee.prefix&&!Ee.uri&&(pe(V,"Unbound namespace prefix: "+(0,T.default)(V.tagName)),Ee.uri=xe.prefix);var _e=V.tags[V.tags.length-1]||V;Ee.ns&&_e.ns!==Ee.ns&&(0,r.default)(Ee.ns).forEach(function(We){fe(V,"onopennamespace",{prefix:We,uri:Ee.ns[We]})});for(var je=0,Be=V.attribList.length;je",V.tagName="",V.state=W.SCRIPT;return}fe(V,"onscript",V.script),V.script=""}var Z=V.tags.length,Ee=V.tagName;V.strict||(Ee=Ee[V.looseCase]());for(var xe=Ee;Z--;){var _e=V.tags[Z];if(_e.name!==xe)pe(V,"Unexpected close tag");else break}if(Z<0){pe(V,"Unmatched closing tag: "+V.tagName),V.textNode+="",V.state=W.TEXT;return}V.tagName=Ee;for(var je=V.tags.length;je-- >Z;){var Be=V.tag=V.tags.pop();V.tagName=V.tag.name,fe(V,"onclosetag",V.tagName);var He={};for(var Ue in Be.ns)He[Ue]=Be.ns[Ue];var ze=V.tags[V.tags.length-1]||V;V.opt.xmlns&&Be.ns!==ze.ns&&(0,r.default)(Be.ns).forEach(function(Ge){var Ye=Be.ns[Ge];fe(V,"onclosenamespace",{prefix:Ge,uri:Ye})})}Z===0&&(V.closedRoot=!0),V.tagName=V.attribValue=V.attribName="",V.attribList.length=0,V.state=W.TEXT}function ie(V){var Z=V.entity,Ee=Z.toLowerCase(),xe,_e="";return V.ENTITIES[Z]?V.ENTITIES[Z]:V.ENTITIES[Ee]?V.ENTITIES[Ee]:(Z=Ee,Z.charAt(0)==="#"&&(Z.charAt(1)==="x"?(Z=Z.slice(2),xe=parseInt(Z,16),_e=xe.toString(16)):(Z=Z.slice(1),xe=parseInt(Z,10),_e=xe.toString(10))),Z=Z.replace(/^0+/,""),isNaN(xe)||_e.toLowerCase()!==Z?(pe(V,"Invalid character entity"),"&"+V.entity+";"):(0,S.default)(xe))}function we(V,Z){Z==="<"?(V.state=W.OPEN_WAKA,V.startTagPosition=V.position):z(Z)||(pe(V,"Non-whitespace before first tag."),V.textNode=Z,V.state=W.TEXT)}function ne(V,Z){var Ee="";return Z"?(fe(Z,"onsgmldeclaration",Z.sgmlDecl),Z.sgmlDecl="",Z.state=W.TEXT):(H(xe)&&(Z.state=W.SGML_DECL_QUOTED),Z.sgmlDecl+=xe);continue;case W.SGML_DECL_QUOTED:xe===Z.q&&(Z.state=W.SGML_DECL,Z.q=""),Z.sgmlDecl+=xe;continue;case W.DOCTYPE:xe===">"?(Z.state=W.TEXT,fe(Z,"ondoctype",Z.doctype),Z.doctype=!0):(Z.doctype+=xe,xe==="["?Z.state=W.DOCTYPE_DTD:H(xe)&&(Z.state=W.DOCTYPE_QUOTED,Z.q=xe));continue;case W.DOCTYPE_QUOTED:Z.doctype+=xe,xe===Z.q&&(Z.q="",Z.state=W.DOCTYPE);continue;case W.DOCTYPE_DTD:Z.doctype+=xe,xe==="]"?Z.state=W.DOCTYPE:H(xe)&&(Z.state=W.DOCTYPE_DTD_QUOTED,Z.q=xe);continue;case W.DOCTYPE_DTD_QUOTED:Z.doctype+=xe,xe===Z.q&&(Z.state=W.DOCTYPE_DTD,Z.q="");continue;case W.COMMENT:xe==="-"?Z.state=W.COMMENT_ENDING:Z.comment+=xe;continue;case W.COMMENT_ENDING:xe==="-"?(Z.state=W.COMMENT_ENDED,Z.comment=Ce(Z.opt,Z.comment),Z.comment&&fe(Z,"oncomment",Z.comment),Z.comment=""):(Z.comment+="-"+xe,Z.state=W.COMMENT);continue;case W.COMMENT_ENDED:xe!==">"?(pe(Z,"Malformed comment"),Z.comment+="--"+xe,Z.state=W.COMMENT):Z.state=W.TEXT;continue;case W.CDATA:xe==="]"?Z.state=W.CDATA_ENDING:Z.cdata+=xe;continue;case W.CDATA_ENDING:xe==="]"?Z.state=W.CDATA_ENDING_2:(Z.cdata+="]"+xe,Z.state=W.CDATA);continue;case W.CDATA_ENDING_2:xe===">"?(Z.cdata&&fe(Z,"oncdata",Z.cdata),fe(Z,"onclosecdata"),Z.cdata="",Z.state=W.TEXT):xe==="]"?Z.cdata+="]":(Z.cdata+="]]"+xe,Z.state=W.CDATA);continue;case W.PROC_INST:xe==="?"?Z.state=W.PROC_INST_ENDING:z(xe)?Z.state=W.PROC_INST_BODY:Z.procInstName+=xe;continue;case W.PROC_INST_BODY:if(!Z.procInstBody&&z(xe))continue;xe==="?"?Z.state=W.PROC_INST_ENDING:Z.procInstBody+=xe;continue;case W.PROC_INST_ENDING:xe===">"?(fe(Z,"onprocessinginstruction",{name:Z.procInstName,body:Z.procInstBody}),Z.procInstName=Z.procInstBody="",Z.state=W.TEXT):(Z.procInstBody+="?"+xe,Z.state=W.PROC_INST_BODY);continue;case W.OPEN_TAG:U(F,xe)?Z.tagName+=xe:(oe(Z),xe===">"?he(Z):xe==="/"?Z.state=W.OPEN_TAG_SLASH:(z(xe)||pe(Z,"Invalid character in tag name"),Z.state=W.ATTRIB));continue;case W.OPEN_TAG_SLASH:xe===">"?(he(Z,!0),Q(Z)):(pe(Z,"Forward-slash in opening tag not followed by >"),Z.state=W.ATTRIB);continue;case W.ATTRIB:if(z(xe))continue;xe===">"?he(Z):xe==="/"?Z.state=W.OPEN_TAG_SLASH:U(j,xe)?(Z.attribName=xe,Z.attribValue="",Z.state=W.ATTRIB_NAME):pe(Z,"Invalid attribute name");continue;case W.ATTRIB_NAME:xe==="="?Z.state=W.ATTRIB_VALUE:xe===">"?(pe(Z,"Attribute without value"),Z.attribValue=Z.attribName,re(Z),he(Z)):z(xe)?Z.state=W.ATTRIB_NAME_SAW_WHITE:U(F,xe)?Z.attribName+=xe:pe(Z,"Invalid attribute name");continue;case W.ATTRIB_NAME_SAW_WHITE:if(xe==="=")Z.state=W.ATTRIB_VALUE;else{if(z(xe))continue;pe(Z,"Attribute without value"),Z.tag.attributes[Z.attribName]="",Z.attribValue="",fe(Z,"onattribute",{name:Z.attribName,value:""}),Z.attribName="",xe===">"?he(Z):U(j,xe)?(Z.attribName=xe,Z.state=W.ATTRIB_NAME):(pe(Z,"Invalid attribute name"),Z.state=W.ATTRIB)}continue;case W.ATTRIB_VALUE:if(z(xe))continue;H(xe)?(Z.q=xe,Z.state=W.ATTRIB_VALUE_QUOTED):(pe(Z,"Unquoted attribute value"),Z.state=W.ATTRIB_VALUE_UNQUOTED,Z.attribValue=xe);continue;case W.ATTRIB_VALUE_QUOTED:if(xe!==Z.q){xe==="&"?Z.state=W.ATTRIB_VALUE_ENTITY_Q:Z.attribValue+=xe;continue}re(Z),Z.q="",Z.state=W.ATTRIB_VALUE_CLOSED;continue;case W.ATTRIB_VALUE_CLOSED:z(xe)?Z.state=W.ATTRIB:xe===">"?he(Z):xe==="/"?Z.state=W.OPEN_TAG_SLASH:U(j,xe)?(pe(Z,"No whitespace between attributes"),Z.attribName=xe,Z.attribValue="",Z.state=W.ATTRIB_NAME):pe(Z,"Invalid attribute name");continue;case W.ATTRIB_VALUE_UNQUOTED:if(!G(xe)){xe==="&"?Z.state=W.ATTRIB_VALUE_ENTITY_U:Z.attribValue+=xe;continue}re(Z),xe===">"?he(Z):Z.state=W.ATTRIB;continue;case W.CLOSE_TAG:if(Z.tagName)xe===">"?Q(Z):U(F,xe)?Z.tagName+=xe:Z.script?(Z.script+=""?Q(Z):pe(Z,"Invalid characters in closing tag");continue;case W.TEXT_ENTITY:case W.ATTRIB_VALUE_ENTITY_Q:case W.ATTRIB_VALUE_ENTITY_U:var Be,He;switch(Z.state){case W.TEXT_ENTITY:Be=W.TEXT,He="textNode";break;case W.ATTRIB_VALUE_ENTITY_Q:Be=W.ATTRIB_VALUE_QUOTED,He="attribValue";break;case W.ATTRIB_VALUE_ENTITY_U:Be=W.ATTRIB_VALUE_UNQUOTED,He="attribValue";break}xe===";"?(Z[He]+=ie(Z),Z.entity="",Z.state=Be):U(Z.entity.length?X:L,xe)?Z.entity+=xe:(pe(Z,"Invalid character in entity name"),Z[He]+="&"+Z.entity+xe,Z.entity="",Z.state=Be);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 V=String.fromCharCode,Z=Math.floor,Ee=function(){var _e=16384,je=[],Be,He,Ue=-1,ze=arguments.length;if(!ze)return"";for(var Ge="";++Ue1114111||Z(Ye)!==Ye)throw RangeError("Invalid code point: "+Ye);Ye<=65535?je.push(Ye):(Ye-=65536,Be=(Ye>>10)+55296,He=Ye%1024+56320,je.push(Be,He)),(Ue+1===ze||je.length>_e)&&(Ge+=V.apply(null,je),je.length=0)}return Ge};s.default?Object.defineProperty(String,"fromCodePoint",{value:Ee,configurable:!0,writable:!0}):String.fromCodePoint=Ee}()})(typeof N=="undefined"?(void 0).sax={}:N)}).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,q,N){q.exports=S;var P=I("events").EventEmitter,m=I("inherits");m(S,P),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(){P.call(this)}S.prototype.pipe=function(R,T){var g=this;function C(d){R.writable&&(R.write(d)===!1&&g.pause&&g.pause())}g.on("data",C);function h(){g.readable&&g.resume&&g.resume()}R.on("drain",h),!R._isStdio&&(!T||T.end!==!1)&&(g.on("end",a),g.on("close",r));var s=!1;function a(){if(s)return;s=!0,R.end()}function r(){if(s)return;s=!0,typeof R.destroy=="function"&&R.destroy()}function f(d){if(p(),P.listenerCount(this,"error")===0)throw d}g.on("error",f),R.on("error",f);function p(){g.removeListener("data",C),R.removeListener("drain",h),g.removeListener("end",a),g.removeListener("close",r),g.removeListener("error",f),R.removeListener("error",f),g.removeListener("end",p),g.removeListener("close",p),R.removeListener("close",p)}return g.on("end",p),g.on("close",p),R.on("close",p),R.emit("pipe",g),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,q,N){(function(P){var m=I("./lib/request"),S=I("./lib/response"),R=I("xtend"),T=I("builtin-status-codes"),g=I("url"),C=N;C.request=function(h,s){typeof h=="string"?h=g.parse(h):h=R(h);var a=P.location.protocol.search(/^https?:$/)===-1?"http:":"",r=h.protocol||a,f=h.hostname||h.host,p=h.port,d=h.path||"/";f&&f.indexOf(":")!==-1&&(f="["+f+"]"),h.url=(f?r+"//"+f:"")+(p?":"+p:"")+d,h.method=(h.method||"GET").toUpperCase(),h.headers=h.headers||{};var E=new m(h);return s&&E.on("response",s),E},C.get=function(s,a){var r=C.request(s,a);return r.end(),r},C.ClientRequest=m,C.IncomingMessage=S.IncomingMessage,C.Agent=function(){},C.Agent.defaultMaxSockets=4,C.globalAgent=new C.Agent,C.STATUS_CODES=T,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,q,N){(function(P){"use strict";N.fetch=C(P.fetch)&&C(P.ReadableStream),N.writableStream=C(P.WritableStream),N.abortController=C(P.AbortController),N.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),N.blobConstructor=!0}catch(h){}var m;function S(){if(m!==void 0)return m;if(P.XMLHttpRequest){m=new P.XMLHttpRequest;try{m.open("GET",P.XDomainRequest?"/":"https://example.com")}catch(h){m=null}}else m=null;return m}function R(h){var s=S();if(!s)return!1;try{return s.responseType=h,s.responseType===h}catch(a){}return!1}var T=typeof P.ArrayBuffer!="undefined",g=T&&C(P.ArrayBuffer.prototype.slice);N.arraybuffer=N.fetch||T&&R("arraybuffer"),N.msstream=!N.fetch&&g&&R("ms-stream"),N.mozchunkedarraybuffer=!N.fetch&&T&&R("moz-chunked-arraybuffer"),N.overrideMimeType=N.fetch||(S()?C(S().overrideMimeType):!1),N.vbArray=C(P.VBArray);function C(h){return typeof h=="function"}m=null}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],233:[function(I,q,N){(function(P,m,S){"use strict";var R=I("babel-runtime/core-js/object/keys"),T=g(R);function g(n){return n&&n.__esModule?n:{default:n}}var C=I("./capability"),h=I("inherits"),s=I("./response"),a=I("readable-stream"),r=I("to-arraybuffer"),f=s.IncomingMessage,p=s.readyStates;function d(n,o){return C.fetch&&o?"fetch":C.mozchunkedarraybuffer?"moz-chunked-arraybuffer":C.msstream?"ms-stream":C.arraybuffer&&n?"arraybuffer":C.vbArray&&n?"text:vbarray":"text"}var E=q.exports=function(n){var o=this;a.Writable.call(o),o._opts=n,o._body=[],o._headers={},n.auth&&o.setHeader("Authorization","Basic "+new S(n.auth).toString("base64")),(0,T.default)(n.headers).forEach(function(v){o.setHeader(v,n.headers[v])});var u,w=!0;if(n.mode==="disable-fetch"||"requestTimeout"in n&&!C.abortController)w=!1,u=!0;else if(n.mode==="prefer-streaming")u=!1;else if(n.mode==="allow-wrong-content-type")u=!C.overrideMimeType;else if(!n.mode||n.mode==="default"||n.mode==="prefer-fast")u=!0;else throw new Error("Invalid value for opts.mode");o._mode=d(u,w),o._fetchTimer=null,o.on("finish",function(){o._onFinish()})};h(E,a.Writable),E.prototype.setHeader=function(n,o){var u=this,w=n.toLowerCase();if(l.indexOf(w)!==-1)return;u._headers[w]={name:n,value:o}},E.prototype.getHeader=function(n){var o=this._headers[n.toLowerCase()];return o?o.value:null},E.prototype.removeHeader=function(n){var o=this;delete o._headers[n.toLowerCase()]},E.prototype._onFinish=function(){var n=this;if(n._destroyed)return;var o=n._opts,u=n._headers,w=null;o.method!=="GET"&&o.method!=="HEAD"&&(C.arraybuffer?w=r(S.concat(n._body)):C.blobConstructor?w=new m.Blob(n._body.map(function(b){return r(b)}),{type:(u["content-type"]||{}).value||""}):w=S.concat(n._body).toString());var v=[];if((0,T.default)(u).forEach(function(b){var x=u[b].name,_=u[b].value;Array.isArray(_)?_.forEach(function(j){v.push([x,j])}):v.push([x,_])}),n._mode==="fetch"){var i=null,D=null;if(C.abortController){var k=new AbortController;i=k.signal,n._fetchAbortController=k,"requestTimeout"in o&&o.requestTimeout!==0&&(n._fetchTimer=m.setTimeout(function(){n.emit("requestTimeout"),n._fetchAbortController&&n._fetchAbortController.abort()},o.requestTimeout))}m.fetch(n._opts.url,{method:n._opts.method,headers:v,body:w||void 0,mode:"cors",credentials:o.withCredentials?"include":"same-origin",signal:i}).then(function(b){n._fetchResponse=b,n._connect()},function(b){m.clearTimeout(n._fetchTimer),n._destroyed||n.emit("error",b)})}else{var c=n._xhr=new m.XMLHttpRequest;try{c.open(n._opts.method,n._opts.url,!0)}catch(b){P.nextTick(function(){n.emit("error",b)});return}"responseType"in c&&(c.responseType=n._mode.split(":")[0]),"withCredentials"in c&&(c.withCredentials=!!o.withCredentials),n._mode==="text"&&"overrideMimeType"in c&&c.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in o&&(c.timeout=o.requestTimeout,c.ontimeout=function(){n.emit("requestTimeout")}),v.forEach(function(b){c.setRequestHeader(b[0],b[1])}),n._response=null,c.onreadystatechange=function(){switch(c.readyState){case p.LOADING:case p.DONE:n._onXHRProgress();break}},n._mode==="moz-chunked-arraybuffer"&&(c.onprogress=function(){n._onXHRProgress()}),c.onerror=function(){if(n._destroyed)return;n.emit("error",new Error("XHR error"))};try{c.send(w)}catch(b){P.nextTick(function(){n.emit("error",b)});return}}};function y(n){try{var o=n.status;return o!==null&&o!==0}catch(u){return!1}}E.prototype._onXHRProgress=function(){var n=this;if(!y(n._xhr)||n._destroyed)return;n._response||n._connect(),n._response._onXHRProgress()},E.prototype._connect=function(){var n=this;if(n._destroyed)return;n._response=new f(n._xhr,n._fetchResponse,n._mode,n._fetchTimer),n._response.on("error",function(o){n.emit("error",o)}),n.emit("response",n._response)},E.prototype._write=function(n,o,u){var w=this;w._body.push(n),u()},E.prototype.abort=E.prototype.destroy=function(){var n=this;n._destroyed=!0,m.clearTimeout(n._fetchTimer),n._response&&(n._response._destroyed=!0),n._xhr?n._xhr.abort():n._fetchAbortController&&n._fetchAbortController.abort()},E.prototype.end=function(n,o,u){var w=this;typeof n=="function"&&(u=n,n=void 0),a.Writable.prototype.end.call(w,n,o,u)},E.prototype.flushHeaders=function(){},E.prototype.setTimeout=function(){},E.prototype.setNoDelay=function(){},E.prototype.setSocketKeepAlive=function(){};var l=["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,q,N){(function(P,m,S){"use strict";var R=I("babel-runtime/core-js/promise"),T=g(R);function g(f){return f&&f.__esModule?f:{default:f}}var C=I("./capability"),h=I("inherits"),s=I("readable-stream"),a=N.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},r=N.IncomingMessage=function(f,p,d,E){var y=this;if(s.Readable.call(y),y._mode=d,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){P.nextTick(function(){y.emit("close")})}),d==="fetch"){var l=function i(){o.read().then(function(D){if(y._destroyed)return;if(D.done){m.clearTimeout(E),y.push(null);return}y.push(new S(D.value)),i()}).catch(function(D){m.clearTimeout(E),y._destroyed||y.emit("error",D)})};if(y._fetchResponse=p,y.url=p.url,y.statusCode=p.status,y.statusMessage=p.statusText,p.headers.forEach(function(i,D){y.headers[D.toLowerCase()]=i,y.rawHeaders.push(D,i)}),C.writableStream){var n=new WritableStream({write:function(D){return new T.default(function(k,c){y._destroyed?c():y.push(new S(D))?k():y._resumeFetch=k})},close:function(){m.clearTimeout(E),y._destroyed||y.push(null)},abort:function(D){y._destroyed||y.emit("error",D)}});try{p.body.pipeTo(n).catch(function(i){m.clearTimeout(E),y._destroyed||y.emit("error",i)});return}catch(i){}}var o=p.body.getReader();l()}else{y._xhr=f,y._pos=0,y.url=f.responseURL,y.statusCode=f.status,y.statusMessage=f.statusText;var u=f.getAllResponseHeaders().split(/\r?\n/);if(u.forEach(function(i){var D=i.match(/^([^:]+):\s*(.*)/);if(D){var k=D[1].toLowerCase();k==="set-cookie"?(y.headers[k]===void 0&&(y.headers[k]=[]),y.headers[k].push(D[2])):y.headers[k]!==void 0?y.headers[k]+=", "+D[2]:y.headers[k]=D[2],y.rawHeaders.push(D[1],D[2])}}),y._charset="x-user-defined",!C.overrideMimeType){var w=y.rawHeaders["mime-type"];if(w){var v=w.match(/;\s*charset=([^;])(;|$)/);v&&(y._charset=v[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};h(r,s.Readable),r.prototype._read=function(){var f=this,p=f._resumeFetch;p&&(f._resumeFetch=null,p())},r.prototype._onXHRProgress=function(){var f=this,p=f._xhr,d=null;switch(f._mode){case"text:vbarray":if(p.readyState!==a.DONE)break;try{d=new m.VBArray(p.responseBody).toArray()}catch(o){}if(d!==null){f.push(new S(d));break}case"text":try{d=p.responseText}catch(o){f._mode="text:vbarray";break}if(d.length>f._pos){var E=d.substr(f._pos);if(f._charset==="x-user-defined"){for(var y=new S(E.length),l=0;lf._pos&&(f.push(new S(new Uint8Array(n.result.slice(f._pos)))),f._pos=n.result.byteLength)},n.onload=function(){f.push(null)},n.readAsArrayBuffer(d);break}f._xhr.readyState===a.DONE&&f._mode!=="ms-stream"&&f.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,q,N){"use strict";var P=I("safe-buffer").Buffer,m=P.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 o;;)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(o)return;n=(""+n).toLowerCase(),o=!0}}function R(n){var o=S(n);if(typeof o!="string"&&(P.isEncoding===m||!m(n)))throw new Error("Unknown encoding: "+n);return o||n}N.StringDecoder=T;function T(n){this.encoding=R(n);var o;switch(this.encoding){case"utf16le":this.text=f,this.end=p,o=4;break;case"utf8":this.fillLast=s,o=4;break;case"base64":this.text=d,this.end=E,o=3;break;default:this.write=y,this.end=l;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=P.allocUnsafe(o)}T.prototype.write=function(n){if(n.length===0)return"";var o,u;if(this.lastNeed){if(o=this.fillLast(n),o===void 0)return"";u=this.lastNeed,this.lastNeed=0}else u=0;return u>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function C(n,o,u){var w=o.length-1;if(w=0?(v>0&&(n.lastNeed=v-1),v):--w=0?(v>0&&(n.lastNeed=v-2),v):--w=0?(v>0&&(v===2?v=0:n.lastNeed=v-3),v):0))}function h(n,o,u){if((o[0]&192)!==128)return n.lastNeed=0,"\uFFFD";if(n.lastNeed>1&&o.length>1){if((o[1]&192)!==128)return n.lastNeed=1,"\uFFFD";if(n.lastNeed>2&&o.length>2&&(o[2]&192)!==128)return n.lastNeed=2,"\uFFFD"}}function s(n){var o=this.lastTotal-this.lastNeed,u=h(this,n,o);if(u!==void 0)return u;if(this.lastNeed<=n.length)return n.copy(this.lastChar,o,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,o,0,n.length),this.lastNeed-=n.length}function a(n,o){var u=C(this,n,o);if(!this.lastNeed)return n.toString("utf8",o);this.lastTotal=u;var w=n.length-(u-this.lastNeed);return n.copy(this.lastChar,0,w),n.toString("utf8",o,w)}function r(n){var o=n&&n.length?this.write(n):"";return this.lastNeed?o+"\uFFFD":o}function f(n,o){if((n.length-o)%2===0){var u=n.toString("utf16le",o);if(u){var w=u.charCodeAt(u.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],u.slice(0,-1)}return u}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",o,n.length-1)}function p(n){var o=n&&n.length?this.write(n):"";if(this.lastNeed){var u=this.lastTotal-this.lastNeed;return o+this.lastChar.toString("utf16le",0,u)}return o}function d(n,o){var u=(n.length-o)%3;return u===0?n.toString("base64",o):(this.lastNeed=3-u,this.lastTotal=3,u===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",o,n.length-u))}function E(n){var o=n&&n.length?this.write(n):"";return this.lastNeed?o+this.lastChar.toString("base64",0,3-this.lastNeed):o}function y(n){return n.toString(this.encoding)}function l(n){return n&&n.length?this.write(n):""}},{"safe-buffer":228}],236:[function(I,q,N){(function(P,m){var S=I("process/browser.js").nextTick,R=Function.prototype.apply,T=Array.prototype.slice,g={},C=0;N.setTimeout=function(){return new h(R.call(setTimeout,window,arguments),clearTimeout)},N.setInterval=function(){return new h(R.call(setInterval,window,arguments),clearInterval)},N.clearTimeout=N.clearInterval=function(s){s.close()};function h(s,a){this._id=s,this._clearFn=a}h.prototype.unref=h.prototype.ref=function(){},h.prototype.close=function(){this._clearFn.call(window,this._id)},N.enroll=function(s,a){clearTimeout(s._idleTimeoutId),s._idleTimeout=a},N.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},N._unrefActive=N.active=function(s){clearTimeout(s._idleTimeoutId);var a=s._idleTimeout;a>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},a))},N.setImmediate=typeof P=="function"?P:function(s){var a=C++,r=arguments.length<2?!1:T.call(arguments,1);return g[a]=!0,S(function(){g[a]&&(r?s.apply(null,r):s.call(null),N.clearImmediate(a))}),a},N.clearImmediate=typeof m=="function"?m:function(s){delete g[s]}}).call(this,I("timers").setImmediate,I("timers").clearImmediate)},{"process/browser.js":208,timers:236}],237:[function(I,q,N){var P=I("buffer").Buffer;q.exports=function(m){if(m instanceof Uint8Array){if(m.byteOffset===0&&m.byteLength===m.buffer.byteLength)return m.buffer;if(typeof m.buffer.slice=="function")return m.buffer.slice(m.byteOffset,m.byteOffset+m.byteLength)}if(P.isBuffer(m)){for(var S=new Uint8Array(m.length),R=m.length,T=0;T",'"',"`"," ","\r",` `," "],h=["{","}","|","\\","^","`"].concat(C),s=["'"].concat(h),a=["%","/","?",";","#"].concat(s),r=["/","?","#"],f=255,p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},l={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},n=I("querystring");function o(i,D,k){if(i&&m.isObject(i)&&i instanceof S)return i;var c=new S;return c.parse(i,D,k),c}S.prototype.parse=function(i,D,k){if(!m.isString(i))throw new TypeError("Parameter 'url' must be a string, not "+typeof i);var c=i.indexOf("?"),b=c!==-1&&c127?Ce+="x":Ce+=be[ue];if(!Ce.match(p)){var pe=de.slice(0,G),oe=de.slice(G+1),ae=be.match(d);ae&&(pe.push(ae[1]),oe.unshift(ae[2])),oe.length&&(j="/"+oe.join(".")+j),this.hostname=pe.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),te||(this.hostname=P.toASCII(this.hostname));var re=this.port?":"+this.port:"",he=this.hostname||"";this.host=he+re,this.href+=this.host,te&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),j[0]!=="/"&&(j="/"+j))}if(!E[X])for(var G=0,fe=s.length;G0?k.host.split("@"):!1;Ce&&(k.auth=Ce.shift(),k.host=k.hostname=Ce.shift())}return k.search=i.search,k.query=i.query,(!m.isNull(k.pathname)||!m.isNull(k.search))&&(k.path=(k.pathname?k.pathname:"")+(k.search?k.search:"")),k.href=k.format(),k}if(!de.length)return k.pathname=null,k.search?k.path="/"+k.search:k.path=null,k.href=k.format(),k;for(var ue=de.slice(-1)[0],ge=(k.host||i.host||de.length>1)&&(ue==="."||ue==="..")||ue==="",pe=0,oe=de.length;oe>=0;oe--)ue=de[oe],ue==="."?de.splice(oe,1):ue===".."?(de.splice(oe,1),pe++):pe&&(de.splice(oe,1),pe--);if(!W&&!te)for(;pe--;pe)de.unshift("..");W&&de[0]!==""&&(!de[0]||de[0].charAt(0)!=="/")&&de.unshift(""),ge&&de.join("/").substr(-1)!=="/"&&de.push("");var ae=de[0]===""||de[0]&&de[0].charAt(0)==="/";if(be){k.hostname=k.host=ae?"":de.length?de.shift():"";var Ce=k.host&&k.host.indexOf("@")>0?k.host.split("@"):!1;Ce&&(k.auth=Ce.shift(),k.host=k.hostname=Ce.shift())}return W=W||k.host&&de.length,W&&!ae&&de.unshift(""),de.length?k.pathname=de.join("/"):(k.pathname=null,k.path=null),(!m.isNull(k.pathname)||!m.isNull(k.search))&&(k.path=(k.pathname?k.pathname:"")+(k.search?k.search:"")),k.auth=i.auth||k.auth,k.slashes=k.slashes||i.slashes,k.href=k.format(),k},S.prototype.parseHost=function(){var i=this.host,D=T.exec(i);D&&(D=D[0],D!==":"&&(this.port=D.substr(1)),i=i.substr(0,i.length-D.length)),i&&(this.hostname=i)}},{"./util":239,punycode:209,querystring:212}],239:[function(I,q,N){"use strict";q.exports={isString:function(P){return typeof P=="string"},isObject:function(P){return typeof P=="object"&&P!==null},isNull:function(P){return P===null},isNullOrUndefined:function(P){return P==null}}},{}],240:[function(I,q,N){(function(P){q.exports=m;function m(R,T){if(S("noDeprecation"))return R;var g=!1;function C(){if(!g){if(S("throwDeprecation"))throw new Error(T);S("traceDeprecation")?console.trace(T):console.warn(T),g=!0}return R.apply(this,arguments)}return C}function S(R){try{if(!P.localStorage)return!1}catch(g){return!1}var T=P.localStorage[R];return T==null?!1:String(T).toLowerCase()==="true"}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],241:[function(I,q,N){typeof Object.create=="function"?q.exports=function(m,S){m.super_=S,m.prototype=Object.create(S.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}})}:q.exports=function(m,S){m.super_=S;var R=function(){};R.prototype=S.prototype,m.prototype=new R,m.prototype.constructor=m}},{}],242:[function(I,q,N){q.exports=function(m){return m&&typeof m=="object"&&typeof m.copy=="function"&&typeof m.fill=="function"&&typeof m.readUInt8=="function"}},{}],243:[function(I,q,N){(function(P,m){var S=/%[sdj%]/g;N.format=function(H){if(!w(H)){for(var G=[],U=0;U=W)return fe;switch(fe){case"%s":return String(B[U++]);case"%d":return Number(B[U++]);case"%j":try{return JSON.stringify(B[U++])}catch(be){return"[Circular]"}default:return fe}}),de=B[U];U=3&&(U.depth=arguments[2]),arguments.length>=4&&(U.colors=arguments[3]),l(G)?U.showHidden=G:G&&N._extend(U,G),i(U.showHidden)&&(U.showHidden=!1),i(U.depth)&&(U.depth=2),i(U.colors)&&(U.colors=!1),i(U.customInspect)&&(U.customInspect=!0),U.colors&&(U.stylize=C),a(U,H,U.depth)}N.inspect=g,g.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]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function C(H,G){var U=g.styles[G];return U?"["+g.colors[U][0]+"m"+H+"["+g.colors[U][1]+"m":H}function h(H,G){return H}function s(H){var G={};return H.forEach(function(U,B){G[U]=!0}),G}function a(H,G,U){if(H.customInspect&&G&&x(G.inspect)&&G.inspect!==N.inspect&&!(G.constructor&&G.constructor.prototype===G)){var B=G.inspect(U,H);return w(B)||(B=a(H,B,U)),B}var W=r(H,G);if(W)return W;var te=Object.keys(G),de=s(te);if(H.showHidden&&(te=Object.getOwnPropertyNames(G)),b(G)&&(te.indexOf("message")>=0||te.indexOf("description")>=0))return f(G);if(te.length===0){if(x(G)){var fe=G.name?": "+G.name:"";return H.stylize("[Function"+fe+"]","special")}if(D(G))return H.stylize(RegExp.prototype.toString.call(G),"regexp");if(c(G))return H.stylize(Date.prototype.toString.call(G),"date");if(b(G))return f(G)}var be="",Ce=!1,ue=["{","}"];if(y(G)&&(Ce=!0,ue=["[","]"]),x(G)){var ge=G.name?": "+G.name:"";be=" [Function"+ge+"]"}if(D(G)&&(be=" "+RegExp.prototype.toString.call(G)),c(G)&&(be=" "+Date.prototype.toUTCString.call(G)),b(G)&&(be=" "+f(G)),te.length===0&&(!Ce||G.length==0))return ue[0]+be+ue[1];if(U<0)return D(G)?H.stylize(RegExp.prototype.toString.call(G),"regexp"):H.stylize("[Object]","special");H.seen.push(G);var pe;return Ce?pe=p(H,G,U,de,te):pe=te.map(function(oe){return d(H,G,U,de,oe,Ce)}),H.seen.pop(),E(pe,be,ue)}function r(H,G){if(i(G))return H.stylize("undefined","undefined");if(w(G)){var U="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return H.stylize(U,"string")}if(u(G))return H.stylize(""+G,"number");if(l(G))return H.stylize(""+G,"boolean");if(n(G))return H.stylize("null","null")}function f(H){return"["+Error.prototype.toString.call(H)+"]"}function p(H,G,U,B,W){for(var te=[],de=0,fe=G.length;de-1&&(te?fe=fe.split(` `).map(function(Ce){return" "+Ce}).join(` `).substr(2):fe=` `+fe.split(` `).map(function(Ce){return" "+Ce}).join(` `))):fe=H.stylize("[Circular]","special")),i(de)){if(te&&W.match(/^\d+$/))return fe;de=JSON.stringify(""+W),de.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(de=de.substr(1,de.length-2),de=H.stylize(de,"name")):(de=de.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),de=H.stylize(de,"string"))}return de+": "+fe}function E(H,G,U){var B=0,W=H.reduce(function(te,de){return B++,de.indexOf(` `)>=0&&B++,te+de.replace(/\u001b\[\d\d?m/g,"").length+1},0);return W>60?U[0]+(G===""?"":G+` `)+" "+H.join(`, `)+" "+U[1]:U[0]+G+" "+H.join(", ")+" "+U[1]}function y(H){return Array.isArray(H)}N.isArray=y;function l(H){return typeof H=="boolean"}N.isBoolean=l;function n(H){return H===null}N.isNull=n;function o(H){return H==null}N.isNullOrUndefined=o;function u(H){return typeof H=="number"}N.isNumber=u;function w(H){return typeof H=="string"}N.isString=w;function v(H){return typeof H=="symbol"}N.isSymbol=v;function i(H){return H===void 0}N.isUndefined=i;function D(H){return k(H)&&j(H)==="[object RegExp]"}N.isRegExp=D;function k(H){return typeof H=="object"&&H!==null}N.isObject=k;function c(H){return k(H)&&j(H)==="[object Date]"}N.isDate=c;function b(H){return k(H)&&(j(H)==="[object Error]"||H instanceof Error)}N.isError=b;function x(H){return typeof H=="function"}N.isFunction=x;function _(H){return H===null||typeof H=="boolean"||typeof H=="number"||typeof H=="string"||typeof H=="symbol"||typeof H=="undefined"}N.isPrimitive=_,N.isBuffer=I("./support/isBuffer");function j(H){return Object.prototype.toString.call(H)}function F(H){return H<10?"0"+H.toString(10):H.toString(10)}var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function X(){var H=new Date,G=[F(H.getHours()),F(H.getMinutes()),F(H.getSeconds())].join(":");return[H.getDate(),L[H.getMonth()],G].join(" ")}N.log=function(){console.log("%s - %s",X(),N.format.apply(N,arguments))},N.inherits=I("inherits"),N._extend=function(H,G){if(!G||!k(G))return H;for(var U=Object.keys(G),B=U.length;B--;)H[U[B]]=G[U[B]];return H};function z(H,G){return Object.prototype.hasOwnProperty.call(H,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,q,N){"use strict";(function(){"use strict";N.stripBOM=function(P){return P[0]==="\uFEFF"?P.substring(1):P}}).call(void 0)},{}],245:[function(I,q,N){"use strict";var P=I("babel-runtime/helpers/typeof"),m=T(P),S=I("babel-runtime/core-js/object/keys"),R=T(S);function T(g){return g&&g.__esModule?g:{default:g}}(function(){"use strict";var g,C,h,s,a,r={}.hasOwnProperty;g=I("xmlbuilder"),C=I("./defaults").defaults,s=function(p){return typeof p=="string"&&(p.indexOf("&")>=0||p.indexOf(">")>=0||p.indexOf("<")>=0)},a=function(p){return""},h=function(p){return p.replace("]]>","]]]]>")},N.Builder=function(){function f(p){var d,E,y;this.options={},E=C["0.2"];for(d in E){if(!r.call(E,d))continue;y=E[d],this.options[d]=y}for(d in p){if(!r.call(p,d))continue;y=p[d],this.options[d]=y}}return f.prototype.buildObject=function(p){var d,E,y,l,n;return d=this.options.attrkey,E=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,y=function(o){return function(u,w){var v,i,D,k,c,b;if((typeof w=="undefined"?"undefined":(0,m.default)(w))!=="object")o.options.cdata&&s(w)?u.raw(a(w)):u.txt(w);else if(Array.isArray(w))for(k in w){if(!r.call(w,k))continue;i=w[k];for(c in i)D=i[c],u=y(u.ele(c),D).up()}else for(c in w){if(!r.call(w,c))continue;if(i=w[c],c===d){if((typeof i=="undefined"?"undefined":(0,m.default)(i))==="object")for(v in i)b=i[v],u=u.att(v,b)}else if(c===E)o.options.cdata&&s(i)?u=u.raw(a(i)):u=u.txt(i);else if(Array.isArray(i))for(k in i){if(!r.call(i,k))continue;D=i[k],typeof D=="string"?o.options.cdata&&s(D)?u=u.ele(c).raw(a(D)).up():u=u.ele(c,D).up():u=y(u.ele(c),D).up()}else(typeof i=="undefined"?"undefined":(0,m.default)(i))==="object"?u=y(u.ele(c),i).up():typeof i=="string"&&o.options.cdata&&s(i)?u=u.ele(c).raw(a(i)).up():(i==null&&(i=""),u=u.ele(c,i.toString()).up())}return u}}(this),l=g.create(n,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(l,p).end(this.options.renderOpts)},f}()}).call(void 0)},{"./defaults":246,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,xmlbuilder:282}],246:[function(I,q,N){"use strict";(function(){N.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,q,N){"use strict";var P=I("babel-runtime/core-js/promise"),m=s(P),S=I("babel-runtime/core-js/object/get-own-property-names"),R=s(S),T=I("babel-runtime/core-js/object/keys"),g=s(T),C=I("babel-runtime/helpers/typeof"),h=s(C);function s(a){return a&&a.__esModule?a:{default:a}}(function(){"use strict";var a,r,f,p,d,E,y,l,n=function(v,i){return function(){return v.apply(i,arguments)}},o=function(v,i){for(var D in i)u.call(i,D)&&(v[D]=i[D]);function k(){this.constructor=v}return k.prototype=i.prototype,v.prototype=new k,v.__super__=i.prototype,v},u={}.hasOwnProperty;y=I("sax"),f=I("events"),a=I("./bom"),E=I("./processors"),l=I("timers").setImmediate,r=I("./defaults").defaults,p=function(v){return(typeof v=="undefined"?"undefined":(0,h.default)(v))==="object"&&v!=null&&(0,g.default)(v).length===0},d=function(v,i,D){var k,c,b;for(k=0,c=v.length;k0&&(F[b.options.childkey]=X),X=F;else if(G){G[b.options.childkey]=G[b.options.childkey]||[],z={};for(j in X){if(!u.call(X,j))continue;z[j]=X[j]}G[b.options.childkey].push(z),delete X["#name"],(0,g.default)(X).length===1&&D in X&&!b.EXPLICIT_CHARKEY&&(X=X[D])}}return c.length>0?b.assignOrPush(G,L,X):(b.options.explicitRoot&&(H=X,X={},X[L]=H),b.resultObject=X,b.saxParser.ended=!0,b.emit("end",b.resultObject))}}(this),k=function(b){return function(x){var _,j;if(j=c[c.length-1],j)return j[D]+=x,b.options.explicitChildren&&b.options.preserveChildrenOrder&&b.options.charsAsChildren&&(b.options.includeWhiteChars||x.replace(/\\n/g,"").trim()!=="")&&(j[b.options.childkey]=j[b.options.childkey]||[],_={"#name":"__text__"},_[D]=x,b.options.normalize&&(_[D]=_[D].replace(/\s{2,}/g," ").trim()),j[b.options.childkey].push(_)),j}}(this),this.saxParser.ontext=k,this.saxParser.oncdata=function(b){return function(x){var _;if(_=k(x),_)return _.cdata=!0}}(this)},v.prototype.parseString=function(i,D){var k;D!=null&&typeof D=="function"&&(this.on("end",function(c){return this.reset(),D(null,c)}),this.on("error",function(c){return this.reset(),D(c)}));try{return i=i.toString(),i.trim()===""?(this.emit("end",null),!0):(i=a.stripBOM(i),this.options.async?(this.remaining=i,l(this.processAsync),this.saxParser):this.saxParser.write(i).close())}catch(c){if(k=c,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw k}else return this.emit("error",k),this.saxParser.errThrown=!0}},v.prototype.parseStringPromise=function(i){return new m.default(function(D){return function(k,c){return D.parseString(i,function(b,x){return b?c(b):k(x)})}}(this))},v}(f),N.parseString=function(w,v,i){var D,k,c;return i!=null?(typeof i=="function"&&(D=i),(typeof v=="undefined"?"undefined":(0,h.default)(v))==="object"&&(k=v)):(typeof v=="function"&&(D=v),k={}),c=new N.Parser(k),c.parseString(w,D)},N.parseStringPromise=function(w,v){var i,D;return(typeof v=="undefined"?"undefined":(0,h.default)(v))==="object"&&(i=v),D=new N.Parser(i),D.parseStringPromise(w)}}).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,q,N){"use strict";(function(){"use strict";var P;P=new RegExp(/(?!xmlns)^.*:/),N.normalize=function(m){return m.toLowerCase()},N.firstCharLowerCase=function(m){return m.charAt(0).toLowerCase()+m.slice(1)},N.stripPrefix=function(m){return m.replace(P,"")},N.parseNumbers=function(m){return isNaN(m)||(m=m%1===0?parseInt(m,10):parseFloat(m)),m},N.parseBooleans=function(m){return/^(?:true|false)$/i.test(m)&&(m=m.toLowerCase()==="true"),m}}).call(void 0)},{}],249:[function(I,q,N){"use strict";(function(){"use strict";var P,m,S,R,T=function(h,s){for(var a in s)g.call(s,a)&&(h[a]=s[a]);function r(){this.constructor=h}return r.prototype=s.prototype,h.prototype=new r,h.__super__=s.prototype,h},g={}.hasOwnProperty;m=I("./defaults"),P=I("./builder"),S=I("./parser"),R=I("./processors"),N.defaults=m.defaults,N.processors=R,N.ValidationError=function(C){T(h,C);function h(s){this.message=s}return h}(Error),N.Builder=P.Builder,N.Parser=S.Parser,N.parseString=S.parseString,N.parseStringPromise=S.parseStringPromise}).call(void 0)},{"./builder":245,"./defaults":246,"./parser":247,"./processors":248}],250:[function(I,q,N){"use strict";(function(){q.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(void 0)},{}],251:[function(I,q,N){"use strict";(function(){q.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,q,N){"use strict";var P=I("babel-runtime/core-js/object/get-prototype-of"),m=C(P),S=I("babel-runtime/helpers/typeof"),R=C(S),T=I("babel-runtime/core-js/object/assign"),g=C(T);function C(h){return h&&h.__esModule?h:{default:h}}(function(){var h,s,a,r,f,p,d,E=[].slice,y={}.hasOwnProperty;h=function(){var n,o,u,w,v,i;if(i=arguments[0],v=2<=arguments.length?E.call(arguments,1):[],f(g.default))g.default.apply(null,arguments);else for(n=0,u=v.length;n":"attribute: {"+h+"}, parent: <"+this.parent.name+">"},C.prototype.isEqualNode=function(h){return h.namespaceURI!==this.namespaceURI||(h.prefix!==this.prefix||h.localName!==this.localName)?!1:!(h.value!==this.value)},C}()}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],255:[function(I,q,N){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var f in r)h.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},h={}.hasOwnProperty;R=I("./NodeType"),g=I("./XMLCharacterData"),q.exports=T=function(s){C(a,s);function a(r,f){if(a.__super__.constructor.call(this,r),f==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=R.CData,this.value=this.stringify.cdata(f)}return a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},a}(g)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],256:[function(I,q,N){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g=function(s,a){for(var r in a)C.call(a,r)&&(s[r]=a[r]);function f(){this.constructor=s}return f.prototype=a.prototype,s.prototype=new f,s.__super__=a.prototype,s},C={}.hasOwnProperty;T=I("./XMLNode"),q.exports=R=function(h){g(s,h);function s(a){s.__super__.constructor.call(this,a),this.value=""}return Object.defineProperty(s.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}}),Object.defineProperty(s.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(s.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}}),s.prototype.clone=function(){return(0,m.default)(this)},s.prototype.substringData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.insertData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.deleteData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceData=function(a,r,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(a){return s.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)?!(a.data!==this.data):!1},s}(T)}).call(void 0)},{"./XMLNode":273,"babel-runtime/core-js/object/create":55}],257:[function(I,q,N){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var f in r)h.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},h={}.hasOwnProperty;R=I("./NodeType"),T=I("./XMLCharacterData"),q.exports=g=function(s){C(a,s);function a(r,f){if(a.__super__.constructor.call(this,r),f==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=R.Comment,this.value=this.stringify.comment(f)}return a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],258:[function(I,q,N){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=T(P),S=I("babel-runtime/core-js/object/create"),R=T(S);function T(g){return g&&g.__esModule?g:{default:g}}(function(){var g,C,h;C=I("./XMLDOMErrorHandler"),h=I("./XMLDOMStringList"),q.exports=g=function(){function s(){var a;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=a=(0,R.default)(this.defaultParams)}return Object.defineProperty(s.prototype,"parameterNames",{get:function(){return new h((0,m.default)(this.defaultParams))}}),s.prototype.getParameter=function(a){return this.params.hasOwnProperty(a)?this.params[a]:null},s.prototype.canSetParameter=function(a,r){return!0},s.prototype.setParameter=function(a,r){return r!=null?this.params[a]=r:delete this.params[a]},s}()}).call(void 0)},{"./XMLDOMErrorHandler":259,"./XMLDOMStringList":261,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60}],259:[function(I,q,N){"use strict";(function(){var P;q.exports=P=function(){function m(){}return m.prototype.handleError=function(S){throw new Error(S)},m}()}).call(void 0)},{}],260:[function(I,q,N){"use strict";(function(){var P;q.exports=P=function(){function m(){}return m.prototype.hasFeature=function(S,R){return!0},m.prototype.createDocumentType=function(S,R,T){throw new Error("This DOM method is not implemented.")},m.prototype.createDocument=function(S,R,T){throw new Error("This DOM method is not implemented.")},m.prototype.createHTMLDocument=function(S){throw new Error("This DOM method is not implemented.")},m.prototype.getFeature=function(S,R){throw new Error("This DOM method is not implemented.")},m}()}).call(void 0)},{}],261:[function(I,q,N){"use strict";(function(){var P;q.exports=P=function(){function m(S){this.arr=S||[]}return Object.defineProperty(m.prototype,"length",{get:function(){return this.arr.length}}),m.prototype.item=function(S){return this.arr[S]||null},m.prototype.contains=function(S){return this.arr.indexOf(S)!==-1},m}()}).call(void 0)},{}],262:[function(I,q,N){"use strict";(function(){var P,m,S,R=function(C,h){for(var s in h)T.call(h,s)&&(C[s]=h[s]);function a(){this.constructor=C}return a.prototype=h.prototype,C.prototype=new a,C.__super__=h.prototype,C},T={}.hasOwnProperty;S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(g){R(C,g);function C(h,s,a,r,f,p){if(C.__super__.constructor.call(this,h),s==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(a==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(s));if(!r)throw new Error("Missing DTD attribute type. "+this.debugInfo(s));if(!f)throw new Error("Missing DTD attribute default. "+this.debugInfo(s));if(f.indexOf("#")!==0&&(f="#"+f),!f.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(s));if(p&&!f.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(s));this.elementName=this.stringify.name(s),this.type=P.AttributeDeclaration,this.attributeName=this.stringify.name(a),this.attributeType=this.stringify.dtdAttType(r),p&&(this.defaultValue=this.stringify.dtdAttDefault(p)),this.defaultValueType=f}return C.prototype.toString=function(h){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(h))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],263:[function(I,q,N){"use strict";(function(){var P,m,S,R=function(C,h){for(var s in h)T.call(h,s)&&(C[s]=h[s]);function a(){this.constructor=C}return a.prototype=h.prototype,C.prototype=new a,C.__super__=h.prototype,C},T={}.hasOwnProperty;S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(g){R(C,g);function C(h,s,a){if(C.__super__.constructor.call(this,h),s==null)throw new Error("Missing DTD element name. "+this.debugInfo());a||(a="(#PCDATA)"),Array.isArray(a)&&(a="("+a.join(",")+")"),this.name=this.stringify.name(s),this.type=P.ElementDeclaration,this.value=this.stringify.dtdElementValue(a)}return C.prototype.toString=function(h){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(h))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],264:[function(I,q,N){"use strict";(function(){var P,m,S,R,T=function(h,s){for(var a in s)g.call(s,a)&&(h[a]=s[a]);function r(){this.constructor=h}return r.prototype=s.prototype,h.prototype=new r,h.__super__=s.prototype,h},g={}.hasOwnProperty;R=I("./Utility").isObject,S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(C){T(h,C);function h(s,a,r,f){if(h.__super__.constructor.call(this,s),r==null)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(f==null)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!a,this.name=this.stringify.name(r),this.type=P.EntityDeclaration,!R(f))this.value=this.stringify.dtdEntityValue(f),this.internal=!0;else{if(!f.pubID&&!f.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(f.pubID&&!f.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(this.internal=!1,f.pubID!=null&&(this.pubID=this.stringify.dtdPubID(f.pubID)),f.sysID!=null&&(this.sysID=this.stringify.dtdSysID(f.sysID)),f.nData!=null&&(this.nData=this.stringify.dtdNData(f.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}}return Object.defineProperty(h.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(h.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(h.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(h.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(h.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(h.prototype,"xmlVersion",{get:function(){return null}}),h.prototype.toString=function(s){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(s))},h}(S)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],265:[function(I,q,N){"use strict";(function(){var P,m,S,R=function(C,h){for(var s in h)T.call(h,s)&&(C[s]=h[s]);function a(){this.constructor=C}return a.prototype=h.prototype,C.prototype=new a,C.__super__=h.prototype,C},T={}.hasOwnProperty;S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(g){R(C,g);function C(h,s,a){if(C.__super__.constructor.call(this,h),s==null)throw new Error("Missing DTD notation name. "+this.debugInfo(s));if(!a.pubID&&!a.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(s));this.name=this.stringify.name(s),this.type=P.NotationDeclaration,a.pubID!=null&&(this.pubID=this.stringify.dtdPubID(a.pubID)),a.sysID!=null&&(this.sysID=this.stringify.dtdSysID(a.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(h){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(h))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],266:[function(I,q,N){"use strict";(function(){var P,m,S,R,T=function(h,s){for(var a in s)g.call(s,a)&&(h[a]=s[a]);function r(){this.constructor=h}return r.prototype=s.prototype,h.prototype=new r,h.__super__=s.prototype,h},g={}.hasOwnProperty;R=I("./Utility").isObject,S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(C){T(h,C);function h(s,a,r,f){var p;h.__super__.constructor.call(this,s),R(a)&&(p=a,a=p.version,r=p.encoding,f=p.standalone),a||(a="1.0"),this.type=P.Declaration,this.version=this.stringify.xmlVersion(a),r!=null&&(this.encoding=this.stringify.xmlEncoding(r)),f!=null&&(this.standalone=this.stringify.xmlStandalone(f))}return h.prototype.toString=function(s){return this.options.writer.declaration(this,this.options.writer.filterOptions(s))},h}(S)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],267:[function(I,q,N){"use strict";(function(){var P,m,S,R,T,g,C,h,s,a=function(p,d){for(var E in d)r.call(d,E)&&(p[E]=d[E]);function y(){this.constructor=p}return y.prototype=d.prototype,p.prototype=new y,p.__super__=d.prototype,p},r={}.hasOwnProperty;s=I("./Utility").isObject,h=I("./XMLNode"),P=I("./NodeType"),m=I("./XMLDTDAttList"),R=I("./XMLDTDEntity"),S=I("./XMLDTDElement"),T=I("./XMLDTDNotation"),C=I("./XMLNamedNodeMap"),q.exports=g=function(f){a(p,f);function p(d,E,y){var l,n,o,u,w,v;if(p.__super__.constructor.call(this,d),this.type=P.DocType,d.children){for(u=d.children,n=0,o=u.length;n=0;)this.up();return this.onEnd()},c.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},c.prototype.openNode=function(b){var x,_,j,F;if(!b.isOpen){if(!this.root&&this.currentLevel===0&&b.type===P.Element&&(this.root=b),_="",b.type===P.Element){this.writerOptions.state=m.OpenTag,_=this.writer.indent(b,this.writerOptions,this.currentLevel)+"<"+b.name,F=b.attribs;for(j in F){if(!k.call(F,j))continue;x=F[j],_+=this.writer.attribute(x,this.writerOptions,this.currentLevel)}_+=(b.children?">":"/>")+this.writer.endline(b,this.writerOptions,this.currentLevel),this.writerOptions.state=m.InsideTag}else this.writerOptions.state=m.OpenTag,_=this.writer.indent(b,this.writerOptions,this.currentLevel)+""),_+=this.writer.endline(b,this.writerOptions,this.currentLevel);return this.onData(_,this.currentLevel),b.isOpen=!0}},c.prototype.closeNode=function(b){var x;if(!b.isClosed)return x="",this.writerOptions.state=m.CloseTag,b.type===P.Element?x=this.writer.indent(b,this.writerOptions,this.currentLevel)+""+this.writer.endline(b,this.writerOptions,this.currentLevel):x=this.writer.indent(b,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(b,this.writerOptions,this.currentLevel),this.writerOptions.state=m.None,this.onData(x,this.currentLevel),b.isClosed=!0},c.prototype.onData=function(b,x){return this.documentStarted=!0,this.onDataCallback(b,x+1)},c.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},c.prototype.debugInfo=function(b){return b==null?"":"node: <"+b+">"},c.prototype.ele=function(){return this.element.apply(this,arguments)},c.prototype.nod=function(b,x,_){return this.node(b,x,_)},c.prototype.txt=function(b){return this.text(b)},c.prototype.dat=function(b){return this.cdata(b)},c.prototype.com=function(b){return this.comment(b)},c.prototype.ins=function(b,x){return this.instruction(b,x)},c.prototype.dec=function(b,x,_){return this.declaration(b,x,_)},c.prototype.dtd=function(b,x,_){return this.doctype(b,x,_)},c.prototype.e=function(b,x,_){return this.element(b,x,_)},c.prototype.n=function(b,x,_){return this.node(b,x,_)},c.prototype.t=function(b){return this.text(b)},c.prototype.d=function(b){return this.cdata(b)},c.prototype.c=function(b){return this.comment(b)},c.prototype.r=function(b){return this.raw(b)},c.prototype.i=function(b,x){return this.instruction(b,x)},c.prototype.att=function(){return this.currentNode&&this.currentNode.type===P.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},c.prototype.a=function(){return this.currentNode&&this.currentNode.type===P.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},c.prototype.ent=function(b,x){return this.entity(b,x)},c.prototype.pent=function(b,x){return this.pEntity(b,x)},c.prototype.not=function(b,x){return this.notation(b,x)},c}()}).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,q,N){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var f in r)h.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},h={}.hasOwnProperty;g=I("./XMLNode"),R=I("./NodeType"),q.exports=T=function(s){C(a,s);function a(r){a.__super__.constructor.call(this,r),this.type=R.Dummy}return a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return""},a}(g)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],271:[function(I,q,N){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C,h,s,a,r,f,p=function(y,l){for(var n in l)d.call(l,n)&&(y[n]=l[n]);function o(){this.constructor=y}return o.prototype=l.prototype,y.prototype=new o,y.__super__=l.prototype,y},d={}.hasOwnProperty;f=I("./Utility"),r=f.isObject,a=f.isFunction,s=f.getValue,h=I("./XMLNode"),R=I("./NodeType"),T=I("./XMLAttribute"),C=I("./XMLNamedNodeMap"),q.exports=g=function(E){p(y,E);function y(l,n,o){var u,w,v,i;if(y.__super__.constructor.call(this,l),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,o!=null&&this.attribute(o),l.type===R.Document&&(this.isRoot=!0,this.documentObject=l,l.rootObject=this,l.children)){for(i=l.children,w=0,v=i.length;w=u;n=0<=u?++o:--o)if(!this.attribs[n].isEqualNode(l.attribs[n]))return!1;return!0},y}(h)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLAttribute":254,"./XMLNamedNodeMap":272,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],272:[function(I,q,N){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R;q.exports=R=function(){function T(g){this.nodes=g}return Object.defineProperty(T.prototype,"length",{get:function(){return(0,m.default)(this.nodes).length||0}}),T.prototype.clone=function(){return this.nodes=null},T.prototype.getNamedItem=function(g){return this.nodes[g]},T.prototype.setNamedItem=function(g){var C;return C=this.nodes[g.nodeName],this.nodes[g.nodeName]=g,C||null},T.prototype.removeNamedItem=function(g){var C;return C=this.nodes[g],delete this.nodes[g],C||null},T.prototype.item=function(g){return this.nodes[(0,m.default)(this.nodes)[g]]||null},T.prototype.getNamedItemNS=function(g,C){throw new Error("This DOM method is not implemented.")},T.prototype.setNamedItemNS=function(g){throw new Error("This DOM method is not implemented.")},T.prototype.removeNamedItemNS=function(g,C){throw new Error("This DOM method is not implemented.")},T}()}).call(void 0)},{"babel-runtime/core-js/object/keys":60}],273:[function(I,q,N){"use strict";(function(){var P,m,S,R,T,g,C,h,s,a,r,f,p,d,E,y,l,n,o,u={}.hasOwnProperty;o=I("./Utility"),n=o.isObject,l=o.isFunction,y=o.isEmpty,E=o.getValue,h=null,S=null,R=null,T=null,g=null,p=null,d=null,f=null,C=null,m=null,r=null,s=null,P=null,q.exports=a=function(){function w(v){this.parent=v,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,h||(h=I("./XMLElement"),S=I("./XMLCData"),R=I("./XMLComment"),T=I("./XMLDeclaration"),g=I("./XMLDocType"),p=I("./XMLRaw"),d=I("./XMLText"),f=I("./XMLProcessingInstruction"),C=I("./XMLDummy"),m=I("./NodeType"),r=I("./XMLNodeList"),s=I("./XMLNamedNodeMap"),P=I("./DocumentPosition"))}return Object.defineProperty(w.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(w.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(w.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(w.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(w.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new r(this.children)),this.childNodeList}}),Object.defineProperty(w.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(w.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(w.prototype,"previousSibling",{get:function(){var i;return i=this.parent.children.indexOf(this),this.parent.children[i-1]||null}}),Object.defineProperty(w.prototype,"nextSibling",{get:function(){var i;return i=this.parent.children.indexOf(this),this.parent.children[i+1]||null}}),Object.defineProperty(w.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(w.prototype,"textContent",{get:function(){var i,D,k,c,b;if(this.nodeType===m.Element||this.nodeType===m.DocumentFragment){for(b="",c=this.children,D=0,k=c.length;D":((D=this.parent)!=null?D.name:void 0)?"node: <"+v+">, parent: <"+this.parent.name+">":"node: <"+v+">"},w.prototype.ele=function(v,i,D){return this.element(v,i,D)},w.prototype.nod=function(v,i,D){return this.node(v,i,D)},w.prototype.txt=function(v){return this.text(v)},w.prototype.dat=function(v){return this.cdata(v)},w.prototype.com=function(v){return this.comment(v)},w.prototype.ins=function(v,i){return this.instruction(v,i)},w.prototype.doc=function(){return this.document()},w.prototype.dec=function(v,i,D){return this.declaration(v,i,D)},w.prototype.e=function(v,i,D){return this.element(v,i,D)},w.prototype.n=function(v,i,D){return this.node(v,i,D)},w.prototype.t=function(v){return this.text(v)},w.prototype.d=function(v){return this.cdata(v)},w.prototype.c=function(v){return this.comment(v)},w.prototype.r=function(v){return this.raw(v)},w.prototype.i=function(v,i){return this.instruction(v,i)},w.prototype.u=function(){return this.up()},w.prototype.importXMLBuilder=function(v){return this.importDocument(v)},w.prototype.replaceChild=function(v,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.removeChild=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.appendChild=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.hasChildNodes=function(){return this.children.length!==0},w.prototype.cloneNode=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isSupported=function(v,i){return!0},w.prototype.hasAttributes=function(){return this.attribs.length!==0},w.prototype.compareDocumentPosition=function(v){var i,D;return i=this,i===v?0:this.document()!==v.document()?(D=P.Disconnected|P.ImplementationSpecific,Math.random()<.5?D|=P.Preceding:D|=P.Following,D):i.isAncestor(v)?P.Contains|P.Preceding:i.isDescendant(v)?P.Contains|P.Following:i.isPreceding(v)?P.Preceding:P.Following},w.prototype.isSameNode=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.lookupPrefix=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isDefaultNamespace=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.lookupNamespaceURI=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isEqualNode=function(v){var i,D,k;if(v.nodeType!==this.nodeType)return!1;if(v.children.length!==this.children.length)return!1;for(i=D=0,k=this.children.length-1;0<=k?D<=k:D>=k;i=0<=k?++D:--D)if(!this.children[i].isEqualNode(v.children[i]))return!1;return!0},w.prototype.getFeature=function(v,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.setUserData=function(v,i,D){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.getUserData=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.contains=function(v){return v?v===this||this.isDescendant(v):!1},w.prototype.isDescendant=function(v){var i,D,k,c,b;for(b=this.children,k=0,c=b.length;kD},w.prototype.treePosition=function(v){var i,D;return D=0,i=!1,this.foreachTreeNode(this.document(),function(k){if(D++,!i&&k===v)return i=!0}),i?D:-1},w.prototype.foreachTreeNode=function(v,i){var D,k,c,b,x;for(v||(v=this.document()),b=v.children,k=0,c=b.length;k0){for(this.stream.write(" ["),this.stream.write(this.endline(s,a,r)),a.state=m.InsideTag,E=s.children,p=0,d=E.length;p"),this.stream.write(this.endline(s,a,r)),a.state=m.None,this.closeNode(s,a,r)},h.prototype.element=function(s,a,r){var f,p,d,E,y,l,n,o,u,w;r||(r=0),this.openNode(s,a,r),a.state=m.OpenTag,this.stream.write(this.indent(s,a,r)+"<"+s.name),u=s.attribs;for(n in u){if(!g.call(u,n))continue;f=u[n],this.attribute(f,a,r)}if(d=s.children.length,E=d===0?null:s.children[0],d===0||s.children.every(function(v){return(v.type===P.Text||v.type===P.Raw)&&v.value===""}))a.allowEmpty?(this.stream.write(">"),a.state=m.CloseTag,this.stream.write("")):(a.state=m.CloseTag,this.stream.write(a.spaceBeforeSlash+"/>"));else if(a.pretty&&d===1&&(E.type===P.Text||E.type===P.Raw)&&E.value!=null)this.stream.write(">"),a.state=m.InsideTag,a.suppressPrettyCount++,o=!0,this.writeChildNode(E,a,r+1),a.suppressPrettyCount--,o=!1,a.state=m.CloseTag,this.stream.write("");else{for(this.stream.write(">"+this.endline(s,a,r)),a.state=m.InsideTag,w=s.children,y=0,l=w.length;y")}return this.stream.write(this.endline(s,a,r)),a.state=m.None,this.closeNode(s,a,r)},h.prototype.processingInstruction=function(s,a,r){return this.stream.write(h.__super__.processingInstruction.call(this,s,a,r))},h.prototype.raw=function(s,a,r){return this.stream.write(h.__super__.raw.call(this,s,a,r))},h.prototype.text=function(s,a,r){return this.stream.write(h.__super__.text.call(this,s,a,r))},h.prototype.dtdAttList=function(s,a,r){return this.stream.write(h.__super__.dtdAttList.call(this,s,a,r))},h.prototype.dtdElement=function(s,a,r){return this.stream.write(h.__super__.dtdElement.call(this,s,a,r))},h.prototype.dtdEntity=function(s,a,r){return this.stream.write(h.__super__.dtdEntity.call(this,s,a,r))},h.prototype.dtdNotation=function(s,a,r){return this.stream.write(h.__super__.dtdNotation.call(this,s,a,r))},h}(R)}).call(void 0)},{"./NodeType":251,"./WriterState":253,"./XMLWriterBase":281}],278:[function(I,q,N){"use strict";(function(){var P,m,S=function(g,C){for(var h in C)R.call(C,h)&&(g[h]=C[h]);function s(){this.constructor=g}return s.prototype=C.prototype,g.prototype=new s,g.__super__=C.prototype,g},R={}.hasOwnProperty;m=I("./XMLWriterBase"),q.exports=P=function(T){S(g,T);function g(C){g.__super__.constructor.call(this,C)}return g.prototype.document=function(C,h){var s,a,r,f,p;for(h=this.filterOptions(h),f="",p=C.children,a=0,r=p.length;a","]]]]>"),this.assertLegalChar(T))},R.prototype.comment=function(T){if(this.options.noValidation)return T;if(T=""+T||"",T.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+T);return this.assertLegalChar(T)},R.prototype.raw=function(T){return this.options.noValidation?T:""+T||""},R.prototype.attValue=function(T){return this.options.noValidation?T:this.assertLegalChar(this.attEscape(T=""+T||""))},R.prototype.insTarget=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.insValue=function(T){if(this.options.noValidation)return T;if(T=""+T||"",T.match(/\?>/))throw new Error("Invalid processing instruction value: "+T);return this.assertLegalChar(T)},R.prototype.xmlVersion=function(T){if(this.options.noValidation)return T;if(T=""+T||"",!T.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+T);return T},R.prototype.xmlEncoding=function(T){if(this.options.noValidation)return T;if(T=""+T||"",!T.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+T);return this.assertLegalChar(T)},R.prototype.xmlStandalone=function(T){return this.options.noValidation?T:T?"yes":"no"},R.prototype.dtdPubID=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdSysID=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdElementValue=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdAttType=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdAttDefault=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdEntityValue=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdNData=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},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(T){var g,C;if(this.options.noValidation)return T;if(g="",this.options.version==="1.0"){if(g=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=T.match(g))throw new Error("Invalid character in string: "+T+" at index "+C.index)}else if(this.options.version==="1.1"&&(g=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=T.match(g)))throw new Error("Invalid character in string: "+T+" at index "+C.index);return T},R.prototype.assertLegalName=function(T){var g;if(this.options.noValidation)return T;if(this.assertLegalChar(T),g=/^([: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])*$/,!T.match(g))throw new Error("Invalid character in name");return T},R.prototype.textEscape=function(T){var g;return this.options.noValidation?T:(g=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,T.replace(g,"&").replace(//g,">").replace(/\r/g," "))},R.prototype.attEscape=function(T){var g;return this.options.noValidation?T:(g=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,T.replace(g,"&").replace(/0)?new Array(i).join(w.indent):""},o.prototype.endline=function(u,w,v){return!w.pretty||w.suppressPrettyCount?"":w.newline},o.prototype.attribute=function(u,w,v){var i;return this.openAttribute(u,w,v),i=" "+u.name+'="'+u.value+'"',this.closeAttribute(u,w,v),i},o.prototype.cdata=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+""+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.comment=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+""+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.declaration=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"",i+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.docType=function(u,w,v){var i,D,k,c,b;if(v||(v=0),this.openNode(u,w,v),w.state=m.OpenTag,c=this.indent(u,w,v),c+="0){for(c+=" [",c+=this.endline(u,w,v),w.state=m.InsideTag,b=u.children,D=0,k=b.length;D",c+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),c},o.prototype.element=function(u,w,v){var i,D,k,c,b,x,_,j,F,L,X,z,H,G;v||(v=0),L=!1,X="",this.openNode(u,w,v),w.state=m.OpenTag,X+=this.indent(u,w,v)+"<"+u.name,z=u.attribs;for(F in z){if(!n.call(z,F))continue;i=z[F],X+=this.attribute(i,w,v)}if(k=u.children.length,c=k===0?null:u.children[0],k===0||u.children.every(function(U){return(U.type===P.Text||U.type===P.Raw)&&U.value===""}))w.allowEmpty?(X+=">",w.state=m.CloseTag,X+=""+this.endline(u,w,v)):(w.state=m.CloseTag,X+=w.spaceBeforeSlash+"/>"+this.endline(u,w,v));else if(w.pretty&&k===1&&(c.type===P.Text||c.type===P.Raw)&&c.value!=null)X+=">",w.state=m.InsideTag,w.suppressPrettyCount++,L=!0,X+=this.writeChildNode(c,w,v+1),w.suppressPrettyCount--,L=!1,w.state=m.CloseTag,X+=""+this.endline(u,w,v);else{if(w.dontPrettyTextNodes){for(H=u.children,b=0,_=H.length;b<_;b++)if(D=H[b],(D.type===P.Text||D.type===P.Raw)&&D.value!=null){w.suppressPrettyCount++,L=!0;break}}for(X+=">"+this.endline(u,w,v),w.state=m.InsideTag,G=u.children,x=0,j=G.length;x",L&&w.suppressPrettyCount--,X+=this.endline(u,w,v),w.state=m.None}return this.closeNode(u,w,v),X},o.prototype.writeChildNode=function(u,w,v){switch(u.type){case P.CData:return this.cdata(u,w,v);case P.Comment:return this.comment(u,w,v);case P.Element:return this.element(u,w,v);case P.Raw:return this.raw(u,w,v);case P.Text:return this.text(u,w,v);case P.ProcessingInstruction:return this.processingInstruction(u,w,v);case P.Dummy:return"";case P.Declaration:return this.declaration(u,w,v);case P.DocType:return this.docType(u,w,v);case P.AttributeDeclaration:return this.dtdAttList(u,w,v);case P.ElementDeclaration:return this.dtdElement(u,w,v);case P.EntityDeclaration:return this.dtdEntity(u,w,v);case P.NotationDeclaration:return this.dtdNotation(u,w,v);default:throw new Error("Unknown XML node type: "+u.constructor.name)}},o.prototype.processingInstruction=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"",i+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.raw=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v),w.state=m.InsideTag,i+=u.value,w.state=m.CloseTag,i+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.text=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v),w.state=m.InsideTag,i+=u.value,w.state=m.CloseTag,i+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.dtdAttList=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+""+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.dtdElement=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+""+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.dtdEntity=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+""+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.dtdNotation=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+""+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.openNode=function(u,w,v){},o.prototype.closeNode=function(u,w,v){},o.prototype.openAttribute=function(u,w,v){},o.prototype.closeAttribute=function(u,w,v){},o}()}).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,q,N){"use strict";(function(){var P,m,S,R,T,g,C,h,s,a;a=I("./Utility"),h=a.assign,s=a.isFunction,S=I("./XMLDOMImplementation"),R=I("./XMLDocument"),T=I("./XMLDocumentCB"),C=I("./XMLStringWriter"),g=I("./XMLStreamWriter"),P=I("./NodeType"),m=I("./WriterState"),q.exports.create=function(r,f,p,d){var E,y;if(r==null)throw new Error("Root element needs a name.");return d=h({},f,p,d),E=new R(d),y=E.element(r),d.headless||(E.declaration(d),(d.pubID!=null||d.sysID!=null)&&E.dtd(d)),y},q.exports.begin=function(r,f,p){var d;return s(r)&&(d=[r,f],f=d[0],p=d[1],r={}),f?new T(r,f,p):new R(r)},q.exports.stringWriter=function(r){return new C(r)},q.exports.streamWriter=function(r,f){return new g(r,f)},q.exports.implementation=new S,q.exports.nodeType=P,q.exports.writerState=m}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLDOMImplementation":260,"./XMLDocument":268,"./XMLDocumentCB":269,"./XMLStreamWriter":277,"./XMLStringWriter":278}],283:[function(I,q,N){q.exports=m;var P=Object.prototype.hasOwnProperty;function m(){for(var S={},R=0;RT?r=a(r):r.length>5]|=128<>>9<<4)+14]=f;for(var p=1732584193,d=-271733879,E=-1732584194,y=271733878,l=0;l>16)+(f>>16)+(p>>16);return d<<16|p&65535}function a(r,f){return r<>>32-f}q.exports=function(f){return P.hash(f,S,16)}},{"./helpers":285}],287:[function(I,q,N){"use strict";var P=I("./helpers");function m(C,h){C[h>>5]|=128<<24-h%32,C[(h+64>>9<<4)+15]=h;for(var s=Array(80),a=1732584193,r=-271733879,f=-1732584194,p=271733878,d=-1009589776,E=0;E>16)+(h>>16)+(s>>16);return a<<16|s&65535}function g(C,h){return C<>>32-h}q.exports=function(h){return P.hash(h,m,20,!0)}},{"./helpers":285}],288:[function(I,q,N){"use strict";q.exports=function(){return function(){}}},{}],289:[function(I,q,N){(function(P){"use strict";var m=I("babel-runtime/helpers/typeof"),S=R(m);function R(a){return a&&a.__esModule?a:{default:a}}var T=I("stream"),g=T.Stream,C=I("../lib/common/utils/isArray"),h=C.isArray;q.exports.string=function(r){return typeof r=="string"},q.exports.array=h,q.exports.buffer=P.isBuffer;function s(a){return a instanceof g}q.exports.writableStream=function(r){return s(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,q,N){"use strict";N.encodeURIComponent=function(P){try{return encodeURIComponent(P)}catch(m){return P}},N.escape=I("escape-html"),N.timestamp=function(m){if(m){var S=m;return typeof S=="string"&&(S=Number(S)),String(m).length===10&&(S*=1e3),new Date(S)}return Math.round(Date.now()/1e3)}},{"escape-html":191}],291:[function(I,q,N){(function(P,m){"use strict";var S=I("babel-runtime/core-js/json/stringify"),R=C(S),T=I("babel-runtime/helpers/typeof"),g=C(T);function C(w){return w&&w.__esModule?w:{default:w}}var h=I("util"),s=I("url"),a=I("http"),r=I("https"),f=I("debug")("urllib"),p=I("humanize-ms"),d,E=0,y=Math.pow(2,31)-10,l=/^https?:\/\//i;function n(w,v){return w===void 0?v:w}function o(w,v){return function(i,D,k){if(i)return v(i);w({data:D,status:k.statusCode,headers:k.headers,res:k})}}N.TIMEOUTS=[p("300s"),p("300s")];var u=["json","text"];N.request=function(v,i,D){return arguments.length===2&&typeof i=="function"&&(D=i,i=null),typeof D=="function"?N.requestWithCallback(v,i,D):(d||(d=I("any-promise")),new d(function(k,c){N.requestWithCallback(v,i,o(k,c))}))},N.requestWithCallback=function(v,i,D){if(!v||typeof v!="string"&&(typeof v=="undefined"?"undefined":(0,g.default)(v))!=="object"){var k=h.format("expect request url to be a string or a http request options, but got %j",v);throw new Error(k)}arguments.length===2&&typeof i=="function"&&(D=i,i=null),i=i||{},E>=y&&(E=0);var c=++E;i.requestUrls=i.requestUrls||[];var b={requestId:c,url:v,args:i,ctx:i.ctx};i.emitter&&i.emitter.emit("request",b),i.timeout=i.timeout||N.TIMEOUTS,i.maxRedirects=i.maxRedirects||10,i.streaming=i.streaming||i.customResponse;var x=Date.now(),_;typeof v=="string"?(l.test(v)||(v="http://"+v),_=s.parse(v)):_=v;var j=(i.type||i.method||_.method||"GET").toUpperCase(),F=_.port||80,L=a,X=n(i.agent,N.agent),z=i.fixJSONCtlChars;_.protocol==="https:"&&(L=r,X=n(i.httpsAgent,N.httpsAgent),_.port||(F=443));var H={host:_.hostname||_.host||"localhost",path:_.path||"/",method:j,port:F,agent:X,headers:i.headers||{},lookup:i.lookup};Array.isArray(i.timeout)?H.requestTimeout=i.timeout[i.timeout.length-1]:typeof i.timeout!="undefined"&&(H.requestTimeout=i.timeout);for(var G=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],U=0;U=0)return f("Request#%d %s: got digest auth header WWW-Authenticate: %s",c,v,Ie),i.headers=i.headers||{},i.headers.Authorization=digestAuthHeader(H.method,H.path,Ie,i.digestAuth),f("Request#%d %s: auth with digest header: %s",c,v,i.headers.Authorization),rt.headers["set-cookie"]&&(i.headers.Cookie=rt.headers["set-cookie"].join(";")),N.requestWithCallback(v,i,We)}var Oe=Date.now()-x;ne&&(ne.contentDownload=Oe),f("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Oe,re,he,H.method,H.host,H.path,ae,ne);var Le={status:he,statusCode:he,headers:$e,size:re,aborted:Q,rt:Oe,keepAliveSocket:ae,data:tt,requestUrls:i.requestUrls,timing:ne,remoteAddress:ie,remotePort:we};if(Re){var Te="";X&&typeof X.getCurrentStatus=="function"&&(Te=", agent status: "+(0,R.default)(X.getCurrentStatus())),Re.message+=", "+H.method+" "+v+" "+he+" (connected: "+oe+", keepalive socket: "+ae+Te+`) headers: `+(0,R.default)($e),Re.data=tt,Re.path=H.path,Re.status=he,Re.headers=$e,Re.res=Le}We(Re,tt,i.streaming?rt:Le),i.emitter&&(b.url=v,b.socket=Ge&&Ge.connection,b.options=H,b.size=be,i.emitter.emit("response",{requestId:c,error:Re,ctx:i.ctx,req:b,res:Le}))}function Ee(Re){var tt=null;if(i.followRedirect&&statuses.redirect[Re.statusCode]){i._followRedirectCount=(i._followRedirectCount||0)+1;var rt=Re.headers.location;if(!rt)tt=new Error("Got statusCode "+Re.statusCode+" but cannot resolve next location from headers"),tt.name="FollowRedirectError";else if(i._followRedirectCount>i.maxRedirects)tt=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+v),tt.name="MaxRedirectError";else{var We=i.formatRedirectUrl?i.formatRedirectUrl(v,rt):s.resolve(v,rt);f("Request#%d %s: `redirected` from %s to %s",c,H.path,v,We),V(),i.headers&&i.headers.Host&&l.test(rt)&&(i.headers.Host=null);var $e=D;return D=null,N.requestWithCallback(We,i,$e),{redirect:!0,error:null}}}return{redirect:!1,error:tt}}!H.headers["User-Agent"]&&!H.headers["user-agent"]&&(H.headers["User-Agent"]=navigator.userAgent),i.gzip&&(!H.headers["Accept-Encoding"]&&!H.headers["accept-encoding"]&&(H.headers["Accept-Encoding"]="gzip"));function xe(Re,tt,rt){var We=Re.headers["content-encoding"];return rt(null,tt,We)}var _e=i.writeStream;f("Request#%d %s %s with headers %j, options.path: %s",c,j,v,H.headers,H.path),i.requestUrls.push(v);function je(Re){if(ne&&(ne.waiting=Date.now()-x),f("Request#%d %s `req response` event emit: status %d, headers: %j",c,v,Re.statusCode,Re.headers),i.streaming){var tt=Ee(Re);if(tt.redirect){Re.resume();return}return tt.error?(Re.resume(),Z(tt.error,null,Re)):Z(null,null,Re)}if(Re.on("close",function(){f("Request#%d %s: `res close` event emit, total size %d",c,v,re)}),Re.on("error",function(){f("Request#%d %s: `res error` event emit, total size %d",c,v,re)}),Re.on("aborted",function(){Q=!0,f("Request#%d %s: `res aborted` event emit, total size %d",c,v,re)}),_e){var tt=Ee(Re);if(tt.redirect){Re.resume();return}return tt.error?(Re.resume(),_e.end(),Z(tt.error,null,Re)):(i.consumeWriteStream===!1?Re.on("end",Z.bind(null,null,null,Re)):isNode010||isNode012?first([[_e,"close"],[Re,"aborted"]],function($e,Ie,Oe){f("Request#%d %s: writeStream or res %s event emitted",c,v,Oe),Z(pe||null,null,Re)}):_e.on("close",function(){f("Request#%d %s: writeStream close event emitted",c,v),Z(pe||null,null,Re)}),Re.pipe(_e))}var rt=[];Re.on("data",function(We){f("Request#%d %s: `res data` event emit, size %d",c,v,We.length),re+=We.length,rt.push(We)}),Re.on("end",function(){var We=m.concat(rt,re);if(f("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",c,v,re,Re._dumped),pe)return Z(pe,We,Re);var $e=Ee(Re);if($e.error)return Z($e.error,We,Re);if($e.redirect)return;xe(Re,We,function(Ie,Oe,Le){if(Ie)return Z(Ie,We,Re);if(!Le&&u.indexOf(i.dataType)>=0){try{Oe=decodeBodyByCharset(Oe,Re)}catch(Ae){return f("decodeBodyByCharset error: %s",Ae),Z(null,Oe,Re)}if(i.dataType==="json")if(re===0)Oe=null;else{var Te=parseJSON(Oe,z);Te.error?Ie=Te.error:Oe=Te.data}}Q&&f("Request#%d %s: Remote socket was terminated before `response.end()` was called",c,v),Z(Ie,Oe,Re)})})}var Be,He;Array.isArray(i.timeout)?(Be=p(i.timeout[0]),He=p(i.timeout[1])):Be=He=p(i.timeout),f("ConnectTimeout: %d, ResponseTimeout: %d",Be,He);function Ue(){f("Connect timer ticking, timeout: %d",Be),ue=setTimeout(function(){ue=null,he===-1&&(he=-2);var Re="Connect timeout for "+Be+"ms",tt="ConnectionTimeoutError";Ge.socket||(tt="SocketAssignTimeoutError",Re+=", working sockets is full"),pe=new Error(Re),pe.name=tt,pe.requestId=c,f("ConnectTimeout: Request#%d %s %s: %s, connected: %s",c,v,pe.name,Re,oe),Ye()},Be)}function ze(){f("Response timer ticking, timeout: %d",He),ge=setTimeout(function(){ge=null;var Re="Response timeout for "+He+"ms",tt="ResponseTimeoutError";pe=new Error(Re),pe.name=tt,pe.requestId=c,f("ResponseTimeout: Request#%d %s %s: %s, connected: %s",c,v,pe.name,Re,oe),Ye()},He)}var Ge;H.mode=i.mode?i.mode:"";try{Ge=L.request(H,je)}catch(Re){return Z(Re)}typeof window=="undefined"?Ue():Ge.on("requestTimeout",function(){he===-1&&(he=-2);var Re="Connect timeout for "+Be+"ms",tt="ConnectionTimeoutError";pe=new Error(Re),pe.name=tt,pe.requestId=c,Ye()});function Ye(){f("Request#%d %s abort, connected: %s",c,v,oe),Ge.socket||(pe.noSocket=!0,Z(pe)),Ge.abort()}return ne&&Ge.on("finish",function(){ne.requestSent=Date.now()-x}),Ge.once("socket",function(Re){ne&&(ne.queuing=Date.now()-x),isNode010&&Re.socket&&(Re=Re.socket);var tt=Re.readyState;if(tt==="opening"){Re.once("lookup",function(rt,We,$e){f("Request#%d %s lookup: %s, %s, %s",c,v,rt,We,$e),ne&&(ne.dnslookup=Date.now()-x),We&&(ie=We)}),Re.once("connect",function(){ne&&(ne.connected=Date.now()-x),J(),ze(),f("Request#%d %s new socket connected",c,v),oe=!0,ie||(ie=Re.remoteAddress),we=Re.remotePort});return}f("Request#%d %s reuse socket connected, readyState: %s",c,v,tt),oe=!0,ae=!0,ie||(ie=Re.remoteAddress),we=Re.remotePort,J(),ze()}),Ge.on("error",function(Re){(Re.name==="Error"||Re.name==="TypeError")&&(Re.name=oe?"ResponseError":"RequestError"),Re.message+=' (req "error")',f("Request#%d %s `req error` event emit, %s: %s",c,v,Re.name,Re.message),Z(pe||Re)}),_e&&_e.once("error",function(Re){Re.message+=' (writeStream "error")',pe=Re,f("Request#%d %s `writeStream error` event emit, %s: %s",c,v,Re.name,Re.message),Ye()}),i.stream?(i.stream.pipe(Ge),i.stream.once("error",function(Re){Re.message+=' (stream "error")',pe=Re,f("Request#%d %s `readStream error` event emit, %s: %s",c,v,Re.name,Re.message),Ye()})):Ge.end(te),Ge.requestId=c,Ge}}).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"))},nj2k:function(I,q,N){I.exports=N.p+"static/nodata.c3b0b86c.svg"},oRuE:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){return P.pad.Iso10126={pad:function(m,S){var R=S*4,T=R-m.sigBytes%R;m.concat(P.lib.WordArray.random(T-1)).concat(P.lib.WordArray.create([T<<24],1))},unpad:function(m){var S=m.words[m.sigBytes-1>>>2]&255;m.sigBytes-=S}},P.pad.Iso10126})},osHv:function(I,q,N){(function(P){P(N("VrN/"))})(function(P){"use strict";var m=P.Pos;function S(l,n){return l.line-n.line||l.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",T=R+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+R+"]["+T+"]*)","g");function C(l,n,o,u){this.line=n,this.ch=o,this.cm=l,this.text=l.getLine(n),this.min=u?Math.max(u.from,l.firstLine()):l.firstLine(),this.max=u?Math.min(u.to-1,l.lastLine()):l.lastLine()}function h(l,n){var o=l.cm.getTokenTypeAt(m(l.line,n));return o&&/\btag\b/.test(o)}function s(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function a(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function r(l){for(;;){var n=l.text.indexOf(">",l.ch);if(n==-1){if(s(l))continue;return}if(!h(l,n+1)){l.ch=n+1;continue}var o=l.text.lastIndexOf("/",n),u=o>-1&&!/\S/.test(l.text.slice(o+1,n));return l.ch=n+1,u?"selfClose":"regular"}}function f(l){for(;;){var n=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(n==-1){if(a(l))continue;return}if(!h(l,n+1)){l.ch=n;continue}g.lastIndex=n,l.ch=n;var o=g.exec(l.text);if(o&&o.index==n)return o}}function p(l){for(;;){g.lastIndex=l.ch;var n=g.exec(l.text);if(!n){if(s(l))continue;return}if(!h(l,n.index+1)){l.ch=n.index+1;continue}return l.ch=n.index+n[0].length,n}}function d(l){for(;;){var n=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(n==-1){if(a(l))continue;return}if(!h(l,n+1)){l.ch=n;continue}var o=l.text.lastIndexOf("/",n),u=o>-1&&!/\S/.test(l.text.slice(o+1,n));return l.ch=n+1,u?"selfClose":"regular"}}function E(l,n){for(var o=[];;){var u=p(l),w,v=l.line,i=l.ch-(u?u[0].length:0);if(!u||!(w=r(l)))return;if(w=="selfClose")continue;if(u[1]){for(var D=o.length-1;D>=0;--D)if(o[D]==u[2]){o.length=D;break}if(D<0&&(!n||n==u[2]))return{tag:u[2],from:m(v,i),to:m(l.line,l.ch)}}else o.push(u[2])}}function y(l,n){for(var o=[];;){var u=d(l);if(!u)return;if(u=="selfClose"){f(l);continue}var w=l.line,v=l.ch,i=f(l);if(!i)return;if(i[1])o.push(i[2]);else{for(var D=o.length-1;D>=0;--D)if(o[D]==i[2]){o.length=D;break}if(D<0&&(!n||n==i[2]))return{tag:i[2],from:m(l.line,l.ch),to:m(w,v)}}}}P.registerHelper("fold","xml",function(l,n){for(var o=new C(l,n.line,0);;){var u=p(o);if(!u||o.line!=n.line)return;var w=r(o);if(!w)return;if(!u[1]&&w!="selfClose"){var v=m(o.line,o.ch),i=E(o,u[2]);return i&&S(i.from,v)>0?{from:v,to:i.from}:null}}}),P.findMatchingTag=function(l,n,o){var u=new C(l,n.line,n.ch,o);if(u.text.indexOf(">")==-1&&u.text.indexOf("<")==-1)return;var w=r(u),v=w&&m(u.line,u.ch),i=w&&f(u);if(!w||!i||S(u,n)>0)return;var D={from:m(u.line,u.ch),to:v,tag:i[2]};return w=="selfClose"?{open:D,close:null,at:"open"}:i[1]?{open:y(u,i[2]),close:D,at:"close"}:(u=new C(l,v.line,v.ch,o),{open:D,close:E(u,i[2]),at:"open"})},P.findEnclosingTag=function(l,n,o,u){for(var w=new C(l,n.line,n.ch,o);;){var v=y(w,u);if(!v)break;var i=new C(l,n.line,n.ch,o),D=E(i,v.tag);if(D)return{open:v,close:D}}},P.scanForClosingTag=function(l,n,o,u){var w=new C(l,n.line,n.ch,u?{from:0,to:u}:null);return E(w,o)}})},p5ED:function(I,q,N){"use strict";var P=N("+L6B"),m=N("2/Rp"),S=N("5Dmo"),R=N("3S7+"),T=N("k1fw"),g=N("tJVT"),C=N("q1tI"),h=N.n(C),s=N("vHTk"),a=N.n(s),r=N("yEEn"),f=N("ZW9T"),p=N("1vsH");q.a=function(d){var E=d.name,y=d.data,l=d.theme,n=d.type,o=d.filename,u=d.monacoEditor,w=d.className,v=d.style,i=d.close,D=d.onClose,k=d.hasMask,c=Object(C.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),b=Object(g.a)(c,2),x=b[0],_=b[1],j=Object(C.useState)(""),F=Object(g.a)(j,2),L=F[0],X=F[1],z,H=1024*1024,G=10*H,U=Object(C.useRef)();n==="office"&&(z=Object(p.T)(y).filesize,z>G&&(n="other")),o&&(u.filename=o),Object(C.useEffect)(function(){var te,de,fe=(te=document.cookie)===null||te===void 0||((de=te.replace(/\s/g,""))===null||de===void 0)?void 0:de.split(";");fe==null||fe.map(function(be){var Ce=be.split("=");Ce[0]==="_educoder_session"&&X(Ce[1])})},[]);var B=function(){if(y.startsWith("http")||y.startsWith("/")){W();return}Object(p.z)(o||"educoder",y,o)},W=function(){Object(p.x)(o||E,y)};return console.log("data:",y,"fileanme:",o," name:",E),h.a.createElement("div",{style:Object(T.a)({},v||{}),className:"".concat(k&&a.a.bgBlack," ").concat(n?a.a.wrp:"hide")},i&&h.a.createElement("div",{className:a.a.close,ref:U},h.a.createElement(R.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},h.a.createElement("span",{onClick:W},h.a.createElement("i",{className:"icon-quxiaozhiding"}))),h.a.createElement(R.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},h.a.createElement("span",{className:"",onClick:D},h.a.createElement("i",{className:"icon-guanbi1"})))),h.a.createElement("div",{className:"".concat(a.a[w]," ").concat(w," ").concat(a.a.monaco," ").concat(n==="txt"?"show":"hide")},n==="txt"&&h.a.createElement(f.b,u)),n==="audio"&&h.a.createElement("audio",{src:"".concat(y!=null&&y.startsWith("/")||(y==null?void 0:y.indexOf("https://"))>-1?y:"data:audio/mp3;base64,").concat(y),autoPlay:!0}),n==="video"&&h.a.createElement(h.a.Fragment,null,y!=null&&y.startsWith("/")?h.a.createElement("video",{controls:!0,src:"".concat(y),autoPlay:!0}):h.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(y),autoPlay:!0})),n==="html"&&h.a.createElement("iframe",{src:y+"&disposition=inline"}),n==="pdf"&&h.a.createElement("embed",{className:a.a.embed,src:y}),n==="image"&&h.a.createElement(h.a.Fragment,null,h.a.createElement("img",{src:"".concat(y!=null&&y.startsWith("/")||(y==null?void 0:y.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(y)})),n==="other"&&h.a.createElement("div",null,h.a.createElement(m.a,{type:"primary",size:"large",onClick:B},h.a.createElement(r.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(n==="download"||n==="office")&&h.a.createElement(m.a,{type:"primary",size:"large",onClick:B},h.a.createElement(r.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(I,q,N){},pA7S:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=S.BlockCipher,g=m.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],h=[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],s=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],a=[{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],f=g.DES=T.extend({_doReset:function(){for(var y=this._key,l=y.words,n=[],o=0;o<56;o++){var u=C[o]-1;n[o]=l[u>>>5]>>>31-u%32&1}for(var w=this._subKeys=[],v=0;v<16;v++){for(var i=w[v]=[],D=s[v],o=0;o<24;o++)i[o/6|0]|=n[(h[o]-1+D)%28]<<31-o%6,i[4+(o/6|0)]|=n[28+(h[o+24]-1+D)%28]<<31-o%6;i[0]=i[0]<<1|i[0]>>>31;for(var o=1;o<7;o++)i[o]=i[o]>>>(o-1)*4+3;i[7]=i[7]<<5|i[7]>>>27}for(var k=this._invSubKeys=[],o=0;o<16;o++)k[o]=w[15-o]},encryptBlock:function(y,l){this._doCryptBlock(y,l,this._subKeys)},decryptBlock:function(y,l){this._doCryptBlock(y,l,this._invSubKeys)},_doCryptBlock:function(y,l,n){this._lBlock=y[l],this._rBlock=y[l+1],p.call(this,4,252645135),p.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),p.call(this,1,1431655765);for(var o=0;o<16;o++){for(var u=n[o],w=this._lBlock,v=this._rBlock,i=0,D=0;D<8;D++)i|=a[D][((v^u[D])&r[D])>>>0];this._lBlock=v,this._rBlock=w^i}var k=this._lBlock;this._lBlock=this._rBlock,this._rBlock=k,p.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),y[l]=this._lBlock,y[l+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function p(y,l){var n=(this._lBlock>>>y^this._rBlock)&l;this._rBlock^=n,this._lBlock^=n<>>y^this._lBlock)&l;this._lBlock^=n,this._rBlock^=n<192.");var n=l.slice(0,2),o=l.length<4?l.slice(0,2):l.slice(2,4),u=l.length<6?l.slice(0,2):l.slice(4,6);this._des1=f.createEncryptor(R.create(n)),this._des2=f.createEncryptor(R.create(o)),this._des3=f.createEncryptor(R.create(u))},encryptBlock:function(y,l){this._des1.encryptBlock(y,l),this._des2.decryptBlock(y,l),this._des3.encryptBlock(y,l)},decryptBlock:function(y,l){this._des3.decryptBlock(y,l),this._des2.encryptBlock(y,l),this._des1.decryptBlock(y,l)},keySize:192/32,ivSize:64/32,blockSize:64/32});m.TripleDES=T._createHelper(E)}(),P.TripleDES})},qBft:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){return P.pad.AnsiX923={pad:function(m,S){var R=m.sigBytes,T=S*4,g=T-R%T,C=R+g-1;m.clamp(),m.words[C>>>2]|=g<<24-C%4*8,m.sigBytes+=g},unpad:function(m){var S=m.words[m.sigBytes-1>>>2]&255;m.sigBytes-=S}},P.pad.Ansix923})},qM6L:function(I,q,N){(function(P,m){I.exports=q=m(N("Ib8C"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=m.enc,g=T.Utf16=T.Utf16BE={stringify:function(h){for(var s=h.words,a=h.sigBytes,r=[],f=0;f>>2]>>>16-f%4*8&65535;r.push(String.fromCharCode(p))}return r.join("")},parse:function(h){for(var s=h.length,a=[],r=0;r>>1]|=h.charCodeAt(r)<<16-r%2*16;return R.create(a,s*2)}};T.Utf16LE={stringify:function(h){for(var s=h.words,a=h.sigBytes,r=[],f=0;f>>2]>>>16-f%4*8&65535);r.push(String.fromCharCode(p))}return r.join("")},parse:function(h){for(var s=h.length,a=[],r=0;r>>1]|=C(h.charCodeAt(r)<<16-r%2*16);return R.create(a,s*2)}};function C(h){return h<<8&4278255360|h>>>8&16711935}}(),P.enc.Utf16})},qu8F:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){/** @preserve * Counter block mode compatible with Dr Brian Gladman fileenc.c * derived from CryptoJS.mode.CTR * Jan Hruby jhruby.web@gmail.com */return P.mode.CTRGladman=function(){var m=P.lib.BlockCipherMode.extend();function S(g){if((g>>24&255)===255){var C=g>>16&255,h=g>>8&255,s=g&255;C===255?(C=0,h===255?(h=0,s===255?s=0:++s):++h):++C,g=0,g+=C<<16,g+=h<<8,g+=s}else g+=1<<24;return g}function R(g){return(g[0]=S(g[0]))===0&&(g[1]=S(g[1])),g}var T=m.Encryptor=m.extend({processBlock:function(g,C){var h=this._cipher,s=h.blockSize,a=this._iv,r=this._counter;a&&(r=this._counter=a.slice(0),this._iv=void 0),R(r);var f=r.slice(0);h.encryptBlock(f,0);for(var p=0;p"']/,P=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,R={"&":"&","<":"<",">":">",'"':""","'":"'"},T=k=>R[k];function g(k,c){if(c){if(N.test(k))return k.replace(P,T)}else if(m.test(k))return k.replace(S,T);return k}const C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function h(k){return k.replace(C,(c,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const s=/(^|[^\[])\^/g;function a(k,c){k=k.source||k,c=c||"";const b={replace:(x,_)=>(_=_.source||_,_=_.replace(s,"$1"),k=k.replace(x,_),b),getRegex:()=>new RegExp(k,c)};return b}const r=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(k,c,b){if(k){let x;try{x=decodeURIComponent(h(b)).replace(r,"").toLowerCase()}catch(_){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}c&&!f.test(b)&&(b=n(c,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(x){return null}return b}const d={},E=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(k,c){d[" "+k]||(E.test(k)?d[" "+k]=k+"/":d[" "+k]=v(k,"/",!0)),k=d[" "+k];const b=k.indexOf(":")===-1;return c.substring(0,2)==="//"?b?c:k.replace(y,"$1")+c:c.charAt(0)==="/"?b?c:k.replace(l,"$1")+c:k+c}const o={exec:function(){}};function u(k){let c=1,b,x;for(;c{let X=!1,z=F;for(;--z>=0&&L[z]==="\\";)X=!X;return X?"|":" |"}),x=b.split(/ \|/);let _=0;if(x.length>c)x.splice(c);else for(;x.length=0;a--){var r=S().key(a);s(R(r),r)}}function C(s){return S().removeItem(s)}function h(){return S().clear()}},sboe:function(I,q,N){"use strict";N.d(q,"a",function(){return S});var P=N("q1tI"),m=N.n(P),S=P.createContext(null)},spXi:function(I,q,N){I.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},u2Z1:function(I,q,N){"use strict";N.d(q,"a",function(){return v});var P=N("miYZ"),m=N("tsqr"),S=N("9og8"),R=N("5NDa"),T=N("5rEg"),g=N("2qtc"),C=N("kLXV"),h=N("oBTY"),s=N("tJVT"),a=N("OaEy"),r=N("2fM7"),f=N("WmNS"),p=N.n(f),d=N("q1tI"),E=N.n(d),y=N("ErOA"),l=N("i58Z"),n=N.n(l),o=N("T1X5"),u=N.n(o),w=r.a.Option,v=function(D){var k=D.subId,c=D.value,b=D.selectvalues,x=D.disabled,_=D.knowledgeOptions,j=_===void 0?[]:_,F=D.onChange,L=F===void 0?function(){}:F,X=D.onAddKnowledgeFinish,z=X===void 0?function(){}:X,H=Object(d.useRef)(),G=Object(d.useState)([]),U=Object(s.a)(G,2),B=U[0],W=U[1];c=c||[];var te=function(be,Ce){be?(W([Ce.key]),L([Ce.key])):(W([]),L([]))};Object(d.useEffect)(function(){(b==null?void 0:b.length)>0&&(W(Object(h.a)(b)),L(Object(h.a)(b)))},[j]),Object(d.useEffect)(function(){var fe;((fe=c)===null||fe===void 0?void 0:fe.length)>0&&L(Object(h.a)(c))},[j]);var de=function(be){be.preventDefault(),H.current="",C.a.confirm({centered:!0,width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",className:"custom-modal-divider",content:E.a.createElement("div",{className:"font14"},E.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},E.a.createElement("img",{src:u.a,style:{width:"108px",height:"108px",marginRight:"29px"}}),"\u60A8\u586B\u5199\u7684\u77E5\u8BC6\u70B9\u6682\u65F6\u4EC5\u5BF9\u672C\u4EBA\u53EF\u89C1\uFF0C\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u540E\u5C06\u5217\u5165\u516C\u5F00\u77E5\u8BC6\u70B9\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF1B",E.a.createElement("br",null),"\u5E73\u53F0\u5BA1\u6838\u8FC7\u7A0B\u4E2D\u6709\u6743\u5220\u9664\u4E0D\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF08\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E\u9519\u8BEF\u3001\u975E\u6CD5\u3001\u4E0D\u96C5\u3001\u4E0D\u5339\u914D\u5F53\u524D\u8BFE\u7A0B\u7B49\u60C5\u5F62\uFF09\uFF0C\u5220\u9664\u540E\u53EF\u80FD\u5F71\u54CD\u60A8\u7684\u8BD5\u9898\u7684\u6B63\u5E38\u4F7F\u7528\u3002",E.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",E.a.createElement("br",null)),E.a.createElement(T.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:H.current,onChange:function(ue){H.current=ue.target.value}})),onOk:function(){return new Promise(function(){var ue=Object(S.a)(p.a.mark(function ge(pe,oe){var ae,re;return p.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(H.current){Q.next=3;break}return m.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),Q.abrupt("return",oe());case 3:if(!(H.current.length>20)){Q.next=6;break}return m.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),Q.abrupt("return",oe());case 6:return Q.next=8,Object(y.a)("/api/tag_disciplines.json",{method:"post",body:{name:H.current,sub_discipline_id:k}});case 8:return ae=Q.sent,(ae==null?void 0:ae.status)===0&&(z({id:ae.tag_discipline_id,name:H.current,type:"personal"}),re=[],re.push(ae.tag_discipline_id),L([].concat(re)),W([ae.tag_discipline_id]),L([].concat(re))),Q.abrupt("return",pe());case 11:case"end":return Q.stop()}},ge)}));return function(ge,pe){return ue.apply(this,arguments)}}())}})};return E.a.createElement("div",{className:n.a.wrap},E.a.createElement(r.a,{disabled:!k||x,className:"mr5",style:{width:"242px"},onChange:te,showSearch:!0,allowClear:!0,value:j==null?void 0:j.filter(function(fe){return(B==null?void 0:B.includes(fe==null?void 0:fe.id))||(B==null?void 0:B.includes((fe==null?void 0:fe.id)+""))}).map(function(fe){return fe.name})},j==null?void 0:j.map(function(fe){return E.a.createElement(w,{key:fe.id,value:fe.name},E.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},E.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},fe.name),E.a.createElement("span",null,fe.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),E.a.createElement("button",{disabled:!k,className:"".concat(n.a.addKnowledge," ").concat(k?"":n.a.disabled),onClick:de},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uGsb:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("MlIO"),N("1uat"))})(this,function(P){return function(){var m=P,S=m.x64,R=S.Word,T=S.WordArray,g=m.algo,C=g.SHA512,h=g.SHA384=C.extend({_doReset:function(){this._hash=new T.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 s=C._doFinalize.call(this);return s.sigBytes-=16,s}});m.SHA384=C._createHelper(h),m.HmacSHA384=C._createHmacHelper(h)}(),P.SHA384})},uGxW:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("OLod"))})(this,function(P){return P.pad.NoPadding={pad:function(){},unpad:function(){}},P.pad.NoPadding})},uK0f:function(I,q,N){(function(P,m){I.exports=m()})(this,function(){"use strict";function P(m,S,R){R=R||{},R.childrenKeyName=R.childrenKeyName||"children";var T=m||[],g=[],C=0;do{var h=T.filter(function(s){return S(s,C)})[0];if(!h)break;g.push(h),T=h[R.childrenKeyName]||[],C+=1}while(T.length>0);return g}return P})},uMZB:function(I,q,N){I.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(I,q,N){I.exports=P;function P(){return N("gaXo"),{}}},ulZh:function(I,q,N){typeof window!="undefined"&&function(m,S){I.exports=S()}(this,function(){return function(P){var m={};function S(R){if(m[R])return m[R].exports;var T=m[R]={i:R,l:!1,exports:{}};return P[R].call(T.exports,T,T.exports,S),T.l=!0,T.exports}return S.m=P,S.c=m,S.d=function(R,T,g){S.o(R,T)||Object.defineProperty(R,T,{enumerable:!0,get:g})},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,T){if(T&1&&(R=S(R)),T&8)return R;if(T&4&&typeof R=="object"&&R&&R.__esModule)return R;var g=Object.create(null);if(S.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:R}),T&2&&typeof R!="string")for(var C in R)S.d(g,C,function(h){return R[h]}.bind(null,C));return g},S.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return S.d(T,"a",T),T},S.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)},S.p="/dist/",S(S.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(P,m,S){"use strict";var R=Object.prototype.hasOwnProperty,T="~";function g(){}Object.create&&(g.prototype=Object.create(null),new g().__proto__||(T=!1));function C(r,f,p){this.fn=r,this.context=f,this.once=p||!1}function h(r,f,p,d,E){if(typeof p!="function")throw new TypeError("The listener must be a function");var y=new C(p,d||r,E),l=T?T+f:f;return r._events[l]?r._events[l].fn?r._events[l]=[r._events[l],y]:r._events[l].push(y):(r._events[l]=y,r._eventsCount++),r}function s(r,f){--r._eventsCount===0?r._events=new g:delete r._events[f]}function a(){this._events=new g,this._eventsCount=0}a.prototype.eventNames=function(){var f=[],p,d;if(this._eventsCount===0)return f;for(d in p=this._events)R.call(p,d)&&f.push(T?d.slice(1):d);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},a.prototype.listeners=function(f){var p=T?T+f:f,d=this._events[p];if(!d)return[];if(d.fn)return[d.fn];for(var E=0,y=d.length,l=new Array(y);E0},!1)}function r(f,p){for(var d={main:[p]},E={main:[]},y={main:{}};a(d);)for(var l=Object.keys(d),n=0;n=2*D/c||L<=z)return;var H=Number.POSITIVE_INFINITY,G;for(G=l.level-1;G>x;G--){var U=b[G].maxBitrate;if(H=D*U/(8*.8*F),H=L)return;var B=this.bwEstimator.getEstimate();a.logger.warn("Fragment "+l.sn+(n?" part "+n.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+` Current BW estimate: `+(Object(R.isFiniteNumber)(B)?(B/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+L.toFixed(3)+` s Estimated load time for the next fragment: `+H.toFixed(3)+` s Time to underbuffer: `+z.toFixed(3)+" s"),o.nextLoadLevel=G,this.bwEstimator.sample(k,i.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),o.trigger(g.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:n,stats:i})},E.onFragLoaded=function(l,n){var o=n.frag,u=n.part;if(o.type===s.PlaylistLevelType.MAIN&&Object(R.isFiniteNumber)(o.sn)){var w=u?u.stats:o.stats,v=u?u.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var i=this.hls.levels[o.level],D=(i.loaded?i.loaded.bytes:0)+w.loaded,k=(i.loaded?i.loaded.duration:0)+v;i.loaded={bytes:D,duration:k},i.realBitrate=Math.round(8*D/k)}if(o.bitrateTest){var c={stats:w,frag:o,part:u,id:o.type};this.onFragBuffered(g.Events.FRAG_BUFFERED,c),o.bitrateTest=!1}}},E.onFragBuffered=function(l,n){var o=n.frag,u=n.part,w=u?u.stats:o.stats;if(w.aborted)return;if(o.type!==s.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var v=w.parsing.end-w.loading.start;this.bwEstimator.sample(v,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},E.onError=function(l,n){switch(n.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},E.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},E.getNextABRAutoLevel=function(){var l=this.fragCurrent,n=this.partCurrent,o=this.hls,u=o.maxAutoLevel,w=o.config,v=o.minAutoLevel,i=o.media,D=n?n.duration:l?l.duration:0,k=i?i.currentTime:0,c=i&&i.playbackRate!==0?Math.abs(i.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,x=(C.BufferHelper.bufferInfo(i,k,w.maxBufferHole).end-k)/c,_=this.findBestLevel(b,v,u,x,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(_>=0)return _;a.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var j=D?Math.min(D,w.maxStarvationDelay):w.maxStarvationDelay,F=w.abrBandWidthFactor,L=w.abrBandWidthUpFactor;if(!x){var X=this.bitrateTestDelay;if(X){var z=D?Math.min(D,w.maxLoadingDelay):w.maxLoadingDelay;j=z-X,a.logger.trace("bitrate test took "+Math.round(1e3*X)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*j)+" ms"),F=L=1}}return _=this.findBestLevel(b,v,u,x+j,F,L),Math.max(_,0)},E.findBestLevel=function(l,n,o,u,w,v){for(var i,D=this.fragCurrent,k=this.partCurrent,c=this.lastLoadedFragLevel,b=this.hls.levels,x=b[c],_=!!(x!=null&&(i=x.details)!==null&&i!==void 0&&i.live),j=x==null?void 0:x.codecSet,F=k?k.duration:D?D.duration:0,L=o;L>=n;L--){var X=b[L];if(!X||j&&X.codecSet!==j)continue;var z=X.details,H=(k?z==null?void 0:z.partTarget:z==null?void 0:z.averagetargetduration)||F,G=void 0;L<=c?G=w*l:G=v*l;var U=b[L].maxBitrate,B=U*H/G;if(a.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+L+"/"+Math.round(G)+"/"+U+"/"+H+"/"+u+"/"+B),G>U&&(!B||_&&!this.bitrateTestDelay||B0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),this.state=T.State.IDLE):(this.loadedmetadata=!1,this.state=T.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},c.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_TRACK:{var x,_=this.levels,j=this.trackId,F=_==null||((x=_[j])===null||x===void 0)?void 0:x.details;if(F){if(this.waitForCdnTuneIn(F))break;this.state=T.State.WAITING_INIT_PTS}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var L,X=performance.now(),z=this.retryDate;(!z||X>=z||(L=this.media)!==null&&L!==void 0&&L.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=T.State.IDLE);break}case T.State.WAITING_INIT_PTS:{var H=this.waitingData;if(H){var G=H.frag,U=H.part,B=H.cache,W=H.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.FRAG_LOADING;var te=B.flush(),de={frag:G,part:U,payload:te,networkDetails:null};this._handleFragmentLoadProgress(de),W&&D.prototype._handleFragmentLoadComplete.call(this,de)}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 fe=this.getLoadPosition(),be=C.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Ce=Object(E.fragmentWithinToleranceTest)(be.end,this.config.maxFragLookUpTolerance,G);Ce<0&&(n.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+be.end+" is needed"),this.clearWaitingFragment())}}else this.state=T.State.IDLE}}this.onTickEnd()},c.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.IDLE)},c.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var _=this.mediaBuffer?this.mediaBuffer:x,j=_.buffered;!this.loadedmetadata&&j.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},c.doTickIdle=function(){var x,_,j=this.hls,F=this.levels,L=this.media,X=this.trackId,z=j.config;if(!F||!F[X])return;if(!L&&(this.startFragRequested||!z.startFragPrefetch))return;var H=F[X],G=H.details;if(!G||G.live&&this.levelLastLoaded!==X||this.waitForCdnTuneIn(G)){this.state=T.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,r.ElementaryStreamTypes.AUDIO,a.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,a.PlaylistLevelType.AUDIO);if(U===null)return;var B=U.len,W=this.getMaxBufferLength(),te=this.audioSwitch;if(B>=W&&!te)return;if(!te&&this._streamEnded(U,G)){j.trigger(g.Events.BUFFER_EOS,{type:"audio"}),this.state=T.State.ENDED;return}var de=G.fragments,fe=de[0].start,be=U.end;if(te){var Ce=this.getLoadPosition();be=Ce,G.PTSKnown&&Cefe||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),L.currentTime=fe+.05))}var ue=this.getNextFragment(be,G);if(!ue){this.bufferFlushed=!0;return}((x=ue.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((_=ue.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(ue,G):this.loadFragment(ue,G,be)},c.getMaxBufferLength=function(){var x=D.prototype.getMaxBufferLength.call(this),_=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,a.PlaylistLevelType.MAIN);return _===null?x:Math.max(x,_.len)},c.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},c.onAudioTracksUpdated=function(x,_){var j=_.audioTracks;this.resetTransmuxer(),this.levels=j.map(function(F){return new s.Level(F)})},c.onAudioTrackSwitching=function(x,_){var j=!!_.url;this.trackId=_.id;var F=this.fragCurrent;F!=null&&F.loader&&F.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),j?this.setInterval(v):this.resetTransmuxer(),j?(this.audioSwitch=!0,this.state=T.State.IDLE):this.state=T.State.STOPPED,this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},c.onLevelLoaded=function(x,_){this.mainDetails=_.details},c.onAudioTrackLoaded=function(x,_){var j,F=this.levels,L=_.details,X=_.id;if(!F){this.warn("Audio tracks were reset while loading level "+X);return}this.log("Track "+X+" loaded ["+L.startSN+","+L.endSN+"],duration:"+L.totalduration);var z=F[X],H=0;if(L.live||(j=z.details)!==null&&j!==void 0&&j.live){var G=this.mainDetails;if(L.fragments[0]||(L.deltaUpdateFailed=!0),L.deltaUpdateFailed||!G)return;!z.details&&L.hasProgramDateTime&&G.hasProgramDateTime?(Object(y.alignMediaPlaylistByPDT)(L,G),H=L.fragments[0].start):H=this.alignPlaylists(L,z.details)}z.details=L,this.levelLastLoaded=X,!this.startFragRequested&&(this.mainDetails||!L.live)&&this.setStartPosition(z.details,H),this.state===T.State.WAITING_TRACK&&!this.waitForCdnTuneIn(L)&&(this.state=T.State.IDLE),this.tick()},c._handleFragmentLoadProgress=function(x){var _,j=x.frag,F=x.part,L=x.payload,X=this.config,z=this.trackId,H=this.levels;if(!H){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+j.sn+" of level "+j.level+" will not be buffered");return}var G=H[z];console.assert(G,"Audio track is defined on fragment load progress");var U=G.details;console.assert(U,"Audio track details are defined on fragment load progress");var B=X.defaultAudioCodec||G.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new p.default(this.hls,a.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[j.cc],de=(_=j.initSegment)===null||_===void 0?void 0:_.data;if(te!==void 0){var fe=!1,be=F?F.index:-1,Ce=be!==-1,ue=new d.ChunkMetadata(j.level,j.sn,j.stats.chunkCount,L.byteLength,be,Ce);W.push(L,de,B,"",j,F,U.totalduration,fe,ue,te)}else{n.logger.log("Unknown video PTS for cc "+j.cc+", waiting for video PTS before demuxing audio frag "+j.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+z);var ge=this.waitingData=this.waitingData||{frag:j,part:F,cache:new f.default,complete:!1},pe=ge.cache;pe.push(new Uint8Array(L)),this.waitingVideoCC=this.videoTrackCC,this.state=T.State.WAITING_INIT_PTS}},c._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,x)},c.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},c.onBufferCreated=function(x,_){var j=_.tracks.audio;j&&(this.mediaBuffer=j.buffer),_.tracks.video&&(this.videoBuffer=_.tracks.video.buffer)},c.onFragBuffered=function(x,_){var j=_.frag,F=_.part;if(j.type!==a.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(j)){this.warn("Fragment "+j.sn+(F?" p: "+F.index:"")+" of level "+j.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}j.sn!=="initSegment"&&(this.fragPrevious=j,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(g.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(j,F)},c.onError=function(x,_){switch(_.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(a.PlaylistLevelType.AUDIO,_);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==T.State.ERROR&&this.state!==T.State.STOPPED&&(this.state=_.fatal?T.State.ERROR:T.State.IDLE,this.warn(_.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="audio"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var j=!0,F=this.getFwdBufferInfo(this.mediaBuffer,a.PlaylistLevelType.AUDIO);F&&F.len>.5&&(j=!this.reduceMaxBufferLength(F.len)),j&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},c.onBufferFlushed=function(x,_){var j=_.type;j===r.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},c._handleTransmuxComplete=function(x){var _,j="audio",F=this.hls,L=x.remuxResult,X=x.chunkMeta,z=this.getCurrentContext(X);if(!z){this.warn("The loading context changed while buffering fragment "+X.sn+" of level "+X.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(X.level);return}var H=z.frag,G=z.part,U=L.audio,B=L.text,W=L.id3,te=L.initSegment;if(this.fragContextChanged(H))return;if(this.state=T.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,H,X),F.trigger(g.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:j,tracks:te.tracks})),U){var de=U.startPTS,fe=U.endPTS,be=U.startDTS,Ce=U.endDTS;G&&(G.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:fe,startDTS:be,endDTS:Ce}),H.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,de,fe,be,Ce),this.bufferFragmentData(U,H,G,X)}if(W!=null&&(_=W.samples)!==null&&_!==void 0&&_.length){var ue=o({frag:H,id:j},W);F.trigger(g.Events.FRAG_PARSING_METADATA,ue)}if(B){var ge=o({frag:H,id:j},B);F.trigger(g.Events.FRAG_PARSING_USERDATA,ge)}},c._bufferInitSegment=function(x,_,j){if(this.state!==T.State.PARSING)return;x.video&&delete x.video;var F=x.audio;if(!F)return;F.levelCodec=F.codec,F.id="audio",this.log("Init audio buffer, container:"+F.container+", codecs[parsed]=["+F.codec+"]"),this.hls.trigger(g.Events.BUFFER_CODECS,x);var L=F.initSegment;if(L!=null&&L.byteLength){var X={type:"audio",frag:_,part:null,chunkMeta:j,parent:_.type,data:L};this.hls.trigger(g.Events.BUFFER_APPENDING,X)}this.tick()},c.loadFragment=function(x,_,j){var F=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||F===h.FragmentState.NOT_LOADED||F===h.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):_.live&&!Object(R.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=T.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,x,_,j)))},c.completeAudioSwitch=function(){var x=this.hls,_=this.media,j=this.trackId;_&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(g.Events.AUDIO_TRACK_SWITCHED,{id:j})},k}(T.default);m.default=i},"./src/controller/audio-track-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts"),T=S("./src/errors.ts"),g=S("./src/controller/base-playlist-controller.ts"),C=S("./src/types/loader.ts");function h(p,d){for(var E=0;E=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=n[this.trackId];this.log("Now switching to audio-track index "+l);var u=n[l],w=u.id,v=u.groupId,i=v===void 0?"":v,D=u.name,k=u.type,c=u.url;if(this.trackId=l,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:i,name:D,type:k,url:c}),u.details&&!u.details.live)return;var b=this.switchParams(u.url,o==null?void 0:o.details);this.loadPlaylist(b)},E.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,o=this.findTrackId(n)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},E.findTrackId=function(l){for(var n=this.tracksInGroup,o=0;od.partTarget&&(u+=1)}if(Object(R.isFiniteNumber)(o))return new T.HlsUrlParameters(o,Object(R.isFiniteNumber)(u)?u:void 0,T.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,d,E){var y=this,l=d.details,n=d.stats,o=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(l.advancedDateTime=Date.now()-o,l.live||E!=null&&E.live){if(l.reloaded(E),E&&this.log("live playlist "+p+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),E&&l.fragments.length>0&&Object(g.mergeDetails)(E,l),!this.canLoad||!l.live)return;var u,w=void 0,v=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var i=this.hls.config.lowLatencyMode,D=l.lastPartSn,k=l.endSN,c=l.lastPartIndex,b=c!==-1,x=D===k,_=i?0:c;b?(w=x?k+1:D,v=x?_:c+1):w=k+1;var j=l.age,F=j+l.ageHeader,L=Math.min(F-l.partTarget,l.targetduration*1.5);if(L>0){if(E&&L>E.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+E.tuneInGoal+" to: "+L+" with playlist age: "+l.age),L=0;else{var X=Math.floor(L/l.targetduration);if(w+=X,v!==void 0){var z=Math.round(L%l.targetduration/l.partTarget);v+=z}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+j.toFixed(2)+"s goal: "+L+" skip sn "+X+" to part "+v)}l.tuneInGoal=L}if(u=this.getDeliveryDirectives(l,d.deliveryDirectives,w,v),i||!x){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(l,d.deliveryDirectives,w,v);var H=Object(g.computeReloadInterval)(l,n);w!==void 0&&l.canBlockReload&&(H-=l.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return y.loadPlaylist(u)},H)}else this.clearTimer()},r.getDeliveryDirectives=function(p,d,E,y){var l=Object(T.getSkipValue)(p,E);return d!=null&&d.skip&&p.deltaUpdateFailed&&(E=d.msn,y=d.part,l=T.HlsSkip.No),new T.HlsUrlParameters(E,y,l)},r.retryLoadingOrFail=function(p){var d=this,E=this.hls.config,y=this.retryCount-1&&(l=p.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*E.levelLoadingRetryDelay,E.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.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 y},a}()},"./src/controller/base-stream-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"State",function(){return k}),S.d(m,"default",function(){return c});var R=S("./src/polyfills/number.ts"),T=S("./src/task-loop.ts"),g=S("./src/controller/fragment-tracker.ts"),C=S("./src/utils/buffer-helper.ts"),h=S("./src/utils/logger.ts"),s=S("./src/events.ts"),a=S("./src/errors.ts"),r=S("./src/types/transmuxer.ts"),f=S("./src/utils/mp4-tools.ts"),p=S("./src/utils/discontinuities.ts"),d=S("./src/controller/fragment-finders.ts"),E=S("./src/controller/level-helper.ts"),y=S("./src/loader/fragment-loader.ts"),l=S("./src/crypt/decrypter.ts"),n=S("./src/utils/time-ranges.ts"),o=S("./src/types/loader.ts");function u(b,x){for(var _=0;_te;(G0&&G&&G.key&&G.iv&&G.method==="AES-128"){var U=self.performance.now();return L.decrypter.webCryptoDecrypt(new Uint8Array(H),G.key.buffer,G.iv.buffer).then(function(B){var W=self.performance.now();return z.trigger(s.Events.FRAG_DECRYPTED,{frag:F,payload:B,stats:{tstart:U,tdecrypt:W}}),X.payload=B,X})}return X}).then(function(X){var z=L.fragCurrent,H=L.hls,G=L.levels;if(!G)throw new Error("init load aborted, missing levels");var U=G[F.level].details;console.assert(U,"Level details are defined when init segment is loaded");var B=F.stats;L.state=k.IDLE,L.fragLoadError=0,F.data=new Uint8Array(X.payload),B.parsing.start=B.buffering.start=self.performance.now(),B.parsing.end=B.buffering.end=self.performance.now(),X.frag===z&&H.trigger(s.Events.FRAG_BUFFERED,{stats:B,frag:z,part:null,id:F.type}),L.tick()}).catch(function(X){L.warn(X),L.resetFragmentLoading(F)})},_.fragContextChanged=function(F){var L=this.fragCurrent;return!F||!L||F.level!==L.level||F.sn!==L.sn||F.urlId!==L.urlId},_.fragBufferedComplete=function(F,L){var X=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+F.type+" sn: "+F.sn+(L?" part: "+L.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+F.level+" "+n.default.toString(C.BufferHelper.getBuffered(X))),this.state=k.IDLE,this.tick()},_._handleFragmentLoadComplete=function(F){var L=this.transmuxer;if(!L)return;var X=F.frag,z=F.part,H=F.partsLoaded,G=!H||H.length===0||H.some(function(B){return!B}),U=new r.ChunkMetadata(X.level,X.sn,X.stats.chunkCount+1,0,z?z.index:-1,!G);L.flush(U)},_._handleFragmentLoadProgress=function(F){},_._doFragLoad=function(F,L,X,z){var H=this;if(X===void 0&&(X=null),!this.levels)throw new Error("frag load aborted, missing levels");if(X=Math.max(F.start,X||0),this.config.lowLatencyMode&&L){var G=L.partList;if(G&&z){X>F.end&&L.fragmentHint&&(F=L.fragmentHint);var U=this.getNextPart(G,F,X);if(U>-1){var B=G[U];return this.log("Loading part sn: "+F.sn+" p: "+B.index+" cc: "+F.cc+" of playlist ["+L.startSN+"-"+L.endSN+"] parts [0-"+U+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+F.level+", target: "+parseFloat(X.toFixed(3))),this.nextLoadPosition=B.start+B.duration,this.state=k.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:F,part:G[U],targetBufferTime:X}),this.doFragPartsLoad(F,G,U,z).catch(function(W){return H.handleFragLoadError(W)})}else if(!F.url||this.loadedEndOfParts(G,X))return Promise.resolve(null)}}return this.log("Loading fragment "+F.sn+" cc: "+F.cc+" "+(L?"of ["+L.startSN+"-"+L.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+F.level+", target: "+parseFloat(X.toFixed(3))),Object(R.isFiniteNumber)(F.sn)&&!this.bitrateTest&&(this.nextLoadPosition=F.start+F.duration),this.state=k.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:F,targetBufferTime:X}),this.fragmentLoader.load(F,z).catch(function(W){return H.handleFragLoadError(W)})},_.doFragPartsLoad=function(F,L,X,z){var H=this;return new Promise(function(G,U){var B=[],W=function te(de){var fe=L[de];H.fragmentLoader.loadPart(F,fe,z).then(function(be){B[fe.index]=be;var Ce=be.part;H.hls.trigger(s.Events.FRAG_LOADED,be);var ue=L[de+1];if(ue&&ue.fragment===F)te(de+1);else return G({frag:F,part:Ce,partsLoaded:B})}).catch(U)};W(X)})},_.handleFragLoadError=function(F){var L=F.data;return L&&L.details===a.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(L.frag,L.part):this.hls.trigger(s.Events.ERROR,L),null},_._handleTransmuxerFlush=function(F){var L=this.getCurrentContext(F);if(!L||this.state!==k.PARSING){this.fragCurrent||(this.state=k.IDLE);return}var X=L.frag,z=L.part,H=L.level,G=self.performance.now();X.stats.parsing.end=G,z&&(z.stats.parsing.end=G),this.updateLevelTiming(X,z,H,F.partial)},_.getCurrentContext=function(F){var L=this.levels,X=F.level,z=F.sn,H=F.part;if(!L||!L[X])return this.warn("Levels object was unset while buffering fragment "+z+" of level "+X+". The current chunk will not be buffered."),null;var G=L[X],U=H>-1?Object(E.getPartWith)(G,z,H):null,B=U?U.fragment:Object(E.getFragmentWithSN)(G,z,this.fragCurrent);return B?{frag:B,part:U,level:G}:null},_.bufferFragmentData=function(F,L,X,z){if(!F||this.state!==k.PARSING)return;var H=F.data1,G=F.data2,U=H;if(H&&G&&(U=Object(f.appendUint8Array)(H,G)),!U||!U.length)return;var B={type:F.type,frag:L,part:X,chunkMeta:z,parent:L.type,data:U};this.hls.trigger(s.Events.BUFFER_APPENDING,B),F.dropped&&F.independent&&!X&&this.flushBufferGap(L)},_.flushBufferGap=function(F){var L=this.media;if(!L)return;if(!C.BufferHelper.isBuffered(L,L.currentTime)){this.flushMainBuffer(0,F.start);return}var X=L.currentTime,z=C.BufferHelper.bufferInfo(L,X,0),H=F.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,H*.25),U=Math.max(Math.min(F.start-G,z.end-G),X+G);F.start-U>G&&this.flushMainBuffer(U,F.start)},_.getFwdBufferInfo=function(F,L){var X=this.config,z=this.getLoadPosition();if(!Object(R.isFiniteNumber)(z))return null;var H=C.BufferHelper.bufferInfo(F,z,X.maxBufferHole);if(H.len===0&&H.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(z,L);if(G&&H.nextStart=X?(L.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+L.maxMaxBufferLength+"s"),!0):!1},_.getNextFragment=function(F,L){var X,z,H=L.fragments,G=H.length;if(!G)return null;var U=this.config,B=H[0].start,W;if(L.live){var te=U.initialLiveManifestSize;if(G-1&&XX.start&&X.loaded},_.getInitialLiveFragment=function(F,L){var X=this.fragPrevious,z=null;if(X){if(F.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+X.programDateTime),z=Object(d.findFragmentByPDT)(L,X.endProgramDateTime,this.config.maxFragLookUpTolerance)),!z){var H=X.sn+1;if(H>=F.startSN&&H<=F.endSN){var G=L[H-F.startSN];X.cc===G.cc&&(z=G,this.log("Live playlist, switching playlist, load frag with next SN: "+z.sn))}z||(z=Object(d.findFragWithCC)(L,X.cc),z&&this.log("Live playlist, switching playlist, load frag with same CC: "+z.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(z=this.getFragmentAtPosition(U,this.bitrateTest?F.fragmentEnd:F.edge,F))}return z},_.getFragmentAtPosition=function(F,L,X){var z=this.config,H=this.fragPrevious,G=X.fragments,U=X.endSN,B=X.fragmentHint,W=z.maxFragLookUpTolerance,te=!!(z.lowLatencyMode&&X.partList&&B);te&&B&&!this.bitrateTest&&(G=G.concat(B),U=B.sn);var de;if(FL-W?0:W;de=Object(d.findFragmentByPTS)(H,G,F,fe)}else de=G[G.length-1];if(de){var be=de.sn-X.startSN,Ce=H&&de.level===H.level,ue=G[be+1],ge=this.fragmentTracker.getState(de);if(ge===g.FragmentState.BACKTRACKED){de=null;for(var pe=be;G[pe]&&this.fragmentTracker.getState(G[pe])===g.FragmentState.BACKTRACKED;)H?de=G[pe--]:de=G[--pe];de||(de=ue)}else H&&de.sn===H.sn&&!te&&(Ce&&(de.sn=G-L.maxFragLookUpTolerance&&H<=U;if(z!==null&&X.duration>z&&(H"+F.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+U),de}return B},_.waitForCdnTuneIn=function(F){var L=3;return F.live&&F.canBlockReload&&F.tuneInGoal>Math.max(F.partHoldBack,F.partTarget*L)},_.setStartPosition=function(F,L){var X=this.startPosition;if(X"+F))}}]),x}(T.default)},"./src/controller/buffer-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return d});var R=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),g=S("./src/utils/logger.ts"),C=S("./src/errors.ts"),h=S("./src/utils/buffer-helper.ts"),s=S("./src/utils/mediasource-helper.ts"),a=S("./src/loader/fragment.ts"),r=S("./src/controller/buffer-operation-queue.ts"),f=Object(s.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function E(l){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 o=n.hls,u=n.media,w=n.mediaSource;g.logger.log("[buffer-controller]: Media source opened"),u&&(n.updateMediaElementDuration(),o.trigger(T.Events.MEDIA_ATTACHED,{media:u})),w&&w.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){g.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){g.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var y=E.prototype;return y.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},y.destroy=function(){this.unregisterListeners(),this.details=null},y.registerListeners=function(){var n=this.hls;n.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(T.Events.BUFFER_RESET,this.onBufferReset,this),n.on(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(T.Events.BUFFER_EOS,this.onBufferEos,this),n.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(T.Events.FRAG_PARSED,this.onFragParsed,this),n.on(T.Events.FRAG_CHANGED,this.onFragChanged,this)},y.unregisterListeners=function(){var n=this.hls;n.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(T.Events.BUFFER_RESET,this.onBufferReset,this),n.off(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(T.Events.BUFFER_EOS,this.onBufferEos,this),n.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(T.Events.FRAG_PARSED,this.onFragParsed,this),n.off(T.Events.FRAG_CHANGED,this.onFragChanged,this)},y._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new r.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},y.onManifestParsed=function(n,o){var u=2;(o.audio&&!o.video||!o.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.details=null,g.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},y.onMediaAttaching=function(n,o){var u=this.media=o.media;if(u&&f){var w=this.mediaSource=new f;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),u.src=self.URL.createObjectURL(w),this._objectUrl=u.src}},y.onMediaDetaching=function(){var n=this.media,o=this.mediaSource,u=this._objectUrl;if(o){if(g.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(w){g.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(u&&self.URL.revokeObjectURL(u),n.src===u?(n.removeAttribute("src"),n.load()):g.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(T.Events.MEDIA_DETACHED,void 0)},y.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(o){var u=n.sourceBuffer[o];try{u&&(n.removeBufferListeners(o),n.mediaSource&&n.mediaSource.removeSourceBuffer(u),n.sourceBuffer[o]=void 0)}catch(w){g.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",w)}}),this._initSourceBuffer()},y.onBufferCodecs=function(n,o){var u=this,w=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(v){if(w){var i=u.tracks[v];if(i&&typeof i.buffer.changeType=="function"){var D=o[v],k=D.codec,c=D.levelCodec,b=D.container,x=(i.levelCodec||i.codec).replace(p,"$1"),_=(c||k).replace(p,"$1");if(x!==_){var j=b+";codecs="+(c||k);u.appendChangeType(v,j)}}}else u.pendingTracks[v]=o[v]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},y.appendChangeType=function(n,o){var u=this,w=this.operationQueue,v={execute:function(){var D=u.sourceBuffer[n];D&&(g.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+o),D.changeType(o)),w.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(D){g.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",D)}};w.append(v,n)},y.onBufferAppending=function(n,o){var u=this,w=this.hls,v=this.operationQueue,i=this.tracks,D=o.data,k=o.type,c=o.frag,b=o.part,x=o.chunkMeta,_=x.buffering[k],j=self.performance.now();_.start=j;var F=c.stats.buffering,L=b?b.stats.buffering:null;F.start===0&&(F.start=j),L&&L.start===0&&(L.start=j);var X=i.audio,z=k==="audio"&&x.id===1&&(X==null?void 0:X.container)==="audio/mpeg",H={execute:function(){if(_.executeStart=self.performance.now(),z){var U=u.sourceBuffer[k];if(U){var B=c.start-U.timestampOffset;Math.abs(B)>=.1&&(g.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+c.start+" (delta: "+B+") sn: "+c.sn+")"),U.timestampOffset=c.start)}}u.appendExecutor(D,k)},onStart:function(){},onComplete:function(){var U=self.performance.now();_.executeEnd=_.end=U,F.first===0&&(F.first=U),L&&L.first===0&&(L.first=U);var B=u.sourceBuffer,W={};for(var te in B)W[te]=h.BufferHelper.getBuffered(B[te]);u.appendError=0,u.hls.trigger(T.Events.BUFFER_APPENDED,{type:k,frag:c,part:b,chunkMeta:x,parent:c.type,timeRanges:W})},onError:function(U){g.logger.error("[buffer-controller]: Error encountered while trying to append to the "+k+" SourceBuffer",U);var B={type:C.ErrorTypes.MEDIA_ERROR,parent:c.type,details:C.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?B.details=C.ErrorDetails.BUFFER_FULL_ERROR:(u.appendError++,B.details=C.ErrorDetails.BUFFER_APPEND_ERROR,u.appendError>w.config.appendErrorMaxRetry&&(g.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),B.fatal=!0)),w.trigger(T.Events.ERROR,B)}};v.append(H,k)},y.onBufferFlushing=function(n,o){var u=this,w=this.operationQueue,v=function(D){return{execute:u.removeExecutor.bind(u,D,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){u.hls.trigger(T.Events.BUFFER_FLUSHED,{type:D})},onError:function(c){g.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",c)}}};o.type?w.append(v(o.type),o.type):this.getSourceBufferTypes().forEach(function(i){w.append(v(i),i)})},y.onFragParsed=function(n,o){var u=this,w=o.frag,v=o.part,i=[],D=v?v.elementaryStreams:w.elementaryStreams;D[a.ElementaryStreamTypes.AUDIOVIDEO]?i.push("audiovideo"):(D[a.ElementaryStreamTypes.AUDIO]&&i.push("audio"),D[a.ElementaryStreamTypes.VIDEO]&&i.push("video"));var k=function(){var b=self.performance.now();w.stats.buffering.end=b,v&&(v.stats.buffering.end=b);var x=v?v.stats:w.stats;u.hls.trigger(T.Events.FRAG_BUFFERED,{frag:w,part:v,stats:x,id:w.type})};i.length===0&&g.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(k,i)},y.onFragChanged=function(n,o){this.flushBackBuffer()},y.onBufferEos=function(n,o){var u=this,w=this.getSourceBufferTypes().reduce(function(v,i){var D=u.sourceBuffer[i];return(!o.type||o.type===i)&&(D&&!D.ended&&(D.ended=!0,g.logger.log("[buffer-controller]: "+i+" sourceBuffer now EOS"))),v&&!!(!D||D.ended)},!0);w&&this.blockBuffers(function(){var v=u.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},y.onLevelUpdated=function(n,o){var u=o.details;if(!u.fragments.length)return;this.details=u,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},y.flushBackBuffer=function(){var n=this.hls,o=this.details,u=this.media,w=this.sourceBuffer;if(!u||o===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var i=o.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(R.isFiniteNumber)(i)||i<0)return;var D=u.currentTime,k=o.levelTargetDuration,c=Math.max(i,k),b=Math.floor(D/k)*k-c;v.forEach(function(x){var _=w[x];if(_){var j=h.BufferHelper.getBuffered(_);j.length>0&&b>j.start(0)&&(n.trigger(T.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),o.live&&n.trigger(T.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),n.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:x}))}})},y.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,o=this.hls,u=this.media,w=this.mediaSource,v=n.fragments[0].start+n.totalduration,i=u.duration,D=Object(R.isFiniteNumber)(w.duration)?w.duration:0;n.live&&o.config.liveDurationInfinity?(g.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(n)):(v>D&&v>i||!Object(R.isFiniteNumber)(i))&&(g.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),w.duration=v)},y.updateSeekableRange=function(n){var o=this.mediaSource,u=n.fragments,w=u.length;if(w&&n.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var v=Math.max(0,u[0].start),i=Math.max(v,v+n.totalduration);o.setLiveSeekableRange(v,i)}},y.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,o=this.operationQueue,u=this.pendingTracks,w=Object.keys(u).length;if(w&&!n||w===2){this.createSourceBuffers(u),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(T.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}v.forEach(function(i){o.executeNext(i)})}},y.createSourceBuffers=function(n){var o=this.sourceBuffer,u=this.mediaSource;if(!u)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var v in n)if(!o[v]){var i=n[v];if(!i)throw Error("source buffer exists for track "+v+", however track does not");var D=i.levelCodec||i.codec,k=i.container+";codecs="+D;g.logger.log("[buffer-controller]: creating sourceBuffer("+k+")");try{var c=o[v]=u.addSourceBuffer(k),b=v;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[v]={buffer:c,codec:D,container:i.container,levelCodec:i.levelCodec,id:i.id},w++}catch(x){g.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(T.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:k})}}w&&this.hls.trigger(T.Events.BUFFER_CREATED,{tracks:this.tracks})},y._onSBUpdateStart=function(n){var o=this.operationQueue,u=o.current(n);u.onStart()},y._onSBUpdateEnd=function(n){var o=this.operationQueue,u=o.current(n);u.onComplete(),o.shiftAndExecuteNext(n)},y._onSBUpdateError=function(n,o){g.logger.error("[buffer-controller]: "+n+" SourceBuffer error",o),this.hls.trigger(T.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var u=this.operationQueue.current(n);u&&u.onError(o)},y.removeExecutor=function(n,o,u){var w=this.media,v=this.mediaSource,i=this.operationQueue,D=this.sourceBuffer,k=D[n];if(!w||!v||!k){g.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(n);return}var c=Object(R.isFiniteNumber)(w.duration)?w.duration:Infinity,b=Object(R.isFiniteNumber)(v.duration)?v.duration:Infinity,x=Math.max(0,o),_=Math.min(u,c,b);_>x?(g.logger.log("[buffer-controller]: Removing ["+x+","+_+"] from the "+n+" SourceBuffer"),console.assert(!k.updating,n+" sourceBuffer must not be updating"),k.remove(x,_)):i.shiftAndExecuteNext(n)},y.appendExecutor=function(n,o){var u=this.operationQueue,w=this.sourceBuffer,v=w[o];if(!v){g.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(o);return}v.ended=!1,console.assert(!v.updating,o+" sourceBuffer must not be updating"),v.appendBuffer(n)},y.blockBuffers=function(n,o){var u=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){g.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var w=this.operationQueue,v=o.map(function(i){return w.appendBlocker(i)});Promise.all(v).then(function(){n(),o.forEach(function(i){var D=u.sourceBuffer[i];(!D||!D.updating)&&w.shiftAndExecuteNext(i)})})},y.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},y.addBufferListener=function(n,o,u){var w=this.sourceBuffer[n];if(!w)return;var v=u.bind(this,n);this.listeners[n].push({event:o,listener:v}),w.addEventListener(o,v)},y.removeBufferListeners=function(n){var o=this.sourceBuffer[n];if(!o)return;this.listeners[n].forEach(function(u){o.removeEventListener(u.event,u.listener)})},E}()},"./src/controller/buffer-operation-queue.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return T});var R=S("./src/utils/logger.ts"),T=function(){function g(h){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=h}var C=g.prototype;return C.append=function(s,a){var r=this.queues[a];r.push(s),r.length===1&&this.buffers[a]&&this.executeNext(a)},C.insertAbort=function(s,a){var r=this.queues[a];r.unshift(s),this.executeNext(a)},C.appendBlocker=function(s){var a,r=new Promise(function(p){a=p}),f={execute:a,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,s),r},C.executeNext=function(s){var a=this.buffers,r=this.queues,f=a[s],p=r[s];if(p.length){var d=p[0];try{d.execute()}catch(E){R.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(E),(!f||!f.updating)&&(p.shift(),this.executeNext(s))}}},C.shiftAndExecuteNext=function(s){this.queues[s].shift(),this.executeNext(s)},C.current=function(s){return this.queues[s][0]},g}()},"./src/controller/cap-level-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts");function T(h,s){for(var a=0;a0&&this.mediaWidth>0){var r=this.hls.levels;if(r.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(r.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},s.getMaxLevel=function(r){var f=this,p=this.hls.levels;if(!p.length)return-1;var d=p.filter(function(E,y){return h.isLevelAllowed(y,f.restrictedLevels)&&y<=r});return this.clientRect=null,h.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},s.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()},s.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},s.getDimensions=function(){if(this.clientRect)return this.clientRect;var r=this.media,f={width:0,height:0};if(r){var p=r.getBoundingClientRect();f.width=p.width,f.height=p.height,!f.width&&!f.height&&(f.width=p.right-p.left||r.width||0,f.height=p.bottom-p.top||r.height||0)}return this.clientRect=f,f},h.isLevelAllowed=function(r,f){return f===void 0&&(f=[]),f.indexOf(r)===-1},h.getMaxLevelByMediaSize=function(r,f,p){if(!r||!r.length)return-1;for(var d=function(o,u){return u?o.width!==u.width||o.height!==u.height:!0},E=r.length-1,y=0;y=f||l.height>=p)&&d(l,r[y+1])){E=y;break}}return E},g(h,[{key:"mediaWidth",get:function(){return this.getDimensions().width*h.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*h.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var r=1;try{r=self.devicePixelRatio}catch(f){}return r}}]),h}();m.default=C},"./src/controller/cmcd-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return d});var R=S("./src/events.ts"),T=S("./src/types/cmcd.ts"),g=S("./src/utils/buffer-helper.ts"),C=S("./src/utils/logger.ts");function h(E,y){for(var l=0;l=E.length?{done:!0}:{done:!1,value:E[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(E,y){if(!E)return;if(typeof E=="string")return f(E,y);var l=Object.prototype.toString.call(E).slice(8,-1);if(l==="Object"&&E.constructor&&(l=E.constructor.name),l==="Map"||l==="Set")return Array.from(E);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return f(E,y)}function f(E,y){(y==null||y>E.length)&&(y=E.length);for(var l=0,n=new Array(y);lo&&(o=i.bitrate)}return o>0?o:NaN},y.getBufferLength=function(n){var o=this.hls.media,u=n===T.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!u||!o)return NaN;var w=g.BufferHelper.bufferInfo(u,o.currentTime,this.config.maxBufferHole);return w.len*1e3},y.createPlaylistLoader=function(){var n=this.config.pLoader,o=this.applyPlaylistData,u=n||this.config.loader;return function(){function w(i){this.loader=void 0,this.loader=new u(i)}var v=w.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(D,k,c){o(D),this.loader.load(D,k,c)},s(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},y.createFragmentLoader=function(){var n=this.config.fLoader,o=this.applyFragmentData,u=n||this.config.loader;return function(){function w(i){this.loader=void 0,this.loader=new u(i)}var v=w.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(D,k,c){o(D),this.loader.load(D,k,c)},s(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},E.uuid=function(){var n=URL.createObjectURL(new Blob),o=n.toString();return URL.revokeObjectURL(n),o.substr(o.lastIndexOf("/")+1)},E.serialize=function(n){for(var o=[],u=function(z){return!Number.isNaN(z)&&z!=null&&z!==""&&z!==!1},w=function(z){return Math.round(z)},v=function(z){return w(z/100)*100},i=function(z){return encodeURIComponent(z)},D={br:w,d:w,bl:v,dl:v,mtp:v,nor:i,rtp:v,tb:w},k=Object.keys(n||{}).sort(),c=a(k),b;!(b=c()).done;){var x=b.value,_=n[x];if(!u(_))continue;if(x==="v"&&_===1)continue;if(x=="pr"&&_===1)continue;var j=D[x];j&&(_=j(_));var F=typeof _,L=void 0;x==="ot"||x==="sf"||x==="st"?L=x+"="+_:F==="boolean"?L=x:F==="number"?L=x+"="+_:L=x+"="+JSON.stringify(_),o.push(L)}return o.join(",")},E.toHeaders=function(n){for(var o=Object.keys(n),u={},w=["Object","Request","Session","Status"],v=[{},{},{},{}],i={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},D=0,k=o;Da){this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var i=a-this._requestLicenseFailureCount+1;g.logger.warn("Retrying license request, "+i+" attempts left"),this._requestLicense(o,u)}break}},E._generateLicenseRequestChallenge=function(l,n){switch(l.mediaKeySystemDomain){case C.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},E._requestLicense=function(l,n){g.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){g.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var u=this.getLicenseServerUrl(o.mediaKeySystemDomain),w=this._createLicenseXhr(u,l,n);g.logger.log("Sending license request to URL: "+u);var v=this._generateLicenseRequestChallenge(o,l);w.send(v)}catch(i){g.logger.error("Failure requesting DRM license: "+i),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},E.onMediaAttached=function(l,n){if(!this._emeEnabled)return;var o=n.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},E.onMediaDetached=function(){var l=this._media,n=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},E.onManifestParsed=function(l,n){if(!this._emeEnabled)return;var o=n.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),u=n.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(C.KeySystems.WIDEVINE,o,u)},s(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();m.default=p},"./src/controller/fps-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts"),T=S("./src/utils/logger.ts"),g=function(){function C(s){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=s,this.registerListeners()}var h=C.prototype;return h.setStreamController=function(a){this.streamController=a},h.registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},h.unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching)},h.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},h.onMediaAttaching=function(a,r){var f=this.hls.config;if(f.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),f.fpsDroppedMonitoringPeriod)}},h.checkFPS=function(a,r,f){var p=performance.now();if(r){if(this.lastTime){var d=p-this.lastTime,E=f-this.lastDroppedFrames,y=r-this.lastDecodedFrames,l=1e3*E/d,n=this.hls;if(n.trigger(R.Events.FPS_DROP,{currentDropped:E,currentDecoded:y,totalDroppedFrames:f}),l>0&&E>n.config.fpsDroppedMonitoringThreshold*y){var o=n.currentLevel;T.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=o)&&(o=o-1,n.trigger(R.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:n.currentLevel}),n.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=f,this.lastDecodedFrames=r}},h.checkFPSInterval=function(){var a=this.media;if(a)if(this.isVideoPlaybackQualityAvailable){var r=a.getVideoPlaybackQuality();this.checkFPS(a,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(a,a.webkitDecodedFrameCount,a.webkitDroppedFrameCount)},C}();m.default=g},"./src/controller/fragment-finders.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"findFragmentByPDT",function(){return g}),S.d(m,"findFragmentByPTS",function(){return C}),S.d(m,"fragmentWithinToleranceTest",function(){return h}),S.d(m,"pdtWithinToleranceTest",function(){return s}),S.d(m,"findFragWithCC",function(){return a});var R=S("./src/polyfills/number.ts"),T=S("./src/utils/binary-search.ts");function g(r,f,p){if(f===null||!Array.isArray(r)||!r.length||!Object(R.isFiniteNumber)(f))return null;var d=r[0].programDateTime;if(f<(d||0))return null;var E=r[r.length-1].endProgramDateTime;if(f>=(E||0))return null;p=p||0;for(var y=0;yr&&p.start?-1:0}function s(r,f,p){var d=Math.min(f,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,E=p.endProgramDateTime||0;return E-d>r}function a(r,f){return T.default.search(r,function(p){return p.ccf?-1:0})}},"./src/controller/fragment-tracker.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"FragmentState",function(){return g}),S.d(m,"FragmentTracker",function(){return C});var R=S("./src/events.ts"),T=S("./src/types/loader.ts"),g;(function(a){a.NOT_LOADED="NOT_LOADED",a.BACKTRACKED="BACKTRACKED",a.APPENDING="APPENDING",a.PARTIAL="PARTIAL",a.OK="OK"})(g||(g={}));var C=function(){function a(f){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=f,this._registerListeners()}var r=a.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,d){if(d===T.PlaylistLevelType.MAIN){var E=this.activeFragment,y=this.activeParts;if(!E)return null;if(y)for(var l=y.length;l--;){var n=y[l],o=n?n.end:E.appendedPTS;if(n.start<=p&&o!==void 0&&p<=o)return l>9&&(this.activeParts=y.slice(l-9)),n}else if(E.start<=p&&E.appendedPTS!==void 0&&p<=E.appendedPTS)return E}return this.getBufferedFrag(p,d)},r.getBufferedFrag=function(p,d){for(var E=this.fragments,y=Object.keys(E),l=y.length;l--;){var n=E[y[l]];if((n==null?void 0:n.body.type)===d&&n.buffered){var o=n.body;if(o.start<=p&&p<=o.end)return o}}return null},r.detectEvictedFragments=function(p,d,E){var y=this;Object.keys(this.fragments).forEach(function(l){var n=y.fragments[l];if(!n)return;if(!n.buffered){n.body.type===E&&y.removeFragment(n.body);return}var o=n.range[p];if(!o)return;o.time.some(function(u){var w=!y.isTimeBuffered(u.startPTS,u.endPTS,d);return w&&y.removeFragment(n.body),w})})},r.detectPartialFragments=function(p){var d=this,E=this.timeRanges,y=p.frag,l=p.part;if(!E||y.sn==="initSegment")return;var n=s(y),o=this.fragments[n];if(!o)return;Object.keys(E).forEach(function(u){var w=y.elementaryStreams[u];if(!w)return;var v=E[u],i=l!==null||w.partial===!0;o.range[u]=d.getBufferedTimes(y,l,i,v)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},r.fragBuffered=function(p){var d=s(p),E=this.fragments[d];E&&(E.backtrack=E.loaded=null,E.buffered=!0)},r.getBufferedTimes=function(p,d,E,y){for(var l={time:[],partial:E},n=d?d.start:p.start,o=d?d.end:p.end,u=p.minEndPTS||o,w=p.maxStartPTS||n,v=0;v=i&&u<=D){l.time.push({startPTS:Math.max(n,y.start(v)),endPTS:Math.min(o,y.end(v))});break}else if(ni)l.partial=!0,l.time.push({startPTS:Math.max(n,y.start(v)),endPTS:Math.min(o,y.end(v))});else if(o<=i)break}return l},r.getPartialFragment=function(p){var d=null,E,y,l,n=0,o=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach(function(w){var v=u[w];if(!v)return;h(v)&&(y=v.body.start-o,l=v.body.end+o,p>=y&&p<=l&&(E=Math.min(p-y,l-p),n<=E&&(d=v.body,n=E)))}),d},r.getState=function(p){var d=s(p),E=this.fragments[d];return E?E.buffered?h(E)?g.PARTIAL:g.OK:E.backtrack?g.BACKTRACKED:g.APPENDING:g.NOT_LOADED},r.backtrack=function(p,d){var E=s(p),y=this.fragments[E];if(!y||y.backtrack)return null;var l=y.backtrack=d||y.loaded;return y.loaded=null,l},r.getBacktrackData=function(p){var d=s(p),E=this.fragments[d];if(E){var y,l=E.backtrack;if(l!=null&&(y=l.payload)!==null&&y!==void 0&&y.byteLength)return l;this.removeFragment(p)}return null},r.isTimeBuffered=function(p,d,E){for(var y,l,n=0;n=y&&d<=l)return!0;if(d<=y)return!1}return!1},r.onFragLoaded=function(p,d){var E=d.frag,y=d.part;if(E.sn==="initSegment"||E.bitrateTest||y)return;var l=s(E);this.fragments[l]={body:E,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},r.onBufferAppended=function(p,d){var E=this,y=d.frag,l=d.part,n=d.timeRanges;if(y.type===T.PlaylistLevelType.MAIN)if(this.activeFragment=y,l){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(l)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(u){var w=n[u];if(E.detectEvictedFragments(u,w),!l)for(var v=0;vp&&y.removeFragment(o)}})},r.removeFragment=function(p){var d=s(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[d]},r.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},a}();function h(a){var r,f;return a.buffered&&(((r=a.range.video)===null||r===void 0?void 0:r.partial)||((f=a.range.audio)===null||f===void 0?void 0:f.partial))}function s(a){return a.type+"_"+a.level+"_"+a.urlId+"_"+a.sn}},"./src/controller/gap-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"STALL_MINIMUM_DURATION_MS",function(){return h}),S.d(m,"MAX_START_GAP_JUMP",function(){return s}),S.d(m,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return a}),S.d(m,"SKIP_BUFFER_RANGE_START",function(){return r}),S.d(m,"default",function(){return f});var R=S("./src/utils/buffer-helper.ts"),T=S("./src/errors.ts"),g=S("./src/events.ts"),C=S("./src/utils/logger.ts"),h=250,s=2,a=.1,r=.05,f=function(){function p(E,y,l,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=E,this.media=y,this.fragmentTracker=l,this.hls=n}var d=p.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(y){var l=this.config,n=this.media,o=this.stalled,u=n.currentTime,w=n.seeking,v=this.seeking&&!w,i=!this.seeking&&w;if(this.seeking=w,u!==y){if(this.moved=!0,o!==null){if(this.stallReported){var D=self.performance.now()-o;C.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((i||v)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!R.BufferHelper.getBuffered(n).length)return;var k=R.BufferHelper.bufferInfo(n,u,0),c=k.len>0,b=k.nextStart||0;if(!c&&!b)return;if(w){var x=k.len>s,_=!b||b-u>s&&!this.fragmentTracker.getPartialFragment(u);if(x||_)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var j,F=Math.max(b,k.start||0)-u,L=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,X=L==null||((j=L.details)===null||j===void 0)?void 0:j.live,z=X?L.details.targetduration*2:s;if(F>0&&F<=z){this._trySkipBufferHole(null);return}}var H=self.performance.now();if(o===null){this.stalled=H;return}var G=H-o;!w&&G>=h&&this._reportStall(k.len);var U=R.BufferHelper.bufferInfo(n,u,l.maxBufferHole);this._tryFixBufferStall(U,G)},d._tryFixBufferStall=function(y,l){var n=this.config,o=this.fragmentTracker,u=this.media,w=u.currentTime,v=o.getPartialFragment(w);if(v){var i=this._trySkipBufferHole(v);if(i)return}y.len>n.maxBufferHole&&l>n.highBufferWatchdogPeriod*1e3&&(C.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(y){var l=this.hls,n=this.media,o=this.stallReported;o||(this.stallReported=!0,C.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+y+")"),l.trigger(g.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:y}))},d._trySkipBufferHole=function(y){for(var l=this.config,n=this.hls,o=this.media,u=o.currentTime,w=0,v=R.BufferHelper.getBuffered(o),i=0;i=w&&u.05&&this.forwardBufferLength>1){var i=Math.min(2,Math.max(1,n)),D=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20;p.playbackRate=Math.min(i,Math.max(1,D))}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},h(a,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,d=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:d?p.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var d=p.holdBack,E=p.partHoldBack,y=p.targetduration,l=this.config,n=l.liveSyncDuration,o=l.liveSyncDurationCount,u=l.lowLatencyMode,w=this.hls.userConfig,v=u&&E||d;(w.liveSyncDuration||w.liveSyncDurationCount||v===0)&&(v=n!==void 0?n:o*y);var i=y,D=1;return v+Math.min(this.stallCount*D,i)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),d=this.targetLatency,E=this.levelDetails;if(p===null||d===null||E===null)return null;var y=E.edge,l=p-d-this.edgeStalled,n=y-E.totalduration,o=y-(this.config.lowLatencyMode&&E.partTarget||E.targetduration);return Math.min(Math.max(n,l),o)}},{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 d=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-d,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,d=this.levelDetails;if(!p||!d)return 0;var E=p.buffered.length;return E?p.buffered.end(E-1):d.edge-this.currentTime}}]),a}()},"./src/controller/level-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return l});var R=S("./src/types/level.ts"),T=S("./src/events.ts"),g=S("./src/errors.ts"),C=S("./src/utils/codecs.ts"),h=S("./src/controller/level-helper.ts"),s=S("./src/controller/base-playlist-controller.ts"),a=S("./src/types/loader.ts");function r(){return r=Object.assign||function(n){for(var o=1;o0){b=D[0].bitrate,D.sort(function(G,U){return G.bitrate-U.bitrate}),this._levels=D;for(var X=0;Xthis.hls.config.fragLoadingMaxRetry&&(x=i.frag.level)):x=i.frag.level}break;case g.ErrorDetails.LEVEL_LOAD_ERROR:case g.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(b=!1),x=D.level),c=!0;break;case g.ErrorDetails.REMUX_ALLOC_ERROR:x=i.level,c=!0;break}x!==void 0&&this.recoverLevel(i,x,c,b)},u.recoverLevel=function(v,i,D,k){var c=v.details,b=this._levels[i];if(b.loadError++,D){var x=this.retryLoadingOrFail(v);if(x)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(k){var _=b.url.length;if(_>1&&b.loadError<_)v.levelRetry=!0,this.redundantFailover(i);else if(this.manualLevelIndex===-1){var j=i===0?this._levels.length-1:i-1;this.currentLevelIndex!==j&&this._levels[j].loadError===0&&(this.warn(c+": switch to "+j),v.levelRetry=!0,this.hls.nextAutoLevel=j)}}},u.redundantFailover=function(v){var i=this._levels[v],D=i.url.length;if(D>1){var k=(i.urlId+1)%D;this.warn("Switching to redundant URL-id "+k),this._levels.forEach(function(c){c.urlId=k}),this.level=v}},u.onFragLoaded=function(v,i){var D=i.frag;if(D!==void 0&&D.type===a.PlaylistLevelType.MAIN){var k=this._levels[D.level];k!==void 0&&(k.fragmentError=0,k.loadError=0)}},u.onLevelLoaded=function(v,i){var D,k=i.level,c=i.details,b=this._levels[k];if(!b){var x;this.warn("Invalid level index "+k),(x=i.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(c.deltaUpdateFailed=!0);return}k===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(k,i,b.details)):(D=i.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(c.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(v,i){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var k=-1,c=this.hls.audioTracks[i.id].groupId,b=0;b0){var k=D.urlId,c=D.url[k];if(v)try{c=v.addDirectives(c)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+i+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+k+" "+c),this.clearTimer(),this.hls.trigger(T.Events.LEVEL_LOADING,{url:c,level:i,id:k,deliveryDirectives:v||null})}},u.removeLevel=function(v,i){var D=function(b,x){return x!==i},k=this._levels.filter(function(c,b){return b!==v?!0:c.url.length>1&&i!==void 0?(c.url=c.url.filter(D),c.audioGroupIds&&(c.audioGroupIds=c.audioGroupIds.filter(D)),c.textGroupIds&&(c.textGroupIds=c.textGroupIds.filter(D)),c.urlId=0,!0):!1}).map(function(c,b){var x=c.details;return x!=null&&x.fragments&&x.fragments.forEach(function(_){_.level=b}),c});this._levels=k,this.hls.trigger(T.Events.LEVELS_UPDATED,{levels:k})},p(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var i,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===v&&(i=D[v])!==null&&i!==void 0&&i.details)return;if(v<0||v>=D.length){var k=v<0;if(this.hls.trigger(T.Events.ERROR,{type:g.ErrorTypes.OTHER_ERROR,details:g.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:k,reason:"invalid level idx"}),k)return;v=Math.min(v,D.length-1)}this.clearTimer();var c=this.currentLevelIndex,b=D[c],x=D[v];this.log("switching to level "+v+" from "+c),this.currentLevelIndex=v;var _=r({},x,{level:v,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete _._urlId,this.hls.trigger(T.Events.LEVEL_SWITCHING,_);var j=x.details;if(!j||j.live){var F=this.switchParams(x.uri,b==null?void 0:b.details);this.loadPlaylist(F)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),o}(s.default)},"./src/controller/level-helper.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"addGroupId",function(){return g}),S.d(m,"assignTrackIdsByGroup",function(){return C}),S.d(m,"updatePTS",function(){return h}),S.d(m,"updateFragPTSDTS",function(){return a}),S.d(m,"mergeDetails",function(){return r}),S.d(m,"mapPartIntersection",function(){return f}),S.d(m,"mapFragmentIntersection",function(){return p}),S.d(m,"adjustSliding",function(){return d}),S.d(m,"addSliding",function(){return E}),S.d(m,"computeReloadInterval",function(){return y}),S.d(m,"getFragmentWithSN",function(){return l}),S.d(m,"getPartWith",function(){return n});var R=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts");function g(o,u,w){switch(u){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(w);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(w);break}}function C(o){var u={};o.forEach(function(w){var v=w.groupId||"";w.id=u[v]=u[v]||0,u[v]++})}function h(o,u,w){var v=o[u],i=o[w];s(v,i)}function s(o,u){var w=u.startPTS;if(Object(R.isFiniteNumber)(w)){var v=0,i;u.sn>o.sn?(v=w-o.start,i=o):(v=o.start-w,i=u),i.duration!==v&&(i.duration=v)}else if(u.sn>o.sn){var D=o.cc===u.cc;D&&o.minEndPTS?u.start=o.start+(o.minEndPTS-o.start):u.start=o.start+o.duration}else u.start=Math.max(o.start-u.duration,0)}function a(o,u,w,v,i,D){var k=v-w;k<=0&&(T.logger.warn("Fragment should have a positive duration",u),v=w+u.duration,D=i+u.duration);var c=w,b=v,x=u.startPTS,_=u.endPTS;if(Object(R.isFiniteNumber)(x)){var j=Math.abs(x-w);Object(R.isFiniteNumber)(u.deltaPTS)?u.deltaPTS=Math.max(j,u.deltaPTS):u.deltaPTS=j,c=Math.max(w,x),w=Math.min(w,x),i=Math.min(i,u.startDTS),b=Math.min(v,_),v=Math.max(v,_),D=Math.max(D,u.endDTS)}u.duration=v-w;var F=w-u.start;u.appendedPTS=v,u.start=u.startPTS=w,u.maxStartPTS=c,u.startDTS=i,u.endPTS=v,u.minEndPTS=b,u.endDTS=D;var L=u.sn;if(!o||Lo.endSN)return 0;var X,z=L-o.startSN,H=o.fragments;for(H[z]=u,X=z;X>0;X--)s(H[X],H[X-1]);for(X=z;X=0;i--){var D=v[i].initSegment;if(D){w=D;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var k=0,c;if(p(o,u,function(X,z){X.relurl&&(k=X.cc-z.cc),Object(R.isFiniteNumber)(X.startPTS)&&Object(R.isFiniteNumber)(X.endPTS)&&(z.start=z.startPTS=X.startPTS,z.startDTS=X.startDTS,z.appendedPTS=X.appendedPTS,z.maxStartPTS=X.maxStartPTS,z.endPTS=X.endPTS,z.endDTS=X.endDTS,z.minEndPTS=X.minEndPTS,z.duration=X.endPTS-X.startPTS,z.duration&&(c=z),u.PTSKnown=u.alignedSliding=!0),z.elementaryStreams=X.elementaryStreams,z.loader=X.loader,z.stats=X.stats,z.urlId=X.urlId,X.initSegment&&(z.initSegment=X.initSegment,w=X.initSegment)}),w){var b=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments;b.forEach(function(X){var z;(!X.initSegment||X.initSegment.relurl===((z=w)===null||z===void 0?void 0:z.relurl))&&(X.initSegment=w)})}if(u.skippedSegments&&(u.deltaUpdateFailed=u.fragments.some(function(X){return!X}),u.deltaUpdateFailed)){T.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=u.skippedSegments;x--;)u.fragments.shift();u.startSN=u.fragments[0].sn,u.startCC=u.fragments[0].cc}var _=u.fragments;if(k){T.logger.warn("discontinuity sliding from playlist, take drift into account");for(var j=0;j<_.length;j++)_[j].cc+=k}u.skippedSegments&&(u.startCC=u.fragments[0].cc),f(o.partList,u.partList,function(X,z){z.elementaryStreams=X.elementaryStreams,z.stats=X.stats}),c?a(u,c,c.startPTS,c.endPTS,c.startDTS,c.endDTS):d(o,u),_.length&&(u.totalduration=u.edge-_[0].start),u.driftStartTime=o.driftStartTime,u.driftStart=o.driftStart;var F=u.advancedDateTime;if(u.advanced&&F){var L=u.edge;u.driftStart||(u.driftStartTime=F,u.driftStart=L),u.driftEndTime=F,u.driftEnd=L}else u.driftEndTime=o.driftEndTime,u.driftEnd=o.driftEnd,u.advancedDateTime=o.advancedDateTime}function f(o,u,w){if(o&&u)for(var v=0,i=0,D=o.length;i<=D;i++){var k=o[i],c=u[i+v];k&&c&&k.index===c.index&&k.fragment.sn===c.fragment.sn?w(k,c):v--}}function p(o,u,w){for(var v=u.skippedSegments,i=Math.max(o.startSN,u.startSN)-u.startSN,D=(o.fragmentHint?1:0)+(v?u.endSN:Math.min(o.endSN,u.endSN))-u.startSN,k=u.startSN-o.startSN,c=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,b=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,x=i;x<=D;x++){var _=b[k+x],j=c[x];v&&!j&&x=v.length)return;E(u,v[w].start)}function E(o,u){if(u){for(var w=o.fragments,v=o.skippedSegments;v0&&i0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),b=x),this.state=T.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=T.State.STOPPED},k.stopLoad=function(){this._forceStartLoad=!1,i.prototype.stopLoad.call(this)},k.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_LEVEL:{var b,x=this.levels,_=this.level,j=x==null||((b=x[_])===null||b===void 0)?void 0:b.details;if(j&&(!j.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(j))break;this.state=T.State.IDLE;break}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var F,L=self.performance.now(),X=this.retryDate;(!X||L>=X||(F=this.media)!==null&&F!==void 0&&F.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=T.State.IDLE)}break;default:break}this.onTickEnd()},k.onTickEnd=function(){i.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},k.doTickIdle=function(){var b,x,_=this.hls,j=this.levelLastLoaded,F=this.levels,L=this.media,X=_.config,z=_.nextLoadLevel;if(j===null||!L&&(this.startFragRequested||!X.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!F||!F[z])return;var H=F[z];this.level=_.nextLoadLevel=z;var G=H.details;if(!G||this.state===T.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==z){this.state=T.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:L,a.PlaylistLevelType.MAIN);if(U===null)return;var B=U.len,W=this.getMaxBufferLength(H.maxBitrate);if(B>=W)return;if(this._streamEnded(U,G)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(C.Events.BUFFER_EOS,te),this.state=T.State.ENDED;return}var de=U.end,fe=this.getNextFragment(de,G);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var be=fe.sn-G.startSN;be>1&&(fe=G.fragments[be-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===s.FragmentState.OK&&this.nextLoadPosition>de){var Ce=this.audioOnly&&!this.altAudio?r.ElementaryStreamTypes.AUDIO:r.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(L,Ce,a.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,G)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((b=fe.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((x=fe.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(fe,G):this.loadFragment(fe,G,de)},k.loadFragment=function(b,x,_){var j,F=this.fragmentTracker.getState(b);if(this.fragCurrent=b,F===s.FragmentState.BACKTRACKED){var L=this.fragmentTracker.getBacktrackData(b);if(L){this._handleFragmentLoadProgress(L),this._handleFragmentLoadComplete(L);return}else F=s.FragmentState.NOT_LOADED}F===s.FragmentState.NOT_LOADED||F===s.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,i.prototype.loadFragment.call(this,b,x,_)):F===s.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((j=this.media)===null||j===void 0?void 0:j.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},k.getAppendedFrag=function(b){var x=this.fragmentTracker.getAppendedFrag(b,a.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},k.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,a.PlaylistLevelType.MAIN)},k.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},k.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},k.nextLevelSwitch=function(){var b=this.levels,x=this.media;if(x!=null&&x.readyState){var _,j=this.getAppendedFrag(x.currentTime);if(j&&j.start>1&&this.flushMainBuffer(0,j.start-1),!x.paused&&b){var F=this.hls.nextLoadLevel,L=b[F],X=this.fragLastKbps;X&&this.fragCurrent?_=this.fragCurrent.duration*L.maxBitrate/(1e3*X)+1:_=0}else _=0;var z=this.getBufferedFrag(x.currentTime+_);if(z){var H=this.followingBufferedFrag(z);if(H){this.abortCurrentFrag();var G=H.maxStartPTS?H.maxStartPTS:H.start,U=H.duration,B=Math.max(z.end,G+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(B,Number.POSITIVE_INFINITY)}}}},k.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===T.State.KEY_LOADING&&(this.state=T.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},k.flushMainBuffer=function(b,x){i.prototype.flushMainBuffer.call(this,b,x,this.altAudio?"video":null)},k.onMediaAttached=function(b,x){i.prototype.onMediaAttached.call(this,b,x);var _=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),_.addEventListener("playing",this.onvplaying),_.addEventListener("seeked",this.onvseeked),this.gapController=new d.default(this.config,_,this.fragmentTracker,this.hls)},k.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),i.prototype.onMediaDetaching.call(this)},k.onMediaPlaying=function(){this.tick()},k.onMediaSeeked=function(){var b=this.media,x=b?b.currentTime:null;Object(R.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},k.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},k.onManifestParsed=function(b,x){var _=!1,j=!1,F;x.levels.forEach(function(L){F=L.audioCodec,F&&(F.indexOf("mp4a.40.2")!==-1&&(_=!0),F.indexOf("mp4a.40.5")!==-1&&(j=!0))}),this.audioCodecSwitch=_&&j&&!Object(g.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},k.onLevelLoading=function(b,x){var _=this.levels;if(!_||this.state!==T.State.IDLE)return;var j=_[x.level];(!j.details||j.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(j.details))&&(this.state=T.State.WAITING_LEVEL)},k.onLevelLoaded=function(b,x){var _,j=this.levels,F=x.level,L=x.details,X=L.totalduration;if(!j){this.warn("Levels were reset while loading level "+F);return}this.log("Level "+F+" loaded ["+L.startSN+","+L.endSN+"], cc ["+L.startCC+", "+L.endCC+"] duration:"+X);var z=this.fragCurrent;z&&(this.state===T.State.FRAG_LOADING||this.state===T.State.FRAG_LOADING_WAITING_RETRY)&&(z.level!==x.level&&z.loader&&(this.state=T.State.IDLE,z.loader.abort()));var H=j[F],G=0;if(L.live||(_=H.details)!==null&&_!==void 0&&_.live){if(L.fragments[0]||(L.deltaUpdateFailed=!0),L.deltaUpdateFailed)return;G=this.alignPlaylists(L,H.details)}if(H.details=L,this.levelLastLoaded=F,this.hls.trigger(C.Events.LEVEL_UPDATED,{details:L,level:F}),this.state===T.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(L))return;this.state=T.State.IDLE}this.startFragRequested?L.live&&this.synchronizeToLiveEdge(L):this.setStartPosition(L,G),this.tick()},k._handleFragmentLoadProgress=function(b){var x,_=b.frag,j=b.part,F=b.payload,L=this.levels;if(!L){this.warn("Levels were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var X=L[_.level],z=X.details;if(!z){this.warn("Dropping fragment "+_.sn+" of level "+_.level+" after level details were reset");return}var H=X.videoCodec,G=z.PTSKnown||!z.live,U=(x=_.initSegment)===null||x===void 0?void 0:x.data,B=this._getAudioCodec(X),W=this.transmuxer=this.transmuxer||new f.default(this.hls,a.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=j?j.index:-1,de=te!==-1,fe=new p.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,F.byteLength,te,de),be=this.initPTS[_.cc];W.push(F,U,B,H,_,j,z.totalduration,G,fe,be)},k.onAudioTrackSwitching=function(b,x){var _=this.altAudio,j=!!x.url,F=x.id;if(!j){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var L=this.fragCurrent;L!=null&&L.loader&&(this.log("Switching to main audio track, cancel main fragment load"),L.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var X=this.hls;_&&X.trigger(C.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),X.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:F})}},k.onAudioTrackSwitched=function(b,x){var _=x.id,j=!!this.hls.audioTracks[_].url;if(j){var F=this.videoBuffer;F&&this.mediaBuffer!==F&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=F)}this.altAudio=j,this.tick()},k.onBufferCreated=function(b,x){var _=x.tracks,j,F,L=!1;for(var X in _){var z=_[X];if(z.id==="main"){if(F=X,j=z,X==="video"){var H=_[X];H&&(this.videoBuffer=H.buffer)}}else L=!0}L&&j?(this.log("Alternate track found, use "+F+".buffered to schedule main fragment loading"),this.mediaBuffer=j.buffer):this.mediaBuffer=this.media},k.onFragBuffered=function(b,x){var _=x.frag,j=x.part;if(_&&_.type!==a.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(j?" p: "+j.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state),this.state===T.State.PARSED&&(this.state=T.State.IDLE);return}var F=j?j.stats:_.stats;this.fragLastKbps=Math.round(8*F.total/(F.buffering.end-F.loading.first)),_.sn!=="initSegment"&&(this.fragPrevious=_),this.fragBufferedComplete(_,j)},k.onError=function(b,x){switch(x.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:case E.ErrorDetails.KEY_LOAD_ERROR:case E.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(a.PlaylistLevelType.MAIN,x);break;case E.ErrorDetails.LEVEL_LOAD_ERROR:case E.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==T.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=T.State.ERROR):!x.levelRetry&&this.state===T.State.WAITING_LEVEL&&(this.state=T.State.IDLE));break;case E.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var _=!0,j=this.getFwdBufferInfo(this.media,a.PlaylistLevelType.MAIN);j&&j.len>.5&&(_=!this.reduceMaxBufferLength(j.len)),_&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},k.checkBuffer=function(){var b=this.media,x=this.gapController;if(!b||!x||!b.readyState)return;var _=h.BufferHelper.getBuffered(b);!this.loadedmetadata&&_.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},k.onFragLoadEmergencyAborted=function(){this.state=T.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},k.onBufferFlushed=function(b,x){var _=x.type;if(_!==r.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var j=(_===r.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(j,_,a.PlaylistLevelType.MAIN)}},k.onLevelsUpdated=function(b,x){this.levels=x.levels},k.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},k.seekToStartPos=function(){var b=this.media,x=b.currentTime,_=this.startPosition;if(_>=0&&x<_){if(b.seeking){y.logger.log("could not seek to "+_+", already seeking at "+x);return}var j=h.BufferHelper.getBuffered(b),F=j.length?j.start(0):0,L=F-_;L>0&&(L1&&b.seeking===!1){var _=b.currentTime;if(h.BufferHelper.isBuffered(b,_)?x=this.getAppendedFrag(_):h.BufferHelper.isBuffered(b,_+.1)&&(x=this.getAppendedFrag(_+.1)),x){var j=this.fragPlaying,F=x.level;(!j||x.sn!==j.sn||j.level!==F||x.urlId!==j.urlId)&&(this.hls.trigger(C.Events.FRAG_CHANGED,{frag:x}),(!j||j.level!==F)&&this.hls.trigger(C.Events.LEVEL_SWITCHED,{level:F}),this.fragPlaying=x)}}},n(D,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var x=this.getAppendedFrag(b.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var x=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(T.default)},"./src/controller/subtitle-stream-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"SubtitleStreamController",function(){return o});var R=S("./src/events.ts"),T=S("./src/utils/logger.ts"),g=S("./src/utils/buffer-helper.ts"),C=S("./src/controller/fragment-finders.ts"),h=S("./src/utils/discontinuities.ts"),s=S("./src/controller/level-helper.ts"),a=S("./src/controller/fragment-tracker.ts"),r=S("./src/controller/base-stream-controller.ts"),f=S("./src/types/loader.ts"),p=S("./src/types/level.ts");function d(u,w){for(var v=0;v=x[F].start&&j<=x[F].end){_=x[F];break}var L=c.start+c.duration;_?_.end=L:(_={start:j,end:L},x.push(_)),this.fragmentTracker.fragBuffered(c)},v.onBufferFlushing=function(D,k){var c=k.startOffset,b=k.endOffset;if(c===0&&b!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,_=this.levels;if(!_.length||!_[x]||!_[x].details)return;var j=_[x].details,F=j.targetduration,L=b-F;if(L<=0)return;k.endOffsetSubtitles=Math.max(0,L),this.tracksBuffered.forEach(function(X){for(var z=0;z=j.length||x!==_||!F)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(c=F.details)!==null&&c!==void 0&&c.live){var L=this.mainDetails;if(b.deltaUpdateFailed||!L)return;var X=L.fragments[0];if(!F.details)b.hasProgramDateTime&&L.hasProgramDateTime?Object(h.alignMediaPlaylistByPDT)(b,L):X&&Object(s.addSliding)(b,X.start);else{var z=this.alignPlaylists(b,F.details);z===0&&X&&Object(s.addSliding)(b,X.start)}}if(F.details=b,this.levelLastLoaded=x,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===r.State.IDLE){var H=Object(C.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);H||(this.warn("Subtitle playlist not aligned with playback"),F.details=void 0)}},v._handleFragmentLoadComplete=function(D){var k=D.frag,c=D.payload,b=k.decryptdata,x=this.hls;if(this.fragContextChanged(k))return;if(c&&c.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var _=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(c),b.key.buffer,b.iv.buffer).then(function(j){var F=performance.now();x.trigger(R.Events.FRAG_DECRYPTED,{frag:k,payload:j,stats:{tstart:_,tdecrypt:F}})})}},v.doTick=function(){if(!this.media){this.state=r.State.IDLE;return}if(this.state===r.State.IDLE){var D,k=this.currentTrackId,c=this.levels;if(!c.length||!c[k]||!c[k].details)return;var b=c[k].details,x=b.targetduration,_=this.config,j=this.media,F=g.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,j.currentTime-x,_.maxBufferHole),L=F.end,X=F.len,z=this.getMaxBufferLength()+x;if(X>z)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var H=b.fragments,G=H.length,U=b.edge,B,W=this.fragPrevious;if(L-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)},y.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},y.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(o){Object(T.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},y.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},y.onManifestParsed=function(n,o){this.tracks=o.subtitleTracks},y.onSubtitleTrackLoaded=function(n,o){var u=o.id,w=o.details,v=this.trackId,i=this.tracksInGroup[v];if(!i){this.warn("Invalid subtitle track id "+u);return}var D=i.details;i.details=o.details,this.log("subtitle track "+u+" loaded ["+w.startSN+"-"+w.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,o,D))},y.onLevelLoading=function(n,o){this.switchLevel(o.level)},y.onLevelSwitching=function(n,o){this.switchLevel(o.level)},y.switchLevel=function(n){var o=this.hls.levels[n];if(!(o!=null&&o.textGroupIds))return;var u=o.textGroupIds[o.urlId];if(this.groupId!==u){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(k){return!u||k.groupId===u});this.tracksInGroup=v;var i=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=u;var D={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(R.Events.SUBTITLE_TRACKS_UPDATED,D),i!==-1&&this.setSubtitleTrack(i,w)}},y.findTrackId=function(n){for(var o=this.tracksInGroup,u=0;u=w.length)return;this.clearTimer();var v=w[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,v){var i=v.id,D=v.groupId,k=D===void 0?"":D,c=v.name,b=v.type,x=v.url;this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:i,groupId:k,name:c,type:b,url:x});var _=this.switchParams(v.url,o==null?void 0:o.details);this.loadPlaylist(_)}else this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:n})},y.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,o=p(this.media.textTracks),u=0;u=0&&(b[0]=Math.min(b[0],w),b[1]=Math.max(b[1],v),k=!0,x/(v-w)>.5))return}if(k||D.push([w,v]),this.config.renderTextTracksNatively){var _=this.captionsTracks[u];this.Cues.newCue(_,w,v,i)}else{var j=this.Cues.newCue(null,w,v,i);this.hls.trigger(T.Events.CUES_PARSED,{type:"captions",cues:j,track:u})}},n.onInitPtsFound=function(u,w){var v=this,i=w.frag,D=w.id,k=w.initPTS,c=w.timescale,b=this.unparsedVttFrags;D==="main"&&(this.initPTS[i.cc]=k,this.timescale[i.cc]=c),b.length&&(this.unparsedVttFrags=[],b.forEach(function(x){v.onFragLoaded(T.Events.FRAG_LOADED,x)}))},n.getExistingTrack=function(u){var w=this.media;if(w)for(var v=0;v>>8^c&255^99,a[i]=c,r[c]=i;var b=v[i],x=v[b],_=v[x],j=v[c]*257^c*16843008;p[i]=j<<24|j>>>8,d[i]=j<<16|j>>>16,E[i]=j<<8|j>>>24,y[i]=j,j=_*16843009^x*65537^b*257^i*16843008,n[c]=j<<24|j>>>8,o[c]=j<<16|j>>>16,u[c]=j<<8|j>>>24,w[c]=j,i?(i=b^v[v[v[_^b]]],D^=v[v[D]]):i=D=1}},h.expandKey=function(a){for(var r=this.uint8ArrayToUint32Array_(a),f=!0,p=0;p>>6)+1;var j=(u[w+2]&60)>>>2;if(j>_.length-1){o.trigger(g.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+j});return}return k=(u[w+2]&1)<<2,k|=(u[w+3]&192)>>>6,R.logger.log("manifest codec:"+v+", ADTS type:"+i+", samplingIndex:"+j),/firefox/i.test(b)?j>=6?(i=5,c=new Array(4),D=j-3):(i=2,c=new Array(2),D=j):b.indexOf("android")!==-1?(i=2,c=new Array(2),D=j):(i=5,c=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&j>=6?D=j-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(j>=6&&k===1||/vivaldi/i.test(b))||!v&&k===1)&&(i=2,c=new Array(2)),D=j)),c[0]=i<<3,c[0]|=(j&14)>>1,c[1]|=(j&1)<<7,c[1]|=k<<3,i===5&&(c[1]|=(D&14)>>1,c[2]=(D&1)<<7,c[2]|=2<<2,c[3]=0),{config:c,samplerate:_[j],channelCount:k,codec:"mp4a.40."+i,manifestCodec:x}}function h(o,u){return o[u]===255&&(o[u+1]&246)===240}function s(o,u){return o[u+1]&1?7:9}function a(o,u){return(o[u+3]&3)<<11|o[u+4]<<3|(o[u+5]&224)>>>5}function r(o,u){return u+5=o.length)return!1;var v=a(o,u);if(v<=w)return!1;var i=u+v;return i===o.length||f(o,i)}return!1}function E(o,u,w,v,i){if(!o.samplerate){var D=C(u,w,v,i);if(!D)return;o.config=D.config,o.samplerate=D.samplerate,o.channelCount=D.channelCount,o.codec=D.codec,o.manifestCodec=D.manifestCodec,R.logger.log("parsed codec:"+o.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function y(o){return 1024*9e4/o}function l(o,u,w,v,i){var D=s(o,u),k=a(o,u);if(k-=D,k>0){var c=w+v*i;return{headerLength:D,frameLength:k,stamp:c}}}function n(o,u,w,v,i){var D=y(o.samplerate),k=l(u,w,v,i,D);if(k){var c=k.frameLength,b=k.headerLength,x=k.stamp,_=b+c,j=Math.max(0,w+_-u.length),F;j?(F=new Uint8Array(_-b),F.set(u.subarray(w+b,u.length),0)):F=u.subarray(w+b,w+_);var L={unit:F,pts:x};return j||o.samples.push(L),{sample:L,length:_,missing:j}}}},"./src/demux/base-audio-demuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"initPTSFn",function(){return a});var R=S("./src/polyfills/number.ts"),T=S("./src/demux/id3.ts"),g=S("./src/demux/dummy-demuxed-track.ts"),C=S("./src/utils/mp4-tools.ts"),h=S("./src/utils/typed-array.ts"),s=function(){function r(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=r.prototype;return f.resetInitSegment=function(d,E,y){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(d,E){return!1},f.appendFrame=function(d,E,y){},f.demux=function(d,E){this.cachedData&&(d=Object(C.appendUint8Array)(this.cachedData,d),this.cachedData=null);var y=T.getID3Data(d,0),l=y?y.length:0,n,o,u=this._audioTrack,w=this._id3Track,v=y?T.getTimeStamp(y):void 0,i=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=a(v,E)),y&&y.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:y}),o=this.initPTS;ls?(this.word<<=s,this.bitsAvailable-=s):(s-=this.bitsAvailable,a=s>>3,s-=a>>3,this.bytesAvailable-=a,this.loadWord(),this.word<<=s,this.bitsAvailable-=s)},C.readBits=function(s){var a=Math.min(this.bitsAvailable,s),r=this.word>>>32-a;return s>32&&R.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=a,this.bitsAvailable>0?this.word<<=a:this.bytesAvailable>0&&this.loadWord(),a=s-a,a>0&&this.bitsAvailable?r<>>s)!==0)return this.word<<=s,this.bitsAvailable-=s,s;return this.loadWord(),s+this.skipLZ()},C.skipUEG=function(){this.skipBits(1+this.skipLZ())},C.skipEG=function(){this.skipBits(1+this.skipLZ())},C.readUEG=function(){var s=this.skipLZ();return this.readBits(s+1)-1},C.readEG=function(){var s=this.readUEG();return 1&s?1+s>>>1:-1*(s>>>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(s){for(var a=8,r=8,f,p=0;p0?i.subarray(k,k+c):void 0},C=function(i,D){var k=0;return k=(i[D]&127)<<21,k|=(i[D+1]&127)<<14,k|=(i[D+2]&127)<<7,k|=i[D+3]&127,k},h=function(i,D){return R(i,D)&&C(i,D+6)+10<=i.length-D},s=function(i){for(var D=f(i),k=0;k>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:L+=String.fromCharCode(_);break;case 12:case 13:j=i[X++],L+=String.fromCharCode((_&31)<<6|j&63);break;case 14:j=i[X++],F=i[X++],L+=String.fromCharCode((_&15)<<12|(j&63)<<6|(F&63)<<0);break;default:}}return L},o={decodeTextFrame:E},u;function w(){return!u&&typeof self.TextDecoder!="undefined"&&(u=new self.TextDecoder("utf-8")),u}},"./src/demux/mp3demuxer.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/id3.ts"),g=S("./src/utils/logger.ts"),C=S("./src/demux/mpegaudio.ts");function h(r,f){r.prototype=Object.create(f.prototype),r.prototype.constructor=r,s(r,f)}function s(r,f){return s=Object.setPrototypeOf||function(d,E){return d.__proto__=E,d},s(r,f)}var a=function(r){h(f,r);function f(){return r.apply(this,arguments)||this}var p=f.prototype;return p.resetInitSegment=function(E,y,l){r.prototype.resetInitSegment.call(this,E,y,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:E,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(E){if(!E)return!1;for(var y=T.getID3Data(E,0)||[],l=y.length,n=E.length;l0},h.demux=function(a){var r=a,f=Object(T.dummyTrack)();if(this.config.progressive){this.remainderData&&(r=Object(R.appendUint8Array)(this.remainderData,a));var p=Object(R.segmentValidRange)(r);this.remainderData=p.remainder,f.samples=p.valid||new Uint8Array}else f.samples=r;return{audioTrack:Object(T.dummyTrack)(),avcTrack:f,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},h.flush=function(){var a=Object(T.dummyTrack)();return a.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(T.dummyTrack)(),avcTrack:a,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},h.demuxSampleAes=function(a,r,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},h.destroy=function(){},C}();g.minProbeByteLength=1024,m.default=g},"./src/demux/mpegaudio.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"appendFrame",function(){return s}),S.d(m,"parseHeader",function(){return a}),S.d(m,"isHeaderPattern",function(){return r}),S.d(m,"isHeader",function(){return f}),S.d(m,"canParse",function(){return p}),S.d(m,"probe",function(){return d});var R=null,T=[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],g=[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]],h=[0,1,1,4];function s(E,y,l,n,o){if(l+24>y.length)return;var u=a(y,l);if(u&&l+u.frameLength<=y.length){var w=u.samplesPerFrame*9e4/u.sampleRate,v=n+o*w,i={unit:y.subarray(l,l+u.frameLength),pts:v,dts:v};return E.config=[],E.channelCount=u.channelCount,E.samplerate=u.sampleRate,E.samples.push(i),{sample:i,length:u.frameLength,missing:0}}}function a(E,y){var l=E[y+1]>>3&3,n=E[y+1]>>1&3,o=E[y+2]>>4&15,u=E[y+2]>>2&3;if(l!==1&&o!==0&&o!==15&&u!==3){var w=E[y+2]>>1&1,v=E[y+3]>>6,i=l===3?3-n:n===3?3:4,D=T[i*14+o-1]*1e3,k=l===3?0:l===2?1:2,c=g[k*3+u],b=v===3?1:2,x=C[l][n],_=h[n],j=x*8*_,F=Math.floor(x*D/c+w)*_;if(R===null){var L=navigator.userAgent||"",X=L.match(/Chrome\/(\d+)/i);R=X?parseInt(X[1]):0}var z=!!R&&R<=87;return z&&n===2&&D>=224e3&&v===0&&(E[y+3]=E[y+3]|128),{sampleRate:c,channelCount:b,frameLength:F,samplesPerFrame:j}}}function r(E,y){return E[y]===255&&(E[y+1]&224)===224&&(E[y+1]&6)!==0}function f(E,y){return y+1=a.length){f();return}if(a[r].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(a,r,f,p),!p)return}},h.getAvcEncryptedData=function(a){for(var r=Math.floor((a.length-48)/160)*16+16,f=new Int8Array(r),p=0,d=32;d<=a.length-16;d+=160,p+=16)f.set(a.subarray(d,d+16),p);return f},h.getAvcDecryptedUnit=function(a,r){for(var f=new Uint8Array(r),p=0,d=32;d<=a.length-16;d+=160,p+=16)a.set(f.subarray(p,p+16),d);return a},h.decryptAvcSample=function(a,r,f,p,d,E){var y=Object(T.discardEPB)(d.data),l=this.getAvcEncryptedData(y),n=this;this.decryptBuffer(l.buffer,function(o){d.data=n.getAvcDecryptedUnit(y,o),E||n.decryptAvcSamples(a,r,f+1,p)})},h.decryptAvcSamples=function(a,r,f,p){if(a instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;r++,f=0){if(r>=a.length){p();return}for(var d=a[r].units;!(f>=d.length);f++){var E=d[f];if(E.data.length<=48||E.type!==1&&E.type!==5)continue;var y=this.decrypter.isSync();if(this.decryptAvcSample(a,r,f,p,E,y),!y)return}}},C}();m.default=g},"./src/demux/transmuxer-interface.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return d});var R=S("./node_modules/webworkify-webpack/index.js"),T=S.n(R),g=S("./src/events.ts"),C=S("./src/demux/transmuxer.ts"),h=S("./src/utils/logger.ts"),s=S("./src/errors.ts"),a=S("./src/utils/mediasource-helper.ts"),r=S("./node_modules/eventemitter3/index.js"),f=S.n(r),p=Object(a.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function E(l,n,o,u){var w=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=l,this.id=n,this.onTransmuxComplete=o,this.onFlush=u;var v=l.config,i=function(x,_){_=_||{},_.frag=w.frag,_.id=w.id,l.trigger(x,_)};this.observer=new r.EventEmitter,this.observer.on(g.Events.FRAG_DECRYPTED,i),this.observer.on(g.Events.ERROR,i);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},k=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){h.logger.log("demuxing in webworker");var c;try{c=this.worker=R("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),c.addEventListener("message",this.onwmsg),c.onerror=function(b){l.trigger(g.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},c.postMessage({cmd:"init",typeSupported:D,vendor:k,id:n,config:JSON.stringify(v)})}catch(b){h.logger.warn("Error in worker:",b),h.logger.error("Error while initializing DemuxerWorker, fallback to inline"),c&&self.URL.revokeObjectURL(c.objectURL),this.transmuxer=new C.default(this.observer,D,v,k,n),this.worker=null}}else this.transmuxer=new C.default(this.observer,D,v,k,n)}var y=E.prototype;return y.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.observer=null},y.push=function(n,o,u,w,v,i,D,k,c,b){var x=this;c.transmuxing.start=self.performance.now();var _=this.transmuxer,j=this.worker,F=i?i.start:v.start,L=v.decryptdata,X=this.frag,z=!(X&&v.cc===X.cc),H=!(X&&c.level===X.level),G=X?c.sn-X.sn:-1,U=this.part?c.part-this.part.index:1,B=!H&&(G===1||G===0&&U===1),W=self.performance.now();(H||G||v.stats.parsing.start===0)&&(v.stats.parsing.start=W),i&&(U||!B)&&(i.stats.parsing.start=W);var te=new C.TransmuxState(z,B,k,H,F);if(!B||z){h.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+` discontinuity: `+z+` trackSwitch: `+H+` contiguous: `+B+` accurateTimeOffset: `+k+` timeOffset: `+F);var de=new C.TransmuxConfig(u,w,o,D,b);this.configureTransmuxer(de)}if(this.frag=v,this.part=i,j)j.postMessage({cmd:"demux",data:n,decryptdata:L,chunkMeta:c,state:te},n instanceof ArrayBuffer?[n]:[]);else if(_){var fe=_.push(n,L,c,te);Object(C.isPromise)(fe)?fe.then(function(be){x.handleTransmuxComplete(be)}):this.handleTransmuxComplete(fe)}},y.flush=function(n){var o=this;n.transmuxing.start=self.performance.now();var u=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:n});else if(u){var v=u.flush(n);Object(C.isPromise)(v)?v.then(function(i){o.handleFlushResult(i,n)}):this.handleFlushResult(v,n)}},y.handleFlushResult=function(n,o){var u=this;n.forEach(function(w){u.handleTransmuxComplete(w)}),this.onFlush(o)},y.onWorkerMessage=function(n){var o=n.data,u=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,u.trigger(o.event,o.data);break}}},y.configureTransmuxer=function(n){var o=this.worker,u=this.transmuxer;o?o.postMessage({cmd:"configure",config:n}):u&&u.configure(n)},y.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},E}()},"./src/demux/transmuxer-worker.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return s});var R=S("./src/demux/transmuxer.ts"),T=S("./src/events.ts"),g=S("./src/utils/logger.ts"),C=S("./node_modules/eventemitter3/index.js"),h=S.n(C);function s(d){var E=new C.EventEmitter,y=function(n,o){d.postMessage({event:n,data:o})};E.on(T.Events.FRAG_DECRYPTED,y),E.on(T.Events.ERROR,y),d.addEventListener("message",function(l){var n=l.data;switch(n.cmd){case"init":{var o=JSON.parse(n.config);d.transmuxer=new R.default(E,n.typeSupported,o,n.vendor,n.id),Object(g.enableLogs)(o.debug),y("init",null);break}case"configure":{d.transmuxer.configure(n.config);break}case"demux":{var u=d.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(R.isPromise)(u)?u.then(function(i){a(d,i)}):a(d,u);break}case"flush":{var w=n.chunkMeta,v=d.transmuxer.flush(w);Object(R.isPromise)(v)?v.then(function(i){f(d,i,w)}):f(d,v,w);break}default:break}})}function a(d,E){if(p(E.remuxResult))return;var y=[],l=E.remuxResult,n=l.audio,o=l.video;n&&r(y,n),o&&r(y,o),d.postMessage({event:"transmuxComplete",data:E},y)}function r(d,E){E.data1&&d.push(E.data1.buffer),E.data2&&d.push(E.data2.buffer)}function f(d,E,y){E.forEach(function(l){a(d,l)}),d.postMessage({event:"flush",data:y})}function p(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return o}),S.d(m,"isPromise",function(){return v}),S.d(m,"TransmuxConfig",function(){return i}),S.d(m,"TransmuxState",function(){return D});var R=S("./src/events.ts"),T=S("./src/errors.ts"),g=S("./src/crypt/decrypter.ts"),C=S("./src/demux/aacdemuxer.ts"),h=S("./src/demux/mp4demuxer.ts"),s=S("./src/demux/tsdemuxer.ts"),a=S("./src/demux/mp3demuxer.ts"),r=S("./src/remux/mp4-remuxer.ts"),f=S("./src/remux/passthrough-remuxer.ts"),p=S("./src/demux/chunk-cache.ts"),d=S("./src/utils/mp4-tools.ts"),E=S("./src/utils/logger.ts"),y;try{y=self.performance.now.bind(self.performance)}catch(k){E.logger.debug("Unable to use Performance API on this environment"),y=self.Date.now}var l=[{demux:s.default,remux:r.default},{demux:h.default,remux:f.default},{demux:C.default,remux:r.default},{demux:a.default,remux:r.default}],n=1024;l.forEach(function(k){var c=k.demux;n=Math.max(n,c.minProbeByteLength)});var o=function(){function k(b,x,_,j,F){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=b,this.typeSupported=x,this.config=_,this.vendor=j,this.id=F}var c=k.prototype;return c.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},c.push=function(x,_,j,F){var L=this,X=j.transmuxing;X.executeStart=y();var z=new Uint8Array(x),H=this.cache,G=this.config,U=this.currentTransmuxState,B=this.transmuxConfig;F&&(this.currentTransmuxState=F);var W=u(z,_);if(W&&W.method==="AES-128"){var te=this.getDecrypter();if(G.enableSoftwareAES){var de=te.softwareDecrypt(z,W.key.buffer,W.iv.buffer);if(!de)return X.executeEnd=y(),w(j);z=new Uint8Array(de)}else return this.decryptionPromise=te.webCryptoDecrypt(z,W.key.buffer,W.iv.buffer).then(function(J){var V=L.push(J,null,j);return L.decryptionPromise=null,V}),this.decryptionPromise}var fe=F||U,be=fe.contiguous,Ce=fe.discontinuity,ue=fe.trackSwitch,ge=fe.accurateTimeOffset,pe=fe.timeOffset,oe=B.audioCodec,ae=B.videoCodec,re=B.defaultInitPts,he=B.duration,Q=B.initSegmentData;if((Ce||ue)&&this.resetInitSegment(Q,oe,ae,he),Ce&&this.resetInitialTimestamp(re),be||this.resetContiguity(),this.needsProbing(z,Ce,ue)){if(H.dataLength){var ie=H.flush();z=Object(d.appendUint8Array)(ie,z)}this.configureTransmuxer(z,B)}var we=this.transmux(z,W,pe,ge,j),ne=this.currentTransmuxState;return ne.contiguous=!0,ne.discontinuity=!1,ne.trackSwitch=!1,X.executeEnd=y(),we},c.flush=function(x){var _=this,j=x.transmuxing;j.executeStart=y();var F=this.decrypter,L=this.cache,X=this.currentTransmuxState,z=this.decryptionPromise;if(z)return z.then(function(){return _.flush(x)});var H=[],G=X.timeOffset;if(F){var U=F.flush();U&&H.push(this.push(U,null,x))}var B=L.dataLength;L.reset();var W=this.demuxer,te=this.remuxer;if(!W||!te)return B>=n&&this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),j.executeEnd=y(),[w(x)];var de=W.flush(G);return v(de)?de.then(function(fe){return _.flushRemux(H,fe,x),H}):(this.flushRemux(H,de,x),H)},c.flushRemux=function(x,_,j){var F=_.audioTrack,L=_.avcTrack,X=_.id3Track,z=_.textTrack,H=this.currentTransmuxState,G=H.accurateTimeOffset,U=H.timeOffset;E.logger.log("[transmuxer.ts]: Flushed fragment "+j.sn+(j.part>-1?" p: "+j.part:"")+" of level "+j.level);var B=this.remuxer.remux(F,L,X,z,U,G,!0,this.id);x.push({remuxResult:B,chunkMeta:j}),j.transmuxing.executeEnd=y()},c.resetInitialTimestamp=function(x){var _=this.demuxer,j=this.remuxer;if(!_||!j)return;_.resetTimeStamp(x),j.resetTimeStamp(x)},c.resetContiguity=function(){var x=this.demuxer,_=this.remuxer;if(!x||!_)return;x.resetContiguity(),_.resetNextTimestamp()},c.resetInitSegment=function(x,_,j,F){var L=this.demuxer,X=this.remuxer;if(!L||!X)return;L.resetInitSegment(_,j,F),X.resetInitSegment(x,_,j)},c.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},c.transmux=function(x,_,j,F,L){var X;return _&&_.method==="SAMPLE-AES"?X=this.transmuxSampleAes(x,_,j,F,L):X=this.transmuxUnencrypted(x,j,F,L),X},c.transmuxUnencrypted=function(x,_,j,F){var L=this.demuxer.demux(x,_,!1,!this.config.progressive),X=L.audioTrack,z=L.avcTrack,H=L.id3Track,G=L.textTrack,U=this.remuxer.remux(X,z,H,G,_,j,!1,this.id);return{remuxResult:U,chunkMeta:F}},c.transmuxSampleAes=function(x,_,j,F,L){var X=this;return this.demuxer.demuxSampleAes(x,_,j).then(function(z){var H=X.remuxer.remux(z.audioTrack,z.avcTrack,z.id3Track,z.textTrack,j,F,!1,X.id);return{remuxResult:H,chunkMeta:L}})},c.configureTransmuxer=function(x,_){for(var j=this.config,F=this.observer,L=this.typeSupported,X=this.vendor,z=_.audioCodec,H=_.defaultInitPts,G=_.duration,U=_.initSegmentData,B=_.videoCodec,W,te=0,de=l.length;te0&&c!=null&&c.key!=null&&c.iv!==null&&c.method!=null&&(b=c),b}var w=function(c){return{remuxResult:{},chunkMeta:c}};function v(k){return"then"in k&&k.then instanceof Function}var i=function(c,b,x,_,j){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=c,this.videoCodec=b,this.initSegmentData=x,this.duration=_,this.defaultInitPts=j},D=function(c,b,x,_,j){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=c,this.contiguous=b,this.accurateTimeOffset=x,this.trackSwitch=_,this.timeOffset=j}},"./src/demux/tsdemuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"discardEPB",function(){return w});var R=S("./src/demux/adts.ts"),T=S("./src/demux/mpegaudio.ts"),g=S("./src/demux/exp-golomb.ts"),C=S("./src/demux/id3.ts"),h=S("./src/demux/sample-aes.ts"),s=S("./src/events.ts"),a=S("./src/utils/mp4-tools.ts"),r=S("./src/utils/logger.ts"),f=S("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},d=function(){function v(D,k,c){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=D,this.config=k,this.typeSupported=c}v.probe=function(k){var c=v.syncOffset(k);return c<0?!1:(c&&r.logger.warn("MPEG2-TS detected but first sync word found @ offset "+c+", junk ahead ?"),!0)},v.syncOffset=function(k){for(var c=Math.min(1e3,k.length-3*188),b=0;b>4,oe=void 0;if(pe>1){if(oe=Ce+5+k[Ce+4],oe===Ce+188)continue}else oe=Ce+4;switch(ge){case X:ue&&(z&&(_=n(z))&&this.parseAVCPES(_,!1),z={data:[],size:0}),z&&(z.data.push(k.subarray(oe,Ce+188)),z.size+=Ce+188-oe);break;case H:ue&&(U&&(_=n(U))&&(F.isAAC?this.parseAACPES(_):this.parseMPEGPES(_)),U={data:[],size:0}),U&&(U.data.push(k.subarray(oe,Ce+188)),U.size+=Ce+188-oe);break;case G:ue&&(B&&(_=n(B))&&this.parseID3PES(_),B={data:[],size:0}),B&&(B.data.push(k.subarray(oe,Ce+188)),B.size+=Ce+188-oe);break;case 0:ue&&(oe+=k[oe]+1),de=this._pmtId=y(k,oe);break;case de:{ue&&(oe+=k[oe]+1);var ae=l(k,oe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);X=ae.avc,X>0&&(j.pid=X),H=ae.audio,H>0&&(F.pid=H,F.isAAC=ae.isAAC),G=ae.id3,G>0&&(L.pid=G),W&&!te&&(r.logger.log("reparse from beginning"),W=!1,Ce=be-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});j.pesData=z,F.pesData=U,L.pesData=B;var re={audioTrack:F,avcTrack:j,id3Track:L,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(re),re},i.flush=function(){var k=this.remainderData;this.remainderData=null;var c;return k?c=this.demux(k,-1,!1,!0):c={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(c),this.sampleAes?this.decrypt(c,this.sampleAes):c},i.extractRemainingSamples=function(k){var c=k.audioTrack,b=k.avcTrack,x=k.id3Track,_=b.pesData,j=c.pesData,F=x.pesData,L;_&&(L=n(_))?(this.parseAVCPES(L,!0),b.pesData=null):b.pesData=_,j&&(L=n(j))?(c.isAAC?this.parseAACPES(L):this.parseMPEGPES(L),c.pesData=null):(j!=null&&j.size&&r.logger.log("last AAC PES packet truncated,might overlap between fragments"),c.pesData=j),F&&(L=n(F))?(this.parseID3PES(L),x.pesData=null):x.pesData=F},i.demuxSampleAes=function(k,c,b){var x=this.demux(k,b,!0,!this.config.progressive),_=this.sampleAes=new h.default(this.observer,this.config,c);return this.decrypt(x,_)},i.decrypt=function(k,c){return new Promise(function(b){var x=k.audioTrack,_=k.avcTrack;x.samples&&x.isAAC?c.decryptAacSamples(x.samples,0,function(){_.samples?c.decryptAvcSamples(_.samples,0,0,function(){b(k)}):b(k)}):_.samples&&c.decryptAvcSamples(_.samples,0,0,function(){b(k)})})},i.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},i.parseAVCPES=function(k,c){var b=this,x=this._avcTrack,_=this.parseAVCNALu(k.data),j=!1,F=this.avcSample,L,X=!1;k.data=null,F&&_.length&&!x.audFound&&(o(F,x),F=this.avcSample=E(!1,k.pts,k.dts,"")),_.forEach(function(z){switch(z.type){case 1:{L=!0,F||(F=b.avcSample=E(!0,k.pts,k.dts,"")),j&&(F.debug+="NDR "),F.frame=!0;var H=z.data;if(X&&H.length>4){var G=new g.default(H).readSliceType();(G===2||G===4||G===7||G===9)&&(F.key=!0)}break}case 5:L=!0,F||(F=b.avcSample=E(!0,k.pts,k.dts,"")),j&&(F.debug+="IDR "),F.key=!0,F.frame=!0;break;case 6:{L=!0,j&&F&&(F.debug+="SEI ");var U=new g.default(w(z.data));U.readUByte();for(var B=0,W=0,te=!1,de=0;!te&&U.bytesAvailable>1;){B=0;do de=U.readUByte(),B+=de;while(de===255);W=0;do de=U.readUByte(),W+=de;while(de===255);if(B===4&&U.bytesAvailable!==0){te=!0;var fe=U.readUByte();if(fe===181){var be=U.readUShort();if(be===49){var Ce=U.readUInt();if(Ce===1195456820){var ue=U.readUByte();if(ue===3){for(var ge=U.readUByte(),pe=U.readUByte(),oe=31&ge,ae=[ge,pe],re=0;re16){for(var he=[],Q=0;Q<16;Q++)he.push(U.readUByte().toString(16)),(Q===3||Q===5||Q===7||Q===9)&&he.push("-");for(var ie=W-16,we=new Uint8Array(ie),ne=0;ne=0){var U={data:k.subarray(H,F-x-1),type:G};j.push(U)}else{var B=this.getLastNalUnit();if(B&&(_&&F<=4-_&&(B.state&&(B.data=B.data.subarray(0,B.data.byteLength-_))),X=F-x-1,X>0)){var W=new Uint8Array(B.data.byteLength+X);W.set(B.data,0),W.set(k.subarray(0,X),B.data.byteLength),B.data=W,B.state=0}}F=0&&x>=0){var te={data:k.subarray(H,c),type:G,state:x};j.push(te)}if(j.length===0){var de=this.getLastNalUnit();if(de){var fe=new Uint8Array(de.data.byteLength+k.byteLength);fe.set(de.data,0),fe.set(k,de.data.byteLength),de.data=fe}}return b.naluState=x,j},i.parseAACPES=function(k){var c=0,b=this._audioTrack,x=this.aacOverFlow,_=k.data;if(x){this.aacOverFlow=null;var j=x.sample.unit.byteLength,F=Math.min(x.missing,j),L=j-F;x.sample.unit.set(_.subarray(0,F),L),b.samples.push(x.sample),c=x.missing}var X,z;for(X=c,z=_.length;X1;){var j=new Uint8Array(_[0].length+_[1].length);j.set(_[0]),j.set(_[1],_[0].length),_[0]=j,_.splice(1,1)}D=_[0];var F=(D[0]<<16)+(D[1]<<8)+D[2];if(F===1){if(k=(D[4]<<8)+D[5],k&&k>v.size-6)return null;var L=D[7];L&192&&(b=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,L&64?(x=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,b-x>60*9e4&&(r.logger.warn(Math.round((b-x)/9e4)+"s delta between PTS and DTS, align them"),b=x)):x=b),c=D[8];var X=c+9;if(v.size<=X)return null;v.size-=X;for(var z=new Uint8Array(v.size),H=0,G=_.length;HU){X-=U;continue}else D=D.subarray(X),U-=X,X=0;z.set(D,i),i+=U}return k&&(k-=c+3),{data:z,pts:b,dts:x,len:k}}return null}function o(v,i){if(v.units.length&&v.frame){if(v.pts===void 0){var D=i.samples,k=D.length;if(k){var c=D[k-1];v.pts=c.pts,v.dts=c.dts}else{i.dropped++;return}}i.samples.push(v)}v.debug.length&&r.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function u(v,i){var D=v.length;if(D>0){if(i.pts>=v[D-1].pts)v.push(i);else for(var k=D-1;k>=0;k--)if(i.ptsb)return _;return 0}},{key:"maxAutoLevel",get:function(){var c=this.levels,b=this.autoLevelCapping,x;return b===-1&&c&&c.length?x=c.length-1:x=b,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(c){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,c)}},{key:"audioTracks",get:function(){var c=this.audioTrackController;return c?c.audioTracks:[]}},{key:"audioTrack",get:function(){var c=this.audioTrackController;return c?c.audioTrack:-1},set:function(c){var b=this.audioTrackController;b&&(b.audioTrack=c)}},{key:"subtitleTracks",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTrack:-1},set:function(c){var b=this.subtitleTrackController;b&&(b.subtitleTrack=c)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var c=this.subtitleTrackController;return c?c.subtitleDisplay:!1},set:function(c){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=c)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(c){this.config.lowLatencyMode=c}},{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 o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return i.defaultConfig?i.defaultConfig:E.hlsDefaultConfig},set:function(c){i.defaultConfig=c}}]),i}();v.defaultConfig=void 0},"./src/is-supported.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"isSupported",function(){return g}),S.d(m,"changeTypeSupported",function(){return C});var R=S("./src/utils/mediasource-helper.ts");function T(){return self.SourceBuffer||self.WebKitSourceBuffer}function g(){var h=Object(R.getMediaSource)();if(!h)return!1;var s=T(),a=h&&typeof h.isTypeSupported=="function"&&h.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!s||s.prototype&&typeof s.prototype.appendBuffer=="function"&&typeof s.prototype.remove=="function";return!!a&&!!r}function C(){var h,s=T();return typeof(s==null||((h=s.prototype)===null||h===void 0)?void 0:h.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return d}),S.d(m,"LoadError",function(){return y});var R=S("./src/polyfills/number.ts"),T=S("./src/errors.ts");function g(l,n){l.prototype=Object.create(n.prototype),l.prototype.constructor=l,r(l,n)}function C(l){var n=typeof Map=="function"?new Map:void 0;return C=function(u){if(u===null||!a(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(u))return n.get(u);n.set(u,w)}function w(){return h(u,arguments,f(this).constructor)}return w.prototype=Object.create(u.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),r(w,u)},C(l)}function h(l,n,o){return s()?h=Reflect.construct:h=function(w,v,i){var D=[null];D.push.apply(D,v);var k=Function.bind.apply(w,D),c=new k;return i&&r(c,i.prototype),c},h.apply(null,arguments)}function s(){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(l){return!1}}function a(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function r(l,n){return r=Object.setPrototypeOf||function(u,w){return u.__proto__=w,u},r(l,n)}function f(l){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},f(l)}var p=Math.pow(2,17),d=function(){function l(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var n=l.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(u,w){var v=this,i=u.url;if(!i)return Promise.reject(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var D=this.config,k=D.fLoader,c=D.loader;return new Promise(function(b,x){v.loader&&v.loader.destroy();var _=v.loader=u.loader=k?new k(D):new c(D),j=E(u),F={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};u.stats=_.stats,_.load(j,F,{onSuccess:function(X,z,H,G){v.resetLoader(u,_),b({frag:u,part:null,payload:X.data,networkDetails:G})},onError:function(X,z,H){v.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,response:X,networkDetails:H}))},onAbort:function(X,z,H){v.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,networkDetails:H}))},onTimeout:function(X,z,H){v.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,networkDetails:H}))},onProgress:function(X,z,H,G){w&&w({frag:u,part:null,payload:H,networkDetails:G})}})})},n.loadPart=function(u,w,v){var i=this;this.abort();var D=this.config,k=D.fLoader,c=D.loader;return new Promise(function(b,x){i.loader&&i.loader.destroy();var _=i.loader=u.loader=k?new k(D):new c(D),j=E(u,w),F={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};w.stats=_.stats,_.load(j,F,{onSuccess:function(X,z,H,G){i.resetLoader(u,_),i.updateStatsFromPart(u,w);var U={frag:u,part:w,payload:X.data,networkDetails:G};v(U),b(U)},onError:function(X,z,H){i.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,part:w,response:X,networkDetails:H}))},onAbort:function(X,z,H){u.stats.aborted=w.stats.aborted,i.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,part:w,networkDetails:H}))},onTimeout:function(X,z,H){i.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,part:w,networkDetails:H}))}})})},n.updateStatsFromPart=function(u,w){var v=u.stats,i=w.stats,D=i.total;if(v.loaded+=i.loaded,D){var k=Math.round(u.duration/w.duration),c=Math.min(Math.round(v.loaded/D),k),b=k-c,x=b*Math.round(v.loaded/c);v.total=v.loaded+x}else v.total=Math.max(v.loaded,v.total);var _=v.loading,j=i.loading;_.start?_.first+=j.first-j.start:(_.start=j.start,_.first=j.first),_.end=j.end},n.resetLoader=function(u,w){u.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},l}();function E(l,n){n===void 0&&(n=null);var o=n||l,u={frag:l,part:n,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},w=o.byteRangeStartOffset,v=o.byteRangeEndOffset;return Object(R.isFiniteNumber)(w)&&Object(R.isFiniteNumber)(v)&&(u.rangeStart=w,u.rangeEnd=v),u}var y=function(l){g(n,l);function n(o){for(var u,w=arguments.length,v=new Array(w>1?w-1:0),i=1;i>8*(15-D)&255;return i},u.setDecryptDataFromLevelKey=function(v,i){var D=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(D=h.LevelKey.fromURI(v.uri),D.method=v.method,D.iv=this.createInitializationVector(i),D.keyFormat="identity"),D},u.setElementaryStreamInfo=function(v,i,D,k,c,b){b===void 0&&(b=!1);var x=this.elementaryStreams,_=x[v];if(!_){x[v]={startPTS:i,endPTS:D,startDTS:k,endDTS:c,partial:b};return}_.startPTS=Math.min(_.startPTS,i),_.endPTS=Math.max(_.endPTS,D),_.startDTS=Math.min(_.startDTS,k),_.endDTS=Math.max(_.endDTS,c)},u.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[d.AUDIO]=null,v[d.VIDEO]=null,v[d.AUDIOVIDEO]=null},p(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&C.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(R.isFiniteNumber)(this.programDateTime))return null;var v=Object(R.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),o}(E),l=function(n){a(o,n);function o(u,w,v,i,D){var k;k=n.call(this,v)||this,k.fragOffset=0,k.duration=0,k.gap=!1,k.independent=!1,k.relurl=void 0,k.fragment=void 0,k.index=void 0,k.stats=new s.LoadStats,k.duration=u.decimalFloatingPoint("DURATION"),k.gap=u.bool("GAP"),k.independent=u.bool("INDEPENDENT"),k.relurl=u.enumeratedString("URI"),k.fragment=w,k.index=i;var c=u.enumeratedString("BYTERANGE");return c&&k.setByteRange(c,D),D&&(k.fragOffset=D.fragOffset+D.duration),k}return p(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var w=this.elementaryStreams;return!!(w.audio||w.video||w.audiovideo)}}]),o}(E)},"./src/loader/key-loader.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return C});var R=S("./src/events.ts"),T=S("./src/errors.ts"),g=S("./src/utils/logger.ts"),C=function(){function h(a){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=a,this._registerListeners()}var s=h.prototype;return s._registerListeners=function(){this.hls.on(R.Events.KEY_LOADING,this.onKeyLoading,this)},s._unregisterListeners=function(){this.hls.off(R.Events.KEY_LOADING,this.onKeyLoading)},s.destroy=function(){this._unregisterListeners();for(var r in this.loaders){var f=this.loaders[r];f&&f.destroy()}this.loaders={}},s.onKeyLoading=function(r,f){var p=f.frag,d=p.type,E=this.loaders[d];if(!p.decryptdata){g.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var y=p.decryptdata.uri;if(y!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(E&&(g.logger.warn("abort previous key loader for type:"+d),E.abort()),!y){g.logger.warn("key uri is falsy");return}var n=l.loader,o=p.loader=this.loaders[d]=new n(l);this.decrypturl=y,this.decryptkey=null;var u={url:y,frag:p,responseType:"arraybuffer"},w={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(u,w,v)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(R.Events.KEY_LOADED,{frag:p}))},s.loadsuccess=function(r,f,p){var d=p.frag;if(!d.decryptdata){g.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(r.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(R.Events.KEY_LOADED,{frag:d})},s.loaderror=function(r,f){var p=f.frag,d=p.loader;d&&d.abort(),delete this.loaders[p.type],this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:r})},s.loadtimeout=function(r,f){var p=f.frag,d=p.loader;d&&d.abort(),delete this.loaders[p.type],this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},h}()},"./src/loader/level-details.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"LevelDetails",function(){return h});var R=S("./src/polyfills/number.ts");function T(s,a){for(var r=0;rf.endSN||p>0||p===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},g(s,[{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 f=this.driftEndTime-this.driftStartTime;if(f>0){var p=this.driftEnd-this.driftStart;return p*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),s}()},"./src/loader/level-key.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"LevelKey",function(){return h});var R=S("./node_modules/url-toolkit/src/url-toolkit.js"),T=S.n(R);function g(s,a){for(var r=0;r2){var x=b.shift()+".";return x+=parseInt(b.shift()).toString(16),x+=("000"+parseInt(b.shift()).toString(16)).substr(-4),x}return c},D.resolve=function(c,b){return T.buildAbsoluteURL(b,c,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(c,b){var x=[],_={},j=!1;p.lastIndex=0;for(var F;(F=p.exec(c))!=null;)if(F[1]){var L=new a.AttrList(F[1]),X={attrs:L,bitrate:L.decimalInteger("AVERAGE-BANDWIDTH")||L.decimalInteger("BANDWIDTH"),name:L.NAME,url:D.resolve(F[2],b)},z=L.decimalResolution("RESOLUTION");z&&(X.width=z.width,X.height=z.height),u((L.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),X),X.videoCodec&&X.videoCodec.indexOf("avc1")!==-1&&(X.videoCodec=D.convertAVC1ToAVCOTI(X.videoCodec)),x.push(X)}else if(F[3]){var H=new a.AttrList(F[3]);H["DATA-ID"]&&(j=!0,_[H["DATA-ID"]]=H)}return{levels:x,sessionData:j?_:null}},D.parseMasterPlaylistMedia=function(c,b,x,_){_===void 0&&(_=[]);var j,F=[],L=0;for(d.lastIndex=0;(j=d.exec(c))!==null;){var X=new a.AttrList(j[1]);if(X.TYPE===x){var z={attrs:X,bitrate:0,id:L++,groupId:X["GROUP-ID"],instreamId:X["INSTREAM-ID"],name:X.NAME||X.LANGUAGE||"",type:x,default:X.bool("DEFAULT"),autoselect:X.bool("AUTOSELECT"),forced:X.bool("FORCED"),lang:X.LANGUAGE,url:X.URI?D.resolve(X.URI,b):""};if(_.length){var H=D.findGroup(_,z.groupId)||_[0];w(z,H,"audioCodec"),w(z,H,"textCodec")}F.push(z)}}return F},D.parseLevelPlaylist=function(c,b,x,_,j){var F=new h.LevelDetails(b),L=F.fragments,X=null,z=0,H=0,G=0,U=0,B=null,W=new C.Fragment(_,b),te,de,fe,be=-1,Ce=!1;for(E.lastIndex=0,F.m3u8=c;(te=E.exec(c))!==null;){Ce&&(Ce=!1,W=new C.Fragment(_,b),W.start=G,W.sn=z,W.cc=U,W.level=x,X&&(W.initSegment=X,W.rawProgramDateTime=X.rawProgramDateTime));var ue=te[1];if(ue){W.duration=parseFloat(ue);var ge=(" "+te[2]).slice(1);W.title=ge||null,W.tagList.push(ge?["INF",ue,ge]:["INF",ue])}else if(te[3])Object(R.isFiniteNumber)(W.duration)&&(W.start=G,fe&&(W.levelkey=fe),W.sn=z,W.level=x,W.cc=U,W.urlId=j,L.push(W),W.relurl=(" "+te[3]).slice(1),i(W,B),B=W,G+=W.duration,z++,H=0,Ce=!0);else if(te[4]){var pe=(" "+te[4]).slice(1);B?W.setByteRange(pe,B):W.setByteRange(pe)}else if(te[5])W.rawProgramDateTime=(" "+te[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),be===-1&&(be=L.length);else{if(te=te[0].match(y),!te){r.logger.warn("No matches on slow regex match for level playlist!");continue}for(de=1;de-1){r.logger.warn("Keyformat "+je+" is not supported from the manifest");continue}else if(je!=="identity")continue;V&&(fe=s.LevelKey.fromURL(b,Z),Z&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(V)>=0&&(fe.method=V,fe.keyFormat=je,_e&&(fe.keyID=_e),xe&&(fe.keyFormatVersions=xe),fe.iv=Ee));break}case"START":{var He=new a.AttrList(ae),Ue=He.decimalFloatingPoint("TIME-OFFSET");Object(R.isFiniteNumber)(Ue)&&(F.startTimeOffset=Ue);break}case"MAP":{var ze=new a.AttrList(ae);W.relurl=ze.URI,ze.BYTERANGE&&W.setByteRange(ze.BYTERANGE),W.level=x,W.sn="initSegment",fe&&(W.levelkey=fe),W.initSegment=null,X=W,Ce=!0;break}case"SERVER-CONTROL":{var Ge=new a.AttrList(ae);F.canBlockReload=Ge.bool("CAN-BLOCK-RELOAD"),F.canSkipUntil=Ge.optionalFloat("CAN-SKIP-UNTIL",0),F.canSkipDateRanges=F.canSkipUntil>0&&Ge.bool("CAN-SKIP-DATERANGES"),F.partHoldBack=Ge.optionalFloat("PART-HOLD-BACK",0),F.holdBack=Ge.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ye=new a.AttrList(ae);F.partTarget=Ye.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Re=F.partList;Re||(Re=F.partList=[]);var tt=H>0?Re[Re.length-1]:void 0,rt=H++,We=new C.Part(new a.AttrList(ae),W,b,rt,tt);Re.push(We),W.duration+=We.duration;break}case"PRELOAD-HINT":{var $e=new a.AttrList(ae);F.preloadHint=$e;break}case"RENDITION-REPORT":{var Ie=new a.AttrList(ae);F.renditionReports=F.renditionReports||[],F.renditionReports.push(Ie);break}default:r.logger.warn("line parsed but not handled: "+te);break}}}B&&!B.relurl?(L.pop(),G-=B.duration,F.partList&&(F.fragmentHint=B)):F.partList&&(i(W,B),W.cc=U,F.fragmentHint=W);var Oe=L.length,Le=L[0],Te=L[Oe-1];if(G+=F.skippedSegments*F.targetduration,G>0&&Oe&&Te){F.averagetargetduration=G/Oe;var Ae=Te.sn;F.endSN=Ae!=="initSegment"?Ae:0,Le&&(F.startCC=Le.cc,Le.initSegment||F.fragments.every(function(ke){return ke.relurl&&n(ke.relurl)})&&(r.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new C.Fragment(_,b),W.relurl=Te.relurl,W.level=x,W.sn="initSegment",Le.initSegment=W,F.needSidxRanges=!0))}else F.endSN=0,F.startCC=0;return F.fragmentHint&&(G+=F.fragmentHint.duration),F.totalduration=G,F.endCC=U,be>0&&v(L,be),F},D}();function u(D,k){["video","audio","text"].forEach(function(c){var b=D.filter(function(_){return Object(f.isCodecType)(_,c)});if(b.length){var x=b.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});k[c+"Codec"]=x.length>0?x[0]:b[0],D=D.filter(function(_){return b.indexOf(_)===-1})}}),k.unknownCodecs=D}function w(D,k,c){var b=k[c];b&&(D[c]=b)}function v(D,k){for(var c=D[k],b=k;b--;){var x=D[b];if(!x)return;x.programDateTime=c.programDateTime-x.duration*1e3,c=x}}function i(D,k){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):k!=null&&k.programDateTime&&(D.programDateTime=k.endProgramDateTime),Object(R.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),g=S("./src/errors.ts"),C=S("./src/utils/logger.ts"),h=S("./src/utils/mp4-tools.ts"),s=S("./src/loader/m3u8-parser.ts"),a=S("./src/types/loader.ts"),r=S("./src/utils/attr-list.ts");function f(E){var y=E.type;switch(y){case a.PlaylistContextType.AUDIO_TRACK:return a.PlaylistLevelType.AUDIO;case a.PlaylistContextType.SUBTITLE_TRACK:return a.PlaylistLevelType.SUBTITLE;default:return a.PlaylistLevelType.MAIN}}function p(E,y){var l=E.url;return(l===void 0||l.indexOf("data:")===0)&&(l=y.url),l}var d=function(){function E(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var y=E.prototype;return y.registerListeners=function(){var n=this.hls;n.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.unregisterListeners=function(){var n=this.hls;n.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(T.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.createInternalLoader=function(n){var o=this.hls.config,u=o.pLoader,w=o.loader,v=u||w,i=new v(o);return n.loader=i,this.loaders[n.type]=i,i},y.getInternalLoader=function(n){return this.loaders[n.type]},y.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},y.destroyInternalLoaders=function(){for(var n in this.loaders){var o=this.loaders[n];o&&o.destroy(),this.resetInternalLoader(n)}},y.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},y.onManifestLoading=function(n,o){var u=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:a.PlaylistContextType.MANIFEST,url:u,deliveryDirectives:null})},y.onLevelLoading=function(n,o){var u=o.id,w=o.level,v=o.url,i=o.deliveryDirectives;this.load({id:u,groupId:null,level:w,responseType:"text",type:a.PlaylistContextType.LEVEL,url:v,deliveryDirectives:i})},y.onAudioTrackLoading=function(n,o){var u=o.id,w=o.groupId,v=o.url,i=o.deliveryDirectives;this.load({id:u,groupId:w,level:null,responseType:"text",type:a.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:i})},y.onSubtitleTrackLoading=function(n,o){var u=o.id,w=o.groupId,v=o.url,i=o.deliveryDirectives;this.load({id:u,groupId:w,level:null,responseType:"text",type:a.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:i})},y.load=function(n){var o,u=this.hls.config,w=this.getInternalLoader(n);if(w){var v=w.context;if(v&&v.url===n.url){C.logger.trace("[playlist-loader]: playlist request ongoing");return}C.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),w.abort()}var i,D,k,c;switch(n.type){case a.PlaylistContextType.MANIFEST:i=u.manifestLoadingMaxRetry,D=u.manifestLoadingTimeOut,k=u.manifestLoadingRetryDelay,c=u.manifestLoadingMaxRetryTimeout;break;case a.PlaylistContextType.LEVEL:case a.PlaylistContextType.AUDIO_TRACK:case a.PlaylistContextType.SUBTITLE_TRACK:i=0,D=u.levelLoadingTimeOut;break;default:i=u.levelLoadingMaxRetry,D=u.levelLoadingTimeOut,k=u.levelLoadingRetryDelay,c=u.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(n),(o=n.deliveryDirectives)!==null&&o!==void 0&&o.part){var b;if(n.type===a.PlaylistContextType.LEVEL&&n.level!==null?b=this.hls.levels[n.level].details:n.type===a.PlaylistContextType.AUDIO_TRACK&&n.id!==null?b=this.hls.audioTracks[n.id].details:n.type===a.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(b=this.hls.subtitleTracks[n.id].details),b){var x=b.partTarget,_=b.targetduration;x&&_&&(D=Math.min(Math.max(x*3,_*.8)*1e3,D))}}var j={timeout:D,maxRetry:i,retryDelay:k,maxRetryDelay:c,highWaterMark:0},F={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(n,j,F)},y.loadsuccess=function(n,o,u,w){if(w===void 0&&(w=null),u.isSidxRequest){this.handleSidxRequest(n,u),this.handlePlaylistLoaded(n,o,u,w);return}this.resetInternalLoader(u.type);var v=n.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,u,"no EXTM3U delimiter",w);return}o.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,o,u,w):this.handleMasterPlaylist(n,o,u,w)},y.loaderror=function(n,o,u){u===void 0&&(u=null),this.handleNetworkError(o,u,!1,n)},y.loadtimeout=function(n,o,u){u===void 0&&(u=null),this.handleNetworkError(o,u,!0)},y.handleMasterPlaylist=function(n,o,u,w){var v=this.hls,i=n.data,D=p(n,u),k=s.default.parseMasterPlaylist(i,D),c=k.levels,b=k.sessionData;if(!c.length){this.handleManifestParsingError(n,u,"no level found in manifest",w);return}var x=c.map(function(z){return{id:z.attrs.AUDIO,audioCodec:z.audioCodec}}),_=c.map(function(z){return{id:z.attrs.SUBTITLES,textCodec:z.textCodec}}),j=s.default.parseMasterPlaylistMedia(i,D,"AUDIO",x),F=s.default.parseMasterPlaylistMedia(i,D,"SUBTITLES",_),L=s.default.parseMasterPlaylistMedia(i,D,"CLOSED-CAPTIONS");if(j.length){var X=j.some(function(z){return!z.url});!X&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(C.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),j.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new r.AttrList({}),bitrate:0,url:""}))}v.trigger(T.Events.MANIFEST_LOADED,{levels:c,audioTracks:j,subtitles:F,captions:L,url:D,stats:o,networkDetails:w,sessionData:b})},y.handleTrackOrLevelPlaylist=function(n,o,u,w){var v=this.hls,i=u.id,D=u.level,k=u.type,c=p(n,u),b=Object(R.isFiniteNumber)(i)?i:0,x=Object(R.isFiniteNumber)(D)?D:b,_=f(u),j=s.default.parseLevelPlaylist(n.data,c,x,_,b);if(!j.fragments.length){v.trigger(T.Events.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:c,reason:"no fragments found in level",level:typeof u.level=="number"?u.level:void 0});return}if(k===a.PlaylistContextType.MANIFEST){var F={attrs:new r.AttrList({}),bitrate:0,details:j,name:"",url:c};v.trigger(T.Events.MANIFEST_LOADED,{levels:[F],audioTracks:[],url:c,stats:o,networkDetails:w,sessionData:null})}if(o.parsing.end=performance.now(),j.needSidxRanges){var L,X=(L=j.fragments[0].initSegment)===null||L===void 0?void 0:L.url;this.load({url:X,isSidxRequest:!0,type:k,level:D,levelDetails:j,id:i,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}u.levelDetails=j,this.handlePlaylistLoaded(n,o,u,w)},y.handleSidxRequest=function(n,o){var u=Object(h.parseSegmentIndex)(new Uint8Array(n.data));if(!u)return;var w=u.references,v=o.levelDetails;w.forEach(function(i,D){var k=i.info,c=v.fragments[D];c.byteRange.length===0&&c.setByteRange(String(1+k.end-k.start)+"@"+String(k.start)),c.initSegment&&c.initSegment.setByteRange(String(u.moovEndOffset)+"@0")})},y.handleManifestParsingError=function(n,o,u,w){this.hls.trigger(T.Events.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===a.PlaylistContextType.MANIFEST,url:n.url,reason:u,response:n,context:o,networkDetails:w})},y.handleNetworkError=function(n,o,u,w){u===void 0&&(u=!1),C.logger.warn("[playlist-loader]: A network "+(u?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var v=g.ErrorDetails.UNKNOWN,i=!1,D=this.getInternalLoader(n);switch(n.type){case a.PlaylistContextType.MANIFEST:v=u?g.ErrorDetails.MANIFEST_LOAD_TIMEOUT:g.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0;break;case a.PlaylistContextType.LEVEL:v=u?g.ErrorDetails.LEVEL_LOAD_TIMEOUT:g.ErrorDetails.LEVEL_LOAD_ERROR,i=!1;break;case a.PlaylistContextType.AUDIO_TRACK:v=u?g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,i=!1;break;case a.PlaylistContextType.SUBTITLE_TRACK:v=u?g.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:g.ErrorDetails.SUBTITLE_LOAD_ERROR,i=!1;break}D&&this.resetInternalLoader(n.type);var k={type:g.ErrorTypes.NETWORK_ERROR,details:v,fatal:i,url:n.url,loader:D,context:n,networkDetails:o};w&&(k.response=w),this.hls.trigger(T.Events.ERROR,k)},y.handlePlaylistLoaded=function(n,o,u,w){var v=u.type,i=u.level,D=u.id,k=u.groupId,c=u.loader,b=u.levelDetails,x=u.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(n,u,"invalid target duration",w);return}if(!c)return;b.live&&(c.getCacheAge&&(b.ageHeader=c.getCacheAge()||0),(!c.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(v){case a.PlaylistContextType.MANIFEST:case a.PlaylistContextType.LEVEL:this.hls.trigger(T.Events.LEVEL_LOADED,{details:b,level:i||0,id:D||0,stats:o,networkDetails:w,deliveryDirectives:x});break;case a.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(T.Events.AUDIO_TRACK_LOADED,{details:b,id:D||0,groupId:k||"",stats:o,networkDetails:w,deliveryDirectives:x});break;case a.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(T.Events.SUBTITLE_TRACK_LOADED,{details:b,id:D||0,groupId:k||"",stats:o,networkDetails:w,deliveryDirectives:x});break}},E}();m.default=d},"./src/polyfills/number.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"isFiniteNumber",function(){return R}),S.d(m,"MAX_SAFE_INTEGER",function(){return T});var R=Number.isFinite||function(g){return typeof g=="number"&&isFinite(g)},T=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(P,m,S){"use strict";S.r(m);var R=function(){function T(){}return T.getSilentFrame=function(C,h){switch(C){case"mp4a.40.2":if(h===1)return new Uint8Array([0,200,0,128,35,128]);if(h===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(h===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(h===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(h===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(h===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(h===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(h===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(h===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},T}();m.default=R},"./src/remux/mp4-generator.ts":function(P,m,S){"use strict";S.r(m);var R=Math.pow(2,32)-1,T=function(){function g(){}return g.init=function(){g.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 h;for(h in g.types)g.types.hasOwnProperty(h)&&(g.types[h]=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)]);var s=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]),a=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]);g.HDLR_TYPES={video:s,audio:a};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);g.STTS=g.STSC=g.STCO=f,g.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),g.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),g.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),g.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),E=new Uint8Array([0,0,0,1]);g.FTYP=g.box(g.types.ftyp,p,E,p,d),g.DINF=g.box(g.types.dinf,g.box(g.types.dref,r))},g.box=function(h){for(var s=8,a=arguments.length,r=new Array(a>1?a-1:0),f=1;f>24&255,E[1]=s>>16&255,E[2]=s>>8&255,E[3]=s&255,E.set(h,4),p=0,s=8;p>24&255,h>>16&255,h>>8&255,h&255,a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))},g.mdia=function(h){return g.box(g.types.mdia,g.mdhd(h.timescale,h.duration),g.hdlr(h.type),g.minf(h))},g.mfhd=function(h){return g.box(g.types.mfhd,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255]))},g.minf=function(h){return h.type==="audio"?g.box(g.types.minf,g.box(g.types.smhd,g.SMHD),g.DINF,g.stbl(h)):g.box(g.types.minf,g.box(g.types.vmhd,g.VMHD),g.DINF,g.stbl(h))},g.moof=function(h,s,a){return g.box(g.types.moof,g.mfhd(h),g.traf(a,s))},g.moov=function(h){for(var s=h.length,a=[];s--;)a[s]=g.trak(h[s]);return g.box.apply(null,[g.types.moov,g.mvhd(h[0].timescale,h[0].duration)].concat(a).concat(g.mvex(h)))},g.mvex=function(h){for(var s=h.length,a=[];s--;)a[s]=g.trex(h[s]);return g.box.apply(null,[g.types.mvex].concat(a))},g.mvhd=function(h,s){s*=h;var a=Math.floor(s/(R+1)),r=Math.floor(s%(R+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,h>>24&255,h>>16&255,h>>8&255,h&255,a>>24,a>>16&255,a>>8&255,a&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 g.box(g.types.mvhd,f)},g.sdtp=function(h){var s=h.samples||[],a=new Uint8Array(4+s.length),r,f;for(r=0;r>>8&255),s.push(p&255),s=s.concat(Array.prototype.slice.call(f));for(r=0;r>>8&255),a.push(p&255),a=a.concat(Array.prototype.slice.call(f));var d=g.box(g.types.avcC,new Uint8Array([1,s[3],s[4],s[5],252|3,224|h.sps.length].concat(s).concat([h.pps.length]).concat(a))),E=h.width,y=h.height,l=h.pixelRatio[0],n=h.pixelRatio[1];return g.box(g.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,E>>8&255,E&255,y>>8&255,y&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]),d,g.box(g.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),g.box(g.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,n>>24,n>>16&255,n>>8&255,n&255])))},g.esds=function(h){var s=h.config.length;return new Uint8Array([0,0,0,0,3,23+s,0,1,0,4,15+s,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([s]).concat(h.config).concat([6,1,2]))},g.mp4a=function(h){var s=h.samplerate;return g.box(g.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h.channelCount,0,16,0,0,0,0,s>>8&255,s&255,0,0]),g.box(g.types.esds,g.esds(h)))},g.mp3=function(h){var s=h.samplerate;return g.box(g.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h.channelCount,0,16,0,0,0,0,s>>8&255,s&255,0,0]))},g.stsd=function(h){return h.type==="audio"?!h.isAAC&&h.codec==="mp3"?g.box(g.types.stsd,g.STSD,g.mp3(h)):g.box(g.types.stsd,g.STSD,g.mp4a(h)):g.box(g.types.stsd,g.STSD,g.avc1(h))},g.tkhd=function(h){var s=h.id,a=h.duration*h.timescale,r=h.width,f=h.height,p=Math.floor(a/(R+1)),d=Math.floor(a%(R+1));return g.box(g.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,s>>24&255,s>>16&255,s>>8&255,s&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,d>>24,d>>16&255,d>>8&255,d&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,f>>8&255,f&255,0,0]))},g.traf=function(h,s){var a=g.sdtp(h),r=h.id,f=Math.floor(s/(R+1)),p=Math.floor(s%(R+1));return g.box(g.types.traf,g.box(g.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),g.box(g.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,p>>24,p>>16&255,p>>8&255,p&255])),g.trun(h,a.length+16+20+8+16+8+8),a)},g.trak=function(h){return h.duration=h.duration||4294967295,g.box(g.types.trak,g.tkhd(h),g.mdia(h))},g.trex=function(h){var s=h.id;return g.box(g.types.trex,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},g.trun=function(h,s){var a=h.samples||[],r=a.length,f=12+16*r,p=new Uint8Array(f),d,E,y,l,n,o;for(s+=8+f,p.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255],0),d=0;d>>24&255,y>>>16&255,y>>>8&255,y&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*d);return g.box(g.types.trun,p)},g.initSegment=function(h){g.types||g.init();var s=g.moov(h),a=new Uint8Array(g.FTYP.byteLength+s.byteLength);return a.set(g.FTYP),a.set(s,g.FTYP.byteLength),a},g}();T.types=void 0,T.HDLR_TYPES=void 0,T.STTS=void 0,T.STSC=void 0,T.STCO=void 0,T.STSZ=void 0,T.VMHD=void 0,T.SMHD=void 0,T.STSD=void 0,T.FTYP=void 0,T.DINF=void 0,m.default=T},"./src/remux/mp4-remuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return o}),S.d(m,"normalizePts",function(){return u});var R=S("./src/polyfills/number.ts"),T=S("./src/remux/aac-helper.ts"),g=S("./src/remux/mp4-generator.ts"),C=S("./src/events.ts"),h=S("./src/errors.ts"),s=S("./src/utils/logger.ts"),a=S("./src/types/loader.ts"),r=S("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(D){for(var k=1;k0?j:F.pts},b[0].pts);return x&&s.logger.debug("PTS rollover detected"),_},k.remux=function(b,x,_,j,F,L,X,z){var H,G,U,B,W,te,de=F,fe=F,be=b.pid>-1,Ce=x.pid>-1,ue=x.samples.length,ge=b.samples.length>0,pe=ue>1,oe=(!be||ge)&&(!Ce||pe)||this.ISGenerated||X;if(oe){this.ISGenerated||(U=this.generateIS(b,x,F));var ae=this.isVideoContiguous,re=-1;if(pe&&(re=w(x.samples),!ae&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,re>0){s.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+ue+" video samples due to a missing keyframe");var he=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(re),x.dropped+=re,fe+=(x.samples[0].pts-he)/(x.timescale||9e4)}else re===-1&&(s.logger.warn("[mp4-remuxer]: No keyframe found out of "+ue+" video samples"),te=!1);if(this.ISGenerated){if(ge&&pe){var Q=this.getVideoStartPts(x.samples),ie=u(b.samples[0].pts,Q)-Q,we=ie/x.inputTimeScale;de+=Math.max(0,we),fe+=Math.max(0,-we)}if(ge){if(b.samplerate||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(b,x,F)),G=this.remuxAudio(b,de,this.isAudioContiguous,L,Ce||pe||z===a.PlaylistLevelType.AUDIO?fe:void 0),pe){var ne=G?G.endPTS-G.startPTS:0;x.inputTimeScale||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(b,x,F)),H=this.remuxVideo(x,fe,ae,ne)}}else pe&&(H=this.remuxVideo(x,fe,ae,0));H&&(H.firstKeyFrame=re,H.independent=re!==-1)}}return this.ISGenerated&&(_.samples.length&&(W=this.remuxID3(_,F)),j.samples.length&&(B=this.remuxText(j,F))),{audio:G,video:H,initSegment:U,independent:te,text:B,id3:W}},k.generateIS=function(b,x,_){var j=b.samples,F=x.samples,L=this.typeSupported,X={},z=!Object(R.isFiniteNumber)(this._initPTS),H="audio/mp4",G,U,B;if(z&&(G=U=Infinity),b.config&&j.length&&(b.timescale=b.samplerate,b.isAAC||(L.mpeg?(H="audio/mpeg",b.codec=""):L.mp3&&(b.codec="mp3")),X.audio={id:"audio",container:H,codec:b.codec,initSegment:!b.isAAC&&L.mpeg?new Uint8Array(0):g.default.initSegment([b]),metadata:{channelCount:b.channelCount}},z&&(B=b.inputTimeScale,G=U=j[0].pts-Math.round(B*_))),x.sps&&x.pps&&F.length&&(x.timescale=x.inputTimeScale,X.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:g.default.initSegment([x]),metadata:{width:x.width,height:x.height}},z)){B=x.inputTimeScale;var W=this.getVideoStartPts(F),te=Math.round(B*_);U=Math.min(U,u(F[0].dts,W)-te),G=Math.min(G,W-te)}if(Object.keys(X).length)return this.ISGenerated=!0,z&&(this._initPTS=G,this._initDTS=U),{tracks:X,initPTS:G,timescale:B}},k.remuxVideo=function(b,x,_,j){var F=b.inputTimeScale,L=b.samples,X=[],z=L.length,H=this._initPTS,G=this.nextAvcDts,U=8,B,W,te,de=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,be=0,Ce=!1;if(!_||G===null){var ue=x*F,ge=L[0].pts-u(L[0].dts,L[0].pts);G=ue-ge}for(var pe=0;peoe.pts){var ae=9e4*.2;be=Math.max(Math.min(be,oe.pts-oe.dts),-1*ae)}oe.dts0?pe-1:pe].dts&&(Ce=!0)}Ce&&L.sort(function(Et,xt){var lt=Et.dts-xt.dts,Wt=Et.pts-xt.pts;return lt||Wt}),W=L[0].dts,te=L[L.length-1].dts;var re=Math.round((te-W)/(z-1));if(be<0){if(bere,J=we<-1;if(ne||J){ne?s.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(we,!0)+" ms ("+we+"dts) hole between fragments detected, filling it"):s.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(-we,!0)+" ms ("+we+"dts) overlapping between fragments detected"),W=G;var V=L[0].pts-we;L[0].dts=W,L[0].pts=V,s.logger.log("Video: First PTS/DTS adjusted: "+Object(r.toMsFromMpegTsClock)(V,!0)+"/"+Object(r.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(r.toMsFromMpegTsClock)(we,!0)+" ms")}}n&&(W=Math.max(0,W));for(var Z=0,Ee=0,xe=0;xe0?Re-1:Re].dts;if(Ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var Me=Math.floor(Ae.maxBufferHole*F),Fe=(j?de+j*F:this.nextAudioPts)-tt.pts;Fe>Me?(B=Fe-ke,B<0&&(B=ke),s.logger.log("[mp4-remuxer]: It is approximately "+Fe/90+" ms to the next segment; using duration "+B/90+" ms for the last video frame.")):B=ke}else B=ke}var Xe=Math.round(tt.pts-tt.dts);X.push(new v(tt.key,B,We,Xe))}if(X.length&&y&&y<70){var qe=X[0].flags;qe.dependsOn=2,qe.isNonSync=0}console.assert(B!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=te+B,this.isVideoContiguous=!0;var pt=g.default.moof(b.sequenceNumber++,W,f({},b,{samples:X})),at="video",ft={data1:pt,data2:Ge,startPTS:de/F,endPTS:(fe+B)/F,startDTS:W/F,endDTS:G/F,type:at,hasAudio:!1,hasVideo:!0,nb:X.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(Ge.length,"MDAT length must not be zero"),ft},k.remuxAudio=function(b,x,_,j,F){var L=b.inputTimeScale,X=b.samplerate?b.samplerate:L,z=L/X,H=b.isAAC?d:E,G=H*z,U=this._initPTS,B=!b.isAAC&&this.typeSupported.mpeg,W=[],te=b.samples,de=B?0:8,fe=this.nextAudioPts||-1,be=x*L;if(this.isAudioContiguous=_=_||te.length&&fe>0&&(j&&Math.abs(be-fe)<9e3||Math.abs(u(te[0].pts-U,be)-fe)<20*G),te.forEach(function(Le){Le.pts=u(Le.pts-U,be)}),!_||fe<0){if(te=te.filter(function(Le){return Le.pts>=0}),!te.length)return;F===0?fe=0:j?fe=Math.max(0,be):fe=te[0].pts}if(b.isAAC)for(var Ce=F!==void 0,ue=this.config.maxAudioFramesDrift,ge=0,pe=fe;ge=ue*G&&he0){Ee+=de;try{Z=new Uint8Array(Ee)}catch(Le){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ee,reason:"fail allocating audio mdat "+Ee});return}if(!B){var Ge=new DataView(Z.buffer);Ge.setUint32(0,Ee),Z.set(g.default.types.mdat,4)}}else return;Z.set(He,de);var Ye=He.byteLength;de+=Ye,W.push(new v(!0,H,Ye,0)),V=Ue}var Re=W.length;if(!Re)return;var tt=W[W.length-1];this.nextAudioPts=fe=V+z*tt.duration;var rt=B?new Uint8Array(0):g.default.moof(b.sequenceNumber++,J/z,f({},b,{samples:W}));b.samples=[];var We=J/L,$e=fe/L,Ie="audio",Oe={data1:rt,data2:Z,startPTS:We,endPTS:$e,startDTS:We,endDTS:$e,type:Ie,hasAudio:!0,hasVideo:!1,nb:Re};return this.isAudioContiguous=!0,console.assert(Z.length,"MDAT length must not be zero"),Oe},k.remuxEmptyAudio=function(b,x,_,j){var F=b.inputTimeScale,L=b.samplerate?b.samplerate:F,X=F/L,z=this.nextAudioPts,H=(z!==null?z:j.startDTS*F)+this._initDTS,G=j.endDTS*F+this._initDTS,U=X*d,B=Math.ceil((G-H)/U),W=T.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(s.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){s.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],de=0;de4294967296;)D+=c;return D}function w(D){for(var k=0;k0?this.lastEndDTS=b:(C.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!D.audio,_=!!D.video,j="";x&&(j+="audio"),_&&(j+="video");var F={data1:v,startPTS:c,startDTS:c,endPTS:b,endDTS:b,type:j,hasAudio:x,hasVideo:_,nb:1,dropped:0};return w.audio=F.type==="audio"?F:void 0,w.video=F.type!=="audio"?F:void 0,w.text=l,w.id3=y,w.initSegment=i,w},r}(),s=function(f,p,d){return Object(T.getStartDTS)(f,p)-d};function a(r,f){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"||f===g.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}m.default=h},"./src/task-loop.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return R});var R=function(){function T(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var g=T.prototype;return g.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},g.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},g.onHandlerDestroyed=function(){},g.hasInterval=function(){return!!this._tickInterval},g.hasNextTick=function(){return!!this._tickTimer},g.setInterval=function(h){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,h),!0)},g.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},g.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},g.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},g.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},g.doTick=function(){},T}()},"./src/types/cmcd.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"CMCDVersion",function(){return R}),S.d(m,"CMCDObjectType",function(){return T}),S.d(m,"CMCDStreamingFormat",function(){return g}),S.d(m,"CMCDStreamType",function(){return C});var R=1,T;(function(h){h.MANIFEST="m",h.AUDIO="a",h.VIDEO="v",h.MUXED="av",h.INIT="i",h.CAPTION="c",h.TIMED_TEXT="tt",h.KEY="k",h.OTHER="o"})(T||(T={}));var g;(function(h){h.DASH="d",h.HLS="h",h.SMOOTH="s",h.OTHER="o"})(g||(g={}));var C;(function(h){h.VOD="v",h.LIVE="l"})(C||(C={}))},"./src/types/level.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"HlsSkip",function(){return g}),S.d(m,"getSkipValue",function(){return C}),S.d(m,"HlsUrlParameters",function(){return h}),S.d(m,"Level",function(){return s});function R(a,r){for(var f=0;fNumber.MAX_SAFE_INTEGER?Infinity:r},h.hexadecimalInteger=function(a){if(this[a]){var r=(this[a]||"0x").slice(2);r=(r.length&1?"0":"")+r;for(var f=new Uint8Array(r.length/2),p=0;pNumber.MAX_SAFE_INTEGER?Infinity:r},h.decimalFloatingPoint=function(a){return parseFloat(this[a])},h.optionalFloat=function(a,r){var f=this[a];return f?parseFloat(f):r},h.enumeratedString=function(a){return this[a]},h.bool=function(a){return this[a]==="YES"},h.decimalResolution=function(a){var r=R.exec(this[a]);return r===null?void 0:{width:parseInt(r[1],10),height:parseInt(r[2],10)}},C.parseAttrList=function(a){var r,f={},p='"';for(T.lastIndex=0;(r=T.exec(a))!==null;){var d=r[2];d.indexOf(p)===0&&d.lastIndexOf(p)===d.length-1&&(d=d.slice(1,-1)),f[r[1]]=d}return f},C}()},"./src/utils/binary-search.ts":function(P,m,S){"use strict";S.r(m);var R={search:function(g,C){for(var h=0,s=g.length-1,a=null,r=null;h<=s;){a=(h+s)/2|0,r=g[a];var f=C(r);if(f>0)h=a+1;else if(f<0)s=a-1;else return r}return null}};m.default=R},"./src/utils/buffer-helper.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"BufferHelper",function(){return g});var R=S("./src/utils/logger.ts"),T={length:0,start:function(){return 0},end:function(){return 0}},g=function(){function C(){}return C.isBuffered=function(s,a){try{if(s){for(var r=C.getBuffered(s),f=0;f=r.start(f)&&a<=r.end(f))return!0}}catch(p){}return!1},C.bufferInfo=function(s,a,r){try{if(s){var f=C.getBuffered(s),p=[],d;for(d=0;dE&&(f[d-1].end=s[p].end):f.push(s[p])}else f.push(s[p])}else f=s;for(var y=0,l,n=a,o=a,u=0;u=w&&a=_&&R.logger.log(this.time+" ["+_+"] "+j)},c}(),y=function(b){for(var x=[],_=0;_h&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=h)},b.moveCursor=function(_){var j=this.pos+_;if(_>1)for(var F=this.pos+1;F=144&&this.backSpace();var j=g(_);if(this.pos>=h){this.logger.log(d.ERROR,"Cannot insert "+_.toString(16)+" ("+j+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(j,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(_){var j;for(j=_;j0&&(_?F="["+j.join(" | ")+"]":F=j.join(` `)),F},b.getTextAndFormat=function(){return this.rows},c}(),w=function(){function c(x,_,j){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=x,this.outputFilter=_,this.mode=null,this.verbose=0,this.displayedMemory=new u(j),this.nonDisplayedMemory=new u(j),this.lastOutputScreen=new u(j),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=j}var b=c.prototype;return b.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},b.getHandler=function(){return this.outputFilter},b.setHandler=function(_){this.outputFilter=_},b.setPAC=function(_){this.writeScreen.setPAC(_)},b.setBkgData=function(_){this.writeScreen.setBkgData(_)},b.setMode=function(_){if(_===this.mode)return;this.mode=_,this.logger.log(d.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=_},b.insertChars=function(_){for(var j=0;j<_.length;j++)this.writeScreen.insertChar(_[j]);var F=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(d.INFO,F+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(d.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(d.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(d.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(d.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(_){this.logger.log(d.INFO,"RU("+_+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(_)},b.ccFON=function(){this.logger.log(d.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(d.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(d.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(d.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(d.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(d.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(d.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(d.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(d.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(_){this.logger.log(d.INFO,"TO("+_+") - Tab Offset"),this.writeScreen.moveCursor(_)},b.ccMIDROW=function(_){var j={flash:!1};if(j.underline=_%2===1,j.italics=_>=46,j.italics)j.foreground="white";else{var F=Math.floor(_/2)-16,L=["white","green","blue","cyan","red","yellow","magenta"];j.foreground=L[F]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(j)),this.writeScreen.setPen(j)},b.outputDataUpdate=function(_){_===void 0&&(_=!1);var j=this.logger.time;if(j===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=j:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,j,this.lastOutputScreen),_&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:j),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(_){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,_,this.displayedMemory),this.cueStartTime=_))},c}(),v=function(){function c(x,_,j){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var F=new E;this.channels=[null,new w(x,_,F),new w(x+1,j,F)],this.cmdHistory=k(),this.logger=F}var b=c.prototype;return b.getHandler=function(_){return this.channels[_].getHandler()},b.setHandler=function(_,j){this.channels[_].setHandler(j)},b.addData=function(_,j){var F,L,X,z=!1;this.logger.time=_;for(var H=0;H ("+y([L,X])+")"),F=this.parseCmd(L,X),F||(F=this.parseMidrow(L,X)),F||(F=this.parsePAC(L,X)),F||(F=this.parseBackgroundAttributes(L,X)),!F&&(z=this.parseChars(L,X),z)){var G=this.currentChannel;if(G&&G>0){var U=this.channels[G];U.insertChars(z)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!F&&!z&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+y([L,X])+" orig: "+y([j[H],j[H+1]]))}},b.parseCmd=function(_,j){var F=this.cmdHistory,L=(_===20||_===28||_===21||_===29)&&j>=32&&j<=47,X=(_===23||_===31)&&j>=33&&j<=35;if(!(L||X))return!1;if(D(_,j,F))return i(null,null,F),this.logger.log(d.DEBUG,"Repeated command ("+y([_,j])+") is dropped"),!0;var z=_===20||_===21||_===23?1:2,H=this.channels[z];return _===20||_===21||_===28||_===29?j===32?H.ccRCL():j===33?H.ccBS():j===34?H.ccAOF():j===35?H.ccAON():j===36?H.ccDER():j===37?H.ccRU(2):j===38?H.ccRU(3):j===39?H.ccRU(4):j===40?H.ccFON():j===41?H.ccRDC():j===42?H.ccTR():j===43?H.ccRTD():j===44?H.ccEDM():j===45?H.ccCR():j===46?H.ccENM():j===47&&H.ccEOC():H.ccTO(j-32),i(_,j,F),this.currentChannel=z,!0},b.parseMidrow=function(_,j){var F=0;if((_===17||_===25)&&j>=32&&j<=47){if(_===17?F=1:F=2,F!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var L=this.channels[F];return L?(L.ccMIDROW(j),this.logger.log(d.DEBUG,"MIDROW ("+y([_,j])+")"),!0):!1}return!1},b.parsePAC=function(_,j){var F,L=this.cmdHistory,X=(_>=17&&_<=23||_>=25&&_<=31)&&j>=64&&j<=127,z=(_===16||_===24)&&j>=64&&j<=95;if(!(X||z))return!1;if(D(_,j,L))return i(null,null,L),!0;var H=_<=23?1:2;j>=64&&j<=95?F=H===1?s[_]:r[_]:F=H===1?a[_]:f[_];var G=this.channels[H];return G?(G.setPAC(this.interpretPAC(F,j)),i(_,j,L),this.currentChannel=H,!0):!1},b.interpretPAC=function(_,j){var F,L={color:null,italics:!1,indent:null,underline:!1,row:_};return j>95?F=j-96:F=j-64,L.underline=(F&1)===1,F<=13?L.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(F/2)]:F<=15?(L.italics=!0,L.color="white"):L.indent=Math.floor((F-16)/2)*4,L},b.parseChars=function(_,j){var F,L=null,X=null;if(_>=25?(F=2,X=_-8):(F=1,X=_),X>=17&&X<=19){var z;X===17?z=j+80:X===18?z=j+112:z=j+144,this.logger.log(d.INFO,"Special char '"+g(z)+"' in channel "+F),L=[z]}else _>=32&&_<=127&&(L=j===0?[_]:[_,j]);if(L){var H=y(L);this.logger.log(d.DEBUG,"Char codes = "+H.join(",")),i(_,j,this.cmdHistory)}return L},b.parseBackgroundAttributes=function(_,j){var F=(_===16||_===24)&&j>=32&&j<=47,L=(_===23||_===31)&&j>=45&&j<=47;if(!(F||L))return!1;var X,z={};_===16||_===24?(X=Math.floor((j-32)/2),z.background=p[X],j%2===1&&(z.background=z.background+"_semi")):j===45?z.background="transparent":(z.foreground="black",j===47&&(z.underline=!0));var H=_<=23?1:2,G=this.channels[H];return G.setBkgData(z),i(_,j,this.cmdHistory),!0},b.reset=function(){for(var _=0;_=16?n--:n++;var i=Object(R.fixLineBreaks)(o.trim()),D=Object(T.generateCueId)(r,f,i);(!a||!a.cues||!a.cues.getCueById(D))&&(y=new u(r,f,i),y.id=D,y.line=w+1,y.align="left",y.position=10+Math.min(80,Math.floor(n*8/32)*10),d.push(y))}return a&&d.length&&(d.sort(function(k,c){return k.line==="auto"||c.line==="auto"?0:k.line>8&&c.line>8?c.line-k.line:k.line-c.line}),d.forEach(function(k){return Object(g.addCueToTrack)(a,k)})),d}};m.default=h},"./src/utils/discontinuities.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"findFirstFragWithCC",function(){return C}),S.d(m,"shouldAlignOnDiscontinuities",function(){return h}),S.d(m,"findDiscontinuousReferenceFrag",function(){return s}),S.d(m,"adjustSlidingStart",function(){return r}),S.d(m,"alignStream",function(){return f}),S.d(m,"alignPDT",function(){return d}),S.d(m,"alignFragmentByPDTDelta",function(){return E}),S.d(m,"alignMediaPlaylistByPDT",function(){return y});var R=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts"),g=S("./src/controller/level-helper.ts");function C(l,n){for(var o=null,u=0,w=l.length;uo.startCC||l&&l.cc=this.minWeight_},C.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},C.destroy=function(){},g}();m.default=T},"./src/utils/ewma.ts":function(P,m,S){"use strict";S.r(m);var R=function(){function T(C,h,s){h===void 0&&(h=0),s===void 0&&(s=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_=h,this.totalWeight_=s}var g=T.prototype;return g.sample=function(h,s){var a=Math.pow(this.alpha_,h);this.estimate_=s*(1-a)+a*this.estimate_,this.totalWeight_+=h},g.getTotalWeight=function(){return this.totalWeight_},g.getEstimate=function(){if(this.alpha_){var h=1-Math.pow(this.alpha_,this.totalWeight_);if(h)return this.estimate_/h}return this.estimate_},T}();m.default=R},"./src/utils/fetch-loader.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"fetchSupported",function(){return E});var R=S("./src/polyfills/number.ts"),T=S("./src/loader/load-stats.ts"),g=S("./src/demux/chunk-cache.ts");function C(u,w){u.prototype=Object.create(w.prototype),u.prototype.constructor=u,f(u,w)}function h(u){var w=typeof Map=="function"?new Map:void 0;return h=function(i){if(i===null||!r(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(i))return w.get(i);w.set(i,D)}function D(){return s(i,arguments,p(this).constructor)}return D.prototype=Object.create(i.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),f(D,i)},h(u)}function s(u,w,v){return a()?s=Reflect.construct:s=function(D,k,c){var b=[null];b.push.apply(b,k);var x=Function.bind.apply(D,b),_=new x;return c&&f(_,c.prototype),_},s.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(u){return!1}}function r(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function f(u,w){return f=Object.setPrototypeOf||function(i,D){return i.__proto__=D,i},f(u,w)}function p(u){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},p(u)}function d(){return d=Object.assign||function(u){for(var w=1;w=c&&b(D,k,x.flush(),i)):b(D,k,X,i),F()}).catch(function(){return Promise.reject()})};return j()},u}();function l(u,w){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(d({},u.headers))};return u.rangeEnd&&v.headers.set("Range","bytes="+u.rangeStart+"-"+String(u.rangeEnd-1)),v}function n(u,w){return new self.Request(u.url,w)}var o=function(u){C(w,u);function w(v,i,D){var k;return k=u.call(this,v)||this,k.code=void 0,k.details=void 0,k.code=i,k.details=D,k}return w}(h(Error));m.default=y},"./src/utils/imsc1-ttml-parser.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"IMSC1_CODEC",function(){return r}),S.d(m,"parseIMSC1",function(){return E});var R=S("./src/utils/mp4-tools.ts"),T=S("./src/utils/vttparser.ts"),g=S("./src/utils/vttcue.ts"),C=S("./src/demux/id3.ts"),h=S("./src/utils/timescale-conversion.ts"),s=S("./src/utils/webvtt-parser.ts");function a(){return a=Object.assign||function(c){for(var b=1;b"):R}function h(r){for(var f=arguments.length,p=new Array(f>1?f-1:0),d=1;d>24,w[v+1]=i>>16&255,w[v+2]=i>>8&255,w[v+3]=i&255}function f(w,v){var i=[];if(!v.length)return i;var D,k,c;"data"in w?(D=w.data,k=w.start,c=w.end):(D=w,k=0,c=D.byteLength);for(var b=k;b1?b+x:c;if(_===v[0])if(v.length===1)i.push({data:D,start:b+8,end:j});else{var F=f({data:D,start:b+8,end:j},v.slice(1));F.length&&C.apply(i,F)}b=j}return i}function p(w){var v=f(w,["moov"]),i=v[0],D=i?i.end:null,k=f(w,["sidx"]);if(!k||!k[0])return null;var c=[],b=k[0],x=b.data[0],_=x===0?8:16,j=a(b,_);_+=4;var F=0,L=0;x===0?_+=8:_+=16,_+=2;var X=b.end+L,z=s(b,_);_+=2;for(var H=0;H>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=a(b,G);G+=4,c.push({referenceSize:B,subsegmentDuration:te,info:{duration:te/j,start:X,end:X+B-1}}),X+=B,G+=4,_=G}return{earliestPresentationTime:F,timescale:j,version:x,referencesCount:z,references:c,moovEndOffset:D}}function d(w){for(var v=[],i=f(w,["moov","trak"]),D=0;Dh)&&(this.startTime=h),this.endTime=s,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},g.reset=function(){this.cueRanges=[]},T}()},"./src/utils/texttrack-utils.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"sendAddTrackEvent",function(){return T}),S.d(m,"addCueToTrack",function(){return g}),S.d(m,"clearCurrentCues",function(){return C}),S.d(m,"removeCuesInRange",function(){return h}),S.d(m,"getCuesInRange",function(){return a});var R=S("./src/utils/logger.ts");function T(r,f){var p;try{p=new Event("addtrack")}catch(d){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=r,f.dispatchEvent(p)}function g(r,f){var p=r.mode;if(p==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(f.id))try{if(r.addCue(f),!r.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(E){R.logger.debug("[texttrack-utils]: "+E);var d=new self.TextTrackCue(f.startTime,f.endTime,f.text);d.id=f.id,r.addCue(d)}p==="disabled"&&(r.mode=p)}function C(r){var f=r.mode;if(f==="disabled"&&(r.mode="hidden"),r.cues)for(var p=r.cues.length;p--;)r.removeCue(r.cues[p]);f==="disabled"&&(r.mode=f)}function h(r,f,p){var d=r.mode;if(d==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0)for(var E=a(r.cues,f,p),y=0;yr[p].endTime)return-1;for(var d=0,E=p;d<=E;){var y=Math.floor((E+d)/2);if(fr[y].startTime&&d-1)for(var y=E,l=r.length;y=f&&n.endTime<=p)d.push(n);else if(n.startTime>p)return d}return d}},"./src/utils/time-ranges.ts":function(P,m,S){"use strict";S.r(m);var R={toString:function(g){for(var C="",h=g.length,s=0;s1?f-1:0),d=1;d100)throw new Error("Position must be between 0 and 100.");c=F,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",s({},E,{get:function(){return b},set:function(F){var L=h(F);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");b=L,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",s({},E,{get:function(){return x},set:function(F){if(F<0||F>100)throw new Error("Size must be between 0 and 100.");x=F,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",s({},E,{get:function(){return _},set:function(F){var L=h(F);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");_=L,this.hasBeenReset=!0}})),d.displayState=void 0}return a.prototype.getCueAsHTML=function(){var r=self.WebVTT;return r.convertCueToDOMTree(self,this.text)},a}()},"./src/utils/vttparser.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"parseTimeStamp",function(){return g}),S.d(m,"fixLineBreaks",function(){return f}),S.d(m,"VTTParser",function(){return p});var R=S("./src/utils/vttcue.ts"),T=function(){function d(){}var E=d.prototype;return E.decode=function(l,n){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},d}();function g(d){function E(l,n,o,u){return(l|0)*3600+(n|0)*60+(o|0)+parseFloat(u||0)}var y=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return y?parseFloat(y[2])>59?E(y[2],y[3],0,y[4]):E(y[1],y[2],y[3],y[4]):null}var C=function(){function d(){this.values=Object.create(null)}var E=d.prototype;return E.set=function(l,n){!this.get(l)&&n!==""&&(this.values[l]=n)},E.get=function(l,n,o){return o?this.has(l)?this.values[l]:n[o]:this.has(l)?this.values[l]:n},E.has=function(l){return l in this.values},E.alt=function(l,n,o){for(var u=0;u=0&&o<=100)return this.set(l,o),!0}return!1},d}();function h(d,E,y,l){var n=l?d.split(l):[d];for(var o in n){if(typeof n[o]!="string")continue;var u=n[o].split(y);if(u.length!==2)continue;var w=u[0],v=u[1];E(w,v)}}var s=new R.default(0,0,""),a=s.align==="middle"?"middle":"center";function r(d,E,y){var l=d;function n(){var w=g(d);if(w===null)throw new Error("Malformed timestamp: "+l);return d=d.replace(/^[^\sa-zA-Z-]+/,""),w}function o(w,v){var i=new C;h(w,function(c,b){var x;switch(c){case"region":for(var _=y.length-1;_>=0;_--)if(y[_].id===b){i.set(c,y[_].region);break}break;case"vertical":i.alt(c,b,["rl","lr"]);break;case"line":x=b.split(","),i.integer(c,x[0]),i.percent(c,x[0])&&i.set("snapToLines",!1),i.alt(c,x[0],["auto"]),x.length===2&&i.alt("lineAlign",x[1],["start",a,"end"]);break;case"position":x=b.split(","),i.percent(c,x[0]),x.length===2&&i.alt("positionAlign",x[1],["start",a,"end","line-left","line-right","auto"]);break;case"size":i.percent(c,b);break;case"align":i.alt(c,b,["start",a,"end","left","right"]);break}},/:/,/\s/),v.region=i.get("region",null),v.vertical=i.get("vertical","");var D=i.get("line","auto");D==="auto"&&s.line===-1&&(D=-1),v.line=D,v.lineAlign=i.get("lineAlign","start"),v.snapToLines=i.get("snapToLines",!0),v.size=i.get("size",100),v.align=i.get("align",a);var k=i.get("position","auto");k==="auto"&&s.position===50&&(k=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=k}function u(){d=d.replace(/^\s+/,"")}if(u(),E.startTime=n(),u(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);d=d.substr(3),u(),E.endTime=n(),u(),o(d,E)}function f(d){return d.replace(//gi,` `)}var p=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new T,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var E=d.prototype;return E.parse=function(l){var n=this;l&&(n.buffer+=n.decoder.decode(l,{stream:!0}));function o(){var k=n.buffer,c=0;for(k=f(k);c")===-1){n.cue.id=w;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{r(w,n.cue,n.regionList)}catch(k){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var D=w.indexOf("-->")!==-1;if(!w||D&&(i=!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+=w}continue;case"BADCUE":w||(n.state="ID")}}}catch(k){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},E.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=` `,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){l.onparsingerror&&l.onparsingerror(n)}return l.onflush&&l.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"generateCueId",function(){return p}),S.d(m,"parseWebVTT",function(){return E});var R=S("./src/polyfills/number.ts"),T=S("./src/utils/vttparser.ts"),g=S("./src/demux/id3.ts"),C=S("./src/utils/timescale-conversion.ts"),h=S("./src/remux/mp4-remuxer.ts"),s=/\r\n|\n\r|\n|\r/g,a=function(l,n,o){return o===void 0&&(o=0),l.substr(o,n.length)===n},r=function(l){var n=parseInt(l.substr(-3)),o=parseInt(l.substr(-6,2)),u=parseInt(l.substr(-9,2)),w=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(R.isFiniteNumber)(n)||!Object(R.isFiniteNumber)(o)||!Object(R.isFiniteNumber)(u)||!Object(R.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return n+=1e3*o,n+=60*1e3*u,n+=60*60*1e3*w,n},f=function(l){for(var n=5381,o=l.length;o;)n=n*33^l.charCodeAt(--o);return(n>>>0).toString()};function p(y,l,n){return f(y.toString())+f(l.toString())+f(n)}var d=function(l,n,o){var u=l[n],w=l[u.prevCC];if(!w||!w.new&&u.new){l.ccOffset=l.presentationOffset=u.start,u.new=!1;return}for(;(v=w)!==null&&v!==void 0&&v.new;){var v;l.ccOffset+=u.start-w.start,u.new=!1,u=w,w=l[u.prevCC]}l.presentationOffset=o};function E(y,l,n,o,u,w,v,i){var D=new T.VTTParser,k=Object(g.utf8ArrayToStr)(new Uint8Array(y)).trim().replace(s,` `).split(` `),c=[],b=Object(C.toMpegTsClockFromTimescale)(l,n),x="00:00.000",_=0,j=0,F,L=!0,X=!1;D.oncue=function(z){var H=o[u],G=o.ccOffset,U=(_-b)/9e4;if(H!=null&&H.new&&(j!==void 0?G=o.ccOffset=H.start:d(o,u,U)),U&&(G=U-o.presentationOffset),X){var B=z.endTime-z.startTime,W=Object(h.normalizePts)((z.startTime+G-j)*9e4,w*9e4)/9e4;z.startTime=W,z.endTime=W+B}var te=z.text.trim();z.text=decodeURIComponent(encodeURIComponent(te)),z.id||(z.id=p(z.startTime,z.endTime,te)),z.endTime>0&&c.push(z)},D.onparsingerror=function(z){F=z},D.onflush=function(){if(F){i(F);return}v(c)},k.forEach(function(z){if(L)if(a(z,"X-TIMESTAMP-MAP=")){L=!1,X=!0,z.substr(16).split(",").forEach(function(H){a(H,"LOCAL:")?x=H.substr(6):a(H,"MPEGTS:")&&(_=parseInt(H.substr(7)))});try{j=r(x)/1e3}catch(H){X=!1,F=H}return}else z===""&&(L=!1);D.parse(z+` `)}),D.flush()}},"./src/utils/xhr-loader.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/utils/logger.ts"),T=S("./src/loader/load-stats.ts"),g=/^age:\s*[\d.]+\s*$/m,C=function(){function h(a){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=a?a.xhrSetup:null,this.stats=new T.LoadStats,this.retryDelay=0}var s=h.prototype;return s.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},s.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()))},s.abort=function(){var r;this.abortInternal(),(r=this.callbacks)!==null&&r!==void 0&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},s.load=function(r,f,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=f,this.callbacks=p,this.retryDelay=f.retryDelay,this.loadInternal()},s.loadInternal=function(){var r=this.config,f=this.context;if(!r)return;var p=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var E=this.xhrSetup;try{if(E)try{E(p,f.url)}catch(n){p.open("GET",f.url,!0),E(p,f.url)}p.readyState||p.open("GET",f.url,!0);var y=this.context.headers;if(y)for(var l in y)p.setRequestHeader(l,y[l])}catch(n){this.callbacks.onError({code:p.status,text:n.message},f,p);return}f.rangeEnd&&p.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),p.send()},s.readystatechange=function(){var r=this.context,f=this.loader,p=this.stats;if(!r||!f)return;var d=f.readyState,E=this.config;if(p.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),d===4){f.onreadystatechange=null,f.onprogress=null;var y=f.status;if(y>=200&&y<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var l,n;if(r.responseType==="arraybuffer"?(l=f.response,n=l.byteLength):(l=f.responseText,n=l.length),p.loaded=p.total=n,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(p,r,l,f),!this.callbacks)return;var u={url:f.responseURL,data:l};this.callbacks.onSuccess(u,p,r,f)}else p.retry>=E.maxRetry||y>=400&&y<499?(R.logger.error(y+" while loading "+r.url),this.callbacks.onError({code:y,text:f.statusText},r,f)):(R.logger.warn(y+" 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,E.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout)},s.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))},s.loadprogress=function(r){var f=this.stats;f.loaded=r.loaded,r.lengthComputable&&(f.total=r.total)},s.getCacheAge=function(){var r=null;if(this.loader&&g.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");r=f?parseFloat(f):null}return r},h}();m.default=C}}).default})},vHTk:function(I,q,N){I.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},w7YG:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.StreamCipher,T=m.algo,g=T.RC4=R.extend({_doReset:function(){for(var s=this._key,a=s.words,r=s.sigBytes,f=this._S=[],p=0;p<256;p++)f[p]=p;for(var p=0,d=0;p<256;p++){var E=p%r,y=a[E>>>2]>>>24-E%4*8&255;d=(d+f[p]+y)%256;var l=f[p];f[p]=f[d],f[d]=l}this._i=this._j=0},_doProcessBlock:function(s,a){s[a]^=C.call(this)},keySize:256/32,ivSize:0});function C(){for(var s=this._S,a=this._i,r=this._j,f=0,p=0;p<4;p++){a=(a+1)%256,r=(r+s[a])%256;var d=s[a];s[a]=s[r],s[r]=d,f|=s[(s[a]+s[r])%256]<<24-p*8}return this._i=a,this._j=r,f}m.RC4=R._createHelper(g);var h=T.RC4Drop=g.extend({cfg:g.cfg.extend({drop:192}),_doReset:function(){g._doReset.call(this);for(var s=this.cfg.drop;s>0;s--)C.call(this)}});m.RC4Drop=R._createHelper(h)}(),P.RC4})},wZgz:function(I,q,N){(function(P,m,S){I.exports=q=m(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.BlockCipher,T=m.algo,g=[],C=[],h=[],s=[],a=[],r=[],f=[],p=[],d=[],E=[];(function(){for(var n=[],o=0;o<256;o++)o<128?n[o]=o<<1:n[o]=o<<1^283;for(var u=0,w=0,o=0;o<256;o++){var v=w^w<<1^w<<2^w<<3^w<<4;v=v>>>8^v&255^99,g[u]=v,C[v]=u;var i=n[u],D=n[i],k=n[D],c=n[v]*257^v*16843008;h[u]=c<<24|c>>>8,s[u]=c<<16|c>>>16,a[u]=c<<8|c>>>24,r[u]=c;var c=k*16843009^D*65537^i*257^u*16843008;f[v]=c<<24|c>>>8,p[v]=c<<16|c>>>16,d[v]=c<<8|c>>>24,E[v]=c,u?(u=i^n[n[n[k^i]]],w^=n[n[w]]):u=w=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],l=T.AES=R.extend({_doReset:function(){var n;if(this._nRounds&&this._keyPriorReset===this._key)return;for(var o=this._keyPriorReset=this._key,u=o.words,w=o.sigBytes/4,v=this._nRounds=w+6,i=(v+1)*4,D=this._keySchedule=[],k=0;k6&&k%w==4&&(n=g[n>>>24]<<24|g[n>>>16&255]<<16|g[n>>>8&255]<<8|g[n&255]):(n=n<<8|n>>>24,n=g[n>>>24]<<24|g[n>>>16&255]<<16|g[n>>>8&255]<<8|g[n&255],n^=y[k/w|0]<<24),D[k]=D[k-w]^n);for(var c=this._invKeySchedule=[],b=0;b>>24]]^p[g[n>>>16&255]]^d[g[n>>>8&255]]^E[g[n&255]]}},encryptBlock:function(n,o){this._doCryptBlock(n,o,this._keySchedule,h,s,a,r,g)},decryptBlock:function(n,o){var u=n[o+1];n[o+1]=n[o+3],n[o+3]=u,this._doCryptBlock(n,o,this._invKeySchedule,f,p,d,E,C);var u=n[o+1];n[o+1]=n[o+3],n[o+3]=u},_doCryptBlock:function(n,o,u,w,v,i,D,k){for(var c=this._nRounds,b=n[o]^u[0],x=n[o+1]^u[1],_=n[o+2]^u[2],j=n[o+3]^u[3],F=4,L=1;L>>24]^v[x>>>16&255]^i[_>>>8&255]^D[j&255]^u[F++],z=w[x>>>24]^v[_>>>16&255]^i[j>>>8&255]^D[b&255]^u[F++],H=w[_>>>24]^v[j>>>16&255]^i[b>>>8&255]^D[x&255]^u[F++],G=w[j>>>24]^v[b>>>16&255]^i[x>>>8&255]^D[_&255]^u[F++];b=X,x=z,_=H,j=G}var X=(k[b>>>24]<<24|k[x>>>16&255]<<16|k[_>>>8&255]<<8|k[j&255])^u[F++],z=(k[x>>>24]<<24|k[_>>>16&255]<<16|k[j>>>8&255]<<8|k[b&255])^u[F++],H=(k[_>>>24]<<24|k[j>>>16&255]<<16|k[b>>>8&255]<<8|k[x&255])^u[F++],G=(k[j>>>24]<<24|k[b>>>16&255]<<16|k[x>>>8&255]<<8|k[_&255])^u[F++];n[o]=X,n[o+1]=z,n[o+2]=H,n[o+3]=G},keySize:256/32});m.AES=R._createHelper(l)}(),P.AES})},wbyO:function(I,q,N){(function(P,m){I.exports=q=m(N("Ib8C"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=m.enc,g=T.Base64url={stringify:function(h,s=!0){var a=h.words,r=h.sigBytes,f=s?this._safe_map:this._map;h.clamp();for(var p=[],d=0;d>>2]>>>24-d%4*8&255,y=a[d+1>>>2]>>>24-(d+1)%4*8&255,l=a[d+2>>>2]>>>24-(d+2)%4*8&255,n=E<<16|y<<8|l,o=0;o<4&&d+o*.75>>6*(3-o)&63));var u=f.charAt(64);if(u)for(;p.length%4;)p.push(u);return p.join("")},parse:function(h,s=!0){var a=h.length,r=s?this._safe_map:this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var p=0;p>>6-p%4*2,y=d|E;r[f>>>2]|=y<<24-f%4*8,f++}return R.create(r,f)}}(),P.enc.Base64url})},ynwM:function(I,q,N){var P=N("MFOe"),m=P.Global;I.exports={name:"oldFF-globalStorage",read:R,write:T,each:g,remove:C,clearAll:h};var S=m.globalStorage;function R(s){return S[s]}function T(s,a){S[s]=a}function g(s){for(var a=S.length-1;a>=0;a--){var r=S.key(a);s(S[r],r)}}function C(s){return S.removeItem(s)}function h(){g(function(s,a){delete S[s]})}}}]);