|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[191,5,6,7,8,10],{"+NIl":function(I,$,R){(function(M){M(R("VrN/"))})(function(M){"use strict";M.defineMode("stex",function(g,T){"use strict";function D(u,p){u.cmdState.push(p)}function v(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function f(u){var p=u.cmdState.pop();p&&p.closeBracket()}function S(u){for(var p=u.cmdState,m=p.length-1;m>=0;m--){var i=p[m];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function y(u,p,m){return function(){this.name=u,this.bracketNo=0,this.style=p,this.styles=m,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var c={};c.importmodule=y("importmodule","tag",["string","builtin"]),c.documentclass=y("documentclass","tag",["","atom"]),c.usepackage=y("usepackage","tag",["atom"]),c.begin=y("begin","tag",["atom"]),c.end=y("end","tag",["atom"]),c.label=y("label","tag",["atom"]),c.ref=y("ref","tag",["atom"]),c.eqref=y("eqref","tag",["atom"]),c.cite=y("cite","tag",["atom"]),c.bibitem=y("bibitem","tag",["atom"]),c.Bibitem=y("Bibitem","tag",["atom"]),c.RBibitem=y("RBibitem","tag",["atom"]),c.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function o(u,p){u.f=p}function r(u,p){var m;if(u.match(/^\\[a-zA-Z@]+/)){var i=u.current().slice(1);return m=c.hasOwnProperty(i)?c[i]:c.DEFAULT,m=new m,D(p,m),o(p,d),m.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return o(p,function(a,l){return s(a,l,"\\]")}),"keyword";if(u.match("\\("))return o(p,function(a,l){return s(a,l,"\\)")}),"keyword";if(u.match("$$"))return o(p,function(a,l){return s(a,l,"$$")}),"keyword";if(u.match("$"))return o(p,function(a,l){return s(a,l,"$")}),"keyword";var t=u.next();if(t=="%")return u.skipToEnd(),"comment";if(t=="}"||t=="]"){if(m=v(p),m)m.closeBracket(t),o(p,d);else return"error";return"bracket"}else return t=="{"||t=="["?(m=c.DEFAULT,m=new m,D(p,m),"bracket"):/\d/.test(t)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),m=S(p),m.name=="begin"&&(m.argument=u.current()),m.styleIdentifier())}function s(u,p,m){if(u.eatSpace())return null;if(m&&u.match(m))return o(p,r),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=u.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(u.skipToEnd(),"comment"):"error"}function d(u,p){var m=u.peek(),i;return m=="{"||m=="["?(i=v(p),i.openBracket(m),u.eat(m),o(p,r),"bracket"):/[ \t\r]/.test(m)?(u.eat(m),null):(o(p,r),f(p),r(u,p))}return{startState:function(){var u=T.inMathMode?function(p,m){return s(p,m)}:r;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,p){return p.f(u,p)},blankLine:function(u){u.f=r,u.cmdState.length=0},lineComment:"%"}}),M.defineMIME("text/x-stex","stex"),M.defineMIME("text/x-latex","stex")})},"+ua5":function(I,$,R){},"/cxE":function(I,$,R){"use strict";R.d($,"e",function(){return T}),R.d($,"f",function(){return D}),R.d($,"g",function(){return v}),R.d($,"d",function(){return S}),R.d($,"a",function(){return y}),R.d($,"b",function(){return c}),R.d($,"c",function(){return o});var M=function(){function r(){this.listeners=[],this.unexpectedErrorHandler=function(s){setTimeout(function(){throw s.stack?new Error(s.message+`
|
|
|
|
|
|
`+s.stack):s},0)}}return r.prototype.emit=function(s){this.listeners.forEach(function(d){d(s)})},r.prototype.onUnexpectedError=function(s){this.unexpectedErrorHandler(s),this.emit(s)},r.prototype.onUnexpectedExternalError=function(s){this.unexpectedErrorHandler(s)},r}(),g=new M;function T(r){S(r)||g.onUnexpectedError(r);return}function D(r){S(r)||g.onUnexpectedExternalError(r);return}function v(r){if(r instanceof Error){var s=r.name,d=r.message,u=r.stacktrace||r.stack;return{$isError:!0,name:s,message:d,stack:u}}return r}var f="Canceled";function S(r){return r instanceof Error&&r.name===f&&r.message===f}function y(){var r=new Error(f);return r.name=r.message,r}function c(r){return r?new Error("Illegal argument: "+r):new Error("Illegal argument")}function o(r){return r?new Error("Illegal state: "+r):new Error("Illegal state")}},"19Vz":function(I,$,R){(function(M){M(R("VrN/"))})(function(M){M.defineOption("placeholder","",function(y,c,o){var r=o&&o!=M.Init;if(c&&!r)y.on("blur",v),y.on("change",f),y.on("swapDoc",f),M.on(y.getInputField(),"compositionupdate",y.state.placeholderCompose=function(){D(y)}),f(y);else if(!c&&r){y.off("blur",v),y.off("change",f),y.off("swapDoc",f),M.off(y.getInputField(),"compositionupdate",y.state.placeholderCompose),g(y);var s=y.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}c&&!y.hasFocus()&&v(y)});function g(y){y.state.placeholder&&(y.state.placeholder.parentNode.removeChild(y.state.placeholder),y.state.placeholder=null)}function T(y){g(y);var c=y.state.placeholder=document.createElement("pre");c.style.cssText="height: 0; overflow: visible",c.style.direction=y.getOption("direction"),c.className="CodeMirror-placeholder CodeMirror-line-like";var o=y.getOption("placeholder");typeof o=="string"&&(o=document.createTextNode(o)),c.appendChild(o),y.display.lineSpace.insertBefore(c,y.display.lineSpace.firstChild)}function D(y){setTimeout(function(){var c=!1,o=y.getInputField();o.nodeName=="TEXTAREA"?c=!o.value:y.lineCount()==1&&(c=!/[^\u200b]/.test(o.querySelector(".CodeMirror-line").textContent)),c?T(y):g(y)},20)}function v(y){S(y)&&T(y)}function f(y){var c=y.getWrapperElement(),o=S(y);c.className=c.className.replace(" CodeMirror-empty","")+(o?" CodeMirror-empty":""),o?T(y):g(y)}function S(y){return y.lineCount()===1&&y.getLine(0)===""}})},"1T2W":function(I,$,R){I.exports={"code-panel-container":"code-panel-container___1BMQ9","action-oj-bar":"action-oj-bar___1PRBr",active:"active___2710v"}},"1eCo":function(I,$,R){(function(M){M(R("VrN/"))})(function(M){"use strict";var g={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},T={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};M.defineMode("xml",function(D,v){var f=D.indentUnit,S={},y=v.htmlMode?g:T;for(var c in y)S[c]=y[c];for(var c in v)S[c]=v[c];var o,r;function s(_,j){function N(z){return j.tokenize=z,z(_,j)}var P=_.next();if(P=="<")return _.eat("!")?_.eat("[")?_.match("CDATA[")?N(p("atom","]]>")):null:_.match("--")?N(p("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),N(m(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),j.tokenize=p("meta","?>"),"meta"):(o=_.eat("/")?"closeTag":"openTag",j.tokenize=d,"tag bracket");if(P=="&"){var V;return _.eat("#")?_.eat("x")?V=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):V=_.eatWhile(/[\d]/)&&_.eat(";"):V=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),V?"atom":"error"}else return _.eatWhile(/[^&<]/),null}s.isInText=!0;function d(_,j){var N=_.next();if(N==">"||N=="/"&&_.eat(">"))return j.tokenize=s,o=N==">"?"endTag":"selfcloseTag","tag bracket";if(N=="=")return o="equals",null;if(N=="<"){j.tokenize=s,j.state=l,j.tagName=j.tagStart=null;var P=j.tokenize(_,j);return P?P+" tag error":"tag error"}else return/[\'\"]/.test(N)?(j.tokenize=u(N),j.stringStartCol=_.column(),j.tokenize(_,j)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(_){var j=function(N,P){for(;!N.eol();)if(N.next()==_){P.tokenize=d;break}return"string"};return j.isInAttribute=!0,j}function p(_,j){return function(N,P){for(;!N.eol();){if(N.match(j)){P.tokenize=s;break}N.next()}return _}}function m(_){return function(j,N){for(var P;(P=j.next())!=null;){if(P=="<")return N.tokenize=m(_+1),N.tokenize(j,N);if(P==">")if(_==1){N.tokenize=s;break}else return N.tokenize=m(_-1),N.tokenize(j,N)}return"meta"}}function i(_,j,N){this.prev=_.context,this.tagName=j,this.indent=_.indented,this.startOfLine=N,(S.doNotIndent.hasOwnProperty(j)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function t(_){_.context&&(_.context=_.context.prev)}function a(_,j){for(var N;;){if(!_.context)return;if(N=_.context.tagName,!S.contextGrabbers.hasOwnProperty(N)||!S.contextGrabbers[N].hasOwnProperty(j))return;t(_)}}function l(_,j,N){return _=="openTag"?(N.tagStart=j.column(),E):_=="closeTag"?b:l}function E(_,j,N){return _=="word"?(N.tagName=j.current(),r="tag",O):S.allowMissingTagName&&_=="endTag"?(r="tag bracket",O(_,j,N)):(r="error",E)}function b(_,j,N){if(_=="word"){var P=j.current();return N.context&&N.context.tagName!=P&&S.implicitlyClosed.hasOwnProperty(N.context.tagName)&&t(N),N.context&&N.context.tagName==P||S.matchClosing===!1?(r="tag",h):(r="tag error",L)}else return S.allowMissingTagName&&_=="endTag"?(r="tag bracket",h(_,j,N)):(r="error",L)}function h(_,j,N){return _!="endTag"?(r="error",h):(t(N),l)}function L(_,j,N){return r="error",h(_,j,N)}function O(_,j,N){if(_=="word")return r="attribute",w;if(_=="endTag"||_=="selfcloseTag"){var P=N.tagName,V=N.tagStart;return N.tagName=N.tagStart=null,_=="selfcloseTag"||S.autoSelfClosers.hasOwnProperty(P)?a(N,P):(a(N,P),N.context=new i(N,P,V==N.indented)),l}return r="error",O}function w(_,j,N){return _=="equals"?C:(S.allowMissing||(r="error"),O(_,j,N))}function C(_,j,N){return _=="string"?x:_=="word"&&S.allowUnquoted?(r="string",O):(r="error",O(_,j,N))}function x(_,j,N){return _=="string"?x:O(_,j,N)}return{startState:function(_){var j={tokenize:s,state:l,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;o=null;var N=j.tokenize(_,j);return(N||o)&&N!="comment"&&(r=null,j.state=j.state(o||N,_,j),r&&(N=r=="error"?N+" error":r)),N},indent:function(_,j,N){var P=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+f;if(P&&P.noIndent)return M.Pass;if(_.tokenize!=d&&_.tokenize!=s)return N?N.match(/^(\s*)/)[0].length:0;if(_.tagName)return S.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+f*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/<!\[CDATA\[/.test(j))return 0;var V=j&&/^<(\/)?([\w_:\.-]*)/.exec(j);if(V&&V[1])for(;P;)if(P.tagName==V[2]){P=P.prev;break}else if(S.implicitlyClosed.hasOwnProperty(P.tagName))P=P.prev;else break;else if(V)for(;P;){var z=S.contextGrabbers[P.tagName];if(z&&z.hasOwnProperty(V[2]))P=P.prev;else break}for(;P&&P.prev&&!P.startOfLine;)P=P.prev;return P?P.indent+f:_.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(_){_.state==C&&(_.state=O)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var j=[],N=_.context;N;N=N.prev)N.tagName&&j.push(N.tagName);return j.reverse()}}}),M.defineMIME("text/xml","xml"),M.defineMIME("application/xml","xml"),M.mimeModes.hasOwnProperty("text/html")||M.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("MlIO"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.Hasher,v=g.x64,f=v.Word,S=v.WordArray,y=g.algo;function c(){return f.create.apply(f,arguments)}var o=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],r=[];(function(){for(var d=0;d<80;d++)r[d]=c()})();var s=y.SHA512=D.extend({_doReset:function(){this._hash=new S.init([new f.init(1779033703,4089235720),new f.init(3144134277,2227873595),new f.init(1013904242,4271175723),new f.init(2773480762,1595750129),new f.init(1359893119,2917565137),new f.init(2600822924,725511199),new f.init(528734635,4215389547),new f.init(1541459225,327033209)])},_doProcessBlock:function(d,u){for(var p=this._hash.words,m=p[0],i=p[1],t=p[2],a=p[3],l=p[4],E=p[5],b=p[6],h=p[7],L=m.high,O=m.low,w=i.high,C=i.low,x=t.high,_=t.low,j=a.high,N=a.low,P=l.high,V=l.low,z=E.high,B=E.low,K=b.high,U=b.low,W=h.high,H=h.low,q=L,ne=O,te=w,_e=C,Ce=x,me=_,Me=j,Oe=N,he=P,ce=V,se=z,Te=B,re=K,ue=U,fe=W,ee=H,Q=0;Q<80;Q++){var X,Z,ve=r[Q];if(Q<16)Z=ve.high=d[u+Q*2]|0,X=ve.low=d[u+Q*2+1]|0;else{var ye=r[Q-15],Re=ye.high,Je=ye.low,Ze=(Re>>>1|Je<<31)^(Re>>>8|Je<<24)^Re>>>7,rt=(Je>>>1|Re<<31)^(Je>>>8|Re<<24)^(Je>>>7|Re<<25),tt=r[Q-2],st=tt.high,ot=tt.low,Fe=(st>>>19|ot<<13)^(st<<3|ot>>>29)^st>>>6,Ae=(ot>>>19|st<<13)^(ot<<3|st>>>29)^(ot>>>6|st<<26),qe=r[Q-7],ut=qe.high,$e=qe.low,nt=r[Q-16],je=nt.high,De=nt.low;X=rt+$e,Z=Ze+ut+(X>>>0<rt>>>0?1:0),X=X+Ae,Z=Z+Fe+(X>>>0<Ae>>>0?1:0),X=X+De,Z=Z+je+(X>>>0<De>>>0?1:0),ve.high=Z,ve.low=X}var Pe=he&se^~he&re,xe=ce&Te^~ce&ue,Se=q&te^q&Ce^te&Ce,Le=ne&_e^ne&me^_e&me,Ne=(q>>>28|ne<<4)^(q<<30|ne>>>2)^(q<<25|ne>>>7),et=(ne>>>28|q<<4)^(ne<<30|q>>>2)^(ne<<25|q>>>7),Xe=(he>>>14|ce<<18)^(he>>>18|ce<<14)^(he<<23|ce>>>9),ct=(ce>>>14|he<<18)^(ce>>>18|he<<14)^(ce<<23|he>>>9),gt=o[Q],wt=gt.high,vt=gt.low,Mt=ee+ct,Pt=fe+Xe+(Mt>>>0<ee>>>0?1:0),Mt=Mt+xe,Pt=Pt+Pe+(Mt>>>0<xe>>>0?1:0),Mt=Mt+vt,Pt=Pt+wt+(Mt>>>0<vt>>>0?1:0),Mt=Mt+X,Pt=Pt+Z+(Mt>>>0<X>>>0?1:0),_t=et+Le,rr=Ne+Se+(_t>>>0<et>>>0?1:0);fe=re,ee=ue,re=se,ue=Te,se=he,Te=ce,ce=Oe+Mt|0,he=Me+Pt+(ce>>>0<Oe>>>0?1:0)|0,Me=Ce,Oe=me,Ce=te,me=_e,te=q,_e=ne,ne=Mt+_t|0,q=Pt+rr+(ne>>>0<Mt>>>0?1:0)|0}O=m.low=O+ne,m.high=L+q+(O>>>0<ne>>>0?1:0),C=i.low=C+_e,i.high=w+te+(C>>>0<_e>>>0?1:0),_=t.low=_+me,t.high=x+Ce+(_>>>0<me>>>0?1:0),N=a.low=N+Oe,a.high=j+Me+(N>>>0<Oe>>>0?1:0),V=l.low=V+ce,l.high=P+he+(V>>>0<ce>>>0?1:0),B=E.low=B+Te,E.high=z+se+(B>>>0<Te>>>0?1:0),U=b.low=U+ue,b.high=K+re+(U>>>0<ue>>>0?1:0),H=h.low=H+ee,h.high=W+fe+(H>>>0<ee>>>0?1:0)},_doFinalize:function(){var d=this._data,u=d.words,p=this._nDataBytes*8,m=d.sigBytes*8;u[m>>>5]|=128<<24-m%32,u[(m+128>>>10<<5)+30]=Math.floor(p/4294967296),u[(m+128>>>10<<5)+31]=p,d.sigBytes=u.length*4,this._process();var i=this._hash.toX32();return i},clone:function(){var d=D.clone.call(this);return d._hash=this._hash.clone(),d},blockSize:1024/32});g.SHA512=D._createHelper(s),g.HmacSHA512=D._createHmacHelper(s)}(),M.SHA512})},"24hK":function(I,$,R){"use strict";R.d($,"a",function(){return T});var M=R("JYp7"),g=function(){function D(v){this.element=v,this.next=D.Undefined,this.prev=D.Undefined}return D.Undefined=new D(void 0),D}(),T=function(){function D(){this._first=g.Undefined,this._last=g.Undefined,this._size=0}return Object.defineProperty(D.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),D.prototype.isEmpty=function(){return this._first===g.Undefined},D.prototype.clear=function(){this._first=g.Undefined,this._last=g.Undefined,this._size=0},D.prototype.unshift=function(v){return this._insert(v,!1)},D.prototype.push=function(v){return this._insert(v,!0)},D.prototype._insert=function(v,f){var S=this,y=new g(v);if(this._first===g.Undefined)this._first=y,this._last=y;else if(f){var c=this._last;this._last=y,y.prev=c,c.next=y}else{var o=this._first;this._first=y,y.next=o,o.prev=y}this._size+=1;var r=!1;return function(){r||(r=!0,S._remove(y))}},D.prototype.shift=function(){if(this._first===g.Undefined)return;var v=this._first.element;return this._remove(this._first),v},D.prototype.pop=function(){if(this._last===g.Undefined)return;var v=this._last.element;return this._remove(this._last),v},D.prototype._remove=function(v){if(v.prev!==g.Undefined&&v.next!==g.Undefined){var f=v.prev;f.next=v.next,v.next.prev=f}else v.prev===g.Undefined&&v.next===g.Undefined?(this._first=g.Undefined,this._last=g.Undefined):v.next===g.Undefined?(this._last=this._last.prev,this._last.next=g.Undefined):v.prev===g.Undefined&&(this._first=this._first.next,this._first.prev=g.Undefined);this._size-=1},D.prototype.iterator=function(){var v,f=this._first;return{next:function(){return f===g.Undefined?M.c:(v?v.value=f.element:v={done:!1,value:f.element},f=f.next,v)}}},D.prototype.toArray=function(){for(var v=[],f=this._first;f!==g.Undefined;f=f.next)v.push(f.element);return v},D}()},"3y9D":function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.WordArray,v=T.Hasher,f=g.algo,S=[],y=f.SHA1=v.extend({_doReset:function(){this._hash=new D.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,o){for(var r=this._hash.words,s=r[0],d=r[1],u=r[2],p=r[3],m=r[4],i=0;i<80;i++){if(i<16)S[i]=c[o+i]|0;else{var t=S[i-3]^S[i-8]^S[i-14]^S[i-16];S[i]=t<<1|t>>>31}var a=(s<<5|s>>>27)+m+S[i];i<20?a+=(d&u|~d&p)+1518500249:i<40?a+=(d^u^p)+1859775393:i<60?a+=(d&u|d&p|u&p)-1894007588:a+=(d^u^p)-899497514,m=p,p=u,u=d<<30|d>>>2,d=s,s=a}r[0]=r[0]+s|0,r[1]=r[1]+d|0,r[2]=r[2]+u|0,r[3]=r[3]+p|0,r[4]=r[4]+m|0},_doFinalize:function(){var c=this._data,o=c.words,r=this._nDataBytes*8,s=c.sigBytes*8;return o[s>>>5]|=128<<24-s%32,o[(s+64>>>9<<4)+14]=Math.floor(r/4294967296),o[(s+64>>>9<<4)+15]=r,c.sigBytes=o.length*4,this._process(),this._hash},clone:function(){var c=v.clone.call(this);return c._hash=this._hash.clone(),c}});g.SHA1=v._createHelper(y),g.HmacSHA1=v._createHmacHelper(y)}(),M.SHA1})},4:function(I,$){},"5hvy":function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("MlIO"))})(this,function(M){return function(g){var T=M,D=T.lib,v=D.WordArray,f=D.Hasher,S=T.x64,y=S.Word,c=T.algo,o=[],r=[],s=[];(function(){for(var p=1,m=0,i=0;i<24;i++){o[p+5*m]=(i+1)*(i+2)/2%64;var t=m%5,a=(2*p+3*m)%5;p=t,m=a}for(var p=0;p<5;p++)for(var m=0;m<5;m++)r[p+5*m]=m+(2*p+3*m)%5*5;for(var l=1,E=0;E<24;E++){for(var b=0,h=0,L=0;L<7;L++){if(l&1){var O=(1<<L)-1;O<32?h^=1<<O:b^=1<<O-32}l&128?l=l<<1^113:l<<=1}s[E]=y.create(b,h)}})();var d=[];(function(){for(var p=0;p<25;p++)d[p]=y.create()})();var u=c.SHA3=f.extend({cfg:f.cfg.extend({outputLength:512}),_doReset:function(){for(var p=this._state=[],m=0;m<25;m++)p[m]=new y.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(p,m){for(var i=this._state,t=this.blockSize/2,a=0;a<t;a++){var l=p[m+2*a],E=p[m+2*a+1];l=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,E=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360;var b=i[a];b.high^=E,b.low^=l}for(var h=0;h<24;h++){for(var L=0;L<5;L++){for(var O=0,w=0,C=0;C<5;C++){var b=i[L+5*C];O^=b.high,w^=b.low}var x=d[L];x.high=O,x.low=w}for(var L=0;L<5;L++)for(var _=d[(L+4)%5],j=d[(L+1)%5],N=j.high,P=j.low,O=_.high^(N<<1|P>>>31),w=_.low^(P<<1|N>>>31),C=0;C<5;C++){var b=i[L+5*C];b.high^=O,b.low^=w}for(var V=1;V<25;V++){var O,w,b=i[V],z=b.high,B=b.low,K=o[V];K<32?(O=z<<K|B>>>32-K,w=B<<K|z>>>32-K):(O=B<<K-32|z>>>64-K,w=z<<K-32|B>>>64-K);var U=d[r[V]];U.high=O,U.low=w}var W=d[0],H=i[0];W.high=H.high,W.low=H.low;for(var L=0;L<5;L++)for(var C=0;C<5;C++){var V=L+5*C,b=i[V],q=d[V],ne=d[(L+1)%5+5*C],te=d[(L+2)%5+5*C];b.high=q.high^~ne.high&te.high,b.low=q.low^~ne.low&te.low}var b=i[0],_e=s[h];b.high^=_e.high,b.low^=_e.low}},_doFinalize:function(){var p=this._data,m=p.words,i=this._nDataBytes*8,t=p.sigBytes*8,a=this.blockSize*32;m[t>>>5]|=1<<24-t%32,m[(g.ceil((t+1)/a)*a>>>5)-1]|=128,p.sigBytes=m.length*4,this._process();for(var l=this._state,E=this.cfg.outputLength/8,b=E/8,h=[],L=0;L<b;L++){var O=l[L],w=O.high,C=O.low;w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,h.push(C),h.push(w)}return new v.init(h,E)},clone:function(){for(var p=f.clone.call(this),m=p._state=this._state.slice(0),i=0;i<25;i++)m[i]=m[i].clone();return p}});T.SHA3=f._createHelper(u),T.HmacSHA3=f._createHmacHelper(u)}(Math),M.SHA3})},"5nXd":function(I,$,R){var M=R("MFOe"),g=M.slice,T=M.pluck,D=M.each,v=M.bind,f=M.create,S=M.isList,y=M.isFunction,c=M.isObject;I.exports={createStore:s};var o={version:"2.0.12",enabled:!1,get:function(d,u){var p=this.storage.read(this._namespacePrefix+d);return this._deserialize(p,u)},set:function(d,u){return u===void 0?this.remove(d):(this.storage.write(this._namespacePrefix+d,this._serialize(u)),u)},remove:function(d){this.storage.remove(this._namespacePrefix+d)},each:function(d){var u=this;this.storage.each(function(p,m){d.call(u,u._deserialize(p),(m||"").replace(u._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(d){return this._namespacePrefix=="__storejs_"+d+"_"},createStore:function(){return s.apply(this,arguments)},addPlugin:function(d){this._addPlugin(d)},namespace:function(d){return s(this.storage,this.plugins,d)}};function r(){var d=typeof console=="undefined"?null:console;if(!d)return;var u=d.warn?d.warn:d.log;u.apply(d,arguments)}function s(d,u,p){p||(p=""),d&&!S(d)&&(d=[d]),u&&!S(u)&&(u=[u]);var m=p?"__storejs_"+p+"_":"",i=p?new RegExp("^"+m):null,t=/^[a-zA-Z0-9_\-]*$/;if(!t.test(p))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var a={_namespacePrefix:m,_namespaceRegexp:i,_testStorage:function(E){try{var b="__storejs__test__";E.write(b,b);var h=E.read(b)===b;return E.remove(b),h}catch(L){return!1}},_assignPluginFnProp:function(E,b){var h=this[b];this[b]=function(){var O=g(arguments,0),w=this;function C(){return h?(D(arguments,function(_,j){O[j]=_}),h.apply(w,O)):void 0}var x=[C].concat(O);return E.apply(w,x)}},_serialize:function(E){return JSON.stringify(E)},_deserialize:function(E,b){if(!E)return b;var h="";try{h=JSON.parse(E)}catch(L){h=E}return h!==void 0?h:b},_addStorage:function(E){if(this.enabled)return;this._testStorage(E)&&(this.storage=E,this.enabled=!0)},_addPlugin:function(E){var b=this;if(S(E)){D(E,function(O){b._addPlugin(O)});return}var h=T(this.plugins,function(O){return E===O});if(h)return;if(this.plugins.push(E),!y(E))throw new Error("Plugins must be function values that return objects");var L=E.call(this);if(!c(L))throw new Error("Plugins must return an object of function properties");D(L,function(O,w){if(!y(O))throw new Error("Bad plugin property: "+w+" from plugin "+E.name+". Plugins should only return functions.");b._assignPluginFnProp(O,w)})},addStorage:function(E){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(E)}},l=f(a,o,{plugins:[]});return l.raw={},D(l,function(E,b){y(E)&&(l.raw[b]=v(l,E))}),D(d,function(E){l._addStorage(E)}),D(u,function(E){l._addPlugin(E)}),l}},"6+eU":function(I,$,R){"use strict";R.d($,"a",function(){return h});var M=R("wx14"),g=R("rePB"),T=R("VTBJ"),D=R("1OyB"),v=R("vuIU"),f=R("Ji7U"),S=R("LK+K"),y=R("q1tI"),c=R.n(y),o=R("TSYQ"),r=R.n(o),s=function(O){var w,C="".concat(O.rootPrefixCls,"-item"),x=r()(C,"".concat(C,"-").concat(O.page),(w={},Object(g.a)(w,"".concat(C,"-active"),O.active),Object(g.a)(w,O.className,!!O.className),Object(g.a)(w,"".concat(C,"-disabled"),!O.page),w)),_=function(){O.onClick(O.page)},j=function(P){O.onKeyPress(P,O.onClick,O.page)};return c.a.createElement("li",{title:O.showTitle?O.page:null,className:x,onClick:_,onKeyPress:j,tabIndex:"0"},O.itemRender(O.page,"page",c.a.createElement("a",{rel:"nofollow"},O.page)))},d=s,u={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},p=function(L){Object(f.a)(w,L);var O=Object(S.a)(w);function w(){var C;Object(D.a)(this,w);for(var x=arguments.length,_=new Array(x),j=0;j<x;j++)_[j]=arguments[j];return C=O.call.apply(O,[this].concat(_)),C.state={goInputText:""},C.buildOptionText=function(N){return"".concat(N," ").concat(C.props.locale.items_per_page)},C.changeSize=function(N){C.props.changeSize(Number(N))},C.handleChange=function(N){C.setState({goInputText:N.target.value})},C.handleBlur=function(N){var P=C.props,V=P.goButton,z=P.quickGo,B=P.rootPrefixCls,K=C.state.goInputText;if(V||K==="")return;if(N.relatedTarget&&(N.relatedTarget.className.indexOf("".concat(B,"-prev"))>=0||N.relatedTarget.className.indexOf("".concat(B,"-next"))>=0))return;C.setState({goInputText:""}),z(C.getValidValue())},C.go=function(N){var P=C.state.goInputText;if(P==="")return;(N.keyCode===u.ENTER||N.type==="click")&&(C.setState({goInputText:""}),C.props.quickGo(C.getValidValue()))},C}return Object(v.a)(w,[{key:"getValidValue",value:function(){var x=this.state,_=x.goInputText,j=x.current;return!_||isNaN(_)?j:Number(_)}},{key:"getPageSizeOptions",value:function(){var x=this.props,_=x.pageSize,j=x.pageSizeOptions;return j.some(function(N){return N.toString()===_.toString()})?j:j.concat([_.toString()]).sort(function(N,P){var V=isNaN(Number(N))?0:Number(N),z=isNaN(Number(P))?0:Number(P);return V-z})}},{key:"render",value:function(){var x=this,_=this.props,j=_.pageSize,N=_.locale,P=_.rootPrefixCls,V=_.changeSize,z=_.quickGo,B=_.goButton,K=_.selectComponentClass,U=_.buildOptionText,W=_.selectPrefixCls,H=_.disabled,q=this.state.goInputText,ne="".concat(P,"-options"),te=K,_e=null,Ce=null,me=null;if(!V&&!z)return null;var Me=this.getPageSizeOptions();if(V&&te){var Oe=Me.map(function(he,ce){return c.a.createElement(te.Option,{key:ce,value:he.toString()},(U||x.buildOptionText)(he))});_e=c.a.createElement(te,{disabled:H,prefixCls:W,showSearch:!1,className:"".concat(ne,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(j||Me[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ce){return ce.parentNode}},Oe)}return z&&(B&&(me=typeof B=="boolean"?c.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(ne,"-quick-jumper-button")},N.jump_to_confirm):c.a.createElement("span",{onClick:this.go,onKeyUp:this.go},B)),Ce=c.a.createElement("div",{className:"".concat(ne,"-quick-jumper")},N.jump_to,c.a.createElement("input",{disabled:H,type:"text",value:q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),N.page,me)),c.a.createElement("li",{className:"".concat(ne)},_e,Ce)}}]),w}(c.a.Component);p.defaultProps={pageSizeOptions:["10","20","50","100"]};var m=p,i=R("N2Kk");function t(){}function a(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function l(L,O,w){return w}function E(L,O,w){var C=typeof L=="undefined"?O.pageSize:L;return Math.floor((w.total-1)/C)+1}var b=function(L){Object(f.a)(w,L);var O=Object(S.a)(w);function w(C){var x;Object(D.a)(this,w),x=O.call(this,C),x.getJumpPrevPage=function(){return Math.max(1,x.state.current-(x.props.showLessItems?3:5))},x.getJumpNextPage=function(){return Math.min(E(void 0,x.state,x.props),x.state.current+(x.props.showLessItems?3:5))},x.getItemIcon=function(V,z){var B=x.props.prefixCls,K=V||c.a.createElement("button",{type:"button","aria-label":z,className:"".concat(B,"-item-link")});return typeof V=="function"&&(K=c.a.createElement(V,Object(T.a)({},x.props))),K},x.savePaginationNode=function(V){x.paginationNode=V},x.isValid=function(V){return a(V)&&V!==x.state.current},x.shouldDisplayQuickJumper=function(){var V=x.props,z=V.showQuickJumper,B=V.pageSize,K=V.total;return K<=B?!1:z},x.handleKeyDown=function(V){(V.keyCode===u.ARROW_UP||V.keyCode===u.ARROW_DOWN)&&V.preventDefault()},x.handleKeyUp=function(V){var z=x.getValidValue(V),B=x.state.currentInputValue;z!==B&&x.setState({currentInputValue:z}),V.keyCode===u.ENTER?x.handleChange(z):V.keyCode===u.ARROW_UP?x.handleChange(z-1):V.keyCode===u.ARROW_DOWN&&x.handleChange(z+1)},x.changePageSize=function(V){var z=x.state.current,B=E(V,x.state,x.props);z=z>B?B:z,B===0&&(z=x.state.current),typeof V=="number"&&("pageSize"in x.props||x.setState({pageSize:V}),"current"in x.props||x.setState({current:z,currentInputValue:z})),x.props.onShowSizeChange(z,V),"onChange"in x.props&&x.props.onChange&&x.props.onChange(z,V)},x.handleChange=function(V){var z=x.props.disabled,B=V;if(x.isValid(B)&&!z){var K=E(void 0,x.state,x.props);B>K?B=K:B<1&&(B=1),"current"in x.props||x.setState({current:B,currentInputValue:B});var U=x.state.pageSize;return x.props.onChange(B,U),B}return x.state.current},x.prev=function(){x.hasPrev()&&x.handleChange(x.state.current-1)},x.next=function(){x.hasNext()&&x.handleChange(x.state.current+1)},x.jumpPrev=function(){x.handleChange(x.getJumpPrevPage())},x.jumpNext=function(){x.handleChange(x.getJumpNextPage())},x.hasPrev=function(){return x.state.current>1},x.hasNext=function(){return x.state.current<E(void 0,x.state,x.props)},x.runIfEnter=function(V,z){if(V.key==="Enter"||V.charCode===13){for(var B=arguments.length,K=new Array(B>2?B-2:0),U=2;U<B;U++)K[U-2]=arguments[U];z.apply(void 0,K)}},x.runIfEnterPrev=function(V){x.runIfEnter(V,x.prev)},x.runIfEnterNext=function(V){x.runIfEnter(V,x.next)},x.runIfEnterJumpPrev=function(V){x.runIfEnter(V,x.jumpPrev)},x.runIfEnterJumpNext=function(V){x.runIfEnter(V,x.jumpNext)},x.handleGoTO=function(V){(V.keyCode===u.ENTER||V.type==="click")&&x.handleChange(x.state.currentInputValue)};var _=C.onChange!==t,j="current"in C;j&&!_&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var N=C.defaultCurrent;"current"in C&&(N=C.current);var P=C.defaultPageSize;return"pageSize"in C&&(P=C.pageSize),N=Math.min(N,E(P,void 0,C)),x.state={current:N,currentInputValue:N,pageSize:P},x}return Object(v.a)(w,[{key:"componentDidUpdate",value:function(x,_){var j=this.props.prefixCls;if(_.current!==this.state.current&&this.paginationNode){var N=this.paginationNode.querySelector(".".concat(j,"-item-").concat(_.current));N&&document.activeElement===N&&N.blur()}}},{key:"getValidValue",value:function(x){var _=x.target.value,j=E(void 0,this.state,this.props),N=this.state.currentInputValue,P;return _===""?P=_:isNaN(Number(_))?P=N:_>=j?P=j:P=Number(_),P}},{key:"getShowSizeChanger",value:function(){var x=this.props,_=x.showSizeChanger,j=x.total,N=x.totalBoundaryShowSizeChanger;return typeof _!="undefined"?_:j>N}},{key:"renderPrev",value:function(x){var _=this.props,j=_.prevIcon,N=_.itemRender,P=N(x,"prev",this.getItemIcon(j,"prev page")),V=!this.hasPrev();return Object(y.isValidElement)(P)?Object(y.cloneElement)(P,{disabled:V}):P}},{key:"renderNext",value:function(x){var _=this.props,j=_.nextIcon,N=_.itemRender,P=N(x,"next",this.getItemIcon(j,"next page")),V=!this.hasNext();return Object(y.isValidElement)(P)?Object(y.cloneElement)(P,{disabled:V}):P}},{key:"render",value:function(){var x=this,_=this.props,j=_.prefixCls,N=_.className,P=_.style,V=_.disabled,z=_.hideOnSinglePage,B=_.total,K=_.locale,U=_.showQuickJumper,W=_.showLessItems,H=_.showTitle,q=_.showTotal,ne=_.simple,te=_.itemRender,_e=_.showPrevNextJumpers,Ce=_.jumpPrevIcon,me=_.jumpNextIcon,Me=_.selectComponentClass,Oe=_.selectPrefixCls,he=_.pageSizeOptions,ce=this.state,se=ce.current,Te=ce.pageSize,re=ce.currentInputValue;if(z===!0&&B<=Te)return null;var ue=E(void 0,this.state,this.props),fe=[],ee=null,Q=null,X=null,Z=null,ve=null,ye=U&&U.goButton,Re=W?1:2,Je=se-1>0?se-1:0,Ze=se+1<ue?se+1:ue,rt=Object.keys(this.props).reduce(function(xe,Se){return(Se.substr(0,5)==="data-"||Se.substr(0,5)==="aria-"||Se==="role")&&(xe[Se]=x.props[Se]),xe},{});if(ne)return ye&&(typeof ye=="boolean"?ve=c.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},K.jump_to_confirm):ve=c.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ye),ve=c.a.createElement("li",{title:H?"".concat(K.jump_to).concat(se,"/").concat(ue):null,className:"".concat(j,"-simple-pager")},ve)),c.a.createElement("ul",Object(M.a)({className:r()(j,"".concat(j,"-simple"),Object(g.a)({},"".concat(j,"-disabled"),V),N),style:P,ref:this.savePaginationNode},rt),c.a.createElement("li",{title:H?K.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:r()("".concat(j,"-prev"),Object(g.a)({},"".concat(j,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Je)),c.a.createElement("li",{title:H?"".concat(se,"/").concat(ue):null,className:"".concat(j,"-simple-pager")},c.a.createElement("input",{type:"text",value:re,disabled:V,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),c.a.createElement("span",{className:"".concat(j,"-slash")},"/"),ue),c.a.createElement("li",{title:H?K.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:r()("".concat(j,"-next"),Object(g.a)({},"".concat(j,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Ze)),ve);if(ue<=3+Re*2){var tt={locale:K,rootPrefixCls:j,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:te};ue||fe.push(c.a.createElement(d,Object(M.a)({},tt,{key:"noPager",page:ue,className:"".concat(j,"-disabled")})));for(var st=1;st<=ue;st+=1){var ot=se===st;fe.push(c.a.createElement(d,Object(M.a)({},tt,{key:st,page:st,active:ot})))}}else{var Fe=W?K.prev_3:K.prev_5,Ae=W?K.next_3:K.next_5;_e&&(ee=c.a.createElement("li",{title:H?Fe:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:r()("".concat(j,"-jump-prev"),Object(g.a)({},"".concat(j,"-jump-prev-custom-icon"),!!Ce))},te(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ce,"prev page"))),Q=c.a.createElement("li",{title:H?Ae:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:r()("".concat(j,"-jump-next"),Object(g.a)({},"".concat(j,"-jump-next-custom-icon"),!!me))},te(this.getJumpNextPage(),"jump-next",this.getItemIcon(me,"next page")))),Z=c.a.createElement(d,{locale:K,last:!0,rootPrefixCls:j,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ue,page:ue,active:!1,showTitle:H,itemRender:te}),X=c.a.createElement(d,{locale:K,rootPrefixCls:j,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:te});var qe=Math.max(1,se-Re),ut=Math.min(se+Re,ue);se-1<=Re&&(ut=1+Re*2),ue-se<=Re&&(qe=ue-Re*2);for(var $e=qe;$e<=ut;$e+=1){var nt=se===$e;fe.push(c.a.createElement(d,{locale:K,rootPrefixCls:j,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:$e,page:$e,active:nt,showTitle:H,itemRender:te}))}se-1>=Re*2&&se!==1+2&&(fe[0]=Object(y.cloneElement)(fe[0],{className:"".concat(j,"-item-after-jump-prev")}),fe.unshift(ee)),ue-se>=Re*2&&se!==ue-2&&(fe[fe.length-1]=Object(y.cloneElement)(fe[fe.length-1],{className:"".concat(j,"-item-before-jump-next")}),fe.push(Q)),qe!==1&&fe.unshift(X),ut!==ue&&fe.push(Z)}var je=null;q&&(je=c.a.createElement("li",{className:"".concat(j,"-total-text")},q(B,[B===0?0:(se-1)*Te+1,se*Te>B?B:se*Te])));var De=!this.hasPrev()||!ue,Pe=!this.hasNext()||!ue;return c.a.createElement("ul",Object(M.a)({className:r()(j,N,Object(g.a)({},"".concat(j,"-disabled"),V)),style:P,unselectable:"unselectable",ref:this.savePaginationNode},rt),je,c.a.createElement("li",{title:H?K.prev_page:null,onClick:this.prev,tabIndex:De?null:0,onKeyPress:this.runIfEnterPrev,className:r()("".concat(j,"-prev"),Object(g.a)({},"".concat(j,"-disabled"),De)),"aria-disabled":De},this.renderPrev(Je)),fe,c.a.createElement("li",{title:H?K.next_page:null,onClick:this.next,tabIndex:Pe?null:0,onKeyPress:this.runIfEnterNext,className:r()("".concat(j,"-next"),Object(g.a)({},"".concat(j,"-disabled"),Pe)),"aria-disabled":Pe},this.renderNext(Ze)),c.a.createElement(m,{disabled:V,locale:K,rootPrefixCls:j,selectComponentClass:Me,selectPrefixCls:Oe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:se,pageSize:Te,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ye}))}}],[{key:"getDerivedStateFromProps",value:function(x,_){var j={};if("current"in x&&(j.current=x.current,x.current!==_.current&&(j.currentInputValue=j.current)),"pageSize"in x&&x.pageSize!==_.pageSize){var N=_.current,P=E(x.pageSize,_,x);N=N>P?P:N,"current"in x||(j.current=N,j.currentInputValue=N),j.pageSize=x.pageSize}return j}}]),w}(c.a.Component);b.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:i.a,style:{},itemRender:l,totalBoundaryShowSizeChanger:50};var h=b},"6RRn":function(I,$,R){"use strict";var M=R("wCXF"),g=R("n6Qo");R.d($,"b",function(){return g.a});var T=R("IBYe"),D=R("6eGT"),v=R("hW8S");R.d($,"a",function(){return v.a}),$.c=M.b},"6eGT":function(I,$,R){"use strict";function M(g){return null}$.a=M},"746U":function(I,$,R){"use strict";R.d($,"d",function(){return g}),R.d($,"j",function(){return T}),R.d($,"i",function(){return D}),R.d($,"h",function(){return v}),R.d($,"e",function(){return f}),R.d($,"k",function(){return S}),R.d($,"l",function(){return y}),R.d($,"a",function(){return c}),R.d($,"f",function(){return r}),R.d($,"g",function(){return s}),R.d($,"m",function(){return d}),R.d($,"c",function(){return m}),R.d($,"b",function(){return i}),R.d($,"n",function(){return t}),R.d($,"o",function(){return a});var M={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function g(l){return Array.isArray?Array.isArray(l):!!(l&&typeof l.length===M.number&&l.constructor===Array)}function T(l){return typeof l===M.string||l instanceof String}function D(l){return typeof l===M.object&&l!==null&&!Array.isArray(l)&&!(l instanceof RegExp)&&!(l instanceof Date)}function v(l){return(typeof l===M.number||l instanceof Number)&&!isNaN(l)}function f(l){return l===!0||l===!1}function S(l){return typeof l===M.undefined}function y(l){return S(l)||l===null}function c(l,E){if(!l)throw new Error(E?"Unexpected type, expected '"+E+"'":"Unexpected type")}var o=Object.prototype.hasOwnProperty;function r(l){if(!D(l))return!1;for(var E in l)if(o.call(l,E))return!1;return!0}function s(l){return typeof l===M.function}function d(l,E){for(var b=Math.min(l.length,E.length),h=0;h<b;h++)u(l[h],E[h])}function u(l,E){if(T(E)){if(typeof l!==E)throw new Error("argument does not match constraint: typeof "+E)}else if(s(E)){try{if(l instanceof E)return}catch(b){}if(!y(l)&&l.constructor===E)return;if(E.length===1&&E.call(void 0,l)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function p(l){for(var E=[],b=Object.getPrototypeOf(l);Object.prototype!==b;)E=E.concat(Object.getOwnPropertyNames(b)),b=Object.getPrototypeOf(b);return E}function m(l){for(var E=[],b=0,h=p(l);b<h.length;b++){var L=h[b];typeof l[L]=="function"&&E.push(L)}return E}function i(l,E){for(var b=function(C){return function(){var x=Array.prototype.slice.call(arguments,0);return E(C,x)}},h={},L=0,O=l;L<O.length;L++){var w=O[L];h[w]=b(w)}return h}function t(l){return l===null?void 0:l}function a(l){return typeof l=="undefined"?null:l}},"7Cbv":function(I,$,R){"use strict";var M=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),g=new Uint8Array(16);function T(){if(!M)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return M(g)}var D=/^(?:[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 v(d){return typeof d=="string"&&D.test(d)}for(var f=v,S=[],y=0;y<256;++y)S.push((y+256).toString(16).substr(1));function c(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=(S[d[u+0]]+S[d[u+1]]+S[d[u+2]]+S[d[u+3]]+"-"+S[d[u+4]]+S[d[u+5]]+"-"+S[d[u+6]]+S[d[u+7]]+"-"+S[d[u+8]]+S[d[u+9]]+"-"+S[d[u+10]]+S[d[u+11]]+S[d[u+12]]+S[d[u+13]]+S[d[u+14]]+S[d[u+15]]).toLowerCase();if(!f(p))throw TypeError("Stringified UUID is invalid");return p}var o=c;function r(d,u,p){d=d||{};var m=d.random||(d.rng||T)();if(m[6]=m[6]&15|64,m[8]=m[8]&63|128,u){p=p||0;for(var i=0;i<16;++i)u[p+i]=m[i];return u}return o(m)}var s=$.a=r},"7ahc":function(I,$,R){"use strict";R.d($,"a",function(){return E});var M=R("k1fw"),g=R("0Owb"),T=R("+L6B"),D=R("2/Rp"),v=R("y8nQ"),f=R("Vl3Y"),S=R("tJVT"),y=R("OaEy"),c=R("2fM7"),o=R("q1tI"),r=R.n(o),s=R("VrN/"),d=R.n(s),u=R("p77/"),p=R.n(u),m=R("c5Ni"),i=R.n(m),t=c.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},l={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"]};$.b=function(b){var h=b.callback,L=b.onCancel,O=Object(o.useState)("python"),w=Object(S.a)(O,2),C=w[0],x=w[1];function _(N){x(l[N][1])}function j(N){h(N)}return r.a.createElement(f.a,Object(g.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:j}),r.a.createElement(f.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},r.a.createElement(c.a,{onChange:_},Object.keys(l).map(function(N){return r.a.createElement(t,{key:N,value:N},l[N][0])}))),r.a.createElement(f.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},r.a.createElement(E,{mode:C})),r.a.createElement("div",{className:"flex-container flex-end"},r.a.createElement(D.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),r.a.createElement(D.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function E(b){var h=b.value,L=b.onChange,O=b.mode,w=b.options,C=w===void 0?{}:w,x=Object(o.useRef)(),_=Object(o.useState)(),j=Object(S.a)(_,2),N=j[0],P=j[1];return Object(o.useEffect)(function(){if(N){function V(z){var B=z.getValue();L&&L(B)}return N.on("change",V),function(){N.off("change",V)}}},[N,L]),Object(o.useEffect)(function(){N&&N.setOption("mode",O)},[N,O]),Object(o.useEffect)(function(){N&&((h!==N.getValue()||h==="")&&setTimeout(function(){N.setValue(h||" ")},300))},[N,h]),Object(o.useEffect)(function(){if(x.current&&!N){var V=d.a.fromTextArea(x.current,Object(M.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));P(V)}},[x.current,N]),r.a.createElement("div",{className:"my-codemirror-container"},r.a.createElement("textarea",{ref:x}))}},"815F":function(I,$,R){"use strict";R.d($,"e",function(){return S}),R.d($,"c",function(){return c}),R.d($,"d",function(){return o}),R.d($,"a",function(){return s}),R.d($,"f",function(){return d}),R.d($,"b",function(){return u});var M=R("KQm4"),g=R("VTBJ"),T=R("Ff2n"),D=R("Zm9Q"),v=R("Kwbf"),f=R("OZM5");function S(p,m){return p!=null?p:m}function y(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=new Map;function i(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(l){var E=l.key,b=l.children;Object(v.a)(E!=null,"Tree node must have a certain key: [".concat(a).concat(E,"]"));var h=String(E);Object(v.a)(!m.has(h)||E===null||E===void 0,"Same 'key' exist in the Tree: ".concat(h)),m.set(h,!0),i(b,"".concat(a).concat(h," > "))})}i(p)}function c(p){function m(i){var t=Object(D.a)(i);return t.map(function(a){if(!Object(f.i)(a))return Object(v.a)(!a,"Tree/TreeNode can only accept TreeNode as children."),null;var l=a.key,E=a.props,b=E.children,h=Object(T.a)(E,["children"]),L=Object(g.a)({key:l},h),O=m(b);return O.length&&(L.children=O),L}).filter(function(a){return a})}return m(p)}function o(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(m===!0?[]:m),t=[];function a(l){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return l.map(function(b,h){var L=Object(f.h)(E?E.pos:"0",h),O=S(b.key,L),w=Object(g.a)(Object(g.a)({},b),{},{parent:E,pos:L,children:null,data:b,isStart:[].concat(Object(M.a)(E?E.isStart:[]),[h===0]),isEnd:[].concat(Object(M.a)(E?E.isEnd:[]),[h===l.length-1])});return t.push(w),m===!0||i.has(O)?w.children=a(b.children||[],w):w.children=[],w})}return a(p),t}function r(p,m,i){var t;i?typeof i=="string"?t=function(E){return E[i]}:typeof i=="function"&&(t=function(E){return i(E)}):t=function(E,b){return S(E.key,b)};function a(l,E,b){var h=l?l.children:p,L=l?Object(f.h)(b.pos,E):"0";if(l){var O=t(l,L),w={node:l,index:E,pos:L,key:O,parentPos:b.node?b.pos:null,level:b.level+1};m(w)}h&&h.forEach(function(C,x){a(C,x,{node:l,pos:L,level:b?b.level+1:-1})})}a(null)}function s(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=m.initWrapper,t=m.processEntity,a=m.onProcessFinished,l=arguments.length>2?arguments[2]:void 0,E={},b={},h={posEntities:E,keyEntities:b};return i&&(h=i(h)||h),r(p,function(L){var O=L.node,w=L.index,C=L.pos,x=L.key,_=L.parentPos,j=L.level,N={node:O,index:w,key:x,pos:C,level:j},P=S(x,C);E[C]=N,b[P]=N,N.parent=E[_],N.parent&&(N.parent.children=N.parent.children||[],N.parent.children.push(N)),t&&t(N,h)},l),a&&a(h),h}function d(p,m){var i=m.expandedKeys,t=m.selectedKeys,a=m.loadedKeys,l=m.loadingKeys,E=m.checkedKeys,b=m.halfCheckedKeys,h=m.dragOverNodeKey,L=m.dropPosition,O=m.keyEntities,w=O[p],C={eventKey:p,expanded:i.indexOf(p)!==-1,selected:t.indexOf(p)!==-1,loaded:a.indexOf(p)!==-1,loading:l.indexOf(p)!==-1,checked:E.indexOf(p)!==-1,halfChecked:b.indexOf(p)!==-1,pos:String(w?w.pos:""),dragOver:h===p&&L===0,dragOverGapTop:h===p&&L===-1,dragOverGapBottom:h===p&&L===1};return C}function u(p){var m=p.data,i=p.expanded,t=p.selected,a=p.checked,l=p.loaded,E=p.loading,b=p.halfChecked,h=p.dragOver,L=p.dragOverGapTop,O=p.dragOverGapBottom,w=p.pos,C=p.active,x=Object(g.a)(Object(g.a)({},m),{},{expanded:i,selected:t,checked:a,loaded:l,loading:E,halfChecked:b,dragOver:h,dragOverGapTop:L,dragOverGapBottom:O,pos:w,active:C});return"props"in x||Object.defineProperty(x,"props",{get:function(){return Object(v.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),p}}),x}},"8EBN":function(I,$,R){(function(M){M(R("VrN/"))})(function(M){"use strict";M.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 g=0;g<M.modeInfo.length;g++){var T=M.modeInfo[g];T.mimes&&(T.mime=T.mimes[0])}M.findModeByMIME=function(D){D=D.toLowerCase();for(var v=0;v<M.modeInfo.length;v++){var f=M.modeInfo[v];if(f.mime==D)return f;if(f.mimes){for(var S=0;S<f.mimes.length;S++)if(f.mimes[S]==D)return f}}if(/\+xml$/.test(D))return M.findModeByMIME("application/xml");if(/\+json$/.test(D))return M.findModeByMIME("application/json")},M.findModeByExtension=function(D){D=D.toLowerCase();for(var v=0;v<M.modeInfo.length;v++){var f=M.modeInfo[v];if(f.ext){for(var S=0;S<f.ext.length;S++)if(f.ext[S]==D)return f}}},M.findModeByFileName=function(D){for(var v=0;v<M.modeInfo.length;v++){var f=M.modeInfo[v];if(f.file&&f.file.test(D))return f}var S=D.lastIndexOf("."),y=S>-1&&D.substring(S+1,D.length);if(y)return M.findModeByExtension(y)},M.findModeByName=function(D){D=D.toLowerCase();for(var v=0;v<M.modeInfo.length;v++){var f=M.modeInfo[v];if(f.name.toLowerCase()==D)return f;if(f.alias){for(var S=0;S<f.alias.length;S++)if(f.alias[S].toLowerCase()==D)return f}}}})},"8HAY":function(I,$,R){"use strict";R.d($,"a",function(){return f}),R.d($,"b",function(){return S});var M=R("pmY6"),g=R("MI8n"),T=function(){var y=function(c,o){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var d in s)s.hasOwnProperty(d)&&(r[d]=s[d])},y(c,o)};return function(c,o){y(c,o);function r(){this.constructor=c}c.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}}(),D=function(y,c,o,r){function s(d){return d instanceof o?d:new o(function(u){u(d)})}return new(o||(o=Promise))(function(d,u){function p(t){try{i(r.next(t))}catch(a){u(a)}}function m(t){try{i(r.throw(t))}catch(a){u(a)}}function i(t){t.done?d(t.value):s(t.value).then(p,m)}i((r=r.apply(y,c||[])).next())})},v=function(y,c){var o={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,s,d,u;return u={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function p(i){return function(t){return m([i,t])}}function m(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,s&&(d=i[0]&2?s.return:i[0]?s.throw||((d=s.return)&&d.call(s),0):s.next)&&!(d=d.call(s,i[1])).done)return d;(s=0,d)&&(i=[i[0]&2,d.value]);switch(i[0]){case 0:case 1:d=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,s=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(d=o.trys,d=d.length>0&&d[d.length-1])&&(i[0]===6||i[0]===2)){o=0;continue}if(i[0]===3&&(!d||i[1]>d[0]&&i[1]<d[3])){o.label=i[1];break}if(i[0]===6&&o.label<d[1]){o.label=d[1],d=i;break}if(d&&o.label<d[2]){o.label=d[2],o.ops.push(i);break}d[2]&&o.ops.pop(),o.trys.pop();continue}i=c.call(y,o)}catch(t){i=[6,t],s=0}finally{r=d=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},f=function(y){T(c,y);function c(o,r,s,d,u){r===void 0&&(r=""),s===void 0&&(s=""),d===void 0&&(d=!0);var p=y.call(this)||this;return p._onDidChange=p._register(new g.a),p.onDidChange=p._onDidChange.event,p._enabled=!0,p._checked=!1,p._id=o,p._label=r,p._cssClass=s,p._enabled=d,p._actionCallback=u,p}return Object.defineProperty(c.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"label",{get:function(){return this._label},set:function(o){this._setLabel(o)},enumerable:!0,configurable:!0}),c.prototype._setLabel=function(o){this._label!==o&&(this._label=o,this._onDidChange.fire({label:o}))},Object.defineProperty(c.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(o){this._setTooltip(o)},enumerable:!0,configurable:!0}),c.prototype._setTooltip=function(o){this._tooltip!==o&&(this._tooltip=o,this._onDidChange.fire({tooltip:o}))},Object.defineProperty(c.prototype,"class",{get:function(){return this._cssClass},set:function(o){this._setClass(o)},enumerable:!0,configurable:!0}),c.prototype._setClass=function(o){this._cssClass!==o&&(this._cssClass=o,this._onDidChange.fire({class:o}))},Object.defineProperty(c.prototype,"enabled",{get:function(){return this._enabled},set:function(o){this._setEnabled(o)},enumerable:!0,configurable:!0}),c.prototype._setEnabled=function(o){this._enabled!==o&&(this._enabled=o,this._onDidChange.fire({enabled:o}))},Object.defineProperty(c.prototype,"checked",{get:function(){return this._checked},set:function(o){this._setChecked(o)},enumerable:!0,configurable:!0}),c.prototype._setChecked=function(o){this._checked!==o&&(this._checked=o,this._onDidChange.fire({checked:o}))},c.prototype.run=function(o,r){return this._actionCallback?this._actionCallback(o):Promise.resolve(!0)},c}(M.a),S=function(y){T(c,y);function c(){var o=y!==null&&y.apply(this,arguments)||this;return o._onDidBeforeRun=o._register(new g.a),o.onDidBeforeRun=o._onDidBeforeRun.event,o._onDidRun=o._register(new g.a),o.onDidRun=o._onDidRun.event,o}return c.prototype.run=function(o,r){return D(this,void 0,void 0,function(){var s,d;return v(this,function(u){switch(u.label){case 0:if(!o.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:o}),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.runAction(o,r)];case 2:return s=u.sent(),this._onDidRun.fire({action:o,result:s}),[3,4];case 3:return d=u.sent(),this._onDidRun.fire({action:o,error:d}),[3,4];case 4:return[2]}})})},c.prototype.runAction=function(o,r){var s=r?o.run(r):o.run();return Promise.resolve(s)},c}(M.a)},"8hTe":function(I,$,R){I.exports={button:"button___1wy9m"}},"9Bee":function(I,$,R){"use strict";var M=R("DYRE"),g=R("zeV3"),T=R("+L6B"),D=R("2/Rp"),v=R("k1fw"),f=R("9og8"),S=R("tJVT"),y=R("WmNS"),c=R.n(y),o=R("q1tI"),r=R.n(o),s=R("vg9a"),d=R("DlQD"),u=R.n(d),p=R("rUJ1");function m(ae,G){var Y=ae.match(/^(\s+)(?:```)/);if(Y===null)return G;var ie=Y[1];return G.split(`
|
|
|
`).map(function(de){var oe=de.match(/^\s+/);if(oe===null)return de;var ze=Object(S.a)(oe,1),ft=ze[0];return ft.length>=ie.length?de.slice(ie.length):de}).join(`
|
|
|
`)}var i=[],t=["<ul>"],a=new u.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function E(){i.length=0,t=["<ul>"]}var b={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function h(ae,G,Y,ie){if(G>=ae.length||ae[G].level<=Y)return G;var de=ae[G];ie.push("<li><a href='#"+de.anchor+"'>"+de.text+"</a>"),G++;var oe=[];return G=h(ae,G,de.level,oe),oe.length>0&&(ie.push("<ul>"),oe.forEach(function(ze){ie.push(ze)}),ie.push("</ul>")),ie.push("</li>"),G=h(ae,G,Y,ie),G}function L(){return h(i,0,0,t),t.push("</ul>"),t.join("")}var O={heading:function(G){var Y=l.exec(G);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},fences:function(G){var Y=this.rules.block.fences.exec(G);if(Y){var ie=Y[0],de=m(ie,Y[3]||""),oe=Y[2]?Y[2].trim():Y[2];if(["latex","katex","math"].indexOf(oe)>=0){var ze=x(),ft=de;de=ze,_[ze]={type:"block",expression:ft}}return{type:"code",raw:ie,lang:oe,text:de}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,x=function(){return"__special_katext_id_".concat(C++,"__")},_={};function j(){return _}function N(){C=0,_={}}function P(ae){return ae=ae.replace(w,function(G,Y){var ie=x();return _[ie]={type:"inline",expression:Y},ie}),ae}var V=a.listitem;a.listitem=function(ae){return V(P(ae))};var z=a.paragraph;a.paragraph=function(ae){return z(P(ae))};var B=a.tablecell;a.tablecell=function(ae,G){return B(P(ae),G)},a.code=function(ae,G,Y){var ie=(G||"").match(/\S*/)[0];return ie?["latex","katex","math"].indexOf(ie)>=0?"<p class='editormd-tex'>".concat(ae,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(G,'">').concat(Y?ae:Object(p.escape)(ae,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(Y?ae:Object(p.escape)(ae,!0))+"</code></pre>"},a.heading=function(ae,G,Y){var ie=this.options.headerPrefix+Y.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:ie,level:G,text:ae}),"<h"+G+' id="'+ie+'">'+ae+"</h"+G+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:O,renderer:a});var K=u.a,U=R("SJMd"),W=R("ulZh"),H=R.n(W),q=R("m3rI"),ne=R("Oy/b"),te=R("p5ED"),_e=R("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(ae,G){return(Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,ie){Y.__proto__=ie}||function(Y,ie){for(var de in ie)Object.prototype.hasOwnProperty.call(ie,de)&&(Y[de]=ie[de])})(ae,G)};function me(ae,G){function Y(){this.constructor=ae}Ce(ae,G),ae.prototype=G===null?Object.create(G):(Y.prototype=G.prototype,new Y)}function Me(ae,G,Y,ie){return new(Y||(Y=Promise))(function(de,oe){function ze(Ft){try{St(ie.next(Ft))}catch(mt){oe(mt)}}function ft(Ft){try{St(ie.throw(Ft))}catch(mt){oe(mt)}}function St(Ft){var mt;Ft.done?de(Ft.value):(mt=Ft.value,mt instanceof Y?mt:new Y(function(Gt){Gt(mt)})).then(ze,ft)}St((ie=ie.apply(ae,G||[])).next())})}function Oe(ae,G){var Y,ie,de,oe,ze={label:0,sent:function(){if(1&de[0])throw de[1];return de[1]},trys:[],ops:[]};return oe={next:ft(0),throw:ft(1),return:ft(2)},typeof Symbol=="function"&&(oe[Symbol.iterator]=function(){return this}),oe;function ft(St){return function(Ft){return function(mt){if(Y)throw new TypeError("Generator is already executing.");for(;ze;)try{if(Y=1,ie&&(de=2&mt[0]?ie.return:mt[0]?ie.throw||((de=ie.return)&&de.call(ie),0):ie.next)&&!(de=de.call(ie,mt[1])).done)return de;switch(ie=0,de&&(mt=[2&mt[0],de.value]),mt[0]){case 0:case 1:de=mt;break;case 4:return ze.label++,{value:mt[1],done:!1};case 5:ze.label++,ie=mt[1],mt=[0];continue;case 7:mt=ze.ops.pop(),ze.trys.pop();continue;default:if(!(de=ze.trys,(de=de.length>0&&de[de.length-1])||mt[0]!==6&&mt[0]!==2)){ze=0;continue}if(mt[0]===3&&(!de||mt[1]>de[0]&&mt[1]<de[3])){ze.label=mt[1];break}if(mt[0]===6&&ze.label<de[1]){ze.label=de[1],de=mt;break}if(de&&ze.label<de[2]){ze.label=de[2],ze.ops.push(mt);break}de[2]&&ze.ops.pop(),ze.trys.pop();continue}mt=G.call(ae,ze)}catch(Gt){mt=[6,Gt],ie=0}finally{Y=de=0}if(5&mt[0])throw mt[1];return{value:mt[0]?mt[1]:void 0,done:!0}}([St,Ft])}}}function he(){for(var ae=0,G=0,Y=arguments.length;G<Y;G++)ae+=arguments[G].length;var ie=Array(ae),de=0;for(G=0;G<Y;G++)for(var oe=arguments[G],ze=0,ft=oe.length;ze<ft;ze++,de++)ie[de]=oe[ze];return ie}var ce=function(){function ae(){}return ae.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ae.setAttributes=function(G,Y){for(var ie=0,de=Y;ie<de.length;ie++){var oe=de[ie],ze=oe[0],ft=oe[1];G.setAttribute(ze,ft)}},ae.createRect=function(G,Y,ie){var de=document.createElementNS("http://www.w3.org/2000/svg","rect");return de.setAttribute("width",G.toString()),de.setAttribute("height",Y.toString()),ie&&ae.setAttributes(de,ie),de},ae.createLine=function(G,Y,ie,de,oe){var ze=document.createElementNS("http://www.w3.org/2000/svg","line");return ze.setAttribute("x1",G.toString()),ze.setAttribute("y1",Y.toString()),ze.setAttribute("x2",ie.toString()),ze.setAttribute("y2",de.toString()),oe&&ae.setAttributes(ze,oe),ze},ae.createPolygon=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ie.setAttribute("points",G),Y&&ae.setAttributes(ie,Y),ie},ae.createCircle=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","circle");return ie.setAttribute("cx",(G/2).toString()),ie.setAttribute("cy",(G/2).toString()),ie.setAttribute("r",G.toString()),Y&&ae.setAttributes(ie,Y),ie},ae.createEllipse=function(G,Y,ie){var de=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return de.setAttribute("cx",(G/2).toString()),de.setAttribute("cy",(Y/2).toString()),de.setAttribute("rx",(G/2).toString()),de.setAttribute("ry",(Y/2).toString()),ie&&ae.setAttributes(de,ie),de},ae.createGroup=function(G){var Y=document.createElementNS("http://www.w3.org/2000/svg","g");return G&&ae.setAttributes(Y,G),Y},ae.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ae.createMarker=function(G,Y,ie,de,oe,ze,ft){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return ae.setAttributes(St,[["id",G],["orient",Y],["markerWidth",ie.toString()],["markerHeight",de.toString()],["refX",oe.toString()],["refY",ze.toString()]]),St.appendChild(ft),St},ae.createText=function(G){var Y=document.createElementNS("http://www.w3.org/2000/svg","text");return Y.setAttribute("x","0"),Y.setAttribute("y","0"),G&&ae.setAttributes(Y,G),Y},ae.createTSpan=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ie.textContent=G,Y&&ae.setAttributes(ie,Y),ie},ae.createImage=function(G){var Y=document.createElementNS("http://www.w3.org/2000/svg","image");return G&&ae.setAttributes(Y,G),Y},ae.createPoint=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ie.x=G,ie.y=Y,ie},ae.createPath=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","path");return ie.setAttribute("d",G),Y&&ae.setAttributes(ie,Y),ie},ae}(),se=function(){function ae(){}return ae.addKey=function(G){ae.key=G},Object.defineProperty(ae,"isLicensed",{get:function(){return!!ae.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ae.key)},enumerable:!1,configurable:!0}),ae}(),Te=function(){function ae(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ae.prototype.rasterize=function(G,Y,ie){var de=this;return new Promise(function(oe){var ze=ie!==void 0?ie:document.createElement("canvas");G===null&&(de.markersOnly=!0,de.naturalSize=!1);var ft=document.createElementNS("http://www.w3.org/2000/svg","svg");ft.setAttribute("xmlns","http://www.w3.org/2000/svg"),ft.setAttribute("width",Y.width.baseVal.valueAsString),ft.setAttribute("height",Y.height.baseVal.valueAsString),ft.setAttribute("viewBox","0 0 "+Y.viewBox.baseVal.width.toString()+" "+Y.viewBox.baseVal.height.toString()),ft.innerHTML=Y.innerHTML,de.naturalSize===!0?(ft.width.baseVal.value=G.naturalWidth,ft.height.baseVal.value=G.naturalHeight):de.width!==void 0&&de.height!==void 0&&(ft.width.baseVal.value=de.width,ft.height.baseVal.value=de.height),ze.width=ft.width.baseVal.value,ze.height=ft.height.baseVal.value;var St=ft.outerHTML,Ft=ze.getContext("2d");de.markersOnly!==!0&&Ft.drawImage(G,0,0,ze.width,ze.height);var mt=window.URL,Gt=new Image(ze.width,ze.height);Gt.setAttribute("crossOrigin","anonymous");var Vt=new Blob([St],{type:"image/svg+xml"}),Hr=mt.createObjectURL(Vt);Gt.onload=function(){Ft.drawImage(Gt,0,0),mt.revokeObjectURL(Hr);var cn=ze.toDataURL(de.imageType,de.imageQuality);oe(cn)},Gt.src=Hr})},ae}(),re=function(){},ue=function(){function ae(G){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+G+"_"}return Object.defineProperty(ae.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ae.prototype.addClass=function(G){return this.styleSheet===void 0&&this.addStyleSheet(),G.name=""+this.classNamePrefix+G.localName,this.classes.push(G),this.styleSheet.sheet.insertRule("."+G.name+" {"+G.style+"}",this.styleSheet.sheet.cssRules.length),G},ae.prototype.addRule=function(G){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(G),this.styleSheet.sheet.insertRule(G.selector+" {"+G.style+"}",this.styleSheet.sheet.cssRules.length)},ae.prototype.addStyleSheet=function(){var G;this.styleSheet=document.createElement("style"),((G=this.styleSheetRoot)!==null&&G!==void 0?G:document.head).appendChild(this.styleSheet),this.addRule(new fe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new fe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new fe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new ee("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new ee("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ae.prototype.removeStyleSheet=function(){var G;this.styleSheet&&(((G=this.styleSheetRoot)!==null&&G!==void 0?G:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ae}(),fe=function(ae,G){this.selector=ae,this.style=G},ee=function(ae,G){this.localName=ae,this.style=G},Q=function(){function ae(G,Y,ie,de,oe){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=G,this.displayMode=Y,this.markerItems=ie,this.uiStyleSettings=de,this.styles=oe,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ae.prototype.show=function(G){var Y=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=G,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ie=document.createElement("div");ie.className=this.toolbarBlockStyleClass.name,ie.style.whiteSpace="nowrap",this.uiContainer.appendChild(ie),this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(oe){var ze=document.createElement("div");ze.className=""+Y.toolbarButtonStyleClass.name,ze.setAttribute("data-type-name",oe.typeName),ze.innerHTML=oe.icon,ze.addEventListener("click",function(){Y.markerToolbarButtonClicked(ze,oe)}),Y.buttons.push(ze),Y.markerButtons.push(ze)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var de=document.createElement("div");de.className=this.toolbarBlockStyleClass.name,de.style.whiteSpace="nowrap",de.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(de),this.addActionButton(de,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(de,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ae.prototype.addButtonClickListener=function(G){this.buttonClickListeners.push(G)},ae.prototype.removeButtonClickListener=function(G){this.buttonClickListeners.indexOf(G)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(G),1)},ae.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ae.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var G=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Y=0;Y<this.markerButtons.length;Y++)Y<G||Y===G&&this.markerButtons.length-1===G?this.markerButtonBlock.appendChild(this.markerButtons[Y]):(Y===G&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Y]))}},ae.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},ae.prototype.resetButtonStyles=function(){var G=this;this.buttons.forEach(function(Y){Y.className=Y.className.replace(G.uiStyleSettings.toolbarButtonStyleColorsClassName?G.uiStyleSettings.toolbarButtonStyleColorsClassName:G.toolbarButtonStyleColorsClass.name,"").trim(),Y.className=Y.className.replace(G.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?G.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:G.toolbarActiveButtonStyleColorsClass.name,"").trim(),Y.className+=" "+(G.uiStyleSettings.toolbarButtonStyleColorsClassName?G.uiStyleSettings.toolbarButtonStyleColorsClassName:G.toolbarButtonStyleColorsClass.name)})},ae.prototype.addActionButton=function(G,Y,ie){var de=this,oe=document.createElement("div");switch(oe.className=""+this.toolbarButtonStyleClass.name,oe.innerHTML=Y,oe.setAttribute("data-action",ie),oe.addEventListener("click",function(){de.actionToolbarButtonClicked(oe,ie)}),ie){case"select":oe.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":oe.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":oe.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":oe.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":oe.style.fill=this.uiStyleSettings.closeButtonColor}G.appendChild(oe),this.buttons.push(oe)},ae.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ee("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ee("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ee("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ee("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new ee("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var G=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ee("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*G)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*G)+`px;
|
|
|
padding: `+G+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ee("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ee("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new fe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new fe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},ae.prototype.markerToolbarButtonClicked=function(G,Y){this.setActiveButton(G),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ie){return ie("marker",Y)}),this.markerButtonOverflowBlock.style.display="none"},ae.prototype.actionToolbarButtonClicked=function(G,Y){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ie){return ie("action",Y)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ae.prototype.setActiveButton=function(G){this.resetButtonStyles(),G.className=G.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),G.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ae.prototype.setActiveMarkerButton=function(G){var Y=this.markerButtons.find(function(ie){return ie.getAttribute("data-type-name")===G});Y&&this.setActiveButton(Y)},ae.prototype.setCurrentMarker=function(G){var Y=this;this.currentMarker=G,this.buttons.filter(function(ie){return/delete|notes/.test(ie.getAttribute("data-action"))}).forEach(function(ie){Y.currentMarker===void 0?(ie.style.fillOpacity="0.4",ie.style.pointerEvents="none"):(ie.style.fillOpacity="1",ie.style.pointerEvents="all")})},ae}(),X=function(){function ae(G,Y,ie,de){this.panels=[],this.panelButtons=[],this.markerjsContainer=G,this.displayMode=Y,this.uiStyleSettings=ie,this.styles=de,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ae.prototype.addStyles=function(){var G;this.toolboxStyleClass=this.styles.addClass(new ee("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 ee("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var Y=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ee("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ee("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ee("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 ee("toolbox-panel-row_colors",`
|
|
|
background-color: `+((G=this.uiStyleSettings.toolboxBackgroundColor)!==null&&G!==void 0?G:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ee("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 ee("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ee("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new fe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new fe("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},ae.prototype.show=function(G){var Y;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=G,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ae.prototype.setPanelButtons=function(G){var Y,ie,de=this;this.panels=G,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+" "+((ie=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ie!==void 0?ie:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(oe){var ze;oe.uiStyleSettings=de.uiStyleSettings;var ft=document.createElement("div");ft.className=de.toolboxButtonStyleClass.name+" "+((ze=de.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ze!==void 0?ze:de.toolboxButtonStyleColorsClass.name),ft.innerHTML=oe.icon,ft.title=oe.title,ft.addEventListener("click",function(){de.panelButtonClick(oe)}),de.panelButtons.push(ft),de.buttonRow.appendChild(ft)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ae.prototype.panelButtonClick=function(G){var Y=this,ie=-1;if(G!==this.activePanel){ie=this.panels.indexOf(G),this.panelRow.innerHTML="";var de=G.getUi();de.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(de),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=G}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(oe,ze){var ft,St;oe.className=Y.toolboxButtonStyleClass.name+" "+(ze===ie?""+((ft=Y.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ft!==void 0?ft:Y.toolboxActiveButtonStyleColorsClass.name):""+((St=Y.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&St!==void 0?St:Y.toolboxButtonStyleColorsClass.name))})},ae}(),Z=function(ae,G){this.title=ae,this.icon=G},ve=function(ae){function G(Y,ie,de,oe){var ze=ae.call(this,Y,oe||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ze.colors=[],ze.addTransparent=!1,ze.colorBoxes=[],ze.colors=ie,ze.currentColor=de,ze.setCurrentColor=ze.setCurrentColor.bind(ze),ze.getColorBox=ze.getColorBox.bind(ze),ze}return me(G,ae),G.prototype.getUi=function(){var Y=this,ie=document.createElement("div");return ie.style.overflow="hidden",ie.style.whiteSpace="nowrap",this.colors.forEach(function(de){var oe=Y.getColorBox(de);ie.appendChild(oe),Y.colorBoxes.push(oe)}),ie},G.prototype.getColorBox=function(Y){var ie=this,de=this.uiStyleSettings.toolbarHeight/4,oe=this.uiStyleSettings.toolbarHeight-de,ze=document.createElement("div");ze.style.display="inline-block",ze.style.boxSizing="content-box",ze.style.width=oe-2+"px",ze.style.height=oe-2+"px",ze.style.padding="1px",ze.style.marginRight="2px",ze.style.marginBottom="2px",ze.style.borderWidth="2px",ze.style.borderStyle="solid",ze.style.borderRadius=(oe+2)/2+"px",ze.style.borderColor=Y===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ze.addEventListener("click",function(){ie.setCurrentColor(Y,ze)});var ft=document.createElement("div");return ft.style.display="inline-block",ft.style.width=oe-2+"px",ft.style.height=oe-2+"px",ft.style.backgroundColor=Y,ft.style.borderRadius=oe/2+"px",Y==="transparent"&&(ft.style.fill=this.uiStyleSettings.toolboxAccentColor,ft.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),ze.appendChild(ft),ze},G.prototype.setCurrentColor=function(Y,ie){var de=this;this.currentColor=Y,this.colorBoxes.forEach(function(oe){oe.style.borderColor=oe===ie?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Y)},G}(Z),ye=function(){function ae(G,Y,ie){this._state="new",this._isSelected=!1,this._container=G,this._overlayContainer=Y,this.globalSettings=ie,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ae.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ae.prototype.ownsTarget=function(G){return!1},Object.defineProperty(ae.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ae.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ae.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ae.prototype.pointerDown=function(G,Y){},ae.prototype.dblClick=function(G,Y){},ae.prototype.manipulate=function(G){},ae.prototype.pointerUp=function(G){this.stateChanged()},ae.prototype.dispose=function(){},ae.prototype.addMarkerVisualToContainer=function(G){this.container.childNodes.length>0?this.container.insertBefore(G,this.container.childNodes[0]):this.container.appendChild(G)},ae.prototype.getState=function(){return{typeName:ae.typeName,state:this.state,notes:this.notes}},ae.prototype.restoreState=function(G){this._state=G.state,this.notes=G.notes},ae.prototype.scale=function(G,Y){},ae.prototype.colorChanged=function(G){this.onColorChanged&&this.onColorChanged(G),this.stateChanged()},ae.prototype.fillColorChanged=function(G){this.onFillColorChanged&&this.onFillColorChanged(G),this.stateChanged()},ae.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var G=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),G.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(G)&&this.onStateChanged(this)}},ae.typeName="MarkerBase",ae}(),Re=function(){function ae(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ae.prototype.findGripByVisual=function(G){return this.topLeft.ownsTarget(G)?this.topLeft:this.topCenter.ownsTarget(G)?this.topCenter:this.topRight.ownsTarget(G)?this.topRight:this.centerLeft.ownsTarget(G)?this.centerLeft:this.centerRight.ownsTarget(G)?this.centerRight:this.bottomLeft.ownsTarget(G)?this.bottomLeft:this.bottomCenter.ownsTarget(G)?this.bottomCenter:this.bottomRight.ownsTarget(G)?this.bottomRight:void 0},ae}(),Je=function(){function ae(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ae.prototype.ownsTarget=function(G){return G===this.visual||G===this.visual.childNodes[0]||G===this.visual.childNodes[1]},ae}(),Ze=function(){function ae(){}return ae.toITransformMatrix=function(G){return{a:G.a,b:G.b,c:G.c,d:G.d,e:G.e,f:G.f}},ae.toSVGMatrix=function(G,Y){return G.a=Y.a,G.b=Y.b,G.c=Y.c,G.d=Y.d,G.e=Y.e,G.f=Y.f,G},ae}(),rt=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.left=0,oe.top=0,oe.width=0,oe.height=0,oe.defaultSize={x:50,y:20},oe.offsetX=0,oe.offsetY=0,oe.rotationAngle=0,oe.CB_DISTANCE=10,oe._suppressMarkerCreateEvent=!1,oe.container.transform.baseVal.appendItem(ce.createTransform()),oe.setupControlBox(),oe}return me(G,ae),Object.defineProperty(G.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"visual",{get:function(){return this._visual},set:function(Y){this._visual=Y;var ie=ce.createTransform();this._visual.transform.baseVal.appendItem(ie)},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(Y){return!!ae.prototype.ownsTarget.call(this,Y)||!!(this.controlGrips.findGripByVisual(Y)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Y))},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),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 de=this.unrotatePoint(Y);if(this.manipulationStartX=de.x,this.manipulationStartY=de.y,this.offsetX=de.x-this.left,this.offsetY=de.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ie),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ie)){this.activeGrip=this.rotatorGrip;var oe=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=oe.x-this.width/2,this.top=oe.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ze=this.container.transform.baseVal.getItem(0);ze.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ze,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},G.prototype.pointerUp=function(Y){var ie=this.state;ae.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",ie==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},G.prototype.moveVisual=function(Y){this.visual.style.transform="translate("+Y.x+"px, "+Y.y+"px)"},G.prototype.manipulate=function(Y){var ie=this.unrotatePoint(Y);this.state==="creating"?this.resize(Y):this.state==="move"?(this.left=this.manipulationStartLeft+(ie.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ie.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ie):this.state==="rotate"&&this.rotate(Y)},G.prototype.resize=function(Y){var ie=this.manipulationStartLeft,de=this.manipulationStartWidth,oe=this.manipulationStartTop,ze=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ie=this.manipulationStartLeft+Y.x-this.manipulationStartX,de=this.manipulationStartWidth+this.manipulationStartLeft-ie;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:de=this.manipulationStartWidth+Y.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:oe=this.manipulationStartTop+Y.y-this.manipulationStartY,ze=this.manipulationStartHeight+this.manipulationStartTop-oe;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ze=this.manipulationStartHeight+Y.y-this.manipulationStartY}de>=0?(this.left=ie,this.width=de):(this.left=ie+de,this.width=-de),ze>=0?(this.top=oe,this.height=ze):(this.top=oe+ze,this.height=-ze),this.setSize()},G.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},G.prototype.rotate=function(Y){if(Math.abs(Y.x-this.centerX)>.1){var ie=Math.sign(Y.x-this.centerX);this.rotationAngle=180*Math.atan((Y.y-this.centerY)/(Y.x-this.centerX))/Math.PI+90*ie,this.applyRotation()}},G.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)},G.prototype.rotatePoint=function(Y){if(this.rotationAngle===0)return Y;var ie=this.container.getCTM(),de=ce.createPoint(Y.x,Y.y);return{x:(de=de.matrixTransform(ie)).x,y:de.y}},G.prototype.unrotatePoint=function(Y){if(this.rotationAngle===0)return Y;var ie=this.container.getCTM();ie=ie.inverse();var de=ce.createPoint(Y.x,Y.y);return{x:(de=de.matrixTransform(ie)).x,y:de.y}},G.prototype.select=function(){ae.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},G.prototype.deselect=function(){ae.prototype.deselect.call(this),this.controlBox.style.display="none"},G.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var Y=ce.createTransform();Y.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Y),this.container.appendChild(this.controlBox),this.controlRect=ce.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ce.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Re,this.addControlGrips(),this.controlBox.style.display="none"},G.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()},G.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()},G.prototype.createGrip=function(){var Y=new Je;return Y.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(Y.visual),Y},G.prototype.positionGrips=function(){var Y=this.controlGrips.topLeft.GRIP_SIZE,ie=-Y/2,de=ie,oe=(this.width+this.CB_DISTANCE)/2-Y/2,ze=(this.height+this.CB_DISTANCE)/2-Y/2,ft=this.height+this.CB_DISTANCE-Y/2,St=this.width+this.CB_DISTANCE-Y/2;this.positionGrip(this.controlGrips.topLeft.visual,ie,de),this.positionGrip(this.controlGrips.topCenter.visual,oe,de),this.positionGrip(this.controlGrips.topRight.visual,St,de),this.positionGrip(this.controlGrips.centerLeft.visual,ie,ze),this.positionGrip(this.controlGrips.centerRight.visual,St,ze),this.positionGrip(this.controlGrips.bottomLeft.visual,ie,ft),this.positionGrip(this.controlGrips.bottomCenter.visual,oe,ft),this.positionGrip(this.controlGrips.bottomRight.visual,St,ft),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,oe,de-3*this.CB_DISTANCE)},G.prototype.positionGrip=function(Y,ie,de){var oe=Y.transform.baseVal.getItem(0);oe.setTranslate(ie,de),Y.transform.baseVal.replaceItem(oe,0)},G.prototype.hideControlBox=function(){this.controlBox.style.display="none"},G.prototype.showControlBox=function(){this.controlBox.style.display=""},G.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ze.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ze.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ae.prototype.getState.call(this))},G.prototype.restoreState=function(Y){ae.prototype.restoreState.call(this,Y);var ie=Y;this.left=ie.left,this.top=ie.top,this.width=ie.width,this.height=ie.height,this.rotationAngle=ie.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ie.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ie.containerTransformMatrix))},G.prototype.scale=function(Y,ie){ae.prototype.scale.call(this,Y,ie);var de=this.rotatePoint({x:this.left,y:this.top}),oe=this.unrotatePoint({x:de.x*Y,y:de.y*ie});this.left=oe.x,this.top=oe.y,this.width=this.width*Y,this.height=this.height*ie,this.adjustControlBox()},G}(ye),tt=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.fillColor="transparent",oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.opacity=1,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setFillColor=oe.setFillColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.createVisual=oe.createVisual.bind(oe),oe}return me(G,ae),G.prototype.ownsTarget=function(Y){return!(!ae.prototype.ownsTarget.call(this,Y)&&Y!==this.visual)},G.prototype.createVisual=function(){this.visual=ce.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),this.state==="new"&&(this.createVisual(),this.moveVisual(Y),this._state="creating")},G.prototype.manipulate=function(Y){ae.prototype.manipulate.call(this,Y)},G.prototype.resize=function(Y){ae.prototype.resize.call(this,Y),this.setSize()},G.prototype.setSize=function(){ae.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},G.prototype.pointerUp=function(Y){ae.prototype.pointerUp.call(this,Y),this.setSize()},G.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Y),this.stateChanged()},G.prototype.setFillColor=function(Y){this.fillColor=Y,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},G.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},G.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},G.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ae.prototype.getState.call(this))},G.prototype.restoreState=function(Y){var ie=Y;this.fillColor=ie.fillColor,this.strokeColor=ie.strokeColor,this.strokeWidth=ie.strokeWidth,this.strokeDasharray=ie.strokeDasharray,this.opacity=ie.opacity,this.createVisual(),ae.prototype.restoreState.call(this,Y),this.setSize()},G.prototype.scale=function(Y,ie){ae.prototype.scale.call(this,Y,ie),this.setSize()},G.title="Rectangle marker",G}(rt),st=function(ae){function G(Y,ie,de,oe){var ze=ae.call(this,Y,oe||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ze.widths=[],ze.widthBoxes=[],ze.widths=ie,ze.currentWidth=de,ze.setCurrentWidth=ze.setCurrentWidth.bind(ze),ze}return me(G,ae),G.prototype.getUi=function(){var Y=this,ie=document.createElement("div");return ie.style.display="flex",ie.style.overflow="hidden",ie.style.flexGrow="2",this.widths.forEach(function(de){var oe=document.createElement("div");oe.style.display="flex",oe.style.flexGrow="2",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderColor=de===Y.currentWidth?Y.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){Y.setCurrentWidth(de,oe)}),ie.appendChild(oe);var ze=document.createElement("div");ze.innerText=de.toString(),ze.style.marginRight="5px",oe.appendChild(ze);var ft=document.createElement("div");ft.style.minHeight="20px",ft.style.flexGrow="2",ft.style.display="flex",ft.style.alignItems="center";var St=document.createElement("hr");St.style.minWidth="20px",St.style.border="0px",St.style.borderTop=de+"px solid "+Y.uiStyleSettings.toolboxColor,St.style.flexGrow="2",ft.appendChild(St),oe.appendChild(ft),Y.widthBoxes.push(oe)}),ie},G.prototype.setCurrentWidth=function(Y,ie){var de=this;this.currentWidth=Y,this.widthBoxes.forEach(function(oe){oe.style.borderColor=oe===ie?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},G}(Z),ot=function(ae){function G(Y,ie,de,oe){var ze=ae.call(this,Y,oe||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ze.styles=[],ze.styleBoxes=[],ze.styles=ie,ze.currentStyle=de,ze.setCurrentStyle=ze.setCurrentStyle.bind(ze),ze}return me(G,ae),G.prototype.getUi=function(){var Y=this,ie=document.createElement("div");return ie.style.display="flex",ie.style.overflow="hidden",ie.style.flexGrow="2",this.styles.forEach(function(de){var oe=document.createElement("div");oe.style.display="flex",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.overflow="hidden",oe.style.maxWidth=100/Y.styles.length-5+"%",oe.style.borderColor=de===Y.currentStyle?Y.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){Y.setCurrentStyle(de,oe)}),ie.appendChild(oe);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.overflow="hidden";var ft=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Y.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(de!==""?'stroke-dasharray="'+de+'"':"")+` />
|
|
|
</svg>`;ze.innerHTML=ft,oe.appendChild(ze),Y.styleBoxes.push(oe)}),ie},G.prototype.setCurrentStyle=function(Y,ie){var de=this;this.currentStyle=Y,this.styleBoxes.forEach(function(oe){oe.style.borderColor=oe===ie?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},G}(Z),Fe=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.strokeColor=de.defaultColor,oe.strokeWidth=de.defaultStrokeWidth,oe.strokeDasharray=de.defaultStrokeDasharray,oe.strokePanel=new ve("Line color",de.defaultColorSet,de.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new st("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new ot("Line style",de.defaultStrokeDasharrays,de.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return me(G,ae),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=ae.prototype.getState.call(this);return Y.typeName=G.typeName,Y},G.typeName="FrameMarker",G.title="Frame marker",G.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',G}(tt),Ae=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},qe=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.x1=0,oe.y1=0,oe.x2=0,oe.y2=0,oe.defaultLength=50,oe.manipulationStartX=0,oe.manipulationStartY=0,oe.manipulationStartX1=0,oe.manipulationStartY1=0,oe.manipulationStartX2=0,oe.manipulationStartY2=0,oe.setupControlBox(),oe}return me(G,ae),G.prototype.ownsTarget=function(Y){return!!ae.prototype.ownsTarget.call(this,Y)||!(!this.grip1.ownsTarget(Y)&&!this.grip2.ownsTarget(Y))},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),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(ie)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ie)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},G.prototype.pointerUp=function(Y){var ie=this.state;ae.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",ie==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},G.prototype.adjustVisual=function(){},G.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)},G.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()},G.prototype.select=function(){ae.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},G.prototype.deselect=function(){ae.prototype.deselect.call(this),this.controlBox.style.display="none"},G.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},G.prototype.adjustControlBox=function(){this.positionGrips()},G.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},G.prototype.createGrip=function(){var Y=new Je;return Y.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(Y.visual),Y},G.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)},G.prototype.positionGrip=function(Y,ie,de){var oe=Y.transform.baseVal.getItem(0);oe.setTranslate(ie,de),Y.transform.baseVal.replaceItem(oe,0)},G.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ae.prototype.getState.call(this))},G.prototype.restoreState=function(Y){ae.prototype.restoreState.call(this,Y);var ie=Y;this.x1=ie.x1,this.y1=ie.y1,this.x2=ie.x2,this.y2=ie.y2},G.prototype.scale=function(Y,ie){ae.prototype.scale.call(this,Y,ie),this.x1=this.x1*Y,this.y1=this.y1*ie,this.x2=this.x2*Y,this.y2=this.y2*ie,this.adjustVisual(),this.adjustControlBox()},G}(ye),ut=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.strokeColor=de.defaultColor,oe.strokeWidth=de.defaultStrokeWidth,oe.strokeDasharray=de.defaultStrokeDasharray,oe.strokePanel=new ve("Line color",de.defaultColorSet,de.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new st("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new ot("Line style",de.defaultStrokeDasharrays,de.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return me(G,ae),G.prototype.ownsTarget=function(Y){return!(!ae.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.selectorLine&&Y!==this.visibleLine)},G.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},G.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},G.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.adjustVisual(),this.colorChanged(Y)},G.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.adjustVisual()},G.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.adjustVisual(),this.stateChanged()},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ae.prototype.getState.call(this));return Y.typeName=G.typeName,Y},G.prototype.restoreState=function(Y){ae.prototype.restoreState.call(this,Y);var ie=Y;this.strokeColor=ie.strokeColor,this.strokeWidth=ie.strokeWidth,this.strokeDasharray=ie.strokeDasharray,this.createVisual(),this.adjustVisual()},G.typeName="LineMarker",G.title="Line marker",G.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',G}(qe),$e=function(ae){function G(Y,ie,de,oe){var ze=ae.call(this,Y,oe||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ze.fonts=[],ze.fontBoxes=[],ze.fonts=ie,ze.currentFont=de,ze.setCurrentFont=ze.setCurrentFont.bind(ze),ze}return me(G,ae),G.prototype.getUi=function(){var Y=this,ie=document.createElement("div");return ie.style.overflow="hidden",ie.style.flexGrow="2",this.fonts.forEach(function(de){var oe=document.createElement("div");oe.style.display="inline-block",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.overflow="hidden",oe.style.maxWidth=100/Y.fonts.length-5+"%",oe.style.borderColor=de===Y.currentFont?Y.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){Y.setCurrentFont(de,oe)}),ie.appendChild(oe);var ze=document.createElement("div");ze.style.display="flex",ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.fontFamily=de,ze.style.overflow="hidden";var ft=document.createElement("div");ft.style.whiteSpace="nowrap",ft.style.overflow="hidden",ft.style.textOverflow="ellipsis",ft.innerHTML="The quick brown fox jumps over the lazy dog",ze.appendChild(ft),oe.appendChild(ze),Y.fontBoxes.push(oe)}),ie},G.prototype.setCurrentFont=function(Y,ie){var de=this;this.currentFont=Y,this.fontBoxes.forEach(function(oe){oe.style.borderColor=oe===ie?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},G}(Z),nt=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.color="transparent",oe.padding=5,oe.DEFAULT_TEXT="your text here",oe.text=oe.DEFAULT_TEXT,oe.isMoved=!1,oe.color=de.defaultColor,oe.fontFamily=de.defaultFontFamily,oe.defaultSize={x:100,y:30},oe.setColor=oe.setColor.bind(oe),oe.setFont=oe.setFont.bind(oe),oe.renderText=oe.renderText.bind(oe),oe.sizeText=oe.sizeText.bind(oe),oe.textEditDivClicked=oe.textEditDivClicked.bind(oe),oe.showTextEditor=oe.showTextEditor.bind(oe),oe.setSize=oe.setSize.bind(oe),oe.positionTextEditor=oe.positionTextEditor.bind(oe),oe.colorPanel=new ve("Color",de.defaultColorSet,de.defaultColor),oe.colorPanel.onColorChanged=oe.setColor,oe.fontFamilyPanel=new $e("Font",de.defaultFontFamilies,de.defaultFontFamily),oe.fontFamilyPanel.onFontChanged=oe.setFont,oe}return me(G,ae),G.prototype.ownsTarget=function(Y){if(ae.prototype.ownsTarget.call(this,Y)||Y===this.visual||Y===this.textElement||Y===this.bgRectangle)return!0;var ie=!1;return this.textElement.childNodes.forEach(function(de){de===Y&&(ie=!0)}),ie},G.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),this.isMoved=!1,this.pointerDownPoint=Y,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Y),this._state="creating")},G.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(ie){Y.textElement.appendChild(ce.createTSpan(ie.trim()===""?" ":ie.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},G.prototype.getTextScale=function(){var Y=this.textElement.getBBox(),ie=1;if(Y.width>0&&Y.height>0){var de=(1*this.width-this.width*this.padding*2/100)/Y.width,oe=(1*this.height-this.height*this.padding*2/100)/Y.height;ie=Math.min(de,oe)}return ie},G.prototype.getTextPosition=function(Y){var ie=this.textElement.getBBox(),de=0,oe=0;return ie.width>0&&ie.height>0&&(de=(this.width-ie.width*Y)/2,oe=this.height/2-ie.height*Y/2),{x:de,y:oe}},G.prototype.sizeText=function(){var Y=this.textElement.getBBox(),ie=this.getTextScale(),de=this.getTextPosition(ie);de.y-=Y.y*ie,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+de.x+"px, "+de.y+"px) scale("+ie+", "+ie+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(de.x,de.y),this.textElement.transform.baseVal.getItem(1).setScale(ie,ie))},G.prototype.manipulate=function(Y){ae.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)},G.prototype.resize=function(Y){ae.prototype.resize.call(this,Y),this.isMoved=!0,this.setSize(),this.sizeText()},G.prototype.setSize=function(){ae.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},G.prototype.pointerUp=function(Y){var ie=this.state;ie==="creating"&&(this._suppressMarkerCreateEvent=!0),ae.prototype.pointerUp.call(this,Y),this.setSize(),(ie==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},G.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(ie){ie.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ie=Number.parseFloat(Y.textEditor.style.fontSize);Y.textEditor.clientWidth>=Number.parseInt(Y.textEditor.style.maxWidth)&&ie>.9;)ie-=.1,Y.textEditor.style.fontSize=Math.max(ie,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ie){ie.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ie){if(ie.clipboardData){var de=ie.clipboardData.getData("text"),oe=window.getSelection();if(!oe.rangeCount)return!1;oe.deleteFromDocument(),oe.getRangeAt(0).insertNode(document.createTextNode(de)),ie.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")},G.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Y=this.getTextScale(),ie=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),de=this.textElement.getBBox(),oe={x:de.width*Y,y:de.height*Y};ie.x-=oe.x/2,ie.y-=oe.y/2,this.textEditor.style.top=ie.y+"px",this.textEditor.style.left=ie.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ie.x+"px",this.textEditor.style.fontSize=Math.max(16*Y,12)+"px",this.textElement.style.display="none"}},G.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()},G.prototype.select=function(){ae.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},G.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ae.prototype.deselect.call(this)},G.prototype.dblClick=function(Y,ie){ae.prototype.dblClick.call(this,Y,ie),this.showTextEditor()},G.prototype.setColor=function(Y){this.textElement&&ce.setAttributes(this.textElement,[["fill",Y]]),this.color=Y,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Y)},G.prototype.setFont=function(Y){this.textElement&&ce.setAttributes(this.textElement,[["font-family",Y]]),this.fontFamily=Y,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},G.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},G.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ae.prototype.getState.call(this));return Y.typeName=G.typeName,Y},G.prototype.restoreState=function(Y){var ie=Y;this.color=ie.color,this.fontFamily=ie.fontFamily,this.padding=ie.padding,this.text=ie.text,this.createVisual(),ae.prototype.restoreState.call(this,Y),this.setSize()},G.prototype.scale=function(Y,ie){ae.prototype.scale.call(this,Y,ie),this.setSize(),this.sizeText(),this.positionTextEditor()},G.typeName="TextMarker",G.title="Text marker",G.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',G}(rt),je=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.color="transparent",oe.lineWidth=3,oe.drawing=!1,oe.pixelRatio=1,oe.color=de.defaultColor,oe.lineWidth=de.defaultStrokeWidth,oe.pixelRatio=de.freehandPixelRatio,oe.setColor=oe.setColor.bind(oe),oe.addCanvas=oe.addCanvas.bind(oe),oe.finishCreation=oe.finishCreation.bind(oe),oe.setLineWidth=oe.setLineWidth.bind(oe),oe.colorPanel=new ve("Color",de.defaultColorSet,de.defaultColor),oe.colorPanel.onColorChanged=oe.setColor,oe.lineWidthPanel=new st("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),oe.lineWidthPanel.onWidthChanged=oe.setLineWidth,oe}return me(G,ae),G.prototype.ownsTarget=function(Y){return!(!ae.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.drawingImage)},G.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var Y=ce.createTransform();this.visual.transform.baseVal.appendItem(Y),this.addMarkerVisualToContainer(this.visual)},G.prototype.pointerDown=function(Y,ie){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(Y.x,Y.y),this.drawing=!0):ae.prototype.pointerDown.call(this,Y,ie)},G.prototype.manipulate=function(Y){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Y.x,Y.y),this.canvasContext.stroke()):ae.prototype.manipulate.call(this,Y)},G.prototype.resize=function(Y){ae.prototype.resize.call(this,Y),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},G.prototype.pointerUp=function(Y){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ae.prototype.pointerUp.call(this,Y)},G.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)},G.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ae.prototype.select.call(this)},G.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ae.prototype.deselect.call(this)},G.prototype.finishCreation=function(){for(var Y=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ie=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],de=ie[0],oe=ie[1],ze=ie[2],ft=ie[3],St=!1,Ft=0;Ft<this.canvasElement.height;Ft++)for(var mt=0;mt<this.canvasElement.width;mt++)Y.data[Ft*this.canvasElement.width*4+4*mt+3]>0&&(St=!0,Ft<oe&&(oe=Ft),mt<de&&(de=mt),Ft>ft&&(ft=Ft),mt>ze&&(ze=mt));if(St){this.left=de/this.pixelRatio,this.top=oe/this.pixelRatio,this.width=(ze-de)/this.pixelRatio,this.height=(ft-oe)/this.pixelRatio;var Gt=document.createElement("canvas");Gt.width=ze-de,Gt.height=ft-oe,Gt.getContext("2d").putImageData(this.canvasContext.getImageData(de,oe,ze-de,ft-oe),0,0),this.drawingImgUrl=Gt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},G.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},G.prototype.setColor=function(Y){this.color=Y,this.colorChanged(Y)},G.prototype.setLineWidth=function(Y){this.lineWidth=Y},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=Object.assign({drawingImgUrl:this.drawingImgUrl},ae.prototype.getState.call(this));return Y.typeName=G.typeName,Y},G.prototype.restoreState=function(Y){this.createVisual(),ae.prototype.restoreState.call(this,Y),this.drawingImgUrl=Y.drawingImgUrl,this.setDrawingImage()},G.prototype.scale=function(Y,ie){ae.prototype.scale.call(this,Y,ie),this.setDrawingImage()},G.typeName="FreehandMarker",G.title="Freehand marker",G.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',G}(rt),De=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,de||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return oe.typeBoxes=[],oe.currentType=ie,oe.setCurrentType=oe.setCurrentType.bind(oe),oe}return me(G,ae),G.prototype.getUi=function(){var Y=this,ie=document.createElement("div");ie.style.display="flex",ie.style.overflow="hidden",ie.style.flexGrow="2";for(var de=function(ft){var St="both";switch(ft){case 0:St="both";break;case 1:St="start";break;case 2:St="end";break;case 3:St="none"}var Ft=document.createElement("div");if(Ft.style.display="flex",Ft.style.flexGrow="2",Ft.style.alignItems="center",Ft.style.justifyContent="space-between",Ft.style.padding="5px",Ft.style.borderWidth="2px",Ft.style.borderStyle="solid",Ft.style.borderColor=St===oe.currentType?oe.uiStyleSettings.toolboxAccentColor:"transparent",Ft.addEventListener("click",function(){Y.setCurrentType(St,Ft)}),ie.appendChild(Ft),St==="both"||St==="start"){var mt=document.createElement("div");mt.style.display="flex",mt.style.alignItems="center",mt.style.minHeight="20px",mt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,mt.style.marginLeft="5px",Ft.appendChild(mt)}var Gt=document.createElement("div");Gt.style.display="flex",Gt.style.alignItems="center",Gt.style.minHeight="20px",Gt.style.flexGrow="2";var Vt=document.createElement("hr");if(Vt.style.minWidth="20px",Vt.style.border="0px",Vt.style.borderTop="3px solid "+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee"),Vt.style.flexGrow="2",Gt.appendChild(Vt),Ft.appendChild(Gt),St==="both"||St==="end"){var Hr=document.createElement("div");Hr.style.display="flex",Hr.style.alignItems="center",Hr.style.minHeight="20px",Hr.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Hr.style.marginRight="5px",Ft.appendChild(Hr)}oe.typeBoxes.push(Ft)},oe=this,ze=0;ze<4;ze++)de(ze);return ie},G.prototype.setCurrentType=function(Y,ie){var de=this;this.currentType=Y,this.typeBoxes.forEach(function(oe){oe.style.borderColor=oe===ie?de.uiStyleSettings!==void 0?de.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},G}(Z),Pe=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.arrowType="end",oe.arrowBaseHeight=10,oe.arrowBaseWidth=10,oe.getArrowPoints=oe.getArrowPoints.bind(oe),oe.setArrowType=oe.setArrowType.bind(oe),oe.arrowTypePanel=new De("Arrow type","end"),oe.arrowTypePanel.onArrowTypeChanged=oe.setArrowType,oe}return me(G,ae),G.prototype.ownsTarget=function(Y){return!(!ae.prototype.ownsTarget.call(this,Y)&&Y!==this.arrow1&&Y!==this.arrow2)},G.prototype.getArrowPoints=function(Y,ie){var de=this.arrowBaseWidth+2*this.strokeWidth,oe=this.arrowBaseHeight+2*this.strokeWidth;return Y-de/2+","+(ie+oe/2)+" "+Y+","+(ie-oe/2)+" "+(Y+de/2)+","+(ie+oe/2)},G.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),this.state==="creating"&&this.createTips()},G.prototype.adjustVisual=function(){if(ae.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var Y=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ie=this.arrow1.transform.baseVal.getItem(0);ie.setRotate(Y,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ie,0);var de=this.arrow2.transform.baseVal.getItem(0);de.setRotate(Y+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(de,0)}},G.prototype.setArrowType=function(Y){this.arrowType=Y,this.adjustVisual(),this.stateChanged()},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=Object.assign({arrowType:this.arrowType},ae.prototype.getState.call(this));return Y.typeName=G.typeName,Y},G.prototype.restoreState=function(Y){ae.prototype.restoreState.call(this,Y);var ie=Y;this.arrowType=ie.arrowType,this.createTips(),this.adjustVisual()},G.typeName="ArrowMarker",G.title="Arrow marker",G.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',G}(ut),xe=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.fillColor=de.defaultFillColor,oe.strokeWidth=0,oe.fillPanel=new ve("Color",de.defaultColorSet,de.defaultFillColor),oe.fillPanel.onColorChanged=oe.setFillColor,oe}return me(G,ae),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=ae.prototype.getState.call(this);return Y.typeName=G.typeName,Y},G.typeName="CoverMarker",G.title="Cover marker",G.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',G}(tt),Se=function(ae){function G(Y,ie,de,oe){var ze=ae.call(this,Y,oe||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ze.opacities=[],ze.opacityBoxes=[],ze.opacities=ie,ze.currentOpacity=de,ze.setCurrentOpacity=ze.setCurrentOpacity.bind(ze),ze}return me(G,ae),G.prototype.getUi=function(){var Y=this,ie=document.createElement("div");return ie.style.display="flex",ie.style.overflow="hidden",ie.style.flexGrow="2",ie.style.justifyContent="space-between",this.opacities.forEach(function(de){var oe=document.createElement("div");oe.style.display="flex",oe.style.alignItems="center",oe.style.justifyContent="center",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderColor=de===Y.currentOpacity?Y.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){Y.setCurrentOpacity(de,oe)}),ie.appendChild(oe);var ze=document.createElement("div");ze.innerText=100*de+"%",oe.appendChild(ze),Y.opacityBoxes.push(oe)}),ie},G.prototype.setCurrentOpacity=function(Y,ie){var de=this;this.currentOpacity=Y,this.opacityBoxes.forEach(function(oe){oe.style.borderColor=oe===ie?de.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},G}(Z),Le=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.setOpacity=oe.setOpacity.bind(oe),oe.fillColor=de.defaultHighlightColor,oe.strokeWidth=0,oe.opacity=de.defaultHighlightOpacity,oe.fillPanel=new ve("Color",de.defaultColorSet,oe.fillColor),oe.fillPanel.onColorChanged=oe.setFillColor,oe.opacityPanel=new Se("Opacity",de.defaultOpacitySteps,oe.opacity),oe.opacityPanel.onOpacityChanged=oe.setOpacity,oe}return me(G,ae),G.prototype.setOpacity=function(Y){this.opacity=Y,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=ae.prototype.getState.call(this);return Y.typeName=G.typeName,Y},G.typeName="HighlightMarker",G.title="Highlight marker",G.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',G}(xe),Ne='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',et=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.bgColor="transparent",oe.tipPosition={x:0,y:0},oe.tipBase1Position={x:0,y:0},oe.tipBase2Position={x:0,y:0},oe.tipMoving=!1,oe.color=de.defaultStrokeColor,oe.bgColor=de.defaultFillColor,oe.fontFamily=de.defaultFontFamily,oe.defaultSize={x:100,y:30},oe.setBgColor=oe.setBgColor.bind(oe),oe.getTipPoints=oe.getTipPoints.bind(oe),oe.positionTip=oe.positionTip.bind(oe),oe.setTipPoints=oe.setTipPoints.bind(oe),oe.colorPanel=new ve("Text color",de.defaultColorSet,oe.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),oe.colorPanel.onColorChanged=oe.setColor,oe.bgColorPanel=new ve("Fill color",de.defaultColorSet,oe.bgColor,Ne),oe.bgColorPanel.onColorChanged=oe.setBgColor,oe.fontFamilyPanel=new $e("Font",de.defaultFontFamilies,de.defaultFontFamily),oe.fontFamilyPanel.onFontChanged=oe.setFont,oe.tipGrip=new Je,oe.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),oe.controlBox.appendChild(oe.tipGrip.visual),oe}return me(G,ae),G.prototype.ownsTarget=function(Y){return ae.prototype.ownsTarget.call(this,Y)||this.tipGrip.ownsTarget(Y)||this.tip===Y},G.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},G.prototype.pointerDown=function(Y,ie){this.state==="new"&&ae.prototype.pointerDown.call(this,Y,ie),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ie)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ae.prototype.pointerDown.call(this,Y,ie)},G.prototype.pointerUp=function(Y){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ae.prototype.pointerUp.call(this,Y);else{var ie=this.state==="creating";ae.prototype.pointerUp.call(this,Y),this.setTipPoints(ie),this.positionTip()}},G.prototype.manipulate=function(Y){if(this.tipMoving){var ie=this.unrotatePoint(Y);this.tipPosition={x:ie.x-this.manipulationStartLeft,y:ie.y-this.manipulationStartTop},this.positionTip()}else ae.prototype.manipulate.call(this,Y)},G.prototype.setBgColor=function(Y){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",Y]]),ce.setAttributes(this.tip,[["fill",Y]])),this.bgColor=Y,this.fillColorChanged(Y)},G.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},G.prototype.setTipPoints=function(Y){Y===void 0&&(Y=!1);var ie=Math.min(this.height/2,15),de=this.height/5;Y&&(this.tipPosition={x:ie+de/2,y:this.height+20});var oe=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?oe<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(de=this.width/5,ie=Math.min(this.width/2,15),this.tipBase1Position={x:ie,y:0},this.tipBase2Position={x:ie+de,y:0}):(this.tipBase1Position={x:0,y:ie},this.tipBase2Position={x:0,y:ie+de}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?oe<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(de=this.width/5,ie=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ie-de,y:0},this.tipBase2Position={x:this.width-ie,y:0}):(this.tipBase1Position={x:this.width,y:ie},this.tipBase2Position={x:this.width,y:ie+de}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?oe<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(de=this.width/5,ie=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ie-de,y:this.height},this.tipBase2Position={x:this.width-ie,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ie-de},this.tipBase2Position={x:this.width,y:this.height-ie}):oe<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(de=this.width/5,ie=Math.min(this.width/2,15),this.tipBase1Position={x:ie,y:this.height},this.tipBase2Position={x:ie+de,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ie},this.tipBase2Position={x:0,y:this.height-ie-de})},G.prototype.resize=function(Y){ae.prototype.resize.call(this,Y),this.positionTip()},G.prototype.positionTip=function(){ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Y=this.tipGrip.visual.transform.baseVal.getItem(0);Y.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Y,0)},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),G.prototype.select=function(){this.positionTip(),ae.prototype.select.call(this)},G.prototype.getState=function(){var Y=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ae.prototype.getState.call(this));return Y.typeName=G.typeName,Y},G.prototype.restoreState=function(Y){var ie=Y;this.bgColor=ie.bgColor,this.tipPosition=ie.tipPosition,ae.prototype.restoreState.call(this,Y),this.createTip(),this.setTipPoints()},G.prototype.scale=function(Y,ie){ae.prototype.scale.call(this,Y,ie),this.tipPosition={x:this.tipPosition.x*Y,y:this.tipPosition.y*ie},this.positionTip()},G.typeName="CalloutMarker",G.title="Callout marker",G.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',G}(nt),Xe=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.fillColor="transparent",oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.opacity=1,oe.strokeColor=de.defaultColor,oe.strokeWidth=de.defaultStrokeWidth,oe.strokeDasharray=de.defaultStrokeDasharray,oe.fillColor=de.defaultFillColor,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setFillColor=oe.setFillColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.setOpacity=oe.setOpacity.bind(oe),oe.createVisual=oe.createVisual.bind(oe),oe.strokePanel=new ve("Line color",he(de.defaultColorSet,["transparent"]),de.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.fillPanel=new ve("Fill color",he(de.defaultColorSet,["transparent"]),oe.fillColor,Ne),oe.fillPanel.onColorChanged=oe.setFillColor,oe.strokeWidthPanel=new st("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new ot("Line style",de.defaultStrokeDasharrays,de.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe.opacityPanel=new Se("Opacity",de.defaultOpacitySteps,oe.opacity),oe.opacityPanel.onOpacityChanged=oe.setOpacity,oe}return me(G,ae),G.prototype.ownsTarget=function(Y){return!(!ae.prototype.ownsTarget.call(this,Y)&&Y!==this.visual)},G.prototype.createVisual=function(){this.visual=ce.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),this.state==="new"&&(this.createVisual(),this.moveVisual(Y),this._state="creating")},G.prototype.manipulate=function(Y){ae.prototype.manipulate.call(this,Y)},G.prototype.resize=function(Y){ae.prototype.resize.call(this,Y),this.setSize()},G.prototype.setSize=function(){ae.prototype.setSize.call(this),ce.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},G.prototype.pointerUp=function(Y){ae.prototype.pointerUp.call(this,Y),this.setSize()},G.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Y),this.stateChanged()},G.prototype.setFillColor=function(Y){this.fillColor=Y,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Y),this.stateChanged()},G.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},G.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},G.prototype.setOpacity=function(Y){this.opacity=Y,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ae.prototype.getState.call(this));return Y.typeName=G.typeName,Y},G.prototype.restoreState=function(Y){var ie=Y;this.fillColor=ie.fillColor,this.strokeColor=ie.strokeColor,this.strokeWidth=ie.strokeWidth,this.strokeDasharray=ie.strokeDasharray,this.opacity=ie.opacity,this.createVisual(),ae.prototype.restoreState.call(this,Y),this.setSize()},G.prototype.scale=function(Y,ie){ae.prototype.scale.call(this,Y,ie),this.setSize()},G.typeName="EllipseMarker",G.title="Ellipse marker",G.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',G}(rt),ct=function(ae){function G(Y,ie,de){return ae.call(this,Y,ie,de)||this}return me(G,ae),Object.defineProperty(G.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(Y){return!(!ae.prototype.ownsTarget.call(this,Y)&&Y!==this.tip1&&Y!==this.tip2)},G.prototype.createTips=function(){this.tip1=ce.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.tip2)},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),this.state==="creating"&&this.createTips()},G.prototype.adjustVisual=function(){if(ae.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ce.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var Y=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ie=this.tip1.transform.baseVal.getItem(0);ie.setRotate(Y,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ie,0);var de=this.tip2.transform.baseVal.getItem(0);de.setRotate(Y+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(de,0)}},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=ae.prototype.getState.call(this);return Y.typeName=G.typeName,Y},G.prototype.restoreState=function(Y){ae.prototype.restoreState.call(this,Y),this.createTips(),this.adjustVisual()},G.typeName="MeasurementMarker",G.title="Measurement marker",G.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',G}(ut),gt=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.strokePanel.colors=de.defaultColorSet,oe.fillColor="transparent",oe}return me(G,ae),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=ae.prototype.getState.call(this);return Y.typeName=G.typeName,Y},G.typeName="EllipseFrameMarker",G.title="Ellipse frame marker",G.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',G}(Xe),wt=function(){function ae(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ae.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ae.prototype.addUndoStep=function(G){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(G)||(this.undoStack.push(G),JSON.stringify(this.lastRedoStep)!==JSON.stringify(G)&&this.redoStack.splice(0,this.redoStack.length))},ae.prototype.replaceLastUndoStep=function(G){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=G)},ae.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ae.prototype.undo=function(){if(this.undoStack.length>1){var G=this.undoStack.pop();return G!==void 0&&this.redoStack.push(G),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ae.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ae}(),vt=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie,de)||this;return oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.curveX=0,oe.curveY=0,oe.manipulationStartCurveX=0,oe.manipulationStartCurveY=0,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.positionGrips=oe.positionGrips.bind(oe),oe.addControlGrips=oe.addControlGrips.bind(oe),oe.adjustVisual=oe.adjustVisual.bind(oe),oe.setupControlBox=oe.setupControlBox.bind(oe),oe.resize=oe.resize.bind(oe),oe.strokeColor=de.defaultColor,oe.strokeWidth=de.defaultStrokeWidth,oe.strokeDasharray=de.defaultStrokeDasharray,oe.strokePanel=new ve("Line color",de.defaultColorSet,de.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new st("Line width",de.defaultStrokeWidths,de.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new ot("Line style",de.defaultStrokeDasharrays,de.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return me(G,ae),G.prototype.ownsTarget=function(Y){return!(!ae.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.selectorCurve&&Y!==this.visibleCurve&&!this.curveGrip.ownsTarget(Y))},G.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},G.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},G.prototype.pointerDown=function(Y,ie){ae.prototype.pointerDown.call(this,Y,ie),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(ie)&&(this.activeGrip=this.curveGrip,this._state="resize")},G.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},G.prototype.setupControlBox=function(){ae.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},G.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ae.prototype.addControlGrips.call(this)},G.prototype.positionGrips=function(){ae.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()))},G.prototype.manipulate=function(Y){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Y.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Y.y-this.manipulationStartY),ae.prototype.manipulate.call(this,Y)},G.prototype.resize=function(Y){this.activeGrip===this.curveGrip&&(this.curveX=Y.x,this.curveY=Y.y),ae.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)},G.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.adjustVisual(),this.colorChanged(Y)},G.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.adjustVisual()},G.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.adjustVisual()},G.prototype.scale=function(Y,ie){this.curveX=this.curveX*Y,this.curveY=this.curveY*ie,ae.prototype.scale.call(this,Y,ie)},Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),G.prototype.getState=function(){var Y=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ae.prototype.getState.call(this));return Y.typeName=G.typeName,Y},G.prototype.restoreState=function(Y){ae.prototype.restoreState.call(this,Y);var ie=Y;this.strokeColor=ie.strokeColor,this.strokeWidth=ie.strokeWidth,this.strokeDasharray=ie.strokeDasharray,this.curveX=ie.curveX,this.curveY=ie.curveY,this.createVisual(),this.adjustVisual()},G.typeName="CurveMarker",G.title="Curve marker",G.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',G}(qe),Mt=function(){function ae(G,Y){Y===void 0&&(Y=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=G,this.cancelable=Y}return Object.defineProperty(ae.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ae.prototype.preventDefault=function(){this._defaultPrevented=!0},ae}(),Pt=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,!1)||this;return oe.dataUrl=ie,oe.state=de,oe}return me(G,ae),G}(Mt),_t=function(ae){function G(Y,ie,de){de===void 0&&(de=!1);var oe=ae.call(this,Y,de)||this;return oe.marker=ie,oe}return me(G,ae),G}(Mt),rr=function(){function ae(){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 ae.prototype.addEventListener=function(G,Y){this[G].push(Y)},ae.prototype.removeEventListener=function(G,Y){var ie=this[G].indexOf(Y);ie>-1&&this[G].splice(ie,1)},ae}(),dr=function(){function ae(G){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ae,this._isOpen=!1,this.undoRedoManager=new wt,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 rr,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ae.instanceCounter++,this.styles=new ue(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=G,this.targetRoot=document.body,this.width=G.clientWidth,this.height=G.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(ae.prototype,"ALL_MARKER_TYPES",{get:function(){return[Fe,je,Pe,nt,gt,Xe,Le,et,ct,xe,ut,vt]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Fe,je,Pe,nt,Xe,Le,et]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Fe,je,Pe,nt,Le]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(G){var Y=this;this._availableMarkerTypes.splice(0),G.forEach(function(ie){if(typeof ie=="string"){var de=Y.ALL_MARKER_TYPES.find(function(oe){return oe.typeName===ie});de!==void 0&&Y._availableMarkerTypes.push(de)}else Y._availableMarkerTypes.push(ie)})},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(G){this._zoomLevel=G,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(ae.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ae.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),se.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ae.prototype.show=function(){var G=this;this.styles.styleSheetRoot===void 0&&re.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=re.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Y){return Y(new Mt(G))})},ae.prototype.render=function(){return Me(this,void 0,void 0,function(){var G;return Oe(this,function(Y){switch(Y.label){case 0:return this.setCurrentMarker(),(G=new Te).naturalSize=this.renderAtNaturalSize,G.imageType=this.renderImageType,G.imageQuality=this.renderImageQuality,G.markersOnly=this.renderMarkersOnly,G.width=this.renderWidth,G.height=this.renderHeight,[4,G.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Y.sent(),[4,G.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Y.sent()]}})})},ae.prototype.close=function(G){var Y=this;if(G===void 0&&(G=!1),this.isOpen){var ie=!1;G||this.eventListeners.beforeclose.forEach(function(de){var oe=new Mt(Y,!0);de(oe),oe.defaultPrevented&&(ie=!0)}),ie||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(de){return de(new Mt(Y))}),this.detachEvents(),this._isOpen=!1)}},ae.prototype.addMarkersToToolbar=function(){for(var G,Y=[],ie=0;ie<arguments.length;ie++)Y[ie]=arguments[ie];(G=this._availableMarkerTypes).push.apply(G,Y)},ae.prototype.addRenderEventListener=function(G){this.addEventListener("render",function(Y){G(Y.dataUrl,Y.state)})},ae.prototype.removeRenderEventListener=function(G){},ae.prototype.addCloseEventListener=function(G){this.addEventListener("close",function(){G()})},ae.prototype.removeCloseEventListener=function(G){},ae.prototype.setupResizeObserver=function(){var G=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){G.resize(G.target.clientWidth,G.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return G.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ae.prototype.onPopupTargetResize=function(){var G=1*this.target.clientWidth/this.target.clientHeight,Y=this.editorCanvas.clientWidth/G>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*G:this.editorCanvas.clientWidth,ie=Y<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/G;this.resize(Y,ie)},ae.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ae.prototype.resize=function(G,Y){this._isResizing=!0;var ie=G/this.imageWidth,de=Y/this.imageHeight;this.imageWidth=Math.round(G),this.imageHeight=Math.round(Y),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(ie,de),this._isResizing=!1},ae.prototype.scaleMarkers=function(G,Y){var ie,de=this;this._currentMarker&&this._currentMarker instanceof nt?this._currentMarker.scale(G,Y):(ie=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(oe){oe!==de._currentMarker&&oe.scale(G,Y)}),ie!==void 0&&this.setCurrentMarker(ie)},ae.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},ae.prototype.setTopLeft=function(){var G=this.editingTarget.getBoundingClientRect(),Y=this.editorCanvas.getBoundingClientRect();this.left=G.left-Y.left,this.top=G.top-Y.top},ae.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},ae.prototype.addDefs=function(){for(var G,Y=[],ie=0;ie<arguments.length;ie++)Y[ie]=arguments[ie];this.defs=ce.createDefs(),this.addDefsToImage(),(G=this.defs).append.apply(G,Y)},ae.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ae.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},ae.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ae.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ae.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},ae.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ae.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},ae.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var G=document.createElement("a");G.href="https://markerjs.com/",G.target="_blank",G.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',G.title="Powered by marker.js",G.style.display="grid",G.style.alignItems="center",G.style.justifyItems="center",G.style.padding="3px",G.style.width="20px",G.style.height="20px",this.logoUI.appendChild(G),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ae.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")},ae.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"},ae.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ae.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 G=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=G+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Q(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new X(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ae.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ae.prototype.removeMarker=function(G){this.markerImage.removeChild(G.container),this.markers.indexOf(G)>-1&&this.markers.splice(this.markers.indexOf(G),1),G.dispose()},ae.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())},ae.prototype.toolbarButtonClicked=function(G,Y){if(G==="marker"&&Y!==void 0)this.createNewMarker(Y);else if(G==="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()}},ae.prototype.deleteSelectedMarker=function(){var G=this;if(this._currentMarker!==void 0){var Y=!1;if(this.eventListeners.markerbeforedelete.forEach(function(de){var oe=new _t(G,G._currentMarker,!0);de(oe),oe.defaultPrevented&&(Y=!0)}),!Y){var ie=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(de){return de(new _t(G,ie))})}}},ae.prototype.clear=function(){var G=this,Y=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ze){var ft=new _t(G,void 0,!0);ze(ft),ft.defaultPrevented&&(Y=!0)}),!Y)){this.setCurrentMarker();for(var ie=function(ze){var ft=de.markers[ze];de.setCurrentMarker(de.markers[ze]),de._currentMarker.dispose(),de.markerImage.removeChild(de._currentMarker.container),de.markers.splice(de.markers.indexOf(de._currentMarker),1),de.eventListeners.markerdelete.forEach(function(St){return St(new _t(G,ft))})},de=this,oe=this.markers.length-1;oe>=0;oe--)ie(oe);this.addUndoStep()}},Object.defineProperty(ae.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ae.prototype.showNotesEditor=function(){var G;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=(G=this._currentMarker.notes)!==null&&G!==void 0?G:"",this.overlayContainer.appendChild(this.notesArea))},ae.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)},ae.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ae.prototype.addUndoStep=function(){var G=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Y=this.getState(),ie=this.undoRedoManager.getLastUndoStep();if(!ie||ie.width===Y.width&&ie.height===Y.height){var de=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Y),de<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(oe){return oe(new Mt(G))})}else this.undoRedoManager.replaceLastUndoStep(Y),this.eventListeners.statechange.forEach(function(oe){return oe(new Mt(G))})}},ae.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ae.prototype.undoStep=function(){var G=this,Y=this.undoRedoManager.undo();Y!==void 0&&(this.restoreState(Y),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ie){return ie(new Mt(G))}))},ae.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ae.prototype.redoStep=function(){var G=this,Y=this.undoRedoManager.redo();Y!==void 0&&(this.restoreState(Y),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ie){return ie(new Mt(G))}))},ae.prototype.stepZoom=function(){var G=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=G<this.zoomSteps.length-1?this.zoomSteps[G+1]:this.zoomSteps[0]},ae.prototype.panTo=function(G){this.contentDiv.scrollBy({left:this.prevPanPoint.x-G.x,top:this.prevPanPoint.y-G.y}),this.prevPanPoint=G},ae.prototype.startRenderAndClose=function(){return Me(this,void 0,void 0,function(){var G,Y,ie=this;return Oe(this,function(de){switch(de.label){case 0:return[4,this.render()];case 1:return G=de.sent(),Y=this.getState(),this.eventListeners.render.forEach(function(oe){return oe(new Pt(ie,G,Y))}),this.close(!0),[2]}})})},ae.prototype.getState=function(G){G===!0&&this.setCurrentMarker();var Y={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ie){return Y.markers.push(ie.getState())}),Y},ae.prototype.restoreState=function(G){var Y=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);G.markers.forEach(function(ie){var de=Y._availableMarkerTypes.find(function(ze){return ze.typeName===ie.typeName});if(de!==void 0){var oe=Y.addNewMarker(de);oe.restoreState(ie),Y.markers.push(oe)}}),G.width&&G.height&&(G.width!==this.imageWidth||G.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/G.width,this.imageHeight/G.height),this.eventListeners.restorestate.forEach(function(ie){return ie(new Mt(Y))})},ae.prototype.addNewMarker=function(G){var Y=ce.createGroup();return this.markerImage.appendChild(Y),new G(Y,this.overlayContainer,this.settings)},ae.prototype.createNewMarker=function(G){var Y,ie=this;(Y=typeof G=="string"?this._availableMarkerTypes.find(function(de){return de.typeName===G}):G)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Y),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(Y.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(de){return de(new _t(ie,ie._currentMarker))}))},ae.prototype.markerCreated=function(G){var Y=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(G),this.setCurrentMarker(G),G instanceof je&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(je):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ie){return ie(new _t(Y,Y._currentMarker))})},ae.prototype.colorChanged=function(G){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=G,this.settings.defaultStrokeColor=G)},ae.prototype.fillColorChanged=function(G){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=G)},ae.prototype.markerStateChanged=function(G){var Y=this;this.eventListeners.markerchange.forEach(function(ie){return ie(new _t(Y,G))})},ae.prototype.setCurrentMarker=function(G){var Y=this;this._currentMarker!==G&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ie){return ie(new _t(Y,Y._currentMarker))})),this._currentMarker=G,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(ie){return ie(new _t(Y,Y._currentMarker))}))},ae.prototype.onPointerDown=function(G){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||G.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var Y=this.markers.find(function(ie){return ie.ownsTarget(G.target)});Y!==void 0?(this.setCurrentMarker(Y),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(G.clientX,G.clientY),G.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:G.clientX,y:G.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(G.clientX,G.clientY))},ae.prototype.onDblClick=function(G){if(this._isFocused||this.focus(),this.mode==="select"){var Y=this.markers.find(function(ie){return ie.ownsTarget(G.target)});Y!==void 0&&Y!==this._currentMarker&&this.setCurrentMarker(Y),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(G.clientX,G.clientY),G.target):this.setCurrentMarker()}},ae.prototype.onPointerMove=function(G){this.touchPoints!==1&&G.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||G.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(G.clientX,G.clientY)):this.zoomLevel>1&&this.panTo({x:G.clientX,y:G.clientY}))},ae.prototype.onPointerUp=function(G){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(G.clientX,G.clientY)),this.isDragging=!1,this.addUndoStep()},ae.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ae.prototype.onKeyUp=function(G){this._currentMarker===void 0||this.notesArea!==void 0||G.key!=="Delete"&&G.key!=="Backspace"||this.deleteSelectedMarker()},ae.prototype.clientToLocalCoordinates=function(G,Y){var ie=this.markerImage.getBoundingClientRect();return{x:(G-ie.left)/this.zoomLevel,y:(Y-ie.top)/this.zoomLevel}},ae.prototype.onWindowResize=function(){this.positionUI()},ae.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var G=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=G+"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()},ae.prototype.addLicenseKey=function(G){se.addKey(G)},ae.prototype.addEventListener=function(G,Y){this.eventListeners.addEventListener(G,Y)},ae.prototype.removeEventListener=function(G,Y){this.eventListeners.removeEventListener(G,Y)},ae.prototype.renderState=function(G){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(G),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ae.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ae.prototype.focus=function(){var G=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 Mt(G))}))},ae.prototype.blur=function(){var G=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Y){return Y(new Mt(G))}))},ae.instanceCounter=0,ae}();/* **********************************
|
|
|
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 Zt=function(ae,G){return(Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,ie){Y.__proto__=ie}||function(Y,ie){for(var de in ie)Object.prototype.hasOwnProperty.call(ie,de)&&(Y[de]=ie[de])})(ae,G)};function fr(ae,G){if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");function Y(){this.constructor=ae}Zt(ae,G),ae.prototype=G===null?Object.create(G):(Y.prototype=G.prototype,new Y)}function Ht(ae,G,Y,ie){return new(Y||(Y=Promise))(function(de,oe){function ze(Ft){try{St(ie.next(Ft))}catch(mt){oe(mt)}}function ft(Ft){try{St(ie.throw(Ft))}catch(mt){oe(mt)}}function St(Ft){var mt;Ft.done?de(Ft.value):(mt=Ft.value,mt instanceof Y?mt:new Y(function(Gt){Gt(mt)})).then(ze,ft)}St((ie=ie.apply(ae,G||[])).next())})}function Mr(ae,G){var Y,ie,de,oe,ze={label:0,sent:function(){if(1&de[0])throw de[1];return de[1]},trys:[],ops:[]};return oe={next:ft(0),throw:ft(1),return:ft(2)},typeof Symbol=="function"&&(oe[Symbol.iterator]=function(){return this}),oe;function ft(St){return function(Ft){return function(mt){if(Y)throw new TypeError("Generator is already executing.");for(;ze;)try{if(Y=1,ie&&(de=2&mt[0]?ie.return:mt[0]?ie.throw||((de=ie.return)&&de.call(ie),0):ie.next)&&!(de=de.call(ie,mt[1])).done)return de;switch(ie=0,de&&(mt=[2&mt[0],de.value]),mt[0]){case 0:case 1:de=mt;break;case 4:return ze.label++,{value:mt[1],done:!1};case 5:ze.label++,ie=mt[1],mt=[0];continue;case 7:mt=ze.ops.pop(),ze.trys.pop();continue;default:if(!(de=ze.trys,(de=de.length>0&&de[de.length-1])||mt[0]!==6&&mt[0]!==2)){ze=0;continue}if(mt[0]===3&&(!de||mt[1]>de[0]&&mt[1]<de[3])){ze.label=mt[1];break}if(mt[0]===6&&ze.label<de[1]){ze.label=de[1],de=mt;break}if(de&&ze.label<de[2]){ze.label=de[2],ze.ops.push(mt);break}de[2]&&ze.ops.pop(),ze.trys.pop();continue}mt=G.call(ae,ze)}catch(Gt){mt=[6,Gt],ie=0}finally{Y=de=0}if(5&mt[0])throw mt[1];return{value:mt[0]?mt[1]:void 0,done:!0}}([St,Ft])}}}var Sr=function(){function ae(){}return ae.addKey=function(G){ae.key=G},Object.defineProperty(ae,"isLicensed",{get:function(){return!!ae.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ae.key)},enumerable:!1,configurable:!0}),ae}(),Tt=function(){function ae(){}return ae.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ae.setAttributes=function(G,Y){for(var ie=0,de=Y;ie<de.length;ie++){var oe=de[ie],ze=oe[0],ft=oe[1];G.setAttribute(ze,ft)}},ae.createRect=function(G,Y,ie){var de=document.createElementNS("http://www.w3.org/2000/svg","rect");return de.setAttribute("width",G.toString()),de.setAttribute("height",Y.toString()),ie&&ae.setAttributes(de,ie),de},ae.createLine=function(G,Y,ie,de,oe){var ze=document.createElementNS("http://www.w3.org/2000/svg","line");return ze.setAttribute("x1",G.toString()),ze.setAttribute("y1",Y.toString()),ze.setAttribute("x2",ie.toString()),ze.setAttribute("y2",de.toString()),oe&&ae.setAttributes(ze,oe),ze},ae.createPolygon=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ie.setAttribute("points",G),Y&&ae.setAttributes(ie,Y),ie},ae.createCircle=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","circle");return ie.setAttribute("cx",(G/2).toString()),ie.setAttribute("cy",(G/2).toString()),ie.setAttribute("r",G.toString()),Y&&ae.setAttributes(ie,Y),ie},ae.createEllipse=function(G,Y,ie){var de=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return de.setAttribute("cx",(G/2).toString()),de.setAttribute("cy",(Y/2).toString()),de.setAttribute("rx",(G/2).toString()),de.setAttribute("ry",(Y/2).toString()),ie&&ae.setAttributes(de,ie),de},ae.createGroup=function(G){var Y=document.createElementNS("http://www.w3.org/2000/svg","g");return G&&ae.setAttributes(Y,G),Y},ae.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ae.createMarker=function(G,Y,ie,de,oe,ze,ft){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return ae.setAttributes(St,[["id",G],["orient",Y],["markerWidth",ie.toString()],["markerHeight",de.toString()],["refX",oe.toString()],["refY",ze.toString()]]),St.appendChild(ft),St},ae.createText=function(G){var Y=document.createElementNS("http://www.w3.org/2000/svg","text");return Y.setAttribute("x","0"),Y.setAttribute("y","0"),G&&ae.setAttributes(Y,G),Y},ae.createTSpan=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ie.textContent=G,Y&&ae.setAttributes(ie,Y),ie},ae.createImage=function(G){var Y=document.createElementNS("http://www.w3.org/2000/svg","image");return G&&ae.setAttributes(Y,G),Y},ae.createPoint=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ie.x=G,ie.y=Y,ie},ae.createPath=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg","path");return ie.setAttribute("d",G),Y&&ae.setAttributes(ie,Y),ie},ae.createElement=function(G,Y){var ie=document.createElementNS("http://www.w3.org/2000/svg",G);return Y&&ae.setAttributes(ie,Y),ie},ae.getHollowRectanglePath=function(G,Y,ie,de,oe,ze,ft,St){return"M"+G+","+Y+"V"+(Y+de)+"H"+(G+ie)+"V"+Y+"H"+oe+"V"+ze+"H"+(oe+ft)+"V"+(ze+St)+"H"+oe+"V"+Y+"Z"},ae}(),Ot=function(){function ae(G){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+G+"_"}return Object.defineProperty(ae.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ae.prototype.addClass=function(G){return this.styleSheet===void 0&&this.addStyleSheet(),G.name=""+this.classNamePrefix+G.localName,this.classes.push(G),this.styleSheet.sheet.insertRule("."+G.name+" {"+G.style+"}",this.styleSheet.sheet.cssRules.length),G},ae.prototype.addRule=function(G){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(G),this.styleSheet.sheet.insertRule(G.selector+" {"+G.style+"}",this.styleSheet.sheet.cssRules.length)},ae.prototype.addStyleSheet=function(){var G;this.styleSheet=document.createElement("style"),((G=this.styleSheetRoot)!==null&&G!==void 0?G:document.head).appendChild(this.styleSheet),this.addRule(new Rt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Rt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Rt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new Bt("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new Bt("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ae.prototype.removeStyleSheet=function(){var G;this.styleSheet&&(((G=this.styleSheetRoot)!==null&&G!==void 0?G:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ae}(),Rt=function(ae,G){this.selector=ae,this.style=G},Bt=function(ae,G){this.localName=ae,this.style=G},lr=function(){function ae(){this.blocks=[],this.display=""}return ae.prototype.addButtonBlock=function(G){G.className=this.blockClassName,G.buttonClassName=this.buttonClassName,G.buttonColorsClassName=this.buttonColorsClassName,G.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(G)},ae.prototype.addElementBlock=function(G){G.className===void 0&&(G.className=this.blockClassName),this.blocks.push(G)},ae.prototype.getUI=function(){var G=document.createElement("div");return G.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,G.style.display=this.display,this.blocks.forEach(function(Y){return G.appendChild(Y.getUI())}),G},ae}(),sn=function(){function ae(){}return ae.prototype.getUI=function(){var G=document.createElement("div");if(G.className=this.className,this.minWidth!==void 0&&(G.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":G.style.justifyContent="flex-start";break;case"center":G.style.justifyContent="center";break;case"end":G.style.justifyContent="flex-end"}return G.style.whiteSpace="nowrap",G},ae}(),yt=function(ae){function G(){var Y=ae!==null&&ae.apply(this,arguments)||this;return Y.buttons=[],Y}return fr(G,ae),G.prototype.addButton=function(Y){Y.className=this.buttonClassName,Y.colorsClassName=this.buttonColorsClassName,Y.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(Y)},G.prototype.getUI=function(){var Y=ae.prototype.getUI.call(this);return this.buttons.forEach(function(ie){return Y.appendChild(ie.getUI())}),Y},G}(sn),kt=function(){function ae(G,Y){this._isActive=!1,this._isHidden=!1,this._icon=G,this.title=Y,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ae.prototype,"icon",{get:function(){return this._icon},set:function(G){this._icon=G,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isActive",{get:function(){return this._isActive},set:function(G){this._isActive=G,this.adjustClassName()},enumerable:!1,configurable:!0}),ae.prototype.getUI=function(){var G=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return G.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ae.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ae.prototype.hide=function(){this._isHidden=!0},ae}(),Ct=function(ae){function G(){var Y=ae!==null&&ae.apply(this,arguments)||this;return Y.elements=[],Y}return fr(G,ae),G.prototype.addElement=function(Y){this.elements.push(Y)},G.prototype.getUI=function(){var Y=ae.prototype.getUI.call(this);return this.elements.forEach(function(ie){return Y.appendChild(ie)}),Y},G}(sn),Ar=function(){function ae(G,Y){this.horizontal=G,this.vertical=Y}return Object.defineProperty(ae.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ae.prototype.getVerticalLength=function(G){return G/this.ratio},ae.prototype.getHorizontalLength=function(G){return G*this.ratio},ae}(),Wr=function(){function ae(){}return ae.getIcon=function(G,Y){if(G>0&&Y>0){var ie=new Ar(G,Y),de=ie.ratio>=1?20:ie.getHorizontalLength(20),oe=ie.ratio<1?20:ie.getVerticalLength(20),ze=document.createElementNS("http://www.w3.org/2000/svg","svg");ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),ze.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ze);var ft=Tt.createDefs();ze.appendChild(ft);var St=Tt.createElement("clipPath",[["id","text-bg-clip"]]);ft.appendChild(St);var Ft=Tt.createPath(Tt.getHollowRectanglePath((24-de)/2,(24-oe)/2,de,oe,(24-de)/2+2,(24-oe)/2+2,de-4,oe-4));ze.appendChild(Ft);var mt=Tt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);mt.appendChild(Tt.createTSpan(G+":"+Y)),ze.appendChild(mt);var Gt=mt.getBBox();Tt.setAttributes(mt,[["x",((24-Gt.width)/2).toString()],["y",((24-Gt.height)/2-Gt.y).toString()]]);var Vt=Tt.createPath(Tt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Gt.width))/2,(24-Math.ceil(Gt.height))/2,Math.ceil(Gt.width),Math.ceil(Gt.height)));return St.appendChild(Vt),Tt.setAttributes(Ft,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ze),ze.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},ae}(),Yt=function(ae){function G(Y,ie,de){var oe=ae.call(this,Y,ie)||this;return oe.isDropdownOpen=!1,oe.onClick=oe.dropdownButtonClicked,oe.dropdownButtons=de,oe}return fr(G,ae),G.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(ie){ie.className=Y.className,ie.colorsClassName=Y.colorsClassName,Y.dropdownBlock.appendChild(ie.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},G.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},G.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},G.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},G.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},G.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},G}(kt),Ut=function(){function ae(G,Y){this.GRIP_SIZE=10,this.color=G,this.fillColor=Y,this.visual=Tt.createGroup(),this.visual.appendChild(Tt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Tt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ae.prototype.ownsTarget=function(G){return G===this.visual||G===this.visual.childNodes[0]||G===this.visual.childNodes[1]},ae.prototype.setCenter=function(G,Y){this.visual.childNodes.forEach(function(ie){return Tt.setAttributes(ie,[["cx",G.toString()],["cy",Y.toString()]])})},ae}(),Pr=function(){function ae(G,Y,ie,de){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=G,this.canvasHeight=Y,this.margin=ie,this.container=de,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(ae.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(G){this._aspectRatio=G,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(G){this._isGridVisible=G,this.gridContainer&&Tt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(G){this._zoomFactor=G,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ae.prototype.open=function(){var G=this;this.cropShadeElement=Tt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Tt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var Y=0;Y<this.numberOfGridLines;Y++)this.horizontalGridLines.push(Tt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Tt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ie){return G.gridContainer.appendChild(ie)}),this.verticalGridLines.forEach(function(ie){return G.gridContainer.appendChild(ie)}),this.cropRectElement=Tt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ae.prototype.setCropRectangle=function(G){this.cropRect=G;var Y=Object.assign({},this.cropRect);this.zoomFactor!==1&&(Y.width=this.cropRect.width*this.zoomFactor,Y.height=this.cropRect.height*this.zoomFactor,Y.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-Y.width/2,Y.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-Y.height/2),Tt.setAttributes(this.cropRectElement,[["x",Y.x.toString()],["y",Y.y.toString()],["width",Y.width.toString()],["height",Y.height.toString()]]);var ie=Y.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(oe,ze){var ft=Y.y+ie*(ze+1);Tt.setAttributes(oe,[["x1",""+Y.x],["y1",""+ft],["x2",""+(Y.x+Y.width)],["y2",""+ft]])});var de=Y.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(oe,ze){var ft=Y.x+de*(ze+1);Tt.setAttributes(oe,[["x1",""+ft],["y1",""+Y.y],["x2",""+ft],["y2",""+(Y.y+Y.height)]])}),Tt.setAttributes(this.cropShadeElement,[["d",Tt.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},ae.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)},ae.prototype.clientToLocalCoordinates=function(G,Y){var ie=this.container.getBoundingClientRect();return{x:G-ie.left+this.margin,y:Y-ie.top+this.margin}},ae.prototype.onPointerDown=function(G){this.container.setPointerCapture(G.pointerId),this.previousPoint=this.clientToLocalCoordinates(G.clientX,G.clientY),this.cropRectElement===G.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(G.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(G.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(G.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(G.target)&&(this.activeGrip=this.bottomRightGrip)},ae.prototype.onPointerMove=function(G){if(this.isMoving)this.move(this.clientToLocalCoordinates(G.clientX,G.clientY));else if(this.activeGrip){var Y=this.clientToLocalCoordinates(G.clientX,G.clientY);this.resize(Y)}G.preventDefault()},ae.prototype.onPointerUp=function(G){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(G.pointerId)},ae.prototype.move=function(G){var Y=G.x-this.previousPoint.x,ie=G.y-this.previousPoint.y;this.zoomFactor!==1&&(Y=-Y/this.zoomFactor,ie=-ie/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+ie),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=G},ae.prototype.resize=function(G){var Y=Object.assign({},this.cropRect),ie=G.x-this.previousPoint.x,de=G.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:Y.x+ie<this.margin&&(ie=this.margin-Y.x),Y.x+=ie,Y.width=this.cropRect.x+this.cropRect.width-Y.x;break;case this.bottomRightGrip:case this.topRightGrip:Y.width+ie>this.canvasWidth*this.zoomFactor&&(ie=this.canvasWidth*this.zoomFactor-Y.width),Y.width+=ie}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(ie),Y.height=this.aspectRatio.getVerticalLength(Y.width)):(Y.y+=de,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+=de}Y.width<10&&(Y.x=this.cropRect.x,Y.width=10),Y.height<10&&(Y.y=this.cropRect.y,Y.height=10),this.previousPoint=G,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))},ae.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var G=this.cropRect.x+this.cropRect.width/2,Y=this.cropRect.y+this.cropRect.height/2,ie=this.aspectRatio.getHorizontalLength(this.cropRect.height),de=this.aspectRatio.getVerticalLength(this.cropRect.width);ie/this.canvasWidth<de/this.canvasHeight?this.cropRect.width=ie:this.cropRect.height=de,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=G-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)}},ae.prototype.getRescaledRect=function(G,Y,ie,de,oe,ze){var ft=ie/G,St=de/Y;return{x:(oe.x-ze)*ft+ze,y:(oe.y-ze)*St+ze,width:oe.width*ft,height:oe.height*St}},ae.prototype.scaleCanvas=function(G,Y){var ie=this.getRescaledRect(this.canvasWidth,this.canvasHeight,G,Y,this.cropRect,this.margin);this.canvasWidth=G,this.canvasHeight=Y,this.onCropChange&&this.onCropChange(ie),this.setCropRectangle(ie)},ae}(),yn=function(){function ae(G){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=G,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(ae.prototype,"angle",{get:function(){return this._angle},set:function(G){this._angle=G,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ae.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},ae.prototype.onPointerDown=function(G){this.controlContainer.setPointerCapture(G.pointerId),this.isDragging=!0,this.previousPoint={x:G.clientX,y:G.clientY}},ae.prototype.onPointerMove=function(G){this.isDragging&&(this.onAngleChange&&this.onAngleChange((G.clientX-this.previousPoint.x)/5),this.previousPoint.x=G.clientX)},ae.prototype.onPointerUp=function(G){this.isDragging&&this.onAngleChange&&this.onAngleChange((G.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(G.pointerId)},ae.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var G=this.angleLabelText.getBBox();Tt.setAttributes(this.angleLabelElement,[["x",((this.width-G.width)/2).toString()],["y",(this.height/2).toString()]])}},ae.prototype.positionScaleShape=function(){if(this.scaleShape){var G=this.scaleShape.transform.baseVal.getItem(0);G.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(G,0)}},ae.prototype.getVisual=function(){var G=document.createElementNS("http://www.w3.org/2000/svg","svg");G.setAttribute("xmlns","http://www.w3.org/2000/svg"),G.setAttribute("width",this.width+"px"),G.setAttribute("height",this.height+"px"),G.setAttribute("viewBox","0 0 "+this.width+" "+this.height),G.style.flexShrink="0",document.body.appendChild(G);for(var Y="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ie=1;ie<=this.width/5+10;ie++){var de=ie%5==0?this.height/3:this.height/6;Y+="h4v"+-de+"h1v"+de}Y+="v1H0Z",this.scaleShape=Tt.createPath(Y);var oe=Tt.createTransform();this.scaleShape.transform.baseVal.appendItem(oe),G.appendChild(this.scaleShape),this.angleLabelElement=Tt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Tt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ze=Tt.createTSpan("");return ze.innerHTML="°",this.angleLabelElement.appendChild(ze),G.appendChild(this.angleLabelElement),document.body.removeChild(G),G},ae}(),Vr=function(){function ae(){this.naturalSize=!1,this.imageType="image/png"}return ae.prototype.rasterize=function(G,Y,ie,de,oe,ze,ft){var St=this;return new Promise(function(Ft){var mt=document.createElement("canvas");mt.width=G.width.baseVal.value-2*de,mt.height=G.height.baseVal.value-2*de;var Gt=1,Vt=1;St.naturalSize===!0?(Gt=Y.naturalWidth/(G.width.baseVal.value-2*de)/ze,Vt=Y.naturalHeight/(G.height.baseVal.value-2*de)/ft,mt.width=Y.naturalWidth/ze,mt.height=Y.naturalHeight/ft):St.width!==void 0&&St.height!==void 0&&(Gt=St.width/ie.width,Vt=St.height/ie.height,mt.width*=Gt,mt.height*=Vt);var Hr=mt.getContext("2d");Hr.translate(mt.width/2,mt.height/2),Hr.rotate(oe*Math.PI/180),Hr.scale(ze,ft),Hr.translate(-mt.width/2,-mt.height/2),Hr.drawImage(Y,0,0,mt.width,mt.height);var cn=document.createElement("canvas");cn.width=ie.width*Gt,cn.height=ie.height*Vt,cn.getContext("2d").putImageData(Hr.getImageData((ie.x-de)*Gt,(ie.y-de)*Vt,ie.width*Gt,ie.height*Vt),0,0),Ft(cn.toDataURL(St.imageType,St.imageQuality))})},ae}(),dt=function(){function ae(G){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=ae.instanceCounter++,this.styles=new Ot(this.instanceNo),this.target=G,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(ae.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(G){this._zoomToCropEnabled=G,G?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(G){this._isGridVisible=G,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"gridLines",{get:function(){return this._gridLines},set:function(G){this._gridLines=G,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(G){this._rotationAngle=G,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"aspectRatio",{get:function(){var G;return(G=this._aspectRatio)!==null&&G!==void 0?G:this.aspectRatios[0]},set:function(G){this._aspectRatio=G},enumerable:!1,configurable:!0}),ae.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},ae.prototype.show=function(){this.showUI(),this.open()},ae.prototype.close=function(G){G===void 0&&(G=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),G||this.closeEventListeners.forEach(function(Y){return Y()}),this._isOpen=!1)},ae.prototype.addRenderEventListener=function(G){this.renderEventListeners.push(G)},ae.prototype.removeRenderEventListener=function(G){this.renderEventListeners.indexOf(G)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(G),1)},ae.prototype.addCloseEventListener=function(G){this.closeEventListeners.push(G)},ae.prototype.removeCloseEventListener=function(G){this.closeEventListeners.indexOf(G)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(G),1)},ae.prototype.setupResizeObserver=function(){var G=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){G.resize(G.target.clientWidth,G.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))},ae.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var G=1*this.target.clientWidth/this.target.clientHeight,Y=this.contentDiv.clientWidth/G>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*G:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ie=Y+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/G;this.resize(Y,ie)}},ae.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ae.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Tt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ae.prototype.resize=function(G,Y){this.imageWidth=Math.round(G),this.imageHeight=Math.round(Y),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ae.prototype.setEditingTarget=function(){var G=document.createElement("canvas");G.width=this.target.naturalWidth,G.height=this.target.naturalHeight,G.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var Y=G.toDataURL();Tt.setAttributes(this.editingTarget,[["href",Y]]),this.setEditingTargetSize()},ae.prototype.setTopLeft=function(){var G=this.target.getBoundingClientRect(),Y=this.editorCanvas.getBoundingClientRect();this.left=G.left-Y.left-this.CANVAS_MARGIN,this.top=G.top-Y.top-this.CANVAS_MARGIN},ae.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Tt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Tt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Tt.createGroup(),this.editingTargetRotationScaleContainer=Tt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var G=Tt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(G);var Y=Tt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(Y),this.editingTargetContainer=Tt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ae.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ae.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Tt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Pr(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ae.prototype.zoomToCrop=function(){if(this.cropRect){var G=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,Y=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=G+"px "+Y+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-G+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-Y+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ae.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ae.prototype.cropRectChanged=function(G){this.cropRect=G,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ae.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ae.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"},ae.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ae.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var G=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,Y=this.target.offsetTop>G+this.CANVAS_MARGIN?this.target.offsetTop-(G+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},ae.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ae.prototype.addTopToolbar=function(){var G=this;this.topToolbar=new lr,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var Y=new yt;Y.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(Y);var ie=[];this.aspectRatios.forEach(function(Vt){var Hr=new kt(Wr.getIcon(Vt.horizontal,Vt.vertical),Vt.horizontal===0&&Vt.vertical===0?"FREE":Vt.horizontal+":"+Vt.vertical);Hr.onClick=function(){return G.ratioButtonClicked(Vt)},ie.push(Hr)}),this.aspectRatioButton=new Yt(Wr.getIcon(0,0),"Aspect ratio",ie),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,Y.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var de=new kt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");de.isActive=this.isGridVisible,de.onClick=function(){G.isGridVisible=!G.isGridVisible,de.isActive=G.isGridVisible},Y.addButton(de);var oe=new kt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(oe.isActive=this.zoomToCropEnabled,oe.onClick=function(){G.zoomToCropEnabled=!G.zoomToCropEnabled,oe.isActive=G.zoomToCropEnabled},Y.addButton(oe),!Sr.isLicensed){var ze=new Ct;this.topToolbar.addElementBlock(ze);var ft=document.createElement("div");ft.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var St=document.createElement("a");St.style.color="currentColor",St.href="https://markerjs.com/products/cropro",St.target="_blank",St.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ft.appendChild(St),ze.addElement(ft)}var Ft=new yt;Ft.minWidth=3*this.toolbarHeight+"px",Ft.contentAlign="end",this.topToolbar.addButtonBlock(Ft);var mt=new kt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");mt.onClick=this.startRenderAndClose,Ft.addButton(mt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(mt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Gt=new kt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Gt.onClick=this.close,Ft.addButton(Gt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Gt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ae.prototype.addBottomToolbar=function(){var G=this;this.bottomToolbar=new lr,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var Y=new yt;Y.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(Y);var ie=new kt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ie.onClick=this.rotateLeftButtonClicked,Y.addButton(ie);var de=new kt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");de.onClick=this.rotateRightButtonClicked,Y.addButton(de);var oe=new Ct;oe.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(oe),this.straightener=new yn("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(Ft){G.rotateBy(Ft),G.straightener.angle=G.rotationAngle},oe.addElement(this.straightener.getUI());var ze=new yt;ze.minWidth=2*this.toolbarHeight+"px",ze.contentAlign="end",this.bottomToolbar.addButtonBlock(ze);var ft=new kt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ft.onClick=this.flipHorizontallyButtonClicked,ze.addButton(ft);var St=new kt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");St.onClick=this.flipVerticallyButtonClicked,ze.addButton(St)},ae.prototype.ratioButtonClicked=function(G){this.aspectRatio=G,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ae.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Wr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ae.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ar(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ae.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ae.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ae.prototype.restoreState=function(G){if(G){var Y=this.cropLayer.getRescaledRect(G.width,G.height,this.imageWidth,this.imageHeight,G.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(Y),this.cropRectChanged(Y),this.flippedHorizontally=G.flippedHorizontally,this.flippedVertically=G.flippedVertically,this.applyFlip(),this.rotationAngle=G.rotationAngle,this.applyRotation()}},ae.prototype.clientToLocalCoordinates=function(G,Y){var ie=this.cropImage.getBoundingClientRect();return{x:G-ie.left,y:Y-ie.top}},ae.prototype.onWindowResize=function(){this.positionUI()},ae.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var G=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=G+"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()},ae.prototype.rotateLeftButtonClicked=function(){var G=this.rotationAngle-90;this.rotationAngle%90!=0&&(G+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(G)},ae.prototype.rotateRightButtonClicked=function(){var G=this.rotationAngle+90;this.rotationAngle%90!=0&&(G-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(G)},ae.prototype.rotateTo=function(G){G=(G=G>180?G-360:G)<=-180?G+360:G,this.rotationAngle=G,this.applyRotation()},ae.prototype.rotateBy=function(G){this.rotateTo((this.rotationAngle+G)%360)},ae.prototype.applyRotation=function(){var G=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 ie=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ie.width,this.imageHeight/ie.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=G},ae.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ae.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ae.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ae.prototype.startRenderAndClose=function(){return Ht(this,void 0,void 0,function(){var G,Y;return Mr(this,function(ie){switch(ie.label){case 0:return[4,this.render()];case 1:return G=ie.sent(),Y=this.getState(),this.renderEventListeners.forEach(function(de){return de(G,Y)}),this.close(!0),[2]}})})},ae.prototype.render=function(){return Ht(this,void 0,void 0,function(){var G;return Mr(this,function(Y){switch(Y.label){case 0:return(G=new Vr).naturalSize=this.renderAtNaturalSize,G.imageType=this.renderImageType,G.imageQuality=this.renderImageQuality,G.width=this.renderWidth,G.height=this.renderHeight,this.unzoomFromCrop(),Tt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,G.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,G.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()]}})})},ae.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Bt("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 Bt("toolbar_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Bt("toolbar-block",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: content-box;
|
|
|
`));var G=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Bt("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.toolbarHeight-2*G)+`px;
|
|
|
height: `+(this.toolbarHeight-2*G)+`px;
|
|
|
padding: `+G+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Bt("toolbar_button_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Bt("toolbar_active_button",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
|
`)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Bt("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 Bt("toolbar_dropdown_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Bt("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 Bt("toolbar_straightener",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
height: `+(this.toolbarHeight-2*G)+`px;
|
|
|
padding: `+G+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Bt("toolbar_straightener_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`))},ae.instanceCounter=0,ae}(),At=R("8hTe"),$t=R.n(At),hr=/<pre[^>]*>/g;function vr(ae){var G=document.createElement("div");return G.innerHTML=ae,G.childNodes.length===0?"":G.childNodes[0].nodeValue}var Er=$.a=function(ae){var G=ae.value,Y=G===void 0?"":G,ie=ae.edit,de=ie===void 0?!1:ie,oe=ae.className,ze=ae.showTextOnly,ft=ae.showLines,St=ae.replaces,Ft=ae.zoomImg,mt=ae.hasMask,Gt=ae.style,Vt=Gt===void 0?{}:Gt,Hr=ae.stylesPrev,cn=Hr===void 0?{}:Hr,rn=String(Y),tr=Object(o.useRef)(),$r=Object(o.useRef)(),pr=Object(o.useState)(""),qt=Object(S.a)(pr,2),sr=qt[0],gr=qt[1],en=Object(o.useState)("office"),fn=Object(S.a)(en,2),Sn=fn[0],wi=fn[1],Vi=function(){var ur=new dt($r.current);ur.displayMode="popup",ur.addRenderEventListener(function(){var nn=Object(f.a)(c.a.mark(function Ir(mn){var Nr;return c.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return tr.current.style.display="none",gn.next=3,Object(_e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mn}});case 3:Nr=gn.sent,Nr!=null&&Nr.id&&St($r.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Nr==null?void 0:Nr.id,"?type=").concat(Nr.content_type));case 5:case"end":return gn.stop()}},Ir)}));return function(Ir){return nn.apply(this,arguments)}}()),ur.show()},Ui=function(){var ur=new dr($r.current);ur.settings.displayMode="popup",ur.addEventListener("render",function(){var nn=Object(f.a)(c.a.mark(function Ir(mn){var Nr;return c.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:if(tr.current.style.display="none",!$r.current){gn.next=6;break}return gn.next=4,Object(_e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mn.dataUrl}});case 4:Nr=gn.sent,Nr!=null&&Nr.id&&St($r.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Nr==null?void 0:Nr.id,"?type=").concat(Nr.content_type));case 6:case"end":return gn.stop()}},Ir)}));return function(Ir){return nn.apply(this,arguments)}}()),ur.show(),window.markerArea=ur},Zn=Object(o.useMemo)(function(){try{var Jr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,ur=/\"\/api\/attachments\/|\"\/attachments\/download\//g,nn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;rn=rn.replace(Jr,"("+q.a.API_SERVER+"/api/attachments/").replace(ur,'"'+q.a.API_SERVER+"/api/attachments/").replace(nn,'"'+q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
|
`),rn=rn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
|
`)}catch(fi){}var Ir=K(rn),mn=j();if(rn.match(/\[TOC\]/)&&(Ir=Ir.replace("<p>[TOC]</p>",L()),E()),Ir=Ir.replace(/(__special_katext_id_\d+__)/g,function(fi,gn){var zn=mn[gn],Di=zn.type,yi=zn.expression;return Object(ne.renderToString)(vr(yi)||"",{displayMode:Di==="block",throwOnError:!1,output:"html"})}),Ir=Ir.replace(/▁/g,"\u2581\u2581\u2581"),N(),ze){var Nr=document.createElement("div");return Nr.innerHTML=Ir,Nr.innerText}return setTimeout(function(){return dn()},500),Ir},[rn]),ln=Object(o.useRef)();b.WebkitLineClamp=ft,ft&&(Vt=Object(v.a)(Object(v.a)({},Vt),b));function Ri(Jr){var ur=Jr.target;if(ur.tagName.toUpperCase()==="IMG"){if(Ft){var nn=ur.getAttribute("src");gr(nn),wi("image")}}else if(ur.tagName.toUpperCase()==="A"){var Ir=ur.getAttribute("href");if(Ir.indexOf("office")>-1)Jr.preventDefault(),gr(Ir),wi("office");else if(Ir.indexOf("application/pdf")>-1)Jr.preventDefault(),gr(Ir),wi("pdf");else if(Ir.indexOf("type=text")>-1)Jr.preventDefault(),gr(Ir),wi("html");else if(Ir.startsWith("#")){Jr.preventDefault();var mn=document.getElementById(Ir.replace("#",""));mn&&mn.scrollIntoView(!0)}}}var dn=function(){var ur,nn=(ur=ln.current)===null||ur===void 0?void 0:ur.querySelectorAll("video");nn==null||nn.forEach(function(Ir){if(Ir.oncontextmenu=function(){return!1},Ir.src.indexOf(".m3u8")>-1&&!Ir.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var mn=new H.a;mn.loadSource(Ir.src),mn.attachMedia(Ir)}}})};Object(o.useEffect)(function(){if(ln.current&&Zn&&(Zn.match(hr)&&window.PR.prettyPrint()),ln.current)return ln.current.addEventListener("click",Ri),function(){ln.current.removeEventListener("click",Ri),N(),E()}},[Zn,ln.current,Ri]);var hi=function(ur){if(!de)return;ur.target.nodeName==="IMG"?(tr.current.style.display="flex",tr.current.style.width=ur.target.clientWidth+"px",tr.current.style.height=ur.target.clientHeight+"px",tr.current.style.top=ur.target.offsetTop+"px",tr.current.style.left=ur.target.offsetLeft+"px",$r.current.src=ur.target.getAttribute("src")):tr.current.style.display="none"};return r.a.createElement("div",{style:{position:"relative"}},r.a.createElement("div",{ref:ln,style:Object(v.a)({},Vt),className:"".concat(oe||""," markdown-body ").concat($t.a.mdBody),onMouseOver:hi,dangerouslySetInnerHTML:{__html:Zn}}),r.a.createElement("div",{ref:tr,className:$t.a.button},r.a.createElement(g.a,null,r.a.createElement(D.a,{onClick:function(){return Vi()}},"\u88C1\u526A"),r.a.createElement(D.a,{onClick:function(){return Ui()}},"\u7F16\u8F91"))),r.a.createElement("img",{ref:$r,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),r.a.createElement(te.a,{close:!0,data:sr,hasMask:mt,type:sr!=null&&sr.length?Sn:"",style:Object(v.a)({},cn),onClose:function(){return gr("")}}))}},"9OqN":function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.mode.CTR=function(){var g=M.lib.BlockCipherMode.extend(),T=g.Encryptor=g.extend({processBlock:function(D,v){var f=this._cipher,S=f.blockSize,y=this._iv,c=this._counter;y&&(c=this._counter=y.slice(0),this._iv=void 0);var o=c.slice(0);f.encryptBlock(o,0),c[S-1]=c[S-1]+1|0;for(var r=0;r<S;r++)D[v+r]^=o[r]}});return g.Decryptor=T,g}(),M.mode.CTR})},"9VGf":function(I,$,R){"use strict";R.d($,"a",function(){return T});var M=R("q1tI"),g=R.n(M);function T(D,v){var f=Object(M.useRef)();Object(M.useEffect)(function(){f.current=D}),Object(M.useEffect)(function(){function S(){f.current()}if(v!==null){var y=setInterval(S,v);return function(){return clearInterval(y)}}},[v])}},ALsQ:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.mode.CFB=function(){var g=M.lib.BlockCipherMode.extend();g.Encryptor=g.extend({processBlock:function(D,v){var f=this._cipher,S=f.blockSize;T.call(this,D,v,S,f),this._prevBlock=D.slice(v,v+S)}}),g.Decryptor=g.extend({processBlock:function(D,v){var f=this._cipher,S=f.blockSize,y=D.slice(v,v+S);T.call(this,D,v,S,f),this._prevBlock=y}});function T(D,v,f,S){var y,c=this._iv;c?(y=c.slice(0),this._iv=void 0):y=this._prevBlock,S.encryptBlock(y,0);for(var o=0;o<f;o++)D[v+o]^=y[o]}return g}(),M.mode.CFB})},B7Ph:function(I,$,R){"use strict";R.d($,"a",function(){return P});var M=R("5NDa"),g=R("5rEg"),T=R("+L6B"),D=R("2/Rp"),v=R("2qtc"),f=R("kLXV"),S=R("miYZ"),y=R("tsqr"),c=R("k1fw"),o=R("9og8"),r=R("tJVT"),s=R("oBTY"),d=R("DZo9"),u=R("8z0m"),p=R("WmNS"),m=R.n(p),i=R("q1tI"),t=R.n(i),a=R("Bvq2"),l=R.n(a),E=R("nj2k"),b=R.n(E),h=R("mxV5"),L=R.n(h),O=R("KhGG"),w=R("ErOA"),C=R("7Cbv"),x=R("1vsH"),_=u.a.Dragger,j=function(z){for(var B=function(me){return me&&me.substring(0,me.lastIndexOf("."))},K=Object(s.a)(z),U=0,W=[],H=0;H<K.length;H++){for(var q="",ne=0;ne<W.length;ne++)if(B(W[ne][0].name)==B(K[H].name)){U=1,q=ne;break}if(U==1)W[q].push(K[H]),U=0;else if(U==0){var te=new Array;te.push(K[H]),W.push(te)}}var _e=W.map(function(Ce){if(Ce[0].name.includes(".in"))return Ce.length===2?Ce:[Ce[0],{}];if(Ce[0].name.includes(".out"))return Ce.length===2?Ce.reverse():[{},Ce[0]]});return _e},N=function(z){var B=z.onClose,K=z.onOK,U=z.visible,W=z.wrapClassName,H=z.rootIdentifier,q=Object(i.useState)([]),ne=Object(r.a)(q,2),te=ne[0],_e=ne[1],Ce=Object(i.useState)({}),me=Object(r.a)(Ce,2),Me=me[0],Oe=me[1],he=Object(i.useState)(!1),ce=Object(r.a)(he,2),se=ce[0],Te=ce[1],re=Object(i.useRef)([]),ue=Object(i.useRef)(0),fe=function(){B()};Object(i.useEffect)(function(){ee()},[]),Object(i.useEffect)(function(){U&&(re.current=[],ue.current=0,_e([]))},[U]);var ee=function(){var Je=Object(o.a)(m.a.mark(function Ze(){var rt,tt;return m.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.prev=0,ot.next=3,Object(w.a)("/api/buckets/get_upload_token_for_big_files",{method:"get"});case 3:rt=ot.sent,tt=JSON.parse(Object(O.a)(rt.data)),Oe(tt),ot.next=10;break;case 8:ot.prev=8,ot.t0=ot.catch(0);case 10:case"end":return ot.stop()}},Ze,null,[[0,8]])}));return function(){return Je.apply(this,arguments)}}(),Q=function(Ze){return Ze&&Ze.substring(0,Ze.lastIndexOf("."))},X=function(Ze){var rt,tt,st=Q((rt=Ze[0])===null||rt===void 0?void 0:rt.name)||Q((tt=Ze[1])===null||tt===void 0?void 0:tt.name),ot=te.filter(function(Fe){return Q(Fe.name)!==st});re.current=Object(s.a)(ot),_e(Object(s.a)(ot))},Z=function(Ze){var rt=new L.a({endpoint:Me.end_point,region:Me.region,accessKeyId:Me.access_key_id,accessKeySecret:Me.access_key_secret,bucket:Me.bucket,stsToken:Me.security_token}),tt=Ze.name,st={container_type:"TestSet",file_name:tt},ot=Object(C.a)(),Fe="testsets/".concat(H,"/").concat(ot).concat(tt.indexOf(".")>-1?"."+tt.split(".").pop():"");H===null&&(Fe="testsets/".concat(ot).concat(tt.indexOf(".")>-1?"."+tt.split(".").pop():"")),rt.multipartUpload(Fe,new Blob([Ze.file],{type:Ze.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:tt+""},url:Me==null?void 0:Me.callback_url,host:Me==null?void 0:Me.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(w.e)(st)}}).then(function(Ae){if(Ae.data.status===0){ue.current=ue.current+1;var qe=re.current.map(function($e){var nt,je;if($e.name===((nt=Ae.data)===null||nt===void 0||((je=nt.data)===null||je===void 0)?void 0:je.file_name)){var De,Pe,xe,Se=Object(c.a)({},$e);if((De=Ae.data)!==null&&De!==void 0&&(Pe=De.data)!==null&&Pe!==void 0&&(xe=Pe.file_name)!==null&&xe!==void 0&&xe.includes(".in")){var Le,Ne,et,Xe,ct,gt;Se.in_object_key=(Le=Ae.data)===null||Le===void 0||((Ne=Le.data)===null||Ne===void 0)?void 0:Ne.object,Se.in_object_size=(et=Ae.data)===null||et===void 0||((Xe=et.data)===null||Xe===void 0)?void 0:Xe.size,Se.input=(ct=Ae.data)===null||ct===void 0||((gt=ct.data)===null||gt===void 0)?void 0:gt.file_name,Se.in_file=Ze}else{var wt,vt,Mt,Pt,_t,rr;Se.out_object_key=(wt=Ae.data)===null||wt===void 0||((vt=wt.data)===null||vt===void 0)?void 0:vt.object,Se.out_object_size=(Mt=Ae.data)===null||Mt===void 0||((Pt=Mt.data)===null||Pt===void 0)?void 0:Pt.size,Se.output=(_t=Ae.data)===null||_t===void 0||((rr=_t.data)===null||rr===void 0)?void 0:rr.file_name,Se.out_file=Ze}return Se}return $e});if(re.current=Object(s.a)(qe),_e(Object(s.a)(qe)),ue.current>0&&ue.current===te.length){Te(!1);var ut=j(qe);ut=ut.filter(function($e){var nt,je;return!!((nt=$e[0])!==null&&nt!==void 0&&nt.name&&(je=$e[1])!==null&&je!==void 0&&je.name)}),ut=ut.map(function($e){return Object(c.a)(Object(c.a)(Object(c.a)({},$e[0]),$e[1]),{},{is_file:!0})}),K(ut),B()}}})},ve=function(){if(te.length===0){y.b.warn("\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6");return}Te(!0);var Ze=j(te);if(Ze.some(function(rt){var tt,st;return!((tt=rt[0])!==null&&tt!==void 0&&tt.name&&(st=rt[1])!==null&&st!==void 0&&st.name)})){f.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u4E0A\u4F20\u7684\u6D4B\u8BD5\u7528\u4F8B\u4E2D\u5B58\u5728\u672A\u914D\u5BF9\u7684\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4EC5\u4FDD\u5B58\u5DF2\u914D\u5BF9\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF1F",onOk:function(){var rt=Object(o.a)(m.a.mark(function st(){return m.a.wrap(function(Fe){for(;;)switch(Fe.prev=Fe.next){case 0:te.map(function(){var Ae=Object(o.a)(m.a.mark(function qe(ut){return m.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:Z(ut);case 1:case"end":return nt.stop()}},qe)}));return function(qe){return Ae.apply(this,arguments)}}());case 1:case"end":return Fe.stop()}},st)}));function tt(){return rt.apply(this,arguments)}return tt}(),onCancel:function(){Te(!1)}});return}te.map(function(){var rt=Object(o.a)(m.a.mark(function tt(st){return m.a.wrap(function(Fe){for(;;)switch(Fe.prev=Fe.next){case 0:Z(st);case 1:case"end":return Fe.stop()}},tt)}));return function(tt){return rt.apply(this,arguments)}}())},ye={name:"file",fileList:te,multiple:!0,accept:".in, .out",showUploadList:!1,beforeUpload:function(Ze){if(te!=null&&te.some(function(tt){return tt.name===Ze.name}))return y.b.info("".concat(Ze.name,"\u6587\u4EF6\u5DF2\u5B58\u5728")),!1;if(Ze.size/1024/1024>100)return y.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(Ze.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 rt={name:Ze.name,uid:Ze.uid,file:Ze,percent:0};return te.push(rt),re.current=Object(s.a)(te),_e(Object(s.a)(te)),!1}},Re=j(te);return console.log(te,Re,"fileList"),t.a.createElement(f.a,{visible:U,wrapClassName:W,onOk:ve,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:se},onCancel:fe,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},t.a.createElement("div",{className:l.a.wrap},te.length?t.a.createElement("div",null,t.a.createElement(u.a,ye,t.a.createElement(D.a,{className:l.a.btnS},"\u4E0A\u4F20\u6587\u4EF6")),t.a.createElement(P,{data:Re,onRemove:X})):t.a.createElement("div",{className:l.a.noData},t.a.createElement("img",{src:b.a,alt:""}),t.a.createElement(u.a,ye,t.a.createElement(D.a,{className:l.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),t.a.createElement("div",{className:l.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",t.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",t.a.createElement("br",null),"2\u3001\u8F93\u5165\u8F93\u51FA\u6587\u4EF6\u9700\u6587\u4EF6\u540D\u79F0\u4E00\u4E00\u5BF9\u5E94\uFF0C\u672A\u5BF9\u5E94\u65F6\uFF0C\u5C06\u65E0\u6CD5\u4E0A\u4F20\u3002",t.a.createElement("br",null),"3\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002")))},P=function(z){var B=z.data,K=B===void 0?[]:B,U=z.onRemove,W=z.width,H=W===void 0?"auto":W,q=z.showScore,ne=q===void 0?!1:q,te=z.disabled,_e=te===void 0?!1:te,Ce=z.inputChange,me=function(ce){var se=document.createElement("a");document.body.appendChild(se);var Te=URL.createObjectURL(ce.file);se.href=Te,se.download=ce.name,se.click(),URL.revokeObjectURL(Te),document.body.removeChild(se)},Me=function(ce,se){Object(x.w)(ce,se)},Oe=function(ce,se){f.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:t.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){U(ce,se)},onCancel:function(){}})};return K.length?t.a.createElement("div",{style:{width:H}},t.a.createElement("div",{className:l.a.head},t.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),t.a.createElement("div",{style:{width:ne?"25%":"35%"}},"\u8F93\u5165"),t.a.createElement("div",{style:{width:ne?"25%":"35%"}},"\u8F93\u51FA"),ne&&t.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),t.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),K.map(function(he,ce){var se,Te,re,ue;return t.a.createElement("div",{key:ce,className:l.a.list},t.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",ce+1),t.a.createElement("div",{className:l.a.info,style:{width:ne?"25%":"35%"}},t.a.createElement("span",{title:he.input||((se=he[0])===null||se===void 0?void 0:se.name),onClick:function(){he.input?he.input_file_url?Me(he.input_file_url,he.input):me(he.in_file):me(he[0])}},he.input||((Te=he[0])===null||Te===void 0?void 0:Te.name))),t.a.createElement("div",{className:l.a.info,style:{width:ne?"25%":"35%"}},t.a.createElement("span",{title:he.output||((re=he[1])===null||re===void 0?void 0:re.name),onClick:function(){he.input?he.output_file_url?Me(he.output_file_url,he.output):me(he.out_file):me(he[1])}},he.output||((ue=he[1])===null||ue===void 0?void 0:ue.name))),ne&&t.a.createElement("div",{style:{width:"20%"}},t.a.createElement(g.a,{disabled:_e,style:{width:"70%"},onChange:function(ee){return Ce(ee,ce)},value:he.score}),t.a.createElement("span",null,"\xA0%")),t.a.createElement("div",{onClick:function(){return Oe(he,ce)},style:{width:"10%"}},t.a.createElement("span",{className:l.a.del},"\u5220\u9664")))})):t.a.createElement(t.a.Fragment,null)};$.b=N},BU3w:function(I,$,R){"use strict";R.d($,"a",function(){return f});var M=R("MNnm"),g="rc-util-key";function T(S){if(S.attachTo)return S.attachTo;var y=document.querySelector("head");return y||document.body}function D(S){var y,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(M.a)())return null;var o=document.createElement("style");if((y=c.csp)===null||y===void 0?void 0:y.nonce){var r;o.nonce=(r=c.csp)===null||r===void 0?void 0:r.nonce}o.innerHTML=S;var s=T(c),d=s.firstChild;return c.prepend&&s.prepend?s.prepend(o):c.prepend&&d?s.insertBefore(o,d):s.appendChild(o),o}var v=new Map;function f(S,y){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=T(c);if(!v.has(o)){var r=D("",c),s=r.parentNode;v.set(o,s),s.removeChild(r)}var d=Array.from(v.get(o).children).find(function(t){return t.tagName==="STYLE"&&t[g]===y});if(d){var u,p;if(((u=c.csp)===null||u===void 0?void 0:u.nonce)&&d.nonce!==((p=c.csp)===null||p===void 0?void 0:p.nonce)){var m;d.nonce=(m=c.csp)===null||m===void 0?void 0:m.nonce}return d.innerHTML!==S&&(d.innerHTML=S),d}var i=D(S,c);return i[g]=y,i}},Bd2K:function(I,$,R){(function(M){M(R("VrN/"),R("osHv"))})(function(M){M.defineOption("autoCloseTags",!1,function(c,o,r){if(r!=M.Init&&r&&c.removeKeyMap("autoCloseTags"),!o)return;var s={name:"autoCloseTags"};(typeof o!="object"||o.whenClosing!==!1)&&(s["'/'"]=function(d){return f(d)}),(typeof o!="object"||o.whenOpening!==!1)&&(s["'>'"]=function(d){return D(d)}),c.addKeyMap(s)});var g=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],T=["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 D(c){if(c.getOption("disableInput"))return M.Pass;for(var o=c.listSelections(),r=[],s=c.getOption("autoCloseTags"),d=0;d<o.length;d++){if(!o[d].empty())return M.Pass;var u=o[d].head,p=c.getTokenAt(u),m=M.innerMode(c.getMode(),p.state),i=m.state,t=m.mode.xmlCurrentTag&&m.mode.xmlCurrentTag(i),a=t&&t.name;if(!a)return M.Pass;var l=m.mode.configuration=="html",E=typeof s=="object"&&s.dontCloseTags||l&&g,b=typeof s=="object"&&s.indentTags||l&&T;p.end>u.ch&&(a=a.slice(0,a.length-p.end+u.ch));var h=a.toLowerCase();if(!a||p.type=="string"&&(p.end!=u.ch||!/[\"\']/.test(p.string.charAt(p.string.length-1))||p.string.length==1)||p.type=="tag"&&t.close||p.string.indexOf("/")==u.ch-p.start-1||E&&S(E,h)>-1||y(c,m.mode.xmlCurrentContext&&m.mode.xmlCurrentContext(i)||[],a,u,!0))return M.Pass;var L=typeof s=="object"&&s.emptyTags;if(L&&S(L,a)>-1){r[d]={text:"/>",newPos:M.Pos(u.line,u.ch+2)};continue}var O=b&&S(b,h)>-1;r[d]={indent:O,text:">"+(O?`
|
|
|
|
|
|
`:"")+"</"+a+">",newPos:O?M.Pos(u.line+1,0):M.Pos(u.line,u.ch+1)}}for(var w=typeof s=="object"&&s.dontIndentOnAutoClose,d=o.length-1;d>=0;d--){var C=r[d];c.replaceRange(C.text,o[d].head,o[d].anchor,"+insert");var x=c.listSelections().slice(0);x[d]={head:C.newPos,anchor:C.newPos},c.setSelections(x),!w&&C.indent&&(c.indentLine(C.newPos.line,null,!0),c.indentLine(C.newPos.line+1,null,!0))}}function v(c,o){for(var r=c.listSelections(),s=[],d=o?"/":"</",u=c.getOption("autoCloseTags"),p=typeof u=="object"&&u.dontIndentOnSlash,m=0;m<r.length;m++){if(!r[m].empty())return M.Pass;var i=r[m].head,t=c.getTokenAt(i),a=M.innerMode(c.getMode(),t.state),l=a.state;if(o&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=i.ch-1))return M.Pass;var E,b=a.mode.name!="xml"&&c.getMode().name=="htmlmixed";if(b&&a.mode.name=="javascript")E=d+"script";else if(b&&a.mode.name=="css")E=d+"style";else{var h=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(l);if(!h||h.length&&y(c,h,h[h.length-1],i))return M.Pass;E=d+h[h.length-1]}c.getLine(i.line).charAt(t.end)!=">"&&(E+=">"),s[m]=E}if(c.replaceSelections(s),r=c.listSelections(),!p)for(var m=0;m<r.length;m++)(m==r.length-1||r[m].head.line<r[m+1].head.line)&&c.indentLine(r[m].head.line)}function f(c){return c.getOption("disableInput")?M.Pass:v(c,!0)}M.commands.closeTag=function(c){return v(c)};function S(c,o){if(c.indexOf)return c.indexOf(o);for(var r=0,s=c.length;r<s;++r)if(c[r]==o)return r;return-1}function y(c,o,r,s,d){if(!M.scanForClosingTag)return!1;var u=Math.min(c.lastLine()+1,s.line+500),p=M.scanForClosingTag(c,s,null,u);if(!p||p.tag!=r)return!1;for(var m=d?1:0,i=o.length-1;i>=0&&o[i]==r;i--)++m;s=p.to;for(var i=1;i<m;i++){var t=M.scanForClosingTag(c,s,null,u);if(!t||t.tag!=r)return!1;s=t.to}return!0}})},BjJ7:function(I,$,R){"use strict";R.d($,"d",function(){return g}),R.d($,"c",function(){return T}),R.d($,"e",function(){return D}),R.d($,"b",function(){return v}),R.d($,"a",function(){return S});var M=R("m3rI");function g(y){var c=!0;if(y.length>0){for(var o=0;o<y.length;o++)if(y[o].compile_success==0||!y[o].compile_success){c=!1;break}}else c=!1;return c}function T(y){for(var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=[],r=0;r<y.length;r++){var s=y[r],d=c?"".concat(c,"/").concat(s.name):"".concat(s.name);o.push({title:s.name,isLeaf:!(s.type==="tree"),key:d})}return o}function D(y,c,o){for(var r=0;r<y.length;r++){var s=y[r];if(s.key===c){s.children=o;break}s.children&&D(s.children,c,o)}return y}function v(y,c,o){var r;return function(){var s=this,d=arguments,u=function(){r=null,o||y.apply(s,d)},p=o&&!r;clearTimeout(r),r=setTimeout(u,c),p&&y.apply(s,d)}}var f=!0,S=M.a.API_SERVER},Bvq2:function(I,$,R){I.exports={wrap:"wrap___2zRY4",colorBlue:"colorBlue___XalpT",repeatedName:"repeatedName___2Tfh4",text:"text___1sYHg",noData:"noData___3pdB4",btn:"btn___3WWjB",btnS:"btnS___2M_9t",head:"head____NWmz",list:"list___2fE4M",del:"del___2BO6Y",info:"info___3GJ70"}},"C+DQ":function(I,$,R){},"C/vA":function(I,$,R){"use strict";R.d($,"a",function(){return M});function M(g){var T=this,D=!1,v;return function(){return D||(D=!0,v=g.apply(T,arguments)),v}}},"Cg/j":function(I,$,R){"use strict";R.d($,"b",function(){return M}),R.d($,"a",function(){return g}),R.d($,"c",function(){return D}),R.d($,"d",function(){return v});var M;(function(f){f.serviceIds=new Map,f.DI_TARGET="$di$target",f.DI_DEPENDENCIES="$di$dependencies";function S(y){return y[f.DI_DEPENDENCIES]||[]}f.getServiceDependencies=S})(M||(M={}));var g=D("instantiationService");function T(f,S,y,c){S[M.DI_TARGET]===S?S[M.DI_DEPENDENCIES].push({id:f,index:y,optional:c}):(S[M.DI_DEPENDENCIES]=[{id:f,index:y,optional:c}],S[M.DI_TARGET]=S)}function D(f){if(M.serviceIds.has(f))return M.serviceIds.get(f);var S=function(y,c,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");T(S,y,o,!1)};return S.toString=function(){return f},M.serviceIds.set(f,S),S}function v(f){return function(S,y,c){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");T(f,S,c,!0)}}},CrYA:function(I,$,R){var M=R("MFOe"),g=M.Global;I.exports={name:"sessionStorage",read:D,write:v,each:f,remove:S,clearAll:y};function T(){return g.sessionStorage}function D(c){return T().getItem(c)}function v(c,o){return T().setItem(c,o)}function f(c){for(var o=T().length-1;o>=0;o--){var r=T().key(o);c(D(r),r)}}function S(c){return T().removeItem(c)}function y(){return T().clear()}},DlQD:function(I,$,R){(function(M,g){I.exports=g()})(this,function(){"use strict";function M(je,De){for(var Pe=0;Pe<De.length;Pe++){var xe=De[Pe];xe.enumerable=xe.enumerable||!1,xe.configurable=!0,"value"in xe&&(xe.writable=!0),Object.defineProperty(je,xe.key,xe)}}function g(je,De,Pe){return De&&M(je.prototype,De),Pe&&M(je,Pe),je}function T(je,De){if(!je)return;if(typeof je=="string")return D(je,De);var Pe=Object.prototype.toString.call(je).slice(8,-1);if(Pe==="Object"&&je.constructor&&(Pe=je.constructor.name),Pe==="Map"||Pe==="Set")return Array.from(je);if(Pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Pe))return D(je,De)}function D(je,De){(De==null||De>je.length)&&(De=je.length);for(var Pe=0,xe=new Array(De);Pe<De;Pe++)xe[Pe]=je[Pe];return xe}function v(je,De){var Pe;if(typeof Symbol=="undefined"||je[Symbol.iterator]==null){if(Array.isArray(je)||(Pe=T(je))||De&&je&&typeof je.length=="number"){Pe&&(je=Pe);var xe=0;return function(){return xe>=je.length?{done:!0}:{done:!1,value:je[xe++]}}}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 Pe=je[Symbol.iterator](),Pe.next.bind(Pe)}function f(je,De){return De={exports:{}},je(De,De.exports),De.exports}var S=f(function(je){function De(){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 Pe(xe){je.exports.defaults=xe}je.exports={defaults:De(),getDefaults:De,changeDefaults:Pe}}),y=S.defaults,c=S.getDefaults,o=S.changeDefaults,r=/[&<>"']/,s=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"},m=function(De){return p[De]};function i(je,De){if(De){if(r.test(je))return je.replace(s,m)}else if(d.test(je))return je.replace(u,m);return je}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(je){return je.replace(t,function(De,Pe){return Pe=Pe.toLowerCase(),Pe==="colon"?":":Pe.charAt(0)==="#"?Pe.charAt(1)==="x"?String.fromCharCode(parseInt(Pe.substring(2),16)):String.fromCharCode(+Pe.substring(1)):""})}var l=/(^|[^\[])\^/g;function E(je,De){je=je.source||je,De=De||"";var Pe={replace:function(Se,Le){return Le=Le.source||Le,Le=Le.replace(l,"$1"),je=je.replace(Se,Le),Pe},getRegex:function(){return new RegExp(je,De)}};return Pe}var b=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(je,De,Pe){if(je){var xe;try{xe=decodeURIComponent(a(Pe)).replace(b,"").toLowerCase()}catch(Se){return null}if(xe.indexOf("javascript:")===0||xe.indexOf("vbscript:")===0||xe.indexOf("data:")===0)return null}De&&!h.test(Pe)&&(Pe=_(De,Pe));try{Pe=encodeURI(Pe).replace(/%25/g,"%")}catch(Se){return null}return Pe}var O={},w=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(je,De){O[" "+je]||(w.test(je)?O[" "+je]=je+"/":O[" "+je]=V(je,"/",!0)),je=O[" "+je];var Pe=je.indexOf(":")===-1;return De.substring(0,2)==="//"?Pe?De:je.replace(C,"$1")+De:De.charAt(0)==="/"?Pe?De:je.replace(x,"$1")+De:je+De}var j={exec:function(){}};function N(je){for(var De=1,Pe,xe;De<arguments.length;De++){Pe=arguments[De];for(xe in Pe)Object.prototype.hasOwnProperty.call(Pe,xe)&&(je[xe]=Pe[xe])}return je}function P(je,De){var Pe=je.replace(/\|/g,function(Le,Ne,et){for(var Xe=!1,ct=Ne;--ct>=0&&et[ct]==="\\";)Xe=!Xe;return Xe?"|":" |"}),xe=Pe.split(/ \|/),Se=0;if(xe.length>De)xe.splice(De);else for(;xe.length<De;)xe.push("");for(;Se<xe.length;Se++)xe[Se]=xe[Se].trim().replace(/\\\|/g,"|");return xe}function V(je,De,Pe){var xe=je.length;if(xe===0)return"";for(var Se=0;Se<xe;){var Le=je.charAt(xe-Se-1);if(Le===De&&!Pe)Se++;else if(Le!==De&&Pe)Se++;else break}return je.substr(0,xe-Se)}function z(je,De){if(je.indexOf(De[1])===-1)return-1;for(var Pe=je.length,xe=0,Se=0;Se<Pe;Se++)if(je[Se]==="\\")Se++;else if(je[Se]===De[0])xe++;else if(je[Se]===De[1]&&(xe--,xe<0))return Se;return-1}function B(je){je&&je.sanitize&&!je.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var K={escape:i,unescape:a,edit:E,cleanUrl:L,resolveUrl:_,noopTest:j,merge:N,splitCells:P,rtrim:V,findClosingBracket:z,checkSanitizeDeprecation:B},U=S.defaults,W=K.rtrim,H=K.splitCells,q=K.escape,ne=K.findClosingBracket;function te(je,De,Pe){var xe=De.href,Se=De.title?q(De.title):null,Le=je[1].replace(/\\([\[\]])/g,"$1");return je[0].charAt(0)!=="!"?{type:"link",raw:Pe,href:xe,title:Se,text:Le}:{type:"image",raw:Pe,href:xe,title:Se,text:q(Le)}}function _e(je,De){var Pe=je.match(/^(\s+)(?:```)/);if(Pe===null)return De;var xe=Pe[1];return De.split(`
|
|
|
`).map(function(Se){var Le=Se.match(/^\s+/);if(Le===null)return Se;var Ne=Le[0];return Ne.length>=xe.length?Se.slice(xe.length):Se}).join(`
|
|
|
`)}var Ce=function(){function je(Pe){this.options=Pe||U}var De=je.prototype;return De.space=function(xe){var Se=this.rules.block.newline.exec(xe);if(Se)return Se[0].length>1?{type:"space",raw:Se[0]}:{raw:`
|
|
|
`}},De.code=function(xe,Se){var Le=this.rules.block.code.exec(xe);if(Le){var Ne=Se[Se.length-1];if(Ne&&Ne.type==="paragraph")return{raw:Le[0],text:Le[0].trimRight()};var et=Le[0].replace(/^ {4}/gm,"");return{type:"code",raw:Le[0],codeBlockStyle:"indented",text:this.options.pedantic?et:W(et,`
|
|
|
`)}}},De.fences=function(xe){var Se=this.rules.block.fences.exec(xe);if(Se){var Le=Se[0],Ne=_e(Le,Se[3]||"");return{type:"code",raw:Le,lang:Se[2]?Se[2].trim():Se[2],text:Ne}}},De.heading=function(xe){var Se=this.rules.block.heading.exec(xe);if(Se)return{type:"heading",raw:Se[0],depth:Se[1].length,text:Se[2]}},De.nptable=function(xe){var Se=this.rules.block.nptable.exec(xe);if(Se){var Le={type:"table",header:H(Se[1].replace(/^ *| *\| *$/g,"")),align:Se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Se[3]?Se[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:Se[0]};if(Le.header.length===Le.align.length){var Ne=Le.align.length,et;for(et=0;et<Ne;et++)/^ *-+: *$/.test(Le.align[et])?Le.align[et]="right":/^ *:-+: *$/.test(Le.align[et])?Le.align[et]="center":/^ *:-+ *$/.test(Le.align[et])?Le.align[et]="left":Le.align[et]=null;for(Ne=Le.cells.length,et=0;et<Ne;et++)Le.cells[et]=H(Le.cells[et],Le.header.length);return Le}}},De.hr=function(xe){var Se=this.rules.block.hr.exec(xe);if(Se)return{type:"hr",raw:Se[0]}},De.blockquote=function(xe){var Se=this.rules.block.blockquote.exec(xe);if(Se){var Le=Se[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Se[0],text:Le}}},De.list=function(xe){var Se=this.rules.block.list.exec(xe);if(Se){for(var Le=Se[0],Ne=Se[2],et=Ne.length>1,Xe=Ne[Ne.length-1]===")",ct={type:"list",raw:Le,ordered:et,start:et?+Ne.slice(0,-1):"",loose:!1,items:[]},gt=Se[0].match(this.rules.block.item),wt=!1,vt,Mt,Pt,_t,rr,dr,Zt,fr=gt.length,Ht=0;Ht<fr;Ht++)vt=gt[Ht],Le=vt,Mt=vt.length,vt=vt.replace(/^ *([*+-]|\d+[.)]) */,""),~vt.indexOf(`
|
|
|
`)&&(Mt-=vt.length,vt=this.options.pedantic?vt.replace(/^ {1,4}/gm,""):vt.replace(new RegExp("^ {1,"+Mt+"}","gm"),"")),Ht!==fr-1&&(Pt=this.rules.block.bullet.exec(gt[Ht+1])[0],(et?Pt.length===1||!Xe&&Pt[Pt.length-1]===")":Pt.length>1||this.options.smartLists&&Pt!==Ne)&&(_t=gt.slice(Ht+1).join(`
|
|
|
`),ct.raw=ct.raw.substring(0,ct.raw.length-_t.length),Ht=fr-1)),rr=wt||/\n\n(?!\s*$)/.test(vt),Ht!==fr-1&&(wt=vt.charAt(vt.length-1)===`
|
|
|
`,rr||(rr=wt)),rr&&(ct.loose=!0),dr=/^\[[ xX]\] /.test(vt),Zt=void 0,dr&&(Zt=vt[1]!==" ",vt=vt.replace(/^\[[ xX]\] +/,"")),ct.items.push({type:"list_item",raw:Le,task:dr,checked:Zt,loose:rr,text:vt});return ct}},De.html=function(xe){var Se=this.rules.block.html.exec(xe);if(Se)return{type:this.options.sanitize?"paragraph":"html",raw:Se[0],pre:!this.options.sanitizer&&(Se[1]==="pre"||Se[1]==="script"||Se[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Se[0]):q(Se[0]):Se[0]}},De.def=function(xe){var Se=this.rules.block.def.exec(xe);if(Se){Se[3]&&(Se[3]=Se[3].substring(1,Se[3].length-1));var Le=Se[1].toLowerCase().replace(/\s+/g," ");return{tag:Le,raw:Se[0],href:Se[2],title:Se[3]}}},De.table=function(xe){var Se=this.rules.block.table.exec(xe);if(Se){var Le={type:"table",header:H(Se[1].replace(/^ *| *\| *$/g,"")),align:Se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Se[3]?Se[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(Le.header.length===Le.align.length){Le.raw=Se[0];var Ne=Le.align.length,et;for(et=0;et<Ne;et++)/^ *-+: *$/.test(Le.align[et])?Le.align[et]="right":/^ *:-+: *$/.test(Le.align[et])?Le.align[et]="center":/^ *:-+ *$/.test(Le.align[et])?Le.align[et]="left":Le.align[et]=null;for(Ne=Le.cells.length,et=0;et<Ne;et++)Le.cells[et]=H(Le.cells[et].replace(/^ *\| *| *\| *$/g,""),Le.header.length);return Le}}},De.lheading=function(xe){var Se=this.rules.block.lheading.exec(xe);if(Se)return{type:"heading",raw:Se[0],depth:Se[2].charAt(0)==="="?1:2,text:Se[1]}},De.paragraph=function(xe){var Se=this.rules.block.paragraph.exec(xe);if(Se)return{type:"paragraph",raw:Se[0],text:Se[1].charAt(Se[1].length-1)===`
|
|
|
`?Se[1].slice(0,-1):Se[1]}},De.text=function(xe,Se){var Le=this.rules.block.text.exec(xe);if(Le){var Ne=Se[Se.length-1];return Ne&&Ne.type==="text"?{raw:Le[0],text:Le[0]}:{type:"text",raw:Le[0],text:Le[0]}}},De.escape=function(xe){var Se=this.rules.inline.escape.exec(xe);if(Se)return{type:"escape",raw:Se[0],text:q(Se[1])}},De.tag=function(xe,Se,Le){var Ne=this.rules.inline.tag.exec(xe);if(Ne)return!Se&&/^<a /i.test(Ne[0])?Se=!0:Se&&/^<\/a>/i.test(Ne[0])&&(Se=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ne[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ne[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:Ne[0],inLink:Se,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ne[0]):q(Ne[0]):Ne[0]}},De.link=function(xe){var Se=this.rules.inline.link.exec(xe);if(Se){var Le=ne(Se[2],"()");if(Le>-1){var Ne=Se[0].indexOf("!")===0?5:4,et=Ne+Se[1].length+Le;Se[2]=Se[2].substring(0,Le),Se[0]=Se[0].substring(0,et).trim(),Se[3]=""}var Xe=Se[2],ct="";if(this.options.pedantic){var gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Xe);gt?(Xe=gt[1],ct=gt[3]):ct=""}else ct=Se[3]?Se[3].slice(1,-1):"";Xe=Xe.trim().replace(/^<([\s\S]*)>$/,"$1");var wt=te(Se,{href:Xe&&Xe.replace(this.rules.inline._escapes,"$1"),title:ct&&ct.replace(this.rules.inline._escapes,"$1")},Se[0]);return wt}},De.reflink=function(xe,Se){var Le;if((Le=this.rules.inline.reflink.exec(xe))||(Le=this.rules.inline.nolink.exec(xe))){var Ne=(Le[2]||Le[1]).replace(/\s+/g," ");if(Ne=Se[Ne.toLowerCase()],!Ne||!Ne.href){var et=Le[0].charAt(0);return{type:"text",raw:et,text:et}}var Xe=te(Le,Ne,Le[0]);return Xe}},De.strong=function(xe,Se,Le){Le===void 0&&(Le="");var Ne=this.rules.inline.strong.start.exec(xe);if(Ne&&(!Ne[1]||Ne[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Se=Se.slice(-1*xe.length);var et=Ne[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;et.lastIndex=0;for(var Xe;(Ne=et.exec(Se))!=null;)if(Xe=this.rules.inline.strong.middle.exec(Se.slice(0,Ne.index+3)),Xe)return{type:"strong",raw:xe.slice(0,Xe[0].length),text:xe.slice(2,Xe[0].length-2)}}},De.em=function(xe,Se,Le){Le===void 0&&(Le="");var Ne=this.rules.inline.em.start.exec(xe);if(Ne&&(!Ne[1]||Ne[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Se=Se.slice(-1*xe.length);var et=Ne[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;et.lastIndex=0;for(var Xe;(Ne=et.exec(Se))!=null;)if(Xe=this.rules.inline.em.middle.exec(Se.slice(0,Ne.index+2)),Xe)return{type:"em",raw:xe.slice(0,Xe[0].length),text:xe.slice(1,Xe[0].length-1)}}},De.codespan=function(xe){var Se=this.rules.inline.code.exec(xe);if(Se){var Le=Se[2].replace(/\n/g," "),Ne=/[^ ]/.test(Le),et=Le.startsWith(" ")&&Le.endsWith(" ");return Ne&&et&&(Le=Le.substring(1,Le.length-1)),Le=q(Le,!0),{type:"codespan",raw:Se[0],text:Le}}},De.br=function(xe){var Se=this.rules.inline.br.exec(xe);if(Se)return{type:"br",raw:Se[0]}},De.del=function(xe){var Se=this.rules.inline.del.exec(xe);if(Se)return{type:"del",raw:Se[0],text:Se[1]}},De.autolink=function(xe,Se){var Le=this.rules.inline.autolink.exec(xe);if(Le){var Ne,et;return Le[2]==="@"?(Ne=q(this.options.mangle?Se(Le[1]):Le[1]),et="mailto:"+Ne):(Ne=q(Le[1]),et=Ne),{type:"link",raw:Le[0],text:Ne,href:et,tokens:[{type:"text",raw:Ne,text:Ne}]}}},De.url=function(xe,Se){var Le;if(Le=this.rules.inline.url.exec(xe)){var Ne,et;if(Le[2]==="@")Ne=q(this.options.mangle?Se(Le[0]):Le[0]),et="mailto:"+Ne;else{var Xe;do Xe=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0];while(Xe!==Le[0]);Ne=q(Le[0]),Le[1]==="www."?et="http://"+Ne:et=Ne}return{type:"link",raw:Le[0],text:Ne,href:et,tokens:[{type:"text",raw:Ne,text:Ne}]}}},De.inlineText=function(xe,Se,Le){var Ne=this.rules.inline.text.exec(xe);if(Ne){var et;return Se?et=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ne[0]):q(Ne[0]):Ne[0]:et=q(this.options.smartypants?Le(Ne[0]):Ne[0]),{type:"text",raw:Ne[0],text:et}}},je}(),me=K.noopTest,Me=K.edit,Oe=K.merge,he={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:me,table:me,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=Me(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=Me(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=Me(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=/<!--(?!-?>)[\s\S]*?-->/,he.html=Me(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=Me(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.blockquote=Me(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Oe({},he),he.gfm=Oe({},he.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*|$)"}),he.gfm.nptable=Me(he.gfm.nptable).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.gfm.table=Me(he.gfm.table).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.pedantic=Oe({},he.normal,{html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:me,paragraph:Me(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:me,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:me,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ce.punctuation=Me(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=Me(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=Me(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=Me(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=Me(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=Me(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=Me(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=Me(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=Me(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=Me(ce._blockSkip,"g").getRegex(),ce.overlapSkip=Me(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ce.autolink=Me(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=Me(ce.tag).replace("comment",he._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=Me(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=Me(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=Me(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=Oe({},ce),ce.pedantic=Oe({},ce.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=Oe({},ce.normal,{escape:Me(ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ce.gfm.url=Me(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=Oe({},ce.gfm,{br:Me(ce.br).replace("{2,}","*").getRegex(),text:Me(ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var se={block:he,inline:ce},Te=S.defaults,re=se.block,ue=se.inline;function fe(je){return je.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ee(je){var De="",Pe,xe,Se=je.length;for(Pe=0;Pe<Se;Pe++)xe=je.charCodeAt(Pe),Math.random()>.5&&(xe="x"+xe.toString(16)),De+="&#"+xe+";";return De}var Q=function(){function je(Pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=Pe||Te,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var xe={block:re.normal,inline:ue.normal};this.options.pedantic?(xe.block=re.pedantic,xe.inline=ue.pedantic):this.options.gfm&&(xe.block=re.gfm,this.options.breaks?xe.inline=ue.breaks:xe.inline=ue.gfm),this.tokenizer.rules=xe}je.lex=function(xe,Se){var Le=new je(Se);return Le.lex(xe)};var De=je.prototype;return De.lex=function(xe){return xe=xe.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(xe,this.tokens,!0),this.inline(this.tokens),this.tokens},De.blockTokens=function(xe,Se,Le){Se===void 0&&(Se=[]),Le===void 0&&(Le=!0),xe=xe.replace(/^ +$/gm,"");for(var Ne,et,Xe,ct;xe;){if(Ne=this.tokenizer.space(xe)){xe=xe.substring(Ne.raw.length),Ne.type&&Se.push(Ne);continue}if(Ne=this.tokenizer.code(xe,Se)){xe=xe.substring(Ne.raw.length),Ne.type?Se.push(Ne):(ct=Se[Se.length-1],ct.raw+=`
|
|
|
`+Ne.raw,ct.text+=`
|
|
|
`+Ne.text);continue}if(Ne=this.tokenizer.fences(xe)){xe=xe.substring(Ne.raw.length),Se.push(Ne);continue}if(Ne=this.tokenizer.heading(xe)){xe=xe.substring(Ne.raw.length),Se.push(Ne);continue}if(Ne=this.tokenizer.nptable(xe)){xe=xe.substring(Ne.raw.length),Se.push(Ne);continue}if(Ne=this.tokenizer.hr(xe)){xe=xe.substring(Ne.raw.length),Se.push(Ne);continue}if(Ne=this.tokenizer.blockquote(xe)){xe=xe.substring(Ne.raw.length),Ne.tokens=this.blockTokens(Ne.text,[],Le),Se.push(Ne);continue}if(Ne=this.tokenizer.list(xe)){for(xe=xe.substring(Ne.raw.length),Xe=Ne.items.length,et=0;et<Xe;et++)Ne.items[et].tokens=this.blockTokens(Ne.items[et].text,[],!1);Se.push(Ne);continue}if(Ne=this.tokenizer.html(xe)){xe=xe.substring(Ne.raw.length),Se.push(Ne);continue}if(Le&&(Ne=this.tokenizer.def(xe))){xe=xe.substring(Ne.raw.length),this.tokens.links[Ne.tag]||(this.tokens.links[Ne.tag]={href:Ne.href,title:Ne.title});continue}if(Ne=this.tokenizer.table(xe)){xe=xe.substring(Ne.raw.length),Se.push(Ne);continue}if(Ne=this.tokenizer.lheading(xe)){xe=xe.substring(Ne.raw.length),Se.push(Ne);continue}if(Le&&(Ne=this.tokenizer.paragraph(xe))){xe=xe.substring(Ne.raw.length),Se.push(Ne);continue}if(Ne=this.tokenizer.text(xe,Se)){xe=xe.substring(Ne.raw.length),Ne.type?Se.push(Ne):(ct=Se[Se.length-1],ct.raw+=`
|
|
|
`+Ne.raw,ct.text+=`
|
|
|
`+Ne.text);continue}if(xe){var gt="Infinite loop on byte: "+xe.charCodeAt(0);if(this.options.silent){console.error(gt);break}else throw new Error(gt)}}return Se},De.inline=function(xe){var Se,Le,Ne,et,Xe,ct,gt=xe.length;for(Se=0;Se<gt;Se++){ct=xe[Se];switch(ct.type){case"paragraph":case"text":case"heading":{ct.tokens=[],this.inlineTokens(ct.text,ct.tokens);break}case"table":{for(ct.tokens={header:[],cells:[]},et=ct.header.length,Le=0;Le<et;Le++)ct.tokens.header[Le]=[],this.inlineTokens(ct.header[Le],ct.tokens.header[Le]);for(et=ct.cells.length,Le=0;Le<et;Le++)for(Xe=ct.cells[Le],ct.tokens.cells[Le]=[],Ne=0;Ne<Xe.length;Ne++)ct.tokens.cells[Le][Ne]=[],this.inlineTokens(Xe[Ne],ct.tokens.cells[Le][Ne]);break}case"blockquote":{this.inline(ct.tokens);break}case"list":{for(et=ct.items.length,Le=0;Le<et;Le++)this.inline(ct.items[Le].tokens);break}}}return xe},De.inlineTokens=function(xe,Se,Le,Ne,et){Se===void 0&&(Se=[]),Le===void 0&&(Le=!1),Ne===void 0&&(Ne=!1),et===void 0&&(et="");var Xe,ct=xe,gt;if(this.tokens.links){var wt=Object.keys(this.tokens.links);if(wt.length>0)for(;(gt=this.tokenizer.rules.inline.reflinkSearch.exec(ct))!=null;)wt.includes(gt[0].slice(gt[0].lastIndexOf("[")+1,-1))&&(ct=ct.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(gt=this.tokenizer.rules.inline.blockSkip.exec(ct))!=null;)ct=ct.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;xe;){if(Xe=this.tokenizer.escape(xe)){xe=xe.substring(Xe.raw.length),Se.push(Xe);continue}if(Xe=this.tokenizer.tag(xe,Le,Ne)){xe=xe.substring(Xe.raw.length),Le=Xe.inLink,Ne=Xe.inRawBlock,Se.push(Xe);continue}if(Xe=this.tokenizer.link(xe)){xe=xe.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,Ne)),Se.push(Xe);continue}if(Xe=this.tokenizer.reflink(xe,this.tokens.links)){xe=xe.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,Ne)),Se.push(Xe);continue}if(Xe=this.tokenizer.strong(xe,ct,et)){xe=xe.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],Le,Ne),Se.push(Xe);continue}if(Xe=this.tokenizer.em(xe,ct,et)){xe=xe.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],Le,Ne),Se.push(Xe);continue}if(Xe=this.tokenizer.codespan(xe)){xe=xe.substring(Xe.raw.length),Se.push(Xe);continue}if(Xe=this.tokenizer.br(xe)){xe=xe.substring(Xe.raw.length),Se.push(Xe);continue}if(Xe=this.tokenizer.del(xe)){xe=xe.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],Le,Ne),Se.push(Xe);continue}if(Xe=this.tokenizer.autolink(xe,ee)){xe=xe.substring(Xe.raw.length),Se.push(Xe);continue}if(!Le&&(Xe=this.tokenizer.url(xe,ee))){xe=xe.substring(Xe.raw.length),Se.push(Xe);continue}if(Xe=this.tokenizer.inlineText(xe,Ne,fe)){xe=xe.substring(Xe.raw.length),et=Xe.raw.slice(-1),Se.push(Xe);continue}if(xe){var vt="Infinite loop on byte: "+xe.charCodeAt(0);if(this.options.silent){console.error(vt);break}else throw new Error(vt)}}return Se},g(je,null,[{key:"rules",get:function(){return{block:re,inline:ue}}}]),je}(),X=S.defaults,Z=K.cleanUrl,ve=K.escape,ye=function(){function je(Pe){this.options=Pe||X}var De=je.prototype;return De.code=function(xe,Se,Le){var Ne=(Se||"").match(/\S*/)[0];if(this.options.highlight){var et=this.options.highlight(xe,Ne);et!=null&&et!==xe&&(Le=!0,xe=et)}return Ne?'<pre><code class="'+this.options.langPrefix+ve(Ne,!0)+'">'+(Le?xe:ve(xe,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Le?xe:ve(xe,!0))+`</code></pre>
|
|
|
`},De.blockquote=function(xe){return`<blockquote>
|
|
|
`+xe+`</blockquote>
|
|
|
`},De.html=function(xe){return xe},De.heading=function(xe,Se,Le,Ne){return this.options.headerIds?"<h"+Se+' id="'+this.options.headerPrefix+Ne.slug(Le)+'">'+xe+"</h"+Se+`>
|
|
|
`:"<h"+Se+">"+xe+"</h"+Se+`>
|
|
|
`},De.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},De.list=function(xe,Se,Le){var Ne=Se?"ol":"ul",et=Se&&Le!==1?' start="'+Le+'"':"";return"<"+Ne+et+`>
|
|
|
`+xe+"</"+Ne+`>
|
|
|
`},De.listitem=function(xe){return"<li>"+xe+`</li>
|
|
|
`},De.checkbox=function(xe){return"<input "+(xe?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},De.paragraph=function(xe){return"<p>"+xe+`</p>
|
|
|
`},De.table=function(xe,Se){return Se&&(Se="<tbody>"+Se+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+xe+`</thead>
|
|
|
`+Se+`</table>
|
|
|
`},De.tablerow=function(xe){return`<tr>
|
|
|
`+xe+`</tr>
|
|
|
`},De.tablecell=function(xe,Se){var Le=Se.header?"th":"td",Ne=Se.align?"<"+Le+' align="'+Se.align+'">':"<"+Le+">";return Ne+xe+"</"+Le+`>
|
|
|
`},De.strong=function(xe){return"<strong>"+xe+"</strong>"},De.em=function(xe){return"<em>"+xe+"</em>"},De.codespan=function(xe){return"<code>"+xe+"</code>"},De.br=function(){return this.options.xhtml?"<br/>":"<br>"},De.del=function(xe){return"<del>"+xe+"</del>"},De.link=function(xe,Se,Le){if(xe=Z(this.options.sanitize,this.options.baseUrl,xe),xe===null)return Le;var Ne='<a href="'+ve(xe)+'"';return Se&&(Ne+=' title="'+Se+'"'),Ne+=">"+Le+"</a>",Ne},De.image=function(xe,Se,Le){if(xe=Z(this.options.sanitize,this.options.baseUrl,xe),xe===null)return Le;var Ne='<img src="'+xe+'" alt="'+Le+'"';return Se&&(Ne+=' title="'+Se+'"'),Ne+=this.options.xhtml?"/>":">",Ne},De.text=function(xe){return xe},je}(),Re=function(){function je(){}var De=je.prototype;return De.strong=function(xe){return xe},De.em=function(xe){return xe},De.codespan=function(xe){return xe},De.del=function(xe){return xe},De.html=function(xe){return xe},De.text=function(xe){return xe},De.link=function(xe,Se,Le){return""+Le},De.image=function(xe,Se,Le){return""+Le},De.br=function(){return""},je}(),Je=function(){function je(){this.seen={}}var De=je.prototype;return De.slug=function(xe){var Se=xe.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Se)){var Le=Se;do this.seen[Le]++,Se=Le+"-"+this.seen[Le];while(this.seen.hasOwnProperty(Se))}return this.seen[Se]=0,Se},je}(),Ze=S.defaults,rt=K.unescape,tt=function(){function je(Pe){this.options=Pe||Ze,this.options.renderer=this.options.renderer||new ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Re,this.slugger=new Je}je.parse=function(xe,Se){var Le=new je(Se);return Le.parse(xe)};var De=je.prototype;return De.parse=function(xe,Se){Se===void 0&&(Se=!0);var Le="",Ne,et,Xe,ct,gt,wt,vt,Mt,Pt,_t,rr,dr,Zt,fr,Ht,Mr,Sr,Tt,Ot=xe.length;for(Ne=0;Ne<Ot;Ne++){_t=xe[Ne];switch(_t.type){case"space":continue;case"hr":{Le+=this.renderer.hr();continue}case"heading":{Le+=this.renderer.heading(this.parseInline(_t.tokens),_t.depth,rt(this.parseInline(_t.tokens,this.textRenderer)),this.slugger);continue}case"code":{Le+=this.renderer.code(_t.text,_t.lang,_t.escaped);continue}case"table":{for(Mt="",vt="",ct=_t.header.length,et=0;et<ct;et++)vt+=this.renderer.tablecell(this.parseInline(_t.tokens.header[et]),{header:!0,align:_t.align[et]});for(Mt+=this.renderer.tablerow(vt),Pt="",ct=_t.cells.length,et=0;et<ct;et++){for(wt=_t.tokens.cells[et],vt="",gt=wt.length,Xe=0;Xe<gt;Xe++)vt+=this.renderer.tablecell(this.parseInline(wt[Xe]),{header:!1,align:_t.align[Xe]});Pt+=this.renderer.tablerow(vt)}Le+=this.renderer.table(Mt,Pt);continue}case"blockquote":{Pt=this.parse(_t.tokens),Le+=this.renderer.blockquote(Pt);continue}case"list":{for(rr=_t.ordered,dr=_t.start,Zt=_t.loose,ct=_t.items.length,Pt="",et=0;et<ct;et++)Ht=_t.items[et],Mr=Ht.checked,Sr=Ht.task,fr="",Ht.task&&(Tt=this.renderer.checkbox(Mr),Zt?Ht.tokens.length>0&&Ht.tokens[0].type==="text"?(Ht.tokens[0].text=Tt+" "+Ht.tokens[0].text,Ht.tokens[0].tokens&&Ht.tokens[0].tokens.length>0&&Ht.tokens[0].tokens[0].type==="text"&&(Ht.tokens[0].tokens[0].text=Tt+" "+Ht.tokens[0].tokens[0].text)):Ht.tokens.unshift({type:"text",text:Tt}):fr+=Tt),fr+=this.parse(Ht.tokens,Zt),Pt+=this.renderer.listitem(fr,Sr,Mr);Le+=this.renderer.list(Pt,rr,dr);continue}case"html":{Le+=this.renderer.html(_t.text);continue}case"paragraph":{Le+=this.renderer.paragraph(this.parseInline(_t.tokens));continue}case"text":{for(Pt=_t.tokens?this.parseInline(_t.tokens):_t.text;Ne+1<Ot&&xe[Ne+1].type==="text";)_t=xe[++Ne],Pt+=`
|
|
|
`+(_t.tokens?this.parseInline(_t.tokens):_t.text);Le+=Se?this.renderer.paragraph(Pt):Pt;continue}default:{var Rt='Token with "'+_t.type+'" type was not found.';if(this.options.silent){console.error(Rt);return}else throw new Error(Rt)}}}return Le},De.parseInline=function(xe,Se){Se=Se||this.renderer;var Le="",Ne,et,Xe=xe.length;for(Ne=0;Ne<Xe;Ne++){et=xe[Ne];switch(et.type){case"escape":{Le+=Se.text(et.text);break}case"html":{Le+=Se.html(et.text);break}case"link":{Le+=Se.link(et.href,et.title,this.parseInline(et.tokens,Se));break}case"image":{Le+=Se.image(et.href,et.title,et.text);break}case"strong":{Le+=Se.strong(this.parseInline(et.tokens,Se));break}case"em":{Le+=Se.em(this.parseInline(et.tokens,Se));break}case"codespan":{Le+=Se.codespan(et.text);break}case"br":{Le+=Se.br();break}case"del":{Le+=Se.del(this.parseInline(et.tokens,Se));break}case"text":{Le+=Se.text(et.text);break}default:{var ct='Token with "'+et.type+'" type was not found.';if(this.options.silent){console.error(ct);return}else throw new Error(ct)}}}return Le},je}(),st=K.merge,ot=K.checkSanitizeDeprecation,Fe=K.escape,Ae=S.getDefaults,qe=S.changeDefaults,ut=S.defaults;function $e(je,De,Pe){if(typeof je=="undefined"||je===null)throw new Error("marked(): input parameter is undefined or null");if(typeof je!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(je)+", string expected");if(typeof De=="function"&&(Pe=De,De=null),De=st({},$e.defaults,De||{}),ot(De),Pe){var xe=De.highlight,Se;try{Se=Q.lex(je,De)}catch(Xe){return Pe(Xe)}var Le=function(ct){var gt;if(!ct)try{gt=tt.parse(Se,De)}catch(wt){ct=wt}return De.highlight=xe,ct?Pe(ct):Pe(null,gt)};if(!xe||xe.length<3)return Le();if(delete De.highlight,!Se.length)return Le();var Ne=0;$e.walkTokens(Se,function(Xe){Xe.type==="code"&&(Ne++,setTimeout(function(){xe(Xe.text,Xe.lang,function(ct,gt){if(ct)return Le(ct);gt!=null&>!==Xe.text&&(Xe.text=gt,Xe.escaped=!0),Ne--,Ne===0&&Le()})},0))}),Ne===0&&Le();return}try{var et=Q.lex(je,De);return De.walkTokens&&$e.walkTokens(et,De.walkTokens),tt.parse(et,De)}catch(Xe){if(Xe.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,De.silent)return"<p>An error occurred:</p><pre>"+Fe(Xe.message+"",!0)+"</pre>";throw Xe}}$e.options=$e.setOptions=function(je){return st($e.defaults,je),qe($e.defaults),$e},$e.getDefaults=Ae,$e.defaults=ut,$e.use=function(je){var De=st({},je);if(je.renderer&&function(){var xe=$e.defaults.renderer||new ye,Se=function(et){var Xe=xe[et];xe[et]=function(){for(var ct=arguments.length,gt=new Array(ct),wt=0;wt<ct;wt++)gt[wt]=arguments[wt];var vt=je.renderer[et].apply(xe,gt);return vt===!1&&(vt=Xe.apply(xe,gt)),vt}};for(var Le in je.renderer)Se(Le);De.renderer=xe}(),je.tokenizer&&function(){var xe=$e.defaults.tokenizer||new Ce,Se=function(et){var Xe=xe[et];xe[et]=function(){for(var ct=arguments.length,gt=new Array(ct),wt=0;wt<ct;wt++)gt[wt]=arguments[wt];var vt=je.tokenizer[et].apply(xe,gt);return vt===!1&&(vt=Xe.apply(xe,gt)),vt}};for(var Le in je.tokenizer)Se(Le);De.tokenizer=xe}(),je.walkTokens){var Pe=$e.defaults.walkTokens;De.walkTokens=function(xe){je.walkTokens(xe),Pe&&Pe(xe)}}$e.setOptions(De)},$e.walkTokens=function(je,De){for(var Pe=v(je),xe;!(xe=Pe()).done;){var Se=xe.value;De(Se);switch(Se.type){case"table":{for(var Le=v(Se.tokens.header),Ne;!(Ne=Le()).done;){var et=Ne.value;$e.walkTokens(et,De)}for(var Xe=v(Se.tokens.cells),ct;!(ct=Xe()).done;)for(var gt=ct.value,wt=v(gt),vt;!(vt=wt()).done;){var Mt=vt.value;$e.walkTokens(Mt,De)}break}case"list":{$e.walkTokens(Se.items,De);break}default:Se.tokens&&$e.walkTokens(Se.tokens,De)}}},$e.Parser=tt,$e.parser=tt.parse,$e.Renderer=ye,$e.TextRenderer=Re,$e.Lexer=Q,$e.lexer=Q.lex,$e.Tokenizer=Ce,$e.Slugger=Je,$e.parse=$e;var nt=$e;return nt})},"DlR+":function(I,$,R){var M=R("MFOe"),g=M.Global,T=M.trim;I.exports={name:"cookieStorage",read:v,write:S,each:f,remove:y,clearAll:c};var D=g.document;function v(r){if(!r||!o(r))return null;var s="(?:^|.*;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(D.cookie.replace(new RegExp(s),"$1"))}function f(r){for(var s=D.cookie.split(/; ?/g),d=s.length-1;d>=0;d--){if(!T(s[d]))continue;var u=s[d].split("="),p=unescape(u[0]),m=unescape(u[1]);r(m,p)}}function S(r,s){if(!r)return;D.cookie=escape(r)+"="+escape(s)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function y(r){if(!r||!o(r))return;D.cookie=escape(r)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function c(){f(function(r,s){y(s)})}function o(r){return new RegExp("(?:^|;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(D.cookie)}},E4JC:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("ETIr"),R("cv67"),R("K3mO"),R("OLod"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.StreamCipher,v=g.algo,f=[],S=[],y=[],c=v.Rabbit=D.extend({_doReset:function(){for(var r=this._key.words,s=this.cfg.iv,d=0;d<4;d++)r[d]=(r[d]<<8|r[d]>>>24)&16711935|(r[d]<<24|r[d]>>>8)&4278255360;var u=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],p=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 d=0;d<4;d++)o.call(this);for(var d=0;d<8;d++)p[d]^=u[d+4&7];if(s){var m=s.words,i=m[0],t=m[1],a=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,l=(t<<8|t>>>24)&16711935|(t<<24|t>>>8)&4278255360,E=a>>>16|l&4294901760,b=l<<16|a&65535;p[0]^=a,p[1]^=E,p[2]^=l,p[3]^=b,p[4]^=a,p[5]^=E,p[6]^=l,p[7]^=b;for(var d=0;d<4;d++)o.call(this)}},_doProcessBlock:function(r,s){var d=this._X;o.call(this),f[0]=d[0]^d[5]>>>16^d[3]<<16,f[1]=d[2]^d[7]>>>16^d[5]<<16,f[2]=d[4]^d[1]>>>16^d[7]<<16,f[3]=d[6]^d[3]>>>16^d[1]<<16;for(var u=0;u<4;u++)f[u]=(f[u]<<8|f[u]>>>24)&16711935|(f[u]<<24|f[u]>>>8)&4278255360,r[s+u]^=f[u]},blockSize:128/32,ivSize:64/32});function o(){for(var r=this._X,s=this._C,d=0;d<8;d++)S[d]=s[d];s[0]=s[0]+1295307597+this._b|0,s[1]=s[1]+3545052371+(s[0]>>>0<S[0]>>>0?1:0)|0,s[2]=s[2]+886263092+(s[1]>>>0<S[1]>>>0?1:0)|0,s[3]=s[3]+1295307597+(s[2]>>>0<S[2]>>>0?1:0)|0,s[4]=s[4]+3545052371+(s[3]>>>0<S[3]>>>0?1:0)|0,s[5]=s[5]+886263092+(s[4]>>>0<S[4]>>>0?1:0)|0,s[6]=s[6]+1295307597+(s[5]>>>0<S[5]>>>0?1:0)|0,s[7]=s[7]+3545052371+(s[6]>>>0<S[6]>>>0?1:0)|0,this._b=s[7]>>>0<S[7]>>>0?1:0;for(var d=0;d<8;d++){var u=r[d]+s[d],p=u&65535,m=u>>>16,i=((p*p>>>17)+p*m>>>15)+m*m,t=((u&4294901760)*u|0)+((u&65535)*u|0);y[d]=i^t}r[0]=y[0]+(y[7]<<16|y[7]>>>16)+(y[6]<<16|y[6]>>>16)|0,r[1]=y[1]+(y[0]<<8|y[0]>>>24)+y[7]|0,r[2]=y[2]+(y[1]<<16|y[1]>>>16)+(y[0]<<16|y[0]>>>16)|0,r[3]=y[3]+(y[2]<<8|y[2]>>>24)+y[1]|0,r[4]=y[4]+(y[3]<<16|y[3]>>>16)+(y[2]<<16|y[2]>>>16)|0,r[5]=y[5]+(y[4]<<8|y[4]>>>24)+y[3]|0,r[6]=y[6]+(y[5]<<16|y[5]>>>16)+(y[4]<<16|y[4]>>>16)|0,r[7]=y[7]+(y[6]<<8|y[6]>>>24)+y[5]|0}g.Rabbit=D._createHelper(c)}(),M.Rabbit})},ELLl:function(I,$,R){(function(M){M(R("VrN/"))})(function(M){var g={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},T=M.Pos;M.defineOption("autoCloseBrackets",!1,function(p,m,i){i&&i!=M.Init&&(p.removeKeyMap(v),p.state.closeBrackets=null),m&&(f(D(m,"pairs")),p.state.closeBrackets=m,p.addKeyMap(v))});function D(p,m){return m=="pairs"&&typeof p=="string"?p:typeof p=="object"&&p[m]!=null?p[m]:g[m]}var v={Backspace:c,Enter:o};function f(p){for(var m=0;m<p.length;m++){var i=p.charAt(m),t="'"+i+"'";v[t]||(v[t]=S(i))}}f(g.pairs+"`");function S(p){return function(m){return s(m,p)}}function y(p){var m=p.state.closeBrackets;if(!m||m.override)return m;var i=p.getModeAt(p.getCursor());return i.closeBrackets||m}function c(p){var m=y(p);if(!m||p.getOption("disableInput"))return M.Pass;for(var i=D(m,"pairs"),t=p.listSelections(),a=0;a<t.length;a++){if(!t[a].empty())return M.Pass;var l=d(p,t[a].head);if(!l||i.indexOf(l)%2!=0)return M.Pass}for(var a=t.length-1;a>=0;a--){var E=t[a].head;p.replaceRange("",T(E.line,E.ch-1),T(E.line,E.ch+1),"+delete")}}function o(p){var m=y(p),i=m&&D(m,"explode");if(!i||p.getOption("disableInput"))return M.Pass;for(var t=p.listSelections(),a=0;a<t.length;a++){if(!t[a].empty())return M.Pass;var l=d(p,t[a].head);if(!l||i.indexOf(l)%2!=0)return M.Pass}p.operation(function(){var E=p.lineSeparator()||`
|
|
|
`;p.replaceSelection(E+E,null),p.execCommand("goCharLeft"),t=p.listSelections();for(var b=0;b<t.length;b++){var h=t[b].head.line;p.indentLine(h,null,!0),p.indentLine(h+1,null,!0)}})}function r(p){var m=M.cmpPos(p.anchor,p.head)>0;return{anchor:new T(p.anchor.line,p.anchor.ch+(m?-1:1)),head:new T(p.head.line,p.head.ch+(m?1:-1))}}function s(p,m){var i=y(p);if(!i||p.getOption("disableInput"))return M.Pass;var t=D(i,"pairs"),a=t.indexOf(m);if(a==-1)return M.Pass;for(var l=D(i,"closeBefore"),E=D(i,"triples"),b=t.charAt(a+1)==m,h=p.listSelections(),L=a%2==0,O,w=0;w<h.length;w++){var C=h[w],x=C.head,_,j=p.getRange(x,T(x.line,x.ch+1));if(L&&!C.empty())_="surround";else if((b||!L)&&j==m)b&&u(p,x)?_="both":E.indexOf(m)>=0&&p.getRange(x,T(x.line,x.ch+3))==m+m+m?_="skipThree":_="skip";else if(b&&x.ch>1&&E.indexOf(m)>=0&&p.getRange(T(x.line,x.ch-2),x)==m+m){if(x.ch>2&&/\bstring/.test(p.getTokenTypeAt(T(x.line,x.ch-2))))return M.Pass;_="addFour"}else if(b){var N=x.ch==0?" ":p.getRange(T(x.line,x.ch-1),x);if(!M.isWordChar(j)&&N!=m&&!M.isWordChar(N))_="both";else return M.Pass}else if(L&&(j.length===0||/\s/.test(j)||l.indexOf(j)>-1))_="both";else return M.Pass;if(!O)O=_;else if(O!=_)return M.Pass}var P=a%2?t.charAt(a-1):m,V=a%2?m:t.charAt(a+1);p.operation(function(){if(O=="skip")p.execCommand("goCharRight");else if(O=="skipThree")for(var z=0;z<3;z++)p.execCommand("goCharRight");else if(O=="surround"){for(var B=p.getSelections(),z=0;z<B.length;z++)B[z]=P+B[z]+V;p.replaceSelections(B,"around"),B=p.listSelections().slice();for(var z=0;z<B.length;z++)B[z]=r(B[z]);p.setSelections(B)}else O=="both"?(p.replaceSelection(P+V,null),p.triggerElectric(P+V),p.execCommand("goCharLeft")):O=="addFour"&&(p.replaceSelection(P+P+P+P,"before"),p.execCommand("goCharRight"))})}function d(p,m){var i=p.getRange(T(m.line,m.ch-1),T(m.line,m.ch+1));return i.length==2?i:null}function u(p,m){var i=p.getTokenAt(T(m.line,m.ch+1));return/\bstring/.test(i.type)&&i.start==m.ch&&(m.ch==0||!/\bstring/.test(p.getTokenTypeAt(m)))}})},ELcG:function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){/** @preserve
|
|
|
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
|
|
|
|
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
|
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
*/return function(g){var T=M,D=T.lib,v=D.WordArray,f=D.Hasher,S=T.algo,y=v.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=v.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),o=v.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),r=v.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),s=v.create([0,1518500249,1859775393,2400959708,2840853838]),d=v.create([1352829926,1548603684,1836072691,2053994217,0]),u=S.RIPEMD160=f.extend({_doReset:function(){this._hash=v.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(E,b){for(var h=0;h<16;h++){var L=b+h,O=E[L];E[L]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}var w=this._hash.words,C=s.words,x=d.words,_=y.words,j=c.words,N=o.words,P=r.words,V,z,B,K,U,W,H,q,ne,te;W=V=w[0],H=z=w[1],q=B=w[2],ne=K=w[3],te=U=w[4];for(var _e,h=0;h<80;h+=1)_e=V+E[b+_[h]]|0,h<16?_e+=p(z,B,K)+C[0]:h<32?_e+=m(z,B,K)+C[1]:h<48?_e+=i(z,B,K)+C[2]:h<64?_e+=t(z,B,K)+C[3]:_e+=a(z,B,K)+C[4],_e=_e|0,_e=l(_e,N[h]),_e=_e+U|0,V=U,U=K,K=l(B,10),B=z,z=_e,_e=W+E[b+j[h]]|0,h<16?_e+=a(H,q,ne)+x[0]:h<32?_e+=t(H,q,ne)+x[1]:h<48?_e+=i(H,q,ne)+x[2]:h<64?_e+=m(H,q,ne)+x[3]:_e+=p(H,q,ne)+x[4],_e=_e|0,_e=l(_e,P[h]),_e=_e+te|0,W=te,te=ne,ne=l(q,10),q=H,H=_e;_e=w[1]+B+ne|0,w[1]=w[2]+K+te|0,w[2]=w[3]+U+W|0,w[3]=w[4]+V+H|0,w[4]=w[0]+z+q|0,w[0]=_e},_doFinalize:function(){var E=this._data,b=E.words,h=this._nDataBytes*8,L=E.sigBytes*8;b[L>>>5]|=128<<24-L%32,b[(L+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,E.sigBytes=(b.length+1)*4,this._process();for(var O=this._hash,w=O.words,C=0;C<5;C++){var x=w[C];w[C]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}return O},clone:function(){var E=f.clone.call(this);return E._hash=this._hash.clone(),E}});function p(E,b,h){return E^b^h}function m(E,b,h){return E&b|~E&h}function i(E,b,h){return(E|~b)^h}function t(E,b,h){return E&h|b&~h}function a(E,b,h){return E^(b|~h)}function l(E,b){return E<<b|E>>>32-b}T.RIPEMD160=f._createHelper(u),T.HmacRIPEMD160=f._createHmacHelper(u)}(Math),M.RIPEMD160})},ETIr:function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.WordArray,v=g.enc,f=v.Base64={stringify:function(y){var c=y.words,o=y.sigBytes,r=this._map;y.clamp();for(var s=[],d=0;d<o;d+=3)for(var u=c[d>>>2]>>>24-d%4*8&255,p=c[d+1>>>2]>>>24-(d+1)%4*8&255,m=c[d+2>>>2]>>>24-(d+2)%4*8&255,i=u<<16|p<<8|m,t=0;t<4&&d+t*.75<o;t++)s.push(r.charAt(i>>>6*(3-t)&63));var a=r.charAt(64);if(a)for(;s.length%4;)s.push(a);return s.join("")},parse:function(y){var c=y.length,o=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var s=0;s<o.length;s++)r[o.charCodeAt(s)]=s}var d=o.charAt(64);if(d){var u=y.indexOf(d);u!==-1&&(c=u)}return S(y,c,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function S(y,c,o){for(var r=[],s=0,d=0;d<c;d++)if(d%4){var u=o[y.charCodeAt(d-1)]<<d%4*2,p=o[y.charCodeAt(d)]>>>6-d%4*2,m=u|p;r[s>>>2]|=m<<24-s%4*8,s++}return D.create(r,s)}}(),M.enc.Base64})},"F+F2":function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){return function(){if(typeof ArrayBuffer!="function")return;var g=M,T=g.lib,D=T.WordArray,v=D.init,f=D.init=function(S){if(S instanceof ArrayBuffer&&(S=new Uint8Array(S)),(S instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&S instanceof Uint8ClampedArray||S instanceof Int16Array||S instanceof Uint16Array||S instanceof Int32Array||S instanceof Uint32Array||S instanceof Float32Array||S instanceof Float64Array)&&(S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength)),S instanceof Uint8Array){for(var y=S.byteLength,c=[],o=0;o<y;o++)c[o>>>2]|=S[o]<<24-o%4*8;v.call(this,c,y)}else v.apply(this,arguments)};f.prototype=D}(),M.lib.WordArray})},GRuw:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("lPiR"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.WordArray,v=g.algo,f=v.SHA256,S=v.SHA224=f.extend({_doReset:function(){this._hash=new D.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var y=f._doFinalize.call(this);return y.sigBytes-=4,y}});g.SHA224=f._createHelper(S),g.HmacSHA224=f._createHmacHelper(S)}(),M.SHA224})},GfqC:function(I,$,R){"use strict";var M=R("q1tI"),g=R.n(M),T=R("TSYQ"),D=R.n(T);function v(K,U){var W="cannot "+K.method+" "+K.action+" "+U.status+"'",H=new Error(W);return H.status=U.status,H.method=K.method,H.url=K.action,H}function f(K){var U=K.responseText||K.response;if(!U)return U;try{return JSON.parse(U)}catch(W){return U}}function S(K){var U=new XMLHttpRequest;K.onProgress&&U.upload&&(U.upload.onprogress=function(ne){ne.total>0&&(ne.percent=ne.loaded/ne.total*100),K.onProgress(ne)});var W=new FormData;K.data&&Object.keys(K.data).forEach(function(q){var ne=K.data[q];if(Array.isArray(ne)){ne.forEach(function(te){W.append(q+"[]",te)});return}W.append(q,K.data[q])}),K.file instanceof Blob?W.append(K.filename,K.file,K.file.name):W.append(K.filename,K.file),U.onerror=function(ne){K.onError(ne)},U.onload=function(){return U.status<200||U.status>=300?K.onError(v(K,U),f(U)):K.onSuccess(f(U),U)},U.open(K.method,K.action,!0),K.withCredentials&&"withCredentials"in U&&(U.withCredentials=!0);var H=K.headers||{};return H["X-Requested-With"]!==null&&U.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function(q){H[q]!==null&&U.setRequestHeader(q,H[q])}),U.send(W),{abort:function(){U.abort()}}}var y=+new Date,c=0;function o(){return"rc-upload-"+y+"-"+ ++c}function r(K,U){return K.indexOf(U,K.length-U.length)!==-1}var s=function(K,U){if(K&&U){var W=Array.isArray(U)?U:U.split(","),H=K.name||"",q=K.type||"",ne=q.replace(/\/.*$/,"");return W.some(function(te){var _e=te.trim();return _e.charAt(0)==="."?r(H.toLowerCase(),_e.toLowerCase()):/\/\*$/.test(_e)?ne===_e.replace(/\/.*$/,""):q===_e})}return!0};function d(K,U){var W=K.createReader(),H=[];function q(){W.readEntries(function(ne){var te=Array.prototype.slice.apply(ne);H=H.concat(te);var _e=!te.length;_e?U(H):q()})}q()}var u=function(U,W,H){var q=function ne(te,_e){_e=_e||"",te.isFile?te.file(function(Ce){H(Ce)&&(te.fullPath&&!Ce.webkitRelativePath&&(Object.defineProperties(Ce,{webkitRelativePath:{writable:!0}}),Ce.webkitRelativePath=te.fullPath.replace(/^\//,""),Object.defineProperties(Ce,{webkitRelativePath:{writable:!1}})),W([Ce]))}):te.isDirectory&&d(te,function(Ce){Ce.forEach(function(me){ne(me,""+_e+te.name+"/")})})};U.forEach(function(ne){q(ne.webkitGetAsEntry())})},p=u,m=Object.assign||function(K){for(var U=1;U<arguments.length;U++){var W=arguments[U];for(var H in W)Object.prototype.hasOwnProperty.call(W,H)&&(K[H]=W[H])}return K},i=function(){function K(U,W){var H=[],q=!0,ne=!1,te=void 0;try{for(var _e=U[Symbol.iterator](),Ce;!(q=(Ce=_e.next()).done)&&!(H.push(Ce.value),W&&H.length===W);q=!0);}catch(me){ne=!0,te=me}finally{try{!q&&_e.return&&_e.return()}finally{if(ne)throw te}}return H}return function(U,W){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return K(U,W);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function K(U,W){for(var H=0;H<W.length;H++){var q=W[H];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(U,q.key,q)}}return function(U,W,H){return W&&K(U.prototype,W),H&&K(U,H),U}}();function a(K,U,W){return U in K?Object.defineProperty(K,U,{value:W,enumerable:!0,configurable:!0,writable:!0}):K[U]=W,K}function l(K,U){var W={};for(var H in K){if(U.indexOf(H)>=0)continue;if(!Object.prototype.hasOwnProperty.call(K,H))continue;W[H]=K[H]}return W}function E(K,U){if(!(K instanceof U))throw new TypeError("Cannot call a class as a function")}function b(K,U){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:K}function h(K,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);K.prototype=Object.create(U&&U.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(K,U):K.__proto__=U)}var L=function(U){return Object.keys(U).reduce(function(W,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(W[H]=U[H]),W},{})},O=function(K){h(U,K);function U(){var W,H,q,ne;E(this,U);for(var te=arguments.length,_e=Array(te),Ce=0;Ce<te;Ce++)_e[Ce]=arguments[Ce];return ne=(H=(q=b(this,(W=U.__proto__||Object.getPrototypeOf(U)).call.apply(W,[this].concat(_e))),q),q.state={uid:o()},q.reqs={},q.onChange=function(me){var Me=me.target.files;q.uploadFiles(Me),q.reset()},q.onClick=function(me){var Me=q.fileInput;if(!Me)return;var Oe=q.props,he=Oe.children,ce=Oe.onClick;he&&he.type==="button"&&(Me.parentNode.focus(),Me.parentNode.querySelector("button").blur()),Me.click(),ce&&ce(me)},q.onKeyDown=function(me){me.key==="Enter"&&q.onClick()},q.onFileDrop=function(me){var Me=q.props.multiple;if(me.preventDefault(),me.type==="dragover")return;if(q.props.directory)p(Array.prototype.slice.call(me.dataTransfer.items),q.uploadFiles,function(he){return s(he,q.props.accept)});else{var Oe=Array.prototype.slice.call(me.dataTransfer.files).filter(function(he){return s(he,q.props.accept)});Me===!1&&(Oe=Oe.slice(0,1)),q.uploadFiles(Oe)}},q.uploadFiles=function(me){var Me=Array.prototype.slice.call(me);Me.map(function(Oe){return Oe.uid=o(),Oe}).forEach(function(Oe){q.upload(Oe,Me)})},q.saveFileInput=function(me){q.fileInput=me},H),b(q,ne)}return t(U,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,q){var ne=this,te=this.props;if(!te.beforeUpload)return setTimeout(function(){return ne.post(H)},0);var _e=te.beforeUpload(H,q);_e&&_e.then?_e.then(function(Ce){var me=Object.prototype.toString.call(Ce);return me==="[object File]"||me==="[object Blob]"?ne.post(Ce):ne.post(H)}).catch(function(Ce){console.log(Ce)}):_e!==!1&&setTimeout(function(){return ne.post(H)},0);return}},{key:"post",value:function(H){var q=this;if(!this._isMounted)return;var ne=this.props,te=ne.onStart,_e=ne.onProgress,Ce=ne.transformFile,me=Ce===void 0?function(Me){return Me}:Ce;new Promise(function(Me){var Oe=ne.action;return typeof Oe=="function"&&(Oe=Oe(H)),Me(Oe)}).then(function(Me){var Oe=H.uid,he=ne.customRequest||S,ce=Promise.resolve(me(H)).then(function(se){var Te=ne.data;return typeof Te=="function"&&(Te=Te(se)),Promise.all([se,Te])}).catch(function(se){console.error(se)});ce.then(function(se){var Te=i(se,2),re=Te[0],ue=Te[1],fe={action:Me,filename:ne.name,data:ue,file:re,headers:ne.headers,withCredentials:ne.withCredentials,method:ne.method||"post",onProgress:_e?function(ee){_e(ee,H)}:null,onSuccess:function(Q,X){delete q.reqs[Oe],ne.onSuccess(Q,H,X)},onError:function(Q,X){delete q.reqs[Oe],ne.onError(Q,X,H)}};te(H),q.reqs[Oe]=he(fe)})})}},{key:"reset",value:function(){this.setState({uid:o()})}},{key:"abort",value:function(H){var q=this.reqs;if(H){var ne=H;H&&H.uid&&(ne=H.uid),q[ne]&&q[ne].abort&&q[ne].abort(),delete q[ne]}else Object.keys(q).forEach(function(te){q[te]&&q[te].abort&&q[te].abort(),delete q[te]})}},{key:"render",value:function(){var H,q=this.props,ne=q.component,te=q.prefixCls,_e=q.className,Ce=q.disabled,me=q.id,Me=q.style,Oe=q.multiple,he=q.accept,ce=q.children,se=q.directory,Te=q.openFileDialogOnClick,re=q.onMouseEnter,ue=q.onMouseLeave,fe=l(q,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ee=D()((H={},a(H,te,!0),a(H,te+"-disabled",Ce),a(H,_e,_e),H)),Q=Ce?{}:{onClick:Te?this.onClick:function(){},onKeyDown:Te?this.onKeyDown:function(){},onMouseEnter:re,onMouseLeave:ue,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return g.a.createElement(ne,m({},Q,{className:ee,role:"button",style:Me}),g.a.createElement("input",m({},L(fe),{id:me,type:"file",ref:this.saveFileInput,onClick:function(Z){return Z.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:he,directory:se?"directory":null,webkitdirectory:se?"webkitdirectory":null,multiple:Oe,onChange:this.onChange})),ce)}}]),U}(M.Component),w=O,C=Object.assign||function(K){for(var U=1;U<arguments.length;U++){var W=arguments[U];for(var H in W)Object.prototype.hasOwnProperty.call(W,H)&&(K[H]=W[H])}return K},x=function(){function K(U,W){for(var H=0;H<W.length;H++){var q=W[H];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(U,q.key,q)}}return function(U,W,H){return W&&K(U.prototype,W),H&&K(U,H),U}}();function _(K,U){if(!(K instanceof U))throw new TypeError("Cannot call a class as a function")}function j(K,U){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:K}function N(K,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);K.prototype=Object.create(U&&U.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(K,U):K.__proto__=U)}function P(){}var V=function(K){N(U,K);function U(){var W,H,q,ne;_(this,U);for(var te=arguments.length,_e=Array(te),Ce=0;Ce<te;Ce++)_e[Ce]=arguments[Ce];return ne=(H=(q=j(this,(W=U.__proto__||Object.getPrototypeOf(U)).call.apply(W,[this].concat(_e))),q),q.saveUploader=function(me){q.uploader=me},H),j(q,ne)}return x(U,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return g.a.createElement(w,C({},this.props,{ref:this.saveUploader}))}}]),U}(M.Component);V.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:P,onError:P,onSuccess:P,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var z=V,B=$.a=z},HmJG:function(I,$,R){},IBYe:function(I,$,R){"use strict";function M(g){return null}$.a=M},Ib8C:function(I,$,R){(function(M){(function(g,T){I.exports=$=T()})(this,function(){var g=g||function(T,D){var v;if(typeof window!="undefined"&&window.crypto&&(v=window.crypto),typeof self!="undefined"&&self.crypto&&(v=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(v=globalThis.crypto),!v&&typeof window!="undefined"&&window.msCrypto&&(v=window.msCrypto),!v&&typeof M!="undefined"&&M.crypto&&(v=M.crypto),!v&&!0)try{v=R(4)}catch(a){}var f=function(){if(v){if(typeof v.getRandomValues=="function")try{return v.getRandomValues(new Uint32Array(1))[0]}catch(a){}if(typeof v.randomBytes=="function")try{return v.randomBytes(4).readInt32LE()}catch(a){}}throw new Error("Native crypto module could not be used to get secure random number.")},S=Object.create||function(){function a(){}return function(l){var E;return a.prototype=l,E=new a,a.prototype=null,E}}(),y={},c=y.lib={},o=c.Base=function(){return{extend:function(a){var l=S(this);return a&&l.mixIn(a),(!l.hasOwnProperty("init")||this.init===l.init)&&(l.init=function(){l.$super.init.apply(this,arguments)}),l.init.prototype=l,l.$super=this,l},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var l in a)a.hasOwnProperty(l)&&(this[l]=a[l]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=c.WordArray=o.extend({init:function(a,l){a=this.words=a||[],l!=D?this.sigBytes=l:this.sigBytes=a.length*4},toString:function(a){return(a||d).stringify(this)},concat:function(a){var l=this.words,E=a.words,b=this.sigBytes,h=a.sigBytes;if(this.clamp(),b%4)for(var L=0;L<h;L++){var O=E[L>>>2]>>>24-L%4*8&255;l[b+L>>>2]|=O<<24-(b+L)%4*8}else for(var w=0;w<h;w+=4)l[b+w>>>2]=E[w>>>2];return this.sigBytes+=h,this},clamp:function(){var a=this.words,l=this.sigBytes;a[l>>>2]&=4294967295<<32-l%4*8,a.length=T.ceil(l/4)},clone:function(){var a=o.clone.call(this);return a.words=this.words.slice(0),a},random:function(a){for(var l=[],E=0;E<a;E+=4)l.push(f());return new r.init(l,a)}}),s=y.enc={},d=s.Hex={stringify:function(a){for(var l=a.words,E=a.sigBytes,b=[],h=0;h<E;h++){var L=l[h>>>2]>>>24-h%4*8&255;b.push((L>>>4).toString(16)),b.push((L&15).toString(16))}return b.join("")},parse:function(a){for(var l=a.length,E=[],b=0;b<l;b+=2)E[b>>>3]|=parseInt(a.substr(b,2),16)<<24-b%8*4;return new r.init(E,l/2)}},u=s.Latin1={stringify:function(a){for(var l=a.words,E=a.sigBytes,b=[],h=0;h<E;h++){var L=l[h>>>2]>>>24-h%4*8&255;b.push(String.fromCharCode(L))}return b.join("")},parse:function(a){for(var l=a.length,E=[],b=0;b<l;b++)E[b>>>2]|=(a.charCodeAt(b)&255)<<24-b%4*8;return new r.init(E,l)}},p=s.Utf8={stringify:function(a){try{return decodeURIComponent(escape(u.stringify(a)))}catch(l){throw new Error("Malformed UTF-8 data")}},parse:function(a){return u.parse(unescape(encodeURIComponent(a)))}},m=c.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(a){typeof a=="string"&&(a=p.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(a){var l,E=this._data,b=E.words,h=E.sigBytes,L=this.blockSize,O=L*4,w=h/O;a?w=T.ceil(w):w=T.max((w|0)-this._minBufferSize,0);var C=w*L,x=T.min(C*4,h);if(C){for(var _=0;_<C;_+=L)this._doProcessBlock(b,_);l=b.splice(0,C),E.sigBytes-=x}return new r.init(l,x)},clone:function(){var a=o.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0}),i=c.Hasher=m.extend({cfg:o.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){a&&this._append(a);var l=this._doFinalize();return l},blockSize:512/32,_createHelper:function(a){return function(l,E){return new a.init(E).finalize(l)}},_createHmacHelper:function(a){return function(l,E){return new t.HMAC.init(a,E).finalize(l)}}}),t=y.algo={};return y}(Math);return g})}).call(this,R("IyRk"))},J66h:function(I,$,R){(function(M){var g,T;(function(D,v){I.exports=v(D)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof M!="undefined"?M:this,function(D){"use strict";D=D||{};var v=D.Base64,f="2.6.4",S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=function(P){for(var V={},z=0,B=P.length;z<B;z++)V[P.charAt(z)]=z;return V}(S),c=String.fromCharCode,o=function(P){if(P.length<2){var V=P.charCodeAt(0);return V<128?P:V<2048?c(192|V>>>6)+c(128|V&63):c(224|V>>>12&15)+c(128|V>>>6&63)+c(128|V&63)}else{var V=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return c(240|V>>>18&7)+c(128|V>>>12&63)+c(128|V>>>6&63)+c(128|V&63)}},r=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,s=function(P){return P.replace(r,o)},d=function(P){var V=[0,2,1][P.length%3],z=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),B=[S.charAt(z>>>18),S.charAt(z>>>12&63),V>=2?"=":S.charAt(z>>>6&63),V>=1?"=":S.charAt(z&63)];return B.join("")},u=D.btoa&&typeof D.btoa=="function"?function(P){return D.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,d)},p=function(P){return u(s(String(P)))},m=function(P){return P.replace(/[+\/]/g,function(V){return V=="+"?"-":"_"}).replace(/=/g,"")},i=function(P,V){return V?m(p(P)):p(P)},t=function(P){return i(P,!0)},a;D.Uint8Array&&(a=function(P,V){for(var z="",B=0,K=P.length;B<K;B+=3){var U=P[B],W=P[B+1],H=P[B+2],q=U<<16|W<<8|H;z+=S.charAt(q>>>18)+S.charAt(q>>>12&63)+(typeof W!="undefined"?S.charAt(q>>>6&63):"=")+(typeof H!="undefined"?S.charAt(q&63):"=")}return V?m(z):z});var l=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,E=function(P){switch(P.length){case 4:var V=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),z=V-65536;return c((z>>>10)+55296)+c((z&1023)+56320);case 3:return c((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return c((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},b=function(P){return P.replace(l,E)},h=function(P){var V=P.length,z=V%4,B=(V>0?y[P.charAt(0)]<<18:0)|(V>1?y[P.charAt(1)]<<12:0)|(V>2?y[P.charAt(2)]<<6:0)|(V>3?y[P.charAt(3)]:0),K=[c(B>>>16),c(B>>>8&255),c(B&255)];return K.length-=[0,0,2,1][z],K.join("")},L=D.atob&&typeof D.atob=="function"?function(P){return D.atob(P)}:function(P){return P.replace(/\S{1,4}/g,h)},O=function(P){return L(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},w=function(P){return b(L(P))},C=function(P){return String(P).replace(/[-_]/g,function(V){return V=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},x=function(P){return w(C(P))},_;D.Uint8Array&&(_=function(P){return Uint8Array.from(O(C(P)),function(V){return V.charCodeAt(0)})});var j=function(){var P=D.Base64;return D.Base64=v,P};if(D.Base64={VERSION:f,atob:O,btoa:u,fromBase64:x,toBase64:i,utob:s,encode:i,encodeURI:t,btou:b,decode:x,noConflict:j,fromUint8Array:a,toUint8Array:_},typeof Object.defineProperty=="function"){var N=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};D.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",N(function(){return x(this)})),Object.defineProperty(String.prototype,"toBase64",N(function(P){return i(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",N(function(){return i(this,!0)}))}}return D.Meteor&&(Base64=D.Base64),I.exports?I.exports.Base64=D.Base64:!(g=[],T=function(){return D.Base64}.apply($,g),T!==void 0&&(I.exports=T)),{Base64:D.Base64}})}).call(this,R("IyRk"))},JYp7:function(I,$,R){"use strict";R.d($,"c",function(){return g}),R.d($,"d",function(){return T}),R.d($,"f",function(){return v}),R.d($,"a",function(){return f}),R.d($,"b",function(){return S}),R.d($,"e",function(){return y});var M=function(){var c=function(o,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,d){s.__proto__=d}||function(s,d){for(var u in d)d.hasOwnProperty(u)&&(s[u]=d[u])},c(o,r)};return function(o,r){c(o,r);function s(){this.constructor=o}o.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}}(),g={done:!0,value:void 0},T;(function(c){var o={next:function(){return g}};function r(){return o}c.empty=r;function s(b){var h=!1;return{next:function(){return h?g:(h=!0,{done:!1,value:b})}}}c.single=s;function d(b,h,L){return h===void 0&&(h=0),L===void 0&&(L=b.length),{next:function(){return h>=L?g:{done:!1,value:b[h++]}}}}c.fromArray=d;function u(b){return{next:function(){var h=b.next();return h.done?g:{done:!1,value:h.value}}}}c.fromNativeIterator=u;function p(b){return b?Array.isArray(b)?c.fromArray(b):b:c.empty()}c.from=p;function m(b,h){return{next:function(){var L=b.next();return L.done?g:{done:!1,value:h(L.value)}}}}c.map=m;function i(b,h){return{next:function(){for(;;){var L=b.next();if(L.done)return g;if(h(L.value))return{done:!1,value:L.value}}}}}c.filter=i;function t(b,h){for(var L=b.next();!L.done;L=b.next())h(L.value)}c.forEach=t;function a(b,h){h===void 0&&(h=Number.POSITIVE_INFINITY);var L=[];if(h===0)return L;for(var O=0,w=b.next();!w.done&&!(L.push(w.value),++O>=h);w=b.next());return L}c.collect=a;function l(){for(var b=[],h=0;h<arguments.length;h++)b[h]=arguments[h];var L=0;return{next:function(){if(L>=b.length)return g;var O=b[L],w=O.next();return w.done?(L++,this.next()):w}}}c.concat=l;function E(b){return new D(b)}c.chain=E})(T||(T={}));var D=function(){function c(o){this.it=o}return c.prototype.next=function(){return this.it.next()},c}();function v(c){return Array.isArray(c)?T.fromArray(c):c||T.empty()}var f=function(){function c(o,r,s,d){r===void 0&&(r=0),s===void 0&&(s=o.length),d===void 0&&(d=r-1),this.items=o,this.start=r,this.end=s,this.index=d}return c.prototype.first=function(){return this.index=this.start,this.current()},c.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},c.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},c}(),S=function(c){M(o,c);function o(r,s,d,u){return s===void 0&&(s=0),d===void 0&&(d=r.length),u===void 0&&(u=s-1),c.call(this,r,s,d,u)||this}return o.prototype.current=function(){return c.prototype.current.call(this)},o.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},o.prototype.first=function(){return this.index=this.start,this.current()},o.prototype.last=function(){return this.index=this.end-1,this.current()},o.prototype.parent=function(){return null},o}(f),y=function(){function c(o,r){this.iterator=o,this.fn=r}return c.prototype.next=function(){return this.fn(this.iterator.next())},c}()},K3mO:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("3y9D"),R("WYAk"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.Base,v=T.WordArray,f=g.algo,S=f.MD5,y=f.EvpKDF=D.extend({cfg:D.extend({keySize:128/32,hasher:S,iterations:1}),init:function(c){this.cfg=this.cfg.extend(c)},compute:function(c,o){for(var r,s=this.cfg,d=s.hasher.create(),u=v.create(),p=u.words,m=s.keySize,i=s.iterations;p.length<m;){r&&d.update(r),r=d.update(c).finalize(o),d.reset();for(var t=1;t<i;t++)r=d.finalize(r),d.reset();u.concat(r)}return u.sigBytes=m*4,u}});g.EvpKDF=function(c,o,r){return y.create(r).compute(c,o)}}(),M.EvpKDF})},KhGG:function(I,$,R){"use strict";R.d($,"a",function(){return h}),R.d($,"c",function(){return O});var M=R("0Owb"),g=R("miYZ"),T=R("tsqr"),D=R("oBTY"),v=R("tJVT"),f=R("PpiC"),S=R("k1fw"),y=R("9og8"),c=R("DZo9"),o=R("8z0m"),r=R("WmNS"),s=R.n(r),d=R("q1tI"),u=R.n(d),p=R("ErOA"),m=R("NFKh"),i=R.n(m),t=R("7Cbv"),a=R("9kvl"),l=R("mxV5"),E=R.n(l),b=o.a.Dragger,h=function(x){var _="bf3c199c2470cb477d907b1e0917c17b",j="5183666c72eec9e4",N=i.a.enc.Utf8.parse(_),P=i.a.enc.Utf8.parse(j),V=i.a.AES.decrypt(x,N,{iv:P,mode:i.a.mode.CBC});return V.toString(i.a.enc.Utf8)},L,O=function(){var C=Object(y.a)(s.a.mark(function x(_,j,N){var P,V,z,B,K,U,W,H,q;return s.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return j.file_name=_.name,te.next=3,Object(p.a)("/api/buckets/get_upload_token.json",{method:"get"});case 3:return W=te.sent,console.log("decrypt(res.data):",h(W.data)),W.data=JSON.parse(h(W.data)),H=Object(t.a)(),q=new E.a({endpoint:W==null||((P=W.data)===null||P===void 0)?void 0:P.end_point,region:W==null||((V=W.data)===null||V===void 0)?void 0:V.region,accessKeyId:W==null||((z=W.data)===null||z===void 0)?void 0:z.access_key_id,accessKeySecret:W==null||((B=W.data)===null||B===void 0)?void 0:B.access_key_secret,bucket:W==null||((K=W.data)===null||K===void 0)?void 0:K.bucket,stsToken:W==null||((U=W.data)===null||U===void 0)?void 0:U.security_token}),te.abrupt("return",new Promise(function(_e,Ce){var me;q.multipartUpload("".concat(H),new Blob([_],{type:_.type}),Object(S.a)(Object(S.a)({timeout:200*1e3,partSize:102400},N),{},{callback:{url:W==null||((me=W.data)===null||me===void 0)?void 0:me.callback_url,host:W==null?void 0:W.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(p.e)(j)}})).then(function(Me){var Oe;_.response=(Oe=Me.data)===null||Oe===void 0?void 0:Oe.data,_e(Me==null?void 0:Me.data)}).catch(function(Me){Ce(Me),console.log("err:",Me)})}));case 9:case"end":return te.stop()}},x)}));return function(_,j,N){return C.apply(this,arguments)}}(),w=function(x){var _=x.user,j=x.cancelUpload,N=Object(f.a)(x,["user","cancelUpload"]),P=Object(d.useState)([]),V=Object(v.a)(P,2),z=V[0],B=V[1],K=Object(d.useState)(),U=Object(v.a)(K,2),W=U[0],H=U[1],q={onRemove:function(_e){B(Object(D.a)(z.filter(function(Ce){return Ce.name!==_e.name}))),N.onChange(z.filter(function(Ce){return Ce.name!==_e.name}))},disabled:N.disabled,multiple:!0,fileList:z==null?void 0:z.map(function(te){return te.file}),customRequest:function(){},beforeUpload:function(){var te=Object(y.a)(s.a.mark(function Ce(me){var Me;return s.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:if(Me=N.maxSize||1024*1024*1024*1,!z.filter(function(ce){return ce.name===me.name}).length){he.next=4;break}return T.b.info("".concat(me.name,"\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9")),he.abrupt("return");case 4:if(!((me==null?void 0:me.size)>Me)){he.next=7;break}return T.b.info("\u6587\u4EF6\u8D85\u8FC7".concat(Me/1024/1024/1024,"GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")),he.abrupt("return",!1);case 7:return z.push({name:me.name,file:me}),B(Object(D.a)(z)),N.onChange(z),he.abrupt("return",!1);case 11:case"end":return he.stop()}},Ce)}));function _e(Ce){return te.apply(this,arguments)}return _e}()},ne=function(){var te=Object(y.a)(s.a.mark(function _e(Ce,me){var Me,Oe,he,ce,se,Te,re,ue,fe;return s.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return me.file_name=Ce.name,re=Ce.name,Q.next=4,Object(p.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 4:if(ue=Q.sent,ue.data=JSON.parse(h(ue.data)),!((ue==null?void 0:ue.status)!==0)){Q.next=12;break}return z[z.findIndex(function(X){return X.name===re})].status="error",z[z.findIndex(function(X){return X.name===re})].file.status="error",N.onChange(z),T.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),Q.abrupt("return");case 12:return W=new E.a({endpoint:ue==null||((Me=ue.data)===null||Me===void 0)?void 0:Me.end_point,region:ue==null||((Oe=ue.data)===null||Oe===void 0)?void 0:Oe.region,accessKeyId:ue==null||((he=ue.data)===null||he===void 0)?void 0:he.access_key_id,accessKeySecret:ue==null||((ce=ue.data)===null||ce===void 0)?void 0:ce.access_key_secret,bucket:ue==null||((se=ue.data)===null||se===void 0)?void 0:se.bucket,stsToken:ue==null||((Te=ue.data)===null||Te===void 0)?void 0:Te.security_token}),console.log(Ce,"file"),H(W),fe=Object(t.a)(),Q.abrupt("return",new Promise(function(X,Z){try{var ve;W.multipartUpload("".concat(N.identifier,"/").concat(fe).concat(re.indexOf(".")>-1?"."+re.split(".").pop():""),new Blob([Ce.file],{type:Ce.file.type}),{timeout:3600*1e3,partSize:1002400,progress:function(Re,Je,Ze){try{console.log("\u8FDB\u5EA6",Re,Je,Ze);var rt=z.findIndex(function(tt){return tt.name===re});z[rt].file.percent=Re*100,z[rt].tempCheckpoint=Je,B(Object(D.a)(z))}catch(tt){}},checkpoint:z[z.findIndex(function(ye){return ye.name===re})].tempCheckpoint,callback:{customValue:{id:re+""},url:ue==null||((ve=ue.data)===null||ve===void 0)?void 0:ve.callback_url,host:ue==null?void 0:ue.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(p.e)(me)}}).then(function(ye){var Re,Je=z.findIndex(function(ot){return ot.name===re}),Ze="done";if(((Re=ye.data)===null||Re===void 0?void 0:Re.status)===0){var rt;Ce.response=(rt=ye.data)===null||rt===void 0?void 0:rt.data;var tt=z.findIndex(function(ot){return ot.name===re});z[tt].status="done",z[tt].file.status="done"}else{var st;T.b.warn((st=ye.data)===null||st===void 0?void 0:st.message),Ze="error"}z[Je].status=Ze,z[Je].file.status=Ze,N.onChange(z),X(ye==null?void 0:ye.data)}).catch(function(ye){z[z.findIndex(function(Re){return Re.name===re})].status="error",z[z.findIndex(function(Re){return Re.name===re})].file.status="error",T.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),B(Object(D.a)(z)),N.onChange(z),Z(ye),console.log("err:",ye)})}catch(ye){}}));case 17:case"end":return Q.stop()}},_e)}));return function(Ce,me){return te.apply(this,arguments)}}();return Object(d.useEffect)(function(){z.every(function(te){return te==="done"||te==="error"})&&N.onComplete(z)},[z]),Object(d.useEffect)(function(){if(j){var te;(te=W)===null||te===void 0||te.cancel()}},[j]),Object(d.useEffect)(function(){N.uploading&&z.map(function(){var te=Object(y.a)(s.a.mark(function _e(Ce){var me,Me;return s.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:if(!((!Ce.status||Ce.status==="error")&&!j)){he.next=6;break}return Ce.status="uploading",Ce.file.status="uploading",he.next=5,ne(Ce,{login:_==null||((me=_.userInfo)===null||me===void 0)?void 0:me.login,container_type:N.container_type,container_id:N.container_id,description:N.description});case 5:Me=he.sent;case 6:case"end":return he.stop()}},_e)}));return function(_e){return te.apply(this,arguments)}}())},[N.uploading]),u.a.createElement(b,Object(M.a)({},q,{height:N.height,className:N.className}),u.a.createElement("p",{className:"ant-upload-hint"},N.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};$.b=Object(a.a)(function(C){var x=C.loading,_=C.globalSetting,j=C.user;return{globalSetting:_,loading:x.models.competitions,user:j}})(w)},KmYQ:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.pad.ZeroPadding={pad:function(g,T){var D=T*4;g.clamp(),g.sigBytes+=D-(g.sigBytes%D||D)},unpad:function(g){for(var T=g.words,D=g.sigBytes-1,D=g.sigBytes-1;D>=0;D--)if(T[D>>>2]>>>24-D%4*8&255){g.sigBytes=D+1;break}}},M.pad.ZeroPadding})},L9qf:function(I,$,R){I.exports={flex_box_center:"flex_box_center___3J7Qj",flex_space_between:"flex_space_between___3P3xx",flex_box_vertical_center:"flex_box_vertical_center___3QrMz",flex_box_center_end:"flex_box_center_end___37g4V",flex_box_column:"flex_box_column___2PxMN",wrap:"wrap___1xDeN",in:"in___364z1",btns:"btns___8vHXH",customModal:"customModal___2Vkln"}},LdHM:function(I,$,R){"use strict";R.d($,"b",function(){return l}),R.d($,"a",function(){return b});var M=R("1OyB"),g=R("vuIU"),T=R("Ji7U"),D=R("LK+K"),v=R("q1tI"),f=R("rePB"),S=R("Ff2n"),y=R("ODXe"),c=R("4IlW"),o=R("bX4T"),r=R("YrtM"),s=R("TSYQ"),d=R.n(s),u=R("+nKL"),p=R("8OUc"),m=function(H,q){var ne=H.prefixCls,te=H.id,_e=H.flattenOptions,Ce=H.childrenAsData,me=H.values,Me=H.searchValue,Oe=H.multiple,he=H.defaultActiveFirstOption,ce=H.height,se=H.itemHeight,Te=H.notFoundContent,re=H.open,ue=H.menuItemSelectedIcon,fe=H.virtual,ee=H.onSelect,Q=H.onToggleOpen,X=H.onActiveValue,Z=H.onScroll,ve=H.onMouseEnter,ye="".concat(ne,"-item"),Re=Object(r.a)(function(){return _e},[re,_e],function(nt,je){return je[0]&&nt[1]!==je[1]}),Je=v.useRef(null),Ze=function(je){je.preventDefault()},rt=function(je){Je.current&&Je.current.scrollTo({index:je})},tt=function(je){for(var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Pe=Re.length,xe=0;xe<Pe;xe+=1){var Se=(je+xe*De+Pe)%Pe,Le=Re[Se],Ne=Le.group,et=Le.data;if(!Ne&&!et.disabled)return Se}return-1},st=v.useState(function(){return tt(0)}),ot=Object(y.a)(st,2),Fe=ot[0],Ae=ot[1],qe=function(je){Ae(je);var De=Re[je];if(!De){X(null,-1);return}X(De.data.value,je)};v.useEffect(function(){qe(he!==!1?tt(0):-1)},[Re.length,Me]),v.useEffect(function(){var nt=setTimeout(function(){if(!Oe&&re&&me.size===1){var je=Array.from(me)[0],De=Re.findIndex(function(Pe){var xe=Pe.data;return xe.value===je});qe(De),rt(De)}});return function(){return clearTimeout(nt)}},[re]);var ut=function(je){je!==void 0&&ee(je,{selected:!me.has(je)}),Oe||Q(!1)};if(v.useImperativeHandle(q,function(){return{onKeyDown:function(je){var De=je.which;switch(De){case c.a.UP:case c.a.DOWN:{var Pe=0;if(De===c.a.UP?Pe=-1:De===c.a.DOWN&&(Pe=1),Pe!==0){var xe=tt(Fe+Pe,Pe);rt(xe),qe(xe)}break}case c.a.ENTER:{var Se=Re[Fe];Se&&!Se.data.disabled?ut(Se.data.value):ut(void 0),re&&je.preventDefault();break}case c.a.ESC:Q(!1)}},onKeyUp:function(){},scrollTo:function(je){rt(je)}}}),Re.length===0)return v.createElement("div",{role:"listbox",id:"".concat(te,"_list"),className:"".concat(ye,"-empty"),onMouseDown:Ze},Te);function $e(nt){var je=Re[nt];if(!je)return null;var De=je.data||{},Pe=De.value,xe=De.label,Se=De.children,Le=Object(o.a)(De,!0),Ne=Ce?Se:xe;return je?v.createElement("div",Object.assign({"aria-label":typeof Ne=="string"?Ne:null},Le,{key:nt,role:"option",id:"".concat(te,"_list_").concat(nt),"aria-selected":me.has(Pe)}),Pe):null}return v.createElement(v.Fragment,null,v.createElement("div",{role:"listbox",id:"".concat(te,"_list"),style:{height:0,width:0,overflow:"hidden"}},$e(Fe-1),$e(Fe),$e(Fe+1)),v.createElement(u.a,{itemKey:"key",ref:Je,data:Re,height:ce,itemHeight:se,fullHeight:!1,onMouseDown:Ze,onScroll:Z,virtual:fe,onMouseEnter:ve},function(nt,je){var De,Pe=nt.group,xe=nt.groupOption,Se=nt.data,Le=Se.label,Ne=Se.key;if(Pe)return v.createElement("div",{className:d()(ye,"".concat(ye,"-group"))},Le!==void 0?Le:Ne);var et=Se.disabled,Xe=Se.value,ct=Se.title,gt=Se.children,wt=Se.style,vt=Se.className,Mt=Object(S.a)(Se,["disabled","value","title","children","style","className"]),Pt=me.has(Xe),_t="".concat(ye,"-option"),rr=d()(ye,_t,vt,(De={},Object(f.a)(De,"".concat(_t,"-grouped"),xe),Object(f.a)(De,"".concat(_t,"-active"),Fe===je&&!et),Object(f.a)(De,"".concat(_t,"-disabled"),et),Object(f.a)(De,"".concat(_t,"-selected"),Pt),De)),dr=Ce?gt:Le,Zt=!ue||typeof ue=="function"||Pt;return v.createElement("div",Object.assign({},Mt,{"aria-selected":Pt,className:rr,title:ct,onMouseMove:function(){if(Fe===je||et)return;qe(je)},onClick:function(){et||ut(Xe)},style:wt}),v.createElement("div",{className:"".concat(_t,"-content")},dr||Xe),v.isValidElement(ue)||Pt,Zt&&v.createElement(p.a,{className:"".concat(ye,"-option-state"),customizeIcon:ue,customizeIconProps:{isSelected:Pt}},Pt?"\u2713":null))}))},i=v.forwardRef(m);i.displayName="OptionList";var t=i,a=function(){return null};a.isSelectOption=!0;var l=a,E=function(){return null};E.isSelectOptGroup=!0;var b=E,h=R("VTBJ"),L=R("Zm9Q");function O(W){var H=W.key,q=W.props,ne=q.children,te=q.value,_e=Object(S.a)(q,["children","value"]);return Object(h.a)({key:H,value:te!==void 0?te:H,children:ne},_e)}function w(W){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(W).map(function(q,ne){if(!v.isValidElement(q)||!q.type)return null;var te=q.type.isSelectOptGroup,_e=q.key,Ce=q.props,me=Ce.children,Me=Object(S.a)(Ce,["children"]);return H||!te?O(q):Object(h.a)(Object(h.a)({key:"__RC_SELECT_GRP__".concat(_e===null?ne:_e,"__"),label:_e},Me),{},{options:w(me)})}).filter(function(q){return q})}var C=R("2Qr1"),x=R("qNPg"),_=R("U8pU"),j=R("Kwbf"),N=R("WKfj");function P(W){var H=W.mode,q=W.options,ne=W.children,te=W.backfill,_e=W.allowClear,Ce=W.placeholder,me=W.getInputElement,Me=W.showSearch,Oe=W.onSearch,he=W.defaultOpen,ce=W.autoFocus,se=W.labelInValue,Te=W.value,re=W.inputValue,ue=W.optionLabelProp,fe=H==="multiple"||H==="tags",ee=Me!==void 0?Me:fe||H==="combobox",Q=q||w(ne);if(Object(j.a)(H!=="tags"||Q.every(function(ye){return!ye.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var X=Q.some(function(ye){return ye.options?ye.options.some(function(Re){return typeof("value"in Re?Re.value:Re.key)=="number"}):typeof("value"in ye?ye.value:ye.key)=="number"});Object(j.a)(!X,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(j.a)(H!=="combobox"||!ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(j.a)(H==="combobox"||!te,"`backfill` only works with `combobox` mode."),Object(j.a)(H==="combobox"||!me,"`getInputElement` only work with `combobox` mode."),Object(j.b)(H!=="combobox"||!me||!_e||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!ee&&H!=="combobox"&&H!=="tags"&&Object(j.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(j.b)(!he||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Te!=null){var Z=Object(N.d)(Te);Object(j.a)(!se||Z.every(function(ye){return Object(_.a)(ye)==="object"&&("key"in ye||"value"in ye)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(j.a)(!fe||Array.isArray(Te),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var ve=null;Object(L.a)(ne).some(function(ye){if(!v.isValidElement(ye)||!ye.type)return!1;var Re=ye.type;if(Re.isSelectOption)return!1;if(Re.isSelectOptGroup){var Je=Object(L.a)(ye.props.children).every(function(Ze){return!v.isValidElement(Ze)||!ye.type||Ze.type.isSelectOption?!0:(ve=Ze.type,!1)});return!Je}return ve=Re,!0}),ve&&Object(j.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ve.displayName||ve.name||ve,"`.")),Object(j.a)(re===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var V=P,z=Object(x.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:w,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:V,fillOptionsWithMissingValue:C.a}),B=function(W){Object(T.a)(q,W);var H=Object(D.a)(q);function q(){var ne;return Object(M.a)(this,q),ne=H.apply(this,arguments),ne.selectRef=v.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(g.a)(q,[{key:"render",value:function(){return v.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),q}(v.Component);B.Option=l,B.OptGroup=b;var K=B,U=$.c=K},M8RZ:function(I,$,R){"use strict";R.d($,"a",function(){return c});var M=R("fWQN"),g=R("mtLc"),T=R("yKVA"),D=R("879j"),v=R("q1tI"),f=R.n(v),S=R("i8i4"),y=R.n(S),c=function(o){Object(T.a)(s,o);var r=Object(D.a)(s);function s(d){var u;Object(M.a)(this,s),u=r.call(this,d);var p=window.document;return u.node=p.createElement("div"),p.body.appendChild(u.node),u}return Object(g.a)(s,[{key:"render",value:function(){var u=this.props.children;return Object(S.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),s}(f.a.Component)},MFOe:function(I,$,R){(function(M){var g=f(),T=S(),D=y(),v=typeof window!="undefined"?window:M;I.exports={assign:g,create:T,trim:D,bind:c,slice:o,each:r,map:s,pluck:d,isList:u,isFunction:p,isObject:m,Global:v};function f(){return Object.assign?Object.assign:function(t,a,l,E){for(var b=1;b<arguments.length;b++)r(Object(arguments[b]),function(h,L){t[L]=h});return t}}function S(){if(Object.create)return function(a,l,E,b){var h=o(arguments,1);return g.apply(this,[Object.create(a)].concat(h))};{function i(){}return function(a,l,E,b){var h=o(arguments,1);return i.prototype=a,g.apply(this,[new i].concat(h))}}}function y(){return String.prototype.trim?function(t){return String.prototype.trim.call(t)}:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function c(i,t){return function(){return t.apply(i,Array.prototype.slice.call(arguments,0))}}function o(i,t){return Array.prototype.slice.call(i,t||0)}function r(i,t){d(i,function(a,l){return t(a,l),!1})}function s(i,t){var a=u(i)?[]:{};return d(i,function(l,E){return a[E]=t(l,E),!1}),a}function d(i,t){if(u(i)){for(var a=0;a<i.length;a++)if(t(i[a],a))return i[a]}else for(var l in i)if(i.hasOwnProperty(l)&&t(i[l],l))return i[l]}function u(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function p(i){return i&&{}.toString.call(i)==="[object Function]"}function m(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,R("IyRk"))},MI8n:function(I,$,R){"use strict";R.d($,"b",function(){return f}),R.d($,"a",function(){return c}),R.d($,"e",function(){return o}),R.d($,"d",function(){return r}),R.d($,"c",function(){return s}),R.d($,"f",function(){return d});var M=R("/cxE"),g=R("C/vA"),T=R("pmY6"),D=R("24hK"),v=function(){var u=function(p,m){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var a in t)t.hasOwnProperty(a)&&(i[a]=t[a])},u(p,m)};return function(p,m){u(p,m);function i(){this.constructor=p}p.prototype=m===null?Object.create(m):(i.prototype=m.prototype,new i)}}(),f;(function(u){u.None=function(){return T.a.None};function p(V){return function(z,B,K){B===void 0&&(B=null);var U=!1,W;return W=V(function(H){return U?void 0:(W?W.dispose():U=!0,z.call(B,H))},null,K),U&&W.dispose(),W}}u.once=p;function m(V,z){return b(function(B,K,U){return K===void 0&&(K=null),V(function(W){return B.call(K,z(W))},null,U)})}u.map=m;function i(V,z){return b(function(B,K,U){return K===void 0&&(K=null),V(function(W){z(W),B.call(K,W)},null,U)})}u.forEach=i;function t(V,z){return b(function(B,K,U){return K===void 0&&(K=null),V(function(W){return z(W)&&B.call(K,W)},null,U)})}u.filter=t;function a(V){return V}u.signal=a;function l(){for(var V=[],z=0;z<arguments.length;z++)V[z]=arguments[z];return function(B,K,U){return K===void 0&&(K=null),T.e.apply(void 0,V.map(function(W){return W(function(H){return B.call(K,H)},null,U)}))}}u.any=l;function E(V,z,B){var K=B;return m(V,function(U){return K=z(K,U),K})}u.reduce=E;function b(V){var z,B=new c({onFirstListenerAdd:function(){z=V(B.fire,B)},onLastListenerRemove:function(){z.dispose()}});return B.event}u.snapshot=b;function h(V,z,B,K,U){B===void 0&&(B=100),K===void 0&&(K=!1);var W,H=void 0,q=void 0,ne=0,te=new c({leakWarningThreshold:U,onFirstListenerAdd:function(){W=V(function(_e){ne++,H=z(H,_e),K&&!q&&(te.fire(H),H=void 0),clearTimeout(q),q=setTimeout(function(){var Ce=H;H=void 0,q=void 0,(!K||ne>1)&&te.fire(Ce),ne=0},B)})},onLastListenerRemove:function(){W.dispose()}});return te.event}u.debounce=h;function L(V){var z=new Date().getTime();return m(p(V),function(B){return new Date().getTime()-z})}u.stopwatch=L;function O(V){var z=!0,B;return t(V,function(K){var U=z||K!==B;return z=!1,B=K,U})}u.latch=O;function w(V,z,B){z===void 0&&(z=!1),B===void 0&&(B=[]);var K=B.slice(),U=V(function(q){K?K.push(q):H.fire(q)}),W=function(){K&&K.forEach(function(q){return H.fire(q)}),K=null},H=new c({onFirstListenerAdd:function(){U||(U=V(function(q){return H.fire(q)}))},onFirstListenerDidAdd:function(){K&&(z?setTimeout(W):W())},onLastListenerRemove:function(){U&&U.dispose(),U=null}});return H.event}u.buffer=w;var C=function(){function V(z){this.event=z}return V.prototype.map=function(z){return new V(m(this.event,z))},V.prototype.forEach=function(z){return new V(i(this.event,z))},V.prototype.filter=function(z){return new V(t(this.event,z))},V.prototype.reduce=function(z,B){return new V(E(this.event,z,B))},V.prototype.latch=function(){return new V(O(this.event))},V.prototype.debounce=function(z,B,K,U){return B===void 0&&(B=100),K===void 0&&(K=!1),new V(h(this.event,z,B,K,U))},V.prototype.on=function(z,B,K){return this.event(z,B,K)},V.prototype.once=function(z,B,K){return p(this.event)(z,B,K)},V}();function x(V){return new C(V)}u.chain=x;function _(V,z,B){B===void 0&&(B=function(q){return q});var K=function(){for(var q=[],ne=0;ne<arguments.length;ne++)q[ne]=arguments[ne];return H.fire(B.apply(void 0,q))},U=function(){return V.on(z,K)},W=function(){return V.removeListener(z,K)},H=new c({onFirstListenerAdd:U,onLastListenerRemove:W});return H.event}u.fromNodeEventEmitter=_;function j(V,z,B){B===void 0&&(B=function(q){return q});var K=function(){for(var q=[],ne=0;ne<arguments.length;ne++)q[ne]=arguments[ne];return H.fire(B.apply(void 0,q))},U=function(){return V.addEventListener(z,K)},W=function(){return V.removeEventListener(z,K)},H=new c({onFirstListenerAdd:U,onLastListenerRemove:W});return H.event}u.fromDOMEventEmitter=j;function N(V){var z=new c,B=!1;return V.then(void 0,function(){return null}).then(function(){B?z.fire(void 0):setTimeout(function(){return z.fire(void 0)},0)}),B=!0,z.event}u.fromPromise=N;function P(V){return new Promise(function(z){return p(V)(z)})}u.toPromise=P})(f||(f={}));var S=-1,y=function(){function u(p,m){m===void 0&&(m=Math.random().toString(18).slice(2,5)),this.customThreshold=p,this.name=m,this._warnCountdown=0}return u.prototype.dispose=function(){this._stacks&&this._stacks.clear()},u.prototype.check=function(p){var m=this,i=S;if(typeof this.customThreshold=="number"&&(i=this.customThreshold),i<=0||p<i)return;this._stacks||(this._stacks=new Map);var t=new Error().stack.split(`
|
|
|
`).slice(3).join(`
|
|
|
`),a=this._stacks.get(t)||0;if(this._stacks.set(t,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;var l,E=0;this._stacks.forEach(function(b,h){(!l||E<b)&&(l=h,E=b)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+p+" listeners already. MOST frequent listener ("+E+"):"),console.warn(l)}return function(){var b=m._stacks.get(t)||0;m._stacks.set(t,b-1)}},u}(),c=function(){function u(p){this._disposed=!1,this._options=p,this._leakageMon=S>0?new y(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(u.prototype,"event",{get:function(){var p=this;return this._event||(this._event=function(m,i,t){p._listeners||(p._listeners=new D.a);var a=p._listeners.isEmpty();a&&p._options&&p._options.onFirstListenerAdd&&p._options.onFirstListenerAdd(p);var l=p._listeners.push(i?[m,i]:m);a&&p._options&&p._options.onFirstListenerDidAdd&&p._options.onFirstListenerDidAdd(p),p._options&&p._options.onListenerDidAdd&&p._options.onListenerDidAdd(p,m,i);var E;p._leakageMon&&(E=p._leakageMon.check(p._listeners.size));var b;return b={dispose:function(){if(E&&E(),b.dispose=u._noop,!p._disposed&&(l(),p._options&&p._options.onLastListenerRemove)){var h=p._listeners&&!p._listeners.isEmpty();h||p._options.onLastListenerRemove(p)}}},t instanceof T.b?t.add(b):Array.isArray(t)&&t.push(b),b}),this._event},enumerable:!0,configurable:!0}),u.prototype.fire=function(p){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new D.a);for(var m=this._listeners.iterator(),i=m.next();!i.done;i=m.next())this._deliveryQueue.push([i.value,p]);for(;this._deliveryQueue.size>0;){var t=this._deliveryQueue.shift(),a=t[0],l=t[1];try{typeof a=="function"?a.call(void 0,l):a[0].call(a[1],l)}catch(E){Object(M.e)(E)}}}},u.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},u._noop=function(){},u}(),o=function(u){v(p,u);function p(m){var i=u.call(this,m)||this;return i._isPaused=0,i._eventQueue=new D.a,i._mergeFn=m&&m.merge,i}return p.prototype.pause=function(){this._isPaused++},p.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var m=this._eventQueue.toArray();this._eventQueue.clear(),u.prototype.fire.call(this,this._mergeFn(m))}else for(;!this._isPaused&&this._eventQueue.size!==0;)u.prototype.fire.call(this,this._eventQueue.shift())},p.prototype.fire=function(m){this._listeners&&(this._isPaused!==0?this._eventQueue.push(m):u.prototype.fire.call(this,m))},p}(c),r=function(){function u(){var p=this;this.hasListeners=!1,this.events=[],this.emitter=new c({onFirstListenerAdd:function(){return p.onFirstListenerAdd()},onLastListenerRemove:function(){return p.onLastListenerRemove()}})}return Object.defineProperty(u.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),u.prototype.add=function(p){var m=this,i={event:p,listener:null};this.events.push(i),this.hasListeners&&this.hook(i);var t=function(){m.hasListeners&&m.unhook(i);var a=m.events.indexOf(i);m.events.splice(a,1)};return Object(T.h)(Object(g.a)(t))},u.prototype.onFirstListenerAdd=function(){var p=this;this.hasListeners=!0,this.events.forEach(function(m){return p.hook(m)})},u.prototype.onLastListenerRemove=function(){var p=this;this.hasListeners=!1,this.events.forEach(function(m){return p.unhook(m)})},u.prototype.hook=function(p){var m=this;p.listener=p.event(function(i){return m.emitter.fire(i)})},u.prototype.unhook=function(p){p.listener&&p.listener.dispose(),p.listener=null},u.prototype.dispose=function(){this.emitter.dispose()},u}(),s=function(){function u(){this.buffers=[]}return u.prototype.wrapEvent=function(p){var m=this;return function(i,t,a){return p(function(l){var E=m.buffers[m.buffers.length-1];E?E.push(function(){return i.call(t,l)}):i.call(t,l)},void 0,a)}},u.prototype.bufferEvents=function(p){var m=[];this.buffers.push(m);var i=p();return this.buffers.pop(),m.forEach(function(t){return t()}),i},u}(),d=function(){function u(){var p=this;this.listening=!1,this.inputEvent=f.None,this.inputEventListener=T.a.None,this.emitter=new c({onFirstListenerDidAdd:function(){p.listening=!0,p.inputEventListener=p.inputEvent(p.emitter.fire,p.emitter)},onLastListenerRemove:function(){p.listening=!1,p.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(u.prototype,"input",{set:function(p){this.inputEvent=p,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=p(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),u.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},u}()},MlIO:function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){return function(g){var T=M,D=T.lib,v=D.Base,f=D.WordArray,S=T.x64={},y=S.Word=v.extend({init:function(o,r){this.high=o,this.low=r}}),c=S.WordArray=v.extend({init:function(o,r){o=this.words=o||[],r!=g?this.sigBytes=r:this.sigBytes=o.length*8},toX32:function(){for(var o=this.words,r=o.length,s=[],d=0;d<r;d++){var u=o[d];s.push(u.high),s.push(u.low)}return f.create(s,this.sigBytes)},clone:function(){for(var o=v.clone.call(this),r=o.words=this.words.slice(0),s=r.length,d=0;d<s;d++)r[d]=r[d].clone();return o}})}(),M})},N0LK:function(I,$,R){"use strict";R.d($,"x",function(){return M}),R.d($,"F",function(){return g}),R.d($,"r",function(){return D}),R.d($,"o",function(){return v}),R.d($,"p",function(){return f}),R.d($,"Q",function(){return S}),R.d($,"K",function(){return c}),R.d($,"k",function(){return o}),R.d($,"N",function(){return r}),R.d($,"m",function(){return s}),R.d($,"l",function(){return d}),R.d($,"I",function(){return u}),R.d($,"H",function(){return p}),R.d($,"q",function(){return m}),R.d($,"t",function(){return i}),R.d($,"D",function(){return t}),R.d($,"e",function(){return a}),R.d($,"f",function(){return l}),R.d($,"B",function(){return E}),R.d($,"C",function(){return b}),R.d($,"n",function(){return L}),R.d($,"O",function(){return w}),R.d($,"c",function(){return C}),R.d($,"d",function(){return x}),R.d($,"z",function(){return _}),R.d($,"A",function(){return j}),R.d($,"u",function(){return N}),R.d($,"E",function(){return V}),R.d($,"G",function(){return z}),R.d($,"i",function(){return K}),R.d($,"g",function(){return W}),R.d($,"v",function(){return q}),R.d($,"h",function(){return ne}),R.d($,"y",function(){return te}),R.d($,"w",function(){return _e}),R.d($,"a",function(){return Ce}),R.d($,"P",function(){return me}),R.d($,"L",function(){return Me}),R.d($,"J",function(){return Oe}),R.d($,"j",function(){return he}),R.d($,"M",function(){return ce}),R.d($,"s",function(){return se}),R.d($,"b",function(){return Te});function M(fe){return!fe||typeof fe!="string"?!0:fe.trim().length===0}function g(fe,ee,Q){Q===void 0&&(Q="0");for(var X=""+fe,Z=[X],ve=X.length;ve<ee;ve++)Z.push(Q);return Z.reverse().join("")}var T=/{(\d+)}/g;function D(fe){for(var ee=[],Q=1;Q<arguments.length;Q++)ee[Q-1]=arguments[Q];return ee.length===0?fe:fe.replace(T,function(X,Z){var ve=parseInt(Z,10);return isNaN(ve)||ve<0||ve>=ee.length?X:ee[ve]})}function v(fe){return fe.replace(/[<>&]/g,function(ee){switch(ee){case"<":return"<";case">":return">";case"&":return"&";default:return ee}})}function f(fe){return fe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function S(fe,ee){ee===void 0&&(ee=" ");var Q=y(fe,ee);return c(Q,ee)}function y(fe,ee){if(!fe||!ee)return fe;var Q=ee.length;if(Q===0||fe.length===0)return fe;for(var X=0;fe.indexOf(ee,X)===X;)X=X+Q;return fe.substring(X)}function c(fe,ee){if(!fe||!ee)return fe;var Q=ee.length,X=fe.length;if(Q===0||X===0)return fe;for(var Z=X,ve=-1;!(ve=fe.lastIndexOf(ee,Z-1),ve===-1||ve+Q!==Z);){if(ve===0)return"";Z=ve}return fe.substring(0,Z)}function o(fe){return fe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function r(fe,ee){if(fe.length<ee.length)return!1;if(fe===ee)return!0;for(var Q=0;Q<ee.length;Q++)if(fe[Q]!==ee[Q])return!1;return!0}function s(fe,ee){var Q=fe.length-ee.length;return Q>0?fe.indexOf(ee,Q)===Q:Q===0?fe===ee:!1}function d(fe,ee,Q){if(Q===void 0&&(Q={}),!fe)throw new Error("Cannot create regex from empty string");ee||(fe=f(fe)),Q.wholeWord&&(/\B/.test(fe.charAt(0))||(fe="\\b"+fe),/\B/.test(fe.charAt(fe.length-1))||(fe=fe+"\\b"));var X="";return Q.global&&(X+="g"),Q.matchCase||(X+="i"),Q.multiline&&(X+="m"),Q.unicode&&(X+="u"),new RegExp(fe,X)}function u(fe){if(fe.source==="^"||fe.source==="^$"||fe.source==="$"||fe.source==="^\\s*$")return!1;var ee=fe.exec("");return!!(ee&&fe.lastIndex===0)}function p(fe){return(fe.global?"g":"")+(fe.ignoreCase?"i":"")+(fe.multiline?"m":"")+(fe.unicode?"u":"")}function m(fe){for(var ee=0,Q=fe.length;ee<Q;ee++){var X=fe.charCodeAt(ee);if(X!==32&&X!==9)return ee}return-1}function i(fe,ee,Q){ee===void 0&&(ee=0),Q===void 0&&(Q=fe.length);for(var X=ee;X<Q;X++){var Z=fe.charCodeAt(X);if(Z!==32&&Z!==9)return fe.substring(ee,X)}return fe.substring(ee,Q)}function t(fe,ee){ee===void 0&&(ee=fe.length-1);for(var Q=ee;Q>=0;Q--){var X=fe.charCodeAt(Q);if(X!==32&&X!==9)return Q}return-1}function a(fe,ee){return fe<ee?-1:fe>ee?1:0}function l(fe,ee){for(var Q=Math.min(fe.length,ee.length),X=0;X<Q;X++){var Z=fe.charCodeAt(X),ve=ee.charCodeAt(X);if(Z===ve)continue;b(Z)&&(Z+=32),b(ve)&&(ve+=32);var ye=Z-ve;if(ye===0)continue;return E(Z)&&E(ve)?ye:a(fe.toLowerCase(),ee.toLowerCase())}return fe.length<ee.length?-1:fe.length>ee.length?1:0}function E(fe){return fe>=97&&fe<=122}function b(fe){return fe>=65&&fe<=90}function h(fe){return E(fe)||b(fe)}function L(fe,ee){return fe.length===ee.length&&O(fe,ee)}function O(fe,ee,Q){Q===void 0&&(Q=fe.length);for(var X=0;X<Q;X++){var Z=fe.charCodeAt(X),ve=ee.charCodeAt(X);if(Z===ve)continue;if(h(Z)&&h(ve)){var ye=Math.abs(Z-ve);if(ye!==0&&ye!==32)return!1}else if(String.fromCharCode(Z).toLowerCase()!==String.fromCharCode(ve).toLowerCase())return!1}return!0}function w(fe,ee){var Q=ee.length;return ee.length>fe.length?!1:O(fe,ee,Q)}function C(fe,ee){var Q,X=Math.min(fe.length,ee.length);for(Q=0;Q<X;Q++)if(fe.charCodeAt(Q)!==ee.charCodeAt(Q))return Q;return X}function x(fe,ee){var Q,X=Math.min(fe.length,ee.length),Z=fe.length-1,ve=ee.length-1;for(Q=0;Q<X;Q++)if(fe.charCodeAt(Z-Q)!==ee.charCodeAt(ve-Q))return Q;return X}function _(fe){return 55296<=fe&&fe<=56319}function j(fe){return 56320<=fe&&fe<=57343}function N(fe,ee,Q){var X=fe.charCodeAt(Q);if(_(X)&&Q+1<ee){var Z=fe.charCodeAt(Q+1);if(j(Z))return(X-55296<<10)+(Z-56320)+65536}return X}function P(fe,ee){var Q=fe.charCodeAt(ee-1);if(j(Q)&&ee>1){var X=fe.charCodeAt(ee-2);if(_(X))return(X-55296<<10)+(Q-56320)+65536}return Q}function V(fe,ee){var Q=re.getInstance(),X=ee,Z=fe.length,ve=N(fe,Z,ee);ee+=ve>=65536?2:1;for(var ye=Q.getGraphemeBreakType(ve);ee<Z;){var Re=N(fe,Z,ee),Je=Q.getGraphemeBreakType(Re);if(Te(ye,Je))break;ee+=Re>=65536?2:1,ye=Je}return ee-X}function z(fe,ee){var Q=re.getInstance(),X=ee,Z=P(fe,ee);ee-=Z>=65536?2:1;for(var ve=Q.getGraphemeBreakType(Z);ee>0;){var ye=P(fe,ee),Re=Q.getGraphemeBreakType(ye);if(Te(Re,ve))break;ee-=ye>=65536?2:1,ve=Re}return X-ee}var B=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function K(fe){return B.test(fe)}var U=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function W(fe){return U.test(fe)}var H=/^[\t\n\r\x20-\x7E]*$/;function q(fe){return H.test(fe)}function ne(fe){for(var ee=0,Q=fe.length;ee<Q;ee++)if(te(fe.charCodeAt(ee)))return!0;return!1}function te(fe){return fe=+fe,fe>=11904&&fe<=55215||fe>=63744&&fe<=64255||fe>=65281&&fe<=65374}function _e(fe){return fe>=127462&&fe<=127487||fe>=9728&&fe<=10175||fe>=127744&&fe<=128591||fe>=128640&&fe<=128764||fe>=128992&&fe<=129003||fe>=129280&&fe<=129535||fe>=129648&&fe<=129651||fe>=129656&&fe<=129666||fe>=129680&&fe<=129685}var Ce=String.fromCharCode(65279);function me(fe){return!!(fe&&fe.length>0&&fe.charCodeAt(0)===65279)}function Me(fe){return btoa(encodeURIComponent(fe))}function Oe(fe,ee){for(var Q="",X=0;X<ee;X++)Q+=fe;return Q}function he(fe,ee){return ee===void 0&&(ee=!1),fe?(ee&&(fe=fe.replace(/\\./g,"")),fe.toLowerCase()!==fe):!1}function ce(fe){var ee=90-65+1;return fe=fe%(2*ee),fe<ee?String.fromCharCode(97+fe):String.fromCharCode(65+fe-ee)}function se(fe){var ee=re.getInstance();return ee.getGraphemeBreakType(fe)}function Te(fe,ee){return fe===0?ee!==5&&ee!==7:fe===2&&ee===3?!1:fe===4||fe===2||fe===3||(ee===4||ee===2||ee===3)?!0:fe===8&&(ee===8||ee===9||ee===11||ee===12)||((fe===11||fe===9)&&(ee===9||ee===10)||((fe===12||fe===10)&&ee===10||(ee===5||ee===13||(ee===7||(fe===1||fe===13&&ee===14)))))?!1:!(fe===6&&ee===6)}var re=function(){function fe(){this._data=ue()}return fe.getInstance=function(){return fe._INSTANCE||(fe._INSTANCE=new fe),fe._INSTANCE},fe.prototype.getGraphemeBreakType=function(ee){if(ee<32)return ee===10?3:ee===13?2:4;if(ee<127)return 0;for(var Q=this._data,X=Q.length/3,Z=1;Z<=X;)if(ee<Q[3*Z])Z=2*Z;else if(ee>Q[3*Z+1])Z=2*Z+1;else return Q[3*Z+2];return 0},fe._INSTANCE=null,fe}();function ue(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},NFKh:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("MlIO"),R("F+F2"),R("qM6L"),R("ETIr"),R("wbyO"),R("cv67"),R("3y9D"),R("lPiR"),R("GRuw"),R("1uat"),R("uGsb"),R("5hvy"),R("ELcG"),R("WYAk"),R("e7zE"),R("K3mO"),R("OLod"),R("ALsQ"),R("9OqN"),R("qu8F"),R("S6kV"),R("gb/T"),R("qBft"),R("oRuE"),R("jO9C"),R("KmYQ"),R("uGxW"),R("bQjk"),R("wZgz"),R("pA7S"),R("w7YG"),R("E4JC"),R("PVpz"))})(this,function(M){return M})},NvD2:function(I,$,R){"use strict";R.d($,"a",function(){return f});var M=R("Kwbf");function g(S,y){var c=new Set;return S.forEach(function(o){y.has(o)||c.add(o)}),c}function T(S){var y=S||{},c=y.disabled,o=y.disableCheckbox,r=y.checkable;return!!(c||o)||r===!1}function D(S,y,c,o){for(var r=new Set(S),s=new Set,d=0;d<=c;d+=1){var u=y.get(d)||new Set;u.forEach(function(t){var a=t.key,l=t.node,E=t.children,b=E===void 0?[]:E;r.has(a)&&!o(l)&&b.filter(function(h){return!o(h.node)}).forEach(function(h){r.add(h.key)})})}for(var p=new Set,m=c;m>=0;m-=1){var i=y.get(m)||new Set;i.forEach(function(t){var a=t.parent,l=t.node;if(o(l)||!t.parent||p.has(t.parent.key))return;if(o(t.parent.node)){p.add(a.key);return}var E=!0,b=!1;(a.children||[]).filter(function(h){return!o(h.node)}).forEach(function(h){var L=h.key,O=r.has(L);E&&!O&&(E=!1),!b&&(O||s.has(L))&&(b=!0)}),E&&r.add(a.key),b&&s.add(a.key),p.add(a.key)})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(g(s,r))}}function v(S,y,c,o,r){for(var s=new Set(S),d=new Set(y),u=0;u<=o;u+=1){var p=c.get(u)||new Set;p.forEach(function(a){var l=a.key,E=a.node,b=a.children,h=b===void 0?[]:b;!s.has(l)&&!d.has(l)&&!r(E)&&h.filter(function(L){return!r(L.node)}).forEach(function(L){s.delete(L.key)})})}d=new Set;for(var m=new Set,i=o;i>=0;i-=1){var t=c.get(i)||new Set;t.forEach(function(a){var l=a.parent,E=a.node;if(r(E)||!a.parent||m.has(a.parent.key))return;if(r(a.parent.node)){m.add(l.key);return}var b=!0,h=!1;(l.children||[]).filter(function(L){return!r(L.node)}).forEach(function(L){var O=L.key,w=s.has(O);b&&!w&&(b=!1),!h&&(w||d.has(O))&&(h=!0)}),b||s.delete(l.key),h&&d.add(l.key),m.add(l.key)})}return{checkedKeys:Array.from(s),halfCheckedKeys:Array.from(g(d,s))}}function f(S,y,c,o){var r=[],s;o?s=o:s=T;var d=new Set(S.filter(function(i){var t=!!c[i];return t||r.push(i),t})),u=new Map,p=0;Object.keys(c).forEach(function(i){var t=c[i],a=t.level,l=u.get(a);l||(l=new Set,u.set(a,l)),l.add(t),p=Math.max(p,a)}),Object(M.a)(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var m;return y===!0?m=D(d,u,p,s):m=v(d,y.halfCheckedKeys,u,p,s),m}},OLod:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("K3mO"))})(this,function(M){M.lib.Cipher||function(g){var T=M,D=T.lib,v=D.Base,f=D.WordArray,S=D.BufferedBlockAlgorithm,y=T.enc,c=y.Utf8,o=y.Base64,r=T.algo,s=r.EvpKDF,d=D.Cipher=S.extend({cfg:v.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(){S.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"?C:L}return function(_){return{encrypt:function(j,N,P){return x(N).encrypt(_,j,N,P)},decrypt:function(j,N,P){return x(N).decrypt(_,j,N,P)}}}}()}),u=D.StreamCipher=d.extend({_doFinalize:function(){var x=this._process(!0);return x},blockSize:1}),p=T.mode={},m=D.BlockCipherMode=v.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=_}}),i=p.CBC=function(){var x=m.extend();x.Encryptor=x.extend({processBlock:function(j,N){var P=this._cipher,V=P.blockSize;_.call(this,j,N,V),P.encryptBlock(j,N),this._prevBlock=j.slice(N,N+V)}}),x.Decryptor=x.extend({processBlock:function(j,N){var P=this._cipher,V=P.blockSize,z=j.slice(N,N+V);P.decryptBlock(j,N),_.call(this,j,N,V),this._prevBlock=z}});function _(j,N,P){var V,z=this._iv;z?(V=z,this._iv=g):V=this._prevBlock;for(var B=0;B<P;B++)j[N+B]^=V[B]}return x}(),t=T.pad={},a=t.Pkcs7={pad:function(x,_){for(var j=_*4,N=j-x.sigBytes%j,P=N<<24|N<<16|N<<8|N,V=[],z=0;z<N;z+=4)V.push(P);var B=f.create(V,N);x.concat(B)},unpad:function(x){var _=x.words[x.sigBytes-1>>>2]&255;x.sigBytes-=_}},l=D.BlockCipher=d.extend({cfg:d.cfg.extend({mode:i,padding:a}),reset:function(){var x;d.reset.call(this);var _=this.cfg,j=_.iv,N=_.mode;this._xformMode==this._ENC_XFORM_MODE?x=N.createEncryptor:(x=N.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==x?this._mode.init(this,j&&j.words):(this._mode=x.call(N,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}),E=D.CipherParams=v.extend({init:function(x){this.mixIn(x)},toString:function(x){return(x||this.formatter).stringify(this)}}),b=T.format={},h=b.OpenSSL={stringify:function(x){var _,j=x.ciphertext,N=x.salt;return N?_=f.create([1398893684,1701076831]).concat(N).concat(j):_=j,_.toString(o)},parse:function(x){var _,j=o.parse(x),N=j.words;return N[0]==1398893684&&N[1]==1701076831&&(_=f.create(N.slice(2,4)),N.splice(0,4),j.sigBytes-=16),E.create({ciphertext:j,salt:_})}},L=D.SerializableCipher=v.extend({cfg:v.extend({format:h}),encrypt:function(x,_,j,N){N=this.cfg.extend(N);var P=x.createEncryptor(j,N),V=P.finalize(_),z=P.cfg;return E.create({ciphertext:V,key:j,iv:z.iv,algorithm:x,mode:z.mode,padding:z.padding,blockSize:x.blockSize,formatter:N.format})},decrypt:function(x,_,j,N){N=this.cfg.extend(N),_=this._parse(_,N.format);var P=x.createDecryptor(j,N).finalize(_.ciphertext);return P},_parse:function(x,_){return typeof x=="string"?_.parse(x,this):x}}),O=T.kdf={},w=O.OpenSSL={execute:function(x,_,j,N){N||(N=f.random(64/8));var P=s.create({keySize:_+j}).compute(x,N),V=f.create(P.words.slice(_),j*4);return P.sigBytes=_*4,E.create({key:P,iv:V,salt:N})}},C=D.PasswordBasedCipher=L.extend({cfg:L.cfg.extend({kdf:w}),encrypt:function(x,_,j,N){N=this.cfg.extend(N);var P=N.kdf.execute(j,x.keySize,x.ivSize);N.iv=P.iv;var V=L.encrypt.call(this,x,_,P.key,N);return V.mixIn(P),V},decrypt:function(x,_,j,N){N=this.cfg.extend(N),_=this._parse(_,N.format);var P=N.kdf.execute(j,x.keySize,x.ivSize,_.salt);N.iv=P.iv;var V=L.decrypt.call(this,x,_,P.key,N);return V}})}()})},OZM5:function(I,$,R){"use strict";R.d($,"b",function(){return o}),R.d($,"a",function(){return r}),R.d($,"k",function(){return s}),R.d($,"h",function(){return d}),R.d($,"i",function(){return u}),R.d($,"g",function(){return p}),R.d($,"c",function(){return m}),R.d($,"d",function(){return i}),R.d($,"j",function(){return l}),R.d($,"e",function(){return E}),R.d($,"f",function(){return b});var M=R("KQm4"),g=R("U8pU"),T=R("Ff2n"),D=R("q1tI"),v=R.n(D),f=R("Kwbf"),S=R("WaYH"),y=.25,c=2;function o(h,L){var O=h.slice(),w=O.indexOf(L);return w>=0&&O.splice(w,1),O}function r(h,L){var O=h.slice();return O.indexOf(L)===-1&&O.push(L),O}function s(h){return h.split("-")}function d(h,L){return"".concat(h,"-").concat(L)}function u(h){return h&&h.type&&h.type.isTreeNode}function p(h,L){var O=[h],w=L[h];function C(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];x.forEach(function(_){var j=_.key,N=_.children;O.push(j),C(N)})}return C(w.children),O}function m(h,L){var O=h.clientY,w=L.selectHandle.getBoundingClientRect(),C=w.top,x=w.bottom,_=w.height,j=Math.max(_*y,c);return O<=C+j?-1:O>=x-j?1:0}function i(h,L){if(!h)return;var O=L.multiple;return O?h.slice():h.length?[h[0]]:h}var t=function(L){return L};function a(h,L){if(!h)return[];var O=L||{},w=O.processProps,C=w===void 0?t:w,x=Array.isArray(h)?h:[h];return x.map(function(_){var j=_.children,N=Object(T.a)(_,["children"]),P=a(j,L);return v.a.createElement(S.a,Object.assign({},C(N)),P)})}function l(h){if(!h)return null;var L;if(Array.isArray(h))L={checkedKeys:h,halfCheckedKeys:void 0};else if(Object(g.a)(h)==="object")L={checkedKeys:h.checked||void 0,halfCheckedKeys:h.halfChecked||void 0};else return Object(f.a)(!1,"`checkedKeys` is not an array or an object"),null;return L}function E(h,L){var O=new Set;function w(C){if(O.has(C))return;var x=L[C];if(!x)return;O.add(C);var _=x.parent,j=x.node;if(j.disabled)return;_&&w(_.key)}return(h||[]).forEach(function(C){w(C)}),Object(M.a)(O)}function b(h){var L={};return Object.keys(h).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(L[O]=h[O])}),L}},Ot1p:function(I,$,R){"use strict";var M=R("2qtc"),g=R("kLXV"),T=R("rAM+"),D=R("miYZ"),v=R("tsqr"),f=R("9og8"),S=R("tJVT"),y=R("jrin"),c=R("WmNS"),o=R.n(c),r=R("q1tI"),s=R.n(r),d=R("VrN/"),u=R.n(d),p=R("bdgK"),m=R("p77/"),i=R("Bd2K"),t=R("ELLl"),a=R("19Vz"),l=R("lZu9"),E=R("+NIl"),b=R("kSUc"),h=R("9Bee"),L=function(Xe){var ct=Xe.value,gt=ct===void 0?"":ct,wt=Xe.className,vt=Xe.showTextOnly,Mt=Xe.showLines,Pt=Xe.style,_t=Pt===void 0?{}:Pt,rr=Object(r.useMemo)(function(){return""},[gt]);return s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{dangerouslySetInnerHTML:{__html:rr}}))},O=R("0Owb"),w=R("dejd"),C=R("C+DQ"),x=R("1vsH"),_=R("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 N(Xe){var ct=Xe.onActionCallback,gt=Xe.title,wt=Xe.icon,vt=Xe.actionName,Mt=Xe.className,Pt=Mt===void 0?"":Mt,_t=Xe.children;function rr(){ct(vt)}return s.a.createElement("a",{title:gt,className:Pt,onClick:rr},s.a.createElement("i",{className:"md-iconfont ".concat(wt)}),_t)}var P=function(Xe){var ct=Xe.watch,gt=Xe.showNullButton,wt=Xe.onActionCallback,vt=Xe.fullScreen,Mt=Xe.insertTemp,Pt=Xe.hidetoolBar,_t=Xe.uuid,rr=Xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.D)("_educoder_session"),"&key=").concat(_t,"&api=").concat(encodeURIComponent(_.a.PROXY_SERVER)));var dr=[].concat(j,[{title:"".concat(ct?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ct?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return s.a.createElement("ul",{className:"markdown-toolbar-container"},!Pt&&dr.map(function(Zt,fr){return s.a.createElement("li",{key:fr},Zt.actionName?s.a.createElement(N,Object(O.a)({},Zt,{onActionCallback:wt})):s.a.createElement("span",{className:"v-line"}))}),gt?s.a.createElement("li",null,s.a.createElement(N,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:wt},s.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Mt&&s.a.createElement("li",null,s.a.createElement(N,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Mt),onActionCallback:wt},s.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),s.a.createElement("li",{className:"btn-full-screen"},s.a.createElement(N,{icon:"".concat(vt?"icon-shrink":"icon-enlarge"),title:vt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:wt})))},V=R("M8RZ"),z=R("+L6B"),B=R("2/Rp"),K=R("y8nQ"),U=R("Vl3Y"),W=R("5NDa"),H=R("5rEg"),q={labelCol:{span:4},wrapperCol:{span:20}},ne=function(Xe){var ct=Xe.callback,gt=Xe.onCancel;function wt(vt){ct(vt)}return s.a.createElement(U.a,Object(O.a)({},q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:wt}),s.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},s.a.createElement(H.a,null)),s.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},s.a.createElement(H.a,null)),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(B.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))},te=R("7ahc"),_e=R("k1fw"),Ce=R("HmJG"),me=R("BjJ7"),Me=U.a.useForm,Oe={width:280,marginRight:10},he={labelCol:{span:5},wrapperCol:{span:19}},ce=function(Xe){var ct=Xe.callback,gt=Xe.onCancel,wt=Me(),vt=Object(S.a)(wt,1),Mt=vt[0],Pt=Object(r.useRef)();function _t(Zt){ct(Object(_e.a)(Object(_e.a)({},Zt),{},{name:Pt.current}))}function rr(Zt,fr){Mt.setFieldsValue({src:"/api/attachments/".concat(Zt.id,"?type=").concat(Zt.content_type),type:fr.type})}function dr(Zt){var fr=Zt.target.files[0];Pt.current=fr.name,Te(fr,rr)}return s.a.createElement(U.a,Object(O.a)({form:Mt},he,{className:"upload-image-panel",onFinish:_t}),s.a.createElement(U.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},s.a.createElement("div",{className:"flex-container"},s.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},s.a.createElement(H.a,{style:Oe})),s.a.createElement(se,{onFileChange:dr}))),s.a.createElement(U.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},s.a.createElement(H.a,{style:{width:264}})),s.a.createElement(U.a.Item,{style:{textAlign:"right"}},s.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(B.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))};function se(Xe){var ct=Xe.onFileChange;return s.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",s.a.createElement("input",{type:"file",onChange:ct}))}function Te(Xe,ct){if(!Xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var gt=new FormData;gt.append("editormd-image-file",Xe),gt.append("file_param_name","editormd-image-file"),gt.append("byxhr","true");var wt=new window.XMLHttpRequest;wt.withCredentials=!0,wt.addEventListener("load",function(vt){ct(JSON.parse(vt.target.responseText),Xe)},!1),wt.addEventListener("error",function(vt){console.error(vt)},!1),wt.open("POST","".concat(me.a,"/api/attachments.json")),wt.send(gt)}var re=R("giR+"),ue=R("fyUT"),fe=R("7Kak"),ee=R("9yH6"),Q=ee.a.Group,X={margin:"0 8px"},Z=function(Xe){var ct=Xe.callback,gt=Xe.onCancel;function wt(vt){ct(vt)}return s.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:wt},s.a.createElement("div",{className:"flex-container"},s.a.createElement("span",{style:X},"\u5355\u5143\u683C\u6570\uFF1A"),s.a.createElement("span",{style:X},"\u884C\u6570"),s.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},s.a.createElement(ue.a,null)),s.a.createElement("span",{style:X},"\u5217\u6570"),s.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},s.a.createElement(ue.a,null))),s.a.createElement("div",{className:"flex-container",style:{marginTop:12}},s.a.createElement("span",{style:X},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),s.a.createElement(U.a.Item,{name:"align"},s.a.createElement(Q,null,s.a.createElement(ee.a,{value:"default"},s.a.createElement("i",{className:"fa fa-align-justify"})),s.a.createElement(ee.a,{value:"left"},s.a.createElement("i",{className:"fa fa-align-left"})),s.a.createElement(ee.a,{value:"center"},s.a.createElement("i",{className:"fa fa-align-center"})),s.a.createElement(ee.a,{value:"right"},s.a.createElement("i",{className:"fa fa-align-right"}))))),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(B.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))},ve=R("ErOA"),ye=R("7Cbv"),Re="link",Je="upload-image",Ze="code-block",rt="add-table",tt="------------",st={default:tt,left:":".concat(tt),center:":".concat(tt,":"),right:"".concat(tt,":")},ot=R("9VGf"),Fe,Ae;function qe(){}var ut=0,$e=1e4,nt="\u2581",je=`
|
|
|
**\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 De(Xe){return/^\d+$/.test(Xe)?"".concat(Xe,"px"):Xe}var Pe=navigator.platform.toUpperCase().indexOf("MAC")>=0,xe=Pe?"Cmd":"Ctrl",Se=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Le=(Fe={},Object(y.a)(Fe,xe+"-B","bold"),Object(y.a)(Fe,xe+"-I","italic"),Fe),Ne=(Ae={},Object(y.a)(Ae,Re,"\u6DFB\u52A0\u94FE\u63A5"),Object(y.a)(Ae,Ze,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(y.a)(Ae,Je,"\u6DFB\u52A0\u6587\u4EF6"),Object(y.a)(Ae,rt,"\u6DFB\u52A0\u8868\u683C"),Ae),et=$.a=function(Xe){var ct=Xe.defaultValue,gt=ct===void 0?"":ct,wt=Xe.onChange,vt=Xe.width,Mt=vt===void 0?"100%":vt,Pt=Xe.height,_t=Pt===void 0?400:Pt,rr=Xe.miniToolbar,dr=rr===void 0?!1:rr,Zt=Xe.isFocus,fr=Zt===void 0?!1:Zt,Ht=Xe.watch,Mr=Xe.insertTemp,Sr=Xe.mode,Tt=Sr===void 0?"markdown":Sr,Ot=Xe.id,Rt=Ot===void 0?"markdown-editor-id":Ot,Bt=Xe.showResizeBar,lr=Bt===void 0?!1:Bt,sn=Xe.noStorage,yt=sn===void 0?!1:sn,kt=Xe.showNullButton,Ct=kt===void 0?!1:kt,Ar=Xe.hidetoolBar,Wr=Ar===void 0?!1:Ar,Yt=Xe.fullScreen,Ut=Yt===void 0?!1:Yt,Pr=Xe.onBlur,yn=Xe.onCMBeforeChange,Vr=Xe.onFullScreen,dt=Xe.className,At=dt===void 0?"":dt,$t=Xe.disablePaste,hr=$t===void 0?!1:$t,vr=Xe.placeholder,Er=vr===void 0?"":vr,ae=Xe.values,G=ae===void 0?"":ae,Y=Object(r.useState)(null),ie=Object(S.a)(Y,2),de=ie[0],oe=ie[1],ze=Object(r.useState)(gt),ft=Object(S.a)(ze,2),St=ft[0],Ft=ft[1],mt=Object(r.useState)(Ht),Gt=Object(S.a)(mt,2),Vt=Gt[0],Hr=Gt[1],cn=Object(r.useState)(Ut),rn=Object(S.a)(cn,2),tr=rn[0],$r=rn[1],pr=Object(r.useState)(""),qt=Object(S.a)(pr,2),sr=qt[0],gr=qt[1],en=Object(r.useState)(0),fn=Object(S.a)(en,2),Sn=fn[0],wi=fn[1],Vi=Object(r.useState)(_t),Ui=Object(S.a)(Vi,2),Zn=Ui[0],ln=Ui[1],Ri=Object(r.useState)(!1),dn=Object(S.a)(Ri,2),hi=dn[0],Jr=dn[1],ur=Object(r.useRef)(Object(ye.a)()),nn=Object(r.useRef)(!1),Ir=Object(r.useRef)(),mn=Object(r.useRef)(),Nr=Object(r.useRef)(),fi=Object(r.useRef)(),gn=Object(r.useRef)(),zn=function(){var zt=Object(f.a)(o.a.mark(function er(){var Jt,yr;return o.a.wrap(function(Qr){for(;;)switch(Qr.prev=Qr.next){case 0:return Qr.next=2,Object(ve.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ur.current}});case 2:yr=Qr.sent,yr!=null&&(Jt=yr.attachments)!==null&&Jt!==void 0&&Jt.length&&(console.log("cm:",de,mn),yr.attachments.map(function(Tr){Tr.content_type.indexOf("image")>-1?de.replaceSelection(".concat(Tr.content_type,")")):Tr.content_type.indexOf("video")>-1?de.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Tr.content_type.indexOf("pdf")>-1?de.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(Tr.id,"?type=").concat(Tr.content_type,'&disposition=inline" target="_blank">').concat(Tr.name,"</a>")):de.replaceSelection("[".concat(Tr.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(Tr.id,"?type=").concat(Tr.content_type,")"))}));case 4:case"end":return Qr.stop()}},er)}));return function(){return zt.apply(this,arguments)}}();Object(r.useEffect)(function(){Ft(G),de==null||de.setValue(G)},[G]),Object(r.useEffect)(function(){Vr==null||Vr(tr)},[tr]),Object(r.useEffect)(function(){if(mn.current){var zt=u.a.fromTextArea(mn.current,{mode:Tt,lineNumbers:!dr,lineWrapping:!0,value:gt,autoCloseTags:!0,autoCloseBrackets:!0});fr&&zt.focus();function er(Jt,yr){if(hr){yr.preventDefault();return}var Rr=yr.clipboardData;if(Rr){var Qr=Rr.types.toString(),Tr=Rr.items;if(Qr==="Files"||Rr.types.indexOf("Files")>-1){if(yr.preventDefault(),Tt=="stex")return;try{var Rn,Kn=Tr[1];((Rn=Tr[0])===null||Rn===void 0?void 0:Rn.kind)==="file"&&(Kn=Tr[0]);var wr=Kn.getAsFile(),ji=wr.name.split(".").pop();Te(wr,function(Fr){if(Fr.id){var Pn,mi,ei;(wr==null||((Pn=wr.type)===null||Pn===void 0)?void 0:Pn.indexOf("image"))>-1?zt.replaceSelection(".concat(Fr.content_type,")")):(wr==null||((mi=wr.type)===null||mi===void 0)?void 0:mi.indexOf("video"))>-1?zt.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(Fr.id,'"></video>')):(wr==null||((ei=wr.type)===null||ei===void 0)?void 0:ei.indexOf("pdf"))>-1?zt.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(Fr.id,"?type=").concat(wr.type,'&disposition=inline" target="_blank">').concat(wr.name,"</a>")):Se.includes(ji)?zt.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(Fr.id,'?type=office&disposition=inline" target="_blank">').concat(wr.name,"</a>")):zt.replaceSelection("[".concat(wr.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(Fr.id,"?type=").concat(Fr.content_type,")"))}else(Fr==null?void 0:Fr.status)===401&&(document.location.href="/user/login")})}catch(Fr){v.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return zt.on("paste",er),zt.on("dragleave",function(Jt,yr){Nr.current.classList.remove("mouse-hover-md")}),zt.on("dragover",function(Jt,yr){Nr.current.classList.add("mouse-hover-md")}),zt.on("drop",function(Jt,yr){Nr.current.classList.add("mouse-hover-md");var Rr;if(Rr=yr.dataTransfer.files,Rr.length>0){yr.preventDefault(),yr.stopPropagation();for(var Qr=function(Kn){var wr=Rr[Kn],ji=wr.name.split(".").pop();Te(wr,function(Fr){if(Fr.id){var Pn,mi,ei;(wr==null||((Pn=wr.type)===null||Pn===void 0)?void 0:Pn.indexOf("image"))>-1?zt.replaceSelection(".concat(Fr.content_type,")")):(wr==null||((mi=wr.type)===null||mi===void 0)?void 0:mi.indexOf("video"))>-1?zt.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(Fr.id,'"></video>')):(wr==null||((ei=wr.type)===null||ei===void 0)?void 0:ei.indexOf("pdf"))>-1?zt.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(Fr.id,"?type=").concat(wr.type,'&disposition=inline" target="_blank">').concat(wr.name,"</a>")):Se.includes(ji)?zt.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(Fr.id,'?type=office&disposition=inline" target="_blank">').concat(wr.name,"</a>")):zt.replaceSelection("[".concat(wr.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(Fr.id,"?type=").concat(Fr.content_type,")"))}else(Fr==null?void 0:Fr.status)===401&&(document.location.href="/user/login")})},Tr=0;Tr<Rr.length;Tr++)Qr(Tr)}}),oe(zt),function(){zt.off("paste",er)}}},[]);var Di=Object(r.useCallback)(function(){if(Nr.current)try{}catch(zt){console.log(zt,"---- to set md editor body height")}},[Zn,Nr,tr]);Object(r.useEffect)(function(){function zt(){var Jt=new p.default(function(yr){var Rr=Object(T.a)(yr),Qr;try{for(Rr.s();!(Qr=Rr.n()).done;){var Tr=Qr.value;(Tr.target.offsetHeight>0||Tr.target.offsetWidth>0)&&(Di(),de.setSize("100%","100%"),de.refresh())}}catch(Rn){Rr.e(Rn)}finally{Rr.f()}});return Jt.observe(mn.current.parentElement),Jt}if(de){var er=zt();return function(){er.unobserve(mn.current.parentElement)}}},[de,Di]),Object(r.useEffect)(function(){if(de){for(var zt=[],er=function(){var Tr=yr[Jt];Rr=Object(S.a)(Tr,2);var Rn=Rr[0],Kn=Rr[1],wr=Object(y.a)({},Rn,function(){yi(Kn)});zt.push(wr),de.addKeyMap(wr)},Jt=0,yr=Object.entries(Le);Jt<yr.length;Jt++){var Rr;er()}return Ir.current=setInterval(function(){nn.current&&zn()},4e3),function(){clearInterval(Ir.current);var Qr=Object(T.a)(zt),Tr;try{for(Qr.s();!(Tr=Qr.n()).done;){var Rn=Tr.value;de.removeKeyMap(Rn)}}catch(Kn){Qr.e(Kn)}finally{Qr.f()}}}},[de]),Object(r.useEffect)(function(){Ut!==tr&&$r(Ut)},[Ut]),Object(ot.a)(function(){if(!yt&&Sn>0){var zt=new Date().getTime(),er=window.sessionStorage.getItem(Rt);zt>=Sn+$e&&(!er||er!==St)&&(window.sessionStorage.setItem(Rt,St),Jr(!0))}},$e),Object(r.useEffect)(function(){Hr(Ht)},[de,Ht]),Object(r.useEffect)(function(){de&&(fr&&de.focus())},[de,fr]),Object(r.useEffect)(function(){if(Vt&&de){var zt=de.getScrollerElement();function er(Jt){var yr=Jt.target;if(gn.current){var Rr=yr.scrollTop/yr.scrollHeight;gn.current.scrollTop=gn.current.scrollHeight*Rr}}return zt.addEventListener("scroll",er),function(){zt.removeEventListener("scroll",er)}}},[de,Vt]),Object(r.useEffect)(function(){if(de&&yn){function zt(er,Jt){yn(er,Jt)}return de.on("beforeChange",zt),function(){de.off("beforeChange",zt)}}},[de,yn]),Object(r.useEffect)(function(){if(de&&Pr){function zt(){Pr(de.getValue())}return de.on("blur",zt),function(){de.off("blur",zt)}}},[de,Pr]),Object(r.useEffect)(function(){if(de){function zt(er){var Jt=er.getValue();Ft(Jt),wi(new Date().getTime()),er.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),wt&&wt(Jt)}return de.on("change",zt),function(){de.off("change",zt)}}},[de,wt]),Object(r.useEffect)(function(){de&&(gt==null?(de.setValue(""),Ft("")):gt!==de.getValue()&&(de.setValue(gt),Ft(gt),de.setCursor(de.lineCount(),0)))},[de,gt]);var yi=Object(r.useCallback)(function(zt){var er=de.getCursor(),Jt=de.getSelection(),yr=Jt.split(`
|
|
|
`);switch(zt){case"bold":return de.replaceSelection("**"+Jt+"**"),Jt===""&&de.setCursor(er.line,er.ch+2),de.focus();case"italic":return de.replaceSelection("*"+Jt+"*"),Jt===""&&de.setCursor(er.line,er.ch+1),de.focus();case"code":return de.replaceSelection("`"+Jt+"`"),Jt===""&&de.setCursor(er.line,er.ch+1),de.focus();case"inline-latex":return de.replaceSelection("`$$"+Jt+"$$`"),Jt===""&&de.setCursor(er.line,er.ch+3),de.focus();case"latex":return de.replaceSelection("```latex\n"+Jt+"\n```"),de.setCursor(er.line+1,Jt.length+1),de.focus();case"line-break":return de.replaceSelection(`<br/>
|
|
|
`),de.focus();case"list-ul":return Jt===""?de.replaceSelection("- "+Jt):de.replaceSelection(yr.map(function(Rr){return Rr===""?"":"- ".concat(Rr)}).join(`
|
|
|
`)),de.focus();case"list-ol":return Jt===""?de.replaceSelection("1. "+Jt):de.replaceSelection(yr.map(function(Rr,Qr){return Rr===""?"":"".concat(Qr+1,". ").concat(Rr)}).join(`
|
|
|
`)),de.focus();case"add-null-ch":return Jt===""&&de.setCursor(er.line,er.ch+1),de.replaceSelection(nt),de.focus();case"inster-template-1":return Jt===""&&de.setCursor(er.line,er.ch),de.replaceSelection(je),de.focus();case"eraser":return de.setValue(""),de.focus();case"trigger-watch":return Hr(!Vt),de.focus();case"trigger-full-screen":return $r(!tr),de.focus();case Re:gr(Re);return;case Ze:gr(Ze);return;case Je:gr(Je);return;case rt:gr(rt);return;default:throw new Error}},[de,Vt,tr]),qn=Object(r.useCallback)(function(zt){gr("");switch(sr){case Re:var er=zt.title,Jt=zt.link;return de.replaceSelection("[".concat(er,"](").concat(Jt,")")),de.focus();case Ze:var yr=zt.language,Rr=zt.content;return de.replaceSelection(["```"+yr,Rr,"```"].join(`
|
|
|
`)),de.focus();case Je:var Qr=zt.src,Tr=zt.alt,Rn=zt.name;return Qr.indexOf("type=image")>-1?de.replaceSelection(".concat(Qr,' "').concat(Tr||"",'" )')):Qr.indexOf("type=application/pdf")>-1?de.replaceSelection('<a href="'.concat(Qr,'&disposition=inline" target="_blank">').concat(Rn,"</a>")):de.replaceSelection('<a href="'.concat(Qr,'" target="_blank">').concat(Rn,"</a>")),de.focus();case rt:for(var Kn=zt.row,wr=zt.col,ji=zt.align,Fr=`
|
|
|
`,Pn=0;Pn<Kn;Pn++){for(var mi=[],ei=[],zr=0;zr<wr;zr++)Pn===1&&ei.push(st[ji]),mi.push(" ");Pn===1&&(Fr+="| ".concat(ei.join(" | "),` |
|
|
|
`)),Fr+="| ".concat(mi.join(wr===1?"":" | "),` |
|
|
|
`)}return de.replaceSelection(Fr+`
|
|
|
`),de.focus();default:throw new Error}},[de,sr]),Ci=Object(r.useMemo)(function(){switch(sr){case Re:return s.a.createElement(ne,{callback:qn,onCancel:Fn});case Ze:return s.a.createElement(te.b,{callback:qn,onCancel:Fn});case Je:return s.a.createElement(ce,{callback:qn,onCancel:Fn});case rt:return s.a.createElement(Z,{callback:qn,onCancel:Fn});default:return null}},[sr]);function Fn(){gr("")}Object(r.useEffect)(function(){if(fi.current){var zt=fi.current,er=!1,Jt=0;function yr(Tr){er=!0,Jt=Tr.pageY}function Rr(){er=!1}function Qr(Tr){if(er){var Rn=Tr.pageY-Jt;Rn<0&&(Rn=0),Rn>300&&(Rn=300);var Kn=_t+Rn+"px";ln(Kn)}}return zt.addEventListener("mousedown",yr),document.addEventListener("mousemove",Qr),document.addEventListener("mouseup",Rr),function(){zt.removeEventListener("mousedown",yr),document.removeEventListener("mousemove",Qr),document.removeEventListener("mouseup",Rr)}}},[de,fi]),Object(r.useEffect)(function(){ln(_t)},[_t]);var Ni=De(Mt),si=De(Zn),pi={width:Ni,height:si},Bi=Object(r.useMemo)(function(){if(Sn){var zt=new Date(Sn),er=zt.getHours(),Jt=zt.getMinutes(),yr=zt.getSeconds();return er=er<10?"0"+er:er,Jt=Jt<10?"0"+Jt:Jt,yr=yr<10?"0"+yr:yr,"".concat(er,":").concat(Jt,":").concat(yr)}return 0},[Sn]);function li(){window.sessionStorage.removeItem(Rt),Jr(!1),wi(0)}function an(){Jr(!1),wi(0),de.setValue(window.sessionStorage.getItem(Rt))}function Qi(zt,er){var Jt=de.getValue();Jt=Jt.replace(zt,er),Ft(Jt),de==null||de.setValue(Jt)}return s.a.createElement(r.Fragment,null,s.a.createElement("div",{className:"markdown-editor-wrapper",ref:Nr},s.a.createElement("div",{className:"markdown-editor-container ".concat(At," ").concat(Vt?"on-preview":""," ").concat(dr?"mini":""," ").concat(tr?"full-screen":""),style:pi},s.a.createElement(P,{insertTemp:Mr,watch:Vt,fullScreen:tr,showNullButton:Ct,onActionCallback:yi,hidetoolBar:Wr,uuid:ur.current,setOpenPhones:function(){nn.current=!0}}),s.a.createElement("div",{className:"markdown-editor-body"},s.a.createElement("div",{className:"codemirror-container"},s.a.createElement("textarea",{ref:mn,placeholder:Er})),Vt?s.a.createElement("div",{ref:gn,className:"preview-container"},Tt==="stex"&&s.a.createElement(L,{value:St}),Tt!=="stex"&&s.a.createElement(h.a,{edit:!0,value:St,replaces:Qi})):null))),lr?s.a.createElement("a",{ref:fi,className:"editor-resize"}):null,s.a.createElement(V.a,null,Ne[sr]?s.a.createElement(g.a,{centered:!0,title:Ne[sr],visible:!0,onCancel:Fn,footer:null},Ci):null))}},PD8m:function(I,$){I.exports={name:"memoryStorage",read:M,write:g,each:T,remove:D,clearAll:v};var R={};function M(f){return R[f]}function g(f,S){R[f]=S}function T(f){for(var S in R)R.hasOwnProperty(S)&&f(R[S],S)}function D(f){delete R[f]}function v(f){R={}}},PVpz:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("ETIr"),R("cv67"),R("K3mO"),R("OLod"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.StreamCipher,v=g.algo,f=[],S=[],y=[],c=v.RabbitLegacy=D.extend({_doReset:function(){var r=this._key.words,s=this.cfg.iv,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],u=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++)o.call(this);for(var p=0;p<8;p++)u[p]^=d[p+4&7];if(s){var m=s.words,i=m[0],t=m[1],a=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,l=(t<<8|t>>>24)&16711935|(t<<24|t>>>8)&4278255360,E=a>>>16|l&4294901760,b=l<<16|a&65535;u[0]^=a,u[1]^=E,u[2]^=l,u[3]^=b,u[4]^=a,u[5]^=E,u[6]^=l,u[7]^=b;for(var p=0;p<4;p++)o.call(this)}},_doProcessBlock:function(r,s){var d=this._X;o.call(this),f[0]=d[0]^d[5]>>>16^d[3]<<16,f[1]=d[2]^d[7]>>>16^d[5]<<16,f[2]=d[4]^d[1]>>>16^d[7]<<16,f[3]=d[6]^d[3]>>>16^d[1]<<16;for(var u=0;u<4;u++)f[u]=(f[u]<<8|f[u]>>>24)&16711935|(f[u]<<24|f[u]>>>8)&4278255360,r[s+u]^=f[u]},blockSize:128/32,ivSize:64/32});function o(){for(var r=this._X,s=this._C,d=0;d<8;d++)S[d]=s[d];s[0]=s[0]+1295307597+this._b|0,s[1]=s[1]+3545052371+(s[0]>>>0<S[0]>>>0?1:0)|0,s[2]=s[2]+886263092+(s[1]>>>0<S[1]>>>0?1:0)|0,s[3]=s[3]+1295307597+(s[2]>>>0<S[2]>>>0?1:0)|0,s[4]=s[4]+3545052371+(s[3]>>>0<S[3]>>>0?1:0)|0,s[5]=s[5]+886263092+(s[4]>>>0<S[4]>>>0?1:0)|0,s[6]=s[6]+1295307597+(s[5]>>>0<S[5]>>>0?1:0)|0,s[7]=s[7]+3545052371+(s[6]>>>0<S[6]>>>0?1:0)|0,this._b=s[7]>>>0<S[7]>>>0?1:0;for(var d=0;d<8;d++){var u=r[d]+s[d],p=u&65535,m=u>>>16,i=((p*p>>>17)+p*m>>>15)+m*m,t=((u&4294901760)*u|0)+((u&65535)*u|0);y[d]=i^t}r[0]=y[0]+(y[7]<<16|y[7]>>>16)+(y[6]<<16|y[6]>>>16)|0,r[1]=y[1]+(y[0]<<8|y[0]>>>24)+y[7]|0,r[2]=y[2]+(y[1]<<16|y[1]>>>16)+(y[0]<<16|y[0]>>>16)|0,r[3]=y[3]+(y[2]<<8|y[2]>>>24)+y[1]|0,r[4]=y[4]+(y[3]<<16|y[3]>>>16)+(y[2]<<16|y[2]>>>16)|0,r[5]=y[5]+(y[4]<<8|y[4]>>>24)+y[3]|0,r[6]=y[6]+(y[5]<<16|y[5]>>>16)+(y[4]<<16|y[4]>>>16)|0,r[7]=y[7]+(y[6]<<8|y[6]>>>24)+y[5]|0}g.RabbitLegacy=D._createHelper(c)}(),M.RabbitLegacy})},QDVR:function(I,$,R){"use strict";R.d($,"e",function(){return g}),R.d($,"d",function(){return T}),R.d($,"c",function(){return S}),R.d($,"b",function(){return y}),R.d($,"a",function(){return o});var M=function(){var r=function(s,d){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var m in p)p.hasOwnProperty(m)&&(u[m]=p[m])},r(s,d)};return function(s,d){r(s,d);function u(){this.constructor=s}s.prototype=d===null?Object.create(d):(u.prototype=d.prototype,new u)}}();function g(r){var s=[];return r.forEach(function(d){return s.push(d)}),s}function T(r){var s=[];return r.forEach(function(d,u){return s.push(u)}),s}var D=function(){function r(){this._value="",this._pos=0}return r.prototype.reset=function(s){return this._value=s,this._pos=0,this},r.prototype.next=function(){return this._pos+=1,this},r.prototype.hasNext=function(){return this._pos<this._value.length-1},r.prototype.cmp=function(s){var d=s.charCodeAt(0),u=this._value.charCodeAt(this._pos);return d-u},r.prototype.value=function(){return this._value[this._pos]},r}(),v=function(){function r(s){s===void 0&&(s=!0),this._splitOnBackslash=s}return r.prototype.reset=function(s){return this._value=s.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},r.prototype.hasNext=function(){return this._to<this._value.length},r.prototype.next=function(){this._from=this._to;for(var s=!0;this._to<this._value.length;this._to++){var d=this._value.charCodeAt(this._to);if(d===47||this._splitOnBackslash&&d===92)if(s)this._from++;else break;else s=!1}return this},r.prototype.cmp=function(s){for(var d=0,u=s.length,p=this._from;d<u&&p<this._to;){var m=s.charCodeAt(d)-this._value.charCodeAt(p);if(m!==0)return m;d+=1,p+=1}return u===this._to-this._from?0:d<u?-1:1},r.prototype.value=function(){return this._value.substring(this._from,this._to)},r}(),f=function(){function r(){}return r}(),S=function(){function r(s){this._iter=s}return r.forPaths=function(){return new r(new v)},r.forStrings=function(){return new r(new D)},r.prototype.clear=function(){this._root=void 0},r.prototype.set=function(s,d){var u=this._iter.reset(s),p;for(this._root||(this._root=new f,this._root.segment=u.value()),p=this._root;;){var m=u.cmp(p.segment);if(m>0)p.left||(p.left=new f,p.left.segment=u.value()),p=p.left;else if(m<0)p.right||(p.right=new f,p.right.segment=u.value()),p=p.right;else if(u.hasNext())u.next(),p.mid||(p.mid=new f,p.mid.segment=u.value()),p=p.mid;else break}var i=p.value;return p.value=d,p.key=s,i},r.prototype.get=function(s){for(var d=this._iter.reset(s),u=this._root;u;){var p=d.cmp(u.segment);if(p>0)u=u.left;else if(p<0)u=u.right;else if(d.hasNext())d.next(),u=u.mid;else break}return u?u.value:void 0},r.prototype.findSubstr=function(s){for(var d=this._iter.reset(s),u=this._root,p=void 0;u;){var m=d.cmp(u.segment);if(m>0)u=u.left;else if(m<0)u=u.right;else if(d.hasNext())d.next(),p=u.value||p,u=u.mid;else break}return u&&u.value||p},r.prototype.forEach=function(s){this._forEach(this._root,s)},r.prototype._forEach=function(s,d){s&&(this._forEach(s.left,d),s.value&&d(s.value,s.key),this._forEach(s.mid,d),this._forEach(s.right,d))},r}(),y=function(){function r(){this.map=new Map,this.ignoreCase=!1}return r.prototype.set=function(s,d){this.map.set(this.toKey(s),d)},r.prototype.get=function(s){return this.map.get(this.toKey(s))},r.prototype.toKey=function(s){var d=s.toString();return this.ignoreCase&&(d=d.toLowerCase()),d},r}(),c=function(){function r(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return r.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),r.prototype.get=function(s,d){d===void 0&&(d=0);var u=this._map.get(s);return u?(d!==0&&this.touch(u,d),u.value):void 0},r.prototype.set=function(s,d,u){u===void 0&&(u=0);var p=this._map.get(s);if(p)p.value=d,u!==0&&this.touch(p,u);else{p={key:s,value:d,next:void 0,previous:void 0};switch(u){case 0:this.addItemLast(p);break;case 1:this.addItemFirst(p);break;case 2:this.addItemLast(p);break;default:this.addItemLast(p);break}this._map.set(s,p),this._size++}},r.prototype.delete=function(s){return!!this.remove(s)},r.prototype.remove=function(s){var d=this._map.get(s);return d?(this._map.delete(s),this.removeItem(d),this._size--,d.value):void 0},r.prototype.forEach=function(s,d){for(var u=this._head;u;)d?s.bind(d)(u.value,u.key,this):s(u.value,u.key,this),u=u.next},r.prototype.trimOld=function(s){if(s>=this.size)return;if(s===0){this.clear();return}for(var d=this._head,u=this.size;d&&u>s;)this._map.delete(d.key),d=d.next,u--;this._head=d,this._size=u,d&&(d.previous=void 0)},r.prototype.addItemFirst=function(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s},r.prototype.addItemLast=function(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s},r.prototype.removeItem=function(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{var d=s.next,u=s.previous;if(!d||!u)throw new Error("Invalid list");d.previous=u,u.next=d}s.next=void 0,s.previous=void 0},r.prototype.touch=function(s,d){if(!this._head||!this._tail)throw new Error("Invalid list");if(d!==1&&d!==2)return;if(d===1){if(s===this._head)return;var u=s.next,p=s.previous;s===this._tail?(p.next=void 0,this._tail=p):(u.previous=p,p.next=u),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s}else if(d===2){if(s===this._tail)return;var u=s.next,p=s.previous;s===this._head?(u.previous=void 0,this._head=u):(u.previous=p,p.next=u),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s}},r.prototype.toJSON=function(){var s=[];return this.forEach(function(d,u){s.push([u,d])}),s},r}(),o=function(r){M(s,r);function s(d,u){u===void 0&&(u=1);var p=r.call(this)||this;return p._limit=d,p._ratio=Math.min(Math.max(0,u),1),p}return s.prototype.get=function(d){return r.prototype.get.call(this,d,2)},s.prototype.peek=function(d){return r.prototype.get.call(this,d,0)},s.prototype.set=function(d,u){r.prototype.set.call(this,d,u,2),this.checkTrim()},s.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},s}(c)},RELg:function(I,$,R){var M=R("MFOe"),g=M.Global;I.exports={name:"oldIE-userDataStorage",write:S,read:y,each:c,remove:o,clearAll:r};var T="storejs",D=g.document,v=u(),f=(g.navigator?g.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function S(p,m){if(f)return;var i=d(p);v(function(t){t.setAttribute(i,m),t.save(T)})}function y(p){if(f)return;var m=d(p),i=null;return v(function(t){i=t.getAttribute(m)}),i}function c(p){v(function(m){for(var i=m.XMLDocument.documentElement.attributes,t=i.length-1;t>=0;t--){var a=i[t];p(m.getAttribute(a.name),a.name)}})}function o(p){var m=d(p);v(function(i){i.removeAttribute(m),i.save(T)})}function r(){v(function(p){var m=p.XMLDocument.documentElement.attributes;p.load(T);for(var i=m.length-1;i>=0;i--)p.removeAttribute(m[i].name);p.save(T)})}var s=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function d(p){return p.replace(/^\d/,"___$&").replace(s,"___")}function u(){if(!D||!D.documentElement||!D.documentElement.addBehavior)return null;var p="script",m,i,t;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+p+">document.w=window</"+p+'><iframe src="/favicon.ico"></iframe>'),i.close(),m=i.w.frames[0].document,t=m.createElement("div")}catch(a){t=D.createElement("div"),m=D.body}return function(a){var l=[].slice.call(arguments,0);l.unshift(t),m.appendChild(t),t.addBehavior("#default#userData"),t.load(T),a.apply(this,l),m.removeChild(t);return}}},S6kV:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.mode.OFB=function(){var g=M.lib.BlockCipherMode.extend(),T=g.Encryptor=g.extend({processBlock:function(D,v){var f=this._cipher,S=f.blockSize,y=this._iv,c=this._keystream;y&&(c=this._keystream=y.slice(0),this._iv=void 0),f.encryptBlock(c,0);for(var o=0;o<S;o++)D[v+o]^=c[o]}});return g.Decryptor=T,g}(),M.mode.OFB})},"SA+Z":function(I,$,R){var M=R("wTVA"),g=R("EbDI"),T=R("ZhPi"),D=R("wkBT");function v(f){return M(f)||g(f)||T(f)||D()}I.exports=v,I.exports.__esModule=!0,I.exports.default=I.exports},SJMd:function(I,$){/**
|
|
|
* @license
|
|
|
* Copyright (C) 2006 Google Inc.
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
* You may obtain a copy of the License at
|
|
|
*
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
*
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*/var R,M,g,T=!1,D,v;window.PR_SHOULD_USE_CONTINUATION=!0;var f,S;(function(){var y=window,c=["break,continue,do,else,for,if,return,while"],o=[c,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],r=[o,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],s=[r,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],d=[r,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[r,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],p="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",m=[r,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",t=[c,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],a=[c,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],l=[c,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],E=[s,u,d,m,i,t,a,l],b=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",L="kwd",O="com",w="typ",C="lit",x="pun",_="pln",j="tag",N="dec",P="src",V="atn",z="atv",B="nocode",K="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(ee){for(var Q=0,X=!1,Z=!1,ve=0,ye=ee.length;ve<ye;++ve){var Re=ee[ve];if(Re.ignoreCase)Z=!0;else if(/[a-z]/i.test(Re.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){X=!0,Z=!1;break}}var Je={b:8,t:9,n:10,v:11,f:12,r:13};function Ze(Fe){var Ae=Fe.charCodeAt(0);if(Ae!==92)return Ae;var qe=Fe.charAt(1);return Ae=Je[qe],Ae||("0"<=qe&&qe<="7"?parseInt(Fe.substring(1),8):qe==="u"||qe==="x"?parseInt(Fe.substring(2),16):Fe.charCodeAt(1))}function rt(Fe){if(Fe<32)return(Fe<16?"\\x0":"\\x")+Fe.toString(16);var Ae=String.fromCharCode(Fe);return Ae==="\\"||Ae==="-"||Ae==="]"||Ae==="^"?"\\"+Ae:Ae}function tt(Fe){var Ae=Fe.substring(1,Fe.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),qe=[],ut=Ae[0]==="^",$e=["["];ut&&$e.push("^");for(var nt=ut?1:0,je=Ae.length;nt<je;++nt){var De=Ae[nt];if(/\\[bdsw]/i.test(De))$e.push(De);else{var Pe=Ze(De),xe;nt+2<je&&Ae[nt+1]==="-"?(xe=Ze(Ae[nt+2]),nt+=2):xe=Pe,qe.push([Pe,xe]),xe<65||Pe>122||(xe<65||Pe>90||qe.push([Math.max(65,Pe)|32,Math.min(xe,90)|32]),xe<97||Pe>122||qe.push([Math.max(97,Pe)&~32,Math.min(xe,122)&~32]))}}qe.sort(function(et,Xe){return et[0]-Xe[0]||Xe[1]-et[1]});for(var Se=[],Le=[],nt=0;nt<qe.length;++nt){var Ne=qe[nt];Ne[0]<=Le[1]+1?Le[1]=Math.max(Le[1],Ne[1]):Se.push(Le=Ne)}for(var nt=0;nt<Se.length;++nt){var Ne=Se[nt];$e.push(rt(Ne[0])),Ne[1]>Ne[0]&&(Ne[1]+1>Ne[0]&&$e.push("-"),$e.push(rt(Ne[1])))}return $e.push("]"),$e.join("")}function st(Fe){for(var Ae=Fe.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")),qe=Ae.length,ut=[],$e=0,nt=0;$e<qe;++$e){var je=Ae[$e];if(je==="(")++nt;else if(je.charAt(0)==="\\"){var De=+je.substring(1);De&&(De<=nt?ut[De]=-1:Ae[$e]=rt(De))}}for(var $e=1;$e<ut.length;++$e)ut[$e]===-1&&(ut[$e]=++Q);for(var $e=0,nt=0;$e<qe;++$e){var je=Ae[$e];if(je==="(")++nt,ut[nt]||(Ae[$e]="(?:");else if(je.charAt(0)==="\\"){var De=+je.substring(1);De&&De<=nt&&(Ae[$e]="\\"+ut[De])}}for(var $e=0;$e<qe;++$e)Ae[$e]==="^"&&Ae[$e+1]!=="^"&&(Ae[$e]="");if(Fe.ignoreCase&&X)for(var $e=0;$e<qe;++$e){var je=Ae[$e],Pe=je.charAt(0);je.length>=2&&Pe==="["?Ae[$e]=tt(je):Pe!=="\\"&&(Ae[$e]=je.replace(/[a-zA-Z]/g,function(Le){var Ne=Le.charCodeAt(0);return"["+String.fromCharCode(Ne&~32,Ne|32)+"]"}))}return Ae.join("")}for(var ot=[],ve=0,ye=ee.length;ve<ye;++ve){var Re=ee[ve];if(Re.global||Re.multiline)throw new Error(""+Re);ot.push("(?:"+st(Re)+")")}return new RegExp(ot.join("|"),Z?"gi":"g")}function W(ee,Q){var X=/(?:^|\s)nocode(?:\s|$)/,Z=[],ve=0,ye=[],Re=0;function Je(Ze){var rt=Ze.nodeType;if(rt==1){if(X.test(Ze.className))return;for(var tt=Ze.firstChild;tt;tt=tt.nextSibling)Je(tt);var st=Ze.nodeName.toLowerCase();(st==="br"||st==="li")&&(Z[Re]=`
|
|
|
`,ye[Re<<1]=ve++,ye[Re++<<1|1]=Ze)}else if(rt==3||rt==4){var ot=Ze.nodeValue;ot.length&&(Q?ot=ot.replace(/\r\n?/g,`
|
|
|
`):ot=ot.replace(/[ \t\r\n]+/g," "),Z[Re]=ot,ye[Re<<1]=ve,ve+=ot.length,ye[Re++<<1|1]=Ze)}}return Je(ee),{sourceCode:Z.join("").replace(/\n$/,""),spans:ye}}function H(ee,Q,X,Z,ve){if(!X)return;var ye={sourceNode:ee,pre:1,langExtension:null,numberLines:null,sourceCode:X,spans:null,basePos:Q,decorations:null};Z(ye),ve.push.apply(ve,ye.decorations)}var q=/\S/;function ne(ee){for(var Q=void 0,X=ee.firstChild;X;X=X.nextSibling){var Z=X.nodeType;Q=Z===1?Q?ee:X:Z===3&&q.test(X.nodeValue)?ee:Q}return Q===ee?void 0:Q}function te(ee,Q){var X={},Z;(function(){for(var Re=ee.concat(Q),Je=[],Ze={},rt=0,tt=Re.length;rt<tt;++rt){var st=Re[rt],ot=st[3];if(ot)for(var Fe=ot.length;--Fe>=0;)X[ot.charAt(Fe)]=st;var Ae=st[1],qe=""+Ae;Ze.hasOwnProperty(qe)||(Je.push(Ae),Ze[qe]=null)}Je.push(/[\0-\uffff]/),Z=U(Je)})();var ve=Q.length,ye=function(Re){for(var Je=Re.sourceCode,Ze=Re.basePos,rt=Re.sourceNode,tt=[Ze,_],st=0,ot=Je.match(Z)||[],Fe={},Ae=0,qe=ot.length;Ae<qe;++Ae){var ut=ot[Ae],$e=Fe[ut],nt=void 0,je;if(typeof $e=="string")je=!1;else{var De=X[ut.charAt(0)];if(De)nt=ut.match(De[1]),$e=De[0];else{for(var Pe=0;Pe<ve;++Pe)if(De=Q[Pe],nt=ut.match(De[1]),nt){$e=De[0];break}nt||($e=_)}je=$e.length>=5&&$e.substring(0,5)==="lang-",je&&!(nt&&typeof nt[1]=="string")&&(je=!1,$e=P),je||(Fe[ut]=$e)}var xe=st;if(st+=ut.length,!je)tt.push(Ze+xe,$e);else{var Se=nt[1],Le=ut.indexOf(Se),Ne=Le+Se.length;nt[2]&&(Ne=ut.length-nt[2].length,Le=Ne-Se.length);var et=$e.substring(5);H(rt,Ze+xe,ut.substring(0,Le),ye,tt),H(rt,Ze+xe+Le,Se,ce(et,Se),tt),H(rt,Ze+xe+Ne,ut.substring(Ne),ye,tt)}}Re.decorations=tt};return ye}function _e(ee){var Q=[],X=[];ee.tripleQuotedStrings?Q.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ee.multiLineStrings?Q.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Q.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ee.verbatimStrings&&X.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Z=ee.hashComments;Z&&(ee.cStyleComments?(Z>1?Q.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Q.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),X.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Q.push([O,/^#[^\r\n]*/,null,"#"])),ee.cStyleComments&&(X.push([O,/^\/\/[^\r\n]*/,null]),X.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ve=ee.regexLiterals;if(ve){var ye=ve>1?"":`
|
|
|
\r`,Re=ye?".":"[\\S\\s]",Je="/(?=[^/*"+ye+"])(?:[^/\\x5B\\x5C"+ye+"]|\\x5C"+Re+"|\\x5B(?:[^\\x5C\\x5D"+ye+"]|\\x5C"+Re+")*(?:\\x5D|$))+/";X.push(["lang-regex",RegExp("^"+K+"("+Je+")")])}var Ze=ee.types;Ze&&X.push([w,Ze]);var rt=(""+ee.keywords).replace(/^ | $/g,"");rt.length&&X.push([L,new RegExp("^(?:"+rt.replace(/[\s,]+/g,"|")+")\\b"),null]),Q.push([_,/^\s+/,null,` \r
|
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return ee.regexLiterals&&(tt+="(?!s*/)"),X.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[w,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[_,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[_,/^\\[\s\S]?/,null],[x,new RegExp(tt),null]),te(Q,X)}var Ce=_e({keywords:E,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function me(ee,Q,X){for(var Z=/(?:^|\s)nocode(?:\s|$)/,ve=/\r\n?|\n/,ye=ee.ownerDocument,Re=ye.createElement("li");ee.firstChild;)Re.appendChild(ee.firstChild);var Je=[Re];function Ze(Ae){var qe=Ae.nodeType;if(qe==1&&!Z.test(Ae.className))if(Ae.nodeName==="br")rt(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var ut=Ae.firstChild;ut;ut=ut.nextSibling)Ze(ut);else if((qe==3||qe==4)&&X){var $e=Ae.nodeValue,nt=$e.match(ve);if(nt){var je=$e.substring(0,nt.index);Ae.nodeValue=je;var De=$e.substring(nt.index+nt[0].length);if(De){var Pe=Ae.parentNode;Pe.insertBefore(ye.createTextNode(De),Ae.nextSibling)}rt(Ae),je||Ae.parentNode.removeChild(Ae)}}}function rt(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function qe(nt,je){var De=je?nt.cloneNode(!1):nt,Pe=nt.parentNode;if(Pe){var xe=qe(Pe,1),Se=nt.nextSibling;xe.appendChild(De);for(var Le=Se;Le;Le=Se)Se=Le.nextSibling,xe.appendChild(Le)}return De}for(var ut=qe(Ae.nextSibling,0),$e;($e=ut.parentNode)&&$e.nodeType===1;)ut=$e;Je.push(ut)}for(var tt=0;tt<Je.length;++tt)Ze(Je[tt]);Q===(Q|0)&&Je[0].setAttribute("value",Q);var st=ye.createElement("ol");st.className="linenums";for(var ot=Math.max(0,Q-1|0)||0,tt=0,Fe=Je.length;tt<Fe;++tt)Re=Je[tt],Re.className="L"+(tt+ot)%10,Re.firstChild||Re.appendChild(ye.createTextNode("\xA0")),st.appendChild(Re);ee.appendChild(st)}function Me(ee){var Q=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Q=Q&&+Q[1]<=8;var X=/\n/g,Z=ee.sourceCode,ve=Z.length,ye=0,Re=ee.spans,Je=Re.length,Ze=0,rt=ee.decorations,tt=rt.length,st=0;rt[tt]=ve;var ot,Fe;for(Fe=ot=0;Fe<tt;)rt[Fe]!==rt[Fe+2]?(rt[ot++]=rt[Fe++],rt[ot++]=rt[Fe++]):Fe+=2;for(tt=ot,Fe=ot=0;Fe<tt;){for(var Ae=rt[Fe],qe=rt[Fe+1],ut=Fe+2;ut+2<=tt&&rt[ut+1]===qe;)ut+=2;rt[ot++]=Ae,rt[ot++]=qe,Fe=ut}tt=rt.length=ot;var $e=ee.sourceNode,nt="";$e&&(nt=$e.style.display,$e.style.display="none");try{for(var je=null;Ze<Je;){var De=Re[Ze],Pe=Re[Ze+2]||ve,xe=rt[st+2]||ve,ut=Math.min(Pe,xe),Se=Re[Ze+1],Le;if(Se.nodeType!==1&&(Le=Z.substring(ye,ut))){Q&&(Le=Le.replace(X,"\r")),Se.nodeValue=Le;var Ne=Se.ownerDocument,et=Ne.createElement("span");et.className=rt[st+1];var Xe=Se.parentNode;Xe.replaceChild(et,Se),et.appendChild(Se),ye<Pe&&(Re[Ze+1]=Se=Ne.createTextNode(Z.substring(ut,Pe)),Xe.insertBefore(Se,et.nextSibling))}ye=ut,ye>=Pe&&(Ze+=2),ye>=xe&&(st+=2)}}finally{$e&&($e.style.display=nt)}}var Oe={};function he(ee,Q){for(var X=Q.length;--X>=0;){var Z=Q[X];Oe.hasOwnProperty(Z)?y.console&&console.warn("cannot override language handler %s",Z):Oe[Z]=ee}}function ce(ee,Q){return ee&&Oe.hasOwnProperty(ee)||(ee=/^\s*</.test(Q)?"default-markup":"default-code"),Oe[ee]}he(Ce,["default-code"]),he(te([],[[_,/^[^<?]+/],[N,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),he(te([[_,/^[\s]+/,null,` \r
|
|
|
`],[z,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[j,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[V,/^(?!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"]),he(te([],[[z,/^[\s\S]+/]]),["uq.val"]),he(_e({keywords:s,hashComments:!0,cStyleComments:!0,types:b}),["c","cc","cpp","cxx","cyc","m"]),he(_e({keywords:"null,true,false"}),["json"]),he(_e({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:b}),["cs"]),he(_e({keywords:d,cStyleComments:!0}),["java"]),he(_e({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(_e({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(_e({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(_e({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(_e({keywords:m,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(_e({keywords:p,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(te([],[[h,/^[\s\S]+/]]),["regex"]);function se(ee){var Q=ee.langExtension;try{var X=W(ee.sourceNode,ee.pre),Z=X.sourceCode;ee.sourceCode=Z,ee.spans=X.spans,ee.basePos=0,ce(Q,Z)(ee),Me(ee)}catch(ve){y.console&&console.log(ve&&ve.stack||ve)}}function Te(ee,Q,X){var Z=X||!1,ve=Q||null,ye=document.createElement("div");ye.innerHTML="<pre>"+ee+"</pre>",ye=ye.firstChild,Z&&me(ye,Z,!0);var Re={langExtension:ve,numberLines:Z,sourceNode:ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return se(Re),ye.innerHTML}function re(ee,Q){var X=Q||document.body,Z=X.ownerDocument||document;function ve(De){return X.getElementsByTagName(De)}for(var ye=[ve("pre"),ve("code"),ve("xmp")],Re=[],Je=0;Je<ye.length;++Je)for(var Ze=0,rt=ye[Je].length;Ze<rt;++Ze)Re.push(ye[Je][Ze]);ye=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var st=0,ot=/\blang(?:uage)?-([\w.]+)(?!\S)/,Fe=/\bprettyprint\b/,Ae=/\bprettyprinted\b/,qe=/pre|xmp/i,ut=/^code$/i,$e=/^(?:pre|code|xmp)$/i,nt={};function je(){for(var De=y.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;st<Re.length&&tt.now()<De;st++){for(var Pe=Re[st],xe=nt,Se=Pe;Se=Se.previousSibling;){var Le=Se.nodeType,Ne=(Le===7||Le===8)&&Se.nodeValue;if(Ne?!/^\??prettify\b/.test(Ne):Le!==3||/\S/.test(Se.nodeValue))break;if(Ne){xe={},Ne.replace(/\b(\w+)=([\w:.%+-]+)/g,function(fr,Ht,Mr){xe[Ht]=Mr});break}}var et=Pe.className;if((xe!==nt||Fe.test(et))&&!Ae.test(et)){for(var Xe=!1,ct=Pe.parentNode;ct;ct=ct.parentNode){var gt=ct.tagName;if($e.test(gt)&&ct.className&&Fe.test(ct.className)){Xe=!0;break}}if(!Xe){Pe.className+=" prettyprinted";var wt=xe.lang;if(!wt){wt=et.match(ot);var vt;!wt&&(vt=ne(Pe))&&ut.test(vt.tagName)&&(wt=vt.className.match(ot)),wt&&(wt=wt[1])}var Mt;if(qe.test(Pe.tagName))Mt=1;else{var Pt=Pe.currentStyle,_t=Z.defaultView,rr=Pt?Pt.whiteSpace:_t&&_t.getComputedStyle?_t.getComputedStyle(Pe,null).getPropertyValue("white-space"):0;Mt=rr&&rr.substring(0,3)==="pre"}var dr=xe.linenums;(dr=dr==="true"||+dr)||(dr=et.match(/\blinenums\b(?::(\d+))?/),dr=dr?dr[1]&&dr[1].length?+dr[1]:!0:!1),dr&&me(Pe,dr,Mt);var Zt={langExtension:wt,sourceNode:Pe,numberLines:dr,pre:Mt,sourceCode:null,basePos:null,spans:null,decorations:null};se(Zt)}}}st<Re.length?y.setTimeout(je,250):typeof ee=="function"&&ee()}je()}var ue=y.PR={createSimpleLexer:te,registerLangHandler:he,sourceDecorator:_e,PR_ATTRIB_NAME:V,PR_ATTRIB_VALUE:z,PR_COMMENT:O,PR_DECLARATION:N,PR_KEYWORD:L,PR_LITERAL:C,PR_NOCODE:B,PR_PLAIN:_,PR_PUNCTUATION:x,PR_SOURCE:P,PR_STRING:h,PR_TAG:j,PR_TYPE:w,prettyPrintOne:T?y.prettyPrintOne=Te:f=Te,prettyPrint:S=T?y.prettyPrint=re:S=re},fe=y.define;typeof fe=="function"&&fe.amd&&fe("google-code-prettify",[],function(){return ue})})()},T8No:function(I,$,R){"use strict";R.d($,"a",function(){return D}),R.d($,"b",function(){return d}),R.d($,"d",function(){return u}),R.d($,"c",function(){return p}),R.d($,"e",function(){return m});var M=R("N0LK"),g=R("Cg/j"),T=function(){var i=function(t,a){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,E){l.__proto__=E}||function(l,E){for(var b in E)E.hasOwnProperty(b)&&(l[b]=E[b])},i(t,a)};return function(t,a){i(t,a);function l(){this.constructor=t}t.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}}(),D=function(){function i(){}return i.has=function(t){return f.create(t)},i.equals=function(t,a){return S.create(t,a)},i.regex=function(t,a){return o.create(t,a)},i.not=function(t){return c.create(t)},i.and=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];return s.create(t)},i.or=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];return d.create(t)},i.deserialize=function(t,a){return a===void 0&&(a=!1),t?this._deserializeOrExpression(t,a):void 0},i._deserializeOrExpression=function(t,a){var l=this,E=t.split("||");return d.create(E.map(function(b){return l._deserializeAndExpression(b,a)}))},i._deserializeAndExpression=function(t,a){var l=this,E=t.split("&&");return s.create(E.map(function(b){return l._deserializeOne(b,a)}))},i._deserializeOne=function(t,a){if(t=t.trim(),t.indexOf("!=")>=0){var l=t.split("!=");return y.create(l[0].trim(),this._deserializeValue(l[1],a))}if(t.indexOf("==")>=0){var l=t.split("==");return S.create(l[0].trim(),this._deserializeValue(l[1],a))}if(t.indexOf("=~")>=0){var l=t.split("=~");return o.create(l[0].trim(),this._deserializeRegexValue(l[1],a))}return/^\!\s*/.test(t)?c.create(t.substr(1).trim()):f.create(t)},i._deserializeValue=function(t,a){if(t=t.trim(),t==="true")return!0;if(t==="false")return!1;var l=/^'([^']*)'$/.exec(t);return l?l[1].trim():t},i._deserializeRegexValue=function(t,a){if(Object(M.x)(t)){if(a)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var l=t.indexOf("/"),E=t.lastIndexOf("/");if(l===E||l<0){if(a)throw new Error("bad regexp-value '"+t+"', missing /-enclosure");return console.warn("bad regexp-value '"+t+"', missing /-enclosure"),null}var b=t.slice(l+1,E),h=t[E+1]==="i"?"i":"";try{return new RegExp(b,h)}catch(L){if(a)throw new Error("bad regexp-value '"+t+"', parse error: "+L);return console.warn("bad regexp-value '"+t+"', parse error: "+L),null}},i}();function v(i,t){var a=i.getType(),l=t.getType();if(a!==l)return a-l;switch(a){case 1:return i.cmp(t);case 2:return i.cmp(t);case 3:return i.cmp(t);case 4:return i.cmp(t);case 6:return i.cmp(t);case 7:return i.cmp(t);case 5:return i.cmp(t);default:throw new Error("Unknown ContextKeyExpr!")}}var f=function(){function i(t){this.key=t}return i.create=function(t){return new i(t)},i.prototype.getType=function(){return 1},i.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:0},i.prototype.equals=function(t){return t instanceof i?this.key===t.key:!1},i.prototype.evaluate=function(t){return!!t.getValue(this.key)},i.prototype.keys=function(){return[this.key]},i.prototype.negate=function(){return c.create(this.key)},i}(),S=function(){function i(t,a){this.key=t,this.value=a}return i.create=function(t,a){return typeof a=="boolean"?a?f.create(t):c.create(t):new i(t,a)},i.prototype.getType=function(){return 3},i.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:this.value<t.value?-1:this.value>t.value?1:0},i.prototype.equals=function(t){return t instanceof i?this.key===t.key&&this.value===t.value:!1},i.prototype.evaluate=function(t){return t.getValue(this.key)==this.value},i.prototype.keys=function(){return[this.key]},i.prototype.negate=function(){return y.create(this.key,this.value)},i}(),y=function(){function i(t,a){this.key=t,this.value=a}return i.create=function(t,a){return typeof a=="boolean"?a?c.create(t):f.create(t):new i(t,a)},i.prototype.getType=function(){return 4},i.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:this.value<t.value?-1:this.value>t.value?1:0},i.prototype.equals=function(t){return t instanceof i?this.key===t.key&&this.value===t.value:!1},i.prototype.evaluate=function(t){return t.getValue(this.key)!=this.value},i.prototype.keys=function(){return[this.key]},i.prototype.negate=function(){return S.create(this.key,this.value)},i}(),c=function(){function i(t){this.key=t}return i.create=function(t){return new i(t)},i.prototype.getType=function(){return 2},i.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:0},i.prototype.equals=function(t){return t instanceof i?this.key===t.key:!1},i.prototype.evaluate=function(t){return!t.getValue(this.key)},i.prototype.keys=function(){return[this.key]},i.prototype.negate=function(){return f.create(this.key)},i}(),o=function(){function i(t,a){this.key=t,this.regexp=a}return i.create=function(t,a){return new i(t,a)},i.prototype.getType=function(){return 6},i.prototype.cmp=function(t){if(this.key<t.key)return-1;if(this.key>t.key)return 1;var a=this.regexp?this.regexp.source:"",l=t.regexp?t.regexp.source:"";return a<l?-1:a>l?1:0},i.prototype.equals=function(t){if(t instanceof i){var a=this.regexp?this.regexp.source:"",l=t.regexp?t.regexp.source:"";return this.key===t.key&&a===l}return!1},i.prototype.evaluate=function(t){var a=t.getValue(this.key);return this.regexp?this.regexp.test(a):!1},i.prototype.keys=function(){return[this.key]},i.prototype.negate=function(){return r.create(this)},i}(),r=function(){function i(t){this._actual=t}return i.create=function(t){return new i(t)},i.prototype.getType=function(){return 7},i.prototype.cmp=function(t){return this._actual.cmp(t._actual)},i.prototype.equals=function(t){return t instanceof i?this._actual.equals(t._actual):!1},i.prototype.evaluate=function(t){return!this._actual.evaluate(t)},i.prototype.keys=function(){return this._actual.keys()},i.prototype.negate=function(){return this._actual},i}(),s=function(){function i(t){this.expr=t}return i.create=function(t){var a=i._normalizeArr(t);return a.length===0?void 0:a.length===1?a[0]:new i(a)},i.prototype.getType=function(){return 5},i.prototype.cmp=function(t){if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(var a=0,l=this.expr.length;a<l;a++){var E=v(this.expr[a],t.expr[a]);if(E!==0)return E}return 0},i.prototype.equals=function(t){if(t instanceof i){if(this.expr.length!==t.expr.length)return!1;for(var a=0,l=this.expr.length;a<l;a++)if(!this.expr[a].equals(t.expr[a]))return!1;return!0}return!1},i.prototype.evaluate=function(t){for(var a=0,l=this.expr.length;a<l;a++)if(!this.expr[a].evaluate(t))return!1;return!0},i._normalizeArr=function(t){var a=[];if(t){for(var l=0,E=t.length;l<E;l++){var b=t[l];if(!b)continue;if(b instanceof i){a=a.concat(b.expr);continue}if(b instanceof d)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');a.push(b)}a.sort(v)}return a},i.prototype.keys=function(){for(var t=[],a=0,l=this.expr;a<l.length;a++){var E=l[a];t.push.apply(t,E.keys())}return t},i.prototype.negate=function(){for(var t=[],a=0,l=this.expr;a<l.length;a++){var E=l[a];t.push(E.negate())}return d.create(t)},i}(),d=function(){function i(t){this.expr=t}return i.create=function(t){var a=i._normalizeArr(t);return a.length===0?void 0:a.length===1?a[0]:new i(a)},i.prototype.getType=function(){return 8},i.prototype.equals=function(t){if(t instanceof i){if(this.expr.length!==t.expr.length)return!1;for(var a=0,l=this.expr.length;a<l;a++)if(!this.expr[a].equals(t.expr[a]))return!1;return!0}return!1},i.prototype.evaluate=function(t){for(var a=0,l=this.expr.length;a<l;a++)if(this.expr[a].evaluate(t))return!0;return!1},i._normalizeArr=function(t){var a=[];if(t){for(var l=0,E=t.length;l<E;l++){var b=t[l];if(!b)continue;if(b instanceof i){a=a.concat(b.expr);continue}a.push(b)}a.sort(v)}return a},i.prototype.keys=function(){for(var t=[],a=0,l=this.expr;a<l.length;a++){var E=l[a];t.push.apply(t,E.keys())}return t},i.prototype.negate=function(){for(var t=[],a=0,l=this.expr;a<l.length;a++){var E=l[a];t.push(E.negate())}for(var b=function(P){return P instanceof i?P.expr:[P]};t.length>1;){for(var h=t.shift(),L=t.shift(),O=[],w=0,C=b(h);w<C.length;w++)for(var x=C[w],_=0,j=b(L);_<j.length;_++){var N=j[_];O.push(D.and(x,N))}t.unshift(D.or.apply(D,O))}return t[0]},i}(),u=function(i){T(t,i);function t(a,l){var E=i.call(this,a)||this;return E._defaultValue=l,E}return t.prototype.bindTo=function(a){return a.createKey(this.key,this._defaultValue)},t.prototype.getValue=function(a){return a.getContextKeyValue(this.key)},t.prototype.toNegated=function(){return D.not(this.key)},t}(f),p=Object(g.c)("contextKeyService"),m="setContext"},"VrN/":function(I,$,R){(function(M,g){I.exports=g()})(this,function(){"use strict";var M=navigator.userAgent,g=navigator.platform,T=/gecko\/\d/i.test(M),D=/MSIE \d/.test(M),v=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(M),f=/Edge\/(\d+)/.exec(M),S=D||v||f,y=S&&(D?document.documentMode||6:+(f||v)[1]),c=!f&&/WebKit\//.test(M),o=c&&/Qt\/\d+\.\d+/.test(M),r=!f&&/Chrome\//.test(M),s=/Opera\//.test(M),d=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(M),p=/PhantomJS/.test(M),m=!f&&/AppleWebKit/.test(M)&&/Mobile\/\w+/.test(M),i=/Android/.test(M),t=m||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(M),a=m||/Mac/.test(g),l=/\bCrOS\b/.test(M),E=/win/i.test(g),b=s&&M.match(/Version\/(\d*\.\d*)/);b&&(b=Number(b[1])),b&&b>=15&&(s=!1,c=!0);var h=a&&(o||s&&(b==null||b<12.11)),L=T||S&&y>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var w=function(e,n){var k=e.className,A=O(n).exec(k);if(A){var F=k.slice(A.index+A[0].length);e.className=k.slice(0,A.index)+(F?A[1]+F:"")}};function C(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function x(e,n){return C(e).appendChild(n)}function _(e,n,k,A){var F=document.createElement(e);if(k&&(F.className=k),A&&(F.style.cssText=A),typeof n=="string")F.appendChild(document.createTextNode(n));else if(n)for(var J=0;J<n.length;++J)F.appendChild(n[J]);return F}function j(e,n,k,A){var F=_(e,n,k,A);return F.setAttribute("role","presentation"),F}var N;document.createRange?N=function(e,n,k,A){var F=document.createRange();return F.setEnd(A||e,k),F.setStart(e,n),F}:N=function(e,n,k){var A=document.body.createTextRange();try{A.moveToElementText(e.parentNode)}catch(F){return A}return A.collapse(!0),A.moveEnd("character",k),A.moveStart("character",n),A};function P(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function V(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function z(e,n){var k=e.className;O(n).test(k)||(e.className+=(k?" ":"")+n)}function B(e,n){for(var k=e.split(" "),A=0;A<k.length;A++)k[A]&&!O(k[A]).test(n)&&(n+=" "+k[A]);return n}var K=function(e){e.select()};m?K=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:S&&(K=function(e){try{e.select()}catch(n){}});function U(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function W(e,n,k){n||(n={});for(var A in e)e.hasOwnProperty(A)&&(k!==!1||!n.hasOwnProperty(A))&&(n[A]=e[A]);return n}function H(e,n,k,A,F){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var J=A||0,le=F||0;;){var pe=e.indexOf(" ",J);if(pe<0||pe>=n)return le+(n-J);le+=pe-J,le+=k-le%k,J=pe+1}}var q=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},q.prototype.set=function(e,n){this.f=n;var k=+new Date+e;(!this.id||k<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=k)};function ne(e,n){for(var k=0;k<e.length;++k)if(e[k]==n)return k;return-1}var te=50,_e={toString:function(){return"CodeMirror.Pass"}},Ce={scroll:!1},me={origin:"*mouse"},Me={origin:"+move"};function Oe(e,n,k){for(var A=0,F=0;;){var J=e.indexOf(" ",A);J==-1&&(J=e.length);var le=J-A;if(J==e.length||F+le>=n)return A+Math.min(le,n-F);if(F+=J-A,F+=k-F%k,A=J+1,F>=n)return A}}var he=[""];function ce(e){for(;he.length<=e;)he.push(se(he)+" ");return he[e]}function se(e){return e[e.length-1]}function Te(e,n){for(var k=[],A=0;A<e.length;A++)k[A]=n(e[A],A);return k}function re(e,n,k){for(var A=0,F=k(n);A<e.length&&k(e[A])<=F;)A++;e.splice(A,0,n)}function ue(){}function fe(e,n){var k;return Object.create?k=Object.create(e):(ue.prototype=e,k=new ue),n&&W(n,k),k}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function X(e,n){return n?n.source.indexOf("\\w")>-1&&Q(e)?!0:n.test(e):Q(e)}function Z(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var ve=/[\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 ye(e){return e.charCodeAt(0)>=768&&ve.test(e)}function Re(e,n,k){for(;(k<0?n>0:n<e.length)&&ye(e.charAt(n));)n+=k;return n}function Je(e,n,k){for(var A=n>k?-1:1;;){if(n==k)return n;var F=(n+k)/2,J=A<0?Math.ceil(F):Math.floor(F);if(J==n)return e(J)?n:k;e(J)?k=J:n=J+A}}function Ze(e,n,k,A){if(!e)return A(n,k,"ltr",0);for(var F=!1,J=0;J<e.length;++J){var le=e[J];(le.from<k&&le.to>n||n==k&&le.to==n)&&(A(Math.max(le.from,n),Math.min(le.to,k),le.level==1?"rtl":"ltr",J),F=!0)}F||A(n,k,"ltr")}var rt=null;function tt(e,n,k){var A;rt=null;for(var F=0;F<e.length;++F){var J=e[F];if(J.from<n&&J.to>n)return F;J.to==n&&(J.from!=J.to&&k=="before"?A=F:rt=F),J.from==n&&(J.from!=J.to&&k!="before"?A=F:rt=F)}return A!=null?A:rt}var st=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function k(Ee){return Ee<=247?e.charAt(Ee):1424<=Ee&&Ee<=1524?"R":1536<=Ee&&Ee<=1785?n.charAt(Ee-1536):1774<=Ee&&Ee<=2220?"r":8192<=Ee&&Ee<=8203?"w":Ee==8204?"b":"L"}var A=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,F=/[stwN]/,J=/[LRr]/,le=/[Lb1n]/,pe=/[1n]/;function ge(Ee,We,Ke){this.level=Ee,this.from=We,this.to=Ke}return function(Ee,We){var Ke=We=="ltr"?"L":"R";if(Ee.length==0||We=="ltr"&&!A.test(Ee))return!1;for(var lt=Ee.length,at=[],pt=0;pt<lt;++pt)at.push(k(Ee.charCodeAt(pt)));for(var bt=0,Dt=Ke;bt<lt;++bt){var It=at[bt];It=="m"?at[bt]=Dt:Dt=It}for(var Wt=0,Nt=Ke;Wt<lt;++Wt){var Kt=at[Wt];Kt=="1"&&Nt=="r"?at[Wt]="n":J.test(Kt)&&(Nt=Kt,Kt=="r"&&(at[Wt]="R"))}for(var cr=1,ir=at[0];cr<lt-1;++cr){var Br=at[cr];Br=="+"&&ir=="1"&&at[cr+1]=="1"?at[cr]="1":Br==","&&ir==at[cr+1]&&(ir=="1"||ir=="n")&&(at[cr]=ir),ir=Br}for(var An=0;An<lt;++An){var ci=at[An];if(ci==",")at[An]="N";else if(ci=="%"){var Un=void 0;for(Un=An+1;Un<lt&&at[Un]=="%";++Un);for(var Fi=An&&at[An-1]=="!"||Un<lt&&at[Un]=="1"?"1":"N",Mi=An;Mi<Un;++Mi)at[Mi]=Fi;An=Un-1}}for(var Jn=0,Pi=Ke;Jn<lt;++Jn){var vi=at[Jn];Pi=="L"&&vi=="1"?at[Jn]="L":J.test(vi)&&(Pi=vi)}for(var oi=0;oi<lt;++oi)if(F.test(at[oi])){var Qn=void 0;for(Qn=oi+1;Qn<lt&&F.test(at[Qn]);++Qn);for(var Hn=(oi?at[oi-1]:Ke)=="L",Ii=(Qn<lt?at[Qn]:Ke)=="L",Za=Hn==Ii?Hn?"L":"R":Ke,_a=oi;_a<Qn;++_a)at[_a]=Za;oi=Qn-1}for(var Ei=[],ua,di=0;di<lt;)if(le.test(at[di])){var ps=di;for(++di;di<lt&&le.test(at[di]);++di);Ei.push(new ge(0,ps,di))}else{var ga=di,La=Ei.length,Ma=We=="rtl"?1:0;for(++di;di<lt&&at[di]!="L";++di);for(var Ai=ga;Ai<di;)if(pe.test(at[Ai])){ga<Ai&&(Ei.splice(La,0,new ge(1,ga,Ai)),La+=Ma);var qa=Ai;for(++Ai;Ai<di&&pe.test(at[Ai]);++Ai);Ei.splice(La,0,new ge(2,qa,Ai)),La+=Ma,ga=Ai}else++Ai;ga<di&&Ei.splice(La,0,new ge(1,ga,di))}return We=="ltr"&&(Ei[0].level==1&&(ua=Ee.match(/^\s+/))&&(Ei[0].from=ua[0].length,Ei.unshift(new ge(0,0,ua[0].length))),se(Ei).level==1&&(ua=Ee.match(/\s+$/))&&(se(Ei).to-=ua[0].length,Ei.push(new ge(0,lt-ua[0].length,lt)))),We=="rtl"?Ei.reverse():Ei}}();function ot(e,n){var k=e.order;return k==null&&(k=e.order=st(e.text,n)),k}var Fe=[],Ae=function(e,n,k){if(e.addEventListener)e.addEventListener(n,k,!1);else if(e.attachEvent)e.attachEvent("on"+n,k);else{var A=e._handlers||(e._handlers={});A[n]=(A[n]||Fe).concat(k)}};function qe(e,n){return e._handlers&&e._handlers[n]||Fe}function ut(e,n,k){if(e.removeEventListener)e.removeEventListener(n,k,!1);else if(e.detachEvent)e.detachEvent("on"+n,k);else{var A=e._handlers,F=A&&A[n];if(F){var J=ne(F,k);J>-1&&(A[n]=F.slice(0,J).concat(F.slice(J+1)))}}}function $e(e,n){var k=qe(e,n);if(!k.length)return;for(var A=Array.prototype.slice.call(arguments,2),F=0;F<k.length;++F)k[F].apply(null,A)}function nt(e,n,k){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),$e(e,k||n.type,e,n),Le(n)||n.codemirrorIgnore}function je(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var k=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),A=0;A<n.length;++A)ne(k,n[A])==-1&&k.push(n[A])}function De(e,n){return qe(e,n).length>0}function Pe(e){e.prototype.on=function(n,k){Ae(this,n,k)},e.prototype.off=function(n,k){ut(this,n,k)}}function xe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ne(e){xe(e),Se(e)}function et(e){return e.target||e.srcElement}function Xe(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),a&&e.ctrlKey&&n==1&&(n=3),n}var ct=function(){if(S&&y<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}(),gt;function wt(e){if(gt==null){var n=_("span","\u200B");x(e,_("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(gt=n.offsetWidth<=1&&n.offsetHeight>2&&!(S&&y<8))}var k=gt?_("span","\u200B"):_("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return k.setAttribute("cm-text",""),k}var vt;function Mt(e){if(vt!=null)return vt;var n=x(e,document.createTextNode("A\u062EA")),k=N(n,0,1).getBoundingClientRect(),A=N(n,1,2).getBoundingClientRect();return C(e),!k||k.left==k.right?!1:vt=A.right-k.right<3}var Pt=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var n=0,k=[],A=e.length;n<=A;){var F=e.indexOf(`
|
|
|
`,n);F==-1&&(F=e.length);var J=e.slice(n,e.charAt(F-1)=="\r"?F-1:F),le=J.indexOf("\r");le!=-1?(k.push(J.slice(0,le)),n+=le+1):(k.push(J),n=F+1)}return k}:function(e){return e.split(/\r\n?|\n/)},_t=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(k){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},rr=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),dr=null;function Zt(e){if(dr!=null)return dr;var n=x(e,_("span","x")),k=n.getBoundingClientRect(),A=N(n,0,1).getBoundingClientRect();return dr=Math.abs(k.left-A.left)>1}var fr={},Ht={};function Mr(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),fr[e]=n}function Sr(e,n){Ht[e]=n}function Tt(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var n=Ht[e.name];typeof n=="string"&&(n={name:n}),e=fe(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ot(e,n){n=Tt(n);var k=fr[n.name];if(!k)return Ot(e,"text/plain");var A=k(e,n);if(Rt.hasOwnProperty(n.name)){var F=Rt[n.name];for(var J in F){if(!F.hasOwnProperty(J))continue;A.hasOwnProperty(J)&&(A["_"+J]=A[J]),A[J]=F[J]}}if(A.name=n.name,n.helperType&&(A.helperType=n.helperType),n.modeProps)for(var le in n.modeProps)A[le]=n.modeProps[le];return A}var Rt={};function Bt(e,n){var k=Rt.hasOwnProperty(e)?Rt[e]:Rt[e]={};W(n,k)}function lr(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var k={};for(var A in n){var F=n[A];F instanceof Array&&(F=F.concat([])),k[A]=F}return k}function sn(e,n){for(var k;e.innerMode&&!(k=e.innerMode(n),!k||k.mode==e);)n=k.state,e=k.mode;return k||{mode:e,state:n}}function yt(e,n,k){return e.startState?e.startState(n,k):!0}var kt=function(e,n,k){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=k};kt.prototype.eol=function(){return this.pos>=this.string.length},kt.prototype.sol=function(){return this.pos==this.lineStart},kt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},kt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},kt.prototype.eat=function(e){var n=this.string.charAt(this.pos),k;if(typeof e=="string"?k=n==e:k=n&&(e.test?e.test(n):e(n)),k)return++this.pos,n},kt.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},kt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},kt.prototype.skipToEnd=function(){this.pos=this.string.length},kt.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},kt.prototype.backUp=function(e){this.pos-=e},kt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},kt.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},kt.prototype.match=function(e,n,k){if(typeof e=="string"){var A=function(le){return k?le.toLowerCase():le},F=this.string.substr(this.pos,e.length);if(A(F)==A(e))return n!==!1&&(this.pos+=e.length),!0}else{var J=this.string.slice(this.pos).match(e);return J&&J.index>0?null:(J&&n!==!1&&(this.pos+=J[0].length),J)}},kt.prototype.current=function(){return this.string.slice(this.start,this.pos)},kt.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},kt.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},kt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ct(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var k=e;!k.lines;)for(var A=0;;++A){var F=k.children[A],J=F.chunkSize();if(n<J){k=F;break}n-=J}return k.lines[n]}function Ar(e,n,k){var A=[],F=n.line;return e.iter(n.line,k.line+1,function(J){var le=J.text;F==k.line&&(le=le.slice(0,k.ch)),F==n.line&&(le=le.slice(n.ch)),A.push(le),++F}),A}function Wr(e,n,k){var A=[];return e.iter(n,k,function(F){A.push(F.text)}),A}function Yt(e,n){var k=n-e.height;if(k)for(var A=e;A;A=A.parent)A.height+=k}function Ut(e){if(e.parent==null)return null;for(var n=e.parent,k=ne(n.lines,e),A=n.parent;A;n=A,A=A.parent)for(var F=0;!(A.children[F]==n);++F)k+=A.children[F].chunkSize();return k+n.first}function Pr(e,n){var k=e.first;e:do{for(var A=0;A<e.children.length;++A){var F=e.children[A],J=F.height;if(n<J){e=F;continue e}n-=J,k+=F.chunkSize()}return k}while(!e.lines);for(var le=0;le<e.lines.length;++le){var pe=e.lines[le],ge=pe.height;if(n<ge)break;n-=ge}return k+le}function yn(e,n){return n>=e.first&&n<e.first+e.size}function Vr(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function dt(e,n,k){if(k===void 0&&(k=null),!(this instanceof dt))return new dt(e,n,k);this.line=e,this.ch=n,this.sticky=k}function At(e,n){return e.line-n.line||e.ch-n.ch}function $t(e,n){return e.sticky==n.sticky&&At(e,n)==0}function hr(e){return dt(e.line,e.ch)}function vr(e,n){return At(e,n)<0?n:e}function Er(e,n){return At(e,n)<0?e:n}function ae(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function G(e,n){if(n.line<e.first)return dt(e.first,0);var k=e.first+e.size-1;return n.line>k?dt(k,Ct(e,k).text.length):Y(n,Ct(e,n.line).text.length)}function Y(e,n){var k=e.ch;return k==null||k>n?dt(e.line,n):k<0?dt(e.line,0):e}function ie(e,n){for(var k=[],A=0;A<n.length;A++)k[A]=G(e,n[A]);return k}var de=function(e,n){this.state=e,this.lookAhead=n},oe=function(e,n,k,A){this.state=n,this.doc=e,this.line=k,this.maxLookAhead=A||0,this.baseTokens=null,this.baseTokenPos=1};oe.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},oe.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},oe.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},oe.fromSaved=function(e,n,k){return n instanceof de?new oe(e,lr(e.mode,n.state),k,n.lookAhead):new oe(e,lr(e.mode,n),k)},oe.prototype.save=function(e){var n=e!==!1?lr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new de(n,this.maxLookAhead):n};function ze(e,n,k,A){var F=[e.state.modeGen],J={};rn(e,n.text,e.doc.mode,k,function(Ee,We){return F.push(Ee,We)},J,A);for(var le=k.state,pe=function(Ee){k.baseTokens=F;var We=e.state.overlays[Ee],Ke=1,lt=0;k.state=!0,rn(e,n.text,We.mode,k,function(at,pt){for(var bt=Ke;lt<at;){var Dt=F[Ke];Dt>at&&F.splice(Ke,1,at,F[Ke+1],Dt),Ke+=2,lt=Math.min(at,Dt)}if(!pt)return;if(We.opaque)F.splice(bt,Ke-bt,at,"overlay "+pt),Ke=bt+2;else for(;bt<Ke;bt+=2){var It=F[bt+1];F[bt+1]=(It?It+" ":"")+"overlay "+pt}},J),k.state=le,k.baseTokens=null,k.baseTokenPos=1},ge=0;ge<e.state.overlays.length;++ge)pe(ge);return{styles:F,classes:J.bgClass||J.textClass?J:null}}function ft(e,n,k){if(!n.styles||n.styles[0]!=e.state.modeGen){var A=St(e,Ut(n)),F=n.text.length>e.options.maxHighlightLength&&lr(e.doc.mode,A.state),J=ze(e,n,A);F&&(A.state=F),n.stateAfter=A.save(!F),n.styles=J.styles,J.classes?n.styleClasses=J.classes:n.styleClasses&&(n.styleClasses=null),k===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function St(e,n,k){var A=e.doc,F=e.display;if(!A.mode.startState)return new oe(A,!0,n);var J=tr(e,n,k),le=J>A.first&&Ct(A,J-1).stateAfter,pe=le?oe.fromSaved(A,le,J):new oe(A,yt(A.mode),J);return A.iter(J,n,function(ge){Ft(e,ge.text,pe);var Ee=pe.line;ge.stateAfter=Ee==n-1||Ee%5==0||Ee>=F.viewFrom&&Ee<F.viewTo?pe.save():null,pe.nextLine()}),k&&(A.modeFrontier=pe.line),pe}function Ft(e,n,k,A){var F=e.doc.mode,J=new kt(n,e.options.tabSize,k);for(J.start=J.pos=A||0,n==""&&mt(F,k.state);!J.eol();)Gt(F,J,k.state),J.start=J.pos}function mt(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var k=sn(e,n);if(k.mode.blankLine)return k.mode.blankLine(k.state)}function Gt(e,n,k,A){for(var F=0;F<10;F++){A&&(A[0]=sn(e,k).mode);var J=e.token(n,k);if(n.pos>n.start)return J}throw new Error("Mode "+e.name+" failed to advance stream.")}var Vt=function(e,n,k){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=k};function Hr(e,n,k,A){var F=e.doc,J=F.mode,le;n=G(F,n);var pe=Ct(F,n.line),ge=St(e,n.line,k),Ee=new kt(pe.text,e.options.tabSize,ge),We;for(A&&(We=[]);(A||Ee.pos<n.ch)&&!Ee.eol();)Ee.start=Ee.pos,le=Gt(J,Ee,ge.state),A&&We.push(new Vt(Ee,le,lr(F.mode,ge.state)));return A?We:new Vt(Ee,le,ge.state)}function cn(e,n){if(e)for(;;){var k=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!k)break;e=e.slice(0,k.index)+e.slice(k.index+k[0].length);var A=k[1]?"bgClass":"textClass";n[A]==null?n[A]=k[2]:new RegExp("(?:^|\\s)"+k[2]+"(?:$|\\s)").test(n[A])||(n[A]+=" "+k[2])}return e}function rn(e,n,k,A,F,J,le){var pe=k.flattenSpans;pe==null&&(pe=e.options.flattenSpans);var ge=0,Ee=null,We=new kt(n,e.options.tabSize,A),Ke,lt=e.options.addModeClass&&[null];for(n==""&&cn(mt(k,A.state),J);!We.eol();){if(We.pos>e.options.maxHighlightLength?(pe=!1,le&&Ft(e,n,A,We.pos),We.pos=n.length,Ke=null):Ke=cn(Gt(k,We,A.state,lt),J),lt){var at=lt[0].name;at&&(Ke="m-"+(Ke?at+" "+Ke:at))}if(!pe||Ee!=Ke){for(;ge<We.start;)ge=Math.min(We.start,ge+5e3),F(ge,Ee);Ee=Ke}We.start=We.pos}for(;ge<We.pos;){var pt=Math.min(We.pos,ge+5e3);F(pt,Ee),ge=pt}}function tr(e,n,k){for(var A,F,J=e.doc,le=k?-1:n-(e.doc.mode.innerMode?1e3:100),pe=n;pe>le;--pe){if(pe<=J.first)return J.first;var ge=Ct(J,pe-1),Ee=ge.stateAfter;if(Ee&&(!k||pe+(Ee instanceof de?Ee.lookAhead:0)<=J.modeFrontier))return pe;var We=H(ge.text,null,e.options.tabSize);(F==null||A>We)&&(F=pe-1,A=We)}return F}function $r(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var k=e.first,A=n-1;A>k;A--){var F=Ct(e,A).stateAfter;if(F&&(!(F instanceof de)||A+F.lookAhead<n)){k=A+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,k)}var pr=!1,qt=!1;function sr(){pr=!0}function gr(){qt=!0}function en(e,n,k){this.marker=e,this.from=n,this.to=k}function fn(e,n){if(e)for(var k=0;k<e.length;++k){var A=e[k];if(A.marker==n)return A}}function Sn(e,n){for(var k,A=0;A<e.length;++A)e[A]!=n&&(k||(k=[])).push(e[A]);return k}function wi(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function Vi(e,n,k){var A;if(e)for(var F=0;F<e.length;++F){var J=e[F],le=J.marker,pe=J.from==null||(le.inclusiveLeft?J.from<=n:J.from<n);if(pe||J.from==n&&le.type=="bookmark"&&(!k||!J.marker.insertLeft)){var ge=J.to==null||(le.inclusiveRight?J.to>=n:J.to>n);(A||(A=[])).push(new en(le,J.from,ge?null:J.to))}}return A}function Ui(e,n,k){var A;if(e)for(var F=0;F<e.length;++F){var J=e[F],le=J.marker,pe=J.to==null||(le.inclusiveRight?J.to>=n:J.to>n);if(pe||J.from==n&&le.type=="bookmark"&&(!k||J.marker.insertLeft)){var ge=J.from==null||(le.inclusiveLeft?J.from<=n:J.from<n);(A||(A=[])).push(new en(le,ge?null:J.from-n,J.to==null?null:J.to-n))}}return A}function Zn(e,n){if(n.full)return null;var k=yn(e,n.from.line)&&Ct(e,n.from.line).markedSpans,A=yn(e,n.to.line)&&Ct(e,n.to.line).markedSpans;if(!k&&!A)return null;var F=n.from.ch,J=n.to.ch,le=At(n.from,n.to)==0,pe=Vi(k,F,le),ge=Ui(A,J,le),Ee=n.text.length==1,We=se(n.text).length+(Ee?F:0);if(pe)for(var Ke=0;Ke<pe.length;++Ke){var lt=pe[Ke];if(lt.to==null){var at=fn(ge,lt.marker);at?Ee&&(lt.to=at.to==null?null:at.to+We):lt.to=F}}if(ge)for(var pt=0;pt<ge.length;++pt){var bt=ge[pt];if(bt.to!=null&&(bt.to+=We),bt.from==null){var Dt=fn(pe,bt.marker);Dt||(bt.from=We,Ee&&(pe||(pe=[])).push(bt))}else bt.from+=We,Ee&&(pe||(pe=[])).push(bt)}pe&&(pe=ln(pe)),ge&&ge!=pe&&(ge=ln(ge));var It=[pe];if(!Ee){var Wt=n.text.length-2,Nt;if(Wt>0&&pe)for(var Kt=0;Kt<pe.length;++Kt)pe[Kt].to==null&&(Nt||(Nt=[])).push(new en(pe[Kt].marker,null,null));for(var cr=0;cr<Wt;++cr)It.push(Nt);It.push(ge)}return It}function ln(e){for(var n=0;n<e.length;++n){var k=e[n];k.from!=null&&k.from==k.to&&k.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Ri(e,n,k){var A=null;if(e.iter(n.line,k.line+1,function(at){if(at.markedSpans)for(var pt=0;pt<at.markedSpans.length;++pt){var bt=at.markedSpans[pt].marker;bt.readOnly&&(!A||ne(A,bt)==-1)&&(A||(A=[])).push(bt)}}),!A)return null;for(var F=[{from:n,to:k}],J=0;J<A.length;++J)for(var le=A[J],pe=le.find(0),ge=0;ge<F.length;++ge){var Ee=F[ge];if(At(Ee.to,pe.from)<0||At(Ee.from,pe.to)>0)continue;var We=[ge,1],Ke=At(Ee.from,pe.from),lt=At(Ee.to,pe.to);(Ke<0||!le.inclusiveLeft&&!Ke)&&We.push({from:Ee.from,to:pe.from}),(lt>0||!le.inclusiveRight&&!lt)&&We.push({from:pe.to,to:Ee.to}),F.splice.apply(F,We),ge+=We.length-3}return F}function dn(e){var n=e.markedSpans;if(!n)return;for(var k=0;k<n.length;++k)n[k].marker.detachLine(e);e.markedSpans=null}function hi(e,n){if(!n)return;for(var k=0;k<n.length;++k)n[k].marker.attachLine(e);e.markedSpans=n}function Jr(e){return e.inclusiveLeft?-1:0}function ur(e){return e.inclusiveRight?1:0}function nn(e,n){var k=e.lines.length-n.lines.length;if(k!=0)return k;var A=e.find(),F=n.find(),J=At(A.from,F.from)||Jr(e)-Jr(n);if(J)return-J;var le=At(A.to,F.to)||ur(e)-ur(n);return le||n.id-e.id}function Ir(e,n){var k=qt&&e.markedSpans,A;if(k)for(var F=void 0,J=0;J<k.length;++J)F=k[J],F.marker.collapsed&&(n?F.from:F.to)==null&&(!A||nn(A,F.marker)<0)&&(A=F.marker);return A}function mn(e){return Ir(e,!0)}function Nr(e){return Ir(e,!1)}function fi(e,n){var k=qt&&e.markedSpans,A;if(k)for(var F=0;F<k.length;++F){var J=k[F];J.marker.collapsed&&(J.from==null||J.from<n)&&(J.to==null||J.to>n)&&(!A||nn(A,J.marker)<0)&&(A=J.marker)}return A}function gn(e,n,k,A,F){var J=Ct(e,n),le=qt&&J.markedSpans;if(le)for(var pe=0;pe<le.length;++pe){var ge=le[pe];if(!ge.marker.collapsed)continue;var Ee=ge.marker.find(0),We=At(Ee.from,k)||Jr(ge.marker)-Jr(F),Ke=At(Ee.to,A)||ur(ge.marker)-ur(F);if(We>=0&&Ke<=0||We<=0&&Ke>=0)continue;if(We<=0&&(ge.marker.inclusiveRight&&F.inclusiveLeft?At(Ee.to,k)>=0:At(Ee.to,k)>0)||We>=0&&(ge.marker.inclusiveRight&&F.inclusiveLeft?At(Ee.from,A)<=0:At(Ee.from,A)<0))return!0}}function zn(e){for(var n;n=mn(e);)e=n.find(-1,!0).line;return e}function Di(e){for(var n;n=Nr(e);)e=n.find(1,!0).line;return e}function yi(e){for(var n,k;n=Nr(e);)e=n.find(1,!0).line,(k||(k=[])).push(e);return k}function qn(e,n){var k=Ct(e,n),A=zn(k);return k==A?n:Ut(A)}function Ci(e,n){if(n>e.lastLine())return n;var k=Ct(e,n),A;if(!Fn(e,k))return n;for(;A=Nr(k);)k=A.find(1,!0).line;return Ut(k)+1}function Fn(e,n){var k=qt&&n.markedSpans;if(k)for(var A=void 0,F=0;F<k.length;++F){if(A=k[F],!A.marker.collapsed)continue;if(A.from==null)return!0;if(A.marker.widgetNode)continue;if(A.from==0&&A.marker.inclusiveLeft&&Ni(e,n,A))return!0}}function Ni(e,n,k){if(k.to==null){var A=k.marker.find(1,!0);return Ni(e,A.line,fn(A.line.markedSpans,k.marker))}if(k.marker.inclusiveRight&&k.to==n.text.length)return!0;for(var F=void 0,J=0;J<n.markedSpans.length;++J)if(F=n.markedSpans[J],F.marker.collapsed&&!F.marker.widgetNode&&F.from==k.to&&(F.to==null||F.to!=k.from)&&(F.marker.inclusiveLeft||k.marker.inclusiveRight)&&Ni(e,n,F))return!0}function si(e){e=zn(e);for(var n=0,k=e.parent,A=0;A<k.lines.length;++A){var F=k.lines[A];if(F==e)break;n+=F.height}for(var J=k.parent;J;k=J,J=k.parent)for(var le=0;le<J.children.length;++le){var pe=J.children[le];if(pe==k)break;n+=pe.height}return n}function pi(e){if(e.height==0)return 0;for(var n=e.text.length,k,A=e;k=mn(A);){var F=k.find(0,!0);A=F.from.line,n+=F.from.ch-F.to.ch}for(A=e;k=Nr(A);){var J=k.find(0,!0);n-=A.text.length-J.from.ch,A=J.to.line,n+=A.text.length-J.to.ch}return n}function Bi(e){var n=e.display,k=e.doc;n.maxLine=Ct(k,k.first),n.maxLineLength=pi(n.maxLine),n.maxLineChanged=!0,k.iter(function(A){var F=pi(A);F>n.maxLineLength&&(n.maxLineLength=F,n.maxLine=A)})}var li=function(e,n,k){this.text=e,hi(this,n),this.height=k?k(this):1};li.prototype.lineNo=function(){return Ut(this)},Pe(li);function an(e,n,k,A){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dn(e),hi(e,k);var F=A?A(e):1;F!=e.height&&Yt(e,F)}function Qi(e){e.parent=null,dn(e)}var zt={},er={};function Jt(e,n){if(!e||/^\s*$/.test(e))return null;var k=n.addModeClass?er:zt;return k[e]||(k[e]=e.replace(/\S+/g,"cm-$&"))}function yr(e,n){var k=j("span",null,null,c?"padding-right: .1px":null),A={pre:j("pre",[k],"CodeMirror-line"),content:k,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var F=0;F<=(n.rest?n.rest.length:0);F++){var J=F?n.rest[F-1]:n.line,le=void 0;A.pos=0,A.addToken=Qr,Mt(e.display.measure)&&(le=ot(J,e.doc.direction))&&(A.addToken=Rn(A.addToken,le)),A.map=[];var pe=n!=e.display.externalMeasured&&Ut(J);wr(J,A,ft(e,J,pe)),J.styleClasses&&(J.styleClasses.bgClass&&(A.bgClass=B(J.styleClasses.bgClass,A.bgClass||"")),J.styleClasses.textClass&&(A.textClass=B(J.styleClasses.textClass,A.textClass||""))),A.map.length==0&&A.map.push(0,0,A.content.appendChild(wt(e.display.measure))),F==0?(n.measure.map=A.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(A.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(c){var ge=A.content.lastChild;(/\bcm-tab\b/.test(ge.className)||ge.querySelector&&ge.querySelector(".cm-tab"))&&(A.content.className="cm-tab-wrap-hack")}return $e(e,"renderLine",e,n.line,A.pre),A.pre.className&&(A.textClass=B(A.pre.className,A.textClass||"")),A}function Rr(e){var n=_("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Qr(e,n,k,A,F,J,le){if(!n)return;var pe=e.splitSpaces?Tr(n,e.trailingSpace):n,ge=e.cm.state.specialChars,Ee=!1,We;if(!ge.test(n))e.col+=n.length,We=document.createTextNode(pe),e.map.push(e.pos,e.pos+n.length,We),S&&y<9&&(Ee=!0),e.pos+=n.length;else{We=document.createDocumentFragment();for(var Ke=0;;){ge.lastIndex=Ke;var lt=ge.exec(n),at=lt?lt.index-Ke:n.length-Ke;if(at){var pt=document.createTextNode(pe.slice(Ke,Ke+at));S&&y<9?We.appendChild(_("span",[pt])):We.appendChild(pt),e.map.push(e.pos,e.pos+at,pt),e.col+=at,e.pos+=at}if(!lt)break;Ke+=at+1;var bt=void 0;if(lt[0]==" "){var Dt=e.cm.options.tabSize,It=Dt-e.col%Dt;bt=We.appendChild(_("span",ce(It),"cm-tab")),bt.setAttribute("role","presentation"),bt.setAttribute("cm-text"," "),e.col+=It}else lt[0]=="\r"||lt[0]==`
|
|
|
`?(bt=We.appendChild(_("span",lt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),bt.setAttribute("cm-text",lt[0]),e.col+=1):(bt=e.cm.options.specialCharPlaceholder(lt[0]),bt.setAttribute("cm-text",lt[0]),S&&y<9?We.appendChild(_("span",[bt])):We.appendChild(bt),e.col+=1);e.map.push(e.pos,e.pos+1,bt),e.pos++}}if(e.trailingSpace=pe.charCodeAt(n.length-1)==32,k||A||F||Ee||J||le){var Wt=k||"";A&&(Wt+=A),F&&(Wt+=F);var Nt=_("span",[We],Wt,J);if(le)for(var Kt in le)le.hasOwnProperty(Kt)&&Kt!="style"&&Kt!="class"&&Nt.setAttribute(Kt,le[Kt]);return e.content.appendChild(Nt)}e.content.appendChild(We)}function Tr(e,n){if(e.length>1&&!/ /.test(e))return e;for(var k=n,A="",F=0;F<e.length;F++){var J=e.charAt(F);J==" "&&k&&(F==e.length-1||e.charCodeAt(F+1)==32)&&(J="\xA0"),A+=J,k=J==" "}return A}function Rn(e,n){return function(k,A,F,J,le,pe,ge){F=F?F+" cm-force-border":"cm-force-border";for(var Ee=k.pos,We=Ee+A.length;;){for(var Ke=void 0,lt=0;lt<n.length&&!(Ke=n[lt],Ke.to>Ee&&Ke.from<=Ee);lt++);if(Ke.to>=We)return e(k,A,F,J,le,pe,ge);e(k,A.slice(0,Ke.to-Ee),F,J,null,pe,ge),J=null,A=A.slice(Ke.to-Ee),Ee=Ke.to}}}function Kn(e,n,k,A){var F=!A&&k.widgetNode;F&&e.map.push(e.pos,e.pos+n,F),!A&&e.cm.display.input.needsContentAttribute&&(F||(F=e.content.appendChild(document.createElement("span"))),F.setAttribute("cm-marker",k.id)),F&&(e.cm.display.input.setUneditable(F),e.content.appendChild(F)),e.pos+=n,e.trailingSpace=!1}function wr(e,n,k){var A=e.markedSpans,F=e.text,J=0;if(!A){for(var le=1;le<k.length;le+=2)n.addToken(n,F.slice(J,J=k[le]),Jt(k[le+1],n.cm.options));return}for(var pe=F.length,ge=0,Ee=1,We="",Ke,lt,at=0,pt,bt,Dt,It,Wt;;){if(at==ge){pt=bt=Dt=lt="",Wt=null,It=null,at=Infinity;for(var Nt=[],Kt=void 0,cr=0;cr<A.length;++cr){var ir=A[cr],Br=ir.marker;if(Br.type=="bookmark"&&ir.from==ge&&Br.widgetNode)Nt.push(Br);else if(ir.from<=ge&&(ir.to==null||ir.to>ge||Br.collapsed&&ir.to==ge&&ir.from==ge)){if(ir.to!=null&&ir.to!=ge&&at>ir.to&&(at=ir.to,bt=""),Br.className&&(pt+=" "+Br.className),Br.css&&(lt=(lt?lt+";":"")+Br.css),Br.startStyle&&ir.from==ge&&(Dt+=" "+Br.startStyle),Br.endStyle&&ir.to==at&&(Kt||(Kt=[])).push(Br.endStyle,ir.to),Br.title&&((Wt||(Wt={})).title=Br.title),Br.attributes)for(var An in Br.attributes)(Wt||(Wt={}))[An]=Br.attributes[An];Br.collapsed&&(!It||nn(It.marker,Br)<0)&&(It=ir)}else ir.from>ge&&at>ir.from&&(at=ir.from)}if(Kt)for(var ci=0;ci<Kt.length;ci+=2)Kt[ci+1]==at&&(bt+=" "+Kt[ci]);if(!It||It.from==ge)for(var Un=0;Un<Nt.length;++Un)Kn(n,0,Nt[Un]);if(It&&(It.from||0)==ge){if(Kn(n,(It.to==null?pe+1:It.to)-ge,It.marker,It.from==null),It.to==null)return;It.to==ge&&(It=!1)}}if(ge>=pe)break;for(var Fi=Math.min(pe,at);;){if(We){var Mi=ge+We.length;if(!It){var Jn=Mi>Fi?We.slice(0,Fi-ge):We;n.addToken(n,Jn,Ke?Ke+pt:pt,Dt,ge+Jn.length==at?bt:"",lt,Wt)}if(Mi>=Fi){We=We.slice(Fi-ge),ge=Fi;break}ge=Mi,Dt=""}We=F.slice(J,J=k[Ee++]),Ke=Jt(k[Ee++],n.cm.options)}}}function ji(e,n,k){this.line=n,this.rest=yi(n),this.size=this.rest?Ut(se(this.rest))-k+1:1,this.node=this.text=null,this.hidden=Fn(e,n)}function Fr(e,n,k){for(var A=[],F,J=n;J<k;J=F){var le=new ji(e.doc,Ct(e.doc,J),J);F=J+le.size,A.push(le)}return A}var Pn=null;function mi(e){Pn?Pn.ops.push(e):e.ownsGroup=Pn={ops:[e],delayedCallbacks:[]}}function ei(e){var n=e.delayedCallbacks,k=0;do{for(;k<n.length;k++)n[k].call(null);for(var A=0;A<e.ops.length;A++){var F=e.ops[A];if(F.cursorActivityHandlers)for(;F.cursorActivityCalled<F.cursorActivityHandlers.length;)F.cursorActivityHandlers[F.cursorActivityCalled++].call(null,F.cm)}}while(k<n.length)}function zr(e,n){var k=e.ownsGroup;if(!k)return;try{ei(k)}finally{Pn=null,n(k)}}var Ur=null;function Dr(e,n){var k=qe(e,n);if(!k.length)return;var A=Array.prototype.slice.call(arguments,2),F;Pn?F=Pn.delayedCallbacks:Ur?F=Ur:(F=Ur=[],setTimeout(ui,0));for(var J=function(pe){F.push(function(){return k[pe].apply(null,A)})},le=0;le<k.length;++le)J(le)}function ui(){var e=Ur;Ur=null;for(var n=0;n<e.length;++n)e[n]()}function Xi(e,n,k,A){for(var F=0;F<n.changes.length;F++){var J=n.changes[F];J=="text"?mr(e,n):J=="gutter"?on(e,n,k,A):J=="class"?br(e,n):J=="widget"&&kr(e,n,A)}n.changes=null}function Yi(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),S&&y<8&&(e.node.style.zIndex=2)),e.node}function ar(e,n){var k=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(k&&(k+=" CodeMirror-linebackground"),n.background)k?n.background.className=k:(n.background.parentNode.removeChild(n.background),n.background=null);else if(k){var A=Yi(n);n.background=A.insertBefore(_("div",null,k),A.firstChild),e.display.input.setUneditable(n.background)}}function jt(e,n){var k=e.display.externalMeasured;return k&&k.line==n.line?(e.display.externalMeasured=null,n.measure=k.measure,k.built):yr(e,n)}function mr(e,n){var k=n.text.className,A=jt(e,n);n.text==n.node&&(n.node=A.pre),n.text.parentNode.replaceChild(A.pre,n.text),n.text=A.pre,A.bgClass!=n.bgClass||A.textClass!=n.textClass?(n.bgClass=A.bgClass,n.textClass=A.textClass,br(e,n)):k&&(n.text.className=k)}function br(e,n){ar(e,n),n.line.wrapClass?Yi(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var k=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=k||""}function on(e,n,k,A){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var F=Yi(n);n.gutterBackground=_("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?A.fixedPos:-A.gutterTotalWidth)+"px; width: "+A.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),F.insertBefore(n.gutterBackground,n.text)}var J=n.line.gutterMarkers;if(e.options.lineNumbers||J){var le=Yi(n),pe=n.gutter=_("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?A.fixedPos:-A.gutterTotalWidth)+"px");if(e.display.input.setUneditable(pe),le.insertBefore(pe,n.text),n.line.gutterClass&&(pe.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!J||!J["CodeMirror-linenumbers"])&&(n.lineNumber=pe.appendChild(_("div",Vr(e.options,k),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+A.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),J)for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var Ee=e.display.gutterSpecs[ge].className,We=J.hasOwnProperty(Ee)&&J[Ee];We&&pe.appendChild(_("div",[We],"CodeMirror-gutter-elt","left: "+A.gutterLeft[Ee]+"px; width: "+A.gutterWidth[Ee]+"px"))}}}function kr(e,n,k){n.alignable&&(n.alignable=null);for(var A=O("CodeMirror-linewidget"),F=n.node.firstChild,J=void 0;F;F=J)J=F.nextSibling,A.test(F.className)&&n.node.removeChild(F);Tn(e,n,k)}function Dn(e,n,k,A){var F=jt(e,n);return n.text=n.node=F.pre,F.bgClass&&(n.bgClass=F.bgClass),F.textClass&&(n.textClass=F.textClass),br(e,n),on(e,n,k,A),Tn(e,n,A),n.node}function Tn(e,n,k){if(ki(e,n.line,n,k,!0),n.rest)for(var A=0;A<n.rest.length;A++)ki(e,n.rest[A],n,k,!1)}function ki(e,n,k,A,F){if(!n.widgets)return;for(var J=Yi(k),le=0,pe=n.widgets;le<pe.length;++le){var ge=pe[le],Ee=_("div",[ge.node],"CodeMirror-linewidget"+(ge.className?" "+ge.className:""));ge.handleMouseEvents||Ee.setAttribute("cm-ignore-events","true"),Bn(ge,Ee,k,A),e.display.input.setUneditable(Ee),F&&ge.above?J.insertBefore(Ee,k.gutter||k.text):J.appendChild(Ee),Dr(ge,"redraw")}}function Bn(e,n,k,A){if(e.noHScroll){(k.alignable||(k.alignable=[])).push(n);var F=A.wrapperWidth;n.style.left=A.fixedPos+"px",e.coverGutter||(F-=A.gutterTotalWidth,n.style.paddingLeft=A.gutterTotalWidth+"px"),n.style.width=F+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-A.gutterTotalWidth+"px"))}function Gn(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!P(document.body,e.node)){var k="position: relative;";e.coverGutter&&(k+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(k+="width: "+n.display.wrapper.clientWidth+"px;"),x(n.display.measure,_("div",[e.node],null,k))}return e.height=e.node.parentNode.offsetHeight}function $n(e,n){for(var k=et(n);k!=e.wrapper;k=k.parentNode)if(!k||k.nodeType==1&&k.getAttribute("cm-ignore-events")=="true"||k.parentNode==e.sizer&&k!=e.mover)return!0}function $i(e){return e.lineSpace.offsetTop}function Ie(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ge(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=x(e.measure,_("pre","x","CodeMirror-line-like")),k=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,A={left:parseInt(k.paddingLeft),right:parseInt(k.paddingRight)};return!isNaN(A.left)&&!isNaN(A.right)&&(e.cachedPaddingH=A),A}function Qe(e){return te-e.display.nativeBarWidth}function Ue(e){return e.display.scroller.clientWidth-Qe(e)-e.display.barWidth}function be(e){return e.display.scroller.clientHeight-Qe(e)-e.display.barHeight}function ke(e,n,k){var A=e.options.lineWrapping,F=A&&Ue(e);if(!n.measure.heights||A&&n.measure.width!=F){var J=n.measure.heights=[];if(A){n.measure.width=F;for(var le=n.text.firstChild.getClientRects(),pe=0;pe<le.length-1;pe++){var ge=le[pe],Ee=le[pe+1];Math.abs(ge.bottom-Ee.bottom)>2&&J.push((ge.bottom+Ee.top)/2-k.top)}}J.push(k.bottom-k.top)}}function we(e,n,k){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var A=0;A<e.rest.length;A++)if(e.rest[A]==n)return{map:e.measure.maps[A],cache:e.measure.caches[A]};for(var F=0;F<e.rest.length;F++)if(Ut(e.rest[F])>k)return{map:e.measure.maps[F],cache:e.measure.caches[F],before:!0}}function Be(e,n){n=zn(n);var k=Ut(n),A=e.display.externalMeasured=new ji(e.doc,n,k);A.lineN=k;var F=A.built=yr(e,A);return A.text=F.pre,x(e.display.lineMeasure,F.pre),A}function He(e,n,k,A){return it(e,Ve(e,n),k,A)}function Ye(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[On(e,n)];var k=e.display.externalMeasured;if(k&&n>=k.lineN&&n<k.lineN+k.size)return k}function Ve(e,n){var k=Ut(n),A=Ye(e,k);A&&!A.text?A=null:A&&A.changes&&(Xi(e,A,k,In(e)),e.curOp.forceUpdate=!0),A||(A=Be(e,n));var F=we(A,n,k);return{line:n,view:A,rect:null,map:F.map,cache:F.cache,before:F.before,hasHeights:!1}}function it(e,n,k,A,F){n.before&&(k=-1);var J=k+(A||""),le;return n.cache.hasOwnProperty(J)?le=n.cache[J]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(ke(e,n.view,n.rect),n.hasHeights=!0),le=Lt(e,n,k,A),le.bogus||(n.cache[J]=le)),{left:le.left,right:le.right,top:F?le.rtop:le.top,bottom:F?le.rbottom:le.bottom}}var ht={left:0,right:0,top:0,bottom:0};function Et(e,n,k){for(var A,F,J,le,pe,ge,Ee=0;Ee<e.length;Ee+=3)if(pe=e[Ee],ge=e[Ee+1],n<pe?(F=0,J=1,le="left"):n<ge?(F=n-pe,J=F+1):(Ee==e.length-3||n==ge&&e[Ee+3]>n)&&(J=ge-pe,F=J-1,n>=ge&&(le="right")),F!=null){if(A=e[Ee+2],pe==ge&&k==(A.insertLeft?"left":"right")&&(le=k),k=="left"&&F==0)for(;Ee&&e[Ee-2]==e[Ee-3]&&e[Ee-1].insertLeft;)A=e[(Ee-=3)+2],le="left";if(k=="right"&&F==ge-pe)for(;Ee<e.length-3&&e[Ee+3]==e[Ee+4]&&!e[Ee+5].insertLeft;)A=e[(Ee+=3)+2],le="right";break}return{node:A,start:F,end:J,collapse:le,coverStart:pe,coverEnd:ge}}function xt(e,n){var k=ht;if(n=="left")for(var A=0;A<e.length&&!((k=e[A]).left!=k.right);A++);else for(var F=e.length-1;F>=0&&!((k=e[F]).left!=k.right);F--);return k}function Lt(e,n,k,A){var F=Et(n.map,k,A),J=F.node,le=F.start,pe=F.end,ge=F.collapse,Ee;if(J.nodeType==3){for(var We=0;We<4;We++){for(;le&&ye(n.line.text.charAt(F.coverStart+le));)--le;for(;F.coverStart+pe<F.coverEnd&&ye(n.line.text.charAt(F.coverStart+pe));)++pe;if(S&&y<9&&le==0&&pe==F.coverEnd-F.coverStart?Ee=J.parentNode.getBoundingClientRect():Ee=xt(N(J,le,pe).getClientRects(),A),Ee.left||Ee.right||le==0)break;pe=le,le=le-1,ge="right"}S&&y<11&&(Ee=Qt(e.display.measure,Ee))}else{le>0&&(ge=A="right");var Ke;e.options.lineWrapping&&(Ke=J.getClientRects()).length>1?Ee=Ke[A=="right"?Ke.length-1:0]:Ee=J.getBoundingClientRect()}if(S&&y<9&&!le&&(!Ee||!Ee.left&&!Ee.right)){var lt=J.parentNode.getClientRects()[0];lt?Ee={left:lt.left,right:lt.left+ti(e.display),top:lt.top,bottom:lt.bottom}:Ee=ht}for(var at=Ee.top-n.rect.top,pt=Ee.bottom-n.rect.top,bt=(at+pt)/2,Dt=n.view.measure.heights,It=0;It<Dt.length-1&&!(bt<Dt[It]);It++);var Wt=It?Dt[It-1]:0,Nt=Dt[It],Kt={left:(ge=="right"?Ee.right:Ee.left)-n.rect.left,right:(ge=="left"?Ee.left:Ee.right)-n.rect.left,top:Wt,bottom:Nt};return!Ee.left&&!Ee.right&&(Kt.bogus=!0),e.options.singleCursorHeightPerLine||(Kt.rtop=at,Kt.rbottom=pt),Kt}function Qt(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Zt(e))return n;var k=screen.logicalXDPI/screen.deviceXDPI,A=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*k,right:n.right*k,top:n.top*A,bottom:n.bottom*A}}function xr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function Cr(e){e.display.externalMeasure=null,C(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)xr(e.display.view[n])}function _r(e){Cr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function jr(){return r&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Lr(){return r&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Or(e){var n=0;if(e.widgets)for(var k=0;k<e.widgets.length;++k)e.widgets[k].above&&(n+=Gn(e.widgets[k]));return n}function Zr(e,n,k,A,F){if(!F){var J=Or(n);k.top+=J,k.bottom+=J}if(A=="line")return k;A||(A="local");var le=si(n);if(A=="local"?le+=$i(e.display):le-=e.display.viewOffset,A=="page"||A=="window"){var pe=e.display.lineSpace.getBoundingClientRect();le+=pe.top+(A=="window"?0:Lr());var ge=pe.left+(A=="window"?0:jr());k.left+=ge,k.right+=ge}return k.top+=le,k.bottom+=le,k}function Kr(e,n,k){if(k=="div")return n;var A=n.left,F=n.top;if(k=="page")A-=jr(),F-=Lr();else if(k=="local"||!k){var J=e.display.sizer.getBoundingClientRect();A+=J.left,F+=J.top}var le=e.display.lineSpace.getBoundingClientRect();return{left:A-le.left,top:F-le.top}}function kn(e,n,k,A,F){return A||(A=Ct(e.doc,n.line)),Zr(e,A,He(e,A,n.ch,F),k)}function Gr(e,n,k,A,F,J){A=A||Ct(e.doc,n.line),F||(F=Ve(e,A));function le(pt,bt){var Dt=it(e,F,pt,bt?"right":"left",J);return bt?Dt.left=Dt.right:Dt.right=Dt.left,Zr(e,A,Dt,k)}var pe=ot(A,e.doc.direction),ge=n.ch,Ee=n.sticky;if(ge>=A.text.length?(ge=A.text.length,Ee="before"):ge<=0&&(ge=0,Ee="after"),!pe)return le(Ee=="before"?ge-1:ge,Ee=="before");function We(pt,bt,Dt){var It=pe[bt],Wt=It.level==1;return le(Dt?pt-1:pt,Wt!=Dt)}var Ke=tt(pe,ge,Ee),lt=rt,at=We(ge,Ke,Ee=="before");return lt!=null&&(at.other=We(ge,lt,Ee!="before")),at}function or(e,n){var k=0;n=G(e.doc,n),e.options.lineWrapping||(k=ti(e.display)*n.ch);var A=Ct(e.doc,n.line),F=si(A)+$i(e.display);return{left:k,right:k,top:F,bottom:F+A.height}}function nr(e,n,k,A,F){var J=dt(e,n,k);return J.xRel=F,A&&(J.outside=A),J}function Xr(e,n,k){var A=e.doc;if(k+=e.display.viewOffset,k<0)return nr(A.first,0,null,-1,-1);var F=Pr(A,k),J=A.first+A.size-1;if(F>J)return nr(A.first+A.size-1,Ct(A,J).text.length,null,1,1);n<0&&(n=0);for(var le=Ct(A,F);;){var pe=Ln(e,le,F,n,k),ge=fi(le,pe.ch+(pe.xRel>0||pe.outside>0?1:0));if(!ge)return pe;var Ee=ge.find(1);if(Ee.line==F)return Ee;le=Ct(A,F=Ee.line)}}function qr(e,n,k,A){A-=Or(n);var F=n.text.length,J=Je(function(le){return it(e,k,le-1).bottom<=A},F,0);return F=Je(function(le){return it(e,k,le).top>A},J,F),{begin:J,end:F}}function Xt(e,n,k,A){k||(k=Ve(e,n));var F=Zr(e,n,it(e,k,A),"line").top;return qr(e,n,k,F)}function tn(e,n,k,A){return e.bottom<=k?!1:e.top>k?!0:(A?e.left:e.right)>n}function Ln(e,n,k,A,F){F-=si(n);var J=Ve(e,n),le=Or(n),pe=0,ge=n.text.length,Ee=!0,We=ot(n,e.doc.direction);if(We){var Ke=(e.options.lineWrapping?En:un)(e,n,k,J,We,A,F);Ee=Ke.level!=1,pe=Ee?Ke.from:Ke.to-1,ge=Ee?Ke.to:Ke.from-1}var lt=null,at=null,pt=Je(function(cr){var ir=it(e,J,cr);return ir.top+=le,ir.bottom+=le,tn(ir,A,F,!1)?(ir.top<=F&&ir.left<=A&&(lt=cr,at=ir),!0):!1},pe,ge),bt,Dt,It=!1;if(at){var Wt=A-at.left<at.right-A,Nt=Wt==Ee;pt=lt+(Nt?0:1),Dt=Nt?"after":"before",bt=Wt?at.left:at.right}else{!Ee&&(pt==ge||pt==pe)&&pt++,Dt=pt==0?"after":pt==n.text.length?"before":it(e,J,pt-(Ee?1:0)).bottom+le<=F==Ee?"after":"before";var Kt=Gr(e,dt(k,pt,Dt),"line",n,J);bt=Kt.left,It=F<Kt.top?-1:F>=Kt.bottom?1:0}return pt=Re(n.text,pt,1),nr(k,pt,Dt,It,A-bt)}function un(e,n,k,A,F,J,le){var pe=Je(function(Ke){var lt=F[Ke],at=lt.level!=1;return tn(Gr(e,dt(k,at?lt.to:lt.from,at?"before":"after"),"line",n,A),J,le,!0)},0,F.length-1),ge=F[pe];if(pe>0){var Ee=ge.level!=1,We=Gr(e,dt(k,Ee?ge.from:ge.to,Ee?"after":"before"),"line",n,A);tn(We,J,le,!0)&&We.top>le&&(ge=F[pe-1])}return ge}function En(e,n,k,A,F,J,le){var pe=qr(e,n,A,le),ge=pe.begin,Ee=pe.end;/\s/.test(n.text.charAt(Ee-1))&&Ee--;for(var We=null,Ke=null,lt=0;lt<F.length;lt++){var at=F[lt];if(at.from>=Ee||at.to<=ge)continue;var pt=at.level!=1,bt=it(e,A,pt?Math.min(Ee,at.to)-1:Math.max(ge,at.from)).right,Dt=bt<J?J-bt+1e9:bt-J;(!We||Ke>Dt)&&(We=at,Ke=Dt)}return We||(We=F[F.length-1]),We.from<ge&&(We={from:ge,to:We.to,level:We.level}),We.to>Ee&&(We={from:We.from,to:Ee,level:We.level}),We}var bn;function Wn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(bn==null){bn=_("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)bn.appendChild(document.createTextNode("x")),bn.appendChild(_("br"));bn.appendChild(document.createTextNode("x"))}x(e.measure,bn);var k=bn.offsetHeight/50;return k>3&&(e.cachedTextHeight=k),C(e.measure),k||1}function ti(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=_("span","xxxxxxxxxx"),k=_("pre",[n],"CodeMirror-line-like");x(e.measure,k);var A=n.getBoundingClientRect(),F=(A.right-A.left)/10;return F>2&&(e.cachedCharWidth=F),F||10}function In(e){for(var n=e.display,k={},A={},F=n.gutters.clientLeft,J=n.gutters.firstChild,le=0;J;J=J.nextSibling,++le){var pe=e.display.gutterSpecs[le].className;k[pe]=J.offsetLeft+J.clientLeft+F,A[pe]=J.clientWidth}return{fixedPos:bi(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:k,gutterWidth:A,wrapperWidth:n.wrapper.clientWidth}}function bi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wi(e){var n=Wn(e.display),k=e.options.lineWrapping,A=k&&Math.max(5,e.display.scroller.clientWidth/ti(e.display)-3);return function(F){if(Fn(e.doc,F))return 0;var J=0;if(F.widgets)for(var le=0;le<F.widgets.length;le++)F.widgets[le].height&&(J+=F.widgets[le].height);return k?J+(Math.ceil(F.text.length/A)||1)*n:J+n}}function Si(e){var n=e.doc,k=Wi(e);n.iter(function(A){var F=k(A);F!=A.height&&Yt(A,F)})}function ri(e,n,k,A){var F=e.display;if(!k&&et(n).getAttribute("cm-not-content")=="true")return null;var J,le,pe=F.lineSpace.getBoundingClientRect();try{J=n.clientX-pe.left,le=n.clientY-pe.top}catch(Ke){return null}var ge=Xr(e,J,le),Ee;if(A&&ge.xRel>0&&(Ee=Ct(e.doc,ge.line).text).length==ge.ch){var We=H(Ee,Ee.length,e.options.tabSize)-Ee.length;ge=dt(ge.line,Math.max(0,Math.round((J-Ge(e.display).left)/ti(e.display))-We))}return ge}function On(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var k=e.display.view,A=0;A<k.length;A++)if(n-=k[A].size,n<0)return A}function wn(e,n,k,A){n==null&&(n=e.doc.first),k==null&&(k=e.doc.first+e.doc.size),A||(A=0);var F=e.display;if(A&&k<F.viewTo&&(F.updateLineNumbers==null||F.updateLineNumbers>n)&&(F.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=F.viewTo)qt&&qn(e.doc,n)<F.viewTo&&Mn(e);else if(k<=F.viewFrom)qt&&Ci(e.doc,k+A)>F.viewFrom?Mn(e):(F.viewFrom+=A,F.viewTo+=A);else if(n<=F.viewFrom&&k>=F.viewTo)Mn(e);else if(n<=F.viewFrom){var J=Hi(e,k,k+A,1);J?(F.view=F.view.slice(J.index),F.viewFrom=J.lineN,F.viewTo+=A):Mn(e)}else if(k>=F.viewTo){var le=Hi(e,n,n,-1);le?(F.view=F.view.slice(0,le.index),F.viewTo=le.lineN):Mn(e)}else{var pe=Hi(e,n,n,-1),ge=Hi(e,k,k+A,1);pe&&ge?(F.view=F.view.slice(0,pe.index).concat(Fr(e,pe.lineN,ge.lineN)).concat(F.view.slice(ge.index)),F.viewTo+=A):Mn(e)}var Ee=F.externalMeasured;Ee&&(k<Ee.lineN?Ee.lineN+=A:n<Ee.lineN+Ee.size&&(F.externalMeasured=null))}function Nn(e,n,k){e.curOp.viewChanged=!0;var A=e.display,F=e.display.externalMeasured;if(F&&n>=F.lineN&&n<F.lineN+F.size&&(A.externalMeasured=null),n<A.viewFrom||n>=A.viewTo)return;var J=A.view[On(e,n)];if(J.node==null)return;var le=J.changes||(J.changes=[]);ne(le,k)==-1&&le.push(k)}function Mn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hi(e,n,k,A){var F=On(e,n),J,le=e.display.view;if(!qt||k==e.doc.first+e.doc.size)return{index:F,lineN:k};for(var pe=e.display.viewFrom,ge=0;ge<F;ge++)pe+=le[ge].size;if(pe!=n){if(A>0){if(F==le.length-1)return null;J=pe+le[F].size-n,F++}else J=pe-n;n+=J,k+=J}for(;qn(e.doc,k)!=k;){if(F==(A<0?0:le.length-1))return null;k+=A*le[F-(A<0?1:0)].size,F+=A}return{index:F,lineN:k}}function ra(e,n,k){var A=e.display,F=A.view;F.length==0||n>=A.viewTo||k<=A.viewFrom?(A.view=Fr(e,n,k),A.viewFrom=n):(A.viewFrom>n?A.view=Fr(e,n,A.viewFrom).concat(A.view):A.viewFrom<n&&(A.view=A.view.slice(On(e,n))),A.viewFrom=n,A.viewTo<k?A.view=A.view.concat(Fr(e,A.viewTo,k)):A.viewTo>k&&(A.view=A.view.slice(0,On(e,k)))),A.viewTo=k}function na(e){for(var n=e.display.view,k=0,A=0;A<n.length;A++){var F=n[A];!F.hidden&&(!F.node||F.changes)&&++k}return k}function xn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ji(e,n){n===void 0&&(n=!0);for(var k=e.doc,A={},F=A.cursors=document.createDocumentFragment(),J=A.selection=document.createDocumentFragment(),le=0;le<k.sel.ranges.length;le++){if(!n&&le==k.sel.primIndex)continue;var pe=k.sel.ranges[le];if(pe.from().line>=e.display.viewTo||pe.to().line<e.display.viewFrom)continue;var ge=pe.empty();(ge||e.options.showCursorWhenSelecting)&&ia(e,pe.head,F),ge||vn(e,pe,J)}return A}function ia(e,n,k){var A=Gr(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),F=k.appendChild(_("div","\xA0","CodeMirror-cursor"));if(F.style.left=A.left+"px",F.style.top=A.top+"px",F.style.height=Math.max(0,A.bottom-A.top)*e.options.cursorHeight+"px",A.other){var J=k.appendChild(_("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));J.style.display="",J.style.left=A.other.left+"px",J.style.top=A.other.top+"px",J.style.height=(A.other.bottom-A.other.top)*.85+"px"}}function _n(e,n){return e.top-n.top||e.left-n.left}function vn(e,n,k){var A=e.display,F=e.doc,J=document.createDocumentFragment(),le=Ge(e.display),pe=le.left,ge=Math.max(A.sizerWidth,Ue(e)-A.sizer.offsetLeft)-le.right,Ee=F.direction=="ltr";function We(Nt,Kt,cr,ir){Kt<0&&(Kt=0),Kt=Math.round(Kt),ir=Math.round(ir),J.appendChild(_("div",null,"CodeMirror-selected","position: absolute; left: "+Nt+`px;
|
|
|
top: `+Kt+"px; width: "+(cr==null?ge-Nt:cr)+`px;
|
|
|
height: `+(ir-Kt)+"px"))}function Ke(Nt,Kt,cr){var ir=Ct(F,Nt),Br=ir.text.length,An,ci;function Un(Jn,Pi){return kn(e,dt(Nt,Jn),"div",ir,Pi)}function Fi(Jn,Pi,vi){var oi=Xt(e,ir,null,Jn),Qn=Pi=="ltr"==(vi=="after")?"left":"right",Hn=vi=="after"?oi.begin:oi.end-(/\s/.test(ir.text.charAt(oi.end-1))?2:1);return Un(Hn,Qn)[Qn]}var Mi=ot(ir,F.direction);return Ze(Mi,Kt||0,cr==null?Br:cr,function(Jn,Pi,vi,oi){var Qn=vi=="ltr",Hn=Un(Jn,Qn?"left":"right"),Ii=Un(Pi-1,Qn?"right":"left"),Za=Kt==null&&Jn==0,_a=cr==null&&Pi==Br,Ei=oi==0,ua=!Mi||oi==Mi.length-1;if(Ii.top-Hn.top<=3){var di=(Ee?Za:_a)&&Ei,ps=(Ee?_a:Za)&&ua,ga=di?pe:(Qn?Hn:Ii).left,La=ps?ge:(Qn?Ii:Hn).right;We(ga,Hn.top,La-ga,Hn.bottom)}else{var Ma,Ai,qa,ms;Qn?(Ma=Ee&&Za&&Ei?pe:Hn.left,Ai=Ee?ge:Fi(Jn,vi,"before"),qa=Ee?pe:Fi(Pi,vi,"after"),ms=Ee&&_a&&ua?ge:Ii.right):(Ma=Ee?Fi(Jn,vi,"before"):pe,Ai=!Ee&&Za&&Ei?ge:Hn.right,qa=!Ee&&_a&&ua?pe:Ii.left,ms=Ee?Fi(Pi,vi,"after"):ge),We(Ma,Hn.top,Ai-Ma,Hn.bottom),Hn.bottom<Ii.top&&We(pe,Hn.bottom,null,Ii.top),We(qa,Ii.top,ms-qa,Ii.bottom)}(!An||_n(Hn,An)<0)&&(An=Hn),_n(Ii,An)<0&&(An=Ii),(!ci||_n(Hn,ci)<0)&&(ci=Hn),_n(Ii,ci)<0&&(ci=Ii)}),{start:An,end:ci}}var lt=n.from(),at=n.to();if(lt.line==at.line)Ke(lt.line,lt.ch,at.ch);else{var pt=Ct(F,lt.line),bt=Ct(F,at.line),Dt=zn(pt)==zn(bt),It=Ke(lt.line,lt.ch,Dt?pt.text.length+1:null).end,Wt=Ke(at.line,Dt?0:null,at.ch).start;Dt&&(It.top<Wt.top-2?(We(It.right,It.top,null,It.bottom),We(pe,Wt.top,Wt.left,Wt.bottom)):We(It.right,It.top,Wt.left-It.right,It.bottom)),It.bottom<Wt.top&&We(pe,It.bottom,null,Wt.top)}k.appendChild(J)}function ni(e){if(!e.state.focused)return;var n=e.display;clearInterval(n.blinker);var k=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||va(e),n.cursorDiv.style.visibility=(k=!k)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}function To(e){e.state.focused||(e.display.input.focus(),aa(e))}function eo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,va(e))},100)}function aa(e,n){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||($e(e,"focus",e,n),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ni(e)}function va(e,n){if(e.state.delayingBlurEvent)return;e.state.focused&&($e(e,"blur",e,n),e.state.focused=!1,w(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Pa(e){for(var n=e.display,k=n.lineDiv.offsetTop,A=0;A<n.view.length;A++){var F=n.view[A],J=e.options.lineWrapping,le=void 0,pe=0;if(F.hidden)continue;if(S&&y<8){var ge=F.node.offsetTop+F.node.offsetHeight;le=ge-k,k=ge}else{var Ee=F.node.getBoundingClientRect();le=Ee.bottom-Ee.top,!J&&F.text.firstChild&&(pe=F.text.firstChild.getBoundingClientRect().right-Ee.left-1)}var We=F.line.height-le;if((We>.005||We<-.005)&&(Yt(F.line,le),to(F.line),F.rest))for(var Ke=0;Ke<F.rest.length;Ke++)to(F.rest[Ke]);if(pe>e.display.sizerWidth){var lt=Math.ceil(pe/ti(e.display));lt>e.display.maxLineLength&&(e.display.maxLineLength=lt,e.display.maxLine=F.line,e.display.maxLineChanged=!0)}}}function to(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var k=e.widgets[n],A=k.node.parentNode;A&&(k.height=A.offsetHeight)}}function Ia(e,n,k){var A=k&&k.top!=null?Math.max(0,k.top):e.scroller.scrollTop;A=Math.floor(A-$i(e));var F=k&&k.bottom!=null?k.bottom:A+e.wrapper.clientHeight,J=Pr(n,A),le=Pr(n,F);if(k&&k.ensure){var pe=k.ensure.from.line,ge=k.ensure.to.line;pe<J?(J=pe,le=Pr(n,si(Ct(n,pe))+e.wrapper.clientHeight)):Math.min(ge,n.lastLine())>=le&&(J=Pr(n,si(Ct(n,ge))-e.wrapper.clientHeight),le=ge)}return{from:J,to:Math.max(le,J+1)}}function Xo(e,n){if(nt(e,"scrollCursorIntoView"))return;var k=e.display,A=k.sizer.getBoundingClientRect(),F=null;if(n.top+A.top<0?F=!0:n.bottom+A.top>(window.innerHeight||document.documentElement.clientHeight)&&(F=!1),F!=null&&!p){var J=_("div","\u200B",null,`position: absolute;
|
|
|
top: `+(n.top-k.viewOffset-$i(e.display))+`px;
|
|
|
height: `+(n.bottom-n.top+Qe(e)+k.barHeight)+`px;
|
|
|
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(J),J.scrollIntoView(F),e.display.lineSpace.removeChild(J)}}function Yo(e,n,k,A){A==null&&(A=0);var F;!e.options.lineWrapping&&n==k&&(n=n.ch?dt(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,k=n.sticky=="before"?dt(n.line,n.ch+1,"before"):n);for(var J=0;J<5;J++){var le=!1,pe=Gr(e,n),ge=!k||k==n?pe:Gr(e,k);F={left:Math.min(pe.left,ge.left),top:Math.min(pe.top,ge.top)-A,right:Math.max(pe.left,ge.left),bottom:Math.max(pe.bottom,ge.bottom)+A};var Ee=ro(e,F),We=e.doc.scrollTop,Ke=e.doc.scrollLeft;if(Ee.scrollTop!=null&&(xa(e,Ee.scrollTop),Math.abs(e.doc.scrollTop-We)>1&&(le=!0)),Ee.scrollLeft!=null&&(zi(e,Ee.scrollLeft),Math.abs(e.doc.scrollLeft-Ke)>1&&(le=!0)),!le)break}return F}function _o(e,n){var k=ro(e,n);k.scrollTop!=null&&xa(e,k.scrollTop),k.scrollLeft!=null&&zi(e,k.scrollLeft)}function ro(e,n){var k=e.display,A=Wn(e.display);n.top<0&&(n.top=0);var F=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:k.scroller.scrollTop,J=be(e),le={};n.bottom-n.top>J&&(n.bottom=n.top+J);var pe=e.doc.height+Ie(k),ge=n.top<A,Ee=n.bottom>pe-A;if(n.top<F)le.scrollTop=ge?0:n.top;else if(n.bottom>F+J){var We=Math.min(n.top,(Ee?pe:n.bottom)-J);We!=F&&(le.scrollTop=We)}var Ke=e.options.fixedGutter?0:k.gutters.offsetWidth,lt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:k.scroller.scrollLeft-Ke,at=Ue(e)-k.gutters.offsetWidth,pt=n.right-n.left>at;return pt&&(n.right=n.left+at),n.left<10?le.scrollLeft=0:n.left<lt?le.scrollLeft=Math.max(0,n.left+Ke-(pt?0:10)):n.right>at+lt-3&&(le.scrollLeft=n.right+(pt?0:10)-at),le}function no(e,n){if(n==null)return;Na(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n}function ya(e){Na(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ba(e,n,k){(n!=null||k!=null)&&Na(e),n!=null&&(e.curOp.scrollLeft=n),k!=null&&(e.curOp.scrollTop=k)}function $o(e,n){Na(e),e.curOp.scrollToPos=n}function Na(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var k=or(e,n.from),A=or(e,n.to);Oa(e,k,A,n.margin)}}function Oa(e,n,k,A){var F=ro(e,{left:Math.min(n.left,k.left),top:Math.min(n.top,k.top)-A,right:Math.max(n.right,k.right),bottom:Math.max(n.bottom,k.bottom)+A});ba(e,F.scrollLeft,F.scrollTop)}function xa(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;T||Da(e,{top:n}),Ea(e,n,!0),T&&Da(e),Ra(e,100)}function Ea(e,n,k){if(n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),e.display.scroller.scrollTop==n&&!k)return;e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n)}function zi(e,n,k,A){if(n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(k?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!A)return;e.doc.scrollLeft=n,Yr(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n)}function ca(e){var n=e.display,k=n.gutters.offsetWidth,A=Math.round(e.doc.height+Ie(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?k:0,docHeight:A,scrollHeight:A+Qe(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:k}}var oa=function(e,n,k){this.cm=k;var A=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),F=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");A.tabIndex=F.tabIndex=-1,e(A),e(F),Ae(A,"scroll",function(){A.clientHeight&&n(A.scrollTop,"vertical")}),Ae(F,"scroll",function(){F.clientWidth&&n(F.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,S&&y<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};oa.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,k=e.scrollHeight>e.clientHeight+1,A=e.nativeBarWidth;if(k){this.vert.style.display="block",this.vert.style.bottom=n?A+"px":"0";var F=e.viewHeight-(n?A:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+F)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=k?A+"px":"0",this.horiz.style.left=e.barLeft+"px";var J=e.viewWidth-e.barLeft-(k?A:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+J)+"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:k?A:0,bottom:n?A:0}},oa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},oa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},oa.prototype.zeroWidthHack=function(){var e=a&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new q,this.disableVert=new q},oa.prototype.enableZeroWidthBar=function(e,n,k){e.style.pointerEvents="auto";function A(){var F=e.getBoundingClientRect(),J=k=="vert"?document.elementFromPoint(F.right-1,(F.top+F.bottom)/2):document.elementFromPoint((F.right+F.left)/2,F.bottom-1);J!=e?e.style.pointerEvents="none":n.set(1e3,A)}n.set(1e3,A)},oa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Aa=function(){};Aa.prototype.update=function(){return{bottom:0,right:0}},Aa.prototype.setScrollLeft=function(){},Aa.prototype.setScrollTop=function(){},Aa.prototype.clear=function(){};function da(e,n){n||(n=ca(e));var k=e.display.barWidth,A=e.display.barHeight;ja(e,n);for(var F=0;F<4&&k!=e.display.barWidth||A!=e.display.barHeight;F++)k!=e.display.barWidth&&e.options.lineWrapping&&Pa(e),ja(e,ca(e)),k=e.display.barWidth,A=e.display.barHeight}function ja(e,n){var k=e.display,A=k.scrollbars.update(n);k.sizer.style.paddingRight=(k.barWidth=A.right)+"px",k.sizer.style.paddingBottom=(k.barHeight=A.bottom)+"px",k.heightForcer.style.borderBottom=A.bottom+"px solid transparent",A.right&&A.bottom?(k.scrollbarFiller.style.display="block",k.scrollbarFiller.style.height=A.bottom+"px",k.scrollbarFiller.style.width=A.right+"px"):k.scrollbarFiller.style.display="",A.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(k.gutterFiller.style.display="block",k.gutterFiller.style.height=A.bottom+"px",k.gutterFiller.style.width=n.gutterWidth+"px"):k.gutterFiller.style.display=""}var io={native:oa,null:Aa};function Fa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&w(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new io[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),Ae(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,k){k=="horizontal"?zi(e,n):xa(e,n)},e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var ao=0;function sa(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ao},mi(e.curOp)}function ha(e){var n=e.curOp;n&&zr(n,function(k){for(var A=0;A<k.ops.length;A++)k.ops[A].cm.curOp=null;Oo(k)})}function Oo(e){for(var n=e.ops,k=0;k<n.length;k++)Jo(n[k]);for(var A=0;A<n.length;A++)Qo(n[A]);for(var F=0;F<n.length;F++)Zo(n[F]);for(var J=0;J<n.length;J++)oo(n[J]);for(var le=0;le<n.length;le++)qo(n[le])}function Jo(e){var n=e.cm,k=n.display;Ao(n),e.updateMaxLine&&Bi(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<k.viewFrom||e.scrollToPos.to.line>=k.viewTo)||k.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new Ki(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qo(e){e.updatedDisplay=e.mustUpdate&&fa(e.cm,e.update)}function Zo(e){var n=e.cm,k=n.display;e.updatedDisplay&&Pa(n),e.barMeasure=ca(n),k.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=He(n,k.maxLine,k.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(k.scroller.clientWidth,k.sizer.offsetLeft+e.adjustWidthTo+Qe(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,k.sizer.offsetLeft+e.adjustWidthTo-Ue(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=k.input.prepareSelection())}function oo(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&zi(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var k=e.focus&&e.focus==V();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,k),(e.updatedDisplay||e.startHeight!=n.doc.height)&&da(n,e.barMeasure),e.updatedDisplay&&pn(n,e.barMeasure),e.selectionChanged&&ni(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),k&&To(e.cm)}function qo(e){var n=e.cm,k=n.display,A=n.doc;if(e.updatedDisplay&&Ua(n,e.update),k.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(k.wheelStartX=k.wheelStartY=null),e.scrollTop!=null&&Ea(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&zi(n,e.scrollLeft,!0,!0),e.scrollToPos){var F=Yo(n,G(A,e.scrollToPos.from),G(A,e.scrollToPos.to),e.scrollToPos.margin);Xo(n,F)}var J=e.maybeHiddenMarkers,le=e.maybeUnhiddenMarkers;if(J)for(var pe=0;pe<J.length;++pe)J[pe].lines.length||$e(J[pe],"hide");if(le)for(var ge=0;ge<le.length;++ge)le[ge].lines.length&&$e(le[ge],"unhide");k.wrapper.offsetHeight&&(A.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&$e(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function Ti(e,n){if(e.curOp)return n();sa(e);try{return n()}finally{ha(e)}}function Vn(e,n){return function(){if(e.curOp)return n.apply(e,arguments);sa(e);try{return n.apply(e,arguments)}finally{ha(e)}}}function gi(e){return function(){if(this.curOp)return e.apply(this,arguments);sa(this);try{return e.apply(this,arguments)}finally{ha(this)}}}function Xn(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);sa(n);try{return e.apply(this,arguments)}finally{ha(n)}}}function Ra(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,U(es,e))}function es(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var k=+new Date+e.options.workTime,A=St(e,n.highlightFrontier),F=[];n.iter(A.line,Math.min(n.first+n.size,e.display.viewTo+500),function(J){if(A.line>=e.display.viewFrom){var le=J.styles,pe=J.text.length>e.options.maxHighlightLength?lr(n.mode,A.state):null,ge=ze(e,J,A,!0);pe&&(A.state=pe),J.styles=ge.styles;var Ee=J.styleClasses,We=ge.classes;We?J.styleClasses=We:Ee&&(J.styleClasses=null);for(var Ke=!le||le.length!=J.styles.length||Ee!=We&&(!Ee||!We||Ee.bgClass!=We.bgClass||Ee.textClass!=We.textClass),lt=0;!Ke&<<le.length;++lt)Ke=le[lt]!=J.styles[lt];Ke&&F.push(A.line),J.stateAfter=A.save(),A.nextLine()}else J.text.length<=e.options.maxHighlightLength&&Ft(e,J.text,A),J.stateAfter=A.line%5==0?A.save():null,A.nextLine();if(+new Date>k)return Ra(e,e.options.workDelay),!0}),n.highlightFrontier=A.line,n.modeFrontier=Math.max(n.modeFrontier,A.line),F.length&&Ti(e,function(){for(var J=0;J<F.length;J++)Nn(e,F[J],"text")})}var Ki=function(e,n,k){var A=e.display;this.viewport=n,this.visible=Ia(A,e.doc,n),this.editorIsHidden=!A.wrapper.offsetWidth,this.wrapperHeight=A.wrapper.clientHeight,this.wrapperWidth=A.wrapper.clientWidth,this.oldDisplayWidth=Ue(e),this.force=k,this.dims=In(e),this.events=[]};Ki.prototype.signal=function(e,n){De(e,n)&&this.events.push(arguments)},Ki.prototype.finish=function(){for(var e=0;e<this.events.length;e++)$e.apply(null,this.events[e])};function Ao(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=Qe(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=Qe(e)+"px",n.scrollbarsClipped=!0)}function Ro(e){if(e.hasFocus())return null;var n=V();if(!n||!P(e.display.lineDiv,n))return null;var k={activeElt:n};if(window.getSelection){var A=window.getSelection();A.anchorNode&&A.extend&&P(e.display.lineDiv,A.anchorNode)&&(k.anchorNode=A.anchorNode,k.anchorOffset=A.anchorOffset,k.focusNode=A.focusNode,k.focusOffset=A.focusOffset)}return k}function Do(e){if(!e||!e.activeElt||e.activeElt==V())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode)){var n=window.getSelection(),k=document.createRange();k.setEnd(e.anchorNode,e.anchorOffset),k.collapse(!1),n.removeAllRanges(),n.addRange(k),n.extend(e.focusNode,e.focusOffset)}}function fa(e,n){var k=e.display,A=e.doc;if(n.editorIsHidden)return Mn(e),!1;if(!n.force&&n.visible.from>=k.viewFrom&&n.visible.to<=k.viewTo&&(k.updateLineNumbers==null||k.updateLineNumbers>=k.viewTo)&&k.renderedView==k.view&&na(e)==0)return!1;ii(e)&&(Mn(e),n.dims=In(e));var F=A.first+A.size,J=Math.max(n.visible.from-e.options.viewportMargin,A.first),le=Math.min(F,n.visible.to+e.options.viewportMargin);k.viewFrom<J&&J-k.viewFrom<20&&(J=Math.max(A.first,k.viewFrom)),k.viewTo>le&&k.viewTo-le<20&&(le=Math.min(F,k.viewTo)),qt&&(J=qn(e.doc,J),le=Ci(e.doc,le));var pe=J!=k.viewFrom||le!=k.viewTo||k.lastWrapHeight!=n.wrapperHeight||k.lastWrapWidth!=n.wrapperWidth;ra(e,J,le),k.viewOffset=si(Ct(e.doc,k.viewFrom)),e.display.mover.style.top=k.viewOffset+"px";var ge=na(e);if(!pe&&ge==0&&!n.force&&k.renderedView==k.view&&(k.updateLineNumbers==null||k.updateLineNumbers>=k.viewTo))return!1;var Ee=Ro(e);return ge>4&&(k.lineDiv.style.display="none"),ko(e,k.updateLineNumbers,n.dims),ge>4&&(k.lineDiv.style.display=""),k.renderedView=k.view,Do(Ee),C(k.cursorDiv),C(k.selectionDiv),k.gutters.style.height=k.sizer.style.minHeight=0,pe&&(k.lastWrapHeight=n.wrapperHeight,k.lastWrapWidth=n.wrapperWidth,Ra(e,400)),k.updateLineNumbers=null,!0}function Ua(e,n){for(var k=n.viewport,A=!0;;A=!1){if(!A||!e.options.lineWrapping||n.oldDisplayWidth==Ue(e)){if(k&&k.top!=null&&(k={top:Math.min(e.doc.height+Ie(e.display)-be(e),k.top)}),n.visible=Ia(e.display,e.doc,k),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else A&&(n.visible=Ia(e.display,e.doc,k));if(!fa(e,n))break;Pa(e);var F=ca(e);xn(e),da(e,F),pn(e,F),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Da(e,n){var k=new Ki(e,n);if(fa(e,k)){Pa(e),Ua(e,k);var A=ca(e);xn(e),da(e,A),pn(e,A),k.finish()}}function ko(e,n,k){var A=e.display,F=e.options.lineNumbers,J=A.lineDiv,le=J.firstChild;function pe(pt){var bt=pt.nextSibling;return c&&a&&e.display.currentWheelTarget==pt?pt.style.display="none":pt.parentNode.removeChild(pt),bt}for(var ge=A.view,Ee=A.viewFrom,We=0;We<ge.length;We++){var Ke=ge[We];if(!Ke.hidden)if(!Ke.node||Ke.node.parentNode!=J){var lt=Dn(e,Ke,Ee,k);J.insertBefore(lt,le)}else{for(;le!=Ke.node;)le=pe(le);var at=F&&n!=null&&n<=Ee&&Ke.lineNumber;Ke.changes&&(ne(Ke.changes,"gutter")>-1&&(at=!1),Xi(e,Ke,Ee,k)),at&&(C(Ke.lineNumber),Ke.lineNumber.appendChild(document.createTextNode(Vr(e.options,Ee)))),le=Ke.node.nextSibling}Ee+=Ke.size}for(;le;)le=pe(le)}function Ba(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function pn(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+Qe(e)+"px"}function Yr(e){var n=e.display,k=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var A=bi(n)-n.scroller.scrollLeft+e.doc.scrollLeft,F=n.gutters.offsetWidth,J=A+"px",le=0;le<k.length;le++)if(!k[le].hidden){e.options.fixedGutter&&(k[le].gutter&&(k[le].gutter.style.left=J),k[le].gutterBackground&&(k[le].gutterBackground.style.left=J));var pe=k[le].alignable;if(pe)for(var ge=0;ge<pe.length;ge++)pe[ge].style.left=J}e.options.fixedGutter&&(n.gutters.style.left=A+F+"px")}function ii(e){if(!e.options.lineNumbers)return!1;var n=e.doc,k=Vr(e.options,n.first+n.size-1),A=e.display;if(k.length!=A.lineNumChars){var F=A.measure.appendChild(_("div",[_("div",k)],"CodeMirror-linenumber CodeMirror-gutter-elt")),J=F.firstChild.offsetWidth,le=F.offsetWidth-J;return A.lineGutter.style.width="",A.lineNumInnerWidth=Math.max(J,A.lineGutter.offsetWidth-le)+1,A.lineNumWidth=A.lineNumInnerWidth+le,A.lineNumChars=A.lineNumInnerWidth?k.length:-1,A.lineGutter.style.width=A.lineNumWidth+"px",Ba(e.display),!0}return!1}function _i(e,n){for(var k=[],A=!1,F=0;F<e.length;F++){var J=e[F],le=null;if(typeof J!="string"&&(le=J.style,J=J.className),J=="CodeMirror-linenumbers")if(n)A=!0;else continue;k.push({className:J,style:le})}return n&&!A&&k.push({className:"CodeMirror-linenumbers",style:null}),k}function wa(e){var n=e.gutters,k=e.gutterSpecs;C(n),e.lineGutter=null;for(var A=0;A<k.length;++A){var F=k[A],J=F.className,le=F.style,pe=n.appendChild(_("div",null,"CodeMirror-gutter "+J));le&&(pe.style.cssText=le),J=="CodeMirror-linenumbers"&&(e.lineGutter=pe,pe.style.width=(e.lineNumWidth||1)+"px")}n.style.display=k.length?"":"none",Ba(e)}function Zi(e){wa(e.display),wn(e),Yr(e)}function ka(e,n,k,A){var F=this;this.input=k,F.scrollbarFiller=_("div",null,"CodeMirror-scrollbar-filler"),F.scrollbarFiller.setAttribute("cm-not-content","true"),F.gutterFiller=_("div",null,"CodeMirror-gutter-filler"),F.gutterFiller.setAttribute("cm-not-content","true"),F.lineDiv=j("div",null,"CodeMirror-code"),F.selectionDiv=_("div",null,null,"position: relative; z-index: 1"),F.cursorDiv=_("div",null,"CodeMirror-cursors"),F.measure=_("div",null,"CodeMirror-measure"),F.lineMeasure=_("div",null,"CodeMirror-measure"),F.lineSpace=j("div",[F.measure,F.lineMeasure,F.selectionDiv,F.cursorDiv,F.lineDiv],null,"position: relative; outline: none");var J=j("div",[F.lineSpace],"CodeMirror-lines");F.mover=_("div",[J],null,"position: relative"),F.sizer=_("div",[F.mover],"CodeMirror-sizer"),F.sizerWidth=null,F.heightForcer=_("div",null,null,"position: absolute; height: "+te+"px; width: 1px;"),F.gutters=_("div",null,"CodeMirror-gutters"),F.lineGutter=null,F.scroller=_("div",[F.sizer,F.heightForcer,F.gutters],"CodeMirror-scroll"),F.scroller.setAttribute("tabIndex","-1"),F.wrapper=_("div",[F.scrollbarFiller,F.gutterFiller,F.scroller],"CodeMirror"),S&&y<8&&(F.gutters.style.zIndex=-1,F.scroller.style.paddingRight=0),!c&&!(T&&t)&&(F.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(F.wrapper):e(F.wrapper)),F.viewFrom=F.viewTo=n.first,F.reportedViewFrom=F.reportedViewTo=n.first,F.view=[],F.renderedView=null,F.externalMeasured=null,F.viewOffset=0,F.lastWrapHeight=F.lastWrapWidth=0,F.updateLineNumbers=null,F.nativeBarWidth=F.barHeight=F.barWidth=0,F.scrollbarsClipped=!1,F.lineNumWidth=F.lineNumInnerWidth=F.lineNumChars=null,F.alignWidgets=!1,F.cachedCharWidth=F.cachedTextHeight=F.cachedPaddingH=null,F.maxLine=null,F.maxLineLength=0,F.maxLineChanged=!1,F.wheelDX=F.wheelDY=F.wheelStartX=F.wheelStartY=null,F.shift=!1,F.selForContextMenu=null,F.activeTouch=null,F.gutterSpecs=_i(A.gutters,A.lineNumbers),wa(F),k.init(F)}var la=0,ai=null;S?ai=-.53:T?ai=15:r?ai=-.7:d&&(ai=-1/3);function Wa(e){var n=e.wheelDeltaX,k=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),k==null&&e.detail&&e.axis==e.VERTICAL_AXIS?k=e.detail:k==null&&(k=e.wheelDelta),{x:n,y:k}}function so(e){var n=Wa(e);return n.x*=ai,n.y*=ai,n}function lo(e,n){var k=Wa(n),A=k.x,F=k.y,J=e.display,le=J.scroller,pe=le.scrollWidth>le.clientWidth,ge=le.scrollHeight>le.clientHeight;if(!(A&&pe||F&&ge))return;if(F&&a&&c){e:for(var Ee=n.target,We=J.view;Ee!=le;Ee=Ee.parentNode)for(var Ke=0;Ke<We.length;Ke++)if(We[Ke].node==Ee){e.display.currentWheelTarget=Ee;break e}}if(A&&!T&&!s&&ai!=null){F&&ge&&xa(e,Math.max(0,le.scrollTop+F*ai)),zi(e,Math.max(0,le.scrollLeft+A*ai)),(!F||F&&ge)&&xe(n),J.wheelStartX=null;return}if(F&&ai!=null){var lt=F*ai,at=e.doc.scrollTop,pt=at+J.wrapper.clientHeight;lt<0?at=Math.max(0,at+lt-50):pt=Math.min(e.doc.height,pt+lt+50),Da(e,{top:at,bottom:pt})}la<20&&(J.wheelStartX==null?(J.wheelStartX=le.scrollLeft,J.wheelStartY=le.scrollTop,J.wheelDX=A,J.wheelDY=F,setTimeout(function(){if(J.wheelStartX==null)return;var bt=le.scrollLeft-J.wheelStartX,Dt=le.scrollTop-J.wheelStartY,It=Dt&&J.wheelDY&&Dt/J.wheelDY||bt&&J.wheelDX&&bt/J.wheelDX;if(J.wheelStartX=J.wheelStartY=null,!It)return;ai=(ai*la+It)/(la+1),++la},200)):(J.wheelDX+=A,J.wheelDY+=F))}var Oi=function(e,n){this.ranges=e,this.primIndex=n};Oi.prototype.primary=function(){return this.ranges[this.primIndex]},Oi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var k=this.ranges[n],A=e.ranges[n];if(!$t(k.anchor,A.anchor)||!$t(k.head,A.head))return!1}return!0},Oi.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new hn(hr(this.ranges[n].anchor),hr(this.ranges[n].head));return new Oi(e,this.primIndex)},Oi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Oi.prototype.contains=function(e,n){n||(n=e);for(var k=0;k<this.ranges.length;k++){var A=this.ranges[k];if(At(n,A.from())>=0&&At(e,A.to())<=0)return k}return-1};var hn=function(e,n){this.anchor=e,this.head=n};hn.prototype.from=function(){return Er(this.anchor,this.head)},hn.prototype.to=function(){return vr(this.anchor,this.head)},hn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Gi(e,n,k){var A=e&&e.options.selectionsMayTouch,F=n[k];n.sort(function(lt,at){return At(lt.from(),at.from())}),k=ne(n,F);for(var J=1;J<n.length;J++){var le=n[J],pe=n[J-1],ge=At(pe.to(),le.from());if(A&&!le.empty()?ge>0:ge>=0){var Ee=Er(pe.from(),le.from()),We=vr(pe.to(),le.to()),Ke=pe.empty()?le.from()==le.head:pe.from()==pe.head;J<=k&&--k,n.splice(--J,2,new hn(Ke?We:Ee,Ke?Ee:We))}}return new Oi(n,k)}function qi(e,n){return new Oi([new hn(e,n||e)],0)}function ea(e){return e.text?dt(e.from.line+e.text.length-1,se(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function uo(e,n){if(At(e,n.from)<0)return e;if(At(e,n.to)<=0)return ea(n);var k=e.line+n.text.length-(n.to.line-n.from.line)-1,A=e.ch;return e.line==n.to.line&&(A+=ea(n).ch-n.to.ch),dt(k,A)}function Ha(e,n){for(var k=[],A=0;A<e.sel.ranges.length;A++){var F=e.sel.ranges[A];k.push(new hn(uo(F.anchor,n),uo(F.head,n)))}return Gi(e.cm,k,e.sel.primIndex)}function Lo(e,n,k){return e.line==n.line?dt(k.line,e.ch-n.ch+k.ch):dt(k.line+(e.line-n.line),e.ch)}function Mo(e,n,k){for(var A=[],F=dt(e.first,0),J=F,le=0;le<n.length;le++){var pe=n[le],ge=Lo(pe.from,F,J),Ee=Lo(ea(pe),F,J);if(F=pe.to,J=Ee,k=="around"){var We=e.sel.ranges[le],Ke=At(We.head,We.anchor)<0;A[le]=new hn(Ke?Ee:ge,Ke?ge:Ee)}else A[le]=new hn(ge,ge)}return new Oi(A,e.sel.primIndex)}function pa(e){e.doc.mode=Ot(e.options,e.doc.modeOption),co(e)}function co(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ra(e,100),e.state.modeGen++,e.curOp&&wn(e)}function gs(e,n){return n.from.ch==0&&n.to.ch==0&&se(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,n,k,A){function F(Wt){return k?k[Wt]:null}function J(Wt,Nt,Kt){an(Wt,Nt,Kt,A),Dr(Wt,"change",Wt,n)}function le(Wt,Nt){for(var Kt=[],cr=Wt;cr<Nt;++cr)Kt.push(new li(Ee[cr],F(cr),A));return Kt}var pe=n.from,ge=n.to,Ee=n.text,We=Ct(e,pe.line),Ke=Ct(e,ge.line),lt=se(Ee),at=F(Ee.length-1),pt=ge.line-pe.line;if(n.full)e.insert(0,le(0,Ee.length)),e.remove(Ee.length,e.size-Ee.length);else if(gs(e,n)){var bt=le(0,Ee.length-1);J(Ke,Ke.text,at),pt&&e.remove(pe.line,pt),bt.length&&e.insert(pe.line,bt)}else if(We==Ke)if(Ee.length==1)J(We,We.text.slice(0,pe.ch)+lt+We.text.slice(ge.ch),at);else{var Dt=le(1,Ee.length-1);Dt.push(new li(lt+We.text.slice(ge.ch),at,A)),J(We,We.text.slice(0,pe.ch)+Ee[0],F(0)),e.insert(pe.line+1,Dt)}else if(Ee.length==1)J(We,We.text.slice(0,pe.ch)+Ee[0]+Ke.text.slice(ge.ch),F(0)),e.remove(pe.line+1,pt);else{J(We,We.text.slice(0,pe.ch)+Ee[0],F(0)),J(Ke,lt+Ke.text.slice(ge.ch),at);var It=le(1,Ee.length-1);pt>1&&e.remove(pe.line+1,pt-1),e.insert(pe.line+1,It)}Dr(e,"change",e,n)}function Ca(e,n,k){function A(F,J,le){if(F.linked)for(var pe=0;pe<F.linked.length;++pe){var ge=F.linked[pe];if(ge.doc==J)continue;var Ee=le&&ge.sharedHist;if(k&&!Ee)continue;n(ge.doc,Ee),A(ge.doc,F,Ee)}}A(e,null,!0)}function vs(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,Si(e),pa(e),ys(e),e.options.lineWrapping||Bi(e),e.options.mode=n.modeOption,wn(e)}function ys(e){(e.doc.direction=="rtl"?z:w)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Ti(e,function(){ys(e),wn(e)})}function Po(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function rs(e,n){var k={from:hr(n.from),to:ea(n),text:Ar(e,n.from,n.to)};return Es(e,k,n.from.line,n.to.line+1),Ca(e,function(A){return Es(A,k,n.from.line,n.to.line+1)},!0),k}function bs(e){for(;e.length;){var n=se(e);if(n.ranges)e.pop();else break}}function ml(e,n){if(n)return bs(e.done),se(e.done);if(e.done.length&&!se(e.done).ranges)return se(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),se(e.done)}function xs(e,n,k,A){var F=e.history;F.undone.length=0;var J=+new Date,le,pe;if((F.lastOp==A||F.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&F.lastModTime>J-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(le=ml(F,F.lastOp==A)))pe=se(le.changes),At(n.from,n.to)==0&&At(n.from,pe.to)==0?pe.to=ea(n):le.changes.push(rs(e,n));else{var ge=se(F.done);for((!ge||!ge.ranges)&&Io(e.sel,F.done),le={changes:[rs(e,n)],generation:F.generation},F.done.push(le);F.done.length>F.undoDepth;)F.done.shift(),F.done[0].ranges||F.done.shift()}F.done.push(k),F.generation=++F.maxGeneration,F.lastModTime=F.lastSelTime=J,F.lastOp=F.lastSelOp=A,F.lastOrigin=F.lastSelOrigin=n.origin,pe||$e(e,"historyAdded")}function gl(e,n,k,A){var F=n.charAt(0);return F=="*"||F=="+"&&k.ranges.length==A.ranges.length&&k.somethingSelected()==A.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,n,k,A){var F=e.history,J=A&&A.origin;k==F.lastSelOp||J&&F.lastSelOrigin==J&&(F.lastModTime==F.lastSelTime&&F.lastOrigin==J||gl(e,J,se(F.done),n))?F.done[F.done.length-1]=n:Io(n,F.done),F.lastSelTime=+new Date,F.lastSelOrigin=J,F.lastSelOp=k,A&&A.clearRedo!==!1&&bs(F.undone)}function Io(e,n){var k=se(n);k&&k.ranges&&k.equals(e)||n.push(e)}function Es(e,n,k,A){var F=n["spans_"+e.id],J=0;e.iter(Math.max(e.first,k),Math.min(e.first+e.size,A),function(le){le.markedSpans&&((F||(F=n["spans_"+e.id]={}))[J]=le.markedSpans),++J})}function yl(e){if(!e)return null;for(var n,k=0;k<e.length;++k)e[k].marker.explicitlyCleared?n||(n=e.slice(0,k)):n&&n.push(e[k]);return n?n.length?n:null:e}function bl(e,n){var k=n["spans_"+e.id];if(!k)return null;for(var A=[],F=0;F<n.text.length;++F)A.push(yl(k[F]));return A}function ws(e,n){var k=bl(e,n),A=Zn(e,n);if(!k)return A;if(!A)return k;for(var F=0;F<k.length;++F){var J=k[F],le=A[F];if(J&&le){e:for(var pe=0;pe<le.length;++pe){for(var ge=le[pe],Ee=0;Ee<J.length;++Ee)if(J[Ee].marker==ge.marker)continue e;J.push(ge)}}else le&&(k[F]=le)}return k}function za(e,n,k){for(var A=[],F=0;F<e.length;++F){var J=e[F];if(J.ranges){A.push(k?Oi.prototype.deepCopy.call(J):J);continue}var le=J.changes,pe=[];A.push({changes:pe});for(var ge=0;ge<le.length;++ge){var Ee=le[ge],We=void 0;if(pe.push({from:Ee.from,to:Ee.to,text:Ee.text}),n)for(var Ke in Ee)(We=Ke.match(/^spans_(\d+)$/))&&(ne(n,Number(We[1]))>-1&&(se(pe)[Ke]=Ee[Ke],delete Ee[Ke]))}}return A}function ns(e,n,k,A){if(A){var F=e.anchor;if(k){var J=At(n,F)<0;J!=At(k,F)<0?(F=n,n=k):J!=At(n,k)<0&&(n=k)}return new hn(F,n)}else return new hn(k||n,n)}function No(e,n,k,A,F){F==null&&(F=e.cm&&(e.cm.display.shift||e.extend)),xi(e,new Oi([ns(e.sel.primary(),n,k,F)],0),A)}function Cs(e,n,k){for(var A=[],F=e.cm&&(e.cm.display.shift||e.extend),J=0;J<e.sel.ranges.length;J++)A[J]=ns(e.sel.ranges[J],n[J],null,F);var le=Gi(e.cm,A,e.sel.primIndex);xi(e,le,k)}function is(e,n,k,A){var F=e.sel.ranges.slice(0);F[n]=k,xi(e,Gi(e.cm,F,e.sel.primIndex),A)}function Ss(e,n,k,A){xi(e,qi(n,k),A)}function xl(e,n,k){var A={ranges:n.ranges,update:function(F){this.ranges=[];for(var J=0;J<F.length;J++)this.ranges[J]=new hn(G(e,F[J].anchor),G(e,F[J].head))},origin:k&&k.origin};return $e(e,"beforeSelectionChange",e,A),e.cm&&$e(e.cm,"beforeSelectionChange",e.cm,A),A.ranges!=n.ranges?Gi(e.cm,A.ranges,A.ranges.length-1):n}function Ts(e,n,k){var A=e.history.done,F=se(A);F&&F.ranges?(A[A.length-1]=n,jo(e,n,k)):xi(e,n,k)}function xi(e,n,k){jo(e,n,k),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,k)}function jo(e,n,k){(De(e,"beforeSelectionChange")||e.cm&&De(e.cm,"beforeSelectionChange"))&&(n=xl(e,n,k));var A=k&&k.bias||(At(n.primary().head,e.sel.primary().head)<0?-1:1);_s(e,As(e,n,A,!0)),!(k&&k.scroll===!1)&&e.cm&&ya(e.cm)}function _s(e,n){if(n.equals(e.sel))return;e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,je(e.cm)),Dr(e,"cursorActivity",e)}function Os(e){_s(e,As(e,e.sel,null,!1))}function As(e,n,k,A){for(var F,J=0;J<n.ranges.length;J++){var le=n.ranges[J],pe=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[J],ge=Fo(e,le.anchor,pe&&pe.anchor,k,A),Ee=Fo(e,le.head,pe&&pe.head,k,A);(F||ge!=le.anchor||Ee!=le.head)&&(F||(F=n.ranges.slice(0,J)),F[J]=new hn(ge,Ee))}return F?Gi(e.cm,F,n.primIndex):n}function Ka(e,n,k,A,F){var J=Ct(e,n.line);if(J.markedSpans)for(var le=0;le<J.markedSpans.length;++le){var pe=J.markedSpans[le],ge=pe.marker,Ee="selectLeft"in ge?!ge.selectLeft:ge.inclusiveLeft,We="selectRight"in ge?!ge.selectRight:ge.inclusiveRight;if((pe.from==null||(Ee?pe.from<=n.ch:pe.from<n.ch))&&(pe.to==null||(We?pe.to>=n.ch:pe.to>n.ch))){if(F&&($e(ge,"beforeCursorEnter"),ge.explicitlyCleared))if(J.markedSpans){--le;continue}else break;if(!ge.atomic)continue;if(k){var Ke=ge.find(A<0?1:-1),lt=void 0;if((A<0?We:Ee)&&(Ke=Rs(e,Ke,-A,Ke&&Ke.line==n.line?J:null)),Ke&&Ke.line==n.line&&(lt=At(Ke,k))&&(A<0?lt<0:lt>0))return Ka(e,Ke,n,A,F)}var at=ge.find(A<0?-1:1);return(A<0?Ee:We)&&(at=Rs(e,at,A,at.line==n.line?J:null)),at?Ka(e,at,n,A,F):null}}return n}function Fo(e,n,k,A,F){var J=A||1,le=Ka(e,n,k,J,F)||!F&&Ka(e,n,k,J,!0)||Ka(e,n,k,-J,F)||!F&&Ka(e,n,k,-J,!0);return le||(e.cantEdit=!0,dt(e.first,0))}function Rs(e,n,k,A){return k<0&&n.ch==0?n.line>e.first?G(e,dt(n.line-1)):null:k>0&&n.ch==(A||Ct(e,n.line)).text.length?n.line<e.first+e.size-1?dt(n.line+1,0):null:new dt(n.line,n.ch+k)}function Ds(e){e.setSelection(dt(e.firstLine(),0),dt(e.lastLine()),Ce)}function ks(e,n,k){var A={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return A.canceled=!0}};return k&&(A.update=function(F,J,le,pe){F&&(A.from=G(e,F)),J&&(A.to=G(e,J)),le&&(A.text=le),pe!==void 0&&(A.origin=pe)}),$e(e,"beforeChange",e,A),e.cm&&$e(e.cm,"beforeChange",e.cm,A),A.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:A.from,to:A.to,text:A.text,origin:A.origin}}function Ga(e,n,k){if(e.cm){if(!e.cm.curOp)return Vn(e.cm,Ga)(e,n,k);if(e.cm.state.suppressEdits)return}if((De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"))&&(n=ks(e,n,!0),!n))return;var A=pr&&!k&&Ri(e,n.from,n.to);if(A)for(var F=A.length-1;F>=0;--F)Ls(e,{from:A[F].from,to:A[F].to,text:F?[""]:n.text,origin:n.origin});else Ls(e,n)}function Ls(e,n){if(n.text.length==1&&n.text[0]==""&&At(n.from,n.to)==0)return;var k=Ha(e,n);xs(e,n,k,e.cm?e.cm.curOp.id:NaN),ho(e,n,k,Zn(e,n));var A=[];Ca(e,function(F,J){!J&&ne(A,F.history)==-1&&(Ns(F.history,n),A.push(F.history)),ho(F,n,null,Zn(F,n))})}function Uo(e,n,k){var A=e.cm&&e.cm.state.suppressEdits;if(A&&!k)return;for(var F=e.history,J,le=e.sel,pe=n=="undo"?F.done:F.undone,ge=n=="undo"?F.undone:F.done,Ee=0;Ee<pe.length&&!(J=pe[Ee],k?J.ranges&&!J.equals(e.sel):!J.ranges);Ee++);if(Ee==pe.length)return;for(F.lastOrigin=F.lastSelOrigin=null;;)if(J=pe.pop(),J.ranges){if(Io(J,ge),k&&!J.equals(e.sel)){xi(e,J,{clearRedo:!1});return}le=J}else if(A){pe.push(J);return}else break;var We=[];Io(le,ge),ge.push({changes:We,generation:F.generation}),F.generation=J.generation||++F.maxGeneration;for(var Ke=De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"),lt=function(bt){var Dt=J.changes[bt];if(Dt.origin=n,Ke&&!ks(e,Dt,!1))return pe.length=0,{};We.push(rs(e,Dt));var It=bt?Ha(e,Dt):se(pe);ho(e,Dt,It,ws(e,Dt)),!bt&&e.cm&&e.cm.scrollIntoView({from:Dt.from,to:ea(Dt)});var Wt=[];Ca(e,function(Nt,Kt){!Kt&&ne(Wt,Nt.history)==-1&&(Ns(Nt.history,Dt),Wt.push(Nt.history)),ho(Nt,Dt,null,ws(Nt,Dt))})},at=J.changes.length-1;at>=0;--at){var pt=lt(at);if(pt)return pt.v}}function Ms(e,n){if(n==0)return;if(e.first+=n,e.sel=new Oi(Te(e.sel.ranges,function(F){return new hn(dt(F.anchor.line+n,F.anchor.ch),dt(F.head.line+n,F.head.ch))}),e.sel.primIndex),e.cm){wn(e.cm,e.first,e.first-n,n);for(var k=e.cm.display,A=k.viewFrom;A<k.viewTo;A++)Nn(e.cm,A,"gutter")}}function ho(e,n,k,A){if(e.cm&&!e.cm.curOp)return Vn(e.cm,ho)(e,n,k,A);if(n.to.line<e.first){Ms(e,n.text.length-1-(n.to.line-n.from.line));return}if(n.from.line>e.lastLine())return;if(n.from.line<e.first){var F=n.text.length-1-(e.first-n.from.line);Ms(e,F),n={from:dt(e.first,0),to:dt(n.to.line+F,n.to.ch),text:[se(n.text)],origin:n.origin}}var J=e.lastLine();n.to.line>J&&(n={from:n.from,to:dt(J,Ct(e,J).text.length),text:[n.text[0]],origin:n.origin}),n.removed=Ar(e,n.from,n.to),k||(k=Ha(e,n)),e.cm?El(e.cm,n,A):ts(e,n,A),jo(e,k,Ce),e.cantEdit&&Fo(e,dt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,n,k){var A=e.doc,F=e.display,J=n.from,le=n.to,pe=!1,ge=J.line;e.options.lineWrapping||(ge=Ut(zn(Ct(A,J.line))),A.iter(ge,le.line+1,function(at){if(at==F.maxLine)return pe=!0,!0})),A.sel.contains(n.from,n.to)>-1&&je(e),ts(A,n,k,Wi(e)),e.options.lineWrapping||(A.iter(ge,J.line+n.text.length,function(at){var pt=pi(at);pt>F.maxLineLength&&(F.maxLine=at,F.maxLineLength=pt,F.maxLineChanged=!0,pe=!1)}),pe&&(e.curOp.updateMaxLine=!0)),$r(A,J.line),Ra(e,400);var Ee=n.text.length-(le.line-J.line)-1;n.full?wn(e):J.line==le.line&&n.text.length==1&&!gs(e.doc,n)?Nn(e,J.line,"text"):wn(e,J.line,le.line+1,Ee);var We=De(e,"changes"),Ke=De(e,"change");if(Ke||We){var lt={from:J,to:le,text:n.text,removed:n.removed,origin:n.origin};Ke&&Dr(e,"change",e,lt),We&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(lt)}e.display.selForContextMenu=null}function Va(e,n,k,A,F){var J;A||(A=k),At(A,k)<0&&(J=[A,k],k=J[0],A=J[1]),typeof n=="string"&&(n=e.splitLines(n)),Ga(e,{from:k,to:A,text:n,origin:F})}function Ps(e,n,k,A){k<e.line?e.line+=A:n<e.line&&(e.line=n,e.ch=0)}function Is(e,n,k,A){for(var F=0;F<e.length;++F){var J=e[F],le=!0;if(J.ranges){J.copied||(J=e[F]=J.deepCopy(),J.copied=!0);for(var pe=0;pe<J.ranges.length;pe++)Ps(J.ranges[pe].anchor,n,k,A),Ps(J.ranges[pe].head,n,k,A);continue}for(var ge=0;ge<J.changes.length;++ge){var Ee=J.changes[ge];if(k<Ee.from.line)Ee.from=dt(Ee.from.line+A,Ee.from.ch),Ee.to=dt(Ee.to.line+A,Ee.to.ch);else if(n<=Ee.to.line){le=!1;break}}le||(e.splice(0,F+1),F=0)}}function Ns(e,n){var k=n.from.line,A=n.to.line,F=n.text.length-(A-k)-1;Is(e.done,k,A,F),Is(e.undone,k,A,F)}function fo(e,n,k,A){var F=n,J=n;return typeof n=="number"?J=Ct(e,ae(e,n)):F=Ut(n),F==null?null:(A(J,F)&&e.cm&&Nn(e.cm,F,k),J)}function po(e){this.lines=e,this.parent=null;for(var n=0,k=0;k<e.length;++k)e[k].parent=this,n+=e[k].height;this.height=n}po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var k=e,A=e+n;k<A;++k){var F=this.lines[k];this.height-=F.height,Qi(F),Dr(F,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,k){this.height+=k,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var A=0;A<n.length;++A)n[A].parent=this},iterN:function(e,n,k){for(var A=e+n;e<A;++e)if(k(this.lines[e]))return!0}};function mo(e){this.children=e;for(var n=0,k=0,A=0;A<e.length;++A){var F=e[A];n+=F.chunkSize(),k+=F.height,F.parent=this}this.size=n,this.height=k,this.parent=null}mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var k=0;k<this.children.length;++k){var A=this.children[k],F=A.chunkSize();if(e<F){var J=Math.min(n,F-e),le=A.height;if(A.removeInner(e,J),this.height-=le-A.height,F==J&&(this.children.splice(k--,1),A.parent=null),(n-=J)==0)break;e=0}else e-=F}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof po))){var pe=[];this.collapse(pe),this.children=[new po(pe)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,k){this.size+=n.length,this.height+=k;for(var A=0;A<this.children.length;++A){var F=this.children[A],J=F.chunkSize();if(e<=J){if(F.insertInner(e,n,k),F.lines&&F.lines.length>50){for(var le=F.lines.length%25+25,pe=le;pe<F.lines.length;){var ge=new po(F.lines.slice(pe,pe+=25));F.height-=ge.height,this.children.splice(++A,0,ge),ge.parent=this}F.lines=F.lines.slice(0,le),this.maybeSpill()}break}e-=J}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var n=e.children.splice(e.children.length-5,5),k=new mo(n);if(e.parent){e.size-=k.size,e.height-=k.height;var F=ne(e.parent.children,e);e.parent.children.splice(F+1,0,k)}else{var A=new mo(e.children);A.parent=e,e.children=[A,k],e=A}k.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,k){for(var A=0;A<this.children.length;++A){var F=this.children[A],J=F.chunkSize();if(e<J){var le=Math.min(n,J-e);if(F.iterN(e,le,k))return!0;if((n-=le)==0)break;e=0}else e-=J}}};var go=function(e,n,k){if(k)for(var A in k)k.hasOwnProperty(A)&&(this[A]=k[A]);this.doc=e,this.node=n};go.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,k=this.line,A=Ut(k);if(A==null||!n)return;for(var F=0;F<n.length;++F)n[F]==this&&n.splice(F--,1);n.length||(k.widgets=null);var J=Gn(this);Yt(k,Math.max(0,k.height-J)),e&&(Ti(e,function(){js(e,k,-J),Nn(e,A,"widget")}),Dr(e,"lineWidgetCleared",e,this,A))},go.prototype.changed=function(){var e=this,n=this.height,k=this.doc.cm,A=this.line;this.height=null;var F=Gn(this)-n;if(!F)return;Fn(this.doc,A)||Yt(A,A.height+F),k&&Ti(k,function(){k.curOp.forceUpdate=!0,js(k,A,F),Dr(k,"lineWidgetChanged",k,e,Ut(A))})},Pe(go);function js(e,n,k){si(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&no(e,k)}function wl(e,n,k,A){var F=new go(e,k,A),J=e.cm;return J&&F.noHScroll&&(J.display.alignWidgets=!0),fo(e,n,"widget",function(le){var pe=le.widgets||(le.widgets=[]);if(F.insertAt==null?pe.push(F):pe.splice(Math.min(pe.length-1,Math.max(0,F.insertAt)),0,F),F.line=le,J&&!Fn(e,le)){var ge=si(le)<e.scrollTop;Yt(le,le.height+Gn(F)),ge&&no(J,F.height),J.curOp.forceUpdate=!0}return!0}),J&&Dr(J,"lineWidgetAdded",J,F,typeof n=="number"?n:Ut(n)),F}var Fs=0,Sa=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Fs};Sa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&sa(e),De(this,"clear")){var k=this.find();k&&Dr(this,"clear",k.from,k.to)}for(var A=null,F=null,J=0;J<this.lines.length;++J){var le=this.lines[J],pe=fn(le.markedSpans,this);e&&!this.collapsed?Nn(e,Ut(le),"text"):e&&(pe.to!=null&&(F=Ut(le)),pe.from!=null&&(A=Ut(le))),le.markedSpans=Sn(le.markedSpans,pe),pe.from==null&&this.collapsed&&!Fn(this.doc,le)&&e&&Yt(le,Wn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ge=0;ge<this.lines.length;++ge){var Ee=zn(this.lines[ge]),We=pi(Ee);We>e.display.maxLineLength&&(e.display.maxLine=Ee,e.display.maxLineLength=We,e.display.maxLineChanged=!0)}A!=null&&e&&this.collapsed&&wn(e,A,F+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Dr(e,"markerCleared",e,this,A,F),n&&ha(e),this.parent&&this.parent.clear()},Sa.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var k,A,F=0;F<this.lines.length;++F){var J=this.lines[F],le=fn(J.markedSpans,this);if(le.from!=null&&(k=dt(n?J:Ut(J),le.from),e==-1))return k;if(le.to!=null&&(A=dt(n?J:Ut(J),le.to),e==1))return A}return k&&{from:k,to:A}},Sa.prototype.changed=function(){var e=this,n=this.find(-1,!0),k=this,A=this.doc.cm;if(!n||!A)return;Ti(A,function(){var F=n.line,J=Ut(n.line),le=Ye(A,J);if(le&&(xr(le),A.curOp.selectionChanged=A.curOp.forceUpdate=!0),A.curOp.updateMaxLine=!0,!Fn(k.doc,F)&&k.height!=null){var pe=k.height;k.height=null;var ge=Gn(k)-pe;ge&&Yt(F,F.height+ge)}Dr(A,"markerChanged",A,e)})},Sa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||ne(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Sa.prototype.detachLine=function(e){if(this.lines.splice(ne(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Pe(Sa);function Xa(e,n,k,A,F){if(A&&A.shared)return Cl(e,n,k,A,F);if(e.cm&&!e.cm.curOp)return Vn(e.cm,Xa)(e,n,k,A,F);var J=new Sa(e,F),le=At(n,k);if(A&&W(A,J,!1),le>0||le==0&&J.clearWhenEmpty!==!1)return J;if(J.replacedWith&&(J.collapsed=!0,J.widgetNode=j("span",[J.replacedWith],"CodeMirror-widget"),A.handleMouseEvents||J.widgetNode.setAttribute("cm-ignore-events","true"),A.insertLeft&&(J.widgetNode.insertLeft=!0)),J.collapsed){if(gn(e,n.line,n,k,J)||n.line!=k.line&&gn(e,k.line,n,k,J))throw new Error("Inserting collapsed marker partially overlapping an existing one");gr()}J.addToHistory&&xs(e,{from:n,to:k,origin:"markText"},e.sel,NaN);var pe=n.line,ge=e.cm,Ee;if(e.iter(pe,k.line+1,function(Ke){ge&&J.collapsed&&!ge.options.lineWrapping&&zn(Ke)==ge.display.maxLine&&(Ee=!0),J.collapsed&&pe!=n.line&&Yt(Ke,0),wi(Ke,new en(J,pe==n.line?n.ch:null,pe==k.line?k.ch:null)),++pe}),J.collapsed&&e.iter(n.line,k.line+1,function(Ke){Fn(e,Ke)&&Yt(Ke,0)}),J.clearOnEnter&&Ae(J,"beforeCursorEnter",function(){return J.clear()}),J.readOnly&&(sr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),J.collapsed&&(J.id=++Fs,J.atomic=!0),ge){if(Ee&&(ge.curOp.updateMaxLine=!0),J.collapsed)wn(ge,n.line,k.line+1);else if(J.className||J.startStyle||J.endStyle||J.css||J.attributes||J.title)for(var We=n.line;We<=k.line;We++)Nn(ge,We,"text");J.atomic&&Os(ge.doc),Dr(ge,"markerAdded",ge,J)}return J}var vo=function(e,n){this.markers=e,this.primary=n;for(var k=0;k<e.length;++k)e[k].parent=this};vo.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Dr(this,"clear")},vo.prototype.find=function(e,n){return this.primary.find(e,n)},Pe(vo);function Cl(e,n,k,A,F){A=W(A),A.shared=!1;var J=[Xa(e,n,k,A,F)],le=J[0],pe=A.widgetNode;return Ca(e,function(ge){pe&&(A.widgetNode=pe.cloneNode(!0)),J.push(Xa(ge,G(ge,n),G(ge,k),A,F));for(var Ee=0;Ee<ge.linked.length;++Ee)if(ge.linked[Ee].isParent)return;le=se(J)}),new vo(J,le)}function Us(e){return e.findMarks(dt(e.first,0),e.clipPos(dt(e.lastLine())),function(n){return n.parent})}function Sl(e,n){for(var k=0;k<n.length;k++){var A=n[k],F=A.find(),J=e.clipPos(F.from),le=e.clipPos(F.to);if(At(J,le)){var pe=Xa(e,J,le,A.primary,A.primary.type);A.markers.push(pe),pe.parent=A}}}function Tl(e){for(var n=function(A){var F=e[A],J=[F.primary.doc];Ca(F.primary.doc,function(ge){return J.push(ge)});for(var le=0;le<F.markers.length;le++){var pe=F.markers[le];ne(J,pe.doc)==-1&&(pe.parent=null,F.markers.splice(le--,1))}},k=0;k<e.length;k++)n(k)}var _l=0,Li=function(e,n,k,A,F){if(!(this instanceof Li))return new Li(e,n,k,A,F);k==null&&(k=0),mo.call(this,[new po([new li("",null)])]),this.first=k,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=k;var J=dt(k,0);this.sel=qi(J),this.history=new Po(null),this.id=++_l,this.modeOption=n,this.lineSep=A,this.direction=F=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:J,to:J,text:e}),xi(this,qi(J),Ce)};Li.prototype=fe(mo.prototype,{constructor:Li,iter:function(e,n,k){k?this.iterN(e-this.first,n-e,k):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var k=0,A=0;A<n.length;++A)k+=n[A].height;this.insertInner(e-this.first,n,k)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Wr(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Xn(function(e){var n=dt(this.first,0),k=this.first+this.size-1;Ga(this,{from:n,to:dt(k,Ct(this,k).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ba(this.cm,0,0),xi(this,qi(n),Ce)}),replaceRange:function(e,n,k,A){n=G(this,n),k=k?G(this,k):n,Va(this,e,n,k,A)},getRange:function(e,n,k){var A=Ar(this,G(this,e),G(this,n));return k===!1?A:A.join(k||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(yn(this,e))return Ct(this,e)},getLineNumber:function(e){return Ut(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ct(this,e)),zn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return G(this,e)},getCursor:function(e){var n=this.sel.primary(),k;return e==null||e=="head"?k=n.head:e=="anchor"?k=n.anchor:e=="end"||e=="to"||e===!1?k=n.to():k=n.from(),k},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Xn(function(e,n,k){Ss(this,G(this,typeof e=="number"?dt(e,n||0):e),null,k)}),setSelection:Xn(function(e,n,k){Ss(this,G(this,e),G(this,n||e),k)}),extendSelection:Xn(function(e,n,k){No(this,G(this,e),n&&G(this,n),k)}),extendSelections:Xn(function(e,n){Cs(this,ie(this,e),n)}),extendSelectionsBy:Xn(function(e,n){var k=Te(this.sel.ranges,e);Cs(this,ie(this,k),n)}),setSelections:Xn(function(e,n,k){if(!e.length)return;for(var A=[],F=0;F<e.length;F++)A[F]=new hn(G(this,e[F].anchor),G(this,e[F].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),xi(this,Gi(this.cm,A,n),k)}),addSelection:Xn(function(e,n,k){var A=this.sel.ranges.slice(0);A.push(new hn(G(this,e),G(this,n||e))),xi(this,Gi(this.cm,A,A.length-1),k)}),getSelection:function(e){for(var n=this.sel.ranges,k,A=0;A<n.length;A++){var F=Ar(this,n[A].from(),n[A].to());k=k?k.concat(F):F}return e===!1?k:k.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],k=this.sel.ranges,A=0;A<k.length;A++){var F=Ar(this,k[A].from(),k[A].to());e!==!1&&(F=F.join(e||this.lineSeparator())),n[A]=F}return n},replaceSelection:function(e,n,k){for(var A=[],F=0;F<this.sel.ranges.length;F++)A[F]=e;this.replaceSelections(A,n,k||"+input")},replaceSelections:Xn(function(e,n,k){for(var A=[],F=this.sel,J=0;J<F.ranges.length;J++){var le=F.ranges[J];A[J]={from:le.from(),to:le.to(),text:this.splitLines(e[J]),origin:k}}for(var pe=n&&n!="end"&&Mo(this,A,n),ge=A.length-1;ge>=0;ge--)Ga(this,A[ge]);pe?Ts(this,pe):this.cm&&ya(this.cm)}),undo:Xn(function(){Uo(this,"undo")}),redo:Xn(function(){Uo(this,"redo")}),undoSelection:Xn(function(){Uo(this,"undo",!0)}),redoSelection:Xn(function(){Uo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,k=0,A=0;A<e.done.length;A++)e.done[A].ranges||++n;for(var F=0;F<e.undone.length;F++)e.undone[F].ranges||++k;return{undo:n,redo:k}},clearHistory:function(){var e=this;this.history=new Po(this.history.maxGeneration),Ca(this,function(n){return n.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:za(this.history.done),undone:za(this.history.undone)}},setHistory:function(e){var n=this.history=new Po(this.history.maxGeneration);n.done=za(e.done.slice(0),null,!0),n.undone=za(e.undone.slice(0),null,!0)},setGutterMarker:Xn(function(e,n,k){return fo(this,e,"gutter",function(A){var F=A.gutterMarkers||(A.gutterMarkers={});return F[n]=k,!k&&Z(F)&&(A.gutterMarkers=null),!0})}),clearGutter:Xn(function(e){var n=this;this.iter(function(k){k.gutterMarkers&&k.gutterMarkers[e]&&fo(n,k,"gutter",function(){return k.gutterMarkers[e]=null,Z(k.gutterMarkers)&&(k.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!yn(this,e))return null;if(n=e,e=Ct(this,e),!e)return null}else if(n=Ut(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Xn(function(e,n,k){return fo(this,e,n=="gutter"?"gutter":"class",function(A){var F=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!A[F])A[F]=k;else{if(O(k).test(A[F]))return!1;A[F]+=" "+k}return!0})}),removeLineClass:Xn(function(e,n,k){return fo(this,e,n=="gutter"?"gutter":"class",function(A){var F=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",J=A[F];if(J)if(k==null)A[F]=null;else{var le=J.match(O(k));if(!le)return!1;var pe=le.index+le[0].length;A[F]=J.slice(0,le.index)+(!le.index||pe==J.length?"":" ")+J.slice(pe)||null}else return!1;return!0})}),addLineWidget:Xn(function(e,n,k){return wl(this,e,n,k)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,k){return Xa(this,G(this,e),G(this,n),k,k&&k.type||"range")},setBookmark:function(e,n){var k={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=G(this,e),Xa(this,e,e,k,"bookmark")},findMarksAt:function(e){e=G(this,e);var n=[],k=Ct(this,e.line).markedSpans;if(k)for(var A=0;A<k.length;++A){var F=k[A];(F.from==null||F.from<=e.ch)&&(F.to==null||F.to>=e.ch)&&n.push(F.marker.parent||F.marker)}return n},findMarks:function(e,n,k){e=G(this,e),n=G(this,n);var A=[],F=e.line;return this.iter(e.line,n.line+1,function(J){var le=J.markedSpans;if(le)for(var pe=0;pe<le.length;pe++){var ge=le[pe];!(ge.to!=null&&F==e.line&&e.ch>=ge.to||ge.from==null&&F!=e.line||ge.from!=null&&F==n.line&&ge.from>=n.ch)&&(!k||k(ge.marker))&&A.push(ge.marker.parent||ge.marker)}++F}),A},getAllMarks:function(){var e=[];return this.iter(function(n){var k=n.markedSpans;if(k)for(var A=0;A<k.length;++A)k[A].from!=null&&e.push(k[A].marker)}),e},posFromIndex:function(e){var n,k=this.first,A=this.lineSeparator().length;return this.iter(function(F){var J=F.text.length+A;if(J>e)return n=e,!0;e-=J,++k}),G(this,dt(k,n))},indexFromPos:function(e){e=G(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var k=this.lineSeparator().length;return this.iter(this.first,e.line,function(A){n+=A.text.length+k}),n},copy:function(e){var n=new Li(Wr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,k=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<k&&(k=e.to);var A=new Li(Wr(this,n,k),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(A.history=this.history),(this.linked||(this.linked=[])).push({doc:A,sharedHist:e.sharedHist}),A.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(A,Us(this)),A},unlinkDoc:function(e){if(e instanceof jn&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var k=this.linked[n];if(k.doc!=e)continue;this.linked.splice(n,1),e.unlinkDoc(this),Tl(Us(this));break}if(e.history==this.history){var A=[e.id];Ca(e,function(F){return A.push(F.id)},!0),e.history=new Po(null),e.history.done=za(this.history.done,A),e.history.undone=za(this.history.undone,A)}},iterLinkedDocs:function(e){Ca(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Pt(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:Xn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&pl(this.cm)})}),Li.prototype.eachLine=Li.prototype.iter;var Bs=0;function Ol(e){var n=this;if(Ws(n),nt(n,e)||$n(n.display,e))return;xe(e),S&&(Bs=+new Date);var k=ri(n,e,!0),A=e.dataTransfer.files;if(!k||n.isReadOnly())return;if(A&&A.length&&window.FileReader&&window.File)for(var F=A.length,J=Array(F),le=0,pe=function(){++le==F&&Vn(n,function(){k=G(n.doc,k);var at={from:k,to:k,text:n.doc.splitLines(J.filter(function(pt){return pt!=null}).join(n.doc.lineSeparator())),origin:"paste"};Ga(n.doc,at),Ts(n.doc,qi(G(n.doc,k),G(n.doc,ea(at))))})()},ge=function(at,pt){if(n.options.allowDropFileTypes&&ne(n.options.allowDropFileTypes,at.type)==-1){pe();return}var bt=new FileReader;bt.onerror=function(){return pe()},bt.onload=function(){var Dt=bt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Dt)){pe();return}J[pt]=Dt,pe()},bt.readAsText(at)},Ee=0;Ee<A.length;Ee++)ge(A[Ee],Ee);else{if(n.state.draggingText&&n.doc.sel.contains(k)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var We=e.dataTransfer.getData("Text");if(We){var Ke;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ke=n.listSelections()),jo(n.doc,qi(k,k)),Ke)for(var lt=0;lt<Ke.length;++lt)Va(n.doc,"",Ke[lt].anchor,Ke[lt].head,"drag");n.replaceSelection(We,"around","paste"),n.display.input.focus()}}catch(at){}}}function Al(e,n){if(S&&(!e.state.draggingText||+new Date-Bs<100)){Ne(n);return}if(nt(e,n)||$n(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!d){var k=_("img",null,null,"position: fixed; left: 0; top: 0;");k.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s&&(k.width=k.height=1,e.display.wrapper.appendChild(k),k._top=k.offsetTop),n.dataTransfer.setDragImage(k,0,0),s&&k.parentNode.removeChild(k)}}function Rl(e,n){var k=ri(e,n);if(!k)return;var A=document.createDocumentFragment();ia(e,k,A),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,A)}function Ws(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Hs(e){if(!document.getElementsByClassName)return;for(var n=document.getElementsByClassName("CodeMirror"),k=[],A=0;A<n.length;A++){var F=n[A].CodeMirror;F&&k.push(F)}k.length&&k[0].operation(function(){for(var J=0;J<k.length;J++)e(k[J])})}var zs=!1;function Dl(){if(zs)return;kl(),zs=!0}function kl(){var e;Ae(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Hs(Ll)},100))}),Ae(window,"blur",function(){return Hs(va)})}function Ll(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Ta={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},yo=0;yo<10;yo++)Ta[yo+48]=Ta[yo+96]=String(yo);for(var Bo=65;Bo<=90;Bo++)Ta[Bo]=String.fromCharCode(Bo);for(var bo=1;bo<=12;bo++)Ta[bo+111]=Ta[bo+63235]="F"+bo;var ma={};ma.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ma.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ma.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ma.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ma.default=a?ma.macDefault:ma.pcDefault;function Ml(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var k,A,F,J,le=0;le<n.length-1;le++){var pe=n[le];if(/^(cmd|meta|m)$/i.test(pe))J=!0;else if(/^a(lt)?$/i.test(pe))k=!0;else if(/^(c|ctrl|control)$/i.test(pe))A=!0;else if(/^s(hift)?$/i.test(pe))F=!0;else throw new Error("Unrecognized modifier name: "+pe)}return k&&(e="Alt-"+e),A&&(e="Ctrl-"+e),J&&(e="Cmd-"+e),F&&(e="Shift-"+e),e}function Pl(e){var n={};for(var k in e)if(e.hasOwnProperty(k)){var A=e[k];if(/^(name|fallthrough|(de|at)tach)$/.test(k))continue;if(A=="..."){delete e[k];continue}for(var F=Te(k.split(" "),Ml),J=0;J<F.length;J++){var le=void 0,pe=void 0;J==F.length-1?(pe=F.join(" "),le=A):(pe=F.slice(0,J+1).join(" "),le="...");var ge=n[pe];if(!ge)n[pe]=le;else if(ge!=le)throw new Error("Inconsistent bindings for "+pe)}delete e[k]}for(var Ee in n)e[Ee]=n[Ee];return e}function Ya(e,n,k,A){n=Wo(n);var F=n.call?n.call(e,A):n[e];if(F===!1)return"nothing";if(F==="...")return"multi";if(F!=null&&k(F))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Ya(e,n.fallthrough,k,A);for(var J=0;J<n.fallthrough.length;J++){var le=Ya(e,n.fallthrough[J],k,A);if(le)return le}}}function Ks(e){var n=typeof e=="string"?e:Ta[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function Gs(e,n,k){var A=e;return n.altKey&&A!="Alt"&&(e="Alt-"+e),(h?n.metaKey:n.ctrlKey)&&A!="Ctrl"&&(e="Ctrl-"+e),(h?n.ctrlKey:n.metaKey)&&A!="Mod"&&(e="Cmd-"+e),!k&&n.shiftKey&&A!="Shift"&&(e="Shift-"+e),e}function Vs(e,n){if(s&&e.keyCode==34&&e.char)return!1;var k=Ta[e.keyCode];return k==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(k=e.code),Gs(k,e,n))}function Wo(e){return typeof e=="string"?ma[e]:e}function $a(e,n){for(var k=e.doc.sel.ranges,A=[],F=0;F<k.length;F++){for(var J=n(k[F]);A.length&&At(J.from,se(A).to)<=0;){var le=A.pop();if(At(le.from,J.from)<0){J.from=le.from;break}}A.push(J)}Ti(e,function(){for(var pe=A.length-1;pe>=0;pe--)Va(e.doc,"",A[pe].from,A[pe].to,"+delete");ya(e)})}function as(e,n,k){var A=Re(e.text,n+k,k);return A<0||A>e.text.length?null:A}function os(e,n,k){var A=as(e,n.ch,k);return A==null?null:new dt(n.line,A,k<0?"after":"before")}function ss(e,n,k,A,F){if(e){n.doc.direction=="rtl"&&(F=-F);var J=ot(k,n.doc.direction);if(J){var le=F<0?se(J):J[0],pe=F<0==(le.level==1),ge=pe?"after":"before",Ee;if(le.level>0||n.doc.direction=="rtl"){var We=Ve(n,k);Ee=F<0?k.text.length-1:0;var Ke=it(n,We,Ee).top;Ee=Je(function(lt){return it(n,We,lt).top==Ke},F<0==(le.level==1)?le.from:le.to-1,Ee),ge=="before"&&(Ee=as(k,Ee,1))}else Ee=F<0?le.to:le.from;return new dt(A,Ee,ge)}}return new dt(A,F<0?k.text.length:0,F<0?"before":"after")}function Il(e,n,k,A){var F=ot(n,e.doc.direction);if(!F)return os(n,k,A);k.ch>=n.text.length?(k.ch=n.text.length,k.sticky="before"):k.ch<=0&&(k.ch=0,k.sticky="after");var J=tt(F,k.ch,k.sticky),le=F[J];if(e.doc.direction=="ltr"&&le.level%2==0&&(A>0?le.to>k.ch:le.from<k.ch))return os(n,k,A);var pe=function(It,Wt){return as(n,It instanceof dt?It.ch:It,Wt)},ge,Ee=function(It){return e.options.lineWrapping?(ge=ge||Ve(e,n),Xt(e,n,ge,It)):{begin:0,end:n.text.length}},We=Ee(k.sticky=="before"?pe(k,-1):k.ch);if(e.doc.direction=="rtl"||le.level==1){var Ke=le.level==1==A<0,lt=pe(k,Ke?1:-1);if(lt!=null&&(Ke?lt<=le.to&<<=We.end:lt>=le.from&<>=We.begin)){var at=Ke?"before":"after";return new dt(k.line,lt,at)}}var pt=function(It,Wt,Nt){for(var Kt=function(An,ci){return ci?new dt(k.line,pe(An,1),"before"):new dt(k.line,An,"after")};It>=0&&It<F.length;It+=Wt){var cr=F[It],ir=Wt>0==(cr.level!=1),Br=ir?Nt.begin:pe(Nt.end,-1);if(cr.from<=Br&&Br<cr.to)return Kt(Br,ir);if(Br=ir?cr.from:pe(cr.to,-1),Nt.begin<=Br&&Br<Nt.end)return Kt(Br,ir)}},bt=pt(J+A,A,We);if(bt)return bt;var Dt=A>0?We.end:pe(We.begin,-1);return Dt!=null&&!(A>0&&Dt==n.text.length)&&(bt=pt(A>0?0:F.length-1,A,Ee(Dt)),bt)?bt:null}var xo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return $a(e,function(n){if(n.empty()){var k=Ct(e.doc,n.head.line).text.length;return n.head.ch==k&&n.head.line<e.lastLine()?{from:n.head,to:dt(n.head.line+1,0)}:{from:n.head,to:dt(n.head.line,k)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return $a(e,function(n){return{from:dt(n.from().line,0),to:G(e.doc,dt(n.to().line+1,0))}})},delLineLeft:function(e){return $a(e,function(n){return{from:dt(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return $a(e,function(n){var k=e.charCoords(n.head,"div").top+5,A=e.coordsChar({left:0,top:k},"div");return{from:A,to:n.from()}})},delWrappedLineRight:function(e){return $a(e,function(n){var k=e.charCoords(n.head,"div").top+5,A=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:k},"div");return{from:n.from(),to:A}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(dt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(dt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Xs(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Ys(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return Nl(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var k=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:k},"div")},Me)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var k=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:k},"div")},Me)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var k=e.cursorCoords(n.head,"div").top+5,A=e.coordsChar({left:0,top:k},"div");return A.ch<e.getLine(A.line).search(/\S/)?Ys(e,n.head):A},Me)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],k=e.listSelections(),A=e.options.tabSize,F=0;F<k.length;F++){var J=k[F].from(),le=H(e.getLine(J.line),J.ch,A);n.push(ce(A-le%A))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ti(e,function(){for(var n=e.listSelections(),k=[],A=0;A<n.length;A++){if(!n[A].empty())continue;var F=n[A].head,J=Ct(e.doc,F.line).text;if(J){if(F.ch==J.length&&(F=new dt(F.line,F.ch-1)),F.ch>0)F=new dt(F.line,F.ch+1),e.replaceRange(J.charAt(F.ch-1)+J.charAt(F.ch-2),dt(F.line,F.ch-2),F,"+transpose");else if(F.line>e.doc.first){var le=Ct(e.doc,F.line-1).text;le&&(F=new dt(F.line,1),e.replaceRange(J.charAt(0)+e.doc.lineSeparator()+le.charAt(le.length-1),dt(F.line-1,le.length-1),F,"+transpose"))}}k.push(new hn(F,F))}e.setSelections(k)})},newlineAndIndent:function(e){return Ti(e,function(){for(var n=e.listSelections(),k=n.length-1;k>=0;k--)e.replaceRange(e.doc.lineSeparator(),n[k].anchor,n[k].head,"+input");n=e.listSelections();for(var A=0;A<n.length;A++)e.indentLine(n[A].from().line,null,!0);ya(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,n){var k=Ct(e.doc,n),A=zn(k);return A!=k&&(n=Ut(A)),ss(!0,e,A,n,1)}function Nl(e,n){var k=Ct(e.doc,n),A=Di(k);return A!=k&&(n=Ut(A)),ss(!0,e,k,n,-1)}function Ys(e,n){var k=Xs(e,n.line),A=Ct(e.doc,k.line),F=ot(A,e.doc.direction);if(!F||F[0].level==0){var J=Math.max(k.ch,A.text.search(/\S/)),le=n.line==k.line&&n.ch<=J&&n.ch;return dt(k.line,le?0:J,k.sticky)}return k}function Ho(e,n,k){if(typeof n=="string"&&(n=xo[n],!n))return!1;e.display.input.ensurePolled();var A=e.display.shift,F=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),k&&(e.display.shift=!1),F=n(e)!=_e}finally{e.display.shift=A,e.state.suppressEdits=!1}return F}function jl(e,n,k){for(var A=0;A<e.state.keyMaps.length;A++){var F=Ya(n,e.state.keyMaps[A],k,e);if(F)return F}return e.options.extraKeys&&Ya(n,e.options.extraKeys,k,e)||Ya(n,e.options.keyMap,k,e)}var Fl=new q;function Eo(e,n,k,A){var F=e.state.keySeq;if(F){if(Ks(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==F&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,F+" "+n,k,A))return!0}return $s(e,n,k,A)}function $s(e,n,k,A){var F=jl(e,n,A);return F=="multi"&&(e.state.keySeq=n),F=="handled"&&Dr(e,"keyHandled",e,n,k),(F=="handled"||F=="multi")&&(xe(k),ni(e)),!!F}function Js(e,n){var k=Vs(n,!0);return k?n.shiftKey&&!e.state.keySeq?Eo(e,"Shift-"+k,n,function(A){return Ho(e,A,!0)})||Eo(e,k,n,function(A){if(typeof A=="string"?/^go[A-Z]/.test(A):A.motion)return Ho(e,A)}):Eo(e,k,n,function(A){return Ho(e,A)}):!1}function Ul(e,n,k){return Eo(e,"'"+k+"'",n,function(A){return Ho(e,A,!0)})}var ls=null;function Qs(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(n.curOp.focus=V(),nt(n,e))return;S&&y<11&&e.keyCode==27&&(e.returnValue=!1);var k=e.keyCode;n.display.shift=k==16||e.shiftKey;var A=Js(n,e);s&&(ls=A?k:null,!A&&k==88&&!rr&&(a?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),T&&!a&&!A&&k==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),k==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Bl(n)}function Bl(e){var n=e.display.lineDiv;z(n,"CodeMirror-crosshair");function k(A){(A.keyCode==18||!A.altKey)&&(w(n,"CodeMirror-crosshair"),ut(document,"keyup",k),ut(document,"mouseover",k))}Ae(document,"keyup",k),Ae(document,"mouseover",k)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),nt(this,e)}function el(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if($n(n.display,e)||nt(n,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var k=e.keyCode,A=e.charCode;if(s&&k==ls){ls=null,xe(e);return}if(s&&(!e.which||e.which<10)&&Js(n,e))return;var F=String.fromCharCode(A==null?k:A);if(F=="\b")return;if(Ul(n,e,F))return;n.display.input.onKeyPress(e)}var Wl=400,us=function(e,n,k){this.time=e,this.pos=n,this.button=k};us.prototype.compare=function(e,n,k){return this.time+Wl>e&&At(n,this.pos)==0&&k==this.button};var wo,Co;function Hl(e,n){var k=+new Date;return Co&&Co.compare(k,e,n)?(wo=Co=null,"triple"):wo&&wo.compare(k,e,n)?(Co=new us(k,e,n),wo=null,"double"):(wo=new us(k,e,n),Co=null,"single")}function tl(e){var n=this,k=n.display;if(nt(n,e)||k.activeTouch&&k.input.supportsTouch())return;if(k.input.ensurePolled(),k.shift=e.shiftKey,$n(k,e)){c||(k.scroller.draggable=!1,setTimeout(function(){return k.scroller.draggable=!0},100));return}if(cs(n,e))return;var A=ri(n,e),F=Xe(e),J=A?Hl(A,F):"single";if(window.focus(),F==1&&n.state.selectingText&&n.state.selectingText(e),A&&zl(n,F,A,J,e))return;F==1?A?Gl(n,A,J,e):et(e)==k.scroller&&xe(e):F==2?(A&&No(n.doc,A),setTimeout(function(){return k.input.focus()},20)):F==3&&(L?n.display.input.onContextMenu(e):eo(n))}function zl(e,n,k,A,F){var J="Click";return A=="double"?J="Double"+J:A=="triple"&&(J="Triple"+J),J=(n==1?"Left":n==2?"Middle":"Right")+J,Eo(e,Gs(J,F),F,function(le){if(typeof le=="string"&&(le=xo[le]),!le)return!1;var pe=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),pe=le(e,k)!=_e}finally{e.state.suppressEdits=!1}return pe})}function Kl(e,n,k){var A=e.getOption("configureMouse"),F=A?A(e,n,k):{};if(F.unit==null){var J=l?k.shiftKey&&k.metaKey:k.altKey;F.unit=J?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(F.extend==null||e.doc.extend)&&(F.extend=e.doc.extend||k.shiftKey),F.addNew==null&&(F.addNew=a?k.metaKey:k.ctrlKey),F.moveOnDrag==null&&(F.moveOnDrag=!(a?k.altKey:k.ctrlKey)),F}function Gl(e,n,k,A){S?setTimeout(U(To,e),0):e.curOp.focus=V();var F=Kl(e,k,A),J=e.doc.sel,le;e.options.dragDrop&&ct&&!e.isReadOnly()&&k=="single"&&(le=J.contains(n))>-1&&(At((le=J.ranges[le]).from(),n)<0||n.xRel>0)&&(At(le.to(),n)>0||n.xRel<0)?Vl(e,A,n,F):Xl(e,A,n,F)}function Vl(e,n,k,A){var F=e.display,J=!1,le=Vn(e,function(Ee){c&&(F.scroller.draggable=!1),e.state.draggingText=!1,ut(F.wrapper.ownerDocument,"mouseup",le),ut(F.wrapper.ownerDocument,"mousemove",pe),ut(F.scroller,"dragstart",ge),ut(F.scroller,"drop",le),J||(xe(Ee),A.addNew||No(e.doc,k,null,null,A.extend),c&&!d||S&&y==9?setTimeout(function(){F.wrapper.ownerDocument.body.focus({preventScroll:!0}),F.input.focus()},20):F.input.focus())}),pe=function(Ee){J=J||Math.abs(n.clientX-Ee.clientX)+Math.abs(n.clientY-Ee.clientY)>=10},ge=function(){return J=!0};c&&(F.scroller.draggable=!0),e.state.draggingText=le,le.copy=!A.moveOnDrag,F.scroller.dragDrop&&F.scroller.dragDrop(),Ae(F.wrapper.ownerDocument,"mouseup",le),Ae(F.wrapper.ownerDocument,"mousemove",pe),Ae(F.scroller,"dragstart",ge),Ae(F.scroller,"drop",le),eo(e),setTimeout(function(){return F.input.focus()},20)}function rl(e,n,k){if(k=="char")return new hn(n,n);if(k=="word")return e.findWordAt(n);if(k=="line")return new hn(dt(n.line,0),G(e.doc,dt(n.line+1,0)));var A=k(e,n);return new hn(A.from,A.to)}function Xl(e,n,k,A){var F=e.display,J=e.doc;xe(n);var le,pe,ge=J.sel,Ee=ge.ranges;if(A.addNew&&!A.extend?(pe=J.sel.contains(k),pe>-1?le=Ee[pe]:le=new hn(k,k)):(le=J.sel.primary(),pe=J.sel.primIndex),A.unit=="rectangle")A.addNew||(le=new hn(k,k)),k=ri(e,n,!0,!0),pe=-1;else{var We=rl(e,k,A.unit);A.extend?le=ns(le,We.anchor,We.head,A.extend):le=We}A.addNew?pe==-1?(pe=Ee.length,xi(J,Gi(e,Ee.concat([le]),pe),{scroll:!1,origin:"*mouse"})):Ee.length>1&&Ee[pe].empty()&&A.unit=="char"&&!A.extend?(xi(J,Gi(e,Ee.slice(0,pe).concat(Ee.slice(pe+1)),0),{scroll:!1,origin:"*mouse"}),ge=J.sel):is(J,pe,le,me):(pe=0,xi(J,new Oi([le],0),me),ge=J.sel);var Ke=k;function lt(Nt){if(At(Ke,Nt)==0)return;if(Ke=Nt,A.unit=="rectangle"){for(var Kt=[],cr=e.options.tabSize,ir=H(Ct(J,k.line).text,k.ch,cr),Br=H(Ct(J,Nt.line).text,Nt.ch,cr),An=Math.min(ir,Br),ci=Math.max(ir,Br),Un=Math.min(k.line,Nt.line),Fi=Math.min(e.lastLine(),Math.max(k.line,Nt.line));Un<=Fi;Un++){var Mi=Ct(J,Un).text,Jn=Oe(Mi,An,cr);An==ci?Kt.push(new hn(dt(Un,Jn),dt(Un,Jn))):Mi.length>Jn&&Kt.push(new hn(dt(Un,Jn),dt(Un,Oe(Mi,ci,cr))))}Kt.length||Kt.push(new hn(k,k)),xi(J,Gi(e,ge.ranges.slice(0,pe).concat(Kt),pe),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Nt)}else{var Pi=le,vi=rl(e,Nt,A.unit),oi=Pi.anchor,Qn;At(vi.anchor,oi)>0?(Qn=vi.head,oi=Er(Pi.from(),vi.anchor)):(Qn=vi.anchor,oi=vr(Pi.to(),vi.head));var Hn=ge.ranges.slice(0);Hn[pe]=Yl(e,new hn(G(J,oi),Qn)),xi(J,Gi(e,Hn,pe),me)}}var at=F.wrapper.getBoundingClientRect(),pt=0;function bt(Nt){var Kt=++pt,cr=ri(e,Nt,!0,A.unit=="rectangle");if(!cr)return;if(At(cr,Ke)!=0){e.curOp.focus=V(),lt(cr);var ir=Ia(F,J);(cr.line>=ir.to||cr.line<ir.from)&&setTimeout(Vn(e,function(){pt==Kt&&bt(Nt)}),150)}else{var Br=Nt.clientY<at.top?-20:Nt.clientY>at.bottom?20:0;Br&&setTimeout(Vn(e,function(){if(pt!=Kt)return;F.scroller.scrollTop+=Br,bt(Nt)}),50)}}function Dt(Nt){e.state.selectingText=!1,pt=Infinity,Nt&&(xe(Nt),F.input.focus()),ut(F.wrapper.ownerDocument,"mousemove",It),ut(F.wrapper.ownerDocument,"mouseup",Wt),J.history.lastSelOrigin=null}var It=Vn(e,function(Nt){Nt.buttons===0||!Xe(Nt)?Dt(Nt):bt(Nt)}),Wt=Vn(e,Dt);e.state.selectingText=Wt,Ae(F.wrapper.ownerDocument,"mousemove",It),Ae(F.wrapper.ownerDocument,"mouseup",Wt)}function Yl(e,n){var k=n.anchor,A=n.head,F=Ct(e.doc,k.line);if(At(k,A)==0&&k.sticky==A.sticky)return n;var J=ot(F);if(!J)return n;var le=tt(J,k.ch,k.sticky),pe=J[le];if(pe.from!=k.ch&&pe.to!=k.ch)return n;var ge=le+(pe.from==k.ch==(pe.level!=1)?0:1);if(ge==0||ge==J.length)return n;var Ee;if(A.line!=k.line)Ee=(A.line-k.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var We=tt(J,A.ch,A.sticky),Ke=We-le||(A.ch-k.ch)*(pe.level==1?-1:1);We==ge-1||We==ge?Ee=Ke<0:Ee=Ke>0}var lt=J[ge+(Ee?-1:0)],at=Ee==(lt.level==1),pt=at?lt.from:lt.to,bt=at?"after":"before";return k.ch==pt&&k.sticky==bt?n:new hn(new dt(k.line,pt,bt),A)}function nl(e,n,k,A){var F,J;if(n.touches)F=n.touches[0].clientX,J=n.touches[0].clientY;else try{F=n.clientX,J=n.clientY}catch(lt){return!1}if(F>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;A&&xe(n);var le=e.display,pe=le.lineDiv.getBoundingClientRect();if(J>pe.bottom||!De(e,k))return Le(n);J-=pe.top-le.viewOffset;for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var Ee=le.gutters.childNodes[ge];if(Ee&&Ee.getBoundingClientRect().right>=F){var We=Pr(e.doc,J),Ke=e.display.gutterSpecs[ge];return $e(e,k,e,We,Ke.className,n),Le(n)}}}function cs(e,n){return nl(e,n,"gutterClick",!0)}function il(e,n){if($n(e.display,n)||$l(e,n))return;if(nt(e,n,"contextmenu"))return;L||e.display.input.onContextMenu(n)}function $l(e,n){return De(e,"gutterContextMenu")?nl(e,n,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),_r(e)}var Ja={toString:function(){return"CodeMirror.Init"}},ol={},zo={};function Jl(e){var n=e.optionHandlers;function k(A,F,J,le){e.defaults[A]=F,J&&(n[A]=le?function(pe,ge,Ee){Ee!=Ja&&J(pe,ge,Ee)}:J)}e.defineOption=k,e.Init=Ja,k("value","",function(A,F){return A.setValue(F)},!0),k("mode",null,function(A,F){A.doc.modeOption=F,pa(A)},!0),k("indentUnit",2,pa,!0),k("indentWithTabs",!1),k("smartIndent",!0),k("tabSize",4,function(A){co(A),_r(A),wn(A)},!0),k("lineSeparator",null,function(A,F){if(A.doc.lineSep=F,!F)return;var J=[],le=A.doc.first;A.doc.iter(function(ge){for(var Ee=0;;){var We=ge.text.indexOf(F,Ee);if(We==-1)break;Ee=We+F.length,J.push(dt(le,We))}le++});for(var pe=J.length-1;pe>=0;pe--)Va(A.doc,F,J[pe],dt(J[pe].line,J[pe].ch+F.length))}),k("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(A,F,J){A.state.specialChars=new RegExp(F.source+(F.test(" ")?"":"| "),"g"),J!=Ja&&A.refresh()}),k("specialCharPlaceholder",Rr,function(A){return A.refresh()},!0),k("electricChars",!0),k("inputStyle",t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),k("spellcheck",!1,function(A,F){return A.getInputField().spellcheck=F},!0),k("autocorrect",!1,function(A,F){return A.getInputField().autocorrect=F},!0),k("autocapitalize",!1,function(A,F){return A.getInputField().autocapitalize=F},!0),k("rtlMoveVisually",!E),k("wholeLineUpdateBefore",!0),k("theme","default",function(A){al(A),Zi(A)},!0),k("keyMap","default",function(A,F,J){var le=Wo(F),pe=J!=Ja&&Wo(J);pe&&pe.detach&&pe.detach(A,le),le.attach&&le.attach(A,pe||null)}),k("extraKeys",null),k("configureMouse",null),k("lineWrapping",!1,Zl,!0),k("gutters",[],function(A,F){A.display.gutterSpecs=_i(F,A.options.lineNumbers),Zi(A)},!0),k("fixedGutter",!0,function(A,F){A.display.gutters.style.left=F?bi(A.display)+"px":"0",A.refresh()},!0),k("coverGutterNextToScrollbar",!1,function(A){return da(A)},!0),k("scrollbarStyle","native",function(A){Fa(A),da(A),A.display.scrollbars.setScrollTop(A.doc.scrollTop),A.display.scrollbars.setScrollLeft(A.doc.scrollLeft)},!0),k("lineNumbers",!1,function(A,F){A.display.gutterSpecs=_i(A.options.gutters,F),Zi(A)},!0),k("firstLineNumber",1,Zi,!0),k("lineNumberFormatter",function(A){return A},Zi,!0),k("showCursorWhenSelecting",!1,xn,!0),k("resetSelectionOnContextMenu",!0),k("lineWiseCopyCut",!0),k("pasteLinesPerSelection",!0),k("selectionsMayTouch",!1),k("readOnly",!1,function(A,F){F=="nocursor"&&(va(A),A.display.input.blur()),A.display.input.readOnlyChanged(F)}),k("screenReaderLabel",null,function(A,F){F=F===""?null:F,A.display.input.screenReaderLabelChanged(F)}),k("disableInput",!1,function(A,F){F||A.display.input.reset()},!0),k("dragDrop",!0,Ql),k("allowDropFileTypes",null),k("cursorBlinkRate",530),k("cursorScrollMargin",0),k("cursorHeight",1,xn,!0),k("singleCursorHeightPerLine",!0,xn,!0),k("workTime",100),k("workDelay",100),k("flattenSpans",!0,co,!0),k("addModeClass",!1,co,!0),k("pollInterval",100),k("undoDepth",200,function(A,F){return A.doc.history.undoDepth=F}),k("historyEventDelay",1250),k("viewportMargin",10,function(A){return A.refresh()},!0),k("maxHighlightLength",1e4,co,!0),k("moveInputWithCursor",!0,function(A,F){F||A.display.input.resetPosition()}),k("tabindex",null,function(A,F){return A.display.input.getField().tabIndex=F||""}),k("autofocus",null),k("direction","ltr",function(A,F){return A.doc.setDirection(F)},!0),k("phrases",null)}function Ql(e,n,k){var A=k&&k!=Ja;if(!n!=!A){var F=e.display.dragFunctions,J=n?Ae:ut;J(e.display.scroller,"dragstart",F.start),J(e.display.scroller,"dragenter",F.enter),J(e.display.scroller,"dragover",F.over),J(e.display.scroller,"dragleave",F.leave),J(e.display.scroller,"drop",F.drop)}}function Zl(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(w(e.display.wrapper,"CodeMirror-wrap"),Bi(e)),Si(e),wn(e),_r(e),setTimeout(function(){return da(e)},100)}function jn(e,n){var k=this;if(!(this instanceof jn))return new jn(e,n);this.options=n=n?W(n):{},W(ol,n,!1);var A=n.value;typeof A=="string"?A=new Li(A,n.mode,null,n.lineSeparator,n.direction):n.mode&&(A.modeOption=n.mode),this.doc=A;var F=new jn.inputStyles[n.inputStyle](this),J=this.display=new ka(e,A,F,n);J.wrapper.CodeMirror=this,al(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fa(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new q,keySeq:null,specialChars:null},n.autofocus&&!t&&J.input.focus(),S&&y<11&&setTimeout(function(){return k.display.input.reset(!0)},20),ql(this),Dl(),sa(this),this.curOp.forceUpdate=!0,vs(this,A),n.autofocus&&!t||this.hasFocus()?setTimeout(function(){k.hasFocus()&&!k.state.focused&&aa(k)},20):va(this);for(var le in zo)zo.hasOwnProperty(le)&&zo[le](this,n[le],Ja);ii(this),n.finishInit&&n.finishInit(this);for(var pe=0;pe<ds.length;++pe)ds[pe](this);ha(this),c&&n.lineWrapping&&getComputedStyle(J.lineDiv).textRendering=="optimizelegibility"&&(J.lineDiv.style.textRendering="auto")}jn.defaults=ol,jn.optionHandlers=zo;function ql(e){var n=e.display;Ae(n.scroller,"mousedown",Vn(e,tl)),S&&y<11?Ae(n.scroller,"dblclick",Vn(e,function(ge){if(nt(e,ge))return;var Ee=ri(e,ge);if(!Ee||cs(e,ge)||$n(e.display,ge))return;xe(ge);var We=e.findWordAt(Ee);No(e.doc,We.anchor,We.head)})):Ae(n.scroller,"dblclick",function(ge){return nt(e,ge)||xe(ge)}),Ae(n.scroller,"contextmenu",function(ge){return il(e,ge)}),Ae(n.input.getField(),"contextmenu",function(ge){n.scroller.contains(ge.target)||il(e,ge)});var k,A={end:0};function F(){n.activeTouch&&(k=setTimeout(function(){return n.activeTouch=null},1e3),A=n.activeTouch,A.end=+new Date)}function J(ge){if(ge.touches.length!=1)return!1;var Ee=ge.touches[0];return Ee.radiusX<=1&&Ee.radiusY<=1}function le(ge,Ee){if(Ee.left==null)return!0;var We=Ee.left-ge.left,Ke=Ee.top-ge.top;return We*We+Ke*Ke>20*20}Ae(n.scroller,"touchstart",function(ge){if(!nt(e,ge)&&!J(ge)&&!cs(e,ge)){n.input.ensurePolled(),clearTimeout(k);var Ee=+new Date;n.activeTouch={start:Ee,moved:!1,prev:Ee-A.end<=300?A:null},ge.touches.length==1&&(n.activeTouch.left=ge.touches[0].pageX,n.activeTouch.top=ge.touches[0].pageY)}}),Ae(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Ae(n.scroller,"touchend",function(ge){var Ee=n.activeTouch;if(Ee&&!$n(n,ge)&&Ee.left!=null&&!Ee.moved&&new Date-Ee.start<300){var We=e.coordsChar(n.activeTouch,"page"),Ke;!Ee.prev||le(Ee,Ee.prev)?Ke=new hn(We,We):!Ee.prev.prev||le(Ee,Ee.prev.prev)?Ke=e.findWordAt(We):Ke=new hn(dt(We.line,0),G(e.doc,dt(We.line+1,0))),e.setSelection(Ke.anchor,Ke.head),e.focus(),xe(ge)}F()}),Ae(n.scroller,"touchcancel",F),Ae(n.scroller,"scroll",function(){n.scroller.clientHeight&&(xa(e,n.scroller.scrollTop),zi(e,n.scroller.scrollLeft,!0),$e(e,"scroll",e))}),Ae(n.scroller,"mousewheel",function(ge){return lo(e,ge)}),Ae(n.scroller,"DOMMouseScroll",function(ge){return lo(e,ge)}),Ae(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(ge){nt(e,ge)||Ne(ge)},over:function(ge){nt(e,ge)||(Rl(e,ge),Ne(ge))},start:function(ge){return Al(e,ge)},drop:Vn(e,Ol),leave:function(ge){nt(e,ge)||Ws(e)}};var pe=n.input.getField();Ae(pe,"keyup",function(ge){return Zs.call(e,ge)}),Ae(pe,"keydown",Vn(e,Qs)),Ae(pe,"keypress",Vn(e,el)),Ae(pe,"focus",function(ge){return aa(e,ge)}),Ae(pe,"blur",function(ge){return va(e,ge)})}var ds=[];jn.defineInitHook=function(e){return ds.push(e)};function So(e,n,k,A){var F=e.doc,J;k==null&&(k="add"),k=="smart"&&(F.mode.indent?J=St(e,n).state:k="prev");var le=e.options.tabSize,pe=Ct(F,n),ge=H(pe.text,null,le);pe.stateAfter&&(pe.stateAfter=null);var Ee=pe.text.match(/^\s*/)[0],We;if(!A&&!/\S/.test(pe.text))We=0,k="not";else if(k=="smart"&&(We=F.mode.indent(J,pe.text.slice(Ee.length),pe.text),We==_e||We>150)){if(!A)return;k="prev"}k=="prev"?n>F.first?We=H(Ct(F,n-1).text,null,le):We=0:k=="add"?We=ge+e.options.indentUnit:k=="subtract"?We=ge-e.options.indentUnit:typeof k=="number"&&(We=ge+k),We=Math.max(0,We);var Ke="",lt=0;if(e.options.indentWithTabs)for(var at=Math.floor(We/le);at;--at)lt+=le,Ke+=" ";if(lt<We&&(Ke+=ce(We-lt)),Ke!=Ee)return Va(F,Ke,dt(n,0),dt(n,Ee.length),"+input"),pe.stateAfter=null,!0;for(var pt=0;pt<F.sel.ranges.length;pt++){var bt=F.sel.ranges[pt];if(bt.head.line==n&&bt.head.ch<Ee.length){var Dt=dt(n,Ee.length);is(F,pt,new hn(Dt,Dt));break}}}var ta=null;function Ko(e){ta=e}function hs(e,n,k,A,F){var J=e.doc;e.display.shift=!1,A||(A=J.sel);var le=+new Date-200,pe=F=="paste"||e.state.pasteIncoming>le,ge=Pt(n),Ee=null;if(pe&&A.ranges.length>1)if(ta&&ta.text.join(`
|
|
|
`)==n){if(A.ranges.length%ta.text.length==0){Ee=[];for(var We=0;We<ta.text.length;We++)Ee.push(J.splitLines(ta.text[We]))}}else ge.length==A.ranges.length&&e.options.pasteLinesPerSelection&&(Ee=Te(ge,function(It){return[It]}));for(var Ke=e.curOp.updateInput,lt=A.ranges.length-1;lt>=0;lt--){var at=A.ranges[lt],pt=at.from(),bt=at.to();at.empty()&&(k&&k>0?pt=dt(pt.line,pt.ch-k):e.state.overwrite&&!pe?bt=dt(bt.line,Math.min(Ct(J,bt.line).text.length,bt.ch+se(ge).length)):pe&&ta&&ta.lineWise&&ta.text.join(`
|
|
|
`)==ge.join(`
|
|
|
`)&&(pt=bt=dt(pt.line,0)));var Dt={from:pt,to:bt,text:Ee?Ee[lt%Ee.length]:ge,origin:F||(pe?"paste":e.state.cutIncoming>le?"cut":"+input")};Ga(e.doc,Dt),Dr(e,"inputRead",e,Dt)}n&&!pe&&ll(e,n),ya(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ke),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,n){var k=e.clipboardData&&e.clipboardData.getData("Text");if(k)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&Ti(n,function(){return hs(n,k,0,null,"paste")}),!0}function ll(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var k=e.doc.sel,A=k.ranges.length-1;A>=0;A--){var F=k.ranges[A];if(F.head.ch>100||A&&k.ranges[A-1].head.line==F.head.line)continue;var J=e.getModeAt(F.head),le=!1;if(J.electricChars){for(var pe=0;pe<J.electricChars.length;pe++)if(n.indexOf(J.electricChars.charAt(pe))>-1){le=So(e,F.head.line,"smart");break}}else J.electricInput&&(J.electricInput.test(Ct(e.doc,F.head.line).text.slice(0,F.head.ch))&&(le=So(e,F.head.line,"smart")));le&&Dr(e,"electricInput",e,F.head.line)}}function ul(e){for(var n=[],k=[],A=0;A<e.doc.sel.ranges.length;A++){var F=e.doc.sel.ranges[A].head.line,J={anchor:dt(F,0),head:dt(F+1,0)};k.push(J),n.push(e.getRange(J.anchor,J.head))}return{text:n,ranges:k}}function cl(e,n,k,A){e.setAttribute("autocorrect",k?"":"off"),e.setAttribute("autocapitalize",A?"":"off"),e.setAttribute("spellcheck",!!n)}function dl(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),n=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return c?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),cl(e),n}function eu(e){var n=e.optionHandlers,k=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(A,F){var J=this.options,le=J[A];if(J[A]==F&&A!="mode")return;J[A]=F,n.hasOwnProperty(A)&&Vn(this,n[A])(this,F,le),$e(this,"optionChange",this,A)},getOption:function(A){return this.options[A]},getDoc:function(){return this.doc},addKeyMap:function(A,F){this.state.keyMaps[F?"push":"unshift"](Wo(A))},removeKeyMap:function(A){for(var F=this.state.keyMaps,J=0;J<F.length;++J)if(F[J]==A||F[J].name==A)return F.splice(J,1),!0},addOverlay:gi(function(A,F){var J=A.token?A:e.getMode(this.options,A);if(J.startState)throw new Error("Overlays may not be stateful.");re(this.state.overlays,{mode:J,modeSpec:A,opaque:F&&F.opaque,priority:F&&F.priority||0},function(le){return le.priority}),this.state.modeGen++,wn(this)}),removeOverlay:gi(function(A){for(var F=this.state.overlays,J=0;J<F.length;++J){var le=F[J].modeSpec;if(le==A||typeof A=="string"&&le.name==A){F.splice(J,1),this.state.modeGen++,wn(this);return}}}),indentLine:gi(function(A,F,J){typeof F!="string"&&typeof F!="number"&&(F==null?F=this.options.smartIndent?"smart":"prev":F=F?"add":"subtract"),yn(this.doc,A)&&So(this,A,F,J)}),indentSelection:gi(function(A){for(var F=this.doc.sel.ranges,J=-1,le=0;le<F.length;le++){var pe=F[le];if(pe.empty())pe.head.line>J&&(So(this,pe.head.line,A,!0),J=pe.head.line,le==this.doc.sel.primIndex&&ya(this));else{var ge=pe.from(),Ee=pe.to(),We=Math.max(J,ge.line);J=Math.min(this.lastLine(),Ee.line-(Ee.ch?0:1))+1;for(var Ke=We;Ke<J;++Ke)So(this,Ke,A);var lt=this.doc.sel.ranges;ge.ch==0&&F.length==lt.length&<[le].from().ch>0&&is(this.doc,le,new hn(ge,lt[le].to()),Ce)}}}),getTokenAt:function(A,F){return Hr(this,A,F)},getLineTokens:function(A,F){return Hr(this,dt(A),F,!0)},getTokenTypeAt:function(A){A=G(this.doc,A);var F=ft(this,Ct(this.doc,A.line)),J=0,le=(F.length-1)/2,pe=A.ch,ge;if(pe==0)ge=F[2];else for(;;){var Ee=J+le>>1;if((Ee?F[Ee*2-1]:0)>=pe)le=Ee;else if(F[Ee*2+1]<pe)J=Ee+1;else{ge=F[Ee*2+2];break}}var We=ge?ge.indexOf("overlay "):-1;return We<0?ge:We==0?null:ge.slice(0,We-1)},getModeAt:function(A){var F=this.doc.mode;return F.innerMode?e.innerMode(F,this.getTokenAt(A).state).mode:F},getHelper:function(A,F){return this.getHelpers(A,F)[0]},getHelpers:function(A,F){var J=[];if(!k.hasOwnProperty(F))return J;var le=k[F],pe=this.getModeAt(A);if(typeof pe[F]=="string")le[pe[F]]&&J.push(le[pe[F]]);else if(pe[F])for(var ge=0;ge<pe[F].length;ge++){var Ee=le[pe[F][ge]];Ee&&J.push(Ee)}else pe.helperType&&le[pe.helperType]?J.push(le[pe.helperType]):le[pe.name]&&J.push(le[pe.name]);for(var We=0;We<le._global.length;We++){var Ke=le._global[We];Ke.pred(pe,this)&&ne(J,Ke.val)==-1&&J.push(Ke.val)}return J},getStateAfter:function(A,F){var J=this.doc;return A=ae(J,A==null?J.first+J.size-1:A),St(this,A+1,F).state},cursorCoords:function(A,F){var J,le=this.doc.sel.primary();return A==null?J=le.head:typeof A=="object"?J=G(this.doc,A):J=A?le.from():le.to(),Gr(this,J,F||"page")},charCoords:function(A,F){return kn(this,G(this.doc,A),F||"page")},coordsChar:function(A,F){return A=Kr(this,A,F||"page"),Xr(this,A.left,A.top)},lineAtHeight:function(A,F){return A=Kr(this,{top:A,left:0},F||"page").top,Pr(this.doc,A+this.display.viewOffset)},heightAtLine:function(A,F,J){var le=!1,pe;if(typeof A=="number"){var ge=this.doc.first+this.doc.size-1;A<this.doc.first?A=this.doc.first:A>ge&&(A=ge,le=!0),pe=Ct(this.doc,A)}else pe=A;return Zr(this,pe,{top:0,left:0},F||"page",J||le).top+(le?this.doc.height-si(pe):0)},defaultTextHeight:function(){return Wn(this.display)},defaultCharWidth:function(){return ti(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(A,F,J,le,pe){var ge=this.display;A=Gr(this,G(this.doc,A));var Ee=A.bottom,We=A.left;if(F.style.position="absolute",F.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(F),ge.sizer.appendChild(F),le=="over")Ee=A.top;else if(le=="above"||le=="near"){var Ke=Math.max(ge.wrapper.clientHeight,this.doc.height),lt=Math.max(ge.sizer.clientWidth,ge.lineSpace.clientWidth);(le=="above"||A.bottom+F.offsetHeight>Ke)&&A.top>F.offsetHeight?Ee=A.top-F.offsetHeight:A.bottom+F.offsetHeight<=Ke&&(Ee=A.bottom),We+F.offsetWidth>lt&&(We=lt-F.offsetWidth)}F.style.top=Ee+"px",F.style.left=F.style.right="",pe=="right"?(We=ge.sizer.clientWidth-F.offsetWidth,F.style.right="0px"):(pe=="left"?We=0:pe=="middle"&&(We=(ge.sizer.clientWidth-F.offsetWidth)/2),F.style.left=We+"px"),J&&_o(this,{left:We,top:Ee,right:We+F.offsetWidth,bottom:Ee+F.offsetHeight})},triggerOnKeyDown:gi(Qs),triggerOnKeyPress:gi(el),triggerOnKeyUp:Zs,triggerOnMouseDown:gi(tl),execCommand:function(A){if(xo.hasOwnProperty(A))return xo[A].call(null,this)},triggerElectric:gi(function(A){ll(this,A)}),findPosH:function(A,F,J,le){var pe=1;F<0&&(pe=-1,F=-F);for(var ge=G(this.doc,A),Ee=0;Ee<F&&!(ge=fs(this.doc,ge,pe,J,le),ge.hitSide);++Ee);return ge},moveH:gi(function(A,F){var J=this;this.extendSelectionsBy(function(le){return J.display.shift||J.doc.extend||le.empty()?fs(J.doc,le.head,A,F,J.options.rtlMoveVisually):A<0?le.from():le.to()},Me)}),deleteH:gi(function(A,F){var J=this.doc.sel,le=this.doc;J.somethingSelected()?le.replaceSelection("",null,"+delete"):$a(this,function(pe){var ge=fs(le,pe.head,A,F,!1);return A<0?{from:ge,to:pe.head}:{from:pe.head,to:ge}})}),findPosV:function(A,F,J,le){var pe=1,ge=le;F<0&&(pe=-1,F=-F);for(var Ee=G(this.doc,A),We=0;We<F;++We){var Ke=Gr(this,Ee,"div");if(ge==null?ge=Ke.left:Ke.left=ge,Ee=hl(this,Ke,pe,J),Ee.hitSide)break}return Ee},moveV:gi(function(A,F){var J=this,le=this.doc,pe=[],ge=!this.display.shift&&!le.extend&&le.sel.somethingSelected();if(le.extendSelectionsBy(function(We){if(ge)return A<0?We.from():We.to();var Ke=Gr(J,We.head,"div");We.goalColumn!=null&&(Ke.left=We.goalColumn),pe.push(Ke.left);var lt=hl(J,Ke,A,F);return F=="page"&&We==le.sel.primary()&&no(J,kn(J,lt,"div").top-Ke.top),lt},Me),pe.length)for(var Ee=0;Ee<le.sel.ranges.length;Ee++)le.sel.ranges[Ee].goalColumn=pe[Ee]}),findWordAt:function(A){var F=this.doc,J=Ct(F,A.line).text,le=A.ch,pe=A.ch;if(J){var ge=this.getHelper(A,"wordChars");(A.sticky=="before"||pe==J.length)&&le?--le:++pe;for(var Ee=J.charAt(le),We=X(Ee,ge)?function(Ke){return X(Ke,ge)}:/\s/.test(Ee)?function(Ke){return/\s/.test(Ke)}:function(Ke){return!/\s/.test(Ke)&&!X(Ke)};le>0&&We(J.charAt(le-1));)--le;for(;pe<J.length&&We(J.charAt(pe));)++pe}return new hn(dt(A.line,le),dt(A.line,pe))},toggleOverwrite:function(A){if(A!=null&&A==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):w(this.display.cursorDiv,"CodeMirror-overwrite"),$e(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==V()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gi(function(A,F){ba(this,A,F)}),getScrollInfo:function(){var A=this.display.scroller;return{left:A.scrollLeft,top:A.scrollTop,height:A.scrollHeight-Qe(this)-this.display.barHeight,width:A.scrollWidth-Qe(this)-this.display.barWidth,clientHeight:be(this),clientWidth:Ue(this)}},scrollIntoView:gi(function(A,F){A==null?(A={from:this.doc.sel.primary().head,to:null},F==null&&(F=this.options.cursorScrollMargin)):typeof A=="number"?A={from:dt(A,0),to:null}:A.from==null&&(A={from:A,to:null}),A.to||(A.to=A.from),A.margin=F||0,A.from.line!=null?$o(this,A):Oa(this,A.from,A.to,A.margin)}),setSize:gi(function(A,F){var J=this,le=function(ge){return typeof ge=="number"||/^\d+$/.test(String(ge))?ge+"px":ge};A!=null&&(this.display.wrapper.style.width=le(A)),F!=null&&(this.display.wrapper.style.height=le(F)),this.options.lineWrapping&&Cr(this);var pe=this.display.viewFrom;this.doc.iter(pe,this.display.viewTo,function(ge){if(ge.widgets){for(var Ee=0;Ee<ge.widgets.length;Ee++)if(ge.widgets[Ee].noHScroll){Nn(J,pe,"widget");break}}++pe}),this.curOp.forceUpdate=!0,$e(this,"refresh",this)}),operation:function(A){return Ti(this,A)},startOperation:function(){return sa(this)},endOperation:function(){return ha(this)},refresh:gi(function(){var A=this.display.cachedTextHeight;wn(this),this.curOp.forceUpdate=!0,_r(this),ba(this,this.doc.scrollLeft,this.doc.scrollTop),Ba(this.display),(A==null||Math.abs(A-Wn(this.display))>.5||this.options.lineWrapping)&&Si(this),$e(this,"refresh",this)}),swapDoc:gi(function(A){var F=this.doc;return F.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,A),_r(this),this.display.input.reset(),ba(this,A.scrollLeft,A.scrollTop),this.curOp.forceScroll=!0,Dr(this,"swapDoc",this,F),F}),phrase:function(A){var F=this.options.phrases;return F&&Object.prototype.hasOwnProperty.call(F,A)?F[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}},Pe(e),e.registerHelper=function(A,F,J){k.hasOwnProperty(A)||(k[A]=e[A]={_global:[]}),k[A][F]=J},e.registerGlobalHelper=function(A,F,J,le){e.registerHelper(A,F,le),k[A]._global.push({pred:J,val:le})}}function fs(e,n,k,A,F){var J=n,le=k,pe=Ct(e,n.line),ge=F&&e.direction=="rtl"?-k:k;function Ee(){var Wt=n.line+ge;return Wt<e.first||Wt>=e.first+e.size?!1:(n=new dt(Wt,n.ch,n.sticky),pe=Ct(e,Wt))}function We(Wt){var Nt;if(A=="codepoint"){var Kt=pe.text.charCodeAt(n.ch+(A>0?0:-1));isNaN(Kt)?Nt=null:Nt=new dt(n.line,Math.max(0,Math.min(pe.text.length,n.ch+k*(Kt>=55296&&Kt<56320?2:1))),-k)}else F?Nt=Il(e.cm,pe,n,k):Nt=os(pe,n,k);if(Nt==null)if(!Wt&&Ee())n=ss(F,e.cm,pe,n.line,ge);else return!1;else n=Nt;return!0}if(A=="char"||A=="codepoint")We();else if(A=="column")We(!0);else if(A=="word"||A=="group")for(var Ke=null,lt=A=="group",at=e.cm&&e.cm.getHelper(n,"wordChars"),pt=!0;!(k<0&&!We(!pt));pt=!1){var bt=pe.text.charAt(n.ch)||`
|
|
|
`,Dt=X(bt,at)?"w":lt&&bt==`
|
|
|
`?"n":!lt||/\s/.test(bt)?null:"p";if(lt&&!pt&&!Dt&&(Dt="s"),Ke&&Ke!=Dt){k<0&&(k=1,We(),n.sticky="after");break}if(Dt&&(Ke=Dt),k>0&&!We(!pt))break}var It=Fo(e,n,J,le,!0);return $t(J,It)&&(It.hitSide=!0),It}function hl(e,n,k,A){var F=e.doc,J=n.left,le;if(A=="page"){var pe=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ge=Math.max(pe-.5*Wn(e.display),3);le=(k>0?n.bottom:n.top)+k*ge}else A=="line"&&(le=k>0?n.bottom+3:n.top-3);for(var Ee;!(Ee=Xr(e,J,le),!Ee.outside);){if(k<0?le<=0:le>=F.height){Ee.hitSide=!0;break}le+=k*5}return Ee}var Cn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Cn.prototype.init=function(e){var n=this,k=this,A=k.cm,F=k.div=e.lineDiv;cl(F,A.options.spellcheck,A.options.autocorrect,A.options.autocapitalize);function J(pe){for(var ge=pe.target;ge;ge=ge.parentNode){if(ge==F)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ge.className))break}return!1}Ae(F,"paste",function(pe){if(!J(pe)||nt(A,pe)||sl(pe,A))return;y<=11&&setTimeout(Vn(A,function(){return n.updateFromDOM()}),20)}),Ae(F,"compositionstart",function(pe){n.composing={data:pe.data,done:!1}}),Ae(F,"compositionupdate",function(pe){n.composing||(n.composing={data:pe.data,done:!1})}),Ae(F,"compositionend",function(pe){n.composing&&(pe.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Ae(F,"touchstart",function(){return k.forceCompositionEnd()}),Ae(F,"input",function(){n.composing||n.readFromDOMSoon()});function le(pe){if(!J(pe)||nt(A,pe))return;if(A.somethingSelected())Ko({lineWise:!1,text:A.getSelections()}),pe.type=="cut"&&A.replaceSelection("",null,"cut");else if(A.options.lineWiseCopyCut){var ge=ul(A);Ko({lineWise:!0,text:ge.text}),pe.type=="cut"&&A.operation(function(){A.setSelections(ge.ranges,0,Ce),A.replaceSelection("",null,"cut")})}else return;if(pe.clipboardData){pe.clipboardData.clearData();var Ee=ta.text.join(`
|
|
|
`);if(pe.clipboardData.setData("Text",Ee),pe.clipboardData.getData("Text")==Ee){pe.preventDefault();return}}var We=dl(),Ke=We.firstChild;A.display.lineSpace.insertBefore(We,A.display.lineSpace.firstChild),Ke.value=ta.text.join(`
|
|
|
`);var lt=document.activeElement;K(Ke),setTimeout(function(){A.display.lineSpace.removeChild(We),lt.focus(),lt==F&&k.showPrimarySelection()},50)}Ae(F,"copy",le),Ae(F,"cut",le)},Cn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Cn.prototype.prepareSelection=function(){var e=Ji(this.cm,!1);return e.focus=document.activeElement==this.div,e},Cn.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Cn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Cn.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,k=n.doc.sel.primary(),A=k.from(),F=k.to();if(n.display.viewTo==n.display.viewFrom||A.line>=n.display.viewTo||F.line<n.display.viewFrom){e.removeAllRanges();return}var J=Go(n,e.anchorNode,e.anchorOffset),le=Go(n,e.focusNode,e.focusOffset);if(J&&!J.bad&&le&&!le.bad&&At(Er(J,le),A)==0&&At(vr(J,le),F)==0)return;var pe=n.display.view,ge=A.line>=n.display.viewFrom&&fl(n,A)||{node:pe[0].measure.map[2],offset:0},Ee=F.line<n.display.viewTo&&fl(n,F);if(!Ee){var We=pe[pe.length-1].measure,Ke=We.maps?We.maps[We.maps.length-1]:We.map;Ee={node:Ke[Ke.length-1],offset:Ke[Ke.length-2]-Ke[Ke.length-3]}}if(!ge||!Ee){e.removeAllRanges();return}var lt=e.rangeCount&&e.getRangeAt(0),at;try{at=N(ge.node,ge.offset,Ee.offset,Ee.node)}catch(pt){}at&&(!T&&n.state.focused?(e.collapse(ge.node,ge.offset),at.collapsed||(e.removeAllRanges(),e.addRange(at))):(e.removeAllRanges(),e.addRange(at)),lt&&e.anchorNode==null?e.addRange(lt):T&&this.startGracePeriod()),this.rememberSelection()},Cn.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Cn.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},Cn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Cn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return P(this.div,n)},Cn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Cn.prototype.blur=function(){this.div.blur()},Cn.prototype.getField=function(){return this.div},Cn.prototype.supportsTouch=function(){return!0},Cn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ti(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Cn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Cn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(i&&r&&this.cm.display.gutterSpecs.length&&tu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var k=Go(n,e.anchorNode,e.anchorOffset),A=Go(n,e.focusNode,e.focusOffset);k&&A&&Ti(n,function(){xi(n.doc,qi(k,A),Ce),(k.bad||A.bad)&&(n.curOp.selectionChanged=!0)})},Cn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,k=e.doc.sel.primary(),A=k.from(),F=k.to();if(A.ch==0&&A.line>e.firstLine()&&(A=dt(A.line-1,Ct(e.doc,A.line-1).length)),F.ch==Ct(e.doc,F.line).text.length&&F.line<e.lastLine()&&(F=dt(F.line+1,0)),A.line<n.viewFrom||F.line>n.viewTo-1)return!1;var J,le,pe;A.line==n.viewFrom||(J=On(e,A.line))==0?(le=Ut(n.view[0].line),pe=n.view[0].node):(le=Ut(n.view[J].line),pe=n.view[J-1].node.nextSibling);var ge=On(e,F.line),Ee,We;if(ge==n.view.length-1?(Ee=n.viewTo-1,We=n.lineDiv.lastChild):(Ee=Ut(n.view[ge+1].line)-1,We=n.view[ge+1].node.previousSibling),!pe)return!1;for(var Ke=e.doc.splitLines(ru(e,pe,We,le,Ee)),lt=Ar(e.doc,dt(le,0),dt(Ee,Ct(e.doc,Ee).text.length));Ke.length>1&<.length>1;)if(se(Ke)==se(lt))Ke.pop(),lt.pop(),Ee--;else if(Ke[0]==lt[0])Ke.shift(),lt.shift(),le++;else break;for(var at=0,pt=0,bt=Ke[0],Dt=lt[0],It=Math.min(bt.length,Dt.length);at<It&&bt.charCodeAt(at)==Dt.charCodeAt(at);)++at;for(var Wt=se(Ke),Nt=se(lt),Kt=Math.min(Wt.length-(Ke.length==1?at:0),Nt.length-(lt.length==1?at:0));pt<Kt&&Wt.charCodeAt(Wt.length-pt-1)==Nt.charCodeAt(Nt.length-pt-1);)++pt;if(Ke.length==1&<.length==1&&le==A.line)for(;at&&at>A.ch&&Wt.charCodeAt(Wt.length-pt-1)==Nt.charCodeAt(Nt.length-pt-1);)at--,pt++;Ke[Ke.length-1]=Wt.slice(0,Wt.length-pt).replace(/^\u200b+/,""),Ke[0]=Ke[0].slice(at).replace(/\u200b+$/,"");var cr=dt(le,at),ir=dt(Ee,lt.length?se(lt).length-pt:0);if(Ke.length>1||Ke[0]||At(cr,ir))return Va(e.doc,Ke,cr,ir,"+input"),!0},Cn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Cn.prototype.reset=function(){this.forceCompositionEnd()},Cn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Cn.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)},Cn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ti(this.cm,function(){return wn(e.cm)})},Cn.prototype.setUneditable=function(e){e.contentEditable="false"},Cn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Vn(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Cn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Cn.prototype.onContextMenu=function(){},Cn.prototype.resetPosition=function(){},Cn.prototype.needsContentAttribute=!0;function fl(e,n){var k=Ye(e,n.line);if(!k||k.hidden)return null;var A=Ct(e.doc,n.line),F=we(k,A,n.line),J=ot(A,e.doc.direction),le="left";if(J){var pe=tt(J,n.ch);le=pe%2?"right":"left"}var ge=Et(F.map,n.ch,le);return ge.offset=ge.collapse=="right"?ge.end:ge.start,ge}function tu(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function Qa(e,n){return n&&(e.bad=!0),e}function ru(e,n,k,A,F){var J="",le=!1,pe=e.doc.lineSeparator(),ge=!1;function Ee(at){return function(pt){return pt.id==at}}function We(){le&&(J+=pe,ge&&(J+=pe),le=ge=!1)}function Ke(at){at&&(We(),J+=at)}function lt(at){if(at.nodeType==1){var pt=at.getAttribute("cm-text");if(pt){Ke(pt);return}var bt=at.getAttribute("cm-marker"),Dt;if(bt){var It=e.findMarks(dt(A,0),dt(F+1,0),Ee(+bt));It.length&&(Dt=It[0].find(0))&&Ke(Ar(e.doc,Dt.from,Dt.to).join(pe));return}if(at.getAttribute("contenteditable")=="false")return;var Wt=/^(pre|div|p|li|table|br)$/i.test(at.nodeName);if(!/^br$/i.test(at.nodeName)&&at.textContent.length==0)return;Wt&&We();for(var Nt=0;Nt<at.childNodes.length;Nt++)lt(at.childNodes[Nt]);/^(pre|p)$/i.test(at.nodeName)&&(ge=!0),Wt&&(le=!0)}else at.nodeType==3&&Ke(at.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(lt(n),n==k);)n=n.nextSibling,ge=!1;return J}function Go(e,n,k){var A;if(n==e.display.lineDiv){if(A=e.display.lineDiv.childNodes[k],!A)return Qa(e.clipPos(dt(e.display.viewTo-1)),!0);n=null,k=0}else for(A=n;;A=A.parentNode){if(!A||A==e.display.lineDiv)return null;if(A.parentNode&&A.parentNode==e.display.lineDiv)break}for(var F=0;F<e.display.view.length;F++){var J=e.display.view[F];if(J.node==A)return nu(J,n,k)}}function nu(e,n,k){var A=e.text.firstChild,F=!1;if(!n||!P(A,n))return Qa(dt(Ut(e.line),0),!0);if(n==A&&(F=!0,n=A.childNodes[k],k=0,!n)){var J=e.rest?se(e.rest):e.line;return Qa(dt(Ut(J),J.text.length),F)}var le=n.nodeType==3?n:null,pe=n;for(!le&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(le=n.firstChild,k&&(k=le.nodeValue.length));pe.parentNode!=A;)pe=pe.parentNode;var ge=e.measure,Ee=ge.maps;function We(Dt,It,Wt){for(var Nt=-1;Nt<(Ee?Ee.length:0);Nt++)for(var Kt=Nt<0?ge.map:Ee[Nt],cr=0;cr<Kt.length;cr+=3){var ir=Kt[cr+2];if(ir==Dt||ir==It){var Br=Ut(Nt<0?e.line:e.rest[Nt]),An=Kt[cr]+Wt;return(Wt<0||ir!=Dt)&&(An=Kt[cr+(Wt?1:0)]),dt(Br,An)}}}var Ke=We(le,pe,k);if(Ke)return Qa(Ke,F);for(var lt=pe.nextSibling,at=le?le.nodeValue.length-k:0;lt;lt=lt.nextSibling){if(Ke=We(lt,lt.firstChild,0),Ke)return Qa(dt(Ke.line,Ke.ch-at),F);at+=lt.textContent.length}for(var pt=pe.previousSibling,bt=k;pt;pt=pt.previousSibling){if(Ke=We(pt,pt.firstChild,-1),Ke)return Qa(dt(Ke.line,Ke.ch+bt),F);bt+=pt.textContent.length}}var Yn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null};Yn.prototype.init=function(e){var n=this,k=this,A=this.cm;this.createField(e);var F=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(F.style.width="0px"),Ae(F,"input",function(){S&&y>=9&&n.hasSelection&&(n.hasSelection=null),k.poll()}),Ae(F,"paste",function(le){if(nt(A,le)||sl(le,A))return;A.state.pasteIncoming=+new Date,k.fastPoll()});function J(le){if(nt(A,le))return;if(A.somethingSelected())Ko({lineWise:!1,text:A.getSelections()});else if(A.options.lineWiseCopyCut){var pe=ul(A);Ko({lineWise:!0,text:pe.text}),le.type=="cut"?A.setSelections(pe.ranges,null,Ce):(k.prevInput="",F.value=pe.text.join(`
|
|
|
`),K(F))}else return;le.type=="cut"&&(A.state.cutIncoming=+new Date)}Ae(F,"cut",J),Ae(F,"copy",J),Ae(e.scroller,"paste",function(le){if($n(e,le)||nt(A,le))return;if(!F.dispatchEvent){A.state.pasteIncoming=+new Date,k.focus();return}var pe=new Event("paste");pe.clipboardData=le.clipboardData,F.dispatchEvent(pe)}),Ae(e.lineSpace,"selectstart",function(le){$n(e,le)||xe(le)}),Ae(F,"compositionstart",function(){var le=A.getCursor("from");k.composing&&k.composing.range.clear(),k.composing={start:le,range:A.markText(le,A.getCursor("to"),{className:"CodeMirror-composing"})}}),Ae(F,"compositionend",function(){k.composing&&(k.poll(),k.composing.range.clear(),k.composing=null)})},Yn.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},Yn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Yn.prototype.prepareSelection=function(){var e=this.cm,n=e.display,k=e.doc,A=Ji(e);if(e.options.moveInputWithCursor){var F=Gr(e,k.sel.primary().head,"div"),J=n.wrapper.getBoundingClientRect(),le=n.lineDiv.getBoundingClientRect();A.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,F.top+le.top-J.top)),A.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,F.left+le.left-J.left))}return A},Yn.prototype.showSelection=function(e){var n=this.cm,k=n.display;x(k.cursorDiv,e.cursors),x(k.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Yn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var n=this.cm;if(n.somethingSelected()){this.prevInput="";var k=n.getSelection();this.textarea.value=k,n.state.focused&&K(this.textarea),S&&y>=9&&(this.hasSelection=k)}else e||(this.prevInput=this.textarea.value="",S&&y>=9&&(this.hasSelection=null))},Yn.prototype.getField=function(){return this.textarea},Yn.prototype.supportsTouch=function(){return!1},Yn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||V()!=this.textarea))try{this.textarea.focus()}catch(e){}},Yn.prototype.blur=function(){this.textarea.blur()},Yn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Yn.prototype.receivedFocus=function(){this.slowPoll()},Yn.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()})},Yn.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function k(){var A=n.poll();!A&&!e?(e=!0,n.polling.set(60,k)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,k)},Yn.prototype.poll=function(){var e=this,n=this.cm,k=this.textarea,A=this.prevInput;if(this.contextMenuPending||!n.state.focused||_t(k)&&!A&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var F=k.value;if(F==A&&!n.somethingSelected())return!1;if(S&&y>=9&&this.hasSelection===F||a&&/[\uf700-\uf7ff]/.test(F))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var J=F.charCodeAt(0);if(J==8203&&!A&&(A="\u200B"),J==8666)return this.reset(),this.cm.execCommand("undo")}for(var le=0,pe=Math.min(A.length,F.length);le<pe&&A.charCodeAt(le)==F.charCodeAt(le);)++le;return Ti(n,function(){hs(n,F.slice(le),A.length-le,null,e.composing?"*compose":null),F.length>1e3||F.indexOf(`
|
|
|
`)>-1?k.value=e.prevInput="":e.prevInput=F,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Yn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Yn.prototype.onKeyPress=function(){S&&y>=9&&(this.hasSelection=null),this.fastPoll()},Yn.prototype.onContextMenu=function(e){var n=this,k=n.cm,A=k.display,F=n.textarea;n.contextMenuPending&&n.contextMenuPending();var J=ri(k,e),le=A.scroller.scrollTop;if(!J||s)return;var pe=k.options.resetSelectionOnContextMenu;pe&&k.doc.sel.contains(J)==-1&&Vn(k,xi)(k.doc,qi(J),Ce);var ge=F.style.cssText,Ee=n.wrapper.style.cssText,We=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",F.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-We.top-5)+"px; left: "+(e.clientX-We.left-5)+`px;
|
|
|
z-index: 1000; background: `+(S?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ke;c&&(Ke=window.scrollY),A.input.focus(),c&&window.scrollTo(null,Ke),A.input.reset(),k.somethingSelected()||(F.value=n.prevInput=" "),n.contextMenuPending=at,A.selForContextMenu=k.doc.sel,clearTimeout(A.detectingSelectAll);function lt(){if(F.selectionStart!=null){var bt=k.somethingSelected(),Dt="\u200B"+(bt?F.value:"");F.value="\u21DA",F.value=Dt,n.prevInput=bt?"":"\u200B",F.selectionStart=1,F.selectionEnd=Dt.length,A.selForContextMenu=k.doc.sel}}function at(){if(n.contextMenuPending!=at)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=Ee,F.style.cssText=ge,S&&y<9&&A.scrollbars.setScrollTop(A.scroller.scrollTop=le),F.selectionStart!=null){(!S||S&&y<9)&<();var bt=0,Dt=function(){A.selForContextMenu==k.doc.sel&&F.selectionStart==0&&F.selectionEnd>0&&n.prevInput=="\u200B"?Vn(k,Ds)(k):bt++<10?A.detectingSelectAll=setTimeout(Dt,500):(A.selForContextMenu=null,A.input.reset())};A.detectingSelectAll=setTimeout(Dt,200)}}if(S&&y>=9&<(),L){Ne(e);var pt=function(){ut(window,"mouseup",pt),setTimeout(at,20)};Ae(window,"mouseup",pt)}else setTimeout(at,50)},Yn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Yn.prototype.setUneditable=function(){},Yn.prototype.needsContentAttribute=!1;function iu(e,n){if(n=n?W(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var k=V();n.autofocus=k==e||e.getAttribute("autofocus")!=null&&k==document.body}function A(){e.value=pe.getValue()}var F;if(e.form&&(Ae(e.form,"submit",A),!n.leaveSubmitMethodAlone)){var J=e.form;F=J.submit;try{var le=J.submit=function(){A(),J.submit=F,J.submit(),J.submit=le}}catch(ge){}}n.finishInit=function(ge){ge.save=A,ge.getTextArea=function(){return e},ge.toTextArea=function(){ge.toTextArea=isNaN,A(),e.parentNode.removeChild(ge.getWrapperElement()),e.style.display="",e.form&&(ut(e.form,"submit",A),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=F))}},e.style.display="none";var pe=jn(function(ge){return e.parentNode.insertBefore(ge,e.nextSibling)},n);return pe}function au(e){e.off=ut,e.on=Ae,e.wheelEventPixels=so,e.Doc=Li,e.splitLines=Pt,e.countColumn=H,e.findColumn=Oe,e.isWordChar=Q,e.Pass=_e,e.signal=$e,e.Line=li,e.changeEnd=ea,e.scrollbarModel=io,e.Pos=dt,e.cmpPos=At,e.modes=fr,e.mimeModes=Ht,e.resolveMode=Tt,e.getMode=Ot,e.modeExtensions=Rt,e.extendMode=Bt,e.copyState=lr,e.startState=yt,e.innerMode=sn,e.commands=xo,e.keyMap=ma,e.keyName=Vs,e.isModifierKey=Ks,e.lookupKey=Ya,e.normalizeKeyMap=Pl,e.StringStream=kt,e.SharedTextMarker=vo,e.TextMarker=Sa,e.LineWidget=go,e.e_preventDefault=xe,e.e_stopPropagation=Se,e.e_stop=Ne,e.addClass=z,e.contains=P,e.rmClass=w,e.keyNames=Ta}Jl(jn),eu(jn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Vo in Li.prototype)Li.prototype.hasOwnProperty(Vo)&&ne(ou,Vo)<0&&(jn.prototype[Vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[Vo]));return Pe(Li),jn.inputStyles={textarea:Yn,contenteditable:Cn},jn.defineMode=function(e){!jn.defaults.mode&&e!="null"&&(jn.defaults.mode=e),Mr.apply(this,arguments)},jn.defineMIME=Sr,jn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jn.defineMIME("text/plain","null"),jn.defineExtension=function(e,n){jn.prototype[e]=n},jn.defineDocExtension=function(e,n){Li.prototype[e]=n},jn.fromTextArea=iu,au(jn),jn.version="5.58.2",jn})},WYAk:function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){(function(){var g=M,T=g.lib,D=T.Base,v=g.enc,f=v.Utf8,S=g.algo,y=S.HMAC=D.extend({init:function(c,o){c=this._hasher=new c.init,typeof o=="string"&&(o=f.parse(o));var r=c.blockSize,s=r*4;o.sigBytes>s&&(o=c.finalize(o)),o.clamp();for(var d=this._oKey=o.clone(),u=this._iKey=o.clone(),p=d.words,m=u.words,i=0;i<r;i++)p[i]^=1549556828,m[i]^=909522486;d.sigBytes=u.sigBytes=s,this.reset()},reset:function(){var c=this._hasher;c.reset(),c.update(this._iKey)},update:function(c){return this._hasher.update(c),this},finalize:function(c){var o=this._hasher,r=o.finalize(c);o.reset();var s=o.finalize(this._oKey.clone().concat(r));return s}})})()})},WaYH:function(I,$,R){"use strict";var M=R("rePB"),g=R("Ff2n"),T=R("VTBJ"),D=R("1OyB"),v=R("vuIU"),f=R("JX7q"),S=R("Ji7U"),y=R("LK+K"),c=R("q1tI"),o=R("TSYQ"),r=R.n(o),s=R("sboe"),d=R("OZM5"),u=function(L){var O=L.prefixCls,w=L.level,C=L.isStart,x=L.isEnd;if(!w)return null;for(var _="".concat(O,"-indent-unit"),j=[],N=0;N<w;N+=1){var P;j.push(c.createElement("span",{key:N,className:r()(_,(P={},Object(M.a)(P,"".concat(_,"-start"),C[N+1]),Object(M.a)(P,"".concat(_,"-end"),x[N+1]),Object(M.a)(P,"".concat(_,"-end-first-level"),!N&&x[0]),P))}))}return c.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},j)},p=u,m=R("815F"),i="open",t="close",a="---",l=function(h){Object(S.a)(O,h);var L=Object(y.a)(O);function O(){var w;return Object(D.a)(this,O),w=L.apply(this,arguments),w.state={dragNodeHighlight:!1},w.onSelectorClick=function(C){var x=w.props.context.onNodeClick;x(C,Object(m.b)(w.props)),w.isSelectable()?w.onSelect(C):w.onCheck(C)},w.onSelectorDoubleClick=function(C){var x=w.props.context.onNodeDoubleClick;x(C,Object(m.b)(w.props))},w.onSelect=function(C){if(w.isDisabled())return;var x=w.props.context.onNodeSelect;C.preventDefault(),x(C,Object(m.b)(w.props))},w.onCheck=function(C){if(w.isDisabled())return;var x=w.props,_=x.disableCheckbox,j=x.checked,N=w.props.context.onNodeCheck;if(!w.isCheckable()||_)return;C.preventDefault();var P=!j;N(C,Object(m.b)(w.props),P)},w.onMouseEnter=function(C){var x=w.props.context.onNodeMouseEnter;x(C,Object(m.b)(w.props))},w.onMouseLeave=function(C){var x=w.props.context.onNodeMouseLeave;x(C,Object(m.b)(w.props))},w.onContextMenu=function(C){var x=w.props.context.onNodeContextMenu;x(C,Object(m.b)(w.props))},w.onDragStart=function(C){var x=w.props.context.onNodeDragStart;C.stopPropagation(),w.setState({dragNodeHighlight:!0}),x(C,Object(f.a)(w));try{C.dataTransfer.setData("text/plain","")}catch(_){}},w.onDragEnter=function(C){var x=w.props.context.onNodeDragEnter;C.preventDefault(),C.stopPropagation(),x(C,Object(f.a)(w))},w.onDragOver=function(C){var x=w.props.context.onNodeDragOver;C.preventDefault(),C.stopPropagation(),x(C,Object(f.a)(w))},w.onDragLeave=function(C){var x=w.props.context.onNodeDragLeave;C.stopPropagation(),x(C,Object(f.a)(w))},w.onDragEnd=function(C){var x=w.props.context.onNodeDragEnd;C.stopPropagation(),w.setState({dragNodeHighlight:!1}),x(C,Object(f.a)(w))},w.onDrop=function(C){var x=w.props.context.onNodeDrop;C.preventDefault(),C.stopPropagation(),w.setState({dragNodeHighlight:!1}),x(C,Object(f.a)(w))},w.onExpand=function(C){var x=w.props.context.onNodeExpand;x(C,Object(m.b)(w.props))},w.setSelectHandle=function(C){w.selectHandle=C},w.getNodeState=function(){var C=w.props.expanded;return w.isLeaf()?null:C?i:t},w.hasChildren=function(){var C=w.props.eventKey,x=w.props.context.keyEntities,_=x[C]||{},j=_.children;return!!(j||[]).length},w.isLeaf=function(){var C=w.props,x=C.isLeaf,_=C.loaded,j=w.props.context.loadData,N=w.hasChildren();return x===!1?!1:x||!j&&!N||j&&_&&!N},w.isDisabled=function(){var C=w.props.disabled,x=w.props.context.disabled;return!!(x||C)},w.isCheckable=function(){var C=w.props.checkable,x=w.props.context.checkable;return!x||C===!1?!1:x},w.syncLoadData=function(C){var x=C.expanded,_=C.loading,j=C.loaded,N=w.props.context,P=N.loadData,V=N.onNodeLoad;if(_)return;P&&x&&!w.isLeaf()&&(!w.hasChildren()&&!j&&V(Object(m.b)(w.props)))},w.renderSwitcher=function(){var C=w.props,x=C.expanded,_=C.switcherIcon,j=w.props.context,N=j.prefixCls,P=j.switcherIcon,V=_||P;if(w.isLeaf())return c.createElement("span",{className:r()("".concat(N,"-switcher"),"".concat(N,"-switcher-noop"))},typeof V=="function"?V(Object(T.a)(Object(T.a)({},w.props),{},{isLeaf:!0})):V);var z=r()("".concat(N,"-switcher"),"".concat(N,"-switcher_").concat(x?i:t));return c.createElement("span",{onClick:w.onExpand,className:z},typeof V=="function"?V(Object(T.a)(Object(T.a)({},w.props),{},{isLeaf:!1})):V)},w.renderCheckbox=function(){var C=w.props,x=C.checked,_=C.halfChecked,j=C.disableCheckbox,N=w.props.context.prefixCls,P=w.isDisabled(),V=w.isCheckable();if(!V)return null;var z=typeof V!="boolean"?V:null;return c.createElement("span",{className:r()("".concat(N,"-checkbox"),x&&"".concat(N,"-checkbox-checked"),!x&&_&&"".concat(N,"-checkbox-indeterminate"),(P||j)&&"".concat(N,"-checkbox-disabled")),onClick:w.onCheck},z)},w.renderIcon=function(){var C=w.props.loading,x=w.props.context.prefixCls;return c.createElement("span",{className:r()("".concat(x,"-iconEle"),"".concat(x,"-icon__").concat(w.getNodeState()||"docu"),C&&"".concat(x,"-icon_loading"))})},w.renderSelector=function(){var C=w.state.dragNodeHighlight,x=w.props,_=x.title,j=x.selected,N=x.icon,P=x.loading,V=x.data,z=w.props.context,B=z.prefixCls,K=z.showIcon,U=z.icon,W=z.draggable,H=z.loadData,q=z.titleRender,ne=w.isDisabled(),te="".concat(B,"-node-content-wrapper"),_e;if(K){var Ce=N||U;_e=Ce?c.createElement("span",{className:r()("".concat(B,"-iconEle"),"".concat(B,"-icon__customize"))},typeof Ce=="function"?Ce(w.props):Ce):w.renderIcon()}else H&&P&&(_e=w.renderIcon());var me;typeof _=="function"?me=_(V):q?me=q(V):me=_;var Me=c.createElement("span",{className:"".concat(B,"-title")},me);return c.createElement("span",{ref:w.setSelectHandle,title:typeof _=="string"?_:"",className:r()("".concat(te),"".concat(te,"-").concat(w.getNodeState()||"normal"),!ne&&(j||C)&&"".concat(B,"-node-selected"),!ne&&W&&"draggable"),draggable:!ne&&W||void 0,"aria-grabbed":!ne&&W||void 0,onMouseEnter:w.onMouseEnter,onMouseLeave:w.onMouseLeave,onContextMenu:w.onContextMenu,onClick:w.onSelectorClick,onDoubleClick:w.onSelectorDoubleClick,onDragStart:W?w.onDragStart:void 0},_e,Me)},w}return Object(v.a)(O,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var C=this.props.selectable,x=this.props.context.selectable;return typeof C=="boolean"?C:x}},{key:"render",value:function(){var C,x=this.props,_=x.eventKey,j=x.className,N=x.style,P=x.dragOver,V=x.dragOverGapTop,z=x.dragOverGapBottom,B=x.isLeaf,K=x.isStart,U=x.isEnd,W=x.expanded,H=x.selected,q=x.checked,ne=x.halfChecked,te=x.loading,_e=x.domRef,Ce=x.active,me=x.onMouseMove,Me=Object(g.a)(x,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Oe=this.props.context,he=Oe.prefixCls,ce=Oe.filterTreeNode,se=Oe.draggable,Te=Oe.keyEntities,re=this.isDisabled(),ue=Object(d.f)(Me),fe=Te[_]||{},ee=fe.level,Q=U[U.length-1];return c.createElement("div",Object.assign({ref:_e,className:r()(j,"".concat(he,"-treenode"),(C={},Object(M.a)(C,"".concat(he,"-treenode-disabled"),re),Object(M.a)(C,"".concat(he,"-treenode-switcher-").concat(W?"open":"close"),!B),Object(M.a)(C,"".concat(he,"-treenode-checkbox-checked"),q),Object(M.a)(C,"".concat(he,"-treenode-checkbox-indeterminate"),ne),Object(M.a)(C,"".concat(he,"-treenode-selected"),H),Object(M.a)(C,"".concat(he,"-treenode-loading"),te),Object(M.a)(C,"".concat(he,"-treenode-active"),Ce),Object(M.a)(C,"".concat(he,"-treenode-leaf-last"),Q),Object(M.a)(C,"drag-over",!re&&P),Object(M.a)(C,"drag-over-gap-top",!re&&V),Object(M.a)(C,"drag-over-gap-bottom",!re&&z),Object(M.a)(C,"filter-node",ce&&ce(Object(m.b)(this.props))),C)),style:N,onDragEnter:se?this.onDragEnter:void 0,onDragOver:se?this.onDragOver:void 0,onDragLeave:se?this.onDragLeave:void 0,onDrop:se?this.onDrop:void 0,onDragEnd:se?this.onDragEnd:void 0,onMouseMove:me},ue),c.createElement(p,{prefixCls:he,level:ee,isStart:K,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(c.Component),E=function(L){return c.createElement(s.a.Consumer,null,function(O){return c.createElement(l,Object.assign({},L,{context:O}))})};E.displayName="TreeNode",E.defaultProps={title:a},E.isTreeNode=1;var b=$.a=E},XIdC:function(I,$,R){"use strict";var M=R("rePB"),g=R("ODXe"),T=R("Ff2n"),D=R("q1tI"),v=R.n(D),f=R("TSYQ"),S=R.n(f),y=R("6cGi"),c=R("4IlW"),o=D.forwardRef(function(r,s){var d,u=r.prefixCls,p=u===void 0?"rc-switch":u,m=r.className,i=r.checked,t=r.defaultChecked,a=r.disabled,l=r.loadingIcon,E=r.checkedChildren,b=r.unCheckedChildren,h=r.onClick,L=r.onChange,O=r.onKeyDown,w=Object(T.a)(r,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),C=Object(y.a)(!1,{value:i,defaultValue:t}),x=Object(g.a)(C,2),_=x[0],j=x[1];function N(B,K){var U=_;return a||(U=B,j(U),L==null||L(U,K)),U}function P(B){B.which===c.a.LEFT?N(!1,B):B.which===c.a.RIGHT&&N(!0,B),O==null||O(B)}function V(B){var K=N(!_,B);h==null||h(K,B)}var z=S()(p,m,(d={},Object(M.a)(d,"".concat(p,"-checked"),_),Object(M.a)(d,"".concat(p,"-disabled"),a),d));return D.createElement("button",Object.assign({},w,{type:"button",role:"switch","aria-checked":_,disabled:a,className:z,ref:s,onKeyDown:P,onClick:V}),l,D.createElement("span",{className:"".concat(p,"-inner")},_?E:b))});o.displayName="Switch",$.a=o},Y1PL:function(I,$,R){"use strict";R.r($),R.d($,"ResizableTextArea",function(){return ne});var M=R("wx14"),g=R("1OyB"),T=R("vuIU"),D=R("Ji7U"),v=R("LK+K"),f=R("q1tI"),S=R("VTBJ"),y=R("rePB"),c=R("Zm9Q"),o=R("Kwbf"),r=R("c+Xe"),s=R("m+aA"),d=R("bdgK"),u=new Map;function p(Ce){Ce.forEach(function(me){var Me,Oe=me.target;(Me=u.get(Oe))===null||Me===void 0||Me.forEach(function(he){return he(Oe)})})}var m=new d.default(p),i=null,t=null;function a(Ce,me){u.has(Ce)||(u.set(Ce,new Set),m.observe(Ce)),u.get(Ce).add(me)}function l(Ce,me){u.has(Ce)&&(u.get(Ce).delete(me),u.get(Ce).size||(m.unobserve(Ce),u.delete(Ce)))}var E=function(Ce){Object(D.a)(Me,Ce);var me=Object(v.a)(Me);function Me(){return Object(g.a)(this,Me),me.apply(this,arguments)}return Object(T.a)(Me,[{key:"render",value:function(){return this.props.children}}]),Me}(f.Component),b=f.createContext(null);function h(Ce){var me=Ce.children,Me=Ce.onBatchResize,Oe=f.useRef(0),he=f.useRef([]),ce=f.useContext(b),se=f.useCallback(function(Te,re,ue){Oe.current+=1;var fe=Oe.current;he.current.push({size:Te,element:re,data:ue}),Promise.resolve().then(function(){fe===Oe.current&&(Me==null||Me(he.current),he.current=[])}),ce==null||ce(Te,re,ue)},[Me,ce]);return f.createElement(b.Provider,{value:se},me)}function L(Ce){var me=Ce.children,Me=Ce.disabled,Oe=f.useRef(null),he=f.useRef(null),ce=f.useContext(b),se=f.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Te=f.isValidElement(me)&&Object(r.c)(me),re=Te?me.ref:null,ue=f.useMemo(function(){return Object(r.a)(re,Oe)},[re,Oe]),fe=f.useRef(Ce);fe.current=Ce;var ee=f.useCallback(function(Q){var X=fe.current,Z=X.onResize,ve=X.data,ye=Q.getBoundingClientRect(),Re=ye.width,Je=ye.height,Ze=Q.offsetWidth,rt=Q.offsetHeight,tt=Math.floor(Re),st=Math.floor(Je);if(se.current.width!==tt||se.current.height!==st||se.current.offsetWidth!==Ze||se.current.offsetHeight!==rt){var ot={width:tt,height:st,offsetWidth:Ze,offsetHeight:rt};se.current=ot;var Fe=Ze===Math.round(Re)?Re:Ze,Ae=rt===Math.round(Je)?Je:rt,qe=Object(S.a)(Object(S.a)({},ot),{},{offsetWidth:Fe,offsetHeight:Ae});ce==null||ce(qe,Q,ve),Z&&Promise.resolve().then(function(){Z(qe,Q)})}},[]);return f.useEffect(function(){var Q=Object(s.a)(Oe.current)||Object(s.a)(he.current);return Q&&!Me&&a(Q,ee),function(){return l(Q,ee)}},[Oe.current,Me]),f.createElement(E,{ref:he},Te?f.cloneElement(me,{ref:ue}):me)}var O="rc-observer-key";function w(Ce){var me=Ce.children,Me=Object(c.a)(me);return Me.map(function(Oe,he){var ce=(Oe==null?void 0:Oe.key)||"".concat(O,"-").concat(he);return f.createElement(L,Object(M.a)({},Ce,{key:ce}),Oe)})}w.Collection=h;var C=w,x=R("bT9E"),_=R("TSYQ"),j=R.n(_),N=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important
|
|
|
`,P=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],V={},z;function B(Ce){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(me&&V[Me])return V[Me];var Oe=window.getComputedStyle(Ce),he=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),se=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),Te=P.map(function(ue){return"".concat(ue,":").concat(Oe.getPropertyValue(ue))}).join(";"),re={sizingStyle:Te,paddingSize:ce,borderSize:se,boxSizing:he};return me&&Me&&(V[Me]=re),re}function K(Ce){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=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 he=B(Ce,me),ce=he.paddingSize,se=he.borderSize,Te=he.boxSizing,re=he.sizingStyle;z.setAttribute("style","".concat(re,";").concat(N)),z.value=Ce.value||Ce.placeholder||"";var ue=Number.MIN_SAFE_INTEGER,fe=Number.MAX_SAFE_INTEGER,ee=z.scrollHeight,Q;if(Te==="border-box"?ee+=se:Te==="content-box"&&(ee-=ce),Me!==null||Oe!==null){z.value=" ";var X=z.scrollHeight-ce;Me!==null&&(ue=X*Me,Te==="border-box"&&(ue=ue+ce+se),ee=Math.max(ue,ee)),Oe!==null&&(fe=X*Oe,Te==="border-box"&&(fe=fe+ce+se),Q=ee>fe?"":"hidden",ee=Math.min(fe,ee))}return{height:ee,minHeight:ue,maxHeight:fe,overflowY:Q,resize:"none"}}var U=R("Gytx"),W=R.n(U),H;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(H||(H={}));var q=function(Ce){Object(D.a)(Me,Ce);var me=Object(v.a)(Me);function Me(Oe){var he;return Object(g.a)(this,Me),he=me.call(this,Oe),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(ce){he.textArea=ce},he.handleResize=function(ce){var se=he.state.resizeStatus,Te=he.props,re=Te.autoSize,ue=Te.onResize;if(se!==H.NONE)return;typeof ue=="function"&&ue(ce),re&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var ce=he.props.autoSize;if(!ce||!he.textArea)return;var se=ce.minRows,Te=ce.maxRows,re=K(he.textArea,!1,se,Te);he.setState({textareaStyles:re,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var ce=he.props,se=ce.prefixCls,Te=se===void 0?"rc-textarea":se,re=ce.autoSize,ue=ce.onResize,fe=ce.className,ee=ce.disabled,Q=he.state,X=Q.textareaStyles,Z=Q.resizeStatus,ve=Object(x.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ye=j()(Te,fe,Object(y.a)({},"".concat(Te,"-disabled"),ee));"value"in ve&&(ve.value=ve.value||"");var Re=Object(S.a)(Object(S.a)(Object(S.a)({},he.props.style),X),Z===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return f.createElement(C,{onResize:he.handleResize,disabled:!(re||ue)},f.createElement("textarea",Object(M.a)({},ve,{className:ye,style:Re,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:H.NONE},he}return Object(T.a)(Me,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!W()(he.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 he=this.textArea.selectionStart,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,ce)}}catch(se){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Me}(f.Component),ne=q,te=function(Ce){Object(D.a)(Me,Ce);var me=Object(v.a)(Me);function Me(Oe){var he;Object(g.a)(this,Me),he=me.call(this,Oe),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(se){he.resizableTextArea=se},he.handleChange=function(se){var Te=he.props.onChange;he.setValue(se.target.value,function(){he.resizableTextArea.resizeTextarea()}),Te&&Te(se)},he.handleKeyDown=function(se){var Te=he.props,re=Te.onPressEnter,ue=Te.onKeyDown;se.keyCode===13&&re&&re(se),ue&&ue(se)};var ce=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return he.state={value:ce},he}return Object(T.a)(Me,[{key:"setValue",value:function(he,ce){"value"in this.props||this.setState({value:he},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return f.createElement(ne,Object(M.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),Me}(f.Component),_e=$.default=te},ZD9Y:function(I,$,R){"use strict";var M=R("BoS7"),g=R("Sdc0"),T=R("OaEy"),D=R("2fM7"),v=R("q1tI"),f=R.n(v),S=R("lOMy"),y=R.n(S),c=D.a.Option;$.a=function(o){var r=o.onFontSizeChange,s=o.cmFontSize,d=o.cmCodeMode,u=o.onCodeModeChange,p=o.onTabToSpace,m=o.className,i=m===void 0?"":m,t=o.tabToSpace,a=o.children;return f.a.createElement("div",{className:"tpi-code-setting ".concat(i)},f.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),f.a.createElement("section",null,f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),f.a.createElement(D.a,{bordered:!1,size:"small",value:d,onChange:u},f.a.createElement(c,{value:"vs"},"\u767D\u8272\u80CC\u666F"),f.a.createElement(c,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),f.a.createElement(D.a,{bordered:!1,size:"small",value:s,onChange:r},f.a.createElement(c,{value:12},"12px"),f.a.createElement(c,{value:14},"14px"),f.a.createElement(c,{value:16},"16px"),f.a.createElement(c,{value:18},"18px"),f.a.createElement(c,{value:20},"20px"),f.a.createElement(c,{value:22},"22px"))),f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"Tab\u8F6C\u6362"),f.a.createElement(g.a,{checked:t,onChange:p}))),f.a.createElement("h3",null,"\u5FEB\u6377\u952E"),f.a.createElement("section",null,f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),f.a.createElement("span",null,"Ctrl + S")),f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),f.a.createElement("span",null,"F1 / Alt + F1")),f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),f.a.createElement("span",null,"Ctrl + ]/[")),f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),f.a.createElement("span",null,"Ctrl + Shift + \\")),f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),f.a.createElement("span",null,"Home")),f.a.createElement("div",{className:"file-item"},f.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),f.a.createElement("span",null,"End"))),a)}},ZW9T:function(I,$,R){"use strict";R.d($,"a",function(){return C});var M=R("k1fw"),g=R("oBTY"),T=R("9og8"),D=R("miYZ"),v=R("tsqr"),f=R("rAM+"),S=R("tJVT"),y=R("PpiC"),c=R("WmNS"),o=R.n(c),r=R("q1tI"),s=R.n(r),d=R("bdgK");function u(x,_,j,N,P){var V=_.getWordUntilPosition(j),z={startLineNumber:j.lineNumber,endLineNumber:j.lineNumber,startColumn:V.startColumn,endColumn:V.endColumn},B=N.map(function(K){return{label:K,kind:x.languages.CompletionItemKind.Keyword,insertText:K,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:z}});return P.map(function(K){B.push(Object(M.a)(Object(M.a)({},K),{},{range:z}))}),B}var p=function(x){var _={label:"ifelse",kind:x.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`),insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet},j=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];x.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(z,B){var K=u(x,z,B,j,[_]);return{suggestions:K}}});var N=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];x.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(z,B){var K=[{label:"print",kind:x.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
|
`),insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet}],U=u(x,z,B,N,K);return{suggestions:U}}});var P=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];x.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(z,B){var K=[_,{label:"main",kind:x.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`),insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:x.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
|
`),insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet}],U=u(x,z,B,P,K);return{suggestions:U}}})},m="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",i=R("fjLI"),t=R("LvDl"),a=R("+ua5");function l(x){return/^\d+$/.test(x)?"".concat(x,"px"):x}function E(){}var b=!1,h={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale"};function L(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_=x;if(Array.isArray(x)){for(var j=0;j<x.length;j++){var N=h[x[j]];if(N)return N}return _[0]}return h[_]||_}var O=null,w=$.b=function(x){var _=x.width,j=_===void 0?"100%":_,N=x.height,P=N===void 0?"100%":N,V=x.value,z=x.language,B=z===void 0?"javascript":z,K=x.style,U=K===void 0?{}:K,W=x.options,H=W===void 0?{}:W,q=x.overrideServices,ne=q===void 0?{}:q,te=x.theme,_e=te===void 0?"vs-dark":te,Ce=x.onEditBlur,me=x.onSave,Me=x.autoHeight,Oe=Me===void 0?!1:Me,he=x.forbidCopy,ce=he===void 0?!1:he,se=x.onChange,Te=se===void 0?E:se,re=x.editorDidMount,ue=re===void 0?E:re,fe=x.onFocus,ee=fe===void 0?E:fe,Q=x.onBreakPoint,X=Q===void 0?E:Q,Z=x.breakPointValue,ve=Z===void 0?[]:Z,ye=x.filename,Re=ye===void 0?"educoder.txt":ye,Je=x.errorLine,Ze=x.errorContent,rt=Ze===void 0?"":Ze,tt=x.highlightLine,st=x.openBreakPoint,ot=st===void 0?!1:st,Fe=Object(y.a)(x,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),Ae=Object(r.useRef)(),qe=Object(r.useRef)({}),ut=Object(r.useRef)(),$e=Object(r.useRef)(),nt=Object(r.useRef)([]),je=Object(r.useRef)(!1),De=Object(r.useRef)(),Pe=Object(r.useState)(!1),xe=Object(S.a)(Pe,2),Se=xe[0],Le=xe[1];function Ne(){var Ot;return Ae.current&&(Ot=new d.default(function(Rt){var Bt=Object(f.a)(Rt),lr;try{for(Bt.s();!(lr=Bt.n()).done;){var sn=lr.value;(sn.target.offsetHeight>0||sn.target.offsetWidth>0)&&qe.current.instance.layout()}}catch(yt){Bt.e(yt)}finally{Bt.f()}}),Ot.observe(Ae.current)),Ot}function et(){v.b.warn({content:decodeURIComponent(m),key:"monaco-editor-tip"})}var Xe=function(){var Rt=qe.current.instance;if(V!=null&&Rt&&Se){var Bt=Rt.getModel();Bt&&V!==Bt.getValue()&&(b=!0,Bt.setValue(V),Rt.layout(),b=!1)}};Object(r.useEffect)(function(){try{var Ot,Rt=qe.current.instance;$e.current&&clearTimeout($e.current),$e.current=setTimeout(function(){Xe()},500),Rt==null||((Ot=Rt.updateOptions)===null||Ot===void 0)||Ot.call(Rt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(V.split(/\r\n|\r|\n/g).length))+3,5)})}catch(Bt){debugger}},[V,Se,qe.current]),Object(r.useEffect)(function(){try{if(Je&&qe.current&&qe.current.instance){var Ot=qe.current.instance;Ot.changeViewZones(function(Bt){var lr=document.createElement("div");lr.style.padding="10px 20px",lr.style.width="calc(100% - 20px)",lr.className="my-error-line-wrp",lr.innerHTML=rt,Bt.addZone({afterLineNumber:Je||11,heightInLines:3,domNode:lr})});var Rt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Ot.addOverlayWidget(Rt),Ot.revealPositionInCenter({lineNumber:20,column:1})}}catch(Bt){debugger}},[Je,qe.current,Se]),Object(r.useEffect)(function(){var Ot;if((Ot=qe.current)!==null&&Ot!==void 0&&Ot.instance&&Se&&ot){var Rt=qe.current.instance,Bt=Rt.getModel();if(!Bt)return;var lr=function(){var At=[],$t=[],hr=Bt.getAllDecorations(),vr=Object(f.a)(hr),Er;try{for(vr.s();!(Er=vr.n()).done;){var ae=Er.value;if(ae.options.className==="highlighted-line"){var G;At.push(ae==null||((G=ae.range)===null||G===void 0)?void 0:G.startLineNumber),$t.push(ae==null?void 0:ae.id)}}}catch(ie){vr.e(ie)}finally{vr.f()}Bt.deltaDecorations($t,[]);var Y=Bt.getLineCount();!!tt&&tt<=Y&&(Rt.deltaDecorations([],[{range:new O.Range(tt,1,tt,Bt.getLineMaxColumn(tt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Rt.revealLineInCenter(tt))};lr();var sn=function(){var At=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,$t=[],hr=[],vr=Bt.getAllDecorations(),Er=Object(f.a)(vr),ae;try{for(Er.s();!(ae=Er.n()).done;){var G=ae.value;if(G.options.linesDecorationsClassName==="breakpoints"){var Y;$t.push(G==null||((Y=G.range)===null||Y===void 0)?void 0:Y.startLineNumber),hr.push(G==null?void 0:G.id)}}}catch(ie){Er.e(ie)}finally{Er.f()}if(At)return{lines:$t,ids:hr};X($t)},yt=function(){var dt=Object(T.a)(o.a.mark(function At($t){var hr;return o.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return hr={range:new O.Range($t,1,$t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},Er.next=3,Bt.deltaDecorations([],[hr]);case 3:sn();case 4:case"end":return Er.stop()}},At)}));return function($t){return dt.apply(this,arguments)}}(),kt=function(){var dt=Object(T.a)(o.a.mark(function At($t){var hr,vr,Er,ae,G;return o.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:hr=[],vr=Rt.getLineDecorations($t),Er=Object(f.a)(vr);try{for(Er.s();!(ae=Er.n()).done;)G=ae.value,G.options.linesDecorationsClassName==="breakpoints"&&hr.push(G.id)}catch(de){Er.e(de)}finally{Er.f()}return ie.next=6,Bt.deltaDecorations(hr,[]);case 6:sn();case 7:case"end":return ie.stop()}},At)}));return function($t){return dt.apply(this,arguments)}}(),Ct=function(At){var $t=Rt.getLineDecorations(At),hr=Object(f.a)($t),vr;try{for(hr.s();!(vr=hr.n()).done;){var Er=vr.value;if(Er.options.linesDecorationsClassName==="breakpoints")return!0}}catch(ae){hr.e(ae)}finally{hr.f()}return!1};if(!Object(t.isEqual)(ve,sn(!0).lines)){Bt.deltaDecorations(sn(!0).ids,[]);var Ar=ve.map(function(dt){return{range:new O.Range(dt,1,dt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});Bt.deltaDecorations([],Ar)}var Wr=Rt.onDidChangeModelContent(function(dt){var At=Rt.getPosition();if(At){var $t=At.lineNumber;Bt.getLineContent($t).trim()===""?kt($t):Ct($t)&&(kt($t),yt($t))}}),Yt=Rt.onMouseDown(function(dt){var At,$t,hr;if(dt.target.detail&&(At=dt.target)!==null&&At!==void 0&&($t=At.element)!==null&&$t!==void 0&&(hr=$t.className)!==null&&hr!==void 0&&hr.includes("line-numbers")){var vr=dt.target.position.lineNumber;if(Bt.getLineContent(vr).trim()==="")return;Ct(vr)?kt(vr):yt(vr)}}),Ut=function(At){var $t={range:new O.Range(At,1,At,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};nt.current=Rt.deltaDecorations(nt.current,[$t])},Pr=function(){nt.current=Rt.deltaDecorations(nt.current,[])},yn=Rt.onMouseMove(function(dt){var At,$t,hr;if(Pr(),dt.target.detail&&(At=dt.target)!==null&&At!==void 0&&($t=At.element)!==null&&$t!==void 0&&(hr=$t.className)!==null&&hr!==void 0&&hr.includes("line-numbers")){var vr=dt.target.position.lineNumber;if(Bt.getLineContent(vr).trim()==="")return;Ut(vr)}}),Vr=Rt.onMouseLeave(function(){Pr()});return function(){Wr.dispose(),Yt.dispose(),yn.dispose(),Vr.dispose()}}},[qe.current,Se,ve,tt,ot]);function ct(){var Ot=qe.current.instance;if(Ot){var Rt=Ot.getSelection(),Bt=qe.current.pastePos||{},lr=new O.Range(Bt.startLineNumber||Rt.endLineNumber,Bt.startColumn||Rt.endColumn,Bt.endLineNumber||Rt.endLineNumber,Bt.endColumn||Rt.endColumn);setTimeout(function(){Ot.executeEdits("",[{range:lr,text:""}])},300)}}function gt(Ot){(window.navigator.platform.match("Mac")?Ot.metaKey:Ot.ctrlKey)&&Ot.keyCode==83&&(Ot.preventDefault(),me())}var wt=function(){if(Oe&&qe.current.instance){var Rt=qe.current.instance.getContentHeight();Sr(Rt<P?P:Rt)}else Sr(P)};function vt(Ot){var Rt=document.createEvent("MouseEvents");Rt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ot.dispatchEvent(Rt)}var Mt=function(Rt){var Bt=Rt.keyCode,lr=Rt.ctrlKey,sn=Rt.metaKey,yt=Rt.target,kt=Rt.type;return(kt==="paste"||(Bt===67||Bt===86)&&(sn||lr))&&yt.nodeName==="TEXTAREA"&&(et(),Rt.preventDefault()),!1};function Pt(Ot,Rt){var Bt=window.URL||window.webkitURL||window,lr=new Blob([Rt]),sn=document.createElementNS("http://www.w3.org/1999/xhtml","a");sn.href=Bt.createObjectURL(lr),sn.download=Ot,vt(sn)}Object(r.useEffect)(function(){wt()},[wt]),Object(r.useEffect)(function(){Ae.current&&!Se&&R.e(27).then(R.t.bind(null,"M/lh",7)).then(function(Ot){try{O=Ot,qe.current.instance=O.editor.create(Ae.current,{value:V,language:L(B),theme:_e,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},ne);var Rt=qe.current.instance,Bt=i.c._menuItems,lr=Object(g.a)(Bt).find(function(yt){return yt[0]._debugName=="EditorContext"});if(ue(Rt,O),setTimeout(function(){wt(),qe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Pt(Re||"educoder.txt",Rt.getValue())}}),Rt.getDomNode().addEventListener("input",function(){ut.current.autoFormat&&Rt.getAction("editor.action.formatDocument").run()})},500),qe.current.subscription=Rt.onDidChangeModelContent(function(yt){debugger;je.current?clearTimeout(De.current):(wt(),Te(Rt.getValue(),yt)),De.current=setTimeout(function(){je.current=!1},500)}),window.Monaco||p(O,L(B)),ce&&(Ae.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Mt),window.removeEventListener("paste",Mt),window.addEventListener("keydown",Mt),window.addEventListener("paste",Mt)),window.Monaco=O,Ce&&Rt.onDidBlurEditorWidget(function(){Ce(Rt.getValue())}),ee&&Rt.onDidFocusEditorText(function(){ee(Rt.getValue())}),ce)try{window.addEventListener("paste",ct)}catch(yt){}var sn=Ne();return Le(!0),function(){var yt=qe.current.instance;yt.dispose();var kt=yt.getModel();kt&&kt.dispose(),qe.current.subscription&&qe.current.subscription.dispose(),ce&&window.removeEventListener("paste",ct),sn.unobserve(Ae.current)}}catch(yt){debugger}})},[]),Object(r.useEffect)(function(){var Ot=qe.current.instance;if(Ot&&Se)return document.addEventListener("keydown",gt,!1),function(){document.removeEventListener("keydown",gt)}},[me,Se]),Object(r.useEffect)(function(){var Ot=qe.current.instance;if(Ot&&Se){var Rt=L(B);O.editor.setModelLanguage(Ot.getModel(),Rt)}},[B,Se]),Object(r.useEffect)(function(){var Ot=qe.current.instance;Ot&&Se&&O.editor.setTheme(_e)},[_e,Se]),Object(r.useEffect)(function(){var Ot=qe.current.instance;ut.current=H,Ot&&Se&&(Ot.updateOptions(Object(M.a)({},H)),setTimeout(function(){Ot.getModel().updateOptions(Object(M.a)({},H))},200))},[JSON.stringify(H),Se]),Object(r.useEffect)(function(){var Ot=qe.current.instance;Ot&&Se&&Ot.layout()},[j,P,Se]);var _t=Object(r.useState)(l(j)),rr=Object(S.a)(_t,2),dr=rr[0],Zt=rr[1],fr=Object(r.useState)(l(P)),Ht=Object(S.a)(fr,2),Mr=Ht[0],Sr=Ht[1],Tt=Object(M.a)(Object(M.a)({},U),{},{width:dr,height:Mr});return s.a.createElement("div",{className:"my-monaco-editor",ref:Ae,style:Tt})};function C(x){var _=x.width,j=_===void 0?"100%":_,N=x.height,P=N===void 0?"100%":N,V=x.original,z=x.modified,B=x.language,K=x.options,U=K===void 0?{}:K,W=Object(r.useRef)(),H=Object(r.useState)(null),q=Object(S.a)(H,2),ne=q[0],te=q[1];function _e(Oe){var he;return W.current&&(he=new d.default(function(ce){var se=Object(f.a)(ce),Te;try{for(se.s();!(Te=se.n()).done;){var re=Te.value;(re.target.offsetHeight>0||re.target.offsetWidth>0)&&Oe.layout()}}catch(ue){se.e(ue)}finally{se.f()}}),he.observe(W.current)),he}Object(r.useEffect)(function(){return W.current&&R.e(27).then(R.t.bind(null,"M/lh",7)).then(function(Oe){O=Oe;var he=O.editor.createDiffEditor(W.current,Object(M.a)(Object(M.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},U),{},{wordWrap:!0}));te(he);var ce=_e(he);return function(){he.dispose();var se=he.getModel();se&&se.dispose(),ce.unobserve(W.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(r.useEffect)(function(){ne&&ne.setModel({original:O.editor.createModel(V,B),modified:O.editor.createModel(z,B)})},[V,z,B,ne]);var Ce=l(j),me=l(P),Me={width:Ce,height:me};return s.a.createElement("div",{className:"my-diff-editor",ref:W,style:Me})}},ZpRC:function(I,$,R){"use strict";function M(r){return typeof r=="object"&&r!=null&&r.nodeType===1}function g(r,s){return(!s||r!=="hidden")&&r!=="visible"&&r!=="clip"}function T(r,s){if(r.clientHeight<r.scrollHeight||r.clientWidth<r.scrollWidth){var d=getComputedStyle(r,null);return g(d.overflowY,s)||g(d.overflowX,s)||function(u){var p=function(m){if(!m.ownerDocument||!m.ownerDocument.defaultView)return null;try{return m.ownerDocument.defaultView.frameElement}catch(i){return null}}(u);return!!p&&(p.clientHeight<u.scrollHeight||p.clientWidth<u.scrollWidth)}(r)}return!1}function D(r,s,d,u,p,m,i,t){return m<r&&i>s||m>r&&i<s?0:m<=r&&t<=d||i>=s&&t>=d?m-r-u:i>s&&t<d||m<r&&t>d?i-s+p:0}var v=function(r,s){var d=window,u=s.scrollMode,p=s.block,m=s.inline,i=s.boundary,t=s.skipOverflowHiddenElements,a=typeof i=="function"?i:function(X){return X!==i};if(!M(r))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,E=[],b=r;M(b)&&a(b);){if((b=b.parentElement)===l){E.push(b);break}b!=null&&b===document.body&&T(b)&&!T(document.documentElement)||b!=null&&T(b,t)&&E.push(b)}for(var h=d.visualViewport?d.visualViewport.width:innerWidth,L=d.visualViewport?d.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,w=window.scrollY||pageYOffset,C=r.getBoundingClientRect(),x=C.height,_=C.width,j=C.top,N=C.right,P=C.bottom,V=C.left,z=p==="start"||p==="nearest"?j:p==="end"?P:j+x/2,B=m==="center"?V+_/2:m==="end"?N:V,K=[],U=0;U<E.length;U++){var W=E[U],H=W.getBoundingClientRect(),q=H.height,ne=H.width,te=H.top,_e=H.right,Ce=H.bottom,me=H.left;if(u==="if-needed"&&j>=0&&V>=0&&P<=L&&N<=h&&j>=te&&P<=Ce&&V>=me&&N<=_e)return K;var Me=getComputedStyle(W),Oe=parseInt(Me.borderLeftWidth,10),he=parseInt(Me.borderTopWidth,10),ce=parseInt(Me.borderRightWidth,10),se=parseInt(Me.borderBottomWidth,10),Te=0,re=0,ue="offsetWidth"in W?W.offsetWidth-W.clientWidth-Oe-ce:0,fe="offsetHeight"in W?W.offsetHeight-W.clientHeight-he-se:0;if(l===W)Te=p==="start"?z:p==="end"?z-L:p==="nearest"?D(w,w+L,L,he,se,w+z,w+z+x,x):z-L/2,re=m==="start"?B:m==="center"?B-h/2:m==="end"?B-h:D(O,O+h,h,Oe,ce,O+B,O+B+_,_),Te=Math.max(0,Te+w),re=Math.max(0,re+O);else{Te=p==="start"?z-te-he:p==="end"?z-Ce+se+fe:p==="nearest"?D(te,Ce,q,he,se+fe,z,z+x,x):z-(te+q/2)+fe/2,re=m==="start"?B-me-Oe:m==="center"?B-(me+ne/2)+ue/2:m==="end"?B-_e+ce+ue:D(me,_e,ne,Oe,ce+ue,B,B+_,_);var ee=W.scrollLeft,Q=W.scrollTop;z+=Q-(Te=Math.max(0,Math.min(Q+Te,W.scrollHeight-q+fe))),B+=ee-(re=Math.max(0,Math.min(ee+re,W.scrollWidth-ne+ue)))}K.push({el:W,top:Te,left:re})}return K};function f(r){return r===Object(r)&&Object.keys(r).length!==0}function S(r,s){s===void 0&&(s="auto");var d="scrollBehavior"in document.body.style;r.forEach(function(u){var p=u.el,m=u.top,i=u.left;p.scroll&&d?p.scroll({top:m,left:i,behavior:s}):(p.scrollTop=m,p.scrollLeft=i)})}function y(r){return r===!1?{block:"end",inline:"nearest"}:f(r)?r:{block:"start",inline:"nearest"}}function c(r,s){var d=!r.ownerDocument.documentElement.contains(r);if(f(s)&&typeof s.behavior=="function")return s.behavior(d?[]:v(r,s));if(d)return;var u=y(s);return S(v(r,u),u.behavior)}var o=$.a=c},Zss7:function(I,$,R){var M;(function(g){var T=/^\s+/,D=/\s+$/,v=0,f=g.round,S=g.min,y=g.max,c=g.random;function o(se,Te){if(se=se||"",Te=Te||{},se instanceof o)return se;if(!(this instanceof o))return new o(se,Te);var re=r(se);this._originalInput=se,this._r=re.r,this._g=re.g,this._b=re.b,this._a=re.a,this._roundA=f(100*this._a)/100,this._format=Te.format||re.format,this._gradientType=Te.gradientType,this._r<1&&(this._r=f(this._r)),this._g<1&&(this._g=f(this._g)),this._b<1&&(this._b=f(this._b)),this._ok=re.ok,this._tc_id=v++}o.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 se=this.toRgb();return(se.r*299+se.g*587+se.b*114)/1e3},getLuminance:function(){var se=this.toRgb(),Te,re,ue,fe,ee,Q;return Te=se.r/255,re=se.g/255,ue=se.b/255,Te<=.03928?fe=Te/12.92:fe=g.pow((Te+.055)/1.055,2.4),re<=.03928?ee=re/12.92:ee=g.pow((re+.055)/1.055,2.4),ue<=.03928?Q=ue/12.92:Q=g.pow((ue+.055)/1.055,2.4),.2126*fe+.7152*ee+.0722*Q},setAlpha:function(se){return this._a=K(se),this._roundA=f(100*this._a)/100,this},toHsv:function(){var se=p(this._r,this._g,this._b);return{h:se.h*360,s:se.s,v:se.v,a:this._a}},toHsvString:function(){var se=p(this._r,this._g,this._b),Te=f(se.h*360),re=f(se.s*100),ue=f(se.v*100);return this._a==1?"hsv("+Te+", "+re+"%, "+ue+"%)":"hsva("+Te+", "+re+"%, "+ue+"%, "+this._roundA+")"},toHsl:function(){var se=d(this._r,this._g,this._b);return{h:se.h*360,s:se.s,l:se.l,a:this._a}},toHslString:function(){var se=d(this._r,this._g,this._b),Te=f(se.h*360),re=f(se.s*100),ue=f(se.l*100);return this._a==1?"hsl("+Te+", "+re+"%, "+ue+"%)":"hsla("+Te+", "+re+"%, "+ue+"%, "+this._roundA+")"},toHex:function(se){return i(this._r,this._g,this._b,se)},toHexString:function(se){return"#"+this.toHex(se)},toHex8:function(se){return t(this._r,this._g,this._b,this._a,se)},toHex8String:function(se){return"#"+this.toHex8(se)},toRgb:function(){return{r:f(this._r),g:f(this._g),b:f(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+f(this._r)+", "+f(this._g)+", "+f(this._b)+")":"rgba("+f(this._r)+", "+f(this._g)+", "+f(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:f(U(this._r,255)*100)+"%",g:f(U(this._g,255)*100)+"%",b:f(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+f(U(this._r,255)*100)+"%, "+f(U(this._g,255)*100)+"%, "+f(U(this._b,255)*100)+"%)":"rgba("+f(U(this._r,255)*100)+"%, "+f(U(this._g,255)*100)+"%, "+f(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:z[i(this._r,this._g,this._b,!0)]||!1},toFilter:function(se){var Te="#"+a(this._r,this._g,this._b,this._a),re=Te,ue=this._gradientType?"GradientType = 1, ":"";if(se){var fe=o(se);re="#"+a(fe._r,fe._g,fe._b,fe._a)}return"progid:DXImageTransform.Microsoft.gradient("+ue+"startColorstr="+Te+",endColorstr="+re+")"},toString:function(se){var Te=!!se;se=se||this._format;var re=!1,ue=this._a<1&&this._a>=0,fe=!Te&&ue&&(se==="hex"||se==="hex6"||se==="hex3"||se==="hex4"||se==="hex8"||se==="name");return fe?se==="name"&&this._a===0?this.toName():this.toRgbString():(se==="rgb"&&(re=this.toRgbString()),se==="prgb"&&(re=this.toPercentageRgbString()),(se==="hex"||se==="hex6")&&(re=this.toHexString()),se==="hex3"&&(re=this.toHexString(!0)),se==="hex4"&&(re=this.toHex8String(!0)),se==="hex8"&&(re=this.toHex8String()),se==="name"&&(re=this.toName()),se==="hsl"&&(re=this.toHslString()),se==="hsv"&&(re=this.toHsvString()),re||this.toHexString())},clone:function(){return o(this.toString())},_applyModification:function(se,Te){var re=se.apply(null,[this].concat([].slice.call(Te)));return this._r=re._r,this._g=re._g,this._b=re._b,this.setAlpha(re._a),this},lighten:function(){return this._applyModification(h,arguments)},brighten:function(){return this._applyModification(L,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(E,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(se,Te){return se.apply(null,[this].concat([].slice.call(Te)))},analogous:function(){return this._applyCombination(N,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(j,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},o.fromRatio=function(se,Te){if(typeof se=="object"){var re={};for(var ue in se)se.hasOwnProperty(ue)&&(ue==="a"?re[ue]=se[ue]:re[ue]=_e(se[ue]));se=re}return o(se,Te)};function r(se){var Te={r:0,g:0,b:0},re=1,ue=null,fe=null,ee=null,Q=!1,X=!1;return typeof se=="string"&&(se=he(se)),typeof se=="object"&&(Oe(se.r)&&Oe(se.g)&&Oe(se.b)?(Te=s(se.r,se.g,se.b),Q=!0,X=String(se.r).substr(-1)==="%"?"prgb":"rgb"):Oe(se.h)&&Oe(se.s)&&Oe(se.v)?(ue=_e(se.s),fe=_e(se.v),Te=m(se.h,ue,fe),Q=!0,X="hsv"):Oe(se.h)&&Oe(se.s)&&Oe(se.l)&&(ue=_e(se.s),ee=_e(se.l),Te=u(se.h,ue,ee),Q=!0,X="hsl"),se.hasOwnProperty("a")&&(re=se.a)),re=K(re),{ok:Q,format:se.format||X,r:S(255,y(Te.r,0)),g:S(255,y(Te.g,0)),b:S(255,y(Te.b,0)),a:re}}function s(se,Te,re){return{r:U(se,255)*255,g:U(Te,255)*255,b:U(re,255)*255}}function d(se,Te,re){se=U(se,255),Te=U(Te,255),re=U(re,255);var ue=y(se,Te,re),fe=S(se,Te,re),ee,Q,X=(ue+fe)/2;if(ue==fe)ee=Q=0;else{var Z=ue-fe;Q=X>.5?Z/(2-ue-fe):Z/(ue+fe);switch(ue){case se:ee=(Te-re)/Z+(Te<re?6:0);break;case Te:ee=(re-se)/Z+2;break;case re:ee=(se-Te)/Z+4;break}ee/=6}return{h:ee,s:Q,l:X}}function u(se,Te,re){var ue,fe,ee;se=U(se,360),Te=U(Te,100),re=U(re,100);function Q(ve,ye,Re){return Re<0&&(Re+=1),Re>1&&(Re-=1),Re<1/6?ve+(ye-ve)*6*Re:Re<1/2?ye:Re<2/3?ve+(ye-ve)*(2/3-Re)*6:ve}if(Te===0)ue=fe=ee=re;else{var X=re<.5?re*(1+Te):re+Te-re*Te,Z=2*re-X;ue=Q(Z,X,se+1/3),fe=Q(Z,X,se),ee=Q(Z,X,se-1/3)}return{r:ue*255,g:fe*255,b:ee*255}}function p(se,Te,re){se=U(se,255),Te=U(Te,255),re=U(re,255);var ue=y(se,Te,re),fe=S(se,Te,re),ee,Q,X=ue,Z=ue-fe;if(Q=ue===0?0:Z/ue,ue==fe)ee=0;else{switch(ue){case se:ee=(Te-re)/Z+(Te<re?6:0);break;case Te:ee=(re-se)/Z+2;break;case re:ee=(se-Te)/Z+4;break}ee/=6}return{h:ee,s:Q,v:X}}function m(se,Te,re){se=U(se,360)*6,Te=U(Te,100),re=U(re,100);var ue=g.floor(se),fe=se-ue,ee=re*(1-Te),Q=re*(1-fe*Te),X=re*(1-(1-fe)*Te),Z=ue%6,ve=[re,Q,ee,ee,X,re][Z],ye=[X,re,re,Q,ee,ee][Z],Re=[ee,ee,X,re,re,Q][Z];return{r:ve*255,g:ye*255,b:Re*255}}function i(se,Te,re,ue){var fe=[te(f(se).toString(16)),te(f(Te).toString(16)),te(f(re).toString(16))];return ue&&fe[0].charAt(0)==fe[0].charAt(1)&&fe[1].charAt(0)==fe[1].charAt(1)&&fe[2].charAt(0)==fe[2].charAt(1)?fe[0].charAt(0)+fe[1].charAt(0)+fe[2].charAt(0):fe.join("")}function t(se,Te,re,ue,fe){var ee=[te(f(se).toString(16)),te(f(Te).toString(16)),te(f(re).toString(16)),te(Ce(ue))];return fe&&ee[0].charAt(0)==ee[0].charAt(1)&&ee[1].charAt(0)==ee[1].charAt(1)&&ee[2].charAt(0)==ee[2].charAt(1)&&ee[3].charAt(0)==ee[3].charAt(1)?ee[0].charAt(0)+ee[1].charAt(0)+ee[2].charAt(0)+ee[3].charAt(0):ee.join("")}function a(se,Te,re,ue){var fe=[te(Ce(ue)),te(f(se).toString(16)),te(f(Te).toString(16)),te(f(re).toString(16))];return fe.join("")}o.equals=function(se,Te){return!se||!Te?!1:o(se).toRgbString()==o(Te).toRgbString()},o.random=function(){return o.fromRatio({r:c(),g:c(),b:c()})};function l(se,Te){Te=Te===0?0:Te||10;var re=o(se).toHsl();return re.s-=Te/100,re.s=W(re.s),o(re)}function E(se,Te){Te=Te===0?0:Te||10;var re=o(se).toHsl();return re.s+=Te/100,re.s=W(re.s),o(re)}function b(se){return o(se).desaturate(100)}function h(se,Te){Te=Te===0?0:Te||10;var re=o(se).toHsl();return re.l+=Te/100,re.l=W(re.l),o(re)}function L(se,Te){Te=Te===0?0:Te||10;var re=o(se).toRgb();return re.r=y(0,S(255,re.r-f(255*-(Te/100)))),re.g=y(0,S(255,re.g-f(255*-(Te/100)))),re.b=y(0,S(255,re.b-f(255*-(Te/100)))),o(re)}function O(se,Te){Te=Te===0?0:Te||10;var re=o(se).toHsl();return re.l-=Te/100,re.l=W(re.l),o(re)}function w(se,Te){var re=o(se).toHsl(),ue=(re.h+Te)%360;return re.h=ue<0?360+ue:ue,o(re)}function C(se){var Te=o(se).toHsl();return Te.h=(Te.h+180)%360,o(Te)}function x(se){var Te=o(se).toHsl(),re=Te.h;return[o(se),o({h:(re+120)%360,s:Te.s,l:Te.l}),o({h:(re+240)%360,s:Te.s,l:Te.l})]}function _(se){var Te=o(se).toHsl(),re=Te.h;return[o(se),o({h:(re+90)%360,s:Te.s,l:Te.l}),o({h:(re+180)%360,s:Te.s,l:Te.l}),o({h:(re+270)%360,s:Te.s,l:Te.l})]}function j(se){var Te=o(se).toHsl(),re=Te.h;return[o(se),o({h:(re+72)%360,s:Te.s,l:Te.l}),o({h:(re+216)%360,s:Te.s,l:Te.l})]}function N(se,Te,re){Te=Te||6,re=re||30;var ue=o(se).toHsl(),fe=360/re,ee=[o(se)];for(ue.h=(ue.h-(fe*Te>>1)+720)%360;--Te;)ue.h=(ue.h+fe)%360,ee.push(o(ue));return ee}function P(se,Te){Te=Te||6;for(var re=o(se).toHsv(),ue=re.h,fe=re.s,ee=re.v,Q=[],X=1/Te;Te--;)Q.push(o({h:ue,s:fe,v:ee})),ee=(ee+X)%1;return Q}o.mix=function(se,Te,re){re=re===0?0:re||50;var ue=o(se).toRgb(),fe=o(Te).toRgb(),ee=re/100,Q={r:(fe.r-ue.r)*ee+ue.r,g:(fe.g-ue.g)*ee+ue.g,b:(fe.b-ue.b)*ee+ue.b,a:(fe.a-ue.a)*ee+ue.a};return o(Q)},o.readability=function(se,Te){var re=o(se),ue=o(Te);return(g.max(re.getLuminance(),ue.getLuminance())+.05)/(g.min(re.getLuminance(),ue.getLuminance())+.05)},o.isReadable=function(se,Te,re){var ue=o.readability(se,Te),fe,ee;ee=!1,fe=ce(re);switch(fe.level+fe.size){case"AAsmall":case"AAAlarge":ee=ue>=4.5;break;case"AAlarge":ee=ue>=3;break;case"AAAsmall":ee=ue>=7;break}return ee},o.mostReadable=function(se,Te,re){var ue=null,fe=0,ee,Q,X,Z;re=re||{},Q=re.includeFallbackColors,X=re.level,Z=re.size;for(var ve=0;ve<Te.length;ve++)ee=o.readability(se,Te[ve]),ee>fe&&(fe=ee,ue=o(Te[ve]));return o.isReadable(se,ue,{level:X,size:Z})||!Q?ue:(re.includeFallbackColors=!1,o.mostReadable(se,["#fff","#000"],re))};var V=o.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=o.hexNames=B(V);function B(se){var Te={};for(var re in se)se.hasOwnProperty(re)&&(Te[se[re]]=re);return Te}function K(se){return se=parseFloat(se),(isNaN(se)||se<0||se>1)&&(se=1),se}function U(se,Te){q(se)&&(se="100%");var re=ne(se);return se=S(Te,y(0,parseFloat(se))),re&&(se=parseInt(se*Te,10)/100),g.abs(se-Te)<1e-6?1:se%Te/parseFloat(Te)}function W(se){return S(1,y(0,se))}function H(se){return parseInt(se,16)}function q(se){return typeof se=="string"&&se.indexOf(".")!=-1&&parseFloat(se)===1}function ne(se){return typeof se=="string"&&se.indexOf("%")!=-1}function te(se){return se.length==1?"0"+se:""+se}function _e(se){return se<=1&&(se=se*100+"%"),se}function Ce(se){return g.round(parseFloat(se)*255).toString(16)}function me(se){return H(se)/255}var Me=function(){var se="[-\\+]?\\d+%?",Te="[-\\+]?\\d*\\.\\d+%?",re="(?:"+Te+")|(?:"+se+")",ue="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?",fe="[\\s|\\(]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")[,|\\s]+("+re+")\\s*\\)?";return{CSS_UNIT:new RegExp(re),rgb:new RegExp("rgb"+ue),rgba:new RegExp("rgba"+fe),hsl:new RegExp("hsl"+ue),hsla:new RegExp("hsla"+fe),hsv:new RegExp("hsv"+ue),hsva:new RegExp("hsva"+fe),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 Oe(se){return!!Me.CSS_UNIT.exec(se)}function he(se){se=se.replace(T,"").replace(D,"").toLowerCase();var Te=!1;if(V[se])se=V[se],Te=!0;else if(se=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var re;return(re=Me.rgb.exec(se))?{r:re[1],g:re[2],b:re[3]}:(re=Me.rgba.exec(se))?{r:re[1],g:re[2],b:re[3],a:re[4]}:(re=Me.hsl.exec(se))?{h:re[1],s:re[2],l:re[3]}:(re=Me.hsla.exec(se))?{h:re[1],s:re[2],l:re[3],a:re[4]}:(re=Me.hsv.exec(se))?{h:re[1],s:re[2],v:re[3]}:(re=Me.hsva.exec(se))?{h:re[1],s:re[2],v:re[3],a:re[4]}:(re=Me.hex8.exec(se))?{r:H(re[1]),g:H(re[2]),b:H(re[3]),a:me(re[4]),format:Te?"name":"hex8"}:(re=Me.hex6.exec(se))?{r:H(re[1]),g:H(re[2]),b:H(re[3]),format:Te?"name":"hex"}:(re=Me.hex4.exec(se))?{r:H(re[1]+""+re[1]),g:H(re[2]+""+re[2]),b:H(re[3]+""+re[3]),a:me(re[4]+""+re[4]),format:Te?"name":"hex8"}:(re=Me.hex3.exec(se))?{r:H(re[1]+""+re[1]),g:H(re[2]+""+re[2]),b:H(re[3]+""+re[3]),format:Te?"name":"hex"}:!1}function ce(se){var Te,re;return se=se||{level:"AA",size:"small"},Te=(se.level||"AA").toUpperCase(),re=(se.size||"small").toLowerCase(),Te!=="AA"&&Te!=="AAA"&&(Te="AA"),re!=="small"&&re!=="large"&&(re="small"),{level:Te,size:re}}I.exports?I.exports=o:!(M=function(){return o}.call($,R,$,I),M!==void 0&&(I.exports=M))})(Math)},bCnd:function(I,$,R){"use strict";R.d($,"b",function(){return D}),R.d($,"a",function(){return v});var M=R("je13"),g=R.n(M),T=!1;function D(f,S){var y=g.a.get("__ec");y||(y={}),y[f]=S,g.a.set("__ec",y)}function v(f,S){var y=g.a.get("__ec");return y?y[f]===void 0?S:y[f]:S}},bQjk:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return function(g){var T=M,D=T.lib,v=D.CipherParams,f=T.enc,S=f.Hex,y=T.format,c=y.Hex={stringify:function(o){return o.ciphertext.toString(S)},parse:function(o){var r=S.parse(o);return v.create({ciphertext:r})}}}(),M.format.Hex})},bT9E:function(I,$,R){"use strict";R.d($,"a",function(){return g});var M=R("VTBJ");function g(T,D){var v=Object(M.a)({},T);return Array.isArray(D)&&D.forEach(function(f){delete v[f]}),v}},biw7:function(I,$,R){"use strict";var M=R("q1tI"),g=R.n(M),T=M.createContext(null);$.a=T},c5Ni:function(I,$,R){},cDPC:function(I,$,R){"use strict";var M=R("tJVT"),g=R("q1tI"),T=R.n(g),D=R("i3hx"),v=R.n(D);$.a=function(f){var S=f.defaultX,y=S===void 0?"40%":S,c=f.leftChild,o=f.rightChild,r=f.className,s=f.hideResize,d=s===void 0?!1:s,u=Object(g.useState)(y),p=Object(M.a)(u,2),m=p[0],i=p[1],t=Object(g.useRef)();function a(){t.current=!0}Object(g.useEffect)(function(){function b(L){t.current&&i(L.pageX)}function h(){t.current=!1}return window.addEventListener("mousemove",b),window.addEventListener("mouseup",h),function(){window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",h)}},[]);var l=typeof m=="number"&&m!==.01?"".concat(m,"px"):y,E="calc(100% - ".concat(d?"0px":"4px"," - ").concat(l,")");return T.a.createElement("div",{className:"split-panel-container ".concat(r)},T.a.createElement("section",{style:{width:l,display:m===.01?"none":""}},c),T.a.createElement("section",{className:"resize-x-bar",onMouseDown:a},T.a.createElement("a",{className:"btn-resize"},T.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},T.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"})))),T.a.createElement("section",{style:{width:E}},o))}},cv67:function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){return function(g){var T=M,D=T.lib,v=D.WordArray,f=D.Hasher,S=T.algo,y=[];(function(){for(var u=0;u<64;u++)y[u]=g.abs(g.sin(u+1))*4294967296|0})();var c=S.MD5=f.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(u,p){for(var m=0;m<16;m++){var i=p+m,t=u[i];u[i]=(t<<8|t>>>24)&16711935|(t<<24|t>>>8)&4278255360}var a=this._hash.words,l=u[p+0],E=u[p+1],b=u[p+2],h=u[p+3],L=u[p+4],O=u[p+5],w=u[p+6],C=u[p+7],x=u[p+8],_=u[p+9],j=u[p+10],N=u[p+11],P=u[p+12],V=u[p+13],z=u[p+14],B=u[p+15],K=a[0],U=a[1],W=a[2],H=a[3];K=o(K,U,W,H,l,7,y[0]),H=o(H,K,U,W,E,12,y[1]),W=o(W,H,K,U,b,17,y[2]),U=o(U,W,H,K,h,22,y[3]),K=o(K,U,W,H,L,7,y[4]),H=o(H,K,U,W,O,12,y[5]),W=o(W,H,K,U,w,17,y[6]),U=o(U,W,H,K,C,22,y[7]),K=o(K,U,W,H,x,7,y[8]),H=o(H,K,U,W,_,12,y[9]),W=o(W,H,K,U,j,17,y[10]),U=o(U,W,H,K,N,22,y[11]),K=o(K,U,W,H,P,7,y[12]),H=o(H,K,U,W,V,12,y[13]),W=o(W,H,K,U,z,17,y[14]),U=o(U,W,H,K,B,22,y[15]),K=r(K,U,W,H,E,5,y[16]),H=r(H,K,U,W,w,9,y[17]),W=r(W,H,K,U,N,14,y[18]),U=r(U,W,H,K,l,20,y[19]),K=r(K,U,W,H,O,5,y[20]),H=r(H,K,U,W,j,9,y[21]),W=r(W,H,K,U,B,14,y[22]),U=r(U,W,H,K,L,20,y[23]),K=r(K,U,W,H,_,5,y[24]),H=r(H,K,U,W,z,9,y[25]),W=r(W,H,K,U,h,14,y[26]),U=r(U,W,H,K,x,20,y[27]),K=r(K,U,W,H,V,5,y[28]),H=r(H,K,U,W,b,9,y[29]),W=r(W,H,K,U,C,14,y[30]),U=r(U,W,H,K,P,20,y[31]),K=s(K,U,W,H,O,4,y[32]),H=s(H,K,U,W,x,11,y[33]),W=s(W,H,K,U,N,16,y[34]),U=s(U,W,H,K,z,23,y[35]),K=s(K,U,W,H,E,4,y[36]),H=s(H,K,U,W,L,11,y[37]),W=s(W,H,K,U,C,16,y[38]),U=s(U,W,H,K,j,23,y[39]),K=s(K,U,W,H,V,4,y[40]),H=s(H,K,U,W,l,11,y[41]),W=s(W,H,K,U,h,16,y[42]),U=s(U,W,H,K,w,23,y[43]),K=s(K,U,W,H,_,4,y[44]),H=s(H,K,U,W,P,11,y[45]),W=s(W,H,K,U,B,16,y[46]),U=s(U,W,H,K,b,23,y[47]),K=d(K,U,W,H,l,6,y[48]),H=d(H,K,U,W,C,10,y[49]),W=d(W,H,K,U,z,15,y[50]),U=d(U,W,H,K,O,21,y[51]),K=d(K,U,W,H,P,6,y[52]),H=d(H,K,U,W,h,10,y[53]),W=d(W,H,K,U,j,15,y[54]),U=d(U,W,H,K,E,21,y[55]),K=d(K,U,W,H,x,6,y[56]),H=d(H,K,U,W,B,10,y[57]),W=d(W,H,K,U,w,15,y[58]),U=d(U,W,H,K,V,21,y[59]),K=d(K,U,W,H,L,6,y[60]),H=d(H,K,U,W,N,10,y[61]),W=d(W,H,K,U,b,15,y[62]),U=d(U,W,H,K,_,21,y[63]),a[0]=a[0]+K|0,a[1]=a[1]+U|0,a[2]=a[2]+W|0,a[3]=a[3]+H|0},_doFinalize:function(){var u=this._data,p=u.words,m=this._nDataBytes*8,i=u.sigBytes*8;p[i>>>5]|=128<<24-i%32;var t=g.floor(m/4294967296),a=m;p[(i+64>>>9<<4)+15]=(t<<8|t>>>24)&16711935|(t<<24|t>>>8)&4278255360,p[(i+64>>>9<<4)+14]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,u.sigBytes=(p.length+1)*4,this._process();for(var l=this._hash,E=l.words,b=0;b<4;b++){var h=E[b];E[b]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360}return l},clone:function(){var u=f.clone.call(this);return u._hash=this._hash.clone(),u}});function o(u,p,m,i,t,a,l){var E=u+(p&m|~p&i)+t+l;return(E<<a|E>>>32-a)+p}function r(u,p,m,i,t,a,l){var E=u+(p&i|m&~i)+t+l;return(E<<a|E>>>32-a)+p}function s(u,p,m,i,t,a,l){var E=u+(p^m^i)+t+l;return(E<<a|E>>>32-a)+p}function d(u,p,m,i,t,a,l){var E=u+(m^(p|~i))+t+l;return(E<<a|E>>>32-a)+p}T.MD5=f._createHelper(c),T.HmacMD5=f._createHmacHelper(c)}(Math),M.MD5})},dejd:function(I,$,R){},dmUQ:function(I,$,R){"use strict";var M=R("Ff2n"),g=R("rePB"),T=R("1OyB"),D=R("vuIU"),v=R("Ji7U"),f=R("md7G"),S=R("foSv"),y=R("q1tI"),c=R.n(y),o=R("TSYQ"),r=R.n(o),s=R("4IlW");function d(x,_){var j=Object.keys(x);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(x);_&&(N=N.filter(function(P){return Object.getOwnPropertyDescriptor(x,P).enumerable})),j.push.apply(j,N)}return j}function u(x){for(var _=1;_<arguments.length;_++){var j=arguments[_]!=null?arguments[_]:{};_%2?d(Object(j),!0).forEach(function(N){Object(g.a)(x,N,j[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(j)):d(Object(j)).forEach(function(N){Object.defineProperty(x,N,Object.getOwnPropertyDescriptor(j,N))})}return x}function p(x){var _=m();return function(){var N=Object(S.a)(x),P;if(_){var V=Object(S.a)(this).constructor;P=Reflect.construct(N,arguments,V)}else P=N.apply(this,arguments);return Object(f.a)(this,P)}}function m(){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(x){return!1}}function i(){}function t(x){x.preventDefault()}var a=function(_){return _.replace(/[^\w.-]+/g,"")},l=200,E=600,b=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,h=function(_){return _!=null},L=function(_,j){return j===_||typeof j=="number"&&typeof _=="number"&&isNaN(j)&&isNaN(_)},O=function(x){Object(v.a)(j,x);var _=p(j);function j(N){var P;Object(T.a)(this,j),P=_.call(this,N),P.onKeyDown=function(B){var K=P.props,U=K.onKeyDown,W=K.onPressEnter;if(B.keyCode===s.a.UP){var H=P.getRatio(B);P.up(B,H,null),P.stop()}else if(B.keyCode===s.a.DOWN){var q=P.getRatio(B);P.down(B,q,null),P.stop()}else B.keyCode===s.a.ENTER&&W&&W(B);if(P.recordCursorPosition(),P.lastKeyCode=B.keyCode,U){for(var ne=arguments.length,te=new Array(ne>1?ne-1:0),_e=1;_e<ne;_e++)te[_e-1]=arguments[_e];U.apply(void 0,[B].concat(te))}},P.onKeyUp=function(B){var K=P.props.onKeyUp;if(P.stop(),P.recordCursorPosition(),K){for(var U=arguments.length,W=new Array(U>1?U-1:0),H=1;H<U;H++)W[H-1]=arguments[H];K.apply(void 0,[B].concat(W))}},P.onChange=function(B){var K=P.props.onChange;P.state.focused&&(P.inputting=!0),P.rawInput=P.props.parser(P.getValueFromEvent(B)),P.setState({inputValue:P.rawInput}),K(P.toNumber(P.rawInput))},P.onMouseUp=function(){var B=P.props.onMouseUp;P.recordCursorPosition(),B&&B.apply(void 0,arguments)},P.onFocus=function(){var B;P.setState({focused:!0}),(B=P.props).onFocus.apply(B,arguments)},P.onBlur=function(){var B=P.props.onBlur;P.inputting=!1,P.setState({focused:!1});var K=P.getCurrentValidValue(P.state.inputValue),U=P.setValue(K,i);if(B){var W=P.input.value,H=P.getInputDisplayValue({focus:!1,value:U});P.input.value=H&&Number(H),B.apply(void 0,arguments),P.input.value=W}},P.getRatio=function(B){var K=1;return B.metaKey||B.ctrlKey?K=.1:B.shiftKey&&(K=10),K},P.getFullNum=function(B){return isNaN(B)?B:/e/i.test(String(B))?Number(B).toFixed(18).replace(/\.?0+$/,""):B},P.getPrecision=function(B){if(h(P.props.precision))return P.props.precision;var K=String(B);if(K.indexOf("e-")>=0)return parseInt(K.slice(K.indexOf("e-")+2),10);var U=0;return K.indexOf(".")>=0&&(U=K.length-K.indexOf(".")-1),U},P.getInputDisplayValue=function(B){var K=B||P.state,U=K.focused,W=K.inputValue,H=K.value,q;U?q=W:q=P.toPrecisionAsStep(H),q==null&&(q="");var ne=P.formatWrapper(q);return h(P.props.decimalSeparator)&&(ne=ne.toString().replace(".",P.props.decimalSeparator)),ne},P.recordCursorPosition=function(){try{P.cursorStart=P.input.selectionStart,P.cursorEnd=P.input.selectionEnd,P.currentValue=P.input.value,P.cursorBefore=P.input.value.substring(0,P.cursorStart),P.cursorAfter=P.input.value.substring(P.cursorEnd)}catch(B){}},P.restoreByAfter=function(B){if(B===void 0)return!1;var K=P.input.value,U=K.lastIndexOf(B);if(U===-1)return!1;var W=P.cursorBefore.length;return P.lastKeyCode===s.a.DELETE&&P.cursorBefore.charAt(W-1)===B[0]?(P.fixCaret(W,W),!0):U+B.length===K.length?(P.fixCaret(U,U),!0):!1},P.partRestoreByAfter=function(B){return B===void 0?!1:Array.prototype.some.call(B,function(K,U){var W=B.substring(U);return P.restoreByAfter(W)})},P.isNotCompleteNumber=function(B){return isNaN(B)||B===""||B===null||B&&B.toString().indexOf(".")===B.toString().length-1},P.stop=function(){P.autoStepTimer&&clearTimeout(P.autoStepTimer)},P.down=function(B,K,U){P.pressingUpOrDown=!0,P.step("down",B,K,U)},P.up=function(B,K,U){P.pressingUpOrDown=!0,P.step("up",B,K,U)},P.saveInput=function(B){P.input=B};var V=N.value;V===void 0&&(V=N.defaultValue),P.state={focused:N.autoFocus};var z=P.getValidValue(P.toNumber(V));return P.state=u(u({},P.state),{},{inputValue:P.toPrecisionAsStep(z),value:z}),P}return Object(D.a)(j,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(P){var V=this.props,z=V.value,B=V.onChange,K=V.max,U=V.min,W=this.state.focused;if(P){if(!L(P.value,z)||!L(P.max,K)||!L(P.min,U)){var H=W?z:this.getValidValue(z),q;this.pressingUpOrDown?q=H:this.inputting?q=this.rawInput:q=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:q})}var ne="value"in this.props?z:this.state.value;"max"in this.props&&P.max!==K&&typeof ne=="number"&&ne>K&&B&&B(K),"min"in this.props&&P.min!==U&&typeof ne=="number"&&ne<U&&B&&B(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var te=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===s.a.BACKSPACE?te=this.cursorStart-1:this.lastKeyCode===s.a.DELETE&&(te=this.cursorStart):te=this.input.value.length,this.fixCaret(te,te)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case s.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case s.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(_e){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(P){var V=P;return V===""?V="":this.isNotCompleteNumber(parseFloat(V))?V=this.state.value:V=this.getValidValue(V),this.toNumber(V)}},{key:"getValueFromEvent",value:function(P){var V=P.target.value.trim().replace(/。/g,".");return h(this.props.decimalSeparator)&&(V=V.replace(this.props.decimalSeparator,".")),V}},{key:"getValidValue",value:function(P){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,B=parseFloat(P);return isNaN(B)?P:(B<V&&(B=V),B>z&&(B=z),B)}},{key:"setValue",value:function(P,V){var z=this.props.precision,B=this.isNotCompleteNumber(parseFloat(P))?null:parseFloat(P),K=this.state.value,U=K===void 0?null:K,W=this.state.inputValue,H=W===void 0?null:W,q=typeof B=="number"?B.toFixed(z):"".concat(B),ne=B!==U||q!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},V)):this.setState({value:B,inputValue:this.toPrecisionAsStep(P)},V),ne&&this.props.onChange(B),B}},{key:"getMaxPrecision",value:function(P){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.props,B=z.precision,K=z.step;if(h(B))return B;var U=this.getPrecision(V),W=this.getPrecision(K),H=this.getPrecision(P);return P?Math.max(H,U+W):U+W}},{key:"getPrecisionFactor",value:function(P){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.getMaxPrecision(P,V);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(P){return this.props.formatter?this.props.formatter(P):P}},{key:"toPrecisionAsStep",value:function(P){if(this.isNotCompleteNumber(P)||P==="")return P;var V=Math.abs(this.getMaxPrecision(P));return isNaN(V)?P.toString():Number(P).toFixed(V)}},{key:"toNumber",value:function(P){var V=this.props.precision,z=this.state.focused,B=P&&P.length>16&&z;return this.isNotCompleteNumber(P)||B?P:h(V)?Math.round(P*Math.pow(10,V))/Math.pow(10,V):Number(P)}},{key:"upStep",value:function(P,V){var z=this.props.step,B=this.getPrecisionFactor(P,V),K=Math.abs(this.getMaxPrecision(P,V)),U=((B*P+B*z*V)/B).toFixed(K);return this.toNumber(U)}},{key:"downStep",value:function(P,V){var z=this.props.step,B=this.getPrecisionFactor(P,V),K=Math.abs(this.getMaxPrecision(P,V)),U=((B*P-B*z*V)/B).toFixed(K);return this.toNumber(U)}},{key:"step",value:function(P,V){var z=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,K=arguments.length>3?arguments[3]:void 0;this.stop(),V&&(V.persist(),V.preventDefault());var U=this.props;if(U.disabled)return;var W=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(W))return;var H=this["".concat(P,"Step")](W,B),q=H>U.max||H<U.min;if(H>U.max?H=U.max:H<U.min&&(H=U.min),this.setValue(H,null),this.setState({focused:!0},function(){z.pressingUpOrDown=!1}),q)return;this.autoStepTimer=setTimeout(function(){z[P](V,B,!0)},K?l:E)}},{key:"fixCaret",value:function(P,V){if(P===void 0||V===void 0||!this.input||!this.input.value)return;try{var z=this.input.selectionStart,B=this.input.selectionEnd;(P!==z||V!==B)&&this.input.setSelectionRange(P,V)}catch(K){}}},{key:"render",value:function(){var P,V=this.props,z=V.prefixCls,B=V.disabled,K=V.readOnly,U=V.useTouch,W=V.autoComplete,H=V.upHandler,q=V.downHandler,ne=V.className,te=V.max,_e=V.min,Ce=V.style,me=V.title,Me=V.onMouseEnter,Oe=V.onMouseLeave,he=V.onMouseOver,ce=V.onMouseOut,se=V.required,Te=V.onClick,re=V.tabIndex,ue=V.type,fe=V.placeholder,ee=V.id,Q=V.inputMode,X=V.pattern,Z=V.step,ve=V.maxLength,ye=V.autoFocus,Re=V.name,Je=V.onPaste,Ze=V.onInput,rt=Object(M.a)(V,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),tt=this.state,st=tt.value,ot=tt.focused,Fe=r()(z,(P={},Object(g.a)(P,ne,!!ne),Object(g.a)(P,"".concat(z,"-disabled"),B),Object(g.a)(P,"".concat(z,"-focused"),ot),P)),Ae={};Object.keys(rt).forEach(function(Ne){(Ne.substr(0,5)==="data-"||Ne.substr(0,5)==="aria-"||Ne==="role")&&(Ae[Ne]=rt[Ne])});var qe=!K&&!B,ut=this.getInputDisplayValue(null),$e=(st||st===0)&&(isNaN(st)||Number(st)>=te),nt=(st||st===0)&&(isNaN(st)||Number(st)<=_e),je=$e||B||K,De=nt||B||K,Pe=r()("".concat(z,"-handler"),"".concat(z,"-handler-up"),Object(g.a)({},"".concat(z,"-handler-up-disabled"),je)),xe=r()("".concat(z,"-handler"),"".concat(z,"-handler-down"),Object(g.a)({},"".concat(z,"-handler-down-disabled"),De)),Se=U?{onTouchStart:je?i:this.up,onTouchEnd:this.stop}:{onMouseDown:je?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Le=U?{onTouchStart:De?i:this.down,onTouchEnd:this.stop}:{onMouseDown:De?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return c.a.createElement("div",{className:Fe,style:Ce,title:me,onMouseEnter:Me,onMouseLeave:Oe,onMouseOver:he,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},c.a.createElement("div",{className:"".concat(z,"-handler-wrap")},c.a.createElement("span",Object.assign({unselectable:"on"},Se,{role:"button","aria-label":"Increase Value","aria-disabled":je,className:Pe}),H||c.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-up-inner"),onClick:t})),c.a.createElement("span",Object.assign({unselectable:"on"},Le,{role:"button","aria-label":"Decrease Value","aria-disabled":De,className:xe}),q||c.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-down-inner"),onClick:t}))),c.a.createElement("div",{className:"".concat(z,"-input-wrap")},c.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":_e,"aria-valuemax":te,"aria-valuenow":st,required:se,type:ue,placeholder:fe,onPaste:Je,onClick:Te,onMouseUp:this.onMouseUp,className:"".concat(z,"-input"),tabIndex:re,autoComplete:W,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:qe?this.onKeyDown:i,onKeyUp:qe?this.onKeyUp:i,autoFocus:ye,maxLength:ve,readOnly:K,disabled:B,max:te,min:_e,step:Z,name:Re,title:me,id:ee,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ut),pattern:X,inputMode:Q,onInput:Ze},Ae))))}}]),j}(c.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:b,min:-b,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:a,required:!1,autoComplete:"off"};var w=O,C=$.a=w},e7zE:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("3y9D"),R("WYAk"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.Base,v=T.WordArray,f=g.algo,S=f.SHA1,y=f.HMAC,c=f.PBKDF2=D.extend({cfg:D.extend({keySize:128/32,hasher:S,iterations:1}),init:function(o){this.cfg=this.cfg.extend(o)},compute:function(o,r){for(var s=this.cfg,d=y.create(s.hasher,o),u=v.create(),p=v.create([1]),m=u.words,i=p.words,t=s.keySize,a=s.iterations;m.length<t;){var l=d.update(r).finalize(p);d.reset();for(var E=l.words,b=E.length,h=l,L=1;L<a;L++){h=d.finalize(h),d.reset();for(var O=h.words,w=0;w<b;w++)E[w]^=O[w]}u.concat(l),i[0]++}return u.sigBytes=t*4,u}});g.PBKDF2=function(o,r,s){return c.create(s).compute(o,r)}}(),M.PBKDF2})},eRFJ:function(I,$,R){I.exports={header:"header___2DEfS",field:"field___2KFR1","oj-form-container":"oj-form-container___11-CJ","oj-left-panel":"oj-left-panel___2_COu","oj-form-info":"oj-form-info___3RmjJ",footer:"footer___13GF0",result:"result___2TPH2",passText:"passText___m4yU3",noPassText:"noPassText___bU8yW",pass:"pass___1qwzN",noPass:"noPass___35fR7","test-case-name":"test-case-name___JX6gg","btn-remove-case":"btn-remove-case___20q0s","icon-tag":"icon-tag___ahN2d",btn_back:"btn_back___2GR2u",testJi:"testJi___lY3ok",upBtn:"upBtn___14ov-","oj-problems":"oj-problems___3xexO",row:"row____2CFx",a:"a___1o_MZ",b:"b___2s_8T",inputTwo:"inputTwo___2QE50",inputOne:"inputOne___3VLjS",cusModal:"cusModal___3HaCu","oj-custom-large-spin":"oj-custom-large-spin___18Uw5",MdEditor:"MdEditor___2TQ6G"}},fcSX:function(I,$,R){"use strict";var M=R("Ff2n"),g=R("1OyB"),T=R("vuIU"),D=R("Ji7U"),v=R("md7G"),f=R("foSv"),S=R("1W/9"),y=R("q1tI"),c=R("rePB"),o=R("JX7q"),r=R("TSYQ"),s=R.n(r),d=R("qx4F"),u=R("4IlW");function p(B){return Array.isArray(B)?B:[B]}var m={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(m).filter(function(B){if(typeof document=="undefined")return!1;var K=document.getElementsByTagName("html")[0];return B in(K?K.style:{})})[0],t=m[i];function a(B,K,U,W){B.addEventListener?B.addEventListener(K,U,W):B.attachEvent&&B.attachEvent("on".concat(K),U)}function l(B,K,U,W){B.removeEventListener?B.removeEventListener(K,U,W):B.attachEvent&&B.detachEvent("on".concat(K),U)}function E(B,K){var U=typeof B=="function"?B(K):B;return Array.isArray(U)?U.length===2?U:[U[0],U[1]]:[U]}var b=function(K){return!isNaN(parseFloat(K))&&isFinite(K)},h=!(typeof window!="undefined"&&window.document&&window.document.createElement),L=function B(K,U,W,H){if(!U||U===document||U instanceof Document)return!1;if(U===K.parentNode)return!0;var q=Math.max(Math.abs(W),Math.abs(H))===Math.abs(H),ne=Math.max(Math.abs(W),Math.abs(H))===Math.abs(W),te=U.scrollHeight-U.clientHeight,_e=U.scrollWidth-U.clientWidth,Ce=document.defaultView.getComputedStyle(U),me=Ce.overflowY==="auto"||Ce.overflowY==="scroll",Me=Ce.overflowX==="auto"||Ce.overflowX==="scroll",Oe=te&&me,he=_e&&Me;return q&&(!Oe||Oe&&(U.scrollTop>=te&&H<0||U.scrollTop<=0&&H>0))||ne&&(!he||he&&(U.scrollLeft>=_e&&W<0||U.scrollLeft<=0&&W>0))?B(K,U.parentNode,W,H):!1};function O(B){var K=w();return function(){var W=Object(f.a)(B),H;if(K){var q=Object(f.a)(this).constructor;H=Reflect.construct(W,arguments,q)}else H=W.apply(this,arguments);return Object(v.a)(this,H)}}function w(){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(B){return!1}}var C={},x=function(B){Object(D.a)(U,B);var K=O(U);function U(W){var H;return Object(g.a)(this,U),H=K.call(this,W),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(q){if(q.touches.length>1)return;H.startPos={x:q.touches[0].clientX,y:q.touches[0].clientY}},H.removeMoveHandler=function(q){if(q.changedTouches.length>1)return;var ne=q.currentTarget,te=q.changedTouches[0].clientX-H.startPos.x,_e=q.changedTouches[0].clientY-H.startPos.y;(ne===H.maskDom||ne===H.handlerDom||ne===H.contentDom&&L(ne,q.target,te,_e))&&q.cancelable&&q.preventDefault()},H.transitionEnd=function(q){var ne=q.target;l(ne,t,H.transitionEnd),ne.style.transition=""},H.onKeyDown=function(q){if(q.keyCode===u.a.ESC){var ne=H.props.onClose;q.stopPropagation(),ne&&ne(q)}},H.onWrapperTransitionEnd=function(q){var ne=H.props,te=ne.open,_e=ne.afterVisibleChange;q.target===H.contentWrapper&&q.propertyName.match(/transform$/)&&(H.dom.style.transition="",!te&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),_e&&_e(!!te))},H.openLevelTransition=function(){var q=H.props,ne=q.open,te=q.width,_e=q.height,Ce=H.getHorizontalBoolAndPlacementName(),me=Ce.isHorizontal,Me=Ce.placementName,Oe=H.contentDom?H.contentDom.getBoundingClientRect()[me?"width":"height"]:0,he=(me?te:_e)||Oe;H.setLevelAndScrolling(ne,Me,he)},H.setLevelTransform=function(q,ne,te,_e){var Ce=H.props,me=Ce.placement,Me=Ce.levelMove,Oe=Ce.duration,he=Ce.ease,ce=Ce.showMask;H.levelDom.forEach(function(se){se.style.transition="transform ".concat(Oe," ").concat(he),a(se,t,H.transitionEnd);var Te=q?te:0;if(Me){var re=E(Me,{target:se,open:q});Te=q?re[0]:re[1]||0}var ue=typeof Te=="number"?"".concat(Te,"px"):Te,fe=me==="left"||me==="top"?ue:"-".concat(ue);fe=ce&&me==="right"&&_e?"calc(".concat(fe," + ").concat(_e,"px)"):fe,se.style.transform=Te?"".concat(ne,"(").concat(fe,")"):""})},H.setLevelAndScrolling=function(q,ne,te){var _e=H.props.onChange;if(!h){var Ce=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(d.a)(!0):0;H.setLevelTransform(q,ne,te,Ce),H.toggleScrollingToDrawerAndBody(Ce)}_e&&_e(q)},H.toggleScrollingToDrawerAndBody=function(q){var ne=H.props,te=ne.getOpenCount,_e=ne.getContainer,Ce=ne.showMask,me=ne.open,Me=_e&&_e(),Oe=te&&te();if(Me&&Me.parentNode===document.body&&Ce){var he=["touchstart"],ce=[document.body,H.maskDom,H.handlerDom,H.contentDom];me&&document.body.style.overflow!=="hidden"?(q&&H.addScrollingEffect(q),Oe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ce.forEach(function(se,Te){if(!se)return;a(se,he[Te]||"touchmove",Te?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(Oe||(document.body.style.overflow=""),document.body.style.touchAction="",q&&H.remScrollingEffect(q),ce.forEach(function(se,Te){if(!se)return;l(se,he[Te]||"touchmove",Te?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(q){var ne=H.props,te=ne.placement,_e=ne.duration,Ce=ne.ease,me=ne.getOpenCount,Me=ne.switchScrollingEffect,Oe=me&&me();Oe===1&&Me();var he="width ".concat(_e," ").concat(Ce),ce="transform ".concat(_e," ").concat(Ce);H.dom.style.transition="none";switch(te){case"right":H.dom.style.transform="translateX(-".concat(q,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(q,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ce,",").concat(he),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(q){var ne=H.props,te=ne.placement,_e=ne.duration,Ce=ne.ease,me=ne.getOpenCount,Me=ne.switchScrollingEffect,Oe=me&&me();Oe||Me(!0),i&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var he,ce="width ".concat(_e," ").concat(Ce),se="transform ".concat(_e," ").concat(Ce);switch(te){case"left":{H.dom.style.width="100%",ce="width 0s ".concat(Ce," ").concat(_e);break}case"right":{H.dom.style.transform="translateX(".concat(q,"px)"),H.dom.style.width="100%",ce="width 0s ".concat(Ce," ").concat(_e),H.maskDom&&(H.maskDom.style.left="-".concat(q,"px"),H.maskDom.style.width="calc(100% + ".concat(q,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(q,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",he="height 0s ".concat(Ce," ").concat(_e);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(se,",").concat(he?"".concat(he,","):"").concat(ce),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(C).some(function(q){return C[q]})},H.getLevelDom=function(q){var ne=q.level,te=q.getContainer;if(h)return;var _e=te&&te(),Ce=_e?_e.parentNode:null;if(H.levelDom=[],ne==="all"){var me=Ce?Array.prototype.slice.call(Ce.children):[];me.forEach(function(Me){Me.nodeName!=="SCRIPT"&&Me.nodeName!=="STYLE"&&Me.nodeName!=="LINK"&&Me!==_e&&H.levelDom.push(Me)})}else ne&&p(ne).forEach(function(Me){document.querySelectorAll(Me).forEach(function(Oe){H.levelDom.push(Oe)})})},H.getHorizontalBoolAndPlacementName=function(){var q=H.props.placement,ne=q==="left"||q==="right",te="translate".concat(ne?"X":"Y");return{isHorizontal:ne,placementName:te}},H.state={_self:Object(o.a)(H)},H}return Object(T.a)(U,[{key:"componentDidMount",value:function(){var H=this;if(!h){var q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return q=!0,null}}))}catch(me){}this.passive=q?{passive:!1}:!1}var ne=this.props,te=ne.open,_e=ne.getContainer,Ce=_e&&_e();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),te&&(Ce&&Ce.parentNode===document.body&&(C[this.drawerId]=te),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var q=this.props,ne=q.open,te=q.getContainer,_e=te&&te();ne!==H.open&&(ne&&this.domFocus(),_e&&_e.parentNode===document.body&&(C[this.drawerId]=!!ne),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,q=H.getOpenCount,ne=H.open,te=H.switchScrollingEffect,_e=typeof q=="function"&&q();delete C[this.drawerId],ne&&(this.setLevelTransform(!1),document.body.style.touchAction=""),_e||(document.body.style.overflow="",te(!0))}},{key:"render",value:function(){var H,q=this,ne=this.props,te=ne.className,_e=ne.children,Ce=ne.style,me=ne.width,Me=ne.height,Oe=ne.defaultOpen,he=ne.open,ce=ne.prefixCls,se=ne.placement,Te=ne.level,re=ne.levelMove,ue=ne.ease,fe=ne.duration,ee=ne.getContainer,Q=ne.handler,X=ne.onChange,Z=ne.afterVisibleChange,ve=ne.showMask,ye=ne.maskClosable,Re=ne.maskStyle,Je=ne.onClose,Ze=ne.onHandleClick,rt=ne.keyboard,tt=ne.getOpenCount,st=ne.switchScrollingEffect,ot=Object(M.a)(ne,["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"]),Fe=this.dom?he:!1,Ae=s()(ce,(H={},Object(c.a)(H,"".concat(ce,"-").concat(se),!0),Object(c.a)(H,"".concat(ce,"-open"),Fe),Object(c.a)(H,te||"",!!te),Object(c.a)(H,"no-mask",!ve),H)),qe=this.getHorizontalBoolAndPlacementName(),ut=qe.placementName,$e=se==="left"||se==="top"?"-100%":"100%",nt=Fe?"":"".concat(ut,"(").concat($e,")"),je=Q&&y.cloneElement(Q,{onClick:function(Pe){Q.props.onClick&&Q.props.onClick(),Ze&&Ze(Pe)},ref:function(Pe){q.handlerDom=Pe}});return y.createElement("div",Object.assign({},ot,{tabIndex:-1,className:Ae,style:Ce,ref:function(Pe){q.dom=Pe},onKeyDown:Fe&&rt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),ve&&y.createElement("div",{className:"".concat(ce,"-mask"),onClick:ye?Je:void 0,style:Re,ref:function(Pe){q.maskDom=Pe}}),y.createElement("div",{className:"".concat(ce,"-content-wrapper"),style:{transform:nt,msTransform:nt,width:b(me)?"".concat(me,"px"):me,height:b(Me)?"".concat(Me,"px"):Me},ref:function(Pe){q.contentWrapper=Pe}},y.createElement("div",{className:"".concat(ce,"-content"),ref:function(Pe){q.contentDom=Pe},onTouchStart:Fe&&ve?this.removeStartHandler:void 0,onTouchMove:Fe&&ve?this.removeMoveHandler:void 0},_e),je))}}],[{key:"getDerivedStateFromProps",value:function(H,q){var ne=q.prevProps,te=q._self,_e={prevProps:H};if(ne!==void 0){var Ce=H.placement,me=H.level;Ce!==ne.placement&&(te.contentDom=null),me!==ne.level&&te.getLevelDom(H)}return _e}}]),U}(y.Component);x.defaultProps={switchScrollingEffect:function(){}};var _=x;function j(B){var K=N();return function(){var W=Object(f.a)(B),H;if(K){var q=Object(f.a)(this).constructor;H=Reflect.construct(W,arguments,q)}else H=W.apply(this,arguments);return Object(v.a)(this,H)}}function N(){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(B){return!1}}var P=function(B){Object(D.a)(U,B);var K=j(U);function U(W){var H;Object(g.a)(this,U),H=K.call(this,W),H.onHandleClick=function(ne){var te=H.props,_e=te.onHandleClick,Ce=te.open;if(_e&&_e(ne),typeof Ce=="undefined"){var me=H.state.open;H.setState({open:!me})}},H.onClose=function(ne){var te=H.props,_e=te.onClose,Ce=te.open;_e&&_e(ne),typeof Ce=="undefined"&&H.setState({open:!1})};var q=typeof W.open!="undefined"?W.open:!!W.defaultOpen;return H.state={open:q},"onMaskClick"in W&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(T.a)(U,[{key:"render",value:function(){var H=this,q=this.props,ne=q.defaultOpen,te=q.getContainer,_e=q.wrapperClassName,Ce=q.forceRender,me=q.handler,Me=Object(M.a)(q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Oe=this.state.open;if(!te)return y.createElement("div",{className:_e,ref:function(se){H.dom=se}},y.createElement(_,Object.assign({},Me,{open:Oe,handler:me,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var he=!!me||Ce;return y.createElement(S.a,{visible:Oe,forceRender:he,getContainer:te,wrapperClassName:_e},function(ce){var se=ce.visible,Te=ce.afterClose,re=Object(M.a)(ce,["visible","afterClose"]);return y.createElement(_,Object.assign({},Me,re,{open:se!==void 0?se:Oe,afterVisibleChange:Te!==void 0?Te:Me.afterVisibleChange,handler:me,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,q){var ne=q.prevProps,te={prevProps:H};return typeof ne!="undefined"&&H.open!==ne.open&&(te.open=H.open),te}}]),U}(y.Component);P.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:y.createElement("div",{className:"drawer-handle"},y.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var V=P,z=$.a=V},fjLI:function(I,$,R){"use strict";R.d($,"e",function(){return o}),R.d($,"a",function(){return r}),R.d($,"c",function(){return s}),R.d($,"d",function(){return u}),R.d($,"b",function(){return p});var M=R("8HAY"),g=R("Cg/j"),T=R("T8No"),D=R("nnTU"),v=R("MI8n"),f=function(){var m=function(i,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,l){a.__proto__=l}||function(a,l){for(var E in l)l.hasOwnProperty(E)&&(a[E]=l[E])},m(i,t)};return function(i,t){m(i,t);function a(){this.constructor=i}i.prototype=t===null?Object.create(t):(a.prototype=t.prototype,new a)}}(),S=function(m,i,t,a){var l=arguments.length,E=l<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,t):a,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,i,t,a);else for(var h=m.length-1;h>=0;h--)(b=m[h])&&(E=(l<3?b(E):l>3?b(i,t,E):b(i,t))||E);return l>3&&E&&Object.defineProperty(i,t,E),E},y=function(m,i){return function(t,a){i(t,a,m)}},c=function(){for(var m=0,i=0,t=arguments.length;i<t;i++)m+=arguments[i].length;for(var a=Array(m),l=0,i=0;i<t;i++)for(var E=arguments[i],b=0,h=E.length;b<h;b++,l++)a[l]=E[b];return a};function o(m){return m.command!==void 0}var r=Object(g.c)("menuService"),s=new(function(){function m(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new v.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return m.prototype.addCommand=function(i){var t=this;return this._commands.set(i.id,i),this._onDidChangeMenu.fire(0),{dispose:function(){t._commands.delete(i.id)&&t._onDidChangeMenu.fire(0)}}},m.prototype.getCommand=function(i){return this._commands.get(i)},m.prototype.getCommands=function(){var i=new Map;return this._commands.forEach(function(t,a){return i.set(a,t)}),i},m.prototype.appendMenuItem=function(i,t){var a=this,l=this._menuItems.get(i);return l?l.push(t):(l=[t],this._menuItems.set(i,l)),this._onDidChangeMenu.fire(i),{dispose:function(){var E=l.indexOf(t);E>=0&&(l.splice(E,1),a._onDidChangeMenu.fire(i))}}},m.prototype.getMenuItems=function(i){var t=(this._menuItems.get(i)||[]).slice(0);return i===0&&this._appendImplicitItems(t),t},m.prototype._appendImplicitItems=function(i){for(var t=new Set,a=i.filter(function(O){return o(O)}),l=0,E=a;l<E.length;l++){var b=E[l],h=b.command,L=b.alt;t.add(h.id),L&&t.add(L.id)}this._commands.forEach(function(O,w){t.has(w)||i.push({command:O})})},m}()),d=function(m){f(i,m);function i(t,a,l){var E=m.call(this,t,a)||this;return E._commandService=l,E}return i.prototype.run=function(){for(var t,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return(t=this._commandService).executeCommand.apply(t,c([this.id],a))},i=S([y(2,D.b)],i),i}(M.a),u=function(m){f(i,m);function i(t){var a=this;return typeof t.title=="string"?a=m.call(this,"",t.title,"submenu")||this:a=m.call(this,"",t.title.value,"submenu")||this,a.item=t,a}return i}(M.a),p=function(m){f(i,m);function i(t,a,l,E,b){var h=this;return typeof t.title=="string"?h=m.call(this,t.id,t.title,b)||this:h=m.call(this,t.id,t.title.value,b)||this,h._cssClass=void 0,h._enabled=!t.precondition||E.contextMatchesRules(t.precondition),h._checked=Boolean(t.toggled&&E.contextMatchesRules(t.toggled)),h._options=l||{},h.item=t,h.alt=a?new i(a,void 0,h._options,E,b):void 0,h}return i.prototype.dispose=function(){this.alt&&this.alt.dispose(),m.prototype.dispose.call(this)},i.prototype.run=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var l=[];return this._options.arg&&(l=c(l,[this._options.arg])),this._options.shouldForwardArgs&&(l=c(l,t)),m.prototype.run.apply(this,l)},i=S([y(3,T.c),y(4,D.b)],i),i}(d)},fyJ8:function(I,$,R){"use strict";var M=R("rePB"),g=R("VTBJ"),T=R("Ff2n"),D=R("U8pU"),v=R("q1tI"),f=R.n(v),S=R("TSYQ"),y=R.n(S),c=R("c+Xe"),o=R("sR1s");function r(m){return m&&Object(D.a)(m)==="object"&&!Array.isArray(m)&&!v.isValidElement(m)}function s(m){return typeof m=="string"?!0:Object(c.c)(m)}function d(m,i){var t,a=m.prefixCls,l=m.className,E=m.record,b=m.index,h=m.dataIndex,L=m.render,O=m.children,w=m.component,C=w===void 0?"td":w,x=m.colSpan,_=m.rowSpan,j=m.fixLeft,N=m.fixRight,P=m.firstFixLeft,V=m.lastFixLeft,z=m.firstFixRight,B=m.lastFixRight,K=m.appendNode,U=m.additionalProps,W=U===void 0?{}:U,H=m.ellipsis,q=m.align,ne=m.rowType,te=m.isSticky,_e="".concat(a,"-cell"),Ce,me;if(O)me=O;else{var Me=Object(o.b)(E,h);if(me=Me,L){var Oe=L(Me,E,b);r(Oe)?(me=Oe.children,Ce=Oe.props):me=Oe}}Object(D.a)(me)==="object"&&!Array.isArray(me)&&!v.isValidElement(me)&&(me=null),H&&(V||z)&&(me=v.createElement("span",{className:"".concat(_e,"-content")},me));var he=Ce||{},ce=he.colSpan,se=he.rowSpan,Te=he.style,re=he.className,ue=Object(T.a)(he,["colSpan","rowSpan","style","className"]),fe=ce!==void 0?ce:x,ee=se!==void 0?se:_;if(fe===0||ee===0)return null;var Q={},X=typeof j=="number",Z=typeof N=="number";X&&(Q.position="sticky",Q.left=j),Z&&(Q.position="sticky",Q.right=N);var ve={};q&&(ve.textAlign=q);var ye,Re=H===!0?{showTitle:!0}:H;Re&&(Re.showTitle||ne==="header")&&(typeof me=="string"||typeof me=="number"?ye=me.toString():v.isValidElement(me)&&typeof me.props.children=="string"&&(ye=me.props.children));var Je=Object(g.a)(Object(g.a)(Object(g.a)({title:ye},ue),W),{},{colSpan:fe&&fe!==1?fe:null,rowSpan:ee&&ee!==1?ee:null,className:y()(_e,l,(t={},Object(M.a)(t,"".concat(_e,"-fix-left"),X),Object(M.a)(t,"".concat(_e,"-fix-left-first"),P),Object(M.a)(t,"".concat(_e,"-fix-left-last"),V),Object(M.a)(t,"".concat(_e,"-fix-right"),Z),Object(M.a)(t,"".concat(_e,"-fix-right-first"),z),Object(M.a)(t,"".concat(_e,"-fix-right-last"),B),Object(M.a)(t,"".concat(_e,"-ellipsis"),H),Object(M.a)(t,"".concat(_e,"-with-append"),K),Object(M.a)(t,"".concat(_e,"-fix-sticky"),(X||Z)&&te),t),W.className,re),style:Object(g.a)(Object(g.a)(Object(g.a)(Object(g.a)({},W.style),ve),Q),Te),ref:s(C)?i:null});return v.createElement(C,Object.assign({},Je),K,me)}var u=v.forwardRef(d);u.displayName="Cell";var p=v.memo(u,function(m,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,m.record):!1});$.a=p},gRFJ:function(I,$,R){I.exports=[R("rdUC"),R("ynwM"),R("RELg"),R("DlR+"),R("CrYA"),R("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($){var R=meta[$];return typeof R=="string"?R:"\\u"+("0000"+$.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+I+'"'}function str(I,$){var R,M,g,T,D=gap,v,f=$[I];f&&typeof f=="object"&&typeof f.toJSON=="function"&&(f=f.toJSON(I)),typeof rep=="function"&&(f=rep.call($,I,f));switch(typeof f){case"string":return quote(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(gap+=indent,v=[],Object.prototype.toString.apply(f)==="[object Array]"){for(T=f.length,R=0;R<T;R+=1)v[R]=str(R,f)||"null";return g=v.length===0?"[]":gap?`[
|
|
|
`+gap+v.join(`,
|
|
|
`+gap)+`
|
|
|
`+D+"]":"["+v.join(",")+"]",gap=D,g}if(rep&&typeof rep=="object")for(T=rep.length,R=0;R<T;R+=1)typeof rep[R]=="string"&&(M=rep[R],g=str(M,f),g&&v.push(quote(M)+(gap?": ":":")+g));else for(M in f)Object.prototype.hasOwnProperty.call(f,M)&&(g=str(M,f),g&&v.push(quote(M)+(gap?": ":":")+g));return g=v.length===0?"{}":gap?`{
|
|
|
`+gap+v.join(`,
|
|
|
`+gap)+`
|
|
|
`+D+"}":"{"+v.join(",")+"}",gap=D,g}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(I,$,R){var M;if(gap="",indent="",typeof R=="number")for(M=0;M<R;M+=1)indent+=" ";else typeof R=="string"&&(indent=R);if(rep=$,$&&typeof $!="function"&&(typeof $!="object"||typeof $.length!="number"))throw new Error("JSON.stringify");return str("",{"":I})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(I,$){var R,M,g=I[$];if(g&&typeof g=="object")for(R in g)Object.prototype.hasOwnProperty.call(g,R)&&(M=walk(g,R),M!==void 0?g[R]=M:delete g[R]);return reviver.call(I,$,g)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(I){return"\\u"+("0000"+I.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},"gb/T":function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.mode.ECB=function(){var g=M.lib.BlockCipherMode.extend();return g.Encryptor=g.extend({processBlock:function(T,D){this._cipher.encryptBlock(T,D)}}),g.Decryptor=g.extend({processBlock:function(T,D){this._cipher.decryptBlock(T,D)}}),g}(),M.mode.ECB})},h78n:function(I,$,R){"use strict";R.d($,"a",function(){return P});var M=R("q1tI"),g=R.n(M),T=R("TSYQ"),D=R.n(T),v={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},f=function(B){var K=B.map(function(){return Object(M.useRef)()}),U=Object(M.useRef)();return Object(M.useEffect)(function(){var W=Date.now(),H=!1;Object.keys(K).forEach(function(q){var ne=K[q].current;if(!ne)return;H=!0;var te=ne.style;te.transitionDuration=".3s, .3s, .3s, .06s",U.current&&W-U.current<100&&(te.transitionDuration="0s, 0s")}),H&&(U.current=Date.now())}),[K]};function S(){return S=Object.assign||function(z){for(var B=1;B<arguments.length;B++){var K=arguments[B];for(var U in K)Object.prototype.hasOwnProperty.call(K,U)&&(z[U]=K[U])}return z},S.apply(this,arguments)}function y(z,B){return d(z)||s(z,B)||o(z,B)||c()}function c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(z,B){if(!z)return;if(typeof z=="string")return r(z,B);var K=Object.prototype.toString.call(z).slice(8,-1);if(K==="Object"&&z.constructor&&(K=z.constructor.name),K==="Map"||K==="Set")return Array.from(z);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return r(z,B)}function r(z,B){(B==null||B>z.length)&&(B=z.length);for(var K=0,U=new Array(B);K<B;K++)U[K]=z[K];return U}function s(z,B){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(z)))return;var K=[],U=!0,W=!1,H=void 0;try{for(var q=z[Symbol.iterator](),ne;!(U=(ne=q.next()).done)&&!(K.push(ne.value),B&&K.length===B);U=!0);}catch(te){W=!0,H=te}finally{try{!U&&q.return!=null&&q.return()}finally{if(W)throw H}}return K}function d(z){if(Array.isArray(z))return z}function u(z,B){if(z==null)return{};var K=p(z,B),U,W;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(z);for(W=0;W<H.length;W++){if(U=H[W],B.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,U))continue;K[U]=z[U]}}return K}function p(z,B){if(z==null)return{};var K={},U=Object.keys(z),W,H;for(H=0;H<U.length;H++){if(W=U[H],B.indexOf(W)>=0)continue;K[W]=z[W]}return K}var m=function(B){var K=B.className,U=B.percent,W=B.prefixCls,H=B.strokeColor,q=B.strokeLinecap,ne=B.strokeWidth,te=B.style,_e=B.trailColor,Ce=B.trailWidth,me=B.transition,Me=u(B,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Me.gapPosition;var Oe=Array.isArray(U)?U:[U],he=Array.isArray(H)?H:[H],ce=f(Oe),se=y(ce,1),Te=se[0],re=ne/2,ue=100-ne/2,fe="M ".concat(q==="round"?re:0,",").concat(re,`
|
|
|
L `).concat(q==="round"?ue:100,",").concat(re),ee="0 0 100 ".concat(ne),Q=0;return g.a.createElement("svg",S({className:D()("".concat(W,"-line"),K),viewBox:ee,preserveAspectRatio:"none",style:te},Me),g.a.createElement("path",{className:"".concat(W,"-line-trail"),d:fe,strokeLinecap:q,stroke:_e,strokeWidth:Ce||ne,fillOpacity:"0"}),Oe.map(function(X,Z){var ve={strokeDasharray:"".concat(X,"px, 100px"),strokeDashoffset:"-".concat(Q,"px"),transition:me||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ye=he[Z]||he[he.length-1];return Q+=X,g.a.createElement("path",{key:Z,className:"".concat(W,"-line-path"),d:fe,strokeLinecap:q,stroke:ye,strokeWidth:ne,fillOpacity:"0",ref:Te[Z],style:ve})}))};m.defaultProps=v;var i=m;function t(){return t=Object.assign||function(z){for(var B=1;B<arguments.length;B++){var K=arguments[B];for(var U in K)Object.prototype.hasOwnProperty.call(K,U)&&(z[U]=K[U])}return z},t.apply(this,arguments)}function a(z,B){return L(z)||h(z,B)||E(z,B)||l()}function l(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E(z,B){if(!z)return;if(typeof z=="string")return b(z,B);var K=Object.prototype.toString.call(z).slice(8,-1);if(K==="Object"&&z.constructor&&(K=z.constructor.name),K==="Map"||K==="Set")return Array.from(z);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return b(z,B)}function b(z,B){(B==null||B>z.length)&&(B=z.length);for(var K=0,U=new Array(B);K<B;K++)U[K]=z[K];return U}function h(z,B){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(z)))return;var K=[],U=!0,W=!1,H=void 0;try{for(var q=z[Symbol.iterator](),ne;!(U=(ne=q.next()).done)&&!(K.push(ne.value),B&&K.length===B);U=!0);}catch(te){W=!0,H=te}finally{try{!U&&q.return!=null&&q.return()}finally{if(W)throw H}}return K}function L(z){if(Array.isArray(z))return z}function O(z,B){if(z==null)return{};var K=w(z,B),U,W;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(z);for(W=0;W<H.length;W++){if(U=H[W],B.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,U))continue;K[U]=z[U]}}return K}function w(z,B){if(z==null)return{};var K={},U=Object.keys(z),W,H;for(H=0;H<U.length;H++){if(W=U[H],B.indexOf(W)>=0)continue;K[W]=z[W]}return K}var C=0;function x(z){return+z.replace("%","")}function _(z){return Array.isArray(z)?z:[z]}function j(z,B,K,U){var W=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,q=50-U/2,ne=0,te=-q,_e=0,Ce=-2*q;switch(H){case"left":ne=-q,te=0,_e=2*q,Ce=0;break;case"right":ne=q,te=0,_e=-2*q,Ce=0;break;case"bottom":te=q,Ce=2*q;break;default:}var me="M 50,50 m ".concat(ne,",").concat(te,`
|
|
|
a `).concat(q,",").concat(q," 0 1 1 ").concat(_e,",").concat(-Ce,`
|
|
|
a `).concat(q,",").concat(q," 0 1 1 ").concat(-_e,",").concat(Ce),Me=Math.PI*2*q,Oe={stroke:K,strokeDasharray:"".concat(B/100*(Me-W),"px ").concat(Me,"px"),strokeDashoffset:"-".concat(W/2+z/100*(Me-W),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:me,pathStyle:Oe}}var N=function(B){var K=B.prefixCls,U=B.strokeWidth,W=B.trailWidth,H=B.gapDegree,q=B.gapPosition,ne=B.trailColor,te=B.strokeLinecap,_e=B.style,Ce=B.className,me=B.strokeColor,Me=B.percent,Oe=O(B,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),he=Object(M.useMemo)(function(){return C+=1,C},[]),ce=j(0,100,ne,U,H,q),se=ce.pathString,Te=ce.pathStyle,re=_(Me),ue=_(me),fe=ue.find(function(ve){return Object.prototype.toString.call(ve)==="[object Object]"}),ee=f(re),Q=a(ee,1),X=Q[0],Z=function(){var ye=0;return re.map(function(Re,Je){var Ze=ue[Je]||ue[ue.length-1],rt=Object.prototype.toString.call(Ze)==="[object Object]"?"url(#".concat(K,"-gradient-").concat(he,")"):"",tt=j(ye,Re,Ze,U,H,q);return ye+=Re,g.a.createElement("path",{key:Je,className:"".concat(K,"-circle-path"),d:tt.pathString,stroke:rt,strokeLinecap:te,strokeWidth:U,opacity:Re===0?0:1,fillOpacity:"0",style:tt.pathStyle,ref:X[Je]})})};return g.a.createElement("svg",t({className:D()("".concat(K,"-circle"),Ce),viewBox:"0 0 100 100",style:_e},Oe),fe&&g.a.createElement("defs",null,g.a.createElement("linearGradient",{id:"".concat(K,"-gradient-").concat(he),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(fe).sort(function(ve,ye){return x(ve)-x(ye)}).map(function(ve,ye){return g.a.createElement("stop",{key:ye,offset:ve,stopColor:fe[ve]})}))),g.a.createElement("path",{className:"".concat(K,"-circle-trail"),d:se,stroke:ne,strokeLinecap:te,strokeWidth:W||U,fillOpacity:"0",style:Te}),Z().reverse())};N.defaultProps=v;var P=N,V={Line:i,Circle:P}},hW8S:function(I,$,R){"use strict";R.d($,"a",function(){return D}),R.d($,"c",function(){return v}),R.d($,"b",function(){return f});var M=R("VTBJ"),g=R("Ff2n"),T=R("Kwbf"),D="RC_TABLE_INTERNAL_COL_DEFINE";function v(S){var y=S.expandable,c=Object(g.a)(S,["expandable"]);return"expandable"in S?Object(M.a)(Object(M.a)({},c),y):c}function f(S){return Object.keys(S).reduce(function(y,c){return(c.substr(0,5)==="data-"||c.substr(0,5)==="aria-")&&(y[c]=S[c]),y},{})}},i3hx:function(I,$,R){},jO9C:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.pad.Iso97971={pad:function(g,T){g.concat(M.lib.WordArray.create([2147483648],1)),M.pad.ZeroPadding.pad(g,T)},unpad:function(g){M.pad.ZeroPadding.unpad(g),g.sigBytes--}},M.pad.Iso97971})},je13:function(I,$,R){var M=R("5nXd"),g=R("gRFJ"),T=[R("uQRt")];I.exports=M.createStore(g,T)},k3GJ:function(I,$,R){"use strict";R.d($,"a",function(){return Dn});var M=R("rePB"),g=R("ODXe"),T=R("Ff2n"),D=R("VTBJ"),v=R("q1tI"),f=R("TSYQ"),S=R.n(f),y=R("Zm9Q"),c=R("6cGi"),o=R("KQm4"),r=R("xEkU"),s=R.n(r),d=R("t23M");function u(Ie){var Ge=Object(v.useRef)(),Qe=Object(v.useRef)(!1);function Ue(){for(var be=arguments.length,ke=new Array(be),we=0;we<be;we++)ke[we]=arguments[we];Qe.current||(s.a.cancel(Ge.current),Ge.current=s()(function(){Ie.apply(void 0,ke)}))}return Object(v.useEffect)(function(){return function(){Qe.current=!0,s.a.cancel(Ge.current)}},[]),Ue}function p(Ie){var Ge=Object(v.useRef)([]),Qe=Object(v.useState)({}),Ue=Object(g.a)(Qe,2),be=Ue[1],ke=Object(v.useRef)(typeof Ie=="function"?Ie():Ie),we=u(function(){var He=ke.current;Ge.current.forEach(function(Ye){He=Ye(He)}),Ge.current=[],ke.current=He,be({})});function Be(He){Ge.current.push(He),we()}return[ke.current,Be]}var m=R("4IlW");function i(Ie,Ge){var Qe,Ue=Ie.prefixCls,be=Ie.id,ke=Ie.active,we=Ie.rtl,Be=Ie.tab,He=Be.key,Ye=Be.tab,Ve=Be.disabled,it=Be.closeIcon,ht=Ie.tabBarGutter,Et=Ie.tabPosition,xt=Ie.closable,Lt=Ie.renderWrapper,Qt=Ie.removeAriaLabel,xr=Ie.editable,Cr=Ie.onClick,_r=Ie.onRemove,jr=Ie.onFocus,Lr="".concat(Ue,"-tab");v.useEffect(function(){return _r},[]);var Or={};Et==="top"||Et==="bottom"?Or[we?"marginLeft":"marginRight"]=ht:Or.marginBottom=ht;var Zr=xr&&xt!==!1&&!Ve;function Kr(or){if(Ve)return;Cr(or)}function kn(or){or.preventDefault(),or.stopPropagation(),xr.onEdit("remove",{key:He,event:or})}var Gr=v.createElement("div",{key:He,ref:Ge,className:S()(Lr,(Qe={},Object(M.a)(Qe,"".concat(Lr,"-with-remove"),Zr),Object(M.a)(Qe,"".concat(Lr,"-active"),ke),Object(M.a)(Qe,"".concat(Lr,"-disabled"),Ve),Qe)),style:Or,onClick:Kr},v.createElement("div",{role:"tab","aria-selected":ke,id:be&&"".concat(be,"-tab-").concat(He),className:"".concat(Lr,"-btn"),"aria-controls":be&&"".concat(be,"-panel-").concat(He),"aria-disabled":Ve,tabIndex:Ve?null:0,onClick:function(nr){nr.stopPropagation(),Kr(nr)},onKeyDown:function(nr){[m.a.SPACE,m.a.ENTER].includes(nr.which)&&(nr.preventDefault(),Kr(nr))},onFocus:jr},Ye),Zr&&v.createElement("button",{type:"button","aria-label":Qt||"remove",tabIndex:0,className:"".concat(Lr,"-remove"),onClick:function(nr){nr.stopPropagation(),kn(nr)}},it||xr.removeIcon||"\xD7"));return Lt&&(Gr=Lt(Gr)),Gr}var t=v.forwardRef(i),a={width:0,height:0,left:0,top:0};function l(Ie,Ge,Qe){return Object(v.useMemo)(function(){for(var Ue,be=new Map,ke=Ge.get((Ue=Ie[0])===null||Ue===void 0?void 0:Ue.key)||a,we=ke.left+ke.width,Be=0;Be<Ie.length;Be+=1){var He=Ie[Be].key,Ye=Ge.get(He);if(!Ye){var Ve;Ye=Ge.get((Ve=Ie[Be-1])===null||Ve===void 0?void 0:Ve.key)||a}var it=be.get(He)||Object(D.a)({},Ye);it.right=we-it.left-it.width,be.set(He,it)}return be},[Ie.map(function(Ue){return Ue.key}).join("_"),Ge,Qe])}var E={width:0,height:0,left:0,top:0,right:0};function b(Ie,Ge,Qe,Ue,be){var ke=be.tabs,we=be.tabPosition,Be=be.rtl,He,Ye,Ve;["top","bottom"].includes(we)?(He="width",Ye=Be?"right":"left",Ve=Math.abs(Ge.left)):(He="height",Ye="top",Ve=-Ge.top);var it=Ge[He],ht=Qe[He],Et=Ue[He],xt=it;return ht+Et>it&&(xt=it-Et),Object(v.useMemo)(function(){if(!ke.length)return[0,0];for(var Lt=ke.length,Qt=Lt,xr=0;xr<Lt;xr+=1){var Cr=Ie.get(ke[xr].key)||E;if(Cr[Ye]+Cr[He]>Ve+xt){Qt=xr-1;break}}for(var _r=0,jr=Lt-1;jr>=0;jr-=1){var Lr=Ie.get(ke[jr].key)||E;if(Lr[Ye]<Ve){_r=jr+1;break}}return[_r,Qt]},[Ie,Ve,xt,we,ke.map(function(Lt){return Lt.key}).join("_"),Be])}var h=R("wx14"),L=R("1OyB"),O=R("vuIU"),w=R("JX7q"),C=R("Ji7U"),x=R("LK+K"),_=R("I8Z2"),j=R("bT9E"),N=R("2GS6"),P=R("Gytx"),V=R.n(P),z=R("U8pU"),B=/iPhone/i,K=/iPod/i,U=/iPad/i,W=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,q=/\bAndroid(?:.+)SD4930UR\b/i,ne=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,te=/Windows Phone/i,_e=/\bWindows(?:.+)ARM\b/i,Ce=/BlackBerry/i,me=/BB10/i,Me=/Opera Mini/i,Oe=/\b(CriOS|Chrome)(?:.+)Mobile/i,he=/Mobile(?:.+)Firefox\b/i;function ce(Ie,Ge){return Ie.test(Ge)}function se(Ie){var Ge=Ie||(typeof navigator!="undefined"?navigator.userAgent:""),Qe=(Ge||"").split("[FBAN");if(typeof Qe[1]!="undefined"){var Ue=Qe,be=Object(g.a)(Ue,1);Ge=be[0]}if(Qe=Ge.split("Twitter"),typeof Qe[1]!="undefined"){var ke=Qe,we=Object(g.a)(ke,1);Ge=we[0]}var Be={apple:{phone:ce(B,Ge)&&!ce(te,Ge),ipod:ce(K,Ge),tablet:!ce(B,Ge)&&ce(U,Ge)&&!ce(te,Ge),device:(ce(B,Ge)||ce(K,Ge)||ce(U,Ge))&&!ce(te,Ge)},amazon:{phone:ce(q,Ge),tablet:!ce(q,Ge)&&ce(ne,Ge),device:ce(q,Ge)||ce(ne,Ge)},android:{phone:!ce(te,Ge)&&ce(q,Ge)||!ce(te,Ge)&&ce(W,Ge),tablet:!ce(te,Ge)&&!ce(q,Ge)&&!ce(W,Ge)&&(ce(ne,Ge)||ce(H,Ge)),device:!ce(te,Ge)&&(ce(q,Ge)||ce(ne,Ge)||ce(W,Ge)||ce(H,Ge))||ce(/\bokhttp\b/i,Ge)},windows:{phone:ce(te,Ge),tablet:ce(_e,Ge),device:ce(te,Ge)||ce(_e,Ge)},other:{blackberry:ce(Ce,Ge),blackberry10:ce(me,Ge),opera:ce(Me,Ge),firefox:ce(he,Ge),chrome:ce(Oe,Ge),device:ce(Ce,Ge)||ce(me,Ge)||ce(Me,Ge)||ce(he,Ge)||ce(Oe,Ge)},any:null,phone:null,tablet:null};return Be.any=Be.apple.device||Be.android.device||Be.windows.device||Be.other.device,Be.phone=Be.apple.phone||Be.android.phone||Be.windows.phone,Be.tablet=Be.apple.tablet||Be.android.tablet||Be.windows.tablet,Be}var Te=Object(D.a)(Object(D.a)({},se()),{},{isMobile:se}),re=Te;function ue(){}function fe(Ie,Ge,Qe){var Ue=Ge||"";return Ie.key||"".concat(Ue,"item_").concat(Qe)}function ee(Ie){return"".concat(Ie,"-menu-")}function Q(Ie,Ge){var Qe=-1;v.Children.forEach(Ie,function(Ue){Qe+=1,Ue&&Ue.type&&Ue.type.isMenuItemGroup?v.Children.forEach(Ue.props.children,function(be){Qe+=1,Ge(be,Qe)}):Ge(Ue,Qe)})}function X(Ie,Ge,Qe){if(!Ie||Qe.find)return;v.Children.forEach(Ie,function(Ue){if(Ue){var be=Ue.type;if(!be||!(be.isSubMenu||be.isMenuItem||be.isMenuItemGroup))return;Ge.indexOf(Ue.key)!==-1?Qe.find=!0:Ue.props.children&&X(Ue.props.children,Ge,Qe)}})}var Z=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],ve=function(Ge){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=Ge&&typeof Ge.getBoundingClientRect=="function"&&Ge.getBoundingClientRect().width;if(Ue){if(Qe){var be=getComputedStyle(Ge),ke=be.marginLeft,we=be.marginRight;Ue+=+ke.replace("px","")+ +we.replace("px","")}Ue=+Ue.toFixed(6)}return Ue||0},ye=function(Ge,Qe,Ue){Ge&&Object(z.a)(Ge.style)==="object"&&(Ge.style[Qe]=Ue)},Re=function(){return re.any},Je=R("bdgK"),Ze=R("i8i4"),rt=R.n(Ze),tt=R("wgJM"),st=R("l4aY"),ot=R("m+aA"),Fe=R("c+Xe"),Ae=R("zT1h"),qe=R("QC+M");function ut(Ie,Ge,Qe){return Qe?Ie[0]===Ge[0]:Ie[0]===Ge[0]&&Ie[1]===Ge[1]}function $e(Ie,Ge,Qe){var Ue=Ie[Ge]||{};return Object(D.a)(Object(D.a)({},Ue),Qe)}function nt(Ie,Ge,Qe,Ue){for(var be=Qe.points,ke=Object.keys(Ie),we=0;we<ke.length;we+=1){var Be=ke[we];if(ut(Ie[Be].points,be,Ue))return"".concat(Ge,"-placement-").concat(Be)}return""}var je=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ie=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ie)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ie==null?void 0:Ie.substr(0,4)))},De=R("MNnm");function Pe(Ie,Ge){var Qe={};return Qe[Ie.toLowerCase()]=Ge.toLowerCase(),Qe["Webkit".concat(Ie)]="webkit".concat(Ge),Qe["Moz".concat(Ie)]="moz".concat(Ge),Qe["ms".concat(Ie)]="MS".concat(Ge),Qe["O".concat(Ie)]="o".concat(Ge.toLowerCase()),Qe}function xe(Ie,Ge){var Qe={animationend:Pe("Animation","AnimationEnd"),transitionend:Pe("Transition","TransitionEnd")};return Ie&&("AnimationEvent"in Ge||delete Qe.animationend.animation,"TransitionEvent"in Ge||delete Qe.transitionend.transition),Qe}var Se=xe(Object(De.a)(),typeof window!="undefined"?window:{}),Le={};if(Object(De.a)()){var Ne=document.createElement("div");Le=Ne.style}var et={};function Xe(Ie){if(et[Ie])return et[Ie];var Ge=Se[Ie];if(Ge)for(var Qe=Object.keys(Ge),Ue=Qe.length,be=0;be<Ue;be+=1){var ke=Qe[be];if(Object.prototype.hasOwnProperty.call(Ge,ke)&&ke in Le)return et[Ie]=Ge[ke],et[Ie]}return""}var ct=Xe("animationend"),gt=Xe("transitionend"),wt=!!(ct&>),vt=ct||"animationend",Mt=gt||"transitionend";function Pt(Ie,Ge){if(!Ie)return null;if(Object(z.a)(Ie)==="object"){var Qe=Ge.replace(/-\w/g,function(Ue){return Ue[1].toUpperCase()});return Ie[Qe]}return"".concat(Ie,"-").concat(Ge)}var _t="none",rr="appear",dr="enter",Zt="leave",fr="none",Ht="prepare",Mr="start",Sr="active",Tt="end";function Ot(Ie){var Ge=Object(v.useRef)(!1),Qe=Object(v.useState)(Ie),Ue=Object(g.a)(Qe,2),be=Ue[0],ke=Ue[1];function we(Be){Ge.current||ke(Be)}return Object(v.useEffect)(function(){return function(){Ge.current=!0}},[]),[be,we]}var Rt=Object(De.a)()?v.useLayoutEffect:v.useEffect,Bt=Rt,lr=function(){var Ie=v.useRef(null);function Ge(){tt.a.cancel(Ie.current)}function Qe(Ue){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ge();var ke=Object(tt.a)(function(){be<=1?Ue({isCanceled:function(){return ke!==Ie.current}}):Qe(Ue,be-1)});Ie.current=ke}return v.useEffect(function(){return function(){Ge()}},[]),[Qe,Ge]},sn=[Ht,Mr,Sr,Tt],yt=!1,kt=!0;function Ct(Ie){return Ie===Sr||Ie===Tt}var Ar=function(Ie,Ge){var Qe=v.useState(fr),Ue=Object(g.a)(Qe,2),be=Ue[0],ke=Ue[1],we=lr(),Be=Object(g.a)(we,2),He=Be[0],Ye=Be[1];function Ve(){ke(Ht)}return Bt(function(){if(be!==fr&&be!==Tt){var it=sn.indexOf(be),ht=sn[it+1],Et=Ge(be);Et===yt?ke(ht):He(function(xt){function Lt(){if(xt.isCanceled())return;ke(ht)}Et===!0?Lt():Promise.resolve(Et).then(Lt)})}},[Ie,be]),v.useEffect(function(){return function(){Ye()}},[]),[Ve,be]},Wr=function(Ie){var Ge=Object(v.useRef)(),Qe=Object(v.useRef)(Ie);Qe.current=Ie;var Ue=v.useCallback(function(we){Qe.current(we)},[]);function be(we){we&&(we.removeEventListener(Mt,Ue),we.removeEventListener(vt,Ue))}function ke(we){Ge.current&&Ge.current!==we&&be(Ge.current),we&&we!==Ge.current&&(we.addEventListener(Mt,Ue),we.addEventListener(vt,Ue),Ge.current=we)}return v.useEffect(function(){return function(){be(Ge.current)}},[]),[ke,be]};function Yt(Ie,Ge,Qe,Ue){var be=Ue.motionEnter,ke=be===void 0?!0:be,we=Ue.motionAppear,Be=we===void 0?!0:we,He=Ue.motionLeave,Ye=He===void 0?!0:He,Ve=Ue.motionDeadline,it=Ue.motionLeaveImmediately,ht=Ue.onAppearPrepare,Et=Ue.onEnterPrepare,xt=Ue.onLeavePrepare,Lt=Ue.onAppearStart,Qt=Ue.onEnterStart,xr=Ue.onLeaveStart,Cr=Ue.onAppearActive,_r=Ue.onEnterActive,jr=Ue.onLeaveActive,Lr=Ue.onAppearEnd,Or=Ue.onEnterEnd,Zr=Ue.onLeaveEnd,Kr=Ue.onVisibleChanged,kn=Ot(),Gr=Object(g.a)(kn,2),or=Gr[0],nr=Gr[1],Xr=Ot(_t),qr=Object(g.a)(Xr,2),Xt=qr[0],tn=qr[1],Ln=Ot(null),un=Object(g.a)(Ln,2),En=un[0],bn=un[1],Wn=Object(v.useRef)(!1),ti=Object(v.useRef)(null),In=Object(v.useRef)(!1),bi=Object(v.useRef)(null);function Wi(){var _n=Qe();return _n||bi.current}var Si=Object(v.useRef)(!1);function ri(_n){var vn=Wi();if(_n&&!_n.deadline&&_n.target!==vn)return;var ni;Xt===rr&&Si.current?ni=Lr==null?void 0:Lr(vn,_n):Xt===dr&&Si.current?ni=Or==null?void 0:Or(vn,_n):Xt===Zt&&Si.current&&(ni=Zr==null?void 0:Zr(vn,_n)),ni!==!1&&!In.current&&(tn(_t),bn(null))}var On=Wr(ri),wn=Object(g.a)(On,1),Nn=wn[0],Mn=v.useMemo(function(){var _n,vn,ni;switch(Xt){case"appear":return _n={},Object(M.a)(_n,Ht,ht),Object(M.a)(_n,Mr,Lt),Object(M.a)(_n,Sr,Cr),_n;case"enter":return vn={},Object(M.a)(vn,Ht,Et),Object(M.a)(vn,Mr,Qt),Object(M.a)(vn,Sr,_r),vn;case"leave":return ni={},Object(M.a)(ni,Ht,xt),Object(M.a)(ni,Mr,xr),Object(M.a)(ni,Sr,jr),ni;default:return{}}},[Xt]),Hi=Ar(Xt,function(_n){if(_n===Ht){var vn=Mn[Ht];return vn?vn(Wi()):yt}if(xn in Mn){var ni;bn(((ni=Mn[xn])===null||ni===void 0?void 0:ni.call(Mn,Wi(),null))||null)}return xn===Sr&&(Nn(Wi()),Ve>0&&(clearTimeout(ti.current),ti.current=setTimeout(function(){ri({deadline:!0})},Ve))),kt}),ra=Object(g.a)(Hi,2),na=ra[0],xn=ra[1],Ji=Ct(xn);Si.current=Ji,Bt(function(){nr(Ge);var _n=Wn.current;if(Wn.current=!0,!Ie)return;var vn;!_n&&Ge&&Be&&(vn=rr),_n&&Ge&&ke&&(vn=dr),(_n&&!Ge&&Ye||!_n&&it&&!Ge&&Ye)&&(vn=Zt),vn&&(tn(vn),na())},[Ge]),Object(v.useEffect)(function(){(Xt===rr&&!Be||Xt===dr&&!ke||Xt===Zt&&!Ye)&&tn(_t)},[Be,ke,Ye]),Object(v.useEffect)(function(){return function(){clearTimeout(ti.current),In.current=!0}},[]),Object(v.useEffect)(function(){or!==void 0&&Xt===_t&&(Kr==null||Kr(or))},[or,Xt]);var ia=En;return Mn[Ht]&&xn===Mr&&(ia=Object(D.a)({transition:"none"},ia)),[Xt,xn,ia,or!=null?or:Ge]}var Ut=function(Ie){Object(C.a)(Qe,Ie);var Ge=Object(x.a)(Qe);function Qe(){return Object(L.a)(this,Qe),Ge.apply(this,arguments)}return Object(O.a)(Qe,[{key:"render",value:function(){return this.props.children}}]),Qe}(v.Component),Pr=Ut;function yn(Ie){var Ge=Ie;Object(z.a)(Ie)==="object"&&(Ge=Ie.transitionSupport);function Qe(be){return!!(be.motionName&&Ge)}var Ue=v.forwardRef(function(be,ke){var we=be.visible,Be=we===void 0?!0:we,He=be.removeOnLeave,Ye=He===void 0?!0:He,Ve=be.forceRender,it=be.children,ht=be.motionName,Et=be.leavedClassName,xt=be.eventProps,Lt=Qe(be),Qt=Object(v.useRef)(),xr=Object(v.useRef)();function Cr(){try{return Object(ot.a)(Qt.current||xr.current)}catch(tn){return null}}var _r=Yt(Lt,Be,Cr,be),jr=Object(g.a)(_r,4),Lr=jr[0],Or=jr[1],Zr=jr[2],Kr=jr[3],kn=v.useRef(Kr);Kr&&(kn.current=!0);var Gr=Object(v.useRef)(ke);Gr.current=ke;var or=v.useCallback(function(tn){Qt.current=tn,Object(Fe.b)(Gr.current,tn)},[]),nr,Xr=Object(D.a)(Object(D.a)({},xt),{},{visible:Be});if(!it)nr=null;else if(Lr===_t||!Qe(be))Kr?nr=it(Object(D.a)({},Xr),or):!Ye&&kn.current?nr=it(Object(D.a)(Object(D.a)({},Xr),{},{className:Et}),or):Ve?nr=it(Object(D.a)(Object(D.a)({},Xr),{},{style:{display:"none"}}),or):nr=null;else{var qr,Xt;Or===Ht?Xt="prepare":Ct(Or)?Xt="active":Or===Mr&&(Xt="start"),nr=it(Object(D.a)(Object(D.a)({},Xr),{},{className:S()(Pt(ht,Lr),(qr={},Object(M.a)(qr,Pt(ht,"".concat(Lr,"-").concat(Xt)),Xt),Object(M.a)(qr,ht,typeof ht=="string"),qr)),style:Zr}),or)}return v.createElement(Pr,{ref:xr},nr)});return Ue.displayName="CSSMotion",Ue}var Vr=yn(wt),dt="add",At="keep",$t="remove",hr="removed";function vr(Ie){var Ge;return Ie&&Object(z.a)(Ie)==="object"&&"key"in Ie?Ge=Ie:Ge={key:Ie},Object(D.a)(Object(D.a)({},Ge),{},{key:String(Ge.key)})}function Er(){var Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ie.map(vr)}function ae(){var Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Qe=[],Ue=0,be=Ge.length,ke=Er(Ie),we=Er(Ge);ke.forEach(function(Ye){for(var Ve=!1,it=Ue;it<be;it+=1){var ht=we[it];if(ht.key===Ye.key){Ue<it&&(Qe=Qe.concat(we.slice(Ue,it).map(function(Et){return Object(D.a)(Object(D.a)({},Et),{},{status:dt})})),Ue=it),Qe.push(Object(D.a)(Object(D.a)({},ht),{},{status:At})),Ue+=1,Ve=!0;break}}Ve||Qe.push(Object(D.a)(Object(D.a)({},Ye),{},{status:$t}))}),Ue<be&&(Qe=Qe.concat(we.slice(Ue).map(function(Ye){return Object(D.a)(Object(D.a)({},Ye),{},{status:dt})})));var Be={};Qe.forEach(function(Ye){var Ve=Ye.key;Be[Ve]=(Be[Ve]||0)+1});var He=Object.keys(Be).filter(function(Ye){return Be[Ye]>1});return He.forEach(function(Ye){Qe=Qe.filter(function(Ve){var it=Ve.key,ht=Ve.status;return it!==Ye||ht!==$t}),Qe.forEach(function(Ve){Ve.key===Ye&&(Ve.status=At)})}),Qe}var G=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Y(Ie){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vr,Qe=function(Ue){Object(C.a)(ke,Ue);var be=Object(x.a)(ke);function ke(){var we;return Object(L.a)(this,ke),we=be.apply(this,arguments),we.state={keyEntities:[]},we.removeKey=function(Be){we.setState(function(He){var Ye=He.keyEntities;return{keyEntities:Ye.map(function(Ve){return Ve.key!==Be?Ve:Object(D.a)(Object(D.a)({},Ve),{},{status:hr})})}})},we}return Object(O.a)(ke,[{key:"render",value:function(){var Be=this,He=this.state.keyEntities,Ye=this.props,Ve=Ye.component,it=Ye.children,ht=Ye.onVisibleChanged,Et=Object(T.a)(Ye,["component","children","onVisibleChanged"]),xt=Ve||v.Fragment,Lt={};return G.forEach(function(Qt){Lt[Qt]=Et[Qt],delete Et[Qt]}),delete Et.keys,v.createElement(xt,Et,He.map(function(Qt){var xr=Qt.status,Cr=Object(T.a)(Qt,["status"]),_r=xr===dt||xr===At;return v.createElement(Ge,Object(h.a)({},Lt,{key:Cr.key,visible:_r,eventProps:Cr,onVisibleChanged:function(Lr){ht==null||ht(Lr,{key:Cr.key}),Lr||Be.removeKey(Cr.key)}}),it)}))}}],[{key:"getDerivedStateFromProps",value:function(Be,He){var Ye=Be.keys,Ve=He.keyEntities,it=Er(Ye),ht=ae(Ve,it);return{keyEntities:ht.filter(function(Et){var xt=Ve.find(function(Lt){var Qt=Lt.key;return Et.key===Qt});return!(xt&&xt.status===hr&&Et.status===$t)})}}}]),ke}(v.Component);return Qe.defaultProps={component:"div"},Qe}var ie=Y(wt),de=Vr;function oe(Ie){var Ge=Ie.prefixCls,Qe=Ie.motion,Ue=Ie.animation,be=Ie.transitionName;return Qe||(Ue?{motionName:"".concat(Ge,"-").concat(Ue)}:be?{motionName:be}:null)}function ze(Ie){var Ge=Ie.prefixCls,Qe=Ie.visible,Ue=Ie.zIndex,be=Ie.mask,ke=Ie.maskMotion,we=Ie.maskAnimation,Be=Ie.maskTransitionName;if(!be)return null;var He={};return(ke||Be||we)&&(He=Object(D.a)({motionAppear:!0},oe({motion:ke,prefixCls:Ge,transitionName:Be,animation:we}))),v.createElement(de,Object(h.a)({},He,{visible:Qe,removeOnLeave:!0}),function(Ye){var Ve=Ye.className;return v.createElement("div",{style:{zIndex:Ue},className:S()("".concat(Ge,"-mask"),Ve)})})}var ft=R("9mu1"),St=R("o0o1"),Ft=R.n(St),mt=R("HaE+"),Gt=["measure","align",null,"motion"],Vt=function(Ie,Ge){var Qe=Object(v.useState)(null),Ue=Object(g.a)(Qe,2),be=Ue[0],ke=Ue[1],we=Object(v.useRef)(),Be=Object(v.useRef)(!1);function He(it){Be.current||ke(it)}function Ye(){tt.a.cancel(we.current)}function Ve(it){Ye(),we.current=Object(tt.a)(function(){He(function(ht){switch(be){case"align":return"motion";case"motion":return"stable";default:}return ht}),it==null||it()})}return Object(v.useEffect)(function(){He("measure")},[Ie]),Object(v.useEffect)(function(){switch(be){case"measure":Ge();break;default:}be&&(we.current=Object(tt.a)(Object(mt.a)(Ft.a.mark(function it(){var ht,Et;return Ft.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:ht=Gt.indexOf(be),Et=Gt[ht+1],Et&&ht!==-1&&He(Et);case 3:case"end":return Lt.stop()}},it)}))))},[be]),Object(v.useEffect)(function(){return function(){Be.current=!0,Ye()}},[]),[be,Ve]},Hr=function(Ie){var Ge=v.useState({width:0,height:0}),Qe=Object(g.a)(Ge,2),Ue=Qe[0],be=Qe[1];function ke(Be){be({width:Be.offsetWidth,height:Be.offsetHeight})}var we=v.useMemo(function(){var Be={};if(Ie){var He=Ue.width,Ye=Ue.height;Ie.indexOf("height")!==-1&&Ye?Be.height=Ye:Ie.indexOf("minHeight")!==-1&&Ye&&(Be.minHeight=Ye),Ie.indexOf("width")!==-1&&He?Be.width=He:Ie.indexOf("minWidth")!==-1&&He&&(Be.minWidth=He)}return Be},[Ie,Ue]);return[we,ke]},cn=v.forwardRef(function(Ie,Ge){var Qe=Ie.visible,Ue=Ie.prefixCls,be=Ie.className,ke=Ie.style,we=Ie.children,Be=Ie.zIndex,He=Ie.stretch,Ye=Ie.destroyPopupOnHide,Ve=Ie.forceRender,it=Ie.align,ht=Ie.point,Et=Ie.getRootDomNode,xt=Ie.getClassNameFromAlign,Lt=Ie.onAlign,Qt=Ie.onMouseEnter,xr=Ie.onMouseLeave,Cr=Ie.onMouseDown,_r=Ie.onTouchStart,jr=Object(v.useRef)(),Lr=Object(v.useRef)(),Or=Object(v.useState)(),Zr=Object(g.a)(Or,2),Kr=Zr[0],kn=Zr[1],Gr=Hr(He),or=Object(g.a)(Gr,2),nr=or[0],Xr=or[1];function qr(){He&&Xr(Et())}var Xt=Vt(Qe,qr),tn=Object(g.a)(Xt,2),Ln=tn[0],un=tn[1],En=Object(v.useRef)();function bn(){return ht||Et}function Wn(){var On;(On=jr.current)===null||On===void 0||On.forceAlign()}function ti(On,wn){var Nn=xt(wn);Kr!==Nn&&kn(Nn),Ln==="align"&&(Kr!==Nn?Promise.resolve().then(function(){Wn()}):un(function(){var Mn;(Mn=En.current)===null||Mn===void 0||Mn.call(En)}),Lt==null||Lt(On,wn))}var In=Object(D.a)({},oe(Ie));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(On){var wn=In[On];In[On]=function(Nn,Mn){return un(),wn==null?void 0:wn(Nn,Mn)}});function bi(){return new Promise(function(On){En.current=On})}v.useEffect(function(){!In.motionName&&Ln==="motion"&&un()},[In.motionName,Ln]),v.useImperativeHandle(Ge,function(){return{forceAlign:Wn,getElement:function(){return Lr.current}}});var Wi=Object(D.a)(Object(D.a)({},nr),{},{zIndex:Be,opacity:Ln==="motion"||Ln==="stable"||!Qe?void 0:0,pointerEvents:Ln==="stable"?void 0:"none"},ke),Si=!0;(it==null?void 0:it.points)&&(Ln==="align"||Ln==="stable")&&(Si=!1);var ri=we;return v.Children.count(we)>1&&(ri=v.createElement("div",{className:"".concat(Ue,"-content")},we)),v.createElement(de,Object(h.a)({visible:Qe,ref:Lr,leavedClassName:"".concat(Ue,"-hidden")},In,{onAppearPrepare:bi,onEnterPrepare:bi,removeOnLeave:Ye,forceRender:Ve}),function(On,wn){var Nn=On.className,Mn=On.style,Hi=S()(Ue,be,Kr,Nn);return v.createElement(ft.a,{target:bn(),key:"popup",ref:jr,monitorWindowResize:!0,disabled:Si,align:it,onAlign:ti},v.createElement("div",{ref:wn,className:Hi,onMouseEnter:Qt,onMouseLeave:xr,onMouseDownCapture:Cr,onTouchStartCapture:_r,style:Object(D.a)(Object(D.a)({},Mn),Wi)},ri))})});cn.displayName="PopupInner";var rn=cn,tr=v.forwardRef(function(Ie,Ge){var Qe=Ie.prefixCls,Ue=Ie.visible,be=Ie.zIndex,ke=Ie.children,we=Ie.mobile;we=we===void 0?{}:we;var Be=we.popupClassName,He=we.popupStyle,Ye=we.popupMotion,Ve=Ye===void 0?{}:Ye,it=we.popupRender,ht=v.useRef();v.useImperativeHandle(Ge,function(){return{forceAlign:function(){},getElement:function(){return ht.current}}});var Et=Object(D.a)({zIndex:be},He),xt=ke;return v.Children.count(ke)>1&&(xt=v.createElement("div",{className:"".concat(Qe,"-content")},ke)),it&&(xt=it(xt)),v.createElement(de,Object(h.a)({visible:Ue,ref:ht,removeOnLeave:!0},Ve),function(Lt,Qt){var xr=Lt.className,Cr=Lt.style,_r=S()(Qe,Be,xr);return v.createElement("div",{ref:Qt,className:_r,style:Object(D.a)(Object(D.a)({},Cr),Et)},xt)})});tr.displayName="MobilePopupInner";var $r=tr,pr=["visible","mobile"],qt=v.forwardRef(function(Ie,Ge){var Qe=Ie.visible,Ue=Ie.mobile,be=Object(T.a)(Ie,pr),ke=Object(v.useState)(Qe),we=Object(g.a)(ke,2),Be=we[0],He=we[1],Ye=Object(v.useState)(!1),Ve=Object(g.a)(Ye,2),it=Ve[0],ht=Ve[1],Et=Object(D.a)(Object(D.a)({},be),{},{visible:Be});Object(v.useEffect)(function(){He(Qe),Qe&&Ue&&ht(je())},[Qe,Ue]);var xt=it?v.createElement($r,Object(h.a)({},Et,{mobile:Ue,ref:Ge})):v.createElement(rn,Object(h.a)({},Et,{ref:Ge}));return v.createElement("div",null,v.createElement(ze,Et),xt)});qt.displayName="Popup";var sr=qt,gr=v.createContext(null),en=gr;function fn(){}function Sn(){return""}function wi(Ie){return Ie?Ie.ownerDocument:window.document}var Vi=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Ui(Ie){var Ge=function(Qe){Object(C.a)(be,Qe);var Ue=Object(x.a)(be);function be(ke){var we;Object(L.a)(this,be),we=Ue.call(this,ke),we.popupRef=v.createRef(),we.triggerRef=v.createRef(),we.attachId=void 0,we.clickOutsideHandler=void 0,we.touchOutsideHandler=void 0,we.contextMenuOutsideHandler1=void 0,we.contextMenuOutsideHandler2=void 0,we.mouseDownTimeout=void 0,we.focusTime=void 0,we.preClickTime=void 0,we.preTouchTime=void 0,we.delayTimer=void 0,we.hasPopupMouseDown=void 0,we.onMouseEnter=function(He){var Ye=we.props.mouseEnterDelay;we.fireEvents("onMouseEnter",He),we.delaySetPopupVisible(!0,Ye,Ye?null:He)},we.onMouseMove=function(He){we.fireEvents("onMouseMove",He),we.setPoint(He)},we.onMouseLeave=function(He){we.fireEvents("onMouseLeave",He),we.delaySetPopupVisible(!1,we.props.mouseLeaveDelay)},we.onPopupMouseEnter=function(){we.clearDelayTimer()},we.onPopupMouseLeave=function(He){var Ye;if(He.relatedTarget&&!He.relatedTarget.setTimeout&&Object(st.a)((Ye=we.popupRef.current)===null||Ye===void 0?void 0:Ye.getElement(),He.relatedTarget))return;we.delaySetPopupVisible(!1,we.props.mouseLeaveDelay)},we.onFocus=function(He){we.fireEvents("onFocus",He),we.clearDelayTimer(),we.isFocusToShow()&&(we.focusTime=Date.now(),we.delaySetPopupVisible(!0,we.props.focusDelay))},we.onMouseDown=function(He){we.fireEvents("onMouseDown",He),we.preClickTime=Date.now()},we.onTouchStart=function(He){we.fireEvents("onTouchStart",He),we.preTouchTime=Date.now()},we.onBlur=function(He){we.fireEvents("onBlur",He),we.clearDelayTimer(),we.isBlurToHide()&&we.delaySetPopupVisible(!1,we.props.blurDelay)},we.onContextMenu=function(He){He.preventDefault(),we.fireEvents("onContextMenu",He),we.setPopupVisible(!0,He)},we.onContextMenuClose=function(){we.isContextMenuToShow()&&we.close()},we.onClick=function(He){if(we.fireEvents("onClick",He),we.focusTime){var Ye;if(we.preClickTime&&we.preTouchTime?Ye=Math.min(we.preClickTime,we.preTouchTime):we.preClickTime?Ye=we.preClickTime:we.preTouchTime&&(Ye=we.preTouchTime),Math.abs(Ye-we.focusTime)<20)return;we.focusTime=0}we.preClickTime=0,we.preTouchTime=0,we.isClickToShow()&&(we.isClickToHide()||we.isBlurToHide())&&He&&He.preventDefault&&He.preventDefault();var Ve=!we.state.popupVisible;(we.isClickToHide()&&!Ve||Ve&&we.isClickToShow())&&we.setPopupVisible(!we.state.popupVisible,He)},we.onPopupMouseDown=function(){if(we.hasPopupMouseDown=!0,clearTimeout(we.mouseDownTimeout),we.mouseDownTimeout=window.setTimeout(function(){we.hasPopupMouseDown=!1},0),we.context){var He;(He=we.context).onPopupMouseDown.apply(He,arguments)}},we.onDocumentClick=function(He){if(we.props.mask&&!we.props.maskClosable)return;var Ye=He.target,Ve=we.getRootDomNode(),it=we.getPopupDomNode();(!Object(st.a)(Ve,Ye)||we.isContextMenuOnly())&&!Object(st.a)(it,Ye)&&!we.hasPopupMouseDown&&we.close()},we.getRootDomNode=function(){var He=we.props.getTriggerDOMNode;if(He)return He(we.triggerRef.current);try{var Ye=Object(ot.a)(we.triggerRef.current);if(Ye)return Ye}catch(Ve){}return rt.a.findDOMNode(Object(w.a)(we))},we.getPopupClassNameFromAlign=function(He){var Ye=[],Ve=we.props,it=Ve.popupPlacement,ht=Ve.builtinPlacements,Et=Ve.prefixCls,xt=Ve.alignPoint,Lt=Ve.getPopupClassNameFromAlign;return it&&ht&&Ye.push(nt(ht,Et,He,xt)),Lt&&Ye.push(Lt(He)),Ye.join(" ")},we.getComponent=function(){var He=we.props,Ye=He.prefixCls,Ve=He.destroyPopupOnHide,it=He.popupClassName,ht=He.onPopupAlign,Et=He.popupMotion,xt=He.popupAnimation,Lt=He.popupTransitionName,Qt=He.popupStyle,xr=He.mask,Cr=He.maskAnimation,_r=He.maskTransitionName,jr=He.maskMotion,Lr=He.zIndex,Or=He.popup,Zr=He.stretch,Kr=He.alignPoint,kn=He.mobile,Gr=He.forceRender,or=we.state,nr=or.popupVisible,Xr=or.point,qr=we.getPopupAlign(),Xt={};return we.isMouseEnterToShow()&&(Xt.onMouseEnter=we.onPopupMouseEnter),we.isMouseLeaveToHide()&&(Xt.onMouseLeave=we.onPopupMouseLeave),Xt.onMouseDown=we.onPopupMouseDown,Xt.onTouchStart=we.onPopupMouseDown,v.createElement(sr,Object(h.a)({prefixCls:Ye,destroyPopupOnHide:Ve,visible:nr,point:Kr&&Xr,className:it,align:qr,onAlign:ht,animation:xt,getClassNameFromAlign:we.getPopupClassNameFromAlign},Xt,{stretch:Zr,getRootDomNode:we.getRootDomNode,style:Qt,mask:xr,zIndex:Lr,transitionName:Lt,maskAnimation:Cr,maskTransitionName:_r,maskMotion:jr,ref:we.popupRef,motion:Et,mobile:kn,forceRender:Gr}),typeof Or=="function"?Or():Or)},we.attachParent=function(He){tt.a.cancel(we.attachId);var Ye=we.props,Ve=Ye.getPopupContainer,it=Ye.getDocument,ht=we.getRootDomNode(),Et;Ve?(ht||Ve.length===0)&&(Et=Ve(ht)):Et=it(we.getRootDomNode()).body,Et?Et.appendChild(He):we.attachId=Object(tt.a)(function(){we.attachParent(He)})},we.getContainer=function(){var He=we.props.getDocument,Ye=He(we.getRootDomNode()).createElement("div");return Ye.style.position="absolute",Ye.style.top="0",Ye.style.left="0",Ye.style.width="100%",we.attachParent(Ye),Ye},we.setPoint=function(He){var Ye=we.props.alignPoint;if(!Ye||!He)return;we.setState({point:{pageX:He.pageX,pageY:He.pageY}})},we.handlePortalUpdate=function(){we.state.prevPopupVisible!==we.state.popupVisible&&we.props.afterPopupVisibleChange(we.state.popupVisible)},we.triggerContextValue={onPopupMouseDown:we.onPopupMouseDown};var Be;return"popupVisible"in ke?Be=!!ke.popupVisible:Be=!!ke.defaultPopupVisible,we.state={prevPopupVisible:Be,popupVisible:Be},Vi.forEach(function(He){we["fire".concat(He)]=function(Ye){we.fireEvents(He,Ye)}}),we}return Object(O.a)(be,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var we=this.props,Be=this.state;if(Be.popupVisible){var He;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(He=we.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ae.a)(He,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(He=He||we.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ae.a)(He,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(He=He||we.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ae.a)(He,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ae.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var we;return((we=this.popupRef.current)===null||we===void 0?void 0:we.getElement())||null}},{key:"getPopupAlign",value:function(){var we=this.props,Be=we.popupPlacement,He=we.popupAlign,Ye=we.builtinPlacements;return Be&&Ye?$e(Ye,Be,He):He}},{key:"setPopupVisible",value:function(we,Be){var He=this.props.alignPoint,Ye=this.state.popupVisible;this.clearDelayTimer(),Ye!==we&&("popupVisible"in this.props||this.setState({popupVisible:we,prevPopupVisible:Ye}),this.props.onPopupVisibleChange(we)),He&&Be&&we&&this.setPoint(Be)}},{key:"delaySetPopupVisible",value:function(we,Be,He){var Ye=this,Ve=Be*1e3;if(this.clearDelayTimer(),Ve){var it=He?{pageX:He.pageX,pageY:He.pageY}:null;this.delayTimer=window.setTimeout(function(){Ye.setPopupVisible(we,it),Ye.clearDelayTimer()},Ve)}else this.setPopupVisible(we,He)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(we){var Be=this.props.children.props,He=this.props;return Be[we]&&He[we]?this["fire".concat(we)]:Be[we]||He[we]}},{key:"isClickToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("click")!==-1||He.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var we=this.props.action;return we==="contextMenu"||we.length===1&&we[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("contextMenu")!==-1||He.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("click")!==-1||He.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("hover")!==-1||He.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("hover")!==-1||He.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var we=this.props,Be=we.action,He=we.showAction;return Be.indexOf("focus")!==-1||He.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var we=this.props,Be=we.action,He=we.hideAction;return Be.indexOf("focus")!==-1||He.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var we;(we=this.popupRef.current)===null||we===void 0||we.forceAlign()}}},{key:"fireEvents",value:function(we,Be){var He=this.props.children.props[we];He&&He(Be);var Ye=this.props[we];Ye&&Ye(Be)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var we=this.state.popupVisible,Be=this.props,He=Be.children,Ye=Be.forceRender,Ve=Be.alignPoint,it=Be.className,ht=Be.autoDestroy,Et=v.Children.only(He),xt={key:"trigger"};this.isContextMenuToShow()?xt.onContextMenu=this.onContextMenu:xt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(xt.onClick=this.onClick,xt.onMouseDown=this.onMouseDown,xt.onTouchStart=this.onTouchStart):(xt.onClick=this.createTwoChains("onClick"),xt.onMouseDown=this.createTwoChains("onMouseDown"),xt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(xt.onMouseEnter=this.onMouseEnter,Ve&&(xt.onMouseMove=this.onMouseMove)):xt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?xt.onMouseLeave=this.onMouseLeave:xt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(xt.onFocus=this.onFocus,xt.onBlur=this.onBlur):(xt.onFocus=this.createTwoChains("onFocus"),xt.onBlur=this.createTwoChains("onBlur"));var Lt=S()(Et&&Et.props&&Et.props.className,it);Lt&&(xt.className=Lt);var Qt=Object(D.a)({},xt);Object(Fe.c)(Et)&&(Qt.ref=Object(Fe.a)(this.triggerRef,Et.ref));var xr=v.cloneElement(Et,Qt),Cr;return(we||this.popupRef.current||Ye)&&(Cr=v.createElement(Ie,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!we&&ht&&(Cr=null),v.createElement(en.Provider,{value:this.triggerContextValue},xr,Cr)}}],[{key:"getDerivedStateFromProps",value:function(we,Be){var He=we.popupVisible,Ye={};return He!==void 0&&Be.popupVisible!==He&&(Ye.popupVisible=He,Ye.prevPopupVisible=Be.popupVisible),Ye}}]),be}(v.Component);return Ge.contextType=en,Ge.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Sn,getDocument:wi,onPopupVisibleChange:fn,afterPopupVisibleChange:fn,onPopupAlign:fn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Ge}var Zn=Ui(qe.a),ln={adjustX:1,adjustY:1},Ri={topLeft:{points:["bl","tl"],overflow:ln,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ln,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ln,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ln,offset:[4,0]}},dn={topLeft:{points:["bl","tl"],overflow:ln,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ln,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ln,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ln,offset:[4,0]}},hi=Ri,Jr=0,ur={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},nn=function(Ge,Qe,Ue){var be=ee(Qe),ke=Ge.getState();Ge.setState({defaultActiveFirst:Object(D.a)(Object(D.a)({},ke.defaultActiveFirst),{},Object(M.a)({},be,Ue))})},Ir=function(Ie){Object(C.a)(Qe,Ie);var Ge=Object(x.a)(Qe);function Qe(Ue){var be;Object(L.a)(this,Qe),be=Ge.call(this,Ue),be.onDestroy=function(Ve){be.props.onDestroy(Ve)},be.onKeyDown=function(Ve){var it=Ve.keyCode,ht=be.menuInstance,Et=be.props.store,xt=be.getVisible();if(it===m.a.ENTER)return be.onTitleClick(Ve),nn(Et,be.props.eventKey,!0),!0;if(it===m.a.RIGHT)return xt?ht.onKeyDown(Ve):(be.triggerOpenChange(!0),nn(Et,be.props.eventKey,!0)),!0;if(it===m.a.LEFT){var Lt;if(xt)Lt=ht.onKeyDown(Ve);else return;return Lt||(be.triggerOpenChange(!1),Lt=!0),Lt}return xt&&(it===m.a.UP||it===m.a.DOWN)?ht.onKeyDown(Ve):void 0},be.onOpenChange=function(Ve){be.props.onOpenChange(Ve)},be.onPopupVisibleChange=function(Ve){be.triggerOpenChange(Ve,Ve?"mouseenter":"mouseleave")},be.onMouseEnter=function(Ve){var it=be.props,ht=it.eventKey,Et=it.onMouseEnter,xt=it.store;nn(xt,be.props.eventKey,!1),Et({key:ht,domEvent:Ve})},be.onMouseLeave=function(Ve){var it=be.props,ht=it.parentMenu,Et=it.eventKey,xt=it.onMouseLeave;ht.subMenuInstance=Object(w.a)(be),xt({key:Et,domEvent:Ve})},be.onTitleMouseEnter=function(Ve){var it=be.props,ht=it.eventKey,Et=it.onItemHover,xt=it.onTitleMouseEnter;Et({key:ht,hover:!0}),xt({key:ht,domEvent:Ve})},be.onTitleMouseLeave=function(Ve){var it=be.props,ht=it.parentMenu,Et=it.eventKey,xt=it.onItemHover,Lt=it.onTitleMouseLeave;ht.subMenuInstance=Object(w.a)(be),xt({key:Et,hover:!1}),Lt({key:Et,domEvent:Ve})},be.onTitleClick=function(Ve){var it=Object(w.a)(be),ht=it.props;if(ht.onTitleClick({key:ht.eventKey,domEvent:Ve}),ht.triggerSubMenuAction==="hover")return;be.triggerOpenChange(!be.getVisible(),"click"),nn(ht.store,be.props.eventKey,!1)},be.onSubMenuClick=function(Ve){typeof be.props.onClick=="function"&&be.props.onClick(be.addKeyPath(Ve))},be.onSelect=function(Ve){be.props.onSelect(Ve)},be.onDeselect=function(Ve){be.props.onDeselect(Ve)},be.getPrefixCls=function(){return"".concat(be.props.rootPrefixCls,"-submenu")},be.getActiveClassName=function(){return"".concat(be.getPrefixCls(),"-active")},be.getDisabledClassName=function(){return"".concat(be.getPrefixCls(),"-disabled")},be.getSelectedClassName=function(){return"".concat(be.getPrefixCls(),"-selected")},be.getOpenClassName=function(){return"".concat(be.props.rootPrefixCls,"-submenu-open")},be.getVisible=function(){return be.state.isOpen},be.getMode=function(){return be.state.mode},be.saveMenuInstance=function(Ve){be.menuInstance=Ve},be.addKeyPath=function(Ve){return Object(D.a)(Object(D.a)({},Ve),{},{keyPath:(Ve.keyPath||[]).concat(be.props.eventKey)})},be.triggerOpenChange=function(Ve,it){var ht=be.props.eventKey,Et=function(){be.onOpenChange({key:ht,item:Object(w.a)(be),trigger:it,open:Ve})};it==="mouseenter"?be.mouseenterTimeout=setTimeout(function(){Et()},0):Et()},be.isChildrenSelected=function(){var Ve={find:!1};return X(be.props.children,be.props.selectedKeys,Ve),Ve.find},be.isInlineMode=function(){return be.getMode()==="inline"},be.adjustWidth=function(){if(!be.subMenuTitle||!be.menuInstance)return;var Ve=Ze.findDOMNode(be.menuInstance);if(Ve.offsetWidth>=be.subMenuTitle.offsetWidth)return;Ve.style.minWidth="".concat(be.subMenuTitle.offsetWidth,"px")},be.saveSubMenuTitle=function(Ve){be.subMenuTitle=Ve},be.getBaseProps=function(){var Ve=Object(w.a)(be),it=Ve.props,ht=be.getMode();return{mode:ht==="horizontal"?"vertical":ht,visible:be.getVisible(),level:it.level+1,inlineIndent:it.inlineIndent,focusable:!1,onClick:be.onSubMenuClick,onSelect:be.onSelect,onDeselect:be.onDeselect,onDestroy:be.onDestroy,selectedKeys:it.selectedKeys,eventKey:"".concat(it.eventKey,"-menu-"),openKeys:it.openKeys,motion:it.motion,onOpenChange:be.onOpenChange,subMenuOpenDelay:it.subMenuOpenDelay,parentMenu:Object(w.a)(be),subMenuCloseDelay:it.subMenuCloseDelay,forceSubMenuRender:it.forceSubMenuRender,triggerSubMenuAction:it.triggerSubMenuAction,builtinPlacements:it.builtinPlacements,defaultActiveFirst:it.store.getState().defaultActiveFirst[ee(it.eventKey)],multiple:it.multiple,prefixCls:it.rootPrefixCls,id:be.internalMenuId,manualRef:be.saveMenuInstance,itemIcon:it.itemIcon,expandIcon:it.expandIcon,direction:it.direction}},be.getMotion=function(Ve,it){var ht=Object(w.a)(be),Et=ht.haveRendered,xt=be.props,Lt=xt.motion,Qt=xt.rootPrefixCls,xr=Object(D.a)(Object(D.a)({},Lt),{},{leavedClassName:"".concat(Qt,"-hidden"),removeOnLeave:!1,motionAppear:Et||!it||Ve!=="inline"});return xr};var ke=Ue.store,we=Ue.eventKey,Be=ke.getState(),He=Be.defaultActiveFirst;be.isRootMenu=!1;var Ye=!1;return He&&(Ye=He[we]),nn(ke,we,Ye),be.state={mode:Ue.mode,isOpen:Ue.isOpen},be}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var be=this,ke=this.props,we=ke.mode,Be=ke.parentMenu,He=ke.manualRef,Ye=ke.isOpen,Ve=function(){be.setState({mode:we,isOpen:Ye})},it=Ye!==this.state.isOpen,ht=we!==this.state.mode;if((ht||it)&&(tt.a.cancel(this.updateStateRaf),ht?this.updateStateRaf=Object(tt.a)(Ve):Ve()),He&&He(this),we!=="horizontal"||!(Be==null?void 0:Be.isRootMenu)||!Ye)return;this.minWidthTimeout=setTimeout(function(){return be.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var be=this.props,ke=be.onDestroy,we=be.eventKey;ke&&ke(we),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(be,ke){var we=this.getBaseProps();return v.createElement(Bi,Object(h.a)({},we,{id:this.internalMenuId,className:be,style:ke}),this.props.children)}},{key:"renderChildren",value:function(){var be=this,ke=this.getBaseProps(),we=ke.mode,Be=ke.visible,He=ke.forceSubMenuRender,Ye=ke.direction,Ve=this.getMotion(we,Be);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Be||He,!this.haveOpened)return v.createElement("div",null);var it=S()("".concat(ke.prefixCls,"-sub"),Object(M.a)({},"".concat(ke.prefixCls,"-rtl"),Ye==="rtl"));return this.isInlineMode()?v.createElement(de,Object(h.a)({visible:ke.visible,forceRender:He},Ve),function(ht){var Et=ht.className,xt=ht.style,Lt=S()(it,Et);return be.renderPopupMenu(Lt,xt)}):this.renderPopupMenu(it)}},{key:"render",value:function(){var be,ke,we,Be=Object(D.a)({},this.props),He=this.getVisible(),Ye=this.getPrefixCls(),Ve=this.isInlineMode(),it=this.getMode(),ht=S()(Ye,"".concat(Ye,"-").concat(it),(be={},Object(M.a)(be,Be.className,!!Be.className),Object(M.a)(be,this.getOpenClassName(),He),Object(M.a)(be,this.getActiveClassName(),Be.active||He&&!Ve),Object(M.a)(be,this.getDisabledClassName(),Be.disabled),Object(M.a)(be,this.getSelectedClassName(),this.isChildrenSelected()),be));this.internalMenuId||(Be.eventKey?this.internalMenuId="".concat(Be.eventKey,"$Menu"):(Jr+=1,this.internalMenuId="$__$".concat(Jr,"$Menu")));var Et={},xt={},Lt={};Be.disabled||(Et={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},xt={onClick:this.onTitleClick},Lt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Qt={},xr=Be.direction,Cr=xr==="rtl";Ve&&(Cr?Qt.paddingRight=Be.inlineIndent*Be.level:Qt.paddingLeft=Be.inlineIndent*Be.level);var _r={};this.getVisible()&&(_r={"aria-owns":this.internalMenuId});var jr=null;it!=="horizontal"&&(jr=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(jr=v.createElement(this.props.expandIcon,Object(D.a)({},this.props))));var Lr=v.createElement("div",Object(h.a)({ref:this.saveSubMenuTitle,style:Qt,className:"".concat(Ye,"-title"),role:"button"},Lt,xt,{"aria-expanded":He},_r,{"aria-haspopup":"true",title:typeof Be.title=="string"?Be.title:void 0}),Be.title,jr||v.createElement("i",{className:"".concat(Ye,"-arrow")})),Or=this.renderChildren(),Zr=((ke=Be.parentMenu)===null||ke===void 0?void 0:ke.isRootMenu)?Be.parentMenu.props.getPopupContainer:function(bn){return bn.parentNode},Kr=ur[it],kn=Be.popupOffset?{offset:Be.popupOffset}:{},Gr=S()((we={},Object(M.a)(we,Be.popupClassName,Be.popupClassName&&!Ve),Object(M.a)(we,"".concat(Ye,"-rtl"),Cr),we)),or=Be.disabled,nr=Be.triggerSubMenuAction,Xr=Be.subMenuOpenDelay,qr=Be.forceSubMenuRender,Xt=Be.subMenuCloseDelay,tn=Be.builtinPlacements;Z.forEach(function(bn){return delete Be[bn]}),delete Be.onClick;var Ln=Cr?Object(D.a)(Object(D.a)({},dn),tn):Object(D.a)(Object(D.a)({},Ri),tn);delete Be.direction;var un=this.getBaseProps(),En=Ve?null:this.getMotion(un.mode,un.visible);return v.createElement("li",Object(h.a)({},Be,Et,{className:ht,role:"menuitem"}),v.createElement(Zn,{prefixCls:Ye,popupClassName:S()("".concat(Ye,"-popup"),Gr),getPopupContainer:Zr,builtinPlacements:Ln,popupPlacement:Kr,popupVisible:Ve?!1:He,popupAlign:kn,popup:Ve?null:Or,action:or||Ve?[]:[nr],mouseEnterDelay:Xr,mouseLeaveDelay:Xt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:qr,popupMotion:En},Lr),Ve?Or:null)}}]),Qe}(v.Component);Ir.defaultProps={onMouseEnter:ue,onMouseLeave:ue,onTitleMouseEnter:ue,onTitleMouseLeave:ue,onTitleClick:ue,manualRef:ue,mode:"vertical",title:""};var mn=Object(_.b)(function(Ie,Ge){var Qe=Ie.openKeys,Ue=Ie.activeKey,be=Ie.selectedKeys,ke=Ge.eventKey,we=Ge.subMenuKey;return{isOpen:Qe.indexOf(ke)>-1,active:Ue[we]===ke,selectedKeys:be}})(Ir);mn.isSubMenu=!0;var Nr=mn,fi="menuitem-overflowed",gn=.5,zn=function(Ie){Object(C.a)(Qe,Ie);var Ge=Object(x.a)(Qe);function Qe(){var Ue;return Object(L.a)(this,Qe),Ue=Ge.apply(this,arguments),Ue.resizeObserver=null,Ue.mutationObserver=null,Ue.originalTotalWidth=0,Ue.overflowedItems=[],Ue.menuItemSizes=[],Ue.cancelFrameId=null,Ue.state={lastVisibleIndex:void 0},Ue.childRef=v.createRef(),Ue.getMenuItemNodes=function(){var be=Ue.props.prefixCls,ke=Ue.childRef.current;return ke?[].slice.call(ke.children).filter(function(we){return we.className.split(" ").indexOf("".concat(be,"-overflowed-submenu"))<0}):[]},Ue.getOverflowedSubMenuItem=function(be,ke,we){var Be=Ue.props,He=Be.overflowedIndicator,Ye=Be.level,Ve=Be.mode,it=Be.prefixCls,ht=Be.theme;if(Ye!==1||Ve!=="horizontal")return null;var Et=Ue.props.children[0],xt=Et.props,Lt=xt.children,Qt=xt.title,xr=xt.style,Cr=Object(T.a)(xt,["children","title","style"]),_r=Object(D.a)({},xr),jr="".concat(be,"-overflowed-indicator"),Lr="".concat(be,"-overflowed-indicator");ke.length===0&&we!==!0?_r=Object(D.a)(Object(D.a)({},_r),{},{display:"none"}):we&&(_r=Object(D.a)(Object(D.a)({},_r),{},{visibility:"hidden",position:"absolute"}),jr="".concat(jr,"-placeholder"),Lr="".concat(Lr,"-placeholder"));var Or=ht?"".concat(it,"-").concat(ht):"",Zr={};return Z.forEach(function(Kr){Cr[Kr]!==void 0&&(Zr[Kr]=Cr[Kr])}),v.createElement(Nr,Object(h.a)({title:He,className:"".concat(it,"-overflowed-submenu"),popupClassName:Or},Zr,{key:jr,eventKey:Lr,disabled:!1,style:_r}),ke)},Ue.setChildrenWidthAndResize=function(){if(Ue.props.mode!=="horizontal")return;var be=Ue.childRef.current;if(!be)return;var ke=be.children;if(!ke||ke.length===0)return;var we=be.children[ke.length-1];ye(we,"display","inline-block");var Be=Ue.getMenuItemNodes(),He=Be.filter(function(Ye){return Ye.className.split(" ").indexOf(fi)>=0});He.forEach(function(Ye){ye(Ye,"display","inline-block")}),Ue.menuItemSizes=Be.map(function(Ye){return ve(Ye,!0)}),He.forEach(function(Ye){ye(Ye,"display","none")}),Ue.overflowedIndicatorWidth=ve(be.children[be.children.length-1],!0),Ue.originalTotalWidth=Ue.menuItemSizes.reduce(function(Ye,Ve){return Ye+Ve},0),Ue.handleResize(),ye(we,"display","none")},Ue.handleResize=function(){if(Ue.props.mode!=="horizontal")return;var be=Ue.childRef.current;if(!be)return;var ke=ve(be);Ue.overflowedItems=[];var we=0,Be;Ue.originalTotalWidth>ke+gn&&(Be=-1,Ue.menuItemSizes.forEach(function(He){we+=He,we+Ue.overflowedIndicatorWidth<=ke&&(Be+=1)})),Ue.setState({lastVisibleIndex:Be})},Ue}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){var be=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ke=this.childRef.current;if(!ke)return;this.resizeObserver=new Je.default(function(we){we.forEach(function(){var Be=be.cancelFrameId;cancelAnimationFrame(Be),be.cancelFrameId=requestAnimationFrame(be.setChildrenWidthAndResize)})}),[].slice.call(ke.children).concat(ke).forEach(function(we){be.resizeObserver.observe(we)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){be.resizeObserver.disconnect(),[].slice.call(ke.children).concat(ke).forEach(function(we){be.resizeObserver.observe(we)}),be.setChildrenWidthAndResize()}),this.mutationObserver.observe(ke,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(be){var ke=this,we=this.state.lastVisibleIndex;return(be||[]).reduce(function(Be,He,Ye){var Ve=He;if(ke.props.mode==="horizontal"){var it=ke.getOverflowedSubMenuItem(He.props.eventKey,[]);we!==void 0&&ke.props.className.indexOf("".concat(ke.props.prefixCls,"-root"))!==-1&&(Ye>we&&(Ve=v.cloneElement(He,{style:{display:"none"},eventKey:"".concat(He.props.eventKey,"-hidden"),className:"".concat(fi)})),Ye===we+1&&(ke.overflowedItems=be.slice(we+1).map(function(Et){return v.cloneElement(Et,{key:Et.props.eventKey,mode:"vertical-left"})}),it=ke.getOverflowedSubMenuItem(He.props.eventKey,ke.overflowedItems)));var ht=[].concat(Object(o.a)(Be),[it,Ve]);return Ye===be.length-1&&ht.push(ke.getOverflowedSubMenuItem(He.props.eventKey,[],!0)),ht}return[].concat(Object(o.a)(Be),[Ve])},[])}},{key:"render",value:function(){var be=this.props,ke=be.visible,we=be.prefixCls,Be=be.overflowedIndicator,He=be.mode,Ye=be.level,Ve=be.tag,it=be.children,ht=be.theme,Et=Object(T.a)(be,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),xt=Ve;return v.createElement(xt,Object(h.a)({ref:this.childRef},Et),this.renderChildren(it))}}]),Qe}(v.Component);zn.defaultProps={tag:"div",className:""};var Di=zn;function yi(Ie){return Ie.length?Ie.every(function(Ge){return!!Ge.props.disabled}):!0}function qn(Ie,Ge,Qe){var Ue=Ie.getState();Ie.setState({activeKey:Object(D.a)(Object(D.a)({},Ue.activeKey),{},Object(M.a)({},Ge,Qe))})}function Ci(Ie){return Ie.eventKey||"0-menu-"}function Fn(Ie,Ge){var Qe=Ge,Ue=Ie.children,be=Ie.eventKey;if(Qe){var ke;if(Q(Ue,function(we,Be){we&&we.props&&!we.props.disabled&&Qe===fe(we,be,Be)&&(ke=!0)}),ke)return Qe}return Qe=null,Ie.defaultActiveFirst&&Q(Ue,function(we,Be){!Qe&&we&&!we.props.disabled&&(Qe=fe(we,be,Be))}),Qe}function Ni(Ie){if(!Ie)return;var Ge=this.instanceArray.indexOf(Ie);Ge!==-1?this.instanceArray[Ge]=Ie:this.instanceArray.push(Ie)}var si=function(Ie){Object(C.a)(Qe,Ie);var Ge=Object(x.a)(Qe);function Qe(Ue){var be;return Object(L.a)(this,Qe),be=Ge.call(this,Ue),be.onKeyDown=function(ke,we){var Be=ke.keyCode,He;if(be.getFlatInstanceArray().forEach(function(Ve){Ve&&Ve.props.active&&Ve.onKeyDown&&(He=Ve.onKeyDown(ke))}),He)return 1;var Ye=null;return(Be===m.a.UP||Be===m.a.DOWN)&&(Ye=be.step(Be===m.a.UP?-1:1)),Ye?(ke.preventDefault(),qn(be.props.store,Ci(be.props),Ye.props.eventKey),typeof we=="function"&&we(Ye),1):void 0},be.onItemHover=function(ke){var we=ke.key,Be=ke.hover;qn(be.props.store,Ci(be.props),Be?we:null)},be.onDeselect=function(ke){be.props.onDeselect(ke)},be.onSelect=function(ke){be.props.onSelect(ke)},be.onClick=function(ke){be.props.onClick(ke)},be.onOpenChange=function(ke){be.props.onOpenChange(ke)},be.onDestroy=function(ke){be.props.onDestroy(ke)},be.getFlatInstanceArray=function(){return be.instanceArray},be.step=function(ke){var we=be.getFlatInstanceArray(),Be=be.props.store.getState().activeKey[Ci(be.props)],He=we.length;if(!He)return null;ke<0&&(we=we.concat().reverse());var Ye=-1;if(we.every(function(Et,xt){return Et&&Et.props.eventKey===Be?(Ye=xt,!1):!0}),!be.props.defaultActiveFirst&&Ye!==-1&&yi(we.slice(Ye,He-1)))return;var Ve=(Ye+1)%He,it=Ve;do{var ht=we[it];if(!ht||ht.props.disabled)it=(it+1)%He;else return ht}while(it!==Ve);return null},be.renderCommonMenuItem=function(ke,we,Be){var He=be.props.store.getState(),Ye=Object(w.a)(be),Ve=Ye.props,it=fe(ke,Ve.eventKey,we),ht=ke.props;if(!ht||typeof ke.type=="string")return ke;var Et=it===He.activeKey,xt=Object(D.a)(Object(D.a)({mode:ht.mode||Ve.mode,level:Ve.level,inlineIndent:Ve.inlineIndent,renderMenuItem:be.renderMenuItem,rootPrefixCls:Ve.prefixCls,index:we,parentMenu:Ve.parentMenu,manualRef:ht.disabled?void 0:Object(N.a)(ke.ref,Ni.bind(Object(w.a)(be))),eventKey:it,active:!ht.disabled&&Et,multiple:Ve.multiple,onClick:function(Qt){(ht.onClick||ue)(Qt),be.onClick(Qt)},onItemHover:be.onItemHover,motion:Ve.motion,subMenuOpenDelay:Ve.subMenuOpenDelay,subMenuCloseDelay:Ve.subMenuCloseDelay,forceSubMenuRender:Ve.forceSubMenuRender,onOpenChange:be.onOpenChange,onDeselect:be.onDeselect,onSelect:be.onSelect,builtinPlacements:Ve.builtinPlacements,itemIcon:ht.itemIcon||be.props.itemIcon,expandIcon:ht.expandIcon||be.props.expandIcon},Be),{},{direction:Ve.direction});return(Ve.mode==="inline"||Re())&&(xt.triggerSubMenuAction="click"),v.cloneElement(ke,Object(D.a)(Object(D.a)({},xt),{},{key:it||we}))},be.renderMenuItem=function(ke,we,Be){if(!ke)return null;var He=be.props.store.getState(),Ye={openKeys:He.openKeys,selectedKeys:He.selectedKeys,triggerSubMenuAction:be.props.triggerSubMenuAction,subMenuKey:Be};return be.renderCommonMenuItem(ke,we,Ye)},Ue.store.setState({activeKey:Object(D.a)(Object(D.a)({},Ue.store.getState().activeKey),{},Object(M.a)({},Ue.eventKey,Fn(Ue,Ue.activeKey)))}),be.instanceArray=[],be}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(be){return this.props.visible||be.visible||this.props.className!==be.className||!V()(this.props.style,be.style)}},{key:"componentDidUpdate",value:function(be){var ke=this.props,we="activeKey"in ke?ke.activeKey:ke.store.getState().activeKey[Ci(ke)],Be=Fn(ke,we);if(Be!==we)qn(ke.store,Ci(ke),Be);else if("activeKey"in be){var He=Fn(be,be.activeKey);Be!==He&&qn(ke.store,Ci(ke),Be)}}},{key:"render",value:function(){var be=this,ke=Object(h.a)({},this.props);this.instanceArray=[];var we=S()(ke.prefixCls,ke.className,"".concat(ke.prefixCls,"-").concat(ke.mode)),Be={className:we,role:ke.role||"menu"};ke.id&&(Be.id=ke.id),ke.focusable&&(Be.tabIndex=0,Be.onKeyDown=this.onKeyDown);var He=ke.prefixCls,Ye=ke.eventKey,Ve=ke.visible,it=ke.level,ht=ke.mode,Et=ke.overflowedIndicator,xt=ke.theme;return Z.forEach(function(Lt){return delete ke[Lt]}),delete ke.onClick,v.createElement(Di,Object(h.a)({},ke,{prefixCls:He,mode:ht,tag:"ul",level:it,theme:xt,visible:Ve,overflowedIndicator:Et},Be),Object(y.a)(ke.children).map(function(Lt,Qt){return be.renderMenuItem(Lt,Qt,Ye||"0-menu-")}))}}]),Qe}(v.Component);si.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ue};var pi=Object(_.b)()(si),Bi=pi,li=R("Kwbf");function an(Ie,Ge,Qe){var Ue=Ie.prefixCls,be=Ie.motion,ke=Ie.defaultMotions,we=ke===void 0?{}:ke,Be=Ie.openAnimation,He=Ie.openTransitionName,Ye=Ge.switchingModeFromInline;if(be)return be;if(Object(z.a)(Be)==="object"&&Be)Object(li.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Be=="string")return{motionName:"".concat(Ue,"-open-").concat(Be)};if(He)return{motionName:He};var Ve=we[Qe];return Ve||(Ye?null:we.other)}var Qi=function(Ie){Object(C.a)(Qe,Ie);var Ge=Object(x.a)(Qe);function Qe(Ue){var be;Object(L.a)(this,Qe),be=Ge.call(this,Ue),be.onSelect=function(Be){var He=Object(w.a)(be),Ye=He.props;if(Ye.selectable){var Ve=be.store.getState(),it=Ve.selectedKeys,ht=Be.key;Ye.multiple?it=it.concat([ht]):it=[ht],"selectedKeys"in Ye||be.store.setState({selectedKeys:it}),Ye.onSelect(Object(D.a)(Object(D.a)({},Be),{},{selectedKeys:it}))}},be.onClick=function(Be){var He=be.getRealMenuMode(),Ye=Object(w.a)(be),Ve=Ye.store,it=Ye.props.onOpenChange;He!=="inline"&&!("openKeys"in be.props)&&(Ve.setState({openKeys:[]}),it([])),be.props.onClick(Be)},be.onKeyDown=function(Be,He){be.innerMenu.getWrappedInstance().onKeyDown(Be,He)},be.onOpenChange=function(Be){var He=Object(w.a)(be),Ye=He.props,Ve=be.store.getState().openKeys.concat(),it=!1,ht=function(xt){var Lt=!1;if(xt.open)Lt=Ve.indexOf(xt.key)===-1,Lt&&Ve.push(xt.key);else{var Qt=Ve.indexOf(xt.key);Lt=Qt!==-1,Lt&&Ve.splice(Qt,1)}it=it||Lt};Array.isArray(Be)?Be.forEach(ht):ht(Be),it&&("openKeys"in be.props||be.store.setState({openKeys:Ve}),Ye.onOpenChange(Ve))},be.onDeselect=function(Be){var He=Object(w.a)(be),Ye=He.props;if(Ye.selectable){var Ve=be.store.getState().selectedKeys.concat(),it=Be.key,ht=Ve.indexOf(it);ht!==-1&&Ve.splice(ht,1),"selectedKeys"in Ye||be.store.setState({selectedKeys:Ve}),Ye.onDeselect(Object(D.a)(Object(D.a)({},Be),{},{selectedKeys:Ve}))}},be.onMouseEnter=function(Be){be.restoreModeVerticalFromInline();var He=be.props.onMouseEnter;He&&He(Be)},be.onTransitionEnd=function(Be){var He=Be.propertyName==="width"&&Be.target===Be.currentTarget,Ye=Be.target.className,Ve=Object.prototype.toString.call(Ye)==="[object SVGAnimatedString]"?Ye.animVal:Ye,it=Be.propertyName==="font-size"&&Ve.indexOf("anticon")>=0;(He||it)&&be.restoreModeVerticalFromInline()},be.setInnerMenu=function(Be){be.innerMenu=Be},be.isRootMenu=!0;var ke=Ue.defaultSelectedKeys,we=Ue.defaultOpenKeys;return"selectedKeys"in Ue&&(ke=Ue.selectedKeys||[]),"openKeys"in Ue&&(we=Ue.openKeys||[]),be.store=Object(_.c)({selectedKeys:ke,openKeys:we,activeKey:{"0-menu-":Fn(Ue,Ue.activeKey)}}),be.state={switchingModeFromInline:!1,prevProps:Ue,inlineOpenKeys:[],store:be.store},be}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(be){var ke=this.props,we=ke.siderCollapsed,Be=ke.inlineCollapsed,He=ke.onOpenChange;(!be.inlineCollapsed&&Be||!be.siderCollapsed&&we)&&He([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var be=this.props.collapsedWidth,ke=this.store,we=this.prevOpenKeys,Be=this.getInlineCollapsed()&&(be===0||be==="0"||be==="0px");Be?(this.prevOpenKeys=ke.getState().openKeys.concat(),this.store.setState({openKeys:[]})):we&&(this.store.setState({openKeys:we}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var be=this.props.mode,ke=this.state.switchingModeFromInline,we=this.getInlineCollapsed();return ke&&we?"inline":we?"vertical":be}},{key:"getInlineCollapsed",value:function(){var be=this.props,ke=be.inlineCollapsed,we=be.siderCollapsed;return we!==void 0?we:ke}},{key:"restoreModeVerticalFromInline",value:function(){var be=this.state.switchingModeFromInline;be&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var be=Object(D.a)({},Object(j.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ke=this.getRealMenuMode();return be.className+=" ".concat(be.prefixCls,"-root"),be.direction==="rtl"&&(be.className+=" ".concat(be.prefixCls,"-rtl")),be=Object(D.a)(Object(D.a)({},be),{},{mode:ke,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:an(this.props,this.state,ke)}),delete be.openAnimation,delete be.openTransitionName,v.createElement(_.a,{store:this.store},v.createElement(Bi,Object(h.a)({},be,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(be,ke){var we=ke.prevProps,Be=ke.store,He=Be.getState(),Ye={},Ve={prevProps:be};return we.mode==="inline"&&be.mode!=="inline"&&(Ve.switchingModeFromInline=!0),"openKeys"in be?Ye.openKeys=be.openKeys||[]:((be.inlineCollapsed&&!we.inlineCollapsed||be.siderCollapsed&&!we.siderCollapsed)&&(Ve.switchingModeFromInline=!0,Ve.inlineOpenKeys=He.openKeys,Ye.openKeys=[]),(!be.inlineCollapsed&&we.inlineCollapsed||!be.siderCollapsed&&we.siderCollapsed)&&(Ye.openKeys=ke.inlineOpenKeys,Ve.inlineOpenKeys=[])),Object.keys(Ye).length&&Be.setState(Ye),Ve}}]),Qe}(v.Component);Qi.defaultProps={selectable:!0,onClick:ue,onSelect:ue,onOpenChange:ue,onDeselect:ue,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:v.createElement("span",null,"\xB7\xB7\xB7")};var zt=Qi,er=function(Ie){Object(C.a)(Qe,Ie);var Ge=Object(x.a)(Qe);function Qe(){var Ue;return Object(L.a)(this,Qe),Ue=Ge.apply(this,arguments),Ue.onKeyDown=function(be){var ke=be.keyCode;return ke===m.a.ENTER?(Ue.onClick(be),!0):void 0},Ue.onMouseLeave=function(be){var ke=Ue.props,we=ke.eventKey,Be=ke.onItemHover,He=ke.onMouseLeave;Be({key:we,hover:!1}),He({key:we,domEvent:be})},Ue.onMouseEnter=function(be){var ke=Ue.props,we=ke.eventKey,Be=ke.onItemHover,He=ke.onMouseEnter;Be({key:we,hover:!0}),He({key:we,domEvent:be})},Ue.onClick=function(be){var ke=Ue.props,we=ke.eventKey,Be=ke.multiple,He=ke.onClick,Ye=ke.onSelect,Ve=ke.onDeselect,it=ke.isSelected,ht={key:we,keyPath:[we],item:Object(w.a)(Ue),domEvent:be};He(ht),Be?it?Ve(ht):Ye(ht):it||Ye(ht)},Ue.saveNode=function(be){Ue.node=be},Ue}return Object(O.a)(Qe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var be=this.props;be.onDestroy&&be.onDestroy(be.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var be,ke=Object(D.a)({},this.props),we=S()(this.getPrefixCls(),ke.className,(be={},Object(M.a)(be,this.getActiveClassName(),!ke.disabled&&ke.active),Object(M.a)(be,this.getSelectedClassName(),ke.isSelected),Object(M.a)(be,this.getDisabledClassName(),ke.disabled),be)),Be=Object(D.a)(Object(D.a)({},ke.attribute),{},{title:typeof ke.title=="string"?ke.title:void 0,className:we,role:ke.role||"menuitem","aria-disabled":ke.disabled});ke.role==="option"?Be=Object(D.a)(Object(D.a)({},Be),{},{role:"option","aria-selected":ke.isSelected}):(ke.role===null||ke.role==="none")&&(Be.role="none");var He={onClick:ke.disabled?null:this.onClick,onMouseLeave:ke.disabled?null:this.onMouseLeave,onMouseEnter:ke.disabled?null:this.onMouseEnter},Ye=Object(D.a)({},ke.style);ke.mode==="inline"&&(ke.direction==="rtl"?Ye.paddingRight=ke.inlineIndent*ke.level:Ye.paddingLeft=ke.inlineIndent*ke.level),Z.forEach(function(it){return delete ke[it]}),delete ke.direction;var Ve=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ve=v.createElement(this.props.itemIcon,this.props)),v.createElement("li",Object(h.a)({},Object(j.a)(ke,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Be,He,{style:Ye,ref:this.saveNode}),ke.children,Ve)}}]),Qe}(v.Component);er.isMenuItem=!0,er.defaultProps={onSelect:ue,onMouseEnter:ue,onMouseLeave:ue,manualRef:ue};var Jt=Object(_.b)(function(Ie,Ge){var Qe=Ie.activeKey,Ue=Ie.selectedKeys,be=Ge.eventKey,ke=Ge.subMenuKey;return{active:Qe[ke]===be,isSelected:Array.isArray(Ue)?Ue.indexOf(be)!==-1:Ue===be}})(er),yr=Jt,Rr=function(Ie){Object(C.a)(Qe,Ie);var Ge=Object(x.a)(Qe);function Qe(){var Ue;return Object(L.a)(this,Qe),Ue=Ge.apply(this,arguments),Ue.renderInnerMenuItem=function(be){var ke=Ue.props,we=ke.renderMenuItem,Be=ke.index;return we(be,Be,Ue.props.subMenuKey)},Ue}return Object(O.a)(Qe,[{key:"render",value:function(){var be=Object(h.a)({},this.props),ke=be.className,we=ke===void 0?"":ke,Be=be.rootPrefixCls,He="".concat(Be,"-item-group-title"),Ye="".concat(Be,"-item-group-list"),Ve=be.title,it=be.children;return Z.forEach(function(ht){return delete be[ht]}),delete be.direction,v.createElement("li",Object(h.a)({},be,{onClick:function(Et){return Et.stopPropagation()},className:"".concat(we," ").concat(Be,"-item-group")}),v.createElement("div",{className:He,title:typeof Ve=="string"?Ve:void 0},Ve),v.createElement("ul",{className:Ye},v.Children.map(it,this.renderInnerMenuItem)))}}]),Qe}(v.Component);Rr.isMenuItemGroup=!0,Rr.defaultProps={disabled:!0};var Qr=Rr,Tr=function(Ge){var Qe=Ge.className,Ue=Ge.rootPrefixCls,be=Ge.style;return v.createElement("li",{className:"".concat(Qe," ").concat(Ue,"-item-divider"),style:be})};Tr.defaultProps={disabled:!0,className:"",style:{}};var Rn=Tr,Kn=zt,wr=R("eDIo");function ji(Ie,Ge){var Qe=Ie.prefixCls,Ue=Ie.editable,be=Ie.locale,ke=Ie.style;return!Ue||Ue.showAdd===!1?null:v.createElement("button",{ref:Ge,type:"button",className:"".concat(Qe,"-nav-add"),style:ke,"aria-label":(be==null?void 0:be.addAriaLabel)||"Add tab",onClick:function(Be){Ue.onEdit("add",{event:Be})}},Ue.addIcon||"+")}var Fr=v.forwardRef(ji);function Pn(Ie,Ge){var Qe=Ie.prefixCls,Ue=Ie.id,be=Ie.tabs,ke=Ie.locale,we=Ie.mobile,Be=Ie.moreIcon,He=Be===void 0?"More":Be,Ye=Ie.moreTransitionName,Ve=Ie.style,it=Ie.className,ht=Ie.editable,Et=Ie.tabBarGutter,xt=Ie.rtl,Lt=Ie.onTabClick,Qt=Object(v.useState)(!1),xr=Object(g.a)(Qt,2),Cr=xr[0],_r=xr[1],jr=Object(v.useState)(null),Lr=Object(g.a)(jr,2),Or=Lr[0],Zr=Lr[1],Kr="".concat(Ue,"-more-popup"),kn="".concat(Qe,"-dropdown"),Gr=Or!==null?"".concat(Kr,"-").concat(Or):null,or=ke==null?void 0:ke.dropdownAriaLabel,nr=v.createElement(Kn,{onClick:function(En){var bn=En.key,Wn=En.domEvent;Lt(bn,Wn),_r(!1)},id:Kr,tabIndex:-1,role:"listbox","aria-activedescendant":Gr,selectedKeys:[Or],"aria-label":or!==void 0?or:"expanded dropdown"},be.map(function(un){return v.createElement(yr,{key:un.key,id:"".concat(Kr,"-").concat(un.key),role:"option","aria-controls":Ue&&"".concat(Ue,"-panel-").concat(un.key),disabled:un.disabled},un.tab)}));function Xr(un){for(var En=be.filter(function(bi){return!bi.disabled}),bn=En.findIndex(function(bi){return bi.key===Or})||0,Wn=En.length,ti=0;ti<Wn;ti+=1){bn=(bn+un+Wn)%Wn;var In=En[bn];if(!In.disabled){Zr(In.key);return}}}function qr(un){var En=un.which;if(!Cr){[m.a.DOWN,m.a.SPACE,m.a.ENTER].includes(En)&&(_r(!0),un.preventDefault());return}switch(En){case m.a.UP:Xr(-1),un.preventDefault();break;case m.a.DOWN:Xr(1),un.preventDefault();break;case m.a.ESC:_r(!1);break;case m.a.SPACE:case m.a.ENTER:Or!==null&&Lt(Or,un);break}}Object(v.useEffect)(function(){var un=document.getElementById(Gr);un&&un.scrollIntoView&&un.scrollIntoView(!1)},[Or]),Object(v.useEffect)(function(){Cr||Zr(null)},[Cr]);var Xt=Object(M.a)({},xt?"marginLeft":"marginRight",Et);be.length||(Xt.visibility="hidden",Xt.order=1);var tn=S()(Object(M.a)({},"".concat(kn,"-rtl"),xt)),Ln=we?null:v.createElement(wr.a,{prefixCls:kn,overlay:nr,trigger:["hover"],visible:Cr,transitionName:Ye,onVisibleChange:_r,overlayClassName:tn,mouseEnterDelay:.1,mouseLeaveDelay:.1},v.createElement("button",{type:"button",className:"".concat(Qe,"-nav-more"),style:Xt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Kr,id:"".concat(Ue,"-more"),"aria-expanded":Cr,onKeyDown:qr},He));return v.createElement("div",{className:S()("".concat(Qe,"-nav-operations"),it),style:Ve,ref:Ge},Ln,v.createElement(Fr,{prefixCls:Qe,locale:ke,editable:ht}))}var mi=v.forwardRef(Pn),ei=Object(v.createContext)(null),zr=.1,Ur=.01,Dr=20,ui=Math.pow(.995,Dr);function Xi(){var Ie=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ie)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ie.substr(0,4)))}function Yi(Ie,Ge){var Qe=Object(v.useState)(),Ue=Object(g.a)(Qe,2),be=Ue[0],ke=Ue[1],we=Object(v.useState)(0),Be=Object(g.a)(we,2),He=Be[0],Ye=Be[1],Ve=Object(v.useState)(0),it=Object(g.a)(Ve,2),ht=it[0],Et=it[1],xt=Object(v.useState)(),Lt=Object(g.a)(xt,2),Qt=Lt[0],xr=Lt[1],Cr=Object(v.useRef)();function _r(or){var nr=or.touches[0],Xr=nr.screenX,qr=nr.screenY;ke({x:Xr,y:qr}),window.clearInterval(Cr.current)}function jr(or){if(!be)return;or.preventDefault();var nr=or.touches[0],Xr=nr.screenX,qr=nr.screenY;ke({x:Xr,y:qr});var Xt=Xr-be.x,tn=qr-be.y;Ge(Xt,tn);var Ln=Date.now();Ye(Ln),Et(Ln-He),xr({x:Xt,y:tn})}function Lr(){if(!be)return;if(ke(null),xr(null),Qt){var or=Qt.x/ht,nr=Qt.y/ht,Xr=Math.abs(or),qr=Math.abs(nr);if(Math.max(Xr,qr)<zr)return;var Xt=or,tn=nr;Cr.current=window.setInterval(function(){if(Math.abs(Xt)<Ur&&Math.abs(tn)<Ur){window.clearInterval(Cr.current);return}Xt*=ui,tn*=ui,Ge(Xt*Dr,tn*Dr)},Dr)}}var Or=Object(v.useRef)(0),Zr=Object(v.useRef)(!1),Kr=Object(v.useRef)();function kn(or){var nr=or.deltaX,Xr=or.deltaY,qr=0,Xt=Math.abs(nr),tn=Math.abs(Xr);Xt===tn?qr=Kr.current==="x"?nr:Xr:Xt>tn?(qr=nr,Kr.current="x"):(qr=Xr,Kr.current="y");var Ln=Date.now();Ln-Or.current>100&&(Zr.current=!1),(Ge(-qr,-qr)||Zr.current)&&(or.preventDefault(),Zr.current=!0),Or.current=Ln}var Gr=Object(v.useRef)(null);Gr.current={onTouchStart:_r,onTouchMove:jr,onTouchEnd:Lr,onWheel:kn},v.useEffect(function(){function or(Xt){Gr.current.onTouchStart(Xt)}function nr(Xt){Gr.current.onTouchMove(Xt)}function Xr(Xt){Gr.current.onTouchEnd(Xt)}function qr(Xt){Gr.current.onWheel(Xt)}return document.addEventListener("touchmove",nr,{passive:!1}),document.addEventListener("touchend",Xr,{passive:!1}),Ie.current.addEventListener("touchstart",or,{passive:!1}),Ie.current.addEventListener("wheel",qr),function(){document.removeEventListener("touchmove",nr),document.removeEventListener("touchend",Xr)}},[])}function ar(){var Ie=Object(v.useRef)(new Map);function Ge(Ue){return Ie.current.has(Ue)||Ie.current.set(Ue,v.createRef()),Ie.current.get(Ue)}function Qe(Ue){Ie.current.delete(Ue)}return[Ge,Qe]}function jt(Ie,Ge){var Qe=v.useRef(Ie),Ue=v.useState({}),be=Object(g.a)(Ue,2),ke=be[1];function we(Be){var He=typeof Be=="function"?Be(Qe.current):Be;He!==Qe.current&&Ge(He,Qe.current),Qe.current=He,ke({})}return[Qe.current,we]}var mr=function(Ge){var Qe=Ge.position,Ue=Ge.prefixCls,be=Ge.extra;if(!be)return null;var ke,we=be;return Qe==="right"&&(ke=we.right||!we.left&&we||null),Qe==="left"&&(ke=we.left||null),ke?v.createElement("div",{className:"".concat(Ue,"-extra-content")},ke):null};function br(Ie,Ge){var Qe,Ue=v.useContext(ei),be=Ue.prefixCls,ke=Ue.tabs,we=Ie.className,Be=Ie.style,He=Ie.id,Ye=Ie.animated,Ve=Ie.activeKey,it=Ie.rtl,ht=Ie.extra,Et=Ie.editable,xt=Ie.locale,Lt=Ie.tabPosition,Qt=Ie.tabBarGutter,xr=Ie.children,Cr=Ie.onTabClick,_r=Ie.onTabScroll,jr=Object(v.useRef)(),Lr=Object(v.useRef)(),Or=Object(v.useRef)(),Zr=Object(v.useRef)(),Kr=ar(),kn=Object(g.a)(Kr,2),Gr=kn[0],or=kn[1],nr=Lt==="top"||Lt==="bottom",Xr=jt(0,function(pn,Yr){nr&&_r&&_r({direction:pn>Yr?"left":"right"})}),qr=Object(g.a)(Xr,2),Xt=qr[0],tn=qr[1],Ln=jt(0,function(pn,Yr){!nr&&_r&&_r({direction:pn>Yr?"top":"bottom"})}),un=Object(g.a)(Ln,2),En=un[0],bn=un[1],Wn=Object(v.useState)(0),ti=Object(g.a)(Wn,2),In=ti[0],bi=ti[1],Wi=Object(v.useState)(0),Si=Object(g.a)(Wi,2),ri=Si[0],On=Si[1],wn=Object(v.useState)(0),Nn=Object(g.a)(wn,2),Mn=Nn[0],Hi=Nn[1],ra=Object(v.useState)(0),na=Object(g.a)(ra,2),xn=na[0],Ji=na[1],ia=Object(v.useState)(null),_n=Object(g.a)(ia,2),vn=_n[0],ni=_n[1],To=Object(v.useState)(null),eo=Object(g.a)(To,2),aa=eo[0],va=eo[1],Pa=Object(v.useState)(0),to=Object(g.a)(Pa,2),Ia=to[0],Xo=to[1],Yo=Object(v.useState)(0),_o=Object(g.a)(Yo,2),ro=_o[0],no=_o[1],ya=p(new Map),ba=Object(g.a)(ya,2),$o=ba[0],Na=ba[1],Oa=l(ke,$o,In),xa="".concat(be,"-nav-operations-hidden"),Ea=0,zi=0;nr?it?(Ea=0,zi=Math.max(0,In-vn)):(Ea=Math.min(0,vn-In),zi=0):(Ea=Math.min(0,aa-ri),zi=0);function ca(pn){return pn<Ea?[Ea,!1]:pn>zi?[zi,!1]:[pn,!0]}var oa=Object(v.useRef)(),Aa=Object(v.useState)(),da=Object(g.a)(Aa,2),ja=da[0],io=da[1];function Fa(){io(Date.now())}function ao(){window.clearTimeout(oa.current)}Yi(jr,function(pn,Yr){var ii=!1;function _i(wa,Zi){wa(function(ka){var la=ca(ka+Zi),ai=Object(g.a)(la,2),Wa=ai[0],so=ai[1];return ii=so,Wa})}if(nr){if(vn>=In)return ii;_i(tn,pn)}else{if(aa>=ri)return ii;_i(bn,Yr)}return ao(),Fa(),ii}),Object(v.useEffect)(function(){return ao(),ja&&(oa.current=window.setTimeout(function(){io(0)},100)),ao},[ja]);function sa(){var pn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ve,Yr=Oa.get(pn);if(!Yr)return;if(nr){var ii=Xt;it?Yr.right<Xt?ii=Yr.right:Yr.right+Yr.width>Xt+vn&&(ii=Yr.right+Yr.width-vn):Yr.left<-Xt?ii=-Yr.left:Yr.left+Yr.width>-Xt+vn&&(ii=-(Yr.left+Yr.width-vn)),bn(0),tn(ca(ii)[0])}else{var _i=En;Yr.top<-En?_i=-Yr.top:Yr.top+Yr.height>-En+aa&&(_i=-(Yr.top+Yr.height-aa)),tn(0),bn(ca(_i)[0])}}var ha=b(Oa,{width:vn,height:aa,left:Xt,top:En},{width:Mn,height:xn},{width:Ia,height:ro},Object(D.a)(Object(D.a)({},Ie),{},{tabs:ke})),Oo=Object(g.a)(ha,2),Jo=Oo[0],Qo=Oo[1],Zo=ke.map(function(pn){var Yr=pn.key;return v.createElement(t,{id:He,prefixCls:be,key:Yr,rtl:it,tab:pn,closable:pn.closable,editable:Et,active:Yr===Ve,tabPosition:Lt,tabBarGutter:Qt,renderWrapper:xr,removeAriaLabel:xt==null?void 0:xt.removeAriaLabel,ref:Gr(Yr),onClick:function(_i){Cr(Yr,_i)},onRemove:function(){or(Yr)},onFocus:function(){sa(Yr),Fa(),it||(jr.current.scrollLeft=0),jr.current.scrollTop=0}})}),oo=u(function(){var pn,Yr,ii,_i,wa,Zi,ka,la,ai,Wa=((pn=jr.current)===null||pn===void 0?void 0:pn.offsetWidth)||0,so=((Yr=jr.current)===null||Yr===void 0?void 0:Yr.offsetHeight)||0,lo=((ii=Zr.current)===null||ii===void 0?void 0:ii.offsetWidth)||0,Oi=((_i=Zr.current)===null||_i===void 0?void 0:_i.offsetHeight)||0,hn=((wa=Or.current)===null||wa===void 0?void 0:wa.offsetWidth)||0,Gi=((Zi=Or.current)===null||Zi===void 0?void 0:Zi.offsetHeight)||0;ni(Wa),va(so),Xo(lo),no(Oi);var qi=(((ka=Lr.current)===null||ka===void 0?void 0:ka.offsetWidth)||0)-lo,ea=(((la=Lr.current)===null||la===void 0?void 0:la.offsetHeight)||0)-Oi;bi(qi),On(ea);var uo=(ai=Or.current)===null||ai===void 0?void 0:ai.className.includes(xa);Hi(qi-(uo?0:hn)),Ji(ea-(uo?0:Gi)),Na(function(){var Ha=new Map;return ke.forEach(function(Lo){var Mo=Lo.key,pa=Gr(Mo).current;pa&&Ha.set(Mo,{width:pa.offsetWidth,height:pa.offsetHeight,left:pa.offsetLeft,top:pa.offsetTop})}),Ha})}),qo=ke.slice(0,Jo),Ti=ke.slice(Qo+1),Vn=[].concat(Object(o.a)(qo),Object(o.a)(Ti)),gi=Object(v.useState)(),Xn=Object(g.a)(gi,2),Ra=Xn[0],es=Xn[1],Ki=Oa.get(Ve),Ao=Object(v.useRef)();function Ro(){s.a.cancel(Ao.current)}Object(v.useEffect)(function(){var pn={};return Ki&&(nr?(it?pn.right=Ki.right:pn.left=Ki.left,pn.width=Ki.width):(pn.top=Ki.top,pn.height=Ki.height)),Ro(),Ao.current=s()(function(){es(pn)}),Ro},[Ki,nr,it]),Object(v.useEffect)(function(){sa()},[Ve,Ki,Oa,nr]),Object(v.useEffect)(function(){oo()},[it,Qt,Ve,ke.map(function(pn){return pn.key}).join("_")]);var Do=!!Vn.length,fa="".concat(be,"-nav-wrap"),Ua,Da,ko,Ba;return nr?it?(Da=Xt>0,Ua=Xt+vn<In):(Ua=Xt<0,Da=-Xt+vn<In):(ko=En<0,Ba=-En+aa<ri),v.createElement("div",{ref:Ge,role:"tablist",className:S()("".concat(be,"-nav"),we),style:Be,onKeyDown:function(){Fa()}},v.createElement(mr,{position:"left",extra:ht,prefixCls:be}),v.createElement(d.a,{onResize:oo},v.createElement("div",{className:S()(fa,(Qe={},Object(M.a)(Qe,"".concat(fa,"-ping-left"),Ua),Object(M.a)(Qe,"".concat(fa,"-ping-right"),Da),Object(M.a)(Qe,"".concat(fa,"-ping-top"),ko),Object(M.a)(Qe,"".concat(fa,"-ping-bottom"),Ba),Qe)),ref:jr},v.createElement(d.a,{onResize:oo},v.createElement("div",{ref:Lr,className:"".concat(be,"-nav-list"),style:{transform:"translate(".concat(Xt,"px, ").concat(En,"px)"),transition:ja?"none":void 0}},Zo,v.createElement(Fr,{ref:Zr,prefixCls:be,locale:xt,editable:Et,style:{visibility:Do?"hidden":null}}),v.createElement("div",{className:S()("".concat(be,"-ink-bar"),Object(M.a)({},"".concat(be,"-ink-bar-animated"),Ye.inkBar)),style:Ra}))))),v.createElement(mi,Object.assign({},Ie,{ref:Or,prefixCls:be,tabs:Vn,className:!Do&&xa})),v.createElement(mr,{position:"right",extra:ht,prefixCls:be}))}var on=v.forwardRef(br);function kr(Ie){var Ge=Ie.id,Qe=Ie.activeKey,Ue=Ie.animated,be=Ie.tabPosition,ke=Ie.rtl,we=Ie.destroyInactiveTabPane,Be=v.useContext(ei),He=Be.prefixCls,Ye=Be.tabs,Ve=Ue.tabPane,it=Ye.findIndex(function(ht){return ht.key===Qe});return v.createElement("div",{className:S()("".concat(He,"-content-holder"))},v.createElement("div",{className:S()("".concat(He,"-content"),"".concat(He,"-content-").concat(be),Object(M.a)({},"".concat(He,"-content-animated"),Ve)),style:it&&Ve?Object(M.a)({},ke?"marginRight":"marginLeft","-".concat(it,"00%")):null},Ye.map(function(ht){return v.cloneElement(ht.node,{key:ht.key,prefixCls:He,tabKey:ht.key,id:Ge,animated:Ve,active:ht.key===Qe,destroyInactiveTabPane:we})})))}function Dn(Ie){var Ge=Ie.prefixCls,Qe=Ie.forceRender,Ue=Ie.className,be=Ie.style,ke=Ie.id,we=Ie.active,Be=Ie.animated,He=Ie.destroyInactiveTabPane,Ye=Ie.tabKey,Ve=Ie.children,it=v.useState(Qe),ht=Object(g.a)(it,2),Et=ht[0],xt=ht[1];v.useEffect(function(){we?xt(!0):He&&xt(!1)},[we,He]);var Lt={};return we||(Be?(Lt.visibility="hidden",Lt.height=0,Lt.overflowY="hidden"):Lt.display="none"),v.createElement("div",{id:ke&&"".concat(ke,"-panel-").concat(Ye),role:"tabpanel",tabIndex:we?0:-1,"aria-labelledby":ke&&"".concat(ke,"-tab-").concat(Ye),"aria-hidden":!we,style:Object(D.a)(Object(D.a)({},Lt),be),className:S()("".concat(Ge,"-tabpane"),we&&"".concat(Ge,"-tabpane-active"),Ue)},(we||Et||Qe)&&Ve)}var Tn=0;function ki(Ie){return Object(y.a)(Ie).map(function(Ge){if(v.isValidElement(Ge)){var Qe=Ge.key!==void 0?String(Ge.key):void 0;return Object(D.a)(Object(D.a)({key:Qe},Ge.props),{},{node:Ge})}return null}).filter(function(Ge){return Ge})}function Bn(Ie,Ge){var Qe,Ue=Ie.id,be=Ie.prefixCls,ke=be===void 0?"rc-tabs":be,we=Ie.className,Be=Ie.children,He=Ie.direction,Ye=Ie.activeKey,Ve=Ie.defaultActiveKey,it=Ie.editable,ht=Ie.animated,Et=Ie.tabPosition,xt=Et===void 0?"top":Et,Lt=Ie.tabBarGutter,Qt=Ie.tabBarStyle,xr=Ie.tabBarExtraContent,Cr=Ie.locale,_r=Ie.moreIcon,jr=Ie.moreTransitionName,Lr=Ie.destroyInactiveTabPane,Or=Ie.renderTabBar,Zr=Ie.onChange,Kr=Ie.onTabClick,kn=Ie.onTabScroll,Gr=Object(T.a)(Ie,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),or=ki(Be),nr=He==="rtl",Xr;ht===!1?Xr={inkBar:!1,tabPane:!1}:Xr=Object(D.a)({inkBar:!0,tabPane:!1},ht!==!0?ht:null);var qr=Object(v.useState)(!1),Xt=Object(g.a)(qr,2),tn=Xt[0],Ln=Xt[1];Object(v.useEffect)(function(){Ln(Xi())},[]);var un=Object(c.a)(function(){var xn;return(xn=or[0])===null||xn===void 0?void 0:xn.key},{value:Ye,defaultValue:Ve}),En=Object(g.a)(un,2),bn=En[0],Wn=En[1],ti=Object(v.useState)(function(){return or.findIndex(function(xn){return xn.key===bn})}),In=Object(g.a)(ti,2),bi=In[0],Wi=In[1];Object(v.useEffect)(function(){var xn=or.findIndex(function(ia){return ia.key===bn});if(xn===-1){var Ji;xn=Math.max(0,Math.min(bi,or.length-1)),Wn((Ji=or[xn])===null||Ji===void 0?void 0:Ji.key)}Wi(xn)},[or.map(function(xn){return xn.key}).join("_"),bn,bi]);var Si=Object(c.a)(null,{value:Ue}),ri=Object(g.a)(Si,2),On=ri[0],wn=ri[1],Nn=xt;tn&&!["left","right"].includes(xt)&&(Nn="top"),Object(v.useEffect)(function(){Ue||(wn("rc-tabs-".concat(Tn)),Tn+=1)},[]);function Mn(xn,Ji){Kr==null||Kr(xn,Ji),Wn(xn),Zr==null||Zr(xn)}var Hi={id:On,activeKey:bn,animated:Xr,tabPosition:Nn,rtl:nr,mobile:tn},ra,na=Object(D.a)(Object(D.a)({},Hi),{},{editable:it,locale:Cr,moreIcon:_r,moreTransitionName:jr,tabBarGutter:Lt,onTabClick:Mn,onTabScroll:kn,extra:xr,style:Qt,panes:Be});return Or?ra=Or(na,on):ra=v.createElement(on,Object.assign({},na)),v.createElement(ei.Provider,{value:{tabs:or,prefixCls:ke}},v.createElement("div",Object.assign({ref:Ge,id:Ue,className:S()(ke,"".concat(ke,"-").concat(Nn),(Qe={},Object(M.a)(Qe,"".concat(ke,"-mobile"),tn),Object(M.a)(Qe,"".concat(ke,"-editable"),it),Object(M.a)(Qe,"".concat(ke,"-rtl"),nr),Qe),we)},Gr),ra,v.createElement(kr,Object.assign({destroyInactiveTabPane:Lr},Hi,{animated:Xr}))))}var Gn=v.forwardRef(Bn);Gn.TabPane=Dn;var $n=Gn,$i=$.b=$n},kSUc:function(I,$,R){},lOMy:function(I,$,R){},lPiR:function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){return function(g){var T=M,D=T.lib,v=D.WordArray,f=D.Hasher,S=T.algo,y=[],c=[];(function(){function s(m){for(var i=g.sqrt(m),t=2;t<=i;t++)if(!(m%t))return!1;return!0}function d(m){return(m-(m|0))*4294967296|0}for(var u=2,p=0;p<64;)s(u)&&(p<8&&(y[p]=d(g.pow(u,1/2))),c[p]=d(g.pow(u,1/3)),p++),u++})();var o=[],r=S.SHA256=f.extend({_doReset:function(){this._hash=new v.init(y.slice(0))},_doProcessBlock:function(s,d){for(var u=this._hash.words,p=u[0],m=u[1],i=u[2],t=u[3],a=u[4],l=u[5],E=u[6],b=u[7],h=0;h<64;h++){if(h<16)o[h]=s[d+h]|0;else{var L=o[h-15],O=(L<<25|L>>>7)^(L<<14|L>>>18)^L>>>3,w=o[h-2],C=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;o[h]=O+o[h-7]+C+o[h-16]}var x=a&l^~a&E,_=p&m^p&i^m&i,j=(p<<30|p>>>2)^(p<<19|p>>>13)^(p<<10|p>>>22),N=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),P=b+N+x+c[h]+o[h],V=j+_;b=E,E=l,l=a,a=t+P|0,t=i,i=m,m=p,p=P+V|0}u[0]=u[0]+p|0,u[1]=u[1]+m|0,u[2]=u[2]+i|0,u[3]=u[3]+t|0,u[4]=u[4]+a|0,u[5]=u[5]+l|0,u[6]=u[6]+E|0,u[7]=u[7]+b|0},_doFinalize:function(){var s=this._data,d=s.words,u=this._nDataBytes*8,p=s.sigBytes*8;return d[p>>>5]|=128<<24-p%32,d[(p+64>>>9<<4)+14]=g.floor(u/4294967296),d[(p+64>>>9<<4)+15]=u,s.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var s=f.clone.call(this);return s._hash=this._hash.clone(),s}});T.SHA256=f._createHelper(r),T.HmacSHA256=f._createHmacHelper(r)}(Math),M.SHA256})},lZu9:function(I,$,R){(function(M){M(R("VrN/"),R("1eCo"),R("8EBN"))})(function(M){"use strict";M.defineMode("markdown",function(g,T){var D=M.getMode(g,"text/html"),v=D.name=="null";function f(U){if(M.findModeByName){var W=M.findModeByName(U);W&&(U=W.mime||W.mimes[0])}var H=M.getMode(g,U);return H.name=="null"?null:H}T.highlightFormatting===void 0&&(T.highlightFormatting=!1),T.maxBlockquoteDepth===void 0&&(T.maxBlockquoteDepth=0),T.taskLists===void 0&&(T.taskLists=!1),T.strikethrough===void 0&&(T.strikethrough=!1),T.emoji===void 0&&(T.emoji=!1),T.fencedCodeBlockHighlighting===void 0&&(T.fencedCodeBlockHighlighting=!0),T.fencedCodeBlockDefaultMode===void 0&&(T.fencedCodeBlockDefaultMode="text/plain"),T.xml===void 0&&(T.xml=!0),T.tokenTypeOverrides===void 0&&(T.tokenTypeOverrides={});var S={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 y in S)S.hasOwnProperty(y)&&T.tokenTypeOverrides[y]&&(S[y]=T.tokenTypeOverrides[y]);var c=/^([*\-_])(?:\s*\1){2,}\s*$/,o=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,r=/^\[(x| )\](?=\s)/i,s=T.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,t=" ";function a(U,W,H){return W.f=W.inline=H,H(U,W)}function l(U,W,H){return W.f=W.block=H,H(U,W)}function E(U){return!U||!/\S/.test(U.string)}function b(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==L){var W=v;if(!W){var H=M.innerMode(D,U.htmlState);W=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}W&&(U.f=x,U.block=h,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function h(U,W){var H=U.column()===W.indentation,q=E(W.prevLine.stream),ne=W.indentedCode,te=W.prevLine.hr,_e=W.list!==!1,Ce=(W.listStack[W.listStack.length-1]||0)+3;W.indentedCode=!1;var me=W.indentation;if(W.indentationDiff===null&&(W.indentationDiff=W.indentation,_e)){for(W.list=null;me<W.listStack[W.listStack.length-1];)W.listStack.pop(),W.listStack.length?W.indentation=W.listStack[W.listStack.length-1]:W.list=!1;W.list!==!1&&(W.indentationDiff=me-W.listStack[W.listStack.length-1])}var Me=!q&&!te&&!W.prevLine.header&&(!_e||!ne)&&!W.prevLine.fencedCodeEnd,Oe=(W.list===!1||te||q)&&W.indentation<=Ce&&U.match(c),he=null;if(W.indentationDiff>=4&&(ne||W.prevLine.fencedCodeEnd||W.prevLine.header||q))return U.skipToEnd(),W.indentedCode=!0,S.code;if(U.eatSpace())return null;if(H&&W.indentation<=Ce&&(he=U.match(s))&&he[1].length<=6)return W.quote=0,W.header=he[1].length,W.thisLine.header=!0,T.highlightFormatting&&(W.formatting="header"),W.f=W.inline,w(W);if(W.indentation<=Ce&&U.eat(">"))return W.quote=H?1:W.quote+1,T.highlightFormatting&&(W.formatting="quote"),U.eatSpace(),w(W);if(!Oe&&!W.setext&&H&&W.indentation<=Ce&&(he=U.match(o))){var ce=he[1]?"ol":"ul";return W.indentation=me+U.current().length,W.list=!0,W.quote=0,W.listStack.push(W.indentation),W.em=!1,W.strong=!1,W.code=!1,W.strikethrough=!1,T.taskLists&&U.match(r,!1)&&(W.taskList=!0),W.f=W.inline,T.highlightFormatting&&(W.formatting=["list","list-"+ce]),w(W)}else{if(H&&W.indentation<=Ce&&(he=U.match(p,!0)))return W.quote=0,W.fencedEndRE=new RegExp(he[1]+"+ *$"),W.localMode=T.fencedCodeBlockHighlighting&&f(he[2]||T.fencedCodeBlockDefaultMode),W.localMode&&(W.localState=M.startState(W.localMode)),W.f=W.block=O,T.highlightFormatting&&(W.formatting="code-block"),W.code=-1,w(W);if(W.setext||(!Me||!_e)&&!W.quote&&W.list===!1&&!W.code&&!Oe&&!m.test(U.string)&&(he=U.lookAhead(1))&&(he=he.match(d)))return W.setext?(W.header=W.setext,W.setext=0,U.skipToEnd(),T.highlightFormatting&&(W.formatting="header")):(W.header=he[0].charAt(0)=="="?1:2,W.setext=W.header),W.thisLine.header=!0,W.f=W.inline,w(W);if(Oe)return U.skipToEnd(),W.hr=!0,W.thisLine.hr=!0,S.hr;if(U.peek()==="[")return a(U,W,V)}return a(U,W,W.inline)}function L(U,W){var H=D.token(U,W.htmlState);if(!v){var q=M.innerMode(D,W.htmlState);(q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText||W.md_inside&&U.current().indexOf(">")>-1)&&(W.f=x,W.block=h,W.htmlState=null)}return H}function O(U,W){var H=W.listStack[W.listStack.length-1]||0,q=W.indentation<H,ne=H+3;if(W.fencedEndRE&&W.indentation<=ne&&(q||U.match(W.fencedEndRE))){T.highlightFormatting&&(W.formatting="code-block");var te;return q||(te=w(W)),W.localMode=W.localState=null,W.block=h,W.f=x,W.fencedEndRE=null,W.code=0,W.thisLine.fencedCodeEnd=!0,q?l(U,W,W.block):te}else return W.localMode?W.localMode.token(U,W.localState):(U.skipToEnd(),S.code)}function w(U){var W=[];if(U.formatting){W.push(S.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var H=0;H<U.formatting.length;H++)W.push(S.formatting+"-"+U.formatting[H]),U.formatting[H]==="header"&&W.push(S.formatting+"-"+U.formatting[H]+"-"+U.header),U.formatting[H]==="quote"&&(!T.maxBlockquoteDepth||T.maxBlockquoteDepth>=U.quote?W.push(S.formatting+"-"+U.formatting[H]+"-"+U.quote):W.push("error"))}if(U.taskOpen)return W.push("meta"),W.length?W.join(" "):null;if(U.taskClosed)return W.push("property"),W.length?W.join(" "):null;if(U.linkHref?W.push(S.linkHref,"url"):(U.strong&&W.push(S.strong),U.em&&W.push(S.em),U.strikethrough&&W.push(S.strikethrough),U.emoji&&W.push(S.emoji),U.linkText&&W.push(S.linkText),U.code&&W.push(S.code),U.image&&W.push(S.image),U.imageAltText&&W.push(S.imageAltText,"link"),U.imageMarker&&W.push(S.imageMarker)),U.header&&W.push(S.header,S.header+"-"+U.header),U.quote&&(W.push(S.quote),!T.maxBlockquoteDepth||T.maxBlockquoteDepth>=U.quote?W.push(S.quote+"-"+U.quote):W.push(S.quote+"-"+T.maxBlockquoteDepth)),U.list!==!1){var q=(U.listStack.length-1)%3;q?q===1?W.push(S.list2):W.push(S.list3):W.push(S.list1)}return U.trailingSpaceNewLine?W.push("trailing-space-new-line"):U.trailingSpace&&W.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),W.length?W.join(" "):null}function C(U,W){return U.match(u,!0)?w(W):void 0}function x(U,W){var H=W.text(U,W);if(typeof H!="undefined")return H;if(W.list)return W.list=null,w(W);if(W.taskList){var q=U.match(r,!0)[1]===" ";return q?W.taskOpen=!0:W.taskClosed=!0,T.highlightFormatting&&(W.formatting="task"),W.taskList=!1,w(W)}if(W.taskOpen=!1,W.taskClosed=!1,W.header&&U.match(/^#+$/,!0))return T.highlightFormatting&&(W.formatting="header"),w(W);var ne=U.next();if(W.linkTitle){W.linkTitle=!1;var te=ne;ne==="("&&(te=")"),te=(te+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var _e="^\\s*(?:[^"+te+"\\\\]+|\\\\\\\\|\\\\.)"+te;if(U.match(new RegExp(_e),!0))return S.linkHref}if(ne==="`"){var Ce=W.formatting;T.highlightFormatting&&(W.formatting="code"),U.eatWhile("`");var me=U.current().length;if(W.code==0&&(!W.quote||me==1))return W.code=me,w(W);if(me==W.code){var Me=w(W);return W.code=0,Me}else return W.formatting=Ce,w(W)}else if(W.code)return w(W);if(ne==="\\"&&(U.next(),T.highlightFormatting)){var Oe=w(W),he=S.formatting+"-escape";return Oe?Oe+" "+he:he}if(ne==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return W.imageMarker=!0,W.image=!0,T.highlightFormatting&&(W.formatting="image"),w(W);if(ne==="["&&W.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return W.imageMarker=!1,W.imageAltText=!0,T.highlightFormatting&&(W.formatting="image"),w(W);if(ne==="]"&&W.imageAltText){T.highlightFormatting&&(W.formatting="image");var Oe=w(W);return W.imageAltText=!1,W.image=!1,W.inline=W.f=j,Oe}if(ne==="["&&!W.image)return W.linkText&&U.match(/^.*?\]/)||(W.linkText=!0,T.highlightFormatting&&(W.formatting="link")),w(W);if(ne==="]"&&W.linkText){T.highlightFormatting&&(W.formatting="link");var Oe=w(W);return W.linkText=!1,W.inline=W.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?j:x,Oe}if(ne==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){W.f=W.inline=_,T.highlightFormatting&&(W.formatting="link");var Oe=w(W);return Oe?Oe+=" ":Oe="",Oe+S.linkInline}if(ne==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){W.f=W.inline=_,T.highlightFormatting&&(W.formatting="link");var Oe=w(W);return Oe?Oe+=" ":Oe="",Oe+S.linkEmail}if(T.xml&&ne==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=U.string.indexOf(">",U.pos);if(ce!=-1){var se=U.string.substring(U.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(se)&&(W.md_inside=!0)}return U.backUp(1),W.htmlState=M.startState(D),l(U,W,L)}if(T.xml&&ne==="<"&&U.match(/^\/\w*?>/))return W.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var Te=1,re=U.pos==1?" ":U.string.charAt(U.pos-2);Te<3&&U.eat(ne);)Te++;var ue=U.peek()||" ",fe=!/\s/.test(ue)&&(!i.test(ue)||/\s/.test(re)||i.test(re)),ee=!/\s/.test(re)&&(!i.test(re)||/\s/.test(ue)||i.test(ue)),Q=null,X=null;if(Te%2&&(!W.em&&fe&&(ne==="*"||!ee||i.test(re))?Q=!0:W.em==ne&&ee&&(ne==="*"||!fe||i.test(ue))&&(Q=!1)),Te>1&&(!W.strong&&fe&&(ne==="*"||!ee||i.test(re))?X=!0:W.strong==ne&&ee&&(ne==="*"||!fe||i.test(ue))&&(X=!1)),X!=null||Q!=null){T.highlightFormatting&&(W.formatting=Q==null?"strong":X==null?"em":"strong em"),Q===!0&&(W.em=ne),X===!0&&(W.strong=ne);var Me=w(W);return Q===!1&&(W.em=!1),X===!1&&(W.strong=!1),Me}}else if(ne===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return w(W);U.backUp(1)}if(T.strikethrough){if(ne==="~"&&U.eatWhile(ne)){if(W.strikethrough){T.highlightFormatting&&(W.formatting="strikethrough");var Me=w(W);return W.strikethrough=!1,Me}else if(U.match(/^[^\s]/,!1))return W.strikethrough=!0,T.highlightFormatting&&(W.formatting="strikethrough"),w(W)}else if(ne===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return w(W);U.backUp(2)}}if(T.emoji&&ne===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){W.emoji=!0,T.highlightFormatting&&(W.formatting="emoji");var Z=w(W);return W.emoji=!1,Z}return ne===" "&&(U.match(/^ +$/,!1)?W.trailingSpace++:W.trailingSpace&&(W.trailingSpaceNewLine=!0)),w(W)}function _(U,W){var H=U.next();if(H===">"){W.f=W.inline=x,T.highlightFormatting&&(W.formatting="link");var q=w(W);return q?q+=" ":q="",q+S.linkInline}return U.match(/^[^>]+/,!0),S.linkInline}function j(U,W){if(U.eatSpace())return null;var H=U.next();return H==="("||H==="["?(W.f=W.inline=P(H==="("?")":"]"),T.highlightFormatting&&(W.formatting="link-string"),W.linkHref=!0,w(W)):"error"}var N={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(U){return function(W,H){var q=W.next();if(q===U){H.f=H.inline=x,T.highlightFormatting&&(H.formatting="link-string");var ne=w(H);return H.linkHref=!1,ne}return W.match(N[U]),H.linkHref=!0,w(H)}}function V(U,W){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(W.f=z,U.next(),T.highlightFormatting&&(W.formatting="link"),W.linkText=!0,w(W)):a(U,W,x)}function z(U,W){if(U.match(/^\]:/,!0)){W.f=W.inline=B,T.highlightFormatting&&(W.formatting="link");var H=w(W);return W.linkText=!1,H}return U.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function B(U,W){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?W.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),W.f=W.inline=x,S.linkHref+" url")}var K={startState:function(){return{f:h,prevLine:{stream:null},thisLine:{stream:null},block:h,htmlState:null,indentation:0,inline:x,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&M.copyState(D,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?M.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,W){if(W.formatting=!1,U!=W.thisLine.stream){if(W.header=0,W.hr=!1,U.match(/^\s*$/,!0))return b(W),null;if(W.prevLine=W.thisLine,W.thisLine={stream:U},W.taskList=!1,W.trailingSpace=0,W.trailingSpaceNewLine=!1,!W.localState&&(W.f=W.block,W.f!=L)){var H=U.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(W.indentation=H,W.indentationDiff=null,H>0)return null}}return W.f(U,W)},innerMode:function(U){return U.block==L?{state:U.htmlState,mode:D}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:K}},indent:function(U,W,H){return U.block==L&&D.indent?D.indent(U.htmlState,W,H):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,W,H):M.Pass},blankLine:b,getType:w,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return K},"xml"),M.defineMIME("text/markdown","markdown"),M.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 $})(function(){var define,module,exports;return function(){function I($,R,M){function g(v,f){if(!R[v]){if(!$[v]){var S=typeof require=="function"&&require;if(!f&&S)return require(v,!0);if(T)return T(v,!0);var y=new Error("Cannot find module '"+v+"'");throw y.code="MODULE_NOT_FOUND",y}var c=R[v]={exports:{}};$[v][0].call(c.exports,function(o){var r=$[v][1][o];return g(r||o)},c,c.exports,I,$,R,M)}return R[v].exports}for(var T=typeof require=="function"&&require,D=0;D<M.length;D++)g(M[D]);return g}return I}()({1:[function(I,$,R){"use strict";var M=I("./browser/client");M.Buffer=I("buffer").Buffer,M.urllib=I("../shims/xhr"),M.version=I("./browser/version").version,$.exports=M},{"../shims/xhr":291,"./browser/client":2,"./browser/version":5,buffer:73}],2:[function(I,$,R){(function(M,g){"use strict";var T=I("babel-runtime/core-js/promise"),D=c(T),v=I("babel-runtime/regenerator"),f=c(v),S=I("babel-runtime/core-js/object/assign"),y=c(S);function c(V){return V&&V.__esModule?V:{default:V}}var o=I("debug")("ali-oss"),r=I("copy-to"),s=I("xml2js"),d=I("agentkeepalive"),u=I("merge-descriptors"),p=I("url"),m=I("is-type-of"),i=I("platform"),t=I("utility"),a=I("urllib"),l=I("./version"),E=I("bowser"),b=I("../common/signUtils"),h=I("../common/utils/isIP"),L=h.isIP,O=I("../common/client/initOptions"),w=I("../common/utils/createRequest"),C=w.createRequest,x=new d;function _(){var V=i.name,z=i.version;V&&V.toLowerCase&&V.toLowerCase()==="ie"&&z.split(".")[0]<10&&console.warn("ali-oss does not support the current browser")}function j(){return location&&location.protocol==="https:"}function N(V,z){if(_(),!(this instanceof N))return new N(V,z);V&&V.inited?this.options=V:this.options=N.initOptions(V),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=a,this.agent=this.options.agent||x),this.ctx=z,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}$.exports=N,N.initOptions=function(z){z.stsToken||console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");var B=(0,y.default)({secure:j(),useFetch:!1},z);return O(B)};var P=N.prototype;P.debug=o,u(P,I("./object")),u(P,I("../common/bucket/getBucketWebsite")),u(P,I("../common/bucket/putBucketWebsite")),u(P,I("../common/bucket/deleteBucketWebsite")),u(P,I("../common/bucket/getBucketLifecycle")),u(P,I("../common/bucket/putBucketLifecycle")),u(P,I("../common/bucket/deleteBucketLifecycle")),u(P,I("../common/bucket/putBucketVersioning")),u(P,I("../common/bucket/getBucketVersioning")),u(P,I("./managed-upload")),u(P,I("../common/multipart")),u(P,I("../common/parallel")),P.signature=function(z){return this.debug("authorization stringToSign: %s",z,"info"),b.computeSignature(this.options.accessKeySecret,z)},P.authorization=function(z,B,K,U){var W=b.buildCanonicalString(z.toUpperCase(),B,{headers:U,parameters:K});return b.authorization(this.options.accessKeyId,this.options.accessKeySecret,W)},P.request=function(z){var B,K,U,W,H,q;return f.default.async(function(te){for(;;)switch(te.prev=te.next){case 0:return B=C.call(this,z),this.options.useFetch||(B.params.mode="disable-fetch"),K=void 0,U=void 0,W=!!z.stream,te.prev=5,te.next=8,f.default.awrap(this.urllib.request(B.url,B.params));case 8:K=te.sent,this.debug("response %s %s, got %s, headers: %j",z.method,B.url,K.status,K.headers,"info"),te.next=15;break;case 12:te.prev=12,te.t0=te.catch(5),U=te.t0;case 15:if(H=void 0,!(K&&z.successStatuses&&z.successStatuses.indexOf(K.status)===-1)){te.next=28;break}return te.next=19,f.default.awrap(this.requestError(K));case 19:if(H=te.sent,!(H.code==="RequestTimeTooSkewed"&&!W)){te.next=25;break}return this.options.amendTimeSkewed=+new Date(H.serverTime)-new Date,te.next=24,f.default.awrap(this.request(z));case 24:return te.abrupt("return",te.sent);case 25:H.params=z,te.next=32;break;case 28:if(!U){te.next=32;break}return te.next=31,f.default.awrap(this.requestError(U));case 31:H=te.sent;case 32:if(!H){te.next=34;break}throw H;case 34:if(!z.xmlResponse){te.next=39;break}return te.next=37,f.default.awrap(this.parseXML(K.data));case 37:q=te.sent,K.data=q;case 39:return te.abrupt("return",K);case 40:case"end":return te.stop()}},null,this,[[5,12]])},P._getResource=function(z){var B="/";return z.bucket&&(B+=z.bucket+"/"),z.object&&(B+=z.object),B},P._isIP=L,P._escape=function(z){return t.encodeURIComponent(z).replace(/%2F/g,"/")},P._getReqUrl=function(z){var B={};r(this.options.endpoint).to(B);var K=this._isIP(B.hostname),U=this.options.cname;z.bucket&&!U&&!K&&(B.host=z.bucket+"."+B.host);var W="/";z.bucket&&K&&(W+=z.bucket+"/"),z.object&&(W+=this._escape(z.object).replace(/\+/g,"%2B")),B.pathname=W;var H={};if(z.query&&u(H,z.query),z.subres){var q={};m.string(z.subres)?q[z.subres]="":m.array(z.subres)?z.subres.forEach(function(ne){q[ne]=""}):q=z.subres,u(H,q)}return B.query=H,p.format(B)},P._getUserAgent=function(){var z=g&&g.browser?"js":"nodejs",B="aliyun-sdk-"+z+"/"+l.version,K=i.description;return!K&&g&&(K="Node.js "+g.version.slice(1)+" on "+g.platform+" "+g.arch),this._checkUserAgent(B+" "+K)},P._checkUserAgent=function(z){var B=z.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta");return B},P.checkBrowserAndVersion=function(z,B){return E.name===z&&E.version.split(".")[0]===B},P.parseXML=function(z){return new D.default(function(B,K){M.isBuffer(z)&&(z=z.toString()),s.parseString(z,{explicitRoot:!1,explicitArray:!1},function(U,W){U?K(U):B(W)})})},P.requestError=function(z){var B,K,U,W;return f.default.async(function(q){for(;;)switch(q.prev=q.next){case 0:if(B=null,!(!z.data||!z.data.length)){q.next=5;break}z.status===-1||z.status===-2?(B=new Error(z.message),B.name=z.name,B.status=z.status,B.code=z.name):(z.status===404?(B=new Error("Object not exists"),B.name="NoSuchKeyError",B.status=404,B.code="NoSuchKey"):z.status===412?(B=new Error("Pre condition failed"),B.name="PreconditionFailedError",B.status=412,B.code="PreconditionFailed"):(B=new Error("Unknow error, status: "+z.status),B.name="UnknowError",B.status=z.status),B.requestId=z.headers["x-oss-request-id"],B.host=""),q.next=33;break;case 5:return K=String(z.data),this.debug("request response error data: %s",K,"error"),U=void 0,q.prev=8,q.next=11,f.default.awrap(this.parseXML(K));case 11:if(q.t0=q.sent,q.t0){q.next=14;break}q.t0={};case 14:U=q.t0,q.next=24;break;case 17:return q.prev=17,q.t1=q.catch(8),this.debug(K,"error"),q.t1.message+=`
|
|
|
raw xml: `+K,q.t1.status=z.status,q.t1.requestId=z.headers["x-oss-request-id"],q.abrupt("return",q.t1);case 24:W=U.Message||"unknow request error, status: "+z.status,U.Condition&&(W+=" (condition: "+U.Condition+")"),B=new Error(W),B.name=U.Code?U.Code+"Error":"UnknowError",B.status=z.status,B.code=U.Code,B.requestId=U.RequestId,B.hostId=U.HostId,B.serverTime=U.ServerTime;case 33:return this.debug("generate error %j",B,"error"),q.abrupt("return",B);case 35:case"end":return q.stop()}},null,this,[[8,17]])}}).call(this,{isBuffer:I("../../node_modules/is-buffer/index.js")},I("_process"))},{"../../node_modules/is-buffer/index.js":197,"../common/bucket/deleteBucketLifecycle":6,"../common/bucket/deleteBucketWebsite":7,"../common/bucket/getBucketLifecycle":8,"../common/bucket/getBucketVersioning":9,"../common/bucket/getBucketWebsite":10,"../common/bucket/putBucketLifecycle":11,"../common/bucket/putBucketVersioning":12,"../common/bucket/putBucketWebsite":13,"../common/client/initOptions":15,"../common/multipart":18,"../common/parallel":33,"../common/signUtils":34,"../common/utils/createRequest":38,"../common/utils/isIP":45,"./managed-upload":3,"./object":4,"./version":5,_process:208,agentkeepalive:48,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,bowser:70,"copy-to":76,debug:288,"is-type-of":289,"merge-descriptors":200,platform:206,url:238,urllib:291,utility:290,xml2js:249}],3:[function(I,$,R){(function(M){"use strict";var g=I("babel-runtime/core-js/array/from"),T=y(g),D=I("babel-runtime/core-js/promise"),v=y(D),f=I("babel-runtime/regenerator"),S=y(f);function y(b){return b&&b.__esModule?b:{default:b}}var c=I("is-type-of"),o=I("util"),r=I("path"),s=I("mime"),d=I("copy-to"),u=I("../common/utils/isBlob"),p=u.isBlob,m=I("../common/utils/isFile"),i=m.isFile,t=R;t.multipartUpload=function(h,L,O){var w,C,x,_,j,N,P,V,z;return S.default.async(function(K){for(;;)switch(K.prev=K.next){case 0:if(this.resetCancelFlag(),O=O||{},!(O.checkpoint&&O.checkpoint.uploadId)){K.next=6;break}return K.next=5,S.default.awrap(this._resumeMultipart(O.checkpoint,O));case 5:return K.abrupt("return",K.sent);case 6:return w=100*1024,O.mime||(i(L)?O.mime=s.getType(r.extname(L.name)):p(L)?O.mime=L.type:O.mime=s.getType(r.extname(L))),O.headers=O.headers||{},this._convertMetaToHeaders(O.meta,O.headers),K.next=12,S.default.awrap(this._getFileSize(L));case 12:if(C=K.sent,!(C<w)){K.next=25;break}return x=this._createStream(L,0,C),O.contentLength=C,K.next=18,S.default.awrap(this.putStream(h,x,O));case 18:if(_=K.sent,!(O&&O.progress)){K.next=22;break}return K.next=22,S.default.awrap(O.progress(1));case 22:return j={res:_.res,bucket:this.options.bucket,name:h,etag:_.res.headers.etag},(O.headers&&O.headers["x-oss-callback"]||O.callback)&&(j.data=_.data),K.abrupt("return",j);case 25:if(!(O.partSize&&!(parseInt(O.partSize,10)===O.partSize))){K.next=27;break}throw new Error("partSize must be int number");case 27:if(!(O.partSize&&O.partSize<w)){K.next=29;break}throw new Error("partSize must not be smaller than "+w);case 29:return K.next=31,S.default.awrap(this.initMultipartUpload(h,O));case 31:if(N=K.sent,P=N.uploadId,V=this._getPartSize(C,O.partSize),z={file:L,name:h,fileSize:C,partSize:V,uploadId:P,doneParts:[]},!(O&&O.progress)){K.next=38;break}return K.next=38,S.default.awrap(O.progress(0,z,N.res));case 38:return K.next=40,S.default.awrap(this._resumeMultipart(z,O));case 40:return K.abrupt("return",K.sent);case 41:case"end":return K.stop()}},null,this)},t._resumeMultipart=function(h,L){var O,w,C,x,_,j,N,P,V,z,B,K,U,W,H,q,ne,te;return S.default.async(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(O=this,!this.isCancel()){Ce.next=3;break}throw this._makeCancelEvent();case 3:return w=h.file,C=h.fileSize,x=h.partSize,_=h.uploadId,j=h.doneParts,N=h.name,P=[],j.length>0&&d(j).to(P),V=this._divideParts(C,x),z=V.length,B=!1,K=function(Me,Oe){var he=this;return new v.default(function(se,Te){var re,ue,fe,ee;return S.default.async(function(X){for(;;)switch(X.prev=X.next){case 0:if(X.prev=0,Me.isCancel()){X.next=18;break}return re=V[Oe-1],ue={stream:Me._createStream(w,re.start,re.end),size:re.end-re.start},X.next=6,S.default.awrap(Me._uploadPart(N,_,Oe,ue));case 6:if(fe=X.sent,!(!Me.isCancel()&&!B)){X.next=15;break}if(h.doneParts.push({number:Oe,etag:fe.res.headers.etag}),!L.progress){X.next=12;break}return X.next=12,S.default.awrap(L.progress(j.length/z,h,fe.res));case 12:se({number:Oe,etag:fe.res.headers.etag}),X.next=16;break;case 15:se();case 16:X.next=19;break;case 18:se();case 19:X.next=30;break;case 21:X.prev=21,X.t0=X.catch(0),ee=new Error,ee.name=X.t0.name,ee.message=X.t0.message,ee.stack=X.t0.stack,ee.partNum=Oe,d(X.t0).to(ee),Te(ee);case 30:case"end":return X.stop()}},null,he,[[0,21]])})},U=(0,T.default)(new Array(z),function(me,Me){return Me+1}),W=P.map(function(me){return me.number}),H=U.filter(function(me){return W.indexOf(me)<0}),q=5,ne=L.parallel||q,Ce.next=17,S.default.awrap(this._parallel(H,ne,function(me){return new v.default(function(Me,Oe){K(O,me).then(function(he){he&&P.push(he),Me()}).catch(function(he){Oe(he)})})}));case 17:if(te=Ce.sent,B=!0,!this.isCancel()){Ce.next=22;break}throw K=null,this._makeCancelEvent();case 22:if(!(te&&te.length>0)){Ce.next=25;break}throw te[0].message="Failed to upload some parts with error: "+te[0].toString()+" part_num: "+te[0].partNum,te[0];case 25:return Ce.next=27,S.default.awrap(this.completeMultipartUpload(N,_,P,L));case 27:return Ce.abrupt("return",Ce.sent);case 28:case"end":return Ce.stop()}},null,this)},t._getFileSize=function(h){return S.default.async(function(O){for(;;)switch(O.prev=O.next){case 0:if(!c.buffer(h)){O.next=4;break}return O.abrupt("return",h.length);case 4:if(!(p(h)||i(h))){O.next=6;break}return O.abrupt("return",h.size);case 6:throw new Error("_getFileSize requires Buffer/File/Blob.");case 7:case"end":return O.stop()}},null,this)};var a=I("stream"),l=a.Readable;function E(b,h){if(!(this instanceof E))return new E(b,h);l.call(this,h),this.file=b,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}o.inherits(E,l),E.prototype.readFileAndPush=function(h){if(this.fileBuffer)for(var L=!0;L&&this.fileBuffer&&this.start<this.fileBuffer.length;){var O=this.start,w=O+h;w=w>this.fileBuffer.length?this.fileBuffer.length:w,this.start=w,L=this.push(this.fileBuffer.slice(O,w))}},E.prototype._read=function(h){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 L=16*1024;h=h||L;var O=this;this.reader.onload=function(C){O.fileBuffer=M.from(new Uint8Array(C.target.result)),O.file=null,O.readFileAndPush(h)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(h)},t._createStream=function(h,L,O){if(p(h)||i(h))return new E(h.slice(L,O));throw new Error("_createStream requires File/Blob.")},t._getPartSize=function(h,L){var O=10*1e3,w=1024*1024;return L?Math.max(Math.ceil(h/O),L):w},t._divideParts=function(h,L){for(var O=Math.ceil(h/L),w=[],C=0;C<O;C++){var x=L*C,_=Math.min(x+L,h);w.push({start:x,end:_})}return w}}).call(this,I("buffer").Buffer)},{"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/array/from":52,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,buffer:73,"copy-to":76,"is-type-of":289,mime:202,path:205,stream:230,util:243}],4:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/promise"),g=c(M),T=I("babel-runtime/core-js/object/keys"),D=c(T),v=I("babel-runtime/core-js/object/assign"),f=c(v),S=I("babel-runtime/regenerator"),y=c(S);function c(O){return O&&O.__esModule?O:{default:O}}var o=I("utility"),r=I("fs"),s=I("is-type-of"),d=I("url"),u=I("copy-to"),p=I("path"),m=I("mime"),i=I("../common/callback"),t=I("../common/signUtils"),a=I("merge-descriptors"),l=I("../common/utils/isBlob"),E=l.isBlob,b=I("../common/utils/isFile"),h=b.isFile,L=R;L.append=function(w,C,x){var _;return y.default.async(function(N){for(;;)switch(N.prev=N.next){case 0:return x=x||{},x.position===void 0&&(x.position="0"),x.subres={append:"",position:x.position},x.method="POST",N.next=6,y.default.awrap(this.put(w,C,x));case 6:return _=N.sent,_.nextAppendPosition=_.res.headers["x-oss-next-append-position"],N.abrupt("return",_);case 9:case"end":return N.stop()}},null,this)},L.put=function(w,C,x){var _,j,N,P,V,z,B;return y.default.async(function(U){for(;;)switch(U.prev=U.next){case 0:if(_=void 0,x=x||{},w=this._objectName(w),!s.buffer(C)){U.next=7;break}_=C,U.next=33;break;case 7:if(!(E(C)||h(C))){U.next=32;break}return x.mime||(h(C)?x.mime=m.getType(p.extname(C.name)):x.mime=C.type),j=this._createStream(C,0,C.size),U.next=12,y.default.awrap(this._getFileSize(C));case 12:return x.contentLength=U.sent,U.prev=13,U.next=16,y.default.awrap(this.putStream(w,j,x));case 16:return N=U.sent,U.abrupt("return",N);case 20:if(U.prev=20,U.t0=U.catch(13),!(U.t0.code==="RequestTimeTooSkewed")){U.next=29;break}return this.options.amendTimeSkewed=+new Date(U.t0.serverTime)-new Date,U.next=26,y.default.awrap(this.put(w,C,x));case 26:return U.abrupt("return",U.sent);case 29:throw U.t0;case 30:U.next=33;break;case 32:throw new TypeError("Must provide Buffer/Blob/File for put.");case 33:return x.headers=x.headers||{},this._convertMetaToHeaders(x.meta,x.headers),P=x.method||"PUT",V=this._objectRequestParams(P,w,x),i.encodeCallback(V,x),V.mime=x.mime,V.content=_,V.successStatuses=[200],U.next=43,y.default.awrap(this.request(V));case 43:return z=U.sent,B={name:w,url:this._objectUrl(w),res:z.res},V.headers&&V.headers["x-oss-callback"]&&(B.data=JSON.parse(z.data.toString())),U.abrupt("return",B);case 47:case"end":return U.stop()}},null,this,[[13,20]])},L.putStream=function(w,C,x){var _,j,N,P;return y.default.async(function(z){for(;;)switch(z.prev=z.next){case 0:return x=x||{},x.headers=x.headers||{},w=this._objectName(w),x.contentLength?x.headers["Content-Length"]=x.contentLength:x.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(x.meta,x.headers),_=x.method||"PUT",j=this._objectRequestParams(_,w,x),i.encodeCallback(j,x),j.mime=x.mime,j.stream=C,j.successStatuses=[200],z.next=13,y.default.awrap(this.request(j));case 13:return N=z.sent,P={name:w,url:this._objectUrl(w),res:N.res},j.headers&&j.headers["x-oss-callback"]&&(P.data=JSON.parse(N.data.toString())),z.abrupt("return",P);case 17:case"end":return z.stop()}},null,this)},a(L,I("../common/object/copyObject")),a(L,I("../common/object/getObjectTagging")),a(L,I("../common/object/putObjectTagging")),a(L,I("../common/object/deleteObjectTagging")),a(L,I("../common/image")),a(L,I("../common/object/getBucketVersions")),a(L,I("../common/object/getACL")),a(L,I("../common/object/putACL")),a(L,I("../common/object/head")),a(L,I("../common/object/delete")),a(L,I("../common/object/get")),a(L,I("../common/object/putSymlink")),a(L,I("../common/object/getSymlink")),a(L,I("../common/object/deleteMulti")),a(L,I("../common/object/getObjectMeta")),L.putMeta=function(w,C,x){var _;return y.default.async(function(N){for(;;)switch(N.prev=N.next){case 0:return N.next=2,y.default.awrap(this.copy(w,w,{meta:C||{},timeout:x&&x.timeout,ctx:x&&x.ctx}));case 2:return _=N.sent,N.abrupt("return",_);case 4:case"end":return N.stop()}},null,this)},L.list=function(w,C){var x,_,j,N,P;return y.default.async(function(z){for(;;)switch(z.prev=z.next){case 0:return x=this._objectRequestParams("GET","",C),x.query=w,x.xmlResponse=!0,x.successStatuses=[200],z.next=6,y.default.awrap(this.request(x));case 6:return _=z.sent,j=_.data.Contents,N=this,j&&(Array.isArray(j)||(j=[j]),j=j.map(function(B){return{name:B.Key,url:N._objectUrl(B.Key),lastModified:B.LastModified,etag:B.ETag,type:B.Type,size:Number(B.Size),storageClass:B.StorageClass,owner:{id:B.Owner.ID,displayName:B.Owner.DisplayName}}})),P=_.data.CommonPrefixes||null,P&&(Array.isArray(P)||(P=[P]),P=P.map(function(B){return B.Prefix})),z.abrupt("return",{res:_.res,objects:j,prefixes:P,nextMarker:_.data.NextMarker||null,isTruncated:_.data.IsTruncated==="true"});case 13:case"end":return z.stop()}},null,this)},L.restore=function(w,C){var x,_;return y.default.async(function(N){for(;;)switch(N.prev=N.next){case 0:return C=C||{},C.subres=(0,f.default)({restore:""},C.subres),C.versionId&&(C.subres.versionId=C.versionId),x=this._objectRequestParams("POST",w,C),x.successStatuses=[202],N.next=7,y.default.awrap(this.request(x));case 7:return _=N.sent,N.abrupt("return",{res:_.res});case 9:case"end":return N.stop()}},null,this)},L.signatureUrl=function(w,C){C=C||{},w=this._objectName(w),C.method=C.method||"GET";var x=o.timestamp()+(C.expires||1800),_={bucket:this.options.bucket,object:w},j=this._getResource(_);this.options.stsToken&&(C["security-token"]=this.options.stsToken);var N=t._signatureForURL(this.options.accessKeySecret,C,j,x),P=d.parse(this._getReqUrl(_));return P.query={OSSAccessKeyId:this.options.accessKeyId,Expires:x,Signature:N.Signature},u(N.subResource).to(P.query),P.format()},L.getObjectUrl=function(w,C){return C?C[C.length-1]!=="/"&&(C+="/"):C=this.options.endpoint.format(),C+this._escape(this._objectName(w))},L._objectUrl=function(w){return this._getReqUrl({bucket:this.options.bucket,object:w})},L.generateObjectUrl=function(O,w){if(w)w[w.length-1]!=="/"&&(w+="/");else{w=this.options.endpoint.format();var C=d.parse(w),x=this.options.bucket;C.hostname=x+"."+C.hostname,C.host=x+"."+C.host,w=C.format()}return w+this._escape(this._objectName(O))},L._objectRequestParams=function(w,C,x){if(!this.options.bucket)throw new Error("Please create a bucket first");x=x||{},C=this._objectName(C);var _={object:C,bucket:this.options.bucket,method:w,subres:x&&x.subres,timeout:x&&x.timeout,ctx:x&&x.ctx};return x.headers&&(_.headers={},u(x.headers).to(_.headers)),_},L._objectName=function(w){return w.replace(/^\/+/,"")},L._convertMetaToHeaders=function(w,C){if(!w)return;(0,D.default)(w).forEach(function(x){C["x-oss-meta-"+x]=w[x]})},L._deleteFileSafe=function(w){var C=this;return new g.default(function(x){r.exists(w,function(_){_?r.unlink(w,function(j){j&&C.debug("unlink %j error: %s",w,j,"error"),x()}):x()})})}},{"../common/callback":14,"../common/image":16,"../common/object/copyObject":19,"../common/object/delete":20,"../common/object/deleteMulti":21,"../common/object/deleteObjectTagging":22,"../common/object/get":23,"../common/object/getACL":24,"../common/object/getBucketVersions":25,"../common/object/getObjectMeta":26,"../common/object/getObjectTagging":27,"../common/object/getSymlink":28,"../common/object/head":29,"../common/object/putACL":30,"../common/object/putObjectTagging":31,"../common/object/putSymlink":32,"../common/signUtils":34,"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,"copy-to":76,fs:71,"is-type-of":289,"merge-descriptors":200,mime:202,path:205,url:238,utility:290}],5:[function(I,$,R){"use strict";R.version="6.10.0"},{}],6:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(S){return S&&S.__esModule?S:{default:S}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=R;f.deleteBucketLifecycle=function(y,c){var o,r;return g.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return v(y),o=this._bucketRequestParams("DELETE",y,"lifecycle",c),o.successStatuses=[204],d.next=5,g.default.awrap(this.request(o));case 5:return r=d.sent,d.abrupt("return",{res:r.res});case 7:case"end":return d.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],7:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(S){return S&&S.__esModule?S:{default:S}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=R;f.deleteBucketWebsite=function(y,c){var o,r;return g.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return v(y),o=this._bucketRequestParams("DELETE",y,"website",c),o.successStatuses=[204],d.next=5,g.default.awrap(this.request(o));case 5:return r=d.sent,d.abrupt("return",{res:r.res});case 7:case"end":return d.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],8:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(r){return r&&r.__esModule?r:{default:r}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=I("../utils/isArray"),S=f.isArray,y=I("../utils/formatObjKey"),c=y.formatObjKey,o=R;o.getBucketLifecycle=function(s,d){var u,p,m;return g.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return v(s),u=this._bucketRequestParams("GET",s,"lifecycle",d),u.successStatuses=[200],u.xmlResponse=!0,t.next=6,g.default.awrap(this.request(u));case 6:return p=t.sent,m=p.data.Rule||null,m&&(S(m)||(m=[m]),m=m.map(function(a){return a.ID&&(a.id=a.ID,delete a.ID),a.Tag&&!S(a.Tag)&&(a.Tag=[a.Tag]),c(a,"firstLowerCase")})),t.abrupt("return",{rules:m,res:p.res});case 10:case"end":return t.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/formatObjKey":40,"../utils/isArray":42,"babel-runtime/regenerator":68}],9:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(S){return S&&S.__esModule?S:{default:S}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=R;f.getBucketVersioning=function(y,c){var o,r,s;return g.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return v(y),o=this._bucketRequestParams("GET",y,"versioning",c),o.xmlResponse=!0,o.successStatuses=[200],u.next=6,g.default.awrap(this.request(o));case 6:return r=u.sent,s=r.data.Status,u.abrupt("return",{status:r.status,versionStatus:s,res:r.res});case 9:case"end":return u.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],10:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(c){return c&&c.__esModule?c:{default:c}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=I("../utils/isObject"),S=f.isObject,y=R;y.getBucketWebsite=function(o,r){var s,d,u;return g.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return v(o),s=this._bucketRequestParams("GET",o,"website",r),s.successStatuses=[200],s.xmlResponse=!0,m.next=6,g.default.awrap(this.request(s));case 6:return d=m.sent,u=[],d.data.RoutingRules&&d.data.RoutingRules.RoutingRule&&(S(d.data.RoutingRules.RoutingRule)?u=[d.data.RoutingRules.RoutingRule]:u=d.data.RoutingRules.RoutingRule),m.abrupt("return",{index:d.data.IndexDocument&&d.data.IndexDocument.Suffix||"",supportSubDir:d.data.IndexDocument&&d.data.IndexDocument.SupportSubDir||"false",type:d.data.IndexDocument&&d.data.IndexDocument.Type,routingRules:u,error:d.data.ErrorDocument&&d.data.ErrorDocument.Key||null,res:d.res});case 10:case"end":return m.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isObject":46,"babel-runtime/regenerator":68}],11:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(h){return h&&h.__esModule?h:{default:h}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=I("../utils/isArray"),S=f.isArray,y=I("../utils/deepCopy"),c=y.deepCopy,o=I("../utils/isObject"),r=o.isObject,s=I("../utils/obj2xml"),d=s.obj2xml,u=I("../utils/checkObjectTag"),p=u.checkObjectTag,m=I("../utils/getStrBytesCount"),i=m.getStrBytesCount,t=R;t.putBucketLifecycle=function(L,O,w){var C,x,_,j,N;return g.default.async(function(V){for(;;)switch(V.prev=V.next){case 0:if(v(L),S(O)){V.next=3;break}throw new Error("rules must be Array");case 3:return C=this._bucketRequestParams("PUT",L,"lifecycle",w),x=[],_={LifecycleConfiguration:{Rule:x}},O.forEach(function(z){a(z),b(z),z.id&&(z.ID=z.id,delete z.id),x.push(z)}),j=d(_,{headers:!0,firstUpperCase:!0}),C.content=j,C.mime="xml",C.successStatuses=[200],V.next=13,g.default.awrap(this.request(C));case 13:return N=V.sent,V.abrupt("return",{res:N.res});case 15:case"end":return V.stop()}},null,this)};function a(h){h.days&&(h.expiration={days:h.days}),h.date&&(h.expiration={createdBeforeDate:h.date})}function l(h,L){var O=h.days,w=h.createdBeforeDate;if(!O&&!w)throw new Error(L+" must includes days or createdBeforeDate");if(O&&!/^[1-9][0-9]*$/.test(O))throw new Error("days must be a positive integer");if(w&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(w))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function E(h){if(!S(h)&&!r(h))throw new Error("tag must be Object or Array");h=r(h)?[h]:h;var L={},O=c(h);O.forEach(function(w){L[w.key]=w.value}),p(L)}function b(h){if(h.id&&i(h.id)>255)throw new Error("ID is composed of 255 bytes at most");if(h.prefix===""||h.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(h.status))throw new Error("Status must be Enabled or Disabled");if(h.transition){if(!["IA","Archive"].includes(h.transition.storageClass))throw new Error("StorageClass must be IA or Archive");l(h.transition,"Transition")}if(h.expiration){if(!h.expiration.expiredObjectDeleteMarker)l(h.expiration,"Expiration");else if(h.expiration.days||h.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(h.abortMultipartUpload&&l(h.abortMultipartUpload,"AbortMultipartUpload"),!h.expiration&&!h.abortMultipartUpload&&!h.transition&&!h.noncurrentVersionTransition)throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(h.tag){if(h.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");E(h.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,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(c){return c&&c.__esModule?c:{default:c}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=I("../utils/obj2xml"),S=f.obj2xml,y=R;y.putBucketVersioning=function(o,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,u,p;return g.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:if(v(o),["Enabled","Suspended"].includes(r)){i.next=3;break}throw new Error("status must be Enabled or Suspended");case 3:return d=this._bucketRequestParams("PUT",o,"versioning",s),u={VersioningConfiguration:{Status:r}},d.mime="xml",d.content=S(u,{headers:!0}),i.next=9,g.default.awrap(this.request(d));case 9:return p=i.sent,i.abrupt("return",{res:p.res,status:p.status});case 11:case"end":return i.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],13:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(r){return r&&r.__esModule?r:{default:r}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=I("../utils/obj2xml"),S=f.obj2xml,y=I("../utils/isArray"),c=y.isArray,o=R;o.putBucketWebsite=function(s){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=arguments[2],p,m,i,t,a;return g.default.async(function(E){for(;;)switch(E.prev=E.next){case 0:if(v(s),p=this._bucketRequestParams("PUT",s,"website",u),m={Suffix:d.index||"index.html"},i={IndexDocument:m},t={WebsiteConfiguration:i},d.supportSubDir&&(m.SupportSubDir=d.supportSubDir),d.type&&(m.Type=d.type),d.error&&(i.ErrorDocument={Key:d.error}),!(d.routingRules!==void 0)){E.next=12;break}if(c(d.routingRules)){E.next=11;break}throw new Error("RoutingRules must be Array");case 11:i.RoutingRules={RoutingRule:d.routingRules};case 12:return t=S(t),p.content=t,p.mime="xml",p.successStatuses=[200],E.next=18,g.default.awrap(this.request(p));case 18:return a=E.sent,E.abrupt("return",{res:a.res});case 20:case"end":return E.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isArray":42,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],14:[function(I,$,R){(function(M){"use strict";var g=I("babel-runtime/core-js/object/keys"),T=f(g),D=I("babel-runtime/core-js/json/stringify"),v=f(D);function f(S){return S&&S.__esModule?S:{default:S}}R.encodeCallback=function(y,c){if(y.headers=y.headers||{},!Object.prototype.hasOwnProperty.call(y.headers,"x-oss-callback")&&c.callback){var o={callbackUrl:encodeURI(c.callback.url),callbackBody:c.callback.body};c.callback.host&&(o.callbackHost=c.callback.host),c.callback.contentType&&(o.callbackBodyType=c.callback.contentType);var r=M.from((0,v.default)(o)).toString("base64");if(y.headers["x-oss-callback"]=r,c.callback.customValue){var s={};(0,T.default)(c.callback.customValue).forEach(function(d){s["x:"+d]=c.callback.customValue[d]}),y.headers["x-oss-callback-var"]=M.from((0,v.default)(s)).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,$,R){"use strict";var M=I("babel-runtime/core-js/object/assign"),g=T(M);function T(o){return o&&o.__esModule?o:{default:o}}var D=I("humanize-ms"),v=I("url"),f=I("../utils/checkBucketName"),S=f.checkBucketName;function y(o,r){var s=v.parse(o);if(s.protocol||(s=v.parse("http"+(r?"s":"")+"://"+o)),s.protocol!=="http:"&&s.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return s}function c(o,r,s){var d=s?"https://":"http://",u=r?"-internal.aliyuncs.com":".aliyuncs.com",p="vpc100-oss-cn-";return o.substr(0,p.length)===p&&(u=".aliyuncs.com"),v.parse(d+o+u)}$.exports=function(o){if(!o||!o.accessKeyId||!o.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");o.bucket&&S(o.bucket);var r=(0,g.default)({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1},o);if(r.accessKeyId=r.accessKeyId.trim(),r.accessKeySecret=r.accessKeySecret.trim(),r.timeout&&(r.timeout=D(r.timeout)),r.endpoint)r.endpoint=y(r.endpoint,r.secure);else if(r.region)r.endpoint=c(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,$,R){"use strict";var M=I("merge-descriptors"),g=R;M(g,I("./processObjectSave"))},{"./processObjectSave":17,"merge-descriptors":200}],17:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(r){return r&&r.__esModule?r:{default:r}}var D=I("../utils/checkBucketName"),v=D.checkBucketName,f=I("querystring"),S=I("js-base64"),y=S.Base64.encode,c=R;c.processObjectSave=function(s,d,u,p){var m,i,t,a;return g.default.async(function(E){for(;;)switch(E.prev=E.next){case 0:return o(s,"sourceObject"),o(d,"targetObject"),o(u,"process"),d=this._objectName(d),p&&v(p),m=this._objectRequestParams("POST",s,{subres:"x-oss-process"}),i=p?",b_"+y(p):"",d=y(d),t={"x-oss-process":u+"|sys/saveas,o_"+d+i},m.content=f.stringify(t),E.next=12,g.default.awrap(this.request(m));case 12:return a=E.sent,E.abrupt("return",{res:a.res,status:a.res.status});case 14:case"end":return E.stop()}},null,this)};function o(r,s){if(!r)throw new Error(s+" is required");if(typeof r!="string")throw new Error(s+" must be String")}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68,"js-base64":199,querystring:212}],18:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=T(M);function T(c){return c&&c.__esModule?c:{default:c}}var D=I("copy-to"),v=I("./callback"),f=I("./utils/deepCopy"),S=f.deepCopy,y=R;y.listUploads=function(o,r){var s,d,u,p;return g.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:return r=r||{},s={},D(r).to(s),s.subres="uploads",d=this._objectRequestParams("GET","",s),d.query=o,d.xmlResponse=!0,d.successStatuses=[200],i.next=10,g.default.awrap(this.request(d));case 10:return u=i.sent,p=u.data.Upload||[],Array.isArray(p)||(p=[p]),p=p.map(function(t){return{name:t.Key,uploadId:t.UploadId,initiated:t.Initiated}}),i.abrupt("return",{res:u.res,uploads:p,bucket:u.data.Bucket,nextKeyMarker:u.data.NextKeyMarker,nextUploadIdMarker:u.data.NextUploadIdMarker,isTruncated:u.data.IsTruncated==="true"});case 15:case"end":return i.stop()}},null,this)},y.listParts=function(o,r,s,d){var u,p,m;return g.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return d=d||{},u={},D(d).to(u),u.subres={uploadId:r},p=this._objectRequestParams("GET",o,u),p.query=s,p.xmlResponse=!0,p.successStatuses=[200],t.next=10,g.default.awrap(this.request(p));case 10:return m=t.sent,t.abrupt("return",{res:m.res,uploadId:m.data.UploadId,bucket:m.data.Bucket,name:m.data.Key,partNumberMarker:m.data.PartNumberMarker,nextPartNumberMarker:m.data.NextPartNumberMarker,maxParts:m.data.MaxParts,isTruncated:m.data.IsTruncated,parts:m.data.Part||[]});case 12:case"end":return t.stop()}},null,this)},y.abortMultipartUpload=function(o,r,s){var d,u,p;return g.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:return this._stop(),s=s||{},d={},D(s).to(d),d.subres={uploadId:r},u=this._objectRequestParams("DELETE",o,d),u.successStatuses=[204],i.next=9,g.default.awrap(this.request(u));case 9:return p=i.sent,i.abrupt("return",{res:p.res});case 11:case"end":return i.stop()}},null,this)},y.initMultipartUpload=function(o,r){var s,d,u;return g.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return r=r||{},s={},D(r).to(s),s.headers=s.headers||{},this._convertMetaToHeaders(r.meta,s.headers),s.subres="uploads",d=this._objectRequestParams("POST",o,s),d.mime=r.mime,d.xmlResponse=!0,d.successStatuses=[200],m.next=12,g.default.awrap(this.request(d));case 12:return u=m.sent,m.abrupt("return",{res:u.res,bucket:u.data.Bucket,name:u.data.Key,uploadId:u.data.UploadId});case 14:case"end":return m.stop()}},null,this)},y.uploadPart=function(o,r,s,d,u,p,m){var i;return g.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:return i={stream:this._createStream(d,u,p),size:p-u},a.next=3,g.default.awrap(this._uploadPart(o,r,s,i,m));case 3:return a.abrupt("return",a.sent);case 4:case"end":return a.stop()}},null,this)},y.completeMultipartUpload=function(o,r,s,d){var u,p,m,i,t,a,l,E;return g.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:for(u=s.concat().sort(function(L,O){return L.number-O.number}).filter(function(L,O,w){return!O||L.number!==w[O-1].number}),p=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,m=0;m<u.length;m++)i=u[m],p+=`<Part>
|
|
|
`,p+="<PartNumber>"+i.number+`</PartNumber>
|
|
|
`,p+="<ETag>"+i.etag+`</ETag>
|
|
|
`,p+=`</Part>
|
|
|
`;return p+="</CompleteMultipartUpload>",d=d||{},t={},t=S(d),t.headers&&delete t.headers["x-oss-server-side-encryption"],t.subres={uploadId:r},a=this._objectRequestParams("POST",o,t),v.encodeCallback(a,t),a.mime="xml",a.content=p,a.headers&&a.headers["x-oss-callback"]||(a.xmlResponse=!0),a.successStatuses=[200],h.next=17,g.default.awrap(this.request(a));case 17:return l=h.sent,E={res:l.res,bucket:a.bucket,name:o,etag:l.res.headers.etag},a.headers&&a.headers["x-oss-callback"]&&(E.data=JSON.parse(l.data.toString())),h.abrupt("return",E);case 21:case"end":return h.stop()}},null,this)},y._uploadPart=function(o,r,s,d,u){var p,m,i;return g.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:return u=u||{},p={},D(u).to(p),p.headers={"Content-Length":d.size},p.subres={partNumber:s,uploadId:r},m=this._objectRequestParams("PUT",o,p),m.mime=p.mime,m.stream=d.stream,m.successStatuses=[200],a.next=11,g.default.awrap(this.request(m));case 11:if(i=a.sent,i.res.headers.etag){a.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 d.stream=null,m.stream=null,a.abrupt("return",{name:o,etag:i.res.headers.etag,res:i.res});case 17:case"end":return a.stop()}},null,this)}},{"./callback":14,"./utils/deepCopy":39,"babel-runtime/regenerator":68,"copy-to":76}],19:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=S(M),T=I("babel-runtime/core-js/object/keys"),D=S(T),v=I("babel-runtime/helpers/typeof"),f=S(v);function S(r){return r&&r.__esModule?r:{default:r}}var y=I("../utils/checkBucketName"),c=y.checkBucketName,o=R;o.copy=function(s,d,u,p){var m,i,t;return g.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return(typeof u=="undefined"?"undefined":(0,f.default)(u))==="object"&&(p=u),p=p||{},p.headers=p.headers||{},(0,D.default)(p.headers).forEach(function(E){p.headers["x-oss-copy-source-"+E.toLowerCase()]=p.headers[E]}),p.meta&&(p.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(p.meta,p.headers),d=this._getSourceName(d,u),p.versionId&&(d=d+"?versionId="+p.versionId),p.headers["x-oss-copy-source"]=d,m=this._objectRequestParams("PUT",s,p),m.xmlResponse=!0,m.successStatuses=[200,304],l.next=14,g.default.awrap(this.request(m));case 14:return i=l.sent,t=i.data,t&&(t={etag:t.ETag,lastModified:t.LastModified}),l.abrupt("return",{data:t,res:i.res});case 18:case"end":return l.stop()}},null,this)},o._getSourceName=function(s,d){return typeof d=="string"?s=this._objectName(s):s[0]!=="/"?d=this.options.bucket:(d=s.replace(/\/(.+?)(\/.*)/,"$1"),s=s.replace(/(\/.+?\/)(.*)/,"$2")),c(d),s=encodeURI(s),s="/"+d+"/"+s,s}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,"babel-runtime/regenerator":68}],20:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(S){return S&&S.__esModule?S:{default:S}}var f=R;f.delete=function(y){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,r;return g.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return c.subres=(0,D.default)({},c.subres),c.versionId&&(c.subres.versionId=c.versionId),o=this._objectRequestParams("DELETE",y,c),o.successStatuses=[204],d.next=6,g.default.awrap(this.request(o));case 6:return r=d.sent,d.abrupt("return",{res:r.res});case 8:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],21:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(o){return o&&o.__esModule?o:{default:o}}var f=I("utility"),S=I("../utils/obj2xml"),y=S.obj2xml,c=R;c.deleteMulti=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d,u,p,m,i,t,a,l,E,b,h,L;return g.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(d=[],!(!r||!r.length)){w.next=3;break}throw new Error("names is required");case 3:for(u=0;u<r.length;u++)p={},typeof r[u]=="string"?p.Key=f.escape(this._objectName(r[u])):(m=r[u],i=m.key,t=m.versionId,p.Key=f.escape(this._objectName(i)),p.VersionId=t),d.push(p);return a={Delete:{Quiet:!!s.quiet,Object:d}},l=y(a,{headers:!0}),s.subres=(0,D.default)({delete:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),E=this._objectRequestParams("POST","",s),E.mime="xml",E.content=l,E.xmlResponse=!0,E.successStatuses=[200],w.next=15,g.default.awrap(this.request(E));case 15:return b=w.sent,h=b.data,L=h&&h.Deleted||null,L&&(Array.isArray(L)||(L=[L])),w.abrupt("return",{res:b.res,deleted:L||[]});case 20:case"end":return w.stop()}},null,this)}},{"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,utility:290}],22:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(S){return S&&S.__esModule?S:{default:S}}var f=R;f.deleteObjectTagging=function(y){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,r;return g.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return c.subres=(0,D.default)({tagging:""},c.subres),c.versionId&&(c.subres.versionId=c.versionId),y=this._objectName(y),o=this._objectRequestParams("DELETE",y,c),o.successStatuses=[204],d.next=7,g.default.awrap(this.request(o));case 7:return r=d.sent,d.abrupt("return",{status:r.status,res:r.res});case 9:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],23:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(c){return c&&c.__esModule?c:{default:c}}var f=I("fs"),S=I("is-type-of"),y=R;y.get=function(o,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,u,p,m;return g.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return d=null,u=!1,S.writableStream(r)?d=r:S.string(r)?(d=f.createWriteStream(r),u=!0):s=r,s=s||{},s.subres=(0,D.default)({},s.subres),s.versionId&&(s.subres.versionId=s.versionId),s.process&&(s.subres["x-oss-process"]=s.process),p=void 0,t.prev=8,m=this._objectRequestParams("GET",o,s),m.writeStream=d,m.successStatuses=[200,206,304],t.next=14,g.default.awrap(this.request(m));case 14:p=t.sent,u&&d.destroy(),t.next=25;break;case 18:if(t.prev=18,t.t0=t.catch(8),!u){t.next=24;break}return d.destroy(),t.next=24,g.default.awrap(this._deleteFileSafe(r));case 24:throw t.t0;case 25:return t.abrupt("return",{res:p.res,content:p.data});case 26:case"end":return t.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,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(S){return S&&S.__esModule?S:{default:S}}var f=R;f.getACL=function(y){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,r;return g.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return c.subres=(0,D.default)({acl:""},c.subres),c.versionId&&(c.subres.versionId=c.versionId),y=this._objectName(y),o=this._objectRequestParams("GET",y,c),o.successStatuses=[200],o.xmlResponse=!0,d.next=8,g.default.awrap(this.request(o));case 8:return r=d.sent,d.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 d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],25:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/keys"),g=S(M),T=I("babel-runtime/regenerator"),D=S(T),v=I("babel-runtime/core-js/object/assign"),f=S(v);function S(m){return m&&m.__esModule?m:{default:m}}var y=R,c=I("../utils/isObject"),o=c.isObject,r=I("../utils/isArray"),s=r.isArray;y.getBucketVersions=d,y.listObjectVersions=d;function d(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t,a,l,E,b,h;return D.default.async(function(O){for(;;)switch(O.prev=O.next){case 0:if(!(m.versionIdMarker&&m.keyMarker===void 0)){O.next=2;break}throw new Error("A version-id marker cannot be specified without a key marker");case 2:return i.subres=(0,f.default)({versions:""},i.subres),i.versionId&&(i.subres.versionId=i.versionId),t=this._objectRequestParams("GET","",i),t.xmlResponse=!0,t.successStatuses=[200],t.query=p(m),O.next=10,D.default.awrap(this.request(t));case 10:return a=O.sent,l=a.data.Version||[],E=a.data.DeleteMarker||[],b=this,l&&(Array.isArray(l)||(l=[l]),l=l.map(function(w){return{name:w.Key,url:b._objectUrl(w.Key),lastModified:w.LastModified,isLatest:w.IsLatest==="true",versionId:w.VersionId,etag:w.ETag,type:w.Type,size:Number(w.Size),storageClass:w.StorageClass,owner:{id:w.Owner.ID,displayName:w.Owner.DisplayName}}})),E&&(s(E)||(E=[E]),E=E.map(function(w){return{name:w.Key,lastModified:w.LastModified,versionId:w.VersionId,owner:{id:w.Owner.ID,displayName:w.Owner.DisplayName}}})),h=a.data.CommonPrefixes||null,h&&(s(h)||(h=[h]),h=h.map(function(w){return w.Prefix})),O.abrupt("return",{res:a.res,objects:l,deleteMarker:E,prefixes:h,nextMarker:a.data.NextMarker||null,NextVersionIdMarker:a.data.NextVersionIdMarker||null,isTruncated:a.data.IsTruncated==="true"});case 19:case"end":return O.stop()}},null,this)}function u(m){return m.replace(/([A-Z])/g,"-$1").toLowerCase()}function p(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={};return o(m)&&(0,g.default)(m).forEach(function(t){i[u(t)]=m[t]}),i}},{"../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,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(S){return S&&S.__esModule?S:{default:S}}var f=R;f.getObjectMeta=function(y,c){var o,r;return g.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return c=c||{},y=this._objectName(y),c.subres=(0,D.default)({objectMeta:""},c.subres),c.versionId&&(c.subres.versionId=c.versionId),o=this._objectRequestParams("HEAD",y,c),o.successStatuses=[200],d.next=8,g.default.awrap(this.request(o));case 8:return r=d.sent,d.abrupt("return",{status:r.status,res:r.res});case 10:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],27:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(c){return c&&c.__esModule?c:{default:c}}var f=R,S=I("../utils/isObject"),y=S.isObject;f.getObjectTagging=function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,d,u,p,m;return g.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return r.subres=(0,D.default)({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),o=this._objectName(o),s=this._objectRequestParams("GET",o,r),s.successStatuses=[200],t.next=7,g.default.awrap(this.request(s));case 7:return d=t.sent,t.next=10,g.default.awrap(this.parseXML(d.data));case 10:return u=t.sent,p=u.TagSet.Tag,p=p&&y(p)?[p]:p||[],m={},p.forEach(function(a){m[a.Key]=a.Value}),t.abrupt("return",{status:d.status,res:d.res,tag:m});case 16:case"end":return t.stop()}},null,this)}},{"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],28:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(S){return S&&S.__esModule?S:{default:S}}var f=R;f.getSymlink=function(y){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,r,s;return g.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return c.subres=(0,D.default)({symlink:""},c.subres),c.versionId&&(c.subres.versionId=c.versionId),y=this._objectName(y),o=this._objectRequestParams("GET",y,c),o.successStatuses=[200],u.next=7,g.default.awrap(this.request(o));case 7:return r=u.sent,s=r.res.headers["x-oss-symlink-target"],u.abrupt("return",{targetName:decodeURIComponent(s),res:r.res});case 10:case"end":return u.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],29:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=S(M),T=I("babel-runtime/core-js/object/keys"),D=S(T),v=I("babel-runtime/core-js/object/assign"),f=S(v);function S(c){return c&&c.__esModule?c:{default:c}}var y=R;y.head=function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,d,u;return g.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return r.subres=(0,f.default)({},r.subres),r.versionId&&(r.subres.versionId=r.versionId),s=this._objectRequestParams("HEAD",o,r),s.successStatuses=[200,304],m.next=6,g.default.awrap(this.request(s));case 6:return d=m.sent,u={meta:null,res:d.res,status:d.status},d.status===200&&(0,D.default)(d.headers).forEach(function(i){i.indexOf("x-oss-meta-")===0&&(u.meta||(u.meta={}),u.meta[i.substring(11)]=d.headers[i])}),m.abrupt("return",u);case 10:case"end":return m.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],30:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(S){return S&&S.__esModule?S:{default:S}}var f=R;f.putACL=function(y,c,o){var r,s;return g.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return o=o||{},o.subres=(0,D.default)({acl:""},o.subres),o.versionId&&(o.subres.versionId=o.versionId),o.headers=o.headers||{},o.headers["x-oss-object-acl"]=c,y=this._objectName(y),r=this._objectRequestParams("PUT",y,o),r.successStatuses=[200],u.next=10,g.default.awrap(this.request(r));case 10:return s=u.sent,u.abrupt("return",{res:s.res});case 12:case"end":return u.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],31:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=S(M),T=I("babel-runtime/core-js/object/keys"),D=S(T),v=I("babel-runtime/core-js/object/assign"),f=S(v);function S(d){return d&&d.__esModule?d:{default:d}}var y=I("../utils/obj2xml"),c=y.obj2xml,o=I("../utils/checkObjectTag"),r=o.checkObjectTag,s=R;s.putObjectTagging=function(u,p){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,t,a;return g.default.async(function(E){for(;;)switch(E.prev=E.next){case 0:return r(p),m.subres=(0,f.default)({tagging:""},m.subres),m.versionId&&(m.subres.versionId=m.versionId),u=this._objectName(u),i=this._objectRequestParams("PUT",u,m),i.successStatuses=[200],p=(0,D.default)(p).map(function(b){return{Key:b,Value:p[b]}}),t={Tagging:{TagSet:{Tag:p}}},i.mime="xml",i.content=c(t),E.next=12,g.default.awrap(this.request(i));case 12:return a=E.sent,E.abrupt("return",{res:a.res,status:a.status});case 14:case"end":return E.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,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/object/assign"),D=v(T);function v(S){return S&&S.__esModule?S:{default:S}}var f=R;f.putSymlink=function(y,c,o){var r,s;return g.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return o=o||{},o.headers=o.headers||{},c=this._escape(this._objectName(c)),this._convertMetaToHeaders(o.meta,o.headers),o.headers["x-oss-symlink-target"]=c,o.subres=(0,D.default)({symlink:""},o.subres),o.versionId&&(o.subres.versionId=o.versionId),o.storageClass&&(o.headers["x-oss-storage-class"]=o.storageClass),y=this._objectName(y),r=this._objectRequestParams("PUT",y,o),r.successStatuses=[200],u.next=13,g.default.awrap(this.request(r));case 13:return s=u.sent,u.abrupt("return",{res:s.res});case 15:case"end":return u.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],33:[function(I,$,R){"use strict";var M=I("babel-runtime/regenerator"),g=v(M),T=I("babel-runtime/core-js/promise"),D=v(T);function v(S){return S&&S.__esModule?S:{default:S}}var f=R;f._parallelNode=function(y,c,o,r){var s,d,u,p,m,i,t,a;return g.default.async(function(E){for(;;)switch(E.prev=E.next){case 0:s=this,d=[],u=[],p=y.length/c,m=y.length%c,i=m===0?p:(y.length-m)/c+1,t=1,a=0;case 8:if(!(a<y.length)){E.next=26;break}if(!s.isCancel()){E.next=11;break}return E.abrupt("break",26);case 11:if(r?u.push(o(s,y[a],r)):u.push(o(s,y[a])),!(u.length===c||t===i&&a===y.length-1)){E.next=23;break}return E.prev=13,t+=1,E.next=17,g.default.awrap(D.default.all(u));case 17:E.next=22;break;case 19:E.prev=19,E.t0=E.catch(13),d.push(E.t0);case 22:u=[];case 23:a++,E.next=8;break;case 26:return E.abrupt("return",d);case 27:case"end":return E.stop()}},null,this,[[13,19]])},f._parallel=function(y,c,o){var r=this;return new D.default(function(s){var d=[];if(c<=0||!y){s(d);return}function u(h){return function(){if(h===null)throw new Error("Callback was already called.");var L=h;h=null;for(var O=arguments.length,w=Array(O),C=0;C<O;C++)w[C]=arguments[C];L.apply(this,w)}}function p(h){var L=-1,O=h.length;return function(){return++L<O&&!r.isCancel()?{value:h[L],key:L}:null}}var m=p(y),i=!1,t=0,a=!1;function l(h,L){t-=1,h?(i=!0,d.push(h),s(d)):L==={}||i&&t<=0?(i=!0,s(d)):a||(r.isCancel()?s(d):b())}function E(h,L){o(h).then(function(O){L(null,O)}).catch(function(O){L(O)})}function b(){for(a=!0;t<c&&!i&&!r.isCancel();){var h=m();if(h===null||d.length>0){i=!0,t<=0&&s(d);return}t+=1,E(h.value,u(l))}a=!1}b()})},f.cancel=function(y){this.options.cancelFlag=!0,y&&this.abortMultipartUpload(y.name,y.uploadId,y.options)},f.isCancel=function(){return this.options.cancelFlag},f.resetCancelFlag=function(){this.options.cancelFlag=!1},f._stop=function(){this.options.cancelFlag=!0},f._makeCancelEvent=function(){var y={status:0,name:"cancel"};return y}},{"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68}],34:[function(I,$,R){(function(M){"use strict";var g=I("babel-runtime/core-js/json/stringify"),T=f(g),D=I("babel-runtime/core-js/object/keys"),v=f(D);function f(c){return c&&c.__esModule?c:{default:c}}var S=I("./../../shims/crypto/crypto.js"),y=I("is-type-of");R.buildCanonicalizedResource=function(o,r){var s=""+o,d="?";if(y.string(r)&&r.trim()!=="")s+=d+r;else if(y.array(r))r.sort(),s+=d+r.join("&");else if(r){var u=function(i,t){return i[0]>t[0]?1:i[0]<t[0]?-1:0},p=function(i){s+=d+i,r[i]&&(s+="="+r[i]),d="&"};(0,v.default)(r).sort(u).forEach(p)}return s},R.buildCanonicalString=function(o,r,s,d){s=s||{};var u=s.headers||{},p="x-oss-",m=[],i={},t=[o.toUpperCase(),u["Content-Md5"]||"",u["Content-Type"]||u["Content-Type".toLowerCase()],d||u["x-oss-date"]];return(0,v.default)(u).forEach(function(a){var l=a.toLowerCase();l.indexOf(p)===0&&(i[l]=String(u[a]).trim())}),(0,v.default)(i).sort().forEach(function(a){m.push(a+":"+i[a])}),t=t.concat(m),t.push(this.buildCanonicalizedResource(r,s.parameters)),t.join(`
|
|
|
`)},R.computeSignature=function(o,r){var s=S.createHmac("sha1",o);return s.update(M.from(r,"utf8")).digest("base64")},R.authorization=function(o,r,s){return"OSS "+o+":"+this.computeSignature(r,s)},R._signatureForURL=function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments[2],d=arguments[3],u={},p=r.subResource,m=p===void 0?{}:p;if(r.process){var i="x-oss-process";m[i]=r.process}if(r.trafficLimit){var t="x-oss-traffic-limit";m[t]=r.trafficLimit}if(r.response&&(0,v.default)(r.response).forEach(function(b){var h="response-"+b.toLowerCase();m[h]=r.response[b]}),(0,v.default)(r).forEach(function(b){var h=b.toLowerCase(),L=r[b];h.indexOf("x-oss-")===0?u[h]=L:(h.indexOf("content-md5")===0||h.indexOf("content-type")===0)&&(u[b]=L)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(m["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){var a={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(a.callbackHost=r.callback.host),r.callback.contentType&&(a.callbackBodyType=r.callback.contentType),m.callback=M.from((0,T.default)(a)).toString("base64"),r.callback.customValue){var l={};(0,v.default)(r.callback.customValue).forEach(function(b){l["x:"+b]=r.callback.customValue[b]}),m["callback-var"]=M.from((0,T.default)(l)).toString("base64")}}var E=this.buildCanonicalString(r.method,s,{headers:u,parameters:m},d.toString());return{Signature:this.computeSignature(o,E),subResource:m}}}).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,$,R){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.checkBucketName=void 0,R.checkBucketName=function(M,g){var T=g?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;if(!T.test(M))throw new Error("The bucket must be conform to the specifications")}},{}],36:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/entries"),g=T(M);function T(r){return r&&r.__esModule?r:{default:r}}Object.defineProperty(R,"__esModule",{value:!0}),R.checkObjectTag=void 0;var D=I("./checkValid"),v=D.checkValid,f=I("./isObject"),S=f.isObject,y=[{validator:function(s){if(typeof s!="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 (/)"}],c={key:[].concat(y,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(y,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};function o(r){if(!S(r))throw new Error("tag must be Object");var s=(0,g.default)(r);if(s.length>10)throw new Error("maximum of 10 tags for a object");var d=["key","value"];s.forEach(function(u){u.forEach(function(p,m){v(p,c[d[m]])})})}R.checkObjectTag=o},{"./checkValid":37,"./isObject":46,"babel-runtime/core-js/object/entries":57}],37:[function(I,$,R){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.checkValid=void 0;function M(g,T){T.forEach(function(D){if(D.validator)D.validator(g);else if(D.pattern&&!D.pattern.test(g))throw new Error(D.msg)})}R.checkValid=M},{}],38:[function(I,$,R){(function(M){"use strict";var g=I("babel-runtime/core-js/object/assign"),T=D(g);function D(u){return u&&u.__esModule?u:{default:u}}Object.defineProperty(R,"__esModule",{value:!0}),R.createRequest=void 0;var v=I("./../../../shims/crypto/crypto.js"),f=I("debug")("ali-oss"),S=I("mime"),y=I("dateformat"),c=I("copy-to"),o=I("path");function r(u,p){return u[p]||u[p.toLowerCase()]}function s(u,p){delete u[p],delete u[p.toLowerCase()]}function d(u){var p=new Date;this.options.amendTimeSkewed&&(p=+new Date+this.options.amendTimeSkewed);var m={"x-oss-date":y(p,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.userAgent.includes("nodejs")&&(m["User-Agent"]=this.userAgent),this.options.isRequestPay&&(0,T.default)(m,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(m["x-oss-security-token"]=this.options.stsToken),c(u.headers).to(m),r(m,"Content-Type")||(u.mime&&u.mime.indexOf("/")>0?m["Content-Type"]=u.mime:m["Content-Type"]=S.getType(u.mime||o.extname(u.object||""))),r(m,"Content-Type")||s(m,"Content-Type"),u.content&&(m["Content-Md5"]=v.createHash("md5").update(M.from(u.content,"utf8")).digest("base64"),m["Content-Length"]||(m["Content-Length"]=u.content.length));var i=this._getResource(u);m.authorization=this.authorization(u.method,i,u.subres,m);var t=this._getReqUrl(u);f("request %s %s, with headers %j, !!stream: %s",u.method,t,m,!!u.stream);var a=u.timeout||this.options.timeout,l={method:u.method,content:u.content,stream:u.stream,headers:m,timeout:a,writeStream:u.writeStream,customResponse:u.customResponse,ctx:u.ctx||this.ctx};return this.agent&&(l.agent=this.agent),this.httpsAgent&&(l.httpsAgent=this.httpsAgent),{url:t,params:l}}R.createRequest=d}).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,$,R){"use strict";var M=I("babel-runtime/core-js/object/keys"),g=v(M),T=I("babel-runtime/helpers/typeof"),D=v(T);function v(f){return f&&f.__esModule?f:{default:f}}Object.defineProperty(R,"__esModule",{value:!0}),R.deepCopy=void 0,R.deepCopy=function(f){if(f===null||(typeof f=="undefined"?"undefined":(0,D.default)(f))!=="object")return f;var S=Array.isArray(f)?[]:{};return(0,g.default)(f).forEach(function(y){S[y]=R.deepCopy(f[y])}),S}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],40:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/keys"),g=v(M),T=I("babel-runtime/helpers/typeof"),D=v(T);function v(y){return y&&y.__esModule?y:{default:y}}Object.defineProperty(R,"__esModule",{value:!0}),R.formatObjKey=void 0;function f(y,c){if(y===null||(typeof y=="undefined"?"undefined":(0,D.default)(y))!=="object")return y;var o=void 0;if(Array.isArray(y)){o=[];for(var r=0;r<y.length;r++)o.push(f(y[r],c))}else o={},(0,g.default)(y).forEach(function(s){o[S(s,c)]=f(y[s],c)});return o}R.formatObjKey=f;function S(y,c){return c==="firstUpperCase"?y=y.replace(/^./,function(o){return o.toUpperCase()}):c==="firstLowerCase"&&(y=y.replace(/^./,function(o){return o.toLowerCase()})),y}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],41:[function(I,$,R){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.getStrBytesCount=void 0;function M(g){for(var T=0,D=0;D<g.length;D++){var v=g.charAt(D);/^[\u00-\uff]$/.test(v)?T+=1:T+=2}return T}R.getStrBytesCount=M},{}],42:[function(I,$,R){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.isArray=void 0,R.isArray=function(M){return Object.prototype.toString.call(M)==="[object Array]"}},{}],43:[function(I,$,R){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.isBlob=void 0;function M(g){return typeof Blob!="undefined"&&g instanceof Blob}R.isBlob=M},{}],44:[function(I,$,R){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.isFile=void 0,R.isFile=function(M){return typeof File!="undefined"&&M instanceof File}},{}],45:[function(I,$,R){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.isIP=void 0,R.isIP=function(M){var g=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,T=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return g.test(M)||T.test(M)}},{}],46:[function(I,$,R){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.isObject=void 0,R.isObject=function(M){return Object.prototype.toString.call(M)==="[object Object]"}},{}],47:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/keys"),g=T(M);function T(S){return S&&S.__esModule?S:{default:S}}Object.defineProperty(R,"__esModule",{value:!0}),R.obj2xml=void 0;var D=I("./formatObjKey");function v(S){return Object.prototype.toString.call(S).replace(/(.*? |])/g,"").toLowerCase()}function f(S,y){var c="";return y&&y.headers&&(c=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
`),y&&y.firstUpperCase&&(S=D.formatObjKey(S,"firstUpperCase")),v(S)==="object"?(0,g.default)(S).forEach(function(o){v(S[o])==="string"||v(S[o])==="number"?c+="<"+o+">"+S[o]+"</"+o+">":v(S[o])==="object"?c+="<"+o+">"+f(S[o])+"</"+o+">":v(S[o])==="array"?c+=S[o].map(function(r){return"<"+o+">"+f(r)+"</"+o+">"}).join(""):c+="<"+o+">"+S[o].toString()+"</"+o+">"}):c+=S.toString(),c}R.obj2xml=f},{"./formatObjKey":40,"babel-runtime/core-js/object/keys":60}],48:[function(I,$,R){$.exports=M,$.exports.HttpsAgent=M;function M(){}},{}],49:[function(I,$,R){$.exports=I("./register")().Promise},{"./register":51}],50:[function(I,$,R){"use strict";var M="@@any-promise/REGISTRATION",g=null;$.exports=function(T,D){return function(f,S){f=f||null,S=S||{};var y=S.global!==!1;if(g===null&&y&&(g=T[M]||null),g!==null&&f!==null&&g.implementation!==f)throw new Error('any-promise already defined as "'+g.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return g===null&&(f!==null&&typeof S.Promise!="undefined"?g={Promise:S.Promise,implementation:f}:g=D(f),y&&(T[M]=g)),g}}},{}],51:[function(I,$,R){"use strict";$.exports=I("./loader")(window,M);function M(){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,$,R){$.exports={default:I("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":77}],53:[function(I,$,R){$.exports={default:I("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":78}],54:[function(I,$,R){$.exports={default:I("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":79}],55:[function(I,$,R){$.exports={default:I("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":80}],56:[function(I,$,R){$.exports={default:I("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":81}],57:[function(I,$,R){$.exports={default:I("core-js/library/fn/object/entries"),__esModule:!0}},{"core-js/library/fn/object/entries":82}],58:[function(I,$,R){$.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,$,R){$.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,$,R){$.exports={default:I("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":85}],61:[function(I,$,R){$.exports={default:I("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":86}],62:[function(I,$,R){$.exports={default:I("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":87}],63:[function(I,$,R){$.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,$,R){$.exports={default:I("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":90}],65:[function(I,$,R){$.exports={default:I("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":89}],66:[function(I,$,R){$.exports={default:I("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":91}],67:[function(I,$,R){"use strict";R.__esModule=!0;var M=I("../core-js/symbol/iterator"),g=f(M),T=I("../core-js/symbol"),D=f(T),v=typeof D.default=="function"&&typeof g.default=="symbol"?function(S){return typeof S}:function(S){return S&&typeof D.default=="function"&&S.constructor===D.default&&S!==D.default.prototype?"symbol":typeof S};function f(S){return S&&S.__esModule?S:{default:S}}R.default=typeof D.default=="function"&&v(g.default)==="symbol"?function(S){return typeof S=="undefined"?"undefined":v(S)}:function(S){return S&&typeof D.default=="function"&&S.constructor===D.default&&S!==D.default.prototype?"symbol":typeof S=="undefined"?"undefined":v(S)}},{"../core-js/symbol":64,"../core-js/symbol/iterator":66}],68:[function(I,$,R){$.exports=I("regenerator-runtime")},{"regenerator-runtime":226}],69:[function(I,$,R){"use strict";R.byteLength=y,R.toByteArray=o,R.fromByteArray=d;for(var M=[],g=[],T=typeof Uint8Array!="undefined"?Uint8Array:Array,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v=0,f=D.length;v<f;++v)M[v]=D[v],g[D.charCodeAt(v)]=v;g["-".charCodeAt(0)]=62,g["_".charCodeAt(0)]=63;function S(u){var p=u.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=u.indexOf("=");m===-1&&(m=p);var i=m===p?0:4-m%4;return[m,i]}function y(u){var p=S(u),m=p[0],i=p[1];return(m+i)*3/4-i}function c(u,p,m){return(p+m)*3/4-m}function o(u){var p,m=S(u),i=m[0],t=m[1],a=new T(c(u,i,t)),l=0,E=t>0?i-4:i,b;for(b=0;b<E;b+=4)p=g[u.charCodeAt(b)]<<18|g[u.charCodeAt(b+1)]<<12|g[u.charCodeAt(b+2)]<<6|g[u.charCodeAt(b+3)],a[l++]=p>>16&255,a[l++]=p>>8&255,a[l++]=p&255;return t===2&&(p=g[u.charCodeAt(b)]<<2|g[u.charCodeAt(b+1)]>>4,a[l++]=p&255),t===1&&(p=g[u.charCodeAt(b)]<<10|g[u.charCodeAt(b+1)]<<4|g[u.charCodeAt(b+2)]>>2,a[l++]=p>>8&255,a[l++]=p&255),a}function r(u){return M[u>>18&63]+M[u>>12&63]+M[u>>6&63]+M[u&63]}function s(u,p,m){for(var i,t=[],a=p;a<m;a+=3)i=(u[a]<<16&16711680)+(u[a+1]<<8&65280)+(u[a+2]&255),t.push(r(i));return t.join("")}function d(u){for(var p,m=u.length,i=m%3,t=[],a=16383,l=0,E=m-i;l<E;l+=a)t.push(s(u,l,l+a>E?E:l+a));return i===1?(p=u[m-1],t.push(M[p>>2]+M[p<<4&63]+"==")):i===2&&(p=(u[m-2]<<8)+u[m-1],t.push(M[p>>10]+M[p>>4&63]+M[p<<2&63]+"=")),t.join("")}},{}],70:[function(I,$,R){/*!
|
|
|
* Bowser - a browser detector
|
|
|
* https://github.com/ded/bowser
|
|
|
* MIT License | (c) Dustin Diaz 2015
|
|
|
*/!function(M,g,T){typeof $!="undefined"&&$.exports?$.exports=T():typeof define=="function"&&define.amd?define(g,T):M[g]=T()}(this,"bowser",function(){var M=!0;function g(c){function o(K){var U=c.match(K);return U&&U.length>1&&U[1]||""}function r(K){var U=c.match(K);return U&&U.length>1&&U[2]||""}var s=o(/(ipod|iphone|ipad)/i).toLowerCase(),d=/like android/i.test(c),u=!d&&/android/i.test(c),p=/nexus\s*[0-6]\s*/i.test(c),m=!p&&/nexus\s*[0-9]+/i.test(c),i=/CrOS/.test(c),t=/silk/i.test(c),a=/sailfish/i.test(c),l=/tizen/i.test(c),E=/(web|hpw)(o|0)s/i.test(c),b=/windows phone/i.test(c),h=/SamsungBrowser/i.test(c),L=!b&&/windows/i.test(c),O=!s&&!t&&/macintosh/i.test(c),w=!u&&!a&&!l&&!E&&/linux/i.test(c),C=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),x=o(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(c)&&!/tablet pc/i.test(c),j=!_&&/[^-]mobi/i.test(c),N=/xbox/i.test(c),P;/opera/i.test(c)?P={name:"Opera",opera:M,version:x||o(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(c)?P={name:"Opera",opera:M,version:o(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||x}:/SamsungBrowser/i.test(c)?P={name:"Samsung Internet for Android",samsungBrowser:M,version:x||o(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(c)?P={name:"NAVER Whale browser",whale:M,version:o(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(c)?P={name:"MZ Browser",mzbrowser:M,version:o(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(c)?P={name:"Opera Coast",coast:M,version:x||o(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(c)?P={name:"Focus",focus:M,version:o(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(c)?P={name:"Yandex Browser",yandexbrowser:M,version:x||o(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(c)?P={name:"UC Browser",ucbrowser:M,version:o(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(c)?P={name:"Maxthon",maxthon:M,version:o(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(c)?P={name:"Epiphany",epiphany:M,version:o(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(c)?P={name:"Puffin",puffin:M,version:o(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(c)?P={name:"Sleipnir",sleipnir:M,version:o(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(c)?P={name:"K-Meleon",kMeleon:M,version:o(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:b?(P={name:"Windows Phone",osname:"Windows Phone",windowsphone:M},C?(P.msedge=M,P.version=C):(P.msie=M,P.version=o(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(c)?P={name:"Internet Explorer",msie:M,version:o(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:i?P={name:"Chrome",osname:"Chrome OS",chromeos:M,chromeBook:M,chrome:M,version:o(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(c)?P={name:"Microsoft Edge",msedge:M,version:C}:/vivaldi/i.test(c)?P={name:"Vivaldi",vivaldi:M,version:o(/vivaldi\/(\d+(\.\d+)?)/i)||x}:a?P={name:"Sailfish",osname:"Sailfish OS",sailfish:M,version:o(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(c)?P={name:"SeaMonkey",seamonkey:M,version:o(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(c)?(P={name:"Firefox",firefox:M,version:o(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(c)&&(P.firefoxos=M,P.osname="Firefox OS")):t?P={name:"Amazon Silk",silk:M,version:o(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(c)?P={name:"PhantomJS",phantom:M,version:o(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(c)?P={name:"SlimerJS",slimer:M,version:o(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(c)||/rim\stablet/i.test(c)?P={name:"BlackBerry",osname:"BlackBerry OS",blackberry:M,version:x||o(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:E?(P={name:"WebOS",osname:"WebOS",webos:M,version:x||o(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(c)&&(P.touchpad=M)):/bada/i.test(c)?P={name:"Bada",osname:"Bada",bada:M,version:o(/dolfin\/(\d+(\.\d+)?)/i)}:l?P={name:"Tizen",osname:"Tizen",tizen:M,version:o(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||x}:/qupzilla/i.test(c)?P={name:"QupZilla",qupzilla:M,version:o(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||x}:/chromium/i.test(c)?P={name:"Chromium",chromium:M,version:o(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||x}:/chrome|crios|crmo/i.test(c)?P={name:"Chrome",chrome:M,version:o(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:u?P={name:"Android",version:x}:/safari|applewebkit/i.test(c)?(P={name:"Safari",safari:M},x&&(P.version=x)):s?(P={name:s=="iphone"?"iPhone":s=="ipad"?"iPad":"iPod"},x&&(P.version=x)):/googlebot/i.test(c)?P={name:"Googlebot",googlebot:M,version:o(/googlebot\/(\d+(\.\d+))/i)||x}:P={name:o(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!P.msedge&&/(apple)?webkit/i.test(c)?(/(apple)?webkit\/537\.36/i.test(c)?(P.name=P.name||"Blink",P.blink=M):(P.name=P.name||"Webkit",P.webkit=M),!P.version&&x&&(P.version=x)):!P.opera&&/gecko\//i.test(c)&&(P.name=P.name||"Gecko",P.gecko=M,P.version=P.version||o(/gecko\/(\d+(\.\d+)?)/i)),!P.windowsphone&&(u||P.silk)?(P.android=M,P.osname="Android"):!P.windowsphone&&s?(P[s]=M,P.ios=M,P.osname="iOS"):O?(P.mac=M,P.osname="macOS"):N?(P.xbox=M,P.osname="Xbox"):L?(P.windows=M,P.osname="Windows"):w&&(P.linux=M,P.osname="Linux");function V(K){switch(K){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="";P.windows?z=V(o(/Windows ((NT|XP)( \d\d?.\d)?)/i)):P.windowsphone?z=o(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):P.mac?(z=o(/Mac OS X (\d+([_\.\s]\d+)*)/i),z=z.replace(/[_\s]/g,".")):s?(z=o(/os (\d+([_\s]\d+)*) like mac os x/i),z=z.replace(/[_\s]/g,".")):u?z=o(/android[ \/-](\d+(\.\d+)*)/i):P.webos?z=o(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):P.blackberry?z=o(/rim\stablet\sos\s(\d+(\.\d+)*)/i):P.bada?z=o(/bada\/(\d+(\.\d+)*)/i):P.tizen&&(z=o(/tizen[\/\s](\d+(\.\d+)*)/i)),z&&(P.osversion=z);var B=!P.windows&&z.split(".")[0];return _||m||s=="ipad"||u&&(B==3||B>=4&&!j)||P.silk?P.tablet=M:(j||s=="iphone"||s=="ipod"||u||p||P.blackberry||P.webos||P.bada)&&(P.mobile=M),P.msedge||P.msie&&P.version>=10||P.yandexbrowser&&P.version>=15||P.vivaldi&&P.version>=1||P.chrome&&P.version>=20||P.samsungBrowser&&P.version>=4||P.whale&&f([P.version,"1.0"])===1||P.mzbrowser&&f([P.version,"6.0"])===1||P.focus&&f([P.version,"1.0"])===1||P.firefox&&P.version>=20||P.safari&&P.version>=6||P.opera&&P.version>=10||P.ios&&P.osversion&&P.osversion.split(".")[0]>=6||P.blackberry&&P.version>=10.1||P.chromium&&P.version>=20?P.a=M:P.msie&&P.version<10||P.chrome&&P.version<20||P.firefox&&P.version<20||P.safari&&P.version<6||P.opera&&P.version<10||P.ios&&P.osversion&&P.osversion.split(".")[0]<6||P.chromium&&P.version<20?P.c=M:P.x=M,P}var T=g(typeof navigator!="undefined"&&navigator.userAgent||"");T.test=function(c){for(var o=0;o<c.length;++o){var r=c[o];if(typeof r=="string"&&r in T)return!0}return!1};function D(c){return c.split(".").length}function v(c,o){var r=[],s;if(Array.prototype.map)return Array.prototype.map.call(c,o);for(s=0;s<c.length;s++)r.push(o(c[s]));return r}function f(c){for(var o=Math.max(D(c[0]),D(c[1])),r=v(c,function(s){var d=o-D(s);return s=s+new Array(d+1).join(".0"),v(s.split("."),function(u){return new Array(20-u.length).join("0")+u}).reverse()});--o>=0;){if(r[0][o]>r[1][o])return 1;if(r[0][o]===r[1][o]){if(o===0)return 0}else return-1}}function S(c,o,r){var s=T;typeof o=="string"&&(r=o,o=void 0),o===void 0&&(o=!1),r&&(s=g(r));var d=""+s.version;for(var u in c)if(c.hasOwnProperty(u)&&s[u]){if(typeof c[u]!="string")throw new Error("Browser version in the minVersion map should be a string: "+u+": "+String(c));return f([d,c[u]])<0}return o}function y(c,o,r){return!S(c,o,r)}return T.isUnsupportedBrowser=S,T.compareVersions=f,T.check=y,T._detect=g,T.detect=g,T})},{}],71:[function(I,$,R){},{}],72:[function(I,$,R){var M=I("buffer").Buffer,g=M.isEncoding||function(y){switch(y&&y.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 T(y){if(y&&!g(y))throw new Error("Unknown encoding: "+y)}var D=R.StringDecoder=function(y){this.encoding=(y||"utf8").toLowerCase().replace(/[-_]/,""),T(y);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=S;break;default:this.write=v;return}this.charBuffer=new M(6),this.charReceived=0,this.charLength=0};D.prototype.write=function(y){for(var c="";this.charLength;){var o=y.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:y.length;if(y.copy(this.charBuffer,this.charReceived,0,o),this.charReceived+=o,this.charReceived<this.charLength)return"";y=y.slice(o,y.length),c=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var s=c.charCodeAt(c.length-1);if(s>=55296&&s<=56319){this.charLength+=this.surrogateSize,c="";continue}if(this.charReceived=this.charLength=0,y.length===0)return c;break}this.detectIncompleteChar(y);var r=y.length;this.charLength&&(y.copy(this.charBuffer,0,y.length-this.charReceived,r),r-=this.charReceived),c+=y.toString(this.encoding,0,r);var r=c.length-1,s=c.charCodeAt(r);if(s>=55296&&s<=56319){var d=this.surrogateSize;return this.charLength+=d,this.charReceived+=d,this.charBuffer.copy(this.charBuffer,d,0,d),y.copy(this.charBuffer,0,0,d),c.substring(0,r)}return c},D.prototype.detectIncompleteChar=function(y){for(var c=y.length>=3?3:y.length;c>0;c--){var o=y[y.length-c];if(c==1&&o>>5==6){this.charLength=2;break}if(c<=2&&o>>4==14){this.charLength=3;break}if(c<=3&&o>>3==30){this.charLength=4;break}}this.charReceived=c},D.prototype.end=function(y){var c="";if(y&&y.length&&(c=this.write(y)),this.charReceived){var o=this.charReceived,r=this.charBuffer,s=this.encoding;c+=r.slice(0,o).toString(s)}return c};function v(y){return y.toString(this.encoding)}function f(y){this.charReceived=y.length%2,this.charLength=this.charReceived?2:0}function S(y){this.charReceived=y.length%3,this.charLength=this.charReceived?3:0}},{buffer:73}],73:[function(I,$,R){(function(M,g){/*!
|
|
|
* The buffer module from node.js, for the browser.
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
|
* @license MIT
|
|
|
*/"use strict";var T=I("base64-js"),D=I("ieee754"),v=I("isarray");R.Buffer=g,R.SlowBuffer=t,R.INSPECT_MAX_BYTES=50,g.TYPED_ARRAY_SUPPORT=M.TYPED_ARRAY_SUPPORT!==void 0?M.TYPED_ARRAY_SUPPORT:f(),R.kMaxLength=S();function f(){try{var ee=new Uint8Array(1);return ee.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},ee.foo()===42&&typeof ee.subarray=="function"&&ee.subarray(1,1).byteLength===0}catch(Q){return!1}}function S(){return g.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(ee,Q){if(S()<Q)throw new RangeError("Invalid typed array length");return g.TYPED_ARRAY_SUPPORT?(ee=new Uint8Array(Q),ee.__proto__=g.prototype):(ee===null&&(ee=new g(Q)),ee.length=Q),ee}function g(ee,Q,X){if(!g.TYPED_ARRAY_SUPPORT&&!(this instanceof g))return new g(ee,Q,X);if(typeof ee=="number"){if(typeof Q=="string")throw new Error("If encoding is specified then the first argument must be a string");return s(this,ee)}return c(this,ee,Q,X)}g.poolSize=8192,g._augment=function(ee){return ee.__proto__=g.prototype,ee};function c(ee,Q,X,Z){if(typeof Q=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&Q instanceof ArrayBuffer?p(ee,Q,X,Z):typeof Q=="string"?d(ee,Q,X):m(ee,Q)}g.from=function(ee,Q,X){return c(null,ee,Q,X)},g.TYPED_ARRAY_SUPPORT&&(g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0}));function o(ee){if(typeof ee!="number")throw new TypeError('"size" argument must be a number');if(ee<0)throw new RangeError('"size" argument must not be negative')}function r(ee,Q,X,Z){return o(Q),Q<=0?y(ee,Q):X!==void 0?typeof Z=="string"?y(ee,Q).fill(X,Z):y(ee,Q).fill(X):y(ee,Q)}g.alloc=function(ee,Q,X){return r(null,ee,Q,X)};function s(ee,Q){if(o(Q),ee=y(ee,Q<0?0:i(Q)|0),!g.TYPED_ARRAY_SUPPORT)for(var X=0;X<Q;++X)ee[X]=0;return ee}g.allocUnsafe=function(ee){return s(null,ee)},g.allocUnsafeSlow=function(ee){return s(null,ee)};function d(ee,Q,X){if((typeof X!="string"||X==="")&&(X="utf8"),!g.isEncoding(X))throw new TypeError('"encoding" must be a valid string encoding');var Z=a(Q,X)|0;ee=y(ee,Z);var ve=ee.write(Q,X);return ve!==Z&&(ee=ee.slice(0,ve)),ee}function u(ee,Q){var X=Q.length<0?0:i(Q.length)|0;ee=y(ee,X);for(var Z=0;Z<X;Z+=1)ee[Z]=Q[Z]&255;return ee}function p(ee,Q,X,Z){if(Q.byteLength,X<0||Q.byteLength<X)throw new RangeError("'offset' is out of bounds");if(Q.byteLength<X+(Z||0))throw new RangeError("'length' is out of bounds");return X===void 0&&Z===void 0?Q=new Uint8Array(Q):Z===void 0?Q=new Uint8Array(Q,X):Q=new Uint8Array(Q,X,Z),g.TYPED_ARRAY_SUPPORT?(ee=Q,ee.__proto__=g.prototype):ee=u(ee,Q),ee}function m(ee,Q){if(g.isBuffer(Q)){var X=i(Q.length)|0;return ee=y(ee,X),ee.length===0||Q.copy(ee,0,0,X),ee}if(Q){if(typeof ArrayBuffer!="undefined"&&Q.buffer instanceof ArrayBuffer||"length"in Q)return typeof Q.length!="number"||fe(Q.length)?y(ee,0):u(ee,Q);if(Q.type==="Buffer"&&v(Q.data))return u(ee,Q.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function i(ee){if(ee>=S())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S().toString(16)+" bytes");return ee|0}function t(ee){return+ee!=ee&&(ee=0),g.alloc(+ee)}g.isBuffer=function(Q){return!!(Q!=null&&Q._isBuffer)},g.compare=function(Q,X){if(!g.isBuffer(Q)||!g.isBuffer(X))throw new TypeError("Arguments must be Buffers");if(Q===X)return 0;for(var Z=Q.length,ve=X.length,ye=0,Re=Math.min(Z,ve);ye<Re;++ye)if(Q[ye]!==X[ye]){Z=Q[ye],ve=X[ye];break}return Z<ve?-1:ve<Z?1:0},g.isEncoding=function(Q){switch(String(Q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},g.concat=function(Q,X){if(!v(Q))throw new TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return g.alloc(0);var Z;if(X===void 0)for(X=0,Z=0;Z<Q.length;++Z)X+=Q[Z].length;var ve=g.allocUnsafe(X),ye=0;for(Z=0;Z<Q.length;++Z){var Re=Q[Z];if(!g.isBuffer(Re))throw new TypeError('"list" argument must be an Array of Buffers');Re.copy(ve,ye),ye+=Re.length}return ve};function a(ee,Q){if(g.isBuffer(ee))return ee.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(ee)||ee instanceof ArrayBuffer))return ee.byteLength;typeof ee!="string"&&(ee=""+ee);var X=ee.length;if(X===0)return 0;for(var Z=!1;;)switch(Q){case"ascii":case"latin1":case"binary":return X;case"utf8":case"utf-8":case void 0:return ce(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X*2;case"hex":return X>>>1;case"base64":return re(ee).length;default:if(Z)return ce(ee).length;Q=(""+Q).toLowerCase(),Z=!0}}g.byteLength=a;function l(ee,Q,X){var Z=!1;if((Q===void 0||Q<0)&&(Q=0),Q>this.length)return"";if((X===void 0||X>this.length)&&(X=this.length),X<=0)return"";if(X>>>=0,Q>>>=0,X<=Q)return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return K(this,Q,X);case"utf8":case"utf-8":return N(this,Q,X);case"ascii":return z(this,Q,X);case"latin1":case"binary":return B(this,Q,X);case"base64":return j(this,Q,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,Q,X);default:if(Z)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),Z=!0}}g.prototype._isBuffer=!0;function E(ee,Q,X){var Z=ee[Q];ee[Q]=ee[X],ee[X]=Z}g.prototype.swap16=function(){var Q=this.length;if(Q%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var X=0;X<Q;X+=2)E(this,X,X+1);return this},g.prototype.swap32=function(){var Q=this.length;if(Q%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var X=0;X<Q;X+=4)E(this,X,X+3),E(this,X+1,X+2);return this},g.prototype.swap64=function(){var Q=this.length;if(Q%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var X=0;X<Q;X+=8)E(this,X,X+7),E(this,X+1,X+6),E(this,X+2,X+5),E(this,X+3,X+4);return this},g.prototype.toString=function(){var Q=this.length|0;return Q===0?"":arguments.length===0?N(this,0,Q):l.apply(this,arguments)},g.prototype.equals=function(Q){if(!g.isBuffer(Q))throw new TypeError("Argument must be a Buffer");return this===Q?!0:g.compare(this,Q)===0},g.prototype.inspect=function(){var Q="",X=R.INSPECT_MAX_BYTES;return this.length>0&&(Q=this.toString("hex",0,X).match(/.{2}/g).join(" "),this.length>X&&(Q+=" ... ")),"<Buffer "+Q+">"},g.prototype.compare=function(Q,X,Z,ve,ye){if(!g.isBuffer(Q))throw new TypeError("Argument must be a Buffer");if(X===void 0&&(X=0),Z===void 0&&(Z=Q?Q.length:0),ve===void 0&&(ve=0),ye===void 0&&(ye=this.length),X<0||Z>Q.length||ve<0||ye>this.length)throw new RangeError("out of range index");if(ve>=ye&&X>=Z)return 0;if(ve>=ye)return-1;if(X>=Z)return 1;if(X>>>=0,Z>>>=0,ve>>>=0,ye>>>=0,this===Q)return 0;for(var Re=ye-ve,Je=Z-X,Ze=Math.min(Re,Je),rt=this.slice(ve,ye),tt=Q.slice(X,Z),st=0;st<Ze;++st)if(rt[st]!==tt[st]){Re=rt[st],Je=tt[st];break}return Re<Je?-1:Je<Re?1:0};function b(ee,Q,X,Z,ve){if(ee.length===0)return-1;if(typeof X=="string"?(Z=X,X=0):X>2147483647?X=2147483647:X<-2147483648&&(X=-2147483648),X=+X,isNaN(X)&&(X=ve?0:ee.length-1),X<0&&(X=ee.length+X),X>=ee.length){if(ve)return-1;X=ee.length-1}else if(X<0)if(ve)X=0;else return-1;if(typeof Q=="string"&&(Q=g.from(Q,Z)),g.isBuffer(Q))return Q.length===0?-1:h(ee,Q,X,Z,ve);if(typeof Q=="number")return Q=Q&255,g.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?ve?Uint8Array.prototype.indexOf.call(ee,Q,X):Uint8Array.prototype.lastIndexOf.call(ee,Q,X):h(ee,[Q],X,Z,ve);throw new TypeError("val must be string, number or Buffer")}function h(ee,Q,X,Z,ve){var ye=1,Re=ee.length,Je=Q.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(ee.length<2||Q.length<2)return-1;ye=2,Re/=2,Je/=2,X/=2}function Ze(Fe,Ae){return ye===1?Fe[Ae]:Fe.readUInt16BE(Ae*ye)}var rt;if(ve){var tt=-1;for(rt=X;rt<Re;rt++)if(Ze(ee,rt)===Ze(Q,tt===-1?0:rt-tt)){if(tt===-1&&(tt=rt),rt-tt+1===Je)return tt*ye}else tt!==-1&&(rt-=rt-tt),tt=-1}else for(X+Je>Re&&(X=Re-Je),rt=X;rt>=0;rt--){for(var st=!0,ot=0;ot<Je;ot++)if(Ze(ee,rt+ot)!==Ze(Q,ot)){st=!1;break}if(st)return rt}return-1}g.prototype.includes=function(Q,X,Z){return this.indexOf(Q,X,Z)!==-1},g.prototype.indexOf=function(Q,X,Z){return b(this,Q,X,Z,!0)},g.prototype.lastIndexOf=function(Q,X,Z){return b(this,Q,X,Z,!1)};function L(ee,Q,X,Z){X=Number(X)||0;var ve=ee.length-X;Z?(Z=Number(Z),Z>ve&&(Z=ve)):Z=ve;var ye=Q.length;if(ye%2!==0)throw new TypeError("Invalid hex string");Z>ye/2&&(Z=ye/2);for(var Re=0;Re<Z;++Re){var Je=parseInt(Q.substr(Re*2,2),16);if(isNaN(Je))return Re;ee[X+Re]=Je}return Re}function O(ee,Q,X,Z){return ue(ce(Q,ee.length-X),ee,X,Z)}function w(ee,Q,X,Z){return ue(se(Q),ee,X,Z)}function C(ee,Q,X,Z){return w(ee,Q,X,Z)}function x(ee,Q,X,Z){return ue(re(Q),ee,X,Z)}function _(ee,Q,X,Z){return ue(Te(Q,ee.length-X),ee,X,Z)}g.prototype.write=function(Q,X,Z,ve){if(X===void 0)ve="utf8",Z=this.length,X=0;else if(Z===void 0&&typeof X=="string")ve=X,Z=this.length,X=0;else if(isFinite(X))X=X|0,isFinite(Z)?(Z=Z|0,ve===void 0&&(ve="utf8")):(ve=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ye=this.length-X;if((Z===void 0||Z>ye)&&(Z=ye),Q.length>0&&(Z<0||X<0)||X>this.length)throw new RangeError("Attempt to write outside buffer bounds");ve||(ve="utf8");for(var Re=!1;;)switch(ve){case"hex":return L(this,Q,X,Z);case"utf8":case"utf-8":return O(this,Q,X,Z);case"ascii":return w(this,Q,X,Z);case"latin1":case"binary":return C(this,Q,X,Z);case"base64":return x(this,Q,X,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,Q,X,Z);default:if(Re)throw new TypeError("Unknown encoding: "+ve);ve=(""+ve).toLowerCase(),Re=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(ee,Q,X){return Q===0&&X===ee.length?T.fromByteArray(ee):T.fromByteArray(ee.slice(Q,X))}function N(ee,Q,X){X=Math.min(ee.length,X);for(var Z=[],ve=Q;ve<X;){var ye=ee[ve],Re=null,Je=ye>239?4:ye>223?3:ye>191?2:1;if(ve+Je<=X){var Ze,rt,tt,st;switch(Je){case 1:ye<128&&(Re=ye);break;case 2:Ze=ee[ve+1],(Ze&192)===128&&(st=(ye&31)<<6|Ze&63,st>127&&(Re=st));break;case 3:Ze=ee[ve+1],rt=ee[ve+2],(Ze&192)===128&&(rt&192)===128&&(st=(ye&15)<<12|(Ze&63)<<6|rt&63,st>2047&&(st<55296||st>57343)&&(Re=st));break;case 4:Ze=ee[ve+1],rt=ee[ve+2],tt=ee[ve+3],(Ze&192)===128&&(rt&192)===128&&(tt&192)===128&&(st=(ye&15)<<18|(Ze&63)<<12|(rt&63)<<6|tt&63,st>65535&&st<1114112&&(Re=st))}}Re===null?(Re=65533,Je=1):Re>65535&&(Re-=65536,Z.push(Re>>>10&1023|55296),Re=56320|Re&1023),Z.push(Re),ve+=Je}return V(Z)}var P=4096;function V(ee){var Q=ee.length;if(Q<=P)return String.fromCharCode.apply(String,ee);for(var X="",Z=0;Z<Q;)X+=String.fromCharCode.apply(String,ee.slice(Z,Z+=P));return X}function z(ee,Q,X){var Z="";X=Math.min(ee.length,X);for(var ve=Q;ve<X;++ve)Z+=String.fromCharCode(ee[ve]&127);return Z}function B(ee,Q,X){var Z="";X=Math.min(ee.length,X);for(var ve=Q;ve<X;++ve)Z+=String.fromCharCode(ee[ve]);return Z}function K(ee,Q,X){var Z=ee.length;(!Q||Q<0)&&(Q=0),(!X||X<0||X>Z)&&(X=Z);for(var ve="",ye=Q;ye<X;++ye)ve+=he(ee[ye]);return ve}function U(ee,Q,X){for(var Z=ee.slice(Q,X),ve="",ye=0;ye<Z.length;ye+=2)ve+=String.fromCharCode(Z[ye]+Z[ye+1]*256);return ve}g.prototype.slice=function(Q,X){var Z=this.length;Q=~~Q,X=X===void 0?Z:~~X,Q<0?(Q+=Z,Q<0&&(Q=0)):Q>Z&&(Q=Z),X<0?(X+=Z,X<0&&(X=0)):X>Z&&(X=Z),X<Q&&(X=Q);var ve;if(g.TYPED_ARRAY_SUPPORT)ve=this.subarray(Q,X),ve.__proto__=g.prototype;else{var ye=X-Q;ve=new g(ye,void 0);for(var Re=0;Re<ye;++Re)ve[Re]=this[Re+Q]}return ve};function W(ee,Q,X){if(ee%1!==0||ee<0)throw new RangeError("offset is not uint");if(ee+Q>X)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUIntLE=function(Q,X,Z){Q=Q|0,X=X|0,Z||W(Q,X,this.length);for(var ve=this[Q],ye=1,Re=0;++Re<X&&(ye*=256);)ve+=this[Q+Re]*ye;return ve},g.prototype.readUIntBE=function(Q,X,Z){Q=Q|0,X=X|0,Z||W(Q,X,this.length);for(var ve=this[Q+--X],ye=1;X>0&&(ye*=256);)ve+=this[Q+--X]*ye;return ve},g.prototype.readUInt8=function(Q,X){return X||W(Q,1,this.length),this[Q]},g.prototype.readUInt16LE=function(Q,X){return X||W(Q,2,this.length),this[Q]|this[Q+1]<<8},g.prototype.readUInt16BE=function(Q,X){return X||W(Q,2,this.length),this[Q]<<8|this[Q+1]},g.prototype.readUInt32LE=function(Q,X){return X||W(Q,4,this.length),(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216},g.prototype.readUInt32BE=function(Q,X){return X||W(Q,4,this.length),this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])},g.prototype.readIntLE=function(Q,X,Z){Q=Q|0,X=X|0,Z||W(Q,X,this.length);for(var ve=this[Q],ye=1,Re=0;++Re<X&&(ye*=256);)ve+=this[Q+Re]*ye;return ye*=128,ve>=ye&&(ve-=Math.pow(2,8*X)),ve},g.prototype.readIntBE=function(Q,X,Z){Q=Q|0,X=X|0,Z||W(Q,X,this.length);for(var ve=X,ye=1,Re=this[Q+--ve];ve>0&&(ye*=256);)Re+=this[Q+--ve]*ye;return ye*=128,Re>=ye&&(Re-=Math.pow(2,8*X)),Re},g.prototype.readInt8=function(Q,X){return X||W(Q,1,this.length),this[Q]&128?(255-this[Q]+1)*-1:this[Q]},g.prototype.readInt16LE=function(Q,X){X||W(Q,2,this.length);var Z=this[Q]|this[Q+1]<<8;return Z&32768?Z|4294901760:Z},g.prototype.readInt16BE=function(Q,X){X||W(Q,2,this.length);var Z=this[Q+1]|this[Q]<<8;return Z&32768?Z|4294901760:Z},g.prototype.readInt32LE=function(Q,X){return X||W(Q,4,this.length),this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24},g.prototype.readInt32BE=function(Q,X){return X||W(Q,4,this.length),this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]},g.prototype.readFloatLE=function(Q,X){return X||W(Q,4,this.length),D.read(this,Q,!0,23,4)},g.prototype.readFloatBE=function(Q,X){return X||W(Q,4,this.length),D.read(this,Q,!1,23,4)},g.prototype.readDoubleLE=function(Q,X){return X||W(Q,8,this.length),D.read(this,Q,!0,52,8)},g.prototype.readDoubleBE=function(Q,X){return X||W(Q,8,this.length),D.read(this,Q,!1,52,8)};function H(ee,Q,X,Z,ve,ye){if(!g.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(Q>ve||Q<ye)throw new RangeError('"value" argument is out of bounds');if(X+Z>ee.length)throw new RangeError("Index out of range")}g.prototype.writeUIntLE=function(Q,X,Z,ve){if(Q=+Q,X=X|0,Z=Z|0,!ve){var ye=Math.pow(2,8*Z)-1;H(this,Q,X,Z,ye,0)}var Re=1,Je=0;for(this[X]=Q&255;++Je<Z&&(Re*=256);)this[X+Je]=Q/Re&255;return X+Z},g.prototype.writeUIntBE=function(Q,X,Z,ve){if(Q=+Q,X=X|0,Z=Z|0,!ve){var ye=Math.pow(2,8*Z)-1;H(this,Q,X,Z,ye,0)}var Re=Z-1,Je=1;for(this[X+Re]=Q&255;--Re>=0&&(Je*=256);)this[X+Re]=Q/Je&255;return X+Z},g.prototype.writeUInt8=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,1,255,0),g.TYPED_ARRAY_SUPPORT||(Q=Math.floor(Q)),this[X]=Q&255,X+1};function q(ee,Q,X,Z){Q<0&&(Q=65535+Q+1);for(var ve=0,ye=Math.min(ee.length-X,2);ve<ye;++ve)ee[X+ve]=(Q&255<<8*(Z?ve:1-ve))>>>(Z?ve:1-ve)*8}g.prototype.writeUInt16LE=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[X]=Q&255,this[X+1]=Q>>>8):q(this,Q,X,!0),X+2},g.prototype.writeUInt16BE=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[X]=Q>>>8,this[X+1]=Q&255):q(this,Q,X,!1),X+2};function ne(ee,Q,X,Z){Q<0&&(Q=4294967295+Q+1);for(var ve=0,ye=Math.min(ee.length-X,4);ve<ye;++ve)ee[X+ve]=Q>>>(Z?ve:3-ve)*8&255}g.prototype.writeUInt32LE=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[X+3]=Q>>>24,this[X+2]=Q>>>16,this[X+1]=Q>>>8,this[X]=Q&255):ne(this,Q,X,!0),X+4},g.prototype.writeUInt32BE=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[X]=Q>>>24,this[X+1]=Q>>>16,this[X+2]=Q>>>8,this[X+3]=Q&255):ne(this,Q,X,!1),X+4},g.prototype.writeIntLE=function(Q,X,Z,ve){if(Q=+Q,X=X|0,!ve){var ye=Math.pow(2,8*Z-1);H(this,Q,X,Z,ye-1,-ye)}var Re=0,Je=1,Ze=0;for(this[X]=Q&255;++Re<Z&&(Je*=256);)Q<0&&Ze===0&&this[X+Re-1]!==0&&(Ze=1),this[X+Re]=(Q/Je>>0)-Ze&255;return X+Z},g.prototype.writeIntBE=function(Q,X,Z,ve){if(Q=+Q,X=X|0,!ve){var ye=Math.pow(2,8*Z-1);H(this,Q,X,Z,ye-1,-ye)}var Re=Z-1,Je=1,Ze=0;for(this[X+Re]=Q&255;--Re>=0&&(Je*=256);)Q<0&&Ze===0&&this[X+Re+1]!==0&&(Ze=1),this[X+Re]=(Q/Je>>0)-Ze&255;return X+Z},g.prototype.writeInt8=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,1,127,-128),g.TYPED_ARRAY_SUPPORT||(Q=Math.floor(Q)),Q<0&&(Q=255+Q+1),this[X]=Q&255,X+1},g.prototype.writeInt16LE=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[X]=Q&255,this[X+1]=Q>>>8):q(this,Q,X,!0),X+2},g.prototype.writeInt16BE=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[X]=Q>>>8,this[X+1]=Q&255):q(this,Q,X,!1),X+2},g.prototype.writeInt32LE=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,4,2147483647,-2147483648),g.TYPED_ARRAY_SUPPORT?(this[X]=Q&255,this[X+1]=Q>>>8,this[X+2]=Q>>>16,this[X+3]=Q>>>24):ne(this,Q,X,!0),X+4},g.prototype.writeInt32BE=function(Q,X,Z){return Q=+Q,X=X|0,Z||H(this,Q,X,4,2147483647,-2147483648),Q<0&&(Q=4294967295+Q+1),g.TYPED_ARRAY_SUPPORT?(this[X]=Q>>>24,this[X+1]=Q>>>16,this[X+2]=Q>>>8,this[X+3]=Q&255):ne(this,Q,X,!1),X+4};function te(ee,Q,X,Z,ve,ye){if(X+Z>ee.length)throw new RangeError("Index out of range");if(X<0)throw new RangeError("Index out of range")}function _e(ee,Q,X,Z,ve){return ve||te(ee,Q,X,4,34028234663852886e22,-34028234663852886e22),D.write(ee,Q,X,Z,23,4),X+4}g.prototype.writeFloatLE=function(Q,X,Z){return _e(this,Q,X,!0,Z)},g.prototype.writeFloatBE=function(Q,X,Z){return _e(this,Q,X,!1,Z)};function Ce(ee,Q,X,Z,ve){return ve||te(ee,Q,X,8,17976931348623157e292,-17976931348623157e292),D.write(ee,Q,X,Z,52,8),X+8}g.prototype.writeDoubleLE=function(Q,X,Z){return Ce(this,Q,X,!0,Z)},g.prototype.writeDoubleBE=function(Q,X,Z){return Ce(this,Q,X,!1,Z)},g.prototype.copy=function(Q,X,Z,ve){if(Z||(Z=0),!ve&&ve!==0&&(ve=this.length),X>=Q.length&&(X=Q.length),X||(X=0),ve>0&&ve<Z&&(ve=Z),ve===Z)return 0;if(Q.length===0||this.length===0)return 0;if(X<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("sourceStart out of bounds");if(ve<0)throw new RangeError("sourceEnd out of bounds");ve>this.length&&(ve=this.length),Q.length-X<ve-Z&&(ve=Q.length-X+Z);var ye=ve-Z,Re;if(this===Q&&Z<X&&X<ve)for(Re=ye-1;Re>=0;--Re)Q[Re+X]=this[Re+Z];else if(ye<1e3||!g.TYPED_ARRAY_SUPPORT)for(Re=0;Re<ye;++Re)Q[Re+X]=this[Re+Z];else Uint8Array.prototype.set.call(Q,this.subarray(Z,Z+ye),X);return ye},g.prototype.fill=function(Q,X,Z,ve){if(typeof Q=="string"){if(typeof X=="string"?(ve=X,X=0,Z=this.length):typeof Z=="string"&&(ve=Z,Z=this.length),Q.length===1){var ye=Q.charCodeAt(0);ye<256&&(Q=ye)}if(ve!==void 0&&typeof ve!="string")throw new TypeError("encoding must be a string");if(typeof ve=="string"&&!g.isEncoding(ve))throw new TypeError("Unknown encoding: "+ve)}else typeof Q=="number"&&(Q=Q&255);if(X<0||this.length<X||this.length<Z)throw new RangeError("Out of range index");if(Z<=X)return this;X=X>>>0,Z=Z===void 0?this.length:Z>>>0,Q||(Q=0);var Re;if(typeof Q=="number")for(Re=X;Re<Z;++Re)this[Re]=Q;else{var Je=g.isBuffer(Q)?Q:ce(new g(Q,ve).toString()),Ze=Je.length;for(Re=0;Re<Z-X;++Re)this[Re+X]=Je[Re%Ze]}return this};var me=/[^+\/0-9A-Za-z-_]/g;function Me(ee){if(ee=Oe(ee).replace(me,""),ee.length<2)return"";for(;ee.length%4!==0;)ee=ee+"=";return ee}function Oe(ee){return ee.trim?ee.trim():ee.replace(/^\s+|\s+$/g,"")}function he(ee){return ee<16?"0"+ee.toString(16):ee.toString(16)}function ce(ee,Q){Q=Q||Infinity;for(var X,Z=ee.length,ve=null,ye=[],Re=0;Re<Z;++Re){if(X=ee.charCodeAt(Re),X>55295&&X<57344){if(!ve){if(X>56319){(Q-=3)>-1&&ye.push(239,191,189);continue}else if(Re+1===Z){(Q-=3)>-1&&ye.push(239,191,189);continue}ve=X;continue}if(X<56320){(Q-=3)>-1&&ye.push(239,191,189),ve=X;continue}X=(ve-55296<<10|X-56320)+65536}else ve&&((Q-=3)>-1&&ye.push(239,191,189));if(ve=null,X<128){if((Q-=1)<0)break;ye.push(X)}else if(X<2048){if((Q-=2)<0)break;ye.push(X>>6|192,X&63|128)}else if(X<65536){if((Q-=3)<0)break;ye.push(X>>12|224,X>>6&63|128,X&63|128)}else if(X<1114112){if((Q-=4)<0)break;ye.push(X>>18|240,X>>12&63|128,X>>6&63|128,X&63|128)}else throw new Error("Invalid code point")}return ye}function se(ee){for(var Q=[],X=0;X<ee.length;++X)Q.push(ee.charCodeAt(X)&255);return Q}function Te(ee,Q){for(var X,Z,ve,ye=[],Re=0;Re<ee.length&&!((Q-=2)<0);++Re)X=ee.charCodeAt(Re),Z=X>>8,ve=X%256,ye.push(ve),ye.push(Z);return ye}function re(ee){return T.toByteArray(Me(ee))}function ue(ee,Q,X,Z){for(var ve=0;ve<Z&&!(ve+X>=Q.length||ve>=ee.length);++ve)Q[ve+X]=ee[ve];return ve}function fe(ee){return ee!==ee}}).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,$,R){$.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,$,R){$.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,$,R){/*!
|
|
|
* copy-to - index.js
|
|
|
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var M=Array.prototype.slice;$.exports=g;function g(D,v){if(!(this instanceof g))return new g(D,v);this.src=D,this._withAccess=v}g.prototype.withAccess=function(D){return this._withAccess=D!==!1,this},g.prototype.pick=function(D){return Array.isArray(D)||(D=M.call(arguments)),D.length&&(this.keys=D),this},g.prototype.to=function(D){if(D=D||{},!this.src)return D;var v=this.keys||Object.keys(this.src);if(!this._withAccess){for(var f=0;f<v.length;f++){if(S=v[f],D[S]!==void 0)continue;D[S]=this.src[S]}return D}for(var f=0;f<v.length;f++){var S=v[f];if(!T(D,S))continue;var y=this.src.__lookupGetter__(S),c=this.src.__lookupSetter__(S);y&&D.__defineGetter__(S,y),c&&D.__defineSetter__(S,c),!y&&!c&&(D[S]=this.src[S])}return D},g.prototype.toCover=function(D){for(var v=this.keys||Object.keys(this.src),f=0;f<v.length;f++){var S=v[f];delete D[S];var y=this.src.__lookupGetter__(S),c=this.src.__lookupSetter__(S);y&&D.__defineGetter__(S,y),c&&D.__defineSetter__(S,c),!y&&!c&&(D[S]=this.src[S])}},g.prototype.override=g.prototype.toCover,g.prototype.and=function(D){var v={};return this.to(v),this.src=D,this.to(v),this.src=v,this};function T(D,v){return D[v]===void 0&&D.__lookupGetter__(v)===void 0&&D.__lookupSetter__(v)===void 0}},{}],77:[function(I,$,R){I("../../modules/es6.string.iterator"),I("../../modules/es6.array.from"),$.exports=I("../../modules/_core").Array.from},{"../../modules/_core":99,"../../modules/es6.array.from":168,"../../modules/es6.string.iterator":180}],78:[function(I,$,R){var M=I("../../modules/_core"),g=M.JSON||(M.JSON={stringify:JSON.stringify});$.exports=function(D){return g.stringify.apply(g,arguments)}},{"../../modules/_core":99}],79:[function(I,$,R){I("../../modules/es6.object.assign"),$.exports=I("../../modules/_core").Object.assign},{"../../modules/_core":99,"../../modules/es6.object.assign":171}],80:[function(I,$,R){I("../../modules/es6.object.create");var M=I("../../modules/_core").Object;$.exports=function(T,D){return M.create(T,D)}},{"../../modules/_core":99,"../../modules/es6.object.create":172}],81:[function(I,$,R){I("../../modules/es6.object.define-property");var M=I("../../modules/_core").Object;$.exports=function(T,D,v){return M.defineProperty(T,D,v)}},{"../../modules/_core":99,"../../modules/es6.object.define-property":173}],82:[function(I,$,R){I("../../modules/es7.object.entries"),$.exports=I("../../modules/_core").Object.entries},{"../../modules/_core":99,"../../modules/es7.object.entries":182}],83:[function(I,$,R){I("../../modules/es6.object.get-own-property-names");var M=I("../../modules/_core").Object;$.exports=function(T){return M.getOwnPropertyNames(T)}},{"../../modules/_core":99,"../../modules/es6.object.get-own-property-names":174}],84:[function(I,$,R){I("../../modules/es6.object.get-prototype-of"),$.exports=I("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":99,"../../modules/es6.object.get-prototype-of":175}],85:[function(I,$,R){I("../../modules/es6.object.keys"),$.exports=I("../../modules/_core").Object.keys},{"../../modules/_core":99,"../../modules/es6.object.keys":176}],86:[function(I,$,R){I("../modules/es6.object.to-string"),I("../modules/es6.string.iterator"),I("../modules/web.dom.iterable"),I("../modules/es6.promise"),I("../modules/es7.promise.finally"),I("../modules/es7.promise.try"),$.exports=I("../modules/_core").Promise},{"../modules/_core":99,"../modules/es6.object.to-string":177,"../modules/es6.promise":178,"../modules/es6.string.iterator":180,"../modules/es7.promise.finally":183,"../modules/es7.promise.try":184,"../modules/web.dom.iterable":187}],87:[function(I,$,R){I("../modules/web.immediate"),$.exports=I("../modules/_core").setImmediate},{"../modules/_core":99,"../modules/web.immediate":188}],88:[function(I,$,R){I("../../modules/es6.string.from-code-point"),$.exports=I("../../modules/_core").String.fromCodePoint},{"../../modules/_core":99,"../../modules/es6.string.from-code-point":179}],89:[function(I,$,R){I("../../modules/es6.function.has-instance"),$.exports=I("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":165,"../../modules/es6.function.has-instance":170}],90:[function(I,$,R){I("../../modules/es6.symbol"),I("../../modules/es6.object.to-string"),I("../../modules/es7.symbol.async-iterator"),I("../../modules/es7.symbol.observable"),$.exports=I("../../modules/_core").Symbol},{"../../modules/_core":99,"../../modules/es6.object.to-string":177,"../../modules/es6.symbol":181,"../../modules/es7.symbol.async-iterator":185,"../../modules/es7.symbol.observable":186}],91:[function(I,$,R){I("../../modules/es6.string.iterator"),I("../../modules/web.dom.iterable"),$.exports=I("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":165,"../../modules/es6.string.iterator":180,"../../modules/web.dom.iterable":187}],92:[function(I,$,R){$.exports=function(M){if(typeof M!="function")throw TypeError(M+" is not a function!");return M}},{}],93:[function(I,$,R){$.exports=function(){}},{}],94:[function(I,$,R){$.exports=function(M,g,T,D){if(!(M instanceof g)||D!==void 0&&D in M)throw TypeError(T+": incorrect invocation!");return M}},{}],95:[function(I,$,R){var M=I("./_is-object");$.exports=function(g){if(!M(g))throw TypeError(g+" is not an object!");return g}},{"./_is-object":119}],96:[function(I,$,R){var M=I("./_to-iobject"),g=I("./_to-length"),T=I("./_to-absolute-index");$.exports=function(D){return function(v,f,S){var y=M(v),c=g(y.length),o=T(S,c),r;if(D&&f!=f){for(;c>o;)if(r=y[o++],r!=r)return!0}else for(;c>o;o++)if((D||o in y)&&y[o]===f)return D||o||0;return!D&&-1}}},{"./_to-absolute-index":156,"./_to-iobject":158,"./_to-length":159}],97:[function(I,$,R){var M=I("./_cof"),g=I("./_wks")("toStringTag"),T=M(function(){return arguments}())=="Arguments",D=function(v,f){try{return v[f]}catch(S){}};$.exports=function(v){var f,S,y;return v===void 0?"Undefined":v===null?"Null":typeof(S=D(f=Object(v),g))=="string"?S:T?M(f):(y=M(f))=="Object"&&typeof f.callee=="function"?"Arguments":y}},{"./_cof":98,"./_wks":166}],98:[function(I,$,R){var M={}.toString;$.exports=function(g){return M.call(g).slice(8,-1)}},{}],99:[function(I,$,R){var M=$.exports={version:"2.6.11"};typeof __e=="number"&&(__e=M)},{}],100:[function(I,$,R){"use strict";var M=I("./_object-dp"),g=I("./_property-desc");$.exports=function(T,D,v){D in T?M.f(T,D,g(0,v)):T[D]=v}},{"./_object-dp":132,"./_property-desc":146}],101:[function(I,$,R){var M=I("./_a-function");$.exports=function(g,T,D){if(M(g),T===void 0)return g;switch(D){case 1:return function(v){return g.call(T,v)};case 2:return function(v,f){return g.call(T,v,f)};case 3:return function(v,f,S){return g.call(T,v,f,S)}}return function(){return g.apply(T,arguments)}}},{"./_a-function":92}],102:[function(I,$,R){$.exports=function(M){if(M==null)throw TypeError("Can't call method on "+M);return M}},{}],103:[function(I,$,R){$.exports=!I("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":108}],104:[function(I,$,R){var M=I("./_is-object"),g=I("./_global").document,T=M(g)&&M(g.createElement);$.exports=function(D){return T?g.createElement(D):{}}},{"./_global":110,"./_is-object":119}],105:[function(I,$,R){$.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],106:[function(I,$,R){var M=I("./_object-keys"),g=I("./_object-gops"),T=I("./_object-pie");$.exports=function(D){var v=M(D),f=g.f;if(f)for(var S=f(D),y=T.f,c=0,o;S.length>c;)y.call(D,o=S[c++])&&v.push(o);return v}},{"./_object-gops":137,"./_object-keys":140,"./_object-pie":141}],107:[function(I,$,R){var M=I("./_global"),g=I("./_core"),T=I("./_ctx"),D=I("./_hide"),v=I("./_has"),f="prototype",S=function(y,c,o){var r=y&S.F,s=y&S.G,d=y&S.S,u=y&S.P,p=y&S.B,m=y&S.W,i=s?g:g[c]||(g[c]={}),t=i[f],a=s?M:d?M[c]:(M[c]||{})[f],l,E,b;s&&(o=c);for(l in o){if(E=!r&&a&&a[l]!==void 0,E&&v(i,l))continue;b=E?a[l]:o[l],i[l]=s&&typeof a[l]!="function"?o[l]:p&&E?T(b,M):m&&a[l]==b?function(h){var L=function(O,w,C){if(this instanceof h){switch(arguments.length){case 0:return new h;case 1:return new h(O);case 2:return new h(O,w)}return new h(O,w,C)}return h.apply(this,arguments)};return L[f]=h[f],L}(b):u&&typeof b=="function"?T(Function.call,b):b,u&&((i.virtual||(i.virtual={}))[l]=b,y&S.R&&t&&!t[l]&&D(t,l,b))}};S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,$.exports=S},{"./_core":99,"./_ctx":101,"./_global":110,"./_has":111,"./_hide":112}],108:[function(I,$,R){$.exports=function(M){try{return!!M()}catch(g){return!0}}},{}],109:[function(I,$,R){var M=I("./_ctx"),g=I("./_iter-call"),T=I("./_is-array-iter"),D=I("./_an-object"),v=I("./_to-length"),f=I("./core.get-iterator-method"),S={},y={},R=$.exports=function(c,o,r,s,d){var u=d?function(){return c}:f(c),p=M(r,s,o?2:1),m=0,i,t,a,l;if(typeof u!="function")throw TypeError(c+" is not iterable!");if(T(u)){for(i=v(c.length);i>m;m++)if(l=o?p(D(t=c[m])[0],t[1]):p(c[m]),l===S||l===y)return l}else for(a=u.call(c);!(t=a.next()).done;)if(l=g(a,p,t.value,o),l===S||l===y)return l};R.BREAK=S,R.RETURN=y},{"./_an-object":95,"./_ctx":101,"./_is-array-iter":117,"./_iter-call":120,"./_to-length":159,"./core.get-iterator-method":167}],110:[function(I,$,R){var M=$.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=M)},{}],111:[function(I,$,R){var M={}.hasOwnProperty;$.exports=function(g,T){return M.call(g,T)}},{}],112:[function(I,$,R){var M=I("./_object-dp"),g=I("./_property-desc");$.exports=I("./_descriptors")?function(T,D,v){return M.f(T,D,g(1,v))}:function(T,D,v){return T[D]=v,T}},{"./_descriptors":103,"./_object-dp":132,"./_property-desc":146}],113:[function(I,$,R){var M=I("./_global").document;$.exports=M&&M.documentElement},{"./_global":110}],114:[function(I,$,R){$.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,$,R){$.exports=function(M,g,T){var D=T===void 0;switch(g.length){case 0:return D?M():M.call(T);case 1:return D?M(g[0]):M.call(T,g[0]);case 2:return D?M(g[0],g[1]):M.call(T,g[0],g[1]);case 3:return D?M(g[0],g[1],g[2]):M.call(T,g[0],g[1],g[2]);case 4:return D?M(g[0],g[1],g[2],g[3]):M.call(T,g[0],g[1],g[2],g[3])}return M.apply(T,g)}},{}],116:[function(I,$,R){var M=I("./_cof");$.exports=Object("z").propertyIsEnumerable(0)?Object:function(g){return M(g)=="String"?g.split(""):Object(g)}},{"./_cof":98}],117:[function(I,$,R){var M=I("./_iterators"),g=I("./_wks")("iterator"),T=Array.prototype;$.exports=function(D){return D!==void 0&&(M.Array===D||T[g]===D)}},{"./_iterators":125,"./_wks":166}],118:[function(I,$,R){var M=I("./_cof");$.exports=Array.isArray||function(T){return M(T)=="Array"}},{"./_cof":98}],119:[function(I,$,R){$.exports=function(M){return typeof M=="object"?M!==null:typeof M=="function"}},{}],120:[function(I,$,R){var M=I("./_an-object");$.exports=function(g,T,D,v){try{return v?T(M(D)[0],D[1]):T(D)}catch(S){var f=g.return;throw f!==void 0&&M(f.call(g)),S}}},{"./_an-object":95}],121:[function(I,$,R){"use strict";var M=I("./_object-create"),g=I("./_property-desc"),T=I("./_set-to-string-tag"),D={};I("./_hide")(D,I("./_wks")("iterator"),function(){return this}),$.exports=function(v,f,S){v.prototype=M(D,{next:g(1,S)}),T(v,f+" Iterator")}},{"./_hide":112,"./_object-create":131,"./_property-desc":146,"./_set-to-string-tag":150,"./_wks":166}],122:[function(I,$,R){"use strict";var M=I("./_library"),g=I("./_export"),T=I("./_redefine"),D=I("./_hide"),v=I("./_iterators"),f=I("./_iter-create"),S=I("./_set-to-string-tag"),y=I("./_object-gpo"),c=I("./_wks")("iterator"),o=!([].keys&&"next"in[].keys()),r="@@iterator",s="keys",d="values",u=function(){return this};$.exports=function(p,m,i,t,a,l,E){f(i,m,t);var b=function(z){if(!o&&z in w)return w[z];switch(z){case s:return function(){return new i(this,z)};case d:return function(){return new i(this,z)}}return function(){return new i(this,z)}},h=m+" Iterator",L=a==d,O=!1,w=p.prototype,C=w[c]||w[r]||a&&w[a],x=C||b(a),_=a?L?b("entries"):x:void 0,j=m=="Array"&&w.entries||C,N,P,V;if(j&&(V=y(j.call(new p)),V!==Object.prototype&&V.next&&(S(V,h,!0),!M&&typeof V[c]!="function"&&D(V,c,u))),L&&C&&C.name!==d&&(O=!0,x=function(){return C.call(this)}),(!M||E)&&(o||O||!w[c])&&D(w,c,x),v[m]=x,v[h]=u,a)if(N={values:L?x:b(d),keys:l?x:b(s),entries:_},E)for(P in N)P in w||T(w,P,N[P]);else g(g.P+g.F*(o||O),m,N);return N}},{"./_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,$,R){var M=I("./_wks")("iterator"),g=!1;try{var T=[7][M]();T.return=function(){g=!0},Array.from(T,function(){throw 2})}catch(D){}$.exports=function(D,v){if(!v&&!g)return!1;var f=!1;try{var S=[7],y=S[M]();y.next=function(){return{done:f=!0}},S[M]=function(){return y},D(S)}catch(c){}return f}},{"./_wks":166}],124:[function(I,$,R){$.exports=function(M,g){return{value:g,done:!!M}}},{}],125:[function(I,$,R){$.exports={}},{}],126:[function(I,$,R){$.exports=!0},{}],127:[function(I,$,R){var M=I("./_uid")("meta"),g=I("./_is-object"),T=I("./_has"),D=I("./_object-dp").f,v=0,f=Object.isExtensible||function(){return!0},S=!I("./_fails")(function(){return f(Object.preventExtensions({}))}),y=function(d){D(d,M,{value:{i:"O"+ ++v,w:{}}})},c=function(d,u){if(!g(d))return typeof d=="symbol"?d:(typeof d=="string"?"S":"P")+d;if(!T(d,M)){if(!f(d))return"F";if(!u)return"E";y(d)}return d[M].i},o=function(d,u){if(!T(d,M)){if(!f(d))return!0;if(!u)return!1;y(d)}return d[M].w},r=function(d){return S&&s.NEED&&f(d)&&!T(d,M)&&y(d),d},s=$.exports={KEY:M,NEED:!1,fastKey:c,getWeak:o,onFreeze:r}},{"./_fails":108,"./_has":111,"./_is-object":119,"./_object-dp":132,"./_uid":162}],128:[function(I,$,R){var M=I("./_global"),g=I("./_task").set,T=M.MutationObserver||M.WebKitMutationObserver,D=M.process,v=M.Promise,f=I("./_cof")(D)=="process";$.exports=function(){var S,y,c,o=function(){var u,p;for(f&&(u=D.domain)&&u.exit();S;){p=S.fn,S=S.next;try{p()}catch(m){throw S?c():y=void 0,m}}y=void 0,u&&u.enter()};if(f)c=function(){D.nextTick(o)};else if(T&&!(M.navigator&&M.navigator.standalone)){var r=!0,s=document.createTextNode("");new T(o).observe(s,{characterData:!0}),c=function(){s.data=r=!r}}else if(v&&v.resolve){var d=v.resolve(void 0);c=function(){d.then(o)}}else c=function(){g.call(M,o)};return function(u){var p={fn:u,next:void 0};y&&(y.next=p),S||(S=p,c()),y=p}}},{"./_cof":98,"./_global":110,"./_task":155}],129:[function(I,$,R){"use strict";var M=I("./_a-function");function g(T){var D,v;this.promise=new T(function(f,S){if(D!==void 0||v!==void 0)throw TypeError("Bad Promise constructor");D=f,v=S}),this.resolve=M(D),this.reject=M(v)}$.exports.f=function(T){return new g(T)}},{"./_a-function":92}],130:[function(I,$,R){"use strict";var M=I("./_descriptors"),g=I("./_object-keys"),T=I("./_object-gops"),D=I("./_object-pie"),v=I("./_to-object"),f=I("./_iobject"),S=Object.assign;$.exports=!S||I("./_fails")(function(){var y={},c={},o=Symbol(),r="abcdefghijklmnopqrst";return y[o]=7,r.split("").forEach(function(s){c[s]=s}),S({},y)[o]!=7||Object.keys(S({},c)).join("")!=r})?function(c,o){for(var r=v(c),s=arguments.length,d=1,u=T.f,p=D.f;s>d;)for(var m=f(arguments[d++]),i=u?g(m).concat(u(m)):g(m),t=i.length,a=0,l;t>a;)l=i[a++],(!M||p.call(m,l))&&(r[l]=m[l]);return r}:S},{"./_descriptors":103,"./_fails":108,"./_iobject":116,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_to-object":160}],131:[function(I,$,R){var M=I("./_an-object"),g=I("./_object-dps"),T=I("./_enum-bug-keys"),D=I("./_shared-key")("IE_PROTO"),v=function(){},f="prototype",S=function(){var y=I("./_dom-create")("iframe"),c=T.length,o="<",r=">",s;for(y.style.display="none",I("./_html").appendChild(y),y.src="javascript:",s=y.contentWindow.document,s.open(),s.write(o+"script"+r+"document.F=Object"+o+"/script"+r),s.close(),S=s.F;c--;)delete S[f][T[c]];return S()};$.exports=Object.create||function(c,o){var r;return c!==null?(v[f]=M(c),r=new v,v[f]=null,r[D]=c):r=S(),o===void 0?r:g(r,o)}},{"./_an-object":95,"./_dom-create":104,"./_enum-bug-keys":105,"./_html":113,"./_object-dps":133,"./_shared-key":151}],132:[function(I,$,R){var M=I("./_an-object"),g=I("./_ie8-dom-define"),T=I("./_to-primitive"),D=Object.defineProperty;R.f=I("./_descriptors")?Object.defineProperty:function(f,S,y){if(M(f),S=T(S,!0),M(y),g)try{return D(f,S,y)}catch(c){}if("get"in y||"set"in y)throw TypeError("Accessors not supported!");return"value"in y&&(f[S]=y.value),f}},{"./_an-object":95,"./_descriptors":103,"./_ie8-dom-define":114,"./_to-primitive":161}],133:[function(I,$,R){var M=I("./_object-dp"),g=I("./_an-object"),T=I("./_object-keys");$.exports=I("./_descriptors")?Object.defineProperties:function(v,f){g(v);for(var S=T(f),y=S.length,c=0,o;y>c;)M.f(v,o=S[c++],f[o]);return v}},{"./_an-object":95,"./_descriptors":103,"./_object-dp":132,"./_object-keys":140}],134:[function(I,$,R){var M=I("./_object-pie"),g=I("./_property-desc"),T=I("./_to-iobject"),D=I("./_to-primitive"),v=I("./_has"),f=I("./_ie8-dom-define"),S=Object.getOwnPropertyDescriptor;R.f=I("./_descriptors")?S:function(c,o){if(c=T(c),o=D(o,!0),f)try{return S(c,o)}catch(r){}if(v(c,o))return g(!M.f.call(c,o),c[o])}},{"./_descriptors":103,"./_has":111,"./_ie8-dom-define":114,"./_object-pie":141,"./_property-desc":146,"./_to-iobject":158,"./_to-primitive":161}],135:[function(I,$,R){var M=I("./_to-iobject"),g=I("./_object-gopn").f,T={}.toString,D=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],v=function(f){try{return g(f)}catch(S){return D.slice()}};$.exports.f=function(S){return D&&T.call(S)=="[object Window]"?v(S):g(M(S))}},{"./_object-gopn":136,"./_to-iobject":158}],136:[function(I,$,R){var M=I("./_object-keys-internal"),g=I("./_enum-bug-keys").concat("length","prototype");R.f=Object.getOwnPropertyNames||function(D){return M(D,g)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],137:[function(I,$,R){R.f=Object.getOwnPropertySymbols},{}],138:[function(I,$,R){var M=I("./_has"),g=I("./_to-object"),T=I("./_shared-key")("IE_PROTO"),D=Object.prototype;$.exports=Object.getPrototypeOf||function(v){return v=g(v),M(v,T)?v[T]:typeof v.constructor=="function"&&v instanceof v.constructor?v.constructor.prototype:v instanceof Object?D:null}},{"./_has":111,"./_shared-key":151,"./_to-object":160}],139:[function(I,$,R){var M=I("./_has"),g=I("./_to-iobject"),T=I("./_array-includes")(!1),D=I("./_shared-key")("IE_PROTO");$.exports=function(v,f){var S=g(v),y=0,c=[],o;for(o in S)o!=D&&(M(S,o)&&c.push(o));for(;f.length>y;)M(S,o=f[y++])&&(~T(c,o)||c.push(o));return c}},{"./_array-includes":96,"./_has":111,"./_shared-key":151,"./_to-iobject":158}],140:[function(I,$,R){var M=I("./_object-keys-internal"),g=I("./_enum-bug-keys");$.exports=Object.keys||function(D){return M(D,g)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],141:[function(I,$,R){R.f={}.propertyIsEnumerable},{}],142:[function(I,$,R){var M=I("./_export"),g=I("./_core"),T=I("./_fails");$.exports=function(D,v){var f=(g.Object||{})[D]||Object[D],S={};S[D]=v(f),M(M.S+M.F*T(function(){f(1)}),"Object",S)}},{"./_core":99,"./_export":107,"./_fails":108}],143:[function(I,$,R){var M=I("./_descriptors"),g=I("./_object-keys"),T=I("./_to-iobject"),D=I("./_object-pie").f;$.exports=function(v){return function(f){for(var S=T(f),y=g(S),c=y.length,o=0,r=[],s;c>o;)s=y[o++],(!M||D.call(S,s))&&r.push(v?[s,S[s]]:S[s]);return r}}},{"./_descriptors":103,"./_object-keys":140,"./_object-pie":141,"./_to-iobject":158}],144:[function(I,$,R){$.exports=function(M){try{return{e:!1,v:M()}}catch(g){return{e:!0,v:g}}}},{}],145:[function(I,$,R){var M=I("./_an-object"),g=I("./_is-object"),T=I("./_new-promise-capability");$.exports=function(D,v){if(M(D),g(v)&&v.constructor===D)return v;var f=T.f(D),S=f.resolve;return S(v),f.promise}},{"./_an-object":95,"./_is-object":119,"./_new-promise-capability":129}],146:[function(I,$,R){$.exports=function(M,g){return{enumerable:!(M&1),configurable:!(M&2),writable:!(M&4),value:g}}},{}],147:[function(I,$,R){var M=I("./_hide");$.exports=function(g,T,D){for(var v in T)D&&g[v]?g[v]=T[v]:M(g,v,T[v]);return g}},{"./_hide":112}],148:[function(I,$,R){$.exports=I("./_hide")},{"./_hide":112}],149:[function(I,$,R){"use strict";var M=I("./_global"),g=I("./_core"),T=I("./_object-dp"),D=I("./_descriptors"),v=I("./_wks")("species");$.exports=function(f){var S=typeof g[f]=="function"?g[f]:M[f];D&&S&&!S[v]&&T.f(S,v,{configurable:!0,get:function(){return this}})}},{"./_core":99,"./_descriptors":103,"./_global":110,"./_object-dp":132,"./_wks":166}],150:[function(I,$,R){var M=I("./_object-dp").f,g=I("./_has"),T=I("./_wks")("toStringTag");$.exports=function(D,v,f){D&&!g(D=f?D:D.prototype,T)&&M(D,T,{configurable:!0,value:v})}},{"./_has":111,"./_object-dp":132,"./_wks":166}],151:[function(I,$,R){var M=I("./_shared")("keys"),g=I("./_uid");$.exports=function(T){return M[T]||(M[T]=g(T))}},{"./_shared":152,"./_uid":162}],152:[function(I,$,R){var M=I("./_core"),g=I("./_global"),T="__core-js_shared__",D=g[T]||(g[T]={});($.exports=function(v,f){return D[v]||(D[v]=f!==void 0?f:{})})("versions",[]).push({version:M.version,mode:I("./_library")?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},{"./_core":99,"./_global":110,"./_library":126}],153:[function(I,$,R){var M=I("./_an-object"),g=I("./_a-function"),T=I("./_wks")("species");$.exports=function(D,v){var f=M(D).constructor,S;return f===void 0||(S=M(f)[T])==null?v:g(S)}},{"./_a-function":92,"./_an-object":95,"./_wks":166}],154:[function(I,$,R){var M=I("./_to-integer"),g=I("./_defined");$.exports=function(T){return function(D,v){var f=String(g(D)),S=M(v),y=f.length,c,o;return S<0||S>=y?T?"":void 0:(c=f.charCodeAt(S),c<55296||c>56319||S+1===y||(o=f.charCodeAt(S+1))<56320||o>57343?T?f.charAt(S):c:T?f.slice(S,S+2):(c-55296<<10)+(o-56320)+65536)}}},{"./_defined":102,"./_to-integer":157}],155:[function(I,$,R){var M=I("./_ctx"),g=I("./_invoke"),T=I("./_html"),D=I("./_dom-create"),v=I("./_global"),f=v.process,S=v.setImmediate,y=v.clearImmediate,c=v.MessageChannel,o=v.Dispatch,r=0,s={},d="onreadystatechange",u,p,m,i=function(){var a=+this;if(s.hasOwnProperty(a)){var l=s[a];delete s[a],l()}},t=function(a){i.call(a.data)};(!S||!y)&&(S=function(l){for(var E=[],b=1;arguments.length>b;)E.push(arguments[b++]);return s[++r]=function(){g(typeof l=="function"?l:Function(l),E)},u(r),r},y=function(l){delete s[l]},I("./_cof")(f)=="process"?u=function(a){f.nextTick(M(i,a,1))}:o&&o.now?u=function(a){o.now(M(i,a,1))}:c?(p=new c,m=p.port2,p.port1.onmessage=t,u=M(m.postMessage,m,1)):v.addEventListener&&typeof postMessage=="function"&&!v.importScripts?(u=function(a){v.postMessage(a+"","*")},v.addEventListener("message",t,!1)):d in D("script")?u=function(a){T.appendChild(D("script"))[d]=function(){T.removeChild(this),i.call(a)}}:u=function(a){setTimeout(M(i,a,1),0)}),$.exports={set:S,clear:y}},{"./_cof":98,"./_ctx":101,"./_dom-create":104,"./_global":110,"./_html":113,"./_invoke":115}],156:[function(I,$,R){var M=I("./_to-integer"),g=Math.max,T=Math.min;$.exports=function(D,v){return D=M(D),D<0?g(D+v,0):T(D,v)}},{"./_to-integer":157}],157:[function(I,$,R){var M=Math.ceil,g=Math.floor;$.exports=function(T){return isNaN(T=+T)?0:(T>0?g:M)(T)}},{}],158:[function(I,$,R){var M=I("./_iobject"),g=I("./_defined");$.exports=function(T){return M(g(T))}},{"./_defined":102,"./_iobject":116}],159:[function(I,$,R){var M=I("./_to-integer"),g=Math.min;$.exports=function(T){return T>0?g(M(T),9007199254740991):0}},{"./_to-integer":157}],160:[function(I,$,R){var M=I("./_defined");$.exports=function(g){return Object(M(g))}},{"./_defined":102}],161:[function(I,$,R){var M=I("./_is-object");$.exports=function(g,T){if(!M(g))return g;var D,v;if(T&&typeof(D=g.toString)=="function"&&!M(v=D.call(g)))return v;if(typeof(D=g.valueOf)=="function"&&!M(v=D.call(g)))return v;if(!T&&typeof(D=g.toString)=="function"&&!M(v=D.call(g)))return v;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":119}],162:[function(I,$,R){var M=0,g=Math.random();$.exports=function(T){return"Symbol(".concat(T===void 0?"":T,")_",(++M+g).toString(36))}},{}],163:[function(I,$,R){var M=I("./_global"),g=M.navigator;$.exports=g&&g.userAgent||""},{"./_global":110}],164:[function(I,$,R){var M=I("./_global"),g=I("./_core"),T=I("./_library"),D=I("./_wks-ext"),v=I("./_object-dp").f;$.exports=function(f){var S=g.Symbol||(g.Symbol=T?{}:M.Symbol||{});f.charAt(0)!="_"&&!(f in S)&&v(S,f,{value:D.f(f)})}},{"./_core":99,"./_global":110,"./_library":126,"./_object-dp":132,"./_wks-ext":165}],165:[function(I,$,R){R.f=I("./_wks")},{"./_wks":166}],166:[function(I,$,R){var M=I("./_shared")("wks"),g=I("./_uid"),T=I("./_global").Symbol,D=typeof T=="function",v=$.exports=function(f){return M[f]||(M[f]=D&&T[f]||(D?T:g)("Symbol."+f))};v.store=M},{"./_global":110,"./_shared":152,"./_uid":162}],167:[function(I,$,R){var M=I("./_classof"),g=I("./_wks")("iterator"),T=I("./_iterators");$.exports=I("./_core").getIteratorMethod=function(D){if(D!=null)return D[g]||D["@@iterator"]||T[M(D)]}},{"./_classof":97,"./_core":99,"./_iterators":125,"./_wks":166}],168:[function(I,$,R){"use strict";var M=I("./_ctx"),g=I("./_export"),T=I("./_to-object"),D=I("./_iter-call"),v=I("./_is-array-iter"),f=I("./_to-length"),S=I("./_create-property"),y=I("./core.get-iterator-method");g(g.S+g.F*!I("./_iter-detect")(function(c){Array.from(c)}),"Array",{from:function(o){var r=T(o),s=typeof this=="function"?this:Array,d=arguments.length,u=d>1?arguments[1]:void 0,p=u!==void 0,m=0,i=y(r),t,a,l,E;if(p&&(u=M(u,d>2?arguments[2]:void 0,2)),i!=null&&!(s==Array&&v(i)))for(E=i.call(r),a=new s;!(l=E.next()).done;m++)S(a,m,p?D(E,u,[l.value,m],!0):l.value);else for(t=f(r.length),a=new s(t);t>m;m++)S(a,m,p?u(r[m],m):r[m]);return a.length=m,a}})},{"./_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,$,R){"use strict";var M=I("./_add-to-unscopables"),g=I("./_iter-step"),T=I("./_iterators"),D=I("./_to-iobject");$.exports=I("./_iter-define")(Array,"Array",function(v,f){this._t=D(v),this._i=0,this._k=f},function(){var v=this._t,f=this._k,S=this._i++;return!v||S>=v.length?(this._t=void 0,g(1)):f=="keys"?g(0,S):f=="values"?g(0,v[S]):g(0,[S,v[S]])},"values"),T.Arguments=T.Array,M("keys"),M("values"),M("entries")},{"./_add-to-unscopables":93,"./_iter-define":122,"./_iter-step":124,"./_iterators":125,"./_to-iobject":158}],170:[function(I,$,R){"use strict";var M=I("./_is-object"),g=I("./_object-gpo"),T=I("./_wks")("hasInstance"),D=Function.prototype;T in D||I("./_object-dp").f(D,T,{value:function(v){if(typeof this!="function"||!M(v))return!1;if(!M(this.prototype))return v instanceof this;for(;v=g(v);)if(this.prototype===v)return!0;return!1}})},{"./_is-object":119,"./_object-dp":132,"./_object-gpo":138,"./_wks":166}],171:[function(I,$,R){var M=I("./_export");M(M.S+M.F,"Object",{assign:I("./_object-assign")})},{"./_export":107,"./_object-assign":130}],172:[function(I,$,R){var M=I("./_export");M(M.S,"Object",{create:I("./_object-create")})},{"./_export":107,"./_object-create":131}],173:[function(I,$,R){var M=I("./_export");M(M.S+M.F*!I("./_descriptors"),"Object",{defineProperty:I("./_object-dp").f})},{"./_descriptors":103,"./_export":107,"./_object-dp":132}],174:[function(I,$,R){I("./_object-sap")("getOwnPropertyNames",function(){return I("./_object-gopn-ext").f})},{"./_object-gopn-ext":135,"./_object-sap":142}],175:[function(I,$,R){var M=I("./_to-object"),g=I("./_object-gpo");I("./_object-sap")("getPrototypeOf",function(){return function(D){return g(M(D))}})},{"./_object-gpo":138,"./_object-sap":142,"./_to-object":160}],176:[function(I,$,R){var M=I("./_to-object"),g=I("./_object-keys");I("./_object-sap")("keys",function(){return function(D){return g(M(D))}})},{"./_object-keys":140,"./_object-sap":142,"./_to-object":160}],177:[function(I,$,R){arguments[4][71][0].apply(R,arguments)},{dup:71}],178:[function(I,$,R){"use strict";var M=I("./_library"),g=I("./_global"),T=I("./_ctx"),D=I("./_classof"),v=I("./_export"),f=I("./_is-object"),S=I("./_a-function"),y=I("./_an-instance"),c=I("./_for-of"),o=I("./_species-constructor"),r=I("./_task").set,s=I("./_microtask")(),d=I("./_new-promise-capability"),u=I("./_perform"),p=I("./_user-agent"),m=I("./_promise-resolve"),i="Promise",t=g.TypeError,a=g.process,l=a&&a.versions,E=l&&l.v8||"",b=g[i],h=D(a)=="process",L=function(){},O,w,C,x,_=w=d.f,j=!!function(){try{var W=b.resolve(1),H=(W.constructor={})[I("./_wks")("species")]=function(q){q(L,L)};return(h||typeof PromiseRejectionEvent=="function")&&W.then(L)instanceof H&&E.indexOf("6.6")!==0&&p.indexOf("Chrome/66")===-1}catch(q){}}(),N=function(W){var H;return f(W)&&typeof(H=W.then)=="function"?H:!1},P=function(W,H){if(W._n)return;W._n=!0;var q=W._c;s(function(){for(var ne=W._v,te=W._s==1,_e=0,Ce=function(me){var Me=te?me.ok:me.fail,Oe=me.resolve,he=me.reject,ce=me.domain,se,Te,re;try{Me?(te||(W._h==2&&B(W),W._h=1),Me===!0?se=ne:(ce&&ce.enter(),se=Me(ne),ce&&(ce.exit(),re=!0)),se===me.promise?he(t("Promise-chain cycle")):(Te=N(se))?Te.call(se,Oe,he):Oe(se)):he(ne)}catch(ue){ce&&!re&&ce.exit(),he(ue)}};q.length>_e;)Ce(q[_e++]);W._c=[],W._n=!1,H&&!W._h&&V(W)})},V=function(W){r.call(g,function(){var H=W._v,q=z(W),ne,te,_e;if(q&&(ne=u(function(){h?a.emit("unhandledRejection",H,W):(te=g.onunhandledrejection)?te({promise:W,reason:H}):(_e=g.console)&&_e.error&&_e.error("Unhandled promise rejection",H)}),W._h=h||z(W)?2:1),W._a=void 0,q&&ne.e)throw ne.v})},z=function(W){return W._h!==1&&(W._a||W._c).length===0},B=function(W){r.call(g,function(){var H;h?a.emit("rejectionHandled",W):(H=g.onrejectionhandled)&&H({promise:W,reason:W._v})})},K=function(W){var H=this;if(H._d)return;H._d=!0,H=H._w||H,H._v=W,H._s=2,H._a||(H._a=H._c.slice()),P(H,!0)},U=function(W){var H=this,q;if(H._d)return;H._d=!0,H=H._w||H;try{if(H===W)throw t("Promise can't be resolved itself");(q=N(W))?s(function(){var ne={_w:H,_d:!1};try{q.call(W,T(U,ne,1),T(K,ne,1))}catch(te){K.call(ne,te)}}):(H._v=W,H._s=1,P(H,!1))}catch(ne){K.call({_w:H,_d:!1},ne)}};j||(b=function(H){y(this,b,i,"_h"),S(H),O.call(this);try{H(T(U,this,1),T(K,this,1))}catch(q){K.call(this,q)}},O=function(H){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},O.prototype=I("./_redefine-all")(b.prototype,{then:function(H,q){var ne=_(o(this,b));return ne.ok=typeof H=="function"?H:!0,ne.fail=typeof q=="function"&&q,ne.domain=h?a.domain:void 0,this._c.push(ne),this._a&&this._a.push(ne),this._s&&P(this,!1),ne.promise},catch:function(W){return this.then(void 0,W)}}),C=function(){var W=new O;this.promise=W,this.resolve=T(U,W,1),this.reject=T(K,W,1)},d.f=_=function(W){return W===b||W===x?new C(W):w(W)}),v(v.G+v.W+v.F*!j,{Promise:b}),I("./_set-to-string-tag")(b,i),I("./_set-species")(i),x=I("./_core")[i],v(v.S+v.F*!j,i,{reject:function(H){var q=_(this),ne=q.reject;return ne(H),q.promise}}),v(v.S+v.F*(M||!j),i,{resolve:function(H){return m(M&&this===x?b:this,H)}}),v(v.S+v.F*!(j&&I("./_iter-detect")(function(W){b.all(W).catch(L)})),i,{all:function(H){var q=this,ne=_(q),te=ne.resolve,_e=ne.reject,Ce=u(function(){var me=[],Me=0,Oe=1;c(H,!1,function(he){var ce=Me++,se=!1;me.push(void 0),Oe++,q.resolve(he).then(function(Te){if(se)return;se=!0,me[ce]=Te,--Oe||te(me)},_e)}),--Oe||te(me)});return Ce.e&&_e(Ce.v),ne.promise},race:function(H){var q=this,ne=_(q),te=ne.reject,_e=u(function(){c(H,!1,function(Ce){q.resolve(Ce).then(ne.resolve,te)})});return _e.e&&te(_e.v),ne.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,$,R){var M=I("./_export"),g=I("./_to-absolute-index"),T=String.fromCharCode,D=String.fromCodePoint;M(M.S+M.F*(!!D&&D.length!=1),"String",{fromCodePoint:function(f){for(var S=[],y=arguments.length,c=0,o;y>c;){if(o=+arguments[c++],g(o,1114111)!==o)throw RangeError(o+" is not a valid code point");S.push(o<65536?T(o):T(((o-=65536)>>10)+55296,o%1024+56320))}return S.join("")}})},{"./_export":107,"./_to-absolute-index":156}],180:[function(I,$,R){"use strict";var M=I("./_string-at")(!0);I("./_iter-define")(String,"String",function(g){this._t=String(g),this._i=0},function(){var g=this._t,T=this._i,D;return T>=g.length?{value:void 0,done:!0}:(D=M(g,T),this._i+=D.length,{value:D,done:!1})})},{"./_iter-define":122,"./_string-at":154}],181:[function(I,$,R){"use strict";var M=I("./_global"),g=I("./_has"),T=I("./_descriptors"),D=I("./_export"),v=I("./_redefine"),f=I("./_meta").KEY,S=I("./_fails"),y=I("./_shared"),c=I("./_set-to-string-tag"),o=I("./_uid"),r=I("./_wks"),s=I("./_wks-ext"),d=I("./_wks-define"),u=I("./_enum-keys"),p=I("./_is-array"),m=I("./_an-object"),i=I("./_is-object"),t=I("./_to-object"),a=I("./_to-iobject"),l=I("./_to-primitive"),E=I("./_property-desc"),b=I("./_object-create"),h=I("./_object-gopn-ext"),L=I("./_object-gopd"),O=I("./_object-gops"),w=I("./_object-dp"),C=I("./_object-keys"),x=L.f,_=w.f,j=h.f,N=M.Symbol,P=M.JSON,V=P&&P.stringify,z="prototype",B=r("_hidden"),K=r("toPrimitive"),U={}.propertyIsEnumerable,W=y("symbol-registry"),H=y("symbols"),q=y("op-symbols"),ne=Object[z],te=typeof N=="function"&&!!O.f,_e=M.QObject,Ce=!_e||!_e[z]||!_e[z].findChild,me=T&&S(function(){return b(_({},"a",{get:function(){return _(this,"a",{value:7}).a}})).a!=7})?function(ye,Re,Je){var Ze=x(ne,Re);Ze&&delete ne[Re],_(ye,Re,Je),Ze&&ye!==ne&&_(ne,Re,Ze)}:_,Me=function(ye){var Re=H[ye]=b(N[z]);return Re._k=ye,Re},Oe=te&&typeof N.iterator=="symbol"?function(ye){return typeof ye=="symbol"}:function(ye){return ye instanceof N},he=function(Re,Je,Ze){return Re===ne&&he(q,Je,Ze),m(Re),Je=l(Je,!0),m(Ze),g(H,Je)?(Ze.enumerable?(g(Re,B)&&Re[B][Je]&&(Re[B][Je]=!1),Ze=b(Ze,{enumerable:E(0,!1)})):(g(Re,B)||_(Re,B,E(1,{})),Re[B][Je]=!0),me(Re,Je,Ze)):_(Re,Je,Ze)},ce=function(Re,Je){m(Re);for(var Ze=u(Je=a(Je)),rt=0,tt=Ze.length,st;tt>rt;)he(Re,st=Ze[rt++],Je[st]);return Re},se=function(Re,Je){return Je===void 0?b(Re):ce(b(Re),Je)},Te=function(Re){var Je=U.call(this,Re=l(Re,!0));return this===ne&&g(H,Re)&&!g(q,Re)?!1:Je||!g(this,Re)||!g(H,Re)||g(this,B)&&this[B][Re]?Je:!0},re=function(Re,Je){if(Re=a(Re),Je=l(Je,!0),Re===ne&&g(H,Je)&&!g(q,Je))return;var Ze=x(Re,Je);return Ze&&g(H,Je)&&!(g(Re,B)&&Re[B][Je])&&(Ze.enumerable=!0),Ze},ue=function(Re){for(var Je=j(a(Re)),Ze=[],rt=0,tt;Je.length>rt;)!g(H,tt=Je[rt++])&&tt!=B&&tt!=f&&Ze.push(tt);return Ze},fe=function(Re){for(var Je=Re===ne,Ze=j(Je?q:a(Re)),rt=[],tt=0,st;Ze.length>tt;)g(H,st=Ze[tt++])&&(Je?g(ne,st):!0)&&rt.push(H[st]);return rt};te||(N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var Re=o(arguments.length>0?arguments[0]:void 0),Je=function(Ze){this===ne&&Je.call(q,Ze),g(this,B)&&g(this[B],Re)&&(this[B][Re]=!1),me(this,Re,E(1,Ze))};return T&&Ce&&me(ne,Re,{configurable:!0,set:Je}),Me(Re)},v(N[z],"toString",function(){return this._k}),L.f=re,w.f=he,I("./_object-gopn").f=h.f=ue,I("./_object-pie").f=Te,O.f=fe,T&&!I("./_library")&&v(ne,"propertyIsEnumerable",Te,!0),s.f=function(ye){return Me(r(ye))}),D(D.G+D.W+D.F*!te,{Symbol:N});for(var ee="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Q=0;ee.length>Q;)r(ee[Q++]);for(var X=C(r.store),Z=0;X.length>Z;)d(X[Z++]);D(D.S+D.F*!te,"Symbol",{for:function(ye){return g(W,ye+="")?W[ye]:W[ye]=N(ye)},keyFor:function(Re){if(!Oe(Re))throw TypeError(Re+" is not a symbol!");for(var Je in W)if(W[Je]===Re)return Je},useSetter:function(){Ce=!0},useSimple:function(){Ce=!1}}),D(D.S+D.F*!te,"Object",{create:se,defineProperty:he,defineProperties:ce,getOwnPropertyDescriptor:re,getOwnPropertyNames:ue,getOwnPropertySymbols:fe});var ve=S(function(){O.f(1)});D(D.S+D.F*ve,"Object",{getOwnPropertySymbols:function(Re){return O.f(t(Re))}}),P&&D(D.S+D.F*(!te||S(function(){var ye=N();return V([ye])!="[null]"||V({a:ye})!="{}"||V(Object(ye))!="{}"})),"JSON",{stringify:function(Re){for(var Je=[Re],Ze=1,rt,tt;arguments.length>Ze;)Je.push(arguments[Ze++]);return tt=rt=Je[1],!i(rt)&&Re===void 0||Oe(Re)?void 0:(p(rt)||(rt=function(st,ot){if(typeof tt=="function"&&(ot=tt.call(this,st,ot)),!Oe(ot))return ot}),Je[1]=rt,V.apply(P,Je))}}),N[z][K]||I("./_hide")(N[z],K,N[z].valueOf),c(N,"Symbol"),c(Math,"Math",!0),c(M.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,$,R){var M=I("./_export"),g=I("./_object-to-array")(!0);M(M.S,"Object",{entries:function(D){return g(D)}})},{"./_export":107,"./_object-to-array":143}],183:[function(I,$,R){"use strict";var M=I("./_export"),g=I("./_core"),T=I("./_global"),D=I("./_species-constructor"),v=I("./_promise-resolve");M(M.P+M.R,"Promise",{finally:function(f){var S=D(this,g.Promise||T.Promise),y=typeof f=="function";return this.then(y?function(c){return v(S,f()).then(function(){return c})}:f,y?function(c){return v(S,f()).then(function(){throw c})}:f)}})},{"./_core":99,"./_export":107,"./_global":110,"./_promise-resolve":145,"./_species-constructor":153}],184:[function(I,$,R){"use strict";var M=I("./_export"),g=I("./_new-promise-capability"),T=I("./_perform");M(M.S,"Promise",{try:function(D){var v=g.f(this),f=T(D);return(f.e?v.reject:v.resolve)(f.v),v.promise}})},{"./_export":107,"./_new-promise-capability":129,"./_perform":144}],185:[function(I,$,R){I("./_wks-define")("asyncIterator")},{"./_wks-define":164}],186:[function(I,$,R){I("./_wks-define")("observable")},{"./_wks-define":164}],187:[function(I,$,R){I("./es6.array.iterator");for(var M=I("./_global"),g=I("./_hide"),T=I("./_iterators"),D=I("./_wks")("toStringTag"),v="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(","),f=0;f<v.length;f++){var S=v[f],y=M[S],c=y&&y.prototype;c&&!c[D]&&g(c,D,S),T[S]=T.Array}},{"./_global":110,"./_hide":112,"./_iterators":125,"./_wks":166,"./es6.array.iterator":169}],188:[function(I,$,R){var M=I("./_export"),g=I("./_task");M(M.G+M.B,{setImmediate:g.set,clearImmediate:g.clear})},{"./_export":107,"./_task":155}],189:[function(I,$,R){(function(M){"use strict";var g=I("babel-runtime/helpers/typeof"),T=D(g);function D(l){return l&&l.__esModule?l:{default:l}}function v(l){return Array.isArray?Array.isArray(l):a(l)==="[object Array]"}R.isArray=v;function f(l){return typeof l=="boolean"}R.isBoolean=f;function S(l){return l===null}R.isNull=S;function y(l){return l==null}R.isNullOrUndefined=y;function c(l){return typeof l=="number"}R.isNumber=c;function o(l){return typeof l=="string"}R.isString=o;function r(l){return(typeof l=="undefined"?"undefined":(0,T.default)(l))==="symbol"}R.isSymbol=r;function s(l){return l===void 0}R.isUndefined=s;function d(l){return a(l)==="[object RegExp]"}R.isRegExp=d;function u(l){return(typeof l=="undefined"?"undefined":(0,T.default)(l))==="object"&&l!==null}R.isObject=u;function p(l){return a(l)==="[object Date]"}R.isDate=p;function m(l){return a(l)==="[object Error]"||l instanceof Error}R.isError=m;function i(l){return typeof l=="function"}R.isFunction=i;function t(l){return l===null||typeof l=="boolean"||typeof l=="number"||typeof l=="string"||(typeof l=="undefined"?"undefined":(0,T.default)(l))==="symbol"||typeof l=="undefined"}R.isPrimitive=t,R.isBuffer=M.isBuffer;function a(l){return Object.prototype.toString.call(l)}}).call(this,{isBuffer:I("../../is-buffer/index.js")})},{"../../is-buffer/index.js":197,"babel-runtime/helpers/typeof":67}],190:[function(I,$,R){"use strict";var M=I("babel-runtime/helpers/typeof"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(D){"use strict";var v=function(){var o=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,r=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,s=/[^-+\dA-Z]/g;return function(d,u,p,m){if(arguments.length===1&&c(d)==="string"&&!/\d/.test(d)&&(u=d,d=void 0),d=d||new Date,d instanceof Date||(d=new Date(d)),isNaN(d))throw TypeError("Invalid date");u=String(v.masks[u]||u||v.masks.default);var i=u.slice(0,4);(i==="UTC:"||i==="GMT:")&&(u=u.slice(4),p=!0,i==="GMT:"&&(m=!0));var t=p?"getUTC":"get",a=d[t+"Date"](),l=d[t+"Day"](),E=d[t+"Month"](),b=d[t+"FullYear"](),h=d[t+"Hours"](),L=d[t+"Minutes"](),O=d[t+"Seconds"](),w=d[t+"Milliseconds"](),C=p?0:d.getTimezoneOffset(),x=S(d),_=y(d),j={d:a,dd:f(a),ddd:v.i18n.dayNames[l],dddd:v.i18n.dayNames[l+7],m:E+1,mm:f(E+1),mmm:v.i18n.monthNames[E],mmmm:v.i18n.monthNames[E+12],yy:String(b).slice(2),yyyy:b,h:h%12||12,hh:f(h%12||12),H:h,HH:f(h),M:L,MM:f(L),s:O,ss:f(O),l:f(w,3),L:f(Math.round(w/10)),t:h<12?"a":"p",tt:h<12?"am":"pm",T:h<12?"A":"P",TT:h<12?"AM":"PM",Z:m?"GMT":p?"UTC":(String(d).match(r)||[""]).pop().replace(s,""),o:(C>0?"-":"+")+f(Math.floor(Math.abs(C)/60)*100+Math.abs(C)%60,4),S:["th","st","nd","rd"][a%10>3?0:(a%100-a%10!=10)*a%10],W:x,N:_};return u.replace(o,function(N){return N in j?j[N]:N.slice(1,N.length-1)})}}();v.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"},v.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 f(o,r){for(o=String(o),r=r||2;o.length<r;)o="0"+o;return o}function S(o){var r=new Date(o.getFullYear(),o.getMonth(),o.getDate());r.setDate(r.getDate()-(r.getDay()+6)%7+3);var s=new Date(r.getFullYear(),0,4);s.setDate(s.getDate()-(s.getDay()+6)%7+3);var d=r.getTimezoneOffset()-s.getTimezoneOffset();r.setHours(r.getHours()-d);var u=(r-s)/(864e5*7);return 1+Math.floor(u)}function y(o){var r=o.getDay();return r===0&&(r=7),r}function c(o){return o===null?"null":o===void 0?"undefined":(typeof o=="undefined"?"undefined":(0,g.default)(o))!=="object"?typeof o=="undefined"?"undefined":(0,g.default)(o):Array.isArray(o)?"array":{}.toString.call(o).slice(8,-1).toLowerCase()}typeof define=="function"&&define.amd?define(function(){return v}):(typeof R=="undefined"?"undefined":(0,g.default)(R))==="object"?$.exports=v:D.dateFormat=v})(void 0)},{"babel-runtime/helpers/typeof":67}],191:[function(I,$,R){/*!
|
|
|
* escape-html
|
|
|
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
|
* Copyright(c) 2015 Andreas Lubbe
|
|
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var M=/["'&<>]/;$.exports=g;function g(T){var D=""+T,v=M.exec(D);if(!v)return D;var f,S="",y=0,c=0;for(y=v.index;y<D.length;y++){switch(D.charCodeAt(y)){case 34:f=""";break;case 38:f="&";break;case 39:f="'";break;case 60:f="<";break;case 62:f=">";break;default:continue}c!==y&&(S+=D.substring(c,y)),c=y+1,S+=f}return c!==y?S+D.substring(c,y):S}},{}],192:[function(I,$,R){function M(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}$.exports=M,M.EventEmitter=M,M.prototype._events=void 0,M.prototype._maxListeners=void 0,M.defaultMaxListeners=10,M.prototype.setMaxListeners=function(f){if(!T(f)||f<0||isNaN(f))throw TypeError("n must be a positive number");return this._maxListeners=f,this},M.prototype.emit=function(f){var S,y,c,o,r,s;if(this._events||(this._events={}),f==="error"&&(!this._events.error||D(this._events.error)&&!this._events.error.length)){if(S=arguments[1],S instanceof Error)throw S;var d=new Error('Uncaught, unspecified "error" event. ('+S+")");throw d.context=S,d}if(y=this._events[f],v(y))return!1;if(g(y))switch(arguments.length){case 1:y.call(this);break;case 2:y.call(this,arguments[1]);break;case 3:y.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),y.apply(this,o)}else if(D(y))for(o=Array.prototype.slice.call(arguments,1),s=y.slice(),c=s.length,r=0;r<c;r++)s[r].apply(this,o);return!0},M.prototype.addListener=function(f,S){var y;if(!g(S))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",f,g(S.listener)?S.listener:S),this._events[f]?D(this._events[f])?this._events[f].push(S):this._events[f]=[this._events[f],S]:this._events[f]=S,D(this._events[f])&&!this._events[f].warned&&(v(this._maxListeners)?y=M.defaultMaxListeners:y=this._maxListeners,y&&y>0&&this._events[f].length>y&&(this._events[f].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[f].length),typeof console.trace=="function"&&console.trace())),this},M.prototype.on=M.prototype.addListener,M.prototype.once=function(f,S){if(!g(S))throw TypeError("listener must be a function");var y=!1;function c(){this.removeListener(f,c),y||(y=!0,S.apply(this,arguments))}return c.listener=S,this.on(f,c),this},M.prototype.removeListener=function(f,S){var y,c,o,r;if(!g(S))throw TypeError("listener must be a function");if(!this._events||!this._events[f])return this;if(y=this._events[f],o=y.length,c=-1,y===S||g(y.listener)&&y.listener===S)delete this._events[f],this._events.removeListener&&this.emit("removeListener",f,S);else if(D(y)){for(r=o;r-- >0;)if(y[r]===S||y[r].listener&&y[r].listener===S){c=r;break}if(c<0)return this;y.length===1?(y.length=0,delete this._events[f]):y.splice(c,1),this._events.removeListener&&this.emit("removeListener",f,S)}return this},M.prototype.removeAllListeners=function(f){var S,y;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[f]&&delete this._events[f],this;if(arguments.length===0){for(S in this._events){if(S==="removeListener")continue;this.removeAllListeners(S)}return this.removeAllListeners("removeListener"),this._events={},this}if(y=this._events[f],g(y))this.removeListener(f,y);else if(y)for(;y.length;)this.removeListener(f,y[y.length-1]);return delete this._events[f],this},M.prototype.listeners=function(f){var S;return!this._events||!this._events[f]?S=[]:g(this._events[f])?S=[this._events[f]]:S=this._events[f].slice(),S},M.prototype.listenerCount=function(f){if(this._events){var S=this._events[f];if(g(S))return 1;if(S)return S.length}return 0},M.listenerCount=function(f,S){return f.listenerCount(S)};function g(f){return typeof f=="function"}function T(f){return typeof f=="number"}function D(f){return typeof f=="object"&&f!==null}function v(f){return f===void 0}},{}],193:[function(I,$,R){var M=I("http"),g=$.exports;for(var T in M)M.hasOwnProperty(T)&&(g[T]=M[T]);g.request=function(D,v){return D||(D={}),D.scheme="https",D.protocol="https:",M.request.call(this,D,v)}},{http:231}],194:[function(I,$,R){/*!
|
|
|
* humanize-ms - index.js
|
|
|
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var M=I("util"),g=I("ms");$.exports=function(T){if(typeof T=="number")return T;var D=g(T);if(D===void 0){var v=new Error(M.format("humanize-ms(%j) result undefined",T));console.warn(v.stack)}return D}},{ms:204,util:243}],195:[function(I,$,R){R.read=function(M,g,T,D,v){var f,S,y=v*8-D-1,c=(1<<y)-1,o=c>>1,r=-7,s=T?v-1:0,d=T?-1:1,u=M[g+s];for(s+=d,f=u&(1<<-r)-1,u>>=-r,r+=y;r>0;f=f*256+M[g+s],s+=d,r-=8);for(S=f&(1<<-r)-1,f>>=-r,r+=D;r>0;S=S*256+M[g+s],s+=d,r-=8);if(f===0)f=1-o;else{if(f===c)return S?NaN:(u?-1:1)*Infinity;S=S+Math.pow(2,D),f=f-o}return(u?-1:1)*S*Math.pow(2,f-D)},R.write=function(M,g,T,D,v,f){var S,y,c,o=f*8-v-1,r=(1<<o)-1,s=r>>1,d=v===23?Math.pow(2,-24)-Math.pow(2,-77):0,u=D?0:f-1,p=D?1:-1,m=g<0||g===0&&1/g<0?1:0;for(g=Math.abs(g),isNaN(g)||g===Infinity?(y=isNaN(g)?1:0,S=r):(S=Math.floor(Math.log(g)/Math.LN2),g*(c=Math.pow(2,-S))<1&&(S--,c*=2),S+s>=1?g+=d/c:g+=d*Math.pow(2,1-s),g*c>=2&&(S++,c/=2),S+s>=r?(y=0,S=r):S+s>=1?(y=(g*c-1)*Math.pow(2,v),S=S+s):(y=g*Math.pow(2,s-1)*Math.pow(2,v),S=0));v>=8;M[T+u]=y&255,u+=p,y/=256,v-=8);for(S=S<<v|y,o+=v;o>0;M[T+u]=S&255,u+=p,S/=256,o-=8);M[T+u-p]|=m*128}},{}],196:[function(I,$,R){typeof Object.create=="function"?$.exports=function(g,T){T&&(g.super_=T,g.prototype=Object.create(T.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}))}:$.exports=function(g,T){if(T){g.super_=T;var D=function(){};D.prototype=T.prototype,g.prototype=new D,g.prototype.constructor=g}}},{}],197:[function(I,$,R){/*!
|
|
|
* Determine if an object is a Buffer
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
|
* @license MIT
|
|
|
*/$.exports=function(T){return T!=null&&(M(T)||g(T)||!!T._isBuffer)};function M(T){return!!T.constructor&&typeof T.constructor.isBuffer=="function"&&T.constructor.isBuffer(T)}function g(T){return typeof T.readFloatLE=="function"&&typeof T.slice=="function"&&M(T.slice(0,0))}},{}],198:[function(I,$,R){var M={}.toString;$.exports=Array.isArray||function(g){return M.call(g)=="[object Array]"}},{}],199:[function(require,module,exports){(function(global){(function(I,$){typeof exports=="object"&&typeof module!="undefined"?module.exports=$(I):typeof define=="function"&&define.amd?define($):$(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 $={},R=0,M=I.length;R<M;R++)$[I.charAt(R)]=R;return $}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(I){if(I.length<2){var $=I.charCodeAt(0);return $<128?I:$<2048?fromCharCode(192|$>>>6)+fromCharCode(128|$&63):fromCharCode(224|$>>>12&15)+fromCharCode(128|$>>>6&63)+fromCharCode(128|$&63)}else{var $=65536+(I.charCodeAt(0)-55296)*1024+(I.charCodeAt(1)-56320);return fromCharCode(240|$>>>18&7)+fromCharCode(128|$>>>12&63)+fromCharCode(128|$>>>6&63)+fromCharCode(128|$&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 $=[0,2,1][I.length%3],R=I.charCodeAt(0)<<16|(I.length>1?I.charCodeAt(1):0)<<8|(I.length>2?I.charCodeAt(2):0),M=[b64chars.charAt(R>>>18),b64chars.charAt(R>>>12&63),$>=2?"=":b64chars.charAt(R>>>6&63),$>=1?"=":b64chars.charAt(R&63)];return M.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 $=Object.prototype.toString.call(I)==="[object Uint8Array]";return $?I.toString("base64"):btoa(utob(String(I)))},encode=function(I,$){return $?_encode(String(I)).replace(/[+\/]/g,function(R){return R=="+"?"-":"_"}).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 $=(7&I.charCodeAt(0))<<18|(63&I.charCodeAt(1))<<12|(63&I.charCodeAt(2))<<6|63&I.charCodeAt(3),R=$-65536;return fromCharCode((R>>>10)+55296)+fromCharCode((R&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 $=I.length,R=$%4,M=($>0?b64tab[I.charAt(0)]<<18:0)|($>1?b64tab[I.charAt(1)]<<12:0)|($>2?b64tab[I.charAt(2)]<<6:0)|($>3?b64tab[I.charAt(3)]:0),g=[fromCharCode(M>>>16),fromCharCode(M>>>8&255),fromCharCode(M&255)];return g.length-=[0,0,2,1][R],g.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($){return $=="-"?"+":"/"}).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,$,R){/*!
|
|
|
* merge-descriptors
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
* MIT Licensed
|
|
|
*/"use strict";$.exports=g;var M=Object.prototype.hasOwnProperty;function g(T,D,v){if(!T)throw new TypeError("argument dest is required");if(!D)throw new TypeError("argument src is required");return v===void 0&&(v=!0),Object.getOwnPropertyNames(D).forEach(function(S){if(!v&&M.call(T,S))return;var y=Object.getOwnPropertyDescriptor(D,S);Object.defineProperty(T,S,y)}),T}},{}],201:[function(I,$,R){"use strict";function M(){this._types=Object.create(null),this._extensions=Object.create(null);for(var g=0;g<arguments.length;g++)this.define(arguments[g]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}M.prototype.define=function(g,T){for(var D in g){var v=g[D].map(function(y){return y.toLowerCase()});D=D.toLowerCase();for(var f=0;f<v.length;f++){var S=v[f];if(S[0]=="*")continue;if(!T&&S in this._types)throw new Error('Attempt to change mapping for "'+S+'" extension from "'+this._types[S]+'" to "'+D+'". Pass `force=true` to allow this, otherwise remove "'+S+'" from the list of extensions for "'+D+'".');this._types[S]=D}if(T||!this._extensions[D]){var S=v[0];this._extensions[D]=S[0]!="*"?S:S.substr(1)}}},M.prototype.getType=function(g){g=String(g);var T=g.replace(/^.*[/\\]/,"").toLowerCase(),D=T.replace(/^.*\./,"").toLowerCase(),v=T.length<g.length,f=D.length<T.length-1;return(f||!v)&&this._types[D]||null},M.prototype.getExtension=function(g){return g=/^\s*([^;\s]*)/.test(g)&&RegExp.$1,g&&this._extensions[g.toLowerCase()]||null},$.exports=M},{}],202:[function(I,$,R){"use strict";var M=I("./Mime");$.exports=new M(I("./types/standard"))},{"./Mime":201,"./types/standard":203}],203:[function(I,$,R){$.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma","es"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/mrb-consumer+xml":["*xdf"],"application/mrb-publish+xml":["*xdf"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["*xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/ttml+xml":["ttml"],"application/urc-ressheet+xml":["rsheet"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-error+xml":["xer"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}],204:[function(I,$,R){var M=1e3,g=M*60,T=g*60,D=T*24,v=D*7,f=D*365.25;$.exports=function(r,s){s=s||{};var d=typeof r;if(d==="string"&&r.length>0)return S(r);if(d==="number"&&isFinite(r))return s.long?c(r):y(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function S(r){if(r=String(r),r.length>100)return;var s=/^(-?(?:\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(!s)return;var d=parseFloat(s[1]),u=(s[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return d*f;case"weeks":case"week":case"w":return d*v;case"days":case"day":case"d":return d*D;case"hours":case"hour":case"hrs":case"hr":case"h":return d*T;case"minutes":case"minute":case"mins":case"min":case"m":return d*g;case"seconds":case"second":case"secs":case"sec":case"s":return d*M;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}function y(r){var s=Math.abs(r);return s>=D?Math.round(r/D)+"d":s>=T?Math.round(r/T)+"h":s>=g?Math.round(r/g)+"m":s>=M?Math.round(r/M)+"s":r+"ms"}function c(r){var s=Math.abs(r);return s>=D?o(r,s,D,"day"):s>=T?o(r,s,T,"hour"):s>=g?o(r,s,g,"minute"):s>=M?o(r,s,M,"second"):r+" ms"}function o(r,s,d,u){var p=s>=d*1.5;return Math.round(r/d)+" "+u+(p?"s":"")}},{}],205:[function(I,$,R){(function(M){function g(f,S){for(var y=0,c=f.length-1;c>=0;c--){var o=f[c];o==="."?f.splice(c,1):o===".."?(f.splice(c,1),y++):y&&(f.splice(c,1),y--)}if(S)for(;y--;y)f.unshift("..");return f}R.resolve=function(){for(var f="",S=!1,y=arguments.length-1;y>=-1&&!S;y--){var c=y>=0?arguments[y]:M.cwd();if(typeof c!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!c)continue;f=c+"/"+f,S=c.charAt(0)==="/"}return f=g(D(f.split("/"),function(o){return!!o}),!S).join("/"),(S?"/":"")+f||"."},R.normalize=function(f){var S=R.isAbsolute(f),y=v(f,-1)==="/";return f=g(D(f.split("/"),function(c){return!!c}),!S).join("/"),!f&&!S&&(f="."),f&&y&&(f+="/"),(S?"/":"")+f},R.isAbsolute=function(f){return f.charAt(0)==="/"},R.join=function(){var f=Array.prototype.slice.call(arguments,0);return R.normalize(D(f,function(S,y){if(typeof S!="string")throw new TypeError("Arguments to path.join must be strings");return S}).join("/"))},R.relative=function(f,S){f=R.resolve(f).substr(1),S=R.resolve(S).substr(1);function y(p){for(var m=0;m<p.length&&!(p[m]!=="");m++);for(var i=p.length-1;i>=0&&!(p[i]!=="");i--);return m>i?[]:p.slice(m,i-m+1)}for(var c=y(f.split("/")),o=y(S.split("/")),r=Math.min(c.length,o.length),s=r,d=0;d<r;d++)if(c[d]!==o[d]){s=d;break}for(var u=[],d=s;d<c.length;d++)u.push("..");return u=u.concat(o.slice(s)),u.join("/")},R.sep="/",R.delimiter=":",R.dirname=function(f){if(typeof f!="string"&&(f=f+""),f.length===0)return".";for(var S=f.charCodeAt(0),y=S===47,c=-1,o=!0,r=f.length-1;r>=1;--r)if(S=f.charCodeAt(r),S===47){if(!o){c=r;break}}else o=!1;return c===-1?y?"/":".":y&&c===1?"/":f.slice(0,c)};function T(f){typeof f!="string"&&(f=f+"");var S=0,y=-1,c=!0,o;for(o=f.length-1;o>=0;--o)if(f.charCodeAt(o)===47){if(!c){S=o+1;break}}else y===-1&&(c=!1,y=o+1);return y===-1?"":f.slice(S,y)}R.basename=function(f,S){var y=T(f);return S&&y.substr(-1*S.length)===S&&(y=y.substr(0,y.length-S.length)),y},R.extname=function(f){typeof f!="string"&&(f=f+"");for(var S=-1,y=0,c=-1,o=!0,r=0,s=f.length-1;s>=0;--s){var d=f.charCodeAt(s);if(d===47){if(!o){y=s+1;break}continue}c===-1&&(o=!1,c=s+1),d===46?S===-1?S=s:r!==1&&(r=1):S!==-1&&(r=-1)}return S===-1||c===-1||r===0||r===1&&S===c-1&&S===y+1?"":f.slice(S,c)};function D(f,S){if(f.filter)return f.filter(S);for(var y=[],c=0;c<f.length;c++)S(f[c],c,f)&&y.push(f[c]);return y}var v="ab".substr(-1)==="b"?function(f,S,y){return f.substr(S,y)}:function(f,S,y){return S<0&&(S=f.length+S),f.substr(S,y)}}).call(this,I("_process"))},{_process:208}],206:[function(I,$,R){(function(M){/*!
|
|
|
* Platform.js <https://mths.be/platform>
|
|
|
* Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/>
|
|
|
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
|
|
* Available under MIT license <https://mths.be/mit>
|
|
|
*/(function(){"use strict";var g={function:!0,object:!0},T=g[typeof window]&&window||this,D=T,v=g[typeof R]&&R,f=g[typeof $]&&$&&!$.nodeType&&$,S=v&&f&&typeof M=="object"&&M;S&&(S.global===S||S.window===S||S.self===S)&&(T=S);var y=Math.pow(2,53)-1,c=/\bOpera/,o=this,r=Object.prototype,s=r.hasOwnProperty,d=r.toString;function u(w){return w=String(w),w.charAt(0).toUpperCase()+w.slice(1)}function p(w,C,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 C&&x&&/^Win/i.test(w)&&!/^Windows Phone /i.test(w)&&(_=_[/[\d.]+$/.exec(w)])&&(w="Windows "+_),w=String(w),C&&x&&(w=w.replace(RegExp(C,"i"),x)),w=i(w.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]),w}function m(w,C){var x=-1,_=w?w.length:0;if(typeof _=="number"&&_>-1&&_<=y)for(;++x<_;)C(w[x],x,w);else t(w,C)}function i(w){return w=h(w),/^(?:webOS|i(?:OS|P))/.test(w)?w:u(w)}function t(w,C){for(var x in w)s.call(w,x)&&C(w[x],x,w)}function a(w){return w==null?u(w):d.call(w).slice(8,-1)}function l(w,C){var x=w!=null?typeof w[C]:"number";return!/^(?:boolean|number|string|undefined)$/.test(x)&&(x=="object"?!!w[C]:!0)}function E(w){return String(w).replace(/([ -])(?!$)/g,"$1?")}function b(w,C){var x=null;return m(w,function(_,j){x=C(x,_,j,w)}),x}function h(w){return String(w).replace(/^ +| +$/g,"")}function L(w){var C=T,x=w&&typeof w=="object"&&a(w)!="String";x&&(C=w,w=null);var _=C.navigator||{},j=_.userAgent||"";w||(w=j);var N=x||o==D,P=x?!!_.likeChrome:/\bChrome\b/.test(w)&&!/internal|\n/i.test(d.toString()),V="Object",z=x?V:"ScriptBridgingProxyObject",B=x?V:"Environment",K=x&&C.java?"JavaPackage":a(C.java),U=x?V:"RuntimeObject",W=/\bJava/.test(K)&&C.java,H=W&&a(C.environment)==B,q=W?"a":"\u03B1",ne=W?"b":"\u03B2",te=C.document||{},_e=C.operamini||C.opera,Ce=c.test(Ce=x&&_e?_e["[[Class]]"]:a(_e))?Ce:_e=null,me,Me=w,Oe=[],he=null,ce=w==j,se=ce&&_e&&typeof _e.version=="function"&&_e.version(),Te,re=X([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),ue=ve(["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"]),fe=Re([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),ee=Z({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),Q=ye(["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 X(tt){return b(tt,function(st,ot){return st||RegExp("\\b"+(ot.pattern||E(ot))+"\\b","i").exec(w)&&(ot.label||ot)})}function Z(tt){return b(tt,function(st,ot,Fe){return st||(ot[fe]||ot[/^[a-z]+(?: +[a-z]+\b)*/i.exec(fe)]||RegExp("\\b"+E(Fe)+"(?:\\b|\\w*\\d)","i").exec(w))&&Fe})}function ve(tt){return b(tt,function(st,ot){return st||RegExp("\\b"+(ot.pattern||E(ot))+"\\b","i").exec(w)&&(ot.label||ot)})}function ye(tt){return b(tt,function(st,ot){var Fe=ot.pattern||E(ot);return!st&&(st=RegExp("\\b"+Fe+"(?:/[\\d.]+|[ \\w.]*)","i").exec(w))&&(st=p(st,Fe,ot.label||ot)),st})}function Re(tt){return b(tt,function(st,ot){var Fe=ot.pattern||E(ot);return!st&&(st=RegExp("\\b"+Fe+" *\\d+[.\\w_]*","i").exec(w)||RegExp("\\b"+Fe+" *\\w+-[\\w]*","i").exec(w)||RegExp("\\b"+Fe+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(w))&&((st=String(ot.label&&!RegExp(Fe,"i").test(ot.label)?ot.label:st).split("/"))[1]&&!/[\d.]+/.test(st[0])&&(st[0]+=" "+st[1]),ot=ot.label||ot,st=i(st[0].replace(RegExp(Fe,"i"),ot).replace(RegExp("; *(?:"+ot+"[_-])?","i")," ").replace(RegExp("("+ot+")[-_.]?(\\w)","i"),"$1 $2"))),st})}function Je(tt){return b(tt,function(st,ot){return st||(RegExp(ot+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(w)||0)[1]||null})}function Ze(){return this.description||""}if(re&&(re=[re]),ee&&!fe&&(fe=Re([ee])),(me=/\bGoogle TV\b/.exec(fe))&&(fe=me[0]),/\bSimulator\b/i.test(w)&&(fe=(fe?fe+" ":"")+"Simulator"),ue=="Opera Mini"&&/\bOPiOS\b/.test(w)&&Oe.push("running in Turbo/Uncompressed mode"),ue=="IE"&&/\blike iPhone OS\b/.test(w)?(me=L(w.replace(/like iPhone OS/,"")),ee=me.manufacturer,fe=me.product):/^iP/.test(fe)?(ue||(ue="Safari"),Q="iOS"+((me=/ OS ([\d_]+)/i.exec(w))?" "+me[1].replace(/_/g,"."):"")):ue=="Konqueror"&&!/buntu/i.test(Q)?Q="Kubuntu":ee&&ee!="Google"&&(/Chrome/.test(ue)&&!/\bMobile Safari\b/i.test(w)||/\bVita\b/.test(fe))||/\bAndroid\b/.test(Q)&&/^Chrome/.test(ue)&&/\bVersion\//i.test(w)?(ue="Android Browser",Q=/\bAndroid\b/.test(Q)?Q:"Android"):ue=="Silk"?(/\bMobi/i.test(w)||(Q="Android",Oe.unshift("desktop mode")),/Accelerated *= *true/i.test(w)&&Oe.unshift("accelerated")):ue=="PaleMoon"&&(me=/\bFirefox\/([\d.]+)\b/.exec(w))?Oe.push("identifying as Firefox "+me[1]):ue=="Firefox"&&(me=/\b(Mobile|Tablet|TV)\b/i.exec(w))?(Q||(Q="Firefox OS"),fe||(fe=me[1])):!ue||(me=!/\bMinefield\b/i.test(w)&&/\b(?:Firefox|Safari)\b/.exec(ue))?(ue&&!fe&&/[\/,]|^[^(]+?\)/.test(w.slice(w.indexOf(me+"/")+8))&&(ue=null),(me=fe||ee||Q)&&(fe||ee||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(Q))&&(ue=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(Q)?Q:me)+" Browser")):ue=="Electron"&&(me=(/\bChrome\/([\d.]+)\b/.exec(w)||0)[1])&&Oe.push("Chromium "+me),se||(se=Je(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",E(ue),"(?:Firefox|Minefield|NetFront)"])),(me=re=="iCab"&&parseFloat(se)>3&&"WebKit"||/\bOpera\b/.test(ue)&&(/\bOPR\b/.test(w)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(w)&&!/^(?:Trident|EdgeHTML)$/.test(re)&&"WebKit"||!re&&/\bMSIE\b/i.test(w)&&(Q=="Mac OS"?"Tasman":"Trident")||re=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ue)&&"NetFront")&&(re=[me]),ue=="IE"&&(me=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(w)||0)[1])?(ue+=" Mobile",Q="Windows Phone "+(/\+$/.test(me)?me:me+".x"),Oe.unshift("desktop mode")):/\bWPDesktop\b/i.test(w)?(ue="IE Mobile",Q="Windows Phone 8.x",Oe.unshift("desktop mode"),se||(se=(/\brv:([\d.]+)/.exec(w)||0)[1])):ue!="IE"&&re=="Trident"&&(me=/\brv:([\d.]+)/.exec(w))&&(ue&&Oe.push("identifying as "+ue+(se?" "+se:"")),ue="IE",se=me[1]),ce){if(l(C,"global"))if(W&&(me=W.lang.System,Me=me.getProperty("os.arch"),Q=Q||me.getProperty("os.name")+" "+me.getProperty("os.version")),H){try{se=C.require("ringo/engine").version.join("."),ue="RingoJS"}catch(tt){(me=C.system)&&me.global.system==C.system&&(ue="Narwhal",Q||(Q=me[0].os||null))}ue||(ue="Rhino")}else typeof C.process=="object"&&!C.process.browser&&(me=C.process)&&(typeof me.versions=="object"&&(typeof me.versions.electron=="string"?(Oe.push("Node "+me.versions.node),ue="Electron",se=me.versions.electron):typeof me.versions.nw=="string"&&(Oe.push("Chromium "+se,"Node "+me.versions.node),ue="NW.js",se=me.versions.nw)),ue||(ue="Node.js",Me=me.arch,Q=me.platform,se=/[\d.]+/.exec(me.version),se=se?se[0]:null));else a(me=C.runtime)==z?(ue="Adobe AIR",Q=me.flash.system.Capabilities.os):a(me=C.phantom)==U?(ue="PhantomJS",se=(me=me.version||null)&&me.major+"."+me.minor+"."+me.patch):typeof te.documentMode=="number"&&(me=/\bTrident\/(\d+)/i.exec(w))?(se=[se,te.documentMode],(me=+me[1]+4)!=se[1]&&(Oe.push("IE "+se[1]+" mode"),re&&(re[1]=""),se[1]=me),se=ue=="IE"?String(se[1].toFixed(1)):se[0]):typeof te.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ue)&&(Oe.push("masking as "+ue+" "+se),ue="IE",se="11.0",re=["Trident"],Q="Windows");Q=Q&&i(Q)}if(se&&(me=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(se)||/(?:alpha|beta)(?: ?\d)?/i.exec(w+";"+(ce&&_.appMinorVersion))||/\bMinefield\b/i.test(w)&&"a")&&(he=/b/i.test(me)?"beta":"alpha",se=se.replace(RegExp(me+"\\+?$"),"")+(he=="beta"?ne:q)+(/\d+\+?/.exec(me)||"")),ue=="Fennec"||ue=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(Q))ue="Firefox Mobile";else if(ue=="Maxthon"&&se)se=se.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(fe))fe=="Xbox 360"&&(Q=null),fe=="Xbox 360"&&/\bIEMobile\b/.test(w)&&Oe.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(ue)||ue&&!fe&&!/Browser|Mobi/.test(ue))&&(Q=="Windows CE"||/Mobi/i.test(w)))ue+=" Mobile";else if(ue=="IE"&&ce)try{C.external===null&&Oe.unshift("platform preview")}catch(tt){Oe.unshift("embedded")}else(/\bBlackBerry\b/.test(fe)||/\bBB10\b/.test(w))&&(me=(RegExp(fe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(w)||0)[1]||se)?(me=[me,/BB10/.test(w)],Q=(me[1]?(fe=null,ee="BlackBerry"):"Device Software")+" "+me[0],se=null):this!=t&&fe!="Wii"&&(ce&&_e||/Opera/.test(ue)&&/\b(?:MSIE|Firefox)\b/i.test(w)||ue=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(Q)||ue=="IE"&&(Q&&!/^Win/.test(Q)&&se>5.5||/\bWindows XP\b/.test(Q)&&se>8||se==8&&!/\bTrident\b/.test(w)))&&!c.test(me=L.call(t,w.replace(c,"")+";"))&&me.name&&(me="ing as "+me.name+((me=me.version)?" "+me:""),c.test(ue)?(/\bIE\b/.test(me)&&Q=="Mac OS"&&(Q=null),me="identify"+me):(me="mask"+me,Ce?ue=i(Ce.replace(/([a-z])([A-Z])/g,"$1 $2")):ue="Opera",/\bIE\b/.test(me)&&(Q=null),ce||(se=null)),re=["Presto"],Oe.push(me));(me=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(w)||0)[1])&&(me=[parseFloat(me.replace(/\.(\d)$/,".0$1")),me],ue=="Safari"&&me[1].slice(-1)=="+"?(ue="WebKit Nightly",he="alpha",se=me[1].slice(0,-1)):(se==me[1]||se==(me[2]=(/\bSafari\/([\d.]+\+?)/i.exec(w)||0)[1]))&&(se=null),me[1]=(/\bChrome\/([\d.]+)/i.exec(w)||0)[1],me[0]==537.36&&me[2]==537.36&&parseFloat(me[1])>=28&&re=="WebKit"&&(re=["Blink"]),!ce||!P&&!me[1]?(re&&(re[1]="like Safari"),me=(me=me[0],me<400?1:me<500?2:me<526?3:me<533?4:me<534?"4+":me<535?5:me<537?6:me<538?7:me<601?8:"8")):(re&&(re[1]="like Chrome"),me=me[1]||(me=me[0],me<530?1:me<532?2:me<532.05?3:me<533?4:me<534.03?5:me<534.07?6:me<534.1?7:me<534.13?8:me<534.16?9:me<534.24?10:me<534.3?11:me<535.01?12:me<535.02?"13+":me<535.07?15:me<535.11?16:me<535.19?17:me<536.05?18:me<536.1?19:me<537.01?20:me<537.11?"21+":me<537.13?23:me<537.18?24:me<537.24?25:me<537.36?26:re!="Blink"?"27":"28")),re&&(re[1]+=" "+(me+=typeof me=="number"?".x":/[.+]/.test(me)?"":"+")),ue=="Safari"&&(!se||parseInt(se)>45)&&(se=me)),ue=="Opera"&&(me=/\bzbov|zvav$/.exec(Q))?(ue+=" ",Oe.unshift("desktop mode"),me=="zvav"?(ue+="Mini",se=null):ue+="Mobile",Q=Q.replace(RegExp(" *"+me+"$"),"")):ue=="Safari"&&/\bChrome\b/.exec(re&&re[1])&&(Oe.unshift("desktop mode"),ue="Chrome Mobile",se=null,/\bOS X\b/.test(Q)?(ee="Apple",Q="iOS 4.3+"):Q=null),se&&se.indexOf(me=/[\d.]+$/.exec(Q))==0&&w.indexOf("/"+me+"-")>-1&&(Q=h(Q.replace(me,""))),re&&!/\b(?:Avant|Nook)\b/.test(ue)&&(/Browser|Lunascape|Maxthon/.test(ue)||ue!="Safari"&&/^iOS/.test(Q)&&/\bSafari\b/.test(re[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(ue)&&re[1])&&((me=re[re.length-1])&&Oe.push(me)),Oe.length&&(Oe=["("+Oe.join("; ")+")"]),ee&&fe&&fe.indexOf(ee)<0&&Oe.push("on "+ee),fe&&Oe.push((/^on /.test(Oe[Oe.length-1])?"":"on ")+fe),Q&&(me=/ ([\d.+]+)$/.exec(Q),Te=me&&Q.charAt(Q.length-me[0].length-1)=="/",Q={architecture:32,family:me&&!Te?Q.replace(me[0],""):Q,version:me?me[1]:null,toString:function(){var tt=this.version;return this.family+(tt&&!Te?" "+tt:"")+(this.architecture==64?" 64-bit":"")}}),(me=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Me))&&!/\bi686\b/i.test(Me)?(Q&&(Q.architecture=64,Q.family=Q.family.replace(RegExp(" *"+me),"")),ue&&(/\bWOW64\b/i.test(w)||ce&&/\w(?:86|32)$/.test(_.cpuClass||_.platform)&&!/\bWin64; x64\b/i.test(w))&&Oe.unshift("32-bit")):Q&&/^OS X/.test(Q.family)&&ue=="Chrome"&&parseFloat(se)>=39&&(Q.architecture=64),w||(w=null);var rt={};return rt.description=w,rt.layout=re&&re[0],rt.manufacturer=ee,rt.name=ue,rt.prerelease=he,rt.product=fe,rt.ua=w,rt.version=ue&&se,rt.os=Q||{architecture:null,family:null,version:null,toString:function(){return"null"}},rt.parse=L,rt.toString=Ze,rt.version&&Oe.unshift(se),rt.name&&Oe.unshift(ue),Q&&ue&&!(Q==String(Q).split(" ")[0]&&(Q==ue.split(" ")[0]||fe))&&Oe.push(fe?"("+Q+")":"on "+Q),Oe.length&&(rt.description=Oe.join(" ")),rt}var O=L();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(T.platform=O,define(function(){return O})):v&&f?t(O,function(w,C){v[C]=w}):T.platform=O}).call(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],207:[function(I,$,R){(function(M){"use strict";typeof M=="undefined"||!M.version||M.version.indexOf("v0.")===0||M.version.indexOf("v1.")===0&&M.version.indexOf("v1.8.")!==0?$.exports={nextTick:g}:$.exports=M;function g(T,D,v,f){if(typeof T!="function")throw new TypeError('"callback" argument must be a function');var S=arguments.length,y,c;switch(S){case 0:case 1:return M.nextTick(T);case 2:return M.nextTick(function(){T.call(null,D)});case 3:return M.nextTick(function(){T.call(null,D,v)});case 4:return M.nextTick(function(){T.call(null,D,v,f)});default:for(y=new Array(S-1),c=0;c<y.length;)y[c++]=arguments[c];return M.nextTick(function(){T.apply(null,y)})}}}).call(this,I("_process"))},{_process:208}],208:[function(I,$,R){var M=$.exports={},g,T;function D(){throw new Error("setTimeout has not been defined")}function v(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?g=setTimeout:g=D}catch(m){g=D}try{typeof clearTimeout=="function"?T=clearTimeout:T=v}catch(m){T=v}})();function f(m){if(g===setTimeout)return setTimeout(m,0);if((g===D||!g)&&setTimeout)return g=setTimeout,setTimeout(m,0);try{return g(m,0)}catch(i){try{return g.call(null,m,0)}catch(t){return g.call(this,m,0)}}}function S(m){if(T===clearTimeout)return clearTimeout(m);if((T===v||!T)&&clearTimeout)return T=clearTimeout,clearTimeout(m);try{return T(m)}catch(i){try{return T.call(null,m)}catch(t){return T.call(this,m)}}}var y=[],c=!1,o,r=-1;function s(){if(!c||!o)return;c=!1,o.length?y=o.concat(y):r=-1,y.length&&d()}function d(){if(c)return;var m=f(s);c=!0;for(var i=y.length;i;){for(o=y,y=[];++r<i;)o&&o[r].run();r=-1,i=y.length}o=null,c=!1,S(m)}M.nextTick=function(m){var i=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)i[t-1]=arguments[t];y.push(new u(m,i)),y.length===1&&!c&&f(d)};function u(m,i){this.fun=m,this.array=i}u.prototype.run=function(){this.fun.apply(null,this.array)},M.title="browser",M.browser=!0,M.env={},M.argv=[],M.version="",M.versions={};function p(){}M.on=p,M.addListener=p,M.once=p,M.off=p,M.removeListener=p,M.removeAllListeners=p,M.emit=p,M.prependListener=p,M.prependOnceListener=p,M.listeners=function(m){return[]},M.binding=function(m){throw new Error("process.binding is not supported")},M.cwd=function(){return"/"},M.chdir=function(m){throw new Error("process.chdir is not supported")},M.umask=function(){return 0}},{}],209:[function(I,$,R){(function(M){/*! https://mths.be/punycode v1.4.1 by @mathias */(function(g){var T=typeof R=="object"&&R&&!R.nodeType&&R,D=typeof $=="object"&&$&&!$.nodeType&&$,v=typeof M=="object"&&M;(v.global===v||v.window===v||v.self===v)&&(g=v);var f,S=2147483647,y=36,c=1,o=26,r=38,s=700,d=72,u=128,p="-",m=/^xn--/,i=/[^\x20-\x7E]/,t=/[\x2E\u3002\uFF0E\uFF61]/g,a={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=y-c,E=Math.floor,b=String.fromCharCode,h;function L(K){throw new RangeError(a[K])}function O(K,U){for(var W=K.length,H=[];W--;)H[W]=U(K[W]);return H}function w(K,U){var W=K.split("@"),H="";W.length>1&&(H=W[0]+"@",K=W[1]),K=K.replace(t,".");var q=K.split("."),ne=O(q,U).join(".");return H+ne}function C(K){for(var U=[],W=0,H=K.length,q,ne;W<H;)q=K.charCodeAt(W++),q>=55296&&q<=56319&&W<H?(ne=K.charCodeAt(W++),(ne&64512)==56320?U.push(((q&1023)<<10)+(ne&1023)+65536):(U.push(q),W--)):U.push(q);return U}function x(K){return O(K,function(U){var W="";return U>65535&&(U-=65536,W+=b(U>>>10&1023|55296),U=56320|U&1023),W+=b(U),W}).join("")}function _(K){return K-48<10?K-22:K-65<26?K-65:K-97<26?K-97:y}function j(K,U){return K+22+75*(K<26)-((U!=0)<<5)}function N(K,U,W){var H=0;for(K=W?E(K/s):K>>1,K+=E(K/U);K>l*o>>1;H+=y)K=E(K/l);return E(H+(l+1)*K/(K+r))}function P(K){var U=[],W=K.length,H,q=0,ne=u,te=d,_e,Ce,me,Me,Oe,he,ce,se,Te;for(_e=K.lastIndexOf(p),_e<0&&(_e=0),Ce=0;Ce<_e;++Ce)K.charCodeAt(Ce)>=128&&L("not-basic"),U.push(K.charCodeAt(Ce));for(me=_e>0?_e+1:0;me<W;){for(Me=q,Oe=1,he=y;!(me>=W&&L("invalid-input"),ce=_(K.charCodeAt(me++)),(ce>=y||ce>E((S-q)/Oe))&&L("overflow"),q+=ce*Oe,se=he<=te?c:he>=te+o?o:he-te,ce<se);he+=y)Te=y-se,Oe>E(S/Te)&&L("overflow"),Oe*=Te;H=U.length+1,te=N(q-Me,H,Me==0),E(q/H)>S-ne&&L("overflow"),ne+=E(q/H),q%=H,U.splice(q++,0,ne)}return x(U)}function V(K){var U,W,H,q,ne,te,_e,Ce,me,Me,Oe,he=[],ce,se,Te,re;for(K=C(K),ce=K.length,U=u,W=0,ne=d,te=0;te<ce;++te)Oe=K[te],Oe<128&&he.push(b(Oe));for(H=q=he.length,q&&he.push(p);H<ce;){for(_e=S,te=0;te<ce;++te)Oe=K[te],Oe>=U&&Oe<_e&&(_e=Oe);for(se=H+1,_e-U>E((S-W)/se)&&L("overflow"),W+=(_e-U)*se,U=_e,te=0;te<ce;++te)if(Oe=K[te],Oe<U&&++W>S&&L("overflow"),Oe==U){for(Ce=W,me=y;!(Me=me<=ne?c:me>=ne+o?o:me-ne,Ce<Me);me+=y)re=Ce-Me,Te=y-Me,he.push(b(j(Me+re%Te,0))),Ce=E(re/Te);he.push(b(j(Ce,0))),ne=N(W,se,H==q),W=0,++H}++W,++U}return he.join("")}function z(K){return w(K,function(U){return m.test(U)?P(U.slice(4).toLowerCase()):U})}function B(K){return w(K,function(U){return i.test(U)?"xn--"+V(U):U})}if(f={version:"1.4.1",ucs2:{decode:C,encode:x},decode:P,encode:V,toASCII:B,toUnicode:z},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return f});else if(T&&D)if($.exports==T)D.exports=f;else for(h in f)f.hasOwnProperty(h)&&(T[h]=f[h]);else g.punycode=f})(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],210:[function(I,$,R){"use strict";function M(T,D){return Object.prototype.hasOwnProperty.call(T,D)}$.exports=function(T,D,v,f){D=D||"&",v=v||"=";var S={};if(typeof T!="string"||T.length===0)return S;var y=/\+/g;T=T.split(D);var c=1e3;f&&typeof f.maxKeys=="number"&&(c=f.maxKeys);var o=T.length;c>0&&o>c&&(o=c);for(var r=0;r<o;++r){var s=T[r].replace(y,"%20"),d=s.indexOf(v),u,p,m,i;d>=0?(u=s.substr(0,d),p=s.substr(d+1)):(u=s,p=""),m=decodeURIComponent(u),i=decodeURIComponent(p),M(S,m)?g(S[m])?S[m].push(i):S[m]=[S[m],i]:S[m]=i}return S};var g=Array.isArray||function(T){return Object.prototype.toString.call(T)==="[object Array]"}},{}],211:[function(I,$,R){"use strict";var M=function(v){switch(typeof v){case"string":return v;case"boolean":return v?"true":"false";case"number":return isFinite(v)?v:"";default:return""}};$.exports=function(v,f,S,y){return f=f||"&",S=S||"=",v===null&&(v=void 0),typeof v=="object"?T(D(v),function(c){var o=encodeURIComponent(M(c))+S;return g(v[c])?T(v[c],function(r){return o+encodeURIComponent(M(r))}).join(f):o+encodeURIComponent(M(v[c]))}).join(f):y?encodeURIComponent(M(y))+S+encodeURIComponent(M(v)):""};var g=Array.isArray||function(v){return Object.prototype.toString.call(v)==="[object Array]"};function T(v,f){if(v.map)return v.map(f);for(var S=[],y=0;y<v.length;y++)S.push(f(v[y],y));return S}var D=Object.keys||function(v){var f=[];for(var S in v)Object.prototype.hasOwnProperty.call(v,S)&&f.push(S);return f}},{}],212:[function(I,$,R){"use strict";R.decode=R.parse=I("./decode"),R.encode=R.stringify=I("./encode")},{"./decode":210,"./encode":211}],213:[function(I,$,R){$.exports=I("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":214}],214:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=v(M),T=I("babel-runtime/core-js/object/keys"),D=v(T);function v(i){return i&&i.__esModule?i:{default:i}}var f=I("process-nextick-args"),S=D.default||function(i){var t=[];for(var a in i)t.push(a);return t};$.exports=u;var y=(0,g.default)(I("core-util-is"));y.inherits=I("inherits");var c=I("./_stream_readable"),o=I("./_stream_writable");y.inherits(u,c);for(var r=S(o.prototype),s=0;s<r.length;s++){var d=r[s];u.prototype[d]||(u.prototype[d]=o.prototype[d])}function u(i){if(!(this instanceof u))return new u(i);c.call(this,i),o.call(this,i),i&&i.readable===!1&&(this.readable=!1),i&&i.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,i&&i.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",p)}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function p(){if(this.allowHalfOpen||this._writableState.ended)return;f.nextTick(m,this)}function m(i){i.end()}Object.defineProperty(u.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=t,this._writableState.destroyed=t}}),u.prototype._destroy=function(i,t){this.push(null),this.end(),f.nextTick(t,i)}},{"./_stream_readable":216,"./_stream_writable":218,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60,"core-util-is":189,inherits:196,"process-nextick-args":207}],215:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(S){return S&&S.__esModule?S:{default:S}}$.exports=f;var D=I("./_stream_transform"),v=(0,g.default)(I("core-util-is"));v.inherits=I("inherits"),v.inherits(f,D);function f(S){if(!(this instanceof f))return new f(S);D.call(this,S)}f.prototype._transform=function(S,y,c){c(null,S)}},{"./_stream_transform":217,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],216:[function(I,$,R){(function(M,g){"use strict";var T=I("babel-runtime/core-js/object/get-prototype-of"),D=S(T),v=I("babel-runtime/core-js/object/create"),f=S(v);function S(re){return re&&re.__esModule?re:{default:re}}var y=I("process-nextick-args");$.exports=C;var c=I("isarray"),o;C.ReadableState=w;var r=I("events").EventEmitter,s=function(ue,fe){return ue.listeners(fe).length},d=I("./internal/streams/stream"),u=I("safe-buffer").Buffer,p=g.Uint8Array||function(){};function m(re){return u.from(re)}function i(re){return u.isBuffer(re)||re instanceof p}var t=(0,f.default)(I("core-util-is"));t.inherits=I("inherits");var a=I("util"),l=void 0;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var E=I("./internal/streams/BufferList"),b=I("./internal/streams/destroy"),h;t.inherits(C,d);var L=["error","close","destroy","pause","resume"];function O(re,ue,fe){if(typeof re.prependListener=="function")return re.prependListener(ue,fe);!re._events||!re._events[ue]?re.on(ue,fe):c(re._events[ue])?re._events[ue].unshift(fe):re._events[ue]=[fe,re._events[ue]]}function w(re,ue){o=o||I("./_stream_duplex"),re=re||{};var fe=ue instanceof o;this.objectMode=!!re.objectMode,fe&&(this.objectMode=this.objectMode||!!re.readableObjectMode);var ee=re.highWaterMark,Q=re.readableHighWaterMark,X=this.objectMode?16:16*1024;ee||ee===0?this.highWaterMark=ee:fe&&(Q||Q===0)?this.highWaterMark=Q:this.highWaterMark=X,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new E,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=re.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,re.encoding&&(h||(h=I("string_decoder/").StringDecoder),this.decoder=new h(re.encoding),this.encoding=re.encoding)}function C(re){if(o=o||I("./_stream_duplex"),!(this instanceof C))return new C(re);this._readableState=new w(re,this),this.readable=!0,re&&(typeof re.read=="function"&&(this._read=re.read),typeof re.destroy=="function"&&(this._destroy=re.destroy)),d.call(this)}Object.defineProperty(C.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ue){if(!this._readableState)return;this._readableState.destroyed=ue}}),C.prototype.destroy=b.destroy,C.prototype._undestroy=b.undestroy,C.prototype._destroy=function(re,ue){this.push(null),ue(re)},C.prototype.push=function(re,ue){var fe=this._readableState,ee;return fe.objectMode?ee=!0:typeof re=="string"&&(ue=ue||fe.defaultEncoding,ue!==fe.encoding&&(re=u.from(re,ue),ue=""),ee=!0),x(this,re,ue,!1,ee)},C.prototype.unshift=function(re){return x(this,re,null,!0,!1)};function x(re,ue,fe,ee,Q){var X=re._readableState;if(ue===null)X.reading=!1,B(re,X);else{var Z;Q||(Z=j(X,ue)),Z?re.emit("error",Z):X.objectMode||ue&&ue.length>0?(typeof ue!="string"&&!X.objectMode&&(0,D.default)(ue)!==u.prototype&&(ue=m(ue)),ee?X.endEmitted?re.emit("error",new Error("stream.unshift() after end event")):_(re,X,ue,!0):X.ended?re.emit("error",new Error("stream.push() after EOF")):(X.reading=!1,X.decoder&&!fe?(ue=X.decoder.write(ue),X.objectMode||ue.length!==0?_(re,X,ue,!1):W(re,X)):_(re,X,ue,!1))):ee||(X.reading=!1)}return N(X)}function _(re,ue,fe,ee){ue.flowing&&ue.length===0&&!ue.sync?(re.emit("data",fe),re.read(0)):(ue.length+=ue.objectMode?1:fe.length,ee?ue.buffer.unshift(fe):ue.buffer.push(fe),ue.needReadable&&K(re)),W(re,ue)}function j(re,ue){var fe;return!i(ue)&&typeof ue!="string"&&ue!==void 0&&!re.objectMode&&(fe=new TypeError("Invalid non-string/buffer chunk")),fe}function N(re){return!re.ended&&(re.needReadable||re.length<re.highWaterMark||re.length===0)}C.prototype.isPaused=function(){return this._readableState.flowing===!1},C.prototype.setEncoding=function(re){return h||(h=I("string_decoder/").StringDecoder),this._readableState.decoder=new h(re),this._readableState.encoding=re,this};var P=8388608;function V(re){return re>=P?re=P:(re--,re|=re>>>1,re|=re>>>2,re|=re>>>4,re|=re>>>8,re|=re>>>16,re++),re}function z(re,ue){return re<=0||ue.length===0&&ue.ended?0:ue.objectMode?1:re!==re?ue.flowing&&ue.length?ue.buffer.head.data.length:ue.length:(re>ue.highWaterMark&&(ue.highWaterMark=V(re)),re<=ue.length?re:ue.ended?ue.length:(ue.needReadable=!0,0))}C.prototype.read=function(re){l("read",re),re=parseInt(re,10);var ue=this._readableState,fe=re;if(re!==0&&(ue.emittedReadable=!1),re===0&&ue.needReadable&&(ue.length>=ue.highWaterMark||ue.ended))return l("read: emitReadable",ue.length,ue.ended),ue.length===0&&ue.ended?ce(this):K(this),null;if(re=z(re,ue),re===0&&ue.ended)return ue.length===0&&ce(this),null;var ee=ue.needReadable;l("need readable",ee),(ue.length===0||ue.length-re<ue.highWaterMark)&&(ee=!0,l("length less than watermark",ee)),ue.ended||ue.reading?(ee=!1,l("reading or ended",ee)):ee&&(l("do read"),ue.reading=!0,ue.sync=!0,ue.length===0&&(ue.needReadable=!0),this._read(ue.highWaterMark),ue.sync=!1,ue.reading||(re=z(fe,ue)));var Q;return re>0?Q=me(re,ue):Q=null,Q===null?(ue.needReadable=!0,re=0):ue.length-=re,ue.length===0&&(ue.ended||(ue.needReadable=!0),fe!==re&&ue.ended&&ce(this)),Q!==null&&this.emit("data",Q),Q};function B(re,ue){if(ue.ended)return;if(ue.decoder){var fe=ue.decoder.end();fe&&fe.length&&(ue.buffer.push(fe),ue.length+=ue.objectMode?1:fe.length)}ue.ended=!0,K(re)}function K(re){var ue=re._readableState;ue.needReadable=!1,ue.emittedReadable||(l("emitReadable",ue.flowing),ue.emittedReadable=!0,ue.sync?y.nextTick(U,re):U(re))}function U(re){l("emit readable"),re.emit("readable"),Ce(re)}function W(re,ue){ue.readingMore||(ue.readingMore=!0,y.nextTick(H,re,ue))}function H(re,ue){for(var fe=ue.length;!ue.reading&&!ue.flowing&&!ue.ended&&ue.length<ue.highWaterMark&&!(l("maybeReadMore read 0"),re.read(0),fe===ue.length);)fe=ue.length;ue.readingMore=!1}C.prototype._read=function(re){this.emit("error",new Error("_read() is not implemented"))},C.prototype.pipe=function(re,ue){var fe=this,ee=this._readableState;switch(ee.pipesCount){case 0:ee.pipes=re;break;case 1:ee.pipes=[ee.pipes,re];break;default:ee.pipes.push(re);break}ee.pipesCount+=1,l("pipe count=%d opts=%j",ee.pipesCount,ue);var Q=(!ue||ue.end!==!1)&&re!==M.stdout&&re!==M.stderr,X=Q?ve:Fe;ee.endEmitted?y.nextTick(X):fe.once("end",X),re.on("unpipe",Z);function Z(Ae,qe){l("onunpipe"),Ae===fe&&(qe&&qe.hasUnpiped===!1&&(qe.hasUnpiped=!0,Je()))}function ve(){l("onend"),re.end()}var ye=q(fe);re.on("drain",ye);var Re=!1;function Je(){l("cleanup"),re.removeListener("close",st),re.removeListener("finish",ot),re.removeListener("drain",ye),re.removeListener("error",tt),re.removeListener("unpipe",Z),fe.removeListener("end",ve),fe.removeListener("end",Fe),fe.removeListener("data",rt),Re=!0,ee.awaitDrain&&(!re._writableState||re._writableState.needDrain)&&ye()}var Ze=!1;fe.on("data",rt);function rt(Ae){l("ondata"),Ze=!1;var qe=re.write(Ae);qe===!1&&!Ze&&((ee.pipesCount===1&&ee.pipes===re||ee.pipesCount>1&&Te(ee.pipes,re)!==-1)&&!Re&&(l("false write response, pause",fe._readableState.awaitDrain),fe._readableState.awaitDrain++,Ze=!0),fe.pause())}function tt(Ae){l("onerror",Ae),Fe(),re.removeListener("error",tt),s(re,"error")===0&&re.emit("error",Ae)}O(re,"error",tt);function st(){re.removeListener("finish",ot),Fe()}re.once("close",st);function ot(){l("onfinish"),re.removeListener("close",st),Fe()}re.once("finish",ot);function Fe(){l("unpipe"),fe.unpipe(re)}return re.emit("pipe",fe),ee.flowing||(l("pipe resume"),fe.resume()),re};function q(re){return function(){var ue=re._readableState;l("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&s(re,"data")&&(ue.flowing=!0,Ce(re))}}C.prototype.unpipe=function(re){var ue=this._readableState,fe={hasUnpiped:!1};if(ue.pipesCount===0)return this;if(ue.pipesCount===1)return re&&re!==ue.pipes?this:(re||(re=ue.pipes),ue.pipes=null,ue.pipesCount=0,ue.flowing=!1,re&&re.emit("unpipe",this,fe),this);if(!re){var ee=ue.pipes,Q=ue.pipesCount;ue.pipes=null,ue.pipesCount=0,ue.flowing=!1;for(var X=0;X<Q;X++)ee[X].emit("unpipe",this,fe);return this}var Z=Te(ue.pipes,re);return Z===-1?this:(ue.pipes.splice(Z,1),ue.pipesCount-=1,ue.pipesCount===1&&(ue.pipes=ue.pipes[0]),re.emit("unpipe",this,fe),this)},C.prototype.on=function(re,ue){var fe=d.prototype.on.call(this,re,ue);if(re==="data")this._readableState.flowing!==!1&&this.resume();else if(re==="readable"){var ee=this._readableState;!ee.endEmitted&&!ee.readableListening&&(ee.readableListening=ee.needReadable=!0,ee.emittedReadable=!1,ee.reading?ee.length&&K(this):y.nextTick(ne,this))}return fe},C.prototype.addListener=C.prototype.on;function ne(re){l("readable nexttick read 0"),re.read(0)}C.prototype.resume=function(){var re=this._readableState;return re.flowing||(l("resume"),re.flowing=!0,te(this,re)),this};function te(re,ue){ue.resumeScheduled||(ue.resumeScheduled=!0,y.nextTick(_e,re,ue))}function _e(re,ue){ue.reading||(l("resume read 0"),re.read(0)),ue.resumeScheduled=!1,ue.awaitDrain=0,re.emit("resume"),Ce(re),ue.flowing&&!ue.reading&&re.read(0)}C.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ce(re){var ue=re._readableState;for(l("flow",ue.flowing);ue.flowing&&re.read()!==null;);}C.prototype.wrap=function(re){var ue=this,fe=this._readableState,ee=!1;re.on("end",function(){if(l("wrapped end"),fe.decoder&&!fe.ended){var Z=fe.decoder.end();Z&&Z.length&&ue.push(Z)}ue.push(null)}),re.on("data",function(Z){if(l("wrapped data"),fe.decoder&&(Z=fe.decoder.write(Z)),fe.objectMode&&Z==null)return;if(!fe.objectMode&&(!Z||!Z.length))return;var ve=ue.push(Z);ve||(ee=!0,re.pause())});for(var Q in re)this[Q]===void 0&&typeof re[Q]=="function"&&(this[Q]=function(Z){return function(){return re[Z].apply(re,arguments)}}(Q));for(var X=0;X<L.length;X++)re.on(L[X],this.emit.bind(this,L[X]));return this._read=function(Z){l("wrapped _read",Z),ee&&(ee=!1,re.resume())},this},Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),C._fromList=me;function me(re,ue){if(ue.length===0)return null;var fe;return ue.objectMode?fe=ue.buffer.shift():!re||re>=ue.length?(ue.decoder?fe=ue.buffer.join(""):ue.buffer.length===1?fe=ue.buffer.head.data:fe=ue.buffer.concat(ue.length),ue.buffer.clear()):fe=Me(re,ue.buffer,ue.decoder),fe}function Me(re,ue,fe){var ee;return re<ue.head.data.length?(ee=ue.head.data.slice(0,re),ue.head.data=ue.head.data.slice(re)):re===ue.head.data.length?ee=ue.shift():ee=fe?Oe(re,ue):he(re,ue),ee}function Oe(re,ue){var fe=ue.head,ee=1,Q=fe.data;for(re-=Q.length;fe=fe.next;){var X=fe.data,Z=re>X.length?X.length:re;if(Z===X.length?Q+=X:Q+=X.slice(0,re),re-=Z,re===0){Z===X.length?(++ee,fe.next?ue.head=fe.next:ue.head=ue.tail=null):(ue.head=fe,fe.data=X.slice(Z));break}++ee}return ue.length-=ee,Q}function he(re,ue){var fe=u.allocUnsafe(re),ee=ue.head,Q=1;for(ee.data.copy(fe),re-=ee.data.length;ee=ee.next;){var X=ee.data,Z=re>X.length?X.length:re;if(X.copy(fe,fe.length-re,0,Z),re-=Z,re===0){Z===X.length?(++Q,ee.next?ue.head=ee.next:ue.head=ue.tail=null):(ue.head=ee,ee.data=X.slice(Z));break}++Q}return ue.length-=Q,fe}function ce(re){var ue=re._readableState;if(ue.length>0)throw new Error('"endReadable()" called on non-empty stream');ue.endEmitted||(ue.ended=!0,y.nextTick(se,ue,re))}function se(re,ue){!re.endEmitted&&re.length===0&&(re.endEmitted=!0,ue.readable=!1,ue.emit("end"))}function Te(re,ue){for(var fe=0,ee=re.length;fe<ee;fe++)if(re[fe]===ue)return fe;return-1}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":214,"./internal/streams/BufferList":219,"./internal/streams/destroy":220,"./internal/streams/stream":221,_process:208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/get-prototype-of":59,"core-util-is":189,events:192,inherits:196,isarray:198,"process-nextick-args":207,"safe-buffer":228,"string_decoder/":235,util:71}],217:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(o){return o&&o.__esModule?o:{default:o}}$.exports=S;var D=I("./_stream_duplex"),v=(0,g.default)(I("core-util-is"));v.inherits=I("inherits"),v.inherits(S,D);function f(o,r){var s=this._transformState;s.transforming=!1;var d=s.writecb;if(!d)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,r!=null&&this.push(r),d(o);var u=this._readableState;u.reading=!1,(u.needReadable||u.length<u.highWaterMark)&&this._read(u.highWaterMark)}function S(o){if(!(this instanceof S))return new S(o);D.call(this,o),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,o&&(typeof o.transform=="function"&&(this._transform=o.transform),typeof o.flush=="function"&&(this._flush=o.flush)),this.on("prefinish",y)}function y(){var o=this;typeof this._flush=="function"?this._flush(function(r,s){c(o,r,s)}):c(this,null,null)}S.prototype.push=function(o,r){return this._transformState.needTransform=!1,D.prototype.push.call(this,o,r)},S.prototype._transform=function(o,r,s){throw new Error("_transform() is not implemented")},S.prototype._write=function(o,r,s){var d=this._transformState;if(d.writecb=s,d.writechunk=o,d.writeencoding=r,!d.transforming){var u=this._readableState;(d.needTransform||u.needReadable||u.length<u.highWaterMark)&&this._read(u.highWaterMark)}},S.prototype._read=function(o){var r=this._transformState;r.writechunk!==null&&r.writecb&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0},S.prototype._destroy=function(o,r){var s=this;D.prototype._destroy.call(this,o,function(d){r(d),s.emit("close")})};function c(o,r,s){if(r)return o.emit("error",r);if(s!=null&&o.push(s),o._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(o._transformState.transforming)throw new Error("Calling transform done when still transforming");return o.push(null)}},{"./_stream_duplex":214,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],218:[function(I,$,R){(function(M,g){"use strict";var T=I("babel-runtime/core-js/object/define-property"),D=d(T),v=I("babel-runtime/core-js/symbol/has-instance"),f=d(v),S=I("babel-runtime/core-js/symbol"),y=d(S),c=I("babel-runtime/core-js/object/create"),o=d(c),r=I("babel-runtime/core-js/set-immediate"),s=d(r);function d(he){return he&&he.__esModule?he:{default:he}}var u=I("process-nextick-args");$.exports=j;function p(he,ce,se){this.chunk=he,this.encoding=ce,this.callback=se,this.next=null}function m(he){var ce=this;this.next=null,this.entry=null,this.finish=function(){Oe(ce,he)}}var i=!M.browser&&["v0.10","v0.9."].indexOf(M.version.slice(0,5))>-1?s.default:u.nextTick,t;j.WritableState=x;var a=(0,o.default)(I("core-util-is"));a.inherits=I("inherits");var l={deprecate:I("util-deprecate")},E=I("./internal/streams/stream"),b=I("safe-buffer").Buffer,h=g.Uint8Array||function(){};function L(he){return b.from(he)}function O(he){return b.isBuffer(he)||he instanceof h}var w=I("./internal/streams/destroy");a.inherits(j,E);function C(){}function x(he,ce){t=t||I("./_stream_duplex"),he=he||{};var se=ce instanceof t;this.objectMode=!!he.objectMode,se&&(this.objectMode=this.objectMode||!!he.writableObjectMode);var Te=he.highWaterMark,re=he.writableHighWaterMark,ue=this.objectMode?16:16*1024;Te||Te===0?this.highWaterMark=Te:se&&(re||re===0)?this.highWaterMark=re:this.highWaterMark=ue,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var fe=he.decodeStrings===!1;this.decodeStrings=!fe,this.defaultEncoding=he.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ee){W(ce,ee)},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 m(this)}x.prototype.getBuffer=function(){for(var ce=this.bufferedRequest,se=[];ce;)se.push(ce),ce=ce.next;return se},function(){try{Object.defineProperty(x.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(he){}}();var _;typeof y.default=="function"&&f.default&&typeof Function.prototype[f.default]=="function"?(_=Function.prototype[f.default],(0,D.default)(j,f.default,{value:function(ce){return _.call(this,ce)?!0:this!==j?!1:ce&&ce._writableState instanceof x}})):_=function(ce){return ce instanceof this};function j(he){if(t=t||I("./_stream_duplex"),!_.call(j,this)&&!(this instanceof t))return new j(he);this._writableState=new x(he,this),this.writable=!0,he&&(typeof he.write=="function"&&(this._write=he.write),typeof he.writev=="function"&&(this._writev=he.writev),typeof he.destroy=="function"&&(this._destroy=he.destroy),typeof he.final=="function"&&(this._final=he.final)),E.call(this)}j.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function N(he,ce){var se=new Error("write after end");he.emit("error",se),u.nextTick(ce,se)}function P(he,ce,se,Te){var re=!0,ue=!1;return se===null?ue=new TypeError("May not write null values to stream"):typeof se!="string"&&se!==void 0&&!ce.objectMode&&(ue=new TypeError("Invalid non-string/buffer chunk")),ue&&(he.emit("error",ue),u.nextTick(Te,ue),re=!1),re}j.prototype.write=function(he,ce,se){var Te=this._writableState,re=!1,ue=!Te.objectMode&&O(he);return ue&&!b.isBuffer(he)&&(he=L(he)),typeof ce=="function"&&(se=ce,ce=null),ue?ce="buffer":ce||(ce=Te.defaultEncoding),typeof se!="function"&&(se=C),Te.ended?N(this,se):(ue||P(this,Te,he,se))&&(Te.pendingcb++,re=z(this,Te,ue,he,ce,se)),re},j.prototype.cork=function(){var he=this._writableState;he.corked++},j.prototype.uncork=function(){var he=this._writableState;he.corked&&(he.corked--,!he.writing&&!he.corked&&!he.finished&&!he.bufferProcessing&&he.bufferedRequest&&ne(this,he))},j.prototype.setDefaultEncoding=function(ce){if(typeof ce=="string"&&(ce=ce.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ce+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+ce);return this._writableState.defaultEncoding=ce,this};function V(he,ce,se){return!he.objectMode&&he.decodeStrings!==!1&&typeof ce=="string"&&(ce=b.from(ce,se)),ce}Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function z(he,ce,se,Te,re,ue){if(!se){var fe=V(ce,Te,re);Te!==fe&&(se=!0,re="buffer",Te=fe)}var ee=ce.objectMode?1:Te.length;ce.length+=ee;var Q=ce.length<ce.highWaterMark;if(Q||(ce.needDrain=!0),ce.writing||ce.corked){var X=ce.lastBufferedRequest;ce.lastBufferedRequest={chunk:Te,encoding:re,isBuf:se,callback:ue,next:null},X?X.next=ce.lastBufferedRequest:ce.bufferedRequest=ce.lastBufferedRequest,ce.bufferedRequestCount+=1}else B(he,ce,!1,ee,Te,re,ue);return Q}function B(he,ce,se,Te,re,ue,fe){ce.writelen=Te,ce.writecb=fe,ce.writing=!0,ce.sync=!0,se?he._writev(re,ce.onwrite):he._write(re,ue,ce.onwrite),ce.sync=!1}function K(he,ce,se,Te,re){--ce.pendingcb,se?(u.nextTick(re,Te),u.nextTick(me,he,ce),he._writableState.errorEmitted=!0,he.emit("error",Te)):(re(Te),he._writableState.errorEmitted=!0,he.emit("error",Te),me(he,ce))}function U(he){he.writing=!1,he.writecb=null,he.length-=he.writelen,he.writelen=0}function W(he,ce){var se=he._writableState,Te=se.sync,re=se.writecb;if(U(se),ce)K(he,se,Te,ce,re);else{var ue=te(se);!ue&&!se.corked&&!se.bufferProcessing&&se.bufferedRequest&&ne(he,se),Te?i(H,he,se,ue,re):H(he,se,ue,re)}}function H(he,ce,se,Te){se||q(he,ce),ce.pendingcb--,Te(),me(he,ce)}function q(he,ce){ce.length===0&&ce.needDrain&&(ce.needDrain=!1,he.emit("drain"))}function ne(he,ce){ce.bufferProcessing=!0;var se=ce.bufferedRequest;if(he._writev&&se&&se.next){var Te=ce.bufferedRequestCount,re=new Array(Te),ue=ce.corkedRequestsFree;ue.entry=se;for(var fe=0,ee=!0;se;)re[fe]=se,se.isBuf||(ee=!1),se=se.next,fe+=1;re.allBuffers=ee,B(he,ce,!0,ce.length,re,"",ue.finish),ce.pendingcb++,ce.lastBufferedRequest=null,ue.next?(ce.corkedRequestsFree=ue.next,ue.next=null):ce.corkedRequestsFree=new m(ce),ce.bufferedRequestCount=0}else{for(;se;){var Q=se.chunk,X=se.encoding,Z=se.callback,ve=ce.objectMode?1:Q.length;if(B(he,ce,!1,ve,Q,X,Z),se=se.next,ce.bufferedRequestCount--,ce.writing)break}se===null&&(ce.lastBufferedRequest=null)}ce.bufferedRequest=se,ce.bufferProcessing=!1}j.prototype._write=function(he,ce,se){se(new Error("_write() is not implemented"))},j.prototype._writev=null,j.prototype.end=function(he,ce,se){var Te=this._writableState;typeof he=="function"?(se=he,he=null,ce=null):typeof ce=="function"&&(se=ce,ce=null),he!=null&&this.write(he,ce),Te.corked&&(Te.corked=1,this.uncork()),!Te.ending&&!Te.finished&&Me(this,Te,se)};function te(he){return he.ending&&he.length===0&&he.bufferedRequest===null&&!he.finished&&!he.writing}function _e(he,ce){he._final(function(se){ce.pendingcb--,se&&he.emit("error",se),ce.prefinished=!0,he.emit("prefinish"),me(he,ce)})}function Ce(he,ce){!ce.prefinished&&!ce.finalCalled&&(typeof he._final=="function"?(ce.pendingcb++,ce.finalCalled=!0,u.nextTick(_e,he,ce)):(ce.prefinished=!0,he.emit("prefinish")))}function me(he,ce){var se=te(ce);return se&&(Ce(he,ce),ce.pendingcb===0&&(ce.finished=!0,he.emit("finish"))),se}function Me(he,ce,se){ce.ending=!0,me(he,ce),se&&(ce.finished?u.nextTick(se):he.once("finish",se)),ce.ended=!0,he.writable=!1}function Oe(he,ce,se){var Te=he.entry;for(he.entry=null;Te;){var re=Te.callback;ce.pendingcb--,re(se),Te=Te.next}ce.corkedRequestsFree?ce.corkedRequestsFree.next=he:ce.corkedRequestsFree=he}Object.defineProperty(j.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ce){if(!this._writableState)return;this._writableState.destroyed=ce}}),j.prototype.destroy=w.destroy,j.prototype._undestroy=w.undestroy,j.prototype._destroy=function(he,ce){this.end(),ce(he)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":214,"./internal/streams/destroy":220,"./internal/streams/stream":221,_process:208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/define-property":56,"babel-runtime/core-js/set-immediate":62,"babel-runtime/core-js/symbol":64,"babel-runtime/core-js/symbol/has-instance":65,"core-util-is":189,inherits:196,"process-nextick-args":207,"safe-buffer":228,"util-deprecate":240}],219:[function(I,$,R){"use strict";function M(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}var g=I("safe-buffer").Buffer,T=I("util");function D(v,f,S){v.copy(f,S)}$.exports=function(){function v(){M(this,v),this.head=null,this.tail=null,this.length=0}return v.prototype.push=function(S){var y={data:S,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length},v.prototype.unshift=function(S){var y={data:S,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length},v.prototype.shift=function(){if(this.length===0)return;var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S},v.prototype.clear=function(){this.head=this.tail=null,this.length=0},v.prototype.join=function(S){if(this.length===0)return"";for(var y=this.head,c=""+y.data;y=y.next;)c+=S+y.data;return c},v.prototype.concat=function(S){if(this.length===0)return g.alloc(0);if(this.length===1)return this.head.data;for(var y=g.allocUnsafe(S>>>0),c=this.head,o=0;c;)D(c.data,y,o),o+=c.data.length,c=c.next;return y},v}(),T&&T.inspect&&T.inspect.custom&&($.exports.prototype[T.inspect.custom]=function(){var v=T.inspect({length:this.length});return this.constructor.name+" "+v})},{"safe-buffer":228,util:71}],220:[function(I,$,R){"use strict";var M=I("process-nextick-args");function g(v,f){var S=this,y=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return y||c?(f?f(v):v&&(!this._writableState||!this._writableState.errorEmitted)&&M.nextTick(D,this,v),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(v||null,function(o){!f&&o?(M.nextTick(D,S,o),S._writableState&&(S._writableState.errorEmitted=!0)):f&&f(o)}),this)}function T(){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 D(v,f){v.emit("error",f)}$.exports={destroy:g,undestroy:T}},{"process-nextick-args":207}],221:[function(I,$,R){"use strict";$.exports=I("events").EventEmitter},{events:192}],222:[function(I,$,R){$.exports=I("./readable").PassThrough},{"./readable":223}],223:[function(I,$,R){R=$.exports=I("./lib/_stream_readable.js"),R.Stream=R,R.Readable=R,R.Writable=I("./lib/_stream_writable.js"),R.Duplex=I("./lib/_stream_duplex.js"),R.Transform=I("./lib/_stream_transform.js"),R.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,$,R){$.exports=I("./readable").Transform},{"./readable":223}],225:[function(I,$,R){$.exports=I("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":218}],226:[function(I,$,R){var M=function(){return this}()||Function("return this")(),g=M.regeneratorRuntime&&Object.getOwnPropertyNames(M).indexOf("regeneratorRuntime")>=0,T=g&&M.regeneratorRuntime;if(M.regeneratorRuntime=void 0,$.exports=I("./runtime"),g)M.regeneratorRuntime=T;else try{delete M.regeneratorRuntime}catch(D){M.regeneratorRuntime=void 0}},{"./runtime":227}],227:[function(I,$,R){!function(M){"use strict";var g=Object.prototype,T=g.hasOwnProperty,D,v=typeof Symbol=="function"?Symbol:{},f=v.iterator||"@@iterator",S=v.asyncIterator||"@@asyncIterator",y=v.toStringTag||"@@toStringTag",c=typeof $=="object",o=M.regeneratorRuntime;if(o){c&&($.exports=o);return}o=M.regeneratorRuntime=c?$.exports:{};function r(z,B,K,U){var W=B&&B.prototype instanceof t?B:t,H=Object.create(W.prototype),q=new N(U||[]);return H._invoke=C(z,K,q),H}o.wrap=r;function s(z,B,K){try{return{type:"normal",arg:z.call(B,K)}}catch(U){return{type:"throw",arg:U}}}var d="suspendedStart",u="suspendedYield",p="executing",m="completed",i={};function t(){}function a(){}function l(){}var E={};E[f]=function(){return this};var b=Object.getPrototypeOf,h=b&&b(b(P([])));h&&h!==g&&T.call(h,f)&&(E=h);var L=l.prototype=t.prototype=Object.create(E);a.prototype=L.constructor=l,l.constructor=a,l[y]=a.displayName="GeneratorFunction";function O(z){["next","throw","return"].forEach(function(B){z[B]=function(K){return this._invoke(B,K)}})}o.isGeneratorFunction=function(z){var B=typeof z=="function"&&z.constructor;return B?B===a||(B.displayName||B.name)==="GeneratorFunction":!1},o.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,l):(z.__proto__=l,y in z||(z[y]="GeneratorFunction")),z.prototype=Object.create(L),z},o.awrap=function(z){return{__await:z}};function w(z){function B(W,H,q,ne){var te=s(z[W],z,H);if(te.type==="throw")ne(te.arg);else{var _e=te.arg,Ce=_e.value;return Ce&&typeof Ce=="object"&&T.call(Ce,"__await")?Promise.resolve(Ce.__await).then(function(me){B("next",me,q,ne)},function(me){B("throw",me,q,ne)}):Promise.resolve(Ce).then(function(me){_e.value=me,q(_e)},ne)}}var K;function U(W,H){function q(){return new Promise(function(ne,te){B(W,H,ne,te)})}return K=K?K.then(q,q):q()}this._invoke=U}O(w.prototype),w.prototype[S]=function(){return this},o.AsyncIterator=w,o.async=function(z,B,K,U){var W=new w(r(z,B,K,U));return o.isGeneratorFunction(B)?W:W.next().then(function(H){return H.done?H.value:W.next()})};function C(z,B,K){var U=d;return function(H,q){if(U===p)throw new Error("Generator is already running");if(U===m){if(H==="throw")throw q;return V()}for(K.method=H,K.arg=q;;){var ne=K.delegate;if(ne){var te=x(ne,K);if(te){if(te===i)continue;return te}}if(K.method==="next")K.sent=K._sent=K.arg;else if(K.method==="throw"){if(U===d)throw U=m,K.arg;K.dispatchException(K.arg)}else K.method==="return"&&K.abrupt("return",K.arg);U=p;var _e=s(z,B,K);if(_e.type==="normal"){if(U=K.done?m:u,_e.arg===i)continue;return{value:_e.arg,done:K.done}}else _e.type==="throw"&&(U=m,K.method="throw",K.arg=_e.arg)}}}function x(z,B){var K=z.iterator[B.method];if(K===D){if(B.delegate=null,B.method==="throw"){if(z.iterator.return&&(B.method="return",B.arg=D,x(z,B),B.method==="throw"))return i;B.method="throw",B.arg=new TypeError("The iterator does not provide a 'throw' method")}return i}var U=s(K,z.iterator,B.arg);if(U.type==="throw")return B.method="throw",B.arg=U.arg,B.delegate=null,i;var W=U.arg;if(!W)return B.method="throw",B.arg=new TypeError("iterator result is not an object"),B.delegate=null,i;if(W.done)B[z.resultName]=W.value,B.next=z.nextLoc,B.method!=="return"&&(B.method="next",B.arg=D);else return W;return B.delegate=null,i}O(L),L[y]="Generator",L[f]=function(){return this},L.toString=function(){return"[object Generator]"};function _(z){var B={tryLoc:z[0]};1 in z&&(B.catchLoc=z[1]),2 in z&&(B.finallyLoc=z[2],B.afterLoc=z[3]),this.tryEntries.push(B)}function j(z){var B=z.completion||{};B.type="normal",delete B.arg,z.completion=B}function N(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(_,this),this.reset(!0)}o.keys=function(z){var B=[];for(var K in z)B.push(K);return B.reverse(),function U(){for(;B.length;){var W=B.pop();if(W in z)return U.value=W,U.done=!1,U}return U.done=!0,U}};function P(z){if(z){var B=z[f];if(B)return B.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var K=-1,U=function W(){for(;++K<z.length;)if(T.call(z,K))return W.value=z[K],W.done=!1,W;return W.value=D,W.done=!0,W};return U.next=U}}return{next:V}}o.values=P;function V(){return{value:D,done:!0}}N.prototype={constructor:N,reset:function(z){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(j),!z)for(var B in this)B.charAt(0)==="t"&&T.call(this,B)&&!isNaN(+B.slice(1))&&(this[B]=D)},stop:function(){this.done=!0;var z=this.tryEntries[0],B=z.completion;if(B.type==="throw")throw B.arg;return this.rval},dispatchException:function(z){if(this.done)throw z;var B=this;function K(te,_e){return H.type="throw",H.arg=z,B.next=te,_e&&(B.method="next",B.arg=D),!!_e}for(var U=this.tryEntries.length-1;U>=0;--U){var W=this.tryEntries[U],H=W.completion;if(W.tryLoc==="root")return K("end");if(W.tryLoc<=this.prev){var q=T.call(W,"catchLoc"),ne=T.call(W,"finallyLoc");if(q&&ne){if(this.prev<W.catchLoc)return K(W.catchLoc,!0);if(this.prev<W.finallyLoc)return K(W.finallyLoc)}else if(q){if(this.prev<W.catchLoc)return K(W.catchLoc,!0)}else if(ne){if(this.prev<W.finallyLoc)return K(W.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(z,B){for(var K=this.tryEntries.length-1;K>=0;--K){var U=this.tryEntries[K];if(U.tryLoc<=this.prev&&T.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var W=U;break}}W&&(z==="break"||z==="continue")&&W.tryLoc<=B&&B<=W.finallyLoc&&(W=null);var H=W?W.completion:{};return H.type=z,H.arg=B,W?(this.method="next",this.next=W.finallyLoc,i):this.complete(H)},complete:function(z,B){if(z.type==="throw")throw z.arg;return z.type==="break"||z.type==="continue"?this.next=z.arg:z.type==="return"?(this.rval=this.arg=z.arg,this.method="return",this.next="end"):z.type==="normal"&&B&&(this.next=B),i},finish:function(z){for(var B=this.tryEntries.length-1;B>=0;--B){var K=this.tryEntries[B];if(K.finallyLoc===z)return this.complete(K.completion,K.afterLoc),j(K),i}},catch:function(z){for(var B=this.tryEntries.length-1;B>=0;--B){var K=this.tryEntries[B];if(K.tryLoc===z){var U=K.completion;if(U.type==="throw"){var W=U.arg;j(K)}return W}}throw new Error("illegal catch attempt")},delegateYield:function(z,B,K){return this.delegate={iterator:P(z),resultName:B,nextLoc:K},this.method==="next"&&(this.arg=D),i}}}(function(){return this}()||Function("return this")())},{}],228:[function(I,$,R){var M=I("buffer"),g=M.Buffer;function T(v,f){for(var S in v)f[S]=v[S]}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?$.exports=M:(T(M,R),R.Buffer=D);function D(v,f,S){return g(v,f,S)}T(g,D),D.from=function(v,f,S){if(typeof v=="number")throw new TypeError("Argument must not be a number");return g(v,f,S)},D.alloc=function(v,f,S){if(typeof v!="number")throw new TypeError("Argument must be a number");var y=g(v);return f!==void 0?typeof S=="string"?y.fill(f,S):y.fill(f):y.fill(0),y},D.allocUnsafe=function(v){if(typeof v!="number")throw new TypeError("Argument must be a number");return g(v)},D.allocUnsafeSlow=function(v){if(typeof v!="number")throw new TypeError("Argument must be a number");return M.SlowBuffer(v)}},{buffer:73}],229:[function(I,$,R){(function(M){"use strict";var g=I("babel-runtime/core-js/string/from-code-point"),T=u(g),D=I("babel-runtime/core-js/json/stringify"),v=u(D),f=I("babel-runtime/helpers/typeof"),S=u(f),y=I("babel-runtime/core-js/object/define-property"),c=u(y),o=I("babel-runtime/core-js/object/keys"),r=u(o),s=I("babel-runtime/core-js/object/create"),d=u(s);function u(p){return p&&p.__esModule?p:{default:p}}(function(p){p.parser=function(X,Z){return new i(X,Z)},p.SAXParser=i,p.SAXStream=L,p.createStream=h,p.MAX_BUFFER_LENGTH=64*1024;var m=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];p.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function i(X,Z){if(!(this instanceof i))return new i(X,Z);var ve=this;a(ve),ve.q=ve.c="",ve.bufferCheckPosition=p.MAX_BUFFER_LENGTH,ve.opt=Z||{},ve.opt.lowercase=ve.opt.lowercase||ve.opt.lowercasetags,ve.looseCase=ve.opt.lowercase?"toLowerCase":"toUpperCase",ve.tags=[],ve.closed=ve.closedRoot=ve.sawRoot=!1,ve.tag=ve.error=null,ve.strict=!!X,ve.noscript=!!(X||ve.opt.noscript),ve.state=H.BEGIN,ve.strictEntities=ve.opt.strictEntities,ve.ENTITIES=ve.strictEntities?(0,d.default)(p.XML_ENTITIES):(0,d.default)(p.ENTITIES),ve.attribList=[],ve.opt.xmlns&&(ve.ns=(0,d.default)(_)),ve.trackPosition=ve.opt.position!==!1,ve.trackPosition&&(ve.position=ve.line=ve.column=0),ne(ve,"onready")}d.default||(Object.create=function(X){function Z(){}Z.prototype=X;var ve=new Z;return ve}),r.default||(Object.keys=function(X){var Z=[];for(var ve in X)X.hasOwnProperty(ve)&&Z.push(ve);return Z});function t(X){for(var Z=Math.max(p.MAX_BUFFER_LENGTH,10),ve=0,ye=0,Re=m.length;ye<Re;ye++){var Je=X[m[ye]].length;if(Je>Z)switch(m[ye]){case"textNode":_e(X);break;case"cdata":te(X,"oncdata",X.cdata),X.cdata="";break;case"script":te(X,"onscript",X.script),X.script="";break;default:me(X,"Max buffer length exceeded: "+m[ye])}ve=Math.max(ve,Je)}var Ze=p.MAX_BUFFER_LENGTH-ve;X.bufferCheckPosition=Ze+X.position}function a(X){for(var Z=0,ve=m.length;Z<ve;Z++)X[m[Z]]=""}function l(X){_e(X),X.cdata!==""&&(te(X,"oncdata",X.cdata),X.cdata=""),X.script!==""&&(te(X,"onscript",X.script),X.script="")}i.prototype={end:function(){Me(this)},write:Q,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){l(this)}};var E;try{E=I("stream").Stream}catch(X){E=function(){}}var b=p.EVENTS.filter(function(X){return X!=="error"&&X!=="end"});function h(X,Z){return new L(X,Z)}function L(X,Z){if(!(this instanceof L))return new L(X,Z);E.apply(this),this._parser=new i(X,Z),this.writable=!0,this.readable=!0;var ve=this;this._parser.onend=function(){ve.emit("end")},this._parser.onerror=function(ye){ve.emit("error",ye),ve._parser.error=null},this._decoder=null,b.forEach(function(ye){(0,c.default)(ve,"on"+ye,{get:function(){return ve._parser["on"+ye]},set:function(Je){if(!Je)return ve.removeAllListeners(ye),ve._parser["on"+ye]=Je,Je;ve.on(ye,Je)},enumerable:!0,configurable:!1})})}L.prototype=(0,d.default)(E.prototype,{constructor:{value:L}}),L.prototype.write=function(X){if(typeof M=="function"&&typeof M.isBuffer=="function"&&M.isBuffer(X)){if(!this._decoder){var Z=I("string_decoder").StringDecoder;this._decoder=new Z("utf8")}X=this._decoder.write(X)}return this._parser.write(X.toString()),this.emit("data",X),!0},L.prototype.end=function(X){return X&&X.length&&this.write(X),this._parser.end(),!0},L.prototype.on=function(X,Z){var ve=this;return!ve._parser["on"+X]&&b.indexOf(X)!==-1&&(ve._parser["on"+X]=function(){var ye=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ye.splice(0,0,X),ve.emit.apply(ve,ye)}),E.prototype.on.call(ve,X,Z)};var O="[CDATA[",w="DOCTYPE",C="http://www.w3.org/XML/1998/namespace",x="http://www.w3.org/2000/xmlns/",_={xml:C,xmlns:x},j=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,N=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,P=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,V=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function z(X){return X===" "||X===`
|
|
|
`||X==="\r"||X===" "}function B(X){return X==='"'||X==="'"}function K(X){return X===">"||z(X)}function U(X,Z){return X.test(Z)}function W(X,Z){return!U(X,Z)}var H=0;p.STATE={BEGIN:H++,BEGIN_WHITESPACE:H++,TEXT:H++,TEXT_ENTITY:H++,OPEN_WAKA:H++,SGML_DECL:H++,SGML_DECL_QUOTED:H++,DOCTYPE:H++,DOCTYPE_QUOTED:H++,DOCTYPE_DTD:H++,DOCTYPE_DTD_QUOTED:H++,COMMENT_STARTING:H++,COMMENT:H++,COMMENT_ENDING:H++,COMMENT_ENDED:H++,CDATA:H++,CDATA_ENDING:H++,CDATA_ENDING_2:H++,PROC_INST:H++,PROC_INST_BODY:H++,PROC_INST_ENDING:H++,OPEN_TAG:H++,OPEN_TAG_SLASH:H++,ATTRIB:H++,ATTRIB_NAME:H++,ATTRIB_NAME_SAW_WHITE:H++,ATTRIB_VALUE:H++,ATTRIB_VALUE_QUOTED:H++,ATTRIB_VALUE_CLOSED:H++,ATTRIB_VALUE_UNQUOTED:H++,ATTRIB_VALUE_ENTITY_Q:H++,ATTRIB_VALUE_ENTITY_U:H++,CLOSE_TAG:H++,CLOSE_TAG_SAW_WHITE:H++,SCRIPT:H++,SCRIPT_ENDING:H++},p.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},p.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)(p.ENTITIES).forEach(function(X){var Z=p.ENTITIES[X],ve=typeof Z=="number"?String.fromCharCode(Z):Z;p.ENTITIES[X]=ve});for(var q in p.STATE)p.STATE[p.STATE[q]]=q;H=p.STATE;function ne(X,Z,ve){X[Z]&&X[Z](ve)}function te(X,Z,ve){X.textNode&&_e(X),ne(X,Z,ve)}function _e(X){X.textNode=Ce(X.opt,X.textNode),X.textNode&&ne(X,"ontext",X.textNode),X.textNode=""}function Ce(X,Z){return X.trim&&(Z=Z.trim()),X.normalize&&(Z=Z.replace(/\s+/g," ")),Z}function me(X,Z){return _e(X),X.trackPosition&&(Z+=`
|
|
|
Line: `+X.line+`
|
|
|
Column: `+X.column+`
|
|
|
Char: `+X.c),Z=new Error(Z),X.error=Z,ne(X,"onerror",Z),X}function Me(X){return X.sawRoot&&!X.closedRoot&&Oe(X,"Unclosed root tag"),X.state!==H.BEGIN&&X.state!==H.BEGIN_WHITESPACE&&X.state!==H.TEXT&&me(X,"Unexpected end"),_e(X),X.c="",X.closed=!0,ne(X,"onend"),i.call(X,X.strict,X.opt),X}function Oe(X,Z){if((typeof X=="undefined"?"undefined":(0,S.default)(X))!=="object"||!(X instanceof i))throw new Error("bad call to strictFail");X.strict&&me(X,Z)}function he(X){X.strict||(X.tagName=X.tagName[X.looseCase]());var Z=X.tags[X.tags.length-1]||X,ve=X.tag={name:X.tagName,attributes:{}};X.opt.xmlns&&(ve.ns=Z.ns),X.attribList.length=0,te(X,"onopentagstart",ve)}function ce(X,Z){var ve=X.indexOf(":"),ye=ve<0?["",X]:X.split(":"),Re=ye[0],Je=ye[1];return Z&&X==="xmlns"&&(Re="xmlns",Je=""),{prefix:Re,local:Je}}function se(X){if(X.strict||(X.attribName=X.attribName[X.looseCase]()),X.attribList.indexOf(X.attribName)!==-1||X.tag.attributes.hasOwnProperty(X.attribName)){X.attribName=X.attribValue="";return}if(X.opt.xmlns){var Z=ce(X.attribName,!0),ve=Z.prefix,ye=Z.local;if(ve==="xmlns")if(ye==="xml"&&X.attribValue!==C)Oe(X,"xml: prefix must be bound to "+C+`
|
|
|
Actual: `+X.attribValue);else if(ye==="xmlns"&&X.attribValue!==x)Oe(X,"xmlns: prefix must be bound to "+x+`
|
|
|
Actual: `+X.attribValue);else{var Re=X.tag,Je=X.tags[X.tags.length-1]||X;Re.ns===Je.ns&&(Re.ns=(0,d.default)(Je.ns)),Re.ns[ye]=X.attribValue}X.attribList.push([X.attribName,X.attribValue])}else X.tag.attributes[X.attribName]=X.attribValue,te(X,"onattribute",{name:X.attribName,value:X.attribValue});X.attribName=X.attribValue=""}function Te(X,Z){if(X.opt.xmlns){var ve=X.tag,ye=ce(X.tagName);ve.prefix=ye.prefix,ve.local=ye.local,ve.uri=ve.ns[ye.prefix]||"",ve.prefix&&!ve.uri&&(Oe(X,"Unbound namespace prefix: "+(0,v.default)(X.tagName)),ve.uri=ye.prefix);var Re=X.tags[X.tags.length-1]||X;ve.ns&&Re.ns!==ve.ns&&(0,r.default)(ve.ns).forEach(function($e){te(X,"onopennamespace",{prefix:$e,uri:ve.ns[$e]})});for(var Je=0,Ze=X.attribList.length;Je<Ze;Je++){var rt=X.attribList[Je],tt=rt[0],st=rt[1],ot=ce(tt,!0),Fe=ot.prefix,Ae=ot.local,qe=Fe===""?"":ve.ns[Fe]||"",ut={name:tt,value:st,prefix:Fe,local:Ae,uri:qe};Fe&&Fe!=="xmlns"&&!qe&&(Oe(X,"Unbound namespace prefix: "+(0,v.default)(Fe)),ut.uri=Fe),X.tag.attributes[tt]=ut,te(X,"onattribute",ut)}X.attribList.length=0}X.tag.isSelfClosing=!!Z,X.sawRoot=!0,X.tags.push(X.tag),te(X,"onopentag",X.tag),Z||(!X.noscript&&X.tagName.toLowerCase()==="script"?X.state=H.SCRIPT:X.state=H.TEXT,X.tag=null,X.tagName=""),X.attribName=X.attribValue="",X.attribList.length=0}function re(X){if(!X.tagName){Oe(X,"Weird empty close tag."),X.textNode+="</>",X.state=H.TEXT;return}if(X.script){if(X.tagName!=="script"){X.script+="</"+X.tagName+">",X.tagName="",X.state=H.SCRIPT;return}te(X,"onscript",X.script),X.script=""}var Z=X.tags.length,ve=X.tagName;X.strict||(ve=ve[X.looseCase]());for(var ye=ve;Z--;){var Re=X.tags[Z];if(Re.name!==ye)Oe(X,"Unexpected close tag");else break}if(Z<0){Oe(X,"Unmatched closing tag: "+X.tagName),X.textNode+="</"+X.tagName+">",X.state=H.TEXT;return}X.tagName=ve;for(var Je=X.tags.length;Je-- >Z;){var Ze=X.tag=X.tags.pop();X.tagName=X.tag.name,te(X,"onclosetag",X.tagName);var rt={};for(var tt in Ze.ns)rt[tt]=Ze.ns[tt];var st=X.tags[X.tags.length-1]||X;X.opt.xmlns&&Ze.ns!==st.ns&&(0,r.default)(Ze.ns).forEach(function(ot){var Fe=Ze.ns[ot];te(X,"onclosenamespace",{prefix:ot,uri:Fe})})}Z===0&&(X.closedRoot=!0),X.tagName=X.attribValue=X.attribName="",X.attribList.length=0,X.state=H.TEXT}function ue(X){var Z=X.entity,ve=Z.toLowerCase(),ye,Re="";return X.ENTITIES[Z]?X.ENTITIES[Z]:X.ENTITIES[ve]?X.ENTITIES[ve]:(Z=ve,Z.charAt(0)==="#"&&(Z.charAt(1)==="x"?(Z=Z.slice(2),ye=parseInt(Z,16),Re=ye.toString(16)):(Z=Z.slice(1),ye=parseInt(Z,10),Re=ye.toString(10))),Z=Z.replace(/^0+/,""),isNaN(ye)||Re.toLowerCase()!==Z?(Oe(X,"Invalid character entity"),"&"+X.entity+";"):(0,T.default)(ye))}function fe(X,Z){Z==="<"?(X.state=H.OPEN_WAKA,X.startTagPosition=X.position):z(Z)||(Oe(X,"Non-whitespace before first tag."),X.textNode=Z,X.state=H.TEXT)}function ee(X,Z){var ve="";return Z<X.length&&(ve=X.charAt(Z)),ve}function Q(X){var Z=this;if(this.error)throw this.error;if(Z.closed)return me(Z,"Cannot write after close. Assign an onready handler.");if(X===null)return Me(Z);(typeof X=="undefined"?"undefined":(0,S.default)(X))==="object"&&(X=X.toString());for(var ve=0,ye="";!(ye=ee(X,ve++),Z.c=ye,!ye);){Z.trackPosition&&(Z.position++,ye===`
|
|
|
`?(Z.line++,Z.column=0):Z.column++);switch(Z.state){case H.BEGIN:if(Z.state=H.BEGIN_WHITESPACE,ye==="\uFEFF")continue;fe(Z,ye);continue;case H.BEGIN_WHITESPACE:fe(Z,ye);continue;case H.TEXT:if(Z.sawRoot&&!Z.closedRoot){for(var Re=ve-1;ye&&ye!=="<"&&ye!=="&";)ye=ee(X,ve++),ye&&Z.trackPosition&&(Z.position++,ye===`
|
|
|
`?(Z.line++,Z.column=0):Z.column++);Z.textNode+=X.substring(Re,ve-1)}ye==="<"&&!(Z.sawRoot&&Z.closedRoot&&!Z.strict)?(Z.state=H.OPEN_WAKA,Z.startTagPosition=Z.position):(!z(ye)&&(!Z.sawRoot||Z.closedRoot)&&Oe(Z,"Text data outside of root node."),ye==="&"?Z.state=H.TEXT_ENTITY:Z.textNode+=ye);continue;case H.SCRIPT:ye==="<"?Z.state=H.SCRIPT_ENDING:Z.script+=ye;continue;case H.SCRIPT_ENDING:ye==="/"?Z.state=H.CLOSE_TAG:(Z.script+="<"+ye,Z.state=H.SCRIPT);continue;case H.OPEN_WAKA:if(ye==="!")Z.state=H.SGML_DECL,Z.sgmlDecl="";else if(!z(ye))if(U(j,ye))Z.state=H.OPEN_TAG,Z.tagName=ye;else if(ye==="/")Z.state=H.CLOSE_TAG,Z.tagName="";else if(ye==="?")Z.state=H.PROC_INST,Z.procInstName=Z.procInstBody="";else{if(Oe(Z,"Unencoded <"),Z.startTagPosition+1<Z.position){var Je=Z.position-Z.startTagPosition;ye=new Array(Je).join(" ")+ye}Z.textNode+="<"+ye,Z.state=H.TEXT}continue;case H.SGML_DECL:(Z.sgmlDecl+ye).toUpperCase()===O?(te(Z,"onopencdata"),Z.state=H.CDATA,Z.sgmlDecl="",Z.cdata=""):Z.sgmlDecl+ye==="--"?(Z.state=H.COMMENT,Z.comment="",Z.sgmlDecl=""):(Z.sgmlDecl+ye).toUpperCase()===w?(Z.state=H.DOCTYPE,(Z.doctype||Z.sawRoot)&&Oe(Z,"Inappropriately located doctype declaration"),Z.doctype="",Z.sgmlDecl=""):ye===">"?(te(Z,"onsgmldeclaration",Z.sgmlDecl),Z.sgmlDecl="",Z.state=H.TEXT):(B(ye)&&(Z.state=H.SGML_DECL_QUOTED),Z.sgmlDecl+=ye);continue;case H.SGML_DECL_QUOTED:ye===Z.q&&(Z.state=H.SGML_DECL,Z.q=""),Z.sgmlDecl+=ye;continue;case H.DOCTYPE:ye===">"?(Z.state=H.TEXT,te(Z,"ondoctype",Z.doctype),Z.doctype=!0):(Z.doctype+=ye,ye==="["?Z.state=H.DOCTYPE_DTD:B(ye)&&(Z.state=H.DOCTYPE_QUOTED,Z.q=ye));continue;case H.DOCTYPE_QUOTED:Z.doctype+=ye,ye===Z.q&&(Z.q="",Z.state=H.DOCTYPE);continue;case H.DOCTYPE_DTD:Z.doctype+=ye,ye==="]"?Z.state=H.DOCTYPE:B(ye)&&(Z.state=H.DOCTYPE_DTD_QUOTED,Z.q=ye);continue;case H.DOCTYPE_DTD_QUOTED:Z.doctype+=ye,ye===Z.q&&(Z.state=H.DOCTYPE_DTD,Z.q="");continue;case H.COMMENT:ye==="-"?Z.state=H.COMMENT_ENDING:Z.comment+=ye;continue;case H.COMMENT_ENDING:ye==="-"?(Z.state=H.COMMENT_ENDED,Z.comment=Ce(Z.opt,Z.comment),Z.comment&&te(Z,"oncomment",Z.comment),Z.comment=""):(Z.comment+="-"+ye,Z.state=H.COMMENT);continue;case H.COMMENT_ENDED:ye!==">"?(Oe(Z,"Malformed comment"),Z.comment+="--"+ye,Z.state=H.COMMENT):Z.state=H.TEXT;continue;case H.CDATA:ye==="]"?Z.state=H.CDATA_ENDING:Z.cdata+=ye;continue;case H.CDATA_ENDING:ye==="]"?Z.state=H.CDATA_ENDING_2:(Z.cdata+="]"+ye,Z.state=H.CDATA);continue;case H.CDATA_ENDING_2:ye===">"?(Z.cdata&&te(Z,"oncdata",Z.cdata),te(Z,"onclosecdata"),Z.cdata="",Z.state=H.TEXT):ye==="]"?Z.cdata+="]":(Z.cdata+="]]"+ye,Z.state=H.CDATA);continue;case H.PROC_INST:ye==="?"?Z.state=H.PROC_INST_ENDING:z(ye)?Z.state=H.PROC_INST_BODY:Z.procInstName+=ye;continue;case H.PROC_INST_BODY:if(!Z.procInstBody&&z(ye))continue;ye==="?"?Z.state=H.PROC_INST_ENDING:Z.procInstBody+=ye;continue;case H.PROC_INST_ENDING:ye===">"?(te(Z,"onprocessinginstruction",{name:Z.procInstName,body:Z.procInstBody}),Z.procInstName=Z.procInstBody="",Z.state=H.TEXT):(Z.procInstBody+="?"+ye,Z.state=H.PROC_INST_BODY);continue;case H.OPEN_TAG:U(N,ye)?Z.tagName+=ye:(he(Z),ye===">"?Te(Z):ye==="/"?Z.state=H.OPEN_TAG_SLASH:(z(ye)||Oe(Z,"Invalid character in tag name"),Z.state=H.ATTRIB));continue;case H.OPEN_TAG_SLASH:ye===">"?(Te(Z,!0),re(Z)):(Oe(Z,"Forward-slash in opening tag not followed by >"),Z.state=H.ATTRIB);continue;case H.ATTRIB:if(z(ye))continue;ye===">"?Te(Z):ye==="/"?Z.state=H.OPEN_TAG_SLASH:U(j,ye)?(Z.attribName=ye,Z.attribValue="",Z.state=H.ATTRIB_NAME):Oe(Z,"Invalid attribute name");continue;case H.ATTRIB_NAME:ye==="="?Z.state=H.ATTRIB_VALUE:ye===">"?(Oe(Z,"Attribute without value"),Z.attribValue=Z.attribName,se(Z),Te(Z)):z(ye)?Z.state=H.ATTRIB_NAME_SAW_WHITE:U(N,ye)?Z.attribName+=ye:Oe(Z,"Invalid attribute name");continue;case H.ATTRIB_NAME_SAW_WHITE:if(ye==="=")Z.state=H.ATTRIB_VALUE;else{if(z(ye))continue;Oe(Z,"Attribute without value"),Z.tag.attributes[Z.attribName]="",Z.attribValue="",te(Z,"onattribute",{name:Z.attribName,value:""}),Z.attribName="",ye===">"?Te(Z):U(j,ye)?(Z.attribName=ye,Z.state=H.ATTRIB_NAME):(Oe(Z,"Invalid attribute name"),Z.state=H.ATTRIB)}continue;case H.ATTRIB_VALUE:if(z(ye))continue;B(ye)?(Z.q=ye,Z.state=H.ATTRIB_VALUE_QUOTED):(Oe(Z,"Unquoted attribute value"),Z.state=H.ATTRIB_VALUE_UNQUOTED,Z.attribValue=ye);continue;case H.ATTRIB_VALUE_QUOTED:if(ye!==Z.q){ye==="&"?Z.state=H.ATTRIB_VALUE_ENTITY_Q:Z.attribValue+=ye;continue}se(Z),Z.q="",Z.state=H.ATTRIB_VALUE_CLOSED;continue;case H.ATTRIB_VALUE_CLOSED:z(ye)?Z.state=H.ATTRIB:ye===">"?Te(Z):ye==="/"?Z.state=H.OPEN_TAG_SLASH:U(j,ye)?(Oe(Z,"No whitespace between attributes"),Z.attribName=ye,Z.attribValue="",Z.state=H.ATTRIB_NAME):Oe(Z,"Invalid attribute name");continue;case H.ATTRIB_VALUE_UNQUOTED:if(!K(ye)){ye==="&"?Z.state=H.ATTRIB_VALUE_ENTITY_U:Z.attribValue+=ye;continue}se(Z),ye===">"?Te(Z):Z.state=H.ATTRIB;continue;case H.CLOSE_TAG:if(Z.tagName)ye===">"?re(Z):U(N,ye)?Z.tagName+=ye:Z.script?(Z.script+="</"+Z.tagName,Z.tagName="",Z.state=H.SCRIPT):(z(ye)||Oe(Z,"Invalid tagname in closing tag"),Z.state=H.CLOSE_TAG_SAW_WHITE);else{if(z(ye))continue;W(j,ye)?Z.script?(Z.script+="</"+ye,Z.state=H.SCRIPT):Oe(Z,"Invalid tagname in closing tag."):Z.tagName=ye}continue;case H.CLOSE_TAG_SAW_WHITE:if(z(ye))continue;ye===">"?re(Z):Oe(Z,"Invalid characters in closing tag");continue;case H.TEXT_ENTITY:case H.ATTRIB_VALUE_ENTITY_Q:case H.ATTRIB_VALUE_ENTITY_U:var Ze,rt;switch(Z.state){case H.TEXT_ENTITY:Ze=H.TEXT,rt="textNode";break;case H.ATTRIB_VALUE_ENTITY_Q:Ze=H.ATTRIB_VALUE_QUOTED,rt="attribValue";break;case H.ATTRIB_VALUE_ENTITY_U:Ze=H.ATTRIB_VALUE_UNQUOTED,rt="attribValue";break}ye===";"?(Z[rt]+=ue(Z),Z.entity="",Z.state=Ze):U(Z.entity.length?V:P,ye)?Z.entity+=ye:(Oe(Z,"Invalid character in entity name"),Z[rt]+="&"+Z.entity+ye,Z.entity="",Z.state=Ze);continue;default:throw new Error(Z,"Unknown state: "+Z.state)}}return Z.position>=Z.bufferCheckPosition&&t(Z),Z}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */T.default||function(){var X=String.fromCharCode,Z=Math.floor,ve=function(){var Re=16384,Je=[],Ze,rt,tt=-1,st=arguments.length;if(!st)return"";for(var ot="";++tt<st;){var Fe=Number(arguments[tt]);if(!isFinite(Fe)||Fe<0||Fe>1114111||Z(Fe)!==Fe)throw RangeError("Invalid code point: "+Fe);Fe<=65535?Je.push(Fe):(Fe-=65536,Ze=(Fe>>10)+55296,rt=Fe%1024+56320,Je.push(Ze,rt)),(tt+1===st||Je.length>Re)&&(ot+=X.apply(null,Je),Je.length=0)}return ot};c.default?Object.defineProperty(String,"fromCodePoint",{value:ve,configurable:!0,writable:!0}):String.fromCodePoint=ve}()})(typeof R=="undefined"?(void 0).sax={}:R)}).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,$,R){$.exports=T;var M=I("events").EventEmitter,g=I("inherits");g(T,M),T.Readable=I("readable-stream/readable.js"),T.Writable=I("readable-stream/writable.js"),T.Duplex=I("readable-stream/duplex.js"),T.Transform=I("readable-stream/transform.js"),T.PassThrough=I("readable-stream/passthrough.js"),T.Stream=T;function T(){M.call(this)}T.prototype.pipe=function(D,v){var f=this;function S(u){D.writable&&(D.write(u)===!1&&f.pause&&f.pause())}f.on("data",S);function y(){f.readable&&f.resume&&f.resume()}D.on("drain",y),!D._isStdio&&(!v||v.end!==!1)&&(f.on("end",o),f.on("close",r));var c=!1;function o(){if(c)return;c=!0,D.end()}function r(){if(c)return;c=!0,typeof D.destroy=="function"&&D.destroy()}function s(u){if(d(),M.listenerCount(this,"error")===0)throw u}f.on("error",s),D.on("error",s);function d(){f.removeListener("data",S),D.removeListener("drain",y),f.removeListener("end",o),f.removeListener("close",r),f.removeListener("error",s),D.removeListener("error",s),f.removeListener("end",d),f.removeListener("close",d),D.removeListener("close",d)}return f.on("end",d),f.on("close",d),D.on("close",d),D.emit("pipe",f),D}},{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,$,R){(function(M){var g=I("./lib/request"),T=I("./lib/response"),D=I("xtend"),v=I("builtin-status-codes"),f=I("url"),S=R;S.request=function(y,c){typeof y=="string"?y=f.parse(y):y=D(y);var o=M.location.protocol.search(/^https?:$/)===-1?"http:":"",r=y.protocol||o,s=y.hostname||y.host,d=y.port,u=y.path||"/";s&&s.indexOf(":")!==-1&&(s="["+s+"]"),y.url=(s?r+"//"+s:"")+(d?":"+d:"")+u,y.method=(y.method||"GET").toUpperCase(),y.headers=y.headers||{};var p=new g(y);return c&&p.on("response",c),p},S.get=function(c,o){var r=S.request(c,o);return r.end(),r},S.ClientRequest=g,S.IncomingMessage=T.IncomingMessage,S.Agent=function(){},S.Agent.defaultMaxSockets=4,S.globalAgent=new S.Agent,S.STATUS_CODES=v,S.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,$,R){(function(M){"use strict";R.fetch=S(M.fetch)&&S(M.ReadableStream),R.writableStream=S(M.WritableStream),R.abortController=S(M.AbortController),R.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),R.blobConstructor=!0}catch(y){}var g;function T(){if(g!==void 0)return g;if(M.XMLHttpRequest){g=new M.XMLHttpRequest;try{g.open("GET",M.XDomainRequest?"/":"https://example.com")}catch(y){g=null}}else g=null;return g}function D(y){var c=T();if(!c)return!1;try{return c.responseType=y,c.responseType===y}catch(o){}return!1}var v=typeof M.ArrayBuffer!="undefined",f=v&&S(M.ArrayBuffer.prototype.slice);R.arraybuffer=R.fetch||v&&D("arraybuffer"),R.msstream=!R.fetch&&f&&D("ms-stream"),R.mozchunkedarraybuffer=!R.fetch&&v&&D("moz-chunked-arraybuffer"),R.overrideMimeType=R.fetch||(T()?S(T().overrideMimeType):!1),R.vbArray=S(M.VBArray);function S(y){return typeof y=="function"}g=null}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],233:[function(I,$,R){(function(M,g,T){"use strict";var D=I("babel-runtime/core-js/object/keys"),v=f(D);function f(t){return t&&t.__esModule?t:{default:t}}var S=I("./capability"),y=I("inherits"),c=I("./response"),o=I("readable-stream"),r=I("to-arraybuffer"),s=c.IncomingMessage,d=c.readyStates;function u(t,a){return S.fetch&&a?"fetch":S.mozchunkedarraybuffer?"moz-chunked-arraybuffer":S.msstream?"ms-stream":S.arraybuffer&&t?"arraybuffer":S.vbArray&&t?"text:vbarray":"text"}var p=$.exports=function(t){var a=this;o.Writable.call(a),a._opts=t,a._body=[],a._headers={},t.auth&&a.setHeader("Authorization","Basic "+new T(t.auth).toString("base64")),(0,v.default)(t.headers).forEach(function(b){a.setHeader(b,t.headers[b])});var l,E=!0;if(t.mode==="disable-fetch"||"requestTimeout"in t&&!S.abortController)E=!1,l=!0;else if(t.mode==="prefer-streaming")l=!1;else if(t.mode==="allow-wrong-content-type")l=!S.overrideMimeType;else if(!t.mode||t.mode==="default"||t.mode==="prefer-fast")l=!0;else throw new Error("Invalid value for opts.mode");a._mode=u(l,E),a._fetchTimer=null,a.on("finish",function(){a._onFinish()})};y(p,o.Writable),p.prototype.setHeader=function(t,a){var l=this,E=t.toLowerCase();if(i.indexOf(E)!==-1)return;l._headers[E]={name:t,value:a}},p.prototype.getHeader=function(t){var a=this._headers[t.toLowerCase()];return a?a.value:null},p.prototype.removeHeader=function(t){var a=this;delete a._headers[t.toLowerCase()]},p.prototype._onFinish=function(){var t=this;if(t._destroyed)return;var a=t._opts,l=t._headers,E=null;a.method!=="GET"&&a.method!=="HEAD"&&(S.arraybuffer?E=r(T.concat(t._body)):S.blobConstructor?E=new g.Blob(t._body.map(function(C){return r(C)}),{type:(l["content-type"]||{}).value||""}):E=T.concat(t._body).toString());var b=[];if((0,v.default)(l).forEach(function(C){var x=l[C].name,_=l[C].value;Array.isArray(_)?_.forEach(function(j){b.push([x,j])}):b.push([x,_])}),t._mode==="fetch"){var h=null,L=null;if(S.abortController){var O=new AbortController;h=O.signal,t._fetchAbortController=O,"requestTimeout"in a&&a.requestTimeout!==0&&(t._fetchTimer=g.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},a.requestTimeout))}g.fetch(t._opts.url,{method:t._opts.method,headers:b,body:E||void 0,mode:"cors",credentials:a.withCredentials?"include":"same-origin",signal:h}).then(function(C){t._fetchResponse=C,t._connect()},function(C){g.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",C)})}else{var w=t._xhr=new g.XMLHttpRequest;try{w.open(t._opts.method,t._opts.url,!0)}catch(C){M.nextTick(function(){t.emit("error",C)});return}"responseType"in w&&(w.responseType=t._mode.split(":")[0]),"withCredentials"in w&&(w.withCredentials=!!a.withCredentials),t._mode==="text"&&"overrideMimeType"in w&&w.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in a&&(w.timeout=a.requestTimeout,w.ontimeout=function(){t.emit("requestTimeout")}),b.forEach(function(C){w.setRequestHeader(C[0],C[1])}),t._response=null,w.onreadystatechange=function(){switch(w.readyState){case d.LOADING:case d.DONE:t._onXHRProgress();break}},t._mode==="moz-chunked-arraybuffer"&&(w.onprogress=function(){t._onXHRProgress()}),w.onerror=function(){if(t._destroyed)return;t.emit("error",new Error("XHR error"))};try{w.send(E)}catch(C){M.nextTick(function(){t.emit("error",C)});return}}};function m(t){try{var a=t.status;return a!==null&&a!==0}catch(l){return!1}}p.prototype._onXHRProgress=function(){var t=this;if(!m(t._xhr)||t._destroyed)return;t._response||t._connect(),t._response._onXHRProgress()},p.prototype._connect=function(){var t=this;if(t._destroyed)return;t._response=new s(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",function(a){t.emit("error",a)}),t.emit("response",t._response)},p.prototype._write=function(t,a,l){var E=this;E._body.push(t),l()},p.prototype.abort=p.prototype.destroy=function(){var t=this;t._destroyed=!0,g.clearTimeout(t._fetchTimer),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort()},p.prototype.end=function(t,a,l){var E=this;typeof t=="function"&&(l=t,t=void 0),o.Writable.prototype.end.call(E,t,a,l)},p.prototype.flushHeaders=function(){},p.prototype.setTimeout=function(){},p.prototype.setNoDelay=function(){},p.prototype.setSocketKeepAlive=function(){};var i=["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,$,R){(function(M,g,T){"use strict";var D=I("babel-runtime/core-js/promise"),v=f(D);function f(s){return s&&s.__esModule?s:{default:s}}var S=I("./capability"),y=I("inherits"),c=I("readable-stream"),o=R.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},r=R.IncomingMessage=function(s,d,u,p){var m=this;if(c.Readable.call(m),m._mode=u,m.headers={},m.rawHeaders=[],m.trailers={},m.rawTrailers=[],m.on("end",function(){M.nextTick(function(){m.emit("close")})}),u==="fetch"){var i=function h(){a.read().then(function(L){if(m._destroyed)return;if(L.done){g.clearTimeout(p),m.push(null);return}m.push(new T(L.value)),h()}).catch(function(L){g.clearTimeout(p),m._destroyed||m.emit("error",L)})};if(m._fetchResponse=d,m.url=d.url,m.statusCode=d.status,m.statusMessage=d.statusText,d.headers.forEach(function(h,L){m.headers[L.toLowerCase()]=h,m.rawHeaders.push(L,h)}),S.writableStream){var t=new WritableStream({write:function(L){return new v.default(function(O,w){m._destroyed?w():m.push(new T(L))?O():m._resumeFetch=O})},close:function(){g.clearTimeout(p),m._destroyed||m.push(null)},abort:function(L){m._destroyed||m.emit("error",L)}});try{d.body.pipeTo(t).catch(function(h){g.clearTimeout(p),m._destroyed||m.emit("error",h)});return}catch(h){}}var a=d.body.getReader();i()}else{m._xhr=s,m._pos=0,m.url=s.responseURL,m.statusCode=s.status,m.statusMessage=s.statusText;var l=s.getAllResponseHeaders().split(/\r?\n/);if(l.forEach(function(h){var L=h.match(/^([^:]+):\s*(.*)/);if(L){var O=L[1].toLowerCase();O==="set-cookie"?(m.headers[O]===void 0&&(m.headers[O]=[]),m.headers[O].push(L[2])):m.headers[O]!==void 0?m.headers[O]+=", "+L[2]:m.headers[O]=L[2],m.rawHeaders.push(L[1],L[2])}}),m._charset="x-user-defined",!S.overrideMimeType){var E=m.rawHeaders["mime-type"];if(E){var b=E.match(/;\s*charset=([^;])(;|$)/);b&&(m._charset=b[1].toLowerCase())}m._charset||(m._charset="utf-8")}}};y(r,c.Readable),r.prototype._read=function(){var s=this,d=s._resumeFetch;d&&(s._resumeFetch=null,d())},r.prototype._onXHRProgress=function(){var s=this,d=s._xhr,u=null;switch(s._mode){case"text:vbarray":if(d.readyState!==o.DONE)break;try{u=new g.VBArray(d.responseBody).toArray()}catch(a){}if(u!==null){s.push(new T(u));break}case"text":try{u=d.responseText}catch(a){s._mode="text:vbarray";break}if(u.length>s._pos){var p=u.substr(s._pos);if(s._charset==="x-user-defined"){for(var m=new T(p.length),i=0;i<p.length;i++)m[i]=p.charCodeAt(i)&255;s.push(m)}else s.push(p,s._charset);s._pos=u.length}break;case"arraybuffer":if(d.readyState!==o.DONE||!d.response)break;u=d.response,s.push(new T(new Uint8Array(u)));break;case"moz-chunked-arraybuffer":if(u=d.response,d.readyState!==o.LOADING||!u)break;s.push(new T(new Uint8Array(u)));break;case"ms-stream":if(u=d.response,d.readyState!==o.LOADING)break;var t=new g.MSStreamReader;t.onprogress=function(){t.result.byteLength>s._pos&&(s.push(new T(new Uint8Array(t.result.slice(s._pos)))),s._pos=t.result.byteLength)},t.onload=function(){s.push(null)},t.readAsArrayBuffer(u);break}s._xhr.readyState===o.DONE&&s._mode!=="ms-stream"&&s.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,$,R){"use strict";var M=I("safe-buffer").Buffer,g=M.isEncoding||function(t){t=""+t;switch(t&&t.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 T(t){if(!t)return"utf8";for(var a;;)switch(t){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 t;default:if(a)return;t=(""+t).toLowerCase(),a=!0}}function D(t){var a=T(t);if(typeof a!="string"&&(M.isEncoding===g||!g(t)))throw new Error("Unknown encoding: "+t);return a||t}R.StringDecoder=v;function v(t){this.encoding=D(t);var a;switch(this.encoding){case"utf16le":this.text=s,this.end=d,a=4;break;case"utf8":this.fillLast=c,a=4;break;case"base64":this.text=u,this.end=p,a=3;break;default:this.write=m,this.end=i;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=M.allocUnsafe(a)}v.prototype.write=function(t){if(t.length===0)return"";var a,l;if(this.lastNeed){if(a=this.fillLast(t),a===void 0)return"";l=this.lastNeed,this.lastNeed=0}else l=0;return l<t.length?a?a+this.text(t,l):this.text(t,l):a||""},v.prototype.end=r,v.prototype.text=o,v.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function f(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function S(t,a,l){var E=a.length-1;if(E<l)return 0;var b=f(a[E]);return b>=0?(b>0&&(t.lastNeed=b-1),b):--E<l||b===-2?0:(b=f(a[E]),b>=0?(b>0&&(t.lastNeed=b-2),b):--E<l||b===-2?0:(b=f(a[E]),b>=0?(b>0&&(b===2?b=0:t.lastNeed=b-3),b):0))}function y(t,a,l){if((a[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&a.length>1){if((a[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&a.length>2&&(a[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function c(t){var a=this.lastTotal-this.lastNeed,l=y(this,t,a);if(l!==void 0)return l;if(this.lastNeed<=t.length)return t.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,a,0,t.length),this.lastNeed-=t.length}function o(t,a){var l=S(this,t,a);if(!this.lastNeed)return t.toString("utf8",a);this.lastTotal=l;var E=t.length-(l-this.lastNeed);return t.copy(this.lastChar,0,E),t.toString("utf8",a,E)}function r(t){var a=t&&t.length?this.write(t):"";return this.lastNeed?a+"\uFFFD":a}function s(t,a){if((t.length-a)%2===0){var l=t.toString("utf16le",a);if(l){var E=l.charCodeAt(l.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],l.slice(0,-1)}return l}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",a,t.length-1)}function d(t){var a=t&&t.length?this.write(t):"";if(this.lastNeed){var l=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,l)}return a}function u(t,a){var l=(t.length-a)%3;return l===0?t.toString("base64",a):(this.lastNeed=3-l,this.lastTotal=3,l===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",a,t.length-l))}function p(t){var a=t&&t.length?this.write(t):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function m(t){return t.toString(this.encoding)}function i(t){return t&&t.length?this.write(t):""}},{"safe-buffer":228}],236:[function(I,$,R){(function(M,g){var T=I("process/browser.js").nextTick,D=Function.prototype.apply,v=Array.prototype.slice,f={},S=0;R.setTimeout=function(){return new y(D.call(setTimeout,window,arguments),clearTimeout)},R.setInterval=function(){return new y(D.call(setInterval,window,arguments),clearInterval)},R.clearTimeout=R.clearInterval=function(c){c.close()};function y(c,o){this._id=c,this._clearFn=o}y.prototype.unref=y.prototype.ref=function(){},y.prototype.close=function(){this._clearFn.call(window,this._id)},R.enroll=function(c,o){clearTimeout(c._idleTimeoutId),c._idleTimeout=o},R.unenroll=function(c){clearTimeout(c._idleTimeoutId),c._idleTimeout=-1},R._unrefActive=R.active=function(c){clearTimeout(c._idleTimeoutId);var o=c._idleTimeout;o>=0&&(c._idleTimeoutId=setTimeout(function(){c._onTimeout&&c._onTimeout()},o))},R.setImmediate=typeof M=="function"?M:function(c){var o=S++,r=arguments.length<2?!1:v.call(arguments,1);return f[o]=!0,T(function(){f[o]&&(r?c.apply(null,r):c.call(null),R.clearImmediate(o))}),o},R.clearImmediate=typeof g=="function"?g:function(c){delete f[c]}}).call(this,I("timers").setImmediate,I("timers").clearImmediate)},{"process/browser.js":208,timers:236}],237:[function(I,$,R){var M=I("buffer").Buffer;$.exports=function(g){if(g instanceof Uint8Array){if(g.byteOffset===0&&g.byteLength===g.buffer.byteLength)return g.buffer;if(typeof g.buffer.slice=="function")return g.buffer.slice(g.byteOffset,g.byteOffset+g.byteLength)}if(M.isBuffer(g)){for(var T=new Uint8Array(g.length),D=g.length,v=0;v<D;v++)T[v]=g[v];return T.buffer}else throw new Error("Argument must be a Buffer")}},{buffer:73}],238:[function(I,$,R){"use strict";var M=I("punycode"),g=I("./util");R.parse=a,R.resolve=E,R.resolveObject=b,R.format=l,R.Url=T;function T(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var D=/^([a-z0-9.+-]+:)/i,v=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,S=["<",">",'"',"`"," ","\r",`
|
|
|
`," "],y=["{","}","|","\\","^","`"].concat(S),c=["'"].concat(y),o=["%","/","?",";","#"].concat(c),r=["/","?","#"],s=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},i={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},t=I("querystring");function a(h,L,O){if(h&&g.isObject(h)&&h instanceof T)return h;var w=new T;return w.parse(h,L,O),w}T.prototype.parse=function(h,L,O){if(!g.isString(h))throw new TypeError("Parameter 'url' must be a string, not "+typeof h);var w=h.indexOf("?"),C=w!==-1&&w<h.indexOf("#")?"?":"#",x=h.split(C),_=/\\/g;x[0]=x[0].replace(_,"/"),h=x.join(C);var j=h;if(j=j.trim(),!O&&h.split("#").length===1){var N=f.exec(j);if(N)return this.path=j,this.href=j,this.pathname=N[1],N[2]?(this.search=N[2],L?this.query=t.parse(this.search.substr(1)):this.query=this.search.substr(1)):L&&(this.search="",this.query={}),this}var P=D.exec(j);if(P){P=P[0];var V=P.toLowerCase();this.protocol=V,j=j.substr(P.length)}if(O||P||j.match(/^\/\/[^@\/]+@[^@\/]+/)){var z=j.substr(0,2)==="//";z&&!(P&&m[P])&&(j=j.substr(2),this.slashes=!0)}if(!m[P]&&(z||P&&!i[P])){for(var B=-1,K=0;K<r.length;K++){var U=j.indexOf(r[K]);U!==-1&&(B===-1||U<B)&&(B=U)}var W,H;B===-1?H=j.lastIndexOf("@"):H=j.lastIndexOf("@",B),H!==-1&&(W=j.slice(0,H),j=j.slice(H+1),this.auth=decodeURIComponent(W)),B=-1;for(var K=0;K<o.length;K++){var U=j.indexOf(o[K]);U!==-1&&(B===-1||U<B)&&(B=U)}B===-1&&(B=j.length),this.host=j.slice(0,B),j=j.slice(B),this.parseHost(),this.hostname=this.hostname||"";var q=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!q)for(var ne=this.hostname.split(/\./),K=0,te=ne.length;K<te;K++){var _e=ne[K];if(!_e)continue;if(!_e.match(d)){for(var Ce="",me=0,Me=_e.length;me<Me;me++)_e.charCodeAt(me)>127?Ce+="x":Ce+=_e[me];if(!Ce.match(d)){var Oe=ne.slice(0,K),he=ne.slice(K+1),ce=_e.match(u);ce&&(Oe.push(ce[1]),he.unshift(ce[2])),he.length&&(j="/"+he.join(".")+j),this.hostname=Oe.join(".");break}}}this.hostname.length>s?this.hostname="":this.hostname=this.hostname.toLowerCase(),q||(this.hostname=M.toASCII(this.hostname));var se=this.port?":"+this.port:"",Te=this.hostname||"";this.host=Te+se,this.href+=this.host,q&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),j[0]!=="/"&&(j="/"+j))}if(!p[V])for(var K=0,te=c.length;K<te;K++){var re=c[K];if(j.indexOf(re)===-1)continue;var ue=encodeURIComponent(re);ue===re&&(ue=escape(re)),j=j.split(re).join(ue)}var fe=j.indexOf("#");fe!==-1&&(this.hash=j.substr(fe),j=j.slice(0,fe));var ee=j.indexOf("?");if(ee!==-1?(this.search=j.substr(ee),this.query=j.substr(ee+1),L&&(this.query=t.parse(this.query)),j=j.slice(0,ee)):L&&(this.search="",this.query={}),j&&(this.pathname=j),i[V]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var se=this.pathname||"",Q=this.search||"";this.path=se+Q}return this.href=this.format(),this};function l(h){return g.isString(h)&&(h=a(h)),h instanceof T?h.format():T.prototype.format.call(h)}T.prototype.format=function(){var h=this.auth||"";h&&(h=encodeURIComponent(h),h=h.replace(/%3A/i,":"),h+="@");var L=this.protocol||"",O=this.pathname||"",w=this.hash||"",C=!1,x="";this.host?C=h+this.host:this.hostname&&(C=h+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(C+=":"+this.port)),this.query&&g.isObject(this.query)&&Object.keys(this.query).length&&(x=t.stringify(this.query));var _=this.search||x&&"?"+x||"";return L&&L.substr(-1)!==":"&&(L+=":"),this.slashes||(!L||i[L])&&C!==!1?(C="//"+(C||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):C||(C=""),w&&w.charAt(0)!=="#"&&(w="#"+w),_&&_.charAt(0)!=="?"&&(_="?"+_),O=O.replace(/[?#]/g,function(j){return encodeURIComponent(j)}),_=_.replace("#","%23"),L+C+O+_+w};function E(h,L){return a(h,!1,!0).resolve(L)}T.prototype.resolve=function(h){return this.resolveObject(a(h,!1,!0)).format()};function b(h,L){return h?a(h,!1,!0).resolveObject(L):L}T.prototype.resolveObject=function(h){if(g.isString(h)){var L=new T;L.parse(h,!1,!0),h=L}for(var O=new T,w=Object.keys(this),C=0;C<w.length;C++){var x=w[C];O[x]=this[x]}if(O.hash=h.hash,h.href==="")return O.href=O.format(),O;if(h.slashes&&!h.protocol){for(var _=Object.keys(h),j=0;j<_.length;j++){var N=_[j];N!=="protocol"&&(O[N]=h[N])}return i[O.protocol]&&O.hostname&&!O.pathname&&(O.path=O.pathname="/"),O.href=O.format(),O}if(h.protocol&&h.protocol!==O.protocol){if(!i[h.protocol]){for(var P=Object.keys(h),V=0;V<P.length;V++){var z=P[V];O[z]=h[z]}return O.href=O.format(),O}if(O.protocol=h.protocol,!h.host&&!m[h.protocol]){for(var te=(h.pathname||"").split("/");te.length&&!(h.host=te.shift()););h.host||(h.host=""),h.hostname||(h.hostname=""),te[0]!==""&&te.unshift(""),te.length<2&&te.unshift(""),O.pathname=te.join("/")}else O.pathname=h.pathname;if(O.search=h.search,O.query=h.query,O.host=h.host||"",O.auth=h.auth,O.hostname=h.hostname||h.host,O.port=h.port,O.pathname||O.search){var B=O.pathname||"",K=O.search||"";O.path=B+K}return O.slashes=O.slashes||h.slashes,O.href=O.format(),O}var U=O.pathname&&O.pathname.charAt(0)==="/",W=h.host||h.pathname&&h.pathname.charAt(0)==="/",H=W||U||O.host&&h.pathname,q=H,ne=O.pathname&&O.pathname.split("/")||[],te=h.pathname&&h.pathname.split("/")||[],_e=O.protocol&&!i[O.protocol];if(_e&&(O.hostname="",O.port=null,O.host&&(ne[0]===""?ne[0]=O.host:ne.unshift(O.host)),O.host="",h.protocol&&(h.hostname=null,h.port=null,h.host&&(te[0]===""?te[0]=h.host:te.unshift(h.host)),h.host=null),H=H&&(te[0]===""||ne[0]==="")),W)O.host=h.host||h.host===""?h.host:O.host,O.hostname=h.hostname||h.hostname===""?h.hostname:O.hostname,O.search=h.search,O.query=h.query,ne=te;else if(te.length)ne||(ne=[]),ne.pop(),ne=ne.concat(te),O.search=h.search,O.query=h.query;else if(!g.isNullOrUndefined(h.search)){if(_e){O.hostname=O.host=ne.shift();var Ce=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;Ce&&(O.auth=Ce.shift(),O.host=O.hostname=Ce.shift())}return O.search=h.search,O.query=h.query,(!g.isNull(O.pathname)||!g.isNull(O.search))&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!ne.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var me=ne.slice(-1)[0],Me=(O.host||h.host||ne.length>1)&&(me==="."||me==="..")||me==="",Oe=0,he=ne.length;he>=0;he--)me=ne[he],me==="."?ne.splice(he,1):me===".."?(ne.splice(he,1),Oe++):Oe&&(ne.splice(he,1),Oe--);if(!H&&!q)for(;Oe--;Oe)ne.unshift("..");H&&ne[0]!==""&&(!ne[0]||ne[0].charAt(0)!=="/")&&ne.unshift(""),Me&&ne.join("/").substr(-1)!=="/"&&ne.push("");var ce=ne[0]===""||ne[0]&&ne[0].charAt(0)==="/";if(_e){O.hostname=O.host=ce?"":ne.length?ne.shift():"";var Ce=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;Ce&&(O.auth=Ce.shift(),O.host=O.hostname=Ce.shift())}return H=H||O.host&&ne.length,H&&!ce&&ne.unshift(""),ne.length?O.pathname=ne.join("/"):(O.pathname=null,O.path=null),(!g.isNull(O.pathname)||!g.isNull(O.search))&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=h.auth||O.auth,O.slashes=O.slashes||h.slashes,O.href=O.format(),O},T.prototype.parseHost=function(){var h=this.host,L=v.exec(h);L&&(L=L[0],L!==":"&&(this.port=L.substr(1)),h=h.substr(0,h.length-L.length)),h&&(this.hostname=h)}},{"./util":239,punycode:209,querystring:212}],239:[function(I,$,R){"use strict";$.exports={isString:function(M){return typeof M=="string"},isObject:function(M){return typeof M=="object"&&M!==null},isNull:function(M){return M===null},isNullOrUndefined:function(M){return M==null}}},{}],240:[function(I,$,R){(function(M){$.exports=g;function g(D,v){if(T("noDeprecation"))return D;var f=!1;function S(){if(!f){if(T("throwDeprecation"))throw new Error(v);T("traceDeprecation")?console.trace(v):console.warn(v),f=!0}return D.apply(this,arguments)}return S}function T(D){try{if(!M.localStorage)return!1}catch(f){return!1}var v=M.localStorage[D];return v==null?!1:String(v).toLowerCase()==="true"}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],241:[function(I,$,R){typeof Object.create=="function"?$.exports=function(g,T){g.super_=T,g.prototype=Object.create(T.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}})}:$.exports=function(g,T){g.super_=T;var D=function(){};D.prototype=T.prototype,g.prototype=new D,g.prototype.constructor=g}},{}],242:[function(I,$,R){$.exports=function(g){return g&&typeof g=="object"&&typeof g.copy=="function"&&typeof g.fill=="function"&&typeof g.readUInt8=="function"}},{}],243:[function(I,$,R){(function(M,g){var T=/%[sdj%]/g;R.format=function(B){if(!E(B)){for(var K=[],U=0;U<arguments.length;U++)K.push(f(arguments[U]));return K.join(" ")}for(var U=1,W=arguments,H=W.length,q=String(B).replace(T,function(te){if(te==="%%")return"%";if(U>=H)return te;switch(te){case"%s":return String(W[U++]);case"%d":return Number(W[U++]);case"%j":try{return JSON.stringify(W[U++])}catch(_e){return"[Circular]"}default:return te}}),ne=W[U];U<H;ne=W[++U])t(ne)||!O(ne)?q+=" "+ne:q+=" "+f(ne);return q},R.deprecate=function(B,K){if(h(g.process))return function(){return R.deprecate(B,K).apply(this,arguments)};if(M.noDeprecation===!0)return B;var U=!1;function W(){if(!U){if(M.throwDeprecation)throw new Error(K);M.traceDeprecation?console.trace(K):console.error(K),U=!0}return B.apply(this,arguments)}return W};var D={},v;R.debuglog=function(B){if(h(v)&&(v=M.env.NODE_DEBUG||""),B=B.toUpperCase(),!D[B])if(new RegExp("\\b"+B+"\\b","i").test(v)){var K=M.pid;D[B]=function(){var U=R.format.apply(R,arguments);console.error("%s %d: %s",B,K,U)}}else D[B]=function(){};return D[B]};function f(B,K){var U={seen:[],stylize:y};return arguments.length>=3&&(U.depth=arguments[2]),arguments.length>=4&&(U.colors=arguments[3]),i(K)?U.showHidden=K:K&&R._extend(U,K),h(U.showHidden)&&(U.showHidden=!1),h(U.depth)&&(U.depth=2),h(U.colors)&&(U.colors=!1),h(U.customInspect)&&(U.customInspect=!0),U.colors&&(U.stylize=S),o(U,B,U.depth)}R.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function S(B,K){var U=f.styles[K];return U?"["+f.colors[U][0]+"m"+B+"["+f.colors[U][1]+"m":B}function y(B,K){return B}function c(B){var K={};return B.forEach(function(U,W){K[U]=!0}),K}function o(B,K,U){if(B.customInspect&&K&&x(K.inspect)&&K.inspect!==R.inspect&&!(K.constructor&&K.constructor.prototype===K)){var W=K.inspect(U,B);return E(W)||(W=o(B,W,U)),W}var H=r(B,K);if(H)return H;var q=Object.keys(K),ne=c(q);if(B.showHidden&&(q=Object.getOwnPropertyNames(K)),C(K)&&(q.indexOf("message")>=0||q.indexOf("description")>=0))return s(K);if(q.length===0){if(x(K)){var te=K.name?": "+K.name:"";return B.stylize("[Function"+te+"]","special")}if(L(K))return B.stylize(RegExp.prototype.toString.call(K),"regexp");if(w(K))return B.stylize(Date.prototype.toString.call(K),"date");if(C(K))return s(K)}var _e="",Ce=!1,me=["{","}"];if(m(K)&&(Ce=!0,me=["[","]"]),x(K)){var Me=K.name?": "+K.name:"";_e=" [Function"+Me+"]"}if(L(K)&&(_e=" "+RegExp.prototype.toString.call(K)),w(K)&&(_e=" "+Date.prototype.toUTCString.call(K)),C(K)&&(_e=" "+s(K)),q.length===0&&(!Ce||K.length==0))return me[0]+_e+me[1];if(U<0)return L(K)?B.stylize(RegExp.prototype.toString.call(K),"regexp"):B.stylize("[Object]","special");B.seen.push(K);var Oe;return Ce?Oe=d(B,K,U,ne,q):Oe=q.map(function(he){return u(B,K,U,ne,he,Ce)}),B.seen.pop(),p(Oe,_e,me)}function r(B,K){if(h(K))return B.stylize("undefined","undefined");if(E(K)){var U="'"+JSON.stringify(K).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return B.stylize(U,"string")}if(l(K))return B.stylize(""+K,"number");if(i(K))return B.stylize(""+K,"boolean");if(t(K))return B.stylize("null","null")}function s(B){return"["+Error.prototype.toString.call(B)+"]"}function d(B,K,U,W,H){for(var q=[],ne=0,te=K.length;ne<te;++ne)z(K,String(ne))?q.push(u(B,K,U,W,String(ne),!0)):q.push("");return H.forEach(function(_e){_e.match(/^\d+$/)||q.push(u(B,K,U,W,_e,!0))}),q}function u(B,K,U,W,H,q){var ne,te,_e;if(_e=Object.getOwnPropertyDescriptor(K,H)||{value:K[H]},_e.get?_e.set?te=B.stylize("[Getter/Setter]","special"):te=B.stylize("[Getter]","special"):_e.set&&(te=B.stylize("[Setter]","special")),z(W,H)||(ne="["+H+"]"),te||(B.seen.indexOf(_e.value)<0?(t(U)?te=o(B,_e.value,null):te=o(B,_e.value,U-1),te.indexOf(`
|
|
|
`)>-1&&(q?te=te.split(`
|
|
|
`).map(function(Ce){return" "+Ce}).join(`
|
|
|
`).substr(2):te=`
|
|
|
`+te.split(`
|
|
|
`).map(function(Ce){return" "+Ce}).join(`
|
|
|
`))):te=B.stylize("[Circular]","special")),h(ne)){if(q&&H.match(/^\d+$/))return te;ne=JSON.stringify(""+H),ne.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ne=ne.substr(1,ne.length-2),ne=B.stylize(ne,"name")):(ne=ne.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ne=B.stylize(ne,"string"))}return ne+": "+te}function p(B,K,U){var W=0,H=B.reduce(function(q,ne){return W++,ne.indexOf(`
|
|
|
`)>=0&&W++,q+ne.replace(/\u001b\[\d\d?m/g,"").length+1},0);return H>60?U[0]+(K===""?"":K+`
|
|
|
`)+" "+B.join(`,
|
|
|
`)+" "+U[1]:U[0]+K+" "+B.join(", ")+" "+U[1]}function m(B){return Array.isArray(B)}R.isArray=m;function i(B){return typeof B=="boolean"}R.isBoolean=i;function t(B){return B===null}R.isNull=t;function a(B){return B==null}R.isNullOrUndefined=a;function l(B){return typeof B=="number"}R.isNumber=l;function E(B){return typeof B=="string"}R.isString=E;function b(B){return typeof B=="symbol"}R.isSymbol=b;function h(B){return B===void 0}R.isUndefined=h;function L(B){return O(B)&&j(B)==="[object RegExp]"}R.isRegExp=L;function O(B){return typeof B=="object"&&B!==null}R.isObject=O;function w(B){return O(B)&&j(B)==="[object Date]"}R.isDate=w;function C(B){return O(B)&&(j(B)==="[object Error]"||B instanceof Error)}R.isError=C;function x(B){return typeof B=="function"}R.isFunction=x;function _(B){return B===null||typeof B=="boolean"||typeof B=="number"||typeof B=="string"||typeof B=="symbol"||typeof B=="undefined"}R.isPrimitive=_,R.isBuffer=I("./support/isBuffer");function j(B){return Object.prototype.toString.call(B)}function N(B){return B<10?"0"+B.toString(10):B.toString(10)}var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var B=new Date,K=[N(B.getHours()),N(B.getMinutes()),N(B.getSeconds())].join(":");return[B.getDate(),P[B.getMonth()],K].join(" ")}R.log=function(){console.log("%s - %s",V(),R.format.apply(R,arguments))},R.inherits=I("inherits"),R._extend=function(B,K){if(!K||!O(K))return B;for(var U=Object.keys(K),W=U.length;W--;)B[U[W]]=K[U[W]];return B};function z(B,K){return Object.prototype.hasOwnProperty.call(B,K)}}).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,$,R){"use strict";(function(){"use strict";R.stripBOM=function(M){return M[0]==="\uFEFF"?M.substring(1):M}}).call(void 0)},{}],245:[function(I,$,R){"use strict";var M=I("babel-runtime/helpers/typeof"),g=v(M),T=I("babel-runtime/core-js/object/keys"),D=v(T);function v(f){return f&&f.__esModule?f:{default:f}}(function(){"use strict";var f,S,y,c,o,r={}.hasOwnProperty;f=I("xmlbuilder"),S=I("./defaults").defaults,c=function(d){return typeof d=="string"&&(d.indexOf("&")>=0||d.indexOf(">")>=0||d.indexOf("<")>=0)},o=function(d){return"<![CDATA["+y(d)+"]]>"},y=function(d){return d.replace("]]>","]]]]><![CDATA[>")},R.Builder=function(){function s(d){var u,p,m;this.options={},p=S["0.2"];for(u in p){if(!r.call(p,u))continue;m=p[u],this.options[u]=m}for(u in d){if(!r.call(d,u))continue;m=d[u],this.options[u]=m}}return s.prototype.buildObject=function(d){var u,p,m,i,t;return u=this.options.attrkey,p=this.options.charkey,(0,D.default)(d).length===1&&this.options.rootName===S["0.2"].rootName?(t=(0,D.default)(d)[0],d=d[t]):t=this.options.rootName,m=function(a){return function(l,E){var b,h,L,O,w,C;if((typeof E=="undefined"?"undefined":(0,g.default)(E))!=="object")a.options.cdata&&c(E)?l.raw(o(E)):l.txt(E);else if(Array.isArray(E))for(O in E){if(!r.call(E,O))continue;h=E[O];for(w in h)L=h[w],l=m(l.ele(w),L).up()}else for(w in E){if(!r.call(E,w))continue;if(h=E[w],w===u){if((typeof h=="undefined"?"undefined":(0,g.default)(h))==="object")for(b in h)C=h[b],l=l.att(b,C)}else if(w===p)a.options.cdata&&c(h)?l=l.raw(o(h)):l=l.txt(h);else if(Array.isArray(h))for(O in h){if(!r.call(h,O))continue;L=h[O],typeof L=="string"?a.options.cdata&&c(L)?l=l.ele(w).raw(o(L)).up():l=l.ele(w,L).up():l=m(l.ele(w),L).up()}else(typeof h=="undefined"?"undefined":(0,g.default)(h))==="object"?l=m(l.ele(w),h).up():typeof h=="string"&&a.options.cdata&&c(h)?l=l.ele(w).raw(o(h)).up():(h==null&&(h=""),l=l.ele(w,h.toString()).up())}return l}}(this),i=f.create(t,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),m(i,d).end(this.options.renderOpts)},s}()}).call(void 0)},{"./defaults":246,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,xmlbuilder:282}],246:[function(I,$,R){"use strict";(function(){R.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,$,R){"use strict";var M=I("babel-runtime/core-js/promise"),g=c(M),T=I("babel-runtime/core-js/object/get-own-property-names"),D=c(T),v=I("babel-runtime/core-js/object/keys"),f=c(v),S=I("babel-runtime/helpers/typeof"),y=c(S);function c(o){return o&&o.__esModule?o:{default:o}}(function(){"use strict";var o,r,s,d,u,p,m,i,t=function(b,h){return function(){return b.apply(h,arguments)}},a=function(b,h){for(var L in h)l.call(h,L)&&(b[L]=h[L]);function O(){this.constructor=b}return O.prototype=h.prototype,b.prototype=new O,b.__super__=h.prototype,b},l={}.hasOwnProperty;m=I("sax"),s=I("events"),o=I("./bom"),p=I("./processors"),i=I("timers").setImmediate,r=I("./defaults").defaults,d=function(b){return(typeof b=="undefined"?"undefined":(0,y.default)(b))==="object"&&b!=null&&(0,f.default)(b).length===0},u=function(b,h,L){var O,w,C;for(O=0,w=b.length;O<w;O++)C=b[O],h=C(h,L);return h},R.Parser=function(E){a(b,E);function b(h){this.parseStringPromise=t(this.parseStringPromise,this),this.parseString=t(this.parseString,this),this.reset=t(this.reset,this),this.assignOrPush=t(this.assignOrPush,this),this.processAsync=t(this.processAsync,this);var L,O,w;if(!(this instanceof R.Parser))return new R.Parser(h);this.options={},O=r["0.2"];for(L in O){if(!l.call(O,L))continue;w=O[L],this.options[L]=w}for(L in h){if(!l.call(h,L))continue;w=h[L],this.options[L]=w}this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(p.normalize)),this.reset()}return b.prototype.processAsync=function(){var h,L;try{return this.remaining.length<=this.options.chunkSize?(h=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(h),this.saxParser.close()):(h=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(h),i(this.processAsync))}catch(O){if(L=O,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(L)}},b.prototype.assignOrPush=function(h,L,O){return L in h?(h[L]instanceof Array||(h[L]=[h[L]]),h[L].push(O)):this.options.explicitArray?h[L]=[O]:h[L]=O},b.prototype.reset=function(){var h,L,O,w;return this.removeAllListeners(),this.saxParser=m.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(C){return function(x){if(C.saxParser.resume(),!C.saxParser.errThrown)return C.saxParser.errThrown=!0,C.emit("error",x)}}(this),this.saxParser.onend=function(C){return function(){if(!C.saxParser.ended)return C.saxParser.ended=!0,C.emit("end",C.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,w=[],h=this.options.attrkey,L=this.options.charkey,this.saxParser.onopentag=function(C){return function(x){var _,j,N,P,V;if(N={},N[L]="",!C.options.ignoreAttrs){V=x.attributes;for(_ in V){if(!l.call(V,_))continue;!(h in N)&&!C.options.mergeAttrs&&(N[h]={}),j=C.options.attrValueProcessors?u(C.options.attrValueProcessors,x.attributes[_],_):x.attributes[_],P=C.options.attrNameProcessors?u(C.options.attrNameProcessors,_):_,C.options.mergeAttrs?C.assignOrPush(N,P,j):N[h][P]=j}}return N["#name"]=C.options.tagNameProcessors?u(C.options.tagNameProcessors,x.name):x.name,C.options.xmlns&&(N[C.options.xmlnskey]={uri:x.uri,local:x.local}),w.push(N)}}(this),this.saxParser.onclosetag=function(C){return function(){var x,_,j,N,P,V,z,B,K,U;if(V=w.pop(),P=V["#name"],(!C.options.explicitChildren||!C.options.preserveChildrenOrder)&&delete V["#name"],V.cdata===!0&&(x=V.cdata,delete V.cdata),K=w[w.length-1],V[L].match(/^\s*$/)&&!x?(_=V[L],delete V[L]):(C.options.trim&&(V[L]=V[L].trim()),C.options.normalize&&(V[L]=V[L].replace(/\s{2,}/g," ").trim()),V[L]=C.options.valueProcessors?u(C.options.valueProcessors,V[L],P):V[L],(0,f.default)(V).length===1&&L in V&&!C.EXPLICIT_CHARKEY&&(V=V[L])),d(V)&&(V=C.options.emptyTag!==""?C.options.emptyTag:_),C.options.validator!=null&&(U="/"+function(){var W,H,q;for(q=[],W=0,H=w.length;W<H;W++)N=w[W],q.push(N["#name"]);return q}().concat(P).join("/"),function(){var W;try{return V=C.options.validator(U,K&&K[P],V)}catch(H){return W=H,C.emit("error",W)}}()),C.options.explicitChildren&&!C.options.mergeAttrs&&(typeof V=="undefined"?"undefined":(0,y.default)(V))==="object"){if(!C.options.preserveChildrenOrder)N={},C.options.attrkey in V&&(N[C.options.attrkey]=V[C.options.attrkey],delete V[C.options.attrkey]),!C.options.charsAsChildren&&C.options.charkey in V&&(N[C.options.charkey]=V[C.options.charkey],delete V[C.options.charkey]),(0,D.default)(V).length>0&&(N[C.options.childkey]=V),V=N;else if(K){K[C.options.childkey]=K[C.options.childkey]||[],z={};for(j in V){if(!l.call(V,j))continue;z[j]=V[j]}K[C.options.childkey].push(z),delete V["#name"],(0,f.default)(V).length===1&&L in V&&!C.EXPLICIT_CHARKEY&&(V=V[L])}}return w.length>0?C.assignOrPush(K,P,V):(C.options.explicitRoot&&(B=V,V={},V[P]=B),C.resultObject=V,C.saxParser.ended=!0,C.emit("end",C.resultObject))}}(this),O=function(C){return function(x){var _,j;if(j=w[w.length-1],j)return j[L]+=x,C.options.explicitChildren&&C.options.preserveChildrenOrder&&C.options.charsAsChildren&&(C.options.includeWhiteChars||x.replace(/\\n/g,"").trim()!=="")&&(j[C.options.childkey]=j[C.options.childkey]||[],_={"#name":"__text__"},_[L]=x,C.options.normalize&&(_[L]=_[L].replace(/\s{2,}/g," ").trim()),j[C.options.childkey].push(_)),j}}(this),this.saxParser.ontext=O,this.saxParser.oncdata=function(C){return function(x){var _;if(_=O(x),_)return _.cdata=!0}}(this)},b.prototype.parseString=function(h,L){var O;L!=null&&typeof L=="function"&&(this.on("end",function(w){return this.reset(),L(null,w)}),this.on("error",function(w){return this.reset(),L(w)}));try{return h=h.toString(),h.trim()===""?(this.emit("end",null),!0):(h=o.stripBOM(h),this.options.async?(this.remaining=h,i(this.processAsync),this.saxParser):this.saxParser.write(h).close())}catch(w){if(O=w,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw O}else return this.emit("error",O),this.saxParser.errThrown=!0}},b.prototype.parseStringPromise=function(h){return new g.default(function(L){return function(O,w){return L.parseString(h,function(C,x){return C?w(C):O(x)})}}(this))},b}(s),R.parseString=function(E,b,h){var L,O,w;return h!=null?(typeof h=="function"&&(L=h),(typeof b=="undefined"?"undefined":(0,y.default)(b))==="object"&&(O=b)):(typeof b=="function"&&(L=b),O={}),w=new R.Parser(O),w.parseString(E,L)},R.parseStringPromise=function(E,b){var h,L;return(typeof b=="undefined"?"undefined":(0,y.default)(b))==="object"&&(h=b),L=new R.Parser(h),L.parseStringPromise(E)}}).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,$,R){"use strict";(function(){"use strict";var M;M=new RegExp(/(?!xmlns)^.*:/),R.normalize=function(g){return g.toLowerCase()},R.firstCharLowerCase=function(g){return g.charAt(0).toLowerCase()+g.slice(1)},R.stripPrefix=function(g){return g.replace(M,"")},R.parseNumbers=function(g){return isNaN(g)||(g=g%1===0?parseInt(g,10):parseFloat(g)),g},R.parseBooleans=function(g){return/^(?:true|false)$/i.test(g)&&(g=g.toLowerCase()==="true"),g}}).call(void 0)},{}],249:[function(I,$,R){"use strict";(function(){"use strict";var M,g,T,D,v=function(y,c){for(var o in c)f.call(c,o)&&(y[o]=c[o]);function r(){this.constructor=y}return r.prototype=c.prototype,y.prototype=new r,y.__super__=c.prototype,y},f={}.hasOwnProperty;g=I("./defaults"),M=I("./builder"),T=I("./parser"),D=I("./processors"),R.defaults=g.defaults,R.processors=D,R.ValidationError=function(S){v(y,S);function y(c){this.message=c}return y}(Error),R.Builder=M.Builder,R.Parser=T.Parser,R.parseString=T.parseString,R.parseStringPromise=T.parseStringPromise}).call(void 0)},{"./builder":245,"./defaults":246,"./parser":247,"./processors":248}],250:[function(I,$,R){"use strict";(function(){$.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(void 0)},{}],251:[function(I,$,R){"use strict";(function(){$.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,$,R){"use strict";var M=I("babel-runtime/core-js/object/get-prototype-of"),g=S(M),T=I("babel-runtime/helpers/typeof"),D=S(T),v=I("babel-runtime/core-js/object/assign"),f=S(v);function S(y){return y&&y.__esModule?y:{default:y}}(function(){var y,c,o,r,s,d,u,p=[].slice,m={}.hasOwnProperty;y=function(){var t,a,l,E,b,h;if(h=arguments[0],b=2<=arguments.length?p.call(arguments,1):[],s(f.default))f.default.apply(null,arguments);else for(t=0,l=b.length;t<l;t++)if(E=b[t],E!=null)for(a in E){if(!m.call(E,a))continue;h[a]=E[a]}return h},s=function(t){return!!t&&Object.prototype.toString.call(t)==="[object Function]"},d=function(t){var a;return!!t&&((a=typeof t=="undefined"?"undefined":(0,D.default)(t))==="function"||a==="object")},o=function(t){return s(Array.isArray)?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"},r=function(t){var a;if(o(t))return!t.length;for(a in t){if(!m.call(t,a))continue;return!1}return!0},u=function(t){var a,l;return d(t)&&(l=(0,g.default)(t))&&(a=l.constructor)&&typeof a=="function"&&a instanceof a&&Function.prototype.toString.call(a)===Function.prototype.toString.call(Object)},c=function(t){return s(t.valueOf)?t.valueOf():t},$.exports.assign=y,$.exports.isFunction=s,$.exports.isObject=d,$.exports.isArray=o,$.exports.isEmpty=r,$.exports.isPlainObject=u,$.exports.getValue=c}).call(void 0)},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/get-prototype-of":59,"babel-runtime/helpers/typeof":67}],253:[function(I,$,R){"use strict";(function(){$.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(void 0)},{}],254:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f;D=I("./NodeType"),f=I("./XMLNode"),$.exports=v=function(){function S(y,c,o){if(this.parent=y,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),c==null)throw new Error("Missing attribute name. "+this.debugInfo(c));this.name=this.stringify.name(c),this.value=this.stringify.attValue(o),this.type=D.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(S.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(S.prototype,"textContent",{get:function(){return this.value},set:function(c){return this.value=c||""}}),Object.defineProperty(S.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(S.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(S.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(S.prototype,"specified",{get:function(){return!0}}),S.prototype.clone=function(){return(0,g.default)(this)},S.prototype.toString=function(y){return this.options.writer.attribute(this,this.options.writer.filterOptions(y))},S.prototype.debugInfo=function(y){return y=y||this.name,y==null?"parent: <"+this.parent.name+">":"attribute: {"+y+"}, parent: <"+this.parent.name+">"},S.prototype.isEqualNode=function(y){return y.namespaceURI!==this.namespaceURI||(y.prefix!==this.prefix||y.localName!==this.localName)?!1:!(y.value!==this.value)},S}()}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],255:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f,S=function(o,r){for(var s in r)y.call(r,s)&&(o[s]=r[s]);function d(){this.constructor=o}return d.prototype=r.prototype,o.prototype=new d,o.__super__=r.prototype,o},y={}.hasOwnProperty;D=I("./NodeType"),f=I("./XMLCharacterData"),$.exports=v=function(c){S(o,c);function o(r,s){if(o.__super__.constructor.call(this,r),s==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=D.CData,this.value=this.stringify.cdata(s)}return o.prototype.clone=function(){return(0,g.default)(this)},o.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},o}(f)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],256:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f=function(c,o){for(var r in o)S.call(o,r)&&(c[r]=o[r]);function s(){this.constructor=c}return s.prototype=o.prototype,c.prototype=new s,c.__super__=o.prototype,c},S={}.hasOwnProperty;v=I("./XMLNode"),$.exports=D=function(y){f(c,y);function c(o){c.__super__.constructor.call(this,o),this.value=""}return Object.defineProperty(c.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}}),Object.defineProperty(c.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(c.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}}),c.prototype.clone=function(){return(0,g.default)(this)},c.prototype.substringData=function(o,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},c.prototype.appendData=function(o){throw new Error("This DOM method is not implemented."+this.debugInfo())},c.prototype.insertData=function(o,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},c.prototype.deleteData=function(o,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},c.prototype.replaceData=function(o,r,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},c.prototype.isEqualNode=function(o){return c.__super__.isEqualNode.apply(this,arguments).isEqualNode(o)?!(o.data!==this.data):!1},c}(v)}).call(void 0)},{"./XMLNode":273,"babel-runtime/core-js/object/create":55}],257:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f,S=function(o,r){for(var s in r)y.call(r,s)&&(o[s]=r[s]);function d(){this.constructor=o}return d.prototype=r.prototype,o.prototype=new d,o.__super__=r.prototype,o},y={}.hasOwnProperty;D=I("./NodeType"),v=I("./XMLCharacterData"),$.exports=f=function(c){S(o,c);function o(r,s){if(o.__super__.constructor.call(this,r),s==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=D.Comment,this.value=this.stringify.comment(s)}return o.prototype.clone=function(){return(0,g.default)(this)},o.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},o}(v)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],258:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/keys"),g=v(M),T=I("babel-runtime/core-js/object/create"),D=v(T);function v(f){return f&&f.__esModule?f:{default:f}}(function(){var f,S,y;S=I("./XMLDOMErrorHandler"),y=I("./XMLDOMStringList"),$.exports=f=function(){function c(){var o;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new S,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=o=(0,D.default)(this.defaultParams)}return Object.defineProperty(c.prototype,"parameterNames",{get:function(){return new y((0,g.default)(this.defaultParams))}}),c.prototype.getParameter=function(o){return this.params.hasOwnProperty(o)?this.params[o]:null},c.prototype.canSetParameter=function(o,r){return!0},c.prototype.setParameter=function(o,r){return r!=null?this.params[o]=r:delete this.params[o]},c}()}).call(void 0)},{"./XMLDOMErrorHandler":259,"./XMLDOMStringList":261,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60}],259:[function(I,$,R){"use strict";(function(){var M;$.exports=M=function(){function g(){}return g.prototype.handleError=function(T){throw new Error(T)},g}()}).call(void 0)},{}],260:[function(I,$,R){"use strict";(function(){var M;$.exports=M=function(){function g(){}return g.prototype.hasFeature=function(T,D){return!0},g.prototype.createDocumentType=function(T,D,v){throw new Error("This DOM method is not implemented.")},g.prototype.createDocument=function(T,D,v){throw new Error("This DOM method is not implemented.")},g.prototype.createHTMLDocument=function(T){throw new Error("This DOM method is not implemented.")},g.prototype.getFeature=function(T,D){throw new Error("This DOM method is not implemented.")},g}()}).call(void 0)},{}],261:[function(I,$,R){"use strict";(function(){var M;$.exports=M=function(){function g(T){this.arr=T||[]}return Object.defineProperty(g.prototype,"length",{get:function(){return this.arr.length}}),g.prototype.item=function(T){return this.arr[T]||null},g.prototype.contains=function(T){return this.arr.indexOf(T)!==-1},g}()}).call(void 0)},{}],262:[function(I,$,R){"use strict";(function(){var M,g,T,D=function(S,y){for(var c in y)v.call(y,c)&&(S[c]=y[c]);function o(){this.constructor=S}return o.prototype=y.prototype,S.prototype=new o,S.__super__=y.prototype,S},v={}.hasOwnProperty;T=I("./XMLNode"),M=I("./NodeType"),$.exports=g=function(f){D(S,f);function S(y,c,o,r,s,d){if(S.__super__.constructor.call(this,y),c==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(o==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(c));if(!r)throw new Error("Missing DTD attribute type. "+this.debugInfo(c));if(!s)throw new Error("Missing DTD attribute default. "+this.debugInfo(c));if(s.indexOf("#")!==0&&(s="#"+s),!s.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(c));if(d&&!s.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(c));this.elementName=this.stringify.name(c),this.type=M.AttributeDeclaration,this.attributeName=this.stringify.name(o),this.attributeType=this.stringify.dtdAttType(r),d&&(this.defaultValue=this.stringify.dtdAttDefault(d)),this.defaultValueType=s}return S.prototype.toString=function(y){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(y))},S}(T)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],263:[function(I,$,R){"use strict";(function(){var M,g,T,D=function(S,y){for(var c in y)v.call(y,c)&&(S[c]=y[c]);function o(){this.constructor=S}return o.prototype=y.prototype,S.prototype=new o,S.__super__=y.prototype,S},v={}.hasOwnProperty;T=I("./XMLNode"),M=I("./NodeType"),$.exports=g=function(f){D(S,f);function S(y,c,o){if(S.__super__.constructor.call(this,y),c==null)throw new Error("Missing DTD element name. "+this.debugInfo());o||(o="(#PCDATA)"),Array.isArray(o)&&(o="("+o.join(",")+")"),this.name=this.stringify.name(c),this.type=M.ElementDeclaration,this.value=this.stringify.dtdElementValue(o)}return S.prototype.toString=function(y){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(y))},S}(T)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],264:[function(I,$,R){"use strict";(function(){var M,g,T,D,v=function(y,c){for(var o in c)f.call(c,o)&&(y[o]=c[o]);function r(){this.constructor=y}return r.prototype=c.prototype,y.prototype=new r,y.__super__=c.prototype,y},f={}.hasOwnProperty;D=I("./Utility").isObject,T=I("./XMLNode"),M=I("./NodeType"),$.exports=g=function(S){v(y,S);function y(c,o,r,s){if(y.__super__.constructor.call(this,c),r==null)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(s==null)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!o,this.name=this.stringify.name(r),this.type=M.EntityDeclaration,!D(s))this.value=this.stringify.dtdEntityValue(s),this.internal=!0;else{if(!s.pubID&&!s.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(s.pubID&&!s.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(this.internal=!1,s.pubID!=null&&(this.pubID=this.stringify.dtdPubID(s.pubID)),s.sysID!=null&&(this.sysID=this.stringify.dtdSysID(s.sysID)),s.nData!=null&&(this.nData=this.stringify.dtdNData(s.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}}return Object.defineProperty(y.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(y.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(y.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(y.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(y.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(y.prototype,"xmlVersion",{get:function(){return null}}),y.prototype.toString=function(c){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(c))},y}(T)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],265:[function(I,$,R){"use strict";(function(){var M,g,T,D=function(S,y){for(var c in y)v.call(y,c)&&(S[c]=y[c]);function o(){this.constructor=S}return o.prototype=y.prototype,S.prototype=new o,S.__super__=y.prototype,S},v={}.hasOwnProperty;T=I("./XMLNode"),M=I("./NodeType"),$.exports=g=function(f){D(S,f);function S(y,c,o){if(S.__super__.constructor.call(this,y),c==null)throw new Error("Missing DTD notation name. "+this.debugInfo(c));if(!o.pubID&&!o.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(c));this.name=this.stringify.name(c),this.type=M.NotationDeclaration,o.pubID!=null&&(this.pubID=this.stringify.dtdPubID(o.pubID)),o.sysID!=null&&(this.sysID=this.stringify.dtdSysID(o.sysID))}return Object.defineProperty(S.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(S.prototype,"systemId",{get:function(){return this.sysID}}),S.prototype.toString=function(y){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(y))},S}(T)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],266:[function(I,$,R){"use strict";(function(){var M,g,T,D,v=function(y,c){for(var o in c)f.call(c,o)&&(y[o]=c[o]);function r(){this.constructor=y}return r.prototype=c.prototype,y.prototype=new r,y.__super__=c.prototype,y},f={}.hasOwnProperty;D=I("./Utility").isObject,T=I("./XMLNode"),M=I("./NodeType"),$.exports=g=function(S){v(y,S);function y(c,o,r,s){var d;y.__super__.constructor.call(this,c),D(o)&&(d=o,o=d.version,r=d.encoding,s=d.standalone),o||(o="1.0"),this.type=M.Declaration,this.version=this.stringify.xmlVersion(o),r!=null&&(this.encoding=this.stringify.xmlEncoding(r)),s!=null&&(this.standalone=this.stringify.xmlStandalone(s))}return y.prototype.toString=function(c){return this.options.writer.declaration(this,this.options.writer.filterOptions(c))},y}(T)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],267:[function(I,$,R){"use strict";(function(){var M,g,T,D,v,f,S,y,c,o=function(d,u){for(var p in u)r.call(u,p)&&(d[p]=u[p]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},r={}.hasOwnProperty;c=I("./Utility").isObject,y=I("./XMLNode"),M=I("./NodeType"),g=I("./XMLDTDAttList"),D=I("./XMLDTDEntity"),T=I("./XMLDTDElement"),v=I("./XMLDTDNotation"),S=I("./XMLNamedNodeMap"),$.exports=f=function(s){o(d,s);function d(u,p,m){var i,t,a,l,E,b;if(d.__super__.constructor.call(this,u),this.type=M.DocType,u.children){for(l=u.children,t=0,a=l.length;t<a;t++)if(i=l[t],i.type===M.Element){this.name=i.name;break}}this.documentObject=u,c(p)&&(E=p,p=E.pubID,m=E.sysID),m==null&&(b=[p,m],m=b[0],p=b[1]),p!=null&&(this.pubID=this.stringify.dtdPubID(p)),m!=null&&(this.sysID=this.stringify.dtdSysID(m))}return Object.defineProperty(d.prototype,"entities",{get:function(){var p,m,i,t,a;for(t={},a=this.children,m=0,i=a.length;m<i;m++)p=a[m],p.type===M.EntityDeclaration&&!p.pe&&(t[p.name]=p);return new S(t)}}),Object.defineProperty(d.prototype,"notations",{get:function(){var p,m,i,t,a;for(t={},a=this.children,m=0,i=a.length;m<i;m++)p=a[m],p.type===M.NotationDeclaration&&(t[p.name]=p);return new S(t)}}),Object.defineProperty(d.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(d.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(d.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),d.prototype.element=function(u,p){var m;return m=new T(this,u,p),this.children.push(m),this},d.prototype.attList=function(u,p,m,i,t){var a;return a=new g(this,u,p,m,i,t),this.children.push(a),this},d.prototype.entity=function(u,p){var m;return m=new D(this,!1,u,p),this.children.push(m),this},d.prototype.pEntity=function(u,p){var m;return m=new D(this,!0,u,p),this.children.push(m),this},d.prototype.notation=function(u,p){var m;return m=new v(this,u,p),this.children.push(m),this},d.prototype.toString=function(u){return this.options.writer.docType(this,this.options.writer.filterOptions(u))},d.prototype.ele=function(u,p){return this.element(u,p)},d.prototype.att=function(u,p,m,i,t){return this.attList(u,p,m,i,t)},d.prototype.ent=function(u,p){return this.entity(u,p)},d.prototype.pent=function(u,p){return this.pEntity(u,p)},d.prototype.not=function(u,p){return this.notation(u,p)},d.prototype.up=function(){return this.root()||this.documentObject},d.prototype.isEqualNode=function(u){return d.__super__.isEqualNode.apply(this,arguments).isEqualNode(u)?u.name!==this.name||u.publicId!==this.publicId?!1:!(u.systemId!==this.systemId):!1},d}(y)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLNamedNodeMap":272,"./XMLNode":273}],268:[function(I,$,R){"use strict";(function(){var M,g,T,D,v,f,S,y,c=function(s,d){for(var u in d)o.call(d,u)&&(s[u]=d[u]);function p(){this.constructor=s}return p.prototype=d.prototype,s.prototype=new p,s.__super__=d.prototype,s},o={}.hasOwnProperty;y=I("./Utility").isPlainObject,T=I("./XMLDOMImplementation"),g=I("./XMLDOMConfiguration"),v=I("./XMLNode"),M=I("./NodeType"),S=I("./XMLStringifier"),f=I("./XMLStringWriter"),$.exports=D=function(r){c(s,r);function s(d){s.__super__.constructor.call(this,null),this.name="#document",this.type=M.Document,this.documentURI=null,this.domConfig=new g,d||(d={}),d.writer||(d.writer=new f),this.options=d,this.stringify=new S(d)}return Object.defineProperty(s.prototype,"implementation",{value:new T}),Object.defineProperty(s.prototype,"doctype",{get:function(){var u,p,m,i;for(i=this.children,p=0,m=i.length;p<m;p++)if(u=i[p],u.type===M.DocType)return u;return null}}),Object.defineProperty(s.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(s.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(s.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(s.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===M.Declaration?this.children[0].encoding:null}}),Object.defineProperty(s.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===M.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(s.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===M.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(s.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(s.prototype,"origin",{get:function(){return null}}),Object.defineProperty(s.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(s.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(s.prototype,"contentType",{get:function(){return null}}),s.prototype.end=function(d){var u;return u={},d?y(d)&&(u=d,d=this.options.writer):d=this.options.writer,d.document(this,d.filterOptions(u))},s.prototype.toString=function(d){return this.options.writer.document(this,this.options.writer.filterOptions(d))},s.prototype.createElement=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createTextNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createComment=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createCDATASection=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createProcessingInstruction=function(d,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createAttribute=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createEntityReference=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.importNode=function(d,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createElementNS=function(d,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createAttributeNS=function(d,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementsByTagNameNS=function(d,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementById=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.adoptNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.renameNode=function(d,u,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementsByClassName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createEvent=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createNodeIterator=function(d,u,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.createTreeWalker=function(d,u,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},s}(v)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDOMConfiguration":258,"./XMLDOMImplementation":260,"./XMLNode":273,"./XMLStringWriter":278,"./XMLStringifier":279}],269:[function(I,$,R){"use strict";(function(){var M,g,T,D,v,f,S,y,c,o,r,s,d,u,p,m,i,t,a,l,E,b,h,L,O={}.hasOwnProperty;L=I("./Utility"),b=L.isObject,E=L.isFunction,h=L.isPlainObject,l=L.getValue,M=I("./NodeType"),s=I("./XMLDocument"),u=I("./XMLElement"),D=I("./XMLCData"),v=I("./XMLComment"),m=I("./XMLRaw"),a=I("./XMLText"),p=I("./XMLProcessingInstruction"),o=I("./XMLDeclaration"),r=I("./XMLDocType"),f=I("./XMLDTDAttList"),y=I("./XMLDTDEntity"),S=I("./XMLDTDElement"),c=I("./XMLDTDNotation"),T=I("./XMLAttribute"),t=I("./XMLStringifier"),i=I("./XMLStringWriter"),g=I("./WriterState"),$.exports=d=function(){function w(C,x,_){var j;this.name="?xml",this.type=M.Document,C||(C={}),j={},C.writer?h(C.writer)&&(j=C.writer,C.writer=new i):C.writer=new i,this.options=C,this.writer=C.writer,this.writerOptions=this.writer.filterOptions(j),this.stringify=new t(C),this.onDataCallback=x||function(){},this.onEndCallback=_||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return w.prototype.createChildNode=function(C){var x,_,j,N,P,V,z,B;switch(C.type){case M.CData:this.cdata(C.value);break;case M.Comment:this.comment(C.value);break;case M.Element:j={},z=C.attribs;for(_ in z){if(!O.call(z,_))continue;x=z[_],j[_]=x.value}this.node(C.name,j);break;case M.Dummy:this.dummy();break;case M.Raw:this.raw(C.value);break;case M.Text:this.text(C.value);break;case M.ProcessingInstruction:this.instruction(C.target,C.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+C.constructor.name)}for(B=C.children,P=0,V=B.length;P<V;P++)N=B[P],this.createChildNode(N),N.type===M.Element&&this.up();return this},w.prototype.dummy=function(){return this},w.prototype.node=function(C,x,_){var j;if(C==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(C));return this.openCurrent(),C=l(C),x==null&&(x={}),x=l(x),b(x)||(j=[x,_],_=j[0],x=j[1]),this.currentNode=new u(this,C,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,_!=null&&this.text(_),this},w.prototype.element=function(C,x,_){var j,N,P,V,z,B;if(this.currentNode&&this.currentNode.type===M.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(C)||b(C)||E(C))for(V=this.options.noValidation,this.options.noValidation=!0,B=new s(this.options).element("TEMP_ROOT"),B.element(C),this.options.noValidation=V,z=B.children,N=0,P=z.length;N<P;N++)j=z[N],this.createChildNode(j),j.type===M.Element&&this.up();else this.node(C,x,_);return this},w.prototype.attribute=function(C,x){var _,j;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(C));if(C!=null&&(C=l(C)),b(C))for(_ in C){if(!O.call(C,_))continue;j=C[_],this.attribute(_,j)}else E(x)&&(x=x.apply()),this.options.keepNullAttributes&&x==null?this.currentNode.attribs[C]=new T(this,C,""):x!=null&&(this.currentNode.attribs[C]=new T(this,C,x));return this},w.prototype.text=function(C){var x;return this.openCurrent(),x=new a(this,C),this.onData(this.writer.text(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.cdata=function(C){var x;return this.openCurrent(),x=new D(this,C),this.onData(this.writer.cdata(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.comment=function(C){var x;return this.openCurrent(),x=new v(this,C),this.onData(this.writer.comment(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.raw=function(C){var x;return this.openCurrent(),x=new m(this,C),this.onData(this.writer.raw(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.instruction=function(C,x){var _,j,N,P,V;if(this.openCurrent(),C!=null&&(C=l(C)),x!=null&&(x=l(x)),Array.isArray(C))for(_=0,P=C.length;_<P;_++)j=C[_],this.instruction(j);else if(b(C))for(j in C){if(!O.call(C,j))continue;N=C[j],this.instruction(j,N)}else E(x)&&(x=x.apply()),V=new p(this,C,x),this.onData(this.writer.processingInstruction(V,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},w.prototype.declaration=function(C,x,_){var j;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return j=new o(this,C,x,_),this.onData(this.writer.declaration(j,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.doctype=function(C,x,_){if(this.openCurrent(),C==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new r(this,x,_),this.currentNode.rootNodeName=C,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},w.prototype.dtdElement=function(C,x){var _;return this.openCurrent(),_=new S(this,C,x),this.onData(this.writer.dtdElement(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.attList=function(C,x,_,j,N){var P;return this.openCurrent(),P=new f(this,C,x,_,j,N),this.onData(this.writer.dtdAttList(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.entity=function(C,x){var _;return this.openCurrent(),_=new y(this,!1,C,x),this.onData(this.writer.dtdEntity(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.pEntity=function(C,x){var _;return this.openCurrent(),_=new y(this,!0,C,x),this.onData(this.writer.dtdEntity(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.notation=function(C,x){var _;return this.openCurrent(),_=new c(this,C,x),this.onData(this.writer.dtdNotation(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},w.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},w.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},w.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},w.prototype.openNode=function(C){var x,_,j,N;if(!C.isOpen){if(!this.root&&this.currentLevel===0&&C.type===M.Element&&(this.root=C),_="",C.type===M.Element){this.writerOptions.state=g.OpenTag,_=this.writer.indent(C,this.writerOptions,this.currentLevel)+"<"+C.name,N=C.attribs;for(j in N){if(!O.call(N,j))continue;x=N[j],_+=this.writer.attribute(x,this.writerOptions,this.currentLevel)}_+=(C.children?">":"/>")+this.writer.endline(C,this.writerOptions,this.currentLevel),this.writerOptions.state=g.InsideTag}else this.writerOptions.state=g.OpenTag,_=this.writer.indent(C,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+C.rootNodeName,C.pubID&&C.sysID?_+=' PUBLIC "'+C.pubID+'" "'+C.sysID+'"':C.sysID&&(_+=' SYSTEM "'+C.sysID+'"'),C.children?(_+=" [",this.writerOptions.state=g.InsideTag):(this.writerOptions.state=g.CloseTag,_+=">"),_+=this.writer.endline(C,this.writerOptions,this.currentLevel);return this.onData(_,this.currentLevel),C.isOpen=!0}},w.prototype.closeNode=function(C){var x;if(!C.isClosed)return x="",this.writerOptions.state=g.CloseTag,C.type===M.Element?x=this.writer.indent(C,this.writerOptions,this.currentLevel)+"</"+C.name+">"+this.writer.endline(C,this.writerOptions,this.currentLevel):x=this.writer.indent(C,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(C,this.writerOptions,this.currentLevel),this.writerOptions.state=g.None,this.onData(x,this.currentLevel),C.isClosed=!0},w.prototype.onData=function(C,x){return this.documentStarted=!0,this.onDataCallback(C,x+1)},w.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},w.prototype.debugInfo=function(C){return C==null?"":"node: <"+C+">"},w.prototype.ele=function(){return this.element.apply(this,arguments)},w.prototype.nod=function(C,x,_){return this.node(C,x,_)},w.prototype.txt=function(C){return this.text(C)},w.prototype.dat=function(C){return this.cdata(C)},w.prototype.com=function(C){return this.comment(C)},w.prototype.ins=function(C,x){return this.instruction(C,x)},w.prototype.dec=function(C,x,_){return this.declaration(C,x,_)},w.prototype.dtd=function(C,x,_){return this.doctype(C,x,_)},w.prototype.e=function(C,x,_){return this.element(C,x,_)},w.prototype.n=function(C,x,_){return this.node(C,x,_)},w.prototype.t=function(C){return this.text(C)},w.prototype.d=function(C){return this.cdata(C)},w.prototype.c=function(C){return this.comment(C)},w.prototype.r=function(C){return this.raw(C)},w.prototype.i=function(C,x){return this.instruction(C,x)},w.prototype.att=function(){return this.currentNode&&this.currentNode.type===M.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},w.prototype.a=function(){return this.currentNode&&this.currentNode.type===M.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},w.prototype.ent=function(C,x){return this.entity(C,x)},w.prototype.pent=function(C,x){return this.pEntity(C,x)},w.prototype.not=function(C,x){return this.notation(C,x)},w}()}).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,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f,S=function(o,r){for(var s in r)y.call(r,s)&&(o[s]=r[s]);function d(){this.constructor=o}return d.prototype=r.prototype,o.prototype=new d,o.__super__=r.prototype,o},y={}.hasOwnProperty;f=I("./XMLNode"),D=I("./NodeType"),$.exports=v=function(c){S(o,c);function o(r){o.__super__.constructor.call(this,r),this.type=D.Dummy}return o.prototype.clone=function(){return(0,g.default)(this)},o.prototype.toString=function(r){return""},o}(f)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],271:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f,S,y,c,o,r,s,d=function(m,i){for(var t in i)u.call(i,t)&&(m[t]=i[t]);function a(){this.constructor=m}return a.prototype=i.prototype,m.prototype=new a,m.__super__=i.prototype,m},u={}.hasOwnProperty;s=I("./Utility"),r=s.isObject,o=s.isFunction,c=s.getValue,y=I("./XMLNode"),D=I("./NodeType"),v=I("./XMLAttribute"),S=I("./XMLNamedNodeMap"),$.exports=f=function(p){d(m,p);function m(i,t,a){var l,E,b,h;if(m.__super__.constructor.call(this,i),t==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(t),this.type=D.Element,this.attribs={},this.schemaTypeInfo=null,a!=null&&this.attribute(a),i.type===D.Document&&(this.isRoot=!0,this.documentObject=i,i.rootObject=this,i.children)){for(h=i.children,E=0,b=h.length;E<b;E++)if(l=h[E],l.type===D.DocType){l.name=this.name;break}}}return Object.defineProperty(m.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(m.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(m.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(m.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(m.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(m.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(m.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(m.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new S(this.attribs)),this.attributeMap}}),m.prototype.clone=function(){var i,t,a,l;a=(0,g.default)(this),a.isRoot&&(a.documentObject=null),a.attribs={},l=this.attribs;for(t in l){if(!u.call(l,t))continue;i=l[t],a.attribs[t]=i.clone()}return a.children=[],this.children.forEach(function(E){var b;return b=E.clone(),b.parent=a,a.children.push(b)}),a},m.prototype.attribute=function(i,t){var a,l;if(i!=null&&(i=c(i)),r(i))for(a in i){if(!u.call(i,a))continue;l=i[a],this.attribute(a,l)}else o(t)&&(t=t.apply()),this.options.keepNullAttributes&&t==null?this.attribs[i]=new v(this,i,""):t!=null&&(this.attribs[i]=new v(this,i,t));return this},m.prototype.removeAttribute=function(i){var t,a,l;if(i==null)throw new Error("Missing attribute name. "+this.debugInfo());if(i=c(i),Array.isArray(i))for(a=0,l=i.length;a<l;a++)t=i[a],delete this.attribs[t];else delete this.attribs[i];return this},m.prototype.toString=function(i){return this.options.writer.element(this,this.options.writer.filterOptions(i))},m.prototype.att=function(i,t){return this.attribute(i,t)},m.prototype.a=function(i,t){return this.attribute(i,t)},m.prototype.getAttribute=function(i){return this.attribs.hasOwnProperty(i)?this.attribs[i].value:null},m.prototype.setAttribute=function(i,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getAttributeNode=function(i){return this.attribs.hasOwnProperty(i)?this.attribs[i]:null},m.prototype.setAttributeNode=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.removeAttributeNode=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getAttributeNS=function(i,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.setAttributeNS=function(i,t,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.removeAttributeNS=function(i,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getAttributeNodeNS=function(i,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.setAttributeNodeNS=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(i,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.hasAttribute=function(i){return this.attribs.hasOwnProperty(i)},m.prototype.hasAttributeNS=function(i,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.setIdAttribute=function(i,t){return this.attribs.hasOwnProperty(i)?this.attribs[i].isId:t},m.prototype.setIdAttributeNS=function(i,t,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.setIdAttributeNode=function(i,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(i,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.isEqualNode=function(i){var t,a,l;if(!m.__super__.isEqualNode.apply(this,arguments).isEqualNode(i))return!1;if(i.namespaceURI!==this.namespaceURI)return!1;if(i.prefix!==this.prefix)return!1;if(i.localName!==this.localName)return!1;if(i.attribs.length!==this.attribs.length)return!1;for(t=a=0,l=this.attribs.length-1;0<=l?a<=l:a>=l;t=0<=l?++a:--a)if(!this.attribs[t].isEqualNode(i.attribs[t]))return!1;return!0},m}(y)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLAttribute":254,"./XMLNamedNodeMap":272,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],272:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/keys"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D;$.exports=D=function(){function v(f){this.nodes=f}return Object.defineProperty(v.prototype,"length",{get:function(){return(0,g.default)(this.nodes).length||0}}),v.prototype.clone=function(){return this.nodes=null},v.prototype.getNamedItem=function(f){return this.nodes[f]},v.prototype.setNamedItem=function(f){var S;return S=this.nodes[f.nodeName],this.nodes[f.nodeName]=f,S||null},v.prototype.removeNamedItem=function(f){var S;return S=this.nodes[f],delete this.nodes[f],S||null},v.prototype.item=function(f){return this.nodes[(0,g.default)(this.nodes)[f]]||null},v.prototype.getNamedItemNS=function(f,S){throw new Error("This DOM method is not implemented.")},v.prototype.setNamedItemNS=function(f){throw new Error("This DOM method is not implemented.")},v.prototype.removeNamedItemNS=function(f,S){throw new Error("This DOM method is not implemented.")},v}()}).call(void 0)},{"babel-runtime/core-js/object/keys":60}],273:[function(I,$,R){"use strict";(function(){var M,g,T,D,v,f,S,y,c,o,r,s,d,u,p,m,i,t,a,l={}.hasOwnProperty;a=I("./Utility"),t=a.isObject,i=a.isFunction,m=a.isEmpty,p=a.getValue,y=null,T=null,D=null,v=null,f=null,d=null,u=null,s=null,S=null,g=null,r=null,c=null,M=null,$.exports=o=function(){function E(b){this.parent=b,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,y||(y=I("./XMLElement"),T=I("./XMLCData"),D=I("./XMLComment"),v=I("./XMLDeclaration"),f=I("./XMLDocType"),d=I("./XMLRaw"),u=I("./XMLText"),s=I("./XMLProcessingInstruction"),S=I("./XMLDummy"),g=I("./NodeType"),r=I("./XMLNodeList"),c=I("./XMLNamedNodeMap"),M=I("./DocumentPosition"))}return Object.defineProperty(E.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(E.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(E.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(E.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(E.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new r(this.children)),this.childNodeList}}),Object.defineProperty(E.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(E.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(E.prototype,"previousSibling",{get:function(){var h;return h=this.parent.children.indexOf(this),this.parent.children[h-1]||null}}),Object.defineProperty(E.prototype,"nextSibling",{get:function(){var h;return h=this.parent.children.indexOf(this),this.parent.children[h+1]||null}}),Object.defineProperty(E.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(E.prototype,"textContent",{get:function(){var h,L,O,w,C;if(this.nodeType===g.Element||this.nodeType===g.DocumentFragment){for(C="",w=this.children,L=0,O=w.length;L<O;L++)h=w[L],h.textContent&&(C+=h.textContent);return C}else return null},set:function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),E.prototype.setParent=function(b){var h,L,O,w,C;for(this.parent=b,b&&(this.options=b.options,this.stringify=b.stringify),w=this.children,C=[],L=0,O=w.length;L<O;L++)h=w[L],C.push(h.setParent(this));return C},E.prototype.element=function(b,h,L){var O,w,C,x,_,j,N,P,V,z,B;if(j=null,h===null&&L==null&&(V=[{},null],h=V[0],L=V[1]),h==null&&(h={}),h=p(h),t(h)||(z=[h,L],L=z[0],h=z[1]),b!=null&&(b=p(b)),Array.isArray(b))for(C=0,N=b.length;C<N;C++)w=b[C],j=this.element(w);else if(i(b))j=this.element(b.apply());else if(t(b))for(_ in b){if(!l.call(b,_))continue;if(B=b[_],i(B)&&(B=B.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&_.indexOf(this.stringify.convertAttKey)===0)j=this.attribute(_.substr(this.stringify.convertAttKey.length),B);else if(!this.options.separateArrayItems&&Array.isArray(B)&&m(B))j=this.dummy();else if(t(B)&&m(B))j=this.element(_);else if(!this.options.keepNullNodes&&B==null)j=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(B))for(x=0,P=B.length;x<P;x++)w=B[x],O={},O[_]=w,j=this.element(O);else t(B)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&_.indexOf(this.stringify.convertTextKey)===0?j=this.element(B):(j=this.element(_),j.element(B)):j=this.element(_,B)}else!this.options.keepNullNodes&&L===null?j=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&b.indexOf(this.stringify.convertTextKey)===0?j=this.text(L):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&b.indexOf(this.stringify.convertCDataKey)===0?j=this.cdata(L):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&b.indexOf(this.stringify.convertCommentKey)===0?j=this.comment(L):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&b.indexOf(this.stringify.convertRawKey)===0?j=this.raw(L):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&b.indexOf(this.stringify.convertPIKey)===0?j=this.instruction(b.substr(this.stringify.convertPIKey.length),L):j=this.node(b,h,L);if(j==null)throw new Error("Could not create any elements with: "+b+". "+this.debugInfo());return j},E.prototype.insertBefore=function(b,h,L){var O,w,C,x,_;if(b!=null?b.type:void 0)return C=b,x=h,C.setParent(this),x?(w=children.indexOf(x),_=children.splice(w),children.push(C),Array.prototype.push.apply(children,_)):children.push(C),C;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(b));return w=this.parent.children.indexOf(this),_=this.parent.children.splice(w),O=this.parent.element(b,h,L),Array.prototype.push.apply(this.parent.children,_),O},E.prototype.insertAfter=function(b,h,L){var O,w,C;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(b));return w=this.parent.children.indexOf(this),C=this.parent.children.splice(w+1),O=this.parent.element(b,h,L),Array.prototype.push.apply(this.parent.children,C),O},E.prototype.remove=function(){var b,h;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return b=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[b,b-b+1].concat(h=[])),this.parent},E.prototype.node=function(b,h,L){var O,w;return b!=null&&(b=p(b)),h||(h={}),h=p(h),t(h)||(w=[h,L],L=w[0],h=w[1]),O=new y(this,b,h),L!=null&&O.text(L),this.children.push(O),O},E.prototype.text=function(b){var h;return t(b)&&this.element(b),h=new u(this,b),this.children.push(h),this},E.prototype.cdata=function(b){var h;return h=new T(this,b),this.children.push(h),this},E.prototype.comment=function(b){var h;return h=new D(this,b),this.children.push(h),this},E.prototype.commentBefore=function(b){var h,L,O;return L=this.parent.children.indexOf(this),O=this.parent.children.splice(L),h=this.parent.comment(b),Array.prototype.push.apply(this.parent.children,O),this},E.prototype.commentAfter=function(b){var h,L,O;return L=this.parent.children.indexOf(this),O=this.parent.children.splice(L+1),h=this.parent.comment(b),Array.prototype.push.apply(this.parent.children,O),this},E.prototype.raw=function(b){var h;return h=new d(this,b),this.children.push(h),this},E.prototype.dummy=function(){var b;return b=new S(this),b},E.prototype.instruction=function(b,h){var L,O,w,C,x;if(b!=null&&(b=p(b)),h!=null&&(h=p(h)),Array.isArray(b))for(C=0,x=b.length;C<x;C++)L=b[C],this.instruction(L);else if(t(b))for(L in b){if(!l.call(b,L))continue;O=b[L],this.instruction(L,O)}else i(h)&&(h=h.apply()),w=new s(this,b,h),this.children.push(w);return this},E.prototype.instructionBefore=function(b,h){var L,O,w;return O=this.parent.children.indexOf(this),w=this.parent.children.splice(O),L=this.parent.instruction(b,h),Array.prototype.push.apply(this.parent.children,w),this},E.prototype.instructionAfter=function(b,h){var L,O,w;return O=this.parent.children.indexOf(this),w=this.parent.children.splice(O+1),L=this.parent.instruction(b,h),Array.prototype.push.apply(this.parent.children,w),this},E.prototype.declaration=function(b,h,L){var O,w;return O=this.document(),w=new v(O,b,h,L),O.children.length===0?O.children.unshift(w):O.children[0].type===g.Declaration?O.children[0]=w:O.children.unshift(w),O.root()||O},E.prototype.dtd=function(b,h){var L,O,w,C,x,_,j,N,P,V;for(O=this.document(),w=new f(O,b,h),P=O.children,C=x=0,j=P.length;x<j;C=++x)if(L=P[C],L.type===g.DocType)return O.children[C]=w,w;for(V=O.children,C=_=0,N=V.length;_<N;C=++_)if(L=V[C],L.isRoot)return O.children.splice(C,0,w),w;return O.children.push(w),w},E.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},E.prototype.root=function(){var b;for(b=this;b;){if(b.type===g.Document)return b.rootObject;if(b.isRoot)return b;b=b.parent}},E.prototype.document=function(){var b;for(b=this;b;){if(b.type===g.Document)return b;b=b.parent}},E.prototype.end=function(b){return this.document().end(b)},E.prototype.prev=function(){var b;if(b=this.parent.children.indexOf(this),b<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[b-1]},E.prototype.next=function(){var b;if(b=this.parent.children.indexOf(this),b===-1||b===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[b+1]},E.prototype.importDocument=function(b){var h;return h=b.root().clone(),h.parent=this,h.isRoot=!1,this.children.push(h),this},E.prototype.debugInfo=function(b){var h,L;return b=b||this.name,b==null&&!((h=this.parent)!=null?h.name:void 0)?"":b==null?"parent: <"+this.parent.name+">":((L=this.parent)!=null?L.name:void 0)?"node: <"+b+">, parent: <"+this.parent.name+">":"node: <"+b+">"},E.prototype.ele=function(b,h,L){return this.element(b,h,L)},E.prototype.nod=function(b,h,L){return this.node(b,h,L)},E.prototype.txt=function(b){return this.text(b)},E.prototype.dat=function(b){return this.cdata(b)},E.prototype.com=function(b){return this.comment(b)},E.prototype.ins=function(b,h){return this.instruction(b,h)},E.prototype.doc=function(){return this.document()},E.prototype.dec=function(b,h,L){return this.declaration(b,h,L)},E.prototype.e=function(b,h,L){return this.element(b,h,L)},E.prototype.n=function(b,h,L){return this.node(b,h,L)},E.prototype.t=function(b){return this.text(b)},E.prototype.d=function(b){return this.cdata(b)},E.prototype.c=function(b){return this.comment(b)},E.prototype.r=function(b){return this.raw(b)},E.prototype.i=function(b,h){return this.instruction(b,h)},E.prototype.u=function(){return this.up()},E.prototype.importXMLBuilder=function(b){return this.importDocument(b)},E.prototype.replaceChild=function(b,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.removeChild=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.appendChild=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.hasChildNodes=function(){return this.children.length!==0},E.prototype.cloneNode=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isSupported=function(b,h){return!0},E.prototype.hasAttributes=function(){return this.attribs.length!==0},E.prototype.compareDocumentPosition=function(b){var h,L;return h=this,h===b?0:this.document()!==b.document()?(L=M.Disconnected|M.ImplementationSpecific,Math.random()<.5?L|=M.Preceding:L|=M.Following,L):h.isAncestor(b)?M.Contains|M.Preceding:h.isDescendant(b)?M.Contains|M.Following:h.isPreceding(b)?M.Preceding:M.Following},E.prototype.isSameNode=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupPrefix=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isDefaultNamespace=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupNamespaceURI=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isEqualNode=function(b){var h,L,O;if(b.nodeType!==this.nodeType)return!1;if(b.children.length!==this.children.length)return!1;for(h=L=0,O=this.children.length-1;0<=O?L<=O:L>=O;h=0<=O?++L:--L)if(!this.children[h].isEqualNode(b.children[h]))return!1;return!0},E.prototype.getFeature=function(b,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setUserData=function(b,h,L){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getUserData=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.contains=function(b){return b?b===this||this.isDescendant(b):!1},E.prototype.isDescendant=function(b){var h,L,O,w,C;for(C=this.children,O=0,w=C.length;O<w;O++){if(h=C[O],b===h)return!0;if(L=h.isDescendant(b),L)return!0}return!1},E.prototype.isAncestor=function(b){return b.isDescendant(this)},E.prototype.isPreceding=function(b){var h,L;return h=this.treePosition(b),L=this.treePosition(this),h===-1||L===-1?!1:h<L},E.prototype.isFollowing=function(b){var h,L;return h=this.treePosition(b),L=this.treePosition(this),h===-1||L===-1?!1:h>L},E.prototype.treePosition=function(b){var h,L;return L=0,h=!1,this.foreachTreeNode(this.document(),function(O){if(L++,!h&&O===b)return h=!0}),h?L:-1},E.prototype.foreachTreeNode=function(b,h){var L,O,w,C,x;for(b||(b=this.document()),C=b.children,O=0,w=C.length;O<w;O++){if(L=C[O],x=h(L))return x;if(x=this.foreachTreeNode(L,h),x)return x}},E}()}).call(void 0)},{"./DocumentPosition":250,"./NodeType":251,"./Utility":252,"./XMLCData":255,"./XMLComment":257,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLNamedNodeMap":272,"./XMLNodeList":274,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],274:[function(I,$,R){"use strict";(function(){var M;$.exports=M=function(){function g(T){this.nodes=T}return Object.defineProperty(g.prototype,"length",{get:function(){return this.nodes.length||0}}),g.prototype.clone=function(){return this.nodes=null},g.prototype.item=function(T){return this.nodes[T]||null},g}()}).call(void 0)},{}],275:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f,S=function(o,r){for(var s in r)y.call(r,s)&&(o[s]=r[s]);function d(){this.constructor=o}return d.prototype=r.prototype,o.prototype=new d,o.__super__=r.prototype,o},y={}.hasOwnProperty;D=I("./NodeType"),v=I("./XMLCharacterData"),$.exports=f=function(c){S(o,c);function o(r,s,d){if(o.__super__.constructor.call(this,r),s==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=D.ProcessingInstruction,this.target=this.stringify.insTarget(s),this.name=this.target,d&&(this.value=this.stringify.insValue(d))}return o.prototype.clone=function(){return(0,g.default)(this)},o.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))},o.prototype.isEqualNode=function(r){return o.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)?!(r.target!==this.target):!1},o}(v)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],276:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f,S=function(o,r){for(var s in r)y.call(r,s)&&(o[s]=r[s]);function d(){this.constructor=o}return d.prototype=r.prototype,o.prototype=new d,o.__super__=r.prototype,o},y={}.hasOwnProperty;D=I("./NodeType"),v=I("./XMLNode"),$.exports=f=function(c){S(o,c);function o(r,s){if(o.__super__.constructor.call(this,r),s==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=D.Raw,this.value=this.stringify.raw(s)}return o.prototype.clone=function(){return(0,g.default)(this)},o.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))},o}(v)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],277:[function(I,$,R){"use strict";(function(){var M,g,T,D,v=function(y,c){for(var o in c)f.call(c,o)&&(y[o]=c[o]);function r(){this.constructor=y}return r.prototype=c.prototype,y.prototype=new r,y.__super__=c.prototype,y},f={}.hasOwnProperty;M=I("./NodeType"),D=I("./XMLWriterBase"),g=I("./WriterState"),$.exports=T=function(S){v(y,S);function y(c,o){this.stream=c,y.__super__.constructor.call(this,o)}return y.prototype.endline=function(c,o,r){return c.isLastRootNode&&o.state===g.CloseTag?"":y.__super__.endline.call(this,c,o,r)},y.prototype.document=function(c,o){var r,s,d,u,p,m,i,t,a;for(i=c.children,s=d=0,p=i.length;d<p;s=++d)r=i[s],r.isLastRootNode=s===c.children.length-1;for(o=this.filterOptions(o),t=c.children,a=[],u=0,m=t.length;u<m;u++)r=t[u],a.push(this.writeChildNode(r,o,0));return a},y.prototype.attribute=function(c,o,r){return this.stream.write(y.__super__.attribute.call(this,c,o,r))},y.prototype.cdata=function(c,o,r){return this.stream.write(y.__super__.cdata.call(this,c,o,r))},y.prototype.comment=function(c,o,r){return this.stream.write(y.__super__.comment.call(this,c,o,r))},y.prototype.declaration=function(c,o,r){return this.stream.write(y.__super__.declaration.call(this,c,o,r))},y.prototype.docType=function(c,o,r){var s,d,u,p;if(r||(r=0),this.openNode(c,o,r),o.state=g.OpenTag,this.stream.write(this.indent(c,o,r)),this.stream.write("<!DOCTYPE "+c.root().name),c.pubID&&c.sysID?this.stream.write(' PUBLIC "'+c.pubID+'" "'+c.sysID+'"'):c.sysID&&this.stream.write(' SYSTEM "'+c.sysID+'"'),c.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(c,o,r)),o.state=g.InsideTag,p=c.children,d=0,u=p.length;d<u;d++)s=p[d],this.writeChildNode(s,o,r+1);o.state=g.CloseTag,this.stream.write("]")}return o.state=g.CloseTag,this.stream.write(o.spaceBeforeSlash+">"),this.stream.write(this.endline(c,o,r)),o.state=g.None,this.closeNode(c,o,r)},y.prototype.element=function(c,o,r){var s,d,u,p,m,i,t,a,l,E;r||(r=0),this.openNode(c,o,r),o.state=g.OpenTag,this.stream.write(this.indent(c,o,r)+"<"+c.name),l=c.attribs;for(t in l){if(!f.call(l,t))continue;s=l[t],this.attribute(s,o,r)}if(u=c.children.length,p=u===0?null:c.children[0],u===0||c.children.every(function(b){return(b.type===M.Text||b.type===M.Raw)&&b.value===""}))o.allowEmpty?(this.stream.write(">"),o.state=g.CloseTag,this.stream.write("</"+c.name+">")):(o.state=g.CloseTag,this.stream.write(o.spaceBeforeSlash+"/>"));else if(o.pretty&&u===1&&(p.type===M.Text||p.type===M.Raw)&&p.value!=null)this.stream.write(">"),o.state=g.InsideTag,o.suppressPrettyCount++,a=!0,this.writeChildNode(p,o,r+1),o.suppressPrettyCount--,a=!1,o.state=g.CloseTag,this.stream.write("</"+c.name+">");else{for(this.stream.write(">"+this.endline(c,o,r)),o.state=g.InsideTag,E=c.children,m=0,i=E.length;m<i;m++)d=E[m],this.writeChildNode(d,o,r+1);o.state=g.CloseTag,this.stream.write(this.indent(c,o,r)+"</"+c.name+">")}return this.stream.write(this.endline(c,o,r)),o.state=g.None,this.closeNode(c,o,r)},y.prototype.processingInstruction=function(c,o,r){return this.stream.write(y.__super__.processingInstruction.call(this,c,o,r))},y.prototype.raw=function(c,o,r){return this.stream.write(y.__super__.raw.call(this,c,o,r))},y.prototype.text=function(c,o,r){return this.stream.write(y.__super__.text.call(this,c,o,r))},y.prototype.dtdAttList=function(c,o,r){return this.stream.write(y.__super__.dtdAttList.call(this,c,o,r))},y.prototype.dtdElement=function(c,o,r){return this.stream.write(y.__super__.dtdElement.call(this,c,o,r))},y.prototype.dtdEntity=function(c,o,r){return this.stream.write(y.__super__.dtdEntity.call(this,c,o,r))},y.prototype.dtdNotation=function(c,o,r){return this.stream.write(y.__super__.dtdNotation.call(this,c,o,r))},y}(D)}).call(void 0)},{"./NodeType":251,"./WriterState":253,"./XMLWriterBase":281}],278:[function(I,$,R){"use strict";(function(){var M,g,T=function(f,S){for(var y in S)D.call(S,y)&&(f[y]=S[y]);function c(){this.constructor=f}return c.prototype=S.prototype,f.prototype=new c,f.__super__=S.prototype,f},D={}.hasOwnProperty;g=I("./XMLWriterBase"),$.exports=M=function(v){T(f,v);function f(S){f.__super__.constructor.call(this,S)}return f.prototype.document=function(S,y){var c,o,r,s,d;for(y=this.filterOptions(y),s="",d=S.children,o=0,r=d.length;o<r;o++)c=d[o],s+=this.writeChildNode(c,y,0);return y.pretty&&s.slice(-y.newline.length)===y.newline&&(s=s.slice(0,-y.newline.length)),s},f}(g)}).call(void 0)},{"./XMLWriterBase":281}],279:[function(I,$,R){"use strict";(function(){var M,g=function(v,f){return function(){return v.apply(f,arguments)}},T={}.hasOwnProperty;$.exports=M=function(){function D(v){this.assertLegalName=g(this.assertLegalName,this),this.assertLegalChar=g(this.assertLegalChar,this);var f,S,y;v||(v={}),this.options=v,this.options.version||(this.options.version="1.0"),S=v.stringify||{};for(f in S){if(!T.call(S,f))continue;y=S[f],this[f]=y}}return D.prototype.name=function(v){return this.options.noValidation?v:this.assertLegalName(""+v||"")},D.prototype.text=function(v){return this.options.noValidation?v:this.assertLegalChar(this.textEscape(""+v||""))},D.prototype.cdata=function(v){return this.options.noValidation?v:(v=""+v||"",v=v.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(v))},D.prototype.comment=function(v){if(this.options.noValidation)return v;if(v=""+v||"",v.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+v);return this.assertLegalChar(v)},D.prototype.raw=function(v){return this.options.noValidation?v:""+v||""},D.prototype.attValue=function(v){return this.options.noValidation?v:this.assertLegalChar(this.attEscape(v=""+v||""))},D.prototype.insTarget=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},D.prototype.insValue=function(v){if(this.options.noValidation)return v;if(v=""+v||"",v.match(/\?>/))throw new Error("Invalid processing instruction value: "+v);return this.assertLegalChar(v)},D.prototype.xmlVersion=function(v){if(this.options.noValidation)return v;if(v=""+v||"",!v.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+v);return v},D.prototype.xmlEncoding=function(v){if(this.options.noValidation)return v;if(v=""+v||"",!v.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+v);return this.assertLegalChar(v)},D.prototype.xmlStandalone=function(v){return this.options.noValidation?v:v?"yes":"no"},D.prototype.dtdPubID=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},D.prototype.dtdSysID=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},D.prototype.dtdElementValue=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},D.prototype.dtdAttType=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},D.prototype.dtdAttDefault=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},D.prototype.dtdEntityValue=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},D.prototype.dtdNData=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},D.prototype.convertAttKey="@",D.prototype.convertPIKey="?",D.prototype.convertTextKey="#text",D.prototype.convertCDataKey="#cdata",D.prototype.convertCommentKey="#comment",D.prototype.convertRawKey="#raw",D.prototype.assertLegalChar=function(v){var f,S;if(this.options.noValidation)return v;if(f="",this.options.version==="1.0"){if(f=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,S=v.match(f))throw new Error("Invalid character in string: "+v+" at index "+S.index)}else if(this.options.version==="1.1"&&(f=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,S=v.match(f)))throw new Error("Invalid character in string: "+v+" at index "+S.index);return v},D.prototype.assertLegalName=function(v){var f;if(this.options.noValidation)return v;if(this.assertLegalChar(v),f=/^([: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])*$/,!v.match(f))throw new Error("Invalid character in name");return v},D.prototype.textEscape=function(v){var f;return this.options.noValidation?v:(f=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,v.replace(f,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},D.prototype.attEscape=function(v){var f;return this.options.noValidation?v:(f=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,v.replace(f,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},D}()}).call(void 0)},{}],280:[function(I,$,R){"use strict";var M=I("babel-runtime/core-js/object/create"),g=T(M);function T(D){return D&&D.__esModule?D:{default:D}}(function(){var D,v,f,S=function(o,r){for(var s in r)y.call(r,s)&&(o[s]=r[s]);function d(){this.constructor=o}return d.prototype=r.prototype,o.prototype=new d,o.__super__=r.prototype,o},y={}.hasOwnProperty;D=I("./NodeType"),v=I("./XMLCharacterData"),$.exports=f=function(c){S(o,c);function o(r,s){if(o.__super__.constructor.call(this,r),s==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=D.Text,this.value=this.stringify.text(s)}return Object.defineProperty(o.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(o.prototype,"wholeText",{get:function(){var s,d,u;for(u="",d=this.previousSibling;d;)u=d.data+u,d=d.previousSibling;for(u+=this.data,s=this.nextSibling;s;)u=u+s.data,s=s.nextSibling;return u}}),o.prototype.clone=function(){return(0,g.default)(this)},o.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))},o.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},o}(v)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],281:[function(I,$,R){"use strict";(function(){var M,g,T,D,v,f,S,y,c,o,r,s,d,u,p,m,i,t={}.hasOwnProperty;i=I("./Utility").assign,M=I("./NodeType"),c=I("./XMLDeclaration"),o=I("./XMLDocType"),T=I("./XMLCData"),D=I("./XMLComment"),s=I("./XMLElement"),u=I("./XMLRaw"),p=I("./XMLText"),d=I("./XMLProcessingInstruction"),r=I("./XMLDummy"),v=I("./XMLDTDAttList"),f=I("./XMLDTDElement"),S=I("./XMLDTDEntity"),y=I("./XMLDTDNotation"),g=I("./WriterState"),$.exports=m=function(){function a(l){var E,b,h;l||(l={}),this.options=l,b=l.writer||{};for(E in b){if(!t.call(b,E))continue;h=b[E],this["_"+E]=this[E],this[E]=h}}return a.prototype.filterOptions=function(l){var E,b,h,L,O,w,C,x;return l||(l={}),l=i({},this.options,l),E={writer:this},E.pretty=l.pretty||!1,E.allowEmpty=l.allowEmpty||!1,E.indent=(b=l.indent)!=null?b:" ",E.newline=(h=l.newline)!=null?h:`
|
|
|
`,E.offset=(L=l.offset)!=null?L:0,E.dontPrettyTextNodes=(O=(w=l.dontPrettyTextNodes)!=null?w:l.dontprettytextnodes)!=null?O:0,E.spaceBeforeSlash=(C=(x=l.spaceBeforeSlash)!=null?x:l.spacebeforeslash)!=null?C:"",E.spaceBeforeSlash===!0&&(E.spaceBeforeSlash=" "),E.suppressPrettyCount=0,E.user={},E.state=g.None,E},a.prototype.indent=function(l,E,b){var h;return!E.pretty||E.suppressPrettyCount?"":E.pretty&&(h=(b||0)+E.offset+1,h>0)?new Array(h).join(E.indent):""},a.prototype.endline=function(l,E,b){return!E.pretty||E.suppressPrettyCount?"":E.newline},a.prototype.attribute=function(l,E,b){var h;return this.openAttribute(l,E,b),h=" "+l.name+'="'+l.value+'"',this.closeAttribute(l,E,b),h},a.prototype.cdata=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b)+"<![CDATA[",E.state=g.InsideTag,h+=l.value,E.state=g.CloseTag,h+="]]>"+this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.comment=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b)+"<!-- ",E.state=g.InsideTag,h+=l.value,E.state=g.CloseTag,h+=" -->"+this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.declaration=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b)+"<?xml",E.state=g.InsideTag,h+=' version="'+l.version+'"',l.encoding!=null&&(h+=' encoding="'+l.encoding+'"'),l.standalone!=null&&(h+=' standalone="'+l.standalone+'"'),E.state=g.CloseTag,h+=E.spaceBeforeSlash+"?>",h+=this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.docType=function(l,E,b){var h,L,O,w,C;if(b||(b=0),this.openNode(l,E,b),E.state=g.OpenTag,w=this.indent(l,E,b),w+="<!DOCTYPE "+l.root().name,l.pubID&&l.sysID?w+=' PUBLIC "'+l.pubID+'" "'+l.sysID+'"':l.sysID&&(w+=' SYSTEM "'+l.sysID+'"'),l.children.length>0){for(w+=" [",w+=this.endline(l,E,b),E.state=g.InsideTag,C=l.children,L=0,O=C.length;L<O;L++)h=C[L],w+=this.writeChildNode(h,E,b+1);E.state=g.CloseTag,w+="]"}return E.state=g.CloseTag,w+=E.spaceBeforeSlash+">",w+=this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),w},a.prototype.element=function(l,E,b){var h,L,O,w,C,x,_,j,N,P,V,z,B,K;b||(b=0),P=!1,V="",this.openNode(l,E,b),E.state=g.OpenTag,V+=this.indent(l,E,b)+"<"+l.name,z=l.attribs;for(N in z){if(!t.call(z,N))continue;h=z[N],V+=this.attribute(h,E,b)}if(O=l.children.length,w=O===0?null:l.children[0],O===0||l.children.every(function(U){return(U.type===M.Text||U.type===M.Raw)&&U.value===""}))E.allowEmpty?(V+=">",E.state=g.CloseTag,V+="</"+l.name+">"+this.endline(l,E,b)):(E.state=g.CloseTag,V+=E.spaceBeforeSlash+"/>"+this.endline(l,E,b));else if(E.pretty&&O===1&&(w.type===M.Text||w.type===M.Raw)&&w.value!=null)V+=">",E.state=g.InsideTag,E.suppressPrettyCount++,P=!0,V+=this.writeChildNode(w,E,b+1),E.suppressPrettyCount--,P=!1,E.state=g.CloseTag,V+="</"+l.name+">"+this.endline(l,E,b);else{if(E.dontPrettyTextNodes){for(B=l.children,C=0,_=B.length;C<_;C++)if(L=B[C],(L.type===M.Text||L.type===M.Raw)&&L.value!=null){E.suppressPrettyCount++,P=!0;break}}for(V+=">"+this.endline(l,E,b),E.state=g.InsideTag,K=l.children,x=0,j=K.length;x<j;x++)L=K[x],V+=this.writeChildNode(L,E,b+1);E.state=g.CloseTag,V+=this.indent(l,E,b)+"</"+l.name+">",P&&E.suppressPrettyCount--,V+=this.endline(l,E,b),E.state=g.None}return this.closeNode(l,E,b),V},a.prototype.writeChildNode=function(l,E,b){switch(l.type){case M.CData:return this.cdata(l,E,b);case M.Comment:return this.comment(l,E,b);case M.Element:return this.element(l,E,b);case M.Raw:return this.raw(l,E,b);case M.Text:return this.text(l,E,b);case M.ProcessingInstruction:return this.processingInstruction(l,E,b);case M.Dummy:return"";case M.Declaration:return this.declaration(l,E,b);case M.DocType:return this.docType(l,E,b);case M.AttributeDeclaration:return this.dtdAttList(l,E,b);case M.ElementDeclaration:return this.dtdElement(l,E,b);case M.EntityDeclaration:return this.dtdEntity(l,E,b);case M.NotationDeclaration:return this.dtdNotation(l,E,b);default:throw new Error("Unknown XML node type: "+l.constructor.name)}},a.prototype.processingInstruction=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b)+"<?",E.state=g.InsideTag,h+=l.target,l.value&&(h+=" "+l.value),E.state=g.CloseTag,h+=E.spaceBeforeSlash+"?>",h+=this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.raw=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b),E.state=g.InsideTag,h+=l.value,E.state=g.CloseTag,h+=this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.text=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b),E.state=g.InsideTag,h+=l.value,E.state=g.CloseTag,h+=this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.dtdAttList=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b)+"<!ATTLIST",E.state=g.InsideTag,h+=" "+l.elementName+" "+l.attributeName+" "+l.attributeType,l.defaultValueType!=="#DEFAULT"&&(h+=" "+l.defaultValueType),l.defaultValue&&(h+=' "'+l.defaultValue+'"'),E.state=g.CloseTag,h+=E.spaceBeforeSlash+">"+this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.dtdElement=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b)+"<!ELEMENT",E.state=g.InsideTag,h+=" "+l.name+" "+l.value,E.state=g.CloseTag,h+=E.spaceBeforeSlash+">"+this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.dtdEntity=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b)+"<!ENTITY",E.state=g.InsideTag,l.pe&&(h+=" %"),h+=" "+l.name,l.value?h+=' "'+l.value+'"':(l.pubID&&l.sysID?h+=' PUBLIC "'+l.pubID+'" "'+l.sysID+'"':l.sysID&&(h+=' SYSTEM "'+l.sysID+'"'),l.nData&&(h+=" NDATA "+l.nData)),E.state=g.CloseTag,h+=E.spaceBeforeSlash+">"+this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.dtdNotation=function(l,E,b){var h;return this.openNode(l,E,b),E.state=g.OpenTag,h=this.indent(l,E,b)+"<!NOTATION",E.state=g.InsideTag,h+=" "+l.name,l.pubID&&l.sysID?h+=' PUBLIC "'+l.pubID+'" "'+l.sysID+'"':l.pubID?h+=' PUBLIC "'+l.pubID+'"':l.sysID&&(h+=' SYSTEM "'+l.sysID+'"'),E.state=g.CloseTag,h+=E.spaceBeforeSlash+">"+this.endline(l,E,b),E.state=g.None,this.closeNode(l,E,b),h},a.prototype.openNode=function(l,E,b){},a.prototype.closeNode=function(l,E,b){},a.prototype.openAttribute=function(l,E,b){},a.prototype.closeAttribute=function(l,E,b){},a}()}).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,$,R){"use strict";(function(){var M,g,T,D,v,f,S,y,c,o;o=I("./Utility"),y=o.assign,c=o.isFunction,T=I("./XMLDOMImplementation"),D=I("./XMLDocument"),v=I("./XMLDocumentCB"),S=I("./XMLStringWriter"),f=I("./XMLStreamWriter"),M=I("./NodeType"),g=I("./WriterState"),$.exports.create=function(r,s,d,u){var p,m;if(r==null)throw new Error("Root element needs a name.");return u=y({},s,d,u),p=new D(u),m=p.element(r),u.headless||(p.declaration(u),(u.pubID!=null||u.sysID!=null)&&p.dtd(u)),m},$.exports.begin=function(r,s,d){var u;return c(r)&&(u=[r,s],s=u[0],d=u[1],r={}),s?new v(r,s,d):new D(r)},$.exports.stringWriter=function(r){return new S(r)},$.exports.streamWriter=function(r,s){return new f(r,s)},$.exports.implementation=new T,$.exports.nodeType=M,$.exports.writerState=g}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLDOMImplementation":260,"./XMLDocument":268,"./XMLDocumentCB":269,"./XMLStreamWriter":277,"./XMLStringWriter":278}],283:[function(I,$,R){$.exports=g;var M=Object.prototype.hasOwnProperty;function g(){for(var T={},D=0;D<arguments.length;D++){var v=arguments[D];for(var f in v)M.call(v,f)&&(T[f]=v[f])}return T}},{}],284:[function(I,$,R){"use strict";var M=I("buffer").Buffer,g=I("./sha"),T=I("./md5"),D={sha1:g,md5:T},v=64,f=M.alloc(v);f.fill(0);function S(o,r,s){M.isBuffer(r)||(r=M.from(r)),M.isBuffer(s)||(s=M.from(s)),r.length>v?r=o(r):r.length<v&&(r=M.concat([r,f],v));for(var d=M.alloc(v),u=M.alloc(v),p=0;p<v;p++)d[p]=r[p]^54,u[p]=r[p]^92;var m=o(M.concat([d,s]));return o(M.concat([u,m]))}function y(o,r){o=o||"sha1";var s=D[o],d=[],u=0;return s||c("algorithm:",o,"is not yet supported"),{update:function(m){return M.isBuffer(m)||(m=M.from(m)),d.push(m),u+=m.length,this},digest:function(m){var i=M.concat(d),t=r?S(s,r,i):s(i);return d=null,m?t.toString(m):t}}}function c(){var o=[].slice.call(arguments).join(" ");throw new Error([o,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}R.createHash=function(o){return y(o)},R.createHmac=function(o,r){return y(o,r)},R.createCredentials=function(){c("sorry,createCredentials is not implemented yet")},R.createCipher=function(){c("sorry,createCipher is not implemented yet")},R.createCipheriv=function(){c("sorry,createCipheriv is not implemented yet")},R.createDecipher=function(){c("sorry,createDecipher is not implemented yet")},R.createDecipheriv=function(){c("sorry,createDecipheriv is not implemented yet")},R.createSign=function(){c("sorry,createSign is not implemented yet")},R.createVerify=function(){c("sorry,createVerify is not implemented yet")},R.createDiffieHellman=function(){c("sorry,createDiffieHellman is not implemented yet")},R.pbkdf2=function(){c("sorry,pbkdf2 is not implemented yet")}},{"./md5":286,"./sha":287,buffer:73}],285:[function(I,$,R){"use strict";var M=I("buffer").Buffer,g=4,T=M.alloc(g);T.fill(0);var D=8;function v(y,c){if(y.length%g!==0){var o=y.length+(g-y.length%g);y=M.concat([y,T],o)}for(var r=[],s=c?y.readInt32BE:y.readInt32LE,d=0;d<y.length;d+=g)r.push(s.call(y,d));return r}function f(y,c,o){for(var r=M.alloc(c),s=o?r.writeInt32BE:r.writeInt32LE,d=0;d<y.length;d++)s.call(r,y[d],d*4,!0);return r}function S(y,c,o,r){M.isBuffer(y)||(y=M.from(y));var s=c(v(y,r),y.length*D);return f(s,o,r)}$.exports={hash:S}},{buffer:73}],286:[function(I,$,R){"use strict";var M=I("./helpers");function g(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function T(r,s){r[s>>5]|=128<<s%32,r[(s+64>>>9<<4)+14]=s;for(var d=1732584193,u=-271733879,p=-1732584194,m=271733878,i=0;i<r.length;i+=16){var t=d,a=u,l=p,E=m;d=v(d,u,p,m,r[i+0],7,-680876936),m=v(m,d,u,p,r[i+1],12,-389564586),p=v(p,m,d,u,r[i+2],17,606105819),u=v(u,p,m,d,r[i+3],22,-1044525330),d=v(d,u,p,m,r[i+4],7,-176418897),m=v(m,d,u,p,r[i+5],12,1200080426),p=v(p,m,d,u,r[i+6],17,-1473231341),u=v(u,p,m,d,r[i+7],22,-45705983),d=v(d,u,p,m,r[i+8],7,1770035416),m=v(m,d,u,p,r[i+9],12,-1958414417),p=v(p,m,d,u,r[i+10],17,-42063),u=v(u,p,m,d,r[i+11],22,-1990404162),d=v(d,u,p,m,r[i+12],7,1804603682),m=v(m,d,u,p,r[i+13],12,-40341101),p=v(p,m,d,u,r[i+14],17,-1502002290),u=v(u,p,m,d,r[i+15],22,1236535329),d=f(d,u,p,m,r[i+1],5,-165796510),m=f(m,d,u,p,r[i+6],9,-1069501632),p=f(p,m,d,u,r[i+11],14,643717713),u=f(u,p,m,d,r[i+0],20,-373897302),d=f(d,u,p,m,r[i+5],5,-701558691),m=f(m,d,u,p,r[i+10],9,38016083),p=f(p,m,d,u,r[i+15],14,-660478335),u=f(u,p,m,d,r[i+4],20,-405537848),d=f(d,u,p,m,r[i+9],5,568446438),m=f(m,d,u,p,r[i+14],9,-1019803690),p=f(p,m,d,u,r[i+3],14,-187363961),u=f(u,p,m,d,r[i+8],20,1163531501),d=f(d,u,p,m,r[i+13],5,-1444681467),m=f(m,d,u,p,r[i+2],9,-51403784),p=f(p,m,d,u,r[i+7],14,1735328473),u=f(u,p,m,d,r[i+12],20,-1926607734),d=S(d,u,p,m,r[i+5],4,-378558),m=S(m,d,u,p,r[i+8],11,-2022574463),p=S(p,m,d,u,r[i+11],16,1839030562),u=S(u,p,m,d,r[i+14],23,-35309556),d=S(d,u,p,m,r[i+1],4,-1530992060),m=S(m,d,u,p,r[i+4],11,1272893353),p=S(p,m,d,u,r[i+7],16,-155497632),u=S(u,p,m,d,r[i+10],23,-1094730640),d=S(d,u,p,m,r[i+13],4,681279174),m=S(m,d,u,p,r[i+0],11,-358537222),p=S(p,m,d,u,r[i+3],16,-722521979),u=S(u,p,m,d,r[i+6],23,76029189),d=S(d,u,p,m,r[i+9],4,-640364487),m=S(m,d,u,p,r[i+12],11,-421815835),p=S(p,m,d,u,r[i+15],16,530742520),u=S(u,p,m,d,r[i+2],23,-995338651),d=y(d,u,p,m,r[i+0],6,-198630844),m=y(m,d,u,p,r[i+7],10,1126891415),p=y(p,m,d,u,r[i+14],15,-1416354905),u=y(u,p,m,d,r[i+5],21,-57434055),d=y(d,u,p,m,r[i+12],6,1700485571),m=y(m,d,u,p,r[i+3],10,-1894986606),p=y(p,m,d,u,r[i+10],15,-1051523),u=y(u,p,m,d,r[i+1],21,-2054922799),d=y(d,u,p,m,r[i+8],6,1873313359),m=y(m,d,u,p,r[i+15],10,-30611744),p=y(p,m,d,u,r[i+6],15,-1560198380),u=y(u,p,m,d,r[i+13],21,1309151649),d=y(d,u,p,m,r[i+4],6,-145523070),m=y(m,d,u,p,r[i+11],10,-1120210379),p=y(p,m,d,u,r[i+2],15,718787259),u=y(u,p,m,d,r[i+9],21,-343485551),d=c(d,t),u=c(u,a),p=c(p,l),m=c(m,E)}return Array(d,u,p,m)}function D(r,s,d,u,p,m){return c(o(c(c(s,r),c(u,m)),p),d)}function v(r,s,d,u,p,m,i){return D(s&d|~s&u,r,s,p,m,i)}function f(r,s,d,u,p,m,i){return D(s&u|d&~u,r,s,p,m,i)}function S(r,s,d,u,p,m,i){return D(s^d^u,r,s,p,m,i)}function y(r,s,d,u,p,m,i){return D(d^(s|~u),r,s,p,m,i)}function c(r,s){var d=(r&65535)+(s&65535),u=(r>>16)+(s>>16)+(d>>16);return u<<16|d&65535}function o(r,s){return r<<s|r>>>32-s}$.exports=function(s){return M.hash(s,T,16)}},{"./helpers":285}],287:[function(I,$,R){"use strict";var M=I("./helpers");function g(S,y){S[y>>5]|=128<<24-y%32,S[(y+64>>9<<4)+15]=y;for(var c=Array(80),o=1732584193,r=-271733879,s=-1732584194,d=271733878,u=-1009589776,p=0;p<S.length;p+=16){for(var m=o,i=r,t=s,a=d,l=u,E=0;E<80;E++){E<16?c[E]=S[p+E]:c[E]=f(c[E-3]^c[E-8]^c[E-14]^c[E-16],1);var b=v(v(f(o,5),T(E,r,s,d)),v(v(u,c[E]),D(E)));u=d,d=s,s=f(r,30),r=o,o=b}o=v(o,m),r=v(r,i),s=v(s,t),d=v(d,a),u=v(u,l)}return Array(o,r,s,d,u)}function T(S,y,c,o){return S<20?y&c|~y&o:S<40?y^c^o:S<60?y&c|y&o|c&o:y^c^o}function D(S){return S<20?1518500249:S<40?1859775393:S<60?-1894007588:-899497514}function v(S,y){var c=(S&65535)+(y&65535),o=(S>>16)+(y>>16)+(c>>16);return o<<16|c&65535}function f(S,y){return S<<y|S>>>32-y}$.exports=function(y){return M.hash(y,g,20,!0)}},{"./helpers":285}],288:[function(I,$,R){"use strict";$.exports=function(){return function(){}}},{}],289:[function(I,$,R){(function(M){"use strict";var g=I("babel-runtime/helpers/typeof"),T=D(g);function D(o){return o&&o.__esModule?o:{default:o}}var v=I("stream"),f=v.Stream,S=I("../lib/common/utils/isArray"),y=S.isArray;$.exports.string=function(r){return typeof r=="string"},$.exports.array=y,$.exports.buffer=M.isBuffer;function c(o){return o instanceof f}$.exports.writableStream=function(r){return c(r)&&typeof r._write=="function"&&(0,T.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,$,R){"use strict";R.encodeURIComponent=function(M){try{return encodeURIComponent(M)}catch(g){return M}},R.escape=I("escape-html"),R.timestamp=function(g){if(g){var T=g;return typeof T=="string"&&(T=Number(T)),String(g).length===10&&(T*=1e3),new Date(T)}return Math.round(Date.now()/1e3)}},{"escape-html":191}],291:[function(I,$,R){(function(M,g){"use strict";var T=I("babel-runtime/core-js/json/stringify"),D=S(T),v=I("babel-runtime/helpers/typeof"),f=S(v);function S(E){return E&&E.__esModule?E:{default:E}}var y=I("util"),c=I("url"),o=I("http"),r=I("https"),s=I("debug")("urllib"),d=I("humanize-ms"),u,p=0,m=Math.pow(2,31)-10,i=/^https?:\/\//i;function t(E,b){return E===void 0?b:E}function a(E,b){return function(h,L,O){if(h)return b(h);E({data:L,status:O.statusCode,headers:O.headers,res:O})}}R.TIMEOUTS=[d("300s"),d("300s")];var l=["json","text"];R.request=function(b,h,L){return arguments.length===2&&typeof h=="function"&&(L=h,h=null),typeof L=="function"?R.requestWithCallback(b,h,L):(u||(u=I("any-promise")),new u(function(O,w){R.requestWithCallback(b,h,a(O,w))}))},R.requestWithCallback=function(b,h,L){if(!b||typeof b!="string"&&(typeof b=="undefined"?"undefined":(0,f.default)(b))!=="object"){var O=y.format("expect request url to be a string or a http request options, but got %j",b);throw new Error(O)}arguments.length===2&&typeof h=="function"&&(L=h,h=null),h=h||{},p>=m&&(p=0);var w=++p;h.requestUrls=h.requestUrls||[];var C={requestId:w,url:b,args:h,ctx:h.ctx};h.emitter&&h.emitter.emit("request",C),h.timeout=h.timeout||R.TIMEOUTS,h.maxRedirects=h.maxRedirects||10,h.streaming=h.streaming||h.customResponse;var x=Date.now(),_;typeof b=="string"?(i.test(b)||(b="http://"+b),_=c.parse(b)):_=b;var j=(h.type||h.method||_.method||"GET").toUpperCase(),N=_.port||80,P=o,V=t(h.agent,R.agent),z=h.fixJSONCtlChars;_.protocol==="https:"&&(P=r,V=t(h.httpsAgent,R.httpsAgent),_.port||(N=443));var B={host:_.hostname||_.host||"localhost",path:_.path||"/",method:j,port:N,agent:V,headers:h.headers||{},lookup:h.lookup};Array.isArray(h.timeout)?B.requestTimeout=h.timeout[h.timeout.length-1]:typeof h.timeout!="undefined"&&(B.requestTimeout=h.timeout);for(var K=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],U=0;U<K.length;U++){var W=K[U];h.hasOwnProperty(W)&&(B[W]=h[W])}B.rejectUnauthorized===!1&&!B.hasOwnProperty("secureOptions")&&(B.secureOptions=I("constants").SSL_OP_NO_TLSv1_2);var H=h.auth||_.auth;H&&(B.auth=H);var q=h.content||h.data,ne=j==="GET"||j==="HEAD"||h.dataAsQueryString;if(!h.content&&(q&&!(typeof q=="string"||g.isBuffer(q))))if(ne)q=h.nestedQuerystring?qs.stringify(q):querystring.stringify(q);else{var te=B.headers["Content-Type"]||B.headers["content-type"];te||(h.contentType==="json"?te="application/json":te="application/x-www-form-urlencoded",B.headers["Content-Type"]=te),parseContentType(te).type==="application/json"?q=(0,D.default)(q):q=h.nestedQuerystring?qs.stringify(q):querystring.stringify(q)}ne&&q&&(B.path+=(_.query?"&":"?")+q,q=null);var _e=0;if(q){var Ce=q.length;g.isBuffer(q)||(Ce=g.byteLength(q)),_e=B.headers["Content-Length"]=Ce}h.dataType==="json"&&(B.headers.Accept="application/json"),typeof h.beforeRequest=="function"&&h.beforeRequest(B);var me=null,Me=null,Oe=null,he=!1,ce=!1,se=0,Te=-1,re=!1,ue="",fe="",ee=null;h.timing&&(ee={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0});function Q(){me&&(clearTimeout(me),me=null)}function X(){Me&&(clearTimeout(Me),Me=null)}function Z(Ae,qe,ut){if(X(),!L){console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),w,M.pid,B.method,b),Ae&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),w,M.pid,Ae.name,Ae.message,Ae.stack);return}var $e=L;L=null;var nt={};if(ut&&(Te=ut.statusCode,nt=ut.headers),Te===401&&nt["www-authenticate"]&&(!h.headers||!h.headers.Authorization)&&h.digestAuth){var je=nt["www-authenticate"];if(je.indexOf("Digest ")>=0)return s("Request#%d %s: got digest auth header WWW-Authenticate: %s",w,b,je),h.headers=h.headers||{},h.headers.Authorization=digestAuthHeader(B.method,B.path,je,h.digestAuth),s("Request#%d %s: auth with digest header: %s",w,b,h.headers.Authorization),ut.headers["set-cookie"]&&(h.headers.Cookie=ut.headers["set-cookie"].join(";")),R.requestWithCallback(b,h,$e)}var De=Date.now()-x;ee&&(ee.contentDownload=De),s("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",De,se,Te,B.method,B.host,B.path,ce,ee);var Pe={status:Te,statusCode:Te,headers:nt,size:se,aborted:re,rt:De,keepAliveSocket:ce,data:qe,requestUrls:h.requestUrls,timing:ee,remoteAddress:ue,remotePort:fe};if(Ae){var xe="";V&&typeof V.getCurrentStatus=="function"&&(xe=", agent status: "+(0,D.default)(V.getCurrentStatus())),Ae.message+=", "+B.method+" "+b+" "+Te+" (connected: "+he+", keepalive socket: "+ce+xe+`)
|
|
|
headers: `+(0,D.default)(nt),Ae.data=qe,Ae.path=B.path,Ae.status=Te,Ae.headers=nt,Ae.res=Pe}$e(Ae,qe,h.streaming?ut:Pe),h.emitter&&(C.url=b,C.socket=ot&&ot.connection,C.options=B,C.size=_e,h.emitter.emit("response",{requestId:w,error:Ae,ctx:h.ctx,req:C,res:Pe}))}function ve(Ae){var qe=null;if(h.followRedirect&&statuses.redirect[Ae.statusCode]){h._followRedirectCount=(h._followRedirectCount||0)+1;var ut=Ae.headers.location;if(!ut)qe=new Error("Got statusCode "+Ae.statusCode+" but cannot resolve next location from headers"),qe.name="FollowRedirectError";else if(h._followRedirectCount>h.maxRedirects)qe=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+b),qe.name="MaxRedirectError";else{var $e=h.formatRedirectUrl?h.formatRedirectUrl(b,ut):c.resolve(b,ut);s("Request#%d %s: `redirected` from %s to %s",w,B.path,b,$e),X(),h.headers&&h.headers.Host&&i.test(ut)&&(h.headers.Host=null);var nt=L;return L=null,R.requestWithCallback($e,h,nt),{redirect:!0,error:null}}}return{redirect:!1,error:qe}}!B.headers["User-Agent"]&&!B.headers["user-agent"]&&(B.headers["User-Agent"]=navigator.userAgent),h.gzip&&(!B.headers["Accept-Encoding"]&&!B.headers["accept-encoding"]&&(B.headers["Accept-Encoding"]="gzip"));function ye(Ae,qe,ut){var $e=Ae.headers["content-encoding"];return ut(null,qe,$e)}var Re=h.writeStream;s("Request#%d %s %s with headers %j, options.path: %s",w,j,b,B.headers,B.path),h.requestUrls.push(b);function Je(Ae){if(ee&&(ee.waiting=Date.now()-x),s("Request#%d %s `req response` event emit: status %d, headers: %j",w,b,Ae.statusCode,Ae.headers),h.streaming){var qe=ve(Ae);if(qe.redirect){Ae.resume();return}return qe.error?(Ae.resume(),Z(qe.error,null,Ae)):Z(null,null,Ae)}if(Ae.on("close",function(){s("Request#%d %s: `res close` event emit, total size %d",w,b,se)}),Ae.on("error",function(){s("Request#%d %s: `res error` event emit, total size %d",w,b,se)}),Ae.on("aborted",function(){re=!0,s("Request#%d %s: `res aborted` event emit, total size %d",w,b,se)}),Re){var qe=ve(Ae);if(qe.redirect){Ae.resume();return}return qe.error?(Ae.resume(),Re.end(),Z(qe.error,null,Ae)):(h.consumeWriteStream===!1?Ae.on("end",Z.bind(null,null,null,Ae)):isNode010||isNode012?first([[Re,"close"],[Ae,"aborted"]],function(nt,je,De){s("Request#%d %s: writeStream or res %s event emitted",w,b,De),Z(Oe||null,null,Ae)}):Re.on("close",function(){s("Request#%d %s: writeStream close event emitted",w,b),Z(Oe||null,null,Ae)}),Ae.pipe(Re))}var ut=[];Ae.on("data",function($e){s("Request#%d %s: `res data` event emit, size %d",w,b,$e.length),se+=$e.length,ut.push($e)}),Ae.on("end",function(){var $e=g.concat(ut,se);if(s("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",w,b,se,Ae._dumped),Oe)return Z(Oe,$e,Ae);var nt=ve(Ae);if(nt.error)return Z(nt.error,$e,Ae);if(nt.redirect)return;ye(Ae,$e,function(je,De,Pe){if(je)return Z(je,$e,Ae);if(!Pe&&l.indexOf(h.dataType)>=0){try{De=decodeBodyByCharset(De,Ae)}catch(Se){return s("decodeBodyByCharset error: %s",Se),Z(null,De,Ae)}if(h.dataType==="json")if(se===0)De=null;else{var xe=parseJSON(De,z);xe.error?je=xe.error:De=xe.data}}re&&s("Request#%d %s: Remote socket was terminated before `response.end()` was called",w,b),Z(je,De,Ae)})})}var Ze,rt;Array.isArray(h.timeout)?(Ze=d(h.timeout[0]),rt=d(h.timeout[1])):Ze=rt=d(h.timeout),s("ConnectTimeout: %d, ResponseTimeout: %d",Ze,rt);function tt(){s("Connect timer ticking, timeout: %d",Ze),me=setTimeout(function(){me=null,Te===-1&&(Te=-2);var Ae="Connect timeout for "+Ze+"ms",qe="ConnectionTimeoutError";ot.socket||(qe="SocketAssignTimeoutError",Ae+=", working sockets is full"),Oe=new Error(Ae),Oe.name=qe,Oe.requestId=w,s("ConnectTimeout: Request#%d %s %s: %s, connected: %s",w,b,Oe.name,Ae,he),Fe()},Ze)}function st(){s("Response timer ticking, timeout: %d",rt),Me=setTimeout(function(){Me=null;var Ae="Response timeout for "+rt+"ms",qe="ResponseTimeoutError";Oe=new Error(Ae),Oe.name=qe,Oe.requestId=w,s("ResponseTimeout: Request#%d %s %s: %s, connected: %s",w,b,Oe.name,Ae,he),Fe()},rt)}var ot;B.mode=h.mode?h.mode:"";try{ot=P.request(B,Je)}catch(Ae){return Z(Ae)}typeof window=="undefined"?tt():ot.on("requestTimeout",function(){Te===-1&&(Te=-2);var Ae="Connect timeout for "+Ze+"ms",qe="ConnectionTimeoutError";Oe=new Error(Ae),Oe.name=qe,Oe.requestId=w,Fe()});function Fe(){s("Request#%d %s abort, connected: %s",w,b,he),ot.socket||(Oe.noSocket=!0,Z(Oe)),ot.abort()}return ee&&ot.on("finish",function(){ee.requestSent=Date.now()-x}),ot.once("socket",function(Ae){ee&&(ee.queuing=Date.now()-x),isNode010&&Ae.socket&&(Ae=Ae.socket);var qe=Ae.readyState;if(qe==="opening"){Ae.once("lookup",function(ut,$e,nt){s("Request#%d %s lookup: %s, %s, %s",w,b,ut,$e,nt),ee&&(ee.dnslookup=Date.now()-x),$e&&(ue=$e)}),Ae.once("connect",function(){ee&&(ee.connected=Date.now()-x),Q(),st(),s("Request#%d %s new socket connected",w,b),he=!0,ue||(ue=Ae.remoteAddress),fe=Ae.remotePort});return}s("Request#%d %s reuse socket connected, readyState: %s",w,b,qe),he=!0,ce=!0,ue||(ue=Ae.remoteAddress),fe=Ae.remotePort,Q(),st()}),ot.on("error",function(Ae){(Ae.name==="Error"||Ae.name==="TypeError")&&(Ae.name=he?"ResponseError":"RequestError"),Ae.message+=' (req "error")',s("Request#%d %s `req error` event emit, %s: %s",w,b,Ae.name,Ae.message),Z(Oe||Ae)}),Re&&Re.once("error",function(Ae){Ae.message+=' (writeStream "error")',Oe=Ae,s("Request#%d %s `writeStream error` event emit, %s: %s",w,b,Ae.name,Ae.message),Fe()}),h.stream?(h.stream.pipe(ot),h.stream.once("error",function(Ae){Ae.message+=' (stream "error")',Oe=Ae,s("Request#%d %s `readStream error` event emit, %s: %s",w,b,Ae.name,Ae.message),Fe()})):ot.end(q),ot.requestId=w,ot}}).call(this,I("_process"),I("buffer").Buffer)},{_process:208,"any-promise":49,"babel-runtime/core-js/json/stringify":53,"babel-runtime/helpers/typeof":67,buffer:73,constants:75,debug:288,http:231,https:193,"humanize-ms":194,url:238,util:243}]},{},[1])(1)})}).call(this,__webpack_require__("IyRk"))},n6Qo:function(I,$,R){"use strict";R.d($,"a",function(){return y});var M=R("q1tI"),g=R("biw7"),T=R("fyJ8");function D(c){var o=c.className,r=c.index,s=c.children,d=c.colSpan,u=c.rowSpan,p=M.useContext(g.a),m=p.prefixCls,i=p.fixedInfoList,t=i[r];return M.createElement(T.a,Object.assign({className:o,index:r,component:"td",prefixCls:m,record:null,dataIndex:null,render:function(){return{children:s,props:{colSpan:d,rowSpan:u}}}},t))}function v(c){return M.createElement("tr",Object.assign({},c))}function f(c){var o=c.children,r=M.useContext(g.a),s=r.prefixCls;return M.createElement("tfoot",{className:"".concat(s,"-summary")},o)}var S=$.b=f,y={Cell:D,Row:v}},nj2k:function(I,$,R){I.exports=R.p+"static/nodata.c3b0b86c.svg"},nnTU:function(I,$,R){"use strict";R.d($,"b",function(){return y}),R.d($,"a",function(){return c});var M=R("pmY6"),g=R("746U"),T=R("Cg/j"),D=R("MI8n"),v=R("24hK"),f=R("QDVR"),S=function(){for(var o=0,r=0,s=arguments.length;r<s;r++)o+=arguments[r].length;for(var d=Array(o),u=0,r=0;r<s;r++)for(var p=arguments[r],m=0,i=p.length;m<i;m++,u++)d[u]=p[m];return d},y=Object(T.c)("commandService"),c=new(function(){function o(){this._commands=new Map,this._onDidRegisterCommand=new D.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return o.prototype.registerCommand=function(r,s){var d=this;if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!s)throw new Error("invalid command");return this.registerCommand({id:r,handler:s})}if(r.description){for(var u=[],p=0,m=r.description.args;p<m.length;p++){var i=m[p];u.push(i.constraint)}var t=r.handler;r.handler=function(h){for(var L=[],O=1;O<arguments.length;O++)L[O-1]=arguments[O];return Object(g.m)(L,u),t.apply(void 0,S([h],L))}}var a=r.id,l=this._commands.get(a);l||(l=new v.a,this._commands.set(a,l));var E=l.unshift(r),b=Object(M.h)(function(){E();var h=d._commands.get(a);(h==null?void 0:h.isEmpty())&&d._commands.delete(a)});return this._onDidRegisterCommand.fire(a),b},o.prototype.registerCommandAlias=function(r,s){return c.registerCommand(r,function(d){for(var u,p=[],m=1;m<arguments.length;m++)p[m-1]=arguments[m];return(u=d.get(y)).executeCommand.apply(u,S([s],p))})},o.prototype.getCommand=function(r){var s=this._commands.get(r);return!s||s.isEmpty()?void 0:s.iterator().next().value},o.prototype.getCommands=function(){for(var r=new Map,s=0,d=Object(f.d)(this._commands);s<d.length;s++){var u=d[s],p=this.getCommand(u);p&&r.set(u,p)}return r},o}())},oRuE:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.pad.Iso10126={pad:function(g,T){var D=T*4,v=D-g.sigBytes%D;g.concat(M.lib.WordArray.random(v-1)).concat(M.lib.WordArray.create([v<<24],1))},unpad:function(g){var T=g.words[g.sigBytes-1>>>2]&255;g.sigBytes-=T}},M.pad.Iso10126})},osHv:function(I,$,R){(function(M){M(R("VrN/"))})(function(M){"use strict";var g=M.Pos;function T(i,t){return i.line-t.line||i.ch-t.ch}var D="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",v=D+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",f=new RegExp("<(/?)(["+D+"]["+v+"]*)","g");function S(i,t,a,l){this.line=t,this.ch=a,this.cm=i,this.text=i.getLine(t),this.min=l?Math.max(l.from,i.firstLine()):i.firstLine(),this.max=l?Math.min(l.to-1,i.lastLine()):i.lastLine()}function y(i,t){var a=i.cm.getTokenTypeAt(g(i.line,t));return a&&/\btag\b/.test(a)}function c(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function o(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function r(i){for(;;){var t=i.text.indexOf(">",i.ch);if(t==-1){if(c(i))continue;return}if(!y(i,t+1)){i.ch=t+1;continue}var a=i.text.lastIndexOf("/",t),l=a>-1&&!/\S/.test(i.text.slice(a+1,t));return i.ch=t+1,l?"selfClose":"regular"}}function s(i){for(;;){var t=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(t==-1){if(o(i))continue;return}if(!y(i,t+1)){i.ch=t;continue}f.lastIndex=t,i.ch=t;var a=f.exec(i.text);if(a&&a.index==t)return a}}function d(i){for(;;){f.lastIndex=i.ch;var t=f.exec(i.text);if(!t){if(c(i))continue;return}if(!y(i,t.index+1)){i.ch=t.index+1;continue}return i.ch=t.index+t[0].length,t}}function u(i){for(;;){var t=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(t==-1){if(o(i))continue;return}if(!y(i,t+1)){i.ch=t;continue}var a=i.text.lastIndexOf("/",t),l=a>-1&&!/\S/.test(i.text.slice(a+1,t));return i.ch=t+1,l?"selfClose":"regular"}}function p(i,t){for(var a=[];;){var l=d(i),E,b=i.line,h=i.ch-(l?l[0].length:0);if(!l||!(E=r(i)))return;if(E=="selfClose")continue;if(l[1]){for(var L=a.length-1;L>=0;--L)if(a[L]==l[2]){a.length=L;break}if(L<0&&(!t||t==l[2]))return{tag:l[2],from:g(b,h),to:g(i.line,i.ch)}}else a.push(l[2])}}function m(i,t){for(var a=[];;){var l=u(i);if(!l)return;if(l=="selfClose"){s(i);continue}var E=i.line,b=i.ch,h=s(i);if(!h)return;if(h[1])a.push(h[2]);else{for(var L=a.length-1;L>=0;--L)if(a[L]==h[2]){a.length=L;break}if(L<0&&(!t||t==h[2]))return{tag:h[2],from:g(i.line,i.ch),to:g(E,b)}}}}M.registerHelper("fold","xml",function(i,t){for(var a=new S(i,t.line,0);;){var l=d(a);if(!l||a.line!=t.line)return;var E=r(a);if(!E)return;if(!l[1]&&E!="selfClose"){var b=g(a.line,a.ch),h=p(a,l[2]);return h&&T(h.from,b)>0?{from:b,to:h.from}:null}}}),M.findMatchingTag=function(i,t,a){var l=new S(i,t.line,t.ch,a);if(l.text.indexOf(">")==-1&&l.text.indexOf("<")==-1)return;var E=r(l),b=E&&g(l.line,l.ch),h=E&&s(l);if(!E||!h||T(l,t)>0)return;var L={from:g(l.line,l.ch),to:b,tag:h[2]};return E=="selfClose"?{open:L,close:null,at:"open"}:h[1]?{open:m(l,h[2]),close:L,at:"close"}:(l=new S(i,b.line,b.ch,a),{open:L,close:p(l,h[2]),at:"open"})},M.findEnclosingTag=function(i,t,a,l){for(var E=new S(i,t.line,t.ch,a);;){var b=m(E,l);if(!b)break;var h=new S(i,t.line,t.ch,a),L=p(h,b.tag);if(L)return{open:b,close:L}}},M.scanForClosingTag=function(i,t,a,l){var E=new S(i,t.line,t.ch,l?{from:0,to:l}:null);return p(E,a)}})},p5ED:function(I,$,R){"use strict";var M=R("+L6B"),g=R("2/Rp"),T=R("5Dmo"),D=R("3S7+"),v=R("k1fw"),f=R("9og8"),S=R("tJVT"),y=R("WmNS"),c=R.n(y),o=R("q1tI"),r=R.n(o),s=R("vHTk"),d=R.n(s),u=R("yEEn"),p=R("ZW9T"),m=R("1vsH"),i=R("V0Rq"),t=R("m3rI");$.a=function(a){var l,E,b,h,L,O,w=a.editOffice,C=w===void 0?"view":w,x=a.name,_=a.data,j=a.theme,N=a.type,P=a.filename,V=a.monacoEditor,z=a.className,B=a.style,K=a.close,U=a.onClose,W=a.hasMask,H=a.disabledDownload,q=a.onImgDimensions,ne=a.otherData,te=Object(o.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),_e=Object(S.a)(te,2),Ce=_e[0],me=_e[1],Me=Object(o.useState)(""),Oe=Object(S.a)(Me,2),he=Oe[0],ce=Oe[1],se=Object(o.useState)(),Te=Object(S.a)(se,2),re=Te[0],ue=Te[1],fe=window.ENV==="build"?"/react/build":"",ee=location.host.startsWith("localhost")?t.a.PROXY_SERVER:t.a.API_SERVER,Q,X=1024*1024,Z=10*X,ve=Object(o.useRef)();(l=_)!==null&&l!==void 0&&l.startsWith("/api")&&N!=="txt"&&(_=t.a.API_SERVER+_),N==="office"&&(Q=Object(m.P)(_).filesize,Q>Z&&(N="other")),P&&(V.filename=P),Object(o.useEffect)(function(){var Ze,rt,tt=(Ze=document.cookie)===null||Ze===void 0||((rt=Ze.replace(/\s/g,""))===null||rt===void 0)?void 0:rt.split(";");tt==null||tt.map(function(st){var ot=st.split("=");ot[0]==="_educoder_session"&&ce(ot[1])})},[]),Object(o.useEffect)(function(){N==="office"&&ye()},[N,_]);var ye=function(){var Ze=Object(f.a)(c.a.mark(function rt(){var tt,st,ot;return c.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:return console.log("data:",_),tt=_,_.startsWith("http")||(tt=location.origin+tt),st=new URL(tt).pathname.split("/").pop(),Ae.next=6,Object(i.U)({attachment_id:st});case 6:ot=Ae.sent,ue(ot);case 8:case"end":return Ae.stop()}},rt)}));return function(){return Ze.apply(this,arguments)}}(),Re=function(){if(_.startsWith("http")||_.startsWith("blob:")){Je();return}Object(m.x)(P||"educoder",_,P)},Je=function(){Object(m.v)(P||"educoder",decodeURIComponent(_))};return r.a.createElement("div",{style:Object(v.a)({},B||{}),className:"".concat(W&&d.a.bgBlack," ").concat(N?d.a.wrp:"hide")},K&&r.a.createElement("div",{className:d.a.close,ref:ve},!!q&&r.a.createElement(D.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return ve.current}},r.a.createElement("span",{onClick:function(){U(),q()}},r.a.createElement("i",{className:"icon-yulanpizhu"}))),!H&&r.a.createElement(D.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ve.current}},r.a.createElement("span",{onClick:Je},r.a.createElement("i",{className:"icon-quxiaozhiding"}))),r.a.createElement(D.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ve.current}},r.a.createElement("span",{className:"",onClick:U},r.a.createElement("i",{className:"icon-guanbi1"})))),r.a.createElement("div",{className:"".concat(d.a[z]," ").concat(z," ").concat(d.a.monaco," ").concat(N==="txt"?"show":"hide")},N==="txt"&&r.a.createElement(p.b,V)),N==="audio"&&r.a.createElement("audio",{src:"".concat(((E=_)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((b=_)===null||b===void 0?void 0:b.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(_),autoPlay:!0}),N==="video"&&r.a.createElement(r.a.Fragment,null,((h=_)===null||h===void 0?void 0:h.indexOf("http"))>-1?r.a.createElement("video",{controls:!0,src:"".concat(_),autoPlay:!0}):r.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(_),autoPlay:!0})),N==="office"&&re&&r.a.createElement("iframe",{src:"".concat(fe,"/office.html?key=").concat(re.key,"&url=").concat(ee+re.url,"&callbackUrl=").concat(ee+re.callbackUrl,"&fileType=").concat(re.fileType,"&title=").concat(re.title,"&model=").concat(C,"&officeServer=").concat(t.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),(N==="xlsx"||N==="doc"||N==="pptx"||N==="docx")&&r.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(ne.key,"&url=").concat(t.a.API_SERVER+ne.url,"&callbackUrl=").concat(t.a.API_SERVER+ne.callbackUrl,"&fileType=").concat(ne.fileType,"&title=").concat(ne.title,"&model=").concat(ne.model)}),N==="html"&&r.a.createElement("iframe",{src:_+"&disposition=inline"}),N==="pdf"&&r.a.createElement("embed",{className:d.a.embed,src:_}),N==="image"&&r.a.createElement("img",{src:"".concat(((L=_)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((O=_)===null||O===void 0?void 0:O.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(_)}),N==="other"&&r.a.createElement("div",null,r.a.createElement(g.a,{type:"primary",size:"large",onClick:Re},r.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),N==="download"&&r.a.createElement(g.a,{type:"primary",size:"large",onClick:Re},r.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(I,$,R){},pA7S:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("ETIr"),R("cv67"),R("K3mO"),R("OLod"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.WordArray,v=T.BlockCipher,f=g.algo,S=[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],y=[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],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],o=[{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],s=f.DES=v.extend({_doReset:function(){for(var m=this._key,i=m.words,t=[],a=0;a<56;a++){var l=S[a]-1;t[a]=i[l>>>5]>>>31-l%32&1}for(var E=this._subKeys=[],b=0;b<16;b++){for(var h=E[b]=[],L=c[b],a=0;a<24;a++)h[a/6|0]|=t[(y[a]-1+L)%28]<<31-a%6,h[4+(a/6|0)]|=t[28+(y[a+24]-1+L)%28]<<31-a%6;h[0]=h[0]<<1|h[0]>>>31;for(var a=1;a<7;a++)h[a]=h[a]>>>(a-1)*4+3;h[7]=h[7]<<5|h[7]>>>27}for(var O=this._invSubKeys=[],a=0;a<16;a++)O[a]=E[15-a]},encryptBlock:function(m,i){this._doCryptBlock(m,i,this._subKeys)},decryptBlock:function(m,i){this._doCryptBlock(m,i,this._invSubKeys)},_doCryptBlock:function(m,i,t){this._lBlock=m[i],this._rBlock=m[i+1],d.call(this,4,252645135),d.call(this,16,65535),u.call(this,2,858993459),u.call(this,8,16711935),d.call(this,1,1431655765);for(var a=0;a<16;a++){for(var l=t[a],E=this._lBlock,b=this._rBlock,h=0,L=0;L<8;L++)h|=o[L][((b^l[L])&r[L])>>>0];this._lBlock=b,this._rBlock=E^h}var O=this._lBlock;this._lBlock=this._rBlock,this._rBlock=O,d.call(this,1,1431655765),u.call(this,8,16711935),u.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),m[i]=this._lBlock,m[i+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function d(m,i){var t=(this._lBlock>>>m^this._rBlock)&i;this._rBlock^=t,this._lBlock^=t<<m}function u(m,i){var t=(this._rBlock>>>m^this._lBlock)&i;this._lBlock^=t,this._rBlock^=t<<m}g.DES=v._createHelper(s);var p=f.TripleDES=v.extend({_doReset:function(){var m=this._key,i=m.words;if(i.length!==2&&i.length!==4&&i.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=i.slice(0,2),a=i.length<4?i.slice(0,2):i.slice(2,4),l=i.length<6?i.slice(0,2):i.slice(4,6);this._des1=s.createEncryptor(D.create(t)),this._des2=s.createEncryptor(D.create(a)),this._des3=s.createEncryptor(D.create(l))},encryptBlock:function(m,i){this._des1.encryptBlock(m,i),this._des2.decryptBlock(m,i),this._des3.encryptBlock(m,i)},decryptBlock:function(m,i){this._des3.decryptBlock(m,i),this._des2.encryptBlock(m,i),this._des1.decryptBlock(m,i)},keySize:192/32,ivSize:64/32,blockSize:64/32});g.TripleDES=v._createHelper(p)}(),M.TripleDES})},pmY6:function(I,$,R){"use strict";R.d($,"g",function(){return v}),R.d($,"f",function(){return f}),R.d($,"e",function(){return S}),R.d($,"h",function(){return y}),R.d($,"b",function(){return c}),R.d($,"a",function(){return o}),R.d($,"d",function(){return r}),R.d($,"c",function(){return s});var M=!1,g="__is_disposable_tracked__";function T(d){if(!M)return;if(d&&d!==o.None)try{d[g]=!0}catch(u){}}function D(d){if(!M)return d;var u=new Error("Potentially leaked disposable").stack;return setTimeout(function(){d[g]||console.log(u)},3e3),d}function v(d){return typeof d.dispose=="function"&&d.dispose.length===0}function f(d){return Array.isArray(d)?(d.forEach(function(u){u&&(T(u),u.dispose())}),[]):d?(T(d),d.dispose(),d):void 0}function S(){for(var d=[],u=0;u<arguments.length;u++)d[u]=arguments[u];return d.forEach(T),D({dispose:function(){return f(d)}})}function y(d){var u=D({dispose:function(){T(u),d()}});return u}var c=function(){function d(){this._toDispose=new Set,this._isDisposed=!1}return d.prototype.dispose=function(){if(this._isDisposed)return;T(this),this._isDisposed=!0,this.clear()},d.prototype.clear=function(){this._toDispose.forEach(function(u){return u.dispose()}),this._toDispose.clear()},d.prototype.add=function(u){if(!u)return u;if(u===this)throw new Error("Cannot register a disposable on itself!");return T(u),this._isDisposed?console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(u),u},d}(),o=function(){function d(){this._store=new c,D(this)}return d.prototype.dispose=function(){T(this),this._store.dispose()},d.prototype._register=function(u){if(u===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(u)},d.None=Object.freeze({dispose:function(){}}),d}(),r=function(){function d(){this._isDisposed=!1,D(this)}return Object.defineProperty(d.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(u){if(this._isDisposed||u===this._value)return;this._value&&this._value.dispose(),u&&T(u),this._value=u},enumerable:!0,configurable:!0}),d.prototype.clear=function(){this.value=void 0},d.prototype.dispose=function(){this._isDisposed=!0,T(this),this._value&&this._value.dispose(),this._value=void 0},d}(),s=function(){function d(u){this.object=u}return d.prototype.dispose=function(){},d}()},qBft:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.pad.AnsiX923={pad:function(g,T){var D=g.sigBytes,v=T*4,f=v-D%v,S=D+f-1;g.clamp(),g.words[S>>>2]|=f<<24-S%4*8,g.sigBytes+=f},unpad:function(g){var T=g.words[g.sigBytes-1>>>2]&255;g.sigBytes-=T}},M.pad.Ansix923})},qM6L:function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.WordArray,v=g.enc,f=v.Utf16=v.Utf16BE={stringify:function(y){for(var c=y.words,o=y.sigBytes,r=[],s=0;s<o;s+=2){var d=c[s>>>2]>>>16-s%4*8&65535;r.push(String.fromCharCode(d))}return r.join("")},parse:function(y){for(var c=y.length,o=[],r=0;r<c;r++)o[r>>>1]|=y.charCodeAt(r)<<16-r%2*16;return D.create(o,c*2)}};v.Utf16LE={stringify:function(y){for(var c=y.words,o=y.sigBytes,r=[],s=0;s<o;s+=2){var d=S(c[s>>>2]>>>16-s%4*8&65535);r.push(String.fromCharCode(d))}return r.join("")},parse:function(y){for(var c=y.length,o=[],r=0;r<c;r++)o[r>>>1]|=S(y.charCodeAt(r)<<16-r%2*16);return D.create(o,c*2)}};function S(y){return y<<8&4278255360|y>>>8&16711935}}(),M.enc.Utf16})},qu8F:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){/** @preserve
|
|
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
|
* derived from CryptoJS.mode.CTR
|
|
|
* Jan Hruby jhruby.web@gmail.com
|
|
|
*/return M.mode.CTRGladman=function(){var g=M.lib.BlockCipherMode.extend();function T(f){if((f>>24&255)===255){var S=f>>16&255,y=f>>8&255,c=f&255;S===255?(S=0,y===255?(y=0,c===255?c=0:++c):++y):++S,f=0,f+=S<<16,f+=y<<8,f+=c}else f+=1<<24;return f}function D(f){return(f[0]=T(f[0]))===0&&(f[1]=T(f[1])),f}var v=g.Encryptor=g.extend({processBlock:function(f,S){var y=this._cipher,c=y.blockSize,o=this._iv,r=this._counter;o&&(r=this._counter=o.slice(0),this._iv=void 0),D(r);var s=r.slice(0);y.encryptBlock(s,0);for(var d=0;d<c;d++)f[S+d]^=s[d]}});return g.Decryptor=v,g}(),M.mode.CTRGladman})},"rAM+":function(I,$,R){"use strict";R.d($,"a",function(){return g});var M=R("Qw5x");function g(T,D){var v;if(typeof Symbol=="undefined"||T[Symbol.iterator]==null){if(Array.isArray(T)||(v=Object(M.a)(T))||D&&T&&typeof T.length=="number"){v&&(T=v);var f=0,S=function(){};return{s:S,n:function(){return f>=T.length?{done:!0}:{done:!1,value:T[f++]}},e:function(s){throw s},f:S}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var y=!0,c=!1,o;return{s:function(){v=T[Symbol.iterator]()},n:function(){var s=v.next();return y=s.done,s},e:function(s){c=!0,o=s},f:function(){try{!y&&v.return!=null&&v.return()}finally{if(c)throw o}}}}},rUJ1:function(I,$){const R=/[&<>"']/,M=/[&<>"']/g,g=/[<>"']|&(?!#?\w+;)/,T=/[<>"']|&(?!#?\w+;)/g,D={"&":"&","<":"<",">":">",'"':""","'":"'"},v=O=>D[O];function f(O,w){if(w){if(R.test(O))return O.replace(M,v)}else if(g.test(O))return O.replace(T,v);return O}const S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function y(O){return O.replace(S,(w,C)=>(C=C.toLowerCase(),C==="colon"?":":C.charAt(0)==="#"?C.charAt(1)==="x"?String.fromCharCode(parseInt(C.substring(2),16)):String.fromCharCode(+C.substring(1)):""))}const c=/(^|[^\[])\^/g;function o(O,w){O=O.source||O,w=w||"";const C={replace:(x,_)=>(_=_.source||_,_=_.replace(c,"$1"),O=O.replace(x,_),C),getRegex:()=>new RegExp(O,w)};return C}const r=/[^\w:]/g,s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(O,w,C){if(O){let x;try{x=decodeURIComponent(y(C)).replace(r,"").toLowerCase()}catch(_){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}w&&!s.test(C)&&(C=t(w,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(x){return null}return C}const u={},p=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(O,w){u[" "+O]||(p.test(O)?u[" "+O]=O+"/":u[" "+O]=b(O,"/",!0)),O=u[" "+O];const C=O.indexOf(":")===-1;return w.substring(0,2)==="//"?C?w:O.replace(m,"$1")+w:w.charAt(0)==="/"?C?w:O.replace(i,"$1")+w:O+w}const a={exec:function(){}};function l(O){let w=1,C,x;for(;w<arguments.length;w++){C=arguments[w];for(x in C)Object.prototype.hasOwnProperty.call(C,x)&&(O[x]=C[x])}return O}function E(O,w){const C=O.replace(/\|/g,(j,N,P)=>{let V=!1,z=N;for(;--z>=0&&P[z]==="\\";)V=!V;return V?"|":" |"}),x=C.split(/ \|/);let _=0;if(x.length>w)x.splice(w);else for(;x.length<w;)x.push("");for(;_<x.length;_++)x[_]=x[_].trim().replace(/\\\|/g,"|");return x}function b(O,w,C){const x=O.length;if(x===0)return"";let _=0;for(;_<x;){const j=O.charAt(x-_-1);if(j===w&&!C)_++;else if(j!==w&&C)_++;else break}return O.substr(0,x-_)}function h(O,w){if(O.indexOf(w[1])===-1)return-1;const C=O.length;let x=0,_=0;for(;_<C;_++)if(O[_]==="\\")_++;else if(O[_]===w[0])x++;else if(O[_]===w[1]&&(x--,x<0))return _;return-1}function L(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}I.exports={escape:f,unescape:y,edit:o,cleanUrl:d,resolveUrl:t,noopTest:a,merge:l,splitCells:E,rtrim:b,findClosingBracket:h,checkSanitizeDeprecation:L}},rWjI:function(I,$,R){"use strict";R.r($),R.d($,"Types",function(){return Ot});var M=R("P2fV"),g=R("NJEC"),T=R("CiB2"),D=R("DYRE"),v=R("zeV3"),f=R("sRBo"),S=R("kaz8"),y=R("7Kak"),c=R("9yH6"),o=R("giR+"),r=R("fyUT"),s=R("OaEy"),d=R("2fM7"),u=R("oBTY"),p=R("rAM+"),m=R("T2oS"),i=R("W9HT"),t=R("g9YV"),a=R("wCAj"),l=R("+L6B"),E=R("2/Rp"),b=R("14J3"),h=R("BMrR"),L=R("jCWc"),O=R("kPKH"),w=R("miYZ"),C=R("tsqr"),x=R("9og8"),_=R("y8nQ"),j=R("Vl3Y"),N=R("tJVT"),P=R("k1fw"),V=R("fu2T"),z=R("gK9i"),B=R("2qtc"),K=R("kLXV"),U=R("5NDa"),W=R("5rEg"),H=R("WmNS"),q=R.n(H),ne=R("q1tI"),te=R.n(ne),_e=R("eRFJ"),Ce=R.n(_e),me=R("jrin"),Me,Oe=d.a.Option,he;(function(yt){yt[yt.language=0]="language",yt[yt.difficulty=1]="difficulty",yt[yt.category=2]="category",yt[yt.openOrNot=3]="openOrNot"})(he||(he={}));var ce=(Me={},Object(me.a)(Me,he.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(me.a)(Me,he.difficulty,[{title:"\u7B80\u5355",key:1},{title:"\u9002\u4E2D",key:2},{title:"\u56F0\u96BE",key:3}]),Object(me.a)(Me,he.category,[{title:"\u7A0B\u5E8F\u8BBE\u8BA1",key:1},{title:"\u7B97\u6CD5",key:2}]),Object(me.a)(Me,he.openOrNot,[{title:"\u516C\u5F00",key:1},{title:"\u79C1\u6709",key:0}]),Me);function se(yt){return ce[yt].map(function(kt){return te.a.createElement(Oe,{key:kt.title,value:kt.key}," ",kt.title," ")})}function Te(yt,kt){yt.map(function(Ct){var Ar=Ct.id,Wr=Ct.name,Yt=Ct.sub_disciplines,Ut={value:Ar,label:Wr};kt.push(Ut),Yt&&Yt.length>0&&(Ut.children=[],Te(Yt,Ut.children))})}function re(yt,kt){for(var Ct=[],Ar=0;Ar<yt.length;Ar++){var Wr,Yt=yt[Ar];if(((Wr=Yt.sub_disciplines)===null||Wr===void 0?void 0:Wr.length)>0){Ct[0]=Yt.id;for(var Ut=0;Ut<Yt.sub_disciplines.length;Ut++){var Pr=Yt.sub_disciplines[Ut];if(Pr.id===kt)return Ct[1]=Pr.id,[Ct,Pr.tag_disciplines||Pr.sub_disciplines||[]]}}}return[Ct,[]]}var ue=R("Ty5D"),fe=R("9kvl"),ee=R("J66h"),Q=R("GIiI"),X=R("2BaD"),Z=R("Ot1p"),ve=R("ErOA");function ye(yt){return Object(ve.f)("practices.json",yt)}function Re(){return Object(ve.c)("problems/new.json")}function Je(yt){return Object(ve.c)("practices/".concat(yt,"/edit.json"))}function Ze(yt,kt){return Object(ve.g)("practices/".concat(yt),kt)}function rt(yt,kt){return Object(ve.f)("exercises/".concat(yt,"/exercise_questions.json"),kt)}function tt(yt,kt){return Object(ve.g)("exercise_questions/".concat(yt,".json"),kt)}var st=R("cDPC"),ot=R("bbsP"),Fe=R("/wGt"),Ae=R("0Owb"),qe=R("ZW9T"),ut=R("ZD9Y"),$e=R("M8RZ"),nt=R("bCnd"),je=R("1T2W"),De=R.n(je),Pe={theme:Object(nt.a)("cmCodeMode","vs-dark"),fontSize:Object(nt.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(nt.a)("cmTabToSpace",!0)},xe;(function(yt){yt[yt.set_font_size=0]="set_font_size",yt[yt.set_theme=1]="set_theme",yt[yt.on_tab_to_space=2]="on_tab_to_space",yt[yt.set_show_editor_setting=3]="set_show_editor_setting"})(xe||(xe={}));function Se(yt,kt){switch(kt.type){case xe.set_show_editor_setting:return Object(P.a)(Object(P.a)({},yt),{},{showEditorSetting:kt.payload});case xe.set_theme:return Object(P.a)(Object(P.a)({},yt),{},{theme:kt.payload});case xe.set_font_size:return Object(P.a)(Object(P.a)({},yt),{},{fontSize:kt.payload});case xe.on_tab_to_space:return Object(P.a)(Object(P.a)({},yt),{},{tabToSpace:kt.payload});default:throw new Error}}var Le=function(yt){var kt=yt.value,Ct=yt.onChange,Ar=yt.language,Wr=yt.onLanguage,Yt=yt.languageItems,Ut=yt.ActionBarRender,Pr=Ut===void 0?function(de){return te.a.createElement(Ne,{languageItems:Yt,onLanguage:Wr,language:Ar,onShowCodeSetting:de})}:Ut,yn=Object(ne.useReducer)(Se,Pe),Vr=Object(N.a)(yn,2),dt=Vr[0],At=Vr[1],$t=dt.theme,hr=dt.fontSize,vr=dt.showEditorSetting,Er=dt.tabToSpace;console.log(kt,Ar,"value");var ae={onFontSizeChange:function(oe){At({type:xe.set_font_size,payload:oe}),Object(nt.b)("cmFontSize",oe)},tabToSpace:Er,cmFontSize:hr,className:"oj",cmCodeMode:$t,onTabToSpace:function(oe){At({type:xe.on_tab_to_space,payload:oe}),Object(nt.b)("cmTabToSpace",oe)},onCodeModeChange:function(oe){At({type:xe.set_theme,payload:oe}),Object(nt.b)("cmCodeMode",oe)}};function G(){At({type:xe.set_show_editor_setting,payload:!1})}function Y(){At({type:xe.set_show_editor_setting,payload:!0})}var ie={value:kt,language:Ar,onChange:Ct,theme:$t,height:"calc(100% - 56px)",options:{fontSize:hr,insertSpaces:Er}};return te.a.createElement(ne.Fragment,null,te.a.createElement("div",{className:De.a["code-panel-container"]},Pr(Y),te.a.createElement(qe.b,Object(Ae.a)({key:Ar},ie))),te.a.createElement($e.a,null,te.a.createElement(Fe.a,{className:"oj",title:null,placement:"right",closable:!1,visible:vr,onClose:G},te.a.createElement(ut.a,ae))))};function Ne(yt){var kt=yt.languageItems,Ct=yt.language,Ar=yt.onShowCodeSetting,Wr=yt.onLanguage;return te.a.createElement("div",{className:De.a["action-oj-bar"]},kt==null?void 0:kt.map(function(Yt){return te.a.createElement("div",{className:Ct===(Yt==null?void 0:Yt.language)?De.a.active:"",onClick:function(){return Wr(Yt==null?void 0:Yt.language)},key:Yt==null?void 0:Yt.language},Yt==null?void 0:Yt.language)}),te.a.createElement("a",{onClick:Ar},te.a.createElement("i",{className:"iconfont icon-shezhi"})))}var et=R("Znn+"),Xe=R("ZTPi"),ct=R("L9qf"),gt=R.n(ct),wt=function(kt){var Ct=kt.visible,Ar=kt.onOK,Wr=kt.onCancel,Yt=Object(ne.useState)(!1),Ut=Object(N.a)(Yt,2),Pr=Ut[0],yn=Ut[1],Vr=Object(ne.useState)(!1),dt=Object(N.a)(Vr,2),At=dt[0],$t=dt[1],hr=Object(ne.useState)("1"),vr=Object(N.a)(hr,2),Er=vr[0],ae=vr[1],G=Object(ne.useState)(""),Y=Object(N.a)(G,2),ie=Y[0],de=Y[1],oe=Object(ne.useState)([]),ze=Object(N.a)(oe,2),ft=ze[0],St=ze[1],Ft=function(){var rn=Object(x.a)(q.a.mark(function tr(){var $r;return q.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:if(ie){qt.next=3;break}return C.b.warn("\u9898\u76EE".concat(cn,"\u4E0D\u80FD\u4E3A\u7A7A")),qt.abrupt("return");case 3:return $t(!0),qt.next=6,Object(ve.a)("/api/tag_disciplines.json",{method:"post",body:{target:Ct,name:ie}});case 6:if($r=qt.sent,!(($r==null?void 0:$r.status)===0)){qt.next=10;break}return Ar(),qt.abrupt("return");case 10:$t(!1);case 11:case"end":return qt.stop()}},tr)}));return function(){return rn.apply(this,arguments)}}(),mt=function(){var rn=Object(x.a)(q.a.mark(function tr(){var $r,pr,qt=arguments;return q.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return $r=qt.length>0&&qt[0]!==void 0?qt[0]:"",yn(!0),gr.next=4,Object(ve.a)("/api/tag_disciplines.json",{method:"get",params:{target:Ct,search:$r}});case 4:pr=gr.sent,St(pr.tag_disciplines||[]),yn(!1);case 7:case"end":return gr.stop()}},tr)}));return function(){return rn.apply(this,arguments)}}(),Gt=function(tr){var $r=tr.name;K.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u91CD\u547D\u540D",content:te.a.createElement("div",null,te.a.createElement(W.a,{defaultValue:$r,placeholder:"\u8BF7\u8F93\u5165".concat(cn,"\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57"),maxLength:20,onChange:function(qt){$r=qt.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var pr=Object(x.a)(q.a.mark(function sr(){var gr;return q.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:if($r){fn.next=3;break}return C.b.warn("\u9898\u76EE".concat(cn,"\u4E0D\u80FD\u4E3A\u7A7A")),fn.abrupt("return",Promise.reject());case 3:return fn.next=5,Object(ve.a)("/api/tag_disciplines/".concat(tr.id,"/rename.json"),{method:"post",body:{id:tr.id,name:$r}});case 5:gr=fn.sent,(gr==null?void 0:gr.status)===0&&mt();case 7:case"end":return fn.stop()}},sr)}));function qt(){return pr.apply(this,arguments)}return qt}()})},Vt=function(tr){K.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,width:570,title:"\u5220\u9664",content:Ct==="practice"?te.a.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u6765\u6E90\u201C",te.a.createElement("span",{className:"c-light-primary"},tr.name),"\u201D\u5220\u9664\u5417\uFF1F",te.a.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u6765\u6E90\u8FDB\u884C\u6E05\u9664\u3002"):te.a.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u77E5\u8BC6\u70B9\u201C",te.a.createElement("span",{className:"c-light-primary"},tr.name),"\u201D\u5220\u9664\u5417\uFF1F",te.a.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u77E5\u8BC6\u70B9\u8FDB\u884C\u6E05\u9664\u3002"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var $r=Object(x.a)(q.a.mark(function qt(){var sr;return q.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(ve.a)("/api/tag_disciplines/".concat(tr.id,".json"),{method:"delete",body:{id:tr.id}});case 2:sr=en.sent,(sr==null?void 0:sr.status)===0&&mt();case 4:case"end":return en.stop()}},qt)}));function pr(){return $r.apply(this,arguments)}return pr}()})},Hr=function(tr){mt(tr)},cn=Ct==="practice"?"\u77E5\u8BC6\u70B9":"\u6765\u6E90";return te.a.createElement(K.a,{afterClose:function(){$t(!1),yn(!1),de(""),ae("1"),St([])},centered:!0,keyboard:!1,width:600,title:"".concat(cn,"\u7BA1\u7406"),visible:!!Ct,className:gt.a.customModal,footer:null,onCancel:Wr},te.a.createElement("section",{className:gt.a.wrap},te.a.createElement(Xe.a,{activeKey:Er,onChange:function(tr){de(""),ae(tr),mt()}},te.a.createElement(Xe.a.TabPane,{tab:"\u65B0\u589E".concat(cn),key:"1"},te.a.createElement(W.a,{value:ie,onChange:function(tr){return de(tr.target.value)},className:gt.a.in,placeholder:"\u8F93\u5165".concat(cn,"\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57"),maxLength:20}),te.a.createElement("div",{className:gt.a.btns},te.a.createElement(E.a,{onClick:Wr,className:"mr20"},"\u53D6\u6D88 "),te.a.createElement(E.a,{loading:At,onClick:Ft,type:"primary"},"\u786E\u8BA4\u65B0\u5EFA"))),te.a.createElement(Xe.a.TabPane,{tab:"\u5DF2\u6709".concat(cn),key:"2"},te.a.createElement(W.a.Search,{allowClear:!0,onSearch:Hr,value:ie,onChange:function(tr){return de(tr.target.value)},className:gt.a.in,placeholder:"\u8F93\u5165".concat(cn,"\u540D\u79F0\u8FDB\u884C\u67E5\u8BE2")}),te.a.createElement(a.a,{dataSource:ft,bordered:!1,loading:Pr,scroll:ft.length>7?{y:300}:{},style:{padding:"0 40px 20px 40px"},columns:[{title:"".concat(cn,"\u540D\u79F0"),dataIndex:"name",ellipsis:!0},{title:"\u64CD\u4F5C",dataIndex:"action",width:120,render:function(tr,$r){return te.a.createElement("span",null,te.a.createElement("span",{onClick:function(){return Gt($r)},className:"current mr10 c-light-primary"},"\u91CD\u547D\u540D"),te.a.createElement("span",{onClick:function(){return Vt($r)},className:"current c-grey-666"},"\u5220\u9664"))}}],pagination:!1})))))},vt=wt,Mt=R("m3rI"),Pt=R("B7Ph"),_t=R("wd/R"),rr=R.n(_t),dr=R("1vsH"),Zt=R("9Bee"),fr=R("xKgJ"),Ht=W.a.TextArea,Mr=K.a.confirm,Sr=z.a.Panel,Tt={loading:!0,user:null,status:0,data:void 0,lastedUpdateTime:0},Ot;(function(yt){yt[yt.SET_INITAL_DATA=0]="SET_INITAL_DATA",yt[yt.SET_LOADING=1]="SET_LOADING",yt[yt.SET_STATUS=2]="SET_STATUS"})(Ot||(Ot={}));var Rt="#### \u9898\u76EE\u63CF\u8FF0\n\u73B0\u6709\u4E00\u4E2A\u6574\u578B\u6570\u7EC4 `nums`\uFF0C\u8BF7\u7F16\u5199\u7A0B\u5E8F\u5C06\u6570\u7EC4 `nums` \u4E2D\u7684\u6240\u6709 `$$0$$` \u79FB\u52A8\u5230\u6570\u7EC4\u7684\u672B\u5C3E\uFF0C\u4F46\u4E0D\u6539\u53D8\u975E\u96F6\u5143\u7D20\u5728\u6570\u7EC4\u4E2D\u7684\u76F8\u5BF9\u4F4D\u7F6E\u3002\u8BF7\u5728\u539F\u6570\u7EC4 `nums` \u4E0A\u8FDB\u884C\u64CD\u4F5C\u3002\n#### \u8F93\u5165\u8F93\u51FA\u683C\u5F0F\n**\u8F93\u5165\u683C\u5F0F**\n\u7B2C\u4E00\u884C\u6709\u4E00\u4E2A\u6574\u6570 `numsSize`\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u5927\u5C0F\uFF1B\n\u7B2C\u4E8C\u884C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n**\u8F93\u51FA\u683C\u5F0F**\n\u4E00\u884C\u8F93\u51FA\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B1\n**\u8F93\u5165**\n`4`\n`0 1 2 3`\n**\u8F93\u51FA**\n`1 2 3 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B2\n**\u8F93\u5165**\n`5`\n`1 1 0 1 0`\n**\u8F93\u51FA**\n`1 1 1 0 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8BF4\u660E\u63D0\u793A\n-`1\u2264n\u2264100`";function Bt(yt,kt){switch(kt.type){case Ot.SET_INITAL_DATA:return Object(P.a)(Object(P.a)({},yt),kt.payload);case Ot.SET_LOADING:return Object(P.a)(Object(P.a)({},yt),{},{loading:kt.payload});case Ot.SET_STATUS:return Object(P.a)(Object(P.a)({},yt),{},{status:kt.payload});default:throw new Error}}var lr=$.default=function(){var yt,kt,Ct,Ar=Object(ue.h)(),Wr=Object(ue.g)(),Yt=Object(ue.i)(),Ut=Yt.id,Pr=j.a.useForm(),yn=Object(N.a)(Pr,1),Vr=yn[0],dt=Object(ne.useState)(),At=Object(N.a)(dt,2),$t=At[0],hr=At[1],vr=Object(ne.useState)(!1),Er=Object(N.a)(vr,2),ae=Er[0],G=Er[1],Y=Object(ne.useState)([]),ie=Object(N.a)(Y,2),de=ie[0],oe=ie[1],ze=Object(ne.useState)([]),ft=Object(N.a)(ze,2),St=ft[0],Ft=ft[1],mt=Object(ne.useState)([]),Gt=Object(N.a)(mt,2),Vt=Gt[0],Hr=Gt[1],cn=Object(ne.useState)([]),rn=Object(N.a)(cn,2),tr=rn[0],$r=rn[1],pr=Object(ne.useState)([]),qt=Object(N.a)(pr,2),sr=qt[0],gr=qt[1],en=Object(ne.useState)("C"),fn=Object(N.a)(en,2),Sn=fn[0],wi=fn[1],Vi=Object(ne.useReducer)(Bt,Tt),Ui=Object(N.a)(Vi,2),Zn=Ui[0],ln=Ui[1],Ri=Zn.loading,dn=Zn.data,hi=Zn.user,Jr=Zn.status,ur=dn==null?void 0:dn.hack_sets,nn=dn==null||((yt=dn.hack)===null||yt===void 0)?void 0:yt.test_set_average,Ir=Object(ne.useState)(!1),mn=Object(N.a)(Ir,2),Nr=mn[0],fi=mn[1],gn=Object(ne.useRef)([]),zn=Object(ne.useState)(!1),Di=Object(N.a)(zn,2),yi=Di[0],qn=Di[1],Ci=Object(ne.useState)(!1),Fn=Object(N.a)(Ci,2),Ni=Fn[0],si=Fn[1],pi=Object(ne.useRef)(!0),Bi=Object(ne.useState)({}),li=Object(N.a)(Bi,2),an=li[0],Qi=li[1];Object(ne.useEffect)(function(){return Object(fe.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(fe.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(fe.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(fe.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(ne.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)});var zt=function(){var ar=Object(x.a)(q.a.mark(function jt(){var mr,br;return q.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return kr.next=2,Object(ve.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice"}});case 2:return mr=kr.sent,kr.next=5,Object(ve.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice_source"}});case 5:br=kr.sent,Ft(mr.tag_disciplines||[]),Hr(br.tag_disciplines||[]);case 8:case"end":return kr.stop()}},jt)}));return function(){return ar.apply(this,arguments)}}(),er=[{language:"C",code:""},{language:"C++",code:""},{language:"Java",code:""},{language:"Python",code:""}],Jt=Object(ne.useCallback)(Object(x.a)(q.a.mark(function ar(){var jt,mr,br,on,kr,Dn,Tn,ki,Bn,Gn,$n,$i,Ie,Ge,Qe,Ue,be,ke,we,Be,He,Ye,Ve,it,ht,Et,xt;return q.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(ln({type:Ot.SET_LOADING,payload:!0}),!Ut){Qt.next=19;break}return Qt.next=4,Je(Ut);case 4:jt=Qt.sent,mr=jt.user,br=jt.language,on=jt.practice_sets,kr=jt.practice_codes,Dn=jt.description,Tn=jt.difficulty,ki=jt.name,Bn=jt.open_or_not,Gn=jt.time_limit,$n=jt.test_set_average,$i=jt.test_set_score,Ie=jt.status,Ge=jt.tag_discipline_ids,Qe=jt.source_discipline_ids,Ue=jt.item_banks_group_id,be=jt.is_file,ke=be===void 0?!1:be,we=jt.hide_actual_output,Be=jt.review_privilege,He=jt.review_description,Ye={review_privilege:Be,status:Ie,review_description:He,name:ki},Qi(Ye),fi(we),Ve=ke?[{input:"",output:"",score:100,position:1}]:on,ke?(oe(on),Vr.setFieldsValue({hack_sets:Ve})):oe([]),it={loading:!0,user:mr,status:Ie,data:{hack:{difficulty:Tn,name:ki,description:Dn,open_or_not:Bn,time_limit:Gn,test_set_average:$n,test_set_score:$i,tag_discipline_ids:Ge,source_discipline_ids:Qe,is_file:ke},hack_sets:Ve}},ln({type:Ot.SET_INITAL_DATA,payload:it}),hr({hack:{difficulty:Tn,name:ki,description:Dn,open_or_not:Bn,time_limit:Gn,test_set_average:$n,test_set_score:$i,tag_discipline_ids:Ge,source_discipline_ids:Qe,is_file:ke}}),ht=kr==null?void 0:kr.map(function(xr){return Object(P.a)(Object(P.a)({},xr),{},{code:ee.Base64.decode(xr==null?void 0:xr.code)})}),gr(ht),gn.current=ht,Qt.next=27;break;case 19:return Qt.next=21,Re();case 21:Et=Qt.sent,xt=Et.user,ln({type:Ot.SET_INITAL_DATA,payload:{loading:!0,status:0,user:xt,data:{hack:{difficulty:"",time_limit:3,description:Rt,test_set_score:!0,test_set_average:!0,open_or_not:!0,name:"",is_file:!1},hack_sets:[{input:"",output:"",score:100,position:1}]}}}),hr({hack:{difficulty:"",time_limit:3,description:"",test_set_average:!0,open_or_not:!0,name:"",is_file:!1}}),gr(er),gn.current=er;case 27:ln({type:Ot.SET_LOADING,payload:!1});case 28:case"end":return Qt.stop()}},ar)})),[Ut]);Object(ne.useEffect)(function(){try{Jt(),zt()}catch(ar){console.log(ar,"----")}},[]);function yr(ar,jt){return Rr.apply(this,arguments)}function Rr(){return Rr=Object(x.a)(q.a.mark(function ar(jt,mr){var br,on,kr,Dn,Tn,ki,Bn,Gn,$n,$i,Ie,Ge,Qe,Ue,be,ke,we,Be;return q.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:on=Object(P.a)({},jt),kr=on.hack_sets,Dn=on.hack,Dn.hide_actual_output=Nr,Tn=[],ki=[],Bn=0,Gn=Dn!=null&&Dn.is_file?de.map(function(Ve,it){return Object(P.a)(Object(P.a)({},Ve),{},{position:it+1})}):kr.map(function(Ve){return Object(P.a)(Object(P.a)({},Ve),{},{is_file:!1})}),$n=Object(p.a)(Gn);try{for($n.s();!($i=$n.n()).done;)Ie=$i.value,Bn+=Ie.score,Ie.id&&Ie.id>=0?Tn.push(Ie):ki.push(Ie)}catch(Ve){$n.e(Ve)}finally{$n.f()}if(Gn!=null&&Gn.length){Ye.next=11;break}return C.b.error("\u6D4B\u8BD5\u96C6\u4E0D\u80FD\u4E3A\u7A7A"),Ye.abrupt("return");case 11:if(!(Bn!==100&&!Dn.test_set_score)){Ye.next=14;break}return C.b.error("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),Ye.abrupt("return");case 14:if(!(Gn!=null&&Gn.some(function(Ve){return!Ve.output}))){Ye.next=17;break}return C.b.error("\u6D4B\u8BD5\u96C6\u8F93\u51FA\u4E0D\u80FD\u4E3A\u7A7A"),Ye.abrupt("return");case 17:if(pi.current?qn(!0):si(!0),Qe=sr==null?void 0:sr.map(function(Ve){return Object(P.a)(Object(P.a)({},Ve),{},{code:ee.Base64.encode(Ve==null?void 0:Ve.code)})}),!Ut){Ye.next=25;break}return Ye.next=22,Ze(Ut,{practice:Dn,practice_codes:Qe,practice_sets:ki,update_practice_sets:Tn});case 22:Ge=Ye.sent,Ye.next=28;break;case 25:return Ye.next=27,ye({practice:Dn,practice_codes:Qe,practice_sets:Gn,publish:!pi.current});case 27:Ge=Ye.sent;case 28:if(qn(!1),si(!1),!(((br=Ge)===null||br===void 0?void 0:br.status)===0)){Ye.next=46;break}if(!((Ue=Ge)!==null&&Ue!==void 0&&(be=Ue.similar_practice)!==null&&be!==void 0&&be.length)){Ye.next=35;break}return G(!0),$r((ke=Ge)===null||ke===void 0?void 0:ke.similar_practice),Ye.abrupt("return");case 35:if(!Ut){Ye.next=44;break}if(C.b.success("\u4FDD\u5B58\u6210\u529F"),pi.current){Ye.next=42;break}return Ye.next=40,Object(ve.a)("/api/practices/".concat(Ut,"/start"),{method:"get"});case 40:we=Ye.sent,(we==null?void 0:we.status)===0&&Wr.push("/problems/".concat(we==null?void 0:we.identifier,"/oj/").concat(Ut));case 42:Ye.next=46;break;case 44:C.b.success("\u65B0\u5EFA\u6210\u529F"),Wr.replace("/problems/".concat((Be=Ge)===null||Be===void 0?void 0:Be.identifier,"/ojedit"));case 46:case"end":return Ye.stop()}},ar)})),Rr.apply(this,arguments)}function Qr(){Wr.replace("/problems")}var Tr=function(jt){var mr=Math.floor(100/jt.length),br=mr+100%jt.length;jt=jt.map(function(on,kr){return kr===jt.length-1?Object(P.a)(Object(P.a)({},on),{},{score:br}):Object(P.a)(Object(P.a)({},on),{},{score:mr})}),oe(jt)};function Rn(ar){ar.target.value||Tr(de),ln({type:Ot.SET_INITAL_DATA,payload:{data:Object(P.a)(Object(P.a)({},dn),{},{hack:Object(P.a)(Object(P.a)({},dn.hack),{},{test_set_score:ar.target.value})})}})}function Kn(ar){ln({type:Ot.SET_INITAL_DATA,payload:{data:Object(P.a)(Object(P.a)({},dn),{},{hack:Object(P.a)(Object(P.a)({},dn.hack),{},{is_file:ar.target.value})})}})}function wr(ar){fi(ar.target.checked)}function ji(ar){var jt=ar.target.value;jt&&Tr(de),ln({type:Ot.SET_INITAL_DATA,payload:{data:Object(P.a)(Object(P.a)({},dn),{},{hack:Object(P.a)(Object(P.a)({},dn.hack),{},{test_set_average:jt})})}})}function Fr(){var ar=Vr.getFieldValue("hack_sets"),jt=ar.length+1,mr=Math.floor(100/jt),br=100%jt;ar.map(function(on,kr){return nn&&(on.score=mr),on.position=kr+1,on}),ar.push({input:"",output:"",position:jt,score:nn?mr+br:0}),Vr.setFieldsValue({hack_sets:ar}),ln({type:Ot.SET_INITAL_DATA,payload:{data:Object(P.a)(Object(P.a)({},dn),{},{hack_sets:ar})}})}Object(ne.useEffect)(function(){if(nn){var ar=ur==null?void 0:ur.length,jt=Math.floor(100/ar),mr=100%ar;ur==null||ur.map(function(br,on){return br.score=jt,br.position=on+1,on===ar-1&&(br.score=jt+mr),br}),ln({type:Ot.SET_INITAL_DATA,payload:{data:Object(P.a)(Object(P.a)({},dn),{},{hack_sets:ur})}}),Vr.setFieldsValue({hack_sets:ur})}},[nn]);function Pn(ar){var jt=Vr.getFieldValue("hack_sets"),mr=(jt==null?void 0:jt.length)-1,br=Math.ceil(100/mr),on=100%mr;jt.splice(ar,1),jt==null||jt.map(function(kr,Dn){return nn&&(kr.score=br,Dn===mr-1&&(kr.score=br+on)),kr.position=Dn+1,kr}),ln({type:Ot.SET_INITAL_DATA,payload:{data:Object(P.a)(Object(P.a)({},dn),{},{hack_sets:jt})}}),Vr.setFieldsValue({hack_sets:jt})}function mi(ar){wi(ar)}var ei=function(jt){var mr,br=(mr=gn.current)===null||mr===void 0?void 0:mr.findIndex(function(on){return on.language===Sn});gn.current[br].code=jt,gr(gn.current)},zr=function(jt){hr(Object(P.a)({},Vr.getFieldsValue()))},Ur=function(){var ar=Object(x.a)(q.a.mark(function jt(mr){var br;return q.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return kr.next=2,Object(ve.a)("/api/practices/".concat(mr,"/start"),{method:"get"});case 2:br=kr.sent,(br==null?void 0:br.status)===0&&Object(dr.O)("/problems/".concat(br==null?void 0:br.identifier,"/oj/").concat(mr));case 4:case"end":return kr.stop()}},jt)}));return function(mr){return ar.apply(this,arguments)}}(),Dr=function(){var ar=Object(x.a)(q.a.mark(function jt(){var mr,br,on,kr,Dn,Tn;return q.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Je(Ut);case 2:mr=Bn.sent,br=mr.name,on=mr.status,kr=mr.review_privilege,Dn=mr.review_description,Tn={review_privilege:kr,status:on,review_description:Dn,name:br},Qi(Tn);case 6:case"end":return Bn.stop()}},jt)}));return function(){return ar.apply(this,arguments)}}(),ui=function(){var jt="";K.a.confirm({icon:null,width:700,className:"custom-modal-divider",centered:!0,title:"\u4E0D\u901A\u8FC7\u539F\u56E0",content:te.a.createElement("div",{className:"mt20"},te.a.createElement(Z.a,{className:Ce.a.MdEditor,defaultValue:jt,onChange:function(br){jt=br}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var mr=Object(x.a)(q.a.mark(function on(){var kr;return q.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:if(jt){Tn.next=3;break}return C.b.warn("\u4E0D\u901A\u8FC7\u539F\u56E0\u4E0D\u80FD\u4E3A\u7A7A"),Tn.abrupt("return",Promise.reject());case 3:return Tn.next=5,Object(ve.a)("/api/practices/".concat(Ut,"/review.json"),{method:"post",body:{op:"fail",description:jt}});case 5:kr=Tn.sent,(kr==null?void 0:kr.status)===0&&(C.b.success("\u63D0\u4EA4\u6210\u529F"),Dr());case 7:case"end":return Tn.stop()}},on)}));function br(){return mr.apply(this,arguments)}return br}()})},Xi=function(){var ar=Object(x.a)(q.a.mark(function jt(){return q.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:K.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u63D0\u793A",content:"\u786E\u8BA4\u5C06\u9898\u76EE\u300A".concat(an==null?void 0:an.name,"\u300B\u7684\u5BA1\u6838\u901A\u8FC7\u5417\uFF1F"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var on=Object(x.a)(q.a.mark(function Dn(){var Tn;return q.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Object(ve.a)("/api/practices/".concat(Ut,"/review.json"),{method:"post",body:{op:"pass"}});case 2:Tn=Bn.sent,(Tn==null?void 0:Tn.status)===0&&(C.b.success("\u63D0\u4EA4\u6210\u529F"),Dr());case 4:case"end":return Bn.stop()}},Dn)}));function kr(){return on.apply(this,arguments)}return kr}()});case 1:case"end":return br.stop()}},jt)}));return function(){return ar.apply(this,arguments)}}(),Yi=function(){var jt=K.a.confirm({icon:null,width:700,className:"".concat(Ce.a.cusModal," custom-modal-divider"),centered:!0,title:te.a.createElement(h.a,null,te.a.createElement(O.a,{flex:"1"},"\u4E0D\u901A\u8FC7\u539F\u56E0"),te.a.createElement(O.a,null,te.a.createElement("span",{className:"iconfont icon-guanbi7 font12 current c-grey-c",onClick:function(){return jt.destroy()}}))),content:te.a.createElement("div",null,te.a.createElement(Zt.a,{className:"mt20",value:(an==null?void 0:an.review_description)||""}))})};return te.a.createElement(i.a,{spinning:Ri,size:"large",className:Ce.a["oj-custom-large-spin"]},dn?te.a.createElement(ne.Fragment,null,te.a.createElement("header",{className:Ce.a.header},te.a.createElement("div",null,te.a.createElement("img",{src:"".concat(Mt.a.IMG_SERVER,"/images/").concat(hi==null?void 0:hi.image_url),alt:"user",width:30}),te.a.createElement("span",null,hi==null?void 0:hi.name)),te.a.createElement("h2",null," ",dn==null||((kt=dn.hack)===null||kt===void 0)?void 0:kt.name," "),Ut?te.a.createElement("a",{className:Ce.a.btn_back,onClick:Qr}," ",te.a.createElement(Q.a,null),"\u9000\u51FA"):null),te.a.createElement(j.a,{form:Vr,initialValues:dn,layout:"vertical",className:Ce.a["oj-form-container"],onValuesChange:zr,onFinish:yr},te.a.createElement(st.a,{hideResize:!0,className:Ce.a["oj-problems"],leftChild:te.a.createElement(sn,{formValue:$t,onRemoveTestCase:Pn,onAddTestCase:Fr,hack:dn.hack,onChangeScore:Rn,onChangehide:wr,onChangeAverage:ji,onChangeFile:Kn,uploadData:de,setUploadData:oe,handleUploadRatio:Tr,ischecked:Nr,pointData:St,sourceData:Vt,getPointData:zt}),rightChild:te.a.createElement(Le,{value:sr==null||((Ct=sr.find(function(ar){return ar.language===Sn}))===null||Ct===void 0)?void 0:Ct.code,onChange:ei,onLanguage:mi,languageItems:sr,language:Sn})}),te.a.createElement("div",{className:Ce.a.footer},!!Ut&&te.a.createElement("div",{className:Ce.a.result},te.a.createElement("span",null,"\u5BA1\u6838\u7ED3\u679C:"),an!=null&&an.review_privilege?te.a.createElement(te.a.Fragment,null,te.a.createElement("div",{onClick:Xi,className:Ce.a.pass},"\u901A\u8FC7"),te.a.createElement("div",{onClick:ui,className:Ce.a.noPass},"\u4E0D\u901A\u8FC7")):te.a.createElement(te.a.Fragment,null,(an==null?void 0:an.status)===0&&te.a.createElement("div",{className:Ce.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u53D1\u5E03"),(an==null?void 0:an.status)===1&&te.a.createElement("div",{className:Ce.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5DF2\u516C\u5F00"),(an==null?void 0:an.status)===2&&te.a.createElement("div",{className:Ce.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u5BA1\u6279"),(an==null?void 0:an.status)===3&&te.a.createElement("div",{className:Ce.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u4E2D"),(an==null?void 0:an.status)===4&&te.a.createElement("div",{className:Ce.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u5B8C\u6210\u5F85\u516C\u5F00"),(an==null?void 0:an.status)===5&&te.a.createElement("div",{className:Ce.a.noPassText},te.a.createElement("i",{className:"iconfont icon-weitongguo1"}),"\u5BA1\u6838\u4E0D\u901A\u8FC7",te.a.createElement("span",{onClick:Yi},"\u67E5\u770B\u539F\u56E0")))),te.a.createElement(E.a,{type:"primary",ghost:!0,onClick:Qr},"\u9000\u51FA\u7F16\u8F91"),te.a.createElement(E.a,{disabled:Ni,loading:yi,type:"primary",onClick:function(){pi.current=!0,Vr.submit()}},"\u4FDD\u5B58 "),Ut?te.a.createElement(E.a,{disabled:yi,loading:Ni,style:{background:"#2FC25B",border:0},type:"primary",onClick:function(){pi.current=!1,Vr.submit()}},"\u7ACB\u5373\u4F53\u9A8C"):te.a.createElement(E.a,{disabled:yi,loading:Ni,type:"primary",onClick:function(){pi.current=!1,Vr.submit()}},"\u4FDD\u5B58\u5E76\u53D1\u5E03\u5BA1\u6838")))):null,te.a.createElement(K.a,{centered:!0,destroyOnClose:!0,footer:null,visible:ae,onCancel:function(){return G(!1)},title:"\u76F8\u4F3C\u6027\u68C0\u6D4B",width:"600px"},te.a.createElement("div",null,te.a.createElement("p",{className:"font14"},"\u7ECF\u7CFB\u7EDF\u68C0\u6D4B\u53D1\u73B0\uFF0C\u672C\u9898\u76EE\u4E0E\u7CFB\u7EDF\u4E2D\u5DF2\u521B\u5EFA\u7684\u9898\u76EE\u9AD8\u5EA6\u96F7\u540C\uFF0C\u8BF7\u8C03\u6574\u9898\u76EE\u540E\u518D\u8FDB\u884C\u4FDD\u5B58"),te.a.createElement(a.a,{dataSource:tr,bordered:!1,scroll:tr.length>7?{y:300}:{},columns:[{title:"\u76F8\u4F3C\u9898\u9898\u76EE",dataIndex:"name",ellipsis:!0,render:function(jt,mr){return te.a.createElement("span",{onClick:function(){return Ur(mr==null?void 0:mr.identifier)},style:{textDecorationLine:"underline"},className:"current c-light-primary"},jt)}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"create_time",width:170,render:function(jt){var mr;return(mr=rr()(jt))===null||mr===void 0?void 0:mr.format("YYYY-MM-DD HH:mm")}}],pagination:!1}))))};function sn(yt){var kt,Ct,Ar=yt.ischecked,Wr=yt.formValue,Yt=yt.hack,Ut=yt.onChangeAverage,Pr=yt.onChangeScore,yn=yt.onChangehide,Vr=yt.onChangeFile,dt=yt.onAddTestCase,At=yt.onRemoveTestCase,$t=yt.uploadData,hr=yt.setUploadData,vr=yt.handleUploadRatio,Er=yt.pointData,ae=yt.sourceData,G=yt.getPointData,Y=Yt.test_set_average,ie=Yt.test_set_score,de=Object(ne.useState)(!1),oe=Object(N.a)(de,2),ze=oe[0],ft=oe[1],St=Object(ne.useState)(!1),Ft=Object(N.a)(St,2),mt=Ft[0],Gt=Ft[1],Vt=function(qt,sr){var gr=Object(u.a)($t);gr.splice(sr,1),Y?vr(gr):hr(gr)},Hr=function(qt,sr){console.log(qt,sr);var gr=$t.map(function(en,fn){return fn===sr?Object(P.a)(Object(P.a)({},en),{},{score:qt.target.value?Number(qt.target.value):0}):en});hr(gr)},cn=function(qt){var sr=$t.concat(qt);Yt.test_set_average?vr(sr):hr(sr)};function rn(pr){pr.stopPropagation()}function tr(){if(Object(fr.v)()){Gt("practice");return}var pr="";K.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",content:te.a.createElement("div",null,te.a.createElement(W.a,{placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:function(sr){pr=sr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qt=Object(x.a)(q.a.mark(function gr(){var en;return q.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(ve.a)("/api/tag_disciplines.json",{method:"post",body:{target:"practice",name:pr}});case 2:en=Sn.sent,(en==null?void 0:en.status)===0&&G();case 4:case"end":return Sn.stop()}},gr)}));function sr(){return qt.apply(this,arguments)}return sr}()})}function $r(){if(Object(fr.v)()){Gt("practice_source");return}var pr="";K.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u6765\u6E90",content:te.a.createElement("div",null,te.a.createElement(W.a,{placeholder:"\u8BF7\u8F93\u5165\u6765\u6E90\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:function(sr){pr=sr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qt=Object(x.a)(q.a.mark(function gr(){var en;return q.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(ve.a)("/api/tag_disciplines.json",{method:"post",body:{target:"practice_source",name:pr}});case 2:en=Sn.sent,(en==null?void 0:en.status)===0&&G();case 4:case"end":return Sn.stop()}},gr)}));function sr(){return qt.apply(this,arguments)}return sr}()})}return te.a.createElement("div",{className:Ce.a["oj-left-panel"]},te.a.createElement("div",{className:Ce.a["oj-form-info"]},te.a.createElement(j.a.Item,{label:"\u9898\u76EE\u540D\u79F0",name:["hack","name"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0"}],className:Ce.a.inputOne},te.a.createElement(W.a,{bordered:!1,maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0",suffix:te.a.createElement("span",null,(Wr==null||((kt=Wr.hack)===null||kt===void 0||((Ct=kt.name)===null||Ct===void 0))?void 0:Ct.length)||0,"/",te.a.createElement("span",{className:"c-grey-999"},"60"))})),te.a.createElement(j.a.Item,{name:["hack","description"],valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},te.a.createElement(Z.a,{placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u63CF\u8FF0\u2026",miniToolbar:!0,id:"moop_cases_content",noStorage:!0,height:200})),te.a.createElement("div",{className:Ce.a.row},te.a.createElement("div",{className:Ce.a.a},te.a.createElement(j.a.Item,{label:"\u96BE\u6613\u5EA6",name:["hack","difficulty"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},te.a.createElement(d.a,null,se(he.difficulty)))),te.a.createElement("div",{className:Ce.a.b},te.a.createElement(j.a.Item,{label:"\u9898\u76EE\u6765\u6E90",name:["hack","source_discipline_ids"]},te.a.createElement(d.a,{placeholder:"\u9009\u62E9\u9898\u76EE\u6765\u6E90",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:function(qt){return qt.parentNode}},ae.map(function(pr){return te.a.createElement(d.a.Option,{key:pr.id,value:pr.id},pr.name)}))),te.a.createElement(E.a,{style:{padding:"0 18px"},type:"primary",ghost:!0,onClick:function(){return $r()}},Object(fr.v)()?"\u6765\u6E90\u7BA1\u7406":"\u65B0\u5EFA\u6765\u6E90"))),te.a.createElement("div",{className:Ce.a.row},te.a.createElement("div",{className:Ce.a.b,style:{width:"100%",marginLeft:0}},te.a.createElement(j.a.Item,{label:"\u77E5\u8BC6\u70B9",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"}],name:["hack","tag_discipline_ids"]},te.a.createElement(d.a,{placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:function(qt){return qt.parentNode}},Er.map(function(pr){return te.a.createElement(d.a.Option,{key:pr.id,value:pr.id},pr.name)}))),te.a.createElement(E.a,{type:"primary",ghost:!0,onClick:function(){return tr()}},Object(fr.v)()?"\u77E5\u8BC6\u70B9\u7BA1\u7406":"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))),te.a.createElement("div",{className:Ce.a.field},te.a.createElement(j.a.Item,{label:"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236",name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],className:Ce.a.inputTwo,extra:te.a.createElement("span",{style:{position:"absolute",left:200,top:11,color:"#333"}},"\u79D2",te.a.createElement("span",{className:"ml5 c-grey-999"},"(\u4EE3\u7801\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F)"))},te.a.createElement(r.a,{style:{width:185},min:3}))),te.a.createElement("div",{className:"tst-case-info"},te.a.createElement("h3",{className:"flex-container",style:{justifyContent:"space-between"}}," ","\u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219",!Yt.is_file&&te.a.createElement(E.a,{style:{height:40},type:"primary",ghost:!0,onClick:dt},"\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B")),te.a.createElement(j.a.Item,{name:["hack","test_set_score"]},te.a.createElement(c.a.Group,{onChange:Pr},te.a.createElement(c.a,{value:!0},"\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6",te.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")),te.a.createElement(c.a,{value:!1},"\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6",te.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")))),te.a.createElement(S.a,{style:{marginBottom:"5px"},checked:Ar,onChange:yn},"\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u505A\u9898\u8FC7\u7A0B\u4E2D\u65E0\u6CD5\u770B\u5230\u5B9E\u9645\u8F93\u51FA\u7ED3\u679C\uFF0C\u4EC5\u5C55\u793A\u662F\u5426\u8BC4\u6D4B\u662F\u5426\u901A\u8FC7\uFF09"),te.a.createElement(j.a.Item,{className:Ce.a.testJi,name:["hack","is_file"],label:"\u7528\u4F8B\u7C7B\u578B:"},te.a.createElement(c.a.Group,{onChange:Vr},te.a.createElement(v.a,{direction:"horizontal"},te.a.createElement(c.a,{value:!1},"\u6587\u672C"),te.a.createElement(c.a,{value:!0},"\u6587\u4EF6")))),!Yt.test_set_score&&te.a.createElement(j.a.Item,{name:["hack","test_set_average"],label:"\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4"},te.a.createElement(c.a.Group,{onChange:Ut},te.a.createElement(c.a,{value:!0},"\u5747\u5206\u6BD4\u4F8B"),te.a.createElement(c.a,{value:!1},"\u81EA\u5B9A\u4E49\u6BD4\u4F8B"))),Yt.is_file&&te.a.createElement("div",{className:Ce.a.upBtn},te.a.createElement(E.a,{ghost:!0,type:"primary",className:"mb20",onClick:function(){return ft(!0)}},"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"),te.a.createElement(Pt.a,{disabled:Yt==null?void 0:Yt.test_set_average,inputChange:Hr,showScore:!Yt.test_set_score,data:$t,onRemove:Vt})),!Yt.is_file&&te.a.createElement(j.a.List,{name:"hack_sets"},function(pr,qt){return Object(T.a)(qt),te.a.createElement(z.a,{accordion:!0},pr.map(function(sr,gr){return te.a.createElement(Sr,{key:"".concat(sr.key,"--").concat(gr),header:te.a.createElement("a",{className:Ce.a["test-case-name"]},te.a.createElement("span",null,"\u6D4B\u8BD5\u7528\u4F8B",gr+1),ie?null:te.a.createElement(te.a.Fragment,null,te.a.createElement(j.a.Item,{name:[sr.name,"score"],fieldKey:[sr.fieldKey,"score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6".concat(gr+1,"\u8BC4\u5206")}]},te.a.createElement(r.a,{onClick:rn,min:0,max:100,disabled:Y})),te.a.createElement("span",null,"%"))),extra:gr>0?te.a.createElement("div",{onClick:rn},te.a.createElement(g.a,{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u5B9A\u5220\u9664\u6D4B\u8BD5\u96C6\b"+(gr+1),onConfirm:function(){At(gr)}},te.a.createElement(X.a,{className:Ce.a["btn-remove-case"]}))):null},te.a.createElement(j.a.Item,{label:"\u8F93\u5165",name:[sr.name,"input"],fieldKey:[sr.fieldKey,"input"]},te.a.createElement(Ht,null)),te.a.createElement(j.a.Item,{label:"\u8F93\u51FA",name:[sr.name,"output"],fieldKey:[sr.fieldKey,"output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},te.a.createElement(Ht,null)))}))}))),te.a.createElement(Pt.b,{rootIdentifier:null,visible:ze,onClose:function(){return ft(!1)},onOK:cn}),te.a.createElement(vt,{visible:mt,onCancel:function(){Gt(!1),G()},onOK:function(){Gt(!1),G()}}))}},rdUC:function(I,$,R){var M=R("MFOe"),g=M.Global;I.exports={name:"localStorage",read:D,write:v,each:f,remove:S,clearAll:y};function T(){return g.localStorage}function D(c){return T().getItem(c)}function v(c,o){return T().setItem(c,o)}function f(c){for(var o=T().length-1;o>=0;o--){var r=T().key(o);c(D(r),r)}}function S(c){return T().removeItem(c)}function y(){return T().clear()}},sR1s:function(I,$,R){"use strict";R.d($,"b",function(){return D}),R.d($,"a",function(){return v}),R.d($,"c",function(){return f}),R.d($,"d",function(){return S});var M=R("U8pU"),g="RC_TABLE_KEY";function T(y){return y==null?[]:Array.isArray(y)?y:[y]}function D(y,c){if(!c&&typeof c!="number")return y;for(var o=T(c),r=y,s=0;s<o.length;s+=1){if(!r)return null;var d=o[s];r=r[d]}return r}function v(y){var c=[],o={};return y.forEach(function(r){for(var s=r||{},d=s.key,u=s.dataIndex,p=d||T(u).join("-")||g;o[p];)p="".concat(p,"_next");o[p]=!0,c.push(p)}),c}function f(){var y={};function c(d,u){u&&Object.keys(u).forEach(function(p){var m=u[p];m&&Object(M.a)(m)==="object"?(d[p]=d[p]||{},c(d[p],m)):d[p]=m})}for(var o=arguments.length,r=new Array(o),s=0;s<o;s++)r[s]=arguments[s];return r.forEach(function(d){c(y,d)}),y}function S(y){return y!=null}},sboe:function(I,$,R){"use strict";R.d($,"a",function(){return T});var M=R("q1tI"),g=R.n(M),T=M.createContext(null)},t23M:function(I,$,R){"use strict";var M=R("VTBJ"),g=R("1OyB"),T=R("vuIU"),D=R("Ji7U"),v=R("LK+K"),f=R("q1tI"),S=R.n(f),y=R("m+aA"),c=R("Zm9Q"),o=R("Kwbf"),r=R("c+Xe"),s=R("bdgK"),d="rc-observer-key",u=function(p){Object(D.a)(i,p);var m=Object(v.a)(i);function i(){var t;return Object(g.a)(this,i),t=m.apply(this,arguments),t.resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(a){var l=t.props.onResize,E=a[0].target,b=E.getBoundingClientRect(),h=b.width,L=b.height,O=E.offsetWidth,w=E.offsetHeight,C=Math.floor(h),x=Math.floor(L);if(t.state.width!==C||t.state.height!==x||t.state.offsetWidth!==O||t.state.offsetHeight!==w){var _={width:C,height:x,offsetWidth:O,offsetHeight:w};t.setState(_),l&&Promise.resolve().then(function(){l(Object(M.a)(Object(M.a)({},_),{},{offsetWidth:O,offsetHeight:w}))})}},t.setChildNode=function(a){t.childNode=a},t}return Object(T.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var a=this.props.disabled;if(a){this.destroyObserver();return}var l=Object(y.a)(this.childNode||this),E=l!==this.currentElement;E&&(this.destroyObserver(),this.currentElement=l),!this.resizeObserver&&l&&(this.resizeObserver=new s.default(this.onResize),this.resizeObserver.observe(l))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var a=this.props.children,l=Object(c.a)(a);if(l.length>1)Object(o.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(l.length===0)return Object(o.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var E=l[0];if(f.isValidElement(E)&&Object(r.c)(E)){var b=E.ref;l[0]=f.cloneElement(E,{ref:Object(r.a)(b,this.setChildNode)})}return l.length===1?l[0]:l.map(function(h,L){return!f.isValidElement(h)||"key"in h&&h.key!==null?h:f.cloneElement(h,{key:"".concat(d,"-").concat(L)})})}}]),i}(f.Component);u.displayName="ResizeObserver",$.a=u},uGsb:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("MlIO"),R("1uat"))})(this,function(M){return function(){var g=M,T=g.x64,D=T.Word,v=T.WordArray,f=g.algo,S=f.SHA512,y=f.SHA384=S.extend({_doReset:function(){this._hash=new v.init([new D.init(3418070365,3238371032),new D.init(1654270250,914150663),new D.init(2438529370,812702999),new D.init(355462360,4144912697),new D.init(1731405415,4290775857),new D.init(2394180231,1750603025),new D.init(3675008525,1694076839),new D.init(1203062813,3204075428)])},_doFinalize:function(){var c=S._doFinalize.call(this);return c.sigBytes-=16,c}});g.SHA384=S._createHelper(y),g.HmacSHA384=S._createHmacHelper(y)}(),M.SHA384})},uGxW:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("OLod"))})(this,function(M){return M.pad.NoPadding={pad:function(){},unpad:function(){}},M.pad.NoPadding})},uQRt:function(I,$,R){I.exports=M;function M(){return R("gaXo"),{}}},ulZh:function(I,$,R){typeof window!="undefined"&&function(g,T){I.exports=T()}(this,function(){return function(M){var g={};function T(D){if(g[D])return g[D].exports;var v=g[D]={i:D,l:!1,exports:{}};return M[D].call(v.exports,v,v.exports,T),v.l=!0,v.exports}return T.m=M,T.c=g,T.d=function(D,v,f){T.o(D,v)||Object.defineProperty(D,v,{enumerable:!0,get:f})},T.r=function(D){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})},T.t=function(D,v){if(v&1&&(D=T(D)),v&8)return D;if(v&4&&typeof D=="object"&&D&&D.__esModule)return D;var f=Object.create(null);if(T.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:D}),v&2&&typeof D!="string")for(var S in D)T.d(f,S,function(y){return D[y]}.bind(null,S));return f},T.n=function(D){var v=D&&D.__esModule?function(){return D.default}:function(){return D};return T.d(v,"a",v),v},T.o=function(D,v){return Object.prototype.hasOwnProperty.call(D,v)},T.p="/dist/",T(T.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(M,g,T){"use strict";var D=Object.prototype.hasOwnProperty,v="~";function f(){}Object.create&&(f.prototype=Object.create(null),new f().__proto__||(v=!1));function S(r,s,d){this.fn=r,this.context=s,this.once=d||!1}function y(r,s,d,u,p){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new S(d,u||r,p),i=v?v+s:s;return r._events[i]?r._events[i].fn?r._events[i]=[r._events[i],m]:r._events[i].push(m):(r._events[i]=m,r._eventsCount++),r}function c(r,s){--r._eventsCount===0?r._events=new f:delete r._events[s]}function o(){this._events=new f,this._eventsCount=0}o.prototype.eventNames=function(){var s=[],d,u;if(this._eventsCount===0)return s;for(u in d=this._events)D.call(d,u)&&s.push(v?u.slice(1):u);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(d)):s},o.prototype.listeners=function(s){var d=v?v+s:s,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var p=0,m=u.length,i=new Array(m);p<m;p++)i[p]=u[p].fn;return i},o.prototype.listenerCount=function(s){var d=v?v+s:s,u=this._events[d];return u?u.fn?1:u.length:0},o.prototype.emit=function(s,d,u,p,m,i){var t=v?v+s:s;if(!this._events[t])return!1;var a=this._events[t],l=arguments.length,E,b;if(a.fn){a.once&&this.removeListener(s,a.fn,void 0,!0);switch(l){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,d),!0;case 3:return a.fn.call(a.context,d,u),!0;case 4:return a.fn.call(a.context,d,u,p),!0;case 5:return a.fn.call(a.context,d,u,p,m),!0;case 6:return a.fn.call(a.context,d,u,p,m,i),!0}for(b=1,E=new Array(l-1);b<l;b++)E[b-1]=arguments[b];a.fn.apply(a.context,E)}else{var h=a.length,L;for(b=0;b<h;b++){a[b].once&&this.removeListener(s,a[b].fn,void 0,!0);switch(l){case 1:a[b].fn.call(a[b].context);break;case 2:a[b].fn.call(a[b].context,d);break;case 3:a[b].fn.call(a[b].context,d,u);break;case 4:a[b].fn.call(a[b].context,d,u,p);break;default:if(!E)for(L=1,E=new Array(l-1);L<l;L++)E[L-1]=arguments[L];a[b].fn.apply(a[b].context,E)}}}return!0},o.prototype.on=function(s,d,u){return y(this,s,d,u,!1)},o.prototype.once=function(s,d,u){return y(this,s,d,u,!0)},o.prototype.removeListener=function(s,d,u,p){var m=v?v+s:s;if(!this._events[m])return this;if(!d)return c(this,m),this;var i=this._events[m];if(i.fn)i.fn===d&&(!p||i.once)&&(!u||i.context===u)&&c(this,m);else{for(var t=0,a=[],l=i.length;t<l;t++)(i[t].fn!==d||p&&!i[t].once||u&&i[t].context!==u)&&a.push(i[t]);a.length?this._events[m]=a.length===1?a[0]:a:c(this,m)}return this},o.prototype.removeAllListeners=function(s){var d;return s?(d=v?v+s:s,this._events[d]&&c(this,d)):(this._events=new f,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=v,o.EventEmitter=o,M.exports=o},"./node_modules/url-toolkit/src/url-toolkit.js":function(M,g,T){(function(D){var v=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,f=/^([^\/?#]*)([^]*)$/,S=/(?:\/|^)\.(?=\/)/g,y=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,c={buildAbsoluteURL:function(o,r,s){if(s=s||{},o=o.trim(),r=r.trim(),!r){if(!s.alwaysNormalize)return o;var d=c.parseURL(o);if(!d)throw new Error("Error trying to parse base URL.");return d.path=c.normalizePath(d.path),c.buildURLFromParts(d)}var u=c.parseURL(r);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return s.alwaysNormalize?(u.path=c.normalizePath(u.path),c.buildURLFromParts(u)):r;var p=c.parseURL(o);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var m=f.exec(p.path);p.netLoc=m[1],p.path=m[2]}p.netLoc&&!p.path&&(p.path="/");var i={scheme:p.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(i.netLoc=p.netLoc,u.path[0]!=="/"))if(!u.path)i.path=p.path,u.params||(i.params=p.params,u.query||(i.query=p.query));else{var t=p.path,a=t.substring(0,t.lastIndexOf("/")+1)+u.path;i.path=c.normalizePath(a)}return i.path===null&&(i.path=s.alwaysNormalize?c.normalizePath(u.path):u.path),c.buildURLFromParts(i)},parseURL:function(o){var r=v.exec(o);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(o){for(o=o.split("").reverse().join("").replace(S,"");o.length!==(o=o.replace(y,"")).length;);return o.split("").reverse().join("")},buildURLFromParts:function(o){return o.scheme+o.netLoc+o.path+o.params+o.query+o.fragment}};M.exports=c})(this)},"./node_modules/webworkify-webpack/index.js":function(M,g,T){function D(s){var d={};function u(m){if(d[m])return d[m].exports;var i=d[m]={i:m,l:!1,exports:{}};return s[m].call(i.exports,i,i.exports,u),i.l=!0,i.exports}u.m=s,u.c=d,u.i=function(m){return m},u.d=function(m,i,t){u.o(m,i)||Object.defineProperty(m,i,{configurable:!1,enumerable:!0,get:t})},u.r=function(m){Object.defineProperty(m,"__esModule",{value:!0})},u.n=function(m){var i=m&&m.__esModule?function(){return m.default}:function(){return m};return u.d(i,"a",i),i},u.o=function(m,i){return Object.prototype.hasOwnProperty.call(m,i)},u.p="/",u.oe=function(m){throw console.error(m),m};var p=u(u.s=ENTRY_MODULE);return p.default||p}var v="[\\.|\\-|\\+|\\w|/|@]+",f="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+v+").*?\\)";function S(s){return(s+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function y(s){return!isNaN(1*s)}function c(s,d,u){var p={};p[u]=[];var m=d.toString(),i=m.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return p;for(var t=i[1],a=new RegExp("(\\\\n|\\W)"+S(t)+f,"g"),l;l=a.exec(m);){if(l[3]==="dll-reference")continue;p[u].push(l[3])}for(a=new RegExp("\\("+S(t)+'\\("(dll-reference\\s('+v+'))"\\)\\)'+f,"g");l=a.exec(m);)s[l[2]]||(p[u].push(l[1]),s[l[2]]=T(l[1]).m),p[l[2]]=p[l[2]]||[],p[l[2]].push(l[4]);for(var E=Object.keys(p),b=0;b<E.length;b++)for(var h=0;h<p[E[b]].length;h++)y(p[E[b]][h])&&(p[E[b]][h]=1*p[E[b]][h]);return p}function o(s){var d=Object.keys(s);return d.reduce(function(u,p){return u||s[p].length>0},!1)}function r(s,d){for(var u={main:[d]},p={main:[]},m={main:{}};o(u);)for(var i=Object.keys(u),t=0;t<i.length;t++){var a=i[t],l=u[a],E=l.pop();if(m[a]=m[a]||{},m[a][E]||!s[a][E])continue;m[a][E]=!0,p[a]=p[a]||[],p[a].push(E);for(var b=c(s,s[a][E],a),h=Object.keys(b),L=0;L<h.length;L++)u[h[L]]=u[h[L]]||[],u[h[L]]=u[h[L]].concat(b[h[L]])}return p}M.exports=function(s,d){d=d||{};var u={main:T.m},p=d.all?{main:Object.keys(u.main)}:r(u,s),m="";Object.keys(p).filter(function(E){return E!=="main"}).forEach(function(E){for(var b=0;p[E][b];)b++;p[E].push(b),u[E][b]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",m=m+"var "+E+" = ("+D.toString().replace("ENTRY_MODULE",JSON.stringify(b))+")({"+p[E].map(function(h){return""+JSON.stringify(h)+": "+u[E][h].toString()}).join(",")+`});
|
|
|
`}),m=m+"new (("+D.toString().replace("ENTRY_MODULE",JSON.stringify(s))+")({"+p.main.map(function(E){return""+JSON.stringify(E)+": "+u.main[E].toString()}).join(",")+"}))(self);";var i=new window.Blob([m],{type:"text/javascript"});if(d.bare)return i;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,a=t.createObjectURL(i),l=new window.Worker(a);return l.objectURL=a,l}},"./src/config.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"hlsDefaultConfig",function(){return L}),T.d(g,"mergeConfig",function(){return w}),T.d(g,"enableStreamingMode",function(){return C});var D=T("./src/controller/abr-controller.ts"),v=T("./src/controller/audio-stream-controller.ts"),f=T("./src/controller/audio-track-controller.ts"),S=T("./src/controller/subtitle-stream-controller.ts"),y=T("./src/controller/subtitle-track-controller.ts"),c=T("./src/controller/buffer-controller.ts"),o=T("./src/controller/timeline-controller.ts"),r=T("./src/controller/cap-level-controller.ts"),s=T("./src/controller/fps-controller.ts"),d=T("./src/controller/eme-controller.ts"),u=T("./src/controller/cmcd-controller.ts"),p=T("./src/utils/xhr-loader.ts"),m=T("./src/utils/fetch-loader.ts"),i=T("./src/utils/cues.ts"),t=T("./src/utils/mediakeys-helper.ts"),a=T("./src/utils/logger.ts");function l(){return l=Object.assign||function(x){for(var _=1;_<arguments.length;_++){var j=arguments[_];for(var N in j)Object.prototype.hasOwnProperty.call(j,N)&&(x[N]=j[N])}return x},l.apply(this,arguments)}function E(x,_){var j=Object.keys(x);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(x);_&&(N=N.filter(function(P){return Object.getOwnPropertyDescriptor(x,P).enumerable})),j.push.apply(j,N)}return j}function b(x){for(var _=1;_<arguments.length;_++){var j=arguments[_]!=null?arguments[_]:{};_%2?E(Object(j),!0).forEach(function(N){h(x,N,j[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(j)):E(Object(j)).forEach(function(N){Object.defineProperty(x,N,Object.getOwnPropertyDescriptor(j,N))})}return x}function h(x,_,j){return _ in x?Object.defineProperty(x,_,{value:j,enumerable:!0,configurable:!0,writable:!0}):x[_]=j,x}var L=b(b({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:D.default,bufferController:c.default,capLevelController:r.default,fpsController:s.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:t.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:S.SubtitleStreamController,subtitleTrackController:y.default,timelineController:o.TimelineController,audioStreamController:v.default,audioTrackController:f.default,emeController:d.default,cmcdController:u.default});function O(){return{cueHandler:i.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function w(x,_){if((_.liveSyncDurationCount||_.liveMaxLatencyDurationCount)&&(_.liveSyncDuration||_.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(_.liveMaxLatencyDurationCount!==void 0&&(_.liveSyncDurationCount===void 0||_.liveMaxLatencyDurationCount<=_.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(_.liveMaxLatencyDuration!==void 0&&(_.liveSyncDuration===void 0||_.liveMaxLatencyDuration<=_.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return l({},x,_)}function C(x){var _=x.loader;if(_!==m.default&&_!==p.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var j=Object(m.fetchSupported)();j&&(x.loader=m.default,x.progressive=!0,x.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/polyfills/number.ts"),v=T("./src/utils/ewma-bandwidth-estimator.ts"),f=T("./src/events.ts"),S=T("./src/utils/buffer-helper.ts"),y=T("./src/errors.ts"),c=T("./src/types/loader.ts"),o=T("./src/utils/logger.ts");function r(u,p){for(var m=0;m<p.length;m++){var i=p[m];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function s(u,p,m){return p&&r(u.prototype,p),m&&r(u,m),u}var d=function(){function u(m){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=m;var i=m.config;this.bwEstimator=new v.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var p=u.prototype;return p.registerListeners=function(){var i=this.hls;i.on(f.Events.FRAG_LOADING,this.onFragLoading,this),i.on(f.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(f.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(f.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(f.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var i=this.hls;i.off(f.Events.FRAG_LOADING,this.onFragLoading,this),i.off(f.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(f.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(f.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(f.Events.ERROR,this.onError,this)},p.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},p.onFragLoading=function(i,t){var a=t.frag;if(a.type===c.PlaylistLevelType.MAIN&&!this.timer){var l;this.fragCurrent=a,this.partCurrent=(l=t.part)!=null?l:null,this.timer=self.setInterval(this.onCheck,100)}},p.onLevelLoaded=function(i,t){var a=this.hls.config;t.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},p._abandonRulesCheck=function(){var i=this.fragCurrent,t=this.partCurrent,a=this.hls,l=a.autoLevelEnabled,E=a.config,b=a.media;if(!i||!b)return;var h=t?t.stats:i.stats,L=t?t.duration:i.duration;if(h.aborted){o.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!l||b.paused||!b.playbackRate||!b.readyState)return;var O=performance.now()-h.loading.start,w=Math.abs(b.playbackRate);if(O<=500*L/w)return;var C=a.levels,x=a.minAutoLevel,_=C[i.level],j=h.total||Math.max(h.loaded,Math.round(L*_.maxBitrate/8)),N=Math.max(1,h.bwEstimate?h.bwEstimate/8:h.loaded*1e3/O),P=(j-h.loaded)/N,V=b.currentTime,z=(S.BufferHelper.bufferInfo(b,V,E.maxBufferHole).end-V)/w;if(z>=2*L/w||P<=z)return;var B=Number.POSITIVE_INFINITY,K;for(K=i.level-1;K>x;K--){var U=C[K].maxBitrate;if(B=L*U/(8*.8*N),B<z)break}if(B>=P)return;var W=this.bwEstimator.getEstimate();o.logger.warn("Fragment "+i.sn+(t?" part "+t.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+K+`
|
|
|
Current BW estimate: `+(Object(D.isFiniteNumber)(W)?(W/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+P.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+B.toFixed(3)+` s
|
|
|
Time to underbuffer: `+z.toFixed(3)+" s"),a.nextLoadLevel=K,this.bwEstimator.sample(O,h.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),a.trigger(f.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:t,stats:h})},p.onFragLoaded=function(i,t){var a=t.frag,l=t.part;if(a.type===c.PlaylistLevelType.MAIN&&Object(D.isFiniteNumber)(a.sn)){var E=l?l.stats:a.stats,b=l?l.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var h=this.hls.levels[a.level],L=(h.loaded?h.loaded.bytes:0)+E.loaded,O=(h.loaded?h.loaded.duration:0)+b;h.loaded={bytes:L,duration:O},h.realBitrate=Math.round(8*L/O)}if(a.bitrateTest){var w={stats:E,frag:a,part:l,id:a.type};this.onFragBuffered(f.Events.FRAG_BUFFERED,w),a.bitrateTest=!1}}},p.onFragBuffered=function(i,t){var a=t.frag,l=t.part,E=l?l.stats:a.stats;if(E.aborted)return;if(a.type!==c.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var b=E.parsing.end-E.loading.start;this.bwEstimator.sample(b,E.loaded),E.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=b/1e3:this.bitrateTestDelay=0},p.onError=function(i,t){switch(t.details){case y.ErrorDetails.FRAG_LOAD_ERROR:case y.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},p.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},p.getNextABRAutoLevel=function(){var i=this.fragCurrent,t=this.partCurrent,a=this.hls,l=a.maxAutoLevel,E=a.config,b=a.minAutoLevel,h=a.media,L=t?t.duration:i?i.duration:0,O=h?h.currentTime:0,w=h&&h.playbackRate!==0?Math.abs(h.playbackRate):1,C=this.bwEstimator?this.bwEstimator.getEstimate():E.abrEwmaDefaultEstimate,x=(S.BufferHelper.bufferInfo(h,O,E.maxBufferHole).end-O)/w,_=this.findBestLevel(C,b,l,x,E.abrBandWidthFactor,E.abrBandWidthUpFactor);if(_>=0)return _;o.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var j=L?Math.min(L,E.maxStarvationDelay):E.maxStarvationDelay,N=E.abrBandWidthFactor,P=E.abrBandWidthUpFactor;if(!x){var V=this.bitrateTestDelay;if(V){var z=L?Math.min(L,E.maxLoadingDelay):E.maxLoadingDelay;j=z-V,o.logger.trace("bitrate test took "+Math.round(1e3*V)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*j)+" ms"),N=P=1}}return _=this.findBestLevel(C,b,l,x+j,N,P),Math.max(_,0)},p.findBestLevel=function(i,t,a,l,E,b){for(var h,L=this.fragCurrent,O=this.partCurrent,w=this.lastLoadedFragLevel,C=this.hls.levels,x=C[w],_=!!(x!=null&&(h=x.details)!==null&&h!==void 0&&h.live),j=x==null?void 0:x.codecSet,N=O?O.duration:L?L.duration:0,P=a;P>=t;P--){var V=C[P];if(!V||j&&V.codecSet!==j)continue;var z=V.details,B=(O?z==null?void 0:z.partTarget:z==null?void 0:z.averagetargetduration)||N,K=void 0;P<=w?K=E*i:K=b*i;var U=C[P].maxBitrate,W=U*B/K;if(o.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+P+"/"+Math.round(K)+"/"+U+"/"+B+"/"+l+"/"+W),K>U&&(!W||_&&!this.bitrateTestDelay||W<l))return P}return-1},s(u,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,t=this.bwEstimator;if(i!==-1&&(!t||!t.canEstimate()))return i;var a=this.getNextABRAutoLevel();return i!==-1&&(a=Math.min(i,a)),a},set:function(i){this._nextAutoLevel=i}}]),u}();g.default=d},"./src/controller/audio-stream-controller.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/polyfills/number.ts"),v=T("./src/controller/base-stream-controller.ts"),f=T("./src/events.ts"),S=T("./src/utils/buffer-helper.ts"),y=T("./src/controller/fragment-tracker.ts"),c=T("./src/types/level.ts"),o=T("./src/types/loader.ts"),r=T("./src/loader/fragment.ts"),s=T("./src/demux/chunk-cache.ts"),d=T("./src/demux/transmuxer-interface.ts"),u=T("./src/types/transmuxer.ts"),p=T("./src/controller/fragment-finders.ts"),m=T("./src/utils/discontinuities.ts"),i=T("./src/errors.ts"),t=T("./src/utils/logger.ts");function a(){return a=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var w=arguments[O];for(var C in w)Object.prototype.hasOwnProperty.call(w,C)&&(L[C]=w[C])}return L},a.apply(this,arguments)}function l(L,O){L.prototype=Object.create(O.prototype),L.prototype.constructor=L,E(L,O)}function E(L,O){return E=Object.setPrototypeOf||function(C,x){return C.__proto__=x,C},E(L,O)}var b=100,h=function(L){l(O,L);function O(C,x){var _;return _=L.call(this,C,x,"[audio-stream-controller]")||this,_.videoBuffer=null,_.videoTrackCC=-1,_.waitingVideoCC=-1,_.audioSwitch=!1,_.trackId=-1,_.waitingData=null,_.mainDetails=null,_.bufferFlushed=!1,_._registerListeners(),_}var w=O.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var x=this.hls;x.on(f.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(f.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(f.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(f.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(f.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(f.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(f.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(f.Events.ERROR,this.onError,this),x.on(f.Events.BUFFER_RESET,this.onBufferReset,this),x.on(f.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(f.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(f.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(f.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var x=this.hls;x.off(f.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(f.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(f.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(f.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(f.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(f.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(f.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(f.Events.ERROR,this.onError,this),x.off(f.Events.BUFFER_RESET,this.onBufferReset,this),x.off(f.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(f.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(f.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(f.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onInitPtsFound=function(x,_){var j=_.frag,N=_.id,P=_.initPTS;if(N==="main"){var V=j.cc;this.initPTS[j.cc]=P,this.log("InitPTS for cc: "+V+" found from main: "+P),this.videoTrackCC=V,this.state===v.State.WAITING_INIT_PTS&&this.tick()}},w.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=v.State.STOPPED;return}var _=this.lastCurrentTime;this.stopLoad(),this.setInterval(b),this.fragLoadError=0,_>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),this.state=v.State.IDLE):(this.loadedmetadata=!1,this.state=v.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},w.doTick=function(){switch(this.state){case v.State.IDLE:this.doTickIdle();break;case v.State.WAITING_TRACK:{var x,_=this.levels,j=this.trackId,N=_==null||((x=_[j])===null||x===void 0)?void 0:x.details;if(N){if(this.waitForCdnTuneIn(N))break;this.state=v.State.WAITING_INIT_PTS}break}case v.State.FRAG_LOADING_WAITING_RETRY:{var P,V=performance.now(),z=this.retryDate;(!z||V>=z||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=v.State.IDLE);break}case v.State.WAITING_INIT_PTS:{var B=this.waitingData;if(B){var K=B.frag,U=B.part,W=B.cache,H=B.complete;if(this.initPTS[K.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=v.State.FRAG_LOADING;var q=W.flush(),ne={frag:K,part:U,payload:q,networkDetails:null};this._handleFragmentLoadProgress(ne),H&&L.prototype._handleFragmentLoadComplete.call(this,ne)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+K.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var te=this.getLoadPosition(),_e=S.BufferHelper.bufferInfo(this.mediaBuffer,te,this.config.maxBufferHole),Ce=Object(p.fragmentWithinToleranceTest)(_e.end,this.config.maxFragLookUpTolerance,K);Ce<0&&(t.logger.log("Waiting fragment cc ("+K.cc+") @ "+K.start+" cancelled because another fragment at "+_e.end+" is needed"),this.clearWaitingFragment())}}else this.state=v.State.IDLE}}this.onTickEnd()},w.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=v.State.IDLE)},w.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},w.doTickIdle=function(){var x,_,j=this.hls,N=this.levels,P=this.media,V=this.trackId,z=j.config;if(!N||!N[V])return;if(!P&&(this.startFragRequested||!z.startFragPrefetch))return;var B=N[V],K=B.details;if(!K||K.live&&this.levelLastLoaded!==V||this.waitForCdnTuneIn(K)){this.state=v.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,r.ElementaryStreamTypes.AUDIO,o.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,o.PlaylistLevelType.AUDIO);if(U===null)return;var W=U.len,H=this.getMaxBufferLength(),q=this.audioSwitch;if(W>=H&&!q)return;if(!q&&this._streamEnded(U,K)){j.trigger(f.Events.BUFFER_EOS,{type:"audio"}),this.state=v.State.ENDED;return}var ne=K.fragments,te=ne[0].start,_e=U.end;if(q){var Ce=this.getLoadPosition();_e=Ce,K.PTSKnown&&Ce<te&&((U.end>te||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),P.currentTime=te+.05))}var me=this.getNextFragment(_e,K);if(!me){this.bufferFlushed=!0;return}((x=me.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((_=me.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(me,K):this.loadFragment(me,K,_e)},w.getMaxBufferLength=function(){var x=L.prototype.getMaxBufferLength.call(this),_=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,o.PlaylistLevelType.MAIN);return _===null?x:Math.max(x,_.len)},w.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},w.onAudioTracksUpdated=function(x,_){var j=_.audioTracks;this.resetTransmuxer(),this.levels=j.map(function(N){return new c.Level(N)})},w.onAudioTrackSwitching=function(x,_){var j=!!_.url;this.trackId=_.id;var N=this.fragCurrent;N!=null&&N.loader&&N.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),j?this.setInterval(b):this.resetTransmuxer(),j?(this.audioSwitch=!0,this.state=v.State.IDLE):this.state=v.State.STOPPED,this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},w.onLevelLoaded=function(x,_){this.mainDetails=_.details},w.onAudioTrackLoaded=function(x,_){var j,N=this.levels,P=_.details,V=_.id;if(!N){this.warn("Audio tracks were reset while loading level "+V);return}this.log("Track "+V+" loaded ["+P.startSN+","+P.endSN+"],duration:"+P.totalduration);var z=N[V],B=0;if(P.live||(j=z.details)!==null&&j!==void 0&&j.live){var K=this.mainDetails;if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed||!K)return;!z.details&&P.hasProgramDateTime&&K.hasProgramDateTime?(Object(m.alignMediaPlaylistByPDT)(P,K),B=P.fragments[0].start):B=this.alignPlaylists(P,z.details)}z.details=P,this.levelLastLoaded=V,!this.startFragRequested&&(this.mainDetails||!P.live)&&this.setStartPosition(z.details,B),this.state===v.State.WAITING_TRACK&&!this.waitForCdnTuneIn(P)&&(this.state=v.State.IDLE),this.tick()},w._handleFragmentLoadProgress=function(x){var _,j=x.frag,N=x.part,P=x.payload,V=this.config,z=this.trackId,B=this.levels;if(!B){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 K=B[z];console.assert(K,"Audio track is defined on fragment load progress");var U=K.details;console.assert(U,"Audio track details are defined on fragment load progress");var W=V.defaultAudioCodec||K.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new d.default(this.hls,o.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var q=this.initPTS[j.cc],ne=(_=j.initSegment)===null||_===void 0?void 0:_.data;if(q!==void 0){var te=!1,_e=N?N.index:-1,Ce=_e!==-1,me=new u.ChunkMetadata(j.level,j.sn,j.stats.chunkCount,P.byteLength,_e,Ce);H.push(P,ne,W,"",j,N,U.totalduration,te,me,q)}else{t.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 Me=this.waitingData=this.waitingData||{frag:j,part:N,cache:new s.default,complete:!1},Oe=Me.cache;Oe.push(new Uint8Array(P)),this.waitingVideoCC=this.videoTrackCC,this.state=v.State.WAITING_INIT_PTS}},w._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,x)},w.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},w.onBufferCreated=function(x,_){var j=_.tracks.audio;j&&(this.mediaBuffer=j.buffer),_.tracks.video&&(this.videoBuffer=_.tracks.video.buffer)},w.onFragBuffered=function(x,_){var j=_.frag,N=_.part;if(j.type!==o.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(j)){this.warn("Fragment "+j.sn+(N?" p: "+N.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(f.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(j,N)},w.onError=function(x,_){switch(_.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(o.PlaylistLevelType.AUDIO,_);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==v.State.ERROR&&this.state!==v.State.STOPPED&&(this.state=_.fatal?v.State.ERROR:v.State.IDLE,this.warn(_.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="audio"&&(this.state===v.State.PARSING||this.state===v.State.PARSED)){var j=!0,N=this.getFwdBufferInfo(this.mediaBuffer,o.PlaylistLevelType.AUDIO);N&&N.len>.5&&(j=!this.reduceMaxBufferLength(N.len)),j&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},w.onBufferFlushed=function(x,_){var j=_.type;j===r.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},w._handleTransmuxComplete=function(x){var _,j="audio",N=this.hls,P=x.remuxResult,V=x.chunkMeta,z=this.getCurrentContext(V);if(!z){this.warn("The loading context changed while buffering fragment "+V.sn+" of level "+V.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(V.level);return}var B=z.frag,K=z.part,U=P.audio,W=P.text,H=P.id3,q=P.initSegment;if(this.fragContextChanged(B))return;if(this.state=v.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),q!=null&&q.tracks&&(this._bufferInitSegment(q.tracks,B,V),N.trigger(f.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:j,tracks:q.tracks})),U){var ne=U.startPTS,te=U.endPTS,_e=U.startDTS,Ce=U.endDTS;K&&(K.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:te,startDTS:_e,endDTS:Ce}),B.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,ne,te,_e,Ce),this.bufferFragmentData(U,B,K,V)}if(H!=null&&(_=H.samples)!==null&&_!==void 0&&_.length){var me=a({frag:B,id:j},H);N.trigger(f.Events.FRAG_PARSING_METADATA,me)}if(W){var Me=a({frag:B,id:j},W);N.trigger(f.Events.FRAG_PARSING_USERDATA,Me)}},w._bufferInitSegment=function(x,_,j){if(this.state!==v.State.PARSING)return;x.video&&delete x.video;var N=x.audio;if(!N)return;N.levelCodec=N.codec,N.id="audio",this.log("Init audio buffer, container:"+N.container+", codecs[parsed]=["+N.codec+"]"),this.hls.trigger(f.Events.BUFFER_CODECS,x);var P=N.initSegment;if(P!=null&&P.byteLength){var V={type:"audio",frag:_,part:null,chunkMeta:j,parent:_.type,data:P};this.hls.trigger(f.Events.BUFFER_APPENDING,V)}this.tick()},w.loadFragment=function(x,_,j){var N=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||N===y.FragmentState.NOT_LOADED||N===y.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):_.live&&!Object(D.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=v.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,x,_,j)))},w.completeAudioSwitch=function(){var x=this.hls,_=this.media,j=this.trackId;_&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(f.Events.AUDIO_TRACK_SWITCHED,{id:j})},O}(v.default);g.default=h},"./src/controller/audio-track-controller.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/events.ts"),v=T("./src/errors.ts"),f=T("./src/controller/base-playlist-controller.ts"),S=T("./src/types/loader.ts");function y(d,u){for(var p=0;p<u.length;p++){var m=u[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}function c(d,u,p){return u&&y(d.prototype,u),p&&y(d,p),d}function o(d,u){d.prototype=Object.create(u.prototype),d.prototype.constructor=d,r(d,u)}function r(d,u){return r=Object.setPrototypeOf||function(m,i){return m.__proto__=i,m},r(d,u)}var s=function(d){o(u,d);function u(m){var i;return i=d.call(this,m,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var p=u.prototype;return p.registerListeners=function(){var i=this.hls;i.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(D.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(D.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var i=this.hls;i.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(D.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(D.Events.ERROR,this.onError,this)},p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,d.prototype.destroy.call(this)},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},p.onManifestParsed=function(i,t){this.tracks=t.audioTracks||[]},p.onAudioTrackLoaded=function(i,t){var a=t.id,l=t.details,E=this.tracksInGroup[a];if(!E){this.warn("Invalid audio track id "+a);return}var b=E.details;E.details=t.details,this.log("audioTrack "+a+" loaded ["+l.startSN+"-"+l.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,t,b))},p.onLevelLoading=function(i,t){this.switchLevel(t.level)},p.onLevelSwitching=function(i,t){this.switchLevel(t.level)},p.switchLevel=function(i){var t=this.hls.levels[i];if(!(t!=null&&t.audioGroupIds))return;var a=t.audioGroupIds[t.urlId];if(this.groupId!==a){this.groupId=a;var l=this.tracks.filter(function(b){return!a||b.groupId===a});this.selectDefaultTrack&&!l.some(function(b){return b.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=l;var E={audioTracks:l};this.log("Updating audio tracks, "+l.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(D.Events.AUDIO_TRACKS_UPDATED,E),this.selectInitialTrack()}},p.onError=function(i,t){if(d.prototype.onError.call(this,i,t),t.fatal||!t.context)return;t.context.type===S.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},p.setAudioTrack=function(i){var t=this.tracksInGroup;if(i<0||i>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=t[this.trackId];this.log("Now switching to audio-track index "+i);var l=t[i],E=l.id,b=l.groupId,h=b===void 0?"":b,L=l.name,O=l.type,w=l.url;if(this.trackId=i,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(D.Events.AUDIO_TRACK_SWITCHING,{id:E,groupId:h,name:L,type:O,url:w}),l.details&&!l.details.live)return;var C=this.switchParams(l.url,a==null?void 0:a.details);this.loadPlaylist(C)},p.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,a=this.findTrackId(t)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},p.findTrackId=function(i){for(var t=this.tracksInGroup,a=0;a<t.length;a++){var l=t[a];if((!this.selectDefaultTrack||l.default)&&(!i||i===l.name))return l.id}return-1},p.loadPlaylist=function(i){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var a=t.id,l=t.groupId,E=t.url;if(i)try{E=i.addDirectives(E)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("loading audio-track playlist for id: "+a),this.clearTimer(),this.hls.trigger(D.Events.AUDIO_TRACK_LOADING,{url:E,id:a,groupId:l,deliveryDirectives:i||null})}},c(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),u}(f.default);g.default=s},"./src/controller/base-playlist-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return c});var D=T("./src/polyfills/number.ts"),v=T("./src/types/level.ts"),f=T("./src/controller/level-helper.ts"),S=T("./src/utils/logger.ts"),y=T("./src/errors.ts"),c=function(){function o(s,d){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=S.logger.log.bind(S.logger,d+":"),this.warn=S.logger.warn.bind(S.logger,d+":"),this.hls=s}var r=o.prototype;return r.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},r.onError=function(d,u){u.fatal&&u.type===y.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},r.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},r.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},r.stopLoad=function(){this.canLoad=!1,this.clearTimer()},r.switchParams=function(d,u){var p=u==null?void 0:u.renditionReports;if(p)for(var m=0;m<p.length;m++){var i=p[m],t=""+i.URI;if(t===d.substr(-t.length)){var a=parseInt(i["LAST-MSN"]),l=parseInt(i["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var E=Math.min(u.age-u.partTarget,u.targetduration);l!==void 0&&E>u.partTarget&&(l+=1)}if(Object(D.isFiniteNumber)(a))return new v.HlsUrlParameters(a,Object(D.isFiniteNumber)(l)?l:void 0,v.HlsSkip.No)}}},r.loadPlaylist=function(d){},r.shouldLoadTrack=function(d){return this.canLoad&&d&&!!d.url&&(!d.details||d.details.live)},r.playlistLoaded=function(d,u,p){var m=this,i=u.details,t=u.stats,a=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(i.advancedDateTime=Date.now()-a,i.live||p!=null&&p.live){if(i.reloaded(p),p&&this.log("live playlist "+d+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),p&&i.fragments.length>0&&Object(f.mergeDetails)(p,i),!this.canLoad||!i.live)return;var l,E=void 0,b=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var h=this.hls.config.lowLatencyMode,L=i.lastPartSn,O=i.endSN,w=i.lastPartIndex,C=w!==-1,x=L===O,_=h?0:w;C?(E=x?O+1:L,b=x?_:w+1):E=O+1;var j=i.age,N=j+i.ageHeader,P=Math.min(N-i.partTarget,i.targetduration*1.5);if(P>0){if(p&&P>p.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+p.tuneInGoal+" to: "+P+" with playlist age: "+i.age),P=0;else{var V=Math.floor(P/i.targetduration);if(E+=V,b!==void 0){var z=Math.round(P%i.targetduration/i.partTarget);b+=z}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+j.toFixed(2)+"s goal: "+P+" skip sn "+V+" to part "+b)}i.tuneInGoal=P}if(l=this.getDeliveryDirectives(i,u.deliveryDirectives,E,b),h||!x){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(i,u.deliveryDirectives,E,b);var B=Object(f.computeReloadInterval)(i,t);E!==void 0&&i.canBlockReload&&(B-=i.partTarget||1),this.log("reload live playlist "+d+" in "+Math.round(B)+" ms"),this.timer=self.setTimeout(function(){return m.loadPlaylist(l)},B)}else this.clearTimer()},r.getDeliveryDirectives=function(d,u,p,m){var i=Object(v.getSkipValue)(d,p);return u!=null&&u.skip&&d.deltaUpdateFailed&&(p=u.msn,m=u.part,i=v.HlsSkip.No),new v.HlsUrlParameters(p,m,i)},r.retryLoadingOrFail=function(d){var u=this,p=this.hls.config,m=this.retryCount<p.levelLoadingMaxRetry;if(m){var i;if(this.retryCount++,d.details.indexOf("LoadTimeOut")>-1&&(i=d.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+d.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*p.levelLoadingRetryDelay,p.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+d.details+'"')}}else this.warn('cannot recover from error "'+d.details+'"'),this.clearTimer(),d.fatal=!0;return m},o}()},"./src/controller/base-stream-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"State",function(){return O}),T.d(g,"default",function(){return w});var D=T("./src/polyfills/number.ts"),v=T("./src/task-loop.ts"),f=T("./src/controller/fragment-tracker.ts"),S=T("./src/utils/buffer-helper.ts"),y=T("./src/utils/logger.ts"),c=T("./src/events.ts"),o=T("./src/errors.ts"),r=T("./src/types/transmuxer.ts"),s=T("./src/utils/mp4-tools.ts"),d=T("./src/utils/discontinuities.ts"),u=T("./src/controller/fragment-finders.ts"),p=T("./src/controller/level-helper.ts"),m=T("./src/loader/fragment-loader.ts"),i=T("./src/crypt/decrypter.ts"),t=T("./src/utils/time-ranges.ts"),a=T("./src/types/loader.ts");function l(C,x){for(var _=0;_<x.length;_++){var j=x[_];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(C,j.key,j)}}function E(C,x,_){return x&&l(C.prototype,x),_&&l(C,_),C}function b(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function h(C,x){C.prototype=Object.create(x.prototype),C.prototype.constructor=C,L(C,x)}function L(C,x){return L=Object.setPrototypeOf||function(j,N){return j.__proto__=N,j},L(C,x)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},w=function(C){h(x,C);function x(j,N,P){var V;return V=C.call(this)||this,V.hls=void 0,V.fragPrevious=null,V.fragCurrent=null,V.fragmentTracker=void 0,V.transmuxer=null,V._state=O.STOPPED,V.media=void 0,V.mediaBuffer=void 0,V.config=void 0,V.bitrateTest=!1,V.lastCurrentTime=0,V.nextLoadPosition=0,V.startPosition=0,V.loadedmetadata=!1,V.fragLoadError=0,V.retryDate=0,V.levels=null,V.fragmentLoader=void 0,V.levelLastLoaded=null,V.startFragRequested=!1,V.decrypter=void 0,V.initPTS=[],V.onvseeking=null,V.onvended=null,V.logPrefix="",V.log=void 0,V.warn=void 0,V.logPrefix=P,V.log=y.logger.log.bind(y.logger,P+":"),V.warn=y.logger.warn.bind(y.logger,P+":"),V.hls=j,V.fragmentLoader=new m.default(j.config),V.fragmentTracker=N,V.config=j.config,V.decrypter=new i.default(j,j.config),j.on(c.Events.KEY_LOADED,V.onKeyLoaded,b(V)),V}var _=x.prototype;return _.doTick=function(){this.onTickEnd()},_.onTickEnd=function(){},_.startLoad=function(N){},_.stopLoad=function(){this.fragmentLoader.abort();var N=this.fragCurrent;N&&this.fragmentTracker.removeFragment(N),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},_._streamEnded=function(N,P){var V=this.fragCurrent,z=this.fragmentTracker;if(!P.live&&V&&V.sn===P.endSN&&!N.nextStart){var B=z.getState(V);return B===f.FragmentState.PARTIAL||B===f.FragmentState.OK}return!1},_.onMediaAttached=function(N,P){var V=this.media=this.mediaBuffer=P.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),V.addEventListener("seeking",this.onvseeking),V.addEventListener("ended",this.onvended);var z=this.config;this.levels&&z.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(z.startPosition)},_.onMediaDetaching=function(){var N=this.media;N!=null&&N.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),N&&(N.removeEventListener("seeking",this.onvseeking),N.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},_.onMediaSeeking=function(){var N=this.config,P=this.fragCurrent,V=this.media,z=this.mediaBuffer,B=this.state,K=V?V.currentTime:0,U=S.BufferHelper.bufferInfo(z||V,K,N.maxBufferHole);if(this.log("media seeking to "+(Object(D.isFiniteNumber)(K)?K.toFixed(3):K)+", state: "+B),B===O.ENDED)this.resetLoadingState();else if(P&&!U.len){var W=N.maxFragLookUpTolerance,H=P.start-W,q=P.start+P.duration+W,ne=K>q;(K<H||ne)&&(ne&&P.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),P.loader.abort()),this.resetLoadingState())}V&&(this.lastCurrentTime=K),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=K),this.tickImmediate()},_.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},_.onKeyLoaded=function(N,P){if(this.state!==O.KEY_LOADING||P.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var V=this.levels[P.frag.level].details;V&&this.loadFragment(P.frag,V,P.frag.start)},_.onHandlerDestroying=function(){this.stopLoad(),C.prototype.onHandlerDestroying.call(this)},_.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(c.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,C.prototype.onHandlerDestroyed.call(this)},_.loadKey=function(N,P){this.log("Loading key for "+N.sn+" of ["+P.startSN+"-"+P.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+N.level),this.state=O.KEY_LOADING,this.fragCurrent=N,this.hls.trigger(c.Events.KEY_LOADING,{frag:N})},_.loadFragment=function(N,P,V){this._loadFragForPlayback(N,P,V)},_._loadFragForPlayback=function(N,P,V){var z=this,B=function(U){if(z.fragContextChanged(N)){z.warn("Fragment "+N.sn+(U.part?" p: "+U.part.index:"")+" of level "+N.level+" was dropped during download."),z.fragmentTracker.removeFragment(N);return}N.stats.chunkCount++,z._handleFragmentLoadProgress(U)};this._doFragLoad(N,P,V,B).then(function(K){if(!K)return;z.fragLoadError=0;var U=z.state;if(z.fragContextChanged(N)){(U===O.FRAG_LOADING||U===O.BACKTRACKING||!z.fragCurrent&&U===O.PARSING)&&(z.fragmentTracker.removeFragment(N),z.state=O.IDLE);return}if("payload"in K&&(z.log("Loaded fragment "+N.sn+" of level "+N.level),z.hls.trigger(c.Events.FRAG_LOADED,K),z.state===O.BACKTRACKING)){z.fragmentTracker.backtrack(N,K),z.resetFragmentLoading(N);return}z._handleFragmentLoadComplete(K)}).catch(function(K){z.warn(K),z.resetFragmentLoading(N)})},_.flushMainBuffer=function(N,P,V){if(V===void 0&&(V=null),!(N-P))return;var z={startOffset:N,endOffset:P,type:V};this.fragLoadError=0,this.hls.trigger(c.Events.BUFFER_FLUSHING,z)},_._loadInitSegment=function(N){var P=this;this._doFragLoad(N).then(function(V){if(!V||P.fragContextChanged(N)||!P.levels)throw new Error("init load aborted");return V}).then(function(V){var z=P.hls,B=V.payload,K=N.decryptdata;if(B&&B.byteLength>0&&K&&K.key&&K.iv&&K.method==="AES-128"){var U=self.performance.now();return P.decrypter.webCryptoDecrypt(new Uint8Array(B),K.key.buffer,K.iv.buffer).then(function(W){var H=self.performance.now();return z.trigger(c.Events.FRAG_DECRYPTED,{frag:N,payload:W,stats:{tstart:U,tdecrypt:H}}),V.payload=W,V})}return V}).then(function(V){var z=P.fragCurrent,B=P.hls,K=P.levels;if(!K)throw new Error("init load aborted, missing levels");var U=K[N.level].details;console.assert(U,"Level details are defined when init segment is loaded");var W=N.stats;P.state=O.IDLE,P.fragLoadError=0,N.data=new Uint8Array(V.payload),W.parsing.start=W.buffering.start=self.performance.now(),W.parsing.end=W.buffering.end=self.performance.now(),V.frag===z&&B.trigger(c.Events.FRAG_BUFFERED,{stats:W,frag:z,part:null,id:N.type}),P.tick()}).catch(function(V){P.warn(V),P.resetFragmentLoading(N)})},_.fragContextChanged=function(N){var P=this.fragCurrent;return!N||!P||N.level!==P.level||N.sn!==P.sn||N.urlId!==P.urlId},_.fragBufferedComplete=function(N,P){var V=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+N.type+" sn: "+N.sn+(P?" part: "+P.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+N.level+" "+t.default.toString(S.BufferHelper.getBuffered(V))),this.state=O.IDLE,this.tick()},_._handleFragmentLoadComplete=function(N){var P=this.transmuxer;if(!P)return;var V=N.frag,z=N.part,B=N.partsLoaded,K=!B||B.length===0||B.some(function(W){return!W}),U=new r.ChunkMetadata(V.level,V.sn,V.stats.chunkCount+1,0,z?z.index:-1,!K);P.flush(U)},_._handleFragmentLoadProgress=function(N){},_._doFragLoad=function(N,P,V,z){var B=this;if(V===void 0&&(V=null),!this.levels)throw new Error("frag load aborted, missing levels");if(V=Math.max(N.start,V||0),this.config.lowLatencyMode&&P){var K=P.partList;if(K&&z){V>N.end&&P.fragmentHint&&(N=P.fragmentHint);var U=this.getNextPart(K,N,V);if(U>-1){var W=K[U];return this.log("Loading part sn: "+N.sn+" p: "+W.index+" cc: "+N.cc+" of playlist ["+P.startSN+"-"+P.endSN+"] parts [0-"+U+"-"+(K.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+N.level+", target: "+parseFloat(V.toFixed(3))),this.nextLoadPosition=W.start+W.duration,this.state=O.FRAG_LOADING,this.hls.trigger(c.Events.FRAG_LOADING,{frag:N,part:K[U],targetBufferTime:V}),this.doFragPartsLoad(N,K,U,z).catch(function(H){return B.handleFragLoadError(H)})}else if(!N.url||this.loadedEndOfParts(K,V))return Promise.resolve(null)}}return this.log("Loading fragment "+N.sn+" cc: "+N.cc+" "+(P?"of ["+P.startSN+"-"+P.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+N.level+", target: "+parseFloat(V.toFixed(3))),Object(D.isFiniteNumber)(N.sn)&&!this.bitrateTest&&(this.nextLoadPosition=N.start+N.duration),this.state=O.FRAG_LOADING,this.hls.trigger(c.Events.FRAG_LOADING,{frag:N,targetBufferTime:V}),this.fragmentLoader.load(N,z).catch(function(H){return B.handleFragLoadError(H)})},_.doFragPartsLoad=function(N,P,V,z){var B=this;return new Promise(function(K,U){var W=[],H=function q(ne){var te=P[ne];B.fragmentLoader.loadPart(N,te,z).then(function(_e){W[te.index]=_e;var Ce=_e.part;B.hls.trigger(c.Events.FRAG_LOADED,_e);var me=P[ne+1];if(me&&me.fragment===N)q(ne+1);else return K({frag:N,part:Ce,partsLoaded:W})}).catch(U)};H(V)})},_.handleFragLoadError=function(N){var P=N.data;return P&&P.details===o.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(P.frag,P.part):this.hls.trigger(c.Events.ERROR,P),null},_._handleTransmuxerFlush=function(N){var P=this.getCurrentContext(N);if(!P||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var V=P.frag,z=P.part,B=P.level,K=self.performance.now();V.stats.parsing.end=K,z&&(z.stats.parsing.end=K),this.updateLevelTiming(V,z,B,N.partial)},_.getCurrentContext=function(N){var P=this.levels,V=N.level,z=N.sn,B=N.part;if(!P||!P[V])return this.warn("Levels object was unset while buffering fragment "+z+" of level "+V+". The current chunk will not be buffered."),null;var K=P[V],U=B>-1?Object(p.getPartWith)(K,z,B):null,W=U?U.fragment:Object(p.getFragmentWithSN)(K,z,this.fragCurrent);return W?{frag:W,part:U,level:K}:null},_.bufferFragmentData=function(N,P,V,z){if(!N||this.state!==O.PARSING)return;var B=N.data1,K=N.data2,U=B;if(B&&K&&(U=Object(s.appendUint8Array)(B,K)),!U||!U.length)return;var W={type:N.type,frag:P,part:V,chunkMeta:z,parent:P.type,data:U};this.hls.trigger(c.Events.BUFFER_APPENDING,W),N.dropped&&N.independent&&!V&&this.flushBufferGap(P)},_.flushBufferGap=function(N){var P=this.media;if(!P)return;if(!S.BufferHelper.isBuffered(P,P.currentTime)){this.flushMainBuffer(0,N.start);return}var V=P.currentTime,z=S.BufferHelper.bufferInfo(P,V,0),B=N.duration,K=Math.min(this.config.maxFragLookUpTolerance*2,B*.25),U=Math.max(Math.min(N.start-K,z.end-K),V+K);N.start-U>K&&this.flushMainBuffer(U,N.start)},_.getFwdBufferInfo=function(N,P){var V=this.config,z=this.getLoadPosition();if(!Object(D.isFiniteNumber)(z))return null;var B=S.BufferHelper.bufferInfo(N,z,V.maxBufferHole);if(B.len===0&&B.nextStart!==void 0){var K=this.fragmentTracker.getBufferedFrag(z,P);if(K&&B.nextStart<K.end)return S.BufferHelper.bufferInfo(N,z,Math.max(B.nextStart,V.maxBufferHole))}return B},_.getMaxBufferLength=function(N){var P=this.config,V;return N?V=Math.max(8*P.maxBufferSize/N,P.maxBufferLength):V=P.maxBufferLength,Math.min(V,P.maxMaxBufferLength)},_.reduceMaxBufferLength=function(N){var P=this.config,V=N||P.maxBufferLength;return P.maxMaxBufferLength>=V?(P.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+P.maxMaxBufferLength+"s"),!0):!1},_.getNextFragment=function(N,P){var V,z,B=P.fragments,K=B.length;if(!K)return null;var U=this.config,W=B[0].start,H;if(P.live){var q=U.initialLiveManifestSize;if(K<q)return this.warn("Not enough fragments to start playback (have: "+K+", need: "+q+")"),null;!P.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(P,B),this.startPosition=H?this.hls.liveSyncPosition||H.start:N)}else N<=W&&(H=B[0]);if(!H){var ne=U.lowLatencyMode?P.partEnd:P.fragmentEnd;H=this.getFragmentAtPosition(N,ne,P)}return(V=H)!==null&&V!==void 0&&V.initSegment&&!((z=H)!==null&&z!==void 0&&z.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},_.getNextPart=function(N,P,V){for(var z=-1,B=!1,K=!0,U=0,W=N.length;U<W;U++){var H=N[U];if(K=K&&!H.independent,z>-1&&V<H.start)break;var q=H.loaded;!q&&(B||H.independent||K)&&H.fragment===P&&(z=U),B=q}return z},_.loadedEndOfParts=function(N,P){var V=N[N.length-1];return V&&P>V.start&&V.loaded},_.getInitialLiveFragment=function(N,P){var V=this.fragPrevious,z=null;if(V){if(N.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+V.programDateTime),z=Object(u.findFragmentByPDT)(P,V.endProgramDateTime,this.config.maxFragLookUpTolerance)),!z){var B=V.sn+1;if(B>=N.startSN&&B<=N.endSN){var K=P[B-N.startSN];V.cc===K.cc&&(z=K,this.log("Live playlist, switching playlist, load frag with next SN: "+z.sn))}z||(z=Object(u.findFragWithCC)(P,V.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?N.fragmentEnd:N.edge,N))}return z},_.getFragmentAtPosition=function(N,P,V){var z=this.config,B=this.fragPrevious,K=V.fragments,U=V.endSN,W=V.fragmentHint,H=z.maxFragLookUpTolerance,q=!!(z.lowLatencyMode&&V.partList&&W);q&&W&&!this.bitrateTest&&(K=K.concat(W),U=W.sn);var ne;if(N<P){var te=N>P-H?0:H;ne=Object(u.findFragmentByPTS)(B,K,N,te)}else ne=K[K.length-1];if(ne){var _e=ne.sn-V.startSN,Ce=B&&ne.level===B.level,me=K[_e+1],Me=this.fragmentTracker.getState(ne);if(Me===f.FragmentState.BACKTRACKED){ne=null;for(var Oe=_e;K[Oe]&&this.fragmentTracker.getState(K[Oe])===f.FragmentState.BACKTRACKED;)B?ne=K[Oe--]:ne=K[--Oe];ne||(ne=me)}else B&&ne.sn===B.sn&&!q&&(Ce&&(ne.sn<U&&this.fragmentTracker.getState(me)!==f.FragmentState.OK?(this.log("SN "+ne.sn+" just loaded, load next one: "+me.sn),ne=me):ne=null))}return ne},_.synchronizeToLiveEdge=function(N){var P=this.config,V=this.media;if(!V)return;var z=this.hls.liveSyncPosition,B=V.currentTime,K=N.fragments[0].start,U=N.edge,W=B>=K-P.maxFragLookUpTolerance&&B<=U;if(z!==null&&V.duration>z&&(B<z||!W)){var H=P.liveMaxLatencyDuration!==void 0?P.liveMaxLatencyDuration:P.liveMaxLatencyDurationCount*N.targetduration;(!W&&V.readyState<4||B<U-H)&&(this.loadedmetadata||(this.nextLoadPosition=z),V.readyState&&(this.warn("Playback: "+B.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+z.toFixed(3)),V.currentTime=z))}},_.alignPlaylists=function(N,P){var V=this.levels,z=this.levelLastLoaded,B=this.fragPrevious,K=z!==null?V[z]:null,U=N.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var W=N.fragments[0].start,H=!P,q=N.alignedSliding&&Object(D.isFiniteNumber)(W);if(H||!q&&!W){Object(d.alignStream)(B,K,N);var ne=N.fragments[0].start;return this.log("Live playlist sliding: "+ne.toFixed(2)+" start-sn: "+(P?P.startSN:"na")+"->"+N.startSN+" prev-sn: "+(B?B.sn:"na")+" fragments: "+U),ne}return W},_.waitForCdnTuneIn=function(N){var P=3;return N.live&&N.canBlockReload&&N.tuneInGoal>Math.max(N.partHoldBack,N.partTarget*P)},_.setStartPosition=function(N,P){var V=this.startPosition;if(V<P&&(V=-1),V===-1||this.lastCurrentTime===-1){var z=N.startTimeOffset;Object(D.isFiniteNumber)(z)?(V=P+z,z<0&&(V+=N.totalduration),V=Math.min(Math.max(P,V),P+N.totalduration),this.log("Start time offset "+z+" found in playlist, adjust startPosition to "+V),this.startPosition=V):N.live?V=this.hls.liveSyncPosition||P:this.startPosition=V=0,this.lastCurrentTime=V}this.nextLoadPosition=V},_.getLoadPosition=function(){var N=this.media,P=0;return this.loadedmetadata&&N?P=N.currentTime:this.nextLoadPosition&&(P=this.nextLoadPosition),P},_.handleFragLoadAborted=function(N,P){this.transmuxer&&N.sn!=="initSegment"&&N.stats.aborted&&(this.warn("Fragment "+N.sn+(P?" part"+P.index:"")+" of level "+N.level+" was aborted"),this.resetFragmentLoading(N))},_.resetFragmentLoading=function(N){(!this.fragCurrent||!this.fragContextChanged(N))&&(this.state=O.IDLE)},_.onFragmentOrKeyLoadError=function(N,P){if(P.fatal)return;var V=P.frag;if(!V||V.type!==N)return;var z=this.fragCurrent;console.assert(z&&V.sn===z.sn&&V.level===z.level&&V.urlId===z.urlId,"Frag load error must match current frag to retry");var B=this.config;if(this.fragLoadError+1<=B.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(V.level))return;var K=Math.min(Math.pow(2,this.fragLoadError)*B.fragLoadingRetryDelay,B.fragLoadingMaxRetryTimeout);this.warn("Fragment "+V.sn+" of "+N+" "+V.level+" failed to load, retrying in "+K+"ms"),this.retryDate=self.performance.now()+K,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else P.levelRetry?(N===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(y.logger.error(P.details+" reaches max retry, redispatch as fatal ..."),P.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},_.afterBufferFlushed=function(N,P,V){if(!N)return;var z=S.BufferHelper.getBuffered(N);this.fragmentTracker.detectEvictedFragments(P,z,V),this.state===O.ENDED&&this.resetLoadingState()},_.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},_.resetLiveStartWhenNotLoaded=function(N){if(!this.loadedmetadata){this.startFragRequested=!1;var P=this.levels?this.levels[N].details:null;if(P!=null&&P.live)return this.startPosition=-1,this.setStartPosition(P,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},_.updateLevelTiming=function(N,P,V,z){var B=this,K=V.details;console.assert(!!K,"level.details must be defined");var U=Object.keys(N.elementaryStreams).reduce(function(W,H){var q=N.elementaryStreams[H];if(q){var ne=q.endPTS-q.startPTS;if(ne<=0)return B.warn("Could not parse fragment "+N.sn+" "+H+" duration reliably ("+ne+") resetting transmuxer to fallback to playlist timing"),B.resetTransmuxer(),W||!1;var te=z?0:Object(p.updateFragPTSDTS)(K,N,q.startPTS,q.endPTS,q.startDTS,q.endDTS);return B.hls.trigger(c.Events.LEVEL_PTS_UPDATED,{details:K,level:V,drift:te,type:H,frag:N,start:q.startPTS,end:q.endPTS}),!0}return W},!1);U?(this.state=O.PARSED,this.hls.trigger(c.Events.FRAG_PARSED,{frag:N,part:P})):this.resetLoadingState()},_.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},E(x,[{key:"state",get:function(){return this._state},set:function(N){var P=this._state;P!==N&&(this._state=N,this.log(P+"->"+N))}}]),x}(v.default)},"./src/controller/buffer-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return u});var D=T("./src/polyfills/number.ts"),v=T("./src/events.ts"),f=T("./src/utils/logger.ts"),S=T("./src/errors.ts"),y=T("./src/utils/buffer-helper.ts"),c=T("./src/utils/mediasource-helper.ts"),o=T("./src/loader/fragment.ts"),r=T("./src/controller/buffer-operation-queue.ts"),s=Object(c.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function p(i){var t=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var a=t.hls,l=t.media,E=t.mediaSource;f.logger.log("[buffer-controller]: Media source opened"),l&&(t.updateMediaElementDuration(),a.trigger(v.Events.MEDIA_ATTACHED,{media:l})),E&&E.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){f.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){f.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var m=p.prototype;return m.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},m.destroy=function(){this.unregisterListeners(),this.details=null},m.registerListeners=function(){var t=this.hls;t.on(v.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(v.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(v.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(v.Events.BUFFER_RESET,this.onBufferReset,this),t.on(v.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(v.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(v.Events.BUFFER_EOS,this.onBufferEos,this),t.on(v.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(v.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(v.Events.FRAG_PARSED,this.onFragParsed,this),t.on(v.Events.FRAG_CHANGED,this.onFragChanged,this)},m.unregisterListeners=function(){var t=this.hls;t.off(v.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(v.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(v.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(v.Events.BUFFER_RESET,this.onBufferReset,this),t.off(v.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(v.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(v.Events.BUFFER_EOS,this.onBufferEos,this),t.off(v.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(v.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(v.Events.FRAG_PARSED,this.onFragParsed,this),t.off(v.Events.FRAG_CHANGED,this.onFragChanged,this)},m._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new r.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},m.onManifestParsed=function(t,a){var l=2;(a.audio&&!a.video||!a.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,f.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},m.onMediaAttaching=function(t,a){var l=this.media=a.media;if(l&&s){var E=this.mediaSource=new s;E.addEventListener("sourceopen",this._onMediaSourceOpen),E.addEventListener("sourceended",this._onMediaSourceEnded),E.addEventListener("sourceclose",this._onMediaSourceClose),l.src=self.URL.createObjectURL(E),this._objectUrl=l.src}},m.onMediaDetaching=function(){var t=this.media,a=this.mediaSource,l=this._objectUrl;if(a){if(f.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(E){f.logger.warn("[buffer-controller]: onMediaDetaching: "+E.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(l&&self.URL.revokeObjectURL(l),t.src===l?(t.removeAttribute("src"),t.load()):f.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(v.Events.MEDIA_DETACHED,void 0)},m.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(a){var l=t.sourceBuffer[a];try{l&&(t.removeBufferListeners(a),t.mediaSource&&t.mediaSource.removeSourceBuffer(l),t.sourceBuffer[a]=void 0)}catch(E){f.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",E)}}),this._initSourceBuffer()},m.onBufferCodecs=function(t,a){var l=this,E=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(b){if(E){var h=l.tracks[b];if(h&&typeof h.buffer.changeType=="function"){var L=a[b],O=L.codec,w=L.levelCodec,C=L.container,x=(h.levelCodec||h.codec).replace(d,"$1"),_=(w||O).replace(d,"$1");if(x!==_){var j=C+";codecs="+(w||O);l.appendChangeType(b,j)}}}else l.pendingTracks[b]=a[b]}),E)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},m.appendChangeType=function(t,a){var l=this,E=this.operationQueue,b={execute:function(){var L=l.sourceBuffer[t];L&&(f.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+a),L.changeType(a)),E.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(L){f.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",L)}};E.append(b,t)},m.onBufferAppending=function(t,a){var l=this,E=this.hls,b=this.operationQueue,h=this.tracks,L=a.data,O=a.type,w=a.frag,C=a.part,x=a.chunkMeta,_=x.buffering[O],j=self.performance.now();_.start=j;var N=w.stats.buffering,P=C?C.stats.buffering:null;N.start===0&&(N.start=j),P&&P.start===0&&(P.start=j);var V=h.audio,z=O==="audio"&&x.id===1&&(V==null?void 0:V.container)==="audio/mpeg",B={execute:function(){if(_.executeStart=self.performance.now(),z){var U=l.sourceBuffer[O];if(U){var W=w.start-U.timestampOffset;Math.abs(W)>=.1&&(f.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+w.start+" (delta: "+W+") sn: "+w.sn+")"),U.timestampOffset=w.start)}}l.appendExecutor(L,O)},onStart:function(){},onComplete:function(){var U=self.performance.now();_.executeEnd=_.end=U,N.first===0&&(N.first=U),P&&P.first===0&&(P.first=U);var W=l.sourceBuffer,H={};for(var q in W)H[q]=y.BufferHelper.getBuffered(W[q]);l.appendError=0,l.hls.trigger(v.Events.BUFFER_APPENDED,{type:O,frag:w,part:C,chunkMeta:x,parent:w.type,timeRanges:H})},onError:function(U){f.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",U);var W={type:S.ErrorTypes.MEDIA_ERROR,parent:w.type,details:S.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?W.details=S.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,W.details=S.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>E.config.appendErrorMaxRetry&&(f.logger.error("[buffer-controller]: Failed "+E.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),W.fatal=!0)),E.trigger(v.Events.ERROR,W)}};b.append(B,O)},m.onBufferFlushing=function(t,a){var l=this,E=this.operationQueue,b=function(L){return{execute:l.removeExecutor.bind(l,L,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(v.Events.BUFFER_FLUSHED,{type:L})},onError:function(w){f.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",w)}}};a.type?E.append(b(a.type),a.type):this.getSourceBufferTypes().forEach(function(h){E.append(b(h),h)})},m.onFragParsed=function(t,a){var l=this,E=a.frag,b=a.part,h=[],L=b?b.elementaryStreams:E.elementaryStreams;L[o.ElementaryStreamTypes.AUDIOVIDEO]?h.push("audiovideo"):(L[o.ElementaryStreamTypes.AUDIO]&&h.push("audio"),L[o.ElementaryStreamTypes.VIDEO]&&h.push("video"));var O=function(){var C=self.performance.now();E.stats.buffering.end=C,b&&(b.stats.buffering.end=C);var x=b?b.stats:E.stats;l.hls.trigger(v.Events.FRAG_BUFFERED,{frag:E,part:b,stats:x,id:E.type})};h.length===0&&f.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+E.type+" level: "+E.level+" sn: "+E.sn),this.blockBuffers(O,h)},m.onFragChanged=function(t,a){this.flushBackBuffer()},m.onBufferEos=function(t,a){var l=this,E=this.getSourceBufferTypes().reduce(function(b,h){var L=l.sourceBuffer[h];return(!a.type||a.type===h)&&(L&&!L.ended&&(L.ended=!0,f.logger.log("[buffer-controller]: "+h+" sourceBuffer now EOS"))),b&&!!(!L||L.ended)},!0);E&&this.blockBuffers(function(){var b=l.mediaSource;if(!b||b.readyState!=="open")return;b.endOfStream()})},m.onLevelUpdated=function(t,a){var l=a.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},m.flushBackBuffer=function(){var t=this.hls,a=this.details,l=this.media,E=this.sourceBuffer;if(!l||a===null)return;var b=this.getSourceBufferTypes();if(!b.length)return;var h=a.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(D.isFiniteNumber)(h)||h<0)return;var L=l.currentTime,O=a.levelTargetDuration,w=Math.max(h,O),C=Math.floor(L/O)*O-w;b.forEach(function(x){var _=E[x];if(_){var j=y.BufferHelper.getBuffered(_);j.length>0&&C>j.start(0)&&(t.trigger(v.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),a.live&&t.trigger(v.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),t.trigger(v.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:x}))}})},m.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,a=this.hls,l=this.media,E=this.mediaSource,b=t.fragments[0].start+t.totalduration,h=l.duration,L=Object(D.isFiniteNumber)(E.duration)?E.duration:0;t.live&&a.config.liveDurationInfinity?(f.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),E.duration=Infinity,this.updateSeekableRange(t)):(b>L&&b>h||!Object(D.isFiniteNumber)(h))&&(f.logger.log("[buffer-controller]: Updating Media Source duration to "+b.toFixed(3)),E.duration=b)},m.updateSeekableRange=function(t){var a=this.mediaSource,l=t.fragments,E=l.length;if(E&&t.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var b=Math.max(0,l[0].start),h=Math.max(b,b+t.totalduration);a.setLiveSeekableRange(b,h)}},m.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,a=this.operationQueue,l=this.pendingTracks,E=Object.keys(l).length;if(E&&!t||E===2){this.createSourceBuffers(l),this.pendingTracks={};var b=this.getSourceBufferTypes();if(b.length===0){this.hls.trigger(v.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}b.forEach(function(h){a.executeNext(h)})}},m.createSourceBuffers=function(t){var a=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var E=0;for(var b in t)if(!a[b]){var h=t[b];if(!h)throw Error("source buffer exists for track "+b+", however track does not");var L=h.levelCodec||h.codec,O=h.container+";codecs="+L;f.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var w=a[b]=l.addSourceBuffer(O),C=b;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[b]={buffer:w,codec:L,container:h.container,levelCodec:h.levelCodec,id:h.id},E++}catch(x){f.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(v.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:O})}}E&&this.hls.trigger(v.Events.BUFFER_CREATED,{tracks:this.tracks})},m._onSBUpdateStart=function(t){var a=this.operationQueue,l=a.current(t);l.onStart()},m._onSBUpdateEnd=function(t){var a=this.operationQueue,l=a.current(t);l.onComplete(),a.shiftAndExecuteNext(t)},m._onSBUpdateError=function(t,a){f.logger.error("[buffer-controller]: "+t+" SourceBuffer error",a),this.hls.trigger(v.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var l=this.operationQueue.current(t);l&&l.onError(a)},m.removeExecutor=function(t,a,l){var E=this.media,b=this.mediaSource,h=this.operationQueue,L=this.sourceBuffer,O=L[t];if(!E||!b||!O){f.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(t);return}var w=Object(D.isFiniteNumber)(E.duration)?E.duration:Infinity,C=Object(D.isFiniteNumber)(b.duration)?b.duration:Infinity,x=Math.max(0,a),_=Math.min(l,w,C);_>x?(f.logger.log("[buffer-controller]: Removing ["+x+","+_+"] from the "+t+" SourceBuffer"),console.assert(!O.updating,t+" sourceBuffer must not be updating"),O.remove(x,_)):h.shiftAndExecuteNext(t)},m.appendExecutor=function(t,a){var l=this.operationQueue,E=this.sourceBuffer,b=E[a];if(!b){f.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(a);return}b.ended=!1,console.assert(!b.updating,a+" sourceBuffer must not be updating"),b.appendBuffer(t)},m.blockBuffers=function(t,a){var l=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){f.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var E=this.operationQueue,b=a.map(function(h){return E.appendBlocker(h)});Promise.all(b).then(function(){t(),a.forEach(function(h){var L=l.sourceBuffer[h];(!L||!L.updating)&&E.shiftAndExecuteNext(h)})})},m.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},m.addBufferListener=function(t,a,l){var E=this.sourceBuffer[t];if(!E)return;var b=l.bind(this,t);this.listeners[t].push({event:a,listener:b}),E.addEventListener(a,b)},m.removeBufferListeners=function(t){var a=this.sourceBuffer[t];if(!a)return;this.listeners[t].forEach(function(l){a.removeEventListener(l.event,l.listener)})},p}()},"./src/controller/buffer-operation-queue.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return v});var D=T("./src/utils/logger.ts"),v=function(){function f(y){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=y}var S=f.prototype;return S.append=function(c,o){var r=this.queues[o];r.push(c),r.length===1&&this.buffers[o]&&this.executeNext(o)},S.insertAbort=function(c,o){var r=this.queues[o];r.unshift(c),this.executeNext(o)},S.appendBlocker=function(c){var o,r=new Promise(function(d){o=d}),s={execute:o,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(s,c),r},S.executeNext=function(c){var o=this.buffers,r=this.queues,s=o[c],d=r[c];if(d.length){var u=d[0];try{u.execute()}catch(p){D.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(p),(!s||!s.updating)&&(d.shift(),this.executeNext(c))}}},S.shiftAndExecuteNext=function(c){this.queues[c].shift(),this.executeNext(c)},S.current=function(c){return this.queues[c][0]},f}()},"./src/controller/cap-level-controller.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/events.ts");function v(y,c){for(var o=0;o<c.length;o++){var r=c[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(y,r.key,r)}}function f(y,c,o){return c&&v(y.prototype,c),o&&v(y,o),y}var S=function(){function y(o){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=o,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var c=y.prototype;return c.setStreamController=function(r){this.streamController=r},c.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},c.registerListeners=function(){var r=this.hls;r.on(D.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},c.unregisterListener=function(){var r=this.hls;r.off(D.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},c.onFpsDropLevelCapping=function(r,s){y.isLevelAllowed(s.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(s.droppedLevel)},c.onMediaAttaching=function(r,s){this.media=s.media instanceof HTMLVideoElement?s.media:null},c.onManifestParsed=function(r,s){var d=this.hls;this.restrictedLevels=[],this.firstLevel=s.firstLevel,d.config.capLevelToPlayerSize&&s.video&&this.startCapping()},c.onBufferCodecs=function(r,s){var d=this.hls;d.config.capLevelToPlayerSize&&s.video&&this.startCapping()},c.onMediaDetaching=function(){this.stopCapping()},c.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var r=this.hls.levels;if(r.length){var s=this.hls;s.autoLevelCapping=this.getMaxLevel(r.length-1),s.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=s.autoLevelCapping}}},c.getMaxLevel=function(r){var s=this,d=this.hls.levels;if(!d.length)return-1;var u=d.filter(function(p,m){return y.isLevelAllowed(m,s.restrictedLevels)&&m<=r});return this.clientRect=null,y.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},c.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()},c.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},c.getDimensions=function(){if(this.clientRect)return this.clientRect;var r=this.media,s={width:0,height:0};if(r){var d=r.getBoundingClientRect();s.width=d.width,s.height=d.height,!s.width&&!s.height&&(s.width=d.right-d.left||r.width||0,s.height=d.bottom-d.top||r.height||0)}return this.clientRect=s,s},y.isLevelAllowed=function(r,s){return s===void 0&&(s=[]),s.indexOf(r)===-1},y.getMaxLevelByMediaSize=function(r,s,d){if(!r||!r.length)return-1;for(var u=function(a,l){return l?a.width!==l.width||a.height!==l.height:!0},p=r.length-1,m=0;m<r.length;m+=1){var i=r[m];if((i.width>=s||i.height>=d)&&u(i,r[m+1])){p=m;break}}return p},f(y,[{key:"mediaWidth",get:function(){return this.getDimensions().width*y.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*y.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var r=1;try{r=self.devicePixelRatio}catch(s){}return r}}]),y}();g.default=S},"./src/controller/cmcd-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return u});var D=T("./src/events.ts"),v=T("./src/types/cmcd.ts"),f=T("./src/utils/buffer-helper.ts"),S=T("./src/utils/logger.ts");function y(p,m){for(var i=0;i<m.length;i++){var t=m[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(p,t.key,t)}}function c(p,m,i){return m&&y(p.prototype,m),i&&y(p,i),p}function o(p,m){var i=typeof Symbol!="undefined"&&p[Symbol.iterator]||p["@@iterator"];if(i)return(i=i.call(p)).next.bind(i);if(Array.isArray(p)||(i=r(p))||m&&p&&typeof p.length=="number"){i&&(p=i);var t=0;return function(){return t>=p.length?{done:!0}:{done:!1,value:p[t++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(p,m){if(!p)return;if(typeof p=="string")return s(p,m);var i=Object.prototype.toString.call(p).slice(8,-1);if(i==="Object"&&p.constructor&&(i=p.constructor.name),i==="Map"||i==="Set")return Array.from(p);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return s(p,m)}function s(p,m){(m==null||m>p.length)&&(m=p.length);for(var i=0,t=new Array(m);i<m;i++)t[i]=p[i];return t}function d(){return d=Object.assign||function(p){for(var m=1;m<arguments.length;m++){var i=arguments[m];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(p[t]=i[t])}return p},d.apply(this,arguments)}var u=function(){function p(i){var t=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(E){try{t.apply(E,{ot:v.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(b){S.logger.warn("Could not generate manifest CMCD data.",b)}},this.applyFragmentData=function(E){try{var b=E.frag,h=t.hls.levels[b.level],L=t.getObjectType(b),O={d:b.duration*1e3,ot:L};(L===v.CMCDObjectType.VIDEO||L===v.CMCDObjectType.AUDIO||L==v.CMCDObjectType.MUXED)&&(O.br=h.bitrate/1e3,O.tb=t.getTopBandwidth(L),O.bl=t.getBufferLength(L)),t.apply(E,O)}catch(w){S.logger.warn("Could not generate segment CMCD data.",w)}},this.hls=i;var a=this.config=i.config,l=a.cmcd;l!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=l.sessionId||p.uuid(),this.cid=l.contentId,this.useHeaders=l.useHeaders===!0,this.registerListeners())}var m=p.prototype;return m.registerListeners=function(){var t=this.hls;t.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(D.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this)},m.unregisterListeners=function(){var t=this.hls;t.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(D.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},m.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},m.onMediaAttached=function(t,a){this.media=a.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},m.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},m.onBufferCreated=function(t,a){var l,E;this.audioBuffer=(l=a.tracks.audio)===null||l===void 0?void 0:l.buffer,this.videoBuffer=(E=a.tracks.video)===null||E===void 0?void 0:E.buffer},m.createData=function(){var t;return{v:v.CMCDVersion,sf:v.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)===null||t===void 0?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},m.apply=function(t,a){a===void 0&&(a={}),d(a,this.createData());var l=a.ot===v.CMCDObjectType.INIT||a.ot===v.CMCDObjectType.VIDEO||a.ot===v.CMCDObjectType.MUXED;if(this.starved&&l&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var E=p.toHeaders(a);if(!Object.keys(E).length)return;t.headers||(t.headers={}),d(t.headers,E)}else{var b=p.toQuery(a);if(!b)return;t.url=p.appendQueryToUri(t.url,b)}},m.getObjectType=function(t){var a=t.type;return a==="subtitle"?v.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?v.CMCDObjectType.INIT:a==="audio"?v.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?v.CMCDObjectType.VIDEO:v.CMCDObjectType.MUXED:void 0},m.getTopBandwidth=function(t){for(var a=0,l=t===v.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,E=o(l),b;!(b=E()).done;){var h=b.value;h.bitrate>a&&(a=h.bitrate)}return a>0?a:NaN},m.getBufferLength=function(t){var a=this.hls.media,l=t===v.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!a)return NaN;var E=f.BufferHelper.bufferInfo(l,a.currentTime,this.config.maxBufferHole);return E.len*1e3},m.createPlaylistLoader=function(){var t=this.config.pLoader,a=this.applyPlaylistData,l=t||this.config.loader;return function(){function E(h){this.loader=void 0,this.loader=new l(h)}var b=E.prototype;return b.destroy=function(){this.loader.destroy()},b.abort=function(){this.loader.abort()},b.load=function(L,O,w){a(L),this.loader.load(L,O,w)},c(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},m.createFragmentLoader=function(){var t=this.config.fLoader,a=this.applyFragmentData,l=t||this.config.loader;return function(){function E(h){this.loader=void 0,this.loader=new l(h)}var b=E.prototype;return b.destroy=function(){this.loader.destroy()},b.abort=function(){this.loader.abort()},b.load=function(L,O,w){a(L),this.loader.load(L,O,w)},c(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},p.uuid=function(){var t=URL.createObjectURL(new Blob),a=t.toString();return URL.revokeObjectURL(t),a.substr(a.lastIndexOf("/")+1)},p.serialize=function(t){for(var a=[],l=function(z){return!Number.isNaN(z)&&z!=null&&z!==""&&z!==!1},E=function(z){return Math.round(z)},b=function(z){return E(z/100)*100},h=function(z){return encodeURIComponent(z)},L={br:E,d:E,bl:b,dl:b,mtp:b,nor:h,rtp:b,tb:E},O=Object.keys(t||{}).sort(),w=o(O),C;!(C=w()).done;){var x=C.value,_=t[x];if(!l(_))continue;if(x==="v"&&_===1)continue;if(x=="pr"&&_===1)continue;var j=L[x];j&&(_=j(_));var N=typeof _,P=void 0;x==="ot"||x==="sf"||x==="st"?P=x+"="+_:N==="boolean"?P=x:N==="number"?P=x+"="+_:P=x+"="+JSON.stringify(_),a.push(P)}return a.join(",")},p.toHeaders=function(t){for(var a=Object.keys(t),l={},E=["Object","Request","Session","Status"],b=[{},{},{},{}],h={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},L=0,O=a;L<O.length;L++){var w=O[L],C=h[w]!=null?h[w]:1;b[C][w]=t[w]}for(var x=0;x<b.length;x++){var _=p.serialize(b[x]);_&&(l["CMCD-"+E[x]]=_)}return l},p.toQuery=function(t){return"CMCD="+encodeURIComponent(p.serialize(t))},p.appendQueryToUri=function(t,a){if(!a)return t;var l=t.includes("?")?"&":"?";return""+t+l+a},p}()},"./src/controller/eme-controller.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/events.ts"),v=T("./src/errors.ts"),f=T("./src/utils/logger.ts"),S=T("./src/utils/mediakeys-helper.ts");function y(u,p){for(var m=0;m<p.length;m++){var i=p[m];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function c(u,p,m){return p&&y(u.prototype,p),m&&y(u,m),u}var o=3,r=function(p,m,i){var t={audioCapabilities:[],videoCapabilities:[]};return p.forEach(function(a){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:i.audioRobustness||""})}),m.forEach(function(a){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:i.videoRobustness||""})}),[t]},s=function(p,m,i,t){switch(p){case S.KeySystems.WIDEVINE:return r(m,i,t);default:throw new Error("Unknown key-system: "+p)}},d=function(){function u(m){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=m,this._config=m.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var p=u.prototype;return p.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},p._registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(D.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this)},p._unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(D.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this)},p.getLicenseServerUrl=function(i){switch(i){case S.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},p._attemptKeySystemAccess=function(i,t,a){var l=this,E=s(i,t,a,this._drmSystemOptions);f.logger.log("Requesting encrypted media key-system access");var b=this.requestMediaKeySystemAccess(i,E);this.mediaKeysPromise=b.then(function(h){return l._onMediaKeySystemAccessObtained(i,h)}),b.catch(function(h){f.logger.error('Failed to obtain key-system "'+i+'" access:',h)})},p._onMediaKeySystemAccessObtained=function(i,t){var a=this;f.logger.log('Access for key-system "'+i+'" obtained');var l={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:i};this._mediaKeysList.push(l);var E=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(b){return l.mediaKeys=b,f.logger.log('Media-keys created for key-system "'+i+'"'),a._onMediaKeysCreated(),b});return E.catch(function(b){f.logger.error("Failed to create media-keys:",b)}),E},p._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),i._onNewMediaKeySession(t.mediaKeysSession))})},p._onNewMediaKeySession=function(i){var t=this;f.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(a){t._onKeySessionMessage(i,a.message)},!1)},p._onKeySessionMessage=function(i,t){f.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(a){f.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),i.update(a)})},p.onMediaEncrypted=function(i){var t=this;if(f.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){f.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(E){if(!t._media)return;t._attemptSetMediaKeys(E),t._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(a).catch(a)},p._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){f.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}f.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},p._generateRequestWithPreferredKeySession=function(i,t){var a=this,l=this._mediaKeysList[0];if(!l){f.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(l.mediaKeysSessionInitialized){f.logger.warn("Key-Session already initialized but requested again");return}var E=l.mediaKeysSession;if(!E){f.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){f.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}f.logger.log('Generating key-session request for "'+i+'" init data type'),l.mediaKeysSessionInitialized=!0,E.generateRequest(i,t).then(function(){f.logger.debug("Key-session generation succeeded")}).catch(function(b){f.logger.error("Error generating key-session request:",b),a.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},p._createLicenseXhr=function(i,t,a){var l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,l,i,t,a);var E=this._licenseXhrSetup;if(E)try{E.call(this.hls,l,i),E=void 0}catch(b){f.logger.error(b)}try{l.readyState||l.open("POST",i,!0),E&&E.call(this.hls,l,i)}catch(b){throw new Error("issue setting up KeySystem license XHR "+b)}return l},p._onLicenseRequestReadyStageChange=function(i,t,a,l){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,f.logger.log("License request succeeded");var E=i.response,b=this._licenseResponseCallback;if(b)try{E=b.call(this.hls,i,t)}catch(L){f.logger.error(L)}l(E)}else{if(f.logger.error("License Request XHR failed ("+t+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>o){this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var h=o-this._requestLicenseFailureCount+1;f.logger.warn("Retrying license request, "+h+" attempts left"),this._requestLicense(a,l)}break}},p._generateLicenseRequestChallenge=function(i,t){switch(i.mediaKeySystemDomain){case S.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},p._requestLicense=function(i,t){f.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){f.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(a.mediaKeySystemDomain),E=this._createLicenseXhr(l,i,t);f.logger.log("Sending license request to URL: "+l);var b=this._generateLicenseRequestChallenge(a,i);E.send(b)}catch(h){f.logger.error("Failure requesting DRM license: "+h),this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},p.onMediaAttached=function(i,t){if(!this._emeEnabled)return;var a=t.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},p.onMediaDetached=function(){var i=this._media,t=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},p.onManifestParsed=function(i,t){if(!this._emeEnabled)return;var a=t.levels.map(function(E){return E.audioCodec}).filter(function(E){return!!E}),l=t.levels.map(function(E){return E.videoCodec}).filter(function(E){return!!E});this._attemptKeySystemAccess(S.KeySystems.WIDEVINE,a,l)},c(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();g.default=d},"./src/controller/fps-controller.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/events.ts"),v=T("./src/utils/logger.ts"),f=function(){function S(c){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=c,this.registerListeners()}var y=S.prototype;return y.setStreamController=function(o){this.streamController=o},y.registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},y.unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching)},y.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},y.onMediaAttaching=function(o,r){var s=this.hls.config;if(s.capLevelOnFPSDrop){var d=r.media instanceof self.HTMLVideoElement?r.media:null;this.media=d,d&&typeof d.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}},y.checkFPS=function(o,r,s){var d=performance.now();if(r){if(this.lastTime){var u=d-this.lastTime,p=s-this.lastDroppedFrames,m=r-this.lastDecodedFrames,i=1e3*p/u,t=this.hls;if(t.trigger(D.Events.FPS_DROP,{currentDropped:p,currentDecoded:m,totalDroppedFrames:s}),i>0&&p>t.config.fpsDroppedMonitoringThreshold*m){var a=t.currentLevel;v.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=a)&&(a=a-1,t.trigger(D.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:t.currentLevel}),t.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=d,this.lastDroppedFrames=s,this.lastDecodedFrames=r}},y.checkFPSInterval=function(){var o=this.media;if(o)if(this.isVideoPlaybackQualityAvailable){var r=o.getVideoPlaybackQuality();this.checkFPS(o,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(o,o.webkitDecodedFrameCount,o.webkitDroppedFrameCount)},S}();g.default=f},"./src/controller/fragment-finders.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"findFragmentByPDT",function(){return f}),T.d(g,"findFragmentByPTS",function(){return S}),T.d(g,"fragmentWithinToleranceTest",function(){return y}),T.d(g,"pdtWithinToleranceTest",function(){return c}),T.d(g,"findFragWithCC",function(){return o});var D=T("./src/polyfills/number.ts"),v=T("./src/utils/binary-search.ts");function f(r,s,d){if(s===null||!Array.isArray(r)||!r.length||!Object(D.isFiniteNumber)(s))return null;var u=r[0].programDateTime;if(s<(u||0))return null;var p=r[r.length-1].endProgramDateTime;if(s>=(p||0))return null;d=d||0;for(var m=0;m<r.length;++m){var i=r[m];if(c(s,d,i))return i}return null}function S(r,s,d,u){d===void 0&&(d=0),u===void 0&&(u=0);var p=null;if(r?p=s[r.sn-s[0].sn+1]||null:d===0&&s[0].start===0&&(p=s[0]),p&&y(d,u,p)===0)return p;var m=v.default.search(s,y.bind(null,d,u));return m||p}function y(r,s,d){r===void 0&&(r=0),s===void 0&&(s=0);var u=Math.min(s,d.duration+(d.deltaPTS?d.deltaPTS:0));return d.start+d.duration-u<=r?1:d.start-u>r&&d.start?-1:0}function c(r,s,d){var u=Math.min(s,d.duration+(d.deltaPTS?d.deltaPTS:0))*1e3,p=d.endProgramDateTime||0;return p-u>r}function o(r,s){return v.default.search(r,function(d){return d.cc<s?1:d.cc>s?-1:0})}},"./src/controller/fragment-tracker.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"FragmentState",function(){return f}),T.d(g,"FragmentTracker",function(){return S});var D=T("./src/events.ts"),v=T("./src/types/loader.ts"),f;(function(o){o.NOT_LOADED="NOT_LOADED",o.BACKTRACKED="BACKTRACKED",o.APPENDING="APPENDING",o.PARTIAL="PARTIAL",o.OK="OK"})(f||(f={}));var S=function(){function o(s){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=s,this._registerListeners()}var r=o.prototype;return r._registerListeners=function(){var d=this.hls;d.on(D.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(D.Events.FRAG_LOADED,this.onFragLoaded,this)},r._unregisterListeners=function(){var d=this.hls;d.off(D.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(D.Events.FRAG_LOADED,this.onFragLoaded,this)},r.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},r.getAppendedFrag=function(d,u){if(u===v.PlaylistLevelType.MAIN){var p=this.activeFragment,m=this.activeParts;if(!p)return null;if(m)for(var i=m.length;i--;){var t=m[i],a=t?t.end:p.appendedPTS;if(t.start<=d&&a!==void 0&&d<=a)return i>9&&(this.activeParts=m.slice(i-9)),t}else if(p.start<=d&&p.appendedPTS!==void 0&&d<=p.appendedPTS)return p}return this.getBufferedFrag(d,u)},r.getBufferedFrag=function(d,u){for(var p=this.fragments,m=Object.keys(p),i=m.length;i--;){var t=p[m[i]];if((t==null?void 0:t.body.type)===u&&t.buffered){var a=t.body;if(a.start<=d&&d<=a.end)return a}}return null},r.detectEvictedFragments=function(d,u,p){var m=this;Object.keys(this.fragments).forEach(function(i){var t=m.fragments[i];if(!t)return;if(!t.buffered){t.body.type===p&&m.removeFragment(t.body);return}var a=t.range[d];if(!a)return;a.time.some(function(l){var E=!m.isTimeBuffered(l.startPTS,l.endPTS,u);return E&&m.removeFragment(t.body),E})})},r.detectPartialFragments=function(d){var u=this,p=this.timeRanges,m=d.frag,i=d.part;if(!p||m.sn==="initSegment")return;var t=c(m),a=this.fragments[t];if(!a)return;Object.keys(p).forEach(function(l){var E=m.elementaryStreams[l];if(!E)return;var b=p[l],h=i!==null||E.partial===!0;a.range[l]=u.getBufferedTimes(m,i,h,b)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},r.fragBuffered=function(d){var u=c(d),p=this.fragments[u];p&&(p.backtrack=p.loaded=null,p.buffered=!0)},r.getBufferedTimes=function(d,u,p,m){for(var i={time:[],partial:p},t=u?u.start:d.start,a=u?u.end:d.end,l=d.minEndPTS||a,E=d.maxStartPTS||t,b=0;b<m.length;b++){var h=m.start(b)-this.bufferPadding,L=m.end(b)+this.bufferPadding;if(E>=h&&l<=L){i.time.push({startPTS:Math.max(t,m.start(b)),endPTS:Math.min(a,m.end(b))});break}else if(t<L&&a>h)i.partial=!0,i.time.push({startPTS:Math.max(t,m.start(b)),endPTS:Math.min(a,m.end(b))});else if(a<=h)break}return i},r.getPartialFragment=function(d){var u=null,p,m,i,t=0,a=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(E){var b=l[E];if(!b)return;y(b)&&(m=b.body.start-a,i=b.body.end+a,d>=m&&d<=i&&(p=Math.min(d-m,i-d),t<=p&&(u=b.body,t=p)))}),u},r.getState=function(d){var u=c(d),p=this.fragments[u];return p?p.buffered?y(p)?f.PARTIAL:f.OK:p.backtrack?f.BACKTRACKED:f.APPENDING:f.NOT_LOADED},r.backtrack=function(d,u){var p=c(d),m=this.fragments[p];if(!m||m.backtrack)return null;var i=m.backtrack=u||m.loaded;return m.loaded=null,i},r.getBacktrackData=function(d){var u=c(d),p=this.fragments[u];if(p){var m,i=p.backtrack;if(i!=null&&(m=i.payload)!==null&&m!==void 0&&m.byteLength)return i;this.removeFragment(d)}return null},r.isTimeBuffered=function(d,u,p){for(var m,i,t=0;t<p.length;t++){if(m=p.start(t)-this.bufferPadding,i=p.end(t)+this.bufferPadding,d>=m&&u<=i)return!0;if(u<=m)return!1}return!1},r.onFragLoaded=function(d,u){var p=u.frag,m=u.part;if(p.sn==="initSegment"||p.bitrateTest||m)return;var i=c(p);this.fragments[i]={body:p,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},r.onBufferAppended=function(d,u){var p=this,m=u.frag,i=u.part,t=u.timeRanges;if(m.type===v.PlaylistLevelType.MAIN)if(this.activeFragment=m,i){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(i)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(l){var E=t[l];if(p.detectEvictedFragments(l,E),!i)for(var b=0;b<E.length;b++)m.appendedPTS=Math.max(E.end(b),m.appendedPTS||0)})},r.onFragBuffered=function(d,u){this.detectPartialFragments(u)},r.hasFragment=function(d){var u=c(d);return!!this.fragments[u]},r.removeFragmentsInRange=function(d,u,p){var m=this;Object.keys(this.fragments).forEach(function(i){var t=m.fragments[i];if(!t)return;if(t.buffered){var a=t.body;a.type===p&&a.start<u&&a.end>d&&m.removeFragment(a)}})},r.removeFragment=function(d){var u=c(d);d.stats.loaded=0,d.clearElementaryStreamInfo(),delete this.fragments[u]},r.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},o}();function y(o){var r,s;return o.buffered&&(((r=o.range.video)===null||r===void 0?void 0:r.partial)||((s=o.range.audio)===null||s===void 0?void 0:s.partial))}function c(o){return o.type+"_"+o.level+"_"+o.urlId+"_"+o.sn}},"./src/controller/gap-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"STALL_MINIMUM_DURATION_MS",function(){return y}),T.d(g,"MAX_START_GAP_JUMP",function(){return c}),T.d(g,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return o}),T.d(g,"SKIP_BUFFER_RANGE_START",function(){return r}),T.d(g,"default",function(){return s});var D=T("./src/utils/buffer-helper.ts"),v=T("./src/errors.ts"),f=T("./src/events.ts"),S=T("./src/utils/logger.ts"),y=250,c=2,o=.1,r=.05,s=function(){function d(p,m,i,t){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=p,this.media=m,this.fragmentTracker=i,this.hls=t}var u=d.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(m){var i=this.config,t=this.media,a=this.stalled,l=t.currentTime,E=t.seeking,b=this.seeking&&!E,h=!this.seeking&&E;if(this.seeking=E,l!==m){if(this.moved=!0,a!==null){if(this.stallReported){var L=self.performance.now()-a;S.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((h||b)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!D.BufferHelper.getBuffered(t).length)return;var O=D.BufferHelper.bufferInfo(t,l,0),w=O.len>0,C=O.nextStart||0;if(!w&&!C)return;if(E){var x=O.len>c,_=!C||C-l>c&&!this.fragmentTracker.getPartialFragment(l);if(x||_)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var j,N=Math.max(C,O.start||0)-l,P=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,V=P==null||((j=P.details)===null||j===void 0)?void 0:j.live,z=V?P.details.targetduration*2:c;if(N>0&&N<=z){this._trySkipBufferHole(null);return}}var B=self.performance.now();if(a===null){this.stalled=B;return}var K=B-a;!E&&K>=y&&this._reportStall(O.len);var U=D.BufferHelper.bufferInfo(t,l,i.maxBufferHole);this._tryFixBufferStall(U,K)},u._tryFixBufferStall=function(m,i){var t=this.config,a=this.fragmentTracker,l=this.media,E=l.currentTime,b=a.getPartialFragment(E);if(b){var h=this._trySkipBufferHole(b);if(h)return}m.len>t.maxBufferHole&&i>t.highBufferWatchdogPeriod*1e3&&(S.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(m){var i=this.hls,t=this.media,a=this.stallReported;a||(this.stallReported=!0,S.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+m+")"),i.trigger(f.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:m}))},u._trySkipBufferHole=function(m){for(var i=this.config,t=this.hls,a=this.media,l=a.currentTime,E=0,b=D.BufferHelper.getBuffered(a),h=0;h<b.length;h++){var L=b.start(h);if(l+i.maxBufferHole>=E&&l<L){var O=Math.max(L+r,a.currentTime+o);return S.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+O),this.moved=!0,this.stalled=null,a.currentTime=O,m&&t.trigger(f.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+O,frag:m}),O}E=b.end(h)}return 0},u._tryNudgeBuffer=function(){var m=this.config,i=this.hls,t=this.media,a=t.currentTime,l=(this.nudgeRetry||0)+1;if(this.nudgeRetry=l,l<m.nudgeMaxRetry){var E=a+l*m.nudgeOffset;S.logger.warn("Nudging 'currentTime' from "+a+" to "+E),t.currentTime=E,i.trigger(f.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else S.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+m.nudgeMaxRetry+" nudges"),i.trigger(f.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},d}()},"./src/controller/id3-track-controller.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/events.ts"),v=T("./src/utils/texttrack-utils.ts"),f=T("./src/demux/id3.ts"),S=.25,y=function(){function c(r){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=r,this._registerListeners()}var o=c.prototype;return o.destroy=function(){this._unregisterListeners()},o._registerListeners=function(){var s=this.hls;s.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(D.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),s.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},o._unregisterListeners=function(){var s=this.hls;s.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(D.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),s.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},o.onMediaAttached=function(s,d){this.media=d.media},o.onMediaDetaching=function(){if(!this.id3Track)return;Object(v.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},o.getID3Track=function(s){if(!this.media)return;for(var d=0;d<s.length;d++){var u=s[d];if(u.kind==="metadata"&&u.label==="id3")return Object(v.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},o.onFragParsingMetadata=function(s,d){if(!this.media)return;var u=d.frag,p=d.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var m=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<p.length;i++){var t=f.getID3Frames(p[i].data);if(t){var a=p[i].pts,l=i<p.length-1?p[i+1].pts:u.end,E=l-a;E<=0&&(l=a+S);for(var b=0;b<t.length;b++){var h=t[b];if(!f.isTimeStampFrame(h)){var L=new m(a,l,"");L.value=h,this.id3Track.addCue(L)}}}}},o.onBufferFlushing=function(s,d){var u=d.startOffset,p=d.endOffset,m=d.type;if(!m||m==="audio"){var i=this.id3Track;i&&Object(v.removeCuesInRange)(i,u,p)}},c}();g.default=y},"./src/controller/latency-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return c});var D=T("./src/errors.ts"),v=T("./src/events.ts"),f=T("./src/utils/logger.ts");function S(o,r){for(var s=0;s<r.length;s++){var d=r[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(o,d.key,d)}}function y(o,r,s){return r&&S(o.prototype,r),s&&S(o,s),o}var c=function(){function o(s){var d=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return d.timeupdate()},this.hls=s,this.config=s.config,this.registerListeners()}var r=o.prototype;return r.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},r.registerListeners=function(){this.hls.on(v.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(v.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(v.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(v.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(v.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){this.hls.off(v.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(v.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(v.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(v.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(v.Events.ERROR,this.onError)},r.onMediaAttached=function(d,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},r.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},r.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},r.onLevelUpdated=function(d,u){var p=u.details;this.levelDetails=p,p.advanced&&this.timeupdate(),!p.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},r.onError=function(d,u){if(u.details!==D.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,f.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},r.timeupdate=function(){var d=this.media,u=this.levelDetails;if(!d||!u)return;this.currentTime=d.currentTime;var p=this.computeLatency();if(p===null)return;this._latency=p;var m=this.config,i=m.lowLatencyMode,t=m.maxLiveSyncPlaybackRate;if(!i||t===1)return;var a=this.targetLatency;if(a===null)return;var l=p-a,E=Math.min(this.maxLatency,a+u.targetduration),b=l<E;if(u.live&&b&&l>.05&&this.forwardBufferLength>1){var h=Math.min(2,Math.max(1,t)),L=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;d.playbackRate=Math.min(h,Math.max(1,L))}else d.playbackRate!==1&&d.playbackRate!==0&&(d.playbackRate=1)},r.estimateLiveEdge=function(){var d=this.levelDetails;return d===null?null:d.edge+d.age},r.computeLatency=function(){var d=this.estimateLiveEdge();return d===null?null:d-this.currentTime},y(o,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var d=this.config,u=this.levelDetails;return d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:u?d.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var d=this.levelDetails;if(d===null)return null;var u=d.holdBack,p=d.partHoldBack,m=d.targetduration,i=this.config,t=i.liveSyncDuration,a=i.liveSyncDurationCount,l=i.lowLatencyMode,E=this.hls.userConfig,b=l&&p||u;(E.liveSyncDuration||E.liveSyncDurationCount||b===0)&&(b=t!==void 0?t:a*m);var h=m,L=1;return b+Math.min(this.stallCount*L,h)}},{key:"liveSyncPosition",get:function(){var d=this.estimateLiveEdge(),u=this.targetLatency,p=this.levelDetails;if(d===null||u===null||p===null)return null;var m=p.edge,i=d-u-this.edgeStalled,t=m-p.totalduration,a=m-(this.config.lowLatencyMode&&p.partTarget||p.targetduration);return Math.min(Math.max(t,i),a)}},{key:"drift",get:function(){var d=this.levelDetails;return d===null?1:d.drift}},{key:"edgeStalled",get:function(){var d=this.levelDetails;if(d===null)return 0;var u=(this.config.lowLatencyMode&&d.partTarget||d.targetduration)*3;return Math.max(d.age-u,0)}},{key:"forwardBufferLength",get:function(){var d=this.media,u=this.levelDetails;if(!d||!u)return 0;var p=d.buffered.length;return p?d.buffered.end(p-1):u.edge-this.currentTime}}]),o}()},"./src/controller/level-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return i});var D=T("./src/types/level.ts"),v=T("./src/events.ts"),f=T("./src/errors.ts"),S=T("./src/utils/codecs.ts"),y=T("./src/controller/level-helper.ts"),c=T("./src/controller/base-playlist-controller.ts"),o=T("./src/types/loader.ts");function r(){return r=Object.assign||function(t){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var E in l)Object.prototype.hasOwnProperty.call(l,E)&&(t[E]=l[E])}return t},r.apply(this,arguments)}function s(t,a){for(var l=0;l<a.length;l++){var E=a[l];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(t,E.key,E)}}function d(t,a,l){return a&&s(t.prototype,a),l&&s(t,l),t}function u(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,p(t,a)}function p(t,a){return p=Object.setPrototypeOf||function(E,b){return E.__proto__=b,E},p(t,a)}var m=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(t){u(a,t);function a(E){var b;return b=t.call(this,E,"[level-controller]")||this,b._levels=[],b._firstLevel=-1,b._startLevel=void 0,b.currentLevelIndex=-1,b.manualLevelIndex=-1,b.onParsedComplete=void 0,b._registerListeners(),b}var l=a.prototype;return l._registerListeners=function(){var b=this.hls;b.on(v.Events.MANIFEST_LOADED,this.onManifestLoaded,this),b.on(v.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(v.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(v.Events.FRAG_LOADED,this.onFragLoaded,this),b.on(v.Events.ERROR,this.onError,this)},l._unregisterListeners=function(){var b=this.hls;b.off(v.Events.MANIFEST_LOADED,this.onManifestLoaded,this),b.off(v.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(v.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(v.Events.FRAG_LOADED,this.onFragLoaded,this),b.off(v.Events.ERROR,this.onError,this)},l.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},l.startLoad=function(){var b=this._levels;b.forEach(function(h){h.loadError=0}),t.prototype.startLoad.call(this)},l.onManifestLoaded=function(b,h){var L=[],O=[],w=[],C,x={},_,j=!1,N=!1,P=!1;if(h.levels.forEach(function(K){var U=K.attrs;j=j||!!(K.width&&K.height),N=N||!!K.videoCodec,P=P||!!K.audioCodec,m&&K.audioCodec&&K.audioCodec.indexOf("mp4a.40.34")!==-1&&(K.audioCodec=void 0);var W=K.bitrate+"-"+K.attrs.RESOLUTION+"-"+K.attrs.CODECS;_=x[W],_?_.url.push(K.url):(_=new D.Level(K),x[W]=_,L.push(_)),U&&(U.AUDIO&&Object(y.addGroupId)(_,"audio",U.AUDIO),U.SUBTITLES&&Object(y.addGroupId)(_,"text",U.SUBTITLES))}),(j||N)&&P&&(L=L.filter(function(K){var U=K.videoCodec,W=K.width,H=K.height;return!!U||!!(W&&H)})),L=L.filter(function(K){var U=K.audioCodec,W=K.videoCodec;return(!U||Object(S.isCodecSupportedInMp4)(U,"audio"))&&(!W||Object(S.isCodecSupportedInMp4)(W,"video"))}),h.audioTracks&&(O=h.audioTracks.filter(function(K){return!K.audioCodec||Object(S.isCodecSupportedInMp4)(K.audioCodec,"audio")}),Object(y.assignTrackIdsByGroup)(O)),h.subtitles&&(w=h.subtitles,Object(y.assignTrackIdsByGroup)(w)),L.length>0){C=L[0].bitrate,L.sort(function(K,U){return K.bitrate-U.bitrate}),this._levels=L;for(var V=0;V<L.length;V++)if(L[V].bitrate===C){this._firstLevel=V,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+C);break}var z=P&&!N,B={levels:L,audioTracks:O,subtitleTracks:w,firstLevel:this._firstLevel,stats:h.stats,audio:P,video:N,altAudio:!z&&O.some(function(K){return!!K.url})};this.hls.trigger(v.Events.MANIFEST_PARSED,B),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(v.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:h.url,reason:"no level with compatible codecs found in manifest"})},l.onError=function(b,h){if(t.prototype.onError.call(this,b,h),h.fatal)return;var L=h.context,O=this._levels[this.currentLevelIndex];if(L&&(L.type===o.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&L.groupId===O.audioGroupIds[O.urlId]||L.type===o.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&L.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var w=!1,C=!0,x;switch(h.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:if(h.frag){var _=this._levels[h.frag.level];_?(_.fragmentError++,_.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=h.frag.level)):x=h.frag.level}break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(C=!1),x=L.level),w=!0;break;case f.ErrorDetails.REMUX_ALLOC_ERROR:x=h.level,w=!0;break}x!==void 0&&this.recoverLevel(h,x,w,C)},l.recoverLevel=function(b,h,L,O){var w=b.details,C=this._levels[h];if(C.loadError++,L){var x=this.retryLoadingOrFail(b);if(x)b.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var _=C.url.length;if(_>1&&C.loadError<_)b.levelRetry=!0,this.redundantFailover(h);else if(this.manualLevelIndex===-1){var j=h===0?this._levels.length-1:h-1;this.currentLevelIndex!==j&&this._levels[j].loadError===0&&(this.warn(w+": switch to "+j),b.levelRetry=!0,this.hls.nextAutoLevel=j)}}},l.redundantFailover=function(b){var h=this._levels[b],L=h.url.length;if(L>1){var O=(h.urlId+1)%L;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(w){w.urlId=O}),this.level=b}},l.onFragLoaded=function(b,h){var L=h.frag;if(L!==void 0&&L.type===o.PlaylistLevelType.MAIN){var O=this._levels[L.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},l.onLevelLoaded=function(b,h){var L,O=h.level,w=h.details,C=this._levels[O];if(!C){var x;this.warn("Invalid level index "+O),(x=h.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(w.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(C.fragmentError===0&&(C.loadError=0,this.retryCount=0),this.playlistLoaded(O,h,C.details)):(L=h.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(w.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(b,h){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var O=-1,w=this.hls.audioTracks[h.id].groupId,C=0;C<L.audioGroupIds.length;C++)if(L.audioGroupIds[C]===w){O=C;break}O!==L.urlId&&(L.urlId=O,this.startLoad())}},l.loadPlaylist=function(b){var h=this.currentLevelIndex,L=this._levels[h];if(this.canLoad&&L&&L.url.length>0){var O=L.urlId,w=L.url[O];if(b)try{w=b.addDirectives(w)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+h+(b?" at sn "+b.msn+" part "+b.part:"")+" with URL-id "+O+" "+w),this.clearTimer(),this.hls.trigger(v.Events.LEVEL_LOADING,{url:w,level:h,id:O,deliveryDirectives:b||null})}},l.removeLevel=function(b,h){var L=function(C,x){return x!==h},O=this._levels.filter(function(w,C){return C!==b?!0:w.url.length>1&&h!==void 0?(w.url=w.url.filter(L),w.audioGroupIds&&(w.audioGroupIds=w.audioGroupIds.filter(L)),w.textGroupIds&&(w.textGroupIds=w.textGroupIds.filter(L)),w.urlId=0,!0):!1}).map(function(w,C){var x=w.details;return x!=null&&x.fragments&&x.fragments.forEach(function(_){_.level=C}),w});this._levels=O,this.hls.trigger(v.Events.LEVELS_UPDATED,{levels:O})},d(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(b){var h,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===b&&(h=L[b])!==null&&h!==void 0&&h.details)return;if(b<0||b>=L.length){var O=b<0;if(this.hls.trigger(v.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.LEVEL_SWITCH_ERROR,level:b,fatal:O,reason:"invalid level idx"}),O)return;b=Math.min(b,L.length-1)}this.clearTimer();var w=this.currentLevelIndex,C=L[w],x=L[b];this.log("switching to level "+b+" from "+w),this.currentLevelIndex=b;var _=r({},x,{level:b,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete _._urlId,this.hls.trigger(v.Events.LEVEL_SWITCHING,_);var j=x.details;if(!j||j.live){var N=this.switchParams(x.uri,C==null?void 0:C.details);this.loadPlaylist(N)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(b){this.manualLevelIndex=b,this._startLevel===void 0&&(this._startLevel=b),b!==-1&&(this.level=b)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(b){this._firstLevel=b}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var b=this.hls.config.startLevel;return b!==void 0?b:this._firstLevel}else return this._startLevel},set:function(b){this._startLevel=b}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(b){this.level=b,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=b)}}]),a}(c.default)},"./src/controller/level-helper.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"addGroupId",function(){return f}),T.d(g,"assignTrackIdsByGroup",function(){return S}),T.d(g,"updatePTS",function(){return y}),T.d(g,"updateFragPTSDTS",function(){return o}),T.d(g,"mergeDetails",function(){return r}),T.d(g,"mapPartIntersection",function(){return s}),T.d(g,"mapFragmentIntersection",function(){return d}),T.d(g,"adjustSliding",function(){return u}),T.d(g,"addSliding",function(){return p}),T.d(g,"computeReloadInterval",function(){return m}),T.d(g,"getFragmentWithSN",function(){return i}),T.d(g,"getPartWith",function(){return t});var D=T("./src/polyfills/number.ts"),v=T("./src/utils/logger.ts");function f(a,l,E){switch(l){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(E);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(E);break}}function S(a){var l={};a.forEach(function(E){var b=E.groupId||"";E.id=l[b]=l[b]||0,l[b]++})}function y(a,l,E){var b=a[l],h=a[E];c(b,h)}function c(a,l){var E=l.startPTS;if(Object(D.isFiniteNumber)(E)){var b=0,h;l.sn>a.sn?(b=E-a.start,h=a):(b=a.start-E,h=l),h.duration!==b&&(h.duration=b)}else if(l.sn>a.sn){var L=a.cc===l.cc;L&&a.minEndPTS?l.start=a.start+(a.minEndPTS-a.start):l.start=a.start+a.duration}else l.start=Math.max(a.start-l.duration,0)}function o(a,l,E,b,h,L){var O=b-E;O<=0&&(v.logger.warn("Fragment should have a positive duration",l),b=E+l.duration,L=h+l.duration);var w=E,C=b,x=l.startPTS,_=l.endPTS;if(Object(D.isFiniteNumber)(x)){var j=Math.abs(x-E);Object(D.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(j,l.deltaPTS):l.deltaPTS=j,w=Math.max(E,x),E=Math.min(E,x),h=Math.min(h,l.startDTS),C=Math.min(b,_),b=Math.max(b,_),L=Math.max(L,l.endDTS)}l.duration=b-E;var N=E-l.start;l.appendedPTS=b,l.start=l.startPTS=E,l.maxStartPTS=w,l.startDTS=h,l.endPTS=b,l.minEndPTS=C,l.endDTS=L;var P=l.sn;if(!a||P<a.startSN||P>a.endSN)return 0;var V,z=P-a.startSN,B=a.fragments;for(B[z]=l,V=z;V>0;V--)c(B[V],B[V-1]);for(V=z;V<B.length-1;V++)c(B[V],B[V+1]);return a.fragmentHint&&c(B[B.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,N}function r(a,l){for(var E=null,b=a.fragments,h=b.length-1;h>=0;h--){var L=b[h].initSegment;if(L){E=L;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var O=0,w;if(d(a,l,function(V,z){V.relurl&&(O=V.cc-z.cc),Object(D.isFiniteNumber)(V.startPTS)&&Object(D.isFiniteNumber)(V.endPTS)&&(z.start=z.startPTS=V.startPTS,z.startDTS=V.startDTS,z.appendedPTS=V.appendedPTS,z.maxStartPTS=V.maxStartPTS,z.endPTS=V.endPTS,z.endDTS=V.endDTS,z.minEndPTS=V.minEndPTS,z.duration=V.endPTS-V.startPTS,z.duration&&(w=z),l.PTSKnown=l.alignedSliding=!0),z.elementaryStreams=V.elementaryStreams,z.loader=V.loader,z.stats=V.stats,z.urlId=V.urlId,V.initSegment&&(z.initSegment=V.initSegment,E=V.initSegment)}),E){var C=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;C.forEach(function(V){var z;(!V.initSegment||V.initSegment.relurl===((z=E)===null||z===void 0?void 0:z.relurl))&&(V.initSegment=E)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(V){return!V}),l.deltaUpdateFailed)){v.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=l.skippedSegments;x--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var _=l.fragments;if(O){v.logger.warn("discontinuity sliding from playlist, take drift into account");for(var j=0;j<_.length;j++)_[j].cc+=O}l.skippedSegments&&(l.startCC=l.fragments[0].cc),s(a.partList,l.partList,function(V,z){z.elementaryStreams=V.elementaryStreams,z.stats=V.stats}),w?o(l,w,w.startPTS,w.endPTS,w.startDTS,w.endDTS):u(a,l),_.length&&(l.totalduration=l.edge-_[0].start),l.driftStartTime=a.driftStartTime,l.driftStart=a.driftStart;var N=l.advancedDateTime;if(l.advanced&&N){var P=l.edge;l.driftStart||(l.driftStartTime=N,l.driftStart=P),l.driftEndTime=N,l.driftEnd=P}else l.driftEndTime=a.driftEndTime,l.driftEnd=a.driftEnd,l.advancedDateTime=a.advancedDateTime}function s(a,l,E){if(a&&l)for(var b=0,h=0,L=a.length;h<=L;h++){var O=a[h],w=l[h+b];O&&w&&O.index===w.index&&O.fragment.sn===w.fragment.sn?E(O,w):b--}}function d(a,l,E){for(var b=l.skippedSegments,h=Math.max(a.startSN,l.startSN)-l.startSN,L=(a.fragmentHint?1:0)+(b?l.endSN:Math.min(a.endSN,l.endSN))-l.startSN,O=l.startSN-a.startSN,w=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,x=h;x<=L;x++){var _=C[O+x],j=w[x];b&&!j&&x<b&&(j=l.fragments[x]=_),_&&j&&E(_,j)}}function u(a,l){var E=l.startSN+l.skippedSegments-a.startSN,b=a.fragments;if(E<0||E>=b.length)return;p(l,b[E].start)}function p(a,l){if(l){for(var E=a.fragments,b=a.skippedSegments;b<E.length;b++)E[b].start+=l;a.fragmentHint&&(a.fragmentHint.start+=l)}}function m(a,l){var E=1e3*a.levelTargetDuration,b=E/2,h=a.age,L=h>0&&h<E*3,O=l.loading.end-l.loading.start,w,C=a.availabilityDelay;if(a.updated===!1)if(L){var x=333*a.misses;w=Math.max(Math.min(b,O*2),x),a.availabilityDelay=(a.availabilityDelay||0)+w}else w=b;else L?(C=Math.min(C||E/2,h),a.availabilityDelay=C,w=C+E-h):w=E-O;return Math.round(w)}function i(a,l,E){if(!a||!a.details)return null;var b=a.details,h=b.fragments[l-b.startSN];return h||(h=b.fragmentHint,h&&h.sn===l?h:l<b.startSN&&E&&E.sn===l?E:null)}function t(a,l,E){if(!a||!a.details)return null;var b=a.details.partList;if(b)for(var h=b.length;h--;){var L=b[h];if(L.index===E&&L.fragment.sn===l)return L}return null}},"./src/controller/stream-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return b});var D=T("./src/polyfills/number.ts"),v=T("./src/controller/base-stream-controller.ts"),f=T("./src/is-supported.ts"),S=T("./src/events.ts"),y=T("./src/utils/buffer-helper.ts"),c=T("./src/controller/fragment-tracker.ts"),o=T("./src/types/loader.ts"),r=T("./src/loader/fragment.ts"),s=T("./src/demux/transmuxer-interface.ts"),d=T("./src/types/transmuxer.ts"),u=T("./src/controller/gap-controller.ts"),p=T("./src/errors.ts"),m=T("./src/utils/logger.ts");function i(h,L){for(var O=0;O<L.length;O++){var w=L[O];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(h,w.key,w)}}function t(h,L,O){return L&&i(h.prototype,L),O&&i(h,O),h}function a(h,L){h.prototype=Object.create(L.prototype),h.prototype.constructor=h,l(h,L)}function l(h,L){return l=Object.setPrototypeOf||function(w,C){return w.__proto__=C,w},l(h,L)}var E=100,b=function(h){a(L,h);function L(w,C){var x;return x=h.call(this,w,C,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var O=L.prototype;return O._registerListeners=function(){var C=this.hls;C.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.on(S.Events.LEVEL_LOADING,this.onLevelLoading,this),C.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(S.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.on(S.Events.ERROR,this.onError,this),C.on(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(S.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(S.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(S.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var C=this.hls;C.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(S.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.off(S.Events.ERROR,this.onError,this),C.off(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(S.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(S.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(S.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(C){if(this.levels){var x=this.lastCurrentTime,_=this.hls;if(this.stopLoad(),this.setInterval(E),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var j=_.startLevel;j===-1&&(_.config.testBandwidth?(j=0,this.bitrateTest=!0):j=_.nextAutoLevel),this.level=_.nextLoadLevel=j,this.loadedmetadata=!1}x>0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),C=x),this.state=v.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=v.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,h.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case v.State.IDLE:this.doTickIdle();break;case v.State.WAITING_LEVEL:{var C,x=this.levels,_=this.level,j=x==null||((C=x[_])===null||C===void 0)?void 0:C.details;if(j&&(!j.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(j))break;this.state=v.State.IDLE;break}break}case v.State.FRAG_LOADING_WAITING_RETRY:{var N,P=self.performance.now(),V=this.retryDate;(!V||P>=V||(N=this.media)!==null&&N!==void 0&&N.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=v.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){h.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var C,x,_=this.hls,j=this.levelLastLoaded,N=this.levels,P=this.media,V=_.config,z=_.nextLoadLevel;if(j===null||!P&&(this.startFragRequested||!V.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!N||!N[z])return;var B=N[z];this.level=_.nextLoadLevel=z;var K=B.details;if(!K||this.state===v.State.WAITING_LEVEL||K.live&&this.levelLastLoaded!==z){this.state=v.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:P,o.PlaylistLevelType.MAIN);if(U===null)return;var W=U.len,H=this.getMaxBufferLength(B.maxBitrate);if(W>=H)return;if(this._streamEnded(U,K)){var q={};this.altAudio&&(q.type="video"),this.hls.trigger(S.Events.BUFFER_EOS,q),this.state=v.State.ENDED;return}var ne=U.end,te=this.getNextFragment(ne,K);if(this.couldBacktrack&&!this.fragPrevious&&te&&te.sn!=="initSegment"){var _e=te.sn-K.startSN;_e>1&&(te=K.fragments[_e-1],this.fragmentTracker.removeFragment(te))}if(te&&this.fragmentTracker.getState(te)===c.FragmentState.OK&&this.nextLoadPosition>ne){var Ce=this.audioOnly&&!this.altAudio?r.ElementaryStreamTypes.AUDIO:r.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(P,Ce,o.PlaylistLevelType.MAIN),te=this.getNextFragment(this.nextLoadPosition,K)}if(!te)return;te.initSegment&&!te.initSegment.data&&!this.bitrateTest&&(te=te.initSegment),((C=te.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((x=te.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(te,K):this.loadFragment(te,K,ne)},O.loadFragment=function(C,x,_){var j,N=this.fragmentTracker.getState(C);if(this.fragCurrent=C,N===c.FragmentState.BACKTRACKED){var P=this.fragmentTracker.getBacktrackData(C);if(P){this._handleFragmentLoadProgress(P),this._handleFragmentLoadComplete(P);return}else N=c.FragmentState.NOT_LOADED}N===c.FragmentState.NOT_LOADED||N===c.FragmentState.PARTIAL?C.sn==="initSegment"?this._loadInitSegment(C):this.bitrateTest?(C.bitrateTest=!0,this.log("Fragment "+C.sn+" of level "+C.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(C)):(this.startFragRequested=!0,h.prototype.loadFragment.call(this,C,x,_)):N===c.FragmentState.APPENDING?this.reduceMaxBufferLength(C.duration)&&this.fragmentTracker.removeFragment(C):((j=this.media)===null||j===void 0?void 0:j.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(C){var x=this.fragmentTracker.getAppendedFrag(C,o.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},O.getBufferedFrag=function(C){return this.fragmentTracker.getBufferedFrag(C,o.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(C){return C?this.getBufferedFrag(C.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var C=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&&C){var N=this.hls.nextLoadLevel,P=C[N],V=this.fragLastKbps;V&&this.fragCurrent?_=this.fragCurrent.duration*P.maxBitrate/(1e3*V)+1:_=0}else _=0;var z=this.getBufferedFrag(x.currentTime+_);if(z){var B=this.followingBufferedFrag(z);if(B){this.abortCurrentFrag();var K=B.maxStartPTS?B.maxStartPTS:B.start,U=B.duration,W=Math.max(z.end,K+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(W,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var C=this.fragCurrent;this.fragCurrent=null,C!=null&&C.loader&&C.loader.abort(),this.state===v.State.KEY_LOADING&&(this.state=v.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(C,x){h.prototype.flushMainBuffer.call(this,C,x,this.altAudio?"video":null)},O.onMediaAttached=function(C,x){h.prototype.onMediaAttached.call(this,C,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 u.default(this.config,_,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var C=this.media;C&&(C.removeEventListener("playing",this.onvplaying),C.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),h.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var C=this.media,x=C?C.currentTime:null;Object(D.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(S.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(C,x){var _=!1,j=!1,N;x.levels.forEach(function(P){N=P.audioCodec,N&&(N.indexOf("mp4a.40.2")!==-1&&(_=!0),N.indexOf("mp4a.40.5")!==-1&&(j=!0))}),this.audioCodecSwitch=_&&j&&!Object(f.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},O.onLevelLoading=function(C,x){var _=this.levels;if(!_||this.state!==v.State.IDLE)return;var j=_[x.level];(!j.details||j.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(j.details))&&(this.state=v.State.WAITING_LEVEL)},O.onLevelLoaded=function(C,x){var _,j=this.levels,N=x.level,P=x.details,V=P.totalduration;if(!j){this.warn("Levels were reset while loading level "+N);return}this.log("Level "+N+" loaded ["+P.startSN+","+P.endSN+"], cc ["+P.startCC+", "+P.endCC+"] duration:"+V);var z=this.fragCurrent;z&&(this.state===v.State.FRAG_LOADING||this.state===v.State.FRAG_LOADING_WAITING_RETRY)&&(z.level!==x.level&&z.loader&&(this.state=v.State.IDLE,z.loader.abort()));var B=j[N],K=0;if(P.live||(_=B.details)!==null&&_!==void 0&&_.live){if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed)return;K=this.alignPlaylists(P,B.details)}if(B.details=P,this.levelLastLoaded=N,this.hls.trigger(S.Events.LEVEL_UPDATED,{details:P,level:N}),this.state===v.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(P))return;this.state=v.State.IDLE}this.startFragRequested?P.live&&this.synchronizeToLiveEdge(P):this.setStartPosition(P,K),this.tick()},O._handleFragmentLoadProgress=function(C){var x,_=C.frag,j=C.part,N=C.payload,P=this.levels;if(!P){this.warn("Levels were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var V=P[_.level],z=V.details;if(!z){this.warn("Dropping fragment "+_.sn+" of level "+_.level+" after level details were reset");return}var B=V.videoCodec,K=z.PTSKnown||!z.live,U=(x=_.initSegment)===null||x===void 0?void 0:x.data,W=this._getAudioCodec(V),H=this.transmuxer=this.transmuxer||new s.default(this.hls,o.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),q=j?j.index:-1,ne=q!==-1,te=new d.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,N.byteLength,q,ne),_e=this.initPTS[_.cc];H.push(N,U,W,B,_,j,z.totalduration,K,te,_e)},O.onAudioTrackSwitching=function(C,x){var _=this.altAudio,j=!!x.url,N=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 P=this.fragCurrent;P!=null&&P.loader&&(this.log("Switching to main audio track, cancel main fragment load"),P.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var V=this.hls;_&&V.trigger(S.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),V.trigger(S.Events.AUDIO_TRACK_SWITCHED,{id:N})}},O.onAudioTrackSwitched=function(C,x){var _=x.id,j=!!this.hls.audioTracks[_].url;if(j){var N=this.videoBuffer;N&&this.mediaBuffer!==N&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=N)}this.altAudio=j,this.tick()},O.onBufferCreated=function(C,x){var _=x.tracks,j,N,P=!1;for(var V in _){var z=_[V];if(z.id==="main"){if(N=V,j=z,V==="video"){var B=_[V];B&&(this.videoBuffer=B.buffer)}}else P=!0}P&&j?(this.log("Alternate track found, use "+N+".buffered to schedule main fragment loading"),this.mediaBuffer=j.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(C,x){var _=x.frag,j=x.part;if(_&&_.type!==o.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===v.State.PARSED&&(this.state=v.State.IDLE);return}var N=j?j.stats:_.stats;this.fragLastKbps=Math.round(8*N.total/(N.buffering.end-N.loading.first)),_.sn!=="initSegment"&&(this.fragPrevious=_),this.fragBufferedComplete(_,j)},O.onError=function(C,x){switch(x.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(o.PlaylistLevelType.MAIN,x);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==v.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=v.State.ERROR):!x.levelRetry&&this.state===v.State.WAITING_LEVEL&&(this.state=v.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===v.State.PARSING||this.state===v.State.PARSED)){var _=!0,j=this.getFwdBufferInfo(this.media,o.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}},O.checkBuffer=function(){var C=this.media,x=this.gapController;if(!C||!x||!C.readyState)return;var _=y.BufferHelper.getBuffered(C);!this.loadedmetadata&&_.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=v.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(C,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,_,o.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(C,x){this.levels=x.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var C=this.media,x=C.currentTime,_=this.startPosition;if(_>=0&&x<_){if(C.seeking){m.logger.log("could not seek to "+_+", already seeking at "+x);return}var j=y.BufferHelper.getBuffered(C),N=j.length?j.start(0):0,P=N-_;P>0&&(P<this.config.maxBufferHole||P<this.config.maxFragLookUpTolerance)&&(m.logger.log("adjusting start position by "+P+" to match buffer start"),_+=P,this.startPosition=_),this.log("seek to target start position "+_+" from current time "+x),C.currentTime=_}},O._getAudioCodec=function(C){var x=this.config.defaultAudioCodec||C.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},O._loadBitrateTestFrag=function(C){var x=this;this._doFragLoad(C).then(function(_){var j=x.hls;if(!_||j.nextLoadLevel||x.fragContextChanged(C))return;x.fragLoadError=0,x.state=v.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var N=C.stats;N.parsing.start=N.parsing.end=N.buffering.start=N.buffering.end=self.performance.now(),j.trigger(S.Events.FRAG_LOADED,_)})},O._handleTransmuxComplete=function(C){var x,_="main",j=this.hls,N=C.remuxResult,P=C.chunkMeta,V=this.getCurrentContext(P);if(!V){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var z=V.frag,B=V.part,K=V.level,U=N.video,W=N.text,H=N.id3,q=N.initSegment,ne=this.altAudio?void 0:N.audio;if(this.fragContextChanged(z))return;if(this.state=v.State.PARSING,q){q.tracks&&(this._bufferInitSegment(K,q.tracks,z,P),j.trigger(S.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:_,tracks:q.tracks}));var te=q.initPTS,_e=q.timescale;Object(D.isFiniteNumber)(te)&&(this.initPTS[z.cc]=te,j.trigger(S.Events.INIT_PTS_FOUND,{frag:z,id:_,initPTS:te,timescale:_e}))}if(U&&N.independent!==!1){if(K.details){var Ce=U.startPTS,me=U.endPTS,Me=U.startDTS,Oe=U.endDTS;if(B)B.elementaryStreams[U.type]={startPTS:Ce,endPTS:me,startDTS:Me,endDTS:Oe};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var he=this.getLoadPosition()+this.config.maxBufferHole;if(he<Ce){this.backtrack(z);return}z.setElementaryStreamInfo(U.type,z.start,me,z.start,Oe,!0)}z.setElementaryStreamInfo(U.type,Ce,me,Me,Oe),this.bufferFragmentData(U,z,B,P)}}else if(N.independent===!1){this.backtrack(z);return}if(ne){var ce=ne.startPTS,se=ne.endPTS,Te=ne.startDTS,re=ne.endDTS;B&&(B.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:se,startDTS:Te,endDTS:re}),z.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,ce,se,Te,re),this.bufferFragmentData(ne,z,B,P)}if(H!=null&&(x=H.samples)!==null&&x!==void 0&&x.length){var ue={frag:z,id:_,samples:H.samples};j.trigger(S.Events.FRAG_PARSING_METADATA,ue)}if(W){var fe={frag:z,id:_,samples:W.samples};j.trigger(S.Events.FRAG_PARSING_USERDATA,fe)}},O._bufferInitSegment=function(C,x,_,j){var N=this;if(this.state!==v.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var P=x.audio,V=x.video,z=x.audiovideo;if(P){var B=C.audioCodec,K=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(B&&(B.indexOf("mp4a.40.5")!==-1?B="mp4a.40.2":B="mp4a.40.5"),P.metadata.channelCount!==1&&K.indexOf("firefox")===-1&&(B="mp4a.40.5")),K.indexOf("android")!==-1&&P.container!=="audio/mpeg"&&(B="mp4a.40.2",this.log("Android: force audio codec to "+B)),C.audioCodec&&C.audioCodec!==B&&this.log('Swapping manifest audio codec "'+C.audioCodec+'" for "'+B+'"'),P.levelCodec=B,P.id="main",this.log("Init audio buffer, container:"+P.container+", codecs[selected/level/parsed]=["+(B||"")+"/"+(C.audioCodec||"")+"/"+P.codec+"]")}V&&(V.levelCodec=C.videoCodec,V.id="main",this.log("Init video buffer, container:"+V.container+", codecs[level/parsed]=["+(C.videoCodec||"")+"/"+V.codec+"]")),z&&this.log("Init audiovideo buffer, container:"+z.container+", codecs[level/parsed]=["+(C.attrs.CODECS||"")+"/"+z.codec+"]"),this.hls.trigger(S.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(U){var W=x[U],H=W.initSegment;H!=null&&H.byteLength&&N.hls.trigger(S.Events.BUFFER_APPENDING,{type:U,data:H,frag:_,part:null,chunkMeta:j,parent:_.type})}),this.tick()},O.backtrack=function(C){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(C);var x=this.fragmentTracker.backtrack(C);this.fragPrevious=null,this.nextLoadPosition=C.start,x?this.resetFragmentLoading(C):this.state=v.State.BACKTRACKING},O.checkFragmentChanged=function(){var C=this.media,x=null;if(C&&C.readyState>1&&C.seeking===!1){var _=C.currentTime;if(y.BufferHelper.isBuffered(C,_)?x=this.getAppendedFrag(_):y.BufferHelper.isBuffered(C,_+.1)&&(x=this.getAppendedFrag(_+.1)),x){var j=this.fragPlaying,N=x.level;(!j||x.sn!==j.sn||j.level!==N||x.urlId!==j.urlId)&&(this.hls.trigger(S.Events.FRAG_CHANGED,{frag:x}),(!j||j.level!==N)&&this.hls.trigger(S.Events.LEVEL_SWITCHED,{level:N}),this.fragPlaying=x)}}},t(L,[{key:"nextLevel",get:function(){var C=this.nextBufferedFrag;return C?C.level:-1}},{key:"currentLevel",get:function(){var C=this.media;if(C){var x=this.getAppendedFrag(C.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var x=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(v.default)},"./src/controller/subtitle-stream-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"SubtitleStreamController",function(){return a});var D=T("./src/events.ts"),v=T("./src/utils/logger.ts"),f=T("./src/utils/buffer-helper.ts"),S=T("./src/controller/fragment-finders.ts"),y=T("./src/utils/discontinuities.ts"),c=T("./src/controller/level-helper.ts"),o=T("./src/controller/fragment-tracker.ts"),r=T("./src/controller/base-stream-controller.ts"),s=T("./src/types/loader.ts"),d=T("./src/types/level.ts");function u(l,E){for(var b=0;b<E.length;b++){var h=E[b];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}function p(l,E,b){return E&&u(l.prototype,E),b&&u(l,b),l}function m(l,E){l.prototype=Object.create(E.prototype),l.prototype.constructor=l,i(l,E)}function i(l,E){return i=Object.setPrototypeOf||function(h,L){return h.__proto__=L,h},i(l,E)}var t=500,a=function(l){m(E,l);function E(h,L){var O;return O=l.call(this,h,L,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var b=E.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var L=this.hls;L.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(D.Events.ERROR,this.onError,this),L.on(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(D.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(D.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(D.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b._unregisterListeners=function(){var L=this.hls;L.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(D.Events.ERROR,this.onError,this),L.off(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(D.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(D.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(D.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b.startLoad=function(){this.stopLoad(),this.state=r.State.IDLE,this.setInterval(t),this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},b.onLevelLoaded=function(L,O){this.mainDetails=O.details},b.onSubtitleFragProcessed=function(L,O){var w=O.frag,C=O.success;if(this.fragPrevious=w,this.state=r.State.IDLE,!C)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var _,j=w.start,N=0;N<x.length;N++)if(j>=x[N].start&&j<=x[N].end){_=x[N];break}var P=w.start+w.duration;_?_.end=P:(_={start:j,end:P},x.push(_)),this.fragmentTracker.fragBuffered(w)},b.onBufferFlushing=function(L,O){var w=O.startOffset,C=O.endOffset;if(w===0&&C!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,_=this.levels;if(!_.length||!_[x]||!_[x].details)return;var j=_[x].details,N=j.targetduration,P=C-N;if(P<=0)return;O.endOffsetSubtitles=Math.max(0,P),this.tracksBuffered.forEach(function(V){for(var z=0;z<V.length;){if(V[z].end<=P){V.shift();continue}else if(V[z].start<P)V[z].start=P;else break;z++}}),this.fragmentTracker.removeFragmentsInRange(w,P,s.PlaylistLevelType.SUBTITLE)}},b.onError=function(L,O){var w,C=O.frag;if(!C||C.type!==s.PlaylistLevelType.SUBTITLE)return;(w=this.fragCurrent)!==null&&w!==void 0&&w.loader&&this.fragCurrent.loader.abort(),this.state=r.State.IDLE},b.onSubtitleTracksUpdated=function(L,O){var w=this,C=O.subtitleTracks;this.tracksBuffered=[],this.levels=C.map(function(x){return new d.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){w.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},b.onSubtitleTrackSwitch=function(L,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var w=this.levels[this.currentTrackId];w!=null&&w.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,w&&this.setInterval(t)},b.onSubtitleTrackLoaded=function(L,O){var w,C=O.details,x=O.id,_=this.currentTrackId,j=this.levels;if(!j.length)return;var N=j[_];if(x>=j.length||x!==_||!N)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,C.live||(w=N.details)!==null&&w!==void 0&&w.live){var P=this.mainDetails;if(C.deltaUpdateFailed||!P)return;var V=P.fragments[0];if(!N.details)C.hasProgramDateTime&&P.hasProgramDateTime?Object(y.alignMediaPlaylistByPDT)(C,P):V&&Object(c.addSliding)(C,V.start);else{var z=this.alignPlaylists(C,N.details);z===0&&V&&Object(c.addSliding)(C,V.start)}}if(N.details=C,this.levelLastLoaded=x,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===r.State.IDLE){var B=Object(S.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);B||(this.warn("Subtitle playlist not aligned with playback"),N.details=void 0)}},b._handleFragmentLoadComplete=function(L){var O=L.frag,w=L.payload,C=O.decryptdata,x=this.hls;if(this.fragContextChanged(O))return;if(w&&w.byteLength>0&&C&&C.key&&C.iv&&C.method==="AES-128"){var _=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(w),C.key.buffer,C.iv.buffer).then(function(j){var N=performance.now();x.trigger(D.Events.FRAG_DECRYPTED,{frag:O,payload:j,stats:{tstart:_,tdecrypt:N}})})}},b.doTick=function(){if(!this.media){this.state=r.State.IDLE;return}if(this.state===r.State.IDLE){var L,O=this.currentTrackId,w=this.levels;if(!w.length||!w[O]||!w[O].details)return;var C=w[O].details,x=C.targetduration,_=this.config,j=this.media,N=f.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,j.currentTime-x,_.maxBufferHole),P=N.end,V=N.len,z=this.getMaxBufferLength()+x;if(V>z)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var B=C.fragments,K=B.length,U=C.edge,W,H=this.fragPrevious;if(P<U){var q=_.maxFragLookUpTolerance;H&&C.hasProgramDateTime&&(W=Object(S.findFragmentByPDT)(B,H.endProgramDateTime,q)),W||(W=Object(S.findFragmentByPTS)(H,B,P,q),!W&&H&&H.start<B[0].start&&(W=B[0]))}else W=B[K-1];(L=W)!==null&&L!==void 0&&L.encrypted?(v.logger.log("Loading key for "+W.sn),this.state=r.State.KEY_LOADING,this.hls.trigger(D.Events.KEY_LOADING,{frag:W})):W&&this.fragmentTracker.getState(W)===o.FragmentState.NOT_LOADED&&this.loadFragment(W,C,P)}},b.loadFragment=function(L,O,w){this.fragCurrent=L,l.prototype.loadFragment.call(this,L,O,w)},p(E,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),E}(r.default)},"./src/controller/subtitle-track-controller.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/events.ts"),v=T("./src/utils/texttrack-utils.ts"),f=T("./src/controller/base-playlist-controller.ts"),S=T("./src/types/loader.ts");function y(u,p){for(var m=0;m<p.length;m++){var i=p[m];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function c(u,p,m){return p&&y(u.prototype,p),m&&y(u,m),u}function o(u,p){u.prototype=Object.create(p.prototype),u.prototype.constructor=u,r(u,p)}function r(u,p){return r=Object.setPrototypeOf||function(i,t){return i.__proto__=t,i},r(u,p)}var s=function(u){o(p,u);function p(i){var t;return t=u.call(this,i,"[subtitle-track-controller]")||this,t.media=null,t.tracks=[],t.groupId=null,t.tracksInGroup=[],t.trackId=-1,t.selectDefaultTrack=!0,t.queuedDefaultTrack=-1,t.trackChangeListener=function(){return t.onTextTracksChanged()},t.asyncPollTrackChange=function(){return t.pollTrackChange(0)},t.useTextTrackPolling=!1,t.subtitlePollingInterval=-1,t.subtitleDisplay=!0,t.registerListeners(),t}var m=p.prototype;return m.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},m.registerListeners=function(){var t=this.hls;t.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(D.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(D.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(D.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){var t=this.hls;t.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(D.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(D.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(D.Events.ERROR,this.onError,this)},m.onMediaAttached=function(t,a){if(this.media=a.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},m.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},m.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var t=d(this.media.textTracks);t.forEach(function(a){Object(v.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},m.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},m.onManifestParsed=function(t,a){this.tracks=a.subtitleTracks},m.onSubtitleTrackLoaded=function(t,a){var l=a.id,E=a.details,b=this.trackId,h=this.tracksInGroup[b];if(!h){this.warn("Invalid subtitle track id "+l);return}var L=h.details;h.details=a.details,this.log("subtitle track "+l+" loaded ["+E.startSN+"-"+E.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,a,L))},m.onLevelLoading=function(t,a){this.switchLevel(a.level)},m.onLevelSwitching=function(t,a){this.switchLevel(a.level)},m.switchLevel=function(t){var a=this.hls.levels[t];if(!(a!=null&&a.textGroupIds))return;var l=a.textGroupIds[a.urlId];if(this.groupId!==l){var E=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,b=this.tracks.filter(function(O){return!l||O.groupId===l});this.tracksInGroup=b;var h=this.findTrackId(E==null?void 0:E.name)||this.findTrackId();this.groupId=l;var L={subtitleTracks:b};this.log("Updating subtitle tracks, "+b.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(D.Events.SUBTITLE_TRACKS_UPDATED,L),h!==-1&&this.setSubtitleTrack(h,E)}},m.findTrackId=function(t){for(var a=this.tracksInGroup,l=0;l<a.length;l++){var E=a[l];if((!this.selectDefaultTrack||E.default)&&(!t||t===E.name))return E.id}return-1},m.onError=function(t,a){if(u.prototype.onError.call(this,t,a),a.fatal||!a.context)return;a.context.type===S.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},m.loadPlaylist=function(t){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var l=a.id,E=a.groupId,b=a.url;if(t)try{b=t.addDirectives(b)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Loading subtitle playlist for id "+l),this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADING,{url:b,id:l,groupId:E,deliveryDirectives:t||null})}},m.toggleTrackModes=function(t){var a=this,l=this.media,E=this.subtitleDisplay,b=this.trackId;if(!l)return;var h=d(l.textTracks),L=h.filter(function(C){return C.groupId===a.groupId});if(t===-1)[].slice.call(h).forEach(function(C){C.mode="disabled"});else{var O=L[b];O&&(O.mode="disabled")}var w=L[t];w&&(w.mode=E?"showing":"hidden")},m.setSubtitleTrack=function(t,a){var l,E=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(l=E[t])!==null&&l!==void 0&&l.details)||t<-1||t>=E.length)return;this.clearTimer();var b=E[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,b){var h=b.id,L=b.groupId,O=L===void 0?"":L,w=b.name,C=b.type,x=b.url;this.hls.trigger(D.Events.SUBTITLE_TRACK_SWITCH,{id:h,groupId:O,name:w,type:C,url:x});var _=this.switchParams(b.url,a==null?void 0:a.details);this.loadPlaylist(_)}else this.hls.trigger(D.Events.SUBTITLE_TRACK_SWITCH,{id:t})},m.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,a=d(this.media.textTracks),l=0;l<a.length;l++)if(a[l].mode==="hidden")t=l;else if(a[l].mode==="showing"){t=l;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)},c(p,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,a)}}]),p}(f.default);function d(u){for(var p=[],m=0;m<u.length;m++){var i=u[m];i.kind==="subtitles"&&i.label&&p.push(u[m])}return p}g.default=s},"./src/controller/timeline-controller.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"TimelineController",function(){return d});var D=T("./src/polyfills/number.ts"),v=T("./src/events.ts"),f=T("./src/utils/cea-608-parser.ts"),S=T("./src/utils/output-filter.ts"),y=T("./src/utils/webvtt-parser.ts"),c=T("./src/utils/texttrack-utils.ts"),o=T("./src/utils/imsc1-ttml-parser.ts"),r=T("./src/types/loader.ts"),s=T("./src/utils/logger.ts"),d=function(){function i(a){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=m(),this.captionsProperties=void 0,this.hls=a,this.config=a.config,this.Cues=a.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var l=new S.default(this,"textTrack1"),E=new S.default(this,"textTrack2"),b=new S.default(this,"textTrack3"),h=new S.default(this,"textTrack4");this.cea608Parser1=new f.default(1,l,E),this.cea608Parser2=new f.default(3,b,h)}a.on(v.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(v.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(v.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(v.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(v.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(v.Events.FRAG_LOADING,this.onFragLoading,this),a.on(v.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(v.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(v.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(v.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(v.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(v.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=i.prototype;return t.destroy=function(){var l=this.hls;l.off(v.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(v.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(v.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(v.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.off(v.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.off(v.Events.FRAG_LOADING,this.onFragLoading,this),l.off(v.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(v.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.off(v.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.off(v.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(v.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.off(v.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(l,E,b,h,L){for(var O=!1,w=L.length;w--;){var C=L[w],x=p(C[0],C[1],E,b);if(x>=0&&(C[0]=Math.min(C[0],E),C[1]=Math.max(C[1],b),O=!0,x/(b-E)>.5))return}if(O||L.push([E,b]),this.config.renderTextTracksNatively){var _=this.captionsTracks[l];this.Cues.newCue(_,E,b,h)}else{var j=this.Cues.newCue(null,E,b,h);this.hls.trigger(v.Events.CUES_PARSED,{type:"captions",cues:j,track:l})}},t.onInitPtsFound=function(l,E){var b=this,h=E.frag,L=E.id,O=E.initPTS,w=E.timescale,C=this.unparsedVttFrags;L==="main"&&(this.initPTS[h.cc]=O,this.timescale[h.cc]=w),C.length&&(this.unparsedVttFrags=[],C.forEach(function(x){b.onFragLoaded(v.Events.FRAG_LOADED,x)}))},t.getExistingTrack=function(l){var E=this.media;if(E)for(var b=0;b<E.textTracks.length;b++){var h=E.textTracks[b];if(h[l])return h}return null},t.createCaptionsTrack=function(l){this.config.renderTextTracksNatively?this.createNativeTrack(l):this.createNonNativeTrack(l)},t.createNativeTrack=function(l){if(this.captionsTracks[l])return;var E=this.captionsProperties,b=this.captionsTracks,h=this.media,L=E[l],O=L.label,w=L.languageCode,C=this.getExistingTrack(l);if(C)b[l]=C,Object(c.clearCurrentCues)(b[l]),Object(c.sendAddTrackEvent)(b[l],h);else{var x=this.createTextTrack("captions",O,w);x&&(x[l]=!0,b[l]=x)}},t.createNonNativeTrack=function(l){if(this.nonNativeCaptionsTracks[l])return;var E=this.captionsProperties[l];if(!E)return;var b=E.label,h={_id:l,label:b,kind:"captions",default:E.media?!!E.media.default:!1,closedCaptions:E.media};this.nonNativeCaptionsTracks[l]=h,this.hls.trigger(v.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[h]})},t.createTextTrack=function(l,E,b){var h=this.media;return h?h.addTextTrack(l,E,b):void 0},t.onMediaAttaching=function(l,E){this.media=E.media,this._cleanTracks()},t.onMediaDetaching=function(){var l=this.captionsTracks;Object.keys(l).forEach(function(E){Object(c.clearCurrentCues)(l[E]),delete l[E]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=m(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},t._cleanTracks=function(){var l=this.media;if(!l)return;var E=l.textTracks;if(E)for(var b=0;b<E.length;b++)Object(c.clearCurrentCues)(E[b])},t.onSubtitleTracksUpdated=function(l,E){var b=this;this.textTracks=[];var h=E.subtitleTracks||[],L=h.some(function(x){return x.textCodec===o.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var O=this.tracks&&h&&this.tracks.length===h.length;if(this.tracks=h||[],this.config.renderTextTracksNatively){var w=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,_){var j;if(_<w.length){for(var N=null,P=0;P<w.length;P++)if(u(w[P],x)){N=w[P];break}N&&(j=N)}j?Object(c.clearCurrentCues)(j):(j=b.createTextTrack("subtitles",x.name,x.lang),j&&(j.mode="disabled")),j&&(j.groupId=x.groupId,b.textTracks.push(j))})}else if(!O&&this.tracks&&this.tracks.length){var C=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(v.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:C})}}},t.onManifestLoaded=function(l,E){var b=this;this.config.enableCEA708Captions&&E.captions&&E.captions.forEach(function(h){var L=/(?:CC|SERVICE)([1-4])/.exec(h.instreamId);if(!L)return;var O="textTrack"+L[1],w=b.captionsProperties[O];if(!w)return;w.label=h.name,h.lang&&(w.languageCode=h.lang),w.media=h})},t.onFragLoading=function(l,E){var b=this.cea608Parser1,h=this.cea608Parser2,L=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(b&&h))return;if(E.frag.type===r.PlaylistLevelType.MAIN){var w,C,x=E.frag.sn,_=(w=E==null||((C=E.part)===null||C===void 0)?void 0:C.index)!=null?w:-1;x===L+1||x===L&&_===O+1||(b.reset(),h.reset()),this.lastSn=x,this.lastPartIndex=_}},t.onFragLoaded=function(l,E){var b=E.frag,h=E.payload,L=this.initPTS,O=this.unparsedVttFrags;if(b.type===r.PlaylistLevelType.SUBTITLE)if(h.byteLength){if(!Object(D.isFiniteNumber)(L[b.cc])){O.push(E),L.length&&this.hls.trigger(v.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:b,error:new Error("Missing initial subtitle PTS")});return}var w=b.decryptdata;if(w==null||w.key==null||w.method!=="AES-128"){var C=this.tracks[b.level],x=this.vttCCs;x[b.cc]||(x[b.cc]={start:b.start,prevCC:this.prevCC,new:!0},this.prevCC=b.cc),C&&C.textCodec===o.IMSC1_CODEC?this._parseIMSC1(b,h):this._parseVTTs(b,h,x)}}else this.hls.trigger(v.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:b,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(l,E){var b=this,h=this.hls;Object(o.parseIMSC1)(E,this.initPTS[l.cc],this.timescale[l.cc],function(L){b._appendCues(L,l.level),h.trigger(v.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(L){s.logger.log("Failed to parse IMSC1: "+L),h.trigger(v.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:L})})},t._parseVTTs=function(l,E,b){var h=this,L=this.hls;Object(y.parseWebVTT)(E,this.initPTS[l.cc],this.timescale[l.cc],b,l.cc,l.start,function(O){h._appendCues(O,l.level),L.trigger(v.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(O){h._fallbackToIMSC1(l,E),s.logger.log("Failed to parse VTT cue: "+O),L.trigger(v.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:O})})},t._fallbackToIMSC1=function(l,E){var b=this,h=this.tracks[l.level];h.textCodec||Object(o.parseIMSC1)(E,this.initPTS[l.cc],this.timescale[l.cc],function(){h.textCodec=o.IMSC1_CODEC,b._parseIMSC1(l,E)},function(){h.textCodec="wvtt"})},t._appendCues=function(l,E){var b=this.hls;if(this.config.renderTextTracksNatively){var h=this.textTracks[E];if(h.mode==="disabled")return;l.forEach(function(w){return Object(c.addCueToTrack)(h,w)})}else{var L=this.tracks[E],O=L.default?"default":"subtitles"+E;b.trigger(v.Events.CUES_PARSED,{type:"subtitles",cues:l,track:O})}},t.onFragDecrypted=function(l,E){var b=E.frag;if(b.type===r.PlaylistLevelType.SUBTITLE){if(!Object(D.isFiniteNumber)(this.initPTS[b.cc])){this.unparsedVttFrags.push(E);return}this.onFragLoaded(v.Events.FRAG_LOADED,E)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(l,E){var b=this.cea608Parser1,h=this.cea608Parser2;if(!this.enabled||!(b&&h))return;for(var L=0;L<E.samples.length;L++){var O=E.samples[L].bytes;if(O){var w=this.extractCea608Data(O);b.addData(E.samples[L].pts,w[0]),h.addData(E.samples[L].pts,w[1])}}},t.onBufferFlushing=function(l,E){var b=E.startOffset,h=E.endOffset,L=E.endOffsetSubtitles,O=E.type,w=this.media;if(!w||w.currentTime<h)return;if(!O||O==="video"){var C=this.captionsTracks;Object.keys(C).forEach(function(_){return Object(c.removeCuesInRange)(C[_],b,h)})}if(this.config.renderTextTracksNatively&&(b===0&&L!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(_){return Object(c.removeCuesInRange)(x[_],b,L)})}},t.extractCea608Data=function(l){for(var E=l[0]&31,b=2,h=[[],[]],L=0;L<E;L++){var O=l[b++],w=127&l[b++],C=127&l[b++],x=(4&O)!==0,_=3&O;if(w===0&&C===0)continue;x&&((_===0||_===1)&&(h[_].push(w),h[_].push(C)))}return h},i}();function u(i,t){return i&&i.label===t.name&&!(i.textTrack1||i.textTrack2)}function p(i,t,a,l){return Math.min(t,l)-Math.max(i,a)}function m(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return D});var D=function(){function v(S,y){this.subtle=void 0,this.aesIV=void 0,this.subtle=S,this.aesIV=y}var f=v.prototype;return f.decrypt=function(y,c){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},c,y)},v}()},"./src/crypt/aes-decryptor.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"removePadding",function(){return v}),T.d(g,"default",function(){return f});var D=T("./src/utils/typed-array.ts");function v(S){var y=S.byteLength,c=y&&new DataView(S.buffer).getUint8(y-1);return c?Object(D.sliceUint8)(S,0,y-c):S}var f=function(){function S(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var y=S.prototype;return y.uint8ArrayToUint32Array_=function(o){for(var r=new DataView(o),s=new Uint32Array(4),d=0;d<4;d++)s[d]=r.getUint32(d*4);return s},y.initTable=function(){var o=this.sBox,r=this.invSBox,s=this.subMix,d=s[0],u=s[1],p=s[2],m=s[3],i=this.invSubMix,t=i[0],a=i[1],l=i[2],E=i[3],b=new Uint32Array(256),h=0,L=0,O=0;for(O=0;O<256;O++)O<128?b[O]=O<<1:b[O]=O<<1^283;for(O=0;O<256;O++){var w=L^L<<1^L<<2^L<<3^L<<4;w=w>>>8^w&255^99,o[h]=w,r[w]=h;var C=b[h],x=b[C],_=b[x],j=b[w]*257^w*16843008;d[h]=j<<24|j>>>8,u[h]=j<<16|j>>>16,p[h]=j<<8|j>>>24,m[h]=j,j=_*16843009^x*65537^C*257^h*16843008,t[w]=j<<24|j>>>8,a[w]=j<<16|j>>>16,l[w]=j<<8|j>>>24,E[w]=j,h?(h=C^b[b[b[_^C]]],L^=b[b[L]]):h=L=1}},y.expandKey=function(o){for(var r=this.uint8ArrayToUint32Array_(o),s=!0,d=0;d<r.length&&s;)s=r[d]===this.key[d],d++;if(s)return;this.key=r;var u=this.keySize=r.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var p=this.ksRows=(u+6+1)*4,m,i,t=this.keySchedule=new Uint32Array(p),a=this.invKeySchedule=new Uint32Array(p),l=this.sBox,E=this.rcon,b=this.invSubMix,h=b[0],L=b[1],O=b[2],w=b[3],C,x;for(m=0;m<p;m++){if(m<u){C=t[m]=r[m];continue}x=C,m%u===0?(x=x<<8|x>>>24,x=l[x>>>24]<<24|l[x>>>16&255]<<16|l[x>>>8&255]<<8|l[x&255],x^=E[m/u|0]<<24):u>6&&m%u===4&&(x=l[x>>>24]<<24|l[x>>>16&255]<<16|l[x>>>8&255]<<8|l[x&255]),t[m]=C=(t[m-u]^x)>>>0}for(i=0;i<p;i++)m=p-i,i&3?x=t[m]:x=t[m-4],i<4||m<=4?a[i]=x:a[i]=h[l[x>>>24]]^L[l[x>>>16&255]]^O[l[x>>>8&255]]^w[l[x&255]],a[i]=a[i]>>>0},y.networkToHostOrderSwap=function(o){return o<<24|(o&65280)<<8|(o&16711680)>>8|o>>>24},y.decrypt=function(o,r,s){for(var d=this.keySize+6,u=this.invKeySchedule,p=this.invSBox,m=this.invSubMix,i=m[0],t=m[1],a=m[2],l=m[3],E=this.uint8ArrayToUint32Array_(s),b=E[0],h=E[1],L=E[2],O=E[3],w=new Int32Array(o),C=new Int32Array(w.length),x,_,j,N,P,V,z,B,K,U,W,H,q,ne,te=this.networkToHostOrderSwap;r<w.length;){for(K=te(w[r]),U=te(w[r+1]),W=te(w[r+2]),H=te(w[r+3]),P=K^u[0],V=H^u[1],z=W^u[2],B=U^u[3],q=4,ne=1;ne<d;ne++)x=i[P>>>24]^t[V>>16&255]^a[z>>8&255]^l[B&255]^u[q],_=i[V>>>24]^t[z>>16&255]^a[B>>8&255]^l[P&255]^u[q+1],j=i[z>>>24]^t[B>>16&255]^a[P>>8&255]^l[V&255]^u[q+2],N=i[B>>>24]^t[P>>16&255]^a[V>>8&255]^l[z&255]^u[q+3],P=x,V=_,z=j,B=N,q=q+4;x=p[P>>>24]<<24^p[V>>16&255]<<16^p[z>>8&255]<<8^p[B&255]^u[q],_=p[V>>>24]<<24^p[z>>16&255]<<16^p[B>>8&255]<<8^p[P&255]^u[q+1],j=p[z>>>24]<<24^p[B>>16&255]<<16^p[P>>8&255]<<8^p[V&255]^u[q+2],N=p[B>>>24]<<24^p[P>>16&255]<<16^p[V>>8&255]<<8^p[z&255]^u[q+3],C[r]=te(x^b),C[r+1]=te(N^h),C[r+2]=te(j^L),C[r+3]=te(_^O),b=K,h=U,L=W,O=H,r=r+4}return C.buffer},S}()},"./src/crypt/decrypter.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return r});var D=T("./src/crypt/aes-crypto.ts"),v=T("./src/crypt/fast-aes-key.ts"),f=T("./src/crypt/aes-decryptor.ts"),S=T("./src/utils/logger.ts"),y=T("./src/utils/mp4-tools.ts"),c=T("./src/utils/typed-array.ts"),o=16,r=function(){function s(u,p,m){var i=m===void 0?{}:m,t=i.removePKCS7Padding,a=t===void 0?!0:t;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=u,this.config=p,this.removePKCS7Padding=a,a)try{var l=self.crypto;l&&(this.subtle=l.subtle||l.webkitSubtle)}catch(E){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var d=s.prototype;return d.destroy=function(){this.observer=null},d.isSync=function(){return this.config.enableSoftwareAES},d.flush=function(){var p=this.currentResult;if(!p){this.reset();return}var m=new Uint8Array(p);return this.reset(),this.removePKCS7Padding?Object(f.removePadding)(m):m},d.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},d.decrypt=function(p,m,i,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(p),m,i);var a=this.flush();a&&t(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(p),m,i).then(t)},d.softwareDecrypt=function(p,m,i){var t=this.currentIV,a=this.currentResult,l=this.remainderData;this.logOnce("JS AES decrypt"),l&&(p=Object(y.appendUint8Array)(l,p),this.remainderData=null);var E=this.getValidChunk(p);if(!E.length)return null;t&&(i=t);var b=this.softwareDecrypter;b||(b=this.softwareDecrypter=new f.default),b.expandKey(m);var h=a;return this.currentResult=b.decrypt(E.buffer,0,i),this.currentIV=Object(c.sliceUint8)(E,-16).buffer,h||null},d.webCryptoDecrypt=function(p,m,i){var t=this,a=this.subtle;return(this.key!==m||!this.fastAesKey)&&(this.key=m,this.fastAesKey=new v.default(a,m)),this.fastAesKey.expandKey().then(function(l){if(!a)return Promise.reject(new Error("web crypto not initialized"));var E=new D.default(a,i);return E.decrypt(p.buffer,l)}).catch(function(l){return t.onWebCryptoError(l,p,m,i)})},d.onWebCryptoError=function(p,m,i,t){return S.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",p),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(m,i,t)},d.getValidChunk=function(p){var m=p,i=p.length-p.length%o;return i!==p.length&&(m=Object(c.sliceUint8)(p,0,i),this.remainderData=Object(c.sliceUint8)(p,i)),m},d.logOnce=function(p){if(!this.logEnabled)return;S.logger.log("[decrypter.ts]: "+p),this.logEnabled=!1},s}()},"./src/crypt/fast-aes-key.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return D});var D=function(){function v(S,y){this.subtle=void 0,this.key=void 0,this.subtle=S,this.key=y}var f=v.prototype;return f.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},v}()},"./src/demux/aacdemuxer.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/demux/base-audio-demuxer.ts"),v=T("./src/demux/adts.ts"),f=T("./src/utils/logger.ts"),S=T("./src/demux/id3.ts");function y(r,s){r.prototype=Object.create(s.prototype),r.prototype.constructor=r,c(r,s)}function c(r,s){return c=Object.setPrototypeOf||function(u,p){return u.__proto__=p,u},c(r,s)}var o=function(r){y(s,r);function s(u,p){var m;return m=r.call(this)||this,m.observer=void 0,m.config=void 0,m.observer=u,m.config=p,m}var d=s.prototype;return d.resetInitSegment=function(p,m,i){r.prototype.resetInitSegment.call(this,p,m,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:p,duration:i,inputTimeScale:9e4,dropped:0}},s.probe=function(p){if(!p)return!1;for(var m=S.getID3Data(p,0)||[],i=m.length,t=p.length;i<t;i++)if(v.probe(p,i))return f.logger.log("ADTS sync word found !"),!0;return!1},d.canParse=function(p,m){return v.canParse(p,m)},d.appendFrame=function(p,m,i){v.initTrackConfig(p,this.observer,m,i,p.manifestCodec);var t=v.appendFrame(p,m,i,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},s}(D.default);o.minProbeByteLength=9,g.default=o},"./src/demux/adts.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"getAudioConfig",function(){return S}),T.d(g,"isHeaderPattern",function(){return y}),T.d(g,"getHeaderLength",function(){return c}),T.d(g,"getFullFrameLength",function(){return o}),T.d(g,"canGetFrameLength",function(){return r}),T.d(g,"isHeader",function(){return s}),T.d(g,"canParse",function(){return d}),T.d(g,"probe",function(){return u}),T.d(g,"initTrackConfig",function(){return p}),T.d(g,"getFrameDuration",function(){return m}),T.d(g,"parseFrameHeader",function(){return i}),T.d(g,"appendFrame",function(){return t});var D=T("./src/utils/logger.ts"),v=T("./src/errors.ts"),f=T("./src/events.ts");function S(a,l,E,b){var h,L,O,w,C=navigator.userAgent.toLowerCase(),x=b,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];h=((l[E+2]&192)>>>6)+1;var j=(l[E+2]&60)>>>2;if(j>_.length-1){a.trigger(f.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+j});return}return O=(l[E+2]&1)<<2,O|=(l[E+3]&192)>>>6,D.logger.log("manifest codec:"+b+", ADTS type:"+h+", samplingIndex:"+j),/firefox/i.test(C)?j>=6?(h=5,w=new Array(4),L=j-3):(h=2,w=new Array(2),L=j):C.indexOf("android")!==-1?(h=2,w=new Array(2),L=j):(h=5,w=new Array(4),b&&(b.indexOf("mp4a.40.29")!==-1||b.indexOf("mp4a.40.5")!==-1)||!b&&j>=6?L=j-3:((b&&b.indexOf("mp4a.40.2")!==-1&&(j>=6&&O===1||/vivaldi/i.test(C))||!b&&O===1)&&(h=2,w=new Array(2)),L=j)),w[0]=h<<3,w[0]|=(j&14)>>1,w[1]|=(j&1)<<7,w[1]|=O<<3,h===5&&(w[1]|=(L&14)>>1,w[2]=(L&1)<<7,w[2]|=2<<2,w[3]=0),{config:w,samplerate:_[j],channelCount:O,codec:"mp4a.40."+h,manifestCodec:x}}function y(a,l){return a[l]===255&&(a[l+1]&246)===240}function c(a,l){return a[l+1]&1?7:9}function o(a,l){return(a[l+3]&3)<<11|a[l+4]<<3|(a[l+5]&224)>>>5}function r(a,l){return l+5<a.length}function s(a,l){return l+1<a.length&&y(a,l)}function d(a,l){return r(a,l)&&y(a,l)&&o(a,l)<=a.length-l}function u(a,l){if(s(a,l)){var E=c(a,l);if(l+E>=a.length)return!1;var b=o(a,l);if(b<=E)return!1;var h=l+b;return h===a.length||s(a,h)}return!1}function p(a,l,E,b,h){if(!a.samplerate){var L=S(l,E,b,h);if(!L)return;a.config=L.config,a.samplerate=L.samplerate,a.channelCount=L.channelCount,a.codec=L.codec,a.manifestCodec=L.manifestCodec,D.logger.log("parsed codec:"+a.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function m(a){return 1024*9e4/a}function i(a,l,E,b,h){var L=c(a,l),O=o(a,l);if(O-=L,O>0){var w=E+b*h;return{headerLength:L,frameLength:O,stamp:w}}}function t(a,l,E,b,h){var L=m(a.samplerate),O=i(l,E,b,h,L);if(O){var w=O.frameLength,C=O.headerLength,x=O.stamp,_=C+w,j=Math.max(0,E+_-l.length),N;j?(N=new Uint8Array(_-C),N.set(l.subarray(E+C,l.length),0)):N=l.subarray(E+C,E+_);var P={unit:N,pts:x};return j||a.samples.push(P),{sample:P,length:_,missing:j}}}},"./src/demux/base-audio-demuxer.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"initPTSFn",function(){return o});var D=T("./src/polyfills/number.ts"),v=T("./src/demux/id3.ts"),f=T("./src/demux/dummy-demuxed-track.ts"),S=T("./src/utils/mp4-tools.ts"),y=T("./src/utils/typed-array.ts"),c=function(){function r(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var s=r.prototype;return s.resetInitSegment=function(u,p,m){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},s.resetTimeStamp=function(){},s.resetContiguity=function(){},s.canParse=function(u,p){return!1},s.appendFrame=function(u,p,m){},s.demux=function(u,p){this.cachedData&&(u=Object(S.appendUint8Array)(this.cachedData,u),this.cachedData=null);var m=v.getID3Data(u,0),i=m?m.length:0,t,a,l=this._audioTrack,E=this._id3Track,b=m?v.getTimeStamp(m):void 0,h=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=o(b,p)),m&&m.length>0&&E.samples.push({pts:this.initPTS,dts:this.initPTS,data:m}),a=this.initPTS;i<h;){if(this.canParse(u,i)){var L=this.appendFrame(l,u,i);L?(this.frameIndex++,a=L.sample.pts,i+=L.length,t=i):i=h}else v.canParse(u,i)?(m=v.getID3Data(u,i),E.samples.push({pts:a,dts:a,data:m}),i+=m.length,t=i):i++;if(i===h&&t!==h){var O=Object(y.sliceUint8)(u,t);this.cachedData?this.cachedData=Object(S.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:l,avcTrack:Object(f.dummyTrack)(),id3Track:E,textTrack:Object(f.dummyTrack)()}},s.demuxSampleAes=function(u,p,m){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},s.flush=function(u){var p=this.cachedData;return p&&(this.cachedData=null,this.demux(p,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(f.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(f.dummyTrack)()}},s.destroy=function(){},r}(),o=function(s,d){return Object(D.isFiniteNumber)(s)?s*90:d*9e4};g.default=c},"./src/demux/chunk-cache.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return D});var D=function(){function f(){this.chunks=[],this.dataLength=0}var S=f.prototype;return S.push=function(c){this.chunks.push(c),this.dataLength+=c.length},S.flush=function(){var c=this.chunks,o=this.dataLength,r;if(c.length)c.length===1?r=c[0]:r=v(c,o);else return new Uint8Array(0);return this.reset(),r},S.reset=function(){this.chunks.length=0,this.dataLength=0},f}();function v(f,S){for(var y=new Uint8Array(S),c=0,o=0;o<f.length;o++){var r=f[o];y.set(r,c),c+=r.length}return y}},"./src/demux/dummy-demuxed-track.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"dummyTrack",function(){return D});function D(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/utils/logger.ts"),v=function(){function f(y){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=y,this.bytesAvailable=y.byteLength,this.word=0,this.bitsAvailable=0}var S=f.prototype;return S.loadWord=function(){var c=this.data,o=this.bytesAvailable,r=c.byteLength-o,s=new Uint8Array(4),d=Math.min(4,o);if(d===0)throw new Error("no bytes available");s.set(c.subarray(r,r+d)),this.word=new DataView(s.buffer).getUint32(0),this.bitsAvailable=d*8,this.bytesAvailable-=d},S.skipBits=function(c){var o;this.bitsAvailable>c?(this.word<<=c,this.bitsAvailable-=c):(c-=this.bitsAvailable,o=c>>3,c-=o>>3,this.bytesAvailable-=o,this.loadWord(),this.word<<=c,this.bitsAvailable-=c)},S.readBits=function(c){var o=Math.min(this.bitsAvailable,c),r=this.word>>>32-o;return c>32&&D.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=o,this.bitsAvailable>0?this.word<<=o:this.bytesAvailable>0&&this.loadWord(),o=c-o,o>0&&this.bitsAvailable?r<<o|this.readBits(o):r},S.skipLZ=function(){var c;for(c=0;c<this.bitsAvailable;++c)if((this.word&2147483648>>>c)!==0)return this.word<<=c,this.bitsAvailable-=c,c;return this.loadWord(),c+this.skipLZ()},S.skipUEG=function(){this.skipBits(1+this.skipLZ())},S.skipEG=function(){this.skipBits(1+this.skipLZ())},S.readUEG=function(){var c=this.skipLZ();return this.readBits(c+1)-1},S.readEG=function(){var c=this.readUEG();return 1&c?1+c>>>1:-1*(c>>>1)},S.readBoolean=function(){return this.readBits(1)===1},S.readUByte=function(){return this.readBits(8)},S.readUShort=function(){return this.readBits(16)},S.readUInt=function(){return this.readBits(32)},S.skipScalingList=function(c){for(var o=8,r=8,s,d=0;d<c;d++)r!==0&&(s=this.readEG(),r=(o+s+256)%256),o=r===0?o:r},S.readSPS=function(){var c=0,o=0,r=0,s=0,d,u,p,m=this.readUByte.bind(this),i=this.readBits.bind(this),t=this.readUEG.bind(this),a=this.readBoolean.bind(this),l=this.skipBits.bind(this),E=this.skipEG.bind(this),b=this.skipUEG.bind(this),h=this.skipScalingList.bind(this);m();var L=m();if(i(5),l(3),m(),b(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var O=t();if(O===3&&l(1),b(),b(),l(1),a())for(u=O!==3?8:12,p=0;p<u;p++)a()&&(p<6?h(16):h(64))}b();var w=t();if(w===0)t();else if(w===1)for(l(1),E(),E(),d=t(),p=0;p<d;p++)E();b(),l(1);var C=t(),x=t(),_=i(1);_===0&&l(1),l(1),a()&&(c=t(),o=t(),r=t(),s=t());var j=[1,1];if(a()&&a()){var N=m();switch(N){case 1:j=[1,1];break;case 2:j=[12,11];break;case 3:j=[10,11];break;case 4:j=[16,11];break;case 5:j=[40,33];break;case 6:j=[24,11];break;case 7:j=[20,11];break;case 8:j=[32,11];break;case 9:j=[80,33];break;case 10:j=[18,11];break;case 11:j=[15,11];break;case 12:j=[64,33];break;case 13:j=[160,99];break;case 14:j=[4,3];break;case 15:j=[3,2];break;case 16:j=[2,1];break;case 255:{j=[m()<<8|m(),m()<<8|m()];break}}}return{width:Math.ceil((C+1)*16-c*2-o*2),height:(2-_)*(x+1)*16-(_?2:4)*(r+s),pixelRatio:j}},S.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},f}();g.default=v},"./src/demux/id3.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"isHeader",function(){return D}),T.d(g,"isFooter",function(){return v}),T.d(g,"getID3Data",function(){return f}),T.d(g,"canParse",function(){return y}),T.d(g,"getTimeStamp",function(){return c}),T.d(g,"isTimeStampFrame",function(){return o}),T.d(g,"getID3Frames",function(){return s}),T.d(g,"decodeFrame",function(){return d}),T.d(g,"utf8ArrayToStr",function(){return t}),T.d(g,"testables",function(){return a});var D=function(h,L){return L+10<=h.length&&(h[L]===73&&h[L+1]===68&&h[L+2]===51&&(h[L+3]<255&&h[L+4]<255&&(h[L+6]<128&&h[L+7]<128&&h[L+8]<128&&h[L+9]<128)))},v=function(h,L){return L+10<=h.length&&(h[L]===51&&h[L+1]===68&&h[L+2]===73&&(h[L+3]<255&&h[L+4]<255&&(h[L+6]<128&&h[L+7]<128&&h[L+8]<128&&h[L+9]<128)))},f=function(h,L){for(var O=L,w=0;D(h,L);){w+=10;var C=S(h,L+6);w+=C,v(h,L+10)&&(w+=10),L+=w}return w>0?h.subarray(O,O+w):void 0},S=function(h,L){var O=0;return O=(h[L]&127)<<21,O|=(h[L+1]&127)<<14,O|=(h[L+2]&127)<<7,O|=h[L+3]&127,O},y=function(h,L){return D(h,L)&&S(h,L+6)+10<=h.length-L},c=function(h){for(var L=s(h),O=0;O<L.length;O++){var w=L[O];if(o(w))return i(w)}return},o=function(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"},r=function(h){var L=String.fromCharCode(h[0],h[1],h[2],h[3]),O=S(h,4),w=10;return{type:L,size:O,data:h.subarray(w,w+O)}},s=function(h){for(var L=0,O=[];D(h,L);){var w=S(h,L+6);L+=10;for(var C=L+w;L+8<C;){var x=r(h.subarray(L)),_=d(x);_&&O.push(_),L+=x.size+10}v(h,L)&&(L+=10)}return O},d=function(h){return h.type==="PRIV"?u(h):h.type[0]==="W"?m(h):p(h)},u=function(h){if(h.size<2)return;var L=t(h.data,!0),O=new Uint8Array(h.data.subarray(L.length+1));return{key:h.type,info:L,data:O.buffer}},p=function(h){if(h.size<2)return;if(h.type==="TXXX"){var L=1,O=t(h.data.subarray(L),!0);L+=O.length+1;var w=t(h.data.subarray(L));return{key:h.type,info:O,data:w}}var C=t(h.data.subarray(1));return{key:h.type,data:C}},m=function(h){if(h.type==="WXXX"){if(h.size<2)return;var L=1,O=t(h.data.subarray(L),!0);L+=O.length+1;var w=t(h.data.subarray(L));return{key:h.type,info:O,data:w}}var C=t(h.data);return{key:h.type,data:C}},i=function(h){if(h.data.byteLength===8){var L=new Uint8Array(h.data),O=L[3]&1,w=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return w/=45,O&&(w+=4772185884e-2),Math.round(w)}return},t=function(h,L){L===void 0&&(L=!1);var O=E();if(O){var w=O.decode(h);if(L){var C=w.indexOf("\0");return C!==-1?w.substring(0,C):w}return w.replace(/\0/g,"")}for(var x=h.length,_,j,N,P="",V=0;V<x;){if(_=h[V++],_===0&&L)return P;if(_===0||_===3)continue;switch(_>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:P+=String.fromCharCode(_);break;case 12:case 13:j=h[V++],P+=String.fromCharCode((_&31)<<6|j&63);break;case 14:j=h[V++],N=h[V++],P+=String.fromCharCode((_&15)<<12|(j&63)<<6|(N&63)<<0);break;default:}}return P},a={decodeTextFrame:p},l;function E(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/demux/base-audio-demuxer.ts"),v=T("./src/demux/id3.ts"),f=T("./src/utils/logger.ts"),S=T("./src/demux/mpegaudio.ts");function y(r,s){r.prototype=Object.create(s.prototype),r.prototype.constructor=r,c(r,s)}function c(r,s){return c=Object.setPrototypeOf||function(u,p){return u.__proto__=p,u},c(r,s)}var o=function(r){y(s,r);function s(){return r.apply(this,arguments)||this}var d=s.prototype;return d.resetInitSegment=function(p,m,i){r.prototype.resetInitSegment.call(this,p,m,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:p,duration:i,inputTimeScale:9e4,dropped:0}},s.probe=function(p){if(!p)return!1;for(var m=v.getID3Data(p,0)||[],i=m.length,t=p.length;i<t;i++)if(S.probe(p,i))return f.logger.log("MPEG Audio sync word found !"),!0;return!1},d.canParse=function(p,m){return S.canParse(p,m)},d.appendFrame=function(p,m,i){return this.initPTS===null?void 0:S.appendFrame(p,m,i,this.initPTS,this.frameIndex)},s}(D.default);o.minProbeByteLength=4,g.default=o},"./src/demux/mp4demuxer.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/utils/mp4-tools.ts"),v=T("./src/demux/dummy-demuxed-track.ts"),f=function(){function S(c,o){this.remainderData=null,this.config=void 0,this.config=o}var y=S.prototype;return y.resetTimeStamp=function(){},y.resetInitSegment=function(){},y.resetContiguity=function(){},S.probe=function(o){return Object(D.findBox)({data:o,start:0,end:Math.min(o.length,16384)},["moof"]).length>0},y.demux=function(o){var r=o,s=Object(v.dummyTrack)();if(this.config.progressive){this.remainderData&&(r=Object(D.appendUint8Array)(this.remainderData,o));var d=Object(D.segmentValidRange)(r);this.remainderData=d.remainder,s.samples=d.valid||new Uint8Array}else s.samples=r;return{audioTrack:Object(v.dummyTrack)(),avcTrack:s,id3Track:Object(v.dummyTrack)(),textTrack:Object(v.dummyTrack)()}},y.flush=function(){var o=Object(v.dummyTrack)();return o.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(v.dummyTrack)(),avcTrack:o,id3Track:Object(v.dummyTrack)(),textTrack:Object(v.dummyTrack)()}},y.demuxSampleAes=function(o,r,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},y.destroy=function(){},S}();f.minProbeByteLength=1024,g.default=f},"./src/demux/mpegaudio.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"appendFrame",function(){return c}),T.d(g,"parseHeader",function(){return o}),T.d(g,"isHeaderPattern",function(){return r}),T.d(g,"isHeader",function(){return s}),T.d(g,"canParse",function(){return d}),T.d(g,"probe",function(){return u});var D=null,v=[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],f=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],S=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],y=[0,1,1,4];function c(p,m,i,t,a){if(i+24>m.length)return;var l=o(m,i);if(l&&i+l.frameLength<=m.length){var E=l.samplesPerFrame*9e4/l.sampleRate,b=t+a*E,h={unit:m.subarray(i,i+l.frameLength),pts:b,dts:b};return p.config=[],p.channelCount=l.channelCount,p.samplerate=l.sampleRate,p.samples.push(h),{sample:h,length:l.frameLength,missing:0}}}function o(p,m){var i=p[m+1]>>3&3,t=p[m+1]>>1&3,a=p[m+2]>>4&15,l=p[m+2]>>2&3;if(i!==1&&a!==0&&a!==15&&l!==3){var E=p[m+2]>>1&1,b=p[m+3]>>6,h=i===3?3-t:t===3?3:4,L=v[h*14+a-1]*1e3,O=i===3?0:i===2?1:2,w=f[O*3+l],C=b===3?1:2,x=S[i][t],_=y[t],j=x*8*_,N=Math.floor(x*L/w+E)*_;if(D===null){var P=navigator.userAgent||"",V=P.match(/Chrome\/(\d+)/i);D=V?parseInt(V[1]):0}var z=!!D&&D<=87;return z&&t===2&&L>=224e3&&b===0&&(p[m+3]=p[m+3]|128),{sampleRate:w,channelCount:C,frameLength:N,samplesPerFrame:j}}}function r(p,m){return p[m]===255&&(p[m+1]&224)===224&&(p[m+1]&6)!==0}function s(p,m){return m+1<p.length&&r(p,m)}function d(p,m){var i=4;return r(p,m)&&i<=p.length-m}function u(p,m){if(m+1<p.length&&r(p,m)){var i=4,t=o(p,m),a=i;t!=null&&t.frameLength&&(a=t.frameLength);var l=m+a;return l===p.length||s(p,l)}return!1}},"./src/demux/sample-aes.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/crypt/decrypter.ts"),v=T("./src/demux/tsdemuxer.ts"),f=function(){function S(c,o,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new D.default(c,o,{removePKCS7Padding:!1})}var y=S.prototype;return y.decryptBuffer=function(o,r){this.decrypter.decrypt(o,this.keyData.key.buffer,this.keyData.iv.buffer,r)},y.decryptAacSample=function(o,r,s,d){var u=o[r].unit,p=u.subarray(16,u.length-u.length%16),m=p.buffer.slice(p.byteOffset,p.byteOffset+p.length),i=this;this.decryptBuffer(m,function(t){var a=new Uint8Array(t);u.set(a,16),d||i.decryptAacSamples(o,r+1,s)})},y.decryptAacSamples=function(o,r,s){for(;;r++){if(r>=o.length){s();return}if(o[r].unit.length<32)continue;var d=this.decrypter.isSync();if(this.decryptAacSample(o,r,s,d),!d)return}},y.getAvcEncryptedData=function(o){for(var r=Math.floor((o.length-48)/160)*16+16,s=new Int8Array(r),d=0,u=32;u<=o.length-16;u+=160,d+=16)s.set(o.subarray(u,u+16),d);return s},y.getAvcDecryptedUnit=function(o,r){for(var s=new Uint8Array(r),d=0,u=32;u<=o.length-16;u+=160,d+=16)o.set(s.subarray(d,d+16),u);return o},y.decryptAvcSample=function(o,r,s,d,u,p){var m=Object(v.discardEPB)(u.data),i=this.getAvcEncryptedData(m),t=this;this.decryptBuffer(i.buffer,function(a){u.data=t.getAvcDecryptedUnit(m,a),p||t.decryptAvcSamples(o,r,s+1,d)})},y.decryptAvcSamples=function(o,r,s,d){if(o instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;r++,s=0){if(r>=o.length){d();return}for(var u=o[r].units;!(s>=u.length);s++){var p=u[s];if(p.data.length<=48||p.type!==1&&p.type!==5)continue;var m=this.decrypter.isSync();if(this.decryptAvcSample(o,r,s,d,p,m),!m)return}}},S}();g.default=f},"./src/demux/transmuxer-interface.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return u});var D=T("./node_modules/webworkify-webpack/index.js"),v=T.n(D),f=T("./src/events.ts"),S=T("./src/demux/transmuxer.ts"),y=T("./src/utils/logger.ts"),c=T("./src/errors.ts"),o=T("./src/utils/mediasource-helper.ts"),r=T("./node_modules/eventemitter3/index.js"),s=T.n(r),d=Object(o.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function p(i,t,a,l){var E=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=i,this.id=t,this.onTransmuxComplete=a,this.onFlush=l;var b=i.config,h=function(x,_){_=_||{},_.frag=E.frag,_.id=E.id,i.trigger(x,_)};this.observer=new r.EventEmitter,this.observer.on(f.Events.FRAG_DECRYPTED,h),this.observer.on(f.Events.ERROR,h);var L={mp4:d.isTypeSupported("video/mp4"),mpeg:d.isTypeSupported("audio/mpeg"),mp3:d.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(b.enableWorker&&typeof Worker!="undefined"){y.logger.log("demuxing in webworker");var w;try{w=this.worker=D("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),w.addEventListener("message",this.onwmsg),w.onerror=function(C){i.trigger(f.Events.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},w.postMessage({cmd:"init",typeSupported:L,vendor:O,id:t,config:JSON.stringify(b)})}catch(C){y.logger.warn("Error in worker:",C),y.logger.error("Error while initializing DemuxerWorker, fallback to inline"),w&&self.URL.revokeObjectURL(w.objectURL),this.transmuxer=new S.default(this.observer,L,b,O,t),this.worker=null}}else this.transmuxer=new S.default(this.observer,L,b,O,t)}var m=p.prototype;return m.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},m.push=function(t,a,l,E,b,h,L,O,w,C){var x=this;w.transmuxing.start=self.performance.now();var _=this.transmuxer,j=this.worker,N=h?h.start:b.start,P=b.decryptdata,V=this.frag,z=!(V&&b.cc===V.cc),B=!(V&&w.level===V.level),K=V?w.sn-V.sn:-1,U=this.part?w.part-this.part.index:1,W=!B&&(K===1||K===0&&U===1),H=self.performance.now();(B||K||b.stats.parsing.start===0)&&(b.stats.parsing.start=H),h&&(U||!W)&&(h.stats.parsing.start=H);var q=new S.TransmuxState(z,W,O,B,N);if(!W||z){y.logger.log("[transmuxer-interface, "+b.type+"]: Starting new transmux session for sn: "+w.sn+" p: "+w.part+" level: "+w.level+" id: "+w.id+`
|
|
|
discontinuity: `+z+`
|
|
|
trackSwitch: `+B+`
|
|
|
contiguous: `+W+`
|
|
|
accurateTimeOffset: `+O+`
|
|
|
timeOffset: `+N);var ne=new S.TransmuxConfig(l,E,a,L,C);this.configureTransmuxer(ne)}if(this.frag=b,this.part=h,j)j.postMessage({cmd:"demux",data:t,decryptdata:P,chunkMeta:w,state:q},t instanceof ArrayBuffer?[t]:[]);else if(_){var te=_.push(t,P,w,q);Object(S.isPromise)(te)?te.then(function(_e){x.handleTransmuxComplete(_e)}):this.handleTransmuxComplete(te)}},m.flush=function(t){var a=this;t.transmuxing.start=self.performance.now();var l=this.transmuxer,E=this.worker;if(E)E.postMessage({cmd:"flush",chunkMeta:t});else if(l){var b=l.flush(t);Object(S.isPromise)(b)?b.then(function(h){a.handleFlushResult(h,t)}):this.handleFlushResult(b,t)}},m.handleFlushResult=function(t,a){var l=this;t.forEach(function(E){l.handleTransmuxComplete(E)}),this.onFlush(a)},m.onWorkerMessage=function(t){var a=t.data,l=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,l.trigger(a.event,a.data);break}}},m.configureTransmuxer=function(t){var a=this.worker,l=this.transmuxer;a?a.postMessage({cmd:"configure",config:t}):l&&l.configure(t)},m.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},p}()},"./src/demux/transmuxer-worker.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return c});var D=T("./src/demux/transmuxer.ts"),v=T("./src/events.ts"),f=T("./src/utils/logger.ts"),S=T("./node_modules/eventemitter3/index.js"),y=T.n(S);function c(u){var p=new S.EventEmitter,m=function(t,a){u.postMessage({event:t,data:a})};p.on(v.Events.FRAG_DECRYPTED,m),p.on(v.Events.ERROR,m),u.addEventListener("message",function(i){var t=i.data;switch(t.cmd){case"init":{var a=JSON.parse(t.config);u.transmuxer=new D.default(p,t.typeSupported,a,t.vendor,t.id),Object(f.enableLogs)(a.debug),m("init",null);break}case"configure":{u.transmuxer.configure(t.config);break}case"demux":{var l=u.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(D.isPromise)(l)?l.then(function(h){o(u,h)}):o(u,l);break}case"flush":{var E=t.chunkMeta,b=u.transmuxer.flush(E);Object(D.isPromise)(b)?b.then(function(h){s(u,h,E)}):s(u,b,E);break}default:break}})}function o(u,p){if(d(p.remuxResult))return;var m=[],i=p.remuxResult,t=i.audio,a=i.video;t&&r(m,t),a&&r(m,a),u.postMessage({event:"transmuxComplete",data:p},m)}function r(u,p){p.data1&&u.push(p.data1.buffer),p.data2&&u.push(p.data2.buffer)}function s(u,p,m){p.forEach(function(i){o(u,i)}),u.postMessage({event:"flush",data:m})}function d(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return a}),T.d(g,"isPromise",function(){return b}),T.d(g,"TransmuxConfig",function(){return h}),T.d(g,"TransmuxState",function(){return L});var D=T("./src/events.ts"),v=T("./src/errors.ts"),f=T("./src/crypt/decrypter.ts"),S=T("./src/demux/aacdemuxer.ts"),y=T("./src/demux/mp4demuxer.ts"),c=T("./src/demux/tsdemuxer.ts"),o=T("./src/demux/mp3demuxer.ts"),r=T("./src/remux/mp4-remuxer.ts"),s=T("./src/remux/passthrough-remuxer.ts"),d=T("./src/demux/chunk-cache.ts"),u=T("./src/utils/mp4-tools.ts"),p=T("./src/utils/logger.ts"),m;try{m=self.performance.now.bind(self.performance)}catch(O){p.logger.debug("Unable to use Performance API on this environment"),m=self.Date.now}var i=[{demux:c.default,remux:r.default},{demux:y.default,remux:s.default},{demux:S.default,remux:r.default},{demux:o.default,remux:r.default}],t=1024;i.forEach(function(O){var w=O.demux;t=Math.max(t,w.minProbeByteLength)});var a=function(){function O(C,x,_,j,N){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 d.default,this.observer=C,this.typeSupported=x,this.config=_,this.vendor=j,this.id=N}var w=O.prototype;return w.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},w.push=function(x,_,j,N){var P=this,V=j.transmuxing;V.executeStart=m();var z=new Uint8Array(x),B=this.cache,K=this.config,U=this.currentTransmuxState,W=this.transmuxConfig;N&&(this.currentTransmuxState=N);var H=l(z,_);if(H&&H.method==="AES-128"){var q=this.getDecrypter();if(K.enableSoftwareAES){var ne=q.softwareDecrypt(z,H.key.buffer,H.iv.buffer);if(!ne)return V.executeEnd=m(),E(j);z=new Uint8Array(ne)}else return this.decryptionPromise=q.webCryptoDecrypt(z,H.key.buffer,H.iv.buffer).then(function(Q){var X=P.push(Q,null,j);return P.decryptionPromise=null,X}),this.decryptionPromise}var te=N||U,_e=te.contiguous,Ce=te.discontinuity,me=te.trackSwitch,Me=te.accurateTimeOffset,Oe=te.timeOffset,he=W.audioCodec,ce=W.videoCodec,se=W.defaultInitPts,Te=W.duration,re=W.initSegmentData;if((Ce||me)&&this.resetInitSegment(re,he,ce,Te),Ce&&this.resetInitialTimestamp(se),_e||this.resetContiguity(),this.needsProbing(z,Ce,me)){if(B.dataLength){var ue=B.flush();z=Object(u.appendUint8Array)(ue,z)}this.configureTransmuxer(z,W)}var fe=this.transmux(z,H,Oe,Me,j),ee=this.currentTransmuxState;return ee.contiguous=!0,ee.discontinuity=!1,ee.trackSwitch=!1,V.executeEnd=m(),fe},w.flush=function(x){var _=this,j=x.transmuxing;j.executeStart=m();var N=this.decrypter,P=this.cache,V=this.currentTransmuxState,z=this.decryptionPromise;if(z)return z.then(function(){return _.flush(x)});var B=[],K=V.timeOffset;if(N){var U=N.flush();U&&B.push(this.push(U,null,x))}var W=P.dataLength;P.reset();var H=this.demuxer,q=this.remuxer;if(!H||!q)return W>=t&&this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),j.executeEnd=m(),[E(x)];var ne=H.flush(K);return b(ne)?ne.then(function(te){return _.flushRemux(B,te,x),B}):(this.flushRemux(B,ne,x),B)},w.flushRemux=function(x,_,j){var N=_.audioTrack,P=_.avcTrack,V=_.id3Track,z=_.textTrack,B=this.currentTransmuxState,K=B.accurateTimeOffset,U=B.timeOffset;p.logger.log("[transmuxer.ts]: Flushed fragment "+j.sn+(j.part>-1?" p: "+j.part:"")+" of level "+j.level);var W=this.remuxer.remux(N,P,V,z,U,K,!0,this.id);x.push({remuxResult:W,chunkMeta:j}),j.transmuxing.executeEnd=m()},w.resetInitialTimestamp=function(x){var _=this.demuxer,j=this.remuxer;if(!_||!j)return;_.resetTimeStamp(x),j.resetTimeStamp(x)},w.resetContiguity=function(){var x=this.demuxer,_=this.remuxer;if(!x||!_)return;x.resetContiguity(),_.resetNextTimestamp()},w.resetInitSegment=function(x,_,j,N){var P=this.demuxer,V=this.remuxer;if(!P||!V)return;P.resetInitSegment(_,j,N),V.resetInitSegment(x,_,j)},w.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},w.transmux=function(x,_,j,N,P){var V;return _&&_.method==="SAMPLE-AES"?V=this.transmuxSampleAes(x,_,j,N,P):V=this.transmuxUnencrypted(x,j,N,P),V},w.transmuxUnencrypted=function(x,_,j,N){var P=this.demuxer.demux(x,_,!1,!this.config.progressive),V=P.audioTrack,z=P.avcTrack,B=P.id3Track,K=P.textTrack,U=this.remuxer.remux(V,z,B,K,_,j,!1,this.id);return{remuxResult:U,chunkMeta:N}},w.transmuxSampleAes=function(x,_,j,N,P){var V=this;return this.demuxer.demuxSampleAes(x,_,j).then(function(z){var B=V.remuxer.remux(z.audioTrack,z.avcTrack,z.id3Track,z.textTrack,j,N,!1,V.id);return{remuxResult:B,chunkMeta:P}})},w.configureTransmuxer=function(x,_){for(var j=this.config,N=this.observer,P=this.typeSupported,V=this.vendor,z=_.audioCodec,B=_.defaultInitPts,K=_.duration,U=_.initSegmentData,W=_.videoCodec,H,q=0,ne=i.length;q<ne;q++)if(i[q].demux.probe(x)){H=i[q];break}H||(p.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:y.default,remux:s.default});var te=this.demuxer,_e=this.remuxer,Ce=H.remux,me=H.demux;(!_e||!(_e instanceof Ce))&&(this.remuxer=new Ce(N,j,P,V)),(!te||!(te instanceof me))&&(this.demuxer=new me(N,j,P),this.probe=me.probe),this.resetInitSegment(U,z,W,K),this.resetInitialTimestamp(B)},w.needsProbing=function(x,_,j){return!this.demuxer||!this.remuxer||_||j},w.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new f.default(this.observer,this.config)),x},O}();function l(O,w){var C=null;return O.byteLength>0&&w!=null&&w.key!=null&&w.iv!==null&&w.method!=null&&(C=w),C}var E=function(w){return{remuxResult:{},chunkMeta:w}};function b(O){return"then"in O&&O.then instanceof Function}var h=function(w,C,x,_,j){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=w,this.videoCodec=C,this.initSegmentData=x,this.duration=_,this.defaultInitPts=j},L=function(w,C,x,_,j){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=w,this.contiguous=C,this.accurateTimeOffset=x,this.trackSwitch=_,this.timeOffset=j}},"./src/demux/tsdemuxer.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"discardEPB",function(){return E});var D=T("./src/demux/adts.ts"),v=T("./src/demux/mpegaudio.ts"),f=T("./src/demux/exp-golomb.ts"),S=T("./src/demux/id3.ts"),y=T("./src/demux/sample-aes.ts"),c=T("./src/events.ts"),o=T("./src/utils/mp4-tools.ts"),r=T("./src/utils/logger.ts"),s=T("./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},u=function(){function b(L,O,w){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=L,this.config=O,this.typeSupported=w}b.probe=function(O){var w=b.syncOffset(O);return w<0?!1:(w&&r.logger.warn("MPEG2-TS detected but first sync word found @ offset "+w+", junk ahead ?"),!0)},b.syncOffset=function(O){for(var w=Math.min(1e3,O.length-3*188),C=0;C<w;){if(O[C]===71&&O[C+188]===71&&O[C+2*188]===71)return C;C++}return-1},b.createTrack=function(O,w){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:d[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?w:void 0}};var h=b.prototype;return h.resetInitSegment=function(O,w,C){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=b.createTrack("video",C),this._audioTrack=b.createTrack("audio",C),this._id3Track=b.createTrack("id3",C),this._txtTrack=b.createTrack("text",C),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=w,this._duration=C},h.resetTimeStamp=function(){},h.resetContiguity=function(){var O=this._audioTrack,w=this._avcTrack,C=this._id3Track;O&&(O.pesData=null),w&&(w.pesData=null),C&&(C.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},h.demux=function(O,w,C,x){C===void 0&&(C=!1),x===void 0&&(x=!1),C||(this.sampleAes=null);var _,j=this._avcTrack,N=this._audioTrack,P=this._id3Track,V=j.pid,z=j.pesData,B=N.pid,K=P.pid,U=N.pesData,W=P.pesData,H=!1,q=this.pmtParsed,ne=this._pmtId,te=O.length;if(this.remainderData&&(O=Object(o.appendUint8Array)(this.remainderData,O),te=O.length,this.remainderData=null),te<188&&!x)return this.remainderData=O,{audioTrack:N,avcTrack:j,id3Track:P,textTrack:this._txtTrack};var _e=Math.max(0,b.syncOffset(O));te-=(te+_e)%188,te<O.byteLength&&!x&&(this.remainderData=new Uint8Array(O.buffer,te,O.buffer.byteLength-te));for(var Ce=_e;Ce<te;Ce+=188)if(O[Ce]===71){var me=!!(O[Ce+1]&64),Me=((O[Ce+1]&31)<<8)+O[Ce+2],Oe=(O[Ce+3]&48)>>4,he=void 0;if(Oe>1){if(he=Ce+5+O[Ce+4],he===Ce+188)continue}else he=Ce+4;switch(Me){case V:me&&(z&&(_=t(z))&&this.parseAVCPES(_,!1),z={data:[],size:0}),z&&(z.data.push(O.subarray(he,Ce+188)),z.size+=Ce+188-he);break;case B:me&&(U&&(_=t(U))&&(N.isAAC?this.parseAACPES(_):this.parseMPEGPES(_)),U={data:[],size:0}),U&&(U.data.push(O.subarray(he,Ce+188)),U.size+=Ce+188-he);break;case K:me&&(W&&(_=t(W))&&this.parseID3PES(_),W={data:[],size:0}),W&&(W.data.push(O.subarray(he,Ce+188)),W.size+=Ce+188-he);break;case 0:me&&(he+=O[he]+1),ne=this._pmtId=m(O,he);break;case ne:{me&&(he+=O[he]+1);var ce=i(O,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);V=ce.avc,V>0&&(j.pid=V),B=ce.audio,B>0&&(N.pid=B,N.isAAC=ce.isAAC),K=ce.id3,K>0&&(P.pid=K),H&&!q&&(r.logger.log("reparse from beginning"),H=!1,Ce=_e-188),q=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(c.Events.ERROR,c.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});j.pesData=z,N.pesData=U,P.pesData=W;var se={audioTrack:N,avcTrack:j,id3Track:P,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(se),se},h.flush=function(){var O=this.remainderData;this.remainderData=null;var w;return O?w=this.demux(O,-1,!1,!0):w={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(w),this.sampleAes?this.decrypt(w,this.sampleAes):w},h.extractRemainingSamples=function(O){var w=O.audioTrack,C=O.avcTrack,x=O.id3Track,_=C.pesData,j=w.pesData,N=x.pesData,P;_&&(P=t(_))?(this.parseAVCPES(P,!0),C.pesData=null):C.pesData=_,j&&(P=t(j))?(w.isAAC?this.parseAACPES(P):this.parseMPEGPES(P),w.pesData=null):(j!=null&&j.size&&r.logger.log("last AAC PES packet truncated,might overlap between fragments"),w.pesData=j),N&&(P=t(N))?(this.parseID3PES(P),x.pesData=null):x.pesData=N},h.demuxSampleAes=function(O,w,C){var x=this.demux(O,C,!0,!this.config.progressive),_=this.sampleAes=new y.default(this.observer,this.config,w);return this.decrypt(x,_)},h.decrypt=function(O,w){return new Promise(function(C){var x=O.audioTrack,_=O.avcTrack;x.samples&&x.isAAC?w.decryptAacSamples(x.samples,0,function(){_.samples?w.decryptAvcSamples(_.samples,0,0,function(){C(O)}):C(O)}):_.samples&&w.decryptAvcSamples(_.samples,0,0,function(){C(O)})})},h.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},h.parseAVCPES=function(O,w){var C=this,x=this._avcTrack,_=this.parseAVCNALu(O.data),j=!1,N=this.avcSample,P,V=!1;O.data=null,N&&_.length&&!x.audFound&&(a(N,x),N=this.avcSample=p(!1,O.pts,O.dts,"")),_.forEach(function(z){switch(z.type){case 1:{P=!0,N||(N=C.avcSample=p(!0,O.pts,O.dts,"")),j&&(N.debug+="NDR "),N.frame=!0;var B=z.data;if(V&&B.length>4){var K=new f.default(B).readSliceType();(K===2||K===4||K===7||K===9)&&(N.key=!0)}break}case 5:P=!0,N||(N=C.avcSample=p(!0,O.pts,O.dts,"")),j&&(N.debug+="IDR "),N.key=!0,N.frame=!0;break;case 6:{P=!0,j&&N&&(N.debug+="SEI ");var U=new f.default(E(z.data));U.readUByte();for(var W=0,H=0,q=!1,ne=0;!q&&U.bytesAvailable>1;){W=0;do ne=U.readUByte(),W+=ne;while(ne===255);H=0;do ne=U.readUByte(),H+=ne;while(ne===255);if(W===4&&U.bytesAvailable!==0){q=!0;var te=U.readUByte();if(te===181){var _e=U.readUShort();if(_e===49){var Ce=U.readUInt();if(Ce===1195456820){var me=U.readUByte();if(me===3){for(var Me=U.readUByte(),Oe=U.readUByte(),he=31&Me,ce=[Me,Oe],se=0;se<he;se++)ce.push(U.readUByte()),ce.push(U.readUByte()),ce.push(U.readUByte());l(C._txtTrack.samples,{type:3,pts:O.pts,bytes:ce})}}}}}else if(W===5&&U.bytesAvailable!==0){if(q=!0,H>16){for(var Te=[],re=0;re<16;re++)Te.push(U.readUByte().toString(16)),(re===3||re===5||re===7||re===9)&&Te.push("-");for(var ue=H-16,fe=new Uint8Array(ue),ee=0;ee<ue;ee++)fe[ee]=U.readUByte();l(C._txtTrack.samples,{pts:O.pts,payloadType:W,uuid:Te.join(""),userData:Object(S.utf8ArrayToStr)(fe),userDataBytes:fe})}}else if(H<U.bytesAvailable)for(var Q=0;Q<H;Q++)U.readUByte()}break}case 7:if(P=!0,V=!0,j&&N&&(N.debug+="SPS "),!x.sps){var X=new f.default(z.data),Z=X.readSPS();x.width=Z.width,x.height=Z.height,x.pixelRatio=Z.pixelRatio,x.sps=[z.data],x.duration=C._duration;for(var ve=z.data.subarray(1,4),ye="avc1.",Re=0;Re<3;Re++){var Je=ve[Re].toString(16);Je.length<2&&(Je="0"+Je),ye+=Je}x.codec=ye}break;case 8:P=!0,j&&N&&(N.debug+="PPS "),x.pps||(x.pps=[z.data]);break;case 9:P=!1,x.audFound=!0,N&&a(N,x),N=C.avcSample=p(!1,O.pts,O.dts,j?"AUD ":"");break;case 12:P=!1;break;default:P=!1,N&&(N.debug+="unknown NAL "+z.type+" ");break}if(N&&P){var Ze=N.units;Ze.push(z)}}),w&&N&&(a(N,x),this.avcSample=null)},h.getLastNalUnit=function(){var O,w=this.avcSample,C;if(!w||w.units.length===0){var x=this._avcTrack.samples;w=x[x.length-1]}if((O=w)!==null&&O!==void 0&&O.units){var _=w.units;C=_[_.length-1]}return C},h.parseAVCNALu=function(O){var w=O.byteLength,C=this._avcTrack,x=C.naluState||0,_=x,j=[],N=0,P,V,z,B=-1,K=0;for(x===-1&&(B=0,K=O[0]&31,x=0,N=1);N<w;){if(P=O[N++],!x){x=P?0:1;continue}if(x===1){x=P?0:2;continue}if(!P)x=3;else if(P===1){if(B>=0){var U={data:O.subarray(B,N-x-1),type:K};j.push(U)}else{var W=this.getLastNalUnit();if(W&&(_&&N<=4-_&&(W.state&&(W.data=W.data.subarray(0,W.data.byteLength-_))),V=N-x-1,V>0)){var H=new Uint8Array(W.data.byteLength+V);H.set(W.data,0),H.set(O.subarray(0,V),W.data.byteLength),W.data=H,W.state=0}}N<w?(z=O[N]&31,B=N,K=z,x=0):x=-1}else x=0}if(B>=0&&x>=0){var q={data:O.subarray(B,w),type:K,state:x};j.push(q)}if(j.length===0){var ne=this.getLastNalUnit();if(ne){var te=new Uint8Array(ne.data.byteLength+O.byteLength);te.set(ne.data,0),te.set(O,ne.data.byteLength),ne.data=te}}return C.naluState=x,j},h.parseAACPES=function(O){var w=0,C=this._audioTrack,x=this.aacOverFlow,_=O.data;if(x){this.aacOverFlow=null;var j=x.sample.unit.byteLength,N=Math.min(x.missing,j),P=j-N;x.sample.unit.set(_.subarray(0,N),P),C.samples.push(x.sample),w=x.missing}var V,z;for(V=w,z=_.length;V<z-1&&!D.isHeader(_,V);V++);if(V!==w){var B,K;if(V<z-1?(B="AAC PES did not start with ADTS header,offset:"+V,K=!1):(B="no ADTS header found in AAC PES",K=!0),r.logger.warn("parsing error:"+B),this.observer.emit(c.Events.ERROR,c.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:K,reason:B}),K)return}D.initTrackConfig(C,this.observer,_,V,this.audioCodec);var U;if(O.pts!==void 0)U=O.pts;else if(x){var W=D.getFrameDuration(C.samplerate);U=x.sample.pts+W}else{r.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;V<z;)if(D.isHeader(_,V)){if(V+5<z){var q=D.appendFrame(C,_,V,U,H);if(q)if(q.missing)this.aacOverFlow=q;else{V+=q.length,H++;continue}}break}else V++},h.parseMPEGPES=function(O){var w=O.data,C=w.length,x=0,_=0,j=O.pts;if(j===void 0){r.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;_<C;)if(v.isHeader(w,_)){var N=v.appendFrame(this._audioTrack,w,_,j,x);if(N)_+=N.length,x++;else break}else _++},h.parseID3PES=function(O){if(O.pts===void 0){r.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},b}();u.minProbeByteLength=188;function p(b,h,L,O){return{key:b,frame:!1,pts:h,dts:L,units:[],debug:O,length:0}}function m(b,h){return(b[h+10]&31)<<8|b[h+11]}function i(b,h,L,O){var w={audio:-1,avc:-1,id3:-1,isAAC:!0},C=(b[h+1]&15)<<8|b[h+2],x=h+3+C-4,_=(b[h+10]&15)<<8|b[h+11];for(h+=12+_;h<x;){var j=(b[h+1]&31)<<8|b[h+2];switch(b[h]){case 207:if(!O){r.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:w.audio===-1&&(w.audio=j);break;case 21:w.id3===-1&&(w.id3=j);break;case 219:if(!O){r.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:w.avc===-1&&(w.avc=j);break;case 3:case 4:L?w.audio===-1&&(w.audio=j,w.isAAC=!1):r.logger.log("MPEG audio found, not supported in this browser");break;case 36:r.logger.warn("Unsupported HEVC stream type found");break;default:break}h+=((b[h+3]&15)<<8|b[h+4])+5}return w}function t(b){var h=0,L,O,w,C,x,_=b.data;if(!b||b.size===0)return null;for(;_[0].length<19&&_.length>1;){var j=new Uint8Array(_[0].length+_[1].length);j.set(_[0]),j.set(_[1],_[0].length),_[0]=j,_.splice(1,1)}L=_[0];var N=(L[0]<<16)+(L[1]<<8)+L[2];if(N===1){if(O=(L[4]<<8)+L[5],O&&O>b.size-6)return null;var P=L[7];P&192&&(C=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,P&64?(x=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,C-x>60*9e4&&(r.logger.warn(Math.round((C-x)/9e4)+"s delta between PTS and DTS, align them"),C=x)):x=C),w=L[8];var V=w+9;if(b.size<=V)return null;b.size-=V;for(var z=new Uint8Array(b.size),B=0,K=_.length;B<K;B++){L=_[B];var U=L.byteLength;if(V)if(V>U){V-=U;continue}else L=L.subarray(V),U-=V,V=0;z.set(L,h),h+=U}return O&&(O-=w+3),{data:z,pts:C,dts:x,len:O}}return null}function a(b,h){if(b.units.length&&b.frame){if(b.pts===void 0){var L=h.samples,O=L.length;if(O){var w=L[O-1];b.pts=w.pts,b.dts=w.dts}else{h.dropped++;return}}h.samples.push(b)}b.debug.length&&r.logger.log(b.pts+"/"+b.dts+":"+b.debug)}function l(b,h){var L=b.length;if(L>0){if(h.pts>=b[L-1].pts)b.push(h);else for(var O=L-1;O>=0;O--)if(h.pts<b[O].pts){b.splice(O,0,h);break}}else b.push(h)}function E(b){for(var h=b.byteLength,L=[],O=1;O<h-2;)b[O]===0&&b[O+1]===0&&b[O+2]===3?(L.push(O+2),O+=2):O++;if(L.length===0)return b;var w=h-L.length,C=new Uint8Array(w),x=0;for(O=0;O<w;x++,O++)x===L[0]&&(x++,L.shift()),C[O]=b[x];return C}g.default=u},"./src/errors.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"ErrorTypes",function(){return D}),T.d(g,"ErrorDetails",function(){return v});var D;(function(f){f.NETWORK_ERROR="networkError",f.MEDIA_ERROR="mediaError",f.KEY_SYSTEM_ERROR="keySystemError",f.MUX_ERROR="muxError",f.OTHER_ERROR="otherError"})(D||(D={}));var v;(function(f){f.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",f.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",f.KEY_SYSTEM_NO_SESSION="keySystemNoSession",f.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",f.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",f.MANIFEST_LOAD_ERROR="manifestLoadError",f.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",f.MANIFEST_PARSING_ERROR="manifestParsingError",f.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",f.LEVEL_EMPTY_ERROR="levelEmptyError",f.LEVEL_LOAD_ERROR="levelLoadError",f.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",f.LEVEL_SWITCH_ERROR="levelSwitchError",f.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",f.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",f.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",f.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",f.FRAG_LOAD_ERROR="fragLoadError",f.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",f.FRAG_DECRYPT_ERROR="fragDecryptError",f.FRAG_PARSING_ERROR="fragParsingError",f.REMUX_ALLOC_ERROR="remuxAllocError",f.KEY_LOAD_ERROR="keyLoadError",f.KEY_LOAD_TIMEOUT="keyLoadTimeOut",f.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",f.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",f.BUFFER_APPEND_ERROR="bufferAppendError",f.BUFFER_APPENDING_ERROR="bufferAppendingError",f.BUFFER_STALLED_ERROR="bufferStalledError",f.BUFFER_FULL_ERROR="bufferFullError",f.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",f.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",f.INTERNAL_EXCEPTION="internalException",f.INTERNAL_ABORTED="aborted",f.UNKNOWN="unknown"})(v||(v={}))},"./src/events.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"Events",function(){return D});var D;(function(v){v.MEDIA_ATTACHING="hlsMediaAttaching",v.MEDIA_ATTACHED="hlsMediaAttached",v.MEDIA_DETACHING="hlsMediaDetaching",v.MEDIA_DETACHED="hlsMediaDetached",v.BUFFER_RESET="hlsBufferReset",v.BUFFER_CODECS="hlsBufferCodecs",v.BUFFER_CREATED="hlsBufferCreated",v.BUFFER_APPENDING="hlsBufferAppending",v.BUFFER_APPENDED="hlsBufferAppended",v.BUFFER_EOS="hlsBufferEos",v.BUFFER_FLUSHING="hlsBufferFlushing",v.BUFFER_FLUSHED="hlsBufferFlushed",v.MANIFEST_LOADING="hlsManifestLoading",v.MANIFEST_LOADED="hlsManifestLoaded",v.MANIFEST_PARSED="hlsManifestParsed",v.LEVEL_SWITCHING="hlsLevelSwitching",v.LEVEL_SWITCHED="hlsLevelSwitched",v.LEVEL_LOADING="hlsLevelLoading",v.LEVEL_LOADED="hlsLevelLoaded",v.LEVEL_UPDATED="hlsLevelUpdated",v.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",v.LEVELS_UPDATED="hlsLevelsUpdated",v.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",v.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",v.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",v.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",v.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",v.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",v.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",v.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",v.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",v.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",v.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",v.CUES_PARSED="hlsCuesParsed",v.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",v.INIT_PTS_FOUND="hlsInitPtsFound",v.FRAG_LOADING="hlsFragLoading",v.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",v.FRAG_LOADED="hlsFragLoaded",v.FRAG_DECRYPTED="hlsFragDecrypted",v.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",v.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",v.FRAG_PARSING_METADATA="hlsFragParsingMetadata",v.FRAG_PARSED="hlsFragParsed",v.FRAG_BUFFERED="hlsFragBuffered",v.FRAG_CHANGED="hlsFragChanged",v.FPS_DROP="hlsFpsDrop",v.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",v.ERROR="hlsError",v.DESTROYING="hlsDestroying",v.KEY_LOADING="hlsKeyLoading",v.KEY_LOADED="hlsKeyLoaded",v.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",v.BACK_BUFFER_REACHED="hlsBackBufferReached"})(D||(D={}))},"./src/hls.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return b});var D=T("./node_modules/url-toolkit/src/url-toolkit.js"),v=T.n(D),f=T("./src/loader/playlist-loader.ts"),S=T("./src/loader/key-loader.ts"),y=T("./src/controller/id3-track-controller.ts"),c=T("./src/controller/latency-controller.ts"),o=T("./src/controller/level-controller.ts"),r=T("./src/controller/fragment-tracker.ts"),s=T("./src/controller/stream-controller.ts"),d=T("./src/is-supported.ts"),u=T("./src/utils/logger.ts"),p=T("./src/config.ts"),m=T("./node_modules/eventemitter3/index.js"),i=T.n(m),t=T("./src/events.ts"),a=T("./src/errors.ts");function l(h,L){for(var O=0;O<L.length;O++){var w=L[O];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(h,w.key,w)}}function E(h,L,O){return L&&l(h.prototype,L),O&&l(h,O),h}var b=function(){h.isSupported=function(){return Object(d.isSupported)()};function h(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new m.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var w=this.config=Object(p.mergeConfig)(h.DefaultConfig,O);this.userConfig=O,Object(u.enableLogs)(w.debug),this._autoLevelCapping=-1,w.progressive&&Object(p.enableStreamingMode)(w);var C=w.abrController,x=w.bufferController,_=w.capLevelController,j=w.fpsController,N=this.abrController=new C(this),P=this.bufferController=new x(this),V=this.capLevelController=new _(this),z=new j(this),B=new f.default(this),K=new S.default(this),U=new y.default(this),W=this.levelController=new o.default(this),H=new r.FragmentTracker(this),q=this.streamController=new s.default(this,H);V.setStreamController(q),z.setStreamController(q);var ne=[W,q];this.networkControllers=ne;var te=[B,K,N,P,V,z,U,H];this.audioTrackController=this.createController(w.audioTrackController,null,ne),this.createController(w.audioStreamController,H,ne),this.subtitleTrackController=this.createController(w.subtitleTrackController,null,ne),this.createController(w.subtitleStreamController,H,ne),this.createController(w.timelineController,null,te),this.emeController=this.createController(w.emeController,null,te),this.cmcdController=this.createController(w.cmcdController,null,te),this.latencyController=this.createController(c.default,null,te),this.coreComponents=te}var L=h.prototype;return L.createController=function(w,C,x){if(w){var _=C?new w(this,C):new w(this);return x&&x.push(_),_}return null},L.on=function(w,C,x){x===void 0&&(x=this),this._emitter.on(w,C,x)},L.once=function(w,C,x){x===void 0&&(x=this),this._emitter.once(w,C,x)},L.removeAllListeners=function(w){this._emitter.removeAllListeners(w)},L.off=function(w,C,x,_){x===void 0&&(x=this),this._emitter.off(w,C,x,_)},L.listeners=function(w){return this._emitter.listeners(w)},L.emit=function(w,C,x){return this._emitter.emit(w,C,x)},L.trigger=function(w,C){if(this.config.debug)return this.emit(w,w,C);try{return this.emit(w,w,C)}catch(x){u.logger.error("An internal error happened while handling event "+w+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(t.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:w,error:x})}return!1},L.listenerCount=function(w){return this._emitter.listenerCount(w)},L.destroy=function(){u.logger.log("destroy"),this.trigger(t.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(w){return w.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(w){return w.destroy()}),this.coreComponents.length=0},L.attachMedia=function(w){u.logger.log("attachMedia"),this._media=w,this.trigger(t.Events.MEDIA_ATTACHING,{media:w})},L.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(w){this.stopLoad();var C=this.media,x=this.url,_=this.url=D.buildAbsoluteURL(self.location.href,w,{alwaysNormalize:!0});u.logger.log("loadSource:"+_),C&&x&&x!==_&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(C)),this.trigger(t.Events.MANIFEST_LOADING,{url:w})},L.startLoad=function(w){w===void 0&&(w=-1),u.logger.log("startLoad("+w+")"),this.networkControllers.forEach(function(C){C.startLoad(w)})},L.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(w){w.stopLoad()})},L.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){u.logger.log("recoverMediaError");var w=this._media;this.detachMedia(),w&&this.attachMedia(w)},L.removeLevel=function(w,C){C===void 0&&(C=0),this.levelController.removeLevel(w,C)},E(h,[{key:"levels",get:function(){var w=this.levelController.levels;return w||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(w){u.logger.log("set currentLevel:"+w),this.loadLevel=w,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(w){u.logger.log("set nextLevel:"+w),this.levelController.manualLevel=w,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(w){u.logger.log("set loadLevel:"+w),this.levelController.manualLevel=w}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(w){this.levelController.nextLoadLevel=w}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(w){u.logger.log("set firstLevel:"+w),this.levelController.firstLevel=w}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(w){u.logger.log("set startLevel:"+w),w!==-1&&(w=Math.max(w,this.minAutoLevel)),this.levelController.startLevel=w}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(w){var C=!!w;C!==this.config.capLevelToPlayerSize&&(C?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=C)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(w){this._autoLevelCapping!==w&&(u.logger.log("set autoLevelCapping:"+w),this._autoLevelCapping=w)}},{key:"bandwidthEstimate",get:function(){var w=this.abrController.bwEstimator;return w?w.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var w=this.levels,C=this.config.minAutoBitrate;if(!w)return 0;for(var x=w.length,_=0;_<x;_++)if(w[_].maxBitrate>C)return _;return 0}},{key:"maxAutoLevel",get:function(){var w=this.levels,C=this.autoLevelCapping,x;return C===-1&&w&&w.length?x=w.length-1:x=C,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(w){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,w)}},{key:"audioTracks",get:function(){var w=this.audioTrackController;return w?w.audioTracks:[]}},{key:"audioTrack",get:function(){var w=this.audioTrackController;return w?w.audioTrack:-1},set:function(w){var C=this.audioTrackController;C&&(C.audioTrack=w)}},{key:"subtitleTracks",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTrack:-1},set:function(w){var C=this.subtitleTrackController;C&&(C.subtitleTrack=w)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var w=this.subtitleTrackController;return w?w.subtitleDisplay:!1},set:function(w){var C=this.subtitleTrackController;C&&(C.subtitleDisplay=w)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(w){this.config.lowLatencyMode=w}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return t.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return h.defaultConfig?h.defaultConfig:p.hlsDefaultConfig},set:function(w){h.defaultConfig=w}}]),h}();b.defaultConfig=void 0},"./src/is-supported.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"isSupported",function(){return f}),T.d(g,"changeTypeSupported",function(){return S});var D=T("./src/utils/mediasource-helper.ts");function v(){return self.SourceBuffer||self.WebKitSourceBuffer}function f(){var y=Object(D.getMediaSource)();if(!y)return!1;var c=v(),o=y&&typeof y.isTypeSupported=="function"&&y.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!c||c.prototype&&typeof c.prototype.appendBuffer=="function"&&typeof c.prototype.remove=="function";return!!o&&!!r}function S(){var y,c=v();return typeof(c==null||((y=c.prototype)===null||y===void 0)?void 0:y.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return u}),T.d(g,"LoadError",function(){return m});var D=T("./src/polyfills/number.ts"),v=T("./src/errors.ts");function f(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,r(i,t)}function S(i){var t=typeof Map=="function"?new Map:void 0;return S=function(l){if(l===null||!o(l))return l;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(l))return t.get(l);t.set(l,E)}function E(){return y(l,arguments,s(this).constructor)}return E.prototype=Object.create(l.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),r(E,l)},S(i)}function y(i,t,a){return c()?y=Reflect.construct:y=function(E,b,h){var L=[null];L.push.apply(L,b);var O=Function.bind.apply(E,L),w=new O;return h&&r(w,h.prototype),w},y.apply(null,arguments)}function c(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function o(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function r(i,t){return r=Object.setPrototypeOf||function(l,E){return l.__proto__=E,l},r(i,t)}function s(i){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},s(i)}var d=Math.pow(2,17),u=function(){function i(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var t=i.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(l,E){var b=this,h=l.url;if(!h)return Promise.reject(new m({type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(h?"part list":"url")));this.abort();var L=this.config,O=L.fLoader,w=L.loader;return new Promise(function(C,x){b.loader&&b.loader.destroy();var _=b.loader=l.loader=O?new O(L):new w(L),j=p(l),N={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:d};l.stats=_.stats,_.load(j,N,{onSuccess:function(V,z,B,K){b.resetLoader(l,_),C({frag:l,part:null,payload:V.data,networkDetails:K})},onError:function(V,z,B){b.resetLoader(l,_),x(new m({type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:V,networkDetails:B}))},onAbort:function(V,z,B){b.resetLoader(l,_),x(new m({type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:B}))},onTimeout:function(V,z,B){b.resetLoader(l,_),x(new m({type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:B}))},onProgress:function(V,z,B,K){E&&E({frag:l,part:null,payload:B,networkDetails:K})}})})},t.loadPart=function(l,E,b){var h=this;this.abort();var L=this.config,O=L.fLoader,w=L.loader;return new Promise(function(C,x){h.loader&&h.loader.destroy();var _=h.loader=l.loader=O?new O(L):new w(L),j=p(l,E),N={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:d};E.stats=_.stats,_.load(j,N,{onSuccess:function(V,z,B,K){h.resetLoader(l,_),h.updateStatsFromPart(l,E);var U={frag:l,part:E,payload:V.data,networkDetails:K};b(U),C(U)},onError:function(V,z,B){h.resetLoader(l,_),x(new m({type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:E,response:V,networkDetails:B}))},onAbort:function(V,z,B){l.stats.aborted=E.stats.aborted,h.resetLoader(l,_),x(new m({type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:E,networkDetails:B}))},onTimeout:function(V,z,B){h.resetLoader(l,_),x(new m({type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,part:E,networkDetails:B}))}})})},t.updateStatsFromPart=function(l,E){var b=l.stats,h=E.stats,L=h.total;if(b.loaded+=h.loaded,L){var O=Math.round(l.duration/E.duration),w=Math.min(Math.round(b.loaded/L),O),C=O-w,x=C*Math.round(b.loaded/w);b.total=b.loaded+x}else b.total=Math.max(b.loaded,b.total);var _=b.loading,j=h.loading;_.start?_.first+=j.first-j.start:(_.start=j.start,_.first=j.first),_.end=j.end},t.resetLoader=function(l,E){l.loader=null,this.loader===E&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),E.destroy()},i}();function p(i,t){t===void 0&&(t=null);var a=t||i,l={frag:i,part:t,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},E=a.byteRangeStartOffset,b=a.byteRangeEndOffset;return Object(D.isFiniteNumber)(E)&&Object(D.isFiniteNumber)(b)&&(l.rangeStart=E,l.rangeEnd=b),l}var m=function(i){f(t,i);function t(a){for(var l,E=arguments.length,b=new Array(E>1?E-1:0),h=1;h<E;h++)b[h-1]=arguments[h];return l=i.call.apply(i,[this].concat(b))||this,l.data=void 0,l.data=a,l}return t}(S(Error))},"./src/loader/fragment.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"ElementaryStreamTypes",function(){return u}),T.d(g,"BaseSegment",function(){return p}),T.d(g,"Fragment",function(){return m}),T.d(g,"Part",function(){return i});var D=T("./src/polyfills/number.ts"),v=T("./node_modules/url-toolkit/src/url-toolkit.js"),f=T.n(v),S=T("./src/utils/logger.ts"),y=T("./src/loader/level-key.ts"),c=T("./src/loader/load-stats.ts");function o(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,r(t,a)}function r(t,a){return r=Object.setPrototypeOf||function(E,b){return E.__proto__=b,E},r(t,a)}function s(t,a){for(var l=0;l<a.length;l++){var E=a[l];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(t,E.key,E)}}function d(t,a,l){return a&&s(t.prototype,a),l&&s(t,l),t}var u;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(u||(u={}));var p=function(){function t(l){var E;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(E={},E[u.AUDIO]=null,E[u.VIDEO]=null,E[u.AUDIOVIDEO]=null,E),this.baseurl=l}var a=t.prototype;return a.setByteRange=function(E,b){var h=E.split("@",2),L=[];h.length===1?L[0]=b?b.byteRangeEndOffset:0:L[0]=parseInt(h[1]),L[1]=parseInt(h[0])+L[0],this._byteRange=L},d(t,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(v.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(E){this._url=E}}]),t}(),m=function(t){o(a,t);function a(E,b){var h;return h=t.call(this,b)||this,h._decryptdata=null,h.rawProgramDateTime=null,h.programDateTime=null,h.tagList=[],h.duration=0,h.sn=0,h.levelkey=void 0,h.type=void 0,h.loader=null,h.level=-1,h.cc=0,h.startPTS=void 0,h.endPTS=void 0,h.appendedPTS=void 0,h.startDTS=void 0,h.endDTS=void 0,h.start=0,h.deltaPTS=void 0,h.maxStartPTS=void 0,h.minEndPTS=void 0,h.stats=new c.LoadStats,h.urlId=0,h.data=void 0,h.bitrateTest=!1,h.title=null,h.initSegment=null,h.type=E,h}var l=a.prototype;return l.createInitializationVector=function(b){for(var h=new Uint8Array(16),L=12;L<16;L++)h[L]=b>>8*(15-L)&255;return h},l.setDecryptDataFromLevelKey=function(b,h){var L=b;return(b==null?void 0:b.method)==="AES-128"&&b.uri&&!b.iv&&(L=y.LevelKey.fromURI(b.uri),L.method=b.method,L.iv=this.createInitializationVector(h),L.keyFormat="identity"),L},l.setElementaryStreamInfo=function(b,h,L,O,w,C){C===void 0&&(C=!1);var x=this.elementaryStreams,_=x[b];if(!_){x[b]={startPTS:h,endPTS:L,startDTS:O,endDTS:w,partial:C};return}_.startPTS=Math.min(_.startPTS,h),_.endPTS=Math.max(_.endPTS,L),_.startDTS=Math.min(_.startDTS,O),_.endDTS=Math.max(_.endDTS,w)},l.clearElementaryStreamInfo=function(){var b=this.elementaryStreams;b[u.AUDIO]=null,b[u.VIDEO]=null,b[u.AUDIOVIDEO]=null},d(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var b=this.sn;typeof b!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&S.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),b=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,b)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(D.isFiniteNumber)(this.programDateTime))return null;var b=Object(D.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+b*1e3}},{key:"encrypted",get:function(){var b;return!!((b=this.decryptdata)!==null&&b!==void 0&&b.keyFormat&&this.decryptdata.uri)}}]),a}(p),i=function(t){o(a,t);function a(l,E,b,h,L){var O;O=t.call(this,b)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new c.LoadStats,O.duration=l.decimalFloatingPoint("DURATION"),O.gap=l.bool("GAP"),O.independent=l.bool("INDEPENDENT"),O.relurl=l.enumeratedString("URI"),O.fragment=E,O.index=h;var w=l.enumeratedString("BYTERANGE");return w&&O.setByteRange(w,L),L&&(O.fragOffset=L.fragOffset+L.duration),O}return d(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var E=this.elementaryStreams;return!!(E.audio||E.video||E.audiovideo)}}]),a}(p)},"./src/loader/key-loader.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return S});var D=T("./src/events.ts"),v=T("./src/errors.ts"),f=T("./src/utils/logger.ts"),S=function(){function y(o){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=o,this._registerListeners()}var c=y.prototype;return c._registerListeners=function(){this.hls.on(D.Events.KEY_LOADING,this.onKeyLoading,this)},c._unregisterListeners=function(){this.hls.off(D.Events.KEY_LOADING,this.onKeyLoading)},c.destroy=function(){this._unregisterListeners();for(var r in this.loaders){var s=this.loaders[r];s&&s.destroy()}this.loaders={}},c.onKeyLoading=function(r,s){var d=s.frag,u=d.type,p=this.loaders[u];if(!d.decryptdata){f.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var m=d.decryptdata.uri;if(m!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(p&&(f.logger.warn("abort previous key loader for type:"+u),p.abort()),!m){f.logger.warn("key uri is falsy");return}var t=i.loader,a=d.loader=this.loaders[u]=new t(i);this.decrypturl=m,this.decryptkey=null;var l={url:m,frag:d,responseType:"arraybuffer"},E={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(l,E,b)}else this.decryptkey&&(d.decryptdata.key=this.decryptkey,this.hls.trigger(D.Events.KEY_LOADED,{frag:d}))},c.loadsuccess=function(r,s,d){var u=d.frag;if(!u.decryptdata){f.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(r.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(D.Events.KEY_LOADED,{frag:u})},c.loaderror=function(r,s){var d=s.frag,u=d.loader;u&&u.abort(),delete this.loaders[d.type],this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:d,response:r})},c.loadtimeout=function(r,s){var d=s.frag,u=d.loader;u&&u.abort(),delete this.loaders[d.type],this.hls.trigger(D.Events.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:d})},y}()},"./src/loader/level-details.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"LevelDetails",function(){return y});var D=T("./src/polyfills/number.ts");function v(c,o){for(var r=0;r<o.length;r++){var s=o[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function f(c,o,r){return o&&v(c.prototype,o),r&&v(c,r),c}var S=10,y=function(){function c(r){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=r}var o=c.prototype;return o.reloaded=function(s){if(!s){this.advanced=!0,this.updated=!0;return}var d=this.lastPartSn-s.lastPartSn,u=this.lastPartIndex-s.lastPartIndex;this.updated=this.endSN!==s.endSN||!!u||!!d,this.advanced=this.endSN>s.endSN||d>0||d===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(s.misses*.6):this.misses=s.misses+1,this.availabilityDelay=s.availabilityDelay},f(c,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(D.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||S}},{key:"drift",get:function(){var s=this.driftEndTime-this.driftStartTime;if(s>0){var d=this.driftEnd-this.driftStart;return d*1e3/s}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var s;return(s=this.fragments)!==null&&s!==void 0&&s.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 s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),c}()},"./src/loader/level-key.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"LevelKey",function(){return y});var D=T("./node_modules/url-toolkit/src/url-toolkit.js"),v=T.n(D);function f(c,o){for(var r=0;r<o.length;r++){var s=o[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function S(c,o,r){return o&&f(c.prototype,o),r&&f(c,r),c}var y=function(){c.fromURL=function(r,s){return new c(r,s)},c.fromURI=function(r){return new c(r)};function c(o,r){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,r?this._uri=Object(D.buildAbsoluteURL)(o,r,{alwaysNormalize:!0}):this._uri=o}return S(c,[{key:"uri",get:function(){return this._uri}}]),c}()},"./src/loader/load-stats.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"LoadStats",function(){return D});var D=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return a});var D=T("./src/polyfills/number.ts"),v=T("./node_modules/url-toolkit/src/url-toolkit.js"),f=T.n(v),S=T("./src/loader/fragment.ts"),y=T("./src/loader/level-details.ts"),c=T("./src/loader/level-key.ts"),o=T("./src/utils/attr-list.ts"),r=T("./src/utils/logger.ts"),s=T("./src/utils/codecs.ts"),d=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#EXT-X-MEDIA:(.*)/g,p=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),m=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function t(L){var O,w;return i.test((O=(w=v.parseURL(L))===null||w===void 0?void 0:w.path)!=null?O:"")}var a=function(){function L(){}return L.findGroup=function(w,C){for(var x=0;x<w.length;x++){var _=w[x];if(_.id===C)return _}},L.convertAVC1ToAVCOTI=function(w){var C=w.split(".");if(C.length>2){var x=C.shift()+".";return x+=parseInt(C.shift()).toString(16),x+=("000"+parseInt(C.shift()).toString(16)).substr(-4),x}return w},L.resolve=function(w,C){return v.buildAbsoluteURL(C,w,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(w,C){var x=[],_={},j=!1;d.lastIndex=0;for(var N;(N=d.exec(w))!=null;)if(N[1]){var P=new o.AttrList(N[1]),V={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:L.resolve(N[2],C)},z=P.decimalResolution("RESOLUTION");z&&(V.width=z.width,V.height=z.height),l((P.CODECS||"").split(/[ ,]+/).filter(function(K){return K}),V),V.videoCodec&&V.videoCodec.indexOf("avc1")!==-1&&(V.videoCodec=L.convertAVC1ToAVCOTI(V.videoCodec)),x.push(V)}else if(N[3]){var B=new o.AttrList(N[3]);B["DATA-ID"]&&(j=!0,_[B["DATA-ID"]]=B)}return{levels:x,sessionData:j?_:null}},L.parseMasterPlaylistMedia=function(w,C,x,_){_===void 0&&(_=[]);var j,N=[],P=0;for(u.lastIndex=0;(j=u.exec(w))!==null;){var V=new o.AttrList(j[1]);if(V.TYPE===x){var z={attrs:V,bitrate:0,id:P++,groupId:V["GROUP-ID"],instreamId:V["INSTREAM-ID"],name:V.NAME||V.LANGUAGE||"",type:x,default:V.bool("DEFAULT"),autoselect:V.bool("AUTOSELECT"),forced:V.bool("FORCED"),lang:V.LANGUAGE,url:V.URI?L.resolve(V.URI,C):""};if(_.length){var B=L.findGroup(_,z.groupId)||_[0];E(z,B,"audioCodec"),E(z,B,"textCodec")}N.push(z)}}return N},L.parseLevelPlaylist=function(w,C,x,_,j){var N=new y.LevelDetails(C),P=N.fragments,V=null,z=0,B=0,K=0,U=0,W=null,H=new S.Fragment(_,C),q,ne,te,_e=-1,Ce=!1;for(p.lastIndex=0,N.m3u8=w;(q=p.exec(w))!==null;){Ce&&(Ce=!1,H=new S.Fragment(_,C),H.start=K,H.sn=z,H.cc=U,H.level=x,V&&(H.initSegment=V,H.rawProgramDateTime=V.rawProgramDateTime));var me=q[1];if(me){H.duration=parseFloat(me);var Me=(" "+q[2]).slice(1);H.title=Me||null,H.tagList.push(Me?["INF",me,Me]:["INF",me])}else if(q[3])Object(D.isFiniteNumber)(H.duration)&&(H.start=K,te&&(H.levelkey=te),H.sn=z,H.level=x,H.cc=U,H.urlId=j,P.push(H),H.relurl=(" "+q[3]).slice(1),h(H,W),W=H,K+=H.duration,z++,B=0,Ce=!0);else if(q[4]){var Oe=(" "+q[4]).slice(1);W?H.setByteRange(Oe,W):H.setByteRange(Oe)}else if(q[5])H.rawProgramDateTime=(" "+q[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),_e===-1&&(_e=P.length);else{if(q=q[0].match(m),!q){r.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne<q.length&&!(typeof q[ne]!="undefined");ne++);var he=(" "+q[ne]).slice(1),ce=(" "+q[ne+1]).slice(1),se=q[ne+2]?(" "+q[ne+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":N.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":z=N.startSN=parseInt(ce);break;case"SKIP":{var Te=new o.AttrList(ce),re=Te.decimalInteger("SKIPPED-SEGMENTS");if(Object(D.isFiniteNumber)(re)){N.skippedSegments=re;for(var ue=re;ue--;)P.unshift(null);z+=re}var fe=Te.enumeratedString("RECENTLY-REMOVED-DATERANGES");fe&&(N.recentlyRemovedDateranges=fe.split(" "));break}case"TARGETDURATION":N.targetduration=parseFloat(ce);break;case"VERSION":N.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":N.live=!1;break;case"#":(ce||se)&&H.tagList.push(se?[ce,se]:[ce]);break;case"DIS":U++;case"GAP":H.tagList.push([he]);break;case"BITRATE":H.tagList.push([he,ce]);break;case"DISCONTINUITY-SEQ":U=parseInt(ce);break;case"KEY":{var ee,Q=new o.AttrList(ce),X=Q.enumeratedString("METHOD"),Z=Q.URI,ve=Q.hexadecimalInteger("IV"),ye=Q.enumeratedString("KEYFORMATVERSIONS"),Re=Q.enumeratedString("KEYID"),Je=(ee=Q.enumeratedString("KEYFORMAT"))!=null?ee:"identity",Ze=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ze.indexOf(Je)>-1){r.logger.warn("Keyformat "+Je+" is not supported from the manifest");continue}else if(Je!=="identity")continue;X&&(te=c.LevelKey.fromURL(C,Z),Z&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(X)>=0&&(te.method=X,te.keyFormat=Je,Re&&(te.keyID=Re),ye&&(te.keyFormatVersions=ye),te.iv=ve));break}case"START":{var rt=new o.AttrList(ce),tt=rt.decimalFloatingPoint("TIME-OFFSET");Object(D.isFiniteNumber)(tt)&&(N.startTimeOffset=tt);break}case"MAP":{var st=new o.AttrList(ce);H.relurl=st.URI,st.BYTERANGE&&H.setByteRange(st.BYTERANGE),H.level=x,H.sn="initSegment",te&&(H.levelkey=te),H.initSegment=null,V=H,Ce=!0;break}case"SERVER-CONTROL":{var ot=new o.AttrList(ce);N.canBlockReload=ot.bool("CAN-BLOCK-RELOAD"),N.canSkipUntil=ot.optionalFloat("CAN-SKIP-UNTIL",0),N.canSkipDateRanges=N.canSkipUntil>0&&ot.bool("CAN-SKIP-DATERANGES"),N.partHoldBack=ot.optionalFloat("PART-HOLD-BACK",0),N.holdBack=ot.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Fe=new o.AttrList(ce);N.partTarget=Fe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ae=N.partList;Ae||(Ae=N.partList=[]);var qe=B>0?Ae[Ae.length-1]:void 0,ut=B++,$e=new S.Part(new o.AttrList(ce),H,C,ut,qe);Ae.push($e),H.duration+=$e.duration;break}case"PRELOAD-HINT":{var nt=new o.AttrList(ce);N.preloadHint=nt;break}case"RENDITION-REPORT":{var je=new o.AttrList(ce);N.renditionReports=N.renditionReports||[],N.renditionReports.push(je);break}default:r.logger.warn("line parsed but not handled: "+q);break}}}W&&!W.relurl?(P.pop(),K-=W.duration,N.partList&&(N.fragmentHint=W)):N.partList&&(h(H,W),H.cc=U,N.fragmentHint=H);var De=P.length,Pe=P[0],xe=P[De-1];if(K+=N.skippedSegments*N.targetduration,K>0&&De&&xe){N.averagetargetduration=K/De;var Se=xe.sn;N.endSN=Se!=="initSegment"?Se:0,Pe&&(N.startCC=Pe.cc,Pe.initSegment||N.fragments.every(function(Le){return Le.relurl&&t(Le.relurl)})&&(r.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new S.Fragment(_,C),H.relurl=xe.relurl,H.level=x,H.sn="initSegment",Pe.initSegment=H,N.needSidxRanges=!0))}else N.endSN=0,N.startCC=0;return N.fragmentHint&&(K+=N.fragmentHint.duration),N.totalduration=K,N.endCC=U,_e>0&&b(P,_e),N},L}();function l(L,O){["video","audio","text"].forEach(function(w){var C=L.filter(function(_){return Object(s.isCodecType)(_,w)});if(C.length){var x=C.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});O[w+"Codec"]=x.length>0?x[0]:C[0],L=L.filter(function(_){return C.indexOf(_)===-1})}}),O.unknownCodecs=L}function E(L,O,w){var C=O[w];C&&(L[w]=C)}function b(L,O){for(var w=L[O],C=O;C--;){var x=L[C];if(!x)return;x.programDateTime=w.programDateTime-x.duration*1e3,w=x}}function h(L,O){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):O!=null&&O.programDateTime&&(L.programDateTime=O.endProgramDateTime),Object(D.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/polyfills/number.ts"),v=T("./src/events.ts"),f=T("./src/errors.ts"),S=T("./src/utils/logger.ts"),y=T("./src/utils/mp4-tools.ts"),c=T("./src/loader/m3u8-parser.ts"),o=T("./src/types/loader.ts"),r=T("./src/utils/attr-list.ts");function s(p){var m=p.type;switch(m){case o.PlaylistContextType.AUDIO_TRACK:return o.PlaylistLevelType.AUDIO;case o.PlaylistContextType.SUBTITLE_TRACK:return o.PlaylistLevelType.SUBTITLE;default:return o.PlaylistLevelType.MAIN}}function d(p,m){var i=p.url;return(i===void 0||i.indexOf("data:")===0)&&(i=m.url),i}var u=function(){function p(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var m=p.prototype;return m.registerListeners=function(){var t=this.hls;t.on(v.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(v.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(v.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(v.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},m.unregisterListeners=function(){var t=this.hls;t.off(v.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(v.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(v.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(v.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},m.createInternalLoader=function(t){var a=this.hls.config,l=a.pLoader,E=a.loader,b=l||E,h=new b(a);return t.loader=h,this.loaders[t.type]=h,h},m.getInternalLoader=function(t){return this.loaders[t.type]},m.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},m.destroyInternalLoaders=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy(),this.resetInternalLoader(t)}},m.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},m.onManifestLoading=function(t,a){var l=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:o.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},m.onLevelLoading=function(t,a){var l=a.id,E=a.level,b=a.url,h=a.deliveryDirectives;this.load({id:l,groupId:null,level:E,responseType:"text",type:o.PlaylistContextType.LEVEL,url:b,deliveryDirectives:h})},m.onAudioTrackLoading=function(t,a){var l=a.id,E=a.groupId,b=a.url,h=a.deliveryDirectives;this.load({id:l,groupId:E,level:null,responseType:"text",type:o.PlaylistContextType.AUDIO_TRACK,url:b,deliveryDirectives:h})},m.onSubtitleTrackLoading=function(t,a){var l=a.id,E=a.groupId,b=a.url,h=a.deliveryDirectives;this.load({id:l,groupId:E,level:null,responseType:"text",type:o.PlaylistContextType.SUBTITLE_TRACK,url:b,deliveryDirectives:h})},m.load=function(t){var a,l=this.hls.config,E=this.getInternalLoader(t);if(E){var b=E.context;if(b&&b.url===t.url){S.logger.trace("[playlist-loader]: playlist request ongoing");return}S.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),E.abort()}var h,L,O,w;switch(t.type){case o.PlaylistContextType.MANIFEST:h=l.manifestLoadingMaxRetry,L=l.manifestLoadingTimeOut,O=l.manifestLoadingRetryDelay,w=l.manifestLoadingMaxRetryTimeout;break;case o.PlaylistContextType.LEVEL:case o.PlaylistContextType.AUDIO_TRACK:case o.PlaylistContextType.SUBTITLE_TRACK:h=0,L=l.levelLoadingTimeOut;break;default:h=l.levelLoadingMaxRetry,L=l.levelLoadingTimeOut,O=l.levelLoadingRetryDelay,w=l.levelLoadingMaxRetryTimeout;break}if(E=this.createInternalLoader(t),(a=t.deliveryDirectives)!==null&&a!==void 0&&a.part){var C;if(t.type===o.PlaylistContextType.LEVEL&&t.level!==null?C=this.hls.levels[t.level].details:t.type===o.PlaylistContextType.AUDIO_TRACK&&t.id!==null?C=this.hls.audioTracks[t.id].details:t.type===o.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(C=this.hls.subtitleTracks[t.id].details),C){var x=C.partTarget,_=C.targetduration;x&&_&&(L=Math.min(Math.max(x*3,_*.8)*1e3,L))}}var j={timeout:L,maxRetry:h,retryDelay:O,maxRetryDelay:w,highWaterMark:0},N={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};E.load(t,j,N)},m.loadsuccess=function(t,a,l,E){if(E===void 0&&(E=null),l.isSidxRequest){this.handleSidxRequest(t,l),this.handlePlaylistLoaded(t,a,l,E);return}this.resetInternalLoader(l.type);var b=t.data;if(b.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,l,"no EXTM3U delimiter",E);return}a.parsing.start=performance.now(),b.indexOf("#EXTINF:")>0||b.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,a,l,E):this.handleMasterPlaylist(t,a,l,E)},m.loaderror=function(t,a,l){l===void 0&&(l=null),this.handleNetworkError(a,l,!1,t)},m.loadtimeout=function(t,a,l){l===void 0&&(l=null),this.handleNetworkError(a,l,!0)},m.handleMasterPlaylist=function(t,a,l,E){var b=this.hls,h=t.data,L=d(t,l),O=c.default.parseMasterPlaylist(h,L),w=O.levels,C=O.sessionData;if(!w.length){this.handleManifestParsingError(t,l,"no level found in manifest",E);return}var x=w.map(function(z){return{id:z.attrs.AUDIO,audioCodec:z.audioCodec}}),_=w.map(function(z){return{id:z.attrs.SUBTITLES,textCodec:z.textCodec}}),j=c.default.parseMasterPlaylistMedia(h,L,"AUDIO",x),N=c.default.parseMasterPlaylistMedia(h,L,"SUBTITLES",_),P=c.default.parseMasterPlaylistMedia(h,L,"CLOSED-CAPTIONS");if(j.length){var V=j.some(function(z){return!z.url});!V&&w[0].audioCodec&&!w[0].attrs.AUDIO&&(S.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:""}))}b.trigger(v.Events.MANIFEST_LOADED,{levels:w,audioTracks:j,subtitles:N,captions:P,url:L,stats:a,networkDetails:E,sessionData:C})},m.handleTrackOrLevelPlaylist=function(t,a,l,E){var b=this.hls,h=l.id,L=l.level,O=l.type,w=d(t,l),C=Object(D.isFiniteNumber)(h)?h:0,x=Object(D.isFiniteNumber)(L)?L:C,_=s(l),j=c.default.parseLevelPlaylist(t.data,w,x,_,C);if(!j.fragments.length){b.trigger(v.Events.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:w,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(O===o.PlaylistContextType.MANIFEST){var N={attrs:new r.AttrList({}),bitrate:0,details:j,name:"",url:w};b.trigger(v.Events.MANIFEST_LOADED,{levels:[N],audioTracks:[],url:w,stats:a,networkDetails:E,sessionData:null})}if(a.parsing.end=performance.now(),j.needSidxRanges){var P,V=(P=j.fragments[0].initSegment)===null||P===void 0?void 0:P.url;this.load({url:V,isSidxRequest:!0,type:O,level:L,levelDetails:j,id:h,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=j,this.handlePlaylistLoaded(t,a,l,E)},m.handleSidxRequest=function(t,a){var l=Object(y.parseSegmentIndex)(new Uint8Array(t.data));if(!l)return;var E=l.references,b=a.levelDetails;E.forEach(function(h,L){var O=h.info,w=b.fragments[L];w.byteRange.length===0&&w.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),w.initSegment&&w.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},m.handleManifestParsingError=function(t,a,l,E){this.hls.trigger(v.Events.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===o.PlaylistContextType.MANIFEST,url:t.url,reason:l,response:t,context:a,networkDetails:E})},m.handleNetworkError=function(t,a,l,E){l===void 0&&(l=!1),S.logger.warn("[playlist-loader]: A network "+(l?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var b=f.ErrorDetails.UNKNOWN,h=!1,L=this.getInternalLoader(t);switch(t.type){case o.PlaylistContextType.MANIFEST:b=l?f.ErrorDetails.MANIFEST_LOAD_TIMEOUT:f.ErrorDetails.MANIFEST_LOAD_ERROR,h=!0;break;case o.PlaylistContextType.LEVEL:b=l?f.ErrorDetails.LEVEL_LOAD_TIMEOUT:f.ErrorDetails.LEVEL_LOAD_ERROR,h=!1;break;case o.PlaylistContextType.AUDIO_TRACK:b=l?f.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:f.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case o.PlaylistContextType.SUBTITLE_TRACK:b=l?f.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:f.ErrorDetails.SUBTITLE_LOAD_ERROR,h=!1;break}L&&this.resetInternalLoader(t.type);var O={type:f.ErrorTypes.NETWORK_ERROR,details:b,fatal:h,url:t.url,loader:L,context:t,networkDetails:a};E&&(O.response=E),this.hls.trigger(v.Events.ERROR,O)},m.handlePlaylistLoaded=function(t,a,l,E){var b=l.type,h=l.level,L=l.id,O=l.groupId,w=l.loader,C=l.levelDetails,x=l.deliveryDirectives;if(!(C!=null&&C.targetduration)){this.handleManifestParsingError(t,l,"invalid target duration",E);return}if(!w)return;C.live&&(w.getCacheAge&&(C.ageHeader=w.getCacheAge()||0),(!w.getCacheAge||isNaN(C.ageHeader))&&(C.ageHeader=0));switch(b){case o.PlaylistContextType.MANIFEST:case o.PlaylistContextType.LEVEL:this.hls.trigger(v.Events.LEVEL_LOADED,{details:C,level:h||0,id:L||0,stats:a,networkDetails:E,deliveryDirectives:x});break;case o.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(v.Events.AUDIO_TRACK_LOADED,{details:C,id:L||0,groupId:O||"",stats:a,networkDetails:E,deliveryDirectives:x});break;case o.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(v.Events.SUBTITLE_TRACK_LOADED,{details:C,id:L||0,groupId:O||"",stats:a,networkDetails:E,deliveryDirectives:x});break}},p}();g.default=u},"./src/polyfills/number.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"isFiniteNumber",function(){return D}),T.d(g,"MAX_SAFE_INTEGER",function(){return v});var D=Number.isFinite||function(f){return typeof f=="number"&&isFinite(f)},v=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(M,g,T){"use strict";T.r(g);var D=function(){function v(){}return v.getSilentFrame=function(S,y){switch(S){case"mp4a.40.2":if(y===1)return new Uint8Array([0,200,0,128,35,128]);if(y===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(y===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(y===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(y===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(y===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(y===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(y===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(y===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},v}();g.default=D},"./src/remux/mp4-generator.ts":function(M,g,T){"use strict";T.r(g);var D=Math.pow(2,32)-1,v=function(){function f(){}return f.init=function(){f.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 y;for(y in f.types)f.types.hasOwnProperty(y)&&(f.types[y]=[y.charCodeAt(0),y.charCodeAt(1),y.charCodeAt(2),y.charCodeAt(3)]);var c=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]),o=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]);f.HDLR_TYPES={video:c,audio:o};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);f.STTS=f.STSC=f.STCO=s,f.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),f.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),f.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),f.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var d=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),p=new Uint8Array([0,0,0,1]);f.FTYP=f.box(f.types.ftyp,d,p,d,u),f.DINF=f.box(f.types.dinf,f.box(f.types.dref,r))},f.box=function(y){for(var c=8,o=arguments.length,r=new Array(o>1?o-1:0),s=1;s<o;s++)r[s-1]=arguments[s];for(var d=r.length,u=d;d--;)c+=r[d].byteLength;var p=new Uint8Array(c);for(p[0]=c>>24&255,p[1]=c>>16&255,p[2]=c>>8&255,p[3]=c&255,p.set(y,4),d=0,c=8;d<u;d++)p.set(r[d],c),c+=r[d].byteLength;return p},f.hdlr=function(y){return f.box(f.types.hdlr,f.HDLR_TYPES[y])},f.mdat=function(y){return f.box(f.types.mdat,y)},f.mdhd=function(y,c){c*=y;var o=Math.floor(c/(D+1)),r=Math.floor(c%(D+1));return f.box(f.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,o>>24,o>>16&255,o>>8&255,o&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))},f.mdia=function(y){return f.box(f.types.mdia,f.mdhd(y.timescale,y.duration),f.hdlr(y.type),f.minf(y))},f.mfhd=function(y){return f.box(f.types.mfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255]))},f.minf=function(y){return y.type==="audio"?f.box(f.types.minf,f.box(f.types.smhd,f.SMHD),f.DINF,f.stbl(y)):f.box(f.types.minf,f.box(f.types.vmhd,f.VMHD),f.DINF,f.stbl(y))},f.moof=function(y,c,o){return f.box(f.types.moof,f.mfhd(y),f.traf(o,c))},f.moov=function(y){for(var c=y.length,o=[];c--;)o[c]=f.trak(y[c]);return f.box.apply(null,[f.types.moov,f.mvhd(y[0].timescale,y[0].duration)].concat(o).concat(f.mvex(y)))},f.mvex=function(y){for(var c=y.length,o=[];c--;)o[c]=f.trex(y[c]);return f.box.apply(null,[f.types.mvex].concat(o))},f.mvhd=function(y,c){c*=y;var o=Math.floor(c/(D+1)),r=Math.floor(c%(D+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,o>>24,o>>16&255,o>>8&255,o&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 f.box(f.types.mvhd,s)},f.sdtp=function(y){var c=y.samples||[],o=new Uint8Array(4+c.length),r,s;for(r=0;r<c.length;r++)s=c[r].flags,o[r+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy;return f.box(f.types.sdtp,o)},f.stbl=function(y){return f.box(f.types.stbl,f.stsd(y),f.box(f.types.stts,f.STTS),f.box(f.types.stsc,f.STSC),f.box(f.types.stsz,f.STSZ),f.box(f.types.stco,f.STCO))},f.avc1=function(y){var c=[],o=[],r,s,d;for(r=0;r<y.sps.length;r++)s=y.sps[r],d=s.byteLength,c.push(d>>>8&255),c.push(d&255),c=c.concat(Array.prototype.slice.call(s));for(r=0;r<y.pps.length;r++)s=y.pps[r],d=s.byteLength,o.push(d>>>8&255),o.push(d&255),o=o.concat(Array.prototype.slice.call(s));var u=f.box(f.types.avcC,new Uint8Array([1,c[3],c[4],c[5],252|3,224|y.sps.length].concat(c).concat([y.pps.length]).concat(o))),p=y.width,m=y.height,i=y.pixelRatio[0],t=y.pixelRatio[1];return f.box(f.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,p>>8&255,p&255,m>>8&255,m&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,f.box(f.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),f.box(f.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,t>>24,t>>16&255,t>>8&255,t&255])))},f.esds=function(y){var c=y.config.length;return new Uint8Array([0,0,0,0,3,23+c,0,1,0,4,15+c,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([c]).concat(y.config).concat([6,1,2]))},f.mp4a=function(y){var c=y.samplerate;return f.box(f.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,c>>8&255,c&255,0,0]),f.box(f.types.esds,f.esds(y)))},f.mp3=function(y){var c=y.samplerate;return f.box(f.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,c>>8&255,c&255,0,0]))},f.stsd=function(y){return y.type==="audio"?!y.isAAC&&y.codec==="mp3"?f.box(f.types.stsd,f.STSD,f.mp3(y)):f.box(f.types.stsd,f.STSD,f.mp4a(y)):f.box(f.types.stsd,f.STSD,f.avc1(y))},f.tkhd=function(y){var c=y.id,o=y.duration*y.timescale,r=y.width,s=y.height,d=Math.floor(o/(D+1)),u=Math.floor(o%(D+1));return f.box(f.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,c>>24&255,c>>16&255,c>>8&255,c&255,0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,r&255,0,0,s>>8&255,s&255,0,0]))},f.traf=function(y,c){var o=f.sdtp(y),r=y.id,s=Math.floor(c/(D+1)),d=Math.floor(c%(D+1));return f.box(f.types.traf,f.box(f.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),f.box(f.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,d>>24,d>>16&255,d>>8&255,d&255])),f.trun(y,o.length+16+20+8+16+8+8),o)},f.trak=function(y){return y.duration=y.duration||4294967295,f.box(f.types.trak,f.tkhd(y),f.mdia(y))},f.trex=function(y){var c=y.id;return f.box(f.types.trex,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},f.trun=function(y,c){var o=y.samples||[],r=o.length,s=12+16*r,d=new Uint8Array(s),u,p,m,i,t,a;for(c+=8+s,d.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255],0),u=0;u<r;u++)p=o[u],m=p.duration,i=p.size,t=p.flags,a=p.cts,d.set([m>>>24&255,m>>>16&255,m>>>8&255,m&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*u);return f.box(f.types.trun,d)},f.initSegment=function(y){f.types||f.init();var c=f.moov(y),o=new Uint8Array(f.FTYP.byteLength+c.byteLength);return o.set(f.FTYP),o.set(c,f.FTYP.byteLength),o},f}();v.types=void 0,v.HDLR_TYPES=void 0,v.STTS=void 0,v.STSC=void 0,v.STCO=void 0,v.STSZ=void 0,v.VMHD=void 0,v.SMHD=void 0,v.STSD=void 0,v.FTYP=void 0,v.DINF=void 0,g.default=v},"./src/remux/mp4-remuxer.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return a}),T.d(g,"normalizePts",function(){return l});var D=T("./src/polyfills/number.ts"),v=T("./src/remux/aac-helper.ts"),f=T("./src/remux/mp4-generator.ts"),S=T("./src/events.ts"),y=T("./src/errors.ts"),c=T("./src/utils/logger.ts"),o=T("./src/types/loader.ts"),r=T("./src/utils/timescale-conversion.ts");function s(){return s=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var w=arguments[O];for(var C in w)Object.prototype.hasOwnProperty.call(w,C)&&(L[C]=w[C])}return L},s.apply(this,arguments)}var d=10*1e3,u=1024,p=1152,m=null,i=null,t=!1,a=function(){function L(w,C,x,_){if(_===void 0&&(_=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=w,this.config=C,this.typeSupported=x,this.ISGenerated=!1,m===null){var j=navigator.userAgent||"",N=j.match(/Chrome\/(\d+)/i);m=N?parseInt(N[1]):0}if(i===null){var P=navigator.userAgent.match(/Safari\/(\d+)/i);i=P?parseInt(P[1]):0}t=!!m&&m<75||!!i&&i<600}var O=L.prototype;return O.destroy=function(){},O.resetTimeStamp=function(C){c.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=C},O.resetNextTimestamp=function(){c.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){c.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(C){var x=!1,_=C.reduce(function(j,N){var P=N.pts-j;return P<-4294967296?(x=!0,l(j,N.pts)):P>0?j:N.pts},C[0].pts);return x&&c.logger.debug("PTS rollover detected"),_},O.remux=function(C,x,_,j,N,P,V,z){var B,K,U,W,H,q,ne=N,te=N,_e=C.pid>-1,Ce=x.pid>-1,me=x.samples.length,Me=C.samples.length>0,Oe=me>1,he=(!_e||Me)&&(!Ce||Oe)||this.ISGenerated||V;if(he){this.ISGenerated||(U=this.generateIS(C,x,N));var ce=this.isVideoContiguous,se=-1;if(Oe&&(se=E(x.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if(q=!0,se>0){c.logger.warn("[mp4-remuxer]: Dropped "+se+" out of "+me+" video samples due to a missing keyframe");var Te=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(se),x.dropped+=se,te+=(x.samples[0].pts-Te)/(x.timescale||9e4)}else se===-1&&(c.logger.warn("[mp4-remuxer]: No keyframe found out of "+me+" video samples"),q=!1);if(this.ISGenerated){if(Me&&Oe){var re=this.getVideoStartPts(x.samples),ue=l(C.samples[0].pts,re)-re,fe=ue/x.inputTimeScale;ne+=Math.max(0,fe),te+=Math.max(0,-fe)}if(Me){if(C.samplerate||(c.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(C,x,N)),K=this.remuxAudio(C,ne,this.isAudioContiguous,P,Ce||Oe||z===o.PlaylistLevelType.AUDIO?te:void 0),Oe){var ee=K?K.endPTS-K.startPTS:0;x.inputTimeScale||(c.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(C,x,N)),B=this.remuxVideo(x,te,ce,ee)}}else Oe&&(B=this.remuxVideo(x,te,ce,0));B&&(B.firstKeyFrame=se,B.independent=se!==-1)}}return this.ISGenerated&&(_.samples.length&&(H=this.remuxID3(_,N)),j.samples.length&&(W=this.remuxText(j,N))),{audio:K,video:B,initSegment:U,independent:q,text:W,id3:H}},O.generateIS=function(C,x,_){var j=C.samples,N=x.samples,P=this.typeSupported,V={},z=!Object(D.isFiniteNumber)(this._initPTS),B="audio/mp4",K,U,W;if(z&&(K=U=Infinity),C.config&&j.length&&(C.timescale=C.samplerate,C.isAAC||(P.mpeg?(B="audio/mpeg",C.codec=""):P.mp3&&(C.codec="mp3")),V.audio={id:"audio",container:B,codec:C.codec,initSegment:!C.isAAC&&P.mpeg?new Uint8Array(0):f.default.initSegment([C]),metadata:{channelCount:C.channelCount}},z&&(W=C.inputTimeScale,K=U=j[0].pts-Math.round(W*_))),x.sps&&x.pps&&N.length&&(x.timescale=x.inputTimeScale,V.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:f.default.initSegment([x]),metadata:{width:x.width,height:x.height}},z)){W=x.inputTimeScale;var H=this.getVideoStartPts(N),q=Math.round(W*_);U=Math.min(U,l(N[0].dts,H)-q),K=Math.min(K,H-q)}if(Object.keys(V).length)return this.ISGenerated=!0,z&&(this._initPTS=K,this._initDTS=U),{tracks:V,initPTS:K,timescale:W}},O.remuxVideo=function(C,x,_,j){var N=C.inputTimeScale,P=C.samples,V=[],z=P.length,B=this._initPTS,K=this.nextAvcDts,U=8,W,H,q,ne=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,_e=0,Ce=!1;if(!_||K===null){var me=x*N,Me=P[0].pts-l(P[0].dts,P[0].pts);K=me-Me}for(var Oe=0;Oe<z;Oe++){var he=P[Oe];if(he.pts=l(he.pts-B,K),he.dts=l(he.dts-B,K),he.dts>he.pts){var ce=9e4*.2;_e=Math.max(Math.min(_e,he.pts-he.dts),-1*ce)}he.dts<P[Oe>0?Oe-1:Oe].dts&&(Ce=!0)}Ce&&P.sort(function(Mt,Pt){var _t=Mt.dts-Pt.dts,rr=Mt.pts-Pt.pts;return _t||rr}),H=P[0].dts,q=P[P.length-1].dts;var se=Math.round((q-H)/(z-1));if(_e<0){if(_e<se*-2){c.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(r.toMsFromMpegTsClock)(-se,!0)+" ms");for(var Te=_e,re=0;re<z;re++)P[re].dts=Te=Math.max(Te,P[re].pts-se),P[re].pts=Math.max(Te,P[re].pts)}else{c.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(r.toMsFromMpegTsClock)(_e,!0)+" ms to overcome this issue");for(var ue=0;ue<z;ue++)P[ue].dts=P[ue].dts+_e}H=P[0].dts}if(_){var fe=H-K,ee=fe>se,Q=fe<-1;if(ee||Q){ee?c.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(fe,!0)+" ms ("+fe+"dts) hole between fragments detected, filling it"):c.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(-fe,!0)+" ms ("+fe+"dts) overlapping between fragments detected"),H=K;var X=P[0].pts-fe;P[0].dts=H,P[0].pts=X,c.logger.log("Video: First PTS/DTS adjusted: "+Object(r.toMsFromMpegTsClock)(X,!0)+"/"+Object(r.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(r.toMsFromMpegTsClock)(fe,!0)+" ms")}}t&&(H=Math.max(0,H));for(var Z=0,ve=0,ye=0;ye<z;ye++){for(var Re=P[ye],Je=Re.units,Ze=Je.length,rt=0,tt=0;tt<Ze;tt++)rt+=Je[tt].data.length;ve+=rt,Z+=Ze,Re.length=rt,Re.dts=Math.max(Re.dts,H),Re.pts=Math.max(Re.pts,Re.dts,0),ne=Math.min(Re.pts,ne),te=Math.max(Re.pts,te)}q=P[z-1].dts;var st=ve+4*Z+8,ot;try{ot=new Uint8Array(st)}catch(Mt){this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:st,reason:"fail allocating video mdat "+st});return}var Fe=new DataView(ot.buffer);Fe.setUint32(0,st),ot.set(f.default.types.mdat,4);for(var Ae=0;Ae<z;Ae++){for(var qe=P[Ae],ut=qe.units,$e=0,nt=0,je=ut.length;nt<je;nt++){var De=ut[nt],Pe=De.data,xe=De.data.byteLength;Fe.setUint32(U,xe),U+=4,ot.set(Pe,U),U+=xe,$e+=4+xe}if(Ae<z-1)W=P[Ae+1].dts-qe.dts;else{var Se=this.config,Le=qe.dts-P[Ae>0?Ae-1:Ae].dts;if(Se.stretchShortVideoTrack&&this.nextAudioPts!==null){var Ne=Math.floor(Se.maxBufferHole*N),et=(j?ne+j*N:this.nextAudioPts)-qe.pts;et>Ne?(W=et-Le,W<0&&(W=Le),c.logger.log("[mp4-remuxer]: It is approximately "+et/90+" ms to the next segment; using duration "+W/90+" ms for the last video frame.")):W=Le}else W=Le}var Xe=Math.round(qe.pts-qe.dts);V.push(new b(qe.key,W,$e,Xe))}if(V.length&&m&&m<70){var ct=V[0].flags;ct.dependsOn=2,ct.isNonSync=0}console.assert(W!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=K=q+W,this.isVideoContiguous=!0;var gt=f.default.moof(C.sequenceNumber++,H,s({},C,{samples:V})),wt="video",vt={data1:gt,data2:ot,startPTS:ne/N,endPTS:(te+W)/N,startDTS:H/N,endDTS:K/N,type:wt,hasAudio:!1,hasVideo:!0,nb:V.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(ot.length,"MDAT length must not be zero"),vt},O.remuxAudio=function(C,x,_,j,N){var P=C.inputTimeScale,V=C.samplerate?C.samplerate:P,z=P/V,B=C.isAAC?u:p,K=B*z,U=this._initPTS,W=!C.isAAC&&this.typeSupported.mpeg,H=[],q=C.samples,ne=W?0:8,te=this.nextAudioPts||-1,_e=x*P;if(this.isAudioContiguous=_=_||q.length&&te>0&&(j&&Math.abs(_e-te)<9e3||Math.abs(l(q[0].pts-U,_e)-te)<20*K),q.forEach(function(Pe){Pe.pts=l(Pe.pts-U,_e)}),!_||te<0){if(q=q.filter(function(Pe){return Pe.pts>=0}),!q.length)return;N===0?te=0:j?te=Math.max(0,_e):te=q[0].pts}if(C.isAAC)for(var Ce=N!==void 0,me=this.config.maxAudioFramesDrift,Me=0,Oe=te;Me<q.length;Me++){var he=q[Me],ce=he.pts,se=ce-Oe,Te=Math.abs(1e3*se/P);if(se<=-me*K&&Ce)Me===0&&(c.logger.warn("Audio frame @ "+(ce/P).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*se/P)+" ms."),this.nextAudioPts=te=Oe=ce);else if(se>=me*K&&Te<d&&Ce){var re=Math.round(se/K);Oe=ce-re*K,Oe<0&&(re--,Oe+=K),Me===0&&(this.nextAudioPts=te=Oe),c.logger.warn("[mp4-remuxer]: Injecting "+re+" audio frame @ "+(Oe/P).toFixed(3)+"s due to "+Math.round(1e3*se/P)+" ms gap.");for(var ue=0;ue<re;ue++){var fe=Math.max(Oe,0),ee=v.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);ee||(c.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ee=he.unit.subarray()),q.splice(Me,0,{unit:ee,pts:fe}),Oe+=K,Me++}}he.pts=Oe,Oe+=K}for(var Q=null,X=null,Z,ve=0,ye=q.length;ye--;)ve+=q[ye].unit.byteLength;for(var Re=0,Je=q.length;Re<Je;Re++){var Ze=q[Re],rt=Ze.unit,tt=Ze.pts;if(X!==null){var st=H[Re-1];st.duration=Math.round((tt-X)/z)}else if(_&&C.isAAC&&(tt=te),Q=tt,ve>0){ve+=ne;try{Z=new Uint8Array(ve)}catch(Pe){this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ve,reason:"fail allocating audio mdat "+ve});return}if(!W){var ot=new DataView(Z.buffer);ot.setUint32(0,ve),Z.set(f.default.types.mdat,4)}}else return;Z.set(rt,ne);var Fe=rt.byteLength;ne+=Fe,H.push(new b(!0,B,Fe,0)),X=tt}var Ae=H.length;if(!Ae)return;var qe=H[H.length-1];this.nextAudioPts=te=X+z*qe.duration;var ut=W?new Uint8Array(0):f.default.moof(C.sequenceNumber++,Q/z,s({},C,{samples:H}));C.samples=[];var $e=Q/P,nt=te/P,je="audio",De={data1:ut,data2:Z,startPTS:$e,endPTS:nt,startDTS:$e,endDTS:nt,type:je,hasAudio:!0,hasVideo:!1,nb:Ae};return this.isAudioContiguous=!0,console.assert(Z.length,"MDAT length must not be zero"),De},O.remuxEmptyAudio=function(C,x,_,j){var N=C.inputTimeScale,P=C.samplerate?C.samplerate:N,V=N/P,z=this.nextAudioPts,B=(z!==null?z:j.startDTS*N)+this._initDTS,K=j.endDTS*N+this._initDTS,U=V*u,W=Math.ceil((K-B)/U),H=v.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(c.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){c.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var q=[],ne=0;ne<W;ne++){var te=B+ne*U;q.push({unit:H,pts:te,dts:te})}return C.samples=q,this.remuxAudio(C,x,_,!1)},O.remuxID3=function(C,x){var _=C.samples.length;if(!_)return;for(var j=C.inputTimeScale,N=this._initPTS,P=this._initDTS,V=0;V<_;V++){var z=C.samples[V];z.pts=l(z.pts-N,x*j)/j,z.dts=l(z.dts-P,x*j)/j}var B=C.samples;return C.samples=[],{samples:B}},O.remuxText=function(C,x){var _=C.samples.length;if(!_)return;for(var j=C.inputTimeScale,N=this._initPTS,P=0;P<_;P++){var V=C.samples[P];V.pts=l(V.pts-N,x*j)/j}C.samples.sort(function(B,K){return B.pts-K.pts});var z=C.samples;return C.samples=[],{samples:z}},L}();function l(L,O){var w;if(O===null)return L;for(O<L?w=-8589934592:w=8589934592;Math.abs(L-O)>4294967296;)L+=w;return L}function E(L){for(var O=0;O<L.length;O++)if(L[O].key)return O;return-1}var b=function(O,w,C,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=w,this.size=C,this.cts=x,this.flags=new h(O)},h=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/polyfills/number.ts"),v=T("./src/utils/mp4-tools.ts"),f=T("./src/loader/fragment.ts"),S=T("./src/utils/logger.ts"),y=function(){function r(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var s=r.prototype;return s.destroy=function(){},s.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},s.resetNextTimestamp=function(){this.lastEndDTS=null},s.resetInitSegment=function(u,p,m){this.audioCodec=p,this.videoCodec=m,this.generateInitSegment(u),this.emitInitSegment=!0},s.generateInitSegment=function(u){var p=this.audioCodec,m=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(v.parseInitSegment)(u);p||(p=o(i.audio,f.ElementaryStreamTypes.AUDIO)),m||(m=o(i.video,f.ElementaryStreamTypes.VIDEO));var t={};i.audio&&i.video?t.audiovideo={container:"video/mp4",codec:p+","+m,initSegment:u,id:"main"}:i.audio?t.audio={container:"audio/mp4",codec:p,initSegment:u,id:"audio"}:i.video?t.video={container:"video/mp4",codec:m,initSegment:u,id:"main"}:S.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},s.remux=function(u,p,m,i,t){var a=this.initPTS,l=this.lastEndDTS,E={audio:void 0,video:void 0,text:i,id3:m,initSegment:void 0};Object(D.isFiniteNumber)(l)||(l=this.lastEndDTS=t||0);var b=p.samples;if(!b||!b.length)return E;var h={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(b),L=this.initData),!L||!L.length)return S.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),E;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1),Object(D.isFiniteNumber)(a)||(this.initPTS=h.initPTS=a=c(L,b,l));var O=Object(v.getDuration)(b,L),w=l,C=O+w;Object(v.offsetStartDTS)(L,b,a),O>0?this.lastEndDTS=C:(S.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!L.audio,_=!!L.video,j="";x&&(j+="audio"),_&&(j+="video");var N={data1:b,startPTS:w,startDTS:w,endPTS:C,endDTS:C,type:j,hasAudio:x,hasVideo:_,nb:1,dropped:0};return E.audio=N.type==="audio"?N:void 0,E.video=N.type!=="audio"?N:void 0,E.text=i,E.id3=m,E.initSegment=h,E},r}(),c=function(s,d,u){return Object(v.getStartDTS)(s,d)-u};function o(r,s){var d=r==null?void 0:r.codec;return d&&d.length>4?d:d==="hvc1"?"hvc1.1.c.L120.90":d==="av01"?"av01.0.04M.08":d==="avc1"||s===f.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}g.default=y},"./src/task-loop.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return D});var D=function(){function v(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var f=v.prototype;return f.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},f.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},f.onHandlerDestroyed=function(){},f.hasInterval=function(){return!!this._tickInterval},f.hasNextTick=function(){return!!this._tickTimer},f.setInterval=function(y){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,y),!0)},f.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},f.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},f.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},f.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},f.doTick=function(){},v}()},"./src/types/cmcd.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"CMCDVersion",function(){return D}),T.d(g,"CMCDObjectType",function(){return v}),T.d(g,"CMCDStreamingFormat",function(){return f}),T.d(g,"CMCDStreamType",function(){return S});var D=1,v;(function(y){y.MANIFEST="m",y.AUDIO="a",y.VIDEO="v",y.MUXED="av",y.INIT="i",y.CAPTION="c",y.TIMED_TEXT="tt",y.KEY="k",y.OTHER="o"})(v||(v={}));var f;(function(y){y.DASH="d",y.HLS="h",y.SMOOTH="s",y.OTHER="o"})(f||(f={}));var S;(function(y){y.VOD="v",y.LIVE="l"})(S||(S={}))},"./src/types/level.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"HlsSkip",function(){return f}),T.d(g,"getSkipValue",function(){return S}),T.d(g,"HlsUrlParameters",function(){return y}),T.d(g,"Level",function(){return c});function D(o,r){for(var s=0;s<r.length;s++){var d=r[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(o,d.key,d)}}function v(o,r,s){return r&&D(o.prototype,r),s&&D(o,s),o}var f;(function(o){o.No="",o.Yes="YES",o.v2="v2"})(f||(f={}));function S(o,r){var s=o.canSkipUntil,d=o.canSkipDateRanges,u=o.endSN,p=r!==void 0?r-u:0;return s&&p<s?d?f.v2:f.Yes:f.No}var y=function(){function o(s,d,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=s,this.part=d,this.skip=u}var r=o.prototype;return r.addDirectives=function(d){var u=new self.URL(d);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},o}(),c=function(){function o(r){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[r.url],this.attrs=r.attrs,this.bitrate=r.bitrate,r.details&&(this.details=r.details),this.id=r.id||0,this.name=r.name,this.width=r.width||0,this.height=r.height||0,this.audioCodec=r.audioCodec,this.videoCodec=r.videoCodec,this.unknownCodecs=r.unknownCodecs,this.codecSet=[r.videoCodec,r.audioCodec].filter(function(s){return s}).join(",").replace(/\.[^.,]+/g,"")}return v(o,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(s){var d=s%this.url.length;this._urlId!==d&&(this.details=void 0,this._urlId=d)}}]),o}()},"./src/types/loader.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"PlaylistContextType",function(){return D}),T.d(g,"PlaylistLevelType",function(){return v});var D;(function(f){f.MANIFEST="manifest",f.LEVEL="level",f.AUDIO_TRACK="audioTrack",f.SUBTITLE_TRACK="subtitleTrack"})(D||(D={}));var v;(function(f){f.MAIN="main",f.AUDIO="audio",f.SUBTITLE="subtitle"})(v||(v={}))},"./src/types/transmuxer.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"ChunkMetadata",function(){return D});var D=function(S,y,c,o,r,s){o===void 0&&(o=0),r===void 0&&(r=-1),s===void 0&&(s=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=v(),this.buffering={audio:v(),video:v(),audiovideo:v()},this.level=S,this.sn=y,this.id=c,this.size=o,this.part=r,this.partial=s};function v(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"AttrList",function(){return f});var D=/^(\d+)x(\d+)$/,v=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,f=function(){function S(c){typeof c=="string"&&(c=S.parseAttrList(c));for(var o in c)c.hasOwnProperty(o)&&(this[o]=c[o])}var y=S.prototype;return y.decimalInteger=function(o){var r=parseInt(this[o],10);return r>Number.MAX_SAFE_INTEGER?Infinity:r},y.hexadecimalInteger=function(o){if(this[o]){var r=(this[o]||"0x").slice(2);r=(r.length&1?"0":"")+r;for(var s=new Uint8Array(r.length/2),d=0;d<r.length/2;d++)s[d]=parseInt(r.slice(d*2,d*2+2),16);return s}else return null},y.hexadecimalIntegerAsNumber=function(o){var r=parseInt(this[o],16);return r>Number.MAX_SAFE_INTEGER?Infinity:r},y.decimalFloatingPoint=function(o){return parseFloat(this[o])},y.optionalFloat=function(o,r){var s=this[o];return s?parseFloat(s):r},y.enumeratedString=function(o){return this[o]},y.bool=function(o){return this[o]==="YES"},y.decimalResolution=function(o){var r=D.exec(this[o]);return r===null?void 0:{width:parseInt(r[1],10),height:parseInt(r[2],10)}},S.parseAttrList=function(o){var r,s={},d='"';for(v.lastIndex=0;(r=v.exec(o))!==null;){var u=r[2];u.indexOf(d)===0&&u.lastIndexOf(d)===u.length-1&&(u=u.slice(1,-1)),s[r[1]]=u}return s},S}()},"./src/utils/binary-search.ts":function(M,g,T){"use strict";T.r(g);var D={search:function(f,S){for(var y=0,c=f.length-1,o=null,r=null;y<=c;){o=(y+c)/2|0,r=f[o];var s=S(r);if(s>0)y=o+1;else if(s<0)c=o-1;else return r}return null}};g.default=D},"./src/utils/buffer-helper.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"BufferHelper",function(){return f});var D=T("./src/utils/logger.ts"),v={length:0,start:function(){return 0},end:function(){return 0}},f=function(){function S(){}return S.isBuffered=function(c,o){try{if(c){for(var r=S.getBuffered(c),s=0;s<r.length;s++)if(o>=r.start(s)&&o<=r.end(s))return!0}}catch(d){}return!1},S.bufferInfo=function(c,o,r){try{if(c){var s=S.getBuffered(c),d=[],u;for(u=0;u<s.length;u++)d.push({start:s.start(u),end:s.end(u)});return this.bufferedInfo(d,o,r)}}catch(p){}return{len:0,start:o,end:o,nextStart:void 0}},S.bufferedInfo=function(c,o,r){o=Math.max(0,o),c.sort(function(h,L){var O=h.start-L.start;return O||L.end-h.end});var s=[];if(r)for(var d=0;d<c.length;d++){var u=s.length;if(u){var p=s[u-1].end;c[d].start-p<r?c[d].end>p&&(s[u-1].end=c[d].end):s.push(c[d])}else s.push(c[d])}else s=c;for(var m=0,i,t=o,a=o,l=0;l<s.length;l++){var E=s[l].start,b=s[l].end;if(o+r>=E&&o<b)t=E,a=b,m=a-o;else if(o+r<E){i=E;break}}return{len:m,start:t||0,end:a||0,nextStart:i}},S.getBuffered=function(c){try{return c.buffered}catch(o){return D.logger.log("failed to get media.buffered",o),v}},S}()},"./src/utils/cea-608-parser.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"Row",function(){return a}),T.d(g,"CaptionScreen",function(){return l});var D=T("./src/utils/logger.ts"),v={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},f=function(C){var x=C;return v.hasOwnProperty(C)&&(x=v[C]),String.fromCharCode(x)},S=15,y=100,c={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},o={17:2,18:4,21:6,22:8,23:10,19:13,20:15},r={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},s={25:2,26:4,29:6,30:8,31:10,27:13,28:15},d=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(w){w[w.ERROR=0]="ERROR",w[w.TEXT=1]="TEXT",w[w.WARNING=2]="WARNING",w[w.INFO=2]="INFO",w[w.DEBUG=3]="DEBUG",w[w.DATA=3]="DATA"})(u||(u={}));var p=function(){function w(){this.time=null,this.verboseLevel=u.ERROR}var C=w.prototype;return C.log=function(_,j){this.verboseLevel>=_&&D.logger.log(this.time+" ["+_+"] "+j)},w}(),m=function(C){for(var x=[],_=0;_<C.length;_++)x.push(C[_].toString(16));return x},i=function(){function w(x,_,j,N,P){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=x||"white",this.underline=_||!1,this.italics=j||!1,this.background=N||"black",this.flash=P||!1}var C=w.prototype;return C.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},C.setStyles=function(_){for(var j=["foreground","underline","italics","background","flash"],N=0;N<j.length;N++){var P=j[N];_.hasOwnProperty(P)&&(this[P]=_[P])}},C.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},C.equals=function(_){return this.foreground===_.foreground&&this.underline===_.underline&&this.italics===_.italics&&this.background===_.background&&this.flash===_.flash},C.copy=function(_){this.foreground=_.foreground,this.underline=_.underline,this.italics=_.italics,this.background=_.background,this.flash=_.flash},C.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},w}(),t=function(){function w(x,_,j,N,P,V){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new i(_,j,N,P,V)}var C=w.prototype;return C.reset=function(){this.uchar=" ",this.penState.reset()},C.setChar=function(_,j){this.uchar=_,this.penState.copy(j)},C.setPenState=function(_){this.penState.copy(_)},C.equals=function(_){return this.uchar===_.uchar&&this.penState.equals(_.penState)},C.copy=function(_){this.uchar=_.uchar,this.penState.copy(_.penState)},C.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},w}(),a=function(){function w(x){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var _=0;_<y;_++)this.chars.push(new t);this.logger=x,this.pos=0,this.currPenState=new i}var C=w.prototype;return C.equals=function(_){for(var j=!0,N=0;N<y;N++)if(!this.chars[N].equals(_.chars[N])){j=!1;break}return j},C.copy=function(_){for(var j=0;j<y;j++)this.chars[j].copy(_.chars[j])},C.isEmpty=function(){for(var _=!0,j=0;j<y;j++)if(!this.chars[j].isEmpty()){_=!1;break}return _},C.setCursor=function(_){this.pos!==_&&(this.pos=_),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>y&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=y)},C.moveCursor=function(_){var j=this.pos+_;if(_>1)for(var N=this.pos+1;N<j+1;N++)this.chars[N].setPenState(this.currPenState);this.setCursor(j)},C.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},C.insertChar=function(_){_>=144&&this.backSpace();var j=f(_);if(this.pos>=y){this.logger.log(u.ERROR,"Cannot insert "+_.toString(16)+" ("+j+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(j,this.currPenState),this.moveCursor(1)},C.clearFromPos=function(_){var j;for(j=_;j<y;j++)this.chars[j].reset()},C.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},C.clearToEndOfRow=function(){this.clearFromPos(this.pos)},C.getTextString=function(){for(var _=[],j=!0,N=0;N<y;N++){var P=this.chars[N].uchar;P!==" "&&(j=!1),_.push(P)}return j?"":_.join("")},C.setPenStyles=function(_){this.currPenState.setStyles(_);var j=this.chars[this.pos];j.setPenState(this.currPenState)},w}(),l=function(){function w(x){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var _=0;_<S;_++)this.rows.push(new a(x));this.logger=x,this.currRow=S-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var C=w.prototype;return C.reset=function(){for(var _=0;_<S;_++)this.rows[_].clear();this.currRow=S-1},C.equals=function(_){for(var j=!0,N=0;N<S;N++)if(!this.rows[N].equals(_.rows[N])){j=!1;break}return j},C.copy=function(_){for(var j=0;j<S;j++)this.rows[j].copy(_.rows[j])},C.isEmpty=function(){for(var _=!0,j=0;j<S;j++)if(!this.rows[j].isEmpty()){_=!1;break}return _},C.backSpace=function(){var _=this.rows[this.currRow];_.backSpace()},C.clearToEndOfRow=function(){var _=this.rows[this.currRow];_.clearToEndOfRow()},C.insertChar=function(_){var j=this.rows[this.currRow];j.insertChar(_)},C.setPen=function(_){var j=this.rows[this.currRow];j.setPenStyles(_)},C.moveCursor=function(_){var j=this.rows[this.currRow];j.moveCursor(_)},C.setCursor=function(_){this.logger.log(u.INFO,"setCursor: "+_);var j=this.rows[this.currRow];j.setCursor(_)},C.setPAC=function(_){this.logger.log(u.INFO,"pacData = "+JSON.stringify(_));var j=_.row-1;if(this.nrRollUpRows&&j<this.nrRollUpRows-1&&(j=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==j){for(var N=0;N<S;N++)this.rows[N].clear();var P=this.currRow+1-this.nrRollUpRows,V=this.lastOutputScreen;if(V){var z=V.rows[P].cueStartTime,B=this.logger.time;if(z&&B!==null&&z<B)for(var K=0;K<this.nrRollUpRows;K++)this.rows[j-this.nrRollUpRows+K+1].copy(V.rows[P+K])}}this.currRow=j;var U=this.rows[this.currRow];if(_.indent!==null){var W=_.indent,H=Math.max(W-1,0);U.setCursor(_.indent),_.color=U.chars[H].penState.foreground}var q={foreground:_.color,underline:_.underline,italics:_.italics,background:"black",flash:!1};this.setPen(q)},C.setBkgData=function(_){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(_)),this.backSpace(),this.setPen(_),this.insertChar(32)},C.setRollUpRows=function(_){this.nrRollUpRows=_},C.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var _=this.currRow+1-this.nrRollUpRows,j=this.rows.splice(_,1)[0];j.clear(),this.rows.splice(this.currRow,0,j),this.logger.log(u.INFO,"Rolling up")},C.getDisplayText=function(_){_=_||!1;for(var j=[],N="",P=-1,V=0;V<S;V++){var z=this.rows[V].getTextString();z&&(P=V+1,_?j.push("Row "+P+": '"+z+"'"):j.push(z.trim()))}return j.length>0&&(_?N="["+j.join(" | ")+"]":N=j.join(`
|
|
|
`)),N},C.getTextAndFormat=function(){return this.rows},w}(),E=function(){function w(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 l(j),this.nonDisplayedMemory=new l(j),this.lastOutputScreen=new l(j),this.currRollUpRow=this.displayedMemory.rows[S-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=j}var C=w.prototype;return C.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[S-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},C.getHandler=function(){return this.outputFilter},C.setHandler=function(_){this.outputFilter=_},C.setPAC=function(_){this.writeScreen.setPAC(_)},C.setBkgData=function(_){this.writeScreen.setBkgData(_)},C.setMode=function(_){if(_===this.mode)return;this.mode=_,this.logger.log(u.INFO,"MODE="+_),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=_},C.insertChars=function(_){for(var j=0;j<_.length;j++)this.writeScreen.insertChar(_[j]);var N=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,N+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},C.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},C.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},C.ccAOF=function(){},C.ccAON=function(){},C.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},C.ccRU=function(_){this.logger.log(u.INFO,"RU("+_+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(_)},C.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},C.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},C.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},C.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},C.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},C.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},C.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},C.ccEOC=function(){if(this.logger.log(u.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(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},C.ccTO=function(_){this.logger.log(u.INFO,"TO("+_+") - Tab Offset"),this.writeScreen.moveCursor(_)},C.ccMIDROW=function(_){var j={flash:!1};if(j.underline=_%2===1,j.italics=_>=46,j.italics)j.foreground="white";else{var N=Math.floor(_/2)-16,P=["white","green","blue","cyan","red","yellow","magenta"];j.foreground=P[N]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(j)),this.writeScreen.setPen(j)},C.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))},C.cueSplitAtTime=function(_){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,_,this.displayedMemory),this.cueStartTime=_))},w}(),b=function(){function w(x,_,j){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var N=new p;this.channels=[null,new E(x,_,N),new E(x+1,j,N)],this.cmdHistory=O(),this.logger=N}var C=w.prototype;return C.getHandler=function(_){return this.channels[_].getHandler()},C.setHandler=function(_,j){this.channels[_].setHandler(j)},C.addData=function(_,j){var N,P,V,z=!1;this.logger.time=_;for(var B=0;B<j.length;B+=2){if(P=j[B]&127,V=j[B+1]&127,P===0&&V===0)continue;if(this.logger.log(u.DATA,"["+m([j[B],j[B+1]])+"] -> ("+m([P,V])+")"),N=this.parseCmd(P,V),N||(N=this.parseMidrow(P,V)),N||(N=this.parsePAC(P,V)),N||(N=this.parseBackgroundAttributes(P,V)),!N&&(z=this.parseChars(P,V),z)){var K=this.currentChannel;if(K&&K>0){var U=this.channels[K];U.insertChars(z)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!N&&!z&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+m([P,V])+" orig: "+m([j[B],j[B+1]]))}},C.parseCmd=function(_,j){var N=this.cmdHistory,P=(_===20||_===28||_===21||_===29)&&j>=32&&j<=47,V=(_===23||_===31)&&j>=33&&j<=35;if(!(P||V))return!1;if(L(_,j,N))return h(null,null,N),this.logger.log(u.DEBUG,"Repeated command ("+m([_,j])+") is dropped"),!0;var z=_===20||_===21||_===23?1:2,B=this.channels[z];return _===20||_===21||_===28||_===29?j===32?B.ccRCL():j===33?B.ccBS():j===34?B.ccAOF():j===35?B.ccAON():j===36?B.ccDER():j===37?B.ccRU(2):j===38?B.ccRU(3):j===39?B.ccRU(4):j===40?B.ccFON():j===41?B.ccRDC():j===42?B.ccTR():j===43?B.ccRTD():j===44?B.ccEDM():j===45?B.ccCR():j===46?B.ccENM():j===47&&B.ccEOC():B.ccTO(j-32),h(_,j,N),this.currentChannel=z,!0},C.parseMidrow=function(_,j){var N=0;if((_===17||_===25)&&j>=32&&j<=47){if(_===17?N=1:N=2,N!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var P=this.channels[N];return P?(P.ccMIDROW(j),this.logger.log(u.DEBUG,"MIDROW ("+m([_,j])+")"),!0):!1}return!1},C.parsePAC=function(_,j){var N,P=this.cmdHistory,V=(_>=17&&_<=23||_>=25&&_<=31)&&j>=64&&j<=127,z=(_===16||_===24)&&j>=64&&j<=95;if(!(V||z))return!1;if(L(_,j,P))return h(null,null,P),!0;var B=_<=23?1:2;j>=64&&j<=95?N=B===1?c[_]:r[_]:N=B===1?o[_]:s[_];var K=this.channels[B];return K?(K.setPAC(this.interpretPAC(N,j)),h(_,j,P),this.currentChannel=B,!0):!1},C.interpretPAC=function(_,j){var N,P={color:null,italics:!1,indent:null,underline:!1,row:_};return j>95?N=j-96:N=j-64,P.underline=(N&1)===1,N<=13?P.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(N/2)]:N<=15?(P.italics=!0,P.color="white"):P.indent=Math.floor((N-16)/2)*4,P},C.parseChars=function(_,j){var N,P=null,V=null;if(_>=25?(N=2,V=_-8):(N=1,V=_),V>=17&&V<=19){var z;V===17?z=j+80:V===18?z=j+112:z=j+144,this.logger.log(u.INFO,"Special char '"+f(z)+"' in channel "+N),P=[z]}else _>=32&&_<=127&&(P=j===0?[_]:[_,j]);if(P){var B=m(P);this.logger.log(u.DEBUG,"Char codes = "+B.join(",")),h(_,j,this.cmdHistory)}return P},C.parseBackgroundAttributes=function(_,j){var N=(_===16||_===24)&&j>=32&&j<=47,P=(_===23||_===31)&&j>=45&&j<=47;if(!(N||P))return!1;var V,z={};_===16||_===24?(V=Math.floor((j-32)/2),z.background=d[V],j%2===1&&(z.background=z.background+"_semi")):j===45?z.background="transparent":(z.foreground="black",j===47&&(z.underline=!0));var B=_<=23?1:2,K=this.channels[B];return K.setBkgData(z),h(_,j,this.cmdHistory),!0},C.reset=function(){for(var _=0;_<Object.keys(this.channels).length;_++){var j=this.channels[_];j&&j.reset()}this.cmdHistory=O()},C.cueSplitAtTime=function(_){for(var j=0;j<this.channels.length;j++){var N=this.channels[j];N&&N.cueSplitAtTime(_)}},w}();function h(w,C,x){x.a=w,x.b=C}function L(w,C,x){return x.a===w&&x.b===C}function O(){return{a:null,b:null}}g.default=b},"./src/utils/codecs.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"isCodecType",function(){return v}),T.d(g,"isCodecSupportedInMp4",function(){return f});var D={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function v(S,y){var c=D[y];return!!c&&c[S.slice(0,4)]===!0}function f(S,y){return MediaSource.isTypeSupported((y||"video")+'/mp4;codecs="'+S+'"')}},"./src/utils/cues.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/utils/vttparser.ts"),v=T("./src/utils/webvtt-parser.ts"),f=T("./src/utils/texttrack-utils.ts"),S=/\s/,y={newCue:function(o,r,s,d){for(var u=[],p,m,i,t,a,l=self.VTTCue||self.TextTrackCue,E=0;E<d.rows.length;E++)if(p=d.rows[E],i=!0,t=0,a="",!p.isEmpty()){for(var b=0;b<p.chars.length;b++)S.test(p.chars[b].uchar)&&i?t++:(a+=p.chars[b].uchar,i=!1);p.cueStartTime=r,r===s&&(s+=1e-4),t>=16?t--:t++;var h=Object(D.fixLineBreaks)(a.trim()),L=Object(v.generateCueId)(r,s,h);(!o||!o.cues||!o.cues.getCueById(L))&&(m=new l(r,s,h),m.id=L,m.line=E+1,m.align="left",m.position=10+Math.min(80,Math.floor(t*8/32)*10),u.push(m))}return o&&u.length&&(u.sort(function(O,w){return O.line==="auto"||w.line==="auto"?0:O.line>8&&w.line>8?w.line-O.line:O.line-w.line}),u.forEach(function(O){return Object(f.addCueToTrack)(o,O)})),u}};g.default=y},"./src/utils/discontinuities.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"findFirstFragWithCC",function(){return S}),T.d(g,"shouldAlignOnDiscontinuities",function(){return y}),T.d(g,"findDiscontinuousReferenceFrag",function(){return c}),T.d(g,"adjustSlidingStart",function(){return r}),T.d(g,"alignStream",function(){return s}),T.d(g,"alignPDT",function(){return u}),T.d(g,"alignFragmentByPDTDelta",function(){return p}),T.d(g,"alignMediaPlaylistByPDT",function(){return m});var D=T("./src/polyfills/number.ts"),v=T("./src/utils/logger.ts"),f=T("./src/controller/level-helper.ts");function S(i,t){for(var a=null,l=0,E=i.length;l<E;l++){var b=i[l];if(b&&b.cc===t){a=b;break}}return a}function y(i,t,a){return!!(t.details&&(a.endCC>a.startCC||i&&i.cc<a.startCC))}function c(i,t){var a=i.fragments,l=t.fragments;if(!l.length||!a.length){v.logger.log("No fragments to align");return}var E=S(a,l[0].cc);if(!E||E&&!E.startPTS){v.logger.log("No frag in previous level to align on");return}return E}function o(i,t){if(i){var a=i.start+t;i.start=i.startPTS=a,i.endPTS=a+i.duration}}function r(i,t){for(var a=t.fragments,l=0,E=a.length;l<E;l++)o(a[l],i);t.fragmentHint&&o(t.fragmentHint,i),t.alignedSliding=!0}function s(i,t,a){if(!t)return;d(i,a,t),!a.alignedSliding&&t.details&&u(a,t.details),!a.alignedSliding&&t.details&&!a.skippedSegments&&Object(f.adjustSliding)(t.details,a)}function d(i,t,a){if(y(i,a,t)){var l=c(a.details,t);l&&Object(D.isFiniteNumber)(l.start)&&(v.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),r(l.start,t))}}function u(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var a=t.fragments[0].programDateTime,l=i.fragments[0].programDateTime,E=(l-a)/1e3+t.fragments[0].start;E&&Object(D.isFiniteNumber)(E)&&(v.logger.log("Adjusting PTS using programDateTime delta "+(l-a)+"ms, sliding:"+E.toFixed(3)+" "+i.url+" "),r(E,i))}function p(i,t){var a=i.programDateTime;if(!a)return;var l=(a-t)/1e3;i.start=i.startPTS=l,i.endPTS=l+i.duration}function m(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var a=t.fragments[0].programDateTime,l=t.fragments[0].start,E=a-l*1e3;i.fragments.forEach(function(b){p(b,E)}),i.fragmentHint&&p(i.fragmentHint,E),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/utils/ewma.ts"),v=function(){function f(y,c,o){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=o,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new D.default(y),this.fast_=new D.default(c)}var S=f.prototype;return S.update=function(c,o){var r=this.slow_,s=this.fast_;this.slow_.halfLife!==c&&(this.slow_=new D.default(c,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==o&&(this.fast_=new D.default(o,s.getEstimate(),s.getTotalWeight()))},S.sample=function(c,o){c=Math.max(c,this.minDelayMs_);var r=8*o,s=c/1e3,d=r/s;this.fast_.sample(s,d),this.slow_.sample(s,d)},S.canEstimate=function(){var c=this.fast_;return c&&c.getTotalWeight()>=this.minWeight_},S.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},S.destroy=function(){},f}();g.default=v},"./src/utils/ewma.ts":function(M,g,T){"use strict";T.r(g);var D=function(){function v(S,y,c){y===void 0&&(y=0),c===void 0&&(c=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=S,this.alpha_=S?Math.exp(Math.log(.5)/S):0,this.estimate_=y,this.totalWeight_=c}var f=v.prototype;return f.sample=function(y,c){var o=Math.pow(this.alpha_,y);this.estimate_=c*(1-o)+o*this.estimate_,this.totalWeight_+=y},f.getTotalWeight=function(){return this.totalWeight_},f.getEstimate=function(){if(this.alpha_){var y=1-Math.pow(this.alpha_,this.totalWeight_);if(y)return this.estimate_/y}return this.estimate_},v}();g.default=D},"./src/utils/fetch-loader.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"fetchSupported",function(){return p});var D=T("./src/polyfills/number.ts"),v=T("./src/loader/load-stats.ts"),f=T("./src/demux/chunk-cache.ts");function S(l,E){l.prototype=Object.create(E.prototype),l.prototype.constructor=l,s(l,E)}function y(l){var E=typeof Map=="function"?new Map:void 0;return y=function(h){if(h===null||!r(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof E!="undefined"){if(E.has(h))return E.get(h);E.set(h,L)}function L(){return c(h,arguments,d(this).constructor)}return L.prototype=Object.create(h.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),s(L,h)},y(l)}function c(l,E,b){return o()?c=Reflect.construct:c=function(L,O,w){var C=[null];C.push.apply(C,O);var x=Function.bind.apply(L,C),_=new x;return w&&s(_,w.prototype),_},c.apply(null,arguments)}function o(){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 r(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function s(l,E){return s=Object.setPrototypeOf||function(h,L){return h.__proto__=L,h},s(l,E)}function d(l){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(b){return b.__proto__||Object.getPrototypeOf(b)},d(l)}function u(){return u=Object.assign||function(l){for(var E=1;E<arguments.length;E++){var b=arguments[E];for(var h in b)Object.prototype.hasOwnProperty.call(b,h)&&(l[h]=b[h])}return l},u.apply(this,arguments)}function p(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(l){}return!1}var m=function(){function l(b){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=b.fetchSetup||t,this.controller=new self.AbortController,this.stats=new v.LoadStats}var E=l.prototype;return E.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},E.abortInternal=function(){var h=this.response;(!h||!h.ok)&&(this.stats.aborted=!0,this.controller.abort())},E.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},E.load=function(h,L,O){var w=this,C=this.stats;if(C.loading.start)throw new Error("Loader can only be used once.");C.loading.start=self.performance.now();var x=i(h,this.controller.signal),_=O.onProgress,j=h.responseType==="arraybuffer",N=j?"byteLength":"length";this.context=h,this.config=L,this.callbacks=O,this.request=this.fetchSetup(h,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){w.abortInternal(),O.onTimeout(C,h,w.response)},L.timeout),self.fetch(this.request).then(function(P){if(w.response=w.loader=P,!P.ok){var V=P.status,z=P.statusText;throw new a(z||"fetch, bad network response",V,P)}return C.loading.first=Math.max(self.performance.now(),C.loading.start),C.total=parseInt(P.headers.get("Content-Length")||"0"),_&&Object(D.isFiniteNumber)(L.highWaterMark)?w.loadProgressively(P,C,h,L.highWaterMark,_):j?P.arrayBuffer():P.text()}).then(function(P){var V=w.response;self.clearTimeout(w.requestTimeout),C.loading.end=Math.max(self.performance.now(),C.loading.first),C.loaded=C.total=P[N];var z={url:V.url,data:P};_&&!Object(D.isFiniteNumber)(L.highWaterMark)&&_(C,h,P,V),O.onSuccess(z,C,h,V)}).catch(function(P){if(self.clearTimeout(w.requestTimeout),C.aborted)return;var V=P.code||0;O.onError({code:V,text:P.message},h,P.details)})},E.getCacheAge=function(){var h=null;if(this.response){var L=this.response.headers.get("age");h=L?parseFloat(L):null}return h},E.loadProgressively=function(h,L,O,w,C){w===void 0&&(w=0);var x=new f.default,_=h.body.getReader(),j=function N(){return _.read().then(function(P){if(P.done)return x.dataLength&&C(L,O,x.flush(),h),Promise.resolve(new ArrayBuffer(0));var V=P.value,z=V.length;return L.loaded+=z,z<w||x.dataLength?(x.push(V),x.dataLength>=w&&C(L,O,x.flush(),h)):C(L,O,V,h),N()}).catch(function(){return Promise.reject()})};return j()},l}();function i(l,E){var b={method:"GET",mode:"cors",credentials:"same-origin",signal:E,headers:new self.Headers(u({},l.headers))};return l.rangeEnd&&b.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),b}function t(l,E){return new self.Request(l.url,E)}var a=function(l){S(E,l);function E(b,h,L){var O;return O=l.call(this,b)||this,O.code=void 0,O.details=void 0,O.code=h,O.details=L,O}return E}(y(Error));g.default=m},"./src/utils/imsc1-ttml-parser.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"IMSC1_CODEC",function(){return r}),T.d(g,"parseIMSC1",function(){return p});var D=T("./src/utils/mp4-tools.ts"),v=T("./src/utils/vttparser.ts"),f=T("./src/utils/vttcue.ts"),S=T("./src/demux/id3.ts"),y=T("./src/utils/timescale-conversion.ts"),c=T("./src/utils/webvtt-parser.ts");function o(){return o=Object.assign||function(w){for(var C=1;C<arguments.length;C++){var x=arguments[C];for(var _ in x)Object.prototype.hasOwnProperty.call(x,_)&&(w[_]=x[_])}return w},o.apply(this,arguments)}var r="stpp.ttml.im1t",s=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(w,C,x,_,j){var N=Object(D.findBox)(new Uint8Array(w),["mdat"]);if(N.length===0){j(new Error("Could not parse IMSC1 mdat"));return}var P=N[0],V=Object(S.utf8ArrayToStr)(new Uint8Array(w,P.start,P.end-P.start)),z=Object(y.toTimescaleFromScale)(C,1,x);try{_(m(V,z))}catch(B){j(B)}}function m(w,C){var x=new DOMParser,_=x.parseFromString(w,"text/xml"),j=_.getElementsByTagName("tt")[0];if(!j)throw new Error("Invalid ttml");var N={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},P=Object.keys(N).reduce(function(U,W){return U[W]=j.getAttribute("ttp:"+W)||N[W],U},{}),V=j.getAttribute("xml:space")!=="preserve",z=t(i(j,"styling","style")),B=t(i(j,"layout","region")),K=i(j,"body","[begin]");return[].map.call(K,function(U){var W=a(U,V);if(!W||!U.hasAttribute("begin"))return null;var H=h(U.getAttribute("begin"),P),q=h(U.getAttribute("dur"),P),ne=h(U.getAttribute("end"),P);if(H===null)throw b(U);if(ne===null){if(q===null)throw b(U);ne=H+q}var te=new f.default(H-C,ne-C,W);te.id=Object(c.generateCueId)(te.startTime,te.endTime,te.text);var _e=B[U.getAttribute("region")],Ce=z[U.getAttribute("style")];te.position=10,te.size=80;var me=l(_e,Ce),Me=me.textAlign;if(Me){var Oe=u[Me];Oe&&(te.lineAlign=Oe),te.align=Me}return o(te,me),te}).filter(function(U){return U!==null})}function i(w,C,x){var _=w.getElementsByTagName(C)[0];return _?[].slice.call(_.querySelectorAll(x)):[]}function t(w){return w.reduce(function(C,x){var _=x.getAttribute("xml:id");return _&&(C[_]=x),C},{})}function a(w,C){return[].slice.call(w.childNodes).reduce(function(x,_,j){var N;return _.nodeName==="br"&&j?x+`
|
|
|
`:(N=_.childNodes)!==null&&N!==void 0&&N.length?a(_,C):C?x+_.textContent.trim().replace(/\s+/g," "):x+_.textContent},"")}function l(w,C){var x="http://www.w3.org/ns/ttml#styling",_=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return _.reduce(function(j,N){var P=E(C,x,N)||E(w,x,N);return P&&(j[N]=P),j},{})}function E(w,C,x){return w.hasAttributeNS(C,x)?w.getAttributeNS(C,x):null}function b(w){return new Error("Could not parse ttml timestamp "+w)}function h(w,C){if(!w)return null;var x=Object(v.parseTimeStamp)(w);return x===null&&(s.test(w)?x=L(w,C):d.test(w)&&(x=O(w,C))),x}function L(w,C){var x=s.exec(w),_=(x[4]|0)+(x[5]|0)/C.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+_/C.frameRate}function O(w,C){var x=d.exec(w),_=Number(x[1]),j=x[2];switch(j){case"h":return _*3600;case"m":return _*60;case"ms":return _*1e3;case"f":return _/C.frameRate;case"t":return _/C.tickRate}return _}},"./src/utils/logger.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"enableLogs",function(){return c}),T.d(g,"logger",function(){return o});var D=function(){},v={trace:D,debug:D,log:D,warn:D,info:D,error:D},f=v;function S(r){var s=self.console[r];return s?s.bind(self.console,"["+r+"] >"):D}function y(r){for(var s=arguments.length,d=new Array(s>1?s-1:0),u=1;u<s;u++)d[u-1]=arguments[u];d.forEach(function(p){f[p]=r[p]?r[p].bind(r):S(p)})}function c(r){if(self.console&&r===!0||typeof r=="object"){y(r,"debug","log","info","warn","error");try{f.log()}catch(s){f=v}}else f=v}var o=f},"./src/utils/mediakeys-helper.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"KeySystems",function(){return D}),T.d(g,"requestMediaKeySystemAccess",function(){return v});var D;(function(f){f.WIDEVINE="com.widevine.alpha",f.PLAYREADY="com.microsoft.playready"})(D||(D={}));var v=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"getMediaSource",function(){return D});function D(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"bin2str",function(){return y}),T.d(g,"readUint16",function(){return c}),T.d(g,"readUint32",function(){return o}),T.d(g,"writeUint32",function(){return r}),T.d(g,"findBox",function(){return s}),T.d(g,"parseSegmentIndex",function(){return d}),T.d(g,"parseInitSegment",function(){return u}),T.d(g,"getStartDTS",function(){return p}),T.d(g,"getDuration",function(){return m}),T.d(g,"computeRawDurationFromSamples",function(){return i}),T.d(g,"offsetStartDTS",function(){return t}),T.d(g,"segmentValidRange",function(){return a}),T.d(g,"appendUint8Array",function(){return l});var D=T("./src/utils/typed-array.ts"),v=T("./src/loader/fragment.ts"),f=Math.pow(2,32)-1,S=[].push;function y(E){return String.fromCharCode.apply(null,E)}function c(E,b){"data"in E&&(b+=E.start,E=E.data);var h=E[b]<<8|E[b+1];return h<0?65536+h:h}function o(E,b){"data"in E&&(b+=E.start,E=E.data);var h=E[b]<<24|E[b+1]<<16|E[b+2]<<8|E[b+3];return h<0?4294967296+h:h}function r(E,b,h){"data"in E&&(b+=E.start,E=E.data),E[b]=h>>24,E[b+1]=h>>16&255,E[b+2]=h>>8&255,E[b+3]=h&255}function s(E,b){var h=[];if(!b.length)return h;var L,O,w;"data"in E?(L=E.data,O=E.start,w=E.end):(L=E,O=0,w=L.byteLength);for(var C=O;C<w;){var x=o(L,C),_=y(L.subarray(C+4,C+8)),j=x>1?C+x:w;if(_===b[0])if(b.length===1)h.push({data:L,start:C+8,end:j});else{var N=s({data:L,start:C+8,end:j},b.slice(1));N.length&&S.apply(h,N)}C=j}return h}function d(E){var b=s(E,["moov"]),h=b[0],L=h?h.end:null,O=s(E,["sidx"]);if(!O||!O[0])return null;var w=[],C=O[0],x=C.data[0],_=x===0?8:16,j=o(C,_);_+=4;var N=0,P=0;x===0?_+=8:_+=16,_+=2;var V=C.end+P,z=c(C,_);_+=2;for(var B=0;B<z;B++){var K=_,U=o(C,K);K+=4;var W=U&2147483647,H=(U&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var q=o(C,K);K+=4,w.push({referenceSize:W,subsegmentDuration:q,info:{duration:q/j,start:V,end:V+W-1}}),V+=W,K+=4,_=K}return{earliestPresentationTime:N,timescale:j,version:x,referencesCount:z,references:w,moovEndOffset:L}}function u(E){for(var b=[],h=s(E,["moov","trak"]),L=0;L<h.length;L++){var O=h[L],w=s(O,["tkhd"])[0];if(w){var C=w.data[w.start],x=C===0?12:20,_=o(w,x),j=s(O,["mdia","mdhd"])[0];if(j){C=j.data[j.start],x=C===0?12:20;var N=o(j,x),P=s(O,["mdia","hdlr"])[0];if(P){var V=y(P.data.subarray(P.start+8,P.start+12)),z={soun:v.ElementaryStreamTypes.AUDIO,vide:v.ElementaryStreamTypes.VIDEO}[V];if(z){var B=s(O,["mdia","minf","stbl","stsd"])[0],K=void 0;B&&(K=y(B.data.subarray(B.start+12,B.start+16))),b[_]={timescale:N,type:z},b[z]={timescale:N,id:_,codec:K}}}}}}var U=s(E,["moov","mvex","trex"]);return U.forEach(function(W){var H=o(W,4),q=b[H];q&&(q.default={duration:o(W,12),flags:o(W,20)})}),b}function p(E,b){return s(b,["moof","traf"]).reduce(function(h,L){var O=s(L,["tfdt"])[0],w=O.data[O.start],C=s(L,["tfhd"]).reduce(function(x,_){var j=o(_,4),N=E[j];if(N){var P=o(O,4);w===1&&(P*=Math.pow(2,32),P+=o(O,8));var V=N.timescale||9e4,z=P/V;if(isFinite(z)&&(x===null||z<x))return z}return x},null);return C!==null&&isFinite(C)&&(h===null||C<h)?C:h},null)||0}function m(E,b){for(var h=0,L=0,O=0,w=s(E,["moof","traf"]),C=0;C<w.length;C++){var x=w[C],_=s(x,["tfhd"])[0],j=o(_,4),N=b[j];if(!N)continue;var P=N.default,V=o(_,0)|(P==null?void 0:P.flags),z=P==null?void 0:P.duration;V&8&&(V&2?z=o(_,12):z=o(_,8));for(var B=N.timescale||9e4,K=s(x,["trun"]),U=0;U<K.length;U++){if(z){var W=o(K[U],4);h=z*W}else h=i(K[U]);N.type===v.ElementaryStreamTypes.VIDEO?L+=h/B:N.type===v.ElementaryStreamTypes.AUDIO&&(O+=h/B)}}if(L===0&&O===0){var H=d(E);if(H!=null&&H.references)return H.references.reduce(function(q,ne){return q+ne.info.duration||0},0)}return L||O}function i(E){var b=o(E,0),h=8;b&1&&(h+=4),b&4&&(h+=4);for(var L=0,O=o(E,4),w=0;w<O;w++){if(b&256){var C=o(E,h);L+=C,h+=4}b&512&&(h+=4),b&1024&&(h+=4),b&2048&&(h+=4)}return L}function t(E,b,h){s(b,["moof","traf"]).forEach(function(L){s(L,["tfhd"]).forEach(function(O){var w=o(O,4),C=E[w];if(!C)return;var x=C.timescale||9e4;s(L,["tfdt"]).forEach(function(_){var j=_.data[_.start],N=o(_,4);if(j===0)r(_,4,N-h*x);else{N*=Math.pow(2,32),N+=o(_,8),N-=h*x,N=Math.max(N,0);var P=Math.floor(N/(f+1)),V=Math.floor(N%(f+1));r(_,4,P),r(_,8,V)}})})})}function a(E){var b={valid:null,remainder:null},h=s(E,["moof"]);if(h){if(h.length<2)return b.remainder=E,b}else return b;var L=h[h.length-1];return b.valid=Object(D.sliceUint8)(E,0,L.start-8),b.remainder=Object(D.sliceUint8)(E,L.start-8),b}function l(E,b){var h=new Uint8Array(E.length+b.length);return h.set(E),h.set(b,E.length),h}},"./src/utils/output-filter.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"default",function(){return D});var D=function(){function v(S,y){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=S,this.trackName=y}var f=v.prototype;return f.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},f.newCue=function(y,c,o){(this.startTime===null||this.startTime>y)&&(this.startTime=y),this.endTime=c,this.screen=o,this.timelineController.createCaptionsTrack(this.trackName)},f.reset=function(){this.cueRanges=[]},v}()},"./src/utils/texttrack-utils.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"sendAddTrackEvent",function(){return v}),T.d(g,"addCueToTrack",function(){return f}),T.d(g,"clearCurrentCues",function(){return S}),T.d(g,"removeCuesInRange",function(){return y}),T.d(g,"getCuesInRange",function(){return o});var D=T("./src/utils/logger.ts");function v(r,s){var d;try{d=new Event("addtrack")}catch(u){d=document.createEvent("Event"),d.initEvent("addtrack",!1,!1)}d.track=r,s.dispatchEvent(d)}function f(r,s){var d=r.mode;if(d==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(s.id))try{if(r.addCue(s),!r.cues.getCueById(s.id))throw new Error("addCue is failed for: "+s)}catch(p){D.logger.debug("[texttrack-utils]: "+p);var u=new self.TextTrackCue(s.startTime,s.endTime,s.text);u.id=s.id,r.addCue(u)}d==="disabled"&&(r.mode=d)}function S(r){var s=r.mode;if(s==="disabled"&&(r.mode="hidden"),r.cues)for(var d=r.cues.length;d--;)r.removeCue(r.cues[d]);s==="disabled"&&(r.mode=s)}function y(r,s,d){var u=r.mode;if(u==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0)for(var p=o(r.cues,s,d),m=0;m<p.length;m++)r.removeCue(p[m]);u==="disabled"&&(r.mode=u)}function c(r,s){if(s<r[0].startTime)return 0;var d=r.length-1;if(s>r[d].endTime)return-1;for(var u=0,p=d;u<=p;){var m=Math.floor((p+u)/2);if(s<r[m].startTime)p=m-1;else if(s>r[m].startTime&&u<d)u=m+1;else return m}return r[u].startTime-s<s-r[p].startTime?u:p}function o(r,s,d){var u=[],p=c(r,s);if(p>-1)for(var m=p,i=r.length;m<i;m++){var t=r[m];if(t.startTime>=s&&t.endTime<=d)u.push(t);else if(t.startTime>d)return u}return u}},"./src/utils/time-ranges.ts":function(M,g,T){"use strict";T.r(g);var D={toString:function(f){for(var S="",y=f.length,c=0;c<y;c++)S+="["+f.start(c).toFixed(3)+","+f.end(c).toFixed(3)+"]";return S}};g.default=D},"./src/utils/timescale-conversion.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"toTimescaleFromBase",function(){return v}),T.d(g,"toTimescaleFromScale",function(){return f}),T.d(g,"toMsFromMpegTsClock",function(){return S}),T.d(g,"toMpegTsClockFromTimescale",function(){return y});var D=9e4;function v(c,o,r,s){r===void 0&&(r=1),s===void 0&&(s=!1);var d=c*o*r;return s?Math.round(d):d}function f(c,o,r,s){return r===void 0&&(r=1),s===void 0&&(s=!1),v(c,o,1/r,s)}function S(c,o){return o===void 0&&(o=!1),v(c,1e3,1/D,o)}function y(c,o){return o===void 0&&(o=1),v(c,D,1/o)}},"./src/utils/typed-array.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"sliceUint8",function(){return D});function D(v,f,S){return Uint8Array.prototype.slice?v.slice(f,S):new Uint8Array(Array.prototype.slice.call(v,f,S))}},"./src/utils/vttcue.ts":function(M,g,T){"use strict";T.r(g),g.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var D=["","lr","rl"],v=["start","middle","end","left","right"];function f(r,s){if(typeof s!="string")return!1;if(!Array.isArray(r))return!1;var d=s.toLowerCase();return~r.indexOf(d)?d:!1}function S(r){return f(D,r)}function y(r){return f(v,r)}function c(r){for(var s=arguments.length,d=new Array(s>1?s-1:0),u=1;u<s;u++)d[u-1]=arguments[u];for(var p=1;p<arguments.length;p++){var m=arguments[p];for(var i in m)r[i]=m[i]}return r}function o(r,s,d){var u=this,p={enumerable:!0};u.hasBeenReset=!1;var m="",i=!1,t=r,a=s,l=d,E=null,b="",h=!0,L="auto",O="start",w=50,C="middle",x=50,_="middle";Object.defineProperty(u,"id",c({},p,{get:function(){return m},set:function(N){m=""+N}})),Object.defineProperty(u,"pauseOnExit",c({},p,{get:function(){return i},set:function(N){i=!!N}})),Object.defineProperty(u,"startTime",c({},p,{get:function(){return t},set:function(N){if(typeof N!="number")throw new TypeError("Start time must be set to a number.");t=N,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",c({},p,{get:function(){return a},set:function(N){if(typeof N!="number")throw new TypeError("End time must be set to a number.");a=N,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",c({},p,{get:function(){return l},set:function(N){l=""+N,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",c({},p,{get:function(){return E},set:function(N){E=N,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",c({},p,{get:function(){return b},set:function(N){var P=S(N);if(P===!1)throw new SyntaxError("An invalid or illegal string was specified.");b=P,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",c({},p,{get:function(){return h},set:function(N){h=!!N,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",c({},p,{get:function(){return L},set:function(N){if(typeof N!="number"&&N!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=N,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",c({},p,{get:function(){return O},set:function(N){var P=y(N);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");O=P,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",c({},p,{get:function(){return w},set:function(N){if(N<0||N>100)throw new Error("Position must be between 0 and 100.");w=N,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",c({},p,{get:function(){return C},set:function(N){var P=y(N);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");C=P,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",c({},p,{get:function(){return x},set:function(N){if(N<0||N>100)throw new Error("Size must be between 0 and 100.");x=N,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",c({},p,{get:function(){return _},set:function(N){var P=y(N);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");_=P,this.hasBeenReset=!0}})),u.displayState=void 0}return o.prototype.getCueAsHTML=function(){var r=self.WebVTT;return r.convertCueToDOMTree(self,this.text)},o}()},"./src/utils/vttparser.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"parseTimeStamp",function(){return f}),T.d(g,"fixLineBreaks",function(){return s}),T.d(g,"VTTParser",function(){return d});var D=T("./src/utils/vttcue.ts"),v=function(){function u(){}var p=u.prototype;return p.decode=function(i,t){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},u}();function f(u){function p(i,t,a,l){return(i|0)*3600+(t|0)*60+(a|0)+parseFloat(l||0)}var m=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return m?parseFloat(m[2])>59?p(m[2],m[3],0,m[4]):p(m[1],m[2],m[3],m[4]):null}var S=function(){function u(){this.values=Object.create(null)}var p=u.prototype;return p.set=function(i,t){!this.get(i)&&t!==""&&(this.values[i]=t)},p.get=function(i,t,a){return a?this.has(i)?this.values[i]:t[a]:this.has(i)?this.values[i]:t},p.has=function(i){return i in this.values},p.alt=function(i,t,a){for(var l=0;l<a.length;++l)if(t===a[l]){this.set(i,t);break}},p.integer=function(i,t){/^-?\d+$/.test(t)&&this.set(i,parseInt(t,10))},p.percent=function(i,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var a=parseFloat(t);if(a>=0&&a<=100)return this.set(i,a),!0}return!1},u}();function y(u,p,m,i){var t=i?u.split(i):[u];for(var a in t){if(typeof t[a]!="string")continue;var l=t[a].split(m);if(l.length!==2)continue;var E=l[0],b=l[1];p(E,b)}}var c=new D.default(0,0,""),o=c.align==="middle"?"middle":"center";function r(u,p,m){var i=u;function t(){var E=f(u);if(E===null)throw new Error("Malformed timestamp: "+i);return u=u.replace(/^[^\sa-zA-Z-]+/,""),E}function a(E,b){var h=new S;y(E,function(w,C){var x;switch(w){case"region":for(var _=m.length-1;_>=0;_--)if(m[_].id===C){h.set(w,m[_].region);break}break;case"vertical":h.alt(w,C,["rl","lr"]);break;case"line":x=C.split(","),h.integer(w,x[0]),h.percent(w,x[0])&&h.set("snapToLines",!1),h.alt(w,x[0],["auto"]),x.length===2&&h.alt("lineAlign",x[1],["start",o,"end"]);break;case"position":x=C.split(","),h.percent(w,x[0]),x.length===2&&h.alt("positionAlign",x[1],["start",o,"end","line-left","line-right","auto"]);break;case"size":h.percent(w,C);break;case"align":h.alt(w,C,["start",o,"end","left","right"]);break}},/:/,/\s/),b.region=h.get("region",null),b.vertical=h.get("vertical","");var L=h.get("line","auto");L==="auto"&&c.line===-1&&(L=-1),b.line=L,b.lineAlign=h.get("lineAlign","start"),b.snapToLines=h.get("snapToLines",!0),b.size=h.get("size",100),b.align=h.get("align",o);var O=h.get("position","auto");O==="auto"&&c.position===50&&(O=b.align==="start"||b.align==="left"?0:b.align==="end"||b.align==="right"?100:50),b.position=O}function l(){u=u.replace(/^\s+/,"")}if(l(),p.startTime=t(),l(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);u=u.substr(3),l(),p.endTime=t(),l(),a(u,p)}function s(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var d=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new v,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var p=u.prototype;return p.parse=function(i){var t=this;i&&(t.buffer+=t.decoder.decode(i,{stream:!0}));function a(){var O=t.buffer,w=0;for(O=s(O);w<O.length&&O[w]!=="\r"&&O[w]!==`
|
|
|
`;)++w;var C=O.substr(0,w);return O[w]==="\r"&&++w,O[w]===`
|
|
|
`&&++w,t.buffer=O.substr(w),C}function l(O){y(O,function(w,C){},/:/)}try{var E="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;E=a();var b=E.match(/^()?WEBVTT([ \t].*)?$/);if(!b||!b[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var h=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;h?h=!1:E=a();switch(t.state){case"HEADER":/:/.test(E)?l(E):E||(t.state="ID");continue;case"NOTE":E||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(E)){t.state="NOTE";break}if(!E)continue;if(t.cue=new D.default(0,0,""),t.state="CUE",E.indexOf("-->")===-1){t.cue.id=E;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{r(E,t.cue,t.regionList)}catch(O){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var L=E.indexOf("-->")!==-1;if(!E||L&&(h=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
|
`),t.cue.text+=E}continue;case"BADCUE":E||(t.state="ID")}}}catch(O){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},p.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
|
|
|
|
|
|
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){i.onparsingerror&&i.onparsingerror(t)}return i.onflush&&i.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(M,g,T){"use strict";T.r(g),T.d(g,"generateCueId",function(){return d}),T.d(g,"parseWebVTT",function(){return p});var D=T("./src/polyfills/number.ts"),v=T("./src/utils/vttparser.ts"),f=T("./src/demux/id3.ts"),S=T("./src/utils/timescale-conversion.ts"),y=T("./src/remux/mp4-remuxer.ts"),c=/\r\n|\n\r|\n|\r/g,o=function(i,t,a){return a===void 0&&(a=0),i.substr(a,t.length)===t},r=function(i){var t=parseInt(i.substr(-3)),a=parseInt(i.substr(-6,2)),l=parseInt(i.substr(-9,2)),E=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(D.isFiniteNumber)(t)||!Object(D.isFiniteNumber)(a)||!Object(D.isFiniteNumber)(l)||!Object(D.isFiniteNumber)(E))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return t+=1e3*a,t+=60*1e3*l,t+=60*60*1e3*E,t},s=function(i){for(var t=5381,a=i.length;a;)t=t*33^i.charCodeAt(--a);return(t>>>0).toString()};function d(m,i,t){return s(m.toString())+s(i.toString())+s(t)}var u=function(i,t,a){var l=i[t],E=i[l.prevCC];if(!E||!E.new&&l.new){i.ccOffset=i.presentationOffset=l.start,l.new=!1;return}for(;(b=E)!==null&&b!==void 0&&b.new;){var b;i.ccOffset+=l.start-E.start,l.new=!1,l=E,E=i[l.prevCC]}i.presentationOffset=a};function p(m,i,t,a,l,E,b,h){var L=new v.VTTParser,O=Object(f.utf8ArrayToStr)(new Uint8Array(m)).trim().replace(c,`
|
|
|
`).split(`
|
|
|
`),w=[],C=Object(S.toMpegTsClockFromTimescale)(i,t),x="00:00.000",_=0,j=0,N,P=!0,V=!1;L.oncue=function(z){var B=a[l],K=a.ccOffset,U=(_-C)/9e4;if(B!=null&&B.new&&(j!==void 0?K=a.ccOffset=B.start:u(a,l,U)),U&&(K=U-a.presentationOffset),V){var W=z.endTime-z.startTime,H=Object(y.normalizePts)((z.startTime+K-j)*9e4,E*9e4)/9e4;z.startTime=H,z.endTime=H+W}var q=z.text.trim();z.text=decodeURIComponent(encodeURIComponent(q)),z.id||(z.id=d(z.startTime,z.endTime,q)),z.endTime>0&&w.push(z)},L.onparsingerror=function(z){N=z},L.onflush=function(){if(N){h(N);return}b(w)},O.forEach(function(z){if(P)if(o(z,"X-TIMESTAMP-MAP=")){P=!1,V=!0,z.substr(16).split(",").forEach(function(B){o(B,"LOCAL:")?x=B.substr(6):o(B,"MPEGTS:")&&(_=parseInt(B.substr(7)))});try{j=r(x)/1e3}catch(B){V=!1,N=B}return}else z===""&&(P=!1);L.parse(z+`
|
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(M,g,T){"use strict";T.r(g);var D=T("./src/utils/logger.ts"),v=T("./src/loader/load-stats.ts"),f=/^age:\s*[\d.]+\s*$/m,S=function(){function y(o){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=o?o.xhrSetup:null,this.stats=new v.LoadStats,this.retryDelay=0}var c=y.prototype;return c.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},c.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()))},c.abort=function(){var r;this.abortInternal(),(r=this.callbacks)!==null&&r!==void 0&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},c.load=function(r,s,d){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=s,this.callbacks=d,this.retryDelay=s.retryDelay,this.loadInternal()},c.loadInternal=function(){var r=this.config,s=this.context;if(!r)return;var d=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var p=this.xhrSetup;try{if(p)try{p(d,s.url)}catch(t){d.open("GET",s.url,!0),p(d,s.url)}d.readyState||d.open("GET",s.url,!0);var m=this.context.headers;if(m)for(var i in m)d.setRequestHeader(i,m[i])}catch(t){this.callbacks.onError({code:d.status,text:t.message},s,d);return}s.rangeEnd&&d.setRequestHeader("Range","bytes="+s.rangeStart+"-"+(s.rangeEnd-1)),d.onreadystatechange=this.readystatechange.bind(this),d.onprogress=this.loadprogress.bind(this),d.responseType=s.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),d.send()},c.readystatechange=function(){var r=this.context,s=this.loader,d=this.stats;if(!r||!s)return;var u=s.readyState,p=this.config;if(d.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),d.loading.first===0&&(d.loading.first=Math.max(self.performance.now(),d.loading.start)),u===4){s.onreadystatechange=null,s.onprogress=null;var m=s.status;if(m>=200&&m<300){d.loading.end=Math.max(self.performance.now(),d.loading.first);var i,t;if(r.responseType==="arraybuffer"?(i=s.response,t=i.byteLength):(i=s.responseText,t=i.length),d.loaded=d.total=t,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(d,r,i,s),!this.callbacks)return;var l={url:s.responseURL,data:i};this.callbacks.onSuccess(l,d,r,s)}else d.retry>=p.maxRetry||m>=400&&m<499?(D.logger.error(m+" while loading "+r.url),this.callbacks.onError({code:m,text:s.statusText},r,s)):(D.logger.warn(m+" 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,p.maxRetryDelay),d.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout)},c.loadtimeout=function(){D.logger.warn("timeout while loading "+this.context.url);var r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))},c.loadprogress=function(r){var s=this.stats;s.loaded=r.loaded,r.lengthComputable&&(s.total=r.total)},c.getCacheAge=function(){var r=null;if(this.loader&&f.test(this.loader.getAllResponseHeaders())){var s=this.loader.getResponseHeader("age");r=s?parseFloat(s):null}return r},y}();g.default=S}}).default})},vHTk:function(I,$,R){I.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},w7YG:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("ETIr"),R("cv67"),R("K3mO"),R("OLod"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.StreamCipher,v=g.algo,f=v.RC4=D.extend({_doReset:function(){for(var c=this._key,o=c.words,r=c.sigBytes,s=this._S=[],d=0;d<256;d++)s[d]=d;for(var d=0,u=0;d<256;d++){var p=d%r,m=o[p>>>2]>>>24-p%4*8&255;u=(u+s[d]+m)%256;var i=s[d];s[d]=s[u],s[u]=i}this._i=this._j=0},_doProcessBlock:function(c,o){c[o]^=S.call(this)},keySize:256/32,ivSize:0});function S(){for(var c=this._S,o=this._i,r=this._j,s=0,d=0;d<4;d++){o=(o+1)%256,r=(r+c[o])%256;var u=c[o];c[o]=c[r],c[r]=u,s|=c[(c[o]+c[r])%256]<<24-d*8}return this._i=o,this._j=r,s}g.RC4=D._createHelper(f);var y=v.RC4Drop=f.extend({cfg:f.cfg.extend({drop:192}),_doReset:function(){f._doReset.call(this);for(var c=this.cfg.drop;c>0;c--)S.call(this)}});g.RC4Drop=D._createHelper(y)}(),M.RC4})},wCXF:function(I,$,R){"use strict";R.d($,"a",function(){return rt});var M=R("rePB"),g=R("VTBJ"),T=R("KQm4"),D=R("U8pU"),v=R("ODXe"),f=R("q1tI"),S=R("TSYQ"),y=R.n(S),c=R("Gytx"),o=R.n(c),r=R("Kwbf"),s=R("t23M"),d=R("qx4F"),u=R("6eGT"),p=R("IBYe"),m=R("Ff2n"),i=R("c+Xe"),t=R("fyJ8"),a=R("biw7");function l(Fe,Ae,qe,ut,$e){var nt=qe[Fe]||{},je=qe[Ae]||{},De,Pe;nt.fixed==="left"?De=ut.left[Fe]:je.fixed==="right"&&(Pe=ut.right[Ae]);var xe=!1,Se=!1,Le=!1,Ne=!1,et=qe[Ae+1],Xe=qe[Fe-1];if($e==="rtl"){if(De!==void 0){var ct=Xe&&Xe.fixed==="left";Ne=!ct}else if(Pe!==void 0){var gt=et&&et.fixed==="right";Le=!gt}}else if(De!==void 0){var wt=et&&et.fixed==="left";xe=!wt}else if(Pe!==void 0){var vt=Xe&&Xe.fixed==="right";Se=!vt}return{fixLeft:De,fixRight:Pe,lastFixLeft:xe,firstFixRight:Se,lastFixRight:Le,firstFixLeft:Ne,isSticky:ut.isSticky}}var E=R("sR1s");function b(Fe){var Ae=Fe.cells,qe=Fe.stickyOffsets,ut=Fe.flattenColumns,$e=Fe.rowComponent,nt=Fe.cellComponent,je=Fe.onHeaderRow,De=Fe.index,Pe=f.useContext(a.a),xe=Pe.prefixCls,Se=Pe.direction,Le;je&&(Le=je(Ae.map(function(et){return et.column}),De));var Ne=Object(E.a)(Ae.map(function(et){return et.column}));return f.createElement($e,Object.assign({},Le),Ae.map(function(et,Xe){var ct=et.column,gt=l(et.colStart,et.colEnd,ut,qe,Se),wt;return ct&&ct.onHeaderCell&&(wt=et.column.onHeaderCell(ct)),f.createElement(t.a,Object.assign({},et,{ellipsis:ct.ellipsis,align:ct.align,component:nt,prefixCls:xe,key:Ne[Xe]},gt,{additionalProps:wt,rowType:"header"}))}))}b.displayName="HeaderRow";var h=b;function L(Fe){var Ae=[];function qe(je,De){var Pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ae[Pe]=Ae[Pe]||[];var xe=De,Se=je.filter(Boolean).map(function(Le){var Ne={key:Le.key,className:Le.className||"",children:Le.title,column:Le,colStart:xe},et=1,Xe=Le.children;return Xe&&Xe.length>0&&(et=qe(Xe,xe,Pe+1).reduce(function(ct,gt){return ct+gt},0),Ne.hasSubColumns=!0),"colSpan"in Le&&(et=Le.colSpan),"rowSpan"in Le&&(Ne.rowSpan=Le.rowSpan),Ne.colSpan=et,Ne.colEnd=Ne.colStart+et-1,Ae[Pe].push(Ne),xe+=et,et});return Se}qe(Fe,0);for(var ut=Ae.length,$e=function(De){Ae[De].forEach(function(Pe){!("rowSpan"in Pe)&&!Pe.hasSubColumns&&(Pe.rowSpan=ut-De)})},nt=0;nt<ut;nt+=1)$e(nt);return Ae}function O(Fe){var Ae=Fe.stickyOffsets,qe=Fe.columns,ut=Fe.flattenColumns,$e=Fe.onHeaderRow,nt=f.useContext(a.a),je=nt.prefixCls,De=nt.getComponent,Pe=f.useMemo(function(){return L(qe)},[qe]),xe=De(["header","wrapper"],"thead"),Se=De(["header","row"],"tr"),Le=De(["header","cell"],"th");return f.createElement(xe,{className:"".concat(je,"-thead")},Pe.map(function(Ne,et){var Xe=f.createElement(h,{key:et,flattenColumns:ut,cells:Ne,stickyOffsets:Ae,rowComponent:Se,cellComponent:Le,onHeaderRow:$e,index:et});return Xe}))}var w=O,C=R("hW8S");function x(Fe){for(var Ae=Fe.colWidths,qe=Fe.columns,ut=Fe.columCount,$e=[],nt=ut||qe.length,je=!1,De=nt-1;De>=0;De-=1){var Pe=Ae[De],xe=qe&&qe[De],Se=xe&&xe[C.a];(Pe||Se||je)&&($e.unshift(f.createElement("col",Object.assign({key:De,style:{width:Pe,minWidth:Pe}},Se))),je=!0)}return f.createElement("colgroup",null,$e)}var _=x;function j(Fe,Ae){return Object(f.useMemo)(function(){for(var qe=[],ut=0;ut<Ae;ut+=1){var $e=Fe[ut];if($e!==void 0)qe[ut]=$e;else return null}return qe},[Fe.join("_"),Ae])}var N=f.forwardRef(function(Fe,Ae){var qe=Fe.noData,ut=Fe.columns,$e=Fe.flattenColumns,nt=Fe.colWidths,je=Fe.columCount,De=Fe.stickyOffsets,Pe=Fe.direction,xe=Fe.fixHeader,Se=Fe.offsetHeader,Le=Fe.stickyClassName,Ne=Fe.onScroll,et=Object(m.a)(Fe,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Xe=f.useContext(a.a),ct=Xe.prefixCls,gt=Xe.scrollbarSize,wt=Xe.isSticky,vt=wt&&!xe?0:gt,Mt=f.useRef(null),Pt=f.useCallback(function(Mr){Object(i.b)(Ae,Mr),Object(i.b)(Mt,Mr)},[]);f.useEffect(function(){var Mr;function Sr(Tt){var Ot=Tt.currentTarget,Rt=Tt.deltaX;Rt&&(Ne({currentTarget:Ot,scrollLeft:Ot.scrollLeft+Rt}),Tt.preventDefault())}return(Mr=Mt.current)===null||Mr===void 0||Mr.addEventListener("wheel",Sr),function(){var Tt;(Tt=Mt.current)===null||Tt===void 0||Tt.removeEventListener("wheel",Sr)}},[]);var _t=$e[$e.length-1],rr={fixed:_t?_t.fixed:null,onHeaderCell:function(){return{className:"".concat(ct,"-cell-scrollbar")}}},dr=Object(f.useMemo)(function(){return vt?[].concat(Object(T.a)(ut),[rr]):ut},[vt,ut]),Zt=Object(f.useMemo)(function(){return vt?[].concat(Object(T.a)($e),[rr]):$e},[vt,$e]),fr=Object(f.useMemo)(function(){var Mr=De.right,Sr=De.left;return Object(g.a)(Object(g.a)({},De),{},{left:Pe==="rtl"?[].concat(Object(T.a)(Sr.map(function(Tt){return Tt+vt})),[0]):Sr,right:Pe==="rtl"?Mr:[].concat(Object(T.a)(Mr.map(function(Tt){return Tt+vt})),[0]),isSticky:wt})},[vt,De,wt]),Ht=j(nt,je);return f.createElement("div",{style:Object(g.a)({overflow:"hidden"},wt?{top:Se}:{}),ref:Pt,className:y()("".concat(ct,"-header"),Object(M.a)({},Le,!!Le))},f.createElement("table",{style:{tableLayout:"fixed",visibility:qe||Ht?null:"hidden"}},f.createElement(_,{colWidths:Ht?[].concat(Object(T.a)(Ht),[vt]):[],columCount:je+1,columns:Zt}),f.createElement(w,Object.assign({},et,{stickyOffsets:fr,columns:dr,flattenColumns:Zt}))))});N.displayName="FixedHeader";var P=N,V=f.createContext(null),z=V;function B(Fe){var Ae=Fe.prefixCls,qe=Fe.children,ut=Fe.component,$e=Fe.cellComponent,nt=Fe.fixHeader,je=Fe.fixColumn,De=Fe.horizonScroll,Pe=Fe.className,xe=Fe.expanded,Se=Fe.componentWidth,Le=Fe.colSpan,Ne=f.useContext(a.a),et=Ne.scrollbarSize;return f.useMemo(function(){var Xe=qe;return je&&(Xe=f.createElement("div",{style:{width:Se-(nt?et:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ae,"-expanded-row-fixed")},Xe)),f.createElement(ut,{className:Pe,style:{display:xe?null:"none"}},f.createElement(t.a,{component:$e,prefixCls:Ae,colSpan:Le},Xe))},[qe,ut,nt,De,Pe,xe,Se,Le,et])}var K=B;function U(Fe){var Ae=Fe.className,qe=Fe.style,ut=Fe.record,$e=Fe.index,nt=Fe.rowKey,je=Fe.getRowKey,De=Fe.rowExpandable,Pe=Fe.expandedKeys,xe=Fe.onRow,Se=Fe.indent,Le=Se===void 0?0:Se,Ne=Fe.rowComponent,et=Fe.cellComponent,Xe=Fe.childrenColumnName,ct=f.useContext(a.a),gt=ct.prefixCls,wt=ct.fixedInfoList,vt=f.useContext(z),Mt=vt.fixHeader,Pt=vt.fixColumn,_t=vt.horizonScroll,rr=vt.componentWidth,dr=vt.flattenColumns,Zt=vt.expandableType,fr=vt.expandRowByClick,Ht=vt.onTriggerExpand,Mr=vt.rowClassName,Sr=vt.expandedRowClassName,Tt=vt.indentSize,Ot=vt.expandIcon,Rt=vt.expandedRowRender,Bt=vt.expandIconColumnIndex,lr=f.useState(!1),sn=Object(v.a)(lr,2),yt=sn[0],kt=sn[1],Ct=Pe&&Pe.has(Fe.recordKey);f.useEffect(function(){Ct&&kt(!0)},[Ct]);var Ar=Zt==="row"&&(!De||De(ut)),Wr=Zt==="nest",Yt=Xe&&ut&&ut[Xe],Ut=Ar||Wr,Pr;xe&&(Pr=xe(ut,$e));var yn=function(G){if(fr&&Ut&&Ht(ut,G),Pr&&Pr.onClick){for(var Y,ie=arguments.length,de=new Array(ie>1?ie-1:0),oe=1;oe<ie;oe++)de[oe-1]=arguments[oe];(Y=Pr).onClick.apply(Y,[G].concat(de))}},Vr;typeof Mr=="string"?Vr=Mr:typeof Mr=="function"&&(Vr=Mr(ut,$e,Le));var dt=Object(E.a)(dr),At=f.createElement(Ne,Object.assign({},Pr,{"data-row-key":nt,className:y()(Ae,"".concat(gt,"-row"),"".concat(gt,"-row-level-").concat(Le),Vr,Pr&&Pr.className),style:Object(g.a)(Object(g.a)({},qe),Pr?Pr.style:null),onClick:yn}),dr.map(function(ae,G){var Y=ae.render,ie=ae.dataIndex,de=ae.className,oe=dt[G],ze=wt[G],ft;G===(Bt||0)&&Wr&&(ft=f.createElement(f.Fragment,null,f.createElement("span",{style:{paddingLeft:"".concat(Tt*Le,"px")},className:"".concat(gt,"-row-indent indent-level-").concat(Le)}),Ot({prefixCls:gt,expanded:Ct,expandable:Yt,record:ut,onExpand:Ht})));var St;return ae.onCell&&(St=ae.onCell(ut,$e)),f.createElement(t.a,Object.assign({className:de,ellipsis:ae.ellipsis,align:ae.align,component:et,prefixCls:gt,key:oe,record:ut,index:$e,dataIndex:ie,render:Y,shouldCellUpdate:ae.shouldCellUpdate},ze,{appendNode:ft,additionalProps:St}))})),$t;if(Ar&&(yt||Ct)){var hr=Rt(ut,$e,Le+1,Ct),vr=Sr&&Sr(ut,$e,Le);$t=f.createElement(K,{expanded:Ct,className:y()("".concat(gt,"-expanded-row"),"".concat(gt,"-expanded-row-level-").concat(Le+1),vr),prefixCls:gt,fixHeader:Mt,fixColumn:Pt,horizonScroll:_t,component:Ne,componentWidth:rr,cellComponent:et,colSpan:dr.length},hr)}var Er;return Yt&&Ct&&(Er=(ut[Xe]||[]).map(function(ae,G){var Y=je(ae,G);return f.createElement(U,Object.assign({},Fe,{key:Y,rowKey:Y,record:ae,recordKey:Y,index:G,indent:Le+1}))})),f.createElement(f.Fragment,null,At,$t,Er)}U.displayName="BodyRow";var W=U,H=f.createContext(null),q=H;function ne(Fe){var Ae=Fe.columnKey,qe=Fe.onColumnResize,ut=f.useRef();return f.useEffect(function(){ut.current&&qe(Ae,ut.current.offsetWidth)},[]),f.createElement(s.a,{onResize:function(nt){var je=nt.offsetWidth;qe(Ae,je)}},f.createElement("td",{ref:ut,style:{padding:0,border:0,height:0}},f.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function te(Fe){var Ae=Fe.data,qe=Fe.getRowKey,ut=Fe.measureColumnWidth,$e=Fe.expandedKeys,nt=Fe.onRow,je=Fe.rowExpandable,De=Fe.emptyNode,Pe=Fe.childrenColumnName,xe=f.useContext(q),Se=xe.onColumnResize,Le=f.useContext(a.a),Ne=Le.prefixCls,et=Le.getComponent,Xe=f.useContext(z),ct=Xe.fixHeader,gt=Xe.horizonScroll,wt=Xe.flattenColumns,vt=Xe.componentWidth;return f.useMemo(function(){var Mt=et(["body","wrapper"],"tbody"),Pt=et(["body","row"],"tr"),_t=et(["body","cell"],"td"),rr;Ae.length?rr=Ae.map(function(Zt,fr){var Ht=qe(Zt,fr);return f.createElement(W,{key:Ht,rowKey:Ht,record:Zt,recordKey:Ht,index:fr,rowComponent:Pt,cellComponent:_t,expandedKeys:$e,onRow:nt,getRowKey:qe,rowExpandable:je,childrenColumnName:Pe})}):rr=f.createElement(K,{expanded:!0,className:"".concat(Ne,"-placeholder"),prefixCls:Ne,fixHeader:ct,fixColumn:gt,horizonScroll:gt,component:Pt,componentWidth:vt,cellComponent:_t,colSpan:wt.length},De);var dr=Object(E.a)(wt);return f.createElement(Mt,{className:"".concat(Ne,"-tbody")},ut&&f.createElement("tr",{"aria-hidden":"true",className:"".concat(Ne,"-measure-row"),style:{height:0}},dr.map(function(Zt){return f.createElement(ne,{key:Zt,columnKey:Zt,onColumnResize:Se})})),rr)},[Ae,Ne,nt,ut,$e,qe,et,vt,De,wt])}var _e=f.memo(te);_e.displayName="Body";var Ce=_e,me=R("wRmb"),Me=R("xEkU"),Oe=R.n(Me);function he(Fe){var Ae=Object(f.useRef)(Fe),qe=Object(f.useState)({}),ut=Object(v.a)(qe,2),$e=ut[1],nt=Object(f.useRef)(null),je=Object(f.useRef)([]);function De(Pe){nt.current===null&&(je.current=[],nt.current=Oe()(function(){je.current.forEach(function(xe){Ae.current=xe(Ae.current)}),nt.current=null,$e({})})),je.current.push(Pe)}return Object(f.useEffect)(function(){return function(){Oe.a.cancel(nt.current)}},[]),[Ae.current,De]}function ce(Fe){var Ae=Object(f.useRef)(Fe),qe=Object(f.useRef)(null);function ut(){window.clearTimeout(qe.current)}function $e(je){Ae.current=je,ut(),qe.current=window.setTimeout(function(){Ae.current=null,qe.current=null},100)}function nt(){return Ae.current}return Object(f.useEffect)(function(){return ut},[]),[$e,nt]}function se(Fe,Ae,qe){var ut=Object(f.useMemo)(function(){for(var $e=[],nt=[],je=0,De=0,Pe=0;Pe<Ae;Pe+=1)if(qe==="rtl"){nt[Pe]=De,De+=Fe[Pe]||0;var xe=Ae-Pe-1;$e[xe]=je,je+=Fe[xe]||0}else{$e[Pe]=je,je+=Fe[Pe]||0;var Se=Ae-Pe-1;nt[Se]=De,De+=Fe[Se]||0}return{left:$e,right:nt}},[Fe,Ae,qe]);return ut}var Te=se;function re(Fe){var Ae=Fe.className,qe=Fe.children;return f.createElement("div",{className:Ae},qe)}var ue=re,fe=R("n6Qo");function ee(Fe){var Ae,qe=Fe.prefixCls,ut=Fe.record,$e=Fe.onExpand,nt=Fe.expanded,je=Fe.expandable,De="".concat(qe,"-row-expand-icon");if(!je)return f.createElement("span",{className:y()(De,"".concat(qe,"-row-spaced"))});var Pe=function(Se){$e(ut,Se),Se.stopPropagation()};return f.createElement("span",{className:y()(De,(Ae={},Object(M.a)(Ae,"".concat(qe,"-row-expanded"),nt),Object(M.a)(Ae,"".concat(qe,"-row-collapsed"),!nt),Ae)),onClick:Pe})}function Q(Fe,Ae,qe){var ut=[];function $e(nt){(nt||[]).forEach(function(je,De){ut.push(Ae(je,De)),$e(je[qe])})}return $e(Fe),ut}var X=R("zT1h"),Z=R("y0+3"),ve=function(Ae,qe){var ut,$e,nt=Ae.scrollBodyRef,je=Ae.onScroll,De=Ae.offsetScroll,Pe=f.useContext(a.a),xe=Pe.prefixCls,Se=((ut=nt.current)===null||ut===void 0?void 0:ut.scrollWidth)||0,Le=(($e=nt.current)===null||$e===void 0?void 0:$e.clientWidth)||0,Ne=Se&&Le*(Le/Se),et=f.useRef(),Xe=he({scrollLeft:0,isHiddenScrollBar:!1}),ct=Object(v.a)(Xe,2),gt=ct[0],wt=ct[1],vt=f.useRef({delta:0,x:0}),Mt=f.useState(!1),Pt=Object(v.a)(Mt,2),_t=Pt[0],rr=Pt[1],dr=function(){rr(!1)},Zt=function(Tt){Tt.persist(),vt.current.delta=Tt.pageX-gt.scrollLeft,vt.current.x=0,rr(!0),Tt.preventDefault()},fr=function(Tt){var Ot,Rt=Tt||((Ot=window)===null||Ot===void 0?void 0:Ot.event),Bt=Rt.buttons;if(!_t||Bt===0){_t&&rr(!1);return}var lr=vt.current.x+Tt.pageX-vt.current.x-vt.current.delta;lr<=0&&(lr=0),lr+Ne>=Le&&(lr=Le-Ne),je({scrollLeft:lr/Le*(Se+2)}),vt.current.x=Tt.pageX},Ht=function(){var Tt=Object(Z.b)(nt.current).top,Ot=Tt+nt.current.offsetHeight,Rt=document.documentElement.scrollTop+window.innerHeight;Ot-Object(d.a)()<=Rt||Tt>=Rt-De?wt(function(Bt){return Object(g.a)(Object(g.a)({},Bt),{},{isHiddenScrollBar:!0})}):wt(function(Bt){return Object(g.a)(Object(g.a)({},Bt),{},{isHiddenScrollBar:!1})})},Mr=function(Tt){wt(function(Ot){return Object(g.a)(Object(g.a)({},Ot),{},{scrollLeft:Tt/Se*Le||0})})};return f.useImperativeHandle(qe,function(){return{setScrollLeft:Mr}}),f.useEffect(function(){var Sr=Object(X.a)(document.body,"mouseup",dr,!1),Tt=Object(X.a)(document.body,"mousemove",fr,!1);return Ht(),function(){Sr.remove(),Tt.remove()}},[Ne,_t]),f.useEffect(function(){var Sr=Object(X.a)(window,"scroll",Ht,!1),Tt=Object(X.a)(window,"resize",Ht,!1);return function(){Sr.remove(),Tt.remove()}},[]),f.useEffect(function(){gt.isHiddenScrollBar||wt(function(Sr){var Tt,Ot;return Object(g.a)(Object(g.a)({},Sr),{},{scrollLeft:nt.current.scrollLeft/((Tt=nt.current)===null||Tt===void 0?void 0:Tt.scrollWidth)*((Ot=nt.current)===null||Ot===void 0?void 0:Ot.clientWidth)})})},[gt.isHiddenScrollBar]),Se<=Le||!Ne||gt.isHiddenScrollBar?null:f.createElement("div",{style:{height:Object(d.a)(),width:Le,bottom:De},className:"".concat(xe,"-sticky-scroll")},f.createElement("div",{onMouseDown:Zt,ref:et,className:y()("".concat(xe,"-sticky-scroll-bar"),Object(M.a)({},"".concat(xe,"-sticky-scroll-bar-active"),_t)),style:{width:"".concat(Ne,"px"),transform:"translate3d(".concat(gt.scrollLeft,"px, 0, 0)")}}))},ye=f.forwardRef(ve);function Re(Fe,Ae){return f.useMemo(function(){var qe=!!Fe;return{isSticky:qe,stickyClassName:qe?"".concat(Ae,"-sticky-header"):"",offsetHeader:Object(D.a)(Fe)==="object"&&Fe.offsetHeader||0,offsetScroll:Object(D.a)(Fe)==="object"&&Fe.offsetScroll||0}},[Fe,Ae])}var Je=[],Ze={},rt="rc-table-internal-hook",tt=f.memo(function(Fe){var Ae=Fe.children;return Ae},function(Fe,Ae){return o()(Fe.props,Ae.props)?Fe.pingLeft!==Ae.pingLeft||Fe.pingRight!==Ae.pingRight:!1});function st(Fe){var Ae,qe=Fe.prefixCls,ut=Fe.className,$e=Fe.rowClassName,nt=Fe.style,je=Fe.data,De=Fe.rowKey,Pe=Fe.scroll,xe=Fe.tableLayout,Se=Fe.direction,Le=Fe.title,Ne=Fe.footer,et=Fe.summary,Xe=Fe.id,ct=Fe.showHeader,gt=Fe.components,wt=Fe.emptyText,vt=Fe.onRow,Mt=Fe.onHeaderRow,Pt=Fe.internalHooks,_t=Fe.transformColumns,rr=Fe.internalRefs,dr=Fe.sticky,Zt=je||Je,fr=!!Zt.length,Ht=f.useState(0),Mr=Object(v.a)(Ht,2),Sr=Mr[0],Tt=Mr[1];f.useEffect(function(){Tt(Object(d.a)())});var Ot=f.useMemo(function(){return Object(E.c)(gt,{})},[gt]),Rt=f.useCallback(function(zr,Ur){return Object(E.b)(Ot,zr)||Ur},[Ot]),Bt=f.useMemo(function(){return typeof De=="function"?De:function(zr){var Ur=zr&&zr[De];return Ur}},[De]),lr=Object(C.c)(Fe),sn=lr.expandIcon,yt=lr.expandedRowKeys,kt=lr.defaultExpandedRowKeys,Ct=lr.defaultExpandAllRows,Ar=lr.expandedRowRender,Wr=lr.onExpand,Yt=lr.onExpandedRowsChange,Ut=lr.expandRowByClick,Pr=lr.rowExpandable,yn=lr.expandIconColumnIndex,Vr=lr.expandedRowClassName,dt=lr.childrenColumnName,At=lr.indentSize,$t=sn||ee,hr=dt||"children",vr=f.useMemo(function(){return Ar?"row":Fe.expandable&&Pt===rt&&Fe.expandable.__PARENT_RENDER_ICON__||Zt.some(function(zr){return zr&&Object(D.a)(zr)==="object"&&zr[hr]})?"nest":!1},[!!Ar,Zt]),Er=f.useState(function(){return kt||(Ct?Q(Zt,Bt,hr):[])}),ae=Object(v.a)(Er,2),G=ae[0],Y=ae[1],ie=f.useMemo(function(){return new Set(yt||G||[])},[yt,G]),de=f.useCallback(function(zr){var Ur=Bt(zr,Zt.indexOf(zr)),Dr,ui=ie.has(Ur);ui?(ie.delete(Ur),Dr=Object(T.a)(ie)):Dr=[].concat(Object(T.a)(ie),[Ur]),Y(Dr),Wr&&Wr(!ui,zr),Yt&&Yt(Dr)},[Bt,ie,Zt,Wr,Yt]),oe=f.useState(0),ze=Object(v.a)(oe,2),ft=ze[0],St=ze[1],Ft=Object(me.b)(Object(g.a)(Object(g.a)(Object(g.a)({},Fe),lr),{},{expandable:!!Ar,expandedKeys:ie,getRowKey:Bt,onTriggerExpand:de,expandIcon:$t,expandIconColumnIndex:yn,direction:Se}),Pt===rt?_t:null),mt=Object(v.a)(Ft,2),Gt=mt[0],Vt=mt[1],Hr=f.useMemo(function(){return{columns:Gt,flattenColumns:Vt}},[Gt,Vt]),cn=f.useRef(),rn=f.useRef(),tr=f.useRef(),$r=f.useState(!1),pr=Object(v.a)($r,2),qt=pr[0],sr=pr[1],gr=f.useState(!1),en=Object(v.a)(gr,2),fn=en[0],Sn=en[1],wi=he(new Map),Vi=Object(v.a)(wi,2),Ui=Vi[0],Zn=Vi[1],ln=Object(E.a)(Vt),Ri=ln.map(function(zr){return Ui.get(zr)}),dn=f.useMemo(function(){return Ri},[Ri.join("_")]),hi=Te(dn,Vt.length,Se),Jr=Pe&&Object(E.d)(Pe.y),ur=Pe&&Object(E.d)(Pe.x),nn=ur&&Vt.some(function(zr){var Ur=zr.fixed;return Ur}),Ir=f.useRef(),mn=Re(dr,qe),Nr=mn.isSticky,fi=mn.offsetHeader,gn=mn.offsetScroll,zn=mn.stickyClassName,Di,yi,qn;Jr&&(yi={overflowY:"scroll",maxHeight:Pe.y}),ur&&(Di={overflowX:"auto"},Jr||(yi={overflowY:"hidden"}),qn={width:Pe.x===!0?"auto":Pe.x,minWidth:"100%"});var Ci=f.useCallback(function(zr,Ur){Zn(function(Dr){var ui=new Map(Dr);return ui.set(zr,Ur),ui})},[]),Fn=ce(null),Ni=Object(v.a)(Fn,2),si=Ni[0],pi=Ni[1];function Bi(zr,Ur){if(!Ur)return;typeof Ur=="function"?Ur(zr):Ur.scrollLeft!==zr&&(Ur.scrollLeft=zr)}var li=function(Ur){var Dr=Ur.currentTarget,ui=Ur.scrollLeft,Xi=typeof ui=="number"?ui:Dr.scrollLeft,Yi=Dr||Ze;if(!pi()||pi()===Yi){var ar;si(Yi),Bi(Xi,rn.current),Bi(Xi,tr.current),Bi(Xi,(ar=Ir.current)===null||ar===void 0?void 0:ar.setScrollLeft)}if(Dr){var jt=Dr.scrollWidth,mr=Dr.clientWidth;sr(Xi>0),Sn(Xi<jt-mr)}},an=function(){tr.current&&li({currentTarget:tr.current})},Qi=function(Ur){var Dr=Ur.width;an(),St(cn.current?cn.current.offsetWidth:Dr)};f.useEffect(function(){return an},[]),f.useEffect(function(){ur&&an()},[ur]),f.useEffect(function(){Pt===rt&&rr&&(rr.body.current=tr.current)});var zt=Rt(["table"],"table"),er=f.useMemo(function(){return xe||(nn?Pe.x==="max-content"?"auto":"fixed":Jr||Vt.some(function(zr){var Ur=zr.ellipsis;return Ur})?"fixed":"auto")},[Jr,nn,Vt,xe]),Jt,yr={colWidths:dn,columCount:Vt.length,stickyOffsets:hi,onHeaderRow:Mt,fixHeader:Jr},Rr=f.useMemo(function(){return fr?null:typeof wt=="function"?wt():wt},[fr,wt]),Qr=f.createElement(Ce,{data:Zt,measureColumnWidth:Jr||ur||Nr,expandedKeys:ie,rowExpandable:Pr,getRowKey:Bt,onRow:vt,emptyNode:Rr,childrenColumnName:hr}),Tr=f.createElement(_,{colWidths:Vt.map(function(zr){var Ur=zr.width;return Ur}),columns:Vt}),Rn=et&&f.createElement(fe.b,null,et(Zt)),Kn=Rt(["body"]);if(Jr||Nr){var wr;typeof Kn=="function"?(wr=Kn(Zt,{scrollbarSize:Sr,ref:tr,onScroll:li}),yr.colWidths=Vt.map(function(zr,Ur){var Dr=zr.width,ui=Ur===Gt.length-1?Dr-Sr:Dr;return typeof ui=="number"&&!Number.isNaN(ui)?ui:(Object(r.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):wr=f.createElement("div",{style:Object(g.a)(Object(g.a)({},Di),yi),onScroll:li,ref:tr,className:y()("".concat(qe,"-body"))},f.createElement(zt,{style:Object(g.a)(Object(g.a)({},qn),{},{tableLayout:er})},Tr,Qr,Rn),Nr&&f.createElement(ye,{ref:Ir,offsetScroll:gn,scrollBodyRef:tr,onScroll:li})),Jt=f.createElement(f.Fragment,null,ct!==!1&&f.createElement(P,Object.assign({noData:!Zt.length},yr,Hr,{direction:Se,offsetHeader:fi,stickyClassName:zn,ref:rn,onScroll:li})),wr)}else Jt=f.createElement("div",{style:Object(g.a)(Object(g.a)({},Di),yi),className:y()("".concat(qe,"-content")),onScroll:li,ref:tr},f.createElement(zt,{style:Object(g.a)(Object(g.a)({},qn),{},{tableLayout:er})},Tr,ct!==!1&&f.createElement(w,Object.assign({},yr,Hr)),Qr,Rn));var ji=Object(C.b)(Fe),Fr=f.createElement("div",Object.assign({className:y()(qe,ut,(Ae={},Object(M.a)(Ae,"".concat(qe,"-rtl"),Se==="rtl"),Object(M.a)(Ae,"".concat(qe,"-ping-left"),qt),Object(M.a)(Ae,"".concat(qe,"-ping-right"),fn),Object(M.a)(Ae,"".concat(qe,"-layout-fixed"),xe==="fixed"),Object(M.a)(Ae,"".concat(qe,"-fixed-header"),Jr),Object(M.a)(Ae,"".concat(qe,"-fixed-column"),nn),Object(M.a)(Ae,"".concat(qe,"-scroll-horizontal"),ur),Object(M.a)(Ae,"".concat(qe,"-has-fix-left"),Vt[0]&&Vt[0].fixed),Object(M.a)(Ae,"".concat(qe,"-has-fix-right"),Vt[Vt.length-1]&&Vt[Vt.length-1].fixed==="right"),Ae)),style:nt,id:Xe,ref:cn},ji),f.createElement(tt,{pingLeft:qt,pingRight:fn,props:Object(g.a)(Object(g.a)({},Fe),{},{stickyOffsets:hi,mergedExpandedKeys:ie})},Le&&f.createElement(ue,{className:"".concat(qe,"-title")},Le(Zt)),f.createElement("div",{className:"".concat(qe,"-container")},Jt),Ne&&f.createElement(ue,{className:"".concat(qe,"-footer")},Ne(Zt))));ur&&(Fr=f.createElement(s.a,{onResize:Qi},Fr));var Pn=f.useMemo(function(){return{prefixCls:qe,getComponent:Rt,scrollbarSize:Sr,direction:Se,fixedInfoList:Vt.map(function(zr,Ur){return l(Ur,Ur,Vt,hi,Se)}),isSticky:Nr}},[qe,Rt,Sr,Se,Vt,hi,Se,Nr]),mi=f.useMemo(function(){return Object(g.a)(Object(g.a)({},Hr),{},{tableLayout:er,rowClassName:$e,expandedRowClassName:Vr,componentWidth:ft,fixHeader:Jr,fixColumn:nn,horizonScroll:ur,expandIcon:$t,expandableType:vr,expandRowByClick:Ut,expandedRowRender:Ar,onTriggerExpand:de,expandIconColumnIndex:yn,indentSize:At})},[Hr,er,$e,Vr,ft,Jr,nn,ur,$t,vr,Ut,Ar,de,yn,At]),ei=f.useMemo(function(){return{onColumnResize:Ci}},[Ci]);return f.createElement(a.a.Provider,{value:Pn},f.createElement(z.Provider,{value:mi},f.createElement(q.Provider,{value:ei},Fr)))}st.Column=p.a,st.ColumnGroup=u.a,st.Summary=fe.a,st.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ot=$.b=st},wRmb:function(I,$,R){"use strict";R.d($,"a",function(){return o});var M=R("rePB"),g=R("KQm4"),T=R("VTBJ"),D=R("Ff2n"),v=R("q1tI"),f=R.n(v),S=R("Kwbf"),y=R("Zm9Q"),c=R("hW8S");function o(p){return Object(y.a)(p).filter(function(m){return v.isValidElement(m)}).map(function(m){var i=m.key,t=m.props,a=t.children,l=Object(D.a)(t,["children"]),E=Object(T.a)({key:i},l);return a&&(E.children=o(a)),E})}function r(p){return p.reduce(function(m,i){var t=i.fixed,a=t===!0?"left":t,l=i.children;return l&&l.length>0?[].concat(Object(g.a)(m),Object(g.a)(r(l).map(function(E){return Object(T.a)({fixed:a},E)}))):[].concat(Object(g.a)(m),[Object(T.a)(Object(T.a)({},i),{},{fixed:a})])},[])}function s(p){for(var m=!0,i=0;i<p.length;i+=1){var t=p[i];if(m&&t.fixed!=="left")m=!1;else if(!m&&t.fixed==="left"){Object(S.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var a=!0,l=p.length-1;l>=0;l-=1){var E=p[l];if(a&&E.fixed!=="right")a=!1;else if(!a&&E.fixed==="right"){Object(S.a)(!1,"Index ".concat(l+1," of `columns` missing `fixed='right'` prop."));break}}}function d(p){return p.map(function(m){var i=m.fixed,t=Object(D.a)(m,["fixed"]),a=i;return i==="left"?a="right":i==="right"&&(a="left"),Object(T.a)({fixed:a},t)})}function u(p,m){var i=p.prefixCls,t=p.columns,a=p.children,l=p.expandable,E=p.expandedKeys,b=p.getRowKey,h=p.onTriggerExpand,L=p.expandIcon,O=p.rowExpandable,w=p.expandIconColumnIndex,C=p.direction,x=p.expandRowByClick,_=v.useMemo(function(){return t||o(a)},[t,a]),j=v.useMemo(function(){if(l){var V,z=w||0,B=_[z],K=(V={},Object(M.a)(V,c.a,{className:"".concat(i,"-expand-icon-col")}),Object(M.a)(V,"title",""),Object(M.a)(V,"fixed",B?B.fixed:null),Object(M.a)(V,"className","".concat(i,"-row-expand-icon-cell")),Object(M.a)(V,"render",function(H,q,ne){var te=b(q,ne),_e=E.has(te),Ce=O?O(q):!0,me=L({prefixCls:i,expanded:_e,expandable:Ce,record:q,onExpand:h});return x?v.createElement("span",{onClick:function(Oe){return Oe.stopPropagation()}},me):me}),V),U=_.slice();return z>=0&&U.splice(z,0,K),U}return _},[l,_,b,E,L,C]),N=v.useMemo(function(){var V=j;return m&&(V=m(V)),V.length||(V=[{render:function(){return null}}]),V},[m,j,C]),P=v.useMemo(function(){return C==="rtl"?d(r(N)):r(N)},[N,C]);return[N,P]}$.b=u},wZgz:function(I,$,R){(function(M,g,T){I.exports=$=g(R("Ib8C"),R("ETIr"),R("cv67"),R("K3mO"),R("OLod"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.BlockCipher,v=g.algo,f=[],S=[],y=[],c=[],o=[],r=[],s=[],d=[],u=[],p=[];(function(){for(var t=[],a=0;a<256;a++)a<128?t[a]=a<<1:t[a]=a<<1^283;for(var l=0,E=0,a=0;a<256;a++){var b=E^E<<1^E<<2^E<<3^E<<4;b=b>>>8^b&255^99,f[l]=b,S[b]=l;var h=t[l],L=t[h],O=t[L],w=t[b]*257^b*16843008;y[l]=w<<24|w>>>8,c[l]=w<<16|w>>>16,o[l]=w<<8|w>>>24,r[l]=w;var w=O*16843009^L*65537^h*257^l*16843008;s[b]=w<<24|w>>>8,d[b]=w<<16|w>>>16,u[b]=w<<8|w>>>24,p[b]=w,l?(l=h^t[t[t[O^h]]],E^=t[t[E]]):l=E=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],i=v.AES=D.extend({_doReset:function(){var t;if(this._nRounds&&this._keyPriorReset===this._key)return;for(var a=this._keyPriorReset=this._key,l=a.words,E=a.sigBytes/4,b=this._nRounds=E+6,h=(b+1)*4,L=this._keySchedule=[],O=0;O<h;O++)O<E?L[O]=l[O]:(t=L[O-1],O%E?E>6&&O%E==4&&(t=f[t>>>24]<<24|f[t>>>16&255]<<16|f[t>>>8&255]<<8|f[t&255]):(t=t<<8|t>>>24,t=f[t>>>24]<<24|f[t>>>16&255]<<16|f[t>>>8&255]<<8|f[t&255],t^=m[O/E|0]<<24),L[O]=L[O-E]^t);for(var w=this._invKeySchedule=[],C=0;C<h;C++){var O=h-C;if(C%4)var t=L[O];else var t=L[O-4];C<4||O<=4?w[C]=t:w[C]=s[f[t>>>24]]^d[f[t>>>16&255]]^u[f[t>>>8&255]]^p[f[t&255]]}},encryptBlock:function(t,a){this._doCryptBlock(t,a,this._keySchedule,y,c,o,r,f)},decryptBlock:function(t,a){var l=t[a+1];t[a+1]=t[a+3],t[a+3]=l,this._doCryptBlock(t,a,this._invKeySchedule,s,d,u,p,S);var l=t[a+1];t[a+1]=t[a+3],t[a+3]=l},_doCryptBlock:function(t,a,l,E,b,h,L,O){for(var w=this._nRounds,C=t[a]^l[0],x=t[a+1]^l[1],_=t[a+2]^l[2],j=t[a+3]^l[3],N=4,P=1;P<w;P++){var V=E[C>>>24]^b[x>>>16&255]^h[_>>>8&255]^L[j&255]^l[N++],z=E[x>>>24]^b[_>>>16&255]^h[j>>>8&255]^L[C&255]^l[N++],B=E[_>>>24]^b[j>>>16&255]^h[C>>>8&255]^L[x&255]^l[N++],K=E[j>>>24]^b[C>>>16&255]^h[x>>>8&255]^L[_&255]^l[N++];C=V,x=z,_=B,j=K}var V=(O[C>>>24]<<24|O[x>>>16&255]<<16|O[_>>>8&255]<<8|O[j&255])^l[N++],z=(O[x>>>24]<<24|O[_>>>16&255]<<16|O[j>>>8&255]<<8|O[C&255])^l[N++],B=(O[_>>>24]<<24|O[j>>>16&255]<<16|O[C>>>8&255]<<8|O[x&255])^l[N++],K=(O[j>>>24]<<24|O[C>>>16&255]<<16|O[x>>>8&255]<<8|O[_&255])^l[N++];t[a]=V,t[a+1]=z,t[a+2]=B,t[a+3]=K},keySize:256/32});g.AES=D._createHelper(i)}(),M.AES})},wbyO:function(I,$,R){(function(M,g){I.exports=$=g(R("Ib8C"))})(this,function(M){return function(){var g=M,T=g.lib,D=T.WordArray,v=g.enc,f=v.Base64url={stringify:function(y,c=!0){var o=y.words,r=y.sigBytes,s=c?this._safe_map:this._map;y.clamp();for(var d=[],u=0;u<r;u+=3)for(var p=o[u>>>2]>>>24-u%4*8&255,m=o[u+1>>>2]>>>24-(u+1)%4*8&255,i=o[u+2>>>2]>>>24-(u+2)%4*8&255,t=p<<16|m<<8|i,a=0;a<4&&u+a*.75<r;a++)d.push(s.charAt(t>>>6*(3-a)&63));var l=s.charAt(64);if(l)for(;d.length%4;)d.push(l);return d.join("")},parse:function(y,c=!0){var o=y.length,r=c?this._safe_map:this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var d=0;d<r.length;d++)s[r.charCodeAt(d)]=d}var u=r.charAt(64);if(u){var p=y.indexOf(u);p!==-1&&(o=p)}return S(y,o,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function S(y,c,o){for(var r=[],s=0,d=0;d<c;d++)if(d%4){var u=o[y.charCodeAt(d-1)]<<d%4*2,p=o[y.charCodeAt(d)]>>>6-d%4*2,m=u|p;r[s>>>2]|=m<<24-s%4*8,s++}return D.create(r,s)}}(),M.enc.Base64url})},"y0+3":function(I,$,R){"use strict";R.d($,"a",function(){return r}),R.d($,"b",function(){return d});var M=/margin|padding|width|height|max|min|offset/,g={left:!0,top:!0},T={cssFloat:1,styleFloat:1,float:1};function D(u){return u.nodeType===1?u.ownerDocument.defaultView.getComputedStyle(u,null):{}}function v(u,p,m){if(p=p.toLowerCase(),m==="auto"){if(p==="height")return u.offsetHeight;if(p==="width")return u.offsetWidth}return p in g||(g[p]=M.test(p)),g[p]?parseFloat(m)||0:m}function f(u,p){var m=arguments.length,i=D(u);return p=T[p]?"cssFloat"in u.style?"cssFloat":"styleFloat":p,m===1?i:v(u,p,i[p]||u.style[p])}function S(u,p,m){var i=arguments.length;if(p=T[p]?"cssFloat"in u.style?"cssFloat":"styleFloat":p,i===3)return typeof m=="number"&&M.test(p)&&(m="".concat(m,"px")),u.style[p]=m,m;for(var t in p)p.hasOwnProperty(t)&&S(u,t,p[t]);return D(u)}function y(u){return u===document.body?document.documentElement.clientWidth:u.offsetWidth}function c(u){return u===document.body?window.innerHeight||document.documentElement.clientHeight:u.offsetHeight}function o(){var u=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),p=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:u,height:p}}function r(){var u=document.documentElement.clientWidth,p=window.innerHeight||document.documentElement.clientHeight;return{width:u,height:p}}function s(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function d(u){var p=u.getBoundingClientRect(),m=document.documentElement;return{left:p.left+(window.pageXOffset||m.scrollLeft)-(m.clientLeft||document.body.clientLeft||0),top:p.top+(window.pageYOffset||m.scrollTop)-(m.clientTop||document.body.clientTop||0)}}},ynwM:function(I,$,R){var M=R("MFOe"),g=M.Global;I.exports={name:"oldFF-globalStorage",read:D,write:v,each:f,remove:S,clearAll:y};var T=g.globalStorage;function D(c){return T[c]}function v(c,o){T[c]=o}function f(c){for(var o=T.length-1;o>=0;o--){var r=T.key(o);c(T[r],r)}}function S(c){return T.removeItem(c)}function y(){f(function(c,o){delete T[c]})}}}]);
|