diff --git a/404.html b/404.html index f0caca3..ccda23c 100644 --- a/404.html +++ b/404.html @@ -20,6 +20,6 @@ - + \ No newline at end of file diff --git a/index.html b/index.html index f0caca3..ccda23c 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,6 @@ - + \ No newline at end of file diff --git a/main.08754bed8e87a449.js b/main.08754bed8e87a449.js deleted file mode 100644 index c7e374f..0000000 --- a/main.08754bed8e87a449.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunktezos_snaps_wallet=self.webpackChunktezos_snaps_wallet||[]).push([[179],{5876:(ne,F,I)=>{const B=I(532),S=I(7554),T=I(179),f=I(1036);function M(_,b,C,x,E){const P=[].slice.call(arguments,1),A=P.length,O="function"==typeof P[A-1];if(!O&&!B())throw new Error("Callback required as last argument");if(!O){if(A<1)throw new Error("Too few arguments provided");return 1===A?(C=b,b=x=void 0):2===A&&!b.getContext&&(x=C,C=b,b=void 0),new Promise(function(N,U){try{const H=S.create(C,x);N(_(H,b,x))}catch(H){U(H)}})}if(A<2)throw new Error("Too few arguments provided");2===A?(E=C,C=b,b=x=void 0):3===A&&(b.getContext&&void 0===E?(E=x,x=void 0):(E=x,x=C,C=b,b=void 0));try{const N=S.create(C,x);E(null,_(N,b,x))}catch(N){E(N)}}F.rT=M.bind(null,T.render),F.hz=M.bind(null,T.renderToDataURL),F.toString=M.bind(null,function(_,b,C){return f.render(_,C)})},532:ne=>{ne.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},3012:(ne,F,I)=>{const R=I(4860).getSymbolSize;F.getRowColCoords=function(S){if(1===S)return[];const T=Math.floor(S/7)+2,f=R(S),M=145===f?26:2*Math.ceil((f-13)/(2*T-2)),_=[f-7];for(let b=1;b{const R=I(6906),B=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function S(T){this.mode=R.ALPHANUMERIC,this.data=T}S.getBitsLength=function(f){return 11*Math.floor(f/2)+f%2*6},S.prototype.getLength=function(){return this.data.length},S.prototype.getBitsLength=function(){return S.getBitsLength(this.data.length)},S.prototype.write=function(f){let M;for(M=0;M+2<=this.data.length;M+=2){let _=45*B.indexOf(this.data[M]);_+=B.indexOf(this.data[M+1]),f.put(_,11)}this.data.length%2&&f.put(B.indexOf(this.data[M]),6)},ne.exports=S},3044:ne=>{function F(){this.buffer=[],this.length=0}F.prototype={get:function(I){const R=Math.floor(I/8);return 1==(this.buffer[R]>>>7-I%8&1)},put:function(I,R){for(let B=0;B>>R-B-1&1))},getLengthInBits:function(){return this.length},putBit:function(I){const R=Math.floor(this.length/8);this.buffer.length<=R&&this.buffer.push(0),I&&(this.buffer[R]|=128>>>this.length%8),this.length++}},ne.exports=F},1973:ne=>{function F(I){if(!I||I<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=I,this.data=new Uint8Array(I*I),this.reservedBit=new Uint8Array(I*I)}F.prototype.set=function(I,R,B,S){const T=I*this.size+R;this.data[T]=B,S&&(this.reservedBit[T]=!0)},F.prototype.get=function(I,R){return this.data[I*this.size+R]},F.prototype.xor=function(I,R,B){this.data[I*this.size+R]^=B},F.prototype.isReserved=function(I,R){return this.reservedBit[I*this.size+R]},ne.exports=F},1824:(ne,F,I)=>{const R=I(8419),B=I(6906);function S(T){this.mode=B.BYTE,this.data=new Uint8Array(R(T))}S.getBitsLength=function(f){return 8*f},S.prototype.getLength=function(){return this.data.length},S.prototype.getBitsLength=function(){return S.getBitsLength(this.data.length)},S.prototype.write=function(T){for(let f=0,M=this.data.length;f{const R=I(9020),B=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],S=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];F.getBlocksCount=function(f,M){switch(M){case R.L:return B[4*(f-1)+0];case R.M:return B[4*(f-1)+1];case R.Q:return B[4*(f-1)+2];case R.H:return B[4*(f-1)+3];default:return}},F.getTotalCodewordsCount=function(f,M){switch(M){case R.L:return S[4*(f-1)+0];case R.M:return S[4*(f-1)+1];case R.Q:return S[4*(f-1)+2];case R.H:return S[4*(f-1)+3];default:return}}},9020:(ne,F)=>{F.L={bit:1},F.M={bit:0},F.Q={bit:3},F.H={bit:2},F.isValid=function(B){return B&&void 0!==B.bit&&B.bit>=0&&B.bit<4},F.from=function(B,S){if(F.isValid(B))return B;try{return function I(R){if("string"!=typeof R)throw new Error("Param is not a string");switch(R.toLowerCase()){case"l":case"low":return F.L;case"m":case"medium":return F.M;case"q":case"quartile":return F.Q;case"h":case"high":return F.H;default:throw new Error("Unknown EC Level: "+R)}}(B)}catch(T){return S}}},9172:(ne,F,I)=>{const R=I(4860).getSymbolSize;F.getPositions=function(T){const f=R(T);return[[0,0],[f-7,0],[0,f-7]]}},611:(ne,F,I)=>{const R=I(4860),T=R.getBCHDigit(1335);F.getEncodedBits=function(M,_){const b=M.bit<<3|_;let C=b<<10;for(;R.getBCHDigit(C)-T>=0;)C^=1335<{const I=new Uint8Array(512),R=new Uint8Array(256);(function(){let S=1;for(let T=0;T<255;T++)I[T]=S,R[S]=T,S<<=1,256&S&&(S^=285);for(let T=255;T<512;T++)I[T]=I[T-255]})(),F.log=function(S){if(S<1)throw new Error("log("+S+")");return R[S]},F.exp=function(S){return I[S]},F.mul=function(S,T){return 0===S||0===T?0:I[R[S]+R[T]]}},8043:(ne,F,I)=>{const R=I(6906),B=I(4860);function S(T){this.mode=R.KANJI,this.data=T}S.getBitsLength=function(f){return 13*f},S.prototype.getLength=function(){return this.data.length},S.prototype.getBitsLength=function(){return S.getBitsLength(this.data.length)},S.prototype.write=function(T){let f;for(f=0;f=33088&&M<=40956)M-=33088;else{if(!(M>=57408&&M<=60351))throw new Error("Invalid SJIS character: "+this.data[f]+"\nMake sure your charset is UTF-8");M-=49472}M=192*(M>>>8&255)+(255&M),T.put(M,13)}},ne.exports=S},7135:(ne,F)=>{F.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function R(B,S,T){switch(B){case F.Patterns.PATTERN000:return(S+T)%2==0;case F.Patterns.PATTERN001:return S%2==0;case F.Patterns.PATTERN010:return T%3==0;case F.Patterns.PATTERN011:return(S+T)%3==0;case F.Patterns.PATTERN100:return(Math.floor(S/2)+Math.floor(T/3))%2==0;case F.Patterns.PATTERN101:return S*T%2+S*T%3==0;case F.Patterns.PATTERN110:return(S*T%2+S*T%3)%2==0;case F.Patterns.PATTERN111:return(S*T%3+(S+T)%2)%2==0;default:throw new Error("bad maskPattern:"+B)}}F.isValid=function(S){return null!=S&&""!==S&&!isNaN(S)&&S>=0&&S<=7},F.from=function(S){return F.isValid(S)?parseInt(S,10):void 0},F.getPenaltyN1=function(S){const T=S.size;let f=0,M=0,_=0,b=null,C=null;for(let x=0;x=5&&(f+=M-5+3),b=P,M=1),P=S.get(E,x),P===C?_++:(_>=5&&(f+=_-5+3),C=P,_=1)}M>=5&&(f+=M-5+3),_>=5&&(f+=_-5+3)}return f},F.getPenaltyN2=function(S){const T=S.size;let f=0;for(let M=0;M=10&&(1488===M||93===M)&&f++,_=_<<1&2047|S.get(C,b),C>=10&&(1488===_||93===_)&&f++}return 40*f},F.getPenaltyN4=function(S){let T=0;const f=S.data.length;for(let _=0;_{const R=I(2316),B=I(4677);F.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},F.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},F.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},F.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},F.MIXED={bit:-1},F.getCharCountIndicator=function(f,M){if(!f.ccBits)throw new Error("Invalid mode: "+f);if(!R.isValid(M))throw new Error("Invalid version: "+M);return M>=1&&M<10?f.ccBits[0]:M<27?f.ccBits[1]:f.ccBits[2]},F.getBestModeForData=function(f){return B.testNumeric(f)?F.NUMERIC:B.testAlphanumeric(f)?F.ALPHANUMERIC:B.testKanji(f)?F.KANJI:F.BYTE},F.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},F.isValid=function(f){return f&&f.bit&&f.ccBits},F.from=function(f,M){if(F.isValid(f))return f;try{return function S(T){if("string"!=typeof T)throw new Error("Param is not a string");switch(T.toLowerCase()){case"numeric":return F.NUMERIC;case"alphanumeric":return F.ALPHANUMERIC;case"kanji":return F.KANJI;case"byte":return F.BYTE;default:throw new Error("Unknown mode: "+T)}}(f)}catch(_){return M}}},6002:(ne,F,I)=>{const R=I(6906);function B(S){this.mode=R.NUMERIC,this.data=S.toString()}B.getBitsLength=function(T){return 10*Math.floor(T/3)+(T%3?T%3*3+1:0)},B.prototype.getLength=function(){return this.data.length},B.prototype.getBitsLength=function(){return B.getBitsLength(this.data.length)},B.prototype.write=function(T){let f,M,_;for(f=0;f+3<=this.data.length;f+=3)M=this.data.substr(f,3),_=parseInt(M,10),T.put(_,10);const b=this.data.length-f;b>0&&(M=this.data.substr(f),_=parseInt(M,10),T.put(_,3*b+1))},ne.exports=B},5179:(ne,F,I)=>{const R=I(7794);F.mul=function(S,T){const f=new Uint8Array(S.length+T.length-1);for(let M=0;M=0;){const M=f[0];for(let b=0;b{const R=I(4860),B=I(9020),S=I(3044),T=I(1973),f=I(3012),M=I(9172),_=I(7135),b=I(6194),C=I(8098),x=I(6602),E=I(611),P=I(6906),A=I(9465);function V(z,J,re){const ve=z.size,y=E.getEncodedBits(J,re);let o,l;for(o=0;o<15;o++)l=1==(y>>o&1),z.set(o<6?o:o<8?o+1:ve-15+o,8,l,!0),z.set(8,o<8?ve-o-1:o<9?15-o-1+1:15-o-1,l,!0);z.set(ve-8,8,1,!0)}function Z(z,J,re,ve){let y;if(Array.isArray(z))y=A.fromArray(z);else{if("string"!=typeof z)throw new Error("Invalid data");{let d=J;if(!d){const m=A.rawSplit(z);d=x.getBestVersionForData(m,re)}y=A.fromString(z,d||40)}}const o=x.getBestVersionForData(y,re);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(J){if(J=0&&c<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===c||6===c)||c>=2&&c<=4&&u>=2&&u<=4,!0)}}(u,J),function N(z){const J=z.size;for(let re=8;re=7&&function H(z,J){const re=z.size,ve=x.getEncodedBits(J);let y,o,l;for(let c=0;c<18;c++)y=Math.floor(c/3),o=c%3+re-8-3,l=1==(ve>>c&1),z.set(y,o,l,!0),z.set(o,y,l,!0)}(u,J),function G(z,J){const re=z.size;let ve=-1,y=re-1,o=7,l=0;for(let c=re-1;c>0;c-=2)for(6===c&&c--;;){for(let u=0;u<2;u++)if(!z.isReserved(y,c-u)){let d=!1;l>>o&1)),z.set(y,c-u,d),o--,-1===o&&(l++,o=7)}if(y+=ve,y<0||re<=y){y-=ve,ve=-ve;break}}}(u,l),isNaN(ve)&&(ve=_.getBestMask(u,V.bind(null,u,re))),_.applyMask(ve,u),V(u,re,ve),{modules:u,version:J,errorCorrectionLevel:re,maskPattern:ve,segments:y}}F.create=function(J,re){if(void 0===J||""===J)throw new Error("No input text");let y,o,ve=B.M;return void 0!==re&&(ve=B.from(re.errorCorrectionLevel,B.M),y=x.from(re.version),o=_.from(re.maskPattern),re.toSJISFunc&&R.setToSJISFunction(re.toSJISFunc)),Z(J,y,ve,o)}},8098:(ne,F,I)=>{const R=I(5179);function B(S){this.genPoly=void 0,this.degree=S,this.degree&&this.initialize(this.degree)}B.prototype.initialize=function(T){this.degree=T,this.genPoly=R.generateECPolynomial(this.degree)},B.prototype.encode=function(T){if(!this.genPoly)throw new Error("Encoder not initialized");const f=new Uint8Array(T.length+this.degree);f.set(T);const M=R.mod(f,this.genPoly),_=this.degree-M.length;if(_>0){const b=new Uint8Array(this.degree);return b.set(M,_),b}return M},ne.exports=B},4677:(ne,F)=>{const I="[0-9]+";let B="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";B=B.replace(/u/g,"\\u");const S="(?:(?![A-Z0-9 $%*+\\-./:]|"+B+")(?:.|[\r\n]))+";F.KANJI=new RegExp(B,"g"),F.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),F.BYTE=new RegExp(S,"g"),F.NUMERIC=new RegExp(I,"g"),F.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const T=new RegExp("^"+B+"$"),f=new RegExp("^"+I+"$"),M=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");F.testKanji=function(b){return T.test(b)},F.testNumeric=function(b){return f.test(b)},F.testAlphanumeric=function(b){return M.test(b)}},9465:(ne,F,I)=>{const R=I(6906),B=I(6002),S=I(812),T=I(1824),f=I(8043),M=I(4677),_=I(4860),b=I(4901);function C(H){return unescape(encodeURIComponent(H)).length}function x(H,V,G){const K=[];let X;for(;null!==(X=H.exec(G));)K.push({data:X[0],index:X.index,mode:V,length:X[0].length});return K}function E(H){const V=x(M.NUMERIC,R.NUMERIC,H),G=x(M.ALPHANUMERIC,R.ALPHANUMERIC,H);let K,X;return _.isKanjiModeEnabled()?(K=x(M.BYTE,R.BYTE,H),X=x(M.KANJI,R.KANJI,H)):(K=x(M.BYTE_KANJI,R.BYTE,H),X=[]),V.concat(G,K,X).sort(function(z,J){return z.index-J.index}).map(function(z){return{data:z.data,mode:z.mode,length:z.length}})}function P(H,V){switch(V){case R.NUMERIC:return B.getBitsLength(H);case R.ALPHANUMERIC:return S.getBitsLength(H);case R.KANJI:return f.getBitsLength(H);case R.BYTE:return T.getBitsLength(H)}}function U(H,V){let G;const K=R.getBestModeForData(H);if(G=R.from(V,K),G!==R.BYTE&&G.bit=0?V[V.length-1]:null;return K&&K.mode===G.mode?(V[V.length-1].data+=G.data,V):(V.push(G),V)},[])}(J))},F.rawSplit=function(V){return F.fromArray(E(V,_.isKanjiModeEnabled()))}},4860:(ne,F)=>{let I;const R=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];F.getSymbolSize=function(S){if(!S)throw new Error('"version" cannot be null or undefined');if(S<1||S>40)throw new Error('"version" should be in range from 1 to 40');return 4*S+17},F.getSymbolTotalCodewords=function(S){return R[S]},F.getBCHDigit=function(B){let S=0;for(;0!==B;)S++,B>>>=1;return S},F.setToSJISFunction=function(S){if("function"!=typeof S)throw new Error('"toSJISFunc" is not a valid function.');I=S},F.isKanjiModeEnabled=function(){return void 0!==I},F.toSJIS=function(S){return I(S)}},2316:(ne,F)=>{F.isValid=function(R){return!isNaN(R)&&R>=1&&R<=40}},6602:(ne,F,I)=>{const R=I(4860),B=I(6194),S=I(9020),T=I(6906),f=I(2316),_=R.getBCHDigit(7973);function C(P,A){return T.getCharCountIndicator(P,A)+4}function x(P,A){let O=0;return P.forEach(function(N){O+=C(N.mode,A)+N.getBitsLength()}),O}F.from=function(A,O){return f.isValid(A)?parseInt(A,10):O},F.getCapacity=function(A,O,N){if(!f.isValid(A))throw new Error("Invalid QR Code version");void 0===N&&(N=T.BYTE);const V=8*(R.getSymbolTotalCodewords(A)-B.getTotalCodewordsCount(A,O));if(N===T.MIXED)return V;const G=V-C(N,A);switch(N){case T.NUMERIC:return Math.floor(G/10*3);case T.ALPHANUMERIC:return Math.floor(G/11*2);case T.KANJI:return Math.floor(G/13);default:return Math.floor(G/8)}},F.getBestVersionForData=function(A,O){let N;const U=S.from(O,S.M);if(Array.isArray(A)){if(A.length>1)return function E(P,A){for(let O=1;O<=40;O++)if(x(P,O)<=F.getCapacity(O,A,T.MIXED))return O}(A,U);if(0===A.length)return 1;N=A[0]}else N=A;return function b(P,A,O){for(let N=1;N<=40;N++)if(A<=F.getCapacity(N,O,P))return N}(N.mode,N.getLength(),U)},F.getEncodedBits=function(A){if(!f.isValid(A)||A<7)throw new Error("Invalid QR Code version");let O=A<<12;for(;R.getBCHDigit(O)-_>=0;)O^=7973<{const R=I(714);F.render=function(f,M,_){let b=_,C=M;void 0===b&&(!M||!M.getContext)&&(b=M,M=void 0),M||(C=function S(){try{return document.createElement("canvas")}catch(T){throw new Error("You need to specify a canvas element")}}()),b=R.getOptions(b);const x=R.getImageWidth(f.modules.size,b),E=C.getContext("2d"),P=E.createImageData(x,x);return R.qrToImageData(P.data,f,b),function B(T,f,M){T.clearRect(0,0,f.width,f.height),f.style||(f.style={}),f.height=M,f.width=M,f.style.height=M+"px",f.style.width=M+"px"}(E,C,x),E.putImageData(P,0,0),C},F.renderToDataURL=function(f,M,_){let b=_;return void 0===b&&(!M||!M.getContext)&&(b=M,M=void 0),b||(b={}),F.render(f,M,b).toDataURL(b.type||"image/png",(b.rendererOpts||{}).quality)}},1036:(ne,F,I)=>{const R=I(714);function B(f,M){const _=f.a/255,b=M+'="'+f.hex+'"';return _<1?b+" "+M+'-opacity="'+_.toFixed(2).slice(1)+'"':b}function S(f,M,_){let b=f+M;return void 0!==_&&(b+=" "+_),b}F.render=function(M,_,b){const C=R.getOptions(_),x=M.modules.size,E=M.modules.data,P=x+2*C.margin,A=C.color.light.a?"':"",O="0&&A>0&&f[P-1]||(b+=x?S("M",A+_,.5+O+_):S("m",C,0),C=0,x=!1),A+1',H=''+A+O+"\n";return"function"==typeof b&&b(null,H),H}},714:(ne,F)=>{function I(R){if("number"==typeof R&&(R=R.toString()),"string"!=typeof R)throw new Error("Color should be defined as hex string");let B=R.slice().replace("#","").split("");if(B.length<3||5===B.length||B.length>8)throw new Error("Invalid hex color: "+R);(3===B.length||4===B.length)&&(B=Array.prototype.concat.apply([],B.map(function(T){return[T,T]}))),6===B.length&&B.push("F","F");const S=parseInt(B.join(""),16);return{r:S>>24&255,g:S>>16&255,b:S>>8&255,a:255&S,hex:"#"+B.slice(0,6).join("")}}F.getOptions=function(B){B||(B={}),B.color||(B.color={});const T=B.width&&B.width>=21?B.width:void 0;return{width:T,scale:T?4:B.scale||4,margin:null==B.margin||B.margin<0?4:B.margin,color:{dark:I(B.color.dark||"#000000ff"),light:I(B.color.light||"#ffffffff")},type:B.type,rendererOpts:B.rendererOpts||{}}},F.getScale=function(B,S){return S.width&&S.width>=B+2*S.margin?S.width/(B+2*S.margin):S.scale},F.getImageWidth=function(B,S){const T=F.getScale(B,S);return Math.floor((B+2*S.margin)*T)},F.qrToImageData=function(B,S,T){const f=S.modules.size,M=S.modules.data,_=F.getScale(f,T),b=Math.floor((f+2*T.margin)*_),C=T.margin*_,x=[T.color.light,T.color.dark];for(let E=0;E=C&&P>=C&&E{"use strict";function R(n){return"function"==typeof n}let B=!1;const S={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else B&&console.log("RxJS: Back to a better error behavior. Thank you. <3");B=n},get useDeprecatedSynchronousErrorHandling(){return B}};function T(n){setTimeout(()=>{throw n},0)}const f={closed:!0,next(n){},error(n){if(S.useDeprecatedSynchronousErrorHandling)throw n;T(n)},complete(){}},M=Array.isArray||(n=>n&&"number"==typeof n.length);function _(n){return null!==n&&"object"==typeof n}const C=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,r)=>`${r+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class x{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:r,_unsubscribe:i,_subscriptions:a}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof x)t.remove(this);else if(null!==t)for(let h=0;he.concat(t instanceof C?t.errors:t),[])}x.EMPTY=((n=new x).closed=!0,n);const P="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class O extends x{constructor(e,t,r){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=f;break;case 1:if(!e){this.destination=f;break}if("object"==typeof e){e instanceof O?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new N(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new N(this,e,t,r)}}[P](){return this}static create(e,t,r){const i=new O(e,t,r);return i.syncErrorThrowable=!1,i}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class N extends O{constructor(e,t,r,i){super(),this._parentSubscriber=e;let a,h=this;R(t)?a=t:t&&(a=t.next,r=t.error,i=t.complete,t!==f&&(h=Object.create(t),R(h.unsubscribe)&&this.add(h.unsubscribe.bind(h)),h.unsubscribe=this.unsubscribe.bind(this))),this._context=h,this._next=a,this._error=r,this._complete=i}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;S.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:r}=S;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):T(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;T(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);S.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(r){if(this.unsubscribe(),S.useDeprecatedSynchronousErrorHandling)throw r;T(r)}}__tryOrSetError(e,t,r){if(!S.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(i){return S.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=i,e.syncErrorThrown=!0,!0):(T(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const V="function"==typeof Symbol&&Symbol.observable||"@@observable";function G(n){return n}let Z=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const r=new n;return r.source=this,r.operator=t,r}subscribe(t,r,i){const{operator:a}=this,h=function H(n,e,t){if(n){if(n instanceof O)return n;if(n[P])return n[P]()}return n||e||t?new O(n,e,t):new O(f)}(t,r,i);if(h.add(a?a.call(h,this.source):this.source||S.useDeprecatedSynchronousErrorHandling&&!h.syncErrorThrowable?this._subscribe(h):this._trySubscribe(h)),S.useDeprecatedSynchronousErrorHandling&&h.syncErrorThrowable&&(h.syncErrorThrowable=!1,h.syncErrorThrown))throw h.syncErrorValue;return h}_trySubscribe(t){try{return this._subscribe(t)}catch(r){S.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=r),function U(n){for(;n;){const{closed:e,destination:t,isStopped:r}=n;if(e||r)return!1;n=t&&t instanceof O?t:null}return!0}(t)?t.error(r):console.warn(r)}}forEach(t,r){return new(r=z(r))((i,a)=>{let h;h=this.subscribe(v=>{try{t(v)}catch(D){a(D),h&&h.unsubscribe()}},a,i)})}_subscribe(t){const{source:r}=this;return r&&r.subscribe(t)}[V](){return this}pipe(...t){return 0===t.length?this:function X(n){return 0===n.length?G:1===n.length?n[0]:function(t){return n.reduce((r,i)=>i(r),t)}}(t)(this)}toPromise(t){return new(t=z(t))((r,i)=>{let a;this.subscribe(h=>a=h,h=>i(h),()=>r(a))})}}return n.create=e=>new n(e),n})();function z(n){if(n||(n=S.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const re=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ve extends x{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}class y extends O{constructor(e){super(e),this.destination=e}}let o=(()=>{class n extends Z{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[P](){return new y(this)}lift(t){const r=new l(this,this);return r.operator=t,r}next(t){if(this.closed)throw new re;if(!this.isStopped){const{observers:r}=this,i=r.length,a=r.slice();for(let h=0;hnew l(e,t),n})();class l extends o{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):x.EMPTY}}function c(n){return n&&"function"==typeof n.schedule}function u(n,e){return function(r){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new d(n,e))}}class d{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new m(e,this.project,this.thisArg))}}class m extends O{constructor(e,t,r){super(e),this.project=t,this.count=0,this.thisArg=r||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(r){return void this.destination.error(r)}this.destination.next(t)}}const w=n=>e=>{for(let t=0,r=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function be(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const ge=n=>{if(n&&"function"==typeof n[V])return(n=>e=>{const t=n[V]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(he(n))return w(n);if(be(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,T),e))(n);if(n&&"function"==typeof n[g])return(n=>e=>{const t=n[g]();for(;;){let r;try{r=t.next()}catch(i){return e.error(i),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${_(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function ce(n,e){return new Z(t=>{const r=new x;let i=0;return r.add(e.schedule(function(){i!==n.length?(t.next(n[i++]),t.closed||r.add(this.schedule())):t.complete()})),r})}function Me(n,e){return e?function _e(n,e){if(null!=n){if(function pe(n){return n&&"function"==typeof n[V]}(n))return function fe(n,e){return new Z(t=>{const r=new x;return r.add(e.schedule(()=>{const i=n[V]();r.add(i.subscribe({next(a){r.add(e.schedule(()=>t.next(a)))},error(a){r.add(e.schedule(()=>t.error(a)))},complete(){r.add(e.schedule(()=>t.complete()))}}))})),r})}(n,e);if(be(n))return function se(n,e){return new Z(t=>{const r=new x;return r.add(e.schedule(()=>n.then(i=>{r.add(e.schedule(()=>{t.next(i),r.add(e.schedule(()=>t.complete()))}))},i=>{r.add(e.schedule(()=>t.error(i)))}))),r})}(n,e);if(he(n))return ce(n,e);if(function ue(n){return n&&"function"==typeof n[g]}(n)||"string"==typeof n)return function ee(n,e){if(!n)throw new Error("Iterable cannot be null");return new Z(t=>{const r=new x;let i;return r.add(()=>{i&&"function"==typeof i.return&&i.return()}),r.add(e.schedule(()=>{i=n[g](),r.add(e.schedule(function(){if(t.closed)return;let a,h;try{const v=i.next();a=v.value,h=v.done}catch(v){return void t.error(v)}h?t.complete():(t.next(a),this.schedule())}))})),r})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof Z?n:new Z(ge(n))}class le extends O{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class Y extends O{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function Le(n,e){if(e.closed)return;if(n instanceof Z)return n.subscribe(e);let t;try{t=ge(n)(e)}catch(r){e.error(r)}return t}function xe(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?r=>r.pipe(xe((i,a)=>Me(n(i,a)).pipe(u((h,v)=>e(i,h,a,v))),t)):("number"==typeof e&&(t=e),r=>r.lift(new Ce(n,t)))}class Ce{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Re(e,this.project,this.concurrent))}}class Re extends Y{constructor(e,t,r=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function Oe(n=Number.POSITIVE_INFINITY){return xe(G,n)}function wt(n,e){return e?ce(n,e):new Z(w(n))}function Be(...n){let e=Number.POSITIVE_INFINITY,t=null,r=n[n.length-1];return c(r)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof r&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof Z?n[0]:Oe(e)(wt(n,t))}function oe(){return function(e){return e.lift(new te(e))}}class te{constructor(e){this.connectable=e}call(e,t){const{connectable:r}=this;r._refCount++;const i=new W(e,r),a=t.subscribe(i);return i.closed||(i.connection=r.connect()),a}}class W extends O{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:r}=this,i=e._connection;this.connection=null,i&&(!r||i===r)&&i.unsubscribe()}}class de extends Z{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new x,e.add(this.source.subscribe(new Ee(this.getSubject(),this))),e.closed&&(this._connection=null,e=x.EMPTY)),e}refCount(){return oe()(this)}}const Pe=(()=>{const n=de.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class Ee extends y{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class Je{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:r}=this,i=this.subjectFactory(),a=r(i).subscribe(e);return a.add(t.subscribe(i)),a}}function kt(){return new o}function tt(n){for(let e in n)if(n[e]===tt)return e;throw Error("Could not find renamed property on target object.")}function Dn(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function nt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(nt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ht(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ln=tt({__forward_ref__:tt});function We(n){return n.__forward_ref__=We,n.toString=function(){return nt(this())},n}function ze(n){return un(n)?n():n}function un(n){return"function"==typeof n&&n.hasOwnProperty(ln)&&n.__forward_ref__===We}class Ne extends Error{constructor(e,t){super(function Xt(n,e){return`NG0${Math.abs(n)}${e?": "+e:""}`}(e,t)),this.code=e}}function $e(n){return"string"==typeof n?n:null==n?"":String(n)}function et(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():$e(n)}function cn(n,e){const t=e?` in ${e}`:"";throw new Ne(-201,`No provider for ${et(n)} found${t}`)}function hn(n,e){null==n&&function Lt(n,e,t,r){throw new Error(`ASSERTION ERROR: ${n}`+(null==r?"":` [Expected=> ${t} ${r} ${e} <=Actual]`))}(e,n,null,"!=")}function xt(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function jt(n){return{providers:n.providers||[],imports:n.imports||[]}}function Rn(n){return Pn(n,ds)||Pn(n,o1)}function Pn(n,e){return n.hasOwnProperty(e)?n[e]:null}function Ea(n){return n&&(n.hasOwnProperty(xd)||n.hasOwnProperty(NS))?n[xd]:null}const ds=tt({\u0275prov:tt}),xd=tt({\u0275inj:tt}),o1=tt({ngInjectableDef:tt}),NS=tt({ngInjectorDef:tt});var en=(()=>((en=en||{})[en.Default=0]="Default",en[en.Host=1]="Host",en[en.Self=2]="Self",en[en.SkipSelf=4]="SkipSelf",en[en.Optional=8]="Optional",en))();let Sd;function ps(n){const e=Sd;return Sd=n,e}function s1(n,e,t){const r=Rn(n);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:t&en.Optional?null:void 0!==e?e:void cn(nt(n),"Injector")}function gs(n){return{toString:n}.toString()}var Yi=(()=>((Yi=Yi||{})[Yi.OnPush=0]="OnPush",Yi[Yi.Default=1]="Default",Yi))(),Qi=(()=>(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom"}(Qi||(Qi={})),Qi))();const BS="undefined"!=typeof globalThis&&globalThis,LS="undefined"!=typeof window&&window,FS="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Zn=BS||"undefined"!=typeof global&&global||LS||FS,xa={},Yn=[],xc=tt({\u0275cmp:tt}),Cd=tt({\u0275dir:tt}),Ad=tt({\u0275pipe:tt}),a1=tt({\u0275mod:tt}),zo=tt({\u0275fac:tt}),Fl=tt({__NG_ELEMENT_ID__:tt});let US=0;function Un(n){return gs(()=>{const t={},r={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===Yi.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||Yn,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Qi.Emulated,id:"c",styles:n.styles||Yn,_:null,setInput:null,schemas:n.schemas||null,tView:null},i=n.directives,a=n.features,h=n.pipes;return r.id+=US++,r.inputs=f1(n.inputs,t),r.outputs=f1(n.outputs),a&&a.forEach(v=>v(r)),r.directiveDefs=i?()=>("function"==typeof i?i():i).map(l1):null,r.pipeDefs=h?()=>("function"==typeof h?h():h).map(u1):null,r})}function l1(n){return jr(n)||function ms(n){return n[Cd]||null}(n)}function u1(n){return function Vs(n){return n[Ad]||null}(n)}const c1={};function _r(n){return gs(()=>{const e={type:n.type,bootstrap:n.bootstrap||Yn,declarations:n.declarations||Yn,imports:n.imports||Yn,exports:n.exports||Yn,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(c1[n.id]=n.type),e})}function f1(n,e){if(null==n)return xa;const t={};for(const r in n)if(n.hasOwnProperty(r)){let i=n[r],a=i;Array.isArray(i)&&(a=i[1],i=i[0]),t[i]=r,e&&(e[i]=a)}return t}const $t=Un;function Gr(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function jr(n){return n[xc]||null}function Pi(n,e){const t=n[a1]||null;if(!t&&!0===e)throw new Error(`Type ${nt(n)} does not have '\u0275mod' property.`);return t}function xo(n){return Array.isArray(n)&&"object"==typeof n[1]}function eo(n){return Array.isArray(n)&&!0===n[1]}function Id(n){return 0!=(8&n.flags)}function Tc(n){return 2==(2&n.flags)}function Dc(n){return 1==(1&n.flags)}function to(n){return null!==n.template}function GS(n){return 0!=(512&n[2])}function Gs(n,e){return n.hasOwnProperty(zo)?n[zo]:null}class WS{constructor(e,t,r){this.previousValue=e,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}}function qr(){return d1}function d1(n){return n.type.prototype.ngOnChanges&&(n.setInput=XS),ZS}function ZS(){const n=g1(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===xa)n.previous=e;else for(let r in e)t[r]=e[r];n.current=null,this.ngOnChanges(e)}}function XS(n,e,t,r){const i=g1(n)||function YS(n,e){return n[p1]=e}(n,{previous:xa,current:null}),a=i.current||(i.current={}),h=i.previous,v=this.declaredInputs[t],D=h[v];a[v]=new WS(D&&D.currentValue,e,h===xa),n[r]=e}qr.ngInherit=!0;const p1="__ngSimpleChanges__";function g1(n){return n[p1]||null}let kd;function Bd(){return void 0!==kd?kd:"undefined"!=typeof document?document:void 0}function pr(n){return!!n.listen}const m1={createRenderer:(n,e)=>Bd()};function Sr(n){for(;Array.isArray(n);)n=n[0];return n}function Ic(n,e){return Sr(e[n])}function _i(n,e){return Sr(e[n.index])}function Ld(n,e){return n.data[e]}function Da(n,e){return n[e]}function wi(n,e){const t=e[n];return xo(t)?t:t[0]}function v1(n){return 4==(4&n[2])}function Fd(n){return 128==(128&n[2])}function vs(n,e){return null==e?null:n[e]}function y1(n){n[18]=0}function Ud(n,e){n[5]+=e;let t=n,r=n[3];for(;null!==r&&(1===e&&1===t[5]||-1===e&&0===t[5]);)r[5]+=e,t=r,r=r[3]}const rn={lFrame:A1(null),bindingsEnabled:!0};function _1(){return rn.bindingsEnabled}function Et(){return rn.lFrame.lView}function Cn(){return rn.lFrame.tView}function ui(n){return rn.lFrame.contextLView=n,n[8]}function Rr(){let n=w1();for(;null!==n&&64===n.type;)n=n.parent;return n}function w1(){return rn.lFrame.currentTNode}function So(n,e){const t=rn.lFrame;t.currentTNode=n,t.isParent=e}function Hd(){return rn.lFrame.isParent}function Vd(){rn.lFrame.isParent=!1}function ei(){const n=rn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Ia(){return rn.lFrame.bindingIndex++}function Ko(n){const e=rn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function pC(n,e){const t=rn.lFrame;t.bindingIndex=t.bindingRootIndex=n,jd(e)}function jd(n){rn.lFrame.currentDirectiveIndex=n}function $d(n){const e=rn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function x1(){return rn.lFrame.currentQueryIndex}function zd(n){rn.lFrame.currentQueryIndex=n}function mC(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function S1(n,e,t){if(t&en.SkipSelf){let i=e,a=n;for(;!(i=i.parent,null!==i||t&en.Host||(i=mC(a),null===i||(a=a[15],10&i.type))););if(null===i)return!1;e=i,n=a}const r=rn.lFrame=C1();return r.currentTNode=e,r.lView=n,!0}function Oc(n){const e=C1(),t=n[1];rn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function C1(){const n=rn.lFrame,e=null===n?null:n.child;return null===e?A1(n):e}function A1(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function T1(){const n=rn.lFrame;return rn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const D1=T1;function Pc(){const n=T1();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function ti(){return rn.lFrame.selectedIndex}function ys(n){rn.lFrame.selectedIndex=n}function lr(){const n=rn.lFrame;return Ld(n.tView,n.selectedIndex)}function Nc(){rn.lFrame.currentNamespace="svg"}function kc(){!function _C(){rn.lFrame.currentNamespace=null}()}function Bc(n,e){for(let t=e.directiveStart,r=e.directiveEnd;t=r)break}else e[D]<0&&(n[18]+=65536),(v>11>16&&(3&n[2])===e){n[2]+=2048;try{a.call(v)}finally{}}}else try{a.call(v)}finally{}}class $l{constructor(e,t,r){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=r}}function Uc(n,e,t){const r=pr(n);let i=0;for(;ie){h=a-1;break}}}for(;a>16}(n),r=e;for(;t>0;)r=r[15],t--;return r}let Wd=!0;function Vc(n){const e=Wd;return Wd=n,e}let DC=0;function Gl(n,e){const t=Xd(n,e);if(-1!==t)return t;const r=e[1];r.firstCreatePass&&(n.injectorIndex=e.length,Zd(r.data,n),Zd(e,null),Zd(r.blueprint,null));const i=jc(n,e),a=n.injectorIndex;if(P1(i)){const h=Ra(i),v=Oa(i,e),D=v[1].data;for(let L=0;L<8;L++)e[a+L]=v[h+L]|D[h+L]}return e[a+8]=i,a}function Zd(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Xd(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function jc(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,r=null,i=e;for(;null!==i;){const a=i[1],h=a.type;if(r=2===h?a.declTNode:1===h?i[6]:null,null===r)return-1;if(t++,i=i[15],-1!==r.injectorIndex)return r.injectorIndex|t<<16}return-1}function $c(n,e,t){!function IC(n,e,t){let r;"string"==typeof t?r=t.charCodeAt(0)||0:t.hasOwnProperty(Fl)&&(r=t[Fl]),null==r&&(r=t[Fl]=DC++);const i=255&r;e.data[n+(i>>5)]|=1<=0?255&e:OC:e}(t);if("function"==typeof a){if(!S1(e,n,r))return r&en.Host?B1(i,t,r):L1(e,t,r,i);try{const h=a(r);if(null!=h||r&en.Optional)return h;cn(t)}finally{D1()}}else if("number"==typeof a){let h=null,v=Xd(n,e),D=-1,L=r&en.Host?e[16][6]:null;for((-1===v||r&en.SkipSelf)&&(D=-1===v?jc(n,e):e[v+8],-1!==D&&V1(r,!1)?(h=e[1],v=Ra(D),e=Oa(D,e)):v=-1);-1!==v;){const j=e[1];if(H1(a,v,j.data)){const Q=PC(v,e,t,h,r,L);if(Q!==U1)return Q}D=e[v+8],-1!==D&&V1(r,e[1].data[v+8]===L)&&H1(a,v,e)?(h=j,v=Ra(D),e=Oa(D,e)):v=-1}}}return L1(e,t,r,i)}const U1={};function OC(){return new Pa(Rr(),Et())}function PC(n,e,t,r,i,a){const h=e[1],v=h.data[n+8],j=zc(v,h,t,null==r?Tc(v)&&Wd:r!=h&&0!=(3&v.type),i&en.Host&&a===v);return null!==j?Kl(e,h,j,v):U1}function zc(n,e,t,r,i){const a=n.providerIndexes,h=e.data,v=1048575&a,D=n.directiveStart,j=a>>20,me=i?v+j:n.directiveEnd;for(let ye=r?v:v+j;ye=D&&Te.type===t)return ye}if(i){const ye=h[D];if(ye&&to(ye)&&ye.type===t)return D}return null}function Kl(n,e,t,r){let i=n[t];const a=e.data;if(function xC(n){return n instanceof $l}(i)){const h=i;h.resolving&&function pn(n,e){const t=e?`. Dependency path: ${e.join(" > ")} > ${n}`:"";throw new Ne(-200,`Circular dependency in DI detected for ${n}${t}`)}(et(a[t]));const v=Vc(h.canSeeViewProviders);h.resolving=!0;const D=h.injectImpl?ps(h.injectImpl):null;S1(n,r,en.Default);try{i=n[t]=h.factory(void 0,a,n,r),e.firstCreatePass&&t>=r.directiveStart&&function MC(n,e,t){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:a}=e.type.prototype;if(r){const h=d1(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,h),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,h)}i&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,i),a&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,a),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,a))}(t,a[t],e)}finally{null!==D&&ps(D),Vc(v),h.resolving=!1,D1()}}return i}function H1(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[zo]||Yd(e),r=Object.prototype;let i=Object.getPrototypeOf(n.prototype).constructor;for(;i&&i!==r;){const a=i[zo]||Yd(i);if(a&&a!==t)return a;i=Object.getPrototypeOf(i)}return a=>new a})}function Yd(n){return un(n)?()=>{const e=Yd(ze(n));return e&&e()}:Gs(n)}const ka="__parameters__";function La(n,e,t){return gs(()=>{const r=function Qd(n){return function(...t){if(n){const r=n(...t);for(const i in r)this[i]=r[i]}}}(e);function i(...a){if(this instanceof i)return r.apply(this,a),this;const h=new i(...a);return v.annotation=h,v;function v(D,L,j){const Q=D.hasOwnProperty(ka)?D[ka]:Object.defineProperty(D,ka,{value:[]})[ka];for(;Q.length<=j;)Q.push(null);return(Q[j]=Q[j]||[]).push(h),D}}return t&&(i.prototype=Object.create(t.prototype)),i.prototype.ngMetadataName=n,i.annotationCls=i,i})}class Kt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=xt({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const BC=new Kt("AnalyzeForEntryComponents");function Bi(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Co(t,e):e(t))}function $1(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Gc(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Xl(n,e){const t=[];for(let r=0;r=0?n[1|r]=t:(r=~r,function UC(n,e,t,r){let i=n.length;if(i==e)n.push(t,r);else if(1===i)n.push(r,n[0]),n[0]=t;else{for(i--,n.push(n[i-1],n[i]);i>e;)n[i]=n[i-2],i--;n[e]=t,n[e+1]=r}}(n,r,e,t)),r}function e0(n,e){const t=Fa(n,e);if(t>=0)return n[1|t]}function Fa(n,e){return function K1(n,e,t){let r=0,i=n.length>>t;for(;i!==r;){const a=r+(i-r>>1),h=n[a<e?i=a:r=a+1}return~(i<({token:n})),-1),_s=Jl(La("Optional"),8),eu=Jl(La("SkipSelf"),4);var Ei=(()=>((Ei=Ei||{})[Ei.Important=1]="Important",Ei[Ei.DashCase=2]="DashCase",Ei))();const ry="__ngContext__";function Wr(n,e){n[ry]=e}function a0(n){const e=function nu(n){return n[ry]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function u0(n,e){return undefined(n,e)}function ru(n){const e=n[3];return eo(e)?e[3]:e}function c0(n){return cy(n[13])}function f0(n){return cy(n[4])}function cy(n){for(;null!==n&&!eo(n);)n=n[4];return n}function Ha(n,e,t,r,i){if(null!=r){let a,h=!1;eo(r)?a=r:xo(r)&&(h=!0,r=r[0]);const v=Sr(r);0===n&&null!==t?null==i?my(e,t,v):Ks(e,t,v,i||null,!0):1===n&&null!==t?Ks(e,t,v,i||null,!0):2===n?function y0(n,e,t){const r=Xc(n,e);r&&function TA(n,e,t,r){pr(n)?n.removeChild(e,t,r):e.removeChild(t)}(n,r,e,t)}(e,v,h):3===n&&e.destroyNode(v),null!=a&&function RA(n,e,t,r,i){const a=t[7];a!==Sr(t)&&Ha(e,n,r,a,i);for(let v=10;v0&&(n[t-1][4]=r[4]);const a=Gc(n,10+e);!function _A(n,e){iu(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(r[1],r);const h=a[19];null!==h&&h.detachView(a[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function dy(n,e){if(!(256&e[2])){const t=e[11];pr(t)&&t.destroyNode&&iu(n,e,t,3,null,null),function EA(n){let e=n[13];if(!e)return g0(n[1],n);for(;e;){let t=null;if(xo(e))t=e[13];else{const r=e[10];r&&(t=r)}if(!t){for(;e&&!e[4]&&e!==n;)xo(e)&&g0(e[1],e),e=e[3];null===e&&(e=n),xo(e)&&g0(e[1],e),t=e&&e[4]}e=t}}(e)}}function g0(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function AA(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let r=0;r=0?r[i=L]():r[i=-L].unsubscribe(),a+=2}else{const h=r[i=t[a+1]];t[a].call(h)}if(null!==r){for(let a=i+1;an,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Jc}())||void 0===e?void 0:e.createHTML(n))||n}function Sy(n){var e;return(null===(e=function M0(){if(void 0===ef&&(ef=null,Zn.trustedTypes))try{ef=Zn.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return ef}())||void 0===e?void 0:e.createHTML(n))||n}class Ws{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class BA extends Ws{getTypeName(){return"HTML"}}class LA extends Ws{getTypeName(){return"Style"}}class FA extends Ws{getTypeName(){return"Script"}}class UA extends Ws{getTypeName(){return"URL"}}class HA extends Ws{getTypeName(){return"ResourceURL"}}function xi(n){return n instanceof Ws?n.changingThisBreaksApplicationSecurity:n}function Ao(n,e){const t=Ty(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Ty(n){return n instanceof Ws&&n.getTypeName()||null}class KA{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(qs(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class qA{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const r=this.inertDocument.createElement("body");t.appendChild(r)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=qs(e),t;const r=this.inertDocument.createElement("body");return r.innerHTML=qs(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(r),r}stripCustomNsAttrs(e){const t=e.attributes;for(let i=t.length-1;0ou(e.trim())).join(", ")}function To(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function su(...n){const e={};for(const t of n)for(const r in t)t.hasOwnProperty(r)&&(e[r]=!0);return e}const Ry=To("area,br,col,hr,img,wbr"),Oy=To("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Py=To("rp,rt"),E0=su(Ry,su(Oy,To("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),su(Py,To("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),su(Py,Oy)),x0=To("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),S0=To("srcset"),Ny=su(x0,S0,To("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),To("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),YA=To("script,style,template");class QA{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,r=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?r=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,r&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let i=this.checkClobberedElement(t,t.nextSibling);if(i){t=i;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!E0.hasOwnProperty(t))return this.sanitizedSomething=!0,!YA.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const r=e.attributes;for(let i=0;i"),!0}endElement(e){const t=e.nodeName.toLowerCase();E0.hasOwnProperty(t)&&!Ry.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(ky(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const JA=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,e4=/([^\#-~ |!])/g;function ky(n){return n.replace(/&/g,"&").replace(JA,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(e4,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let tf;function By(n,e){let t=null;try{tf=tf||function Dy(n){const e=new qA(n);return function WA(){try{return!!(new window.DOMParser).parseFromString(qs(""),"text/html")}catch(n){return!1}}()?new KA(e):e}(n);let r=e?String(e):"";t=tf.getInertBodyElement(r);let i=5,a=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=a,a=t.innerHTML,t=tf.getInertBodyElement(r)}while(r!==a);return qs((new QA).sanitizeChildren(C0(t)||t))}finally{if(t){const r=C0(t)||t;for(;r.firstChild;)r.removeChild(r.firstChild)}}}function C0(n){return"content"in n&&function t4(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var Qn=(()=>((Qn=Qn||{})[Qn.NONE=0]="NONE",Qn[Qn.HTML=1]="HTML",Qn[Qn.STYLE=2]="STYLE",Qn[Qn.SCRIPT=3]="SCRIPT",Qn[Qn.URL=4]="URL",Qn[Qn.RESOURCE_URL=5]="RESOURCE_URL",Qn))();function nf(n){const e=au();return e?Sy(e.sanitize(Qn.HTML,n)||""):Ao(n,"HTML")?Sy(xi(n)):By(Bd(),$e(n))}function ws(n){const e=au();return e?e.sanitize(Qn.URL,n)||"":Ao(n,"URL")?xi(n):ou($e(n))}function au(){const n=Et();return n&&n[12]}function T0(n){return n.ngOriginalError}function f4(n,...e){n.error(...e)}class lu{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),r=function c4(n){return n&&n.ngErrorLogger||f4}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t)}_findOriginalError(e){let t=e&&T0(e);for(;t&&T0(t);)t=T0(t);return t||null}}const y4=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Zn))();function D0(n){return n.ownerDocument.defaultView}function Do(n){return n instanceof Function?n():n}function Uy(n,e,t){let r=n.length;for(;;){const i=n.indexOf(e,t);if(-1===i)return i;if(0===i||n.charCodeAt(i-1)<=32){const a=e.length;if(i+a===r||n.charCodeAt(i+a)<=32)return i}t=i+1}}const Hy="ng-template";function w4(n,e,t){let r=0;for(;ra?"":i[Q+1].toLowerCase();const ye=8&r?me:null;if(ye&&-1!==Uy(ye,L,0)||2&r&&L!==me){if(no(r))return!1;h=!0}}}}else{if(!h&&!no(r)&&!no(D))return!1;if(h&&no(D))continue;h=!1,r=D|1&r}}return no(r)||h}function no(n){return 0==(1&n)}function x4(n,e,t,r){if(null===e)return-1;let i=0;if(r||!t){let a=!1;for(;i-1)for(t++;t0?'="'+v+'"':"")+"]"}else 8&r?i+="."+h:4&r&&(i+=" "+h);else""!==i&&!no(h)&&(e+=$y(a,i),i=""),r=h,a=a||!no(r);t++}return""!==i&&(e+=$y(a,i)),e}const on={};function bt(n){zy(Cn(),Et(),ti()+n,!1)}function zy(n,e,t,r){if(!r)if(3==(3&e[2])){const a=n.preOrderCheckHooks;null!==a&&Lc(e,a,t)}else{const a=n.preOrderHooks;null!==a&&Fc(e,a,0,t)}ys(t)}function rf(n,e){return n<<17|e<<2}function ro(n){return n>>17&32767}function I0(n){return 2|n}function qo(n){return(131068&n)>>2}function R0(n,e){return-131069&n|e<<2}function O0(n){return 1|n}function tb(n,e){const t=n.contentQueries;if(null!==t)for(let r=0;r20&&zy(n,e,20,!1),t(r,i)}finally{ys(a)}}function rb(n,e,t){if(Id(e)){const i=e.directiveEnd;for(let a=e.directiveStart;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(v)!=D&&v.push(D),v.push(r,i,h)}}function fb(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function hb(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function i5(n,e,t){if(t){if(e.exportAs)for(let r=0;r0&&K0(t)}}function K0(n){for(let r=c0(n);null!==r;r=f0(r))for(let i=10;i0&&K0(a)}const t=n[1].components;if(null!==t)for(let r=0;r0&&K0(i)}}function f5(n,e){const t=wi(e,n),r=t[1];(function h5(n,e){for(let t=e.length;tPromise.resolve(null))();function vb(n){return n[7]||(n[7]=[])}function yb(n){return n.cleanup||(n.cleanup=[])}function _b(n,e){const t=n[9],r=t?t.get(lu,null):null;r&&r.handleError(e)}function wb(n,e,t,r,i){for(let a=0;athis.processProvider(v,e,t)),Co([e],v=>this.processInjectorType(v,[],a)),this.records.set(Y0,Ga(void 0,this));const h=this.records.get(Q0);this.scope=null!=h?h.value:null,this.source=i||("object"==typeof e?null:nt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=Yl,r=en.Default){this.assertNotDestroyed();const i=Z1(this),a=ps(void 0);try{if(!(r&en.SkipSelf)){let v=this.records.get(e);if(void 0===v){const D=function C5(n){return"function"==typeof n||"object"==typeof n&&n instanceof Kt}(e)&&Rn(e);v=D&&this.injectableDefInScope(D)?Ga(ep(e),fu):null,this.records.set(e,v)}if(null!=v)return this.hydrate(e,v)}return(r&en.Self?Eb():this.parent).get(e,t=r&en.Optional&&t===Yl?null:t)}catch(h){if("NullInjectorError"===h.name){if((h[qc]=h[qc]||[]).unshift(nt(e)),i)throw h;return function QC(n,e,t,r){const i=n[qc];throw e[W1]&&i.unshift(e[W1]),n.message=function JC(n,e,t,r=null){n=n&&"\n"===n.charAt(0)&&"\u0275"==n.charAt(1)?n.substr(2):n;let i=nt(e);if(Array.isArray(e))i=e.map(nt).join(" -> ");else if("object"==typeof e){let a=[];for(let h in e)if(e.hasOwnProperty(h)){let v=e[h];a.push(h+":"+("string"==typeof v?JSON.stringify(v):nt(v)))}i=`{${a.join(", ")}}`}return`${t}${r?"("+r+")":""}[${i}]: ${n.replace(KC,"\n ")}`}("\n"+n.message,i,t,r),n.ngTokenPath=i,n[qc]=null,n}(h,e,"R3InjectorError",this.source)}throw h}finally{ps(a),Z1(i)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((r,i)=>e.push(nt(i))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Ne(205,!1)}processInjectorType(e,t,r){if(!(e=ze(e)))return!1;let i=Ea(e);const a=null==i&&e.ngModule||void 0,h=void 0===a?e:a,v=-1!==r.indexOf(h);if(void 0!==a&&(i=Ea(a)),null==i)return!1;if(null!=i.imports&&!v){let j;r.push(h);try{Co(i.imports,Q=>{this.processInjectorType(Q,t,r)&&(void 0===j&&(j=[]),j.push(Q))})}finally{}if(void 0!==j)for(let Q=0;Qthis.processProvider(Te,me,ye||Yn))}}this.injectorDefTypes.add(h);const D=Gs(h)||(()=>new h);this.records.set(h,Ga(D,fu));const L=i.providers;if(null!=L&&!v){const j=e;Co(L,Q=>this.processProvider(Q,j,L))}return void 0!==a&&void 0!==e.providers}processProvider(e,t,r){let i=Ka(e=ze(e))?e:ze(e&&e.provide);const a=function _5(n,e,t){return Ab(n)?Ga(void 0,n.useValue):Ga(Cb(n),fu)}(e);if(Ka(e)||!0!==e.multi)this.records.get(i);else{let h=this.records.get(i);h||(h=Ga(void 0,fu,!0),h.factory=()=>r0(h.multi),this.records.set(i,h)),i=e,h.multi.push(e)}this.records.set(i,a)}hydrate(e,t){return t.value===fu&&(t.value=v5,t.value=t.factory()),"object"==typeof t.value&&t.value&&function S5(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ze(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function ep(n){const e=Rn(n),t=null!==e?e.factory:Gs(n);if(null!==t)return t;if(n instanceof Kt)throw new Ne(204,!1);if(n instanceof Function)return function b5(n){const e=n.length;if(e>0)throw Xl(e,"?"),new Ne(204,!1);const t=function Fn(n){const e=n&&(n[ds]||n[o1]);if(e){const t=function Ll(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Ne(204,!1)}function Cb(n,e,t){let r;if(Ka(n)){const i=ze(n);return Gs(i)||ep(i)}if(Ab(n))r=()=>ze(n.useValue);else if(function M5(n){return!(!n||!n.useFactory)}(n))r=()=>n.useFactory(...r0(n.deps||[]));else if(function w5(n){return!(!n||!n.useExisting)}(n))r=()=>Mt(ze(n.useExisting));else{const i=ze(n&&(n.useClass||n.provide));if(!function x5(n){return!!n.deps}(n))return Gs(i)||ep(i);r=()=>new i(...r0(n.deps))}return r}function Ga(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function Ab(n){return null!==n&&"object"==typeof n&&WC in n}function Ka(n){return"function"==typeof n}let Cr=(()=>{class n{static create(t,r){var i;if(Array.isArray(t))return xb({name:""},r,t,"");{const a=null!==(i=t.name)&&void 0!==i?i:"";return xb({name:a},t.parent,t.providers,a)}}}return n.THROW_IF_NOT_FOUND=Yl,n.NULL=new Mb,n.\u0275prov=xt({token:n,providedIn:"any",factory:()=>Mt(Y0)}),n.__NG_ELEMENT_ID__=-1,n})();function N5(n,e){Bc(a0(n)[1],Rr())}function Hn(n){let e=function Ub(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const r=[n];for(;e;){let i;if(to(n))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Ne(903,"");i=e.\u0275dir}if(i){if(t){r.push(i);const h=n;h.inputs=rp(n.inputs),h.declaredInputs=rp(n.declaredInputs),h.outputs=rp(n.outputs);const v=i.hostBindings;v&&F5(n,v);const D=i.viewQuery,L=i.contentQueries;if(D&&B5(n,D),L&&L5(n,L),Dn(n.inputs,i.inputs),Dn(n.declaredInputs,i.declaredInputs),Dn(n.outputs,i.outputs),to(i)&&i.data.animation){const j=n.data;j.animation=(j.animation||[]).concat(i.data.animation)}}const a=i.features;if(a)for(let h=0;h=0;r--){const i=n[r];i.hostVars=e+=i.hostVars,i.hostAttrs=Hc(i.hostAttrs,t=Hc(t,i.hostAttrs))}}(r)}function rp(n){return n===xa?{}:n===Yn?[]:n}function B5(n,e){const t=n.viewQuery;n.viewQuery=t?(r,i)=>{e(r,i),t(r,i)}:e}function L5(n,e){const t=n.contentQueries;n.contentQueries=t?(r,i,a)=>{e(r,i,a),t(r,i,a)}:e}function F5(n,e){const t=n.hostBindings;n.hostBindings=t?(r,i)=>{e(r,i),t(r,i)}:e}let cf=null;function qa(){if(!cf){const n=Zn.Symbol;if(n&&n.iterator)cf=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;tv(Sr(At[r.index])):r.index;if(pr(t)){let At=null;if(!v&&D&&(At=function g8(n,e,t,r){const i=n.cleanup;if(null!=i)for(let a=0;aD?v[D]:null}"string"==typeof h&&(a+=2)}return null}(n,e,i,r.index)),null!==At)(At.__ngLastListenerFn__||At).__ngNextListenerFn__=a,At.__ngLastListenerFn__=a,ye=!1;else{a=hp(r,e,Q,a,!1);const Nt=t.listen(gt,i,a);me.push(a,Nt),j&&j.push(i,_t,Ie,Ie+1)}}else a=hp(r,e,Q,a,!0),gt.addEventListener(i,a,h),me.push(a),j&&j.push(i,_t,Ie,h)}else a=hp(r,e,Q,a,!1);const Te=r.outputs;let Ve;if(ye&&null!==Te&&(Ve=Te[i])){const je=Ve.length;if(je)for(let gt=0;gt0;)e=e[15],n--;return e}(n,rn.lFrame.contextLView))[8]}(n)}function m8(n,e){let t=null;const r=function S4(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let i=0;i=0}const Pr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function M_(n){return n.substring(Pr.key,Pr.keyEnd)}function E_(n,e){const t=Pr.textEnd;return t===e?-1:(e=Pr.keyEnd=function E8(n,e,t){for(;e32;)e++;return e}(n,Pr.key=e,t),il(n,e,t))}function il(n,e,t){for(;e=0;t=E_(e,t))Mi(n,M_(e),!0)}function ao(n,e,t,r){const i=Et(),a=Cn(),h=Ko(2);a.firstUpdatePass&&D_(a,n,h,r),e!==on&&Zr(i,h,e)&&R_(a,a.data[ti()],i,i[11],n,i[h+1]=function P8(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=nt(xi(n)))),n}(e,t),r,h)}function T_(n,e){return e>=n.expandoStartIndex}function D_(n,e,t,r){const i=n.data;if(null===i[t+1]){const a=i[ti()],h=T_(n,t);P_(a,r)&&null===e&&!h&&(e=!1),e=function A8(n,e,t,r){const i=$d(n);let a=r?e.residualClasses:e.residualStyles;if(null===i)0===(r?e.classBindings:e.styleBindings)&&(t=mu(t=dp(null,n,e,t,r),e.attrs,r),a=null);else{const h=e.directiveStylingLast;if(-1===h||n[h]!==i)if(t=dp(i,n,e,t,r),null===a){let D=function T8(n,e,t){const r=t?e.classBindings:e.styleBindings;if(0!==qo(r))return n[ro(r)]}(n,e,r);void 0!==D&&Array.isArray(D)&&(D=dp(null,n,e,D[1],r),D=mu(D,e.attrs,r),function D8(n,e,t,r){n[ro(t?e.classBindings:e.styleBindings)]=r}(n,e,r,D))}else a=function I8(n,e,t){let r;const i=e.directiveEnd;for(let a=1+e.directiveStylingLast;a0)&&(L=!0)}else j=t;if(i)if(0!==D){const me=ro(n[v+1]);n[r+1]=rf(me,v),0!==me&&(n[me+1]=R0(n[me+1],r)),n[v+1]=function O4(n,e){return 131071&n|e<<17}(n[v+1],r)}else n[r+1]=rf(v,0),0!==v&&(n[v+1]=R0(n[v+1],r)),v=r;else n[r+1]=rf(D,0),0===v?v=r:n[D+1]=R0(n[D+1],r),D=r;L&&(n[r+1]=I0(n[r+1])),w_(n,j,r,!0),w_(n,j,r,!1),function y8(n,e,t,r,i){const a=i?n.residualClasses:n.residualStyles;null!=a&&"string"==typeof e&&Fa(a,e)>=0&&(t[r+1]=O0(t[r+1]))}(e,j,n,r,a),h=rf(v,D),a?e.classBindings=h:e.styleBindings=h}(i,a,e,t,h,r)}}function dp(n,e,t,r,i){let a=null;const h=t.directiveEnd;let v=t.directiveStylingLast;for(-1===v?v=t.directiveStart:v++;v0;){const D=n[i],L=Array.isArray(D),j=L?D[1]:D,Q=null===j;let me=t[i+1];me===on&&(me=Q?Yn:void 0);let ye=Q?e0(me,r):j===r?me:void 0;if(L&&!pf(ye)&&(ye=e0(D,r)),pf(ye)&&(v=ye,h))return v;const Te=n[i+1];i=h?ro(Te):qo(Te)}if(null!==e){let D=a?e.residualClasses:e.residualStyles;null!=D&&(v=e0(D,r))}return v}function pf(n){return void 0!==n}function P_(n,e){return 0!=(n.flags&(e?16:32))}function ft(n,e=""){const t=Et(),r=Cn(),i=n+20,a=r.firstCreatePass?ja(r,i,1,e,null):r.data[i],h=t[i]=function h0(n,e){return pr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yc(r,t,h,a),So(a,!1)}function Nr(n){return Vn("",n,""),Nr}function Vn(n,e,t){const r=Et(),i=Za(r,n,e,t);return i!==on&&Wo(r,ti(),i),Vn}function gf(n,e,t,r,i){const a=Et(),h=Xa(a,n,e,t,r,i);return h!==on&&Wo(a,ti(),h),gf}function pp(n,e,t){const r=Et();if(Zr(r,Ia(),e)){const a=Cn(),h=lr();Si(a,h,r,n,e,function bb(n,e,t){return(null===n||to(n))&&(t=function iC(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}($d(a.data),h,r),t,!0)}return pp}const mf="en-US";let J_=mf;function vp(n,e,t,r,i){if(n=ze(n),Array.isArray(n))for(let a=0;a>20;if(Ka(n)||!n.multi){const ye=new $l(D,i,ot),Te=bp(v,e,i?j:j+me,Q);-1===Te?($c(Gl(L,h),a,v),yp(a,n,e.length),e.push(v),L.directiveStart++,L.directiveEnd++,i&&(L.providerIndexes+=1048576),t.push(ye),h.push(ye)):(t[Te]=ye,h[Te]=ye)}else{const ye=bp(v,e,j+me,Q),Te=bp(v,e,j,j+me),Ve=ye>=0&&t[ye],je=Te>=0&&t[Te];if(i&&!je||!i&&!Ve){$c(Gl(L,h),a,v);const gt=function QT(n,e,t,r,i){const a=new $l(n,t,ot);return a.multi=[],a.index=e,a.componentProviders=0,Ew(a,i,r&&!t),a}(i?YT:XT,t.length,i,r,D);!i&&je&&(t[Te].providerFactory=gt),yp(a,n,e.length,0),e.push(v),L.directiveStart++,L.directiveEnd++,i&&(L.providerIndexes+=1048576),t.push(gt),h.push(gt)}else yp(a,n,ye>-1?ye:Te,Ew(t[i?Te:ye],D,!i&&r));!i&&r&&je&&t[Te].componentProviders++}}}function yp(n,e,t,r){const i=Ka(e),a=function E5(n){return!!n.useClass}(e);if(i||a){const D=(a?ze(e.useClass):e).prototype.ngOnDestroy;if(D){const L=n.destroyHooks||(n.destroyHooks=[]);if(!i&&e.multi){const j=L.indexOf(t);-1===j?L.push(t,[r,D]):L[j+1].push(r,D)}else L.push(t,D)}}}function Ew(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function bp(n,e,t,r){for(let i=t;i{t.providersResolver=(r,i)=>function ZT(n,e,t){const r=Cn();if(r.firstCreatePass){const i=to(n);vp(t,r.data,r.blueprint,i,!0),vp(e,r.data,r.blueprint,i,!1)}}(r,i?i(n):n,e)}}class xw{}class tD{resolveComponentFactory(e){throw function eD(n){const e=Error(`No component factory found for ${nt(n)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=n,e}(e)}}let Ys=(()=>{class n{}return n.NULL=new tD,n})();function nD(){return ll(Rr(),Et())}function ll(n,e){return new kr(_i(n,e))}let kr=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=nD,n})();function rD(n){return n instanceof kr?n.nativeElement:n}class Qs{}let Fi=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>function oD(){const n=Et(),t=wi(Rr().index,n);return function iD(n){return n[11]}(xo(t)?t:n)}(),n})(),sD=(()=>{class n{}return n.\u0275prov=xt({token:n,providedIn:"root",factory:()=>null}),n})();class wu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const aD=new wu("13.4.0"),wp={};function wf(n,e,t,r,i=!1){for(;null!==t;){const a=e[t.index];if(null!==a&&r.push(Sr(a)),eo(a))for(let v=10;v-1&&(p0(e,r),Gc(t,r))}this._attachedToViewContainer=!1}dy(this._lView[1],this._lView)}onDestroy(e){ab(this._lView[1],this._lView,null,e)}markForCheck(){q0(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){!function Z0(n,e,t){const r=e[10];r.begin&&r.begin();try{za(n,e,n.template,t)}catch(i){throw _b(e,i),i}finally{r.end&&r.end()}}(this._lView[1],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Ne(902,"");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function MA(n,e){iu(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Ne(902,"");this._appRef=e}}class lD extends Mu{constructor(e){super(e),this._view=e}detectChanges(){mb(this._view)}checkNoChanges(){}get context(){return null}}class Cw extends Ys{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){const t=jr(e);return new Mp(t,this.ngModule)}}function Aw(n){const e=[];for(let t in n)n.hasOwnProperty(t)&&e.push({propName:n[t],templateName:t});return e}class Mp extends xw{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function I4(n){return n.map(D4).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return Aw(this.componentDef.inputs)}get outputs(){return Aw(this.componentDef.outputs)}create(e,t,r,i){const a=(i=i||this.ngModule)?function cD(n,e){return{get:(t,r,i)=>{const a=n.get(t,wp,i);return a!==wp||r===wp?a:e.get(t,r,i)}}}(e,i.injector):e,h=a.get(Qs,m1),v=a.get(sD,null),D=h.createRenderer(null,this.componentDef),L=this.componentDef.selectors[0][0]||"div",j=r?function sb(n,e,t){if(pr(n))return n.selectRootElement(e,t===Qi.ShadowDom);let r="string"==typeof e?n.querySelector(e):e;return r.textContent="",r}(D,r,this.componentDef.encapsulation):d0(h.createRenderer(null,this.componentDef),L,function uD(n){const e=n.toLowerCase();return"svg"===e?"svg":"math"===e?"math":null}(L)),Q=this.componentDef.onPush?576:528,me=function Fb(n,e){return{components:[],scheduler:n||y4,clean:p5,playerHandler:e||null,flags:0}}(),ye=af(0,null,null,1,0,null,null,null,null,null),Te=uu(null,ye,me,Q,null,null,h,D,v,a);let Ve,je;Oc(Te);try{const gt=function Bb(n,e,t,r,i,a){const h=t[1];t[20]=n;const D=ja(h,20,2,"#host",null),L=D.mergedAttrs=e.hostAttrs;null!==L&&(uf(D,L,!0),null!==n&&(Uc(i,n,L),null!==D.classes&&_0(i,n,D.classes),null!==D.styles&&xy(i,n,D.styles)));const j=r.createRenderer(n,e),Q=uu(t,ib(e),null,e.onPush?64:16,t[20],D,r,j,a||null,null);return h.firstCreatePass&&($c(Gl(D,t),h,e.type),hb(h,D),db(D,t.length,1)),lf(t,Q),t[20]=Q}(j,this.componentDef,Te,h,D);if(j)if(r)Uc(D,j,["ng-version",aD.full]);else{const{attrs:Ie,classes:_t}=function R4(n){const e=[],t=[];let r=1,i=2;for(;r0&&_0(D,j,_t.join(" "))}if(je=Ld(ye,20),void 0!==t){const Ie=je.projection=[];for(let _t=0;_tD(h,e)),e.contentQueries){const D=Rr();e.contentQueries(1,h,D.directiveStart)}const v=Rr();return!a.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(ys(v.index),cb(t[1],v,0,v.directiveStart,v.directiveEnd,e),fb(e,h)),h}(gt,this.componentDef,Te,me,[N5]),cu(ye,Te,null)}finally{Pc()}return new hD(this.componentType,Ve,ll(je,Te),Te,je)}}class hD extends class JT{}{constructor(e,t,r,i,a){super(),this.location=r,this._rootLView=i,this._tNode=a,this.instance=t,this.hostView=this.changeDetectorRef=new lD(i),this.componentType=e}get injector(){return new Pa(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}class Yo{}class Tw{}const ul=new Map;class Rw extends Yo{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new Cw(this);const r=Pi(e);this._bootstrapComponents=Do(r.bootstrap),this._r3Injector=Sb(e,t,[{provide:Yo,useValue:this},{provide:Ys,useValue:this.componentFactoryResolver}],nt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Cr.THROW_IF_NOT_FOUND,r=en.Default){return e===Cr||e===Yo||e===Y0?this:this._r3Injector.get(e,t,r)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class Ep extends Tw{constructor(e){super(),this.moduleType=e,null!==Pi(e)&&function pD(n){const e=new Set;!function t(r){const i=Pi(r,!0),a=i.id;null!==a&&(function Dw(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${nt(e)} vs ${nt(e.name)}`)}(a,ul.get(a),r),ul.set(a,r));const h=Do(i.imports);for(const v of h)e.has(v)||(e.add(v),t(v))}(n)}(e)}create(e){return new Rw(this.moduleType,e)}}function Eu(n,e){const t=n[e];return t===on?void 0:t}function Qo(n,e){const t=Cn();let r;const i=n+20;t.firstCreatePass?(r=function SD(n,e){if(e)for(let t=e.length-1;t>=0;t--){const r=e[t];if(n===r.name)return r}}(e,t.pipeRegistry),t.data[i]=r,r.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(i,r.onDestroy)):r=t.data[i];const a=r.factory||(r.factory=Gs(r.type)),h=ps(ot);try{const v=Vc(!1),D=a();return Vc(v),function K5(n,e,t,r){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=r}(t,Et(),i,D),D}finally{ps(h)}}function Js(n,e,t){const r=n+20,i=Et(),a=Da(i,r);return xu(i,r)?function Ow(n,e,t,r,i,a){const h=e+t;return Zr(n,h,i)?Ro(n,h+1,a?r.call(a,i):r(i)):Eu(n,h+1)}(i,ei(),e,a.transform,t,a):a.transform(t)}function xp(n,e,t,r){const i=n+20,a=Et(),h=Da(a,i);return xu(a,i)?function Pw(n,e,t,r,i,a,h){const v=e+t;return Zs(n,v,i,a)?Ro(n,v+2,h?r.call(h,i,a):r(i,a)):Eu(n,v+2)}(a,ei(),e,h.transform,t,r,h):h.transform(t,r)}function xu(n,e){return n[1].data[e].pure}function Sp(n){return e=>{setTimeout(n,void 0,e)}}const vn=class DD extends o{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,r){var i,a,h;let v=e,D=t||(()=>null),L=r;if(e&&"object"==typeof e){const Q=e;v=null===(i=Q.next)||void 0===i?void 0:i.bind(Q),D=null===(a=Q.error)||void 0===a?void 0:a.bind(Q),L=null===(h=Q.complete)||void 0===h?void 0:h.bind(Q)}this.__isAsync&&(D=Sp(D),v&&(v=Sp(v)),L&&(L=Sp(L)));const j=super.subscribe({next:v,error:D,complete:L});return e instanceof x&&e.add(j),j}};function ID(){return this._results[qa()]()}class Cp{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=qa(),r=Cp.prototype;r[t]||(r[t]=ID)}get changes(){return this._changes||(this._changes=new vn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const r=this;r.dirty=!1;const i=Bi(e);(this._changesDetected=!function LC(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r{class n{}return n.__NG_ELEMENT_ID__=PD,n})();const RD=No,OD=class extends RD{constructor(e,t,r){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=r}createEmbeddedView(e){const t=this._declarationTContainer.tViews,r=uu(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);r[17]=this._declarationLView[this._declarationTContainer.index];const a=this._declarationLView[19];return null!==a&&(r[19]=a.createEmbeddedView(t)),cu(t,r,e),new Mu(r)}};function PD(){return Mf(Rr(),Et())}function Mf(n,e){return 4&n.type?new OD(e,n,ll(n,e)):null}let uo=(()=>{class n{}return n.__NG_ELEMENT_ID__=ND,n})();function ND(){return Uw(Rr(),Et())}const kD=uo,Lw=class extends kD{constructor(e,t,r){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=r}get element(){return ll(this._hostTNode,this._hostLView)}get injector(){return new Pa(this._hostTNode,this._hostLView)}get parentInjector(){const e=jc(this._hostTNode,this._hostLView);if(P1(e)){const t=Oa(e,this._hostLView),r=Ra(e);return new Pa(t[1].data[r+8],t)}return new Pa(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=Fw(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,r){const i=e.createEmbeddedView(t||{});return this.insert(i,r),i}createComponent(e,t,r,i,a){const h=e&&!function Zl(n){return"function"==typeof n}(e);let v;if(h)v=t;else{const Q=t||{};v=Q.index,r=Q.injector,i=Q.projectableNodes,a=Q.ngModuleRef}const D=h?e:new Mp(jr(e)),L=r||this.parentInjector;if(!a&&null==D.ngModule){const me=(h?L:this.parentInjector).get(Yo,null);me&&(a=me)}const j=D.create(L,i,void 0,a);return this.insert(j.hostView,v),j}insert(e,t){const r=e._lView,i=r[1];if(function sC(n){return eo(n[3])}(r)){const j=this.indexOf(e);if(-1!==j)this.detach(j);else{const Q=r[3],me=new Lw(Q,Q[6],Q[3]);me.detach(me.indexOf(e))}}const a=this._adjustIndex(t),h=this._lContainer;!function xA(n,e,t,r){const i=10+r,a=t.length;r>0&&(t[i-1][4]=e),r0)r.push(h[v/2]);else{const L=a[v+1],j=e[-D];for(let Q=10;Q{class n{constructor(t){this.appInits=t,this.resolve=Af,this.reject=Af,this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i})}runInitializers(){if(this.initialized)return;const t=[],r=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i{a.subscribe({complete:v,error:D})});t.push(h)}}Promise.all(t).then(()=>{r()}).catch(i=>{this.reject(i)}),0===t.length&&r(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Mt(Up,8))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const Cu=new Kt("AppId",{providedIn:"root",factory:function u2(){return`${Vp()}${Vp()}${Vp()}`}});function Vp(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const c2=new Kt("Platform Initializer"),Au=new Kt("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),f2=new Kt("appBootstrapListener");let aI=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();const xs=new Kt("LocaleId",{providedIn:"root",factory:()=>XC(xs,en.Optional|en.SkipSelf)||function lI(){return"undefined"!=typeof $localize&&$localize.locale||mf}()});class cI{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}let h2=(()=>{class n{compileModuleSync(t){return new Ep(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){const r=this.compileModuleSync(t),a=Do(Pi(t).declarations).reduce((h,v)=>{const D=jr(v);return D&&h.push(new Mp(D)),h},[]);return new cI(r,a)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const hI=(()=>Promise.resolve(0))();function jp(n){"undefined"==typeof Zone?hI.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class or{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new vn(!1),this.onMicrotaskEmpty=new vn(!1),this.onStable=new vn(!1),this.onError=new vn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!r&&t,i.shouldCoalesceRunChangeDetection=r,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function dI(){let n=Zn.requestAnimationFrame,e=Zn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const r=e[Zone.__symbol__("OriginalDelegate")];r&&(e=r)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function mI(n){const e=()=>{!function gI(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(Zn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,zp(n),n.isCheckStableRunning=!0,$p(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),zp(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,r,i,a,h,v)=>{try{return d2(n),t.invokeTask(i,a,h,v)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===a.type||n.shouldCoalesceRunChangeDetection)&&e(),p2(n)}},onInvoke:(t,r,i,a,h,v,D)=>{try{return d2(n),t.invoke(i,a,h,v,D)}finally{n.shouldCoalesceRunChangeDetection&&e(),p2(n)}},onHasTask:(t,r,i,a)=>{t.hasTask(i,a),r===i&&("microTask"==a.change?(n._hasPendingMicrotasks=a.microTask,zp(n),$p(n)):"macroTask"==a.change&&(n.hasPendingMacrotasks=a.macroTask))},onHandleError:(t,r,i,a)=>(t.handleError(i,a),n.runOutsideAngular(()=>n.onError.emit(a)),!1)})}(i)}static isInAngularZone(){return"undefined"!=typeof Zone&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!or.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(or.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,r){return this._inner.run(e,t,r)}runTask(e,t,r,i){const a=this._inner,h=a.scheduleEventTask("NgZoneEvent: "+i,e,pI,Af,Af);try{return a.runTask(h,t,r)}finally{a.cancelTask(h)}}runGuarded(e,t,r){return this._inner.runGuarded(e,t,r)}runOutsideAngular(e){return this._outer.run(e)}}const pI={};function $p(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function zp(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function d2(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function p2(n){n._nesting--,$p(n)}class vI{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new vn,this.onMicrotaskEmpty=new vn,this.onStable=new vn,this.onError=new vn}run(e,t,r){return e.apply(t,r)}runGuarded(e,t,r){return e.apply(t,r)}runOutsideAngular(e){return e()}runTask(e,t,r,i){return e.apply(t,r)}}let Gp=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{or.assertNotInAngularZone(),jp(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())jp(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(t)||(clearTimeout(r.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,r,i){let a=-1;r&&r>0&&(a=setTimeout(()=>{this._callbacks=this._callbacks.filter(h=>h.timeoutId!==a),t(this._didWork,this.getPendingTasks())},r)),this._callbacks.push({doneCb:t,timeoutId:a,updateCb:i})}whenStable(t,r,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,r,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,r,i){return[]}}return n.\u0275fac=function(t){return new(t||n)(Mt(or))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),yI=(()=>{class n{constructor(){this._applications=new Map,Kp.addToWindow(this)}registerApplication(t,r){this._applications.set(t,r)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,r=!0){return Kp.findTestabilityInTree(this,t,r)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();class bI{addToWindow(e){}findTestabilityInTree(e,t,r){return null}}let Kp=new bI,ea=null;const g2=new Kt("AllowMultipleToken"),m2=new Kt("PlatformOnDestroy");class v2{constructor(e,t){this.name=e,this.token=t}}function y2(n,e,t=[]){const r=`Platform: ${e}`,i=new Kt(r);return(a=[])=>{let h=qp();if(!h||h.injector.get(g2,!1)){const v=[...t,...a,{provide:i,useValue:!0}];n?n(v):function EI(n){if(ea&&!ea.get(g2,!1))throw new Ne(400,"");ea=n;const e=n.get(b2),t=n.get(c2,null);t&&t.forEach(r=>r())}(function SI(n=[],e){return Cr.create({name:e,providers:[{provide:Q0,useValue:"platform"},{provide:m2,useValue:()=>ea=null},...n]})}(v,r))}return function xI(n){const e=qp();if(!e)throw new Ne(401,"");return e}()}}function qp(){var n;return null!==(n=null==ea?void 0:ea.get(b2))&&void 0!==n?n:null}let b2=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,r){const v=function CI(n,e){let t;return t="noop"===n?new vI:("zone.js"===n?void 0:n)||new or({enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(r?r.ngZone:void 0,{ngZoneEventCoalescing:r&&r.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:r&&r.ngZoneRunCoalescing||!1}),D=[{provide:or,useValue:v}];return v.run(()=>{const L=Cr.create({providers:D,parent:this.injector,name:t.moduleType.name}),j=t.create(L),Q=j.injector.get(lu,null);if(!Q)throw new Ne(402,"");return v.runOutsideAngular(()=>{const me=v.onError.subscribe({next:ye=>{Q.handleError(ye)}});j.onDestroy(()=>{Wp(this._modules,j),me.unsubscribe()})}),function AI(n,e,t){try{const r=t();return pu(r)?r.catch(i=>{throw e.runOutsideAngular(()=>n.handleError(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>n.handleError(r)),r}}(Q,v,()=>{const me=j.injector.get(Hp);return me.runInitializers(),me.donePromise.then(()=>(function iT(n){hn(n,"Expected localeId to be defined"),"string"==typeof n&&(J_=n.toLowerCase().replace(/_/g,"-"))}(j.injector.get(xs,mf)||mf),this._moduleDoBootstrap(j),j))})})}bootstrapModule(t,r=[]){const i=_2({},r);return function wI(n,e,t){const r=new Ep(t);return Promise.resolve(r)}(0,0,t).then(a=>this.bootstrapModuleFactory(a,i))}_moduleDoBootstrap(t){const r=t.injector.get(fl);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!t.instance.ngDoBootstrap)throw new Ne(403,"");t.instance.ngDoBootstrap(r)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Ne(404,"");this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());const t=this._injector.get(m2,null);null==t||t(),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Mt(Cr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();function _2(n,e){return Array.isArray(e)?e.reduce(_2,n):Object.assign(Object.assign({},n),e)}let fl=(()=>{class n{constructor(t,r,i,a){this._zone=t,this._injector=r,this._exceptionHandler=i,this._initStatus=a,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const h=new Z(D=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{D.next(this._stable),D.complete()})}),v=new Z(D=>{let L;this._zone.runOutsideAngular(()=>{L=this._zone.onStable.subscribe(()=>{or.assertNotInAngularZone(),jp(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,D.next(!0))})})});const j=this._zone.onUnstable.subscribe(()=>{or.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{D.next(!1)}))});return()=>{L.unsubscribe(),j.unsubscribe()}});this.isStable=Be(h,v.pipe(function Ye(){return n=>oe()(function Xe(n,e){return function(r){let i;if(i="function"==typeof n?n:function(){return n},"function"==typeof e)return r.lift(new Je(i,e));const a=Object.create(r,Pe);return a.source=r,a.subjectFactory=i,a}}(kt)(n))}()))}bootstrap(t,r){if(!this._initStatus.done)throw new Ne(405,"");let i;i=t instanceof xw?t:this._injector.get(Ys).resolveComponentFactory(t),this.componentTypes.push(i.componentType);const a=function MI(n){return n.isBoundToModule}(i)?void 0:this._injector.get(Yo),v=i.create(Cr.NULL,[],r||i.selector,a),D=v.location.nativeElement,L=v.injector.get(Gp,null),j=L&&v.injector.get(yI);return L&&j&&j.registerApplication(D,L),v.onDestroy(()=>{this.detachView(v.hostView),Wp(this.components,v),j&&j.unregisterApplication(D)}),this._loadComponent(v),v}tick(){if(this._runningTick)throw new Ne(101,"");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const r=t;this._views.push(r),r.attachToAppRef(this)}detachView(t){const r=t;Wp(this._views,r),r.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(f2,[]).concat(this._bootstrapListeners).forEach(i=>i(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Mt(or),Mt(Cr),Mt(lu),Mt(Hp))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function Wp(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}let M2=!0,hl=(()=>{class n{}return n.__NG_ELEMENT_ID__=II,n})();function II(n){return function RI(n,e,t){if(Tc(n)&&!t){const r=wi(n.index,e);return new Mu(r,r)}return 47&n.type?new Mu(e[16],e):null}(Rr(),Et(),16==(16&n))}class A2{constructor(){}supports(e){return hu(e)}create(e){return new LI(e)}}const BI=(n,e)=>e;class LI{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||BI}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,r=this._removalsHead,i=0,a=null;for(;t||r;){const h=!r||t&&t.currentIndex{h=this._trackByFn(i,v),null!==t&&Object.is(t.trackById,h)?(r&&(t=this._verifyReinsertion(t,v,h,i)),Object.is(t.item,v)||this._addIdentityChange(t,v)):(t=this._mismatch(t,v,h,i),r=!0),t=t._next,i++}),this.length=i;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,r,i){let a;return null===e?a=this._itTail:(a=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,a,i)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(r,i))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,a,i)):e=this._addAfter(new FI(t,r),a,i),e}_verifyReinsertion(e,t,r,i){let a=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==a?e=this._reinsertAfter(a,e._prev,i):e.currentIndex!=i&&(e.currentIndex=i,this._addToMoves(e,i)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const i=e._prevRemoved,a=e._nextRemoved;return null===i?this._removalsHead=a:i._nextRemoved=a,null===a?this._removalsTail=i:a._prevRemoved=i,this._insertAfter(e,t,r),this._addToMoves(e,r),e}_moveAfter(e,t,r){return this._unlink(e),this._insertAfter(e,t,r),this._addToMoves(e,r),e}_addAfter(e,t,r){return this._insertAfter(e,t,r),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,r){const i=null===t?this._itHead:t._next;return e._next=i,e._prev=t,null===i?this._itTail=e:i._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new T2),this._linkedRecords.put(e),e.currentIndex=r,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,r=e._next;return null===t?this._itHead=r:t._next=r,null===r?this._itTail=t:r._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new T2),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class FI{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class UI{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===t||t<=r.currentIndex)&&Object.is(r.trackById,e))return r;return null}remove(e){const t=e._prevDup,r=e._nextDup;return null===t?this._head=r:t._nextDup=r,null===r?this._tail=t:r._prevDup=t,null===this._head}}class T2{constructor(){this.map=new Map}put(e){const t=e.trackById;let r=this.map.get(t);r||(r=new UI,this.map.set(t,r)),r.add(e)}get(e,t){const i=this.map.get(e);return i?i.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function D2(n,e,t){const r=n.previousIndex;if(null===r)return r;let i=0;return t&&r{class n{constructor(t){this.factories=t}static create(t,r){if(null!=r){const i=r.factories.slice();t=t.concat(i)}return new n(t)}static extend(t){return{provide:n,useFactory:r=>n.create(t,r||R2()),deps:[[n,new eu,new _s]]}}find(t){const r=this.factories.find(i=>i.supports(t));if(null!=r)return r;throw new Ne(901,"")}}return n.\u0275prov=xt({token:n,providedIn:"root",factory:R2}),n})();const zI=y2(null,"core",[]);let GI=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Mt(fl))},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})(),Rf=null;function ko(){return Rf}const wr=new Kt("DocumentToken");let na=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:function(){return function ZI(){return Mt(P2)}()},providedIn:"platform"}),n})();const XI=new Kt("Location Initialized");let P2=(()=>{class n extends na{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ko().getBaseHref(this._doc)}onPopState(t){const r=ko().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",t,!1),()=>r.removeEventListener("popstate",t)}onHashChange(t){const r=ko().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",t,!1),()=>r.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,r,i){N2()?this._history.pushState(t,r,i):this.location.hash=i}replaceState(t,r,i){N2()?this._history.replaceState(t,r,i):this.location.hash=i}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:function(){return function YI(){return new P2(Mt(wr))}()},providedIn:"platform"}),n})();function N2(){return!!window.history.pushState}function Jp(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}function k2(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Jo(n){return n&&"?"!==n[0]?"?"+n:n}let dl=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:function(){return function QI(n){const e=Mt(wr).location;return new B2(Mt(na),e&&e.origin||"")}()},providedIn:"root"}),n})();const eg=new Kt("appBaseHref");let B2=(()=>{class n extends dl{constructor(t,r){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==r&&(r=this._platformLocation.getBaseHrefFromDOM()),null==r)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=r}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return Jp(this._baseHref,t)}path(t=!1){const r=this._platformLocation.pathname+Jo(this._platformLocation.search),i=this._platformLocation.hash;return i&&t?`${r}${i}`:r}pushState(t,r,i,a){const h=this.prepareExternalUrl(i+Jo(a));this._platformLocation.pushState(t,r,h)}replaceState(t,r,i,a){const h=this.prepareExternalUrl(i+Jo(a));this._platformLocation.replaceState(t,r,h)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var r,i;null===(i=(r=this._platformLocation).historyGo)||void 0===i||i.call(r,t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(na),Mt(eg,8))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),JI=(()=>{class n extends dl{constructor(t,r){super(),this._platformLocation=t,this._baseHref="",this._removeListenerFns=[],null!=r&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}path(t=!1){let r=this._platformLocation.hash;return null==r&&(r="#"),r.length>0?r.substring(1):r}prepareExternalUrl(t){const r=Jp(this._baseHref,t);return r.length>0?"#"+r:r}pushState(t,r,i,a){let h=this.prepareExternalUrl(i+Jo(a));0==h.length&&(h=this._platformLocation.pathname),this._platformLocation.pushState(t,r,h)}replaceState(t,r,i,a){let h=this.prepareExternalUrl(i+Jo(a));0==h.length&&(h=this._platformLocation.pathname),this._platformLocation.replaceState(t,r,h)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var r,i;null===(i=(r=this._platformLocation).historyGo)||void 0===i||i.call(r,t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(na),Mt(eg,8))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),tg=(()=>{class n{constructor(t,r){this._subject=new vn,this._urlChangeListeners=[],this._platformStrategy=t;const i=this._platformStrategy.getBaseHref();this._platformLocation=r,this._baseHref=k2(L2(i)),this._platformStrategy.onPopState(a=>{this._subject.emit({url:this.path(!0),pop:!0,state:a.state,type:a.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,r=""){return this.path()==this.normalize(t+Jo(r))}normalize(t){return n.stripTrailingSlash(function tR(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,L2(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,r="",i=null){this._platformStrategy.pushState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Jo(r)),i)}replaceState(t,r="",i=null){this._platformStrategy.replaceState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Jo(r)),i)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var r,i;null===(i=(r=this._platformStrategy).historyGo)||void 0===i||i.call(r,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}))}_notifyUrlChangeListeners(t="",r){this._urlChangeListeners.forEach(i=>i(t,r))}subscribe(t,r,i){return this._subject.subscribe({next:t,error:r,complete:i})}}return n.normalizeQueryParams=Jo,n.joinWithSlash=Jp,n.stripTrailingSlash=k2,n.\u0275fac=function(t){return new(t||n)(Mt(dl),Mt(na))},n.\u0275prov=xt({token:n,factory:function(){return function eR(){return new tg(Mt(dl),Mt(na))}()},providedIn:"root"}),n})();function L2(n){return n.replace(/\/index.html$/,"")}function K2(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const r=t.indexOf("="),[i,a]=-1==r?[t,""]:[t.slice(0,r),t.slice(r+1)];if(i.trim()===e)return decodeURIComponent(a)}return null}class HR{constructor(e,t,r,i){this.$implicit=e,this.ngForOf=t,this.index=r,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ru=(()=>{class n{constructor(t,r,i){this._viewContainer=t,this._template=r,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;!this._differ&&t&&(this._differ=this._differs.find(t).create(this.ngForTrackBy))}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const r=this._viewContainer;t.forEachOperation((i,a,h)=>{if(null==i.previousIndex)r.createEmbeddedView(this._template,new HR(i.item,this._ngForOf,-1,-1),null===h?void 0:h);else if(null==h)r.remove(null===a?void 0:a);else if(null!==a){const v=r.get(a);r.move(v,h),q2(v,i)}});for(let i=0,a=r.length;i{q2(r.get(i.currentIndex),i)})}static ngTemplateContextGuard(t,r){return!0}}return n.\u0275fac=function(t){return new(t||n)(ot(uo),ot(No),ot(If))},n.\u0275dir=$t({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();function q2(n,e){n.context.$implicit=e.item}let fo=(()=>{class n{constructor(t,r){this._viewContainer=t,this._context=new VR,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=r}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){W2("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){W2("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,r){return!0}}return n.\u0275fac=function(t){return new(t||n)(ot(uo),ot(No))},n.\u0275dir=$t({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class VR{constructor(){this.$implicit=null,this.ngIf=null}}function W2(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${nt(e)}'.`)}const Z2="browser";function X2(n){return n===Z2}let Pu=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})(),jO=(()=>{class n{}return n.\u0275prov=xt({token:n,providedIn:"root",factory:()=>new $O(Mt(wr),window)}),n})();class $O{constructor(e,t){this.document=e,this.window=t,this.offset=()=>[0,0]}setOffset(e){this.offset=Array.isArray(e)?()=>e:e}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(e){this.supportsScrolling()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(!this.supportsScrolling())return;const t=function zO(n,e){const t=n.getElementById(e)||n.getElementsByName(e)[0];if(t)return t;if("function"==typeof n.createTreeWalker&&n.body&&(n.body.createShadowRoot||n.body.attachShadow)){const r=n.createTreeWalker(n.body,NodeFilter.SHOW_ELEMENT);let i=r.currentNode;for(;i;){const a=i.shadowRoot;if(a){const h=a.getElementById(e)||a.querySelector(`[name="${e}"]`);if(h)return h}i=r.nextNode()}}return null}(this.document,e);t&&(this.scrollToElement(t),t.focus())}setHistoryScrollRestoration(e){if(this.supportScrollRestoration()){const t=this.window.history;t&&t.scrollRestoration&&(t.scrollRestoration=e)}}scrollToElement(e){const t=e.getBoundingClientRect(),r=t.left+this.window.pageXOffset,i=t.top+this.window.pageYOffset,a=this.offset();this.window.scrollTo(r-a[0],i-a[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const e=rM(this.window.history)||rM(Object.getPrototypeOf(this.window.history));return!(!e||!e.writable&&!e.set)}catch(e){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(e){return!1}}}function rM(n){return Object.getOwnPropertyDescriptor(n,"scrollRestoration")}class iM{}class vg extends class KO extends class WI{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function qI(n){Rf||(Rf=n)}(new vg)}onAndCancel(e,t,r){return e.addEventListener(t,r,!1),()=>{e.removeEventListener(t,r,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=function qO(){return Nu=Nu||document.querySelector("base"),Nu?Nu.getAttribute("href"):null}();return null==t?null:function WO(n){$f=$f||document.createElement("a"),$f.setAttribute("href",n);const e=$f.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Nu=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return K2(document.cookie,e)}}let $f,Nu=null;const oM=new Kt("TRANSITION_ID"),XO=[{provide:Up,useFactory:function ZO(n,e,t){return()=>{t.get(Hp).donePromise.then(()=>{const r=ko(),i=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let a=0;a{const a=e.findTestabilityInTree(r,i);if(null==a)throw new Error("Could not find testability for element.");return a},Zn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Zn.getAllAngularRootElements=()=>e.getAllRootElements(),Zn.frameworkStabilizers||(Zn.frameworkStabilizers=[]),Zn.frameworkStabilizers.push(r=>{const i=Zn.getAllAngularTestabilities();let a=i.length,h=!1;const v=function(D){h=h||D,a--,0==a&&r(h)};i.forEach(function(D){D.whenStable(v)})})}findTestabilityInTree(e,t,r){if(null==t)return null;const i=e.getTestability(t);return null!=i?i:r?ko().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let YO=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const zf=new Kt("EventManagerPlugins");let Gf=(()=>{class n{constructor(t,r){this._zone=r,this._eventNameToPlugin=new Map,t.forEach(i=>i.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,r,i){return this._findPluginFor(r).addEventListener(t,r,i)}addGlobalEventListener(t,r,i){return this._findPluginFor(r).addGlobalEventListener(t,r,i)}getZone(){return this._zone}_findPluginFor(t){const r=this._eventNameToPlugin.get(t);if(r)return r;const i=this._plugins;for(let a=0;a{class n{constructor(){this._stylesSet=new Set}addStyles(t){const r=new Set;t.forEach(i=>{this._stylesSet.has(i)||(this._stylesSet.add(i),r.add(i))}),this.onStylesAdded(r)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),ku=(()=>{class n extends aM{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,r,i){t.forEach(a=>{const h=this._doc.createElement("style");h.textContent=a,i.push(r.appendChild(h))})}addHost(t){const r=[];this._addStylesToHost(this._stylesSet,t,r),this._hostNodes.set(t,r)}removeHost(t){const r=this._hostNodes.get(t);r&&r.forEach(lM),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((r,i)=>{this._addStylesToHost(t,i,r)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(lM))}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();function lM(n){ko().remove(n)}const bg={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},_g=/%COMP%/g;function Kf(n,e,t){for(let r=0;r{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let qf=(()=>{class n{constructor(t,r,i){this.eventManager=t,this.sharedStylesHost=r,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new wg(t)}createRenderer(t,r){if(!t||!r)return this.defaultRenderer;switch(r.encapsulation){case Qi.Emulated:{let i=this.rendererByCompId.get(r.id);return i||(i=new r7(this.eventManager,this.sharedStylesHost,r,this.appId),this.rendererByCompId.set(r.id,i)),i.applyToHost(t),i}case 1:case Qi.ShadowDom:return new i7(this.eventManager,this.sharedStylesHost,t,r);default:if(!this.rendererByCompId.has(r.id)){const i=Kf(r.id,r.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(r.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Mt(Gf),Mt(ku),Mt(Cu))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class wg{constructor(e){this.eventManager=e,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(e,t){return t?document.createElementNS(bg[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,r){e&&e.insertBefore(t,r)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let r="string"==typeof e?document.querySelector(e):e;if(!r)throw new Error(`The selector "${e}" did not match any elements`);return t||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,r,i){if(i){t=i+":"+t;const a=bg[i];a?e.setAttributeNS(a,t,r):e.setAttribute(t,r)}else e.setAttribute(t,r)}removeAttribute(e,t,r){if(r){const i=bg[r];i?e.removeAttributeNS(i,t):e.removeAttribute(`${r}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,r,i){i&(Ei.DashCase|Ei.Important)?e.style.setProperty(t,r,i&Ei.Important?"important":""):e.style[t]=r}removeStyle(e,t,r){r&Ei.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,r){e[t]=r}setValue(e,t){e.nodeValue=t}listen(e,t,r){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,fM(r)):this.eventManager.addEventListener(e,t,fM(r))}}class r7 extends wg{constructor(e,t,r,i){super(e),this.component=r;const a=Kf(i+"-"+r.id,r.styles,[]);t.addStyles(a),this.contentAttr=function e7(n){return"_ngcontent-%COMP%".replace(_g,n)}(i+"-"+r.id),this.hostAttr=function t7(n){return"_nghost-%COMP%".replace(_g,n)}(i+"-"+r.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const r=super.createElement(e,t);return super.setAttribute(r,this.contentAttr,""),r}}class i7 extends wg{constructor(e,t,r,i){super(e),this.sharedStylesHost=t,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const a=Kf(i.id,i.styles,[]);for(let h=0;h{class n extends sM{constructor(t){super(t)}supports(t){return!0}addEventListener(t,r,i){return t.addEventListener(r,i,!1),()=>this.removeEventListener(t,r,i)}removeEventListener(t,r,i){return t.removeEventListener(r,i)}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const dM=["alt","control","meta","shift"],a7={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},pM={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},l7={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let u7=(()=>{class n extends sM{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,r,i){const a=n.parseEventName(r),h=n.eventCallback(a.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ko().onAndCancel(t,a.domEventName,h))}static parseEventName(t){const r=t.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const a=n._normalizeKey(r.pop());let h="";if(dM.forEach(D=>{const L=r.indexOf(D);L>-1&&(r.splice(L,1),h+=D+".")}),h+=a,0!=r.length||0===a.length)return null;const v={};return v.domEventName=i,v.fullKey=h,v}static getEventFullKey(t){let r="",i=function c7(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&pM.hasOwnProperty(e)&&(e=pM[e]))}return a7[e]||e}(t);return i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),dM.forEach(a=>{a!=i&&l7[a](t)&&(r+=a+".")}),r+=i,r}static eventCallback(t,r,i){return a=>{n.getEventFullKey(a)===t&&i.runGuarded(()=>r(a))}}static _normalizeKey(t){return"esc"===t?"escape":t}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const p7=y2(zI,"browser",[{provide:Au,useValue:Z2},{provide:c2,useValue:function f7(){vg.makeCurrent(),yg.init()},multi:!0},{provide:wr,useFactory:function d7(){return function nC(n){kd=n}(document),document},deps:[]}]),g7=[{provide:Q0,useValue:"root"},{provide:lu,useFactory:function h7(){return new lu},deps:[]},{provide:zf,useClass:o7,multi:!0,deps:[wr,or,Au]},{provide:zf,useClass:u7,multi:!0,deps:[wr]},{provide:qf,useClass:qf,deps:[Gf,ku,Cu]},{provide:Qs,useExisting:qf},{provide:aM,useExisting:ku},{provide:ku,useClass:ku,deps:[wr]},{provide:Gp,useClass:Gp,deps:[or]},{provide:Gf,useClass:Gf,deps:[zf,or]},{provide:iM,useClass:YO,deps:[]}];let gM=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Cu,useValue:t.appId},{provide:oM,useExisting:Cu},XO]}}}return n.\u0275fac=function(t){return new(t||n)(Mt(n,12))},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:g7,imports:[Pu,GI]}),n})();"undefined"!=typeof window&&window;let Wf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:function(t){let r=null;return r=t?new(t||n):Mt(yM),r},providedIn:"root"}),n})(),yM=(()=>{class n extends Wf{constructor(t){super(),this._doc=t}sanitize(t,r){if(null==r)return null;switch(t){case Qn.NONE:return r;case Qn.HTML:return Ao(r,"HTML")?xi(r):By(this._doc,String(r)).toString();case Qn.STYLE:return Ao(r,"Style")?xi(r):r;case Qn.SCRIPT:if(Ao(r,"Script"))return xi(r);throw new Error("unsafe value used in a script context");case Qn.URL:return Ty(r),Ao(r,"URL")?xi(r):ou(String(r));case Qn.RESOURCE_URL:if(Ao(r,"ResourceURL"))return xi(r);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function VA(n){return new BA(n)}(t)}bypassSecurityTrustStyle(t){return function jA(n){return new LA(n)}(t)}bypassSecurityTrustScript(t){return function $A(n){return new FA(n)}(t)}bypassSecurityTrustUrl(t){return function zA(n){return new UA(n)}(t)}bypassSecurityTrustResourceUrl(t){return function GA(n){return new HA(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:function(t){let r=null;return r=t?new t:function S7(n){return new yM(n.get(wr))}(Mt(Cr)),r},providedIn:"root"}),n})();class bM{}const ts="*";function _M(n,e){return{type:7,name:n,definitions:e,options:{}}}function pl(n,e=null){return{type:4,styles:e,timings:n}}function wM(n,e=null){return{type:2,steps:n,options:e}}function Ci(n){return{type:6,styles:n,offset:null}}function Eg(n,e,t){return{type:0,name:n,styles:e,options:t}}function xg(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function MM(n){Promise.resolve(null).then(n)}class Bu{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){MM(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class EM{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,r=0,i=0;const a=this.players.length;0==a?MM(()=>this._onFinish()):this.players.forEach(h=>{h.onDone(()=>{++t==a&&this._onFinish()}),h.onDestroy(()=>{++r==a&&this._onDestroy()}),h.onStart(()=>{++i==a&&this._onStart()})}),this.totalTime=this.players.reduce((h,v)=>Math.max(h,v.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(r=>{const i=r.totalTime?Math.min(1,t/r.totalTime):1;r.setPosition(i)})}getPosition(){const e=this.players.reduce((t,r)=>null===t||r.totalTime>t.totalTime?r:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class A7{constructor(e,t){this.open=e,this.close=t||e}isManual(){return"manual"===this.open||"manual"===this.close}}const T7={hover:["mouseover","mouseout"],focus:["focusin","focusout"]};const sr="undefined"!=typeof window&&window||{};var Zf=(()=>(function(n){n.isBs3="bs3",n.isBs4="bs4",n.isBs5="bs5"}(Zf||(Zf={})),Zf))();let Ai;function Cg(){if(void 0===sr.document)return"bs4";const n=sr.document.createElement("span");n.innerText="testing bs version",n.classList.add("d-none"),n.classList.add("pl-1"),sr.document.head.appendChild(n);const e=n.getBoundingClientRect(),t=sr.getComputedStyle(n).paddingLeft;return!e||e&&0!==e.top?(sr.document.head.removeChild(n),"bs3"):t&&parseFloat(t)?(sr.document.head.removeChild(n),"bs4"):(sr.document.head.removeChild(n),"bs5")}function gl(){return void 0===sr||(void 0===sr.__theme?(Ai||(Ai=Cg()),"bs3"===Ai):"bs3"===sr.__theme)}function SM(){return!gl()&&(Ai||(Ai=Cg()),"bs4"===Ai)}function Lu(){return{isBs3:gl(),isBs4:SM(),isBs5:!gl()&&!SM()&&(Ai||(Ai=Cg()),"bs5"===Ai)}}function Ag(n,e,t,r){return R(t)&&(r=t,t=void 0),r?Ag(n,e,t).pipe(u(i=>M(i)?r(...i):r(i))):new Z(i=>{AM(n,e,function a(h){i.next(arguments.length>1?Array.prototype.slice.call(arguments):h)},i,t)})}function AM(n,e,t,r,i){let a;if(function F7(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const h=n;n.addEventListener(e,t,i),a=()=>h.removeEventListener(e,t,i)}else if(function L7(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const h=n;n.on(e,t),a=()=>h.off(e,t)}else if(function B7(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const h=n;n.addListener(e,t),a=()=>h.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let h=0,v=n.length;h{class n{constructor(t,r=n.now){this.SchedulerAction=t,this.now=r}schedule(t,r=0,i){return new this.SchedulerAction(this,t).schedule(i,r)}}return n.now=()=>Date.now(),n})();class ns extends DM{constructor(e,t=DM.now){super(e,()=>ns.delegate&&ns.delegate!==this?ns.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,r){return ns.delegate&&ns.delegate!==this?ns.delegate.schedule(e,t,r):super.schedule(e,t,r)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let r;this.active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}}const j7=new class V7 extends ns{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let r,i=-1,a=t.length;e=e||t.shift();do{if(r=e.execute(e.state,e.delay))break}while(++i0?super.requestAsyncId(e,t,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,r=0){if(null!==r&&r>0||null===r&&this.delay>0)return super.recycleAsyncId(e,t,r);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});var Xf=(()=>(function(n){n.top="top",n.bottom="bottom",n.left="left",n.right="right",n.auto="auto",n.end="right",n.start="left",n["top left"]="top left",n["top right"]="top right",n["right top"]="right top",n["right bottom"]="right bottom",n["bottom right"]="bottom right",n["bottom left"]="bottom left",n["left bottom"]="left bottom",n["left top"]="left top",n["top start"]="top left",n["top end"]="top right",n["end top"]="right top",n["end bottom"]="right bottom",n["bottom end"]="bottom right",n["bottom start"]="bottom left",n["start bottom"]="start bottom",n["start top"]="left top"}(Xf||(Xf={})),Xf))(),Fu=(()=>(function(n){n.top="top",n.bottom="bottom",n.left="start",n.right="end",n.auto="auto",n.end="end",n.start="start",n["top left"]="top start",n["top right"]="top end",n["right top"]="end top",n["right bottom"]="end bottom",n["bottom right"]="bottom end",n["bottom left"]="bottom start",n["left bottom"]="start bottom",n["left top"]="start top",n["top start"]="top start",n["top end"]="top end",n["end top"]="end top",n["end bottom"]="end bottom",n["bottom end"]="bottom end",n["bottom start"]="bottom start",n["start bottom"]="start bottom",n["start top"]="start top"}(Fu||(Fu={})),Fu))();function ra(n,e){if(1!==n.nodeType)return[];const t=n.ownerDocument.defaultView,r=null==t?void 0:t.getComputedStyle(n,null);return e?r&&r[e]:r}function Tg(n){if(!n)return document.documentElement;let r,t=null==n?void 0:n.offsetParent;for(;null===t&&n.nextElementSibling&&r!==n.nextElementSibling;)r=n.nextElementSibling,t=r.offsetParent;const i=t&&t.nodeName;return i&&"BODY"!==i&&"HTML"!==i?t&&-1!==["TH","TD","TABLE"].indexOf(t.nodeName)&&"static"===ra(t,"position")?Tg(t):t:r?r.ownerDocument.documentElement:document.documentElement}function Dg(n){return null!==n.parentNode?Dg(n.parentNode):n}function Yf(n,e){if(!(n&&n.nodeType&&e&&e.nodeType))return document.documentElement;const t=n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=t?n:e,i=t?e:n,a=document.createRange();a.setStart(r,0),a.setEnd(i,0);const h=a.commonAncestorContainer;if(n!==h&&e!==h||r.contains(i))return function $7(n){const{nodeName:e}=n;return"BODY"!==e&&("HTML"===e||Tg(n.firstElementChild)===n)}(h)?h:Tg(h);const v=Dg(n);return v.host?Yf(v.host,e):Yf(n,Dg(e).host)}function IM(n){if(!n||!n.parentElement)return document.documentElement;let e=n.parentElement;for(;(null==e?void 0:e.parentElement)&&"none"===ra(e,"transform");)e=e.parentElement;return e||document.documentElement}function RM(n,e){const t="x"===e?"Left":"Top",r="Left"===t?"Right":"Bottom";return parseFloat(n[`border${t}Width`])+parseFloat(n[`border${r}Width`])}function OM(n,e,t,r){return Math.max(e[`offset${n}`],e[`scroll${n}`],t[`client${n}`],t[`offset${n}`],t[`scroll${n}`],0)}function PM(n){const e=n.body,t=n.documentElement;return{height:OM("Height",e,t),width:OM("Width",e,t)}}function Uu(n){return Object.assign(Object.assign({},n),{right:(n.left||0)+n.width,bottom:(n.top||0)+n.height})}function ar(n){return"number"==typeof n||"[object Number]"===Object.prototype.toString.call(n)}function NM(n){const e=n.getBoundingClientRect();if(!(e&&ar(e.top)&&ar(e.left)&&ar(e.bottom)&&ar(e.right)))return e;const t={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},r="HTML"===n.nodeName?PM(n.ownerDocument):void 0,i=(null==r?void 0:r.width)||n.clientWidth||ar(e.right)&&ar(t.left)&&e.right-t.left||0,a=(null==r?void 0:r.height)||n.clientHeight||ar(e.bottom)&&ar(t.top)&&e.bottom-t.top||0;let h=n.offsetWidth-i,v=n.offsetHeight-a;if(h||v){const D=ra(n);h-=RM(D,"x"),v-=RM(D,"y"),t.width-=h,t.height-=v}return Uu(t)}function Ig(n){return"HTML"===n.nodeName?n:n.parentNode||n.host}function Rg(n){if(!n)return document.body;switch(n.nodeName){case"HTML":case"BODY":return n.ownerDocument.body;case"#document":return n.body}const{overflow:e,overflowX:t,overflowY:r}=ra(n);return/(auto|scroll|overlay)/.test(String(e)+String(r)+String(t))?n:Rg(Ig(n))}function Og(n,e,t=!1){var r,i,a,h,v,D;const L="HTML"===e.nodeName,j=NM(n),Q=NM(e),ye=(Rg(n),ra(e)),Te=parseFloat(ye.borderTopWidth),Ve=parseFloat(ye.borderLeftWidth);t&&L&&(Q.top=Math.max(null!==(r=Q.top)&&void 0!==r?r:0,0),Q.left=Math.max(null!==(i=Q.left)&&void 0!==i?i:0,0));const je=Uu({top:(null!==(a=j.top)&&void 0!==a?a:0)-(null!==(h=Q.top)&&void 0!==h?h:0)-Te,left:(null!==(v=j.left)&&void 0!==v?v:0)-(null!==(D=Q.left)&&void 0!==D?D:0)-Ve,width:j.width,height:j.height});if(je.marginTop=0,je.marginLeft=0,L){const gt=parseFloat(ye.marginTop),Ie=parseFloat(ye.marginLeft);ar(je.top)&&(je.top-=Te-gt),ar(je.bottom)&&(je.bottom-=Te-gt),ar(je.left)&&(je.left-=Ve-Ie),ar(je.right)&&(je.right-=Ve-Ie),je.marginTop=gt,je.marginLeft=Ie}return je}function kM(n,e="top"){const t="top"===e?"scrollTop":"scrollLeft",r=n.nodeName;if("BODY"===r||"HTML"===r){const i=n.ownerDocument.documentElement;return(n.ownerDocument.scrollingElement||i)[t]}return n[t]}function BM(n){const e=n.nodeName;return"BODY"!==e&&"HTML"!==e&&("fixed"===ra(n,"position")||BM(Ig(n)))}function Pg(n,e,t=0,r,i=!1){let a={top:0,left:0};const h=i?IM(n):Yf(n,e);if("viewport"===r)a=function G7(n,e=!1){const t=n.ownerDocument.documentElement,r=Og(n,t),i=Math.max(t.clientWidth,window.innerWidth||0),a=Math.max(t.clientHeight,window.innerHeight||0),h=e?0:kM(t),v=e?0:kM(t,"left");return Uu({top:h-Number(null==r?void 0:r.top)+Number(null==r?void 0:r.marginTop),left:v-Number(null==r?void 0:r.left)+Number(null==r?void 0:r.marginLeft),width:i,height:a})}(h,i);else{let v;"scrollParent"===r?(v=Rg(Ig(e)),"BODY"===v.nodeName&&(v=n.ownerDocument.documentElement)):v="window"===r?n.ownerDocument.documentElement:r;const D=Og(v,h,i);if(D&&"HTML"===v.nodeName&&!BM(h)){const{height:L,width:j}=PM(n.ownerDocument);ar(a.top)&&ar(D.top)&&ar(D.marginTop)&&(a.top+=D.top-D.marginTop),ar(a.top)&&(a.bottom=Number(L)+Number(D.top)),ar(a.left)&&ar(D.left)&&ar(D.marginLeft)&&(a.left+=D.left-D.marginLeft),ar(a.top)&&(a.right=Number(j)+Number(D.left))}else D&&(a=D)}return ar(a.left)&&(a.left+=t),ar(a.top)&&(a.top+=t),ar(a.right)&&(a.right-=t),ar(a.bottom)&&(a.bottom-=t),a}function K7({width:n,height:e}){return n*e}function LM(n,e,t,r,i=["top","bottom","right","left"],a="viewport",h=0){var v,D,L,j,Q,me,ye,Te,Ve,je,gt,Ie;if(-1===n.indexOf("auto"))return n;const _t=Pg(t,r,h,a),At={top:{width:null!==(v=null==_t?void 0:_t.width)&&void 0!==v?v:0,height:(null!==(D=null==e?void 0:e.top)&&void 0!==D?D:0)-(null!==(L=null==_t?void 0:_t.top)&&void 0!==L?L:0)},right:{width:(null!==(j=null==_t?void 0:_t.right)&&void 0!==j?j:0)-(null!==(Q=null==e?void 0:e.right)&&void 0!==Q?Q:0),height:null!==(me=null==_t?void 0:_t.height)&&void 0!==me?me:0},bottom:{width:null!==(ye=null==_t?void 0:_t.width)&&void 0!==ye?ye:0,height:(null!==(Te=null==_t?void 0:_t.bottom)&&void 0!==Te?Te:0)-(null!==(Ve=null==e?void 0:e.bottom)&&void 0!==Ve?Ve:0)},left:{width:(null!==(je=e.left)&&void 0!==je?je:0)-(null!==(gt=null==_t?void 0:_t.left)&&void 0!==gt?gt:0),height:null!==(Ie=null==_t?void 0:_t.height)&&void 0!==Ie?Ie:0}},Nt=Object.keys(At).map(De=>Object.assign(Object.assign({position:De},At[De]),{area:K7(At[De])})).sort((De,ke)=>ke.area-De.area);let Vt=Nt.filter(({width:De,height:ke})=>De>=t.clientWidth&&ke>=t.clientHeight);Vt=Vt.filter(({position:De})=>i.some(ke=>ke===De));const Zt=Vt.length>0?Vt[0].position:Nt[0].position,Se=n.split(" ")[1];return t.className=t.className.replace(/bs-tooltip-auto/g,`bs-tooltip-${Lu().isBs5?Fu[Zt]:Zt}`),Zt+(Se?`-${Se}`:"")}const Qf=(n,e=0)=>n?parseFloat(n):e;function FM(n){const e=n.ownerDocument.defaultView,t=null==e?void 0:e.getComputedStyle(n),r=Qf(null==t?void 0:t.marginTop)+Qf(null==t?void 0:t.marginBottom),i=Qf(null==t?void 0:t.marginLeft)+Qf(null==t?void 0:t.marginRight);return{width:Number(n.offsetWidth)+i,height:Number(n.offsetHeight)+r}}function UM(n,e,t){return Og(e,t?IM(n):Yf(n,e),t)}function Ng(n,e,t){var r,i,a;const h=t.split(" ")[0],v=FM(n),D={width:v.width,height:v.height},L=-1!==["right","left"].indexOf(h),j=L?"top":"left",Q=L?"left":"top",me=L?"height":"width",ye=L?"width":"height";return D[j]=(null!==(r=e[j])&&void 0!==r?r:0)+e[me]/2-v[me]/2,D[Q]=h===Q?(null!==(i=e[Q])&&void 0!==i?i:0)-v[ye]:null!==(a=e[function W7(n){const e={left:"right",right:"left",bottom:"top",top:"bottom"};return n.replace(/left|right|bottom|top/g,t=>e[t])}(Q)])&&void 0!==a?a:0,D}function HM(n,e){var t;return!!(null===(t=n.modifiers[e])||void 0===t?void 0:t.enabled)}const X7={top:["top","top start","top end"],bottom:["bottom","bottom start","bottom end"],start:["start","start top","start bottom"],end:["end","end top","end bottom"]};function Jf(n,e){return!!Lu().isBs5&&X7[e].includes(n)}function VM(n,e,t){!n||!e||Object.keys(e).forEach(r=>{let i="";-1!==["width","height","top","right","bottom","left"].indexOf(r)&&function z7(n){return""!==n&&!isNaN(parseFloat(n))&&isFinite(Number(n))}(e[r])&&(i="px"),t?t.setStyle(n,r,`${String(e[r])}${i}`):n.style[r]=String(e[r])+i})}function J7(n){var e,t,r,i,a,h;let v=n.offsets.target;const D=n.instance.target.querySelector(".arrow");if(!D)return n;const L=-1!==["left","right"].indexOf(n.placement.split(" ")[0]),j=L?"height":"width",Q=L?"Top":"Left",me=Q.toLowerCase(),ye=L?"left":"top",Te=L?"bottom":"right",Ve=FM(D)[j],je=n.placement.split(" ")[1];(null!==(e=n.offsets.host[Te])&&void 0!==e?e:0)-Ve<(null!==(t=v[me])&&void 0!==t?t:0)&&(v[me]-=(null!==(r=v[me])&&void 0!==r?r:0)-((null!==(i=n.offsets.host[Te])&&void 0!==i?i:0)-Ve)),Number(n.offsets.host[me])+Number(Ve)>(null!==(a=v[Te])&&void 0!==a?a:0)&&(v[me]+=Number(n.offsets.host[me])+Number(Ve)-Number(v[Te])),v=Uu(v);const gt=ra(n.instance.target),Ie=parseFloat(gt[`margin${Q}`])||0,_t=parseFloat(gt[`border${Q}Width`])||0;let At;if(je){const Vt=parseFloat(gt.borderRadius)||0,Zt=Number(Ie+_t+Vt);At=me===je?Number(n.offsets.host[me])+Zt:Number(n.offsets.host[me])+Number(n.offsets.host[j]-Zt)}else At=Number(n.offsets.host[me])+Number(n.offsets.host[j]/2-Ve/2);let Nt=At-(null!==(h=v[me])&&void 0!==h?h:0)-Ie-_t;return Nt=Math.max(Math.min(v[j]-(Ve+5),Nt),0),n.offsets.arrow={[me]:Math.round(Nt),[ye]:""},n.instance.arrow=D,n}function eP(n){if(n.offsets.target=Uu(n.offsets.target),!HM(n.options,"flip"))return n.offsets.target=Object.assign(Object.assign({},n.offsets.target),Ng(n.instance.target,n.offsets.host,n.placement)),n;const e=Pg(n.instance.target,n.instance.host,0,"viewport",!1);let t=n.placement.split(" ")[0],r=n.placement.split(" ")[1]||"";const v=LM("auto",n.offsets.host,n.instance.target,n.instance.host,n.options.allowedPositions),D=[t,v];return D.forEach((L,j)=>{var Q,me,ye,Te,Ve,je,gt,Ie,_t,At,Nt,Vt,Zt,Se,De,ke;if(t!==L||D.length===j+1)return;t=n.placement.split(" ")[0];const dt="left"===t&&Math.floor(null!==(Q=n.offsets.target.right)&&void 0!==Q?Q:0)>Math.floor(null!==(me=n.offsets.host.left)&&void 0!==me?me:0)||"right"===t&&Math.floor(null!==(ye=n.offsets.target.left)&&void 0!==ye?ye:0)Math.floor(null!==(je=n.offsets.host.top)&&void 0!==je?je:0)||"bottom"===t&&Math.floor(null!==(gt=n.offsets.target.top)&&void 0!==gt?gt:0)Math.floor(null!==(Vt=e.right)&&void 0!==Vt?Vt:0),vt=Math.floor(null!==(Zt=n.offsets.target.top)&&void 0!==Zt?Zt:0)Math.floor(null!==(ke=e.bottom)&&void 0!==ke?ke:0),Fe="left"===t&&Qe||"right"===t&&st||"top"===t&&vt||"bottom"===t&&Ze,Ke=-1!==["top","bottom"].indexOf(t),qe=Ke&&"left"===r&&Qe||Ke&&"right"===r&&st||!Ke&&"left"===r&&vt||!Ke&&"right"===r&&Ze;(dt||Fe||qe)&&((dt||Fe)&&(t=D[j+1]),qe&&(r=function Z7(n){return"right"===n?"left":"left"===n?"right":n}(r)),n.placement=t+(r?` ${r}`:""),n.offsets.target=Object.assign(Object.assign({},n.offsets.target),Ng(n.instance.target,n.offsets.host,n.placement)))}),n}function nP(n){var e;if(!HM(n.options,"preventOverflow"))return n;const t="transform",r=n.instance.target.style,{top:i,left:a,[t]:h}=r;r.top="",r.left="",r[t]="";const v=Pg(n.instance.target,n.instance.host,0,(null===(e=n.options.modifiers.preventOverflow)||void 0===e?void 0:e.boundariesElement)||"scrollParent",!1);r.top=i,r.left=a,r[t]=h;const L={primary(j){var Q,me,ye,Te;let Ve=n.offsets.target[j];return(null!==(Q=n.offsets.target[j])&&void 0!==Q?Q:0)<(null!==(me=v[j])&&void 0!==me?me:0)&&(Ve=Math.max(null!==(ye=n.offsets.target[j])&&void 0!==ye?ye:0,null!==(Te=v[j])&&void 0!==Te?Te:0)),{[j]:Ve}},secondary(j){var Q,me,ye,Te;const Ve="right"===j,je=Ve?"left":"top";let Ie=n.offsets.target[je];return(null!==(Q=n.offsets.target[j])&&void 0!==Q?Q:0)>(null!==(me=v[j])&&void 0!==me?me:0)&&(Ie=Math.min(null!==(ye=n.offsets.target[je])&&void 0!==ye?ye:0,(null!==(Te=v[j])&&void 0!==Te?Te:0)-n.offsets.target[Ve?"width":"height"])),{[je]:Ie}}};return["left","right","top","bottom"].forEach(j=>{const Q=-1!==["left","top","start"].indexOf(j)?L.primary:L.secondary;n.offsets.target=Object.assign(Object.assign({},n.offsets.target),Q(j))}),n}function rP(n){var e;const t=n.placement,r=t.split(" ")[0],i=t.split(" ")[1];if(i){const{host:a,target:h}=n.offsets,v=-1!==["bottom","top"].indexOf(r),D=v?"left":"top",L=v?"width":"height",j={start:{[D]:a[D]},end:{[D]:(null!==(e=a[D])&&void 0!==e?e:0)+a[L]-h[L]}};n.offsets.target=Object.assign(Object.assign({},h),{[D]:D===i?j.start[D]:j.end[D]})}return n}const oP=new class iP{position(e,t){return this.offset(e,t)}offset(e,t){return UM(t,e)}positionElements(e,t,r,i,a){const h=[eP,rP,nP,J7],D=function tP(n,e,t,r){if(!n||!e)return;const i=UM(n,e);!t.match(/^(auto)*\s*(left|right|top|bottom|start|end)*$/)&&!t.match(/^(left|right|top|bottom|start|end)*(?: (left|right|top|bottom|start|end))*$/)&&(t="auto");const a=!!t.match(/auto/g);let h=t.match(/auto\s(left|right|top|bottom|start|end)/)?t.split(" ")[1]||"auto":t;const v=h.match(/^(left|right|top|bottom|start|end)* ?(?!\1)(left|right|top|bottom|start|end)?/);return v&&(h=v[1]+(v[2]?` ${v[2]}`:"")),-1!==["left right","right left","top bottom","bottom top"].indexOf(h)&&(h="auto"),h=LM(h,i,n,e,r?r.allowedPositions:void 0),{options:r||{modifiers:{}},instance:{target:n,host:e,arrow:void 0},offsets:{target:Ng(n,i,h),host:i,arrow:void 0},positionFixed:!1,placement:h,placementAuto:a}}(t,e,Xf[r],a);if(D)return h.reduce((L,j)=>j(L),D)}};function sP(n,e,t,r,i,a){const h=oP.positionElements(n,e,t,r,i);if(!h)return;const v=function q7(n){var e,t,r,i;return{width:n.offsets.target.width,height:n.offsets.target.height,left:Math.floor(null!==(e=n.offsets.target.left)&&void 0!==e?e:0),top:Math.round(null!==(t=n.offsets.target.top)&&void 0!==t?t:0),bottom:Math.round(null!==(r=n.offsets.target.bottom)&&void 0!==r?r:0),right:Math.floor(null!==(i=n.offsets.target.right)&&void 0!==i?i:0)}}(h);VM(e,{"will-change":"transform",top:"0px",left:"0px",transform:`translate3d(${v.left}px, ${v.top}px, 0px)`},a),h.instance.arrow&&VM(h.instance.arrow,h.offsets.arrow,a),function Q7(n,e){const t=n.instance.target;let r=t.className;const i=Lu().isBs5?Fu[n.placement]:n.placement;n.placementAuto&&(r=r.replace(/bs-popover-auto/g,`bs-popover-${i}`),r=r.replace(/ms-2|me-2|mb-2|mt-2/g,""),r=r.replace(/bs-tooltip-auto/g,`bs-tooltip-${i}`),r=r.replace(/\sauto/g,` ${i}`),-1!==r.indexOf("popover")&&(r=r+" "+function Y7(n){return Lu().isBs5?Jf(n,"end")?"ms-2":Jf(n,"start")?"me-2":Jf(n,"top")?"mb-2":Jf(n,"bottom")?"mt-2":"":""}(i)),-1!==r.indexOf("popover")&&-1===r.indexOf("popover-auto")&&(r+=" popover-auto"),-1!==r.indexOf("tooltip")&&-1===r.indexOf("tooltip-auto")&&(r+=" tooltip-auto")),r=r.replace(/left|right|top|bottom|end|start/g,`${i.split(" ")[0]}`),e?e.setAttribute(t,"class",r):t.className=r}(h,a)}let eh=(()=>{class n{constructor(t,r,i){this.update$$=new o,this.positionElements=new Map,this.isDisabled=!1,X2(i)&&t.runOutsideAngular(()=>{this.triggerEvent$=Be(Ag(window,"scroll",{passive:!0}),Ag(window,"resize",{passive:!0}),tn(0,j7),this.update$$),this.triggerEvent$.subscribe(()=>{this.isDisabled||this.positionElements.forEach(a=>{sP(th(a.target),th(a.element),a.attachment,a.appendToBody,this.options,r.createRenderer(null,null))})})})}position(t){this.addPositionElement(t)}get event$(){return this.triggerEvent$}disable(){this.isDisabled=!0}enable(){this.isDisabled=!1}addPositionElement(t){this.positionElements.set(th(t.element),t)}calcPosition(){this.update$$.next(null)}deletePositionElement(t){this.positionElements.delete(th(t))}setOptions(t){this.options=t}}return n.\u0275fac=function(t){return new(t||n)(Mt(or),Mt(Qs),Mt(Au))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function th(n){return"string"==typeof n?document.querySelector(n):n instanceof kr?n.nativeElement:null!=n?n:null}class Hu{constructor(e,t,r){this.nodes=e,this.viewRef=t,this.componentRef=r}}class aP{constructor(e,t,r,i,a,h,v,D){this._viewContainerRef=e,this._renderer=t,this._elementRef=r,this._injector=i,this._componentFactoryResolver=a,this._ngZone=h,this._applicationRef=v,this._posService=D,this.onBeforeShow=new vn,this.onShown=new vn,this.onBeforeHide=new vn,this.onHidden=new vn,this._providers=[],this._isHiding=!1,this.containerDefaultSelector="body",this._listenOpts={},this._globalListener=Function.prototype}get isShown(){return!this._isHiding&&!!this._componentRef}attach(e){return this._componentFactory=this._componentFactoryResolver.resolveComponentFactory(e),this}to(e){return this.container=e||this.container,this}position(e){return e?(this.attachment=e.attachment||this.attachment,this._elementRef=e.target||this._elementRef,this):this}provide(e){return this._providers.push(e),this}show(e={}){if(this._subscribePositioning(),this._innerComponent=void 0,!this._componentRef){this.onBeforeShow.emit(),this._contentRef=this._getContentRef(e.content,e.context,e.initialState);const t=Cr.create({providers:this._providers,parent:this._injector});if(!this._componentFactory)return;if(this._componentRef=this._componentFactory.create(t,this._contentRef.nodes),this._applicationRef.attachView(this._componentRef.hostView),this.instance=this._componentRef.instance,Object.assign(this._componentRef.instance,e),this.container instanceof kr&&this.container.nativeElement.appendChild(this._componentRef.location.nativeElement),"string"==typeof this.container&&"undefined"!=typeof document){const r=document.querySelector(this.container)||document.querySelector(this.containerDefaultSelector);if(!r)return;r.appendChild(this._componentRef.location.nativeElement)}!this.container&&this._elementRef&&this._elementRef.nativeElement.parentElement&&this._elementRef.nativeElement.parentElement.appendChild(this._componentRef.location.nativeElement),this._contentRef.componentRef&&(this._innerComponent=this._contentRef.componentRef.instance,this._contentRef.componentRef.changeDetectorRef.markForCheck(),this._contentRef.componentRef.changeDetectorRef.detectChanges()),this._componentRef.changeDetectorRef.markForCheck(),this._componentRef.changeDetectorRef.detectChanges(),this.onShown.emit(e.id?{id:e.id}:this._componentRef.instance)}return this._registerOutsideClick(),this._componentRef}hide(e){var t,r,i,a,h,v;if(!this._componentRef)return this;this._posService.deletePositionElement(this._componentRef.location),this.onBeforeHide.emit(this._componentRef.instance);const D=this._componentRef.location.nativeElement;return null===(t=D.parentNode)||void 0===t||t.removeChild(D),null===(i=null===(r=this._contentRef)||void 0===r?void 0:r.componentRef)||void 0===i||i.destroy(),this._viewContainerRef&&(null===(a=this._contentRef)||void 0===a?void 0:a.viewRef)&&this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._contentRef.viewRef)),null===(v=null===(h=this._contentRef)||void 0===h?void 0:h.viewRef)||void 0===v||v.destroy(),this._contentRef=void 0,this._componentRef=void 0,this._removeGlobalListener(),this.onHidden.emit(e?{id:e}:null),this}toggle(){this.isShown?this.hide():this.show()}dispose(){this.isShown&&this.hide(),this._unsubscribePositioning(),this._unregisterListenersFn&&this._unregisterListenersFn()}listen(e){var t;this.triggers=e.triggers||this.triggers,this._listenOpts.outsideClick=e.outsideClick,this._listenOpts.outsideEsc=e.outsideEsc,e.target=e.target||(null===(t=this._elementRef)||void 0===t?void 0:t.nativeElement);const r=this._listenOpts.hide=()=>e.hide?e.hide():void this.hide(),i=this._listenOpts.show=h=>{e.show?e.show(h):this.show(h),h()};return this._renderer&&(this._unregisterListenersFn=function D7(n,e){const t=function xM(n,e=T7){const t=(n||"").trim();if(0===t.length)return[];const r=t.split(/\s+/).map(a=>a.split(":")).map(a=>{const h=e[a[0]]||a;return new A7(h[0],h[1])}),i=r.filter(a=>a.isManual());if(i.length>1)throw new Error("Triggers parse error: only one manual trigger is allowed");if(1===i.length&&r.length>1)throw new Error("Triggers parse error: manual trigger can't be mixed with other triggers");return r}(e.triggers),r=e.target;if(1===t.length&&t[0].isManual())return Function.prototype;const i=[],a=[],h=()=>{a.forEach(v=>i.push(v())),a.length=0};return t.forEach(v=>{const D=v.open===v.close,L=D?e.toggle:e.show;if(!D&&v.close&&e.hide){const j=n.listen(r,v.close,e.hide);a.push(()=>j)}L&&i.push(n.listen(r,v.open,()=>L(h)))}),()=>{i.forEach(v=>v())}}(this._renderer,{target:e.target,triggers:e.triggers,show:i,hide:r,toggle:h=>{this.isShown?r():i(h)}})),this}_removeGlobalListener(){this._globalListener&&(this._globalListener(),this._globalListener=Function.prototype)}attachInline(e,t){return e&&t&&(this._inlineViewRef=e.createEmbeddedView(t)),this}_registerOutsideClick(){if(this._componentRef&&this._componentRef.location){if(this._listenOpts.outsideClick){const e=this._componentRef.location.nativeElement;setTimeout(()=>{this._renderer&&this._elementRef&&(this._globalListener=function I7(n,e){return e.outsideClick?n.listen("document","click",t=>{e.target&&e.target.contains(t.target)||e.targets&&e.targets.some(r=>r.contains(t.target))||e.hide&&e.hide()}):Function.prototype}(this._renderer,{targets:[e,this._elementRef.nativeElement],outsideClick:this._listenOpts.outsideClick,hide:()=>this._listenOpts.hide&&this._listenOpts.hide()}))})}this._listenOpts.outsideEsc&&this._renderer&&this._elementRef&&(this._globalListener=function R7(n,e){return e.outsideEsc?n.listen("document","keyup.esc",t=>{e.target&&e.target.contains(t.target)||e.targets&&e.targets.some(r=>r.contains(t.target))||e.hide&&e.hide()}):Function.prototype}(this._renderer,{targets:[this._componentRef.location.nativeElement,this._elementRef.nativeElement],outsideEsc:this._listenOpts.outsideEsc,hide:()=>this._listenOpts.hide&&this._listenOpts.hide()}))}}getInnerComponent(){return this._innerComponent}_subscribePositioning(){this._zoneSubscription||!this.attachment||(this.onShown.subscribe(()=>{var e;this._posService.position({element:null===(e=this._componentRef)||void 0===e?void 0:e.location,target:this._elementRef,attachment:this.attachment,appendToBody:"body"===this.container})}),this._zoneSubscription=this._ngZone.onStable.subscribe(()=>{!this._componentRef||this._posService.calcPosition()}))}_unsubscribePositioning(){!this._zoneSubscription||(this._zoneSubscription.unsubscribe(),this._zoneSubscription=void 0)}_getContentRef(e,t,r){if(!e)return new Hu([]);if(e instanceof No){if(this._viewContainerRef){const h=this._viewContainerRef.createEmbeddedView(e,t);return h.markForCheck(),new Hu([h.rootNodes],h)}const a=e.createEmbeddedView({});return this._applicationRef.attachView(a),new Hu([a.rootNodes],a)}if("function"==typeof e){const a=this._componentFactoryResolver.resolveComponentFactory(e),h=Cr.create({providers:this._providers,parent:this._injector}),v=a.create(h);return Object.assign(v.instance,r),this._applicationRef.attachView(v.hostView),new Hu([[v.location.nativeElement]],v.hostView,v)}const i=this._renderer?[this._renderer.createText(`${e}`)]:[];return new Hu([i])}}let nh=(()=>{class n{constructor(t,r,i,a,h){this._componentFactoryResolver=t,this._ngZone=r,this._injector=i,this._posService=a,this._applicationRef=h}createLoader(t,r,i){return new aP(r,i,t,this._injector,this._componentFactoryResolver,this._ngZone,this._applicationRef,this._posService)}}return n.\u0275fac=function(t){return new(t||n)(Mt(Ys),Mt(or),Mt(Cr),Mt(eh),Mt(fl))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();Ci({height:0,overflow:"hidden"}),pl("220ms cubic-bezier(0, 0, 0.2, 1)",Ci({height:"*",overflow:"hidden"}));let uP=(()=>{class n{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new vn,this.isDisabledChange=new vn,this.toggleClick=new vn,this.counts=0,this.dropdownMenu=new Promise(t=>{this.resolveDropdownMenu=t})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})(),cP=(()=>{class n{static forRoot(){return{ngModule:n,providers:[nh,eh,uP]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Pu]]}),n})();class Vi extends o{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new re;return this._value}next(e){super.next(this._value=e)}}class fP extends O{notifyNext(e,t,r,i,a){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class hP extends O{constructor(e,t,r){super(),this.parent=e,this.outerValue=t,this.outerIndex=r,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function dP(n,e,t,r,i=new hP(n,t,r)){if(!i.closed)return e instanceof Z?e.subscribe(i):ge(e)(i)}const jM={};class gP{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new mP(e,this.resultSelector))}}class mP extends fP{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(jM),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let r=0;re.schedule(vP,0,{error:n,subscriber:t}):t=>t.error(n))}function vP({error:n,subscriber:e}){e.error(n)}const ih=(()=>{function n(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return n.prototype=Object.create(Error.prototype),n})();function kg(...n){return function yP(){return Oe(1)}()(tn(...n))}const ml=new Z(n=>n.complete());function oh(n){return n?function bP(n){return new Z(e=>n.schedule(()=>e.complete()))}(n):ml}function $M(n){return new Z(e=>{let t;try{t=n()}catch(i){return void e.error(i)}return(t?Me(t):oh()).subscribe(e)})}function Cs(n,e){return"function"==typeof e?t=>t.pipe(Cs((r,i)=>Me(n(r,i)).pipe(u((a,h)=>e(r,a,i,h))))):t=>t.lift(new _P(n))}class _P{constructor(e){this.project=e}call(e,t){return t.subscribe(new wP(e,this.project))}}class wP extends Y{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const r=this.index++;try{t=this.project(e,r)}catch(i){return void this.destination.error(i)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const r=new le(this),i=this.destination;i.add(r),this.innerSubscription=Le(e,r),this.innerSubscription!==r&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const zM=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function sh(n){return e=>0===n?oh():e.lift(new MP(n))}class MP{constructor(e){if(this.total=e,this.total<0)throw new zM}call(e,t){return t.subscribe(new EP(e,this.total))}}class EP extends O{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))}}function GM(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(i){return i.lift(new SP(n,e,t))}}class SP{constructor(e,t,r=!1){this.accumulator=e,this.seed=t,this.hasSeed=r}call(e,t){return t.subscribe(new CP(e,this.accumulator,this.seed,this.hasSeed))}}class CP extends O{constructor(e,t,r,i){super(e),this.accumulator=t,this._seed=r,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let r;try{r=this.accumulator(this.seed,e,t)}catch(i){this.destination.error(i)}this.seed=r,this.destination.next(r)}}function rs(n,e){return function(r){return r.lift(new AP(n,e))}}class AP{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new TP(e,this.predicate,this.thisArg))}}class TP extends O{constructor(e,t,r){super(e),this.predicate=t,this.thisArg=r,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(r){return void this.destination.error(r)}t&&this.destination.next(e)}}function ia(n){return function(t){const r=new DP(n),i=t.lift(r);return r.caught=i}}class DP{constructor(e){this.selector=e}call(e,t){return t.subscribe(new IP(e,this.selector,this.caught))}}class IP extends Y{constructor(e,t,r){super(e),this.selector=t,this.caught=r}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(a){return void super.error(a)}this._unsubscribeAndRecycle();const r=new le(this);this.add(r);const i=Le(t,r);i!==r&&this.add(i)}}}function vl(n,e){return xe(n,e,1)}function Bg(n){return function(t){return 0===n?oh():t.lift(new RP(n))}}class RP{constructor(e){if(this.total=e,this.total<0)throw new zM}call(e,t){return t.subscribe(new OP(e,this.total))}}class OP extends O{constructor(e,t){super(e),this.total=t,this.ring=new Array,this.count=0}_next(e){const t=this.ring,r=this.total,i=this.count++;t.length0){const r=this.count>=this.total?this.total:this.count,i=this.ring;for(let a=0;ae.lift(new PP(n))}class PP{constructor(e){this.errorFactory=e}call(e,t){return t.subscribe(new NP(e,this.errorFactory))}}class NP extends O{constructor(e,t){super(e),this.errorFactory=t,this.hasValue=!1}_next(e){this.hasValue=!0,this.destination.next(e)}_complete(){if(this.hasValue)return this.destination.complete();{let e;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)}}}function kP(){return new ih}function qM(n=null){return e=>e.lift(new BP(n))}class BP{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new LP(e,this.defaultValue))}}class LP extends O{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function fi(n,e){const t=arguments.length>=2;return r=>r.pipe(n?rs((i,a)=>n(i,a,r)):G,sh(1),t?qM(e):KM(()=>new ih))}function As(){}function Ti(n,e,t){return function(i){return i.lift(new UP(n,e,t))}}class UP{constructor(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}call(e,t){return t.subscribe(new HP(e,this.nextOrObserver,this.error,this.complete))}}class HP extends O{constructor(e,t,r,i){super(e),this._tapNext=As,this._tapError=As,this._tapComplete=As,this._tapError=r||As,this._tapComplete=i||As,R(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||As,this._tapError=t.error||As,this._tapComplete=t.complete||As)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class jP{constructor(e){this.callback=e}call(e,t){return t.subscribe(new $P(e,this.callback))}}class $P extends O{constructor(e,t){super(e),this.add(new x(t))}}class is{constructor(e,t){this.id=e,this.url=t}}class Lg extends is{constructor(e,t,r="imperative",i=null){super(e,t),this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class yl extends is{constructor(e,t,r){super(e,t),this.urlAfterRedirects=r}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class WM extends is{constructor(e,t,r){super(e,t),this.reason=r}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class zP extends is{constructor(e,t,r){super(e,t),this.error=r}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class GP extends is{constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class KP extends is{constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class qP extends is{constructor(e,t,r,i,a){super(e,t),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=a}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class WP extends is{constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ZP extends is{constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ZM{constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class XM{constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class XP{constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class YP{constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class QP{constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class JP{constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class YM{constructor(e,t,r){this.routerEvent=e,this.position=t,this.anchor=r}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const yn="primary";class e9{constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function bl(n){return new e9(n)}const QM="ngNavigationCancelingError";function Fg(n){const e=Error("NavigationCancelingError: "+n);return e[QM]=!0,e}function n9(n,e,t){const r=t.path.split("/");if(r.length>n.length||"full"===t.pathMatch&&(e.hasChildren()||r.lengthr[a]===i)}return n===e}function eE(n){return Array.prototype.concat.apply([],n)}function tE(n){return n.length>0?n[n.length-1]:null}function $r(n,e){for(const t in n)n.hasOwnProperty(t)&&e(n[t],t)}function Lo(n){return fp(n)?n:pu(n)?Me(Promise.resolve(n)):tn(n)}const o9={exact:function iE(n,e,t){if(!sa(n.segments,e.segments)||!ah(n.segments,e.segments,t)||n.numberOfChildren!==e.numberOfChildren)return!1;for(const r in e.children)if(!n.children[r]||!iE(n.children[r],e.children[r],t))return!1;return!0},subset:oE},nE={exact:function s9(n,e){return Bo(n,e)},subset:function a9(n,e){return Object.keys(e).length<=Object.keys(n).length&&Object.keys(e).every(t=>JM(n[t],e[t]))},ignored:()=>!0};function rE(n,e,t){return o9[t.paths](n.root,e.root,t.matrixParams)&&nE[t.queryParams](n.queryParams,e.queryParams)&&!("exact"===t.fragment&&n.fragment!==e.fragment)}function oE(n,e,t){return sE(n,e,e.segments,t)}function sE(n,e,t,r){if(n.segments.length>t.length){const i=n.segments.slice(0,t.length);return!(!sa(i,t)||e.hasChildren()||!ah(i,t,r))}if(n.segments.length===t.length){if(!sa(n.segments,t)||!ah(n.segments,t,r))return!1;for(const i in e.children)if(!n.children[i]||!oE(n.children[i],e.children[i],r))return!1;return!0}{const i=t.slice(0,n.segments.length),a=t.slice(n.segments.length);return!!(sa(n.segments,i)&&ah(n.segments,i,r)&&n.children[yn])&&sE(n.children[yn],e,a,r)}}function ah(n,e,t){return e.every((r,i)=>nE[t](n[i].parameters,r.parameters))}class oa{constructor(e,t,r){this.root=e,this.queryParams=t,this.fragment=r}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=bl(this.queryParams)),this._queryParamMap}toString(){return c9.serialize(this)}}class _n{constructor(e,t){this.segments=e,this.children=t,this.parent=null,$r(t,(r,i)=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return lh(this)}}class Vu{constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap||(this._parameterMap=bl(this.parameters)),this._parameterMap}toString(){return fE(this)}}function sa(n,e){return n.length===e.length&&n.every((t,r)=>t.path===e[r].path)}class aE{}class lE{parse(e){const t=new b9(e);return new oa(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){const t=`/${ju(e.root,!0)}`,r=function d9(n){const e=Object.keys(n).map(t=>{const r=n[t];return Array.isArray(r)?r.map(i=>`${uh(t)}=${uh(i)}`).join("&"):`${uh(t)}=${uh(r)}`}).filter(t=>!!t);return e.length?`?${e.join("&")}`:""}(e.queryParams),i="string"==typeof e.fragment?`#${function f9(n){return encodeURI(n)}(e.fragment)}`:"";return`${t}${r}${i}`}}const c9=new lE;function lh(n){return n.segments.map(e=>fE(e)).join("/")}function ju(n,e){if(!n.hasChildren())return lh(n);if(e){const t=n.children[yn]?ju(n.children[yn],!1):"",r=[];return $r(n.children,(i,a)=>{a!==yn&&r.push(`${a}:${ju(i,!1)}`)}),r.length>0?`${t}(${r.join("//")})`:t}{const t=function u9(n,e){let t=[];return $r(n.children,(r,i)=>{i===yn&&(t=t.concat(e(r,i)))}),$r(n.children,(r,i)=>{i!==yn&&(t=t.concat(e(r,i)))}),t}(n,(r,i)=>i===yn?[ju(n.children[yn],!1)]:[`${i}:${ju(r,!1)}`]);return 1===Object.keys(n.children).length&&null!=n.children[yn]?`${lh(n)}/${t[0]}`:`${lh(n)}/(${t.join("//")})`}}function uE(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function uh(n){return uE(n).replace(/%3B/gi,";")}function Ug(n){return uE(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function ch(n){return decodeURIComponent(n)}function cE(n){return ch(n.replace(/\+/g,"%20"))}function fE(n){return`${Ug(n.path)}${function h9(n){return Object.keys(n).map(e=>`;${Ug(e)}=${Ug(n[e])}`).join("")}(n.parameters)}`}const p9=/^[^\/()?;=#]+/;function fh(n){const e=n.match(p9);return e?e[0]:""}const g9=/^[^=?&#]+/,v9=/^[^&#]+/;class b9{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new _n([],{}):new _n([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(r[yn]=new _n(e,t)),r}parseSegment(){const e=fh(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(e),new Vu(ch(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=fh(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const i=fh(this.remaining);i&&(r=i,this.capture(r))}e[ch(t)]=ch(r)}parseQueryParam(e){const t=function m9(n){const e=n.match(g9);return e?e[0]:""}(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const h=function y9(n){const e=n.match(v9);return e?e[0]:""}(this.remaining);h&&(r=h,this.capture(r))}const i=cE(t),a=cE(r);if(e.hasOwnProperty(i)){let h=e[i];Array.isArray(h)||(h=[h],e[i]=h),h.push(a)}else e[i]=a}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=fh(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let a;r.indexOf(":")>-1?(a=r.substr(0,r.indexOf(":")),this.capture(a),this.capture(":")):e&&(a=yn);const h=this.parseChildren();t[a]=1===Object.keys(h).length?h[yn]:new _n([],h),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new Error(`Expected "${e}".`)}}class hE{constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=Hg(e,this._root);return t?t.children.map(r=>r.value):[]}firstChild(e){const t=Hg(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=Vg(e,this._root);return t.length<2?[]:t[t.length-2].children.map(i=>i.value).filter(i=>i!==e)}pathFromRoot(e){return Vg(e,this._root).map(t=>t.value)}}function Hg(n,e){if(n===e.value)return e;for(const t of e.children){const r=Hg(n,t);if(r)return r}return null}function Vg(n,e){if(n===e.value)return[e];for(const t of e.children){const r=Vg(n,t);if(r.length)return r.unshift(e),r}return[]}class os{constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function _l(n){const e={};return n&&n.children.forEach(t=>e[t.value.outlet]=t),e}class dE extends hE{constructor(e,t){super(e),this.snapshot=t,jg(this,e)}toString(){return this.snapshot.toString()}}function pE(n,e){const t=function _9(n,e){const h=new hh([],{},{},"",{},yn,e,null,n.root,-1,{});return new mE("",new os(h,[]))}(n,e),r=new Vi([new Vu("",{})]),i=new Vi({}),a=new Vi({}),h=new Vi({}),v=new Vi(""),D=new wl(r,i,h,v,a,yn,e,t.root);return D.snapshot=t.root,new dE(new os(D,[]),t)}class wl{constructor(e,t,r,i,a,h,v,D){this.url=e,this.params=t,this.queryParams=r,this.fragment=i,this.data=a,this.outlet=h,this.component=v,this._futureSnapshot=D}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(u(e=>bl(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(u(e=>bl(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function gE(n,e="emptyOnly"){const t=n.pathFromRoot;let r=0;if("always"!==e)for(r=t.length-1;r>=1;){const i=t[r],a=t[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(a.component)break;r--}}return function w9(n){return n.reduce((e,t)=>({params:Object.assign(Object.assign({},e.params),t.params),data:Object.assign(Object.assign({},e.data),t.data),resolve:Object.assign(Object.assign({},e.resolve),t._resolvedData)}),{params:{},data:{},resolve:{}})}(t.slice(r))}class hh{constructor(e,t,r,i,a,h,v,D,L,j,Q){this.url=e,this.params=t,this.queryParams=r,this.fragment=i,this.data=a,this.outlet=h,this.component=v,this.routeConfig=D,this._urlSegment=L,this._lastPathIndex=j,this._resolve=Q}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=bl(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=bl(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class mE extends hE{constructor(e,t){super(t),this.url=e,jg(this,t)}toString(){return vE(this._root)}}function jg(n,e){e.value._routerState=n,e.children.forEach(t=>jg(n,t))}function vE(n){const e=n.children.length>0?` { ${n.children.map(vE).join(", ")} } `:"";return`${n.value}${e}`}function $g(n){if(n.snapshot){const e=n.snapshot,t=n._futureSnapshot;n.snapshot=t,Bo(e.queryParams,t.queryParams)||n.queryParams.next(t.queryParams),e.fragment!==t.fragment&&n.fragment.next(t.fragment),Bo(e.params,t.params)||n.params.next(t.params),function r9(n,e){if(n.length!==e.length)return!1;for(let t=0;tBo(t.parameters,e[r].parameters))}(n.url,e.url);return t&&!(!n.parent!=!e.parent)&&(!n.parent||zg(n.parent,e.parent))}function $u(n,e,t){if(t&&n.shouldReuseRoute(e.value,t.value.snapshot)){const r=t.value;r._futureSnapshot=e.value;const i=function E9(n,e,t){return e.children.map(r=>{for(const i of t.children)if(n.shouldReuseRoute(r.value,i.value.snapshot))return $u(n,r,i);return $u(n,r)})}(n,e,t);return new os(r,i)}{if(n.shouldAttach(e.value)){const a=n.retrieve(e.value);if(null!==a){const h=a.route;return h.value._futureSnapshot=e.value,h.children=e.children.map(v=>$u(n,v)),h}}const r=function x9(n){return new wl(new Vi(n.url),new Vi(n.params),new Vi(n.queryParams),new Vi(n.fragment),new Vi(n.data),n.outlet,n.component,n)}(e.value),i=e.children.map(a=>$u(n,a));return new os(r,i)}}function dh(n){return"object"==typeof n&&null!=n&&!n.outlets&&!n.segmentPath}function zu(n){return"object"==typeof n&&null!=n&&n.outlets}function Gg(n,e,t,r,i){let a={};if(r&&$r(r,(v,D)=>{a[D]=Array.isArray(v)?v.map(L=>`${L}`):`${v}`}),n===e)return new oa(t,a,i);const h=yE(n,e,t);return new oa(h,a,i)}function yE(n,e,t){const r={};return $r(n.children,(i,a)=>{r[a]=i===e?t:yE(i,e,t)}),new _n(n.segments,r)}class bE{constructor(e,t,r){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=r,e&&r.length>0&&dh(r[0]))throw new Error("Root segment cannot have matrix parameters");const i=r.find(zu);if(i&&i!==tE(r))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Kg{constructor(e,t,r){this.segmentGroup=e,this.processChildren=t,this.index=r}}function _E(n,e,t){if(n||(n=new _n([],{})),0===n.segments.length&&n.hasChildren())return ph(n,e,t);const r=function I9(n,e,t){let r=0,i=e;const a={match:!1,pathIndex:0,commandIndex:0};for(;i=t.length)return a;const h=n.segments[i],v=t[r];if(zu(v))break;const D=`${v}`,L=r0&&void 0===D)break;if(D&&L&&"object"==typeof L&&void 0===L.outlets){if(!ME(D,L,h))return a;r+=2}else{if(!ME(D,{},h))return a;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(n,e,t),i=t.slice(r.commandIndex);if(r.match&&r.pathIndex{"string"==typeof a&&(a=[a]),null!==a&&(i[h]=_E(n.children[h],e,a))}),$r(n.children,(a,h)=>{void 0===r[h]&&(i[h]=a)}),new _n(n.segments,i)}}function qg(n,e,t){const r=n.segments.slice(0,e);let i=0;for(;i{"string"==typeof t&&(t=[t]),null!==t&&(e[r]=qg(new _n([],{}),0,t))}),e}function wE(n){const e={};return $r(n,(t,r)=>e[r]=`${t}`),e}function ME(n,e,t){return n==t.path&&Bo(e,t.parameters)}class P9{constructor(e,t,r,i){this.routeReuseStrategy=e,this.futureState=t,this.currState=r,this.forwardEvent=i}activate(e){const t=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,r,e),$g(this.futureState.root),this.activateChildRoutes(t,r,e)}deactivateChildRoutes(e,t,r){const i=_l(t);e.children.forEach(a=>{const h=a.value.outlet;this.deactivateRoutes(a,i[h],r),delete i[h]}),$r(i,(a,h)=>{this.deactivateRouteAndItsChildren(a,r)})}deactivateRoutes(e,t,r){const i=e.value,a=t?t.value:null;if(i===a)if(i.component){const h=r.getContext(i.outlet);h&&this.deactivateChildRoutes(e,t,h.children)}else this.deactivateChildRoutes(e,t,r);else a&&this.deactivateRouteAndItsChildren(t,r)}deactivateRouteAndItsChildren(e,t){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const r=t.getContext(e.value.outlet),i=r&&e.value.component?r.children:t,a=_l(e);for(const h of Object.keys(a))this.deactivateRouteAndItsChildren(a[h],i);if(r&&r.outlet){const h=r.outlet.detach(),v=r.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:h,route:e,contexts:v})}}deactivateRouteAndOutlet(e,t){const r=t.getContext(e.value.outlet),i=r&&e.value.component?r.children:t,a=_l(e);for(const h of Object.keys(a))this.deactivateRouteAndItsChildren(a[h],i);r&&r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated(),r.attachRef=null,r.resolver=null,r.route=null)}activateChildRoutes(e,t,r){const i=_l(t);e.children.forEach(a=>{this.activateRoutes(a,i[a.value.outlet],r),this.forwardEvent(new JP(a.value.snapshot))}),e.children.length&&this.forwardEvent(new YP(e.value.snapshot))}activateRoutes(e,t,r){const i=e.value,a=t?t.value:null;if($g(i),i===a)if(i.component){const h=r.getOrCreateContext(i.outlet);this.activateChildRoutes(e,t,h.children)}else this.activateChildRoutes(e,t,r);else if(i.component){const h=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const v=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),h.children.onOutletReAttached(v.contexts),h.attachRef=v.componentRef,h.route=v.route.value,h.outlet&&h.outlet.attach(v.componentRef,v.route.value),$g(v.route.value),this.activateChildRoutes(e,null,h.children)}else{const v=function N9(n){for(let e=n.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig;if(t&&t.component)return null}return null}(i.snapshot),D=v?v.module.componentFactoryResolver:null;h.attachRef=null,h.route=i,h.resolver=D,h.outlet&&h.outlet.activateWith(i,D),this.activateChildRoutes(e,null,h.children)}}else this.activateChildRoutes(e,null,r)}}class Wg{constructor(e,t){this.routes=e,this.module=t}}function Ts(n){return"function"==typeof n}function aa(n){return n instanceof oa}const Gu=Symbol("INITIAL_VALUE");function Ku(){return Cs(n=>function pP(...n){let e,t;return c(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&M(n[0])&&(n=n[0]),wt(n,t).lift(new gP(e))}(n.map(e=>e.pipe(sh(1),function xP(...n){const e=n[n.length-1];return c(e)?(n.pop(),t=>kg(n,t,e)):t=>kg(n,t)}(Gu)))).pipe(GM((e,t)=>{let r=!1;return t.reduce((i,a,h)=>i!==Gu?i:(a===Gu&&(r=!0),r||!1!==a&&h!==t.length-1&&!aa(a)?i:a),e)},Gu),rs(e=>e!==Gu),u(e=>aa(e)?e:!0===e),sh(1)))}class H9{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new qu,this.attachRef=null}}class qu{constructor(){this.contexts=new Map}onChildOutletCreated(e,t){const r=this.getOrCreateContext(e);r.outlet=t,this.contexts.set(e,r)}onChildOutletDestroyed(e){const t=this.getContext(e);t&&(t.outlet=null,t.attachRef=null)}onOutletDeactivated(){const e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let t=this.getContext(e);return t||(t=new H9,this.contexts.set(e,t)),t}getContext(e){return this.contexts.get(e)||null}}let Zg=(()=>{class n{constructor(t,r,i,a,h){this.parentContexts=t,this.location=r,this.resolver=i,this.changeDetector=h,this.activated=null,this._activatedRoute=null,this.activateEvents=new vn,this.deactivateEvents=new vn,this.attachEvents=new vn,this.detachEvents=new vn,this.name=a||yn,t.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,r){this.activated=t,this._activatedRoute=r,this.location.insert(t.hostView),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,r){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;const h=(r=r||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),v=this.parentContexts.getOrCreateContext(this.name).children,D=new V9(t,v,this.location.injector);this.activated=this.location.createComponent(h,this.location.length,D),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return n.\u0275fac=function(t){return new(t||n)(ot(qu),ot(uo),ot(Ys),function ql(n){return function RC(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const r=t.length;let i=0;for(;i{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Un({type:n,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,r){1&t&&Bt(0,"router-outlet")},directives:[Zg],encapsulation:2}),n})();function xE(n,e=""){for(let t=0;tji(r)===e);return t.push(...n.filter(r=>ji(r)!==e)),t}const CE={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function gh(n,e,t){var r;if(""===e.path)return"full"===e.pathMatch&&(n.hasChildren()||t.length>0)?Object.assign({},CE):{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};const a=(e.matcher||n9)(t,n,e);if(!a)return Object.assign({},CE);const h={};$r(a.posParams,(D,L)=>{h[L]=D.path});const v=a.consumed.length>0?Object.assign(Object.assign({},h),a.consumed[a.consumed.length-1].parameters):h;return{matched:!0,consumedSegments:a.consumed,remainingSegments:t.slice(a.consumed.length),parameters:v,positionalParamSegments:null!==(r=a.posParams)&&void 0!==r?r:{}}}function mh(n,e,t,r,i="corrected"){if(t.length>0&&function K9(n,e,t){return t.some(r=>vh(n,e,r)&&ji(r)!==yn)}(n,t,r)){const h=new _n(e,function G9(n,e,t,r){const i={};i[yn]=r,r._sourceSegment=n,r._segmentIndexShift=e.length;for(const a of t)if(""===a.path&&ji(a)!==yn){const h=new _n([],{});h._sourceSegment=n,h._segmentIndexShift=e.length,i[ji(a)]=h}return i}(n,e,r,new _n(t,n.children)));return h._sourceSegment=n,h._segmentIndexShift=e.length,{segmentGroup:h,slicedSegments:[]}}if(0===t.length&&function q9(n,e,t){return t.some(r=>vh(n,e,r))}(n,t,r)){const h=new _n(n.segments,function z9(n,e,t,r,i,a){const h={};for(const v of r)if(vh(n,t,v)&&!i[ji(v)]){const D=new _n([],{});D._sourceSegment=n,D._segmentIndexShift="legacy"===a?n.segments.length:e.length,h[ji(v)]=D}return Object.assign(Object.assign({},i),h)}(n,e,t,r,n.children,i));return h._sourceSegment=n,h._segmentIndexShift=e.length,{segmentGroup:h,slicedSegments:t}}const a=new _n(n.segments,n.children);return a._sourceSegment=n,a._segmentIndexShift=e.length,{segmentGroup:a,slicedSegments:t}}function vh(n,e,t){return(!(n.hasChildren()||e.length>0)||"full"!==t.pathMatch)&&""===t.path}function AE(n,e,t,r){return!!(ji(n)===r||r!==yn&&vh(e,t,n))&&("**"===n.path||gh(e,n,t).matched)}function TE(n,e,t){return 0===e.length&&!n.children[t]}class yh{constructor(e){this.segmentGroup=e||null}}class DE{constructor(e){this.urlTree=e}}function Wu(n){return rh(new yh(n))}function IE(n){return rh(new DE(n))}function W9(n){return rh(new Error(`Only absolute redirects can have named outlets. redirectTo: '${n}'`))}class Y9{constructor(e,t,r,i,a){this.configLoader=t,this.urlSerializer=r,this.urlTree=i,this.config=a,this.allowRedirects=!0,this.ngModule=e.get(Yo)}apply(){const e=mh(this.urlTree.root,[],[],this.config).segmentGroup,t=new _n(e.segments,e.children);return this.expandSegmentGroup(this.ngModule,this.config,t,yn).pipe(u(a=>this.createUrlTree(Yg(a),this.urlTree.queryParams,this.urlTree.fragment))).pipe(ia(a=>{if(a instanceof DE)return this.allowRedirects=!1,this.match(a.urlTree);throw a instanceof yh?this.noMatchError(a):a}))}match(e){return this.expandSegmentGroup(this.ngModule,this.config,e.root,yn).pipe(u(i=>this.createUrlTree(Yg(i),e.queryParams,e.fragment))).pipe(ia(i=>{throw i instanceof yh?this.noMatchError(i):i}))}noMatchError(e){return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`)}createUrlTree(e,t,r){const i=e.segments.length>0?new _n([],{[yn]:e}):e;return new oa(i,t,r)}expandSegmentGroup(e,t,r,i){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(e,t,r).pipe(u(a=>new _n([],a))):this.expandSegment(e,r,t,r.segments,i,!0)}expandChildren(e,t,r){const i=[];for(const a of Object.keys(r.children))"primary"===a?i.unshift(a):i.push(a);return Me(i).pipe(vl(a=>{const h=r.children[a],v=SE(t,a);return this.expandSegmentGroup(e,v,h,a).pipe(u(D=>({segment:D,outlet:a})))}),GM((a,h)=>(a[h.outlet]=h.segment,a),{}),function FP(n,e){const t=arguments.length>=2;return r=>r.pipe(n?rs((i,a)=>n(i,a,r)):G,Bg(1),t?qM(e):KM(()=>new ih))}())}expandSegment(e,t,r,i,a,h){return Me(r).pipe(vl(v=>this.expandSegmentAgainstRoute(e,t,r,v,i,a,h).pipe(ia(L=>{if(L instanceof yh)return tn(null);throw L}))),fi(v=>!!v),ia((v,D)=>{if(v instanceof ih||"EmptyError"===v.name)return TE(t,i,a)?tn(new _n([],{})):Wu(t);throw v}))}expandSegmentAgainstRoute(e,t,r,i,a,h,v){return AE(i,t,a,h)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(e,t,i,a,h):v&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,r,i,a,h):Wu(t):Wu(t)}expandSegmentAgainstRouteUsingRedirect(e,t,r,i,a,h){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,r,i,h):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,r,i,a,h)}expandWildCardWithParamsAgainstRouteUsingRedirect(e,t,r,i){const a=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?IE(a):this.lineralizeSegments(r,a).pipe(xe(h=>{const v=new _n(h,{});return this.expandSegment(e,v,t,h,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(e,t,r,i,a,h){const{matched:v,consumedSegments:D,remainingSegments:L,positionalParamSegments:j}=gh(t,i,a);if(!v)return Wu(t);const Q=this.applyRedirectCommands(D,i.redirectTo,j);return i.redirectTo.startsWith("/")?IE(Q):this.lineralizeSegments(i,Q).pipe(xe(me=>this.expandSegment(e,t,r,me.concat(L),h,!1)))}matchSegmentAgainstRoute(e,t,r,i,a){if("**"===r.path)return r.loadChildren?(r._loadedConfig?tn(r._loadedConfig):this.configLoader.load(e.injector,r)).pipe(u(Q=>(r._loadedConfig=Q,new _n(i,{})))):tn(new _n(i,{}));const{matched:h,consumedSegments:v,remainingSegments:D}=gh(t,r,i);return h?this.getChildConfig(e,r,i).pipe(xe(j=>{const Q=j.module,me=j.routes,{segmentGroup:ye,slicedSegments:Te}=mh(t,v,D,me),Ve=new _n(ye.segments,ye.children);if(0===Te.length&&Ve.hasChildren())return this.expandChildren(Q,me,Ve).pipe(u(_t=>new _n(v,_t)));if(0===me.length&&0===Te.length)return tn(new _n(v,{}));const je=ji(r)===a;return this.expandSegment(Q,Ve,me,Te,je?yn:a,!0).pipe(u(Ie=>new _n(v.concat(Ie.segments),Ie.children)))})):Wu(t)}getChildConfig(e,t,r){return t.children?tn(new Wg(t.children,e)):t.loadChildren?void 0!==t._loadedConfig?tn(t._loadedConfig):this.runCanLoadGuards(e.injector,t,r).pipe(xe(i=>i?this.configLoader.load(e.injector,t).pipe(u(a=>(t._loadedConfig=a,a))):function Z9(n){return rh(Fg(`Cannot load children because the guard of the route "path: '${n.path}'" returned false`))}(t))):tn(new Wg([],e))}runCanLoadGuards(e,t,r){const i=t.canLoad;if(!i||0===i.length)return tn(!0);const a=i.map(h=>{const v=e.get(h);let D;if(function B9(n){return n&&Ts(n.canLoad)}(v))D=v.canLoad(t,r);else{if(!Ts(v))throw new Error("Invalid CanLoad guard");D=v(t,r)}return Lo(D)});return tn(a).pipe(Ku(),Ti(h=>{if(!aa(h))return;const v=Fg(`Redirecting to "${this.urlSerializer.serialize(h)}"`);throw v.url=h,v}),u(h=>!0===h))}lineralizeSegments(e,t){let r=[],i=t.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return tn(r);if(i.numberOfChildren>1||!i.children[yn])return W9(e.redirectTo);i=i.children[yn]}}applyRedirectCommands(e,t,r){return this.applyRedirectCreatreUrlTree(t,this.urlSerializer.parse(t),e,r)}applyRedirectCreatreUrlTree(e,t,r,i){const a=this.createSegmentGroup(e,t.root,r,i);return new oa(a,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const r={};return $r(e,(i,a)=>{if("string"==typeof i&&i.startsWith(":")){const v=i.substring(1);r[a]=t[v]}else r[a]=i}),r}createSegmentGroup(e,t,r,i){const a=this.createSegments(e,t.segments,r,i);let h={};return $r(t.children,(v,D)=>{h[D]=this.createSegmentGroup(e,v,r,i)}),new _n(a,h)}createSegments(e,t,r,i){return t.map(a=>a.path.startsWith(":")?this.findPosParam(e,a,i):this.findOrReturn(a,r))}findPosParam(e,t,r){const i=r[t.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${e}'. Cannot find '${t.path}'.`);return i}findOrReturn(e,t){let r=0;for(const i of t){if(i.path===e.path)return t.splice(r),i;r++}return e}}function Yg(n){const e={};for(const r of Object.keys(n.children)){const a=Yg(n.children[r]);(a.segments.length>0||a.hasChildren())&&(e[r]=a)}return function Q9(n){if(1===n.numberOfChildren&&n.children[yn]){const e=n.children[yn];return new _n(n.segments.concat(e.segments),e.children)}return n}(new _n(n.segments,e))}class RE{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class bh{constructor(e,t){this.component=e,this.route=t}}function eN(n,e,t){const r=n._root;return Zu(r,e?e._root:null,t,[r.value])}function _h(n,e,t){const r=function nN(n){if(!n)return null;for(let e=n.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(e);return(r?r.module.injector:t).get(n)}function Zu(n,e,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const a=_l(e);return n.children.forEach(h=>{(function rN(n,e,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const a=n.value,h=e?e.value:null,v=t?t.getContext(n.value.outlet):null;if(h&&a.routeConfig===h.routeConfig){const D=function iN(n,e,t){if("function"==typeof t)return t(n,e);switch(t){case"pathParamsChange":return!sa(n.url,e.url);case"pathParamsOrQueryParamsChange":return!sa(n.url,e.url)||!Bo(n.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!zg(n,e)||!Bo(n.queryParams,e.queryParams);default:return!zg(n,e)}}(h,a,a.routeConfig.runGuardsAndResolvers);D?i.canActivateChecks.push(new RE(r)):(a.data=h.data,a._resolvedData=h._resolvedData),Zu(n,e,a.component?v?v.children:null:t,r,i),D&&v&&v.outlet&&v.outlet.isActivated&&i.canDeactivateChecks.push(new bh(v.outlet.component,h))}else h&&Xu(e,v,i),i.canActivateChecks.push(new RE(r)),Zu(n,null,a.component?v?v.children:null:t,r,i)})(h,a[h.value.outlet],t,r.concat([h.value]),i),delete a[h.value.outlet]}),$r(a,(h,v)=>Xu(h,t.getContext(v),i)),i}function Xu(n,e,t){const r=_l(n),i=n.value;$r(r,(a,h)=>{Xu(a,i.component?e?e.children.getContext(h):null:e,t)}),t.canDeactivateChecks.push(new bh(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))}class dN{}function OE(n){return new Z(e=>e.error(n))}class gN{constructor(e,t,r,i,a,h){this.rootComponentType=e,this.config=t,this.urlTree=r,this.url=i,this.paramsInheritanceStrategy=a,this.relativeLinkResolution=h}recognize(){const e=mh(this.urlTree.root,[],[],this.config.filter(h=>void 0===h.redirectTo),this.relativeLinkResolution).segmentGroup,t=this.processSegmentGroup(this.config,e,yn);if(null===t)return null;const r=new hh([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},yn,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new os(r,t),a=new mE(this.url,i);return this.inheritParamsAndData(a._root),a}inheritParamsAndData(e){const t=e.value,r=gE(t,this.paramsInheritanceStrategy);t.params=Object.freeze(r.params),t.data=Object.freeze(r.data),e.children.forEach(i=>this.inheritParamsAndData(i))}processSegmentGroup(e,t,r){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t):this.processSegment(e,t,t.segments,r)}processChildren(e,t){const r=[];for(const a of Object.keys(t.children)){const h=t.children[a],v=SE(e,a),D=this.processSegmentGroup(v,h,a);if(null===D)return null;r.push(...D)}const i=PE(r);return function mN(n){n.sort((e,t)=>e.value.outlet===yn?-1:t.value.outlet===yn?1:e.value.outlet.localeCompare(t.value.outlet))}(i),i}processSegment(e,t,r,i){for(const a of e){const h=this.processSegmentAgainstRoute(a,t,r,i);if(null!==h)return h}return TE(t,r,i)?[]:null}processSegmentAgainstRoute(e,t,r,i){if(e.redirectTo||!AE(e,t,r,i))return null;let a,h=[],v=[];if("**"===e.path){const ye=r.length>0?tE(r).parameters:{};a=new hh(r,ye,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,BE(e),ji(e),e.component,e,NE(t),kE(t)+r.length,LE(e))}else{const ye=gh(t,e,r);if(!ye.matched)return null;h=ye.consumedSegments,v=ye.remainingSegments,a=new hh(h,ye.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,BE(e),ji(e),e.component,e,NE(t),kE(t)+h.length,LE(e))}const D=function vN(n){return n.children?n.children:n.loadChildren?n._loadedConfig.routes:[]}(e),{segmentGroup:L,slicedSegments:j}=mh(t,h,v,D.filter(ye=>void 0===ye.redirectTo),this.relativeLinkResolution);if(0===j.length&&L.hasChildren()){const ye=this.processChildren(D,L);return null===ye?null:[new os(a,ye)]}if(0===D.length&&0===j.length)return[new os(a,[])];const Q=ji(e)===i,me=this.processSegment(D,L,j,Q?yn:i);return null===me?null:[new os(a,me)]}}function yN(n){const e=n.value.routeConfig;return e&&""===e.path&&void 0===e.redirectTo}function PE(n){const e=[],t=new Set;for(const r of n){if(!yN(r)){e.push(r);continue}const i=e.find(a=>r.value.routeConfig===a.value.routeConfig);void 0!==i?(i.children.push(...r.children),t.add(i)):e.push(r)}for(const r of t){const i=PE(r.children);e.push(new os(r.value,i))}return e.filter(r=>!t.has(r))}function NE(n){let e=n;for(;e._sourceSegment;)e=e._sourceSegment;return e}function kE(n){let e=n,t=e._segmentIndexShift?e._segmentIndexShift:0;for(;e._sourceSegment;)e=e._sourceSegment,t+=e._segmentIndexShift?e._segmentIndexShift:0;return t-1}function BE(n){return n.data||{}}function LE(n){return n.resolve||{}}function FE(n){return[...Object.keys(n),...Object.getOwnPropertySymbols(n)]}function Qg(n){return Cs(e=>{const t=n(e);return t?Me(t).pipe(u(()=>e)):tn(e)})}class CN extends class SN{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}{}const Jg=new Kt("ROUTES");class UE{constructor(e,t,r,i){this.injector=e,this.compiler=t,this.onLoadStartListener=r,this.onLoadEndListener=i}load(e,t){if(t._loader$)return t._loader$;this.onLoadStartListener&&this.onLoadStartListener(t);const i=this.loadModuleFactory(t.loadChildren).pipe(u(a=>{this.onLoadEndListener&&this.onLoadEndListener(t);const h=a.create(e);return new Wg(eE(h.injector.get(Jg,void 0,en.Self|en.Optional)).map(Xg),h)}),ia(a=>{throw t._loader$=void 0,a}));return t._loader$=new de(i,()=>new o).pipe(oe()),t._loader$}loadModuleFactory(e){return Lo(e()).pipe(xe(t=>t instanceof Tw?tn(t):Me(this.compiler.compileModuleAsync(t))))}}class TN{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,t){return e}}function DN(n){throw n}function IN(n,e,t){return e.parse("/")}function HE(n,e){return tn(null)}const RN={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},ON={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let hi=(()=>{class n{constructor(t,r,i,a,h,v,D){this.rootComponentType=t,this.urlSerializer=r,this.rootContexts=i,this.location=a,this.config=D,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new o,this.errorHandler=DN,this.malformedUriErrorHandler=IN,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:HE,afterPreactivation:HE},this.urlHandlingStrategy=new TN,this.routeReuseStrategy=new CN,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.ngModule=h.get(Yo),this.console=h.get(aI);const Q=h.get(or);this.isNgZoneEnabled=Q instanceof or&&or.isInAngularZone(),this.resetConfig(D),this.currentUrlTree=function i9(){return new oa(new _n([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new UE(h,v,me=>this.triggerEvent(new ZM(me)),me=>this.triggerEvent(new XM(me))),this.routerState=pE(this.currentUrlTree,this.rootComponentType),this.transitions=new Vi({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){var t;return null===(t=this.location.getState())||void 0===t?void 0:t.\u0275routerPageId}setupNavigations(t){const r=this.events;return t.pipe(rs(i=>0!==i.id),u(i=>Object.assign(Object.assign({},i),{extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),Cs(i=>{let a=!1,h=!1;return tn(i).pipe(Ti(v=>{this.currentNavigation={id:v.id,initialUrl:v.currentRawUrl,extractedUrl:v.extractedUrl,trigger:v.source,extras:v.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Cs(v=>{const D=this.browserUrlTree.toString(),L=!this.navigated||v.extractedUrl.toString()!==D||D!==this.currentUrlTree.toString();if(("reload"===this.onSameUrlNavigation||L)&&this.urlHandlingStrategy.shouldProcessUrl(v.rawUrl))return VE(v.source)&&(this.browserUrlTree=v.extractedUrl),tn(v).pipe(Cs(Q=>{const me=this.transitions.getValue();return r.next(new Lg(Q.id,this.serializeUrl(Q.extractedUrl),Q.source,Q.restoredState)),me!==this.transitions.getValue()?ml:Promise.resolve(Q)}),function J9(n,e,t,r){return Cs(i=>function X9(n,e,t,r,i){return new Y9(n,e,t,r,i).apply()}(n,e,t,i.extractedUrl,r).pipe(u(a=>Object.assign(Object.assign({},i),{urlAfterRedirects:a}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),Ti(Q=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:Q.urlAfterRedirects})}),function bN(n,e,t,r,i){return xe(a=>function pN(n,e,t,r,i="emptyOnly",a="legacy"){try{const h=new gN(n,e,t,r,i,a).recognize();return null===h?OE(new dN):tn(h)}catch(h){return OE(h)}}(n,e,a.urlAfterRedirects,t(a.urlAfterRedirects),r,i).pipe(u(h=>Object.assign(Object.assign({},a),{targetSnapshot:h}))))}(this.rootComponentType,this.config,Q=>this.serializeUrl(Q),this.paramsInheritanceStrategy,this.relativeLinkResolution),Ti(Q=>{if("eager"===this.urlUpdateStrategy){if(!Q.extras.skipLocationChange){const ye=this.urlHandlingStrategy.merge(Q.urlAfterRedirects,Q.rawUrl);this.setBrowserUrl(ye,Q)}this.browserUrlTree=Q.urlAfterRedirects}const me=new GP(Q.id,this.serializeUrl(Q.extractedUrl),this.serializeUrl(Q.urlAfterRedirects),Q.targetSnapshot);r.next(me)}));if(L&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:me,extractedUrl:ye,source:Te,restoredState:Ve,extras:je}=v,gt=new Lg(me,this.serializeUrl(ye),Te,Ve);r.next(gt);const Ie=pE(ye,this.rootComponentType).snapshot;return tn(Object.assign(Object.assign({},v),{targetSnapshot:Ie,urlAfterRedirects:ye,extras:Object.assign(Object.assign({},je),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=v.rawUrl,v.resolve(null),ml}),Qg(v=>{const{targetSnapshot:D,id:L,extractedUrl:j,rawUrl:Q,extras:{skipLocationChange:me,replaceUrl:ye}}=v;return this.hooks.beforePreactivation(D,{navigationId:L,appliedUrlTree:j,rawUrlTree:Q,skipLocationChange:!!me,replaceUrl:!!ye})}),Ti(v=>{const D=new KP(v.id,this.serializeUrl(v.extractedUrl),this.serializeUrl(v.urlAfterRedirects),v.targetSnapshot);this.triggerEvent(D)}),u(v=>Object.assign(Object.assign({},v),{guards:eN(v.targetSnapshot,v.currentSnapshot,this.rootContexts)})),function oN(n,e){return xe(t=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:a,canDeactivateChecks:h}}=t;return 0===h.length&&0===a.length?tn(Object.assign(Object.assign({},t),{guardsResult:!0})):function sN(n,e,t,r){return Me(n).pipe(xe(i=>function hN(n,e,t,r,i){const a=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return a&&0!==a.length?tn(a.map(v=>{const D=_h(v,e,i);let L;if(function U9(n){return n&&Ts(n.canDeactivate)}(D))L=Lo(D.canDeactivate(n,e,t,r));else{if(!Ts(D))throw new Error("Invalid CanDeactivate guard");L=Lo(D(n,e,t,r))}return L.pipe(fi())})).pipe(Ku()):tn(!0)}(i.component,i.route,t,e,r)),fi(i=>!0!==i,!0))}(h,r,i,n).pipe(xe(v=>v&&function k9(n){return"boolean"==typeof n}(v)?function aN(n,e,t,r){return Me(e).pipe(vl(i=>kg(function uN(n,e){return null!==n&&e&&e(new XP(n)),tn(!0)}(i.route.parent,r),function lN(n,e){return null!==n&&e&&e(new QP(n)),tn(!0)}(i.route,r),function fN(n,e,t){const r=e[e.length-1],a=e.slice(0,e.length-1).reverse().map(h=>function tN(n){const e=n.routeConfig?n.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:n,guards:e}:null}(h)).filter(h=>null!==h).map(h=>$M(()=>tn(h.guards.map(D=>{const L=_h(D,h.node,t);let j;if(function F9(n){return n&&Ts(n.canActivateChild)}(L))j=Lo(L.canActivateChild(r,n));else{if(!Ts(L))throw new Error("Invalid CanActivateChild guard");j=Lo(L(r,n))}return j.pipe(fi())})).pipe(Ku())));return tn(a).pipe(Ku())}(n,i.path,t),function cN(n,e,t){const r=e.routeConfig?e.routeConfig.canActivate:null;if(!r||0===r.length)return tn(!0);const i=r.map(a=>$M(()=>{const h=_h(a,e,t);let v;if(function L9(n){return n&&Ts(n.canActivate)}(h))v=Lo(h.canActivate(e,n));else{if(!Ts(h))throw new Error("Invalid CanActivate guard");v=Lo(h(e,n))}return v.pipe(fi())}));return tn(i).pipe(Ku())}(n,i.route,t))),fi(i=>!0!==i,!0))}(r,a,n,e):tn(v)),u(v=>Object.assign(Object.assign({},t),{guardsResult:v})))})}(this.ngModule.injector,v=>this.triggerEvent(v)),Ti(v=>{if(aa(v.guardsResult)){const L=Fg(`Redirecting to "${this.serializeUrl(v.guardsResult)}"`);throw L.url=v.guardsResult,L}const D=new qP(v.id,this.serializeUrl(v.extractedUrl),this.serializeUrl(v.urlAfterRedirects),v.targetSnapshot,!!v.guardsResult);this.triggerEvent(D)}),rs(v=>!!v.guardsResult||(this.restoreHistory(v),this.cancelNavigationTransition(v,""),!1)),Qg(v=>{if(v.guards.canActivateChecks.length)return tn(v).pipe(Ti(D=>{const L=new WP(D.id,this.serializeUrl(D.extractedUrl),this.serializeUrl(D.urlAfterRedirects),D.targetSnapshot);this.triggerEvent(L)}),Cs(D=>{let L=!1;return tn(D).pipe(function _N(n,e){return xe(t=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=t;if(!i.length)return tn(t);let a=0;return Me(i).pipe(vl(h=>function wN(n,e,t,r){return function MN(n,e,t,r){const i=FE(n);if(0===i.length)return tn({});const a={};return Me(i).pipe(xe(h=>function EN(n,e,t,r){const i=_h(n,e,r);return Lo(i.resolve?i.resolve(e,t):i(e,t))}(n[h],e,t,r).pipe(Ti(v=>{a[h]=v}))),Bg(1),xe(()=>FE(a).length===i.length?tn(a):ml))}(n._resolve,n,e,r).pipe(u(a=>(n._resolvedData=a,n.data=Object.assign(Object.assign({},n.data),gE(n,t).resolve),null)))}(h.route,r,n,e)),Ti(()=>a++),Bg(1),xe(h=>a===i.length?tn(t):ml))})}(this.paramsInheritanceStrategy,this.ngModule.injector),Ti({next:()=>L=!0,complete:()=>{L||(this.restoreHistory(D),this.cancelNavigationTransition(D,"At least one route resolver didn't emit any value."))}}))}),Ti(D=>{const L=new ZP(D.id,this.serializeUrl(D.extractedUrl),this.serializeUrl(D.urlAfterRedirects),D.targetSnapshot);this.triggerEvent(L)}))}),Qg(v=>{const{targetSnapshot:D,id:L,extractedUrl:j,rawUrl:Q,extras:{skipLocationChange:me,replaceUrl:ye}}=v;return this.hooks.afterPreactivation(D,{navigationId:L,appliedUrlTree:j,rawUrlTree:Q,skipLocationChange:!!me,replaceUrl:!!ye})}),u(v=>{const D=function M9(n,e,t){const r=$u(n,e._root,t?t._root:void 0);return new dE(r,e)}(this.routeReuseStrategy,v.targetSnapshot,v.currentRouterState);return Object.assign(Object.assign({},v),{targetRouterState:D})}),Ti(v=>{this.currentUrlTree=v.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(v.urlAfterRedirects,v.rawUrl),this.routerState=v.targetRouterState,"deferred"===this.urlUpdateStrategy&&(v.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,v),this.browserUrlTree=v.urlAfterRedirects)}),((n,e,t)=>u(r=>(new P9(e,r.targetRouterState,r.currentRouterState,t).activate(n),r)))(this.rootContexts,this.routeReuseStrategy,v=>this.triggerEvent(v)),Ti({next(){a=!0},complete(){a=!0}}),function VP(n){return e=>e.lift(new jP(n))}(()=>{var v;a||h||this.cancelNavigationTransition(i,`Navigation ID ${i.id} is not equal to the current navigation id ${this.navigationId}`),(null===(v=this.currentNavigation)||void 0===v?void 0:v.id)===i.id&&(this.currentNavigation=null)}),ia(v=>{if(h=!0,function t9(n){return n&&n[QM]}(v)){const D=aa(v.url);D||(this.navigated=!0,this.restoreHistory(i,!0));const L=new WM(i.id,this.serializeUrl(i.extractedUrl),v.message);r.next(L),D?setTimeout(()=>{const j=this.urlHandlingStrategy.merge(v.url,this.rawUrlTree),Q={skipLocationChange:i.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||VE(i.source)};this.scheduleNavigation(j,"imperative",null,Q,{resolve:i.resolve,reject:i.reject,promise:i.promise})},0):i.resolve(!1)}else{this.restoreHistory(i,!0);const D=new zP(i.id,this.serializeUrl(i.extractedUrl),v);r.next(D);try{i.resolve(this.errorHandler(v))}catch(L){i.reject(L)}}return ml}))}))}resetRootComponentType(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType}setTransition(t){this.transitions.next(Object.assign(Object.assign({},this.transitions.value),t))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{const r="popstate"===t.type?"popstate":"hashchange";"popstate"===r&&setTimeout(()=>{var i;const a={replaceUrl:!0},h=(null===(i=t.state)||void 0===i?void 0:i.navigationId)?t.state:null;if(h){const D=Object.assign({},h);delete D.navigationId,delete D.\u0275routerPageId,0!==Object.keys(D).length&&(a.state=D)}const v=this.parseUrl(t.url);this.scheduleNavigation(v,r,h,a)},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(t){this.events.next(t)}resetConfig(t){xE(t),this.config=t.map(Xg),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(t,r={}){const{relativeTo:i,queryParams:a,fragment:h,queryParamsHandling:v,preserveFragment:D}=r,L=i||this.routerState.root,j=D?this.currentUrlTree.fragment:h;let Q=null;switch(v){case"merge":Q=Object.assign(Object.assign({},this.currentUrlTree.queryParams),a);break;case"preserve":Q=this.currentUrlTree.queryParams;break;default:Q=a||null}return null!==Q&&(Q=this.removeEmptyProps(Q)),function S9(n,e,t,r,i){if(0===t.length)return Gg(e.root,e.root,e.root,r,i);const a=function C9(n){if("string"==typeof n[0]&&1===n.length&&"/"===n[0])return new bE(!0,0,n);let e=0,t=!1;const r=n.reduce((i,a,h)=>{if("object"==typeof a&&null!=a){if(a.outlets){const v={};return $r(a.outlets,(D,L)=>{v[L]="string"==typeof D?D.split("/"):D}),[...i,{outlets:v}]}if(a.segmentPath)return[...i,a.segmentPath]}return"string"!=typeof a?[...i,a]:0===h?(a.split("/").forEach((v,D)=>{0==D&&"."===v||(0==D&&""===v?t=!0:".."===v?e++:""!=v&&i.push(v))}),i):[...i,a]},[]);return new bE(t,e,r)}(t);if(a.toRoot())return Gg(e.root,e.root,new _n([],{}),r,i);const h=function A9(n,e,t){if(n.isAbsolute)return new Kg(e.root,!0,0);if(-1===t.snapshot._lastPathIndex){const a=t.snapshot._urlSegment;return new Kg(a,a===e.root,0)}const r=dh(n.commands[0])?0:1;return function T9(n,e,t){let r=n,i=e,a=t;for(;a>i;){if(a-=i,r=r.parent,!r)throw new Error("Invalid number of '../'");i=r.segments.length}return new Kg(r,!1,i-a)}(t.snapshot._urlSegment,t.snapshot._lastPathIndex+r,n.numberOfDoubleDots)}(a,e,n),v=h.processChildren?ph(h.segmentGroup,h.index,a.commands):_E(h.segmentGroup,h.index,a.commands);return Gg(e.root,h.segmentGroup,v,r,i)}(L,this.currentUrlTree,t,Q,null!=j?j:null)}navigateByUrl(t,r={skipLocationChange:!1}){const i=aa(t)?t:this.parseUrl(t),a=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(a,"imperative",null,r)}navigate(t,r={skipLocationChange:!1}){return function PN(n){for(let e=0;e{const a=t[i];return null!=a&&(r[i]=a),r},{})}processNavigations(){this.navigations.subscribe(t=>{this.navigated=!0,this.lastSuccessfulId=t.id,this.currentPageId=t.targetPageId,this.events.next(new yl(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,t.resolve(!0)},t=>{this.console.warn(`Unhandled Navigation Error: ${t}`)})}scheduleNavigation(t,r,i,a,h){var v,D;if(this.disposed)return Promise.resolve(!1);let L,j,Q;h?(L=h.resolve,j=h.reject,Q=h.promise):Q=new Promise((Te,Ve)=>{L=Te,j=Ve});const me=++this.navigationId;let ye;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(i=this.location.getState()),ye=i&&i.\u0275routerPageId?i.\u0275routerPageId:a.replaceUrl||a.skipLocationChange?null!==(v=this.browserPageId)&&void 0!==v?v:0:(null!==(D=this.browserPageId)&&void 0!==D?D:0)+1):ye=0,this.setTransition({id:me,targetPageId:ye,source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:a,resolve:L,reject:j,promise:Q,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),Q.catch(Te=>Promise.reject(Te))}setBrowserUrl(t,r){const i=this.urlSerializer.serialize(t),a=Object.assign(Object.assign({},r.extras.state),this.generateNgRouterState(r.id,r.targetPageId));this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl?this.location.replaceState(i,"",a):this.location.go(i,"",a)}restoreHistory(t,r=!1){var i,a;if("computed"===this.canceledNavigationResolution){const h=this.currentPageId-t.targetPageId;"popstate"!==t.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==(null===(i=this.currentNavigation)||void 0===i?void 0:i.finalUrl)||0===h?this.currentUrlTree===(null===(a=this.currentNavigation)||void 0===a?void 0:a.finalUrl)&&0===h&&(this.resetState(t),this.browserUrlTree=t.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(h)}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(t),this.resetUrlToCurrentUrlTree())}resetState(t){this.routerState=t.currentRouterState,this.currentUrlTree=t.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(t,r){const i=new WM(t.id,this.serializeUrl(t.extractedUrl),r);this.triggerEvent(i),t.resolve(!1)}generateNgRouterState(t,r){return"computed"===this.canceledNavigationResolution?{navigationId:t,\u0275routerPageId:r}:{navigationId:t}}}return n.\u0275fac=function(t){up()},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();function VE(n){return"imperative"!==n}class jE{}class $E{preload(e,t){return tn(null)}}let zE=(()=>{class n{constructor(t,r,i,a){this.router=t,this.injector=i,this.preloadingStrategy=a,this.loader=new UE(i,r,D=>t.triggerEvent(new ZM(D)),D=>t.triggerEvent(new XM(D)))}setUpPreloading(){this.subscription=this.router.events.pipe(rs(t=>t instanceof yl),vl(()=>this.preload())).subscribe(()=>{})}preload(){const t=this.injector.get(Yo);return this.processRoutes(t,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,r){const i=[];for(const a of r)if(a.loadChildren&&!a.canLoad&&a._loadedConfig){const h=a._loadedConfig;i.push(this.processRoutes(h.module,h.routes))}else a.loadChildren&&!a.canLoad?i.push(this.preloadConfig(t,a)):a.children&&i.push(this.processRoutes(t,a.children));return Me(i).pipe(Oe(),u(a=>{}))}preloadConfig(t,r){return this.preloadingStrategy.preload(r,()=>(r._loadedConfig?tn(r._loadedConfig):this.loader.load(t.injector,r)).pipe(xe(a=>(r._loadedConfig=a,this.processRoutes(a.module,a.routes)))))}}return n.\u0275fac=function(t){return new(t||n)(Mt(hi),Mt(h2),Mt(Cr),Mt(jE))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),nm=(()=>{class n{constructor(t,r,i={}){this.router=t,this.viewportScroller=r,this.options=i,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},i.scrollPositionRestoration=i.scrollPositionRestoration||"disabled",i.anchorScrolling=i.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(t=>{t instanceof Lg?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof yl&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.router.parseUrl(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(t=>{t instanceof YM&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,r){this.router.triggerEvent(new YM(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,r))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return n.\u0275fac=function(t){up()},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const la=new Kt("ROUTER_CONFIGURATION"),GE=new Kt("ROUTER_FORROOT_GUARD"),LN=[tg,{provide:aE,useClass:lE},{provide:hi,useFactory:function jN(n,e,t,r,i,a,h={},v,D){const L=new hi(null,n,e,t,r,i,eE(a));return v&&(L.urlHandlingStrategy=v),D&&(L.routeReuseStrategy=D),function $N(n,e){n.errorHandler&&(e.errorHandler=n.errorHandler),n.malformedUriErrorHandler&&(e.malformedUriErrorHandler=n.malformedUriErrorHandler),n.onSameUrlNavigation&&(e.onSameUrlNavigation=n.onSameUrlNavigation),n.paramsInheritanceStrategy&&(e.paramsInheritanceStrategy=n.paramsInheritanceStrategy),n.relativeLinkResolution&&(e.relativeLinkResolution=n.relativeLinkResolution),n.urlUpdateStrategy&&(e.urlUpdateStrategy=n.urlUpdateStrategy),n.canceledNavigationResolution&&(e.canceledNavigationResolution=n.canceledNavigationResolution)}(h,L),h.enableTracing&&L.events.subscribe(j=>{var Q,me;null===(Q=console.group)||void 0===Q||Q.call(console,`Router Event: ${j.constructor.name}`),console.log(j.toString()),console.log(j),null===(me=console.groupEnd)||void 0===me||me.call(console)}),L},deps:[aE,qu,tg,Cr,h2,Jg,la,[class AN{},new _s],[class xN{},new _s]]},qu,{provide:wl,useFactory:function zN(n){return n.routerState.root},deps:[hi]},zE,$E,class BN{preload(e,t){return t().pipe(ia(()=>tn(null)))}},{provide:la,useValue:{enableTracing:!1}}];function FN(){return new v2("Router",hi)}let KE=(()=>{class n{constructor(t,r){}static forRoot(t,r){return{ngModule:n,providers:[LN,qE(t),{provide:GE,useFactory:VN,deps:[[hi,new _s,new eu]]},{provide:la,useValue:r||{}},{provide:dl,useFactory:HN,deps:[na,[new Wc(eg),new _s],la]},{provide:nm,useFactory:UN,deps:[hi,jO,la]},{provide:jE,useExisting:r&&r.preloadingStrategy?r.preloadingStrategy:$E},{provide:v2,multi:!0,useFactory:FN},[rm,{provide:Up,multi:!0,useFactory:GN,deps:[rm]},{provide:WE,useFactory:KN,deps:[rm]},{provide:f2,multi:!0,useExisting:WE}]]}}static forChild(t){return{ngModule:n,providers:[qE(t)]}}}return n.\u0275fac=function(t){return new(t||n)(Mt(GE,8),Mt(hi,8))},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})();function UN(n,e,t){return t.scrollOffset&&e.setOffset(t.scrollOffset),new nm(n,e,t)}function HN(n,e,t={}){return t.useHash?new JI(n,e):new B2(n,e)}function VN(n){return"guarded"}function qE(n){return[{provide:BC,multi:!0,useValue:n},{provide:Jg,multi:!0,useValue:n}]}let rm=(()=>{class n{constructor(t){this.injector=t,this.initNavigation=!1,this.destroyed=!1,this.resultOfPreactivationDone=new o}appInitializer(){return this.injector.get(XI,Promise.resolve(null)).then(()=>{if(this.destroyed)return Promise.resolve(!0);let r=null;const i=new Promise(v=>r=v),a=this.injector.get(hi),h=this.injector.get(la);return"disabled"===h.initialNavigation?(a.setUpLocationChangeListener(),r(!0)):"enabled"===h.initialNavigation||"enabledBlocking"===h.initialNavigation?(a.hooks.afterPreactivation=()=>this.initNavigation?tn(null):(this.initNavigation=!0,r(!0),this.resultOfPreactivationDone),a.initialNavigation()):r(!0),i})}bootstrapListener(t){const r=this.injector.get(la),i=this.injector.get(zE),a=this.injector.get(nm),h=this.injector.get(hi),v=this.injector.get(fl);t===v.components[0]&&(("enabledNonBlocking"===r.initialNavigation||void 0===r.initialNavigation)&&h.initialNavigation(),i.setUpPreloading(),a.init(),h.resetRootComponentType(v.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}ngOnDestroy(){this.destroyed=!0}}return n.\u0275fac=function(t){return new(t||n)(Mt(Cr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();function GN(n){return n.appInitializer.bind(n)}function KN(n){return n.bootstrapListener.bind(n)}const WE=new Kt("Router Initializer"),WN=[];let ZN=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[KE.forRoot(WN)],KE]}),n})();function ZE(n,e,t,r,i,a,h){try{var v=n[a](h),D=v.value}catch(L){return void t(L)}v.done?e(D):Promise.resolve(D).then(r,i)}function Ot(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function h(D){ZE(a,r,i,h,v,"next",D)}function v(D){ZE(a,r,i,h,v,"throw",D)}h(void 0)})}}var XN=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,im=Math.ceil,Fo=Math.floor,di="[BigNumber Error] ",XE=di+"Number primitive has more than 15 significant digits: ",po=1e14,om=9007199254740991,sm=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ds=1e7,Hr=1e9;function $i(n){var e=0|n;return n>0||n===e?e:e-1}function zi(n){for(var e,t,r=1,i=n.length,a=n[0]+"";rL^t?1:-1;for(v=(D=i.length)<(L=a.length)?D:L,h=0;ha[h]^t?1:-1;return D==L?0:D>L^t?1:-1}function cr(n,e,t,r){if(nt||n!==Fo(n))throw Error(di+(r||"Argument")+("number"==typeof n?nt?" out of range: ":" not an integer: ":" not a primitive number: ")+String(n))}function wh(n){var e=n.c.length-1;return $i(n.e/14)==e&&n.c[e]%2!=0}function Mh(n,e){return(n.length>1?n.charAt(0)+"."+n.slice(1):n)+(e<0?"e":"e+")+e}function ss(n,e,t){var r,i;if(e<0){for(i=t+".";++e;i+=t);n=i+n}else if(++e>(r=n.length)){for(i=t,e-=r;--e;i+=t);n+=i}else eQ?qe.c=qe.e=null:Se.e=10;vt/=10,st++);return void(st>Q?qe.c=qe.e=null:(qe.e=st,qe.c=[Se]))}Ke=String(Se)}else{if(!XN.test(Ke=String(Se)))return r(qe,Ke,Ze);qe.s=45==Ke.charCodeAt(0)?(Ke=Ke.slice(1),-1):1}(st=Ke.indexOf("."))>-1&&(Ke=Ke.replace(".","")),(vt=Ke.search(/e/i))>0?(st<0&&(st=vt),st+=+Ke.slice(vt+1),Ke=Ke.substring(0,vt)):st<0&&(st=Ke.length)}else{if(cr(De,2,je.length,"Base"),10==De&>)return Vt(qe=new Ie(Se),h+qe.e+1,v);if(Ke=String(Se),Ze="number"==typeof Se){if(0*Se!=0)return r(qe,Ke,Ze,De);if(qe.s=1/Se<0?(Ke=Ke.slice(1),-1):1,Ie.DEBUG&&Ke.replace(/^0\.0*|\./,"").length>15)throw Error(XE+Se)}else qe.s=45===Ke.charCodeAt(0)?(Ke=Ke.slice(1),-1):1;for(ke=je.slice(0,De),st=vt=0,Fe=Ke.length;vtst){st=Fe;continue}}else if(!Qe&&(Ke==Ke.toUpperCase()&&(Ke=Ke.toLowerCase())||Ke==Ke.toLowerCase()&&(Ke=Ke.toUpperCase()))){Qe=!0,vt=-1,st=0;continue}return r(qe,String(Se),Ze,De)}Ze=!1,(st=(Ke=t(Ke,De,10,qe.s)).indexOf("."))>-1?Ke=Ke.replace(".",""):st=Ke.length}for(vt=0;48===Ke.charCodeAt(vt);vt++);for(Fe=Ke.length;48===Ke.charCodeAt(--Fe););if(Ke=Ke.slice(vt,++Fe)){if(Fe-=vt,Ze&&Ie.DEBUG&&Fe>15&&(Se>om||Se!==Fo(Se)))throw Error(XE+qe.s*Se);if((st=st-vt-1)>Q)qe.c=qe.e=null;else if(st=L)?Mh(Fe,vt):ss(Fe,vt,"0");else if(st=(Se=Vt(new Ie(Se),De,ke)).e,Ze=(Fe=zi(Se.c)).length,1==dt||2==dt&&(De<=st||st<=D)){for(;ZeZe){if(--De>0)for(Fe+=".";De--;Fe+="0");}else if((De+=st-Ze)>0)for(st+1==Ze&&(Fe+=".");De--;Fe+="0");return Se.s<0&&Qe?"-"+Fe:Fe}function At(Se,De){for(var ke,dt=1,Qe=new Ie(Se[0]);dt=10;Qe/=10,dt++);return(ke=dt+14*ke-1)>Q?Se.c=Se.e=null:ke=10;Ze/=10,Qe++);if((st=De-Qe)<0)st+=14,qe=(Fe=yt[Ke=0])/Dt[Qe-(vt=De)-1]%10|0;else if((Ke=im((st+1)/14))>=yt.length){if(!dt)break e;for(;yt.length<=Ke;yt.push(0));Fe=qe=0,Qe=1,vt=(st%=14)-14+1}else{for(Fe=Ze=yt[Ke],Qe=1;Ze>=10;Ze/=10,Qe++);qe=(vt=(st%=14)-14+Qe)<0?0:Fe/Dt[Qe-vt-1]%10|0}if(dt=dt||De<0||null!=yt[Ke+1]||(vt<0?Fe:Fe%Dt[Qe-vt-1]),dt=ke<4?(qe||dt)&&(0==ke||ke==(Se.s<0?3:2)):qe>5||5==qe&&(4==ke||dt||6==ke&&(st>0?vt>0?Fe/Dt[Qe-vt]:0:yt[Ke-1])%10&1||ke==(Se.s<0?8:7)),De<1||!yt[0])return yt.length=0,dt?(yt[0]=Dt[(14-(De-=Se.e+1)%14)%14],Se.e=-De||0):yt[0]=Se.e=0,Se;if(0==st?(yt.length=Ke,Ze=1,Ke--):(yt.length=Ke+1,Ze=Dt[14-st],yt[Ke]=vt>0?Fo(Fe/Dt[Qe-vt]%Dt[vt])*Ze:0),dt)for(;;){if(0==Ke){for(st=1,vt=yt[0];vt>=10;vt/=10,st++);for(vt=yt[0]+=Ze,Ze=1;vt>=10;vt/=10,Ze++);st!=Ze&&(Se.e++,yt[0]==po&&(yt[0]=1));break}if(yt[Ke]+=Ze,yt[Ke]!=po)break;yt[Ke--]=0,Ze=1}for(st=yt.length;0===yt[--st];yt.pop());}Se.e>Q?Se.c=Se.e=null:Se.e=L?Mh(De,ke):ss(De,ke,"0"),Se.s<0?"-"+De:De)}return Ie.clone=YE,Ie.ROUND_UP=0,Ie.ROUND_DOWN=1,Ie.ROUND_CEIL=2,Ie.ROUND_FLOOR=3,Ie.ROUND_HALF_UP=4,Ie.ROUND_HALF_DOWN=5,Ie.ROUND_HALF_EVEN=6,Ie.ROUND_HALF_CEIL=7,Ie.ROUND_HALF_FLOOR=8,Ie.EUCLID=9,Ie.config=Ie.set=function(Se){var De,ke;if(null!=Se){if("object"!=typeof Se)throw Error(di+"Object expected: "+Se);if(Se.hasOwnProperty(De="DECIMAL_PLACES")&&(cr(ke=Se[De],0,Hr,De),h=ke),Se.hasOwnProperty(De="ROUNDING_MODE")&&(cr(ke=Se[De],0,8,De),v=ke),Se.hasOwnProperty(De="EXPONENTIAL_AT")&&((ke=Se[De])&&ke.pop?(cr(ke[0],-Hr,0,De),cr(ke[1],0,Hr,De),D=ke[0],L=ke[1]):(cr(ke,-Hr,Hr,De),D=-(L=ke<0?-ke:ke))),Se.hasOwnProperty(De="RANGE"))if((ke=Se[De])&&ke.pop)cr(ke[0],-Hr,-1,De),cr(ke[1],1,Hr,De),j=ke[0],Q=ke[1];else{if(cr(ke,-Hr,Hr,De),!ke)throw Error(di+De+" cannot be zero: "+ke);j=-(Q=ke<0?-ke:ke)}if(Se.hasOwnProperty(De="CRYPTO")){if((ke=Se[De])!==!!ke)throw Error(di+De+" not true or false: "+ke);if(ke){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw me=!ke,Error(di+"crypto unavailable");me=ke}else me=ke}if(Se.hasOwnProperty(De="MODULO_MODE")&&(cr(ke=Se[De],0,9,De),ye=ke),Se.hasOwnProperty(De="POW_PRECISION")&&(cr(ke=Se[De],0,Hr,De),Te=ke),Se.hasOwnProperty(De="FORMAT")){if("object"!=typeof(ke=Se[De]))throw Error(di+De+" not an object: "+ke);Ve=ke}if(Se.hasOwnProperty(De="ALPHABET")){if("string"!=typeof(ke=Se[De])||/^.?$|[+\-.\s]|(.).*\1/.test(ke))throw Error(di+De+" invalid: "+ke);gt="0123456789"==ke.slice(0,10),je=ke}}return{DECIMAL_PLACES:h,ROUNDING_MODE:v,EXPONENTIAL_AT:[D,L],RANGE:[j,Q],CRYPTO:me,MODULO_MODE:ye,POW_PRECISION:Te,FORMAT:Ve,ALPHABET:je}},Ie.isBigNumber=function(Se){if(!Se||!0!==Se._isBigNumber)return!1;if(!Ie.DEBUG)return!0;var De,ke,dt=Se.c,Qe=Se.e,st=Se.s;e:if("[object Array]"=={}.toString.call(dt)){if((1===st||-1===st)&&Qe>=-Hr&&Qe<=Hr&&Qe===Fo(Qe)){if(0===dt[0]){if(0===Qe&&1===dt.length)return!0;break e}if((De=(Qe+1)%14)<1&&(De+=14),String(dt[0]).length==De){for(De=0;De=po||ke!==Fo(ke))break e;if(0!==ke)return!0}}}else if(null===dt&&null===Qe&&(null===st||1===st||-1===st))return!0;throw Error(di+"Invalid BigNumber: "+Se)},Ie.maximum=Ie.max=function(){return At(arguments,i.lt)},Ie.minimum=Ie.min=function(){return At(arguments,i.gt)},Ie.random=(Se=9007199254740992,De=Math.random()*Se&2097151?function(){return Fo(Math.random()*Se)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(ke){var dt,Qe,st,vt,Ze,Fe=0,Ke=[],qe=new Ie(a);if(null==ke?ke=h:cr(ke,0,Hr),vt=im(ke/14),me)if(crypto.getRandomValues){for(dt=crypto.getRandomValues(new Uint32Array(vt*=2));Fe>>11))>=9e15?(Qe=crypto.getRandomValues(new Uint32Array(2)),dt[Fe]=Qe[0],dt[Fe+1]=Qe[1]):(Ke.push(Ze%1e14),Fe+=2);Fe=vt/2}else{if(!crypto.randomBytes)throw me=!1,Error(di+"crypto unavailable");for(dt=crypto.randomBytes(vt*=7);Fe=9e15?crypto.randomBytes(7).copy(dt,Fe):(Ke.push(Ze%1e14),Fe+=7);Fe=vt/7}if(!me)for(;Fe=10;Ze/=10,Fe++);Fe<14&&(st-=14-Fe)}return qe.e=st,qe.c=Ke,qe}),Ie.sum=function(){for(var Se=1,De=arguments,ke=new Ie(De[0]);SeQe-1&&(null==Ze[vt+1]&&(Ze[vt+1]=0),Ze[vt+1]+=Ze[vt]/Qe|0,Ze[vt]%=Qe)}return Ze.reverse()}return function(ke,dt,Qe,st,vt){var Ze,Fe,Ke,qe,yt,Dt,Pt,Yt,On=ke.indexOf("."),an=h,Sn=v;for(On>=0&&(qe=Te,Te=0,ke=ke.replace(".",""),Dt=(Yt=new Ie(dt)).pow(ke.length-On),Te=qe,Yt.c=De(ss(zi(Dt.c),Dt.e,"0"),10,Qe,Se),Yt.e=Yt.c.length),Ke=qe=(Pt=De(ke,dt,Qe,vt?(Ze=je,Se):(Ze=Se,je))).length;0==Pt[--qe];Pt.pop());if(!Pt[0])return Ze.charAt(0);if(On<0?--Ke:(Dt.c=Pt,Dt.e=Ke,Dt.s=st,Pt=(Dt=e(Dt,Yt,an,Sn,Qe)).c,yt=Dt.r,Ke=Dt.e),On=Pt[Fe=Ke+an+1],qe=Qe/2,yt=yt||Fe<0||null!=Pt[Fe+1],yt=Sn<4?(null!=On||yt)&&(0==Sn||Sn==(Dt.s<0?3:2)):On>qe||On==qe&&(4==Sn||yt||6==Sn&&1&Pt[Fe-1]||Sn==(Dt.s<0?8:7)),Fe<1||!Pt[0])ke=yt?ss(Ze.charAt(1),-an,Ze.charAt(0)):Ze.charAt(0);else{if(Pt.length=Fe,yt)for(--Qe;++Pt[--Fe]>Qe;)Pt[Fe]=0,Fe||(++Ke,Pt=[1].concat(Pt));for(qe=Pt.length;!Pt[--qe];);for(On=0,ke="";On<=qe;ke+=Ze.charAt(Pt[On++]));ke=ss(ke,Ke,Ze.charAt(0))}return ke}}(),e=function(){function Se(dt,Qe,st){var vt,Ze,Fe,Ke,qe=0,yt=dt.length,Dt=Qe%Ds,Pt=Qe/Ds|0;for(dt=dt.slice();yt--;)qe=((Ze=Dt*(Fe=dt[yt]%Ds)+(vt=Pt*Fe+(Ke=dt[yt]/Ds|0)*Dt)%Ds*Ds+qe)/st|0)+(vt/Ds|0)+Pt*Ke,dt[yt]=Ze%st;return qe&&(dt=[qe].concat(dt)),dt}function De(dt,Qe,st,vt){var Ze,Fe;if(st!=vt)Fe=st>vt?1:-1;else for(Ze=Fe=0;ZeQe[Ze]?1:-1;break}return Fe}function ke(dt,Qe,st,vt){for(var Ze=0;st--;)dt[st]-=Ze,dt[st]=(Ze=dt[st]1;dt.splice(0,1));}return function(dt,Qe,st,vt,Ze){var Fe,Ke,qe,yt,Dt,Pt,Yt,On,an,Sn,kn,In,Wi,Zi,Eo,yi,Ec,Xi=dt.s==Qe.s?1:-1,li=dt.c,br=Qe.c;if(!(li&&li[0]&&br&&br[0]))return new Ie(dt.s&&Qe.s&&(li?!br||li[0]!=br[0]:br)?li&&0==li[0]||!br?0*Xi:Xi/0:NaN);for(an=(On=new Ie(Xi)).c=[],Xi=st+(Ke=dt.e-Qe.e)+1,Ze||(Ze=po,Ke=$i(dt.e/14)-$i(Qe.e/14),Xi=Xi/14|0),qe=0;br[qe]==(li[qe]||0);qe++);if(br[qe]>(li[qe]||0)&&Ke--,Xi<0)an.push(1),yt=!0;else{for(Zi=li.length,yi=br.length,qe=0,Xi+=2,(Dt=Fo(Ze/(br[0]+1)))>1&&(br=Se(br,Dt,Ze),li=Se(li,Dt,Ze),yi=br.length,Zi=li.length),Wi=yi,kn=(Sn=li.slice(0,yi)).length;kn=Ze/2&&Eo++;do{if(Dt=0,(Fe=De(br,Sn,yi,kn))<0){if(In=Sn[0],yi!=kn&&(In=In*Ze+(Sn[1]||0)),(Dt=Fo(In/Eo))>1)for(Dt>=Ze&&(Dt=Ze-1),Yt=(Pt=Se(br,Dt,Ze)).length,kn=Sn.length;1==De(Pt,Sn,Yt,kn);)Dt--,ke(Pt,yi=10;Xi/=10,qe++);Vt(On,st+(On.e=qe+14*Ke-1)+1,vt,yt)}else On.e=Ke,On.r=+yt;return On}}(),r=function(){var Se=/^(-?)0([xbo])(?=\w[\w.]*$)/i,De=/^([^.]+)\.$/,ke=/^\.([^.]+)$/,dt=/^-?(Infinity|NaN)$/,Qe=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(st,vt,Ze,Fe){var Ke,qe=Ze?vt:vt.replace(Qe,"");if(dt.test(qe))st.s=isNaN(qe)?null:qe<0?-1:1;else{if(!Ze&&(qe=qe.replace(Se,function(yt,Dt,Pt){return Ke="x"==(Pt=Pt.toLowerCase())?16:"b"==Pt?2:8,Fe&&Fe!=Ke?yt:Dt}),Fe&&(Ke=Fe,qe=qe.replace(De,"$1").replace(ke,"0.$1")),vt!=qe))return new Ie(qe,Ke);if(Ie.DEBUG)throw Error(di+"Not a"+(Fe?" base "+Fe:"")+" number: "+vt);st.s=null}st.c=st.e=null}}(),i.absoluteValue=i.abs=function(){var Se=new Ie(this);return Se.s<0&&(Se.s=1),Se},i.comparedTo=function(Se,De){return El(this,new Ie(Se,De))},i.decimalPlaces=i.dp=function(Se,De){var ke,dt,Qe;if(null!=Se)return cr(Se,0,Hr),null==De?De=v:cr(De,0,8),Vt(new Ie(this),Se+this.e+1,De);if(!(ke=this.c))return null;if(dt=14*((Qe=ke.length-1)-$i(this.e/14)),Qe=ke[Qe])for(;Qe%10==0;Qe/=10,dt--);return dt<0&&(dt=0),dt},i.dividedBy=i.div=function(Se,De){return e(this,new Ie(Se,De),h,v)},i.dividedToIntegerBy=i.idiv=function(Se,De){return e(this,new Ie(Se,De),0,1)},i.exponentiatedBy=i.pow=function(Se,De){var ke,dt,Qe,st,Ze,Fe,Ke,qe,yt=this;if((Se=new Ie(Se)).c&&!Se.isInteger())throw Error(di+"Exponent not an integer: "+Zt(Se));if(null!=De&&(De=new Ie(De)),Ze=Se.e>14,!yt.c||!yt.c[0]||1==yt.c[0]&&!yt.e&&1==yt.c.length||!Se.c||!Se.c[0])return qe=new Ie(Math.pow(+Zt(yt),Ze?Se.s*(2-wh(Se)):+Zt(Se))),De?qe.mod(De):qe;if(Fe=Se.s<0,De){if(De.c?!De.c[0]:!De.s)return new Ie(NaN);(dt=!Fe&&yt.isInteger()&&De.isInteger())&&(yt=yt.mod(De))}else{if(Se.e>9&&(yt.e>0||yt.e<-1||(0==yt.e?yt.c[0]>1||Ze&&yt.c[1]>=24e7:yt.c[0]<8e13||Ze&&yt.c[0]<=9999975e7)))return st=yt.s<0&&wh(Se)?-0:0,yt.e>-1&&(st=1/st),new Ie(Fe?1/st:st);Te&&(st=im(Te/14+2))}for(Ze?(ke=new Ie(.5),Fe&&(Se.s=1),Ke=wh(Se)):Ke=(Qe=Math.abs(+Zt(Se)))%2,qe=new Ie(a);;){if(Ke){if(!(qe=qe.times(yt)).c)break;st?qe.c.length>st&&(qe.c.length=st):dt&&(qe=qe.mod(De))}if(Qe){if(0===(Qe=Fo(Qe/2)))break;Ke=Qe%2}else if(Vt(Se=Se.times(ke),Se.e+1,1),Se.e>14)Ke=wh(Se);else{if(0==(Qe=+Zt(Se)))break;Ke=Qe%2}yt=yt.times(yt),st?yt.c&&yt.c.length>st&&(yt.c.length=st):dt&&(yt=yt.mod(De))}return dt?qe:(Fe&&(qe=a.div(qe)),De?qe.mod(De):st?Vt(qe,Te,v,void 0):qe)},i.integerValue=function(Se){var De=new Ie(this);return null==Se?Se=v:cr(Se,0,8),Vt(De,De.e+1,Se)},i.isEqualTo=i.eq=function(Se,De){return 0===El(this,new Ie(Se,De))},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(Se,De){return El(this,new Ie(Se,De))>0},i.isGreaterThanOrEqualTo=i.gte=function(Se,De){return 1===(De=El(this,new Ie(Se,De)))||0===De},i.isInteger=function(){return!!this.c&&$i(this.e/14)>this.c.length-2},i.isLessThan=i.lt=function(Se,De){return El(this,new Ie(Se,De))<0},i.isLessThanOrEqualTo=i.lte=function(Se,De){return-1===(De=El(this,new Ie(Se,De)))||0===De},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.minus=function(Se,De){var ke,dt,Qe,st,vt=this,Ze=vt.s;if(De=(Se=new Ie(Se,De)).s,!Ze||!De)return new Ie(NaN);if(Ze!=De)return Se.s=-De,vt.plus(Se);var Fe=vt.e/14,Ke=Se.e/14,qe=vt.c,yt=Se.c;if(!Fe||!Ke){if(!qe||!yt)return qe?(Se.s=-De,Se):new Ie(yt?vt:NaN);if(!qe[0]||!yt[0])return yt[0]?(Se.s=-De,Se):new Ie(qe[0]?vt:3==v?-0:0)}if(Fe=$i(Fe),Ke=$i(Ke),qe=qe.slice(),Ze=Fe-Ke){for((st=Ze<0)?(Ze=-Ze,Qe=qe):(Ke=Fe,Qe=yt),Qe.reverse(),De=Ze;De--;Qe.push(0));Qe.reverse()}else for(dt=(st=(Ze=qe.length)<(De=yt.length))?Ze:De,Ze=De=0;De0)for(;De--;qe[ke++]=0);for(De=po-1;dt>Ze;){if(qe[--dt]=0;){for(ke=0,Dt=In[Qe]%an,Pt=In[Qe]/an|0,st=Qe+(vt=Fe);st>Qe;)ke=((Ke=Dt*(Ke=kn[--vt]%an)+(Ze=Pt*Ke+(qe=kn[vt]/an|0)*Dt)%an*an+Yt[st]+ke)/On|0)+(Ze/an|0)+Pt*qe,Yt[st--]=Ke%On;Yt[st]=ke}return ke?++dt:Yt.splice(0,1),Nt(Se,Yt,dt)},i.negated=function(){var Se=new Ie(this);return Se.s=-Se.s||null,Se},i.plus=function(Se,De){var ke,dt=this,Qe=dt.s;if(De=(Se=new Ie(Se,De)).s,!Qe||!De)return new Ie(NaN);if(Qe!=De)return Se.s=-De,dt.minus(Se);var st=dt.e/14,vt=Se.e/14,Ze=dt.c,Fe=Se.c;if(!st||!vt){if(!Ze||!Fe)return new Ie(Qe/0);if(!Ze[0]||!Fe[0])return Fe[0]?Se:new Ie(Ze[0]?dt:0*Qe)}if(st=$i(st),vt=$i(vt),Ze=Ze.slice(),Qe=st-vt){for(Qe>0?(vt=st,ke=Fe):(Qe=-Qe,ke=Ze),ke.reverse();Qe--;ke.push(0));ke.reverse()}for((Qe=Ze.length)-(De=Fe.length)<0&&(ke=Fe,Fe=Ze,Ze=ke,De=Qe),Qe=0;De;)Qe=(Ze[--De]=Ze[De]+Fe[De]+Qe)/po|0,Ze[De]=po===Ze[De]?0:Ze[De]%po;return Qe&&(Ze=[Qe].concat(Ze),++vt),Nt(Se,Ze,vt)},i.precision=i.sd=function(Se,De){var ke,dt,Qe;if(null!=Se&&Se!==!!Se)return cr(Se,1,Hr),null==De?De=v:cr(De,0,8),Vt(new Ie(this),Se,De);if(!(ke=this.c))return null;if(dt=14*(Qe=ke.length-1)+1,Qe=ke[Qe]){for(;Qe%10==0;Qe/=10,dt--);for(Qe=ke[0];Qe>=10;Qe/=10,dt++);}return Se&&this.e+1>dt&&(dt=this.e+1),dt},i.shiftedBy=function(Se){return cr(Se,-om,om),this.times("1e"+Se)},i.squareRoot=i.sqrt=function(){var Se,De,ke,dt,Qe,st=this,vt=st.c,Ze=st.s,Fe=st.e,Ke=h+4,qe=new Ie("0.5");if(1!==Ze||!vt||!vt[0])return new Ie(!Ze||Ze<0&&(!vt||vt[0])?NaN:vt?st:1/0);if(0==(Ze=Math.sqrt(+Zt(st)))||Ze==1/0?(((De=zi(vt)).length+Fe)%2==0&&(De+="0"),Ze=Math.sqrt(+De),Fe=$i((Fe+1)/2)-(Fe<0||Fe%2),ke=new Ie(De=Ze==1/0?"5e"+Fe:(De=Ze.toExponential()).slice(0,De.indexOf("e")+1)+Fe)):ke=new Ie(Ze+""),ke.c[0])for((Ze=(Fe=ke.e)+Ke)<3&&(Ze=0);;)if(ke=qe.times((Qe=ke).plus(e(st,Qe,Ke,1))),zi(Qe.c).slice(0,Ze)===(De=zi(ke.c)).slice(0,Ze)){if(ke.e0&&Yt>0){for(qe=Pt.substr(0,st=Yt%Ze||Ze);st0&&(qe+=Ke+Pt.slice(st)),Dt&&(qe="-"+qe)}dt=yt?qe+(ke.decimalSeparator||"")+((Fe=+ke.fractionGroupSize)?yt.replace(new RegExp("\\d{"+Fe+"}\\B","g"),"$&"+(ke.fractionGroupSeparator||"")):yt):qe}return(ke.prefix||"")+dt+(ke.suffix||"")},i.toFraction=function(Se){var De,ke,dt,Qe,st,vt,Ze,Fe,Ke,qe,yt,Dt,Pt=this,Yt=Pt.c;if(null!=Se&&(!(Ze=new Ie(Se)).isInteger()&&(Ze.c||1!==Ze.s)||Ze.lt(a)))throw Error(di+"Argument "+(Ze.isInteger()?"out of range: ":"not an integer: ")+Zt(Ze));if(!Yt)return new Ie(Pt);for(De=new Ie(a),Ke=ke=new Ie(a),dt=Fe=new Ie(a),Dt=zi(Yt),st=De.e=Dt.length-Pt.e-1,De.c[0]=sm[(vt=st%14)<0?14+vt:vt],Se=!Se||Ze.comparedTo(De)>0?st>0?De:Ke:Ze,vt=Q,Q=1/0,Ze=new Ie(Dt),Fe.c[0]=0;qe=e(Ze,De,0,1),1!=(Qe=ke.plus(qe.times(dt))).comparedTo(Se);)ke=dt,dt=Qe,Ke=Fe.plus(qe.times(Qe=Ke)),Fe=Qe,De=Ze.minus(qe.times(Qe=De)),Ze=Qe;return Qe=e(Se.minus(ke),dt,0,1),Fe=Fe.plus(Qe.times(Ke)),ke=ke.plus(Qe.times(dt)),Fe.s=Ke.s=Pt.s,yt=e(Ke,dt,st*=2,v).minus(Pt).abs().comparedTo(e(Fe,ke,st,v).minus(Pt).abs())<1?[Ke,dt]:[Fe,ke],Q=vt,yt},i.toNumber=function(){return+Zt(this)},i.toPrecision=function(Se,De){return null!=Se&&cr(Se,1,Hr),_t(this,Se,De,2)},i.toString=function(Se){var De,ke=this,dt=ke.s,Qe=ke.e;return null===Qe?dt?(De="Infinity",dt<0&&(De="-"+De)):De="NaN":(null==Se?De=Qe<=D||Qe>=L?Mh(zi(ke.c),Qe):ss(zi(ke.c),Qe,"0"):10===Se&>?De=ss(zi((ke=Vt(new Ie(ke),h+Qe+1,v)).c),ke.e,"0"):(cr(Se,2,je.length,"Base"),De=t(ss(zi(ke.c),Qe,"0"),10,Se,dt,!0)),dt<0&&ke.c[0]&&(De="-"+De)),De},i.valueOf=i.toJSON=function(){return Zt(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,null!=n&&Ie.set(n),Ie}();const Nn=am;var wn=(()=>(function(n){n.BlockchainRequest="blockchain_request",n.PermissionRequest="permission_request",n.SignPayloadRequest="sign_payload_request",n.OperationRequest="operation_request",n.BroadcastRequest="broadcast_request",n.ChangeAccountRequest="change_account_request",n.BlockchainResponse="blockchain_response",n.PermissionResponse="permission_response",n.SignPayloadResponse="sign_payload_response",n.OperationResponse="operation_response",n.BroadcastResponse="broadcast_response",n.Acknowledge="acknowledge",n.Disconnect="disconnect",n.Error="error"}(wn||(wn={})),wn))(),ua=(()=>(function(n){n.SIGN="sign",n.OPERATION_REQUEST="operation_request",n.ENCRYPT="encrypt",n.NOTIFICATION="notification",n.THRESHOLD="threshold"}(ua||(ua={})),ua))(),Gi=(()=>(function(n){n.MAINNET="mainnet",n.GHOSTNET="ghostnet",n.MONDAYNET="mondaynet",n.DAILYNET="dailynet",n.DELPHINET="delphinet",n.EDONET="edonet",n.FLORENCENET="florencenet",n.GRANADANET="granadanet",n.HANGZHOUNET="hangzhounet",n.ITHACANET="ithacanet",n.JAKARTANET="jakartanet",n.KATHMANDUNET="kathmandunet",n.LIMANET="limanet",n.MUMBAINET="mumbainet",n.NAIROBINET="nairobinet",n.OXFORDNET="oxfordnet",n.CUSTOM="custom"}(Gi||(Gi={})),Gi))(),xl=(()=>(function(n){n.ENDORSEMENT="endorsement",n.SEED_NONCE_REVELATION="seed_nonce_revelation",n.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",n.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",n.ACTIVATE_ACCOUNT="activate_account",n.PROPOSALS="proposals",n.BALLOT="ballot",n.REVEAL="reveal",n.TRANSACTION="transaction",n.ORIGINATION="origination",n.DELEGATION="delegation"}(xl||(xl={})),xl))(),Eh=(()=>(function(n){n.WEBSITE="website",n.EXTENSION="extension",n.P2P="p2p",n.WALLETCONNECT="walletconnect"}(Eh||(Eh={})),Eh))(),as=(()=>(function(n){n.BROADCAST_ERROR="BROADCAST_ERROR",n.NETWORK_NOT_SUPPORTED="NETWORK_NOT_SUPPORTED",n.NO_ADDRESS_ERROR="NO_ADDRESS_ERROR",n.NO_PRIVATE_KEY_FOUND_ERROR="NO_PRIVATE_KEY_FOUND_ERROR",n.NOT_GRANTED_ERROR="NOT_GRANTED_ERROR",n.PARAMETERS_INVALID_ERROR="PARAMETERS_INVALID_ERROR",n.TOO_MANY_OPERATIONS="TOO_MANY_OPERATIONS",n.TRANSACTION_INVALID_ERROR="TRANSACTION_INVALID_ERROR",n.SIGNATURE_TYPE_NOT_SUPPORTED="SIGNATURE_TYPE_NOT_SUPPORTED",n.ABORTED_ERROR="ABORTED_ERROR",n.UNKNOWN_ERROR="UNKNOWN_ERROR"}(as||(as={})),as))(),Uo=(()=>(function(n){n.NOT_CONNECTED="NOT_CONNECTED",n.CONNECTING="CONNECTING",n.CONNECTED="CONNECTED"}(Uo||(Uo={})),Uo))(),Yu=(()=>(function(n){n.CHROME_MESSAGE="chrome_message",n.WALLETCONNECT="walletconnect",n.POST_MESSAGE="post_message",n.LEDGER="ledger",n.P2P="p2p"}(Yu||(Yu={})),Yu))(),nn=(()=>(function(n){n.TRANSPORT_P2P_PEERS_DAPP="beacon:communication-peers-dapp",n.TRANSPORT_P2P_PEERS_WALLET="beacon:communication-peers-wallet",n.TRANSPORT_POSTMESSAGE_PEERS_DAPP="beacon:postmessage-peers-dapp",n.TRANSPORT_POSTMESSAGE_PEERS_WALLET="beacon:postmessage-peers-wallet",n.TRANSPORT_WALLETCONNECT_PEERS_DAPP="beacon:walletconnect-peers-dapp",n.LAST_SELECTED_WALLET="beacon:last-selected-wallet",n.ACCOUNTS="beacon:accounts",n.ACTIVE_ACCOUNT="beacon:active-account",n.PUSH_TOKENS="beacon:push-tokens",n.BEACON_SDK_SECRET_SEED="beacon:sdk-secret-seed",n.APP_METADATA_LIST="beacon:app-metadata-list",n.PERMISSION_LIST="beacon:permissions",n.BEACON_SDK_VERSION="beacon:sdk_version",n.MATRIX_PRESERVED_STATE="beacon:sdk-matrix-preserved-state",n.MATRIX_PEER_ROOM_IDS="beacon:matrix-peer-rooms",n.MATRIX_SELECTED_NODE="beacon:matrix-selected-node",n.MULTI_NODE_SETUP_DONE="beacon:multi-node-setup"}(nn||(nn={})),nn))();const lm={[nn.TRANSPORT_P2P_PEERS_DAPP]:[],[nn.TRANSPORT_P2P_PEERS_WALLET]:[],[nn.TRANSPORT_POSTMESSAGE_PEERS_DAPP]:[],[nn.TRANSPORT_POSTMESSAGE_PEERS_WALLET]:[],[nn.TRANSPORT_WALLETCONNECT_PEERS_DAPP]:[],[nn.LAST_SELECTED_WALLET]:void 0,[nn.ACCOUNTS]:[],[nn.ACTIVE_ACCOUNT]:void 0,[nn.PUSH_TOKENS]:[],[nn.BEACON_SDK_SECRET_SEED]:void 0,[nn.APP_METADATA_LIST]:[],[nn.PERMISSION_LIST]:[],[nn.BEACON_SDK_VERSION]:void 0,[nn.MATRIX_PRESERVED_STATE]:{},[nn.MATRIX_PEER_ROOM_IDS]:{},[nn.MATRIX_SELECTED_NODE]:void 0,[nn.MULTI_NODE_SETUP_DONE]:void 0};var xh=(()=>(function(n){n.EUROPE_EAST="europe-east",n.EUROPE_WEST="europe-west",n.NORTH_AMERICA_EAST="north-america-east",n.NORTH_AMERICA_WEST="north-america-west",n.CENTRAL_AMERICA="central-america",n.SOUTH_AMERICA="south-america",n.ASIA_EAST="asia-east",n.ASIA_WEST="asia-west",n.AFRICA="africa",n.AUSTRALIA="australia"}(xh||(xh={})),xh))(),Sh=(()=>(function(n){n[n.CONTINUE=100]="CONTINUE",n[n.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",n[n.PROCESSING=102]="PROCESSING",n[n.OK=200]="OK",n[n.CREATED=201]="CREATED",n[n.ACCEPTED=202]="ACCEPTED",n[n.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",n[n.NO_CONTENT=204]="NO_CONTENT",n[n.RESET_CONTENT=205]="RESET_CONTENT",n[n.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",n[n.MULTI_STATUS=207]="MULTI_STATUS",n[n.ALREADY_REPORTED=208]="ALREADY_REPORTED",n[n.IM_USED=226]="IM_USED",n[n.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",n[n.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",n[n.FOUND=302]="FOUND",n[n.SEE_OTHER=303]="SEE_OTHER",n[n.NOT_MODIFIED=304]="NOT_MODIFIED",n[n.USE_PROXY=305]="USE_PROXY",n[n.SWITCH_PROXY=306]="SWITCH_PROXY",n[n.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",n[n.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.UNAUTHORIZED=401]="UNAUTHORIZED",n[n.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",n[n.FORBIDDEN=403]="FORBIDDEN",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",n[n.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",n[n.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",n[n.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",n[n.CONFLICT=409]="CONFLICT",n[n.GONE=410]="GONE",n[n.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",n[n.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",n[n.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",n[n.URI_TOO_LONG=414]="URI_TOO_LONG",n[n.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",n[n.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",n[n.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",n[n.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",n[n.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",n[n.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",n[n.LOCKED=423]="LOCKED",n[n.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",n[n.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",n[n.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",n[n.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",n[n.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",n[n.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n[n.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",n[n.BAD_GATEWAY=502]="BAD_GATEWAY",n[n.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",n[n.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",n[n.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",n[n.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",n[n.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",n[n.LOOP_DETECTED=508]="LOOP_DETECTED",n[n.NOT_EXTENDED=510]="NOT_EXTENDED",n[n.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(Sh||(Sh={})),Sh))(),QN="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node?I(2015).XMLHttpRequest:XMLHttpRequest,QE=function n(e,t,r,i,a){this.message=e,this.status=t,this.statusText=r,this.body=i,this.url=a,this.name="HttpResponse"},ek=function n(e,t){this.url=e,this.innerEvent=t,this.name="HttpRequestFailed",this.message="Request to "+e+" failed"},tk=function(){function n(){}return n.prototype.serialize=function(e){if(!e)return"";var t=[],r=function(h){if(e.hasOwnProperty(h)&&void 0!==e[h]){var v="function"==typeof e[h].toJSON?e[h].toJSON():e[h];if(null===v)return t.push(encodeURIComponent(h)),"continue";if(Array.isArray(v))return v.forEach(function(D){t.push(encodeURIComponent(h)+"="+encodeURIComponent(D))}),"continue";t.push(encodeURIComponent(h)+"="+encodeURIComponent(v))}};for(var i in e)r(i);var a=t.join("&");return a?"?"+a:""},n.prototype.createXHR=function(){return new QN},n.prototype.createRequest=function(e,t){var r=this,i=e.url,a=e.method,h=e.timeout,v=e.query,D=e.headers,L=void 0===D?{}:D,j=e.json,Q=void 0===j||j,me=e.mimeType,ye=void 0===me?void 0:me;return new Promise(function(Te,Ve){var je=r.createXHR();for(var gt in je.open(a||"GET",""+i+r.serialize(v)),L["Content-Type"]||je.setRequestHeader("Content-Type","application/json"),ye&&je.overrideMimeType(""+ye),L)je.setRequestHeader(gt,L[gt]);if(je.timeout=h||3e4,je.onload=function(){if(this.status>=200&&this.status<300)if(Q)try{Te(JSON.parse(je.response))}catch(_t){Ve(new Error("Unable to parse response: "+je.response))}else Te(je.response);else Ve(new QE("Http error response: ("+this.status+") "+je.response,this.status,je.statusText,je.response,i))},je.ontimeout=function(){Ve(new Error("Request timed out after: "+je.timeout+"ms"))},je.onerror=function(_t){Ve(new ek(i,_t))},t){var Ie=JSON.stringify(t);je.send(Ie)}else je.send()})},n}(),ls=function(){return ls=Object.assign||function(e){for(var t,r=1,i=arguments.length;r0&&a[a.length-1])&&(6===L[0]||2===L[0])){t=0;continue}if(3===L[0]&&(!a||L[1]>a[0]&&L[1](function(n){n.ORIGINATION="origination",n.DELEGATION="delegation",n.REVEAL="reveal",n.TRANSACTION="transaction",n.ACTIVATION="activate_account",n.ENDORSEMENT="endorsement",n.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",n.SEED_NONCE_REVELATION="seed_nonce_revelation",n.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",n.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",n.PROPOSALS="proposals",n.BALLOT="ballot",n.FAILING_NOOP="failing_noop"}(Ch||(Ch={})),Ch))(),An={block:"head"},t3=function(){function n(e,t,r){void 0===t&&(t="main"),void 0===r&&(r=new tk),this.url=e,this.chain=t,this.httpBackend=r}return n.prototype.createURL=function(e){return""+this.url.replace(/\/+$/g,"")+e},n.prototype.getBlockHash=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/hash"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getLiveBlocks=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/live_blocks"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBalance=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a;return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/balance"),method:"GET"})];case 1:return a=h.sent(),[2,new Nn(a)]}})})},n.prototype.getStorage=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/storage"),method:"GET"})]})})},n.prototype.getScript=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/script"),method:"GET"})]})})},n.prototype.getContract=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a;return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e),method:"GET"})];case 1:return a=h.sent(),[2,ls(ls({},a),{balance:new Nn(a.balance)})]}})})},n.prototype.getManagerKey=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/manager_key"),method:"GET"})]})})},n.prototype.getDelegate=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a,h;return En(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/delegate"),method:"GET"})];case 1:return a=v.sent(),[3,3];case 2:if(!((h=v.sent())instanceof QE&&h.status===Sh.NOT_FOUND))throw h;return a=null,[3,3];case 3:return[2,a]}})})},n.prototype.getBigMapKey=function(e,t,r){var a=(void 0===r?An:r).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+a+"/context/contracts/"+e+"/big_map_get"),method:"POST"},t)]})})},n.prototype.getBigMapExpr=function(e,t,r){var a=(void 0===r?An:r).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+a+"/context/big_maps/"+e+"/"+t),method:"GET"})]})})},n.prototype.getDelegates=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a;return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/delegates/"+e),method:"GET"})];case 1:return[2,{deactivated:(a=h.sent()).deactivated,balance:new Nn(a.balance),frozen_balance:new Nn(a.frozen_balance),frozen_balance_by_cycle:a.frozen_balance_by_cycle.map(function(v){var D=v.deposit,L=v.deposits,j=v.fees,Q=v.rewards,me=JE(v,["deposit","deposits","fees","rewards"]),ye=um({deposit:D,deposits:L,fees:j,rewards:Q},["deposit","deposits","fees","rewards"]);return ls(ls({},me),{deposit:ye.deposit,deposits:ye.deposits,fees:ye.fees,rewards:ye.rewards})}),staking_balance:new Nn(a.staking_balance),delegated_contracts:a.delegated_contracts,delegated_balance:new Nn(a.delegated_balance),grace_period:a.grace_period,voting_power:a.voting_power}]}})})},n.prototype.getConstants=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){var i,a;return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/context/constants"),method:"GET"})];case 1:return i=h.sent(),a=um(i,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy"]),[2,ls(ls({},i),a)]}})})},n.prototype.getBlock=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBlockHeader=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/header"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBlockMetadata=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/metadata"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBakingRights=function(e,t){void 0===e&&(e={});var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/baking_rights"),method:"GET",query:e})];case 1:return[2,h.sent()]}})})},n.prototype.getEndorsingRights=function(e,t){void 0===e&&(e={});var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/endorsing_rights"),method:"GET",query:e})];case 1:return[2,h.sent()]}})})},n.prototype.getBallotList=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/ballot_list"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBallots=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/ballots"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getCurrentPeriodKind=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/current_period_kind"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getCurrentProposal=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/current_proposal"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getCurrentQuorum=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/current_quorum"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getVotesListings=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/listings"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getProposals=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/proposals"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.forgeOperations=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/forge/operations"),method:"POST"},e)]})})},n.prototype.injectOperation=function(e){return Mn(this,void 0,void 0,function(){return En(this,function(t){return[2,this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},e)]})})},n.prototype.preapplyOperations=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/preapply/operations"),method:"POST"},e)];case 1:return[2,h.sent()]}})})},n.prototype.getEntrypoints=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/entrypoints"),method:"GET"})];case 1:return[2,h.sent()]}})})},n.prototype.runOperation=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/scripts/run_operation"),method:"POST"},e)];case 1:return[2,h.sent()]}})})},n.prototype.runCode=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/scripts/run_code"),method:"POST"},e)];case 1:return[2,h.sent()]}})})},n.prototype.getChainId=function(){return Mn(this,void 0,void 0,function(){return En(this,function(e){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/chain_id"),method:"GET"})]})})},n.prototype.packData=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a,h,v,D,L;return En(this,function(j){switch(j.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/scripts/pack_data"),method:"POST"},e)];case 1:return a=j.sent(),h=a.gas,v=JE(a,["gas"]),D=h,(L=new Nn(h||"")).isNaN()||(D=L),[2,ls({gas:D},v)]}})})},n.prototype.getRpcUrl=function(){return this.url},n.prototype.getCurrentPeriod=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/current_period"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getSuccessorPeriod=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/successor_period"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getSaplingDiffById=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/sapling/"+e+"/get_diff"),method:"GET"})]})})},n.prototype.getSaplingDiffByContract=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/single_sapling_get_diff"),method:"GET"})]})})},n}();class n3{}class r3{}class us{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const r=t.indexOf(":");if(r>0){const i=t.slice(0,r),a=i.toLowerCase(),h=t.slice(r+1).trim();this.maybeSetNormalizedName(i,a),this.headers.has(a)?this.headers.get(a).push(h):this.headers.set(a,[h])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let r=e[t];const i=t.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(i,r),this.maybeSetNormalizedName(t,i))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof us?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new us;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof us?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let r=e.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(e.name,t);const i=("a"===e.op?this.headers.get(t):void 0)||[];i.push(...r),this.headers.set(t,i);break;case"d":const a=e.value;if(a){let h=this.headers.get(t);if(!h)return;h=h.filter(v=>-1===a.indexOf(v)),0===h.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,h)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class ik{encodeKey(e){return o3(e)}encodeValue(e){return o3(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const sk=/%(\d[a-f0-9])/gi,ak={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function o3(n){return encodeURIComponent(n).replace(sk,(e,t)=>{var r;return null!==(r=ak[t])&&void 0!==r?r:e})}function s3(n){return`${n}`}class Is{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new ik,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function ok(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(i=>{const a=i.indexOf("="),[h,v]=-1==a?[e.decodeKey(i),""]:[e.decodeKey(i.slice(0,a)),e.decodeValue(i.slice(a+1))],D=t.get(h)||[];D.push(v),t.set(h,D)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const r=e.fromObject[t];this.map.set(t,Array.isArray(r)?r:[r])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(r=>{const i=e[r];Array.isArray(i)?i.forEach(a=>{t.push({param:r,value:a,op:"a"})}):t.push({param:r,value:i,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(r=>t+"="+this.encoder.encodeValue(r)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new Is({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(s3(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let r=this.map.get(e.param)||[];const i=r.indexOf(s3(e.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(e.param,r):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class lk{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}}function a3(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function l3(n){return"undefined"!=typeof Blob&&n instanceof Blob}function u3(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Qu{constructor(e,t,r,i){let a;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function uk(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,a=i):a=r,a&&(this.reportProgress=!!a.reportProgress,this.withCredentials=!!a.withCredentials,a.responseType&&(this.responseType=a.responseType),a.headers&&(this.headers=a.headers),a.context&&(this.context=a.context),a.params&&(this.params=a.params)),this.headers||(this.headers=new us),this.context||(this.context=new lk),this.params){const h=this.params.toString();if(0===h.length)this.urlWithParams=t;else{const v=t.indexOf("?");this.urlWithParams=t+(-1===v?"?":vme.set(ye,e.setHeaders[ye]),L)),e.setParams&&(j=Object.keys(e.setParams).reduce((me,ye)=>me.set(ye,e.setParams[ye]),j)),new Qu(r,i,h,{params:j,headers:L,context:Q,reportProgress:D,responseType:a,withCredentials:v})}}var Dr=(()=>((Dr=Dr||{})[Dr.Sent=0]="Sent",Dr[Dr.UploadProgress=1]="UploadProgress",Dr[Dr.ResponseHeader=2]="ResponseHeader",Dr[Dr.DownloadProgress=3]="DownloadProgress",Dr[Dr.Response=4]="Response",Dr[Dr.User=5]="User",Dr))();class cm{constructor(e,t=200,r="OK"){this.headers=e.headers||new us,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||r,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class fm extends cm{constructor(e={}){super(e),this.type=Dr.ResponseHeader}clone(e={}){return new fm({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Ah extends cm{constructor(e={}){super(e),this.type=Dr.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new Ah({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class c3 extends cm{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function hm(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let f3=(()=>{class n{constructor(t){this.handler=t}request(t,r,i={}){let a;if(t instanceof Qu)a=t;else{let D,L;D=i.headers instanceof us?i.headers:new us(i.headers),i.params&&(L=i.params instanceof Is?i.params:new Is({fromObject:i.params})),a=new Qu(t,r,void 0!==i.body?i.body:null,{headers:D,context:i.context,params:L,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const h=tn(a).pipe(vl(D=>this.handler.handle(D)));if(t instanceof Qu||"events"===i.observe)return h;const v=h.pipe(rs(D=>D instanceof Ah));switch(i.observe||"body"){case"body":switch(a.responseType){case"arraybuffer":return v.pipe(u(D=>{if(null!==D.body&&!(D.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return D.body}));case"blob":return v.pipe(u(D=>{if(null!==D.body&&!(D.body instanceof Blob))throw new Error("Response is not a Blob.");return D.body}));case"text":return v.pipe(u(D=>{if(null!==D.body&&"string"!=typeof D.body)throw new Error("Response is not a string.");return D.body}));default:return v.pipe(u(D=>D.body))}case"response":return v;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(t,r={}){return this.request("DELETE",t,r)}get(t,r={}){return this.request("GET",t,r)}head(t,r={}){return this.request("HEAD",t,r)}jsonp(t,r){return this.request("JSONP",t,{params:(new Is).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,r={}){return this.request("OPTIONS",t,r)}patch(t,r,i={}){return this.request("PATCH",t,hm(i,r))}post(t,r,i={}){return this.request("POST",t,hm(i,r))}put(t,r,i={}){return this.request("PUT",t,hm(i,r))}}return n.\u0275fac=function(t){return new(t||n)(Mt(n3))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class h3{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const d3=new Kt("HTTP_INTERCEPTORS");let fk=(()=>{class n{intercept(t,r){return r.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const hk=/^\)\]\}',?\n/;let p3=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new Z(r=>{const i=this.xhrFactory.build();if(i.open(t.method,t.urlWithParams),t.withCredentials&&(i.withCredentials=!0),t.headers.forEach((ye,Te)=>i.setRequestHeader(ye,Te.join(","))),t.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const ye=t.detectContentTypeHeader();null!==ye&&i.setRequestHeader("Content-Type",ye)}if(t.responseType){const ye=t.responseType.toLowerCase();i.responseType="json"!==ye?ye:"text"}const a=t.serializeBody();let h=null;const v=()=>{if(null!==h)return h;const ye=i.statusText||"OK",Te=new us(i.getAllResponseHeaders()),Ve=function dk(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(i)||t.url;return h=new fm({headers:Te,status:i.status,statusText:ye,url:Ve}),h},D=()=>{let{headers:ye,status:Te,statusText:Ve,url:je}=v(),gt=null;204!==Te&&(gt=void 0===i.response?i.responseText:i.response),0===Te&&(Te=gt?200:0);let Ie=Te>=200&&Te<300;if("json"===t.responseType&&"string"==typeof gt){const _t=gt;gt=gt.replace(hk,"");try{gt=""!==gt?JSON.parse(gt):null}catch(At){gt=_t,Ie&&(Ie=!1,gt={error:At,text:gt})}}Ie?(r.next(new Ah({body:gt,headers:ye,status:Te,statusText:Ve,url:je||void 0})),r.complete()):r.error(new c3({error:gt,headers:ye,status:Te,statusText:Ve,url:je||void 0}))},L=ye=>{const{url:Te}=v(),Ve=new c3({error:ye,status:i.status||0,statusText:i.statusText||"Unknown Error",url:Te||void 0});r.error(Ve)};let j=!1;const Q=ye=>{j||(r.next(v()),j=!0);let Te={type:Dr.DownloadProgress,loaded:ye.loaded};ye.lengthComputable&&(Te.total=ye.total),"text"===t.responseType&&!!i.responseText&&(Te.partialText=i.responseText),r.next(Te)},me=ye=>{let Te={type:Dr.UploadProgress,loaded:ye.loaded};ye.lengthComputable&&(Te.total=ye.total),r.next(Te)};return i.addEventListener("load",D),i.addEventListener("error",L),i.addEventListener("timeout",L),i.addEventListener("abort",L),t.reportProgress&&(i.addEventListener("progress",Q),null!==a&&i.upload&&i.upload.addEventListener("progress",me)),i.send(a),r.next({type:Dr.Sent}),()=>{i.removeEventListener("error",L),i.removeEventListener("abort",L),i.removeEventListener("load",D),i.removeEventListener("timeout",L),t.reportProgress&&(i.removeEventListener("progress",Q),null!==a&&i.upload&&i.upload.removeEventListener("progress",me)),i.readyState!==i.DONE&&i.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(Mt(iM))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const dm=new Kt("XSRF_COOKIE_NAME"),pm=new Kt("XSRF_HEADER_NAME");class g3{}let pk=(()=>{class n{constructor(t,r,i){this.doc=t,this.platform=r,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=K2(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr),Mt(Au),Mt(dm))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{class n{constructor(t,r){this.tokenService=t,this.headerName=r}intercept(t,r){const i=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||i.startsWith("http://")||i.startsWith("https://"))return r.handle(t);const a=this.tokenService.getToken();return null!==a&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,a)})),r.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(g3),Mt(pm))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),gk=(()=>{class n{constructor(t,r){this.backend=t,this.injector=r,this.chain=null}handle(t){if(null===this.chain){const r=this.injector.get(d3,[]);this.chain=r.reduceRight((i,a)=>new h3(i,a),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(r3),Mt(Cr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),mk=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:gm,useClass:fk}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:dm,useValue:t.cookieName}:[],t.headerName?{provide:pm,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:[gm,{provide:d3,useExisting:gm,multi:!0},{provide:g3,useClass:pk},{provide:dm,useValue:"XSRF-TOKEN"},{provide:pm,useValue:"X-XSRF-TOKEN"}]}),n})(),vk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:[f3,{provide:n3,useClass:gk},p3,{provide:r3,useExisting:p3}],imports:[[mk.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})(),m3=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const yk={[Gi.MAINNET]:{selected:"https://tezos-node.prod.gke.papers.tech",all:["https://tezos-node.prod.gke.papers.tech"]},[Gi.GHOSTNET]:{selected:"https://tezos-ghostnet-node-1.diamond.papers.tech",all:["https://tezos-ghostnet-node-1.diamond.papers.tech"]}};let Ju=(()=>{class n{constructor(t,r,i){var a;this.http=t,this.storage=r,this.domSanitizer=i,this.RPCs=yk;try{const h=JSON.parse(null!==(a=localStorage.getItem("nodes"))&&void 0!==a?a:"");this.RPCs=h}catch(h){}}getPublicKeyForAddress(t){var r=this;return Ot(function*(){const i=Object.entries(r.RPCs).filter(a=>!!a[1].selected).map(a=>({network:a[0],url:a[1].selected}));i.unshift({network:Gi.MAINNET,url:r.RPCs.mainnet.selected});for(let a of i){const h=yield r.getPublicKeyForAddressFromRPC(a.url,t);if(h)return{network:a.network,publicKey:h}}throw new Error("No entry found")})()}getPublicKeyForAddressFromRPC(t,r){var i=this;return Ot(function*(){const a=`${t}/chains/main/blocks/head/context/contracts/${r}/manager_key`,h=yield i.http.get(a).toPromise();return console.log(h),h})()}selectRpc(t,r){var i=this;return Ot(function*(){i.RPCs[t].selected=r,localStorage.setItem("nodes",JSON.stringify(i.RPCs))})()}addCustomRpc(t,r){var i=this;return Ot(function*(){i.RPCs[t].all.push(r),i.selectRpc(t,r)})()}getBalanceOfAddress(t){var r=this;return Ot(function*(){return new t3(r.RPCs.mainnet.selected).getBalance(t)})()}getOperationHistory(t){var r=this;return Ot(function*(){return yield r.http.get(`https://api.tzkt.io/v1/accounts/${t}/operations?limit=10`).toPromise()})()}getTokenTransactionHistory(t){var r=this;return Ot(function*(){return yield r.http.get(`https://api.tzkt.io/v1/tokens/transfers?anyof.from.to=${t}&sort.desc=id&limit=10`).toPromise()})()}getBlockexplorerAddressLink(t){return Ot(function*(){return`https://tzkt.io/${t}`})()}getTokenBalances(t){var r=this;return Ot(function*(){return r.http.get(`https://api.tzkt.io/v1/tokens/balances?token.metadata.displayUri.null=true&balance.ne=0&account=${t}&sort.desc=balance&limit=5`).toPromise().then(i=>i.map(a=>(a.token.metadata.sanitizedThumbnailUri=a.token.metadata.thumbnailUri?r.domSanitizer.bypassSecurityTrustUrl(a.token.metadata.thumbnailUri.startsWith("ipfs://")?`https://cloudflare-ipfs.com/ipfs/${a.token.metadata.thumbnailUri.slice(6)}/`:a.token.metadata.thumbnailUri):void 0,a.humanReadableBalance=new Nn(a.balance).shiftedBy(-new Nn(a.token.metadata.decimals).toNumber()).decimalPlaces(6).toString(10),a)))})()}getNftBalances(t){var r=this;return Ot(function*(){return r.http.get(`https://api.tzkt.io/v1/tokens/balances?token.standard=fa2&token.metadata.displayUri.null=false&balance.ne=0&account=${t}&limit=20`).toPromise().then(i=>i.map(a=>(a.token.metadata.sanitizedThumbnailUri=a.token.metadata.displayUri?r.domSanitizer.bypassSecurityTrustUrl(`https://cloudflare-ipfs.com/ipfs/${a.token.metadata.displayUri.slice(6)}/`):a.token.metadata.artifactUri?r.domSanitizer.bypassSecurityTrustUrl(`https://cloudflare-ipfs.com/ipfs/${a.token.metadata.artifactUri.slice(6)}/`):void 0,a)))})()}getXtzPrice(){var t=this;return Ot(function*(){return t.http.get("https://min-api.cryptocompare.com/data/price?fsym=XTZ&tsyms=USD").toPromise().then(r=>r.USD)})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(f3),Mt(m3),Mt(Wf))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function mm(n){return Object.keys(n)}var go=(()=>(function(n){n.PENDING="pending",n.RESOLVED="resolved",n.REJECTED="rejected"}(go||(go={})),go))();const v3=()=>{throw new Error("ExposedPromise not initialized yet.")};class pi{constructor(){this._resolve=v3,this._reject=v3,this._status=go.PENDING,this._promise=new Promise((e,t)=>{this._resolve=r=>{this.isSettled()||(this._promiseResult=r,e(r),this._status=go.RESOLVED)},this._reject=r=>{this.isSettled()||(this._promiseError=r,t(r),this._status=go.REJECTED)}})}get promise(){return this._promise}get resolve(){return this._resolve}get reject(){return this._reject}get status(){return this._status}get promiseResult(){return this._promiseResult}get promiseError(){return this._promiseError}static resolve(e){const t=new pi;return t.resolve(e),t}static reject(e){const t=new pi;return t.reject(e),t}isPending(){return this.status===go.PENDING}isResolved(){return this.status===go.RESOLVED}isRejected(){return this.status===go.REJECTED}isSettled(){return this.isResolved()||this.isRejected()}}var ca=I(4329),vm=I.n(ca),ec=I(4488),y3=I(5784),Sl=I(3434),cs=I(7221),mo=I(5553),bk=I(8401),vo=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};function fs(n){return Buffer.from(n).toString("hex")}function Cl(n){return vo(this,void 0,void 0,function*(){return fs((0,cs.hash)("string"==typeof n?(0,Sl.cv)(n):n,32))})}function b3(n){return vo(this,void 0,void 0,function*(){return(0,mo._w)((0,cs.hash)((0,Sl.cv)(n),32))})}function _3(n,e){return`@${n}:${e}`}function bm(){return function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){const n=(0,y3.randomBytes)(16);return[n.slice(0,4),n.slice(4,6),n.slice(6,8),n.slice(8,10),n.slice(10,16)].map(function(e){return Buffer.from(e).toString("hex")}).join("-")})}const E3="https://beacon-notification-oracle.dev.gke.papers.tech",tc=[n=>{}];let Al={postMessage:(n,e)=>{console.log("GOT MOCK POST MESSAGE",n),tc.forEach(t=>{t({data:n})})},addEventListener:(n,e)=>{tc.push(e)},removeEventListener:(n,e)=>{tc.splice(tc.indexOf(t=>t===e),1)},location:{origin:"*"}};try{"undefined"!=typeof window&&(Al=window)}catch(n){console.log(`not defined: ${n}`)}class Ik{track(e,t,r,i){}}var Th=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})},nc=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class Dh{constructor(e,t){this.storage=e,this.storageKey=t}getAll(){var e;return nc(this,void 0,void 0,function*(){return null!==(e=yield this.storage.get(this.storageKey))&&void 0!==e?e:[]})}getOne(e){return nc(this,void 0,void 0,function*(){return(yield this.storage.get(this.storageKey)).find(e)})}addOne(e,t,r=!0){return nc(this,void 0,void 0,function*(){const i=yield this.storage.get(this.storageKey);if(i.some(t)){if(r)for(let a=0;a!e(i));return this.storage.set(this.storageKey,r)})}removeAll(){return nc(this,void 0,void 0,function*(){return this.storage.delete(this.storageKey)})}}const x3=(n,e)=>function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(void 0,void 0,void 0,function*(){const t=[n,e.type];e.name&&t.push(`name:${e.name}`),e.rpcUrl&&t.push(`rpc:${e.rpcUrl}`);const r=Buffer.from((0,cs.hash)((0,Sl.cv)(t.join("-")),10));return ca.encode(r)});class S3{static hasPermission(e,t,r){return function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){switch(e.type){case wn.PermissionRequest:case wn.BroadcastRequest:return!0;case wn.OperationRequest:{const i=yield x3(e.sourceAddress,e.network),a=yield t(i);return!!a&&a.scopes.includes(ua.OPERATION_REQUEST)}case wn.SignPayloadRequest:{const a=(yield r()).filter(h=>h.address===e.sourceAddress);return 0!==a.length&&a.some(h=>h.scopes.includes(ua.SIGN))}default:throw new Error("Message not handled")}})}}var fa=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class Nk{constructor(e){this.storageManager=new Dh(e,nn.ACCOUNTS)}getAccounts(){var e;return fa(this,void 0,void 0,function*(){return null!==(e=yield this.storageManager.getAll())&&void 0!==e?e:[]})}getAccount(e){return fa(this,void 0,void 0,function*(){return this.storageManager.getOne(t=>t.accountIdentifier===e)})}addAccount(e){return fa(this,void 0,void 0,function*(){return this.storageManager.addOne(e,t=>t.accountIdentifier===e.accountIdentifier)})}removeAccount(e){return fa(this,void 0,void 0,function*(){return this.storageManager.remove(t=>t.accountIdentifier===e)})}removeAccounts(e){return fa(this,void 0,void 0,function*(){return this.storageManager.remove(t=>e.includes(t.accountIdentifier))})}removeAllAccounts(){return fa(this,void 0,void 0,function*(){return this.storageManager.removeAll()})}hasPermission(e){return fa(this,void 0,void 0,function*(){return S3.hasPermission(e,this.getAccount.bind(this),this.getAccounts.bind(this))})}}const Tl=n=>function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(void 0,void 0,void 0,function*(){const e=Buffer.from((0,cs.hash)(Buffer.from(n,"hex"),5));return ca.encode(e)});let _m=!!Al.beaconSdkDebugEnabled;_m&&console.log("[BEACON]: Debug mode is ON (turned on either by the developer or a browser extension)");class yo{constructor(e){this.name=e}debug(e,...t){ha.debug(this.name,e,t)}log(e,...t){ha.log(this.name,e,t)}warn(e,...t){ha.warn(this.name,e,t)}error(e,...t){ha.error(this.name,e,t)}time(e,t){ha.time(e,t)}timeLog(e,...t){ha.timeLog(e,t)}}new yo("");let ha=new class Lk{constructor(){}debug(e,t,...r){this._log("debug",e,t,r)}log(e,t,...r){this._log("log",e,t,r)}warn(e,t,...r){this._log("warn",e,t,r)}error(e,t,...r){this._log("error",e,t,r)}time(e,t){e?console.time(t):console.timeEnd(t)}timeLog(e,t,...r){this._log("timeLog",e,t,r)}_log(e,t,r,i=[]){if(!_m)return;let a=`[BEACON] ${(new Date).toISOString()} [${t}](${r})`,h=i;switch(i[0]&&"string"==typeof i[0]&&(a+=` ${i[0]}`,h=i.slice(1)),e){case"error":console.group(a),console.error(...h);break;case"warn":console.group(a),console.warn(...h);break;case"debug":console.groupCollapsed(a),console.debug(...h);break;case"timeLog":console.group(a),console.timeLog(...h);break;default:console.group(a),console.log(...h)}console.groupEnd()}};var gi=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const Uk=new yo("Client");var bo=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const hs=new yo("Transport");var Rh=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class jk{constructor(e){this.prefix=e}static isSupported(){return Rh(this,void 0,void 0,function*(){return Promise.resolve(Boolean("undefined"!=typeof window)&&Boolean(window.localStorage))})}get(e){return Rh(this,void 0,void 0,function*(){const t=localStorage.getItem(this.getPrefixedKey(e));if(!t)return"object"==typeof lm[e]?JSON.parse(JSON.stringify(lm[e])):lm[e];try{return JSON.parse(t)}catch(r){return t}})}set(e,t){return Rh(this,void 0,void 0,function*(){return"string"==typeof t?localStorage.setItem(this.getPrefixedKey(e),t):localStorage.setItem(this.getPrefixedKey(e),JSON.stringify(t))})}delete(e){return Rh(this,void 0,void 0,function*(){return Promise.resolve(localStorage.removeItem(this.getPrefixedKey(e)))})}getPrefixedKey(e){return this.prefix?`${this.prefix}-${e}`:e}}new yo("STORAGE");var A3=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class rc{serialize(e){return A3(this,void 0,void 0,function*(){const t=JSON.stringify(e);return ca.encode(Buffer.from(t))})}deserialize(e){return A3(this,void 0,void 0,function*(){if("string"!=typeof e)throw new Error("Encoded payload needs to be a string");return JSON.parse(ca.decode(e).toString())})}}var Dl=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class zk{constructor(e){this.storageManager=new Dh(e,nn.APP_METADATA_LIST)}getAppMetadataList(){var e;return Dl(this,void 0,void 0,function*(){return null!==(e=yield this.storageManager.getAll())&&void 0!==e?e:[]})}getAppMetadata(e){return Dl(this,void 0,void 0,function*(){return this.storageManager.getOne(t=>t.senderId===e)})}addAppMetadata(e){return Dl(this,void 0,void 0,function*(){return this.storageManager.addOne(e,t=>t.senderId===e.senderId)})}removeAppMetadata(e){return Dl(this,void 0,void 0,function*(){return this.storageManager.remove(t=>t.senderId===e)})}removeAppMetadatas(e){return Dl(this,void 0,void 0,function*(){return this.storageManager.remove(t=>e.includes(t.senderId))})}removeAllAppMetadata(){return Dl(this,void 0,void 0,function*(){return this.storageManager.removeAll()})}}var da=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class Gk{constructor(e){this.storageManager=new Dh(e,nn.PERMISSION_LIST)}getPermissions(){var e;return da(this,void 0,void 0,function*(){return null!==(e=yield this.storageManager.getAll())&&void 0!==e?e:[]})}getPermission(e){return da(this,void 0,void 0,function*(){return this.storageManager.getOne(t=>t.accountIdentifier===e)})}addPermission(e){return da(this,void 0,void 0,function*(){return this.storageManager.addOne(e,t=>t.accountIdentifier===e.accountIdentifier&&t.senderId===e.senderId)})}removePermission(e){return da(this,void 0,void 0,function*(){return this.storageManager.remove(t=>t.accountIdentifier===e)})}removePermissions(e){return da(this,void 0,void 0,function*(){return this.storageManager.remove(t=>e.includes(t.accountIdentifier))})}removeAllPermissions(){return da(this,void 0,void 0,function*(){return this.storageManager.removeAll()})}hasPermission(e){return da(this,void 0,void 0,function*(){return S3.hasPermission(e,this.getPermission.bind(this),this.getPermissions.bind(this))})}}var pa=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class wm{constructor(e,t){this.storageManager=new Dh(e,t)}hasPeer(e){return pa(this,void 0,void 0,function*(){return!!(yield this.getPeer(e))})}getPeers(){var e;return pa(this,void 0,void 0,function*(){return null!==(e=yield this.storageManager.getAll())&&void 0!==e?e:[]})}getPeer(e){return pa(this,void 0,void 0,function*(){return this.storageManager.getOne(t=>t.publicKey===e)})}addPeer(e){return pa(this,void 0,void 0,function*(){return this.storageManager.addOne(e,t=>t.publicKey===e.publicKey)})}removePeer(e){return pa(this,void 0,void 0,function*(){return this.storageManager.remove(t=>t.publicKey===e)})}removePeers(e){return pa(this,void 0,void 0,function*(){return this.storageManager.remove(t=>e.includes(t.publicKey))})}removeAllPeers(){return pa(this,void 0,void 0,function*(){return this.storageManager.removeAll()})}}var T3=I(467),ic=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})},qk=I(3014),oc=I.n(qk),sc=(()=>(function(n){n.TEXT="m.text"}(sc||(sc={})),sc))();class Mm{constructor(e,t,r,i){this.type=e,this.sender=t,this.content=r,this.timestamp=i}static from(e){if(Xk(e))return new Mm(e.content.msgtype,e.sender,e.content.body,e.origin_server_ts)}}const D3=n=>"m.room.message"===n.type,Xk=n=>D3(n)&&n.content instanceof Object&&"msgtype"in n.content&&n.content.msgtype===sc.TEXT;var zr=(()=>(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.JOINED=1]="JOINED",n[n.INVITED=2]="INVITED",n[n.LEFT=3]="LEFT"}(zr||(zr={})),zr))();class xr{constructor(e,t=zr.UNKNOWN,r=[],i=[]){this.id=e,this.status=t,this.members=r,this.messages=i}static fromSync(e){var t,r,i;if(!e)return[];function a(h,v){return Object.entries(h).map(([D,L])=>v(D,L))}return[...a(null!==(t=e.join)&&void 0!==t?t:{},xr.fromJoined),...a(null!==(r=e.invite)&&void 0!==r?r:{},xr.fromInvited),...a(null!==(i=e.leave)&&void 0!==i?i:{},xr.fromLeft)]}static from(e,t){return"string"==typeof e?new xr(e,t||zr.UNKNOWN):void 0!==t?new xr(e.id,t,e.members,e.messages):e}static merge(e,t){return t&&t.id===e.id?new xr(e.id,e.status,[...t.members,...e.members].filter((r,i,a)=>a.indexOf(r)===i),[...t.messages,...e.messages]):xr.from(e)}static fromJoined(e,t){const r=[...t.state.events,...t.timeline.events],i=xr.getMembersFromEvents(r),a=xr.getMessagesFromEvents(r);return new xr(e,zr.JOINED,i,a)}static fromInvited(e,t){const r=xr.getMembersFromEvents(t.invite_state.events);return new xr(e,zr.INVITED,r)}static fromLeft(e,t){const r=[...t.state.events,...t.timeline.events],i=xr.getMembersFromEvents(r),a=xr.getMessagesFromEvents(r);return new xr(e,zr.LEFT,i,a)}static getMembersFromEvents(e){return xr.getUniqueEvents(e.filter(t=>(n=>"m.room.create"===n.type&&n.content instanceof Object&&"creator"in n.content)(t)||(n=>"m.room.member"===n.type&&n.content instanceof Object&&"membership"in n.content&&"join"===n.content.membership)(t))).map(t=>t.sender).filter((t,r,i)=>i.indexOf(t)===r)}static getMessagesFromEvents(e){return xr.getUniqueEvents(e.filter(D3)).map(t=>Mm.from(t)).filter(Boolean)}static getUniqueEvents(e){const t={},r=[];return e.forEach((i,a)=>{const h=i.event_id;(void 0===h||!(h in t))&&(void 0!==h&&(t[h]=a),r.push(i))}),r}}var Oh=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const I3=["syncToken","rooms"];class Yk{constructor(e){this.storage=e,this.state={isRunning:!1,userId:void 0,deviceId:void 0,txnNo:0,accessToken:void 0,syncToken:void 0,pollingTimeout:void 0,pollingRetries:0,rooms:{}},this.onStateChangedListeners=new Map,this.waitReadyPromise=new Promise((t,r)=>Oh(this,void 0,void 0,function*(){try{yield this.initFromStorage(),t()}catch(i){r(i)}}))}get(e){return this.state[e]}getRoom(e){const t=xr.from(e,zr.UNKNOWN);return this.state.rooms[t.id]||t}update(e){return Oh(this,void 0,void 0,function*(){yield this.waitReady();const t=Object.assign({},this.state);this.setState(e),this.updateStorage(e),this.notifyListeners(t,this.state,e)})}onStateChanged(e,...t){t.length>0?t.forEach(r=>{this.onStateChangedListeners.set(r,e)}):this.onStateChangedListeners.set("all",e)}waitReady(){return Oh(this,void 0,void 0,function*(){return this.waitReadyPromise})}initFromStorage(){return Oh(this,void 0,void 0,function*(){const e=yield this.storage.get(nn.MATRIX_PRESERVED_STATE);this.setState(e)})}prepareData(e){const r=["rooms"].some(i=>void 0!==e[i])?JSON.parse(JSON.stringify(e)):e;return Object.values(r.rooms||{}).forEach(i=>{i.messages=[]}),r}updateStorage(e){if(Object.entries(e).filter(([r,i])=>I3.includes(r)&&Boolean(i)).length>0){const r={};I3.forEach(i=>{r[i]=this.state[i]}),this.storage.set(nn.MATRIX_PRESERVED_STATE,this.prepareData(r))}}setState(e){this.state={isRunning:e.isRunning||this.state.isRunning,userId:e.userId||this.state.userId,deviceId:e.deviceId||this.state.deviceId,txnNo:e.txnNo||this.state.txnNo,accessToken:e.accessToken||this.state.accessToken,syncToken:e.syncToken||this.state.syncToken,pollingTimeout:e.pollingTimeout||this.state.pollingTimeout,pollingRetries:e.pollingRetries||this.state.pollingRetries,rooms:this.mergeRooms(this.state.rooms,e.rooms)}}mergeRooms(e,t){if(!t)return e;const r=Array.isArray(t)?t:Object.values(t),i=Object.assign({},e);return r.forEach(a=>{i[a.id]=xr.merge(a,e[a.id])}),i}notifyListeners(e,t,r){const i=this.onStateChangedListeners.get("all");i&&i(e,t,r),mm(r).filter(a=>void 0!==r[a]).forEach(a=>{const h=this.onStateChangedListeners.get(a);h&&h(e,t,r)})}}var ac=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const Qk=new yo("MatrixHttpClient");class eB{constructor(e){this.baseUrl=e,this.cancelTokenSource=oc().CancelToken.source()}get(e,t,r){return ac(this,void 0,void 0,function*(){return this.send("GET",e,r,t)})}post(e,t,r,i){return ac(this,void 0,void 0,function*(){return this.send("POST",e,r,i,t)})}put(e,t,r,i){return ac(this,void 0,void 0,function*(){return this.send("PUT",e,r,i,t)})}cancelAllRequests(){return ac(this,void 0,void 0,function*(){return this.cancelTokenSource.cancel("Manually cancelled")})}send(e,t,r,i,a){return ac(this,void 0,void 0,function*(){const h=r?this.getHeaders(r):void 0,v=i?this.getParams(i):void 0;let D;try{D=yield oc().request({method:e,url:t,baseURL:this.apiUrl("/_matrix/client/r0"),headers:h,data:a,params:v,cancelToken:this.cancelTokenSource.token})}catch(L){throw Qk.error("send",L.code,L.message,L.response.data),L.response.data}return D.data})}getHeaders(e){const t={},r=[];if(e.accessToken&&r.push(["Authorization",`Bearer ${e.accessToken}`]),0!==r.length){for(const[i,a]of r)t[i]=a;return t}}getParams(e){if(!e)return;const t=Object.assign(e,{});return mm(t).forEach(r=>void 0===t[r]&&delete t[r]),t}apiUrl(...e){return[this.baseUrl.endsWith("/")?this.baseUrl.substr(0,this.baseUrl.length-1):this.baseUrl,...e.map(i=>i.startsWith("/")?i.substr(1):i)].join("/")}}var Ph=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class tB{constructor(e){this.httpClient=e}createRoom(e,t={}){return Ph(this,void 0,void 0,function*(){return this.httpClient.post("/createRoom",t,{accessToken:e})})}inviteToRoom(e,t,r){return Ph(this,void 0,void 0,function*(){return r.status!==zr.JOINED&&r.status!==zr.UNKNOWN?Promise.reject(`User is not a member of room ${r.id}.`):this.httpClient.post(`/rooms/${encodeURIComponent(r.id)}/invite`,{user_id:t},{accessToken:e})})}joinRoom(e,t){return Ph(this,void 0,void 0,function*(){return t.status===zr.JOINED?Promise.resolve({room_id:t.id}):this.httpClient.post(`/rooms/${encodeURIComponent(t.id)}/join`,{},{accessToken:e})})}getJoinedRooms(e){return Ph(this,void 0,void 0,function*(){return this.httpClient.get("/joined_rooms",void 0,{accessToken:e})})}}class rB{constructor(e){this.httpClient=e}login(e,t,r){return function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){return this.httpClient.post("/login",{type:"m.login.password",identifier:{type:"m.id.user",user:e},password:t,device_id:r})})}}var Em=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class iB{constructor(e){this.httpClient=e,this.cachedPromises=new Map}sync(e,t){return Em(this,void 0,void 0,function*(){return this.withCache("sync",()=>this.httpClient.get("/sync",{timeout:t?t.pollingTimeout:void 0,since:t?t.syncToken:void 0},{accessToken:e}))})}sendMessage(e,t,r,i){return Em(this,void 0,void 0,function*(){return new Promise((a,h)=>this.scheduleEvent({accessToken:e,roomId:t,type:"m.room.message",content:r,txnId:i,onSuccess:a,onError:h}))})}scheduleEvent(e){this.sendEvent(e)}sendEvent(e){return Em(this,void 0,void 0,function*(){const{roomId:t,type:r,txnId:i,content:a,accessToken:h}=e;try{const v=yield this.httpClient.put(`/rooms/${encodeURIComponent(t)}/send/${r}/${encodeURIComponent(i)}`,a,{accessToken:h});e.onSuccess(v)}catch(v){e.onError(v)}})}withCache(e,t){let r=this.cachedPromises.get(e);return r||(r=t().finally(()=>{this.cachedPromises.delete(e)}),this.cachedPromises.set(e,r)),r}}var mi=(()=>(function(n){n.INVITE="invite",n.MESSAGE="message"}(mi||(mi={})),mi))();class sB extends class oB{constructor(){this.events={}}on(e,t){return"object"!=typeof this.events[e]&&(this.events[e]=[]),this.events[e].push(t),()=>this.removeListener(e,t)}removeListener(e,t){if("object"!=typeof this.events[e])return;if(!t)return void(this.events[e]=[]);const r=this.events[e].indexOf(t);r>-1&&this.events[e].splice(r,1)}removeAllListeners(){Object.keys(this.events).forEach(e=>this.events[e].splice(0,this.events[e].length))}emit(e,...t){"object"==typeof this.events[e]&&[...this.events[e]].forEach(r=>r.apply(this,t))}once(e,t){const r=this.on(e,(...i)=>{r(),t.apply(this,i)});return r}}{constructor(){super(...arguments),this.eventEmitProviders=new Map([[mi.INVITE,()=>[this.isInvite,this.emitInvite.bind(this)]],[mi.MESSAGE,()=>[this.isMessage,this.emitMessage.bind(this)]]])}onStateChanged(e,t,r){for(const i of mm(mi))this.emitIfEvent(mi[i],r)}emitIfEvent(e,t){const r=this.eventEmitProviders.get(e);if(r){const[i,a]=r();i(t)&&a(e,t)}}emitClientEvent(e,t,r){this.emit(e,{type:e,content:t,timestamp:r})}isInvite(e){return!!e.rooms&&e.rooms.some(t=>t.status===zr.INVITED)}emitInvite(e,t){t.rooms.filter(r=>r.status===zr.INVITED).map(r=>[r.id,r.members]).forEach(([r,i])=>{this.emitClientEvent(e,{roomId:r,members:i})})}isMessage(e){return!!e.rooms&&e.rooms.some(t=>t.messages.length>0)}emitMessage(e,t){t.rooms.filter(r=>r.messages.length>0).map(r=>r.messages.map(i=>[r.id,i,i.timestamp])).reduce((r,i)=>r.concat(i),[]).forEach(([r,i,a])=>{this.emitClientEvent(e,{roomId:r,message:i},a)})}}var fr=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const xm=new yo("MatrixClient");class Sm{constructor(e,t,r,i,a,h){this.store=e,this.eventEmitter=t,this.userService=r,this.roomService=i,this.eventService=a,this.httpClient=h,this.isActive=!0,this._isReady=new pi,this.store.onStateChanged((v,D,L)=>{this.eventEmitter.onStateChanged(v,D,L)},"rooms")}static create(e){const t=new Yk(e.storage),r=new sB,i=new eB(e.baseUrl),a=new rB(i),h=new tB(i),v=new iB(i);return new Sm(t,r,a,h,v,i)}get joinedRooms(){return new Promise(e=>fr(this,void 0,void 0,function*(){yield this.isConnected(),e(Object.values(this.store.get("rooms")).filter(t=>t.status===zr.JOINED))}))}get invitedRooms(){return new Promise(e=>fr(this,void 0,void 0,function*(){yield this.isConnected(),e(Object.values(this.store.get("rooms")).filter(t=>t.status===zr.INVITED))}))}get leftRooms(){return new Promise(e=>fr(this,void 0,void 0,function*(){yield this.isConnected(),e(Object.values(this.store.get("rooms")).filter(t=>t.status===zr.LEFT))}))}start(e){return fr(this,void 0,void 0,function*(){const t=yield this.userService.login(e.id,e.password,e.deviceId);yield this.store.update({accessToken:t.access_token});const r=new Promise((i,a)=>fr(this,void 0,void 0,function*(){yield this.poll(0,h=>fr(this,void 0,void 0,function*(){this.store.get("isRunning")||i(),yield this.store.update({isRunning:!0,syncToken:h.next_batch,pollingTimeout:3e4,pollingRetries:0,rooms:xr.fromSync(h.rooms)})}),h=>fr(this,void 0,void 0,function*(){this.store.get("isRunning")||a(h),yield this.store.update({isRunning:!1,pollingRetries:this.store.get("pollingRetries")+1})}))}));return r.then(()=>{this._isReady.resolve()}).catch(console.error),r})}isConnected(){return fr(this,void 0,void 0,function*(){return this._isReady.promise})}stop(){return fr(this,void 0,void 0,function*(){return xm.log("MATRIX CLIENT STOPPED"),this.isActive=!1,this._isReady=new pi,this.httpClient.cancelAllRequests()})}subscribe(e,t){this.eventEmitter.on(e,t)}unsubscribe(e,t){t&&this.eventEmitter.removeListener(e,t)}unsubscribeAll(e){this.eventEmitter.removeListener(e)}getRoomById(e){return fr(this,void 0,void 0,function*(){return yield this.isConnected(),this.store.getRoom(e)})}createTrustedPrivateRoom(...e){return fr(this,void 0,void 0,function*(){return yield this.isConnected(),this.requiresAuthorization("createRoom",t=>fr(this,void 0,void 0,function*(){return(yield this.roomService.createRoom(t,{room_version:"5",invite:e,preset:"public_chat",is_direct:!0})).room_id}))})}inviteToRooms(e,...t){return fr(this,void 0,void 0,function*(){yield this.isConnected(),yield this.requiresAuthorization("invite",r=>Promise.all(t.map(i=>{const a=this.store.getRoom(i);this.roomService.inviteToRoom(r,e,a).catch(h=>xm.warn("inviteToRooms",h))})))})}joinRooms(...e){return fr(this,void 0,void 0,function*(){yield this.isConnected(),yield this.requiresAuthorization("join",t=>Promise.all(e.map(r=>{const i=this.store.getRoom(r);return this.roomService.joinRoom(t,i)})))})}sendTextMessage(e,t){return fr(this,void 0,void 0,function*(){yield this.isConnected(),yield this.requiresAuthorization("send",r=>fr(this,void 0,void 0,function*(){const i=yield this.createTxnId();return this.eventService.sendMessage(r,e,{msgtype:"m.text",body:t},i)}))})}poll(e,t,r){return fr(this,void 0,void 0,function*(){const i=this.store,a=this.sync.bind(this),h=(v,D)=>fr(this,void 0,void 0,function*(){let L=0;try{const j=yield a();t(j)}catch(j){r(j),L=i.get("pollingRetries"),this.isActive&&xm.log(`Retry syncing... ${L} retries so far`)}finally{this.isActive?setTimeout(()=>fr(this,void 0,void 0,function*(){yield h(v,D)}),L>3?5e3+e:e):D(new Error("Syncing stopped manually."))}});return new Promise(h)})}sync(){return fr(this,void 0,void 0,function*(){return this.requiresAuthorization("sync",e=>fr(this,void 0,void 0,function*(){return this.eventService.sync(e,{pollingTimeout:this.store.get("pollingTimeout"),syncToken:this.store.get("syncToken")})}))})}requiresAuthorization(e,t){return fr(this,void 0,void 0,function*(){const r=this.store.get("accessToken");return r?t(r):Promise.reject(`${e} requires authorization but no access token has been provided.`)})}createTxnId(){return fr(this,void 0,void 0,function*(){const e=(new Date).getTime(),t=this.store.get("txnNo");return yield this.store.update({txnNo:t+1}),`m${e}.${t}`})}}var Tn=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const Ht=new yo("P2PCommunicationClient"),R3={[xh.EUROPE_WEST]:["beacon-node-1.diamond.papers.tech","beacon-node-1.sky.papers.tech","beacon-node-2.sky.papers.tech","beacon-node-1.hope.papers.tech","beacon-node-1.hope-2.papers.tech","beacon-node-1.hope-3.papers.tech","beacon-node-1.hope-4.papers.tech","beacon-node-1.hope-5.papers.tech"]};class uB extends class Kk{constructor(e){this.keyPair=e,this.eventHandlers=new Map}getPublicKey(){var e;return ic(this,void 0,void 0,function*(){return fs(null===(e=this.keyPair)||void 0===e?void 0:e.publicKey)})}getPublicKeyHash(){return ic(this,void 0,void 0,function*(){return Cl(this.keyPair.publicKey)})}createCryptoBoxServer(e,t){return ic(this,void 0,void 0,function*(){return(0,T3.serverSessionKeys)({publicKey:(0,mo.SH)(t.publicKey),secretKey:(0,mo.zh)(t.secretKey)},(0,mo.SH)(Buffer.from(e,"hex")))})}createCryptoBoxClient(e,t){return ic(this,void 0,void 0,function*(){return(0,T3.clientSessionKeys)({publicKey:(0,mo.SH)(t.publicKey),secretKey:(0,mo.zh)(t.secretKey)},(0,mo.SH)(Buffer.from(e,"hex")))})}encryptMessageAsymmetric(e,t){return ic(this,void 0,void 0,function*(){return function Mk(n,e){return vo(this,void 0,void 0,function*(){const t=(0,mo.SH)(Buffer.from(e)),r=(0,ec.generateKeyPair)(),a=new cs.BLAKE2b(24).update(r.publicKey,32).update(t,32).digest(),h="string"==typeof n?(0,Sl.cv)(n):n,v=(0,ec.box)(t,r.secretKey,a,h);return fs((0,bk.z)(r.publicKey,v))})}(t,Buffer.from(e,"hex"))})}}{constructor(e,t,r,i,a,h,v){super(t),this.name=e,this.replicationCount=r,this.storage=i,this.iconUrl=h,this.appUrl=v,this.client=new pi,this.activeListeners=new Map,this.ignoredRooms=[],this.loginCounter=0,Ht.log("constructor","P2PCommunicationClient created"),this.ENABLED_RELAY_SERVERS=R3,a&&(this.ENABLED_RELAY_SERVERS=Object.assign(Object.assign({},R3),a))}getPairingRequestInfo(){return Tn(this,void 0,void 0,function*(){const e={id:yield bm(),type:"p2p-pairing-request",name:this.name,version:"3",publicKey:yield this.getPublicKey(),relayServer:(yield this.getRelayServer()).server};return this.iconUrl&&(e.icon=this.iconUrl),this.appUrl&&(e.appUrl=this.appUrl),e})}getPairingResponseInfo(e){return Tn(this,void 0,void 0,function*(){const t={id:e.id,type:"p2p-pairing-response",name:this.name,version:e.version,publicKey:yield this.getPublicKey(),relayServer:(yield this.getRelayServer()).server};return this.iconUrl&&(t.icon=this.iconUrl),this.appUrl&&(t.appUrl=this.appUrl),t})}findBestRegion(){return Tn(this,void 0,void 0,function*(){if(this.selectedRegion)return this.selectedRegion;const e=Object.keys(this.ENABLED_RELAY_SERVERS),t=[];e.forEach(i=>{var a;const h=null!==(a=this.ENABLED_RELAY_SERVERS[i])&&void 0!==a?a:[];if(0===h.length)return;const v=Math.floor(Math.random()*h.length);t.push(this.getBeaconInfo(h[v]).then(D=>({region:i,server:h[v],response:D})).catch(D=>new Promise((L,j)=>{setTimeout(()=>j(D),2e3)})))});const r=yield Promise.race(t);return this.selectedRegion=r.region,r.region})}getRelayServer(){return Tn(this,void 0,void 0,function*(){if(this.relayServer){const a=yield this.relayServer.promise;if(Date.now()-a.localTimestamp<6e4)return{server:a.server,timestamp:a.timestamp};const h=yield this.getBeaconInfo(a.server);return this.relayServer.resolve({server:a.server,timestamp:h.timestamp,localTimestamp:(new Date).getTime()}),{server:a.server,timestamp:h.timestamp}}this.relayServer=new pi;const e=yield this.storage.get(nn.MATRIX_SELECTED_NODE);if(e&&e.length>0){const a=yield this.getBeaconInfo(e);return this.relayServer.resolve({server:e,timestamp:a.timestamp,localTimestamp:(new Date).getTime()}),{server:e,timestamp:a.timestamp}}const t=yield this.findBestRegion(),r=this.ENABLED_RELAY_SERVERS[t];if(!r)throw new Error(`No servers found for region ${t}`);const i=[...r];for(;i.length>0;){const a=Math.floor(Math.random()*i.length),h=i[a];try{const v=yield this.getBeaconInfo(h);return this.storage.set(nn.MATRIX_SELECTED_NODE,h).catch(D=>Ht.log(D)),this.relayServer.resolve({server:h,timestamp:v.timestamp,localTimestamp:(new Date).getTime()}),{server:h,timestamp:v.timestamp}}catch(v){Ht.log(`Ignoring server "${h}", trying another one...`),i.splice(a,1)}}throw this.relayServer.reject("No matrix server reachable!"),new Error("No matrix server reachable!")})}getBeaconInfo(e){return Tn(this,void 0,void 0,function*(){return oc().get(`https://${e}/_synapse/client/beacon/info`).then(t=>({region:t.data.region,known_servers:t.data.known_servers,timestamp:Math.floor(t.data.timestamp)}))})}tryJoinRooms(e,t=1){return Tn(this,void 0,void 0,function*(){try{yield(yield this.client.promise).joinRooms(e)}catch(r){t<=10&&"M_FORBIDDEN"===r.errcode?(Ht.log("Retrying to join...",r),setTimeout(()=>Tn(this,void 0,void 0,function*(){yield this.tryJoinRooms(e,t+1)}),200)):Ht.log(`Failed to join after ${t} tries.`,r)}})}start(){var e,t;return Tn(this,void 0,void 0,function*(){Ht.log("start","starting client"),Ht.log("start","connecting to server");const r=yield this.getRelayServer(),i=Sm.create({baseUrl:`https://${r.server}`,storage:this.storage});if(this.initialListener=j=>Tn(this,void 0,void 0,function*(){this.initialEvent&&this.initialEvent.timestamp&&j&&j.timestamp?this.initialEvent.timestampTn(this,void 0,void 0,function*(){let Q;1===j.content.members.length&&(Q=j.content.members[0]),yield this.tryJoinRooms(j.content.roomId),Q&&(yield this.updateRelayServer(Q),yield this.updatePeerRoom(Q,j.content.roomId))})),!r.timestamp)throw new Error("No timestamp received from relay server");const a=Math.floor(r.timestamp),h=`login:${Math.floor(a/300)}`;Ht.log("start",`login ${h}, ${yield this.getPublicKeyHash()} on ${r.server}`);const v=(0,cs.hash)((0,Sl.cv)(h),32),D=null!==(e=this.keyPair.secretKey)&&void 0!==e?e:this.keyPair.privateKey,L=(0,mo.Xx)(D,v);try{yield i.start({id:yield this.getPublicKeyHash(),password:`ed:${fs(L)}:${yield this.getPublicKey()}`,deviceId:fs(this.keyPair.publicKey)})}catch(j){if(Ht.error("start","Could not log in, retrying"),yield this.reset(),!this.selectedRegion)throw new Error("No region selected.");if(this.loginCounter<=(null!==(t=this.ENABLED_RELAY_SERVERS[this.selectedRegion])&&void 0!==t?t:[]).length)return this.loginCounter++,void this.start();throw Ht.error("start","Tried to log in to every known beacon node, but no login was successful."),new Error("Could not connect to any beacon nodes. Try again later.")}Ht.log("start","login successful, client is ready"),this.client.resolve(i)})}stop(){return Tn(this,void 0,void 0,function*(){Ht.log("stop","stopping client"),this.client.isResolved()&&(yield(yield this.client.promise).stop().catch(e=>Ht.error(e))),yield this.reset()})}reset(){return Tn(this,void 0,void 0,function*(){Ht.log("reset","resetting connection"),yield this.storage.delete(nn.MATRIX_PEER_ROOM_IDS).catch(e=>Ht.log(e)),yield this.storage.delete(nn.MATRIX_PRESERVED_STATE).catch(e=>Ht.log(e)),yield this.storage.delete(nn.MATRIX_SELECTED_NODE).catch(e=>Ht.log(e)),this.relayServer=void 0,this.client=new pi,this.initialEvent=void 0,this.initialListener=void 0})}listenForEncryptedMessage(e,t){return Tn(this,void 0,void 0,function*(){if(this.activeListeners.has(e))return;Ht.log("listenForEncryptedMessage",`start listening for encrypted messages from publicKey ${e}`);const r=yield this.createCryptoBoxServer(e,this.keyPair),i=v=>Tn(this,void 0,void 0,function*(){if(this.isTextMessage(v.content)&&(yield this.isSender(v,e))){let D;yield this.updateRelayServer(v.content.message.sender),yield this.updatePeerRoom(v.content.message.sender,v.content.roomId);try{D=Buffer.from(v.content.message.content,"hex")}catch(L){}if(D&&D.length>=40)try{const L=yield function wk(n,e){return vo(this,void 0,void 0,function*(){const t=n.slice(0,24),r=n.slice(24),i=(0,ec.openSecretBox)(e,t,r);if(!i)throw new Error("Decryption failed");return Buffer.from(i).toString("utf8")})}(D,r.receive);Ht.log("listenForEncryptedMessage",`received a message from ${e}`,L),t(L)}catch(L){}}});this.activeListeners.set(e,i),(yield this.client.promise).subscribe(mi.MESSAGE,i);const a=this.initialEvent;a&&a.timestamp&&(new Date).getTime()-a.timestamp<3e5?(Ht.log("listenForEncryptedMessage","Handling previous event"),yield i(a)):Ht.log("listenForEncryptedMessage","No previous event found");const h=this.initialListener;h&&(yield this.client.promise).unsubscribe(mi.MESSAGE,h),this.initialListener=void 0,this.initialEvent=void 0})}unsubscribeFromEncryptedMessage(e){return Tn(this,void 0,void 0,function*(){const t=this.activeListeners.get(e);!t||((yield this.client.promise).unsubscribe(mi.MESSAGE,t),this.activeListeners.delete(e))})}unsubscribeFromEncryptedMessages(){return Tn(this,void 0,void 0,function*(){(yield this.client.promise).unsubscribeAll(mi.MESSAGE),this.activeListeners.clear()})}sendMessage(e,t){return Tn(this,void 0,void 0,function*(){const r=yield this.createCryptoBoxClient(t.publicKey,this.keyPair),a=_3(yield Cl(Buffer.from(t.publicKey,"hex")),t.relayServer),h=yield this.getRelevantRoom(a);yield this.waitForJoin(h);const v=yield function _k(n,e){return vo(this,void 0,void 0,function*(){const t=Buffer.from((0,y3.randomBytes)(24));return fs(Buffer.concat([t,Buffer.from((0,ec.secretBox)(e,t,Buffer.from(n,"utf8")))]))})}(e,r.send);Ht.log("sendMessage","sending encrypted message",t.publicKey,h,e),(yield this.client.promise).sendTextMessage(h,v).catch(D=>Tn(this,void 0,void 0,function*(){if("M_FORBIDDEN"===D.errcode){Ht.log("sendMessage","M_FORBIDDEN",h,D),yield this.deleteRoomIdFromRooms(h);const L=yield this.getRelevantRoom(a);Ht.log("sendMessage","Old room deleted, new room created",L),(yield this.client.promise).sendTextMessage(L,v).catch(j=>Tn(this,void 0,void 0,function*(){Ht.log("sendMessage","inner error",L,j)}))}else Ht.log("sendMessage","unexpected error",D)}))})}updatePeerRoom(e,t){return Tn(this,void 0,void 0,function*(){Ht.log("updatePeerRoom",e,t);const r=e.split(":");if(r.length<2||!r[0].startsWith("@"))throw new Error("Invalid sender");const i=yield this.storage.get(nn.MATRIX_PEER_ROOM_IDS),a=i[e];a===t&&Ht.debug("updatePeerRoom","rooms are the same, not updating"),Ht.debug("updatePeerRoom","current room",a,"new room",t),a&&a[1]&&(Ht.log("updatePeerRoom",`adding room "${a[1]}" to ignored array`),this.ignoredRooms.push(a[1])),i[e]=t,yield this.storage.set(nn.MATRIX_PEER_ROOM_IDS,i)})}deleteRoomIdFromRooms(e){return Tn(this,void 0,void 0,function*(){const t=yield this.storage.get(nn.MATRIX_PEER_ROOM_IDS),r=Object.entries(t).filter(i=>i[1]!==e).reduce((i,a)=>Object.assign(Object.assign({},i),{[a[0]]:a[1]}),{});yield this.storage.set(nn.MATRIX_PEER_ROOM_IDS,r),this.ignoredRooms.push(e)})}listenForChannelOpening(e){return Tn(this,void 0,void 0,function*(){Ht.debug("listenForChannelOpening"),(yield this.client.promise).subscribe(mi.MESSAGE,t=>Tn(this,void 0,void 0,function*(){if(this.isTextMessage(t.content)&&(yield this.isChannelOpenMessage(t.content))){Ht.log("listenForChannelOpening","channel opening received, trying to decrypt",JSON.stringify(t)),yield this.updateRelayServer(t.content.message.sender),yield this.updatePeerRoom(t.content.message.sender,t.content.roomId);const r=t.content.message.content.split(":"),i=Buffer.from(r[r.length-1],"hex");if(i.length>=40)try{const a=JSON.parse(yield function Ek(n,e,t){return vo(this,void 0,void 0,function*(){const r=(0,mo.zh)(Buffer.from(t)),i=(0,mo.SH)(Buffer.from(e)),a="string"==typeof n?(0,Sl.cv)(n):n,h=a.slice(0,32),v=a.slice(32),L=new cs.BLAKE2b(24).update(h,32).update(i,32).digest(),j=(0,ec.openBox)(h,r,L,v);if(!j)throw new Error("Decryption failed");return Buffer.from(j).toString()})}(i,this.keyPair.publicKey,this.keyPair.secretKey));Ht.log("listenForChannelOpening","channel opening received and decrypted",JSON.stringify(a)),e(Object.assign(Object.assign({},a),{senderId:yield Tl(a.publicKey)}))}catch(a){}}}))})}waitForJoin(e,t=0){return Tn(this,void 0,void 0,function*(){const r=yield(yield this.client.promise).getRoomById(e);if(Ht.log("waitForJoin",`Currently ${r.members.length} members, we need at least 2`),!(r.members.length>=2)){if(t<=200)return Ht.log(`Waiting for join... Try: ${t}`),new Promise(i=>{setTimeout(()=>Tn(this,void 0,void 0,function*(){i(this.waitForJoin(e,t+1))}),100*(t>50?10:1))});throw new Error(`No one joined after ${t} tries.`)}})}sendPairingResponse(e){return Tn(this,void 0,void 0,function*(){Ht.log("sendPairingResponse");const r=_3(yield Cl(Buffer.from(e.publicKey,"hex")),e.relayServer),i=yield(yield this.client.promise).createTrustedPrivateRoom(r);Ht.debug("sendPairingResponse",`Connecting to room "${i}"`),yield this.updatePeerRoom(r,i),yield this.waitForJoin(i),Ht.debug("sendPairingResponse","Successfully joined room.");const a=void 0===e.version?yield this.getPublicKey():JSON.stringify(yield this.getPairingResponseInfo(e));Ht.debug("sendPairingResponse","Sending pairing response",a);const h=yield this.encryptMessageAsymmetric(e.publicKey,a),v=["@channel-open",r,h].join(":");(yield this.client.promise).sendTextMessage(i,v).catch(D=>Tn(this,void 0,void 0,function*(){if("M_FORBIDDEN"===D.errcode){Ht.log("sendPairingResponse","M_FORBIDDEN",i,D),yield this.deleteRoomIdFromRooms(i);const L=yield this.getRelevantRoom(r);Ht.log("sendPairingResponse","Old room deleted, new room created",L),(yield this.client.promise).sendTextMessage(L,v).catch(j=>Tn(this,void 0,void 0,function*(){Ht.log("sendPairingResponse","inner error",L,j)}))}else Ht.log("sendPairingResponse","unexpected error",D)}))})}isTextMessage(e){return e.message.type===sc.TEXT}updateRelayServer(e){return Tn(this,void 0,void 0,function*(){Ht.log("updateRelayServer",e);const t=e.split(":");if(t.length<2||!t[0].startsWith("@"))throw new Error("Invalid sender");const r=t.shift(),i=t.join(":"),a=localStorage.getItem("beacon:communication-peers-dapp")?new wm(this.storage,nn.TRANSPORT_P2P_PEERS_DAPP):new wm(this.storage,nn.TRANSPORT_P2P_PEERS_WALLET),v=(yield a.getPeers()).map(D=>Tn(this,void 0,void 0,function*(){`@${yield Cl(Buffer.from(D.publicKey,"hex"))}`===r&&D.relayServer!==i&&(D.relayServer=i,yield a.addPeer(D))}));yield Promise.all(v)})}isChannelOpenMessage(e){return Tn(this,void 0,void 0,function*(){return e.message.content.startsWith(`@channel-open:@${yield Cl(Buffer.from(yield this.getPublicKey(),"hex"))}`)})}isSender(e,t){return Tn(this,void 0,void 0,function*(){return e.content.message.sender.startsWith(`@${yield Cl(Buffer.from(t,"hex"))}`)})}getRelevantRoom(e){return Tn(this,void 0,void 0,function*(){const t=yield this.storage.get(nn.MATRIX_PEER_ROOM_IDS);let r=t[e];if(!r){Ht.log("getRelevantRoom",`No room found for peer ${e}, checking joined ones.`);const i=yield this.getRelevantJoinedRoom(e);r=i.id,t[e]=i.id,yield this.storage.set(nn.MATRIX_PEER_ROOM_IDS,t)}return Ht.log("getRelevantRoom",`Using room ${r}`),r})}getRelevantJoinedRoom(e){return Tn(this,void 0,void 0,function*(){const t=yield(yield this.client.promise).joinedRooms;Ht.log("checking joined rooms",t,e);const r=t.filter(a=>!this.ignoredRooms.some(h=>a.id===h)).filter(a=>a.members.some(h=>h===e));let i;if(0===r.length||this.ignoredRooms.length>0){Ht.log("getRelevantJoinedRoom","no relevant rooms found, creating new one");const a=yield(yield this.client.promise).createTrustedPrivateRoom(e);i=yield(yield this.client.promise).getRoomById(a),Ht.log("getRelevantJoinedRoom",`waiting for other party to join room: ${i.id}`),yield this.waitForJoin(a),Ht.log("getRelevantJoinedRoom",`new room created and peer invited: ${i.id}`)}else i=r[0],Ht.log("getRelevantJoinedRoom",`channel already open, reusing room ${i.id}`);return i})}}var ma=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const Cm=new yo("P2PTransport");class hB extends class cB extends class Vk{constructor(e,t,r){this.type=Yu.POST_MESSAGE,this._isConnected=Uo.NOT_CONNECTED,this.listeners=[],this.name=e,this.client=t,this.peerManager=r}setEventHandler(e,t){this.client.eventHandlers.set(e,t)}get connectionStatus(){return this._isConnected}static isAvailable(){return bo(this,void 0,void 0,function*(){return Promise.resolve(!1)})}connect(){return bo(this,void 0,void 0,function*(){hs.log("connect"),this._isConnected=Uo.CONNECTED})}disconnect(){return bo(this,void 0,void 0,function*(){hs.log("disconnect"),this._isConnected=Uo.NOT_CONNECTED})}send(e,t){return bo(this,void 0,void 0,function*(){if(t)return this.client.sendMessage(e,t);{const i=(yield this.getPeers()).map(a=>this.client.sendMessage(e,a));return(yield Promise.all(i))[0]}})}addListener(e){return bo(this,void 0,void 0,function*(){hs.debug("addListener"),this.listeners.push(e)})}removeListener(e){return bo(this,void 0,void 0,function*(){hs.log("removeListener"),this.listeners=this.listeners.filter(t=>t!==e)})}getPeers(){return bo(this,void 0,void 0,function*(){return this.peerManager.getPeers()})}addPeer(e,t=!0){return bo(this,void 0,void 0,function*(){hs.log("addPeer","adding peer",e),yield this.peerManager.addPeer(e),yield this.listen(e.publicKey)})}removePeer(e){return bo(this,void 0,void 0,function*(){hs.log("removePeer","removing peer",e),yield this.peerManager.removePeer(e.publicKey),this.client&&(yield this.client.unsubscribeFromEncryptedMessage(e.publicKey))})}removeAllPeers(){return bo(this,void 0,void 0,function*(){hs.log("removeAllPeers"),yield this.peerManager.removeAllPeers(),this.client&&(yield this.client.unsubscribeFromEncryptedMessages())})}notifyListeners(e,t){return bo(this,void 0,void 0,function*(){0===this.listeners.length?hs.warn("notifyListeners","0 listeners notified!",this):hs.log("notifyListeners",`Notifying ${this.listeners.length} listeners`,this),this.listeners.forEach(r=>{r(e,t)})})}}{constructor(e,t,r,i,a,h,v){super(e,new uB(e,t,1,r,i,h,v),new wm(r,a)),this.type=Yu.P2P}static isAvailable(){return ma(this,void 0,void 0,function*(){return Promise.resolve(!0)})}connect(){const e=Object.create(null,{connect:{get:()=>super.connect}});return ma(this,void 0,void 0,function*(){if(this._isConnected!==Uo.NOT_CONNECTED)return;Cm.log("connect"),this._isConnected=Uo.CONNECTING,yield this.client.start();const t=yield this.getPeers();if(t.length>0){Cm.log("connect",`connecting to ${t.length} peers`);const r=t.map(i=>ma(this,void 0,void 0,function*(){return this.listen(i.publicKey)}));Promise.all(r).catch(i=>Cm.error("connect",i))}return yield this.startOpenChannelListener(),e.connect.call(this)})}disconnect(){const e=Object.create(null,{disconnect:{get:()=>super.disconnect}});return ma(this,void 0,void 0,function*(){return yield this.client.stop(),e.disconnect.call(this)})}startOpenChannelListener(){return ma(this,void 0,void 0,function*(){})}getPairingRequestInfo(){return ma(this,void 0,void 0,function*(){return this.client.getPairingRequestInfo()})}listen(e){return ma(this,void 0,void 0,function*(){yield this.client.listenForEncryptedMessage(e,t=>{this.notifyListeners(t,{origin:Eh.P2P,id:e}).catch(i=>{throw i})}).catch(t=>{throw t})})}}{constructor(e,t,r,i,a,h){super(e,t,r,i,nn.TRANSPORT_P2P_PEERS_WALLET,a,h)}addPeer(e,t=!0){const r=Object.create(null,{addPeer:{get:()=>super.addPeer}});return function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){yield r.addPeer.call(this,e),t&&(yield this.client.sendPairingResponse(e))})}}var Nh=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const O3=new yo("IncomingRequestInterceptor");class Rs{static intercept(e){return Nh(this,void 0,void 0,function*(){console.log("INTERCEPTING REQUEST",e.message),"2"===e.message.version?Rs.handleV2Message(e):"3"===e.message.version&&Rs.handleV3Message(e)})}static getAppMetadata(e,t){return Nh(this,void 0,void 0,function*(){const r=yield e.getAppMetadata(t);if(!r)throw new Error("AppMetadata not found");return r})}static handleV2Message(e){return Nh(this,void 0,void 0,function*(){const{message:t,connectionInfo:r,appMetadataManager:i,interceptorCallback:a}=e;switch(t.type){case wn.PermissionRequest:console.log("PERMISSION REQUEST V*",t),t.appMetadata.beaconId&&!t.appMetadata.senderId&&(t.appMetadata.senderId=t.appMetadata.beaconId,delete t.appMetadata.beaconId),yield i.addAppMetadata(t.appMetadata),a(t,r);break;case wn.OperationRequest:{const h=yield Rs.getAppMetadata(i,t.senderId);a(Object.assign({appMetadata:h},t),r)}break;case wn.SignPayloadRequest:{const h=yield Rs.getAppMetadata(i,t.senderId);a(Object.assign({appMetadata:h},t),r)}break;case wn.BroadcastRequest:{const h=yield Rs.getAppMetadata(i,t.senderId);a(Object.assign({appMetadata:h},t),r)}break;default:O3.log("intercept","Message not handled"),P3()}})}static handleV3Message(e){return Nh(this,void 0,void 0,function*(){const{message:t,connectionInfo:r,appMetadataManager:i,interceptorCallback:a}=e,h=t,v=h.message;switch(v.type){case wn.PermissionRequest:yield i.addAppMetadata(Object.assign(Object.assign({},v.blockchainData.appMetadata),{senderId:t.senderId})),a(h,r);break;case wn.BlockchainRequest:a(Object.assign({},h),r);break;default:O3.log("intercept","Message not handled"),P3()}})}}function P3(n){throw new Error("Function not implemented.")}var Am=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const N3=new yo("OutgoingResponseInterceptor");class lc{static intercept(e){return Am(this,void 0,void 0,function*(){"2"===e.request.version?lc.handleV2Message(e):"3"===e.request.version&&lc.handleV3Message(e)})}static handleV3Message(e){return Am(this,void 0,void 0,function*(){const{message:t,appMetadataManager:r,interceptorCallback:i}=e;console.log("LOGGING OUTGOING V3",t.message,r),i(t)})}static handleV2Message(e){return Am(this,void 0,void 0,function*(){const{senderId:t,request:r,message:i,ownAppMetadata:a,permissionManager:h,appMetadataManager:v,interceptorCallback:D}=e;switch(i.type){case wn.Error:{const L={type:i.type,version:"2",senderId:t,id:i.id,errorType:i.errorType};if(i.errorType===as.TRANSACTION_INVALID_ERROR&&i.errorData){const j=i.errorData;Array.isArray(j)&&j.every(Q=>Boolean(Q.kind)&&Boolean(Q.id))?L.errorData=i.errorData:N3.warn("ErrorData provided is not in correct format. It needs to be an array of RPC errors. It will not be included in the message sent to the dApp")}D(L);break}case wn.Acknowledge:D({type:i.type,version:"2",senderId:t,id:i.id});break;case wn.PermissionResponse:{const L=Object.assign({senderId:t,version:"2",appMetadata:a},i),j=L.publicKey,Q=yield function xk(n){return vo(this,void 0,void 0,function*(){const e={edpk:{length:54,prefix:Buffer.from(new Uint8Array([6,161,159]))},sppk:{length:55,prefix:Buffer.from(new Uint8Array([6,161,161]))},p2pk:{length:55,prefix:Buffer.from(new Uint8Array([6,161,164]))}};let t,r;if(64===n.length)t=e.edpk.prefix,r=n;else{const a=Object.entries(e);for(let h=0;h{this._beaconId.resolve(fs(e.publicKey))})})}removeBeaconEntriesFromStorage(){return Th(this,void 0,void 0,function*(){const e=Object.values(nn);yield Promise.all(e.map(t=>this.storage.delete(t)))})}loadOrCreateBeaconSecret(){return Th(this,void 0,void 0,function*(){const e=yield this.storage.get(nn.BEACON_SDK_SECRET_SEED);if(e&&"string"==typeof e)this._keyPair.resolve(yield b3(e));else{const t=yield bm();yield this.storage.set(nn.BEACON_SDK_SECRET_SEED,t),this._keyPair.resolve(yield b3(t))}})}}{constructor(e){var t;super(e),this.rateLimit=2,this.rateLimitWindowInSeconds=5,this.requestCounter=[],this._transport=new pi,this.accountManager=new Nk(e.storage),this.matrixNodes=null!==(t=e.matrixNodes)&&void 0!==t?t:{},this.handleResponse=(r,i)=>{throw new Error(`not overwritten${JSON.stringify(r)} - ${JSON.stringify(i)}`)}}get transport(){return this._transport.promise}get connectionStatus(){var e,t;return null!==(t=null===(e=this._transport.promiseResult)||void 0===e?void 0:e.connectionStatus)&&void 0!==t?t:Uo.NOT_CONNECTED}get ready(){return this.transport.then(()=>{})}getAccounts(){return gi(this,void 0,void 0,function*(){return this.accountManager.getAccounts()})}getAccount(e){return gi(this,void 0,void 0,function*(){return this.accountManager.getAccount(e)})}removeAccount(e){return gi(this,void 0,void 0,function*(){return this.accountManager.removeAccount(e)})}removeAllAccounts(){return gi(this,void 0,void 0,function*(){return this.accountManager.removeAllAccounts()})}addRequestAndCheckIfRateLimited(){return gi(this,void 0,void 0,function*(){const e=(new Date).getTime();return this.requestCounter=this.requestCounter.filter(t=>t+1e3*this.rateLimitWindowInSeconds>e),this.requestCounter.push(e),this.requestCounter.length>this.rateLimit})}init(e){return gi(this,void 0,void 0,function*(){return this._transport.status===go.RESOLVED?(yield this.transport).type:(yield this.setTransport(e),e.type)})}getOwnAppMetadata(){return gi(this,void 0,void 0,function*(){return{senderId:yield Tl(yield this.beaconId),name:this.name,icon:this.iconUrl}})}getPeers(){return gi(this,void 0,void 0,function*(){return(yield this.transport).getPeers()})}addPeer(e){return gi(this,void 0,void 0,function*(){return(yield this.transport).addPeer(e)})}destroy(){const e=Object.create(null,{destroy:{get:()=>super.destroy}});return gi(this,void 0,void 0,function*(){this._transport.status===go.RESOLVED&&(yield(yield this.transport).disconnect()),yield e.destroy.call(this)})}setTransport(e){return gi(this,void 0,void 0,function*(){e?this._transport.isSettled()?this._transport=pi.resolve(e):this._transport.resolve(e):this._transport.isSettled()&&(this._transport=new pi)})}addListener(e){return gi(this,void 0,void 0,function*(){e.addListener((t,r)=>gi(this,void 0,void 0,function*(){if("string"==typeof t){const i=yield(new rc).deserialize(t);this.handleResponse(i,r)}})).catch(t=>Uk.error("addListener",t))})}sendDisconnectToPeer(e,t){return gi(this,void 0,void 0,function*(){const r={id:yield bm(),version:e.version,senderId:yield Tl(yield this.beaconId),type:wn.Disconnect},i=yield(new rc).serialize(r);yield(null!=t?t:yield this.transport).send(i,e)})}}{constructor(e){super(Object.assign({storage:e&&e.storage?e.storage:new jk},e)),this._isConnected=new pi,this.pendingRequests=[],this.permissionManager=new Gk(this.storage),this.appMetadataManager=new zk(this.storage)}get isConnected(){return this._isConnected.promise}init(){const e=Object.create(null,{init:{get:()=>super.init}});return tr(this,void 0,void 0,function*(){const t=yield this.keyPair,r=new hB(this.name,t,this.storage,this.matrixNodes,this.iconUrl,this.appUrl);return e.init.call(this,r)})}connect(e){return tr(this,void 0,void 0,function*(){return this.handleResponse=(t,r)=>tr(this,void 0,void 0,function*(){if("3"===t.version){const i=t;if(i.message.type===wn.Disconnect)return this.disconnect(i.senderId);this.pendingRequests.some(a=>a[0].id===t.id)||(this.pendingRequests.push([i,r]),yield this.sendAcknowledgeResponse(i,r),yield Rs.intercept({message:i,connectionInfo:r,appMetadataManager:this.appMetadataManager,interceptorCallback:e}))}else{const i=t;if(i.type===wn.Disconnect)return this.disconnect(i.senderId);this.pendingRequests.some(a=>a[0].id===t.id)||(this.pendingRequests.push([i,r]),"1"!==i.version&&(yield this.sendAcknowledgeResponse(i,r)),yield Rs.intercept({message:i,connectionInfo:r,appMetadataManager:this.appMetadataManager,interceptorCallback:e}))}}),this._connect()})}getRegisterPushChallenge(e,t,r=E3){return tr(this,void 0,void 0,function*(){const i=(yield oc().get(`${r}/challenge`)).data,h=fs(["Tezos Signed Message: ",i.id,i.timestamp,t,e].join(" "));return{challenge:i,payloadToSign:"0501"+h.length.toString(16).padStart(8,"0")+h}})}registerPush(e,t,r,i,a,h,v=E3){return tr(this,void 0,void 0,function*(){const D=yield this.storage.get(nn.PUSH_TOKENS),L=D.find(me=>me.publicKey===i&&me.backendUrl===r);if(L)return L;const j=(yield oc().post(`${v}/register`,{name:this.name,challenge:e,accountPublicKey:i,signature:t,backendUrl:r,protocolIdentifier:a,deviceId:h})).data,Q={publicKey:i,backendUrl:r,accessToken:j.accessToken,managementToken:j.managementToken};return D.push(Q),yield this.storage.set(nn.PUSH_TOKENS,D),Q})}_connect(){return tr(this,void 0,void 0,function*(){const e=yield this.transport;e.connectionStatus===Uo.NOT_CONNECTED&&(yield e.connect(),e.addListener((t,r)=>tr(this,void 0,void 0,function*(){if("string"==typeof t){const i=yield(new rc).deserialize(t);this.handleResponse(i,r)}})).catch(t=>pB.log("_connect",t)),this._isConnected.resolve(!0))})}respond(e){return tr(this,void 0,void 0,function*(){console.log("RESPONSE",e);const t=this.pendingRequests.find(r=>r[0].id===e.id);if(!t)throw new Error("No matching request found!");this.pendingRequests=this.pendingRequests.filter(r=>r[0].id!==e.id),yield lc.intercept({senderId:yield Tl(yield this.beaconId),request:t[0],message:e,ownAppMetadata:yield this.getOwnAppMetadata(),permissionManager:this.permissionManager,appMetadataManager:this.appMetadataManager,interceptorCallback:r=>tr(this,void 0,void 0,function*(){yield this.respondToMessage(r,t[1])})})})}getAppMetadataList(){return tr(this,void 0,void 0,function*(){return this.appMetadataManager.getAppMetadataList()})}getAppMetadata(e){return tr(this,void 0,void 0,function*(){return this.appMetadataManager.getAppMetadata(e)})}removeAppMetadata(e){return tr(this,void 0,void 0,function*(){return this.appMetadataManager.removeAppMetadata(e)})}removeAllAppMetadata(){return tr(this,void 0,void 0,function*(){return this.appMetadataManager.removeAllAppMetadata()})}getPermissions(){return tr(this,void 0,void 0,function*(){return this.permissionManager.getPermissions()})}getPermission(e){return tr(this,void 0,void 0,function*(){return this.permissionManager.getPermission(e)})}removePermission(e){return tr(this,void 0,void 0,function*(){return this.permissionManager.removePermission(e)})}removeAllPermissions(){return tr(this,void 0,void 0,function*(){return this.permissionManager.removeAllPermissions()})}addPeer(e,t=!0){return tr(this,void 0,void 0,function*(){const r=Object.assign(Object.assign({},e),{senderId:yield Tl(e.publicKey)});return(yield this.transport).addPeer(r,t)})}removePeer(e,t=!1){return tr(this,void 0,void 0,function*(){const r=(yield this.transport).removePeer(e);return yield this.removePermissionsForPeers([e]),t&&(yield this.sendDisconnectToPeer(e)),r})}removeAllPeers(e=!1){return tr(this,void 0,void 0,function*(){const t=yield(yield this.transport).getPeers(),r=(yield this.transport).removeAllPeers();if(yield this.removePermissionsForPeers(t),e){const i=t.map(a=>this.sendDisconnectToPeer(a));yield Promise.all(i)}return r})}removePermissionsForPeers(e){return tr(this,void 0,void 0,function*(){const t=yield this.permissionManager.getPermissions(),r=e.map(h=>h.senderId),a=t.filter(h=>r.includes(h.appMetadata.senderId)).map(h=>h.accountIdentifier);yield this.permissionManager.removePermissions(a)})}sendAcknowledgeResponse(e,t){return tr(this,void 0,void 0,function*(){const r={id:e.id,type:wn.Acknowledge};yield lc.intercept({senderId:yield Tl(yield this.beaconId),request:e,message:r,ownAppMetadata:yield this.getOwnAppMetadata(),permissionManager:this.permissionManager,appMetadataManager:this.appMetadataManager,interceptorCallback:i=>tr(this,void 0,void 0,function*(){yield this.respondToMessage(i,t)})})})}respondToMessage(e,t){return tr(this,void 0,void 0,function*(){const r=yield(new rc).serialize(e);if(t){const a=(yield this.getPeers()).find(h=>h.publicKey===t.id);yield(yield this.transport).send(r,a)}else yield(yield this.transport).send(r)})}disconnect(e){return tr(this,void 0,void 0,function*(){const i=(yield(yield this.transport).getPeers()).find(a=>a.senderId===e);i&&(yield this.removePeer(i))})}}var Vr=(()=>(function(n){n.ACCOUNTS="explorer:accounts",n.REQUEST_ID_PREFIX="explorer:req_id_",n.METAMASK_BUSY="explorer:metamask_busy"}(Vr||(Vr={})),Vr))(),kh=(()=>(function(n){n.METAMASK="metamask"}(kh||(kh={})),kh))();let Os=(()=>{class n{constructor(t){var r;this._storage=t,this._accounts$=new Vi([]),this.hasAccounts=!1,this.accounts$=this._accounts$.asObservable();const i=JSON.parse(null!==(r=localStorage.getItem(Vr.ACCOUNTS))&&void 0!==r?r:"[]");this._accounts$.next(i),this.accounts$.subscribe(a=>{this.hasAccounts=a.length>0})}addOrUpdateAccount(t){var r=this;return Ot(function*(){const i=r._accounts$.value;i.every(a=>a.address!==t.address)&&i.push(t),localStorage.setItem(Vr.ACCOUNTS,JSON.stringify(i)),r._accounts$.next(i)})()}removeAccount(t){var r=this;return Ot(function*(){const i=r._accounts$.value.filter(a=>a.address!==t.address);localStorage.setItem(Vr.ACCOUNTS,JSON.stringify(i)),r._accounts$.next(i)})()}disconnect(){var t=this;return Ot(function*(){Object.keys(localStorage).forEach(r=>{r.startsWith("explorer:")&&localStorage.removeItem(r)}),t._accounts$.next([]),t.hasAccounts=!1})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(m3))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const uc="npm:tezos-metamask-snap",mB=function(){var n=Ot(function*(){return yield window.ethereum.request({method:"wallet_getSnaps"})});return function(){return n.apply(this,arguments)}}(),vB=function(){var n=Ot(function*(e=uc,t={}){yield window.ethereum.request({method:"wallet_requestSnaps",params:{[e]:t}})});return function(){return n.apply(this,arguments)}}(),k3=function(){var n=Ot(function*(e){try{const t=yield mB();return Object.values(t).find(r=>r.id===uc&&(!e||r.version===e))}catch(t){return void console.log("Failed to obtain installed snap",t)}});return function(t){return n.apply(this,arguments)}}(),yB=function(){var n=Ot(function*(){const e=yield window.ethereum.request({method:"wallet_invokeSnap",params:{snapId:uc,request:{method:"tezos_getAccount"}}});return console.log("tezos_getAccount",e),{publicKey:null==e?void 0:e.publicKey,address:null==e?void 0:e.address}});return function(){return n.apply(this,arguments)}}(),Tm=function(){var n=Ot(function*(e){const t=yield window.ethereum.request({method:"wallet_invokeSnap",params:{snapId:uc,request:{method:"tezos_sendOperation",params:{payload:e}}}});return console.log("tezos_sendOperation",t),t.opHash});return function(t){return n.apply(this,arguments)}}(),bB=function(){var n=Ot(function*(e){const t=yield window.ethereum.request({method:"wallet_invokeSnap",params:{snapId:uc,request:{method:"tezos_signPayload",params:{payload:e}}}});return console.log("tezos_signPayload",t),t.signature.prefixSig});return function(t){return n.apply(this,arguments)}}();var _o=(()=>(function(n){n.PAGE_OPEN_PING="explorer:evt_page_open_ping",n.PAGE_OPEN_PONG="explorer:evt_page_open_pong",n.CLEAR="explorer:evt_clear"}(_o||(_o={})),_o))();let Dm,B3=(()=>{class n{constructor(){this.clear$=new vn,this.tabWillClose$=new vn,this.tabClosedEventHandlers=[],this.setupListener()}sendEvent(t){localStorage[t]=Date.now()}setupListener(){var t=this;localStorage[_o.PAGE_OPEN_PING]=Date.now();var r=function(){var i=Ot(function*(a){a.key===_o.PAGE_OPEN_PING&&(localStorage[_o.PAGE_OPEN_PONG]=Date.now()),a.key===_o.PAGE_OPEN_PONG&&console.log("Another page was opened"),a.key===_o.CLEAR&&(console.log("CLEAR REQUEST RECEIVED"),t.clear$.next(!0))});return function(h){return i.apply(this,arguments)}}();window.addEventListener("storage",r,!1),window.addEventListener("beforeunload",i=>{this.tabWillClose$.emit(!0),this.tabClosedEventHandlers.forEach(a=>{a()})})}addTabClosedEventHandler(t){this.tabClosedEventHandlers.push(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),_B=(()=>{class n{constructor(){this._focusTrapStack=[]}register(t){this._focusTrapStack=this._focusTrapStack.filter(i=>i!==t);let r=this._focusTrapStack;r.length&&r[r.length-1]._disable(),r.push(t),t._enable()}deregister(t){t._disable();const r=this._focusTrapStack,i=r.indexOf(t);-1!==i&&(r.splice(i,1),r.length&&r[r.length-1]._enable())}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();try{Dm="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){Dm=!1}let L3=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?X2(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!Dm)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(Mt(Au))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),F3=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function MB(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const r=function wB(n){try{return n.frameElement}catch(e){return null}}(function IB(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(r&&(-1===H3(r)||!this.isVisible(r)))return!1;let i=t.nodeName.toLowerCase(),a=H3(t);return t.hasAttribute("contenteditable")?-1!==a:!("iframe"===i||"object"===i||this._platform.WEBKIT&&this._platform.IOS&&!function TB(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===i?!!t.hasAttribute("controls")&&-1!==a:"video"===i?-1!==a&&(null!==a||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,r){return function DB(n){return!function xB(n){return function CB(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function EB(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function SB(n){return function AB(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||U3(n))}(t)&&!this.isDisabled(t)&&((null==r?void 0:r.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Mt(L3))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function U3(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function H3(n){if(!U3(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}function V3(n){return null!=n&&"false"!=`${n}`}class RB{constructor(e,t,r,i,a=!1){this._element=e,this._checker=t,this._ngZone=r,this._document=i,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,a||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement()))})}focusFirstTabbableElementWhenReady(){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement()))})}focusLastTabbableElementWhenReady(){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement()))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let r=0;r=0;r--){let i=t[r].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[r]):null;if(i)return i}return null}_createAnchor(){const e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(sh(1)).subscribe(e)}}let OB=(()=>{class n{constructor(t,r,i){this._checker=t,this._ngZone=r,this._document=i}create(t,r=!1){return new RB(t,this._checker,this._ngZone,this._document,r)}}return n.\u0275fac=function(t){return new(t||n)(Mt(F3),Mt(or),Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),PB=(()=>{class n{constructor(t,r,i){this._elementRef=t,this._focusTrapFactory=r,this._previouslyFocusedElement=null,this._autoCapture=!1,this._document=i,this.focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement,!0)}get enabled(){return this.focusTrap.enabled}set enabled(t){this.focusTrap.enabled=V3(t)}get autoCapture(){return this._autoCapture}set autoCapture(t){this._autoCapture=V3(t)}ngOnDestroy(){this.focusTrap.destroy(),this._previouslyFocusedElement&&(this._previouslyFocusedElement.focus(),this._previouslyFocusedElement=null)}ngAfterContentInit(){this.focusTrap.attachAnchors(),this.autoCapture&&this._captureFocus()}ngDoCheck(){this.focusTrap.hasAttached()||this.focusTrap.attachAnchors()}ngOnChanges(t){const r=t.autoCapture;r&&!r.firstChange&&this.autoCapture&&this.focusTrap.hasAttached()&&this._captureFocus()}_captureFocus(){this._previouslyFocusedElement=this._document.activeElement,this.focusTrap.focusInitialElementWhenReady()}}return n.\u0275fac=function(t){return new(t||n)(ot(kr),ot(OB),ot(wr))},n.\u0275dir=$t({type:n,selectors:[["","focusTrap",""]],inputs:{enabled:["cdkTrapFocus","enabled"],autoCapture:["cdkTrapFocusAutoCapture","autoCapture"]},exportAs:["focusTrap"],features:[qr]}),n})(),j3=(()=>{class n{static forRoot(){return{ngModule:n,providers:[_B,L3,F3]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Pu]]}),n})();const NB=["*"];let Xr=(()=>{class n{constructor(){this.hide=()=>{},this.setClass=()=>{}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})(),$3=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();const Bh={backdrop:!0,keyboard:!0,focus:!0,show:!1,ignoreBackdropClick:!1,class:"",animated:!0,initialState:{},closeInterceptor:void 0},kB=new Kt("override-default-config");let BB=(()=>{class n{constructor(t,r,i){this._element=r,this._renderer=i,this.isShown=!1,this.isAnimated=!1,this.isModalHiding=!1,this.clickStartedInContent=!1,this.config=Object.assign({},t)}ngOnInit(){this.isAnimated&&this._renderer.addClass(this._element.nativeElement,"fade"),this._renderer.setStyle(this._element.nativeElement,"display","block"),setTimeout(()=>{this.isShown=!0,this._renderer.addClass(this._element.nativeElement,gl()?"in":"show")},this.isAnimated?150:0),document&&document.body&&(this.bsModalService&&1===this.bsModalService.getModalsCount()&&(this.bsModalService.checkScrollbar(),this.bsModalService.setScrollbar()),this._renderer.addClass(document.body,"modal-open"),this._renderer.setStyle(document.body,"overflow-y","hidden")),this._element.nativeElement&&this._element.nativeElement.focus()}onClickStarted(t){this.clickStartedInContent=t.target!==this._element.nativeElement}onClickStop(t){var r;this.config.ignoreBackdropClick||"static"===this.config.backdrop||t.target!==this._element.nativeElement||this.clickStartedInContent?this.clickStartedInContent=!1:(null===(r=this.bsModalService)||void 0===r||r.setDismissReason("backdrop-click"),this.hide())}onPopState(){var t;null===(t=this.bsModalService)||void 0===t||t.setDismissReason("browser-back-navigation-clicked"),this.hide()}onEsc(t){var r,i;!this.isShown||((27===t.keyCode||"Escape"===t.key)&&t.preventDefault(),this.config.keyboard&&this.level===(null===(r=this.bsModalService)||void 0===r?void 0:r.getModalsCount())&&(null===(i=this.bsModalService)||void 0===i||i.setDismissReason("esc"),this.hide()))}ngOnDestroy(){this.isShown&&this._hide()}hide(){if(!this.isModalHiding&&this.isShown){if(this.config.closeInterceptor)return void this.config.closeInterceptor().then(()=>this._hide(),()=>{});this._hide()}}_hide(){this.isModalHiding=!0,this._renderer.removeClass(this._element.nativeElement,gl()?"in":"show"),setTimeout(()=>{var t,r;this.isShown=!1,document&&document.body&&1===(null===(t=this.bsModalService)||void 0===t?void 0:t.getModalsCount())&&(this._renderer.removeClass(document.body,"modal-open"),this._renderer.setStyle(document.body,"overflow-y","")),null===(r=this.bsModalService)||void 0===r||r.hide(this.config.id),this.isModalHiding=!1},this.isAnimated?300:0)}}return n.\u0275fac=function(t){return new(t||n)(ot($3),ot(kr),ot(Fi))},n.\u0275cmp=Un({type:n,selectors:[["modal-container"]],hostAttrs:["role","dialog","tabindex","-1",1,"modal"],hostVars:3,hostBindings:function(t,r){1&t&&Tt("mousedown",function(a){return r.onClickStarted(a)})("click",function(a){return r.onClickStop(a)})("popstate",function(){return r.onPopState()},!1,D0)("keydown.esc",function(a){return r.onEsc(a)},!1,D0),2&t&&ri("aria-modal",!0)("aria-labelledby",r.config.ariaLabelledBy)("aria-describedby",r.config.ariaDescribedby)},ngContentSelectors:NB,decls:3,vars:2,consts:[["role","document","focusTrap",""],[1,"modal-content"]],template:function(t,r){1&t&&(function c_(n){const e=Et()[16][6];if(!e.projection){const r=e.projection=Xl(n?n.length:1,null),i=r.slice();let a=e.child;for(;null!==a;){const h=n?m8(a,n):0;null!==h&&(i[h]?i[h].projectionNext=a:r[h]=a,i[h]=a),a=a.next}}}(),Ue(0,"div",0)(1,"div",1),function f_(n,e=0,t){const r=Et(),i=Cn(),a=ja(i,20+n,16,null,t||null);null===a.projection&&(a.projection=e),Vd(),64!=(64&a.flags)&&function IA(n,e,t){Ey(e[11],0,e,t,py(n,t,e),yy(t.parent||e[6],t,e))}(i,r,a)}(2),Ge()()),2&t&&so("modal-dialog"+(r.config.class?" "+r.config.class:""))},directives:[PB],encapsulation:2}),n})(),LB=(()=>{class n{constructor(t,r){this._isAnimated=!1,this._isShown=!1,this.element=t,this.renderer=r}get isAnimated(){return this._isAnimated}set isAnimated(t){this._isAnimated=t}get isShown(){return this._isShown}set isShown(t){this._isShown=t,t?this.renderer.addClass(this.element.nativeElement,"in"):this.renderer.removeClass(this.element.nativeElement,"in"),gl()||(t?this.renderer.addClass(this.element.nativeElement,"show"):this.renderer.removeClass(this.element.nativeElement,"show"))}ngOnInit(){this.isAnimated&&(this.renderer.addClass(this.element.nativeElement,"fade"),class N7{static reflow(e){}static getStyles(e){let t=e.ownerDocument.defaultView;return(!t||!t.opener)&&(t=sr),t.getComputedStyle(e)}static stackOverflowConfig(){const e=function P7(){const n=Lu(),e=Object.keys(n).find(t=>n[t]);return Zf[e]}();return{crossorigin:"bs3"!==e?"anonymous":void 0,integrity:"bs5"===e?"sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We":"bs4"===e?"sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2":void 0,cdnLink:"bs5"===e?"https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css":"bs4"===e?"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css":"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"}}}.reflow(this.element.nativeElement)),this.isShown=!0}}return n.\u0275fac=function(t){return new(t||n)(ot(kr),ot(Fi))},n.\u0275cmp=Un({type:n,selectors:[["bs-modal-backdrop"]],hostAttrs:[1,"modal-backdrop"],decls:0,vars:0,template:function(t,r){},encapsulation:2}),n})(),FB=1,Rm=(()=>{class n{constructor(t,r,i){this.clf=r,this.modalDefaultOption=i,this.onShow=new vn,this.onShown=new vn,this.onHide=new vn,this.onHidden=new vn,this.isBodyOverflowing=!1,this.originalBodyPadding=0,this.scrollbarWidth=0,this.modalsCount=0,this.loaders=[],this._backdropLoader=this.clf.createLoader(),this._renderer=t.createRenderer(null,null),this.config=i?Object.assign({},Bh,i):Bh}show(t,r){this.modalsCount++,this._createLoaders();const i=(null==r?void 0:r.id)||FB++;return this.config=this.modalDefaultOption?Object.assign({},Bh,this.modalDefaultOption,r):Object.assign({},Bh,r),this.config.id=i,this._showBackdrop(),this.lastDismissReason=void 0,this._showModal(t)}hide(t){(1===this.modalsCount||null==t)&&(this._hideBackdrop(),this.resetScrollbar()),this.modalsCount=this.modalsCount>=1&&null!=t?this.modalsCount-1:0,setTimeout(()=>{this._hideModal(t),this.removeLoaders(t)},this.config.animated?150:0)}_showBackdrop(){const t=!0===this.config.backdrop||"static"===this.config.backdrop,r=!this.backdropRef||!this.backdropRef.instance.isShown;1===this.modalsCount&&(this.removeBackdrop(),t&&r&&(this._backdropLoader.attach(LB).to("body").show({isAnimated:this.config.animated}),this.backdropRef=this._backdropLoader._componentRef))}_hideBackdrop(){this.backdropRef&&(this.backdropRef.instance.isShown=!1,setTimeout(()=>this.removeBackdrop(),this.config.animated?150:0))}_showModal(t){var r;const i=this.loaders[this.loaders.length-1];if(this.config&&this.config.providers)for(const v of this.config.providers)i.provide(v);const a=new Xr,h=i.provide({provide:$3,useValue:this.config}).provide({provide:Xr,useValue:a}).attach(BB).to("body");return a.hide=()=>{var v;return null===(v=h.instance)||void 0===v?void 0:v.hide()},a.setClass=v=>{h.instance&&(h.instance.config.class=v)},a.onHidden=new vn,a.onHide=new vn,this.copyEvent(i.onBeforeHide,a.onHide),this.copyEvent(i.onHidden,a.onHidden),h.show({content:t,isAnimated:this.config.animated,initialState:this.config.initialState,bsModalService:this,id:this.config.id}),h.instance&&(h.instance.level=this.getModalsCount(),a.content=i.getInnerComponent(),a.id=null===(r=h.instance.config)||void 0===r?void 0:r.id),a}_hideModal(t){if(null!=t){const r=this.loaders.findIndex(a=>{var h;return(null===(h=a.instance)||void 0===h?void 0:h.config.id)===t}),i=this.loaders[r];i&&i.hide(t)}else this.loaders.forEach(r=>{r.instance&&r.hide(r.instance.config.id)})}getModalsCount(){return this.modalsCount}setDismissReason(t){this.lastDismissReason=t}removeBackdrop(){this._renderer.removeClass(document.body,"modal-open"),this._renderer.setStyle(document.body,"overflow-y",""),this._backdropLoader.hide(),this.backdropRef=void 0}checkScrollbar(){this.isBodyOverflowing=document.body.clientWidth{var a;return(null===(a=i.instance)||void 0===a?void 0:a.config.id)===t});r>=0&&(this.loaders.splice(r,1),this.loaders.forEach((i,a)=>{i.instance&&(i.instance.level=a+1)}))}else this.loaders.splice(0,this.loaders.length)}copyEvent(t,r){t.subscribe(i=>{r.emit(this.lastDismissReason||i)})}}return n.\u0275fac=function(t){return new(t||n)(Mt(Qs),Mt(nh),Mt(kB,8))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();j3.forRoot();let UB=(()=>{class n{static forRoot(){return{ngModule:n,providers:[Rm,nh,eh]}}static forChild(){return{ngModule:n,providers:[Rm,nh,eh]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[j3]]}),n})(),HB=(()=>{class n{constructor(t){this.bsModalRef=t,this.text="Loading..."}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-loading-modal"]],decls:7,vars:1,consts:[[1,"modal-body"],[1,"d-flex","align-items-center","justify-content-between"],[1,"m-0"],["role","status",1,"spinner-border","mr-3"],[1,"sr-only"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1)(2,"h5",2),ft(3),Ge(),Ue(4,"div",3)(5,"span",4),ft(6,"Loading..."),Ge()()()()),2&t&&(bt(3),Nr(r.text))},styles:[""]}),n})(),VB=(()=>{class n{constructor(t){this.bsModalRef=t,this.title="",this.text=""}confirm(){var t;this.confirmCallback&&this.confirmCallback(),null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("confirm"),this.bsModalRef.hide()}decline(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("decline"),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-confirm-modal"]],decls:14,vars:2,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-primary","btn-circle",3,"click"],["type","button",1,"btn","btn-primary","btn-circle","button",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2),Ge(),Ue(3,"button",2),Tt("click",function(){return r.decline()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"p"),ft(8),Ge()(),Ue(9,"div",5)(10,"button",6),Tt("click",function(){return r.decline()}),ft(11," Close "),Ge(),Ue(12,"button",7),Tt("click",function(){return r.confirm()}),ft(13," Confirm "),Ge()()),2&t&&(bt(2),Nr(r.title),bt(6),Nr(r.text))},styles:[".button[_ngcontent-%COMP%]{width:100px;height:40px;padding:0 24px;gap:10px;background-color:#0f61ff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#183fd7}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{color:#0f61ff;border-color:#d2d2d7;background-color:transparent}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]:hover{color:#0f61ff;border-color:#0f61ff;background-color:transparent;outline:none}"]}),n})();function Fh(n,e){return new Z(t=>{const r=n.length;if(0===r)return void t.complete();const i=new Array(r);let a=0,h=0;for(let v=0;v{L||(L=!0,h++),i[v]=j},error:j=>t.error(j),complete:()=>{a++,(a===r||!L)&&(h===r&&t.next(e?e.reduce((j,Q,me)=>(j[Q]=i[me],j),{}):i),t.complete())}}))}})}let z3=(()=>{class n{constructor(t,r){this._renderer=t,this._elementRef=r,this.onChange=i=>{},this.onTouched=()=>{}}setProperty(t,r){this._renderer.setProperty(this._elementRef.nativeElement,t,r)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(ot(Fi),ot(kr))},n.\u0275dir=$t({type:n}),n})(),va=(()=>{class n extends z3{}return n.\u0275fac=function(){let e;return function(r){return(e||(e=Ur(n)))(r||n)}}(),n.\u0275dir=$t({type:n,features:[Hn]}),n})();const Ho=new Kt("NgValueAccessor"),zB={provide:Ho,useExisting:We(()=>Il),multi:!0},KB=new Kt("CompositionEventMode");let Il=(()=>{class n extends z3{constructor(t,r,i){super(t,r),this._compositionMode=i,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function GB(){const n=ko()?ko().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return n.\u0275fac=function(t){return new(t||n)(ot(Fi),ot(kr),ot(KB,8))},n.\u0275dir=$t({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,r){1&t&&Tt("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},features:[ir([zB]),Hn]}),n})();const Yr=new Kt("NgValidators"),Ns=new Kt("NgAsyncValidators");function tx(n){return null!=n}function nx(n){const e=pu(n)?Me(n):n;return fp(e),e}function rx(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function ix(n,e){return e.map(t=>t(n))}function ox(n){return n.map(e=>function WB(n){return!n.validate}(e)?e:t=>e.validate(t))}function Om(n){return null!=n?function sx(n){if(!n)return null;const e=n.filter(tx);return 0==e.length?null:function(t){return rx(ix(t,e))}}(ox(n)):null}function Pm(n){return null!=n?function ax(n){if(!n)return null;const e=n.filter(tx);return 0==e.length?null:function(t){return function jB(...n){if(1===n.length){const e=n[0];if(M(e))return Fh(e,null);if(_(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return Fh(t.map(r=>e[r]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return Fh(n=1===n.length&&M(n[0])?n[0]:n,null).pipe(u(t=>e(...t)))}return Fh(n,null)}(ix(t,e).map(nx)).pipe(u(rx))}}(ox(n)):null}function lx(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function Nm(n){return n?Array.isArray(n)?n:[n]:[]}function Hh(n,e){return Array.isArray(n)?n.includes(e):n===e}function fx(n,e){const t=Nm(e);return Nm(n).forEach(i=>{Hh(t,i)||t.push(i)}),t}function hx(n,e){return Nm(e).filter(t=>!Hh(n,t))}class dx{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=Om(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=Pm(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}class ks extends dx{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class si extends dx{get formDirective(){return null}get path(){return null}}let Vh=(()=>{class n extends class px{constructor(e){this._cd=e}is(e){var t,r,i;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(i=null===(r=this._cd)||void 0===r?void 0:r.control)||void 0===i?void 0:i[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(ot(ks,2))},n.\u0275dir=$t({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,r){2&t&&df("ng-untouched",r.is("untouched"))("ng-touched",r.is("touched"))("ng-pristine",r.is("pristine"))("ng-dirty",r.is("dirty"))("ng-valid",r.is("valid"))("ng-invalid",r.is("invalid"))("ng-pending",r.is("pending"))},features:[Hn]}),n})();function cc(n,e){(function Lm(n,e){const t=function ux(n){return n._rawValidators}(n);null!==e.validator?n.setValidators(lx(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const r=function cx(n){return n._rawAsyncValidators}(n);null!==e.asyncValidator?n.setAsyncValidators(lx(r,e.asyncValidator)):"function"==typeof r&&n.setAsyncValidators([r]);const i=()=>n.updateValueAndValidity();Gh(e._rawValidators,i),Gh(e._rawAsyncValidators,i)})(n,e),e.valueAccessor.writeValue(n.value),function rL(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&mx(n,e)})}(n,e),function oL(n,e){const t=(r,i)=>{e.valueAccessor.writeValue(r),i&&e.viewToModelUpdate(r)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function iL(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&mx(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function nL(n,e){if(e.valueAccessor.setDisabledState){const t=r=>{e.valueAccessor.setDisabledState(r)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function Gh(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function mx(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function Hm(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const fc="VALID",qh="INVALID",Rl="PENDING",hc="DISABLED";function jm(n){return(Wh(n)?n.validators:n)||null}function _x(n){return Array.isArray(n)?Om(n):n||null}function $m(n,e){return(Wh(e)?e.asyncValidators:n)||null}function wx(n){return Array.isArray(n)?Pm(n):n||null}function Wh(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}const zm=n=>n instanceof Km;function Ex(n){return(n=>n instanceof Cx)(n)?n.value:n.getRawValue()}function xx(n,e){const t=zm(n),r=n.controls;if(!(t?Object.keys(r):r).length)throw new Ne(1e3,"");if(!r[e])throw new Ne(1001,"")}function Sx(n,e){zm(n),n._forEachChild((r,i)=>{if(void 0===e[i])throw new Ne(1002,"")})}class Gm{constructor(e,t){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=_x(this._rawValidators),this._composedAsyncValidatorFn=wx(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===fc}get invalid(){return this.status===qh}get pending(){return this.status==Rl}get disabled(){return this.status===hc}get enabled(){return this.status!==hc}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=_x(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=wx(e)}addValidators(e){this.setValidators(fx(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(fx(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(hx(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(hx(e,this._rawAsyncValidators))}hasValidator(e){return Hh(this._rawValidators,e)}hasAsyncValidator(e){return Hh(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Rl,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=hc,this.errors=null,this._forEachChild(r=>{r.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=fc,this._forEachChild(r=>{r.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===fc||this.status===Rl)&&this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?hc:fc}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Rl,this._hasOwnPendingAsyncValidator=!0;const t=nx(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(r=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(r,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function uL(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(t)),Array.isArray(e)&&0===e.length))return null;let r=n;return e.forEach(i=>{r=zm(r)?r.controls.hasOwnProperty(i)?r.controls[i]:null:(n=>n instanceof fL)(r)&&r.at(i)||null}),r}(this,e,".")}getError(e,t){const r=t?this.get(t):this;return r&&r.errors?r.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new vn,this.statusChanges=new vn}_calculateStatus(){return this._allControlsDisabled()?hc:this.errors?qh:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Rl)?Rl:this._anyControlsHaveStatus(qh)?qh:fc}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Wh(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class Cx extends Gm{constructor(e=null,t,r){super(jm(t),$m(r,t)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Wh(t)&&t.initialValueIsDefault&&(this.defaultValue=this._isBoxedValue(e)?e.value:e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(r=>r(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){Hm(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){Hm(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class Km extends Gm{constructor(e,t,r){super(jm(t),$m(r,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,r={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){Sx(this,e),Object.keys(e).forEach(r=>{xx(this,r),this.controls[r].setValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(r=>{this.controls[r]&&this.controls[r].patchValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((r,i)=>{r.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,r)=>(e[r]=Ex(t),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,r)=>!!r._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const r=this.controls[t];r&&e(r,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const r=this.controls[t];if(this.contains(t)&&e(r))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,r)=>((t.enabled||this.disabled)&&(e[r]=t.value),e))}_reduceChildren(e,t){let r=e;return this._forEachChild((i,a)=>{r=t(r,i,a)}),r}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}}class fL extends Gm{constructor(e,t,r){super(jm(t),$m(r,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,r={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:r.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){Sx(this,e),e.forEach((r,i)=>{xx(this,i),this.at(i).setValue(r,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((r,i)=>{this.at(i)&&this.at(i).patchValue(r,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((r,i)=>{r.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>Ex(e))}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,r)=>!!r._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){this.controls.forEach((t,r)=>{e(t,r)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const pL={provide:ks,useExisting:We(()=>pc)},Dx=(()=>Promise.resolve(null))();let pc=(()=>{class n extends ks{constructor(t,r,i,a,h){super(),this._changeDetectorRef=h,this.control=new Cx,this._registered=!1,this.update=new vn,this._parent=t,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=function Um(n,e){if(!e)return null;let t,r,i;return Array.isArray(e),e.forEach(a=>{a.constructor===Il?t=a:function lL(n){return Object.getPrototypeOf(n.constructor)===va}(a)?r=a:i=a}),i||r||t||null}(0,a)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){const r=t.name.previousValue;this.formDirective.removeControl({name:r,path:this._getPath(r)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),function Fm(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){cc(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){Dx.then(()=>{var r;this.control.setValue(t,{emitViewToModelChange:!1}),null===(r=this._changeDetectorRef)||void 0===r||r.markForCheck()})}_updateDisabled(t){const r=t.isDisabled.currentValue,i=""===r||r&&"false"!==r;Dx.then(()=>{var a;i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable(),null===(a=this._changeDetectorRef)||void 0===a||a.markForCheck()})}_getPath(t){return this._parent?function $h(n,e){return[...e.path,n]}(t,this._parent):[t]}}return n.\u0275fac=function(t){return new(t||n)(ot(si,9),ot(Yr,10),ot(Ns,10),ot(Ho,10),ot(hl,8))},n.\u0275dir=$t({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[ir([pL]),Hn,qr]}),n})(),Rx=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})();const SL={provide:Ho,useExisting:We(()=>Zh),multi:!0};function Fx(n,e){return null==n?`${e}`:(e&&"object"==typeof e&&(e="Object"),`${n}: ${e}`.slice(0,50))}let Zh=(()=>{class n extends va{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;const i=Fx(this._getOptionId(t),t);this.setProperty("value",i)}registerOnChange(t){this.onChange=r=>{this.value=this._getOptionValue(r),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(const r of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(r),t))return r;return null}_getOptionValue(t){const r=function CL(n){return n.split(":")[0]}(t);return this._optionMap.has(r)?this._optionMap.get(r):t}}return n.\u0275fac=function(){let e;return function(r){return(e||(e=Ur(n)))(r||n)}}(),n.\u0275dir=$t({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(t,r){1&t&&Tt("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},features:[ir([SL]),Hn]}),n})(),Ux=(()=>{class n{constructor(t,r,i){this._element=t,this._renderer=r,this._select=i,this._select&&(this.id=this._select._registerOption())}set ngValue(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(Fx(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return n.\u0275fac=function(t){return new(t||n)(ot(kr),ot(Fi),ot(Zh,9))},n.\u0275dir=$t({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),n})();const AL={provide:Ho,useExisting:We(()=>Ym),multi:!0};function Hx(n,e){return null==n?`${e}`:("string"==typeof e&&(e=`'${e}'`),e&&"object"==typeof e&&(e="Object"),`${n}: ${e}`.slice(0,50))}let Ym=(()=>{class n extends va{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){let r;if(this.value=t,Array.isArray(t)){const i=t.map(a=>this._getOptionId(a));r=(a,h)=>{a._setSelected(i.indexOf(h.toString())>-1)}}else r=(i,a)=>{i._setSelected(!1)};this._optionMap.forEach(r)}registerOnChange(t){this.onChange=r=>{const i=[],a=r.selectedOptions;if(void 0!==a){const h=a;for(let v=0;v{class n{constructor(t,r,i){this._element=t,this._renderer=r,this._select=i,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){null!=this._select&&(this._value=t,this._setElementValue(Hx(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(Hx(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return n.\u0275fac=function(t){return new(t||n)(ot(kr),ot(Fi),ot(Ym,9))},n.\u0275dir=$t({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),n})(),FL=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Rx]]}),n})(),UL=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[FL]}),n})();function HL(n,e){if(1&n){const t=oo();Ue(0,"div",16)(1,"input",17),Tt("click",function(){const a=ui(t).$implicit,h=zt().$implicit;return zt().selectNode(h[0],a.url)}),Ge(),Ue(2,"label",18),ft(3),Ge()()}if(2&n){const t=e.$implicit,r=zt().$implicit;bt(1),Ct("name",r[0])("id",r[0])("value",t.url)("checked",t.selected),bt(1),Ct("for",r[0]),bt(1),Vn(" ",t.url," ")}}function VL(n,e){if(1&n&&(Zo(0),Ue(1,"div",5)(2,"p",6)(3,"small"),ft(4),Ge()(),Ft(5,HL,4,6,"div",15),Ge(),Xo()),2&n){const t=e.$implicit;bt(4),Nr(t[0]),bt(1),Ct("ngForOf",t[1])}}function jL(n,e){if(1&n&&(Ue(0,"option"),ft(1),Ge()),2&n){const t=e.$implicit;bt(1),Nr(t)}}let $L=(()=>{class n{constructor(t,r){this.bsModalRef=t,this.api=r,this.customNodeAddress="",this.customNodeNetwork=Gi.MAINNET,this.networks=[Gi.MAINNET,Gi.GHOSTNET],this.nodes=[],this.loadRPCs()}ngOnInit(){}loadRPCs(){this.nodes=Object.entries(this.api.RPCs).filter(t=>t[1].all.length>0).map(t=>[t[0],t[1].all.map(r=>({selected:t[1].selected===r,url:r}))])}selectNode(t,r){this.api.selectRpc(t,r),this.loadRPCs()}addNode(){this.api.addCustomRpc(this.customNodeNetwork,this.customNodeAddress),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Ju))},n.\u0275cmp=Un({type:n,selectors:[["app-node-selector-modal"]],decls:26,vars:4,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"pb-3"],[1,"text-muted","mb-1"],[4,"ngFor","ngForOf"],[1,"input-group","mb-3"],[1,"input-group-prepend"],[1,"custom-select",3,"ngModel","ngModelChange"],["type","text","placeholder","RPC URL","aria-label","RPC URL",1,"form-control",3,"ngModel","ngModelChange"],["type","button",1,"btn","btn-light",3,"click"],[1,"modal-footer"],["type","button",1,"btn","btn-primary",3,"click"],["class","form-check",4,"ngFor","ngForOf"],[1,"form-check"],["type","radio",1,"form-check-input",3,"name","id","value","checked","click"],[1,"form-check-label",3,"for"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2,"Tezos RPC Node Selection"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.bsModalRef.hide()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"div",5)(8,"p",6)(9,"small"),ft(10,"Select Tezos RPC Node"),Ge()(),Ft(11,VL,6,2,"ng-container",7),Ge(),Ue(12,"div")(13,"p",6)(14,"small"),ft(15,"Custom Tezos RPC Node"),Ge()(),Ue(16,"div",8)(17,"div",9)(18,"select",10),Tt("ngModelChange",function(a){return r.customNodeNetwork=a}),Ft(19,jL,2,1,"option",7),Ge()(),Ue(20,"input",11),Tt("ngModelChange",function(a){return r.customNodeAddress=a}),Ge()(),Ue(21,"button",12),Tt("click",function(){return r.addNode()}),ft(22," Add Custom Node "),Ge()()(),Ue(23,"div",13)(24,"button",14),Tt("click",function(){return r.bsModalRef.hide()}),ft(25," Save "),Ge()()),2&t&&(bt(11),Ct("ngForOf",r.nodes),bt(7),Ct("ngModel",r.customNodeNetwork),bt(1),Ct("ngForOf",r.networks),bt(1),Ct("ngModel",r.customNodeAddress))},directives:[Ru,Zh,Vh,pc,Ux,Vx,Il],styles:[""]}),n})(),zL=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-how-to-modal"]],decls:29,vars:1,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"pb-4"],[1,"pb-2"],[1,"modal-footer"],["type","button",1,"btn","btn-default",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2,"How To Connect"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.bsModalRef.hide()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"p"),ft(8," The Beacon Debug Wallet can be used to simulate a connection between a wallet and a dApp. All relevant details are exposed and in the Beacon Debug Wallet to simplify testing and debugging. "),Ge(),Ue(9,"p",5),ft(10," With the Beacon Debug Wallet dApp developer can also view their application from the perspective of specific addresses. "),Ge(),Ue(11,"h6",6),ft(12,"How To Connect A dApp To The Beacon Debug Wallet"),Ge(),Ue(13,"ol")(14,"li"),ft(15,"Go to the dApp you want to establish a connection."),Ge(),Ue(16,"li"),ft(17,' Use the functionality on the dApp to open the Beacon dialog. Usually this is a button labelled "Connect Wallet" or "sync". '),Ge(),Ue(18,"li"),ft(19,'Select "Pair with another device" on the beacon dialog.'),Ge(),Ue(20,"li"),ft(21," Hover over the QR code, click on the Copy button, the Beacon Connection code has now been copied to your clipboard. "),Ge(),Ue(22,"li"),ft(23,' Come Back to the Beacon Debug Wallet and click on the button "Connect To A New dApp" '),Ge(),Ue(24,"li"),ft(25,"You're now connected an can trigger operations from the dApp. \u{1f389}"),Ge()()(),Ue(26,"div",7)(27,"button",8),Tt("click",function(){return r.bsModalRef.hide()}),ft(28),Ge()()),2&t&&(bt(28),Vn(" ",r.closeBtnName," "))},styles:["ol[_ngcontent-%COMP%]{padding-inline-start:1rem}li[_ngcontent-%COMP%]{padding-bottom:.5rem}"]}),n})();const GL=function(){var n=Ot(function*(){const e=window.ethereum;try{const t=yield null==e?void 0:e.request({method:"web3_clientVersion"}),r=null==t?void 0:t.includes("flask");return Boolean(e&&r)}catch(t){return!1}});return function(){return n.apply(this,arguments)}}();let Xh=(()=>{class n{constructor(t){this.accountService=t,this.isConnected=!1,this.isSnapInstalled().then(r=>this.isConnected=r)}connect(){var t=this;return Ot(function*(){console.log("isFlask",yield GL()),yield vB();const r=yield k3();if(console.log("snap installed",r),localStorage.getItem(Vr.METAMASK_BUSY))throw console.log("MetaMaskService: MetaMask is busy handling another request"),new Error("MetaMask is busy handling another request");localStorage.setItem(Vr.METAMASK_BUSY,"true");const i=yield yB();localStorage.removeItem(Vr.METAMASK_BUSY),t.accountService.addOrUpdateAccount({address:i.address,publicKey:i.publicKey,type:kh.METAMASK,description:"",tags:[],network:Gi.MAINNET,wallet:{name:"MetaMask"}}),t.isSnapInstalled().then(a=>t.isConnected=a)})()}disconnect(){return Ot(function*(){alert("NOT IMPLEMENTED")})()}isSnapInstalled(){return Ot(function*(){const t=yield k3();return Boolean(t)})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(Os))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Yx=(()=>{class n{constructor(t,r,i){this.bsModalRef=t,this.modalService=r,this.metamaskService=i}ngOnInit(){}cancel(){this.bsModalRef.hide()}connect(){var t=this;return Ot(function*(){t.bsModalRef.hide();const r=t.showLoadingModal();t.metamaskService.connect().then(()=>{r.hide(),t.successCallback&&t.successCallback()}).catch(Ot(function*(){r.hide(),t.errorCallback&&t.errorCallback()}))})()}showLoadingModal(){return this.modalService.showLoadingModal("Connecting...")}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Fs),ot(Xh))},n.\u0275cmp=Un({type:n,selectors:[["app-not-connected-modal"]],decls:12,vars:0,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","text-center"],[1,"modal-title"],[1,"text-left"],[1,"text-left","mt-3"],["type","button",1,"btn","btn-primary","btn-circle","btn-block","mt-3",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.cancel()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6,"Not connected to MetaMask"),Ge(),Bt(7,"div",5),Ue(8,"div",6),ft(9," You need to connect to MetaMask before you can interact with a dApp. Please do this now. "),Ge(),Ue(10,"button",7),Tt("click",function(){return r.connect()}),ft(11," Connect "),Ge()())},styles:[""]}),n})();const Qx=["toast-component",""];function qL(n,e){if(1&n){const t=oo();Ue(0,"button",5),Tt("click",function(){return ui(t),zt().remove()}),Ue(1,"span",6),ft(2,"\xd7"),Ge()()}}function WL(n,e){if(1&n&&(Zo(0),ft(1),Xo()),2&n){const t=zt(2);bt(1),Vn("[",t.duplicatesCount+1,"]")}}function ZL(n,e){if(1&n&&(Ue(0,"div"),ft(1),Ft(2,WL,2,1,"ng-container",4),Ge()),2&n){const t=zt();so(t.options.titleClass),ri("aria-label",t.title),bt(1),Vn(" ",t.title," "),bt(1),Ct("ngIf",t.duplicatesCount)}}function XL(n,e){if(1&n&&Bt(0,"div",7),2&n){const t=zt();so(t.options.messageClass),Ct("innerHTML",t.message,nf)}}function YL(n,e){if(1&n&&(Ue(0,"div",8),ft(1),Ge()),2&n){const t=zt();so(t.options.messageClass),ri("aria-label",t.message),bt(1),Vn(" ",t.message," ")}}function QL(n,e){if(1&n&&(Ue(0,"div"),Bt(1,"div",9),Ge()),2&n){const t=zt();bt(1),ol("width",t.width+"%")}}function JL(n,e){if(1&n){const t=oo();Ue(0,"button",5),Tt("click",function(){return ui(t),zt().remove()}),Ue(1,"span",6),ft(2,"\xd7"),Ge()()}}function eF(n,e){if(1&n&&(Zo(0),ft(1),Xo()),2&n){const t=zt(2);bt(1),Vn("[",t.duplicatesCount+1,"]")}}function tF(n,e){if(1&n&&(Ue(0,"div"),ft(1),Ft(2,eF,2,1,"ng-container",4),Ge()),2&n){const t=zt();so(t.options.titleClass),ri("aria-label",t.title),bt(1),Vn(" ",t.title," "),bt(1),Ct("ngIf",t.duplicatesCount)}}function nF(n,e){if(1&n&&Bt(0,"div",7),2&n){const t=zt();so(t.options.messageClass),Ct("innerHTML",t.message,nf)}}function rF(n,e){if(1&n&&(Ue(0,"div",8),ft(1),Ge()),2&n){const t=zt();so(t.options.messageClass),ri("aria-label",t.message),bt(1),Vn(" ",t.message," ")}}function iF(n,e){if(1&n&&(Ue(0,"div"),Bt(1,"div",9),Ge()),2&n){const t=zt();bt(1),ol("width",t.width+"%")}}class oF{constructor(e,t){this.component=e,this.injector=t}attach(e,t){return this._attachedHost=e,e.attach(this,t)}detach(){const e=this._attachedHost;if(e)return this._attachedHost=void 0,e.detach()}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class Yh{constructor(e,t,r,i,a,h){this.toastId=e,this.config=t,this.message=r,this.title=i,this.toastType=a,this.toastRef=h,this._onTap=new o,this._onAction=new o,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(e){this._onAction.next(e)}onAction(){return this._onAction.asObservable()}}const Jx={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing",payload:null},e6=new Kt("ToastConfig");class aF{constructor(e){this._overlayRef=e,this.duplicatesCount=0,this._afterClosed=new o,this._activate=new o,this._manualClose=new o,this._resetTimeout=new o,this._countDuplicate=new o}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(e,t){e&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}}class lF{constructor(e,t){this._toastPackage=e,this._parentInjector=t}get(e,t,r){return e===Yh?this._toastPackage:this._parentInjector.get(e,t,r)}}class uF extends class sF{attach(e,t){return this._attachedPortal=e,this.attachComponentPortal(e,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(e){this._disposeFn=e}}{constructor(e,t,r){super(),this._hostDomElement=e,this._componentFactoryResolver=t,this._appRef=r}attachComponentPortal(e,t){const r=this._componentFactoryResolver.resolveComponentFactory(e.component);let i;return i=r.create(e.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}class cF{constructor(e){this._portalHost=e}attach(e,t=!0){return this._portalHost.attach(e,t)}detach(){return this._portalHost.detach()}}let fF=(()=>{class n{constructor(t){this._document=t}ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),hF=(()=>{class n{constructor(t,r,i,a){this._overlayContainer=t,this._componentFactoryResolver=r,this._appRef=i,this._document=a,this._paneElements=new Map}create(t,r){return this._createOverlayRef(this.getPaneElement(t,r))}getPaneElement(t="",r){return this._paneElements.get(r)||this._paneElements.set(r,{}),this._paneElements.get(r)[t]||(this._paneElements.get(r)[t]=this._createPaneElement(t,r)),this._paneElements.get(r)[t]}_createPaneElement(t,r){const i=this._document.createElement("div");return i.id="toast-container",i.classList.add(t),i.classList.add("toast-container"),r?r.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(t){return new uF(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new cF(this._createPortalHost(t))}}return n.\u0275fac=function(t){return new(t||n)(Mt(fF),Mt(Ys),Mt(fl),Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Qh=(()=>{class n{constructor(t,r,i,a,h){this.overlay=r,this._injector=i,this.sanitizer=a,this.ngZone=h,this.currentlyActive=0,this.toasts=[],this.index=0,this.toastrConfig=Object.assign(Object.assign({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=Object.assign(Object.assign({},t.default.iconClasses),t.config.iconClasses))}show(t,r,i={},a=""){return this._preBuildNotification(a,t,r,this.applyConfig(i))}success(t,r,i={}){return this._preBuildNotification(this.toastrConfig.iconClasses.success||"",t,r,this.applyConfig(i))}error(t,r,i={}){return this._preBuildNotification(this.toastrConfig.iconClasses.error||"",t,r,this.applyConfig(i))}info(t,r,i={}){return this._preBuildNotification(this.toastrConfig.iconClasses.info||"",t,r,this.applyConfig(i))}warning(t,r,i={}){return this._preBuildNotification(this.toastrConfig.iconClasses.warning||"",t,r,this.applyConfig(i))}clear(t){for(const r of this.toasts)if(void 0!==t){if(r.toastId===t)return void r.toastRef.manualClose()}else r.toastRef.manualClose()}remove(t){const r=this._findToast(t);if(!r||(r.activeToast.toastRef.close(),this.toasts.splice(r.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActivethis._buildNotification(t,r,i,a)):this._buildNotification(t,r,i,a)}_buildNotification(t,r,i,a){if(!a.toastComponent)throw new Error("toastComponent required");const h=this.findDuplicate(i,r,this.toastrConfig.resetTimeoutOnDuplicate&&a.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||r)&&this.toastrConfig.preventDuplicates&&null!==h)return h;this.previousToastMessage=r;let v=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(v=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));const D=this.overlay.create(a.positionClass,this.overlayContainer);this.index=this.index+1;let L=r;r&&a.enableHtml&&(L=this.sanitizer.sanitize(Qn.HTML,r));const j=new aF(D),Q=new Yh(this.index,a,L,i,t,j),me=new lF(Q,this._injector),ye=new oF(a.toastComponent,me),Te=D.attach(ye,this.toastrConfig.newestOnTop);j.componentInstance=Te.instance;const Ve={toastId:this.index,title:i||"",message:r||"",toastRef:j,onShown:j.afterActivate(),onHidden:j.afterClosed(),onTap:Q.onTap(),onAction:Q.onAction(),portal:Te};return v||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{Ve.toastRef.activate()})),this.toasts.push(Ve),Ve}}return n.\u0275fac=function(t){return new(t||n)(Mt(e6),Mt(hF),Mt(Cr),Mt(Wf),Mt(or))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),dF=(()=>{class n{constructor(t,r,i){this.toastrService=t,this.toastPackage=r,this.ngZone=i,this.width=-1,this.toastClasses="",this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}},this.message=r.message,this.title=r.title,this.options=r.config,this.originalTimeout=r.config.timeOut,this.toastClasses=`${r.toastType} ${r.config.toastClass}`,this.sub=r.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=r.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=r.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=r.toastRef.countDuplicate().subscribe(a=>{this.duplicatesCount=a})}get displayStyle(){if("inactive"===this.state.value)return"none"}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=Object.assign(Object.assign({},this.state),{value:"active"}),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(0===this.width||100===this.width||!this.options.timeOut)return;const t=(new Date).getTime();this.width=(this.hideTime-t)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=Object.assign(Object.assign({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.state=Object.assign(Object.assign({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){"removed"!==this.state.value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){!0===this.options.disableTimeOut||"extendedTimeOut"===this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state.value||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,r){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),r)):this.timeout=setTimeout(()=>t(),r)}outsideInterval(t,r){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),r)):this.intervalId=setInterval(()=>t(),r)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}}return n.\u0275fac=function(t){return new(t||n)(ot(Qh),ot(Yh),ot(or))},n.\u0275cmp=Un({type:n,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,r){1&t&&Tt("click",function(){return r.tapToast()})("mouseenter",function(){return r.stickAround()})("mouseleave",function(){return r.delayedHideToast()}),2&t&&(pp("@flyInOut",r.state),so(r.toastClasses),ol("display",r.displayStyle))},attrs:Qx,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,r){1&t&&(Ft(0,qL,3,0,"button",0),Ft(1,ZL,3,5,"div",1),Ft(2,XL,1,3,"div",2),Ft(3,YL,2,4,"div",3),Ft(4,QL,2,2,"div",4)),2&t&&(Ct("ngIf",r.options.closeButton),bt(1),Ct("ngIf",r.title),bt(1),Ct("ngIf",r.message&&r.options.enableHtml),bt(1),Ct("ngIf",r.message&&!r.options.enableHtml),bt(1),Ct("ngIf",r.options.progressBar))},directives:[fo],encapsulation:2,data:{animation:[_M("flyInOut",[Eg("inactive",Ci({opacity:0})),Eg("active",Ci({opacity:1})),Eg("removed",Ci({opacity:0})),xg("inactive => active",pl("{{ easeTime }}ms {{ easing }}")),xg("active => removed",pl("{{ easeTime }}ms {{ easing }}"))])]}}),n})();const pF=Object.assign(Object.assign({},Jx),{toastComponent:dF});let gF=(()=>{class n{static forRoot(t={}){return{ngModule:n,providers:[{provide:e6,useValue:{default:pF,config:t}}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Pu]]}),n})(),mF=(()=>{class n{constructor(t,r,i){this.toastrService=t,this.toastPackage=r,this.appRef=i,this.width=-1,this.toastClasses="",this.state="inactive",this.message=r.message,this.title=r.title,this.options=r.config,this.originalTimeout=r.config.timeOut,this.toastClasses=`${r.toastType} ${r.config.toastClass}`,this.sub=r.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=r.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=r.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=r.toastRef.countDuplicate().subscribe(a=>{this.duplicatesCount=a})}get displayStyle(){if("inactive"===this.state)return"none"}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state="active",!(!0===this.options.disableTimeOut||"timeOut"===this.options.disableTimeOut)&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(0===this.width||100===this.width||!this.options.timeOut)return;const t=(new Date).getTime();this.width=(this.hideTime-t)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=(new Date).getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){"removed"!==this.state&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){"removed"!==this.state&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){!0===this.options.disableTimeOut||"extendedTimeOut"===this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}}return n.\u0275fac=function(t){return new(t||n)(ot(Qh),ot(Yh),ot(fl))},n.\u0275cmp=Un({type:n,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,r){1&t&&Tt("click",function(){return r.tapToast()})("mouseenter",function(){return r.stickAround()})("mouseleave",function(){return r.delayedHideToast()}),2&t&&(so(r.toastClasses),ol("display",r.displayStyle))},attrs:Qx,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,r){1&t&&(Ft(0,JL,3,0,"button",0),Ft(1,tF,3,5,"div",1),Ft(2,nF,1,3,"div",2),Ft(3,rF,2,4,"div",3),Ft(4,iF,2,2,"div",4)),2&t&&(Ct("ngIf",r.options.closeButton),bt(1),Ct("ngIf",r.title),bt(1),Ct("ngIf",r.message&&r.options.enableHtml),bt(1),Ct("ngIf",r.message&&!r.options.enableHtml),bt(1),Ct("ngIf",r.options.progressBar))},directives:[fo],encapsulation:2}),n})();Object.assign(Object.assign({},Jx),{toastComponent:mF});let vF=(()=>{class n{constructor(t,r){this.bsModalRef=t,this.toastService=r}ngOnInit(){}confirm(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("confirm"),this.bsModalRef.hide(),this.toastService.success("Connected to dApp","Success",{progressBar:!0,positionClass:"toast-bottom-center"})}decline(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("decline"),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Qh))},n.\u0275cmp=Un({type:n,selectors:[["app-permission-modal"]],decls:23,vars:2,consts:[[1,"modal-header"],[1,"modalTitle","modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modalContainer"],[1,"modal-body"],[1,"inputTitle"],[1,"inputBox"],[1,"inputText"],[1,"modal-footer",2,"width","fit-content"],["type","button",1,"button","btn","btn-block","btn-primary",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h2",1),ft(2,"Connect DApp"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.decline()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"div",5)(8,"p"),ft(9,"Do you want to connect to the following DApp?"),Ge(),Ue(10,"p",6),ft(11,"DApp:"),Ge(),Ue(12,"div",7)(13,"p",8),ft(14),Ge()(),Ue(15,"p",6),ft(16,"Account:"),Ge(),Ue(17,"div",7)(18,"p",8),ft(19),Ge()()(),Ue(20,"div",9)(21,"button",10),Tt("click",function(){return r.confirm()}),ft(22," Connect "),Ge()()()),2&t&&(bt(14),Nr(null==r.appMetadata?null:r.appMetadata.name),bt(5),Nr(null==r.account?null:r.account.address))},styles:[".modalContainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}.modal-footer[_ngcontent-%COMP%]{display:flex;justify-content:center}.modalTitle[_ngcontent-%COMP%]{font-family:Inter;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:center;margin:0 auto}.inputTitle[_ngcontent-%COMP%]{font-family:Inter;font-size:16px;font-weight:600;line-height:19px;letter-spacing:0em;text-align:left;margin-top:10px}.inputBox[_ngcontent-%COMP%]{width:400px;height:50px;padding:0 24px;border-radius:100px;border:2px;gap:10px;background-color:#f5f5f7;display:flex;justify-content:left;align-items:center}.inputText[_ngcontent-%COMP%]{font-family:Inter;font-size:14px;font-weight:600;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto}.infoInputBox[_ngcontent-%COMP%]{width:400px;padding:20px;border-radius:10px;gap:10px;background-color:#f5f5f7;display:flex;justify-content:left;align-items:center;margin-top:20px}.infoInputText[_ngcontent-%COMP%]{font-family:Inter;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto}.button[_ngcontent-%COMP%]{width:400px;height:52px;padding:0 24px;border-radius:100px;gap:10px;background-color:#0f61ff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#0079ff}"]}),n})(),yF=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}test(){this.callback&&this.callback()}confirm(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("confirm"),this.bsModalRef.hide()}decline(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("decline"),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-operation-modal"]],decls:15,vars:0,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[3,"click"],[1,"modal-footer"],["type","button",1,"btn","btn-light",3,"click"],["type","button",1,"btn","btn-primary","ml-1",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2,"Submit Operation"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.decline()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"p"),ft(8," Do you want to create this transaction? "),Ue(9,"button",5),Tt("click",function(){return r.test()}),Ge()()(),Ue(10,"div",6)(11,"button",7),Tt("click",function(){return r.decline()}),ft(12," Decline "),Ge(),Ue(13,"button",8),Tt("click",function(){return r.confirm()}),ft(14," Sign transaction "),Ge()())},styles:[""]}),n})(),bF=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}confirm(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("confirm"),this.bsModalRef.hide()}decline(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("decline"),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-sign-payload-modal"]],decls:14,vars:0,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-light",3,"click"],["type","button",1,"btn","btn-primary","ml-1",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2,"Sign Payload"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.decline()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"p"),ft(8,"Do you want to sign this payload?"),Ge()(),Ue(9,"div",5)(10,"button",6),Tt("click",function(){return r.decline()}),ft(11," Decline "),Ge(),Ue(12,"button",7),Tt("click",function(){return r.confirm()}),ft(13," Sign Payload "),Ge()())},styles:[""]}),n})();var Ir=(()=>(function(n){n.ENDORSEMENT="endorsement",n.SEED_NONCE_REVELATION="seed_nonce_revelation",n.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",n.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",n.ACTIVATE_ACCOUNT="activate_account",n.PROPOSALS="proposals",n.BALLOT="ballot",n.REVEAL="reveal",n.TRANSACTION="transaction",n.ORIGINATION="origination",n.DELEGATION="delegation"}(Ir||(Ir={})),Ir))();const gc="1040000",Jm="60000",RF=function(){var n=Ot(function*(e,t,r,i=new Nn("1300").toFixed()){return{kind:Ir.REVEAL,fee:i,gas_limit:"10000",storage_limit:"0",counter:e.toFixed(),public_key:t,source:r}});return function(t,r,i){return n.apply(this,arguments)}}();var o6=I(1108);I(3647);class OF extends Error{}class Lr extends OF{}class s6 extends Lr{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidAddressError",this.message=`Invalid address "${e}"`,this.message+=t?` ${t}.`:"."}}class PF extends Lr{constructor(e,t){super(),this.blockHash=e,this.errorDetail=t,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${e}"`,this.message+=t?` ${t}.`:"."}}class a6 extends Lr{constructor(e,t){super(),this.hexString=e,this.errorDetail=t,this.name="InvalidHexStringError",this.message=`Invalid hex string "${e}"`,this.message+=t?` ${t}.`:"."}}class l6 extends Lr{constructor(e,t){super(),this.publicKey=e,this.errorDetail=t,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${e}"`,this.message+=t?` ${t}.`:"."}}class u6 extends Lr{constructor(e,t){super(),this.contractAddress=e,this.errorDetail=t,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${e}"`,this.message+=t?` ${t}.`:"."}}class NF extends Lr{constructor(e,t){super(),this.keyHash=e,this.errorDetail=t,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${e}"`,this.message+=t?` ${t}.`:"."}}class c6 extends Lr{constructor(e,t){super(),this.operationKind=e,this.errorDetail=t,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${e}"`,this.message+=t?` ${t}.`:"."}}I(7715),I(8517);var rt=(()=>(function(n){n.TZ1="tz1",n.TZ2="tz2",n.TZ3="tz3",n.TZ4="tz4",n.KT="KT",n.KT1="KT1",n.EDSK2="edsk2",n.SPSK="spsk",n.P2SK="p2sk",n.EDPK="edpk",n.SPPK="sppk",n.P2PK="p2pk",n.BLPK="BLpk",n.EDESK="edesk",n.SPESK="spesk",n.P2ESK="p2esk",n.EDSK="edsk",n.EDSIG="edsig",n.SPSIG="spsig",n.P2SIG="p2sig",n.SIG="sig",n.NET="Net",n.NCE="nce",n.B="B",n.O="o",n.LO="Lo",n.LLO="LLo",n.P="P",n.CO="Co",n.ID="id",n.EXPR="expr",n.TZ="TZ",n.VH="vh",n.SASK="sask",n.ZET1="zet1",n.TXR1="txr1",n.TXI="txi",n.TXM="txm",n.TXC="txc",n.TXMR="txmr",n.TXRL="txM",n.TXW="txw",n.SR1="sr1",n.SRC1="src1"}(rt||(rt={})),rt))();const hr={[rt.TZ1]:new Uint8Array([6,161,159]),[rt.TZ2]:new Uint8Array([6,161,161]),[rt.TZ3]:new Uint8Array([6,161,164]),[rt.TZ4]:new Uint8Array([6,161,166]),[rt.KT]:new Uint8Array([2,90,121]),[rt.KT1]:new Uint8Array([2,90,121]),[rt.EDSK]:new Uint8Array([43,246,78,7]),[rt.EDSK2]:new Uint8Array([13,15,58,7]),[rt.SPSK]:new Uint8Array([17,162,224,201]),[rt.P2SK]:new Uint8Array([16,81,238,189]),[rt.EDPK]:new Uint8Array([13,15,37,217]),[rt.SPPK]:new Uint8Array([3,254,226,86]),[rt.P2PK]:new Uint8Array([3,178,139,127]),[rt.BLPK]:new Uint8Array([6,149,135,204]),[rt.EDESK]:new Uint8Array([7,90,60,179,41]),[rt.SPESK]:new Uint8Array([9,237,241,174,150]),[rt.P2ESK]:new Uint8Array([9,48,57,115,171]),[rt.EDSIG]:new Uint8Array([9,245,205,134,18]),[rt.SPSIG]:new Uint8Array([13,115,101,19,63]),[rt.P2SIG]:new Uint8Array([54,240,44,52]),[rt.SIG]:new Uint8Array([4,130,43]),[rt.NET]:new Uint8Array([87,82,0]),[rt.NCE]:new Uint8Array([69,220,169]),[rt.B]:new Uint8Array([1,52]),[rt.O]:new Uint8Array([5,116]),[rt.LO]:new Uint8Array([133,233]),[rt.LLO]:new Uint8Array([29,159,109]),[rt.P]:new Uint8Array([2,170]),[rt.CO]:new Uint8Array([79,179]),[rt.ID]:new Uint8Array([153,103]),[rt.EXPR]:new Uint8Array([13,44,64,27]),[rt.TZ]:new Uint8Array([2,90,121]),[rt.VH]:new Uint8Array([1,106,242]),[rt.SASK]:new Uint8Array([11,237,20,92]),[rt.ZET1]:new Uint8Array([18,71,40,223]),[rt.TXR1]:new Uint8Array([1,128,120,31]),[rt.TXI]:new Uint8Array([79,148,196]),[rt.TXM]:new Uint8Array([79,149,30]),[rt.TXC]:new Uint8Array([79,148,17]),[rt.TXMR]:new Uint8Array([18,7,206,87]),[rt.TXRL]:new Uint8Array([79,146,82]),[rt.TXW]:new Uint8Array([79,150,72]),[rt.SR1]:new Uint8Array([6,124,117]),[rt.SRC1]:new Uint8Array([17,165,134,138])},Ol={[rt.TZ1]:20,[rt.TZ2]:20,[rt.TZ3]:20,[rt.TZ4]:20,[rt.KT]:20,[rt.KT1]:20,[rt.EDPK]:32,[rt.SPPK]:33,[rt.P2PK]:33,[rt.BLPK]:48,[rt.EDSIG]:64,[rt.SPSIG]:64,[rt.P2SIG]:64,[rt.SIG]:64,[rt.NET]:4,[rt.B]:32,[rt.P]:32,[rt.O]:32,[rt.VH]:32,[rt.SASK]:169,[rt.ZET1]:43,[rt.TXR1]:20,[rt.TXI]:32,[rt.TXM]:32,[rt.TXC]:32,[rt.TXMR]:32,[rt.TXRL]:32,[rt.TXW]:32,[rt.SR1]:20,[rt.SRC1]:32};var nr=(()=>(function(n){n[n.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",n[n.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",n[n.INVALID_LENGTH=2]="INVALID_LENGTH",n[n.VALID=3]="VALID"}(nr||(nr={})),nr))();const KF=[rt.B];function Di(n){switch(n){case nr.NO_PREFIX_MATCHED:return"with unsupported prefix";case nr.INVALID_CHECKSUM:return"failed checksum";case nr.INVALID_LENGTH:return"with incorrect length";default:return""}}const y6=n=>n.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),mr=(n,e=8)=>n.toString(16).padStart(e,"0");var He=(()=>(function(n){n.SECRET="secret",n.RAW="raw",n.TZ1="tz1",n.BRANCH="branch",n.ZARITH="zarith",n.PUBLIC_KEY="public_key",n.PKH="pkh",n.DELEGATE="delegate",n.SCRIPT="script",n.BALLOT_STATEMENT="ballotStmt",n.PROPOSAL="proposal",n.PROPOSAL_ARR="proposalArr",n.INT32="int32",n.INT16="int16",n.PARAMETERS="parameters",n.ADDRESS="address",n.SMART_CONTRACT_ADDRESS="smart_contract_address",n.SMART_ROLLUP_ADDRESS="smart_rollup_address",n.SMART_ROLLUP_COMMITMENT_HASH="smart_rollup_commitment_hash",n.VALUE="value",n.PADDED_BYTES="padded_bytes",n.SMART_ROLLUP_MESSAGE="smart_rollup_message",n.MANAGER="manager",n.BLOCK_PAYLOAD_HASH="blockPayloadHash",n.ENTRYPOINT="entrypoint",n.OPERATION="operation",n.OP_ACTIVATE_ACCOUNT="activate_account",n.OP_DELEGATION="delegation",n.OP_TRANSACTION="transaction",n.OP_ORIGINATION="origination",n.OP_BALLOT="ballot",n.OP_FAILING_NOOP="failing_noop",n.OP_ENDORSEMENT="endorsement",n.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",n.OP_REVEAL="reveal",n.OP_PROPOSALS="proposals",n.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",n.OP_TRANSFER_TICKET="transfer_ticket",n.OP_TX_ROLLUP_ORIGINATION="tx_rollup_origination",n.OP_TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",n.BURN_LIMIT="burn_limit",n.TX_ROLLUP_ORIGINATION_PARAM="tx_rollup_origination_param",n.TX_ROLLUP_ID="tx_rollup_id",n.TX_ROLLUP_BATCH_CONTENT="tx_rollup_batch_content",n.OP_INCREASE_PAID_STORAGE="increase_paid_storage",n.OP_UPDATE_CONSENSUS_KEY="update_consensus_key",n.OP_DRAIN_DELEGATE="drain_delegate",n.DEPOSITS_LIMIT="deposits_limit",n.OP_SET_DEPOSITS_LIMIT="set_deposits_limit",n.OP_SMART_ROLLUP_ORIGINATE="smart_rollup_originate",n.PVM_KIND="pvm_kind",n.OP_SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",n.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message"}(He||(He={})),He))();const jo={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET_DEPRECATED",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT",98:"Lambda_rec",99:"LAMBDA_REC","9a":"TICKET","9b":"BYTES","9c":"NAT"},tU=(()=>{const n={};return Object.keys(jo).forEach(e=>{n[jo[e]]=e}),n})(),tv={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"endorsement",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",150:"tx_rollup_origination",151:"tx_rollup_submit_batch",158:"transfer_ticket",112:"set_deposits_limit",113:"increase_paid_storage",114:"update_consensus_key",9:"drain_delegate",200:"smart_rollup_originate",201:"smart_rollup_add_messages",206:"smart_rollup_execute_outbox_message",17:"failing_noop"},b6=(()=>{const n={};return Object.keys(tv).forEach(e=>{const t="string"==typeof e?parseInt(e,10):e;n[tv[t]]=mr(t,2)}),n})(),td={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate","05":"deposit"},_6=(()=>{const n={};return Object.keys(td).forEach(e=>{n[td[e]]=e}),n})();class w6 extends Lr{constructor(e,t){super(),this.operation=e,this.errorDetail=t,this.name="InvalidOperationSchemaError",this.message="Invalid operation content recevied",t&&(this.message+=` ${t}.`)}}class M6 extends Lr{constructor(e){super(),this.entrypoint=e,this.name="OversizedEntryPointError",this.message=`Invalid entrypoint length "${e.length}", maximum length is "31".`}}class nU extends Lr{constructor(e){super(),this.ballotValue=e,this.name="InvalidBallotValueError",this.message=`Invalid ballot value "${e}" expecting one of the following: "yay", "nay", "pass".`}}class rU extends Lr{constructor(e){super(),this.ballotValue=e,this.name="DecodeBallotValueError",this.message=`Invalid ballot value "${e}", cannot be decoded.`}}class iU extends Lr{constructor(e){super(),this.value=e,this.name="UnexpectedMichelsonValueError",this.message=`Invalid Michelson value "${e}", unalbe to encode.`}}class E6 extends Lr{constructor(e){super(),this.message=e,this.name="OperationDecodingError"}}class oU extends Lr{constructor(e){super(),this.message=e,this.name="OperationEncodingError"}}class sU extends Lr{constructor(e){super(),this.op=e,this.name="UnsupportedOperationError",this.message=`Unsupported operation "${e}", can submit an issue on our github for feature request.`}}class aU extends Lr{constructor(e){super(),this.pvm=e,this.name="UnsupportedPvmKindError",this.message=`Invalid Pvm kind "${e}" expecting either "arith" or "wasm_2_0_0".`}}class lU extends Lr{constructor(e){super(),this.pvm=e,this.name="DecodePvmKindError",this.message=`Invalid Pvm kind "${e}", cannot be decoded.`}}class x6 extends Lr{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidSmartRollupAddress",this.message=`Invalid smart rollup address "${e}"`,t&&(this.message+=` ${t}.`)}}class S6 extends Lr{constructor(e,t){super(),this.hash=e,this.errorDetail=t,this.name="InvalidSmartRollupCommitmentHashError",this.message=`Invalid smart rollup commitment hash "${e}"`,t&&(this.message+=` ${t}.`)}}class Mo{constructor(e,t=0){this.arr=e,this.offset=t}static fromHexString(e){const t=e.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(t)){const r=new Uint8Array((t.match(/([a-z]|\d){2}/g)||[]).map(i=>parseInt(i,16)));return new Mo(r)}throw new a6(t)}consume(e){const t=this.arr.subarray(this.offset,this.offset+e);return this.offset+=e,t}get(e){return this.arr[this.offset+e]}length(){return this.arr.length-this.offset}slice(e,t){return new Mo(this.arr.slice(e,t))}}const Bs=n=>{if(Array.isArray(n)){const e=n.map(r=>Bs(r)).join("");return`02${mr(e.length/2)}${e}`}if((n=>"prim"in n)(n))return MU(n);if((n=>"bytes"in n&&"string"==typeof n.bytes)(n))return mU(n);if((n=>"string"in n&&"string"==typeof n.string)(n))return yU(n);if((n=>"int"in n&&"string"==typeof n.int)(n))return _U(n);throw new iU(JSON.stringify(n))},Ls=n=>{const e=n.consume(1);switch(e[0]){case 10:return vU(n);case 1:return bU(n);case 0:return wU(n);case 2:{const t=new Mo(Ii(n)),r=[];for(;t.length()>0;)r.push(Ls(t));return r}default:return EU(n,e)}},Ii=(n,e=4)=>{const t=n.consume(e),r=parseInt(Buffer.from(t).toString("hex"),16);return n.consume(r)},mU=n=>{if(!/^([A-Fa-f0-9]{2})*$/.test(n.bytes))throw new a6(n.bytes);return`0a${mr(n.bytes.length/2)}${n.bytes}`},vU=n=>{const e=Ii(n);return{bytes:Buffer.from(e).toString("hex")}},yU=n=>{const e=Buffer.from(n.string,"utf8").toString("hex");return`01${mr(e.length/2)}${e}`},bU=n=>{const e=Ii(n);return{string:Buffer.from(e).toString("utf8")}},_U=({int:n})=>{const e=new am(n,10),t="-"===e.toString(2)[0]?"1":"0",r=e.toString(2).replace(/-/g,""),h=r.padStart(r.length<=6?6:(r.length-6)%7?r.length+7-(r.length-6)%7:r.length,"0").match(/\d{6,7}/g).reverse();return h[0]=t+h[0],`00${h.map((D,L)=>parseInt((L===h.length-1?"0":"1")+D,2).toString(16).padStart(2,"0")).join("")}`},wU=n=>{let e=n.consume(1)[0];const t=[];for(;128&e;)t.push(e),e=n.consume(1)[0];t.push(e);const i=!!(64&t[0]);t[0]=127&t[0];const a=t.map((v,D)=>v.toString(2).slice(0===D?-6:-7).padStart(0===D?6:7,"0")).reverse();let h=new am(a.join(""),2);return i&&(h=h.times(-1)),{int:h.toFixed()}},MU=n=>{const e=+Array.isArray(n.annots),t=Array.isArray(n.args)?n.args.length:0,r=mr(Math.min(2*t+e+3,9),2),i=tU[n.prim];let a=(n.args||[]).map(v=>Bs(v)).join("");const h=Array.isArray(n.annots)?CU(n.annots):"";return("LAMBDA"===n.prim||"LAMBDA_REC"===n.prim)&&t&&(a=mr(a.length/2)+a+mr(0)),("pair"===n.prim||"Pair"===n.prim)&&t>2&&(a=""===h?mr(a.length/2)+a+mr(0):mr(a.length/2)+a),"view"===n.prim&&n.args&&(a=mr(a.length/2)+a+mr(0)),`${r}${i}${a}${h}`},EU=(n,e)=>{const t=(e[0]-3)%2==1;let r=Math.floor((e[0]-3)/2);const i=n.consume(1)[0].toString(16).padStart(2,"0"),a={prim:jo[i]};if(("LAMBDA"===jo[i]||"LAMBDA_REC"===jo[i])&&n.consume(4),"view"===jo[i])return 0!=r?xU(n,a):a;let h,v;("pair"===jo[i]||"Pair"===jo[i])&&r>2&&(h=SU(n),r=0,v=C6(n));const D=new Array(r).fill(0).map(()=>Ls(n));return("LAMBDA"===jo[i]||"LAMBDA_REC"===jo[i])&&n.consume(4),h?a.args=h:D.length&&(a.args=D),v&&""!==v[0]?a.annots=v:t&&(a.annots=C6(n)),a},xU=(n,e)=>(n.consume(4),e.args=new Array(4).fill(0).map(()=>Ls(n)),n.consume(4),e),SU=n=>{const e=new Mo(Ii(n)),t=[];for(;e.length()>0;)t.push(Ls(e));return t},CU=n=>{const e=n.map(r=>Buffer.from(r,"utf8").toString("hex")).join("20");return`${mr(e.length/2)}${e}`},C6=n=>{const e=n.consume(4),t=parseInt(Buffer.from(e).toString("hex"),16),r=n.consume(t);return Buffer.from(r).toString("hex").split("20").map(a=>Buffer.from(a,"hex").toString("utf8"))},Qr=n=>e=>(n=>{const e=new Uint8Array(n),t=[];return e.forEach(r=>{const a=`00${r.toString(16)}`.slice(-2);t.push(a)}),t.join("")})(Buffer.from(((n,e)=>vm().decode(n).slice(e.length))(e,hr[n]))),ai=n=>e=>function Vo(n,e){const t="string"==typeof n?Uint8Array.from(o6.lW.from(n,"hex")):n,r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),vm().encode(o6.lW.from(r.buffer))}(e.consume(Ol[n]),hr[n]),AU=ai(rt.TZ1),TU=ai(rt.B),nv=n=>{const e=n.consume(1);return 0===e[0]?ai(rt.TZ1)(n):1===e[0]?ai(rt.TZ2)(n):2===e[0]?ai(rt.TZ3)(n):void 0},DU=Qr(rt.B),IU=Qr(rt.TZ1),A6=n=>n?"ff":"00",T6=n=>Qr(rt.P)(n),D6=n=>ai(rt.P)(n),rv=n=>{switch(n.substring(0,3)){case rt.TZ1:return"00"+Qr(rt.TZ1)(n);case rt.TZ2:return"01"+Qr(rt.TZ2)(n);case rt.TZ3:return"02"+Qr(rt.TZ3)(n);case rt.TZ4:return"03"+Qr(rt.TZ4)(n);default:throw new NF(n,Di(nr.NO_PREFIX_MATCHED)+` expecting one for the following "${rt.TZ1}", "${rt.TZ2}", "${rt.TZ3}" or "${rt.TZ4}".`)}},iv=n=>{const e=[];let t=new Nn(n,10);if(t.isNaN())throw new TypeError(`Invalid zarith number ${n}`);for(;;){if(t.lt(128)){t.lt(16)&&e.push("0"),e.push(t.toString(16));break}{let r=t.mod(128);t=t.minus(r),t=t.dividedBy(128),r=r.plus(128),e.push(r.toString(16))}}return e.join("")},ov=n=>{let e=0;for(;e=0;r-=1){const i=127&n.get(r);t=t.multipliedBy(128),t=t.plus(i)}return n.consume(e+1),new Nn(t).toString()},sH=Qr(rt.VH),aH=ai(rt.VH),hH=Qr(rt.TXR1),dH=ai(rt.TXR1),I6={branch:He.BRANCH,contents:[He.OPERATION]},sv={pkh:He.TZ1,secret:He.SECRET},av={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,public_key:He.PUBLIC_KEY},lv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,delegate:He.DELEGATE},uv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,amount:He.ZARITH,destination:He.ADDRESS,parameters:He.PARAMETERS},cv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,balance:He.ZARITH,delegate:He.DELEGATE,script:He.SCRIPT},fv={source:He.PKH,period:He.INT32,proposal:He.PROPOSAL,ballot:He.BALLOT_STATEMENT},hv={slot:He.INT16,level:He.INT32,round:He.INT32,block_payload_hash:He.BLOCK_PAYLOAD_HASH},dv={level:He.INT32,nonce:He.RAW},pv={source:He.PKH,period:He.INT32,proposals:He.PROPOSAL_ARR},gv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,value:He.VALUE},mv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,ticket_contents:He.VALUE,ticket_ty:He.VALUE,ticket_ticketer:He.ADDRESS,ticket_amount:He.ZARITH,destination:He.ADDRESS,entrypoint:He.ENTRYPOINT},vv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,tx_rollup_origination:He.TX_ROLLUP_ORIGINATION_PARAM},yv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,rollup:He.TX_ROLLUP_ID,content:He.TX_ROLLUP_BATCH_CONTENT,burn_limit:He.BURN_LIMIT},bv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,amount:He.ZARITH,destination:He.SMART_CONTRACT_ADDRESS},_v={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,pk:He.PUBLIC_KEY},wv={consensus_key:He.PKH,delegate:He.PKH,destination:He.PKH},Mv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,limit:He.DEPOSITS_LIMIT},Ev={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,pvm_kind:He.PVM_KIND,kernel:He.PADDED_BYTES,origination_proof:He.PADDED_BYTES,parameters_ty:He.VALUE},xv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,message:He.SMART_ROLLUP_MESSAGE},Sv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,rollup:He.SMART_ROLLUP_ADDRESS,cemented_commitment:He.SMART_ROLLUP_COMMITMENT_HASH,output_proof:He.PADDED_BYTES},Cv={arbitrary:He.PADDED_BYTES},vr=n=>e=>t=>Object.keys(e).reduce((i,a)=>{const h=e[a];if(t&&Array.isArray(h)){const v=n[h[0]],D=t[a];if(!Array.isArray(D))throw new oU(`Invalid operation value "${JSON.stringify(D)}" of key "${a}, expected value to be Array.`);return i+D.reduce((L,j)=>L+v(j),"")}return i+(0,n[h])(t[a])},""),yr=n=>e=>t=>Object.keys(e).reduce((i,a)=>{const h=e[a];if(Array.isArray(h)){const v=n[h[0]],D=[],L=t.length();for(;t.length()>0;)if(D.push(v(t)),L===t.length())throw new E6("Unable to decode value");return Object.assign(Object.assign({},i),{[a]:D})}{const D=n[h](t);return void 0!==D?Object.assign(Object.assign({},i),{[a]:D}):Object.assign({},i)}},{}),qt={[He.SECRET]:n=>y6(n.consume(20)),[He.RAW]:n=>y6(n.consume(32)),[He.TZ1]:AU,[He.BRANCH]:TU,[He.ZARITH]:ov,[He.PUBLIC_KEY]:n=>{switch(n.consume(1)[0]){case 0:return ai(rt.EDPK)(n);case 1:return ai(rt.SPPK)(n);case 2:return ai(rt.P2PK)(n);default:throw new l6(n.toString(),Di(nr.NO_PREFIX_MATCHED))}},[He.PKH]:nv,[He.DELEGATE]:n=>{if((n=>255===n.consume(1)[0])(n))return nv(n)},[He.INT32]:n=>{const e=n.consume(4);let t=0;for(let r=0;r{const e=Ii(n),t=Ii(n);return{code:Ls(new Mo(e)),storage:Ls(new Mo(t))}},[He.BALLOT_STATEMENT]:n=>{const e=n.consume(1);switch(e[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new rU(e[0].toString())}},[He.PROPOSAL]:D6,[He.PROPOSAL_ARR]:n=>{const e=[];for(n.consume(4);n.length()>0;)e.push(D6(n));return e},[He.PARAMETERS]:n=>{if(0!==n.consume(1)[0]){const t=(n=>{const e=mr(n.consume(1)[0],2);if(e in td)return td[e];{const t=Ii(n,1),r=Buffer.from(t).toString("utf8");if(r.length>31)throw new M6(r);return r}})(n),r=Ii(n);return{entrypoint:t,value:Ls(new Mo(r))}}},[He.ADDRESS]:n=>{switch(n.consume(1)[0]){case 0:return nv(n);case 1:{const t=ai(rt.KT1)(n);return n.consume(1),t}default:throw new s6(n.toString(),": Unable to decode.")}},[He.SMART_ROLLUP_ADDRESS]:n=>{const e=ai(rt.SR1)(n);if(e.substring(0,3)!==rt.SR1)throw new x6(e,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.SR1}'.`);return e},[He.SMART_CONTRACT_ADDRESS]:n=>{if(1===n.consume(1)[0]){const t=ai(rt.KT1)(n);return n.consume(1),t}throw new u6(n.toString(),Di(nr.NO_PREFIX_MATCHED))},[He.SMART_ROLLUP_COMMITMENT_HASH]:n=>{const e=ai(rt.SRC1)(n);if(e.substring(0,4)!==rt.SRC1)throw new S6(e,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.SRC1}'`);return e},[He.VALUE]:n=>{const e=Ii(n);return Ls(new Mo(e))},[He.INT16]:n=>{const e=n.consume(2);let t=0;for(let r=0;r{const e=Ii(n);return Buffer.from(e).toString("utf8")},[He.TX_ROLLUP_ORIGINATION_PARAM]:n=>({}),[He.TX_ROLLUP_ID]:dH,[He.TX_ROLLUP_BATCH_CONTENT]:n=>{const e=Ii(n);return Buffer.from(e).toString("hex")},[He.BURN_LIMIT]:n=>{const e=n.consume(1);if("00"!==Buffer.from(e).toString("hex"))return ov(n)},[He.DEPOSITS_LIMIT]:n=>{const e=n.consume(1);if("00"!==Buffer.from(e).toString("hex"))return ov(n)},[He.PVM_KIND]:n=>{const e=n.consume(1);switch(e[0]){case 0:return"arith";case 1:return"wasm_2_0_0";default:throw new lU(e[0].toString())}},[He.PADDED_BYTES]:n=>{const e=Ii(n);return Buffer.from(e).toString("hex")},[He.SMART_ROLLUP_MESSAGE]:n=>{const e=Ii(n);return((n,e=4)=>{const t=[];let r=n;for(;r.length();){const i=r.consume(e),a=parseInt(Buffer.from(i).toString("hex"),16);t.push(r.consume(a)),r=r.slice(a+e)}return t})(new Mo(e)).map(r=>Buffer.from(r).toString("hex"))}};qt[He.OPERATION]=(n=>e=>{const t=e.consume(1),r=tv[t[0]];if(void 0===r)throw new sU(t[0].toString());const i=n[r](e);if("object"!=typeof i)throw new E6("Invalid operation, cannot be decoded.");return Object.assign({kind:r},i)})(qt),qt[He.OP_ACTIVATE_ACCOUNT]=n=>yr(qt)(sv)(n),qt[He.OP_FAILING_NOOP]=n=>yr(qt)(Cv)(n),qt[He.OP_DELEGATION]=n=>yr(qt)(lv)(n),qt[He.OP_TRANSACTION]=n=>yr(qt)(uv)(n),qt[He.OP_ORIGINATION]=n=>yr(qt)(cv)(n),qt[He.OP_BALLOT]=n=>yr(qt)(fv)(n),qt[He.OP_ENDORSEMENT]=n=>yr(qt)(hv)(n),qt[He.OP_SEED_NONCE_REVELATION]=n=>yr(qt)(dv)(n),qt[He.OP_PROPOSALS]=n=>yr(qt)(pv)(n),qt[He.OP_REVEAL]=n=>yr(qt)(av)(n),qt[He.OP_REGISTER_GLOBAL_CONSTANT]=n=>yr(qt)(gv)(n),qt[He.OP_TRANSFER_TICKET]=n=>yr(qt)(mv)(n),qt[He.OP_TX_ROLLUP_ORIGINATION]=n=>yr(qt)(vv)(n),qt[He.OP_TX_ROLLUP_SUBMIT_BATCH]=n=>yr(qt)(yv)(n),qt[He.OP_INCREASE_PAID_STORAGE]=n=>yr(qt)(bv)(n),qt[He.OP_UPDATE_CONSENSUS_KEY]=n=>yr(qt)(_v)(n),qt[He.OP_DRAIN_DELEGATE]=n=>yr(qt)(wv)(n),qt[He.OP_SMART_ROLLUP_ORIGINATE]=n=>yr(qt)(Ev)(n),qt[He.OP_SMART_ROLLUP_ADD_MESSAGES]=n=>yr(qt)(xv)(n),qt[He.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=n=>yr(qt)(Sv)(n),qt[He.MANAGER]=yr(qt)(I6),qt[He.OP_SET_DEPOSITS_LIMIT]=n=>yr(qt)(Mv)(n);const Wt={[He.SECRET]:n=>n,[He.RAW]:n=>n,[He.TZ1]:IU,[He.BRANCH]:DU,[He.ZARITH]:iv,[He.PUBLIC_KEY]:n=>{switch(n.substring(0,4)){case rt.EDPK:return"00"+Qr(rt.EDPK)(n);case rt.SPPK:return"01"+Qr(rt.SPPK)(n);case rt.P2PK:return"02"+Qr(rt.P2PK)(n);default:throw new l6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting one of the following '${rt.EDPK}', '${rt.SPPK}', '${rt.P2PK}' or '${rt.BLPK}'.`)}},[He.PKH]:rv,[He.DELEGATE]:n=>n?A6(!0)+rv(n):A6(!1),[He.SCRIPT]:n=>{const e=Bs(n.code),t=Bs(n.storage);return`${mr(e.length/2,8)}${e}${mr(t.length/2,8)}${t}`},[He.BALLOT_STATEMENT]:n=>{switch(n){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new nU(n)}},[He.PROPOSAL]:T6,[He.PROPOSAL_ARR]:n=>mr(32*n.length)+n.map(e=>T6(e)).join(""),[He.INT32]:n=>{const e=parseInt(String(n),10),t=[];for(let r=0;r<4;r++){const i=8*(4-(r+1));t.push((e&255<>i)}return Buffer.from(t).toString("hex")},[He.PARAMETERS]:n=>{if(!n||"default"===n.entrypoint&&"prim"in n.value&&"Unit"===n.value.prim)return"00";const e=(n=>{if(n in _6)return`${_6[n]}`;if(n.length>31)throw new M6(n);return`ff${Bs({string:n}).slice(8)}`})(n.entrypoint),t=Bs(n.value);return`ff${e}${(t.length/2).toString(16).padStart(8,"0")}${t}`},[He.ADDRESS]:n=>{switch(n.substring(0,3)){case rt.TZ1:case rt.TZ2:case rt.TZ3:case rt.TZ4:return"00"+rv(n);case rt.KT1:return"01"+Qr(rt.KT1)(n)+"00";default:throw new s6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting one of the following prefix '${rt.TZ1}', ${rt.TZ2}', '${rt.TZ3}', '${rt.TZ4}' or '${rt.KT1}'.`)}},[He.SMART_ROLLUP_ADDRESS]:n=>{if(n.substring(0,3)!==rt.SR1)throw new x6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.SR1}'.`);return Qr(rt.SR1)(n)},[He.SMART_CONTRACT_ADDRESS]:n=>{if(n.substring(0,3)===rt.KT1)return"01"+Qr(rt.KT1)(n)+"00";throw new u6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.KT1}'.`)},[He.SMART_ROLLUP_COMMITMENT_HASH]:n=>{if(n.substring(0,4)===rt.SRC1)return Qr(rt.SRC1)(n);throw new S6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.SRC1}'`)},[He.VALUE]:n=>{const e=Bs(n);return`${mr(e.length/2)}${e}`},[He.INT16]:n=>{const e=parseInt(String(n),10),t=[];for(let r=0;r<2;r++){const i=8*(2-(r+1));t.push((e&255<>i)}return Buffer.from(t).toString("hex")},[He.BLOCK_PAYLOAD_HASH]:sH,[He.ENTRYPOINT]:n=>`${Bs({string:n}).slice(2)}`,[He.TX_ROLLUP_ORIGINATION_PARAM]:n=>"",[He.TX_ROLLUP_ID]:hH,[He.TX_ROLLUP_BATCH_CONTENT]:n=>`${mr(n.length/2)}${n}`,[He.BURN_LIMIT]:n=>n?`ff${iv(n)}`:"00",[He.DEPOSITS_LIMIT]:n=>n?`ff${iv(n)}`:"00",[He.PVM_KIND]:n=>{switch(n){case"arith":return"00";case"wasm_2_0_0":return"01";default:throw new aU(n)}},[He.PADDED_BYTES]:(n,e=8)=>`${mr(n.length/2,e)}${n}`,[He.SMART_ROLLUP_MESSAGE]:n=>{const e=n.reduce((t,r)=>t+`${mr(r.length/2)}${r}`,"");return`${mr(e.length/2)}${e}`}};Wt[He.OPERATION]=(n=>e=>{if(!(e.kind in n)||!(e.kind in b6))throw new c6(e.kind);return b6[e.kind]+n[e.kind](e)})(Wt),Wt[He.OP_ACTIVATE_ACCOUNT]=n=>vr(Wt)(sv)(n),Wt[He.OP_DELEGATION]=n=>vr(Wt)(lv)(n),Wt[He.OP_TRANSACTION]=n=>vr(Wt)(uv)(n),Wt[He.OP_ORIGINATION]=n=>vr(Wt)(cv)(n),Wt[He.OP_BALLOT]=n=>vr(Wt)(fv)(n),Wt[He.OP_ENDORSEMENT]=n=>vr(Wt)(hv)(n),Wt[He.OP_SEED_NONCE_REVELATION]=n=>vr(Wt)(dv)(n),Wt[He.OP_PROPOSALS]=n=>vr(Wt)(pv)(n),Wt[He.OP_REVEAL]=n=>vr(Wt)(av)(n),Wt[He.OP_REGISTER_GLOBAL_CONSTANT]=n=>vr(Wt)(gv)(n),Wt[He.OP_TRANSFER_TICKET]=n=>vr(Wt)(mv)(n),Wt[He.OP_TX_ROLLUP_ORIGINATION]=n=>vr(Wt)(vv)(n),Wt[He.OP_TX_ROLLUP_SUBMIT_BATCH]=n=>vr(Wt)(yv)(n),Wt[He.OP_INCREASE_PAID_STORAGE]=n=>vr(Wt)(bv)(n),Wt[He.OP_UPDATE_CONSENSUS_KEY]=n=>vr(Wt)(_v)(n),Wt[He.OP_DRAIN_DELEGATE]=n=>vr(Wt)(wv)(n),Wt[He.OP_SMART_ROLLUP_ORIGINATE]=n=>vr(Wt)(Ev)(n),Wt[He.OP_SMART_ROLLUP_ADD_MESSAGES]=n=>vr(Wt)(xv)(n),Wt[He.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=n=>vr(Wt)(Sv)(n),Wt[He.MANAGER]=vr(Wt)(I6),Wt[He.OP_SET_DEPOSITS_LIMIT]=n=>vr(Wt)(Mv)(n),Wt[He.OP_FAILING_NOOP]=n=>vr(Wt)(Cv)(n);const R6={activate_account:sv,reveal:av,delegation:lv,transaction:uv,origination:cv,ballot:fv,endorsement:hv,seed_nonce_revelation:dv,proposals:pv,register_global_constant:gv,transfer_ticket:mv,tx_rollup_origination:vv,tx_rollup_submit_batch:yv,increase_paid_storage:bv,update_consensus_key:_v,drain_delegate:wv,set_deposits_limit:Mv,smart_rollup_originate:Ev,smart_rollup_add_messages:xv,smart_rollup_execute_outbox_message:Sv,failing_noop:Cv},TH=n=>Object.keys(R6).includes(n),DH=n=>{const e=n.kind,r=((n,e)=>n.filter(t=>"kind"!==t))(Object.keys(n));return((n,e)=>e.filter(t=>!n.includes(t)))(r,Object.keys(R6[e]))};var nd=(()=>(function(n){n.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",n.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",n.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",n.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",n.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",n.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",n.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",n.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",n.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",n.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",n.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",n.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",n.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",n.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",n.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",n.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",n.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(nd||(nd={})),nd))();const IH=nd.PtMumbai2,PH=new class OH{constructor(e=IH){this.protocolHash=e,this.codec=function RH(n,e){return{encoder:Wt[n],decoder:t=>{const r=Mo.fromHexString(t);return qt[n](r)}}}(He.MANAGER)}forge(e){const t=function ZF(n){return function wo(n,e){const t=new RegExp(`^(${e.join("|")})`).exec(n);if(!t||0===t.length)return nr.NO_PREFIX_MATCHED;const r=t[0];if(!function VF(n){return"string"==typeof n&&n in hr}(r))return nr.NO_PREFIX_MATCHED;if(n.includes("%")&&(n=n.split("%")[0]),!/^(KT1\w{33})$/.test(n)&&"KT1"===r)return nr.INVALID_CHECKSUM;let a=vm().decodeUnsafe(n);return a?(a=a.slice(hr[r].length),a.length!==Ol[r]?nr.INVALID_LENGTH:nr.VALID):nr.INVALID_CHECKSUM}(n,KF)}(e.branch);if(t!==nr.VALID)throw new PF(e.branch,Di(t));for(const i of e.contents){if(!TH(i.kind))throw new c6(i.kind);const a=DH(i);if(1===a.length){if("delegation"===i.kind&&"delegate"===a[0])continue;if("origination"===i.kind&&"delegate"===a[0])continue;if("transaction"===i.kind&&"parameters"===a[0])continue;if("set_deposits_limit"===i.kind&&"limit"===a[0])continue;if("tx_rollup_submit_batch"===i.kind&&"burn_limit"===a[0])continue;throw new w6(i,`missing properties "${a.join(", ")}"`)}if(a.length>1)throw new w6(i,`missing properties "${a.join(", ")}"`)}const r=this.codec.encoder(e).toLowerCase();return Promise.resolve(r)}parse(e){return Promise.resolve(this.codec.decoder(e))}},kH=function(){var n=Ot(function*(e,t,r){let i=0;return e.contents.forEach((a,h)=>{const{metadata:v}=t.contents[h];if(!v.operation_result)return;const D=a,L=v.operation_result;if(L.errors)throw new Error(`The operation produced an error ${JSON.stringify(L.errors)}`);let{gasLimit:j,storageLimit:Q}=(n=>{let e=0,t=0;return n.internal_operation_results?(n.internal_operation_results.forEach(r=>{if(null==r?void 0:r.result){if(r.result.errors)throw new Error(`An internal operation produced an error ${JSON.stringify(r.result.errors)}`);e+=Math.ceil(Number(r.result.consumed_milligas)/1e3),r.result.paid_storage_size_diff&&(t+=Number(r.result.paid_storage_size_diff)),r.result.originated_contracts&&(t+=257*r.result.originated_contracts.length),r.result.allocated_destination_contract&&(t+=257)}}),{gasLimit:e,storageLimit:t}):{gasLimit:e,storageLimit:t}})(v);j+=Math.ceil(Number(L.consumed_milligas)/1e3),L.paid_storage_size_diff&&(Q+=Number(L.paid_storage_size_diff)),L.originated_contracts&&(Q+=257*L.originated_contracts.length),L.allocated_destination_contract&&(Q+=257),(D.gas_limit&&r||D.gas_limit===gc)&&(D.gas_limit=j.toString()),(D.storage_limit&&r||D.storage_limit===Jm)&&(D.storage_limit=Q.toString()),i+=j}),i});return function(t,r,i){return n.apply(this,arguments)}}(),BH=function(){var n=Ot(function*(e,t,r=!0,i){const h=[Ir.TRANSACTION,Ir.REVEAL,Ir.ORIGINATION,Ir.DELEGATION],v=e.contents.map((ye,Te)=>{if(!h.includes(ye.kind))return ye;const Ve=ye,je=new Nn(26e5).dividedToIntegerBy(e.contents.length),gt=new Nn(gc).gt(je)?je:gc,Ie=i?i.plus(Te).toString():Ve.counter;return Object.assign(Object.assign({},ye),{gas_limit:gt,counter:Ie})}),L={chain_id:(yield fetch(`${t}chains/main/blocks/head/header`).then(ye=>ye.json())).chain_id,operation:{branch:e.branch,contents:v,signature:"sigUHx32f9wesZ1n2BWpixXz4AQaZggEtchaQNHYGRCoWNAXx45WGW2ua3apUUUAGMLPwAU41QoaFCzVSL61VaessLg4YbbP"}},j=yield PH.forge(e),Q=yield fetch(`${t}chains/main/blocks/head/helpers/scripts/run_operation`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)}).then(ye=>ye.json()).catch(ye=>{throw ye});if(e.contents.length!==Q.contents.length)throw new Error(`Run Operation did not return same number of operations. Locally we have ${e.contents.length}, but got back ${Q.contents.length}`);const me=yield kH(e,Q,r);if(r||e.contents.some(ye=>"0"===(null==ye?void 0:ye.fee))){const ye=100+1*Math.ceil((j.length+128)/2)+.1*me+100,Te=e.contents.filter(je=>"reveal"!==je.kind),Ve=Math.ceil(ye/Te.length);e.contents.forEach(je=>{je.fee&&"reveal"!==je.kind&&(je.fee=Ve.toString())})}return e});return function(t,r){return n.apply(this,arguments)}}(),LH=function(){var n=Ot(function*(e,t,r){let i=new Nn(0);try{const a=yield fetch(`${t}chains/main/blocks/head/context/contracts/${e}/balance`).then(h=>h.json());i=i.plus(new Nn(a))}catch(a){if(a.response&&404!==a.response.status)throw new Error("Error fetching balance")}return i.toString(10)});return function(t,r,i){return n.apply(this,arguments)}}(),FH=function(){var n=Ot(function*(e,t,r,i,a,h){var v,D,L,j,Q;const me=e;if(!me.public_key)throw new Error('property "public_key" was not defined');return me.source=null!==(v=me.source)&&void 0!==v?v:t,me.counter=null!==(D=me.counter)&&void 0!==D?D:r,me.fee=null!==(L=me.fee)&&void 0!==L?L:i,me.gas_limit=null!==(j=me.gas_limit)&&void 0!==j?j:a,me.storage_limit=null!==(Q=me.storage_limit)&&void 0!==Q?Q:h,me});return function(t,r,i,a,h,v){return n.apply(this,arguments)}}(),UH=function(){var n=Ot(function*(e,t,r,i,a,h){var v,D,L,j,Q;const me=e;return me.source=null!==(v=me.source)&&void 0!==v?v:t,me.counter=null!==(D=me.counter)&&void 0!==D?D:r,me.fee=null!==(L=me.fee)&&void 0!==L?L:i,me.gas_limit=null!==(j=me.gas_limit)&&void 0!==j?j:a,me.storage_limit=null!==(Q=me.storage_limit)&&void 0!==Q?Q:h,me});return function(t,r,i,a,h,v){return n.apply(this,arguments)}}(),HH=function(){var n=Ot(function*(e,t,r,i){var a,h,v,D,L;const j=e;if(!j.amount)throw new Error('property "amount" was not defined');if(!j.destination)throw new Error('property "destination" was not defined');return j.source=null!==(a=j.source)&&void 0!==a?a:t,j.counter=null!==(h=j.counter)&&void 0!==h?h:r,j.fee=null!==(v=j.fee)&&void 0!==v?v:i,j.gas_limit=null!==(D=j.gas_limit)&&void 0!==D?D:gc,j.storage_limit=null!==(L=j.storage_limit)&&void 0!==L?L:Jm,j});return function(t,r,i,a){return n.apply(this,arguments)}}(),VH=function(){var n=Ot(function*(e,t,r,i){var a,h,v,D,L;const j=e;if(!j.balance)throw new Error('property "balance" was not defined');if(!j.script)throw new Error('property "script" was not defined');return j.source=null!==(a=j.source)&&void 0!==a?a:t,j.counter=null!==(h=j.counter)&&void 0!==h?h:r,j.fee=null!==(v=j.fee)&&void 0!==v?v:i,j.gas_limit=null!==(D=j.gas_limit)&&void 0!==D?D:gc,j.storage_limit=null!==(L=j.storage_limit)&&void 0!==L?L:Jm,j});return function(t,r,i,a){return n.apply(this,arguments)}}(),O6=function(){var n=Ot(function*(e,t,r,i,a=!0){let h=new Nn(1);const v=[],D=yield Promise.all((yield Promise.all([fetch(`${i}chains/main/blocks/head/context/contracts/${e}/counter`),fetch(`${i}chains/main/blocks/head~2/hash`),fetch(`${i}chains/main/blocks/head/context/contracts/${e}/manager_key`)]).catch(Ve=>{throw new Error(Ve)})).map(Ve=>Ve.json()));h=new Nn(D[0]).plus(1);const L=D[1],j=D[2],Q=r.some(Ve=>Ve.kind===Ir.REVEAL);!j&&!Q&&(v.push(yield RF(h,t,e)),h=h.plus(1));const me=r.map(function(){var Ve=Ot(function*(je,gt){if(!je.kind)throw new Error(`property "kind" was not defined ${JSON.stringify(je)}`);const Ie=je.destination;let _t;(null==Ie?void 0:Ie.toLowerCase().startsWith("tz"))&&(_t=new Nn(yield LH(Ie,i)));const At=h.plus(gt).toFixed(),Zt=(null==_t?void 0:_t.isZero())&&Ie&&Ie.toLowerCase().startsWith("tz")?"300":"0";switch(je.kind){case Ir.REVEAL:return FH(je,e,At,"0","10300",Zt);case Ir.DELEGATION:return UH(je,e,At,"0","10300",Zt);case Ir.TRANSACTION:return HH(je,e,At,"0");case Ir.ORIGINATION:return VH(je,e,At,"0");case Ir.ENDORSEMENT:case Ir.SEED_NONCE_REVELATION:case Ir.DOUBLE_ENDORSEMENT_EVIDENCE:case Ir.DOUBLE_BAKING_EVIDENCE:case Ir.ACTIVATE_ACCOUNT:case Ir.PROPOSALS:case Ir.BALLOT:return je;default:throw new Error(`unsupported operation type "${JSON.stringify(je.kind)}"`)}});return function(je,gt){return Ve.apply(this,arguments)}}());return v.push(...yield Promise.all(me)),yield BH({branch:L,contents:v},i,a)});return function(t,r,i,a){return n.apply(this,arguments)}}();let rd=(()=>{class n{constructor(t){this.toastr=t}showTxSuccessToast(){return this.toastr.success("Operation sent",void 0,{progressBar:!0,positionClass:"toast-bottom-center"})}showTxErrorToast(){return this.toastr.error("Operaton failed to send",void 0,{progressBar:!0,positionClass:"toast-bottom-center"})}showCopiedToClipboard(){return this.toastr.success("Copied to clipboard","Success",{progressBar:!0,positionClass:"toast-bottom-center"})}showOperationRequestReceivedToast(){return this.toastr.success("Operation request received","Success",{closeButton:!0,timeOut:0,positionClass:"toast-bottom-center"})}showSignRequestReceivedToast(){return this.toastr.success("Sign request received","Success",{closeButton:!0,timeOut:0,positionClass:"toast-bottom-center"})}}return n.\u0275fac=function(t){return new(t||n)(Mt(Qh))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function jH(n,e){if(1&n&&(Ue(0,"small",10),ft(1),Ge()),2&n){const t=zt();bt(1),Vn("Fee: ",t.fee," \ua729")}}let $H=(()=>{class n{constructor(t,r,i,a,h){this.bsModalRef=t,this.apiService=r,this.accountService=i,this.beaconService=a,this.toastService=h,this.recipient="",this.amount="",this.usdAmount="0.00",this.usdPrice=0,this.apiService.getXtzPrice().then(v=>this.usdPrice=v)}ngOnInit(){}send(){var t=this;return Ot(function*(){t.accountService.accounts$.pipe(fi()).subscribe(function(){var r=Ot(function*(i){const a=i[0],h=[{kind:xl.TRANSACTION,amount:new Nn(t.amount).times(1e6).toString(),destination:t.recipient}];try{const v=yield O6(a.address,a.publicKey,h,t.apiService.RPCs[Gi.MAINNET].selected+"/");t.fee=new Nn(v.contents[0].fee).div(1e6).toString();const D=yield Tm(h);t.toastService.showTxSuccessToast(),console.log("RESULT",D)}catch(v){t.toastService.showTxErrorToast()}t.bsModalRef.hide()});return function(i){return r.apply(this,arguments)}}())})()}onAmountChanged(t){this.amount=t,this.usdAmount=new Nn(t).times(this.usdPrice).toString(10)}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Ju),ot(Os),ot(mc),ot(rd))},n.\u0275cmp=Un({type:n,selectors:[["app-send-tez-modal"]],decls:23,vars:5,consts:[[1,"modal-header","send-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","text-center",2,"padding","0"],[1,"modal-title"],[1,"text-left"],["for","amount",2,"margin","0"],[1,"amount-text"],["type","input","id","amount","placeholder","0.00",1,"form-control","custom-input",3,"ngModel","ngModelChange"],[1,"d-flex","justify-content-between"],[1,"form-text","text-muted"],["class","form-text text-muted",4,"ngIf"],["for","sendTo",2,"margin","0"],[1,"send-text"],["type","input","id","sendTo","placeholder","Paste tz address here",1,"form-control","custom-input",3,"ngModel","ngModelChange"],["type","button",1,"btn","button","btn-circle","btn-block",3,"disabled","click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6,"Send tez"),Ge(),Ue(7,"div",5)(8,"label",6)(9,"h5",7),ft(10,"Amount:"),Ge()(),Ue(11,"input",8),Tt("ngModelChange",function(a){return r.onAmountChanged(a)}),Ge(),Ue(12,"div",9)(13,"small",10),ft(14),Ge(),Ft(15,jH,2,1,"small",11),Ge()(),Ue(16,"div",5)(17,"label",12)(18,"h5",13),ft(19,"Send To:"),Ge()(),Ue(20,"input",14),Tt("ngModelChange",function(a){return r.recipient=a}),Ge()(),Ue(21,"button",15),Tt("click",function(){return r.send()}),ft(22," Preview "),Ge()()),2&t&&(bt(11),Ct("ngModel",r.amount),bt(3),Vn("USD: $",r.usdAmount,""),bt(1),Ct("ngIf",r.fee),bt(5),Ct("ngModel",r.recipient),bt(1),Ct("disabled",0===r.amount.length||0===r.recipient.length))},directives:[Il,Vh,pc,fo],styles:[".custom-input[_ngcontent-%COMP%]{padding:0 24px;border-radius:100px;border:1px solid #d2d2d7;min-height:52px}.button[_ngcontent-%COMP%]{width:100%;height:52px;padding:0 24px;border-radius:100px;gap:10px;background-color:#0f61ff;color:#fff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;margin-top:30px;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#183fd7}.btn[_ngcontent-%COMP%]:disabled{background-color:#d2d2d7;color:#86868b}.send-header[_ngcontent-%COMP%]{padding:10px 10px 0 0}.amount-text[_ngcontent-%COMP%]{margin:0 0 12px}.form-text[_ngcontent-%COMP%]{margin:12px 0 0}.send-text[_ngcontent-%COMP%]{margin:24px 0 12px}"]}),n})(),Av=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-text-modal"]],decls:11,vars:3,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"modal-title","pull-left"],[3,"innerHTML"],[1,"modal-footer"],["type","button",1,"btn","btn-default",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6),Ge(),Bt(7,"p",5),Ge(),Ue(8,"div",6)(9,"button",7),Tt("click",function(){return r.bsModalRef.hide()}),ft(10),Ge()()),2&t&&(bt(6),Nr(r.title),bt(1),Ct("innerHTML",r.text,nf),bt(3),Vn(" ",r.closeBtnName," "))},styles:[""]}),n})(),Tv=(()=>{class n{constructor(t){this.toastService=t}copy(t){var r=this;return Ot(function*(){navigator.clipboard.writeText(t).then(()=>{r.toastService.showCopiedToClipboard()}).catch(i=>console.error("Failed to copy!",i))})()}paste(){return Ot(function*(){return navigator.clipboard.readText().then(function(){var t=Ot(function*(r){return r});return function(r){return t.apply(this,arguments)}}()).catch(t=>{throw t})})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(rd))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function N6(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}var Iv=I(5876);const KH=["qrcElement"];let qH=(()=>{class n{constructor(t,r){this.renderer=t,this.sanitizer=r,this.allowEmptyString=!1,this.colorDark="#000000ff",this.colorLight="#ffffffff",this.cssClass="qrcode",this.elementType="canvas",this.errorCorrectionLevel="M",this.margin=4,this.qrdata="",this.scale=4,this.width=10,this.qrCodeURL=new vn,this.context=null}ngOnChanges(){return N6(this,void 0,void 0,function*(){yield this.createQRCode()})}isValidQrCodeText(t){return!1===this.allowEmptyString?!(void 0===t||""===t||"null"===t||null===t):void 0!==t}toDataURL(t){return new Promise((r,i)=>{Iv.hz(this.qrdata,t,(a,h)=>{a?i(a):r(h)})})}toCanvas(t,r){return new Promise((i,a)=>{Iv.rT(t,this.qrdata,r,h=>{h?a(h):i("success")})})}toSVG(t){return new Promise((r,i)=>{Iv.toString(this.qrdata,t,(a,h)=>{a?i(a):r(h)})})}renderElement(t){for(const r of this.qrcElement.nativeElement.childNodes)this.renderer.removeChild(this.qrcElement.nativeElement,r);this.renderer.appendChild(this.qrcElement.nativeElement,t)}createQRCode(){return N6(this,void 0,void 0,function*(){this.version&&this.version>40?(console.warn("[angularx-qrcode] max value for `version` is 40"),this.version=40):this.version&&this.version<1?(console.warn("[angularx-qrcode]`min value for `version` is 1"),this.version=1):void 0!==this.version&&isNaN(this.version)&&(console.warn("[angularx-qrcode] version should be a number, defaulting to auto."),this.version=void 0);try{if(!this.isValidQrCodeText(this.qrdata))throw new Error("[angularx-qrcode] Field `qrdata` is empty, set 'allowEmptyString=\"true\"' to overwrite this behaviour.");this.isValidQrCodeText(this.qrdata)&&""===this.qrdata&&(this.qrdata=" ");const t={color:{dark:this.colorDark,light:this.colorLight},errorCorrectionLevel:this.errorCorrectionLevel,margin:this.margin,scale:this.scale,type:this.elementType,version:this.version,width:this.width},r=this.imageSrc,i=this.imageHeight||40,a=this.imageWidth||40;switch(this.elementType){case"canvas":const h=this.renderer.createElement("canvas");this.context=h.getContext("2d"),this.toCanvas(h,t).then(()=>{if(this.ariaLabel&&this.renderer.setAttribute(h,"aria-label",`${this.ariaLabel}`),this.title&&this.renderer.setAttribute(h,"title",`${this.title}`),r&&this.context){this.centerImage=new Image(a,i),r!==this.centerImage.src&&(this.centerImage.src=r),i!==this.centerImage.height&&(this.centerImage.height=i),a!==this.centerImage.width&&(this.centerImage.width=a);const L=this.centerImage;L&&(L.onload=()=>{var j;null===(j=this.context)||void 0===j||j.drawImage(L,h.width/2-a/2,h.height/2-i/2,a,i)})}this.renderElement(h),this.emitQRCodeURL(h)}).catch(L=>{console.error("[angularx-qrcode] canvas error:",L)});break;case"svg":const v=this.renderer.createElement("div");this.toSVG(t).then(L=>{this.renderer.setProperty(v,"innerHTML",L);const j=v.firstChild;this.renderer.setAttribute(j,"height",`${this.width}`),this.renderer.setAttribute(j,"width",`${this.width}`),this.renderElement(j),this.emitQRCodeURL(j)}).catch(L=>{console.error("[angularx-qrcode] svg error:",L)});break;default:const D=this.renderer.createElement("img");this.toDataURL(t).then(L=>{this.alt&&D.setAttribute("alt",this.alt),this.ariaLabel&&D.setAttribute("aria-label",this.ariaLabel),D.setAttribute("src",L),this.title&&D.setAttribute("title",this.title),this.renderElement(D),this.emitQRCodeURL(D)}).catch(L=>{console.error("[angularx-qrcode] img/url error:",L)})}}catch(t){console.error("[angularx-qrcode] Error generating QR Code:",t.message)}})}emitQRCodeURL(t){const r=t.constructor.name;if(r===SVGSVGElement.name){const h=new Blob([t.outerHTML],{type:"image/svg+xml"}),v=URL.createObjectURL(h),D=this.sanitizer.bypassSecurityTrustUrl(v);return void this.qrCodeURL.emit(D)}let i="";r===HTMLCanvasElement.name&&(i=t.toDataURL("image/png")),r===HTMLImageElement.name&&(i=t.src),fetch(i).then(a=>a.blob()).then(a=>URL.createObjectURL(a)).then(a=>this.sanitizer.bypassSecurityTrustUrl(a)).then(a=>{this.qrCodeURL.emit(a)}).catch(a=>{console.error("[angularx-qrcode] Error when fetching image/png URL: "+a)})}}return n.\u0275fac=function(t){return new(t||n)(ot(Fi),ot(Wf))},n.\u0275cmp=Un({type:n,selectors:[["qrcode"]],viewQuery:function(t,r){if(1&t&&jw(KH,7),2&t){let i;Ef(i=function xf(){return function jD(n,e){return n[19].queries[e].queryList}(Et(),x1())}())&&(r.qrcElement=i.first)}},inputs:{allowEmptyString:"allowEmptyString",colorDark:"colorDark",colorLight:"colorLight",cssClass:"cssClass",elementType:"elementType",errorCorrectionLevel:"errorCorrectionLevel",imageSrc:"imageSrc",imageHeight:"imageHeight",imageWidth:"imageWidth",margin:"margin",qrdata:"qrdata",scale:"scale",version:"version",width:"width",alt:"alt",ariaLabel:"ariaLabel",title:"title"},outputs:{qrCodeURL:"qrCodeURL"},features:[qr],decls:2,vars:2,consts:[["qrcElement",""]],template:function(t,r){1&t&&Bt(0,"div",null,0),2&t&&so(r.cssClass)},encapsulation:2,changeDetection:0}),n})(),WH=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:[]}),n})(),Rv=(()=>{class n{transform(t,r={}){if(!t||"string"!=typeof t)return"";let i=t;return t.length>=13&&(void 0===r.ifMatches||i.match(r.ifMatches))&&(i=`${t.substr(0,7)}...${t.substr(-4)}`),i}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=Gr({name:"shortenString",type:n,pure:!0}),n})(),ZH=(()=>{class n{constructor(t,r){this.bsModalRef=t,this.clipboardService=r,this.qrData=""}ngOnInit(){}copyToClipboard(){this.clipboardService.copy(this.qrData)}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Tv))},n.\u0275cmp=Un({type:n,selectors:[["app-qr-modal"]],decls:15,vars:7,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","d-flex","flex-column","align-items-center"],[1,"modal-title"],[3,"qrdata","width","errorCorrectionLevel","click"],[1,"addressBox"],["src","./assets/metamask-logo-sm.svg","alt","SVG Image",2,"width","16px","height","16px"],[1,"addressContainer"],[1,"textAddress"],["src","./assets/icons/FiCopy.svg","alt","SVG Image",1,"copy-button",2,"width","16px","height","16px",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6),Ge(),Ue(7,"qrcode",5),Tt("click",function(){return r.copyToClipboard()}),Ge(),Ue(8,"div",6),Bt(9,"img",7),Ue(10,"div",8)(11,"div",9),ft(12),Qo(13,"shortenString"),Ge(),Ue(14,"img",10),Tt("click",function(){return r.copyToClipboard()}),Ge()()()()),2&t&&(bt(6),Nr(r.title),bt(1),Ct("qrdata",r.qrData)("width",256)("errorCorrectionLevel","M"),bt(5),Vn(" ",Js(13,5,r.qrData)," "))},directives:[qH],pipes:[Rv],styles:[".addressContainer[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.addressBox[_ngcontent-%COMP%]{width:200px;display:flex;justify-content:center;align-items:center;margin:10px;gap:6px;padding:11px 16px;background:#f5f5f7;border-radius:100px;height:40px;cursor:pointer}.textAddress[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;color:#1d1d1f;word-wrap:break-word}.addressBox[_ngcontent-%COMP%]:hover{background-color:#d2d2d7}.addressBox[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:focus{background-color:#d2d2d7;outline:none}.addressBox[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{background-color:#d2d2d7;cursor:pointer}"]}),n})(),XH=(()=>{class n{constructor(t,r,i){var a=this;this.bsModalRef=t,this.accountService=r,this.beaconService=i,this.address="",this.accountService.accounts$.pipe(fi()).subscribe(function(){var h=Ot(function*(v){v[0]&&(a.address=v[0].address)});return function(v){return h.apply(this,arguments)}}())}ngOnInit(){}close(){this.bsModalRef.hide(),this.beaconService.handlePendingRequest()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Os),ot(mc))},n.\u0275cmp=Un({type:n,selectors:[["app-connected-modal"]],decls:29,vars:1,consts:[[1,"modal-header"],[1,"modalTitle","modal-title"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modalContainer"],[1,"modal-body",2,"padding","20px"],[1,"inputTitle"],[1,"inputBox"],[1,"inputText"],[1,"inputTitleA"],[1,"infoInputBox"],["src","./assets/icons/FiAlertCircleRed.svg","alt","alert",2,"width","20px","height","20px"],[1,"infoInputText"],["src","./assets/icons/FiAlertCircleBlack.svg","alt","alert",2,"width","20px","height","20px"],[1,"modal-footer",2,"width","fit-content","padding","0"],["type","button",1,"button","btn","btn-block","btn-primary",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h2",1),ft(2,"Connected To MetaMask"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.close()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"div",5)(8,"p",6),ft(9,"Network:"),Ge(),Ue(10,"div",7)(11,"p",8),ft(12,"Mainnet"),Ge()(),Ue(13,"p",9),ft(14,"Account:"),Ge(),Ue(15,"div",7)(16,"p",8),ft(17),Ge()(),Ue(18,"div",10),Bt(19,"img",11),Ue(20,"p",12),ft(21," This account was generated with your MetaMask Secret Recovery Phrase. "),Ge()(),Ue(22,"div",10),Bt(23,"img",13),Ue(24,"p",12),ft(25," This explorer will allow you to connect with Tezos dApps and send/receive tokens via the MetaMask Wallet. Note, this account won't be visible in your MetaMask browser extension. "),Ge()()(),Ue(26,"div",14)(27,"button",15),Tt("click",function(){return r.close()}),ft(28," Got it! "),Ge()()()),2&t&&(bt(17),Nr(r.address))},styles:[".modalContainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}.modal-footer[_ngcontent-%COMP%]{display:flex;justify-content:center}.modalTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:center;margin:0 auto;padding-left:30px}.inputTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:19px;letter-spacing:0em;text-align:left;margin:0 0 12px}.inputTitleA[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:19px;letter-spacing:0em;text-align:left;margin:24px 0 12px}.inputBox[_ngcontent-%COMP%]{width:400px;height:50px;padding:0 24px;border-radius:100px;border:2px;gap:10px;background-color:#f5f5f7;display:flex;justify-content:left;align-items:center}.inputText[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:600;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto;color:#424245}.infoInputBox[_ngcontent-%COMP%]{width:400px;padding:20px;border-radius:10px;gap:10px;background-color:#f5f5f7;display:flex;justify-content:left;align-items:center;margin-top:30px}.infoInputText[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto}.button[_ngcontent-%COMP%]{width:400px;height:52px;padding:0 24px;border-radius:100px;gap:10px;background-color:#0f61ff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#183fd7;color:#fff}"]}),n})();function YH(n,e){if(1&n){const t=oo();Ue(0,"span",5)(1,"div",6)(2,"div",7),Bt(3,"img",8),Ge(),Ue(4,"div",9)(5,"div")(6,"p",10),ft(7),Ge(),Ue(8,"p",11),ft(9),Ge()(),Ue(10,"div",12)(11,"div",13)(12,"a",14),Tt("click",function(){ui(t);const i=zt();return i.openLink("https://tzkt.io/"+i.nft.token.contract.address+"/tokens/"+i.nft.token.tokenId+"/transfers")}),ft(13," Tezos Blockchain "),Bt(14,"img",15),Ge(),Ue(15,"a",16),Tt("click",function(){ui(t);const i=zt();return i.openLink("https://better-call.dev/mainnet/"+i.nft.token.contract.address+"/operations")}),ft(16," Smart Contract "),Bt(17,"img",15),Ge()()()()()()}if(2&n){const t=zt();bt(3),Ct("src",t.nft.token.metadata.sanitizedThumbnailUri,ws),bt(4),Nr(t.nft.token.metadata.name),bt(2),Nr(t.nft.token.metadata.description)}}let QH=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}openLink(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-nft-modal"]],decls:6,vars:1,consts:[[1,"modal-header",2,"padding","0","padding-top","10px","padding-right","10px"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","text-center",2,"padding","0"],["class","nft-info",4,"ngIf"],[1,"nft-info"],[1,"d-flex","flex-lg-row","flex-column","align-items-start"],[1,"image-container"],[1,"img-fluid","max-400",3,"src"],[1,"text-container","ml-lg-3","d-flex","flex-column"],[1,"text-name"],[1,"text-description"],[1,"mt-auto"],[1,"links"],["href","#",1,"custom-link",3,"click"],["src","./assets/icons/Links.svg","alt","SVG Image",1,"link-icon"],["href","#",1,"custom-link",2,"margin-left","10px",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3),Ft(5,YH,18,3,"span",4),Ge()),2&t&&(bt(5),Ct("ngIf",r.nft))},directives:[fo],styles:[".nft-info[_ngcontent-%COMP%]{display:flex;align-items:center;max-width:100%;max-height:100%;overflow:hidden;height:100%;width:100%;box-sizing:border-box;flex-wrap:wrap}.text-container[_ngcontent-%COMP%]{flex:1;text-align:left}.max-400[_ngcontent-%COMP%]{max-width:400px;max-height:400px;width:auto;height:auto;object-fit:contain}.custom-link[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:12px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;color:#0f61ff;text-decoration:none;display:inline-block;margin-top:5px}.text-name[_ngcontent-%COMP%]{font-weight:700}.custom-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.link-icon[_ngcontent-%COMP%]{width:14px;height:14px;margin-left:1px;margin-bottom:1px}@media (max-width: 767px){.max-400[_ngcontent-%COMP%]{max-width:100%;max-height:none}.text-container[_ngcontent-%COMP%]{margin-top:30px}}@media (min-width: 992px){.text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between;height:400px}.image-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;justify-content:center;align-items:center}.text-container[_ngcontent-%COMP%] .links[_ngcontent-%COMP%]{margin-top:auto}}"]}),n})();function JH(n,e){if(1&n&&(Ue(0,"small",15),ft(1),Ge()),2&n){const t=zt();bt(1),Vn("Fee: ",t.fee," \ua729")}}let eV=(()=>{class n{constructor(t,r,i,a,h){this.bsModalRef=t,this.apiService=r,this.accountService=i,this.beaconService=a,this.toastService=h,this.recipient="",this.amount=""}ngOnInit(){}send(){var t=this;return Ot(function*(){const r=(a,h,v,D,L)=>({kind:xl.TRANSACTION,amount:"0",destination:a,parameters:{entrypoint:"transfer",value:[{prim:"Pair",args:[{string:h},[{prim:"Pair",args:[{string:v},{prim:"Pair",args:[{int:D},{int:L}]}]}]]}]}}),i=(a,h,v,D)=>({kind:xl.TRANSACTION,amount:"0",destination:a,parameters:{entrypoint:"transfer",value:{prim:"Pair",args:[{string:h},{prim:"Pair",args:[{string:v},{int:D}]}]}}});t.accountService.accounts$.pipe(fi()).subscribe(function(){var a=Ot(function*(h){if(!t.token)return;const v=h[0],D=new Nn(t.amount).shiftedBy(new Nn(t.token.token.metadata.decimals).toNumber()).toString(10),L=["fa2"===t.token.token.standard?r(t.token.token.contract.address,v.address,t.recipient,t.token.token.tokenId,D):i(t.token.token.contract.address,v.address,t.recipient,D)];try{const j=yield O6(v.address,v.publicKey,L,t.apiService.RPCs[Gi.MAINNET].selected+"/");t.fee=new Nn(j.contents[0].fee).div(1e6).toString();const Q=yield Tm(L);t.toastService.showTxSuccessToast(),console.log("RESULT",Q)}catch(j){t.toastService.showTxErrorToast()}t.bsModalRef.hide()});return function(h){return a.apply(this,arguments)}}())})()}onAmountChanged(t){this.amount=t}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Ju),ot(Os),ot(mc),ot(rd))},n.\u0275cmp=Un({type:n,selectors:[["app-send-token-modal"]],decls:21,vars:5,consts:[[1,"modal-header","send-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","text-center",2,"padding","0"],[1,"modal-title"],[1,"text-left"],["for","amount",2,"margin","0"],[1,"amount-text"],["type","input","id","amount","placeholder","0.00",1,"form-control","custom-input",3,"ngModel","ngModelChange"],[1,"d-flex","justify-content-between"],["class","form-text text-muted",4,"ngIf"],["for","sendTo",2,"margin","0"],[1,"send-text"],["type","input","id","sendTo","placeholder","Paste tz address here",1,"form-control","custom-input",3,"ngModel","ngModelChange"],["type","button",1,"btn","button","btn-circle","btn-block",3,"disabled","click"],[1,"form-text","text-muted"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6),Ge(),Ue(7,"div",5)(8,"label",6)(9,"h5",7),ft(10,"Amount:"),Ge()(),Ue(11,"input",8),Tt("ngModelChange",function(a){return r.onAmountChanged(a)}),Ge(),Ue(12,"div",9),Ft(13,JH,2,1,"small",10),Ge()(),Ue(14,"div",5)(15,"label",11)(16,"h5",12),ft(17,"Send To:"),Ge()(),Ue(18,"input",13),Tt("ngModelChange",function(a){return r.recipient=a}),Ge()(),Ue(19,"button",14),Tt("click",function(){return r.send()}),ft(20," Send "),Ge()()),2&t&&(bt(6),Vn("Send ",null==r.token||null==r.token.token||null==r.token.token.metadata?null:r.token.token.metadata.symbol,""),bt(5),Ct("ngModel",r.amount),bt(2),Ct("ngIf",r.fee),bt(5),Ct("ngModel",r.recipient),bt(1),Ct("disabled",0===r.amount.length||0===r.recipient.length))},directives:[Il,Vh,pc,fo],styles:[".custom-input[_ngcontent-%COMP%]{padding:0 24px;border-radius:100px;border:1px solid #d2d2d7;min-height:52px}.button[_ngcontent-%COMP%]{width:100%;height:52px;padding:0 24px;border-radius:100px;gap:10px;background-color:#0f61ff;color:#fff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;margin-top:30px;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#183fd7}.btn[_ngcontent-%COMP%]:disabled{background-color:#d2d2d7;color:#86868b}.send-header[_ngcontent-%COMP%]{padding:10px 10px 0 0}.amount-text[_ngcontent-%COMP%]{margin:0 0 12px}.form-text[_ngcontent-%COMP%]{margin:12px 0 0}.send-text[_ngcontent-%COMP%]{margin:24px 0 12px}"]}),n})(),Fs=(()=>{class n{constructor(t){this.modalService=t,this.modalOptions={class:"modal-dialog-centered"}}showLoadingModal(t="Loading..."){const r=Object.assign(Object.assign({},this.modalOptions),{initialState:{text:t}});return this.modalService.show(HB,r)}showNodeSelectorModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{}});return this.modalService.show($L,t)}showHowToModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{closeBtnName:"Close"}});return this.modalService.show(zL,t)}showNoAccountModal(){const t=Object.assign(Object.assign({},this.modalOptions),{ignoreBackdropClick:!0,keyboard:!1,initialState:{}});return this.modalService.show(Yx,t)}showPermissionModal(t,r){const i=Object.assign(Object.assign({},this.modalOptions),{ignoreBackdropClick:!0,keyboard:!1,initialState:{account:t,appMetadata:r}});return this.modalService.show(vF,i)}showOperationModal(){const t=Object.assign(Object.assign({},this.modalOptions),{ignoreBackdropClick:!0,keyboard:!1,initialState:{callback:()=>{console.log("callback")}}});return this.modalService.show(yF,t)}showSignModal(){const t=Object.assign(Object.assign({},this.modalOptions),{ignoreBackdropClick:!0,keyboard:!1,initialState:{}});return this.modalService.show(bF,t)}showSendTezModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{recipient:"",amount:""}});return this.modalService.show($H,t)}showSendTokenModal(t){const r=Object.assign(Object.assign({},this.modalOptions),{initialState:{token:t,recipient:"",amount:""}});return this.modalService.show(eV,r)}showXModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"header",text:"text",closeBtnName:"Close"}});return this.modalService.show(Av,t)}showQRModal(t){const r=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"Your Account QR Code",qrData:t}});return this.modalService.show(ZH,r)}showConfirmModal(t){const r=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"Disconnect",text:"Are you sure you want to disconnet from MetaMask?",confirmCallback:t}});return this.modalService.show(VB,r)}showInstructionsModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"Installation Instructions",text:"
    \n
  1. To get started make sure you have MetaMask chrome extension installed and then go to the Tezos Wallet powered by Metamask here.
  2. \n
  3. Connect with MetaMask
  4. \n
  5. Accept the connection in MetaMask
  6. \n
  7. Approve and install the Tezos snap
  8. \n
"}});return this.modalService.show(Av,t)}showNFTModal(t){const r=Object.assign(Object.assign({},this.modalOptions),{class:"modal-lg",initialState:{nft:t}});return this.modalService.show(QH,r)}showFaqModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"FAQ",text:"text"}});return this.modalService.show(Av,t)}showNotConnectedModal(t,r){const i=Object.assign(Object.assign({},this.modalOptions),{initialState:{successCallback:t,errorCallback:r}});return this.modalService.show(Yx,i)}showConnectedModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{}});return this.modalService.show(XH,t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(Rm))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),mc=(()=>{class n{constructor(t,r,i,a,h){var v=this;this.tabSyncService=t,this.accountService=r,this.modalService=i,this.apiService=a,this.toastService=h,this.log=[],this.walletClient=new gB({name:"MetaMask"}),this.connect(),this.tabSyncService.clear$.subscribe(()=>{var D;null===(D=this.modalRef)||void 0===D||D.hide()}),this.tabSyncService.tabWillClose$.subscribe(Ot(function*(){if(v.pendingRequest){localStorage.setItem("tab_closing_while_pending",(new Date).toLocaleTimeString());const D={type:wn.Error,id:v.pendingRequest.id,errorType:as.ABORTED_ERROR};yield v.walletClient.respond(D),v.requestCleanup(v.pendingRequest.id),localStorage.setItem("tab_closing_while_pending","error sent")}}))}handleMessage(t){var r=this;return Ot(function*(){var i,a,h;localStorage.getItem(Vr.METAMASK_BUSY)&&t.type!==wn.PermissionRequest?console.log("BeaconService: MetaMask is busy handling another request"):localStorage.getItem(`${Vr.REQUEST_ID_PREFIX}${t.id}`)?console.log("This request is already being handled"):(localStorage.setItem(`${Vr.REQUEST_ID_PREFIX}${t.id}`,Date.now().toString()),r.tabSyncService.addTabClosedEventHandler(()=>{r.requestCleanup(t.id)}),r.log.push([new Date,`${t.appMetadata.name}: INCOMING MESSAGE (${t.type}) ${t.type===wn.OperationRequest?1===t.operationDetails.length?`${null===(i=t.operationDetails[0])||void 0===i?void 0:i.amount} mutez, Entrypoint: ${null===(h=null===(a=t.operationDetails[0])||void 0===a?void 0:a.parameters)||void 0===h?void 0:h.entrypoint}`:`${t.operationDetails.length} operations`:""}`,t,[]]),console.log("message",t),r.pendingRequest=t,r.accountService.accounts$.pipe(fi()).subscribe(v=>{var D;if(t.type===wn.PermissionRequest){if(0===v.length)return console.error("No account found, need to wait for user to connect"),localStorage.removeItem(`${Vr.REQUEST_ID_PREFIX}${t.id}`),void localStorage.removeItem(Vr.METAMASK_BUSY);r.modalRef=r.modalService.showPermissionModal(v[0],t.appMetadata),null===(D=r.modalRef.onHide)||void 0===D||D.pipe(fi()).subscribe(L=>{r.tabSyncService.sendEvent(_o.CLEAR),L&&"confirm"===L?r.handlePermissionRequest(v[0],t):(r.sendAbortedError(t),console.log("DENIED",L))})}else if(t.type===wn.OperationRequest){const L=v.find(Q=>Q.address===t.sourceAddress);if(!L)return void console.error("No account found for "+t.sourceAddress);const j=r.toastService.showOperationRequestReceivedToast();r.handleOperationRequest(L,t).then(()=>{j.toastRef.close(),r.toastService.showTxSuccessToast()}).catch(()=>{j.toastRef.close(),r.toastService.showTxErrorToast()}).finally(()=>{r.tabSyncService.sendEvent(_o.CLEAR)})}else if(t.type===wn.SignPayloadRequest){const L=v.find(Q=>Q.address===t.sourceAddress);if(!L)return void console.error("No account found for "+t.sourceAddress);const j=r.toastService.showSignRequestReceivedToast();r.handleSignPayload(L,t).then(()=>{j.toastRef.close(),r.toastService.showTxSuccessToast()}).catch(()=>{j.toastRef.close(),r.toastService.showTxErrorToast()}).finally(()=>{r.tabSyncService.sendEvent(_o.CLEAR)})}else console.error("Message type not supported"),console.error("Received: ",t),r.walletClient.respond({type:wn.Error,id:t.id,errorType:as.ABORTED_ERROR}),r.requestCleanup(t.id)}))})()}connect(){var t=this;this.walletClient.init().then(Ot(function*(){t.walletClient.connect(t.handleMessage.bind(t)).catch(r=>console.error("connect error",r))}))}sendAbortedError(t){var r=this;return Ot(function*(){r.walletClient.respond({type:wn.Error,id:t.id,errorType:as.ABORTED_ERROR}),r.requestCleanup(t.id)})()}addPeer(t){var r=this;return Ot(function*(){return(new rc).deserialize(t).then(a=>(console.log("Adding peer",a),r.walletClient.addPeer(a).then(()=>{console.log("Peer added")}))).catch(a=>{console.error("not a valid sync code: ",a,t)})})()}handlePendingRequest(){this.pendingRequest?(console.log("Have pending request, handling now"),this.handleMessage(this.pendingRequest)):console.log("Have NO pending request")}handlePermissionRequest(t,r){console.log("Sharing ",t),this.walletClient.respond({type:wn.PermissionResponse,network:r.network,scopes:[ua.OPERATION_REQUEST,ua.SIGN],id:r.id,publicKey:t.publicKey}),this.requestCleanup(r.id)}handleOperationRequest(t,r){var i=this;return Ot(function*(){localStorage.setItem(Vr.METAMASK_BUSY,"true");const a=r.operationDetails;i.runOperation(t.address,a,r.network.type).then(h=>{console.log("RUN_OPERATION RESULT",h)}).catch(h=>{console.log("RUN_OPERATION ERROR",h)}).finally(Ot(function*(){let h;console.log("METAMASK SENDING OPERATION REQUEST");try{const v=yield Tm(a);h={id:r.id,type:wn.OperationResponse,transactionHash:v}}catch(v){h={type:wn.Error,id:r.id,errorType:as.ABORTED_ERROR}}console.log("RESPONSE",h),i.walletClient.respond(h),i.requestCleanup(r.id)}))})()}handleSignPayload(t,r){var i=this;return Ot(function*(){let a;console.log("METAMASK SIGN REQUEST",r),localStorage.setItem(Vr.METAMASK_BUSY,"true");try{const h=yield bB(r.payload);a={id:r.id,type:wn.SignPayloadResponse,signature:h,signingType:r.signingType}}catch(h){a={type:wn.Error,id:r.id,errorType:as.ABORTED_ERROR}}i.walletClient.respond(a),console.log("METAMASK SIGN RESPONSE",a),i.requestCleanup(r.id)})()}metamaskDisconnected(){this.pendingRequest&&this.requestCleanup(this.pendingRequest.id)}requestCleanup(t){this.pendingRequest=void 0,localStorage.removeItem(`${Vr.REQUEST_ID_PREFIX}${t}`),localStorage.removeItem(Vr.METAMASK_BUSY)}runOperation(t,r,i){var a=this;return Ot(function*(){console.log("RPCs",a.apiService.RPCs[i]);const h=new t3(a.apiService.RPCs[i].selected),{counter:v}=yield h.getContract(t);console.log("COUNTER FROM API",v);let D=parseInt(v||"0",10)+1;console.log("nextCounter",D);const L=(yield h.getBlockHeader()).hash,Q=yield h.getChainId(),me=r.map(ye=>Object.assign(Object.assign({source:t,counter:String(D++),fee:"10000",gas_limit:"1040000",storage_limit:"60000"},ye),{kind:Ch.TRANSACTION}));return h.runOperation({operation:{branch:L,contents:me,signature:"edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg"},chain_id:Q})})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(B3),Mt(Os),Mt(Fs),Mt(Ju),Mt(rd))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const L6=()=>!!/Android|iPhone/i.test(navigator.userAgent);function tV(n,e){1&n&&(Ue(0,"span"),ft(1,"The Tezos Wallet Explorer is not supported on mobile."),Ge())}function nV(n,e){1&n&&(Ue(0,"span"),ft(1," You need to install MetaMask. You can download it "),Ue(2,"a",30),ft(3,"here"),Ge(),ft(4,". "),Ge())}function rV(n,e){1&n&&(Ue(0,"span"),ft(1," Connect your MetaMask to access the Tezos Wallet Explorer. "),Ge())}function iV(n,e){if(1&n&&(Zo(0),Ft(1,nV,5,0,"span",15),Ft(2,rV,2,0,"span",15),Xo()),2&n){const t=zt();bt(1),Ct("ngIf",!t.isMetaMaskInstalled),bt(1),Ct("ngIf",t.isMetaMaskInstalled)}}function oV(n,e){if(1&n){const t=oo();Ue(0,"div",34),Tt("click",function(){return ui(t),zt(2).connect()}),Bt(1,"img",35),Ue(2,"div",36),ft(3,"Connect with MetaMask"),Ge()()}}function sV(n,e){1&n&&(Ue(0,"div",37)(1,"span",38),ft(2,"Loading..."),Ge()())}function aV(n,e){if(1&n&&(Ue(0,"div",31),Ft(1,oV,4,0,"div",32),Ft(2,sV,3,0,"div",33),Ge()),2&n){const t=zt();bt(1),Ct("ngIf",!t.isLoading),bt(1),Ct("ngIf",t.isLoading)}}function lV(n,e){1&n&&(Ue(0,"div",39),ft(1," Your version of MetaMask wallet does not support Snaps. Please update your MetaMask "),Ue(2,"a",30),ft(3,"here"),Ge(),ft(4,". "),Ge())}console.log("isMobile",L6());let uV=(()=>{class n{constructor(t,r){this.metamaskService=t,this.modalService=r,this.isMetaMaskInstalled=void 0!==window.ethereum&&window.ethereum.isMetaMask&&!window.ethereum.isBraveWallet,this.isMobile=L6(),this.isLoading=!1,this.errorCode=0}ngOnInit(){}connect(){var t=this;return Ot(function*(){t.isLoading||(t.isLoading=!0,t.metamaskService.connect().then(()=>{t.errorCode=0,t.modalService.showConnectedModal()}).catch(r=>{t.errorCode=r.code}).finally(Ot(function*(){t.isLoading=!1})))})()}showInstructionsModal(){this.modalService.showInstructionsModal()}openLink(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(ot(Xh),ot(Fs))},n.\u0275cmp=Un({type:n,selectors:[["app-landing"]],decls:51,vars:4,consts:[[1,"containerbox","container-fluid","px-md-5","pb-3",2,"flex-direction","column"],[1,"flex-container"],["src","./assets/tezos-logo-main.svg",1,"logo"],[1,"text-container"],[1,"header","large"],[1,"header","ml-1","small"],[1,"imageBox"],[1,"d-flex","justify-content-center",2,"width","40px","height","40px"],["src","./assets/tezos-logo-sm.svg","alt","SVG Image",2,"width","100%","height","100%"],["src","./assets/icons/close.svg","alt","SVG Image",2,"width","20px","height","100%","margin-left","20px"],["src","./assets/metamask-logo-sm.svg","alt","SVG Image",2,"width","100%","height","100%","margin-left","20px"],[1,"textBox"],[1,"metamasTextBox"],[1,"metamaskTitle"],[1,"metamaskSubtitle"],[4,"ngIf"],["class","metamaskContainer",4,"ngIf"],["class","metamaskSubtitle red-text mt-3",4,"ngIf"],[1,"containerModal",3,"click"],[1,"instructionsModal"],[1,"instructionsBox"],[1,"footer"],["src","./assets/icons/FiAlertCircle.svg",1,"icon"],[1,"text"],[1,"footer-menu"],["href","#",1,"footer-link",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","2","height","20","viewBox","0 0 2 20","fill","none"],["d","M1 0V20","stroke","#D2D2D7"],[1,"footerTezos"],["href","https://metamask.io/snaps/",2,"text-decoration","underline","color","#86868b"],["href","https://metamask.io/download/","target","_blank"],[1,"metamaskContainer"],["class","metamaskModal",3,"click",4,"ngIf"],["class","spinner-border mr-3","role","status",4,"ngIf"],[1,"metamaskModal",3,"click"],["src","./assets/metamask-logo.svg",1,"metamaskLogo"],[1,"metamaskText"],["role","status",1,"spinner-border","mr-3"],[1,"sr-only"],[1,"metamaskSubtitle","red-text","mt-3"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1),Bt(2,"img",2),Ue(3,"div",3)(4,"span",4),ft(5,"Tezos Wallet Explorer"),Ge(),Ue(6,"span",5),ft(7,"powered by MetaMask"),Ge()()(),Bt(8,"br"),Ue(9,"div",6)(10,"div",7),Bt(11,"img",8)(12,"img",9)(13,"img",10),Ge(),Ue(14,"div",11)(15,"div",12)(16,"div",13),ft(17," Tezos Wallet Explorer, powered by MetaMask "),Ge(),Ue(18,"div",14),Ft(19,tV,2,0,"span",15),Ft(20,iV,3,2,"ng-container",15),Ge()(),Ue(21,"div"),Ft(22,aV,3,2,"div",16),Ft(23,lV,5,0,"div",17),Ge(),Ue(24,"div",18),Tt("click",function(){return r.showInstructionsModal()}),Ue(25,"div",19)(26,"div",20)(27,"div",21),Bt(28,"img",22),Ue(29,"span",23),ft(30,"Installation Guide"),Ge()()()()()()(),Ue(31,"div",24)(32,"a",25),Tt("click",function(){return r.openLink("https://github.com/airgap-it/tezos-snaps-wallet")}),ft(33,"GitHub"),Ge(),Nc(),Ue(34,"svg",26),Bt(35,"path",27),Ge(),kc(),Ue(36,"a",25),Tt("click",function(){return r.openLink("./assets/documents/privacy-policy.pdf")}),ft(37,"Privacy Policy"),Ge(),Nc(),Ue(38,"svg",26),Bt(39,"path",27),Ge(),kc(),Ue(40,"a",25),Tt("click",function(){return r.openLink("./assets/documents/terms-of-service.pdf")}),ft(41,"Terms of Service"),Ge(),Nc(),Ue(42,"svg",26),Bt(43,"path",27),Ge(),kc(),Ue(44,"a",25),Tt("click",function(){return r.openLink("https://github.com/airgap-it/tezos-metamask-snap/wiki/FAQs")}),ft(45,"FAQs"),Ge()(),Ue(46,"div",28)(47,"span"),ft(48,"Powered by "),Ue(49,"a",29),ft(50,"MetaMask Snaps"),Ge()()()()),2&t&&(bt(19),Ct("ngIf",r.isMobile),bt(1),Ct("ngIf",!r.isMobile),bt(2),Ct("ngIf",r.isMetaMaskInstalled&&!r.isMobile),bt(1),Ct("ngIf",-32601===r.errorCode))},directives:[fo],styles:[".imageBox[_ngcontent-%COMP%]{width:500px;padding:60px 90px;background:white;box-shadow:0 0 20px #0003;border-radius:30px;flex-direction:column;justify-content:flex-start;align-items:center;gap:30px;display:inline-flex}.textBox[_ngcontent-%COMP%], .metamaskContainer[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:30px;display:flex}.metamaskModal[_ngcontent-%COMP%]{width:320px;padding:16px 24px;border-radius:100px;border:.5px #d2d2d7 solid;justify-content:center;align-items:center;gap:10px;display:inline-flex;cursor:pointer}.metamaskModal[_ngcontent-%COMP%]:hover{color:#0f61ff;border-color:#0f61ff;background-color:transparent;outline:none}.containerModal[_ngcontent-%COMP%]{justify-content:flex-start;align-items:center;gap:4px;display:inline-flex}@media (max-width: 768px){.metamaskModal[_ngcontent-%COMP%]{width:100%;max-width:320px}}.instructionsModal[_ngcontent-%COMP%]{justify-content:center;align-items:center;display:flex}.instructionsBox[_ngcontent-%COMP%]{position:relative;flex-direction:column;justify-content:flex-start;align-items:flex-start;display:flex}.containerbox[_ngcontent-%COMP%]{height:100vh;width:100vw;display:flex;justify-content:center;align-items:center}@media (max-width: 768px){.containerbox[_ngcontent-%COMP%]{flex-direction:column;justify-content:center;padding:20px}}.large[_ngcontent-%COMP%]{font-size:24px;font-weight:300;line-height:26px;letter-spacing:0em;text-align:left;color:#1d1d1f;margin:0 0 0 3px}.small[_ngcontent-%COMP%]{font-size:12px;color:#6e6e73;margin:0}.flex-container[_ngcontent-%COMP%]{display:flex;align-items:center;max-height:40px;margin-bottom:40px;margin-top:40px}.logo[_ngcontent-%COMP%]{height:auto;max-height:100%;margin-left:10px}.text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:5px}.footer[_ngcontent-%COMP%]{color:#0f61ff;font-size:14px;font-weight:400;display:flex;align-items:center}.footer[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]:hover{cursor:pointer}.icon[_ngcontent-%COMP%]{width:20px;height:20px;margin-right:10px}.metamaskText[_ngcontent-%COMP%]{text-align:center;color:#0f61ff;font-size:16px;font-weight:600;line-height:18px;word-wrap:break-word}.metamaskTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:28px;font-weight:600;line-height:34px;letter-spacing:0em;text-align:center}.metamaskSubtitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:center}.metamasTextBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:20px;display:flex}.metamaskLogo[_ngcontent-%COMP%]{width:20px;height:20px}.footer-menu[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:3rem}.footer-link[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:normal;margin-right:1.5rem;margin-left:1.5rem;text-decoration:none;color:#424245}.footer-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.footerTezos[_ngcontent-%COMP%]{text-align:center;font-size:12px;color:#86868b;margin-top:4rem}.red-text[_ngcontent-%COMP%]{color:#d0342c}.red-text[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#d0342c;text-decoration:underline}@media (max-width: 768px){.flex-container[_ngcontent-%COMP%]{margin-bottom:20px;margin-top:20px}.imageBox[_ngcontent-%COMP%]{width:100%;max-width:400px;padding:40px}.large[_ngcontent-%COMP%]{font-size:20px}.small[_ngcontent-%COMP%]{font-size:10px}.metamaskTitle[_ngcontent-%COMP%]{font-size:24px}.textBox[_ngcontent-%COMP%]{text-align:center}.logo[_ngcontent-%COMP%]{margin-right:5px}.footer-menu[_ngcontent-%COMP%]{flex-wrap:wrap;justify-content:center}.footer-link[_ngcontent-%COMP%]{margin:.5rem}.footerTezos[_ngcontent-%COMP%]{margin-top:2rem}}.text[_ngcontent-%COMP%]:hover{text-decoration:underline}"]}),n})(),cV=(()=>{class n{constructor(t,r,i,a,h){this.metamaskService=t,this.accountService=r,this.modalService=i,this.clipboardService=a,this.beaconService=h,this.address="",this.network="Mainnet",this.otherNetwork="Ghostnet",this.loadAccountInfo()}ngOnInit(){}loadAccountInfo(){var t=this;this.accountService.accounts$.pipe(fi()).subscribe(function(){var r=Ot(function*(i){i[0]&&(t.address=i[0].address)});return function(i){return r.apply(this,arguments)}}())}showQrModal(){this.modalService.showQRModal(this.address)}disconnect(){this.modalService.showConfirmModal(()=>{this.accountService.hasAccounts?(this.accountService.disconnect(),this.beaconService.metamaskDisconnected()):this.metamaskService.connect()})}changeNetwork(){"Mainnet"===this.network?(this.network="Ghostnet",this.otherNetwork="Mainnet"):(this.network="Mainnet",this.otherNetwork="Ghostnet")}copyToClipboard(){this.clipboardService.copy(this.address)}}return n.\u0275fac=function(t){return new(t||n)(ot(Xh),ot(Os),ot(Fs),ot(Tv),ot(mc))},n.\u0275cmp=Un({type:n,selectors:[["app-header-item"]],decls:28,vars:4,consts:[[1,"container-fluid","py-3","px-0","px-md-4"],[1,"navbar","navbar-expand-md","navbar-light","d-flex","justify-content-between"],[1,"flex-container"],["src","./assets/tezos-logo-main.svg",1,"logo"],[1,"text-container"],[1,"header","pt-1","ml-1","large"],[1,"header","ml-1","small"],[1,"navbar-nav","d-flex","align-items-md-center"],[1,"ml-md-3",3,"click"],[1,"addressBox"],["src","./assets/metamask-logo-sm.svg","alt","SVG Image",2,"width","16px","height","16px"],[1,"addressContainer"],[1,"textAddress"],[1,"copy-button",2,"background","none","border","none","cursor","pointer"],["src","./assets/icons/FiCopy.svg","alt","SVG Image",2,"width","16px","height","16px"],[1,"ml-md-3","qr-code"],[1,"qr-button",3,"click"],[1,"d-flex","align-items-center"],["src","./assets/icons/qr-code-icon.svg",1,"fa-icon"],[1,"ml-md-3"],[1,"addressBoxConnect"],[1,"d-flex","align-items-center",3,"click"],["src","./assets/icons/FiLogOut.svg",1,"fa-icon"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"nav",1)(2,"div",2),Bt(3,"img",3),Ue(4,"div",4)(5,"span",5),ft(6,"Tezos Wallet Explorer"),Ge(),Ue(7,"span",6),ft(8,"powered by MetaMask"),Ge()()(),Ue(9,"ul",7)(10,"li",8),Tt("click",function(){return r.copyToClipboard()}),Ue(11,"div",9),Bt(12,"img",10),Ue(13,"div",11)(14,"div",12),ft(15),Qo(16,"shortenString"),Ge(),Ue(17,"button",13),Bt(18,"img",14),Ge()()()(),Ue(19,"li",15)(20,"button",16),Tt("click",function(){return r.showQrModal()}),Ue(21,"span",17),Bt(22,"img",18),Ge()()(),Ue(23,"li",19)(24,"div",20)(25,"span",21),Tt("click",function(){return r.disconnect()}),Bt(26,"img",22),ft(27),Ge()()()()()()),2&t&&(bt(15),Vn(" ",Js(16,2,r.address)," "),bt(12),Vn(" ",r.accountService.hasAccounts?"Disconnect":"Connect"," "))},pipes:[Rv],styles:[".addressBox[_ngcontent-%COMP%], .addressBoxConnect[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;gap:6px;padding:11px 16px;background:#f5f5f7;border-radius:100px;height:40px;cursor:pointer;margin-right:10px}.addressBoxConnect[_ngcontent-%COMP%]:hover{background-color:#d2d2d7}.addressBoxConnect[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:focus{background-color:#d2d2d7;outline:none}.addressBoxConnect[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{background-color:#d2d2d7;cursor:pointer}.addressContainer[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.addressBox[_ngcontent-%COMP%]:hover{background-color:#d2d2d7}.addressBox[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:focus{background-color:#d2d2d7;outline:none}.addressBox[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{background-color:#d2d2d7;cursor:pointer}.large[_ngcontent-%COMP%]{font-size:24px;font-weight:300;line-height:26px;letter-spacing:0em;text-align:left;color:#1d1d1f}.small[_ngcontent-%COMP%]{font-size:12px;color:#6e6e73}.flex-container[_ngcontent-%COMP%]{display:flex;align-items:center;max-height:40px}.logo[_ngcontent-%COMP%]{height:auto;max-height:100%;margin-left:10px}.text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:5px}.buttonContainer[_ngcontent-%COMP%]{margin-left:3rem}.textAddress[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;color:#1d1d1f;word-wrap:break-word;margin-right:5px}.buttonNetwork[_ngcontent-%COMP%]{background-color:#f5f5f7;color:#1d1d1f;border:none;width:110px;height:40px;padding:11px 16px;display:flex;justify-content:center;align-items:center;box-shadow:none;transition:background-color .3s ease-in-out,color .3s ease-in-out}.buttonContainer[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .buttonContainer[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{outline:none!important;box-shadow:none;border:none}.buttonContainer[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .buttonContainer[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{border:none;box-shadow:none;background-color:#0f61ff;color:#fff}.buttonContainer[_ngcontent-%COMP%]:focus{outline:none;box-shadow:none;border:none}.buttonContainer[_ngcontent-%COMP%]:not(:hover) button[_ngcontent-%COMP%]{background-color:#f5f5f7;color:#1d1d1f}.custom-dropdown-toggle[_ngcontent-%COMP%]:after{content:none}.custom-dropdown-toggle[_ngcontent-%COMP%]{background-color:#f5f5f7;color:#1d1d1f;border:none;width:40px;height:40px;padding:10px;border-radius:100px;gap:10px;display:flex;justify-content:center;align-items:center;transition:background-color .3s ease-in-out}.custom-dropdown-toggle[_ngcontent-%COMP%]:focus{outline:none}.dropdown-menu-container[_ngcontent-%COMP%]{position:relative}.dropdown-menu.custom-dropdown-menu[_ngcontent-%COMP%]{right:auto;left:calc(-100% + 40px);position:absolute}.qr-button[_ngcontent-%COMP%]{width:40px;height:40px;padding:12px;border-radius:100px;background-color:#f5f5f7;border:none;cursor:pointer;outline:none}.qr-button[_ngcontent-%COMP%]:hover{background-color:#d2d2d7}.qr-code[_ngcontent-%COMP%], .copy-button[_ngcontent-%COMP%]{cursor:pointer}@media (max-width: 768px){.addressBoxConnect[_ngcontent-%COMP%]{margin-top:10px}.buttonContainer[_ngcontent-%COMP%], .addressBox[_ngcontent-%COMP%], .qr-code[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .qr-button[_ngcontent-%COMP%]{display:none}}"]}),n})();const Ov=_M("fadeInAnimation",[xg(":enter",[Ci({opacity:0}),pl("1s ease-out",Ci({opacity:1}))])]);function fV(n,e){1&n&&(Ue(0,"div",11),Bt(1,"img",12),Ge())}function hV(n,e){1&n&&(Ue(0,"span"),ft(1,"."),Ge())}function dV(n,e){if(1&n&&(Zo(0),Ue(1,"p",13),ft(2),Ft(3,hV,2,0,"span",5),Ue(4,"span",14),ft(5),Ge()(),Ue(6,"p",15),ft(7),Ge(),Xo()),2&n){const t=zt();bt(1),Ct("@fadeInAnimation",void 0),bt(1),Vn(" ",t.tezMainAmount,""),bt(1),Ct("ngIf",t.tezDecimalAmount),bt(2),Vn("",t.tezDecimalAmount," \ua729"),bt(1),Ct("@fadeInAnimation",void 0),bt(1),Vn("$",t.usdBalance,"")}}function pV(n,e){1&n&&(Ue(0,"span"),ft(1,"."),Ge())}function gV(n,e){if(1&n){const t=oo();Ue(0,"div")(1,"div",16)(2,"div",17),Bt(3,"img",18),Ue(4,"span",19),ft(5),Ge(),Ue(6,"span",20),ft(7),Ft(8,pV,2,0,"span",5),Ue(9,"span",21),ft(10),Ge()(),Ue(11,"button",22),Tt("click",function(){const a=ui(t).$implicit;return zt().sendToken(a)}),Bt(12,"img",23),Ge()()()()}if(2&n){const t=e.$implicit,r=zt();let i;Ct("@fadeInAnimation",void 0),bt(3),Ct("src",null!==(i=null==t||null==t.token||null==t.token.metadata?null:t.token.metadata.sanitizedThumbnailUri)&&void 0!==i?i:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",ws),bt(2),Nr(null==t||null==t.token||null==t.token.metadata?null:t.token.metadata.symbol),bt(2),Vn(" ",r.splitNumber(null==t?null:t.humanReadableBalance)[0],""),bt(1),Ct("ngIf",r.splitNumber(null==t?null:t.humanReadableBalance)[1]),bt(2),Nr(r.splitNumber(null==t?null:t.humanReadableBalance)[1])}}function mV(n,e){if(1&n&&(Ue(0,"div",24)(1,"div",25)(2,"div")(3,"a",26),ft(4,"Load More"),Ge(),Bt(5,"img",27),Ge()()()),2&n){const t=zt();bt(3),gu("href","https://tzkt.io/",t.address,"/balances/",ws)}}let vV=(()=>{class n{constructor(t){this.modalService=t,this.address="",this.balance="",this.usdBalance="",this.tokens=[],this.isLoading=!0,this.tezMainAmount="0",this.tezDecimalAmount="0"}ngOnInit(){}ngOnChanges(t){var r;const i=null===(r=t.balance)||void 0===r?void 0:r.currentValue;i&&([this.tezMainAmount,this.tezDecimalAmount]=i.split("."))}openLink(t){window.open(t,"_blank")}sendTez(){this.modalService.showSendTezModal()}splitNumber(t){return t?t.split("."):["",""]}sendToken(t){this.modalService.showSendTokenModal(t)}}return n.\u0275fac=function(t){return new(t||n)(ot(Fs))},n.\u0275cmp=Un({type:n,selectors:[["app-account"]],inputs:{address:"address",balance:"balance",usdBalance:"usdBalance",tokens:"tokens",isLoading:"isLoading"},features:[qr],decls:16,vars:5,consts:[[1,"card","cardBox"],[1,"card-body",2,"padding","30px"],[1,"card-title"],[1,"d-flex","flex-column","flex-md-row","justify-content-between","align-items-center"],["role","status",4,"ngIf"],[4,"ngIf"],[1,"d-flex","justify-content-center","align-items-center","mt-3","mt-md-0"],["type","button",1,"btn","btn-outline-primary","btn-circle","mr-2",3,"click"],["type","button",1,"btn","btn-primary","btn-circle",3,"click"],[4,"ngFor","ngForOf"],["class","load-more-box justify-content-between align-items-center","style","padding-top: 18px; margin-top: 18px; display: flex",4,"ngIf"],["role","status"],["src","./assets/icons/arrow-spin.svg","alt","Loading...",1,"svg-spinner"],[1,"cardBalance"],[1,"cardBalanceDecimal"],[1,"text-muted"],[1,"token-box",2,"padding-top","18px","margin-top","18px"],[1,"justify-content-between","align-items-center"],[2,"width","40px","height","100%","margin-right","12px",3,"src"],[2,"font-weight","600"],[2,"position","absolute","left","170px","margin-top","8px"],[1,"small-text"],["type","button",1,"btn","btn-outline-primary","btn-circle",2,"float","right","width","40px",3,"click"],["src","./assets/icons/MdOutlineCallReceivedBlue.svg","alt","Sent",1,"copy-button",2,"width","16px","height","16px","transform","rotate(180deg)"],[1,"load-more-box","justify-content-between","align-items-center",2,"padding-top","18px","margin-top","18px","display","flex"],[2,"display","flex","align-items","center","justify-content","center","width","100%","height","100%"],["target","_blank",1,"explorer-link",3,"href"],["src","./assets/icons/FiExternalLink.svg","alt","SVG Image",2,"width","16px","height","16px"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1)(2,"h2",2),ft(3,"Balance"),Ge(),Ue(4,"div",3)(5,"div"),Ft(6,fV,2,0,"div",4),Ft(7,dV,8,6,"ng-container",5),Ge(),Ue(8,"div",6)(9,"button",7),Tt("click",function(){return r.openLink("https://widget.wert.io/default/widget/?commodity=XTZ%3ATezos&address="+r.address)}),ft(10," Buy tez "),Ge(),Ue(11,"button",8),Tt("click",function(){return r.sendTez()}),ft(12," Send "),Ge()()(),Ue(13,"div"),Ft(14,gV,13,6,"div",9),Ft(15,mV,6,1,"div",10),Ge()()()),2&t&&(bt(6),Ct("ngIf",r.isLoading),bt(1),Ct("ngIf",!r.isLoading),bt(6),Ct("@fadeInAnimation",void 0),bt(1),Ct("ngForOf",r.tokens),bt(1),Ct("ngIf",r.tokens.length>=5))},directives:[fo,Ru],styles:[".cardBox[_ngcontent-%COMP%]{min-height:153px;border-radius:20px;background:var(--Netural-1, #f5f5f7);box-shadow:none;box-sizing:border-box;margin:0 auto}.card-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:left}.cardBalance[_ngcontent-%COMP%]{color:var(--Black, #1d1d1f);font-family:Inter,sans-serif;font-size:28px;font-weight:600;line-height:26px;text-align:center;margin:0 0 6px}.cardBalanceDecimal[_ngcontent-%COMP%]{font-size:20px}.btn.btn-primary.btn-circle[_ngcontent-%COMP%], .btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{height:40px;width:88px;border-radius:20px;display:flex;justify-content:center;align-items:center;outline:none;font-size:16px;transition:background-color .3s ease-in-out}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{color:#0f61ff;border-color:#d2d2d7;background-color:transparent}.btn.btn-primary.btn-circle[_ngcontent-%COMP%]{background-color:#0f61ff;color:#fff;border:none}.btn.btn-primary.btn-circle[_ngcontent-%COMP%]:hover{color:#fff;outline:none}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]:hover{color:#0f61ff;border-color:#0f61ff;background-color:transparent;outline:none}@media (max-width: 1490px){.cardBox[_ngcontent-%COMP%]{width:100%!important}}@media (min-width: 768px){.cardBox[_ngcontent-%COMP%]{width:100%;margin:0 auto}.btn.btn-primary.btn-circle[_ngcontent-%COMP%], .btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{font-size:16px;margin:0}.btn.btn-primary.btn-circle[_ngcontent-%COMP%]:hover{background-color:#183fd7}}@media (max-width: 768px){.cardBox[_ngcontent-%COMP%]{max-width:100%;margin-left:0;margin-right:0}.cardBalance[_ngcontent-%COMP%]{font-size:24px;line-height:28px}.text-muted[_ngcontent-%COMP%]{font-size:14px}.cardBalanceDecimal[_ngcontent-%COMP%]{font-size:14px;line-height:16px}.btn.btn-primary.btn-circle[_ngcontent-%COMP%], .btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{width:154px}.btn.btn-primary.btn-circle[_ngcontent-%COMP%]:hover{background-color:#183fd7}}@media (max-width: 1300px){.cardBalance[_ngcontent-%COMP%]{font-size:18px;line-height:18px}.cardBalanceDecimal[_ngcontent-%COMP%]{font-size:14px;line-height:14px}}.svg-spinner[_ngcontent-%COMP%]{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.token-box[_ngcontent-%COMP%]{font-family:Inter;font-size:16px;font-style:normal;font-weight:600;line-height:normal;border-top:1px solid #d2d2d7}.small-text[_ngcontent-%COMP%]{font-size:14px}.explorer-link[_ngcontent-%COMP%]{color:#0f61ff;font-size:14px;font-family:Inter;font-weight:400;margin-right:4px}.load-more-box[_ngcontent-%COMP%]{border-top:1px solid #d2d2d7}"],data:{animation:[Ov]}}),n})();const yV=new ns(TM);function F6(n){return!M(n)&&n-parseFloat(n)+1>=0}function _V(n){const{index:e,period:t,subscriber:r}=n;if(r.next(e),!r.closed){if(-1===t)return r.complete();n.index=e+1,this.schedule(n,t)}}class MV{constructor(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}call(e,t){return t.subscribe(new Pv(e,this.project,this.concurrent,this.scheduler))}}class Pv extends Y{constructor(e,t,r,i){super(e),this.project=t,this.concurrent=r,this.scheduler=i,this.index=0,this.active=0,this.hasCompleted=!1,r0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()}}class xV{constructor(e){this.total=e}call(e,t){return t.subscribe(new SV(e,this.total))}}class SV extends O{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}class bc{}let G6=(()=>{class n extends bc{tick(t){return tn(0).pipe(function wV(n,e=Number.POSITIVE_INFINITY,t){return e=(e||0)<1?Number.POSITIVE_INFINITY:e,r=>r.lift(new MV(n,e,t))}(()=>{const r=Date.now(),i=Math.round(Math.abs(r-t)/1e3),a=i<60?1e3:i<3600?6e4:i<86400?36e5:0;return a?function bV(n=0,e,t){let r=-1;return F6(e)?r=Number(e)<1?1:Number(e):c(e)&&(t=e),c(t)||(t=yV),new Z(i=>{const a=F6(n)?n:+n-t.now();return t.schedule(_V,a,{index:0,period:r,subscriber:i})})}(a):oh()}),function EV(n){return e=>e.lift(new xV(n))}(1))}}return n.\u0275fac=function(){let e;return function(r){return(e||(e=Ur(n)))(r||n)}}(),n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),K6=(()=>{class n{constructor(){this.changes=new o}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class _c{}let q6=(()=>{class n extends _c{format(t){const{suffix:r,value:i,unit:a}=function(n){const e=Date.now(),t=Math.round(Math.abs(e-n)/1e3),r=n{class n{constructor(t,r,i,a){this.clock=a,this.live=!0,this.stateChanges=new o,t&&(this.intlSubscription=t.changes.subscribe(()=>this.stateChanges.next())),this.stateChanges.subscribe(()=>{this.value=i.format(this.date),r.markForCheck()})}transform(t,...r){const i=function V6(n){const e=new Date(n);if(!Number.isNaN(e.valueOf()))return e;const t=String(n).match(/\d+/g);if(null===t||t.length<=2)return e;{const[r,i,...a]=t.map(h=>parseInt(h,10));return new Date(Date.UTC(r,i-1,...a))}}(t).valueOf();let a;if(a=function U6(n){return null!=n}(r[0])?function H6(n){return null!=n&&"false"!=`${n}`}(r[0]):this.live,this.date===i&&this.live===a)return this.value;if(this.date=i,this.live=a,!this.date)throw new SyntaxError(`Wrong parameter in TimeagoPipe. Expected a valid date, received: ${t}`);return this.clockSubscription&&(this.clockSubscription.unsubscribe(),this.clockSubscription=void 0),this.clockSubscription=this.clock.tick(this.date).pipe(rs(()=>this.live,this)).subscribe(()=>this.stateChanges.next()),this.stateChanges.next(),this.value}ngOnDestroy(){this.intlSubscription&&(this.intlSubscription.unsubscribe(),this.intlSubscription=void 0),this.clockSubscription&&(this.clockSubscription.unsubscribe(),this.clockSubscription=void 0),this.stateChanges.complete()}}return n.\u0275fac=function(t){return new(t||n)(ot(K6,24),ot(hl,16),ot(_c,16),ot(bc,16))},n.\u0275pipe=Gr({name:"timeago",type:n,pure:!1}),n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),TV=(()=>{class n{static forRoot(t={}){return{ngModule:n,providers:[t.clock||{provide:bc,useClass:G6},t.intl||[],t.formatter||{provide:_c,useClass:q6}]}}static forChild(t={}){return{ngModule:n,providers:[t.clock||{provide:bc,useClass:G6},t.intl||[],t.formatter||{provide:_c,useClass:q6}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})();function DV(n,e){1&n&&(Ue(0,"div",10)(1,"div",11),Bt(2,"img",12),Ge()())}function IV(n,e){if(1&n){const t=oo();Ue(0,"div")(1,"div",13)(2,"div",14),ft(3,"No 'operations' to show"),Ge(),Ue(4,"div",15)(5,"p"),ft(6,"Buy tez to see your operation history here..."),Ge()(),Ue(7,"button",16),Tt("click",function(){ui(t);const i=zt();return i.openLink("https://widget.wert.io/default/widget/?commodity=XTZ%3ATezos&address="+i.address)}),ft(8," Buy tez "),Ge()()()}2&n&&Ct("@fadeInAnimation",void 0)}function RV(n,e){if(1&n&&(Ue(0,"div",22),ft(1),Ge()),2&n){const t=zt().$implicit;bt(1),Vn(" ","origination"===t.type?"Origination":"delegation"===t.type?"Delegation":"reveal"===t.type?"Reveal":t.type," ")}}function OV(n,e){1&n&&Bt(0,"img",37)}function PV(n,e){1&n&&Bt(0,"img",38)}function NV(n,e){if(1&n&&(Ue(0,"span",39)(1,"strong",40),ft(2,"From:"),Ge(),ft(3),Qo(4,"shortenString"),Ge()),2&n){const t=zt(2).$implicit;let r;bt(3),Vn(" ",Js(4,1,null!==(r=null==t||null==t.sender?null:t.sender.address)&&void 0!==r?r:"")," ")}}function kV(n,e){if(1&n&&(Ue(0,"span",39)(1,"strong",41),ft(2,"To:"),Ge(),ft(3),Qo(4,"shortenString"),Ge()),2&n){const t=zt(2).$implicit;let r;bt(3),Vn(" ",Js(4,1,null!==(r=null==t||null==t.target?null:t.target.address)&&void 0!==r?r:"")," ")}}function BV(n,e){if(1&n){const t=oo();Ue(0,"div",22)(1,"div",23),Ft(2,OV,1,0,"img",24),Ft(3,PV,1,0,"img",25),Ue(4,"div",26)(5,"p",27)(6,"span",28),ft(7),Ge()()()(),Ue(8,"div",29)(9,"div",30),Ft(10,NV,5,3,"span",31),Ft(11,kV,5,3,"span",31),Ue(12,"img",32),Tt("click",function(i){ui(t);const a=zt().$implicit,h=zt(2);return h.copyAddressToClipboard(i,(null==a||null==a.target?null:a.target.address)===h.address?a.sender.address:a.target.address)}),Ge()(),Ue(13,"div",33)(14,"div",34),Tt("click",function(){ui(t);const i=zt().$implicit;return zt(2).openLink("https://tzkt.io/"+i.hash)}),Ue(15,"span",35),ft(16),Qo(17,"timeago"),Ge()(),Ue(18,"div"),Bt(19,"img",36),Ge()()()()}if(2&n){const t=zt().$implicit,r=zt(2);bt(2),Ct("ngIf",(null==t||null==t.target?null:t.target.address)===r.address),bt(1),Ct("ngIf",(null==t||null==t.target?null:t.target.address)!==r.address),bt(4),gf(" ",(null==t||null==t.target?null:t.target.address)===r.address?"+":"-","",t.amount/1e6," tez "),bt(3),Ct("ngIf",(null==t||null==t.target?null:t.target.address)===r.address),bt(1),Ct("ngIf",(null==t||null==t.target?null:t.target.address)!==r.address),bt(5),Nr(xp(17,7,t.timestamp,"live"))}}function LV(n,e){1&n&&Bt(0,"img",37)}function FV(n,e){1&n&&Bt(0,"img",38)}function UV(n,e){if(1&n&&(Ue(0,"span",39)(1,"strong",40),ft(2,"From:"),Ge(),ft(3),Qo(4,"shortenString"),Ge()),2&n){const t=zt(2).$implicit;let r;bt(3),Vn(" ",Js(4,1,null!==(r=null==t||null==t.from?null:t.from.address)&&void 0!==r?r:""),"")}}function HV(n,e){if(1&n&&(Ue(0,"span",39)(1,"strong",41),ft(2,"To:"),Ge(),ft(3),Qo(4,"shortenString"),Ge()),2&n){const t=zt(2).$implicit;let r;bt(3),Vn(" ",Js(4,1,null!==(r=null==t||null==t.to?null:t.to.address)&&void 0!==r?r:""),"")}}function VV(n,e){if(1&n){const t=oo();Ue(0,"div",22)(1,"div",23),Ft(2,LV,1,0,"img",24),Ft(3,FV,1,0,"img",25),Ue(4,"div",26)(5,"p",27)(6,"span",28),ft(7),ft(8),Ge()()()(),Ue(9,"div",29)(10,"div",30),Ft(11,UV,5,3,"span",31),Ft(12,HV,5,3,"span",31),Ue(13,"img",32),Tt("click",function(i){ui(t);const a=zt().$implicit,h=zt(2);let v;return h.copyAddressToClipboard(i,null!==(v=(null==a||null==a.to?null:a.to.address)===h.address?null==a.from?null:a.from.address:null==a.to?null:a.to.address)&&void 0!==v?v:"")}),Ge()(),Ue(14,"div",33)(15,"div",34),Tt("click",function(){ui(t);const i=zt().$implicit;return zt(2).openLink("https://tzkt.io/transactions/"+i.transactionId)}),Ue(16,"span",35),ft(17),Qo(18,"timeago"),Ge()(),Ue(19,"div"),Bt(20,"img",36),Ge()()()()}if(2&n){const t=zt().$implicit,r=zt(2);bt(2),Ct("ngIf",(null==t||null==t.to?null:t.to.address)===r.address),bt(1),Ct("ngIf",(null==t||null==t.to?null:t.to.address)!==r.address),bt(4),gf(" ",(null==t||null==t.to?null:t.to.address)===r.address?"+":"-","",t.formattedAmount," "),bt(1),Vn(" ",null==t.token||null==t.token.metadata?null:t.token.metadata.name," "),bt(3),Ct("ngIf",(null==t||null==t.to?null:t.to.address)===r.address),bt(1),Ct("ngIf",(null==t||null==t.to?null:t.to.address)!==r.address),bt(5),Nr(xp(18,8,t.timestamp,"live"))}}function jV(n,e){if(1&n&&(Ue(0,"div",18)(1,"div",19)(2,"div",20),Ft(3,RV,2,1,"div",21),Ft(4,BV,20,10,"div",21),Ft(5,VV,21,11,"div",21),Ge()()()),2&n){const t=e.$implicit;Ct("@fadeInAnimation",void 0),bt(3),Ct("ngIf","transaction"!==t.type&&"tokenTransfer"!==t.type),bt(1),Ct("ngIf","transaction"===t.type),bt(1),Ct("ngIf","tokenTransfer"===t.type)}}function $V(n,e){if(1&n&&(Zo(0),Ft(1,jV,6,4,"div",17),Xo()),2&n){const t=zt();bt(1),Ct("ngForOf",t.operations)}}let zV=(()=>{class n{constructor(t,r){var i=this;this.accountService=t,this.clipboardService=r,this.operations=[],this.isLoading=!0,this.address="",this.accountService.accounts$.pipe(fi()).subscribe(function(){var a=Ot(function*(h){h[0]&&(i.address=h[0].address)});return function(h){return a.apply(this,arguments)}}())}ngOnInit(){}openLink(t){window.open(t,"_blank")}copyAddressToClipboard(t,r){t.stopPropagation(),this.clipboardService.copy(r)}}return n.\u0275fac=function(t){return new(t||n)(ot(Os),ot(Tv))},n.\u0275cmp=Un({type:n,selectors:[["app-operations"]],inputs:{operations:"operations",isLoading:"isLoading"},decls:13,vars:4,consts:[[1,"card","no-shadow","cardBox"],[1,"card-body",2,"padding","30px"],[1,"row","operations-header"],[1,"col-6"],[1,"card-title"],[1,"col-6","text-right"],["target","_blank",1,"explorer-link",3,"href"],["src","./assets/icons/FiExternalLink.svg","alt","SVG Image",2,"width","16px","height","16px"],["class","spinner-container",4,"ngIf"],[4,"ngIf"],[1,"spinner-container"],[1,"spinner"],["src","./assets/icons/arrow-spin.svg","alt","Loading...",1,"svg-spinner"],[1,"stateBox"],[1,"metamaskTitle"],[1,"metamaskSubtitle"],["type","button",1,"btn","btn-outline-primary","btn-circle","mr-2",3,"click"],["class","card card-container",4,"ngFor","ngForOf"],[1,"card","card-container"],[1,"card-body",2,"padding","15px"],[1,"justify-content-between","align-items-center"],["class","d-flex flex-column",4,"ngIf"],[1,"d-flex","flex-column"],[1,"d-flex","flex-row"],["src","./assets/icons/MdOutlineCallReceived.svg","alt","Received","style","\n width: 18px;\n height: 18px;\n margin-right: 4px;\n margin-top: 2px;\n ",4,"ngIf"],["src","./assets/icons/MdOutlineCallReceived.svg","alt","Sent","style","\n color: #6e6e73;\n width: 18px;\n height: 18px;\n margin-right: 4px;\n margin-top: 2px;\n transform: rotate(180deg);\n ",4,"ngIf"],[1,"flex-grow-1"],[1,"text-amount"],[1,"truncate-text","truncate-container"],[1,"d-flex","align-items-center","mobile-container",2,"margin-left","22px","justify-content","space-between"],[1,"elements-left"],["class","text-address",4,"ngIf"],["src","./assets/icons/FiCopy.svg","alt","Copy",1,"copy-button",2,"width","16px","height","16px","margin-left","6px",3,"click"],[1,"elements-right","d-flex","align-items-center"],[3,"click"],[1,"timestamp"],["src","./assets/icons/MdOutlineCheckCircle.svg","alt","Checked",2,"width","16px","height","16px","margin-left","4px"],["src","./assets/icons/MdOutlineCallReceived.svg","alt","Received",2,"width","18px","height","18px","margin-right","4px","margin-top","2px"],["src","./assets/icons/MdOutlineCallReceived.svg","alt","Sent",2,"color","#6e6e73","width","18px","height","18px","margin-right","4px","margin-top","2px","transform","rotate(180deg)"],[1,"text-address"],[2,"font-weight","600","font-family","Inter"],[2,"font-weight","600"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h2",4),ft(5,"Operations"),Ge()(),Ue(6,"div",5)(7,"a",6),ft(8,"View in Explorer"),Ge(),Bt(9,"img",7),Ge()(),Ft(10,DV,3,0,"div",8),Ft(11,IV,9,1,"div",9),Ft(12,$V,2,1,"ng-container",9),Ge()()),2&t&&(bt(7),gu("href","https://tzkt.io/",r.address,"",ws),bt(3),Ct("ngIf",r.isLoading),bt(1),Ct("ngIf",!r.isLoading&&0===r.operations.length),bt(1),Ct("ngIf",!r.isLoading))},directives:[fo,Ru],pipes:[Rv,AV],styles:[".no-shadow[_ngcontent-%COMP%]{box-shadow:none}.cardBox[_ngcontent-%COMP%]{border-radius:20px;background:var(--Netural-1, #f5f5f7);box-shadow:none;min-height:472px}.operations-header[_ngcontent-%COMP%]{margin-bottom:30px}.card-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:left;margin:0}.card-container[_ngcontent-%COMP%]{border-radius:10px;background-color:#fff;box-shadow:0 0 10px #0000001a;overflow:hidden;min-height:87px}.copy-button[_ngcontent-%COMP%]{cursor:pointer;color:#d2d2d7}.explorer-link[_ngcontent-%COMP%]{color:#0f61ff;margin-right:4px}.badge-light[_ngcontent-%COMP%]{background-color:#0079ff;color:#fff}.timestamp[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:right;color:#6e6e73;cursor:pointer;white-space:nowrap;max-width:100%;margin-left:auto}.timestamp[_ngcontent-%COMP%]:hover{text-decoration:underline}.text-amount[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:16px;font-weight:600;letter-spacing:0em;text-align:left;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1;word-break:break-word;flex-shrink:1;max-width:100%}.truncate-text[_ngcontent-%COMP%]{display:inline-block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (max-width: 837px){.truncate-text[_ngcontent-%COMP%]{max-width:600px!important}}@media (max-width: 837px) and (max-width: 796px){.truncate-text[_ngcontent-%COMP%]{max-width:550px!important}}@media (max-width: 837px) and (max-width: 680px){.truncate-text[_ngcontent-%COMP%]{max-width:500px!important}}@media (max-width: 837px) and (max-width: 630px){.truncate-text[_ngcontent-%COMP%]{max-width:400px!important}}@media (max-width: 837px) and (max-width: 540px){.truncate-text[_ngcontent-%COMP%]{max-width:350px!important}}@media (max-width: 837px) and (max-width: 485px){.truncate-text[_ngcontent-%COMP%]{max-width:300px!important}}@media (max-width: 837px) and (max-width: 440px){.truncate-text[_ngcontent-%COMP%]{max-width:280px!important}}@media (max-width: 837px) and (max-width: 400px){.truncate-text[_ngcontent-%COMP%]{max-width:250px!important}}@media (max-width: 837px) and (max-width: 375px){.truncate-text[_ngcontent-%COMP%]{max-width:230px!important}}@media (max-width: 837px) and (max-width: 360px){.truncate-text[_ngcontent-%COMP%]{max-width:200px!important}}@media (min-width: 837px){.truncate-text[_ngcontent-%COMP%]{max-width:360px}}.text-address[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;color:#6e6e73}.text-strong[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:600;line-height:17px;letter-spacing:0em;text-align:left}.explorer-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.metamasTextBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:20px;display:flex;padding:1rem}.stateBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex;padding:1rem;height:48vh}.metamaskTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:28px;font-weight:600;line-height:34px;letter-spacing:0em;text-align:center;color:#6e6e73}.metamaskSubtitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:center;max-width:400px;color:#86868b}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{color:#0f61ff;border-color:#d2d2d7;background-color:transparent}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]:hover{color:#0f61ff;border-color:#0f61ff;background-color:transparent;outline:none}@media (max-width: 1490px){.cardBox[_ngcontent-%COMP%]{width:100%!important}}@media (min-width: 768px){.cardBox[_ngcontent-%COMP%]{width:100%;margin:0 auto}.card-container[_ngcontent-%COMP%]{margin:10px auto 0}}@media (max-width: 768px){.card-container[_ngcontent-%COMP%]{min-height:72px!important}.timestamp[_ngcontent-%COMP%]{font-size:12px}.text-amount[_ngcontent-%COMP%]{font-size:14px}.text-address[_ngcontent-%COMP%]{font-size:12px}.card-container[_ngcontent-%COMP%]{margin-top:10px}.card-title[_ngcontent-%COMP%]{margin:0}}.spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:36vh}.spinner[_ngcontent-%COMP%]{text-align:center}.svg-spinner[_ngcontent-%COMP%]{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"],data:{animation:[Ov]}}),n})();function GV(n,e){1&n&&(Ue(0,"h2",6),ft(1," Collectibles "),Ge()),2&n&&Ct("@fadeInAnimation",void 0)}function KV(n,e){1&n&&(Ue(0,"div",7)(1,"div",8),Bt(2,"img",9),Ue(3,"div",10),Bt(4,"img",11),Ge()()())}function qV(n,e){1&n&&(Ue(0,"div",12)(1,"div",10),Bt(2,"img",11),Ge(),Ue(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16),Bt(7,"img",17)(8,"img",18)(9,"img",19),Ge()(),Ue(10,"div",20)(11,"div",21),ft(12," Welcome to Tezos Wallet Explorer, powered by MetaMask "),Ge(),Ue(13,"div",22)(14,"p"),ft(15," This explorer will allow you to connect with Tezos dApps and view and manage tokens via the MetaMask Wallet. Note, this account won't be visible in your MetaMask browser extension. "),Ge()()()()()()),2&n&&Ct("@fadeInAnimation",void 0)}function WV(n,e){if(1&n){const t=oo();Ue(0,"div",25),Tt("click",function(){const a=ui(t).$implicit;return zt(2).showNFTModal(a)}),Ue(1,"div",26),Bt(2,"img",27),Ge(),Ue(3,"p",28),ft(4),Ge()()}if(2&n){const t=e.$implicit;bt(2),Ct("src",t.token.metadata.sanitizedThumbnailUri,ws),bt(2),Nr(t.token.metadata.name)}}function ZV(n,e){if(1&n&&(Ue(0,"div",23),Ft(1,WV,5,2,"div",24),Ge()),2&n){const t=zt();Ct("@fadeInAnimation",void 0),bt(1),Ct("ngForOf",t.nfts)}}let XV=(()=>{class n{constructor(t){this.modalService=t,this.nfts=[],this.isLoading=!0}ngOnInit(){}showNFTModal(t){this.modalService.showNFTModal(t)}}return n.\u0275fac=function(t){return new(t||n)(ot(Fs))},n.\u0275cmp=Un({type:n,selectors:[["app-nft-list"]],inputs:{nfts:"nfts",isLoading:"isLoading"},decls:6,vars:4,consts:[[1,"card","cardBox"],[1,"card-body",2,"padding","10px"],["class","card-title",4,"ngIf"],["class","spinner-container",4,"ngIf"],["class","container",4,"ngIf"],["class","grid-container",4,"ngIf"],[1,"card-title"],[1,"spinner-container"],[1,"spinner"],["src","./assets/icons/arrow-spin.svg","alt","Loading...",1,"svg-spinner"],[1,"background-image"],["src","./assets/icons/Vector.svg","alt","SVG Image",1,"max-height-300"],[1,"container"],[1,"centered-content"],[1,"textBox"],[1,"imageBox"],[1,"d-flex","justify-content-center",2,"width","40px","height","40px"],["src","./assets/tezos-logo-sm.svg","alt","SVG Image",2,"width","100%","height","100%"],["src","./assets/icons/close.svg","alt","SVG Image",2,"width","20px","height","100%","margin-left","20px"],["src","./assets/metamask-logo-sm.svg","alt","SVG Image",2,"width","100%","height","100%","margin-left","20px"],[1,"metamasTextBox"],[1,"metamaskTitle"],[1,"metamaskSubtitle"],[1,"grid-container"],["class","grid-item custom-grid-item",3,"click",4,"ngFor","ngForOf"],[1,"grid-item","custom-grid-item",3,"click"],[1,"image-container"],[3,"src"],[1,"text-name"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1),Ft(2,GV,2,1,"h2",2),Ft(3,KV,5,0,"div",3),Ft(4,qV,16,1,"div",4),Ft(5,ZV,2,2,"div",5),Ge()()),2&t&&(bt(2),Ct("ngIf",r.nfts.length>0),bt(1),Ct("ngIf",r.isLoading),bt(1),Ct("ngIf",!r.isLoading&&0===r.nfts.length),bt(1),Ct("ngIf",r.nfts.length>0))},directives:[fo,Ru],styles:[".cardBox[_ngcontent-%COMP%]{width:100%;border-radius:20px;background:var(--Netural-1, #f5f5f7);margin:0 0 0 auto;box-sizing:border-box;box-shadow:none;min-height:692px}.card-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:left;padding:20px 20px 0}.container[_ngcontent-%COMP%]{position:relative}.background-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;text-align:center}.background-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{vertical-align:middle}.centered-content[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100vh}.grid-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(182px,1fr));align-content:center;justify-content:center;align-items:center;justify-items:center;grid-gap:10px;gap:10px;padding:20px}.custom-grid-item[_ngcontent-%COMP%]{width:100%;min-width:182px;height:226px;border-radius:10px;background-color:#fff;box-shadow:0 0 10px #0000001a;display:flex;flex-direction:column;border:none}.image-container[_ngcontent-%COMP%]{flex:1;display:flex;justify-content:center;align-items:center;padding:10px;overflow:hidden}.image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:162px;height:162px}.text-name[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;padding-left:10px;padding-right:10px;word-wrap:break-word;max-height:34px;overflow:hidden;text-overflow:ellipsis}.imageBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:30px;display:inline-flex}.textBox[_ngcontent-%COMP%]{flex-direction:column;gap:30px;max-width:480px;display:flex;justify-content:center;align-items:center;z-index:1}.metamasTextBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:20px;display:flex}.metamaskTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:28px;font-weight:600;line-height:34px;letter-spacing:0em;text-align:center}.metamaskSubtitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:center;max-width:400px;color:#1d1d1f}@media (max-width: 768px){.card-title[_ngcontent-%COMP%]{margin-left:10px}.grid-container[_ngcontent-%COMP%]{padding:10px}.image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:134px;height:134px}.custom-grid-item[_ngcontent-%COMP%]{min-width:0px}.max-height-300[_ngcontent-%COMP%]{max-height:300px;width:auto}.cardBox[_ngcontent-%COMP%]{max-width:100%;margin-left:0;padding:0}.grid-container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}@media (min-width: 1200px){.background-image[_ngcontent-%COMP%]{margin-top:3rem}}.spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:90vh}.spinner[_ngcontent-%COMP%]{text-align:center}.svg-spinner[_ngcontent-%COMP%]{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"],data:{animation:[Ov]}}),n})(),YV=(()=>{class n{constructor(t){this.modalService=t}ngOnInit(){}openLink(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(ot(Fs))},n.\u0275cmp=Un({type:n,selectors:[["app-footer"]],decls:20,vars:0,consts:[[1,"footer-container","mt-3","px-lg-5","py-lg-2"],[1,"row","custom-footer","justify-content-between","text-muted"],[1,"d-flex","align-items-center"],["href","#",1,"footer-link",3,"click"],[1,"separator"],["href","#",1,"footer-link","footer-link-faqs",3,"click"],[1,"text-right","text-tezos"],["href","https://metamask.io/snaps/","target","_blank",1,"text-footer"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1)(2,"div",2)(3,"a",3),Tt("click",function(){return r.openLink("https://github.com/airgap-it/tezos-snaps-wallet")}),ft(4,"GitHub"),Ge(),Bt(5,"div",4),Ue(6,"a",3),Tt("click",function(){return r.openLink("./assets/documents/privacy-policy.pdf")}),ft(7,"Privacy Policy"),Ge(),Bt(8,"div",4),Ue(9,"a",3),Tt("click",function(){return r.openLink("./assets/documents/terms-of-service.pdf")}),ft(10,"Terms of Service"),Ge(),Bt(11,"div",4),Ue(12,"a",5),Tt("click",function(){return r.openLink("https://github.com/airgap-it/tezos-metamask-snap/wiki/FAQs")}),ft(13,"FAQs"),Ge()(),Ue(14,"div",2)(15,"span",6),ft(16," Powered by "),Ue(17,"u")(18,"a",7),ft(19,"MetaMask Snaps"),Ge()()()()()())},styles:[".footer-container[_ngcontent-%COMP%]{background:#f5f5f7;border-radius:20px;min-height:100px}.footer-link[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:normal;text-decoration:none;color:#424245;white-space:nowrap;padding:20px}.footer-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.custom-footer[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;margin-top:inherit}.separator[_ngcontent-%COMP%]{width:1px;height:20px;background:#d2d2d7;margin:10px}.text-footer[_ngcontent-%COMP%]{color:#86868b}.text-footer[_ngcontent-%COMP%]:hover{text-decoration:underline}.custom-footer[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:nowrap}.text-tezos[_ngcontent-%COMP%]{font-size:12px}@media (min-width: 768px){.custom-footer[_ngcontent-%COMP%]{flex-direction:row;justify-content:space-between;align-items:center;white-space:nowrap}}@media (max-width: 768px){.custom-footer[_ngcontent-%COMP%]{margin-top:0}.footer-container[_ngcontent-%COMP%]{padding:20px}.footer-link[_ngcontent-%COMP%]{padding:10px}.text-tezos[_ngcontent-%COMP%]{margin-top:10px}.separator[_ngcontent-%COMP%]{margin:2px}}@media (max-width: 991px){.custom-footer[_ngcontent-%COMP%]{max-width:-moz-fit-content;max-width:fit-content;margin:auto;padding-top:20px}}@media (max-width: 423px){.footer-link[_ngcontent-%COMP%]{font-size:x-small}}"]}),n})();function QV(n,e){1&n&&Bt(0,"app-landing")}function JV(n,e){1&n&&Bt(0,"app-header-item")}function ej(n,e){if(1&n&&(Ue(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5),Bt(4,"app-account",6),Ge(),Ue(5,"div",7)(6,"div",8)(7,"div",9),Bt(8,"img",10),Ue(9,"p",11),ft(10," This explorer will allow you to connect with Tezos dApps and send/receive tokens via the MetaMask Wallet. Note, this account won't be visible in your MetaMask browser extension. "),Ge()()()(),Ue(11,"div",12),Bt(12,"app-operations",13),Ge()(),Ue(13,"div",14)(14,"div",15),Bt(15,"app-nft-list",16),Ge(),Ue(16,"div",17),Bt(17,"app-operations",13),Ge()()(),Bt(18,"app-footer"),Ge()),2&n){const t=zt();bt(4),Ct("isLoading",t.isLoading)("balance",t.balance)("usdBalance",t.usdBalance)("address",t.address)("tokens",t.tokens),bt(8),Ct("isLoading",t.isLoading)("operations",t.operations),bt(3),Ct("isLoading",t.isLoading)("nfts",t.nfts),bt(2),Ct("isLoading",t.isLoading)("operations",t.operations)}}let tj=(()=>{class n{constructor(t,r,i,a,h,v,D){var L=this;this.api=t,this.beacon=r,this.metamaskService=i,this.accountService=a,this.modalService=h,this.router=v,this.tabSyncService=D,this.balance="0",this.usdBalance="0",this.address="",this.operations=[],this.price=0,this.nfts=[],this.tokens=[],this.isLoading=!0,this.isCollapsed=!0,this.syncCode="",this.connected=!1,this.peersAndPermissions=[],this.selectedNodes=[],this.accounts$=this.accountService.accounts$,this.loadNodes(),this.router.events.subscribe(function(){var j=Ot(function*(Q){if(Q instanceof yl){const me=`https://placeholder.com/${Q.url}`;if(me.includes("?type=tzip10&data=")){console.log(me);const Te=new URL(me).searchParams.get("data");Te&&(console.log("ADDING PEER"),yield L.beacon.addPeer(Te),L.router.navigate(["/"]))}}});return function(Q){return j.apply(this,arguments)}}()),setInterval(()=>{this.loadAccountInfo()},1e4),this.loadAccountInfo()}loadAccountInfo(){var t=this;this.accountService.accounts$.pipe(fi()).subscribe(function(){var r=Ot(function*(i){if(i[0]){const a=i[0].address;t.address=a,Promise.all([t.api.getXtzPrice(),t.api.getBalanceOfAddress(a),t.api.getOperationHistory(a),t.api.getTokenTransactionHistory(a),t.api.getNftBalances(a),t.api.getTokenBalances(a)]).then(([h,v,D,L,j,Q])=>{t.isLoading=!1,t.balance=v.shiftedBy(-6).toString(10);const me=[...D,...L.map(ye=>{var Te,Ve,je;const gt=Object.assign(Object.assign({},ye),{type:"tokenTransfer"});return gt.formattedAmount=new Nn(gt.amount).shiftedBy(-new Nn(null!==(je=null===(Ve=null===(Te=null==gt?void 0:gt.token)||void 0===Te?void 0:Te.metadata)||void 0===Ve?void 0:Ve.decimals)&&void 0!==je?je:0).toNumber()).decimalPlaces(6).toString(10),gt})].sort((ye,Te)=>Te.id-ye.id).slice(0,10);me.some((ye,Te)=>{var Ve;return(null==ye?void 0:ye.id)!==(null===(Ve=t.operations[Te])||void 0===Ve?void 0:Ve.id)})&&(t.operations=me),j.some((ye,Te)=>{var Ve;return(null==ye?void 0:ye.id)!==(null===(Ve=t.nfts[Te])||void 0===Ve?void 0:Ve.id)})&&(t.nfts=j),Q.some((ye,Te)=>{var Ve,je;return(null==ye?void 0:ye.id)!==(null===(Ve=t.tokens[Te])||void 0===Ve?void 0:Ve.id)||(null==ye?void 0:ye.humanReadableBalance)!==(null===(je=t.tokens[Te])||void 0===je?void 0:je.humanReadableBalance)})&&(t.tokens=Q),t.price=h,t.usdBalance=new Nn(t.balance).times(t.price).decimalPlaces(2).toString(10),console.log("BALANCE: ",t.balance),console.log("TXs: ",t.operations),console.log("tokenTransfers: ",L),console.log("NFTs: ",t.nfts),console.log("TOKENs: ",t.tokens)})}});return function(i){return r.apply(this,arguments)}}())}loadNodes(){this.selectedNodes=Object.entries(this.api.RPCs).filter(t=>t[1].all.length>0).map(t=>[t[0],t[1].selected])}ngOnInit(){var t=this;return Ot(function*(){t.connected=yield t.beacon.walletClient.isConnected,t.getPeers()})()}paste(){var t=this;return Ot(function*(){navigator.clipboard.readText().then(function(){var r=Ot(function*(i){try{t.syncCode=i}catch(a){}});return function(i){return r.apply(this,arguments)}}())})()}connect(){var t=this;return Ot(function*(){const r=t.modalService.showLoadingModal();setTimeout(()=>{t.beacon.addPeer(t.syncCode).finally(()=>r.hide())},500)})()}getPeers(){var t=this;return Ot(function*(){const r=yield t.beacon.walletClient.getPeers(),i=yield t.beacon.walletClient.getPermissions();t.peersAndPermissions=r.map(a=>[a,i.filter(h=>h.senderId===a.senderId)])})()}removePeer(t,r){var i=this;return Ot(function*(){t.stopPropagation(),i.modalService.showConfirmModal(Ot(function*(){yield i.beacon.walletClient.removePeer(r,!0),i.getPeers()}))})()}removePermission(t){var r=this;return Ot(function*(){r.modalService.showConfirmModal(Ot(function*(){yield r.beacon.walletClient.removePermission(t.accountIdentifier),r.getPeers()}))})()}removeAccount(t){var r=this;return Ot(function*(){r.modalService.showConfirmModal(()=>{r.accountService.removeAccount(t)})})()}openNodeSelectorModal(){var t;null===(t=this.modalService.showNodeSelectorModal().onHide)||void 0===t||t.subscribe(()=>{this.loadNodes()})}openHowToModal(){this.modalService.showHowToModal()}}return n.\u0275fac=function(t){return new(t||n)(ot(Ju),ot(mc),ot(Xh),ot(Os),ot(Fs),ot(hi),ot(B3))},n.\u0275cmp=Un({type:n,selectors:[["app-root"]],decls:5,vars:3,consts:[[4,"ngIf"],["class","container-fluid px-md-5 pb-3",4,"ngIf"],[1,"container-fluid","px-md-5","pb-3"],[1,"row"],[1,"col","fixed-width"],[1,"card","no-shadow","mb-3"],[3,"isLoading","balance","usdBalance","address","tokens"],[1,"card","no-shadow","mb-3","cardBox"],[1,"card-body",2,"padding","30px"],[1,"infoInputBox"],["src","./assets/icons/FiAlertCircleBlack.svg","alt","alert",2,"width","20px","height","20px"],[1,"infoInputText"],[1,"card","no-shadow","mb-3","d-none","d-md-block"],[3,"isLoading","operations"],[1,"col"],[1,"max-width"],[3,"isLoading","nfts"],[1,"card","no-shadow","mb-3","d-md-none","operations-mobile"]],template:function(t,r){1&t&&(Ft(0,QV,1,0,"app-landing",0),Ue(1,"div"),Ft(2,JV,1,0,"app-header-item",0),Ge(),Ft(3,ej,19,11,"div",1),Bt(4,"router-outlet")),2&t&&(Ct("ngIf",!r.accountService.hasAccounts),bt(2),Ct("ngIf",r.accountService.hasAccounts),bt(1),Ct("ngIf",r.accountService.hasAccounts))},directives:[fo,uV,cV,vV,zV,XV,YV,Zg],styles:[".header[_ngcontent-%COMP%]{font-size:24px} .card{background:#f5f5f7;border-radius:20px;border:none} .card-header{border:none} .btn-circle{border-radius:100px} modal-container{-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px)} modal-container .modal-header{border-bottom:none} modal-container .modal-footer{border-top:none} .modal-content{border-radius:20px;padding:50px} .modal-content .close{margin-top:-50px;margin-right:-50px;width:40px;height:40px;padding:10px;background:#f5f5f7;border-radius:100px;justify-content:center;align-items:center}.no-shadow[_ngcontent-%COMP%]{box-shadow:none}.infoInputBox[_ngcontent-%COMP%]{gap:10px;display:flex;justify-content:left;align-items:center}.infoInputText[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto}.cardBox[_ngcontent-%COMP%]{box-shadow:none;box-sizing:border-box;margin:0 auto}@media (max-width: 768px){.fixed-width[_ngcontent-%COMP%]{min-width:none!important;max-width:none!important}.operations-mobile[_ngcontent-%COMP%]{margin-top:20px}}@media (min-width: 768px){.fixed-width[_ngcontent-%COMP%]{min-width:500px;max-width:500px}}@media (max-width: 837px){.col[_ngcontent-%COMP%]{max-width:none!important}.d-md-block[_ngcontent-%COMP%]{display:none!important}.operations-mobile[_ngcontent-%COMP%]{display:block!important;margin-top:20px}}"]}),n})();const xn=!1;function W6(n){return new Ne(3e3,xn)}function kj(){return"undefined"!=typeof window&&void 0!==window.document}function Nv(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Us(n){switch(n.length){case 0:return new Bu;case 1:return n[0];default:return new EM(n)}}function Z6(n,e,t,r,i={},a={}){const h=[],v=[];let D=-1,L=null;if(r.forEach(j=>{const Q=j.offset,me=Q==D,ye=me&&L||{};Object.keys(j).forEach(Te=>{let Ve=Te,je=j[Te];if("offset"!==Te)switch(Ve=e.normalizePropertyName(Ve,h),je){case"!":je=i[Te];break;case ts:je=a[Te];break;default:je=e.normalizeStyleValue(Te,Ve,je,h)}ye[Ve]=je}),me||v.push(ye),L=ye,D=Q}),h.length)throw function xj(n){return new Ne(3502,xn)}();return v}function kv(n,e,t,r){switch(e){case"start":n.onStart(()=>r(t&&Bv(t,"start",n)));break;case"done":n.onDone(()=>r(t&&Bv(t,"done",n)));break;case"destroy":n.onDestroy(()=>r(t&&Bv(t,"destroy",n)))}}function Bv(n,e,t){const r=t.totalTime,a=Lv(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==r?n.totalTime:r,!!t.disabled),h=n._data;return null!=h&&(a._data=h),a}function Lv(n,e,t,r,i="",a=0,h){return{element:n,triggerName:e,fromState:t,toState:r,phaseName:i,totalTime:a,disabled:!!h}}function Ri(n,e,t){let r;return n instanceof Map?(r=n.get(e),r||n.set(e,r=t)):(r=n[e],r||(r=n[e]=t)),r}function X6(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let Fv=(n,e)=>!1,Y6=(n,e,t)=>[],Q6=null;function Uv(n){const e=n.parentNode||n.host;return e===Q6?null:e}(Nv()||"undefined"!=typeof Element)&&(kj()?(Q6=(()=>document.documentElement)(),Fv=(n,e)=>{for(;e;){if(e===n)return!0;e=Uv(e)}return!1}):Fv=(n,e)=>n.contains(e),Y6=(n,e,t)=>{if(t)return Array.from(n.querySelectorAll(e));const r=n.querySelector(e);return r?[r]:[]});let ba=null,J6=!1;function eS(n){ba||(ba=function Lj(){return"undefined"!=typeof document?document.body:null}()||{},J6=!!ba.style&&"WebkitAppearance"in ba.style);let e=!0;return ba.style&&!function Bj(n){return"ebkit"==n.substring(1,6)}(n)&&(e=n in ba.style,!e&&J6&&(e="Webkit"+n.charAt(0).toUpperCase()+n.substr(1)in ba.style)),e}const tS=Fv,nS=Y6;let rS=(()=>{class n{validateStyleProperty(t){return eS(t)}matchesElement(t,r){return!1}containsElement(t,r){return tS(t,r)}getParentElement(t){return Uv(t)}query(t,r,i){return nS(t,r,i)}computeStyle(t,r,i){return i||""}animate(t,r,i,a,h,v=[],D){return new Bu(i,a)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),Hv=(()=>{class n{}return n.NOOP=new rS,n})();const Vv="ng-enter",sd="ng-leave",ad="ng-trigger",ld=".ng-trigger",oS="ng-animating",jv=".ng-animating";function _a(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:$v(parseFloat(e[1]),e[2])}function $v(n,e){return"s"===e?1e3*n:n}function ud(n,e,t){return n.hasOwnProperty("duration")?n:function Hj(n,e,t){let i,a=0,h="";if("string"==typeof n){const v=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===v)return e.push(W6()),{duration:0,delay:0,easing:""};i=$v(parseFloat(v[1]),v[2]);const D=v[3];null!=D&&(a=$v(parseFloat(D),v[4]));const L=v[5];L&&(h=L)}else i=n;if(!t){let v=!1,D=e.length;i<0&&(e.push(function nj(){return new Ne(3100,xn)}()),v=!0),a<0&&(e.push(function rj(){return new Ne(3101,xn)}()),v=!0),v&&e.splice(D,0,W6())}return{duration:i,delay:a,easing:h}}(n,e,t)}function kl(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function Hs(n,e,t={}){if(e)for(let r in n)t[r]=n[r];else kl(n,t);return t}function aS(n,e,t){return t?e+":"+t+";":""}function lS(n){let e="";for(let t=0;t{const i=Gv(r);t&&!t.hasOwnProperty(r)&&(t[r]=n.style[i]),n.style[i]=e[r]}),Nv()&&lS(n))}function wa(n,e){n.style&&(Object.keys(e).forEach(t=>{const r=Gv(t);n.style[r]=""}),Nv()&&lS(n))}function wc(n){return Array.isArray(n)?1==n.length?n[0]:wM(n):n}const zv=new RegExp("{{\\s*(.+?)\\s*}}","g");function uS(n){let e=[];if("string"==typeof n){let t;for(;t=zv.exec(n);)e.push(t[1]);zv.lastIndex=0}return e}function cd(n,e,t){const r=n.toString(),i=r.replace(zv,(a,h)=>{let v=e[h];return e.hasOwnProperty(h)||(t.push(function oj(n){return new Ne(3003,xn)}()),v=""),v.toString()});return i==r?n:i}function fd(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const jj=/-+([a-z0-9])/g;function Gv(n){return n.replace(jj,(...e)=>e[1].toUpperCase())}function $j(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Oi(n,e,t){switch(e.type){case 7:return n.visitTrigger(e,t);case 0:return n.visitState(e,t);case 1:return n.visitTransition(e,t);case 2:return n.visitSequence(e,t);case 3:return n.visitGroup(e,t);case 4:return n.visitAnimate(e,t);case 5:return n.visitKeyframes(e,t);case 6:return n.visitStyle(e,t);case 8:return n.visitReference(e,t);case 9:return n.visitAnimateChild(e,t);case 10:return n.visitAnimateRef(e,t);case 11:return n.visitQuery(e,t);case 12:return n.visitStagger(e,t);default:throw function sj(n){return new Ne(3004,xn)}()}}function cS(n,e){return window.getComputedStyle(n)[e]}function Zj(n,e){const t=[];return"string"==typeof n?n.split(/\s*,\s*/).forEach(r=>function Xj(n,e,t){if(":"==n[0]){const D=function Yj(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,r)=>parseFloat(r)>parseFloat(t);case":decrement":return(t,r)=>parseFloat(r) *"}}(n,t);if("function"==typeof D)return void e.push(D);n=D}const r=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==r||r.length<4)return t.push(function bj(n){return new Ne(3015,xn)}()),e;const i=r[1],a=r[2],h=r[3];e.push(fS(i,h));"<"==a[0]&&!("*"==i&&"*"==h)&&e.push(fS(h,i))}(r,t,e)):t.push(n),t}const gd=new Set(["true","1"]),md=new Set(["false","0"]);function fS(n,e){const t=gd.has(n)||md.has(n),r=gd.has(e)||md.has(e);return(i,a)=>{let h="*"==n||n==i,v="*"==e||e==a;return!h&&t&&"boolean"==typeof i&&(h=i?gd.has(n):md.has(n)),!v&&r&&"boolean"==typeof a&&(v=a?gd.has(e):md.has(e)),h&&v}}const Qj=new RegExp("s*:selfs*,?","g");function Kv(n,e,t,r){return new Jj(n).build(e,t,r)}class Jj{constructor(e){this._driver=e}build(e,t,r){const i=new n$(t);this._resetContextStyleTimingState(i);const a=Oi(this,wc(e),i);return i.unsupportedCSSPropertiesFound.size&&i.unsupportedCSSPropertiesFound.keys(),a}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let r=t.queryCount=0,i=t.depCount=0;const a=[],h=[];return"@"==e.name.charAt(0)&&t.errors.push(function lj(){return new Ne(3006,xn)}()),e.definitions.forEach(v=>{if(this._resetContextStyleTimingState(t),0==v.type){const D=v,L=D.name;L.toString().split(/\s*,\s*/).forEach(j=>{D.name=j,a.push(this.visitState(D,t))}),D.name=L}else if(1==v.type){const D=this.visitTransition(v,t);r+=D.queryCount,i+=D.depCount,h.push(D)}else t.errors.push(function uj(){return new Ne(3007,xn)}())}),{type:7,name:e.name,states:a,transitions:h,queryCount:r,depCount:i,options:null}}visitState(e,t){const r=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(r.containsDynamicStyles){const a=new Set,h=i||{};r.styles.forEach(v=>{if(vd(v)){const D=v;Object.keys(D).forEach(L=>{uS(D[L]).forEach(j=>{h.hasOwnProperty(j)||a.add(j)})})}}),a.size&&(fd(a.values()),t.errors.push(function cj(n,e){return new Ne(3008,xn)}()))}return{type:0,name:e.name,style:r,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const r=Oi(this,wc(e.animation),t);return{type:1,matchers:Zj(e.expr,t.errors),animation:r,queryCount:t.queryCount,depCount:t.depCount,options:Ma(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(r=>Oi(this,r,t)),options:Ma(e.options)}}visitGroup(e,t){const r=t.currentTime;let i=0;const a=e.steps.map(h=>{t.currentTime=r;const v=Oi(this,h,t);return i=Math.max(i,t.currentTime),v});return t.currentTime=i,{type:3,steps:a,options:Ma(e.options)}}visitAnimate(e,t){const r=function i$(n,e){if(n.hasOwnProperty("duration"))return n;if("number"==typeof n)return qv(ud(n,e).duration,0,"");const t=n;if(t.split(/\s+/).some(a=>"{"==a.charAt(0)&&"{"==a.charAt(1))){const a=qv(0,0,"");return a.dynamic=!0,a.strValue=t,a}const i=ud(t,e);return qv(i.duration,i.delay,i.easing)}(e.timings,t.errors);t.currentAnimateTimings=r;let i,a=e.styles?e.styles:Ci({});if(5==a.type)i=this.visitKeyframes(a,t);else{let h=e.styles,v=!1;if(!h){v=!0;const L={};r.easing&&(L.easing=r.easing),h=Ci(L)}t.currentTime+=r.duration+r.delay;const D=this.visitStyle(h,t);D.isEmptyStep=v,i=D}return t.currentAnimateTimings=null,{type:4,timings:r,style:i,options:null}}visitStyle(e,t){const r=this._makeStyleAst(e,t);return this._validateStyleAst(r,t),r}_makeStyleAst(e,t){const r=[];Array.isArray(e.styles)?e.styles.forEach(h=>{"string"==typeof h?h==ts?r.push(h):t.errors.push(function fj(n){return new Ne(3002,xn)}()):r.push(h)}):r.push(e.styles);let i=!1,a=null;return r.forEach(h=>{if(vd(h)){const v=h,D=v.easing;if(D&&(a=D,delete v.easing),!i)for(let L in v)if(v[L].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:r,easing:a,offset:e.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(e,t){const r=t.currentAnimateTimings;let i=t.currentTime,a=t.currentTime;r&&a>0&&(a-=r.duration+r.delay),e.styles.forEach(h=>{"string"!=typeof h&&Object.keys(h).forEach(v=>{if(!this._driver.validateStyleProperty(v))return delete h[v],void t.unsupportedCSSPropertiesFound.add(v);const D=t.collectedStyles[t.currentQuerySelector],L=D[v];let j=!0;L&&(a!=i&&a>=L.startTime&&i<=L.endTime&&(t.errors.push(function hj(n,e,t,r,i){return new Ne(3010,xn)}()),j=!1),a=L.startTime),j&&(D[v]={startTime:a,endTime:i}),t.options&&function Vj(n,e,t){const r=e.params||{},i=uS(n);i.length&&i.forEach(a=>{r.hasOwnProperty(a)||t.push(function ij(n){return new Ne(3001,xn)}())})}(h[v],t.options,t.errors)})})}visitKeyframes(e,t){const r={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(function dj(){return new Ne(3011,xn)}()),r;let a=0;const h=[];let v=!1,D=!1,L=0;const j=e.steps.map(gt=>{const Ie=this._makeStyleAst(gt,t);let _t=null!=Ie.offset?Ie.offset:function r$(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(vd(t)&&t.hasOwnProperty("offset")){const r=t;e=parseFloat(r.offset),delete r.offset}});else if(vd(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(Ie.styles),At=0;return null!=_t&&(a++,At=Ie.offset=_t),D=D||At<0||At>1,v=v||At0&&a{const _t=me>0?Ie==ye?1:me*Ie:h[Ie],At=_t*je;t.currentTime=Te+Ve.delay+At,Ve.duration=At,this._validateStyleAst(gt,t),gt.offset=_t,r.styles.push(gt)}),r}visitReference(e,t){return{type:8,animation:Oi(this,wc(e.animation),t),options:Ma(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:Ma(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Ma(e.options)}}visitQuery(e,t){const r=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;const[a,h]=function e$(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(Qj,"")),n=n.replace(/@\*/g,ld).replace(/@\w+/g,t=>ld+"-"+t.substr(1)).replace(/:animating/g,jv),[n,e]}(e.selector);t.currentQuerySelector=r.length?r+" "+a:a,Ri(t.collectedStyles,t.currentQuerySelector,{});const v=Oi(this,wc(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=r,{type:11,selector:a,limit:i.limit||0,optional:!!i.optional,includeSelf:h,animation:v,originalSelector:e.selector,options:Ma(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(function vj(){return new Ne(3013,xn)}());const r="full"===e.timings?{duration:0,delay:0,easing:"full"}:ud(e.timings,t.errors,!0);return{type:12,animation:Oi(this,wc(e.animation),t),timings:r,options:null}}}class n${constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function vd(n){return!Array.isArray(n)&&"object"==typeof n}function Ma(n){return n?(n=kl(n)).params&&(n.params=function t$(n){return n?kl(n):null}(n.params)):n={},n}function qv(n,e,t){return{duration:n,delay:e,easing:t}}function Wv(n,e,t,r,i,a,h=null,v=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:r,duration:i,delay:a,totalTime:i+a,easing:h,subTimeline:v}}class yd{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,t){let r=this._map.get(e);r||this._map.set(e,r=[]),r.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const a$=new RegExp(":enter","g"),u$=new RegExp(":leave","g");function Zv(n,e,t,r,i,a={},h={},v,D,L=[]){return(new c$).buildKeyframes(n,e,t,r,i,a,h,v,D,L)}class c${buildKeyframes(e,t,r,i,a,h,v,D,L,j=[]){L=L||new yd;const Q=new Xv(e,t,L,i,a,j,[]);Q.options=D,Q.currentTimeline.setStyles([h],null,Q.errors,D),Oi(this,r,Q);const me=Q.timelines.filter(ye=>ye.containsAnimation());if(Object.keys(v).length){let ye;for(let Te=me.length-1;Te>=0;Te--){const Ve=me[Te];if(Ve.element===t){ye=Ve;break}}ye&&!ye.allowOnlyTimelineStyles()&&ye.setStyles([v],null,Q.errors,D)}return me.length?me.map(ye=>ye.buildKeyframes()):[Wv(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const r=t.subInstructions.get(t.element);if(r){const i=t.createSubContext(e.options),a=t.currentTimeline.currentTime,h=this._visitSubInstructions(r,i,i.options);a!=h&&t.transformIntoNewTimeline(h)}t.previousNode=e}visitAnimateRef(e,t){const r=t.createSubContext(e.options);r.transformIntoNewTimeline(),this.visitReference(e.animation,r),t.transformIntoNewTimeline(r.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,r){let a=t.currentTimeline.currentTime;const h=null!=r.duration?_a(r.duration):null,v=null!=r.delay?_a(r.delay):null;return 0!==h&&e.forEach(D=>{const L=t.appendInstructionToTimeline(D,h,v);a=Math.max(a,L.duration+L.delay)}),a}visitReference(e,t){t.updateOptions(e.options,!0),Oi(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const r=t.subContextCount;let i=t;const a=e.options;if(a&&(a.params||a.delay)&&(i=t.createSubContext(a),i.transformIntoNewTimeline(),null!=a.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=bd);const h=_a(a.delay);i.delayNextStep(h)}e.steps.length&&(e.steps.forEach(h=>Oi(this,h,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const r=[];let i=t.currentTimeline.currentTime;const a=e.options&&e.options.delay?_a(e.options.delay):0;e.steps.forEach(h=>{const v=t.createSubContext(e.options);a&&v.delayNextStep(a),Oi(this,h,v),i=Math.max(i,v.currentTimeline.currentTime),r.push(v.currentTimeline)}),r.forEach(h=>t.currentTimeline.mergeTimelineCollectedStyles(h)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const r=e.strValue;return ud(t.params?cd(r,t.params,t.errors):r,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const r=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;r.delay&&(t.incrementTime(r.delay),i.snapshotCurrentStyles());const a=e.style;5==a.type?this.visitKeyframes(a,t):(t.incrementTime(r.duration),this.visitStyle(a,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const r=t.currentTimeline,i=t.currentAnimateTimings;!i&&r.getCurrentStyleProperties().length&&r.forwardFrame();const a=i&&i.easing||e.easing;e.isEmptyStep?r.applyEmptyStep(a):r.setStyles(e.styles,a,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const r=t.currentAnimateTimings,i=t.currentTimeline.duration,a=r.duration,v=t.createSubContext().currentTimeline;v.easing=r.easing,e.styles.forEach(D=>{v.forwardTime((D.offset||0)*a),v.setStyles(D.styles,D.easing,t.errors,t.options),v.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(v),t.transformIntoNewTimeline(i+a),t.previousNode=e}visitQuery(e,t){const r=t.currentTimeline.currentTime,i=e.options||{},a=i.delay?_a(i.delay):0;a&&(6===t.previousNode.type||0==r&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=bd);let h=r;const v=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=v.length;let D=null;v.forEach((L,j)=>{t.currentQueryIndex=j;const Q=t.createSubContext(e.options,L);a&&Q.delayNextStep(a),L===t.element&&(D=Q.currentTimeline),Oi(this,e.animation,Q),Q.currentTimeline.applyStylesToKeyframe(),h=Math.max(h,Q.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(h),D&&(t.currentTimeline.mergeTimelineCollectedStyles(D),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const r=t.parentContext,i=t.currentTimeline,a=e.timings,h=Math.abs(a.duration),v=h*(t.currentQueryTotal-1);let D=h*t.currentQueryIndex;switch(a.duration<0?"reverse":a.easing){case"reverse":D=v-D;break;case"full":D=r.currentStaggerTime}const j=t.currentTimeline;D&&j.delayNextStep(D);const Q=j.currentTime;Oi(this,e.animation,t),t.previousNode=e,r.currentStaggerTime=i.currentTime-Q+(i.startTime-r.currentTimeline.startTime)}}const bd={};class Xv{constructor(e,t,r,i,a,h,v,D){this._driver=e,this.element=t,this.subInstructions=r,this._enterClassName=i,this._leaveClassName=a,this.errors=h,this.timelines=v,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=bd,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=D||new _d(this._driver,t,0),v.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const r=e;let i=this.options;null!=r.duration&&(i.duration=_a(r.duration)),null!=r.delay&&(i.delay=_a(r.delay));const a=r.params;if(a){let h=i.params;h||(h=this.options.params={}),Object.keys(a).forEach(v=>{(!t||!h.hasOwnProperty(v))&&(h[v]=cd(a[v],h,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const r=e.params={};Object.keys(t).forEach(i=>{r[i]=t[i]})}}return e}createSubContext(e=null,t,r){const i=t||this.element,a=new Xv(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return a.previousNode=this.previousNode,a.currentAnimateTimings=this.currentAnimateTimings,a.options=this._copyOptions(),a.updateOptions(e),a.currentQueryIndex=this.currentQueryIndex,a.currentQueryTotal=this.currentQueryTotal,a.parentContext=this,this.subContextCount++,a}transformIntoNewTimeline(e){return this.previousNode=bd,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,r){const i={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=r?r:0)+e.delay,easing:""},a=new f$(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(a),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,r,i,a,h){let v=[];if(i&&v.push(this.element),e.length>0){e=(e=e.replace(a$,"."+this._enterClassName)).replace(u$,"."+this._leaveClassName);let L=this._driver.query(this.element,e,1!=r);0!==r&&(L=r<0?L.slice(L.length+r,L.length):L.slice(0,r)),v.push(...L)}return!a&&0==v.length&&h.push(function yj(n){return new Ne(3014,xn)}()),v}}class _d{constructor(e,t,r,i){this._driver=e,this.element=t,this.startTime=r,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new _d(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||ts,this._currentKeyframe[t]=ts}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,r,i){t&&(this._previousKeyframe.easing=t);const a=i&&i.params||{},h=function h$(n,e){const t={};let r;return n.forEach(i=>{"*"===i?(r=r||Object.keys(e),r.forEach(a=>{t[a]=ts})):Hs(i,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(h).forEach(v=>{const D=cd(h[v],a,r);this._pendingStyles[v]=D,this._localTimelineStyles.hasOwnProperty(v)||(this._backFill[v]=this._globalTimelineStyles.hasOwnProperty(v)?this._globalTimelineStyles[v]:ts),this._updateStyle(v,D)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(r=>{this._currentKeyframe[r]=e[r]}),Object.keys(this._localTimelineStyles).forEach(r=>{this._currentKeyframe.hasOwnProperty(r)||(this._currentKeyframe[r]=this._localTimelineStyles[r])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const r=this._styleSummary[t],i=e._styleSummary[t];(!r||i.time>r.time)&&this._updateStyle(t,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,r=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((v,D)=>{const L=Hs(v,!0);Object.keys(L).forEach(j=>{const Q=L[j];"!"==Q?e.add(j):Q==ts&&t.add(j)}),r||(L.offset=D/this.duration),i.push(L)});const a=e.size?fd(e.values()):[],h=t.size?fd(t.values()):[];if(r){const v=i[0],D=kl(v);v.offset=0,D.offset=1,i=[v,D]}return Wv(this.element,i,a,h,this.duration,this.startTime,this.easing,!1)}}class f$ extends _d{constructor(e,t,r,i,a,h,v=!1){super(e,t,h.delay),this.keyframes=r,this.preStyleProps=i,this.postStyleProps=a,this._stretchStartingKeyframe=v,this.timings={duration:h.duration,delay:h.delay,easing:h.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:r,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){const a=[],h=r+t,v=t/h,D=Hs(e[0],!1);D.offset=0,a.push(D);const L=Hs(e[0],!1);L.offset=pS(v),a.push(L);const j=e.length-1;for(let Q=1;Q<=j;Q++){let me=Hs(e[Q],!1);me.offset=pS((t+me.offset*r)/h),a.push(me)}r=h,t=0,i="",e=a}return Wv(this.element,e,this.preStyleProps,this.postStyleProps,r,t,i,!0)}}function pS(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class Yv{}class d$ extends Yv{normalizePropertyName(e,t){return Gv(e)}normalizeStyleValue(e,t,r,i){let a="";const h=r.toString().trim();if(p$[t]&&0!==r&&"0"!==r)if("number"==typeof r)a="px";else{const v=r.match(/^[+-]?[\d\.]+([a-z]*)$/);v&&0==v[1].length&&i.push(function aj(n,e){return new Ne(3005,xn)}())}return h+a}}const p$=(()=>function g$(n){const e={};return n.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function gS(n,e,t,r,i,a,h,v,D,L,j,Q,me){return{type:0,element:n,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:a,toState:r,toStyles:h,timelines:v,queriedElements:D,preStyleProps:L,postStyleProps:j,totalTime:Q,errors:me}}const Qv={};class mS{constructor(e,t,r){this._triggerName=e,this.ast=t,this._stateStyles=r}match(e,t,r,i){return function m$(n,e,t,r,i){return n.some(a=>a(e,t,r,i))}(this.ast.matchers,e,t,r,i)}buildStyles(e,t,r){const i=this._stateStyles["*"],a=this._stateStyles[e],h=i?i.buildStyles(t,r):{};return a?a.buildStyles(t,r):h}build(e,t,r,i,a,h,v,D,L,j){const Q=[],me=this.ast.options&&this.ast.options.params||Qv,Te=this.buildStyles(r,v&&v.params||Qv,Q),Ve=D&&D.params||Qv,je=this.buildStyles(i,Ve,Q),gt=new Set,Ie=new Map,_t=new Map,At="void"===i,Nt={params:Object.assign(Object.assign({},me),Ve)},Vt=j?[]:Zv(e,t,this.ast.animation,a,h,Te,je,Nt,L,Q);let Zt=0;if(Vt.forEach(De=>{Zt=Math.max(De.duration+De.delay,Zt)}),Q.length)return gS(t,this._triggerName,r,i,At,Te,je,[],[],Ie,_t,Zt,Q);Vt.forEach(De=>{const ke=De.element,dt=Ri(Ie,ke,{});De.preStyleProps.forEach(st=>dt[st]=!0);const Qe=Ri(_t,ke,{});De.postStyleProps.forEach(st=>Qe[st]=!0),ke!==t&>.add(ke)});const Se=fd(gt.values());return gS(t,this._triggerName,r,i,At,Te,je,Vt,Se,Ie,_t,Zt)}}class v${constructor(e,t,r){this.styles=e,this.defaultParams=t,this.normalizer=r}buildStyles(e,t){const r={},i=kl(this.defaultParams);return Object.keys(e).forEach(a=>{const h=e[a];null!=h&&(i[a]=h)}),this.styles.styles.forEach(a=>{if("string"!=typeof a){const h=a;Object.keys(h).forEach(v=>{let D=h[v];D.length>1&&(D=cd(D,i,t));const L=this.normalizer.normalizePropertyName(v,t);D=this.normalizer.normalizeStyleValue(v,L,D,t),r[L]=D})}}),r}}class b${constructor(e,t,r){this.name=e,this.ast=t,this._normalizer=r,this.transitionFactories=[],this.states={},t.states.forEach(i=>{this.states[i.name]=new v$(i.style,i.options&&i.options.params||{},r)}),vS(this.states,"true","1"),vS(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new mS(e,i,this.states))}),this.fallbackTransition=function _$(n,e,t){return new mS(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(h,v)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,r,i){return this.transitionFactories.find(h=>h.match(e,t,r,i))||null}matchStyles(e,t,r){return this.fallbackTransition.buildStyles(e,t,r)}}function vS(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const w$=new yd;class M${constructor(e,t,r){this.bodyNode=e,this._driver=t,this._normalizer=r,this._animations={},this._playersById={},this.players=[]}register(e,t){const r=[],a=Kv(this._driver,t,r,[]);if(r.length)throw function Sj(n){return new Ne(3503,xn)}();this._animations[e]=a}_buildPlayer(e,t,r){const i=e.element,a=Z6(0,this._normalizer,0,e.keyframes,t,r);return this._driver.animate(i,a,e.duration,e.delay,e.easing,[],!0)}create(e,t,r={}){const i=[],a=this._animations[e];let h;const v=new Map;if(a?(h=Zv(this._driver,t,a,Vv,sd,{},{},r,w$,i),h.forEach(j=>{const Q=Ri(v,j.element,{});j.postStyleProps.forEach(me=>Q[me]=null)})):(i.push(function Cj(){return new Ne(3300,xn)}()),h=[]),i.length)throw function Aj(n){return new Ne(3504,xn)}();v.forEach((j,Q)=>{Object.keys(j).forEach(me=>{j[me]=this._driver.computeStyle(Q,me,ts)})});const L=Us(h.map(j=>{const Q=v.get(j.element);return this._buildPlayer(j,{},Q)}));return this._playersById[e]=L,L.onDestroy(()=>this.destroy(e)),this.players.push(L),L}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const r=this.players.indexOf(t);r>=0&&this.players.splice(r,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw function Tj(n){return new Ne(3301,xn)}();return t}listen(e,t,r,i){const a=Lv(t,"","","");return kv(this._getPlayer(e),r,a,i),()=>{}}command(e,t,r,i){if("register"==r)return void this.register(e,i[0]);if("create"==r)return void this.create(e,t,i[0]||{});const a=this._getPlayer(e);switch(r){case"play":a.play();break;case"pause":a.pause();break;case"reset":a.reset();break;case"restart":a.restart();break;case"finish":a.finish();break;case"init":a.init();break;case"setPosition":a.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e)}}}const yS="ng-animate-queued",Jv="ng-animate-disabled",A$=[],bS={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},T$={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Ki="__ng_removed";class e1{constructor(e,t=""){this.namespaceId=t;const r=e&&e.hasOwnProperty("value");if(this.value=function O$(n){return null!=n?n:null}(r?e.value:e),r){const a=kl(e);delete a.value,this.options=a}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const r=this.options.params;Object.keys(t).forEach(i=>{null==r[i]&&(r[i]=t[i])})}}}const Mc="void",t1=new e1(Mc);class D${constructor(e,t,r){this.id=e,this.hostElement=t,this._engine=r,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,qi(t,this._hostClassName)}listen(e,t,r,i){if(!this._triggers.hasOwnProperty(t))throw function Dj(n,e){return new Ne(3302,xn)}();if(null==r||0==r.length)throw function Ij(n){return new Ne(3303,xn)}();if(!function P$(n){return"start"==n||"done"==n}(r))throw function Rj(n,e){return new Ne(3400,xn)}();const a=Ri(this._elementListeners,e,[]),h={name:t,phase:r,callback:i};a.push(h);const v=Ri(this._engine.statesByElement,e,{});return v.hasOwnProperty(t)||(qi(e,ad),qi(e,ad+"-"+t),v[t]=t1),()=>{this._engine.afterFlush(()=>{const D=a.indexOf(h);D>=0&&a.splice(D,1),this._triggers[t]||delete v[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw function Oj(n){return new Ne(3401,xn)}();return t}trigger(e,t,r,i=!0){const a=this._getTrigger(t),h=new n1(this.id,t,e);let v=this._engine.statesByElement.get(e);v||(qi(e,ad),qi(e,ad+"-"+t),this._engine.statesByElement.set(e,v={}));let D=v[t];const L=new e1(r,this.id);if(!(r&&r.hasOwnProperty("value"))&&D&&L.absorbOptions(D.options),v[t]=L,D||(D=t1),L.value!==Mc&&D.value===L.value){if(!function B$(n,e){const t=Object.keys(n),r=Object.keys(e);if(t.length!=r.length)return!1;for(let i=0;i{wa(e,je),$o(e,gt)})}return}const me=Ri(this._engine.playersByElement,e,[]);me.forEach(Ve=>{Ve.namespaceId==this.id&&Ve.triggerName==t&&Ve.queued&&Ve.destroy()});let ye=a.matchTransition(D.value,L.value,e,L.params),Te=!1;if(!ye){if(!i)return;ye=a.fallbackTransition,Te=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:ye,fromState:D,toState:L,player:h,isFallbackTransition:Te}),Te||(qi(e,yS),h.onStart(()=>{Bl(e,yS)})),h.onDone(()=>{let Ve=this.players.indexOf(h);Ve>=0&&this.players.splice(Ve,1);const je=this._engine.playersByElement.get(e);if(je){let gt=je.indexOf(h);gt>=0&&je.splice(gt,1)}}),this.players.push(h),me.push(h),h}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,r)=>{delete t[e]}),this._elementListeners.forEach((t,r)=>{this._elementListeners.set(r,t.filter(i=>i.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(r=>r.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const r=this._engine.driver.query(e,ld,!0);r.forEach(i=>{if(i[Ki])return;const a=this._engine.fetchNamespacesByElement(i);a.size?a.forEach(h=>h.triggerLeaveAnimation(i,t,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>r.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,r,i){const a=this._engine.statesByElement.get(e),h=new Map;if(a){const v=[];if(Object.keys(a).forEach(D=>{if(h.set(D,a[D].value),this._triggers[D]){const L=this.trigger(e,D,Mc,i);L&&v.push(L)}}),v.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,h),r&&Us(v).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),r=this._engine.statesByElement.get(e);if(t&&r){const i=new Set;t.forEach(a=>{const h=a.name;if(i.has(h))return;i.add(h);const D=this._triggers[h].fallbackTransition,L=r[h]||t1,j=new e1(Mc),Q=new n1(this.id,h,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:h,transition:D,fromState:L,toState:j,player:Q,isFallbackTransition:!0})})}}removeNode(e,t){const r=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(r.totalAnimations){const a=r.players.length?r.playersByQueriedElement.get(e):[];if(a&&a.length)i=!0;else{let h=e;for(;h=h.parentNode;)if(r.statesByElement.get(h)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)r.markElementAsRemoved(this.id,e,!1,t);else{const a=e[Ki];(!a||a===bS)&&(r.afterFlush(()=>this.clearElementCache(e)),r.destroyInnerAnimations(e),r._onRemovalComplete(e,t))}}insertNode(e,t){qi(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(r=>{const i=r.player;if(i.destroyed)return;const a=r.element,h=this._elementListeners.get(a);h&&h.forEach(v=>{if(v.name==r.triggerName){const D=Lv(a,r.triggerName,r.fromState.value,r.toState.value);D._data=e,kv(r.player,v.phase,D,v.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(r)}),this._queue=[],t.sort((r,i)=>{const a=r.transition.ast.depCount,h=i.transition.ast.depCount;return 0==a||0==h?a-h:this._engine.driver.containsElement(r.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(r=>r.element===e)||t,t}}class I${constructor(e,t,r){this.bodyNode=e,this.driver=t,this._normalizer=r,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(i,a)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(r=>{r.queued&&e.push(r)})}),e}createNamespace(e,t){const r=new D$(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(r,t):(this.newHostElements.set(t,r),this.collectEnterElement(t)),this._namespaceLookup[e]=r}_balanceNamespaceList(e,t){const r=this._namespaceList,i=this.namespacesByHostElement,a=r.length-1;if(a>=0){let h=!1;if(void 0!==this.driver.getParentElement){let v=this.driver.getParentElement(t);for(;v;){const D=i.get(v);if(D){const L=r.indexOf(D);r.splice(L+1,0,e),h=!0;break}v=this.driver.getParentElement(v)}}else for(let v=a;v>=0;v--)if(this.driver.containsElement(r[v].hostElement,t)){r.splice(v+1,0,e),h=!0;break}h||r.unshift(e)}else r.push(e);return i.set(t,e),e}register(e,t){let r=this._namespaceLookup[e];return r||(r=this.createNamespace(e,t)),r}registerTrigger(e,t,r){let i=this._namespaceLookup[e];i&&i.register(t,r)&&this.totalAnimations++}destroy(e,t){if(!e)return;const r=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(r.hostElement),delete this._namespaceLookup[e];const i=this._namespaceList.indexOf(r);i>=0&&this._namespaceList.splice(i,1)}),this.afterFlushAnimationsDone(()=>r.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,r=this.statesByElement.get(e);if(r){const i=Object.keys(r);for(let a=0;a=0&&this.collectedLeaveElements.splice(h,1)}if(e){const h=this._fetchNamespace(e);h&&h.insertNode(t,r)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),qi(e,Jv)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Bl(e,Jv))}removeNode(e,t,r,i){if(wd(t)){const a=e?this._fetchNamespace(e):null;if(a?a.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i),r){const h=this.namespacesByHostElement.get(t);h&&h.id!==e&&h.removeNode(t,i)}}else this._onRemovalComplete(t,i)}markElementAsRemoved(e,t,r,i,a){this.collectedLeaveElements.push(t),t[Ki]={namespaceId:e,setForRemoval:i,hasAnimation:r,removedBeforeQueried:!1,previousTriggersValues:a}}listen(e,t,r,i,a){return wd(t)?this._fetchNamespace(e).listen(t,r,i,a):()=>{}}_buildInstruction(e,t,r,i,a){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,r,i,e.fromState.options,e.toState.options,t,a)}destroyInnerAnimations(e){let t=this.driver.query(e,ld,!0);t.forEach(r=>this.destroyActiveAnimationsForElement(r)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,jv,!0),t.forEach(r=>this.finishActiveQueriedAnimationOnElement(r)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(r=>{r.queued?r.markedForDestroy=!0:r.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(r=>r.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Us(this.players).onDone(()=>e());e()})}processLeaveNode(e){var t;const r=e[Ki];if(r&&r.setForRemoval){if(e[Ki]=bS,r.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,r.setForRemoval)}(null===(t=e.classList)||void 0===t?void 0:t.contains(Jv))&&this.markElementAsDisabled(e,!1),this.driver.query(e,".ng-animate-disabled",!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((r,i)=>this._balanceNamespaceList(r,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let r=0;rr()),this._flushFns=[],this._whenQuietFns.length){const r=this._whenQuietFns;this._whenQuietFns=[],t.length?Us(t).onDone(()=>{r.forEach(i=>i())}):r.forEach(i=>i())}}reportError(e){throw function Pj(n){return new Ne(3402,xn)}()}_flushAnimations(e,t){const r=new yd,i=[],a=new Map,h=[],v=new Map,D=new Map,L=new Map,j=new Set;this.disabledNodes.forEach(Fe=>{j.add(Fe);const Ke=this.driver.query(Fe,".ng-animate-queued",!0);for(let qe=0;qe{const qe=Vv+Ve++;Te.set(Ke,qe),Fe.forEach(yt=>qi(yt,qe))});const je=[],gt=new Set,Ie=new Set;for(let Fe=0;Fegt.add(yt)):Ie.add(Ke))}const _t=new Map,At=MS(me,Array.from(gt));At.forEach((Fe,Ke)=>{const qe=sd+Ve++;_t.set(Ke,qe),Fe.forEach(yt=>qi(yt,qe))}),e.push(()=>{ye.forEach((Fe,Ke)=>{const qe=Te.get(Ke);Fe.forEach(yt=>Bl(yt,qe))}),At.forEach((Fe,Ke)=>{const qe=_t.get(Ke);Fe.forEach(yt=>Bl(yt,qe))}),je.forEach(Fe=>{this.processLeaveNode(Fe)})});const Nt=[],Vt=[];for(let Fe=this._namespaceList.length-1;Fe>=0;Fe--)this._namespaceList[Fe].drainQueuedTransitions(t).forEach(qe=>{const yt=qe.player,Dt=qe.element;if(Nt.push(yt),this.collectedEnterElements.length){const In=Dt[Ki];if(In&&In.setForMove){if(In.previousTriggersValues&&In.previousTriggersValues.has(qe.triggerName)){const Wi=In.previousTriggersValues.get(qe.triggerName),Zi=this.statesByElement.get(qe.element);Zi&&Zi[qe.triggerName]&&(Zi[qe.triggerName].value=Wi)}return void yt.destroy()}}const Pt=!Q||!this.driver.containsElement(Q,Dt),Yt=_t.get(Dt),On=Te.get(Dt),an=this._buildInstruction(qe,r,On,Yt,Pt);if(an.errors&&an.errors.length)return void Vt.push(an);if(Pt)return yt.onStart(()=>wa(Dt,an.fromStyles)),yt.onDestroy(()=>$o(Dt,an.toStyles)),void i.push(yt);if(qe.isFallbackTransition)return yt.onStart(()=>wa(Dt,an.fromStyles)),yt.onDestroy(()=>$o(Dt,an.toStyles)),void i.push(yt);const Sn=[];an.timelines.forEach(In=>{In.stretchStartingKeyframe=!0,this.disabledNodes.has(In.element)||Sn.push(In)}),an.timelines=Sn,r.append(Dt,an.timelines),h.push({instruction:an,player:yt,element:Dt}),an.queriedElements.forEach(In=>Ri(v,In,[]).push(yt)),an.preStyleProps.forEach((In,Wi)=>{const Zi=Object.keys(In);if(Zi.length){let Eo=D.get(Wi);Eo||D.set(Wi,Eo=new Set),Zi.forEach(yi=>Eo.add(yi))}}),an.postStyleProps.forEach((In,Wi)=>{const Zi=Object.keys(In);let Eo=L.get(Wi);Eo||L.set(Wi,Eo=new Set),Zi.forEach(yi=>Eo.add(yi))})});if(Vt.length){const Fe=[];Vt.forEach(Ke=>{Fe.push(function Nj(n,e){return new Ne(3505,xn)}())}),Nt.forEach(Ke=>Ke.destroy()),this.reportError(Fe)}const Zt=new Map,Se=new Map;h.forEach(Fe=>{const Ke=Fe.element;r.has(Ke)&&(Se.set(Ke,Ke),this._beforeAnimationBuild(Fe.player.namespaceId,Fe.instruction,Zt))}),i.forEach(Fe=>{const Ke=Fe.element;this._getPreviousPlayers(Ke,!1,Fe.namespaceId,Fe.triggerName,null).forEach(yt=>{Ri(Zt,Ke,[]).push(yt),yt.destroy()})});const De=je.filter(Fe=>xS(Fe,D,L)),ke=new Map;wS(ke,this.driver,Ie,L,ts).forEach(Fe=>{xS(Fe,D,L)&&De.push(Fe)});const Qe=new Map;ye.forEach((Fe,Ke)=>{wS(Qe,this.driver,new Set(Fe),D,"!")}),De.forEach(Fe=>{const Ke=ke.get(Fe),qe=Qe.get(Fe);ke.set(Fe,Object.assign(Object.assign({},Ke),qe))});const st=[],vt=[],Ze={};h.forEach(Fe=>{const{element:Ke,player:qe,instruction:yt}=Fe;if(r.has(Ke)){if(j.has(Ke))return qe.onDestroy(()=>$o(Ke,yt.toStyles)),qe.disabled=!0,qe.overrideTotalTime(yt.totalTime),void i.push(qe);let Dt=Ze;if(Se.size>1){let Yt=Ke;const On=[];for(;Yt=Yt.parentNode;){const an=Se.get(Yt);if(an){Dt=an;break}On.push(Yt)}On.forEach(an=>Se.set(an,Dt))}const Pt=this._buildAnimation(qe.namespaceId,yt,Zt,a,Qe,ke);if(qe.setRealPlayer(Pt),Dt===Ze)st.push(qe);else{const Yt=this.playersByElement.get(Dt);Yt&&Yt.length&&(qe.parentPlayer=Us(Yt)),i.push(qe)}}else wa(Ke,yt.fromStyles),qe.onDestroy(()=>$o(Ke,yt.toStyles)),vt.push(qe),j.has(Ke)&&i.push(qe)}),vt.forEach(Fe=>{const Ke=a.get(Fe.element);if(Ke&&Ke.length){const qe=Us(Ke);Fe.setRealPlayer(qe)}}),i.forEach(Fe=>{Fe.parentPlayer?Fe.syncPlayerEvents(Fe.parentPlayer):Fe.destroy()});for(let Fe=0;Fe!Pt.destroyed);Dt.length?N$(this,Ke,Dt):this.processLeaveNode(Ke)}return je.length=0,st.forEach(Fe=>{this.players.push(Fe),Fe.onDone(()=>{Fe.destroy();const Ke=this.players.indexOf(Fe);this.players.splice(Ke,1)}),Fe.play()}),st}elementContainsData(e,t){let r=!1;const i=t[Ki];return i&&i.setForRemoval&&(r=!0),this.playersByElement.has(t)&&(r=!0),this.playersByQueriedElement.has(t)&&(r=!0),this.statesByElement.has(t)&&(r=!0),this._fetchNamespace(e).elementContainsData(t)||r}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,r,i,a){let h=[];if(t){const v=this.playersByQueriedElement.get(e);v&&(h=v)}else{const v=this.playersByElement.get(e);if(v){const D=!a||a==Mc;v.forEach(L=>{L.queued||!D&&L.triggerName!=i||h.push(L)})}}return(r||i)&&(h=h.filter(v=>!(r&&r!=v.namespaceId||i&&i!=v.triggerName))),h}_beforeAnimationBuild(e,t,r){const a=t.element,h=t.isRemovalTransition?void 0:e,v=t.isRemovalTransition?void 0:t.triggerName;for(const D of t.timelines){const L=D.element,j=L!==a,Q=Ri(r,L,[]);this._getPreviousPlayers(L,j,h,v,t.toState).forEach(ye=>{const Te=ye.getRealPlayer();Te.beforeDestroy&&Te.beforeDestroy(),ye.destroy(),Q.push(ye)})}wa(a,t.fromStyles)}_buildAnimation(e,t,r,i,a,h){const v=t.triggerName,D=t.element,L=[],j=new Set,Q=new Set,me=t.timelines.map(Te=>{const Ve=Te.element;j.add(Ve);const je=Ve[Ki];if(je&&je.removedBeforeQueried)return new Bu(Te.duration,Te.delay);const gt=Ve!==D,Ie=function k$(n){const e=[];return ES(n,e),e}((r.get(Ve)||A$).map(Zt=>Zt.getRealPlayer())).filter(Zt=>!!Zt.element&&Zt.element===Ve),_t=a.get(Ve),At=h.get(Ve),Nt=Z6(0,this._normalizer,0,Te.keyframes,_t,At),Vt=this._buildPlayer(Te,Nt,Ie);if(Te.subTimeline&&i&&Q.add(Ve),gt){const Zt=new n1(e,v,Ve);Zt.setRealPlayer(Vt),L.push(Zt)}return Vt});L.forEach(Te=>{Ri(this.playersByQueriedElement,Te.element,[]).push(Te),Te.onDone(()=>function R$(n,e,t){let r;if(n instanceof Map){if(r=n.get(e),r){if(r.length){const i=r.indexOf(t);r.splice(i,1)}0==r.length&&n.delete(e)}}else if(r=n[e],r){if(r.length){const i=r.indexOf(t);r.splice(i,1)}0==r.length&&delete n[e]}return r}(this.playersByQueriedElement,Te.element,Te))}),j.forEach(Te=>qi(Te,oS));const ye=Us(me);return ye.onDestroy(()=>{j.forEach(Te=>Bl(Te,oS)),$o(D,t.toStyles)}),Q.forEach(Te=>{Ri(i,Te,[]).push(ye)}),ye}_buildPlayer(e,t,r){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,r):new Bu(e.duration,e.delay)}}class n1{constructor(e,t,r){this.namespaceId=e,this.triggerName=t,this.element=r,this._player=new Bu,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(r=>kv(e,t,void 0,r))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){Ri(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function wd(n){return n&&1===n.nodeType}function _S(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function wS(n,e,t,r,i){const a=[];t.forEach(D=>a.push(_S(D)));const h=[];r.forEach((D,L)=>{const j={};D.forEach(Q=>{const me=j[Q]=e.computeStyle(L,Q,i);(!me||0==me.length)&&(L[Ki]=T$,h.push(L))}),n.set(L,j)});let v=0;return t.forEach(D=>_S(D,a[v++])),h}function MS(n,e){const t=new Map;if(n.forEach(v=>t.set(v,[])),0==e.length)return t;const i=new Set(e),a=new Map;function h(v){if(!v)return 1;let D=a.get(v);if(D)return D;const L=v.parentNode;return D=t.has(L)?L:i.has(L)?1:h(L),a.set(v,D),D}return e.forEach(v=>{const D=h(v);1!==D&&t.get(D).push(v)}),t}function qi(n,e){var t;null===(t=n.classList)||void 0===t||t.add(e)}function Bl(n,e){var t;null===(t=n.classList)||void 0===t||t.remove(e)}function N$(n,e,t){Us(t).onDone(()=>n.processLeaveNode(e))}function ES(n,e){for(let t=0;ti.add(a)):e.set(n,r),t.delete(n),!0}class Md{constructor(e,t,r){this.bodyNode=e,this._driver=t,this._normalizer=r,this._triggerCache={},this.onRemovalComplete=(i,a)=>{},this._transitionEngine=new I$(e,t,r),this._timelineEngine=new M$(e,t,r),this._transitionEngine.onRemovalComplete=(i,a)=>this.onRemovalComplete(i,a)}registerTrigger(e,t,r,i,a){const h=e+"-"+i;let v=this._triggerCache[h];if(!v){const D=[],j=Kv(this._driver,a,D,[]);if(D.length)throw function Ej(n,e){return new Ne(3404,xn)}();v=function y$(n,e,t){return new b$(n,e,t)}(i,j,this._normalizer),this._triggerCache[h]=v}this._transitionEngine.registerTrigger(t,i,v)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,r,i){this._transitionEngine.insertNode(e,t,r,i)}onRemove(e,t,r,i){this._transitionEngine.removeNode(e,t,i||!1,r)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,r,i){if("@"==r.charAt(0)){const[a,h]=X6(r);this._timelineEngine.command(a,t,h,i)}else this._transitionEngine.trigger(e,t,r,i)}listen(e,t,r,i,a){if("@"==r.charAt(0)){const[h,v]=X6(r);return this._timelineEngine.listen(h,t,v,a)}return this._transitionEngine.listen(e,t,r,i,a)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}let F$=(()=>{class n{constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i,this._state=0;let a=n.initialStylesByElement.get(t);a||n.initialStylesByElement.set(t,a={}),this._initialStyles=a}start(){this._state<1&&(this._startStyles&&$o(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&($o(this._element,this._initialStyles),this._endStyles&&($o(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(wa(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(wa(this._element,this._endStyles),this._endStyles=null),$o(this._element,this._initialStyles),this._state=3)}}return n.initialStylesByElement=new WeakMap,n})();function r1(n){let e=null;const t=Object.keys(n);for(let r=0;re()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,r){return e.animate(t,r)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};if(this.hasStarted()){const t=this._finalKeyframe;Object.keys(t).forEach(r=>{"offset"!=r&&(e[r]=this._finished?t[r]:cS(this.element,r))})}this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class H${validateStyleProperty(e){return eS(e)}matchesElement(e,t){return!1}containsElement(e,t){return tS(e,t)}getParentElement(e){return Uv(e)}query(e,t,r){return nS(e,t,r)}computeStyle(e,t,r){return window.getComputedStyle(e)[t]}animate(e,t,r,i,a,h=[]){const D={duration:r,delay:i,fill:0==i?"both":"forwards"};a&&(D.easing=a);const L={},j=h.filter(me=>me instanceof SS);(function zj(n,e){return 0===n||0===e})(r,i)&&j.forEach(me=>{let ye=me.currentSnapshot;Object.keys(ye).forEach(Te=>L[Te]=ye[Te])}),t=function Gj(n,e,t){const r=Object.keys(t);if(r.length&&e.length){let a=e[0],h=[];if(r.forEach(v=>{a.hasOwnProperty(v)||h.push(v),a[v]=t[v]}),h.length)for(var i=1;iHs(me,!1)),L);const Q=function L$(n,e){let t=null,r=null;return Array.isArray(e)&&e.length?(t=r1(e[0]),e.length>1&&(r=r1(e[e.length-1]))):e&&(t=r1(e)),t||r?new F$(n,t,r):null}(e,t);return new SS(e,t,D,Q)}}let V$=(()=>{class n extends bM{constructor(t,r){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(r.body,{id:"0",encapsulation:Qi.None,styles:[],data:{animation:[]}})}build(t){const r=this._nextAnimationId.toString();this._nextAnimationId++;const i=Array.isArray(t)?wM(t):t;return CS(this._renderer,null,r,"register",[i]),new j$(r,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(Mt(Qs),Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class j$ extends class C7{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new $$(this._id,e,t||{},this._renderer)}}class $${constructor(e,t,r,i){this.id=e,this.element=t,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",r)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return CS(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function CS(n,e,t,r,i){return n.setProperty(e,`@@${t}:${r}`,i)}const AS="@.disabled";let z$=(()=>{class n{constructor(t,r,i){this.delegate=t,this.engine=r,this._zone=i,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),r.onRemovalComplete=(a,h)=>{const v=null==h?void 0:h.parentNode(a);v&&h.removeChild(v,a)}}createRenderer(t,r){const a=this.delegate.createRenderer(t,r);if(!(t&&r&&r.data&&r.data.animation)){let j=this._rendererCache.get(a);return j||(j=new TS("",a,this.engine),this._rendererCache.set(a,j)),j}const h=r.id,v=r.id+"-"+this._currentId;this._currentId++,this.engine.register(v,t);const D=j=>{Array.isArray(j)?j.forEach(D):this.engine.registerTrigger(h,v,t,j.name,j)};return r.data.animation.forEach(D),new G$(this,v,a,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,r,i){t>=0&&tr(i)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(a=>{const[h,v]=a;h(v)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([r,i]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return n.\u0275fac=function(t){return new(t||n)(Mt(Qs),Mt(Md),Mt(or))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class TS{constructor(e,t,r){this.namespaceId=e,this.delegate=t,this.engine=r,this.destroyNode=this.delegate.destroyNode?i=>t.destroyNode(i):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,r,i=!0){this.delegate.insertBefore(e,t,r),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,r){this.engine.onRemove(this.namespaceId,t,this.delegate,r)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,r,i){this.delegate.setAttribute(e,t,r,i)}removeAttribute(e,t,r){this.delegate.removeAttribute(e,t,r)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,r,i){this.delegate.setStyle(e,t,r,i)}removeStyle(e,t,r){this.delegate.removeStyle(e,t,r)}setProperty(e,t,r){"@"==t.charAt(0)&&t==AS?this.disableAnimations(e,!!r):this.delegate.setProperty(e,t,r)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,r){return this.delegate.listen(e,t,r)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class G$ extends TS{constructor(e,t,r,i){super(t,r,i),this.factory=e,this.namespaceId=t}setProperty(e,t,r){"@"==t.charAt(0)?"."==t.charAt(1)&&t==AS?this.disableAnimations(e,r=void 0===r||!!r):this.engine.process(this.namespaceId,e,t.substr(1),r):this.delegate.setProperty(e,t,r)}listen(e,t,r){if("@"==t.charAt(0)){const i=function K$(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let a=t.substr(1),h="";return"@"!=a.charAt(0)&&([a,h]=function q$(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(a)),this.engine.listen(this.namespaceId,i,a,h,v=>{this.factory.scheduleListenerCallback(v._data||-1,r,v)})}return this.delegate.listen(e,t,r)}}let W$=(()=>{class n extends Md{constructor(t,r,i){super(t.body,r,i)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr),Mt(Hv),Mt(Yv))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const DS=new Kt("AnimationModuleType"),IS=[{provide:bM,useClass:V$},{provide:Yv,useFactory:function Z$(){return new d$}},{provide:Md,useClass:W$},{provide:Qs,useFactory:function X$(n,e,t){return new z$(n,e,t)},deps:[qf,Md,or]}],RS=[{provide:Hv,useFactory:()=>new H$},{provide:DS,useValue:"BrowserAnimations"},...IS],Y$=[{provide:Hv,useClass:rS},{provide:DS,useValue:"NoopAnimations"},...IS];let Q$=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Y$:RS}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:RS,imports:[gM]}),n})();const OS="400ms cubic-bezier(0.4,0.0,0.2,1)";Ci({height:0,visibility:"hidden"}),pl(OS,Ci({height:"*",visibility:"visible"})),Ci({height:"*",visibility:"visible"}),pl(OS,Ci({height:0,visibility:"hidden"}));let PS=(()=>{class n{static forRoot(){return{ngModule:n,providers:[]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})(),ez=(()=>{class n{static forRoot(){return{ngModule:n,providers:[]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Pu,PS]]}),n})(),tz=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n,bootstrap:[tj]}),n.\u0275inj=jt({providers:[],imports:[[gM,ZN,vk,UL,Q$,UB.forRoot(),ez.forRoot(),PS.forRoot(),cP.forRoot(),WH,TV.forRoot(),gF.forRoot()]]}),n})();(function DI(){M2=!1})(),p7().bootstrapModule(tz).catch(n=>console.error(n))},4502:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(8046);function M(d,m,w){return void 0===m&&(m=new Uint8Array(2)),void 0===w&&(w=0),m[w+0]=d>>>8,m[w+1]=d>>>0,m}function _(d,m,w){return void 0===m&&(m=new Uint8Array(2)),void 0===w&&(w=0),m[w+0]=d>>>0,m[w+1]=d>>>8,m}function b(d,m){return void 0===m&&(m=0),d[m]<<24|d[m+1]<<16|d[m+2]<<8|d[m+3]}function C(d,m){return void 0===m&&(m=0),(d[m]<<24|d[m+1]<<16|d[m+2]<<8|d[m+3])>>>0}function x(d,m){return void 0===m&&(m=0),d[m+3]<<24|d[m+2]<<16|d[m+1]<<8|d[m]}function E(d,m){return void 0===m&&(m=0),(d[m+3]<<24|d[m+2]<<16|d[m+1]<<8|d[m])>>>0}function P(d,m,w){return void 0===m&&(m=new Uint8Array(4)),void 0===w&&(w=0),m[w+0]=d>>>24,m[w+1]=d>>>16,m[w+2]=d>>>8,m[w+3]=d>>>0,m}function A(d,m,w){return void 0===m&&(m=new Uint8Array(4)),void 0===w&&(w=0),m[w+0]=d>>>0,m[w+1]=d>>>8,m[w+2]=d>>>16,m[w+3]=d>>>24,m}function V(d,m,w){return void 0===m&&(m=new Uint8Array(8)),void 0===w&&(w=0),P(d/4294967296>>>0,m,w),P(d>>>0,m,w+4),m}function G(d,m,w){return void 0===m&&(m=new Uint8Array(8)),void 0===w&&(w=0),A(d>>>0,m,w),A(d/4294967296>>>0,m,w+4),m}F.readInt16BE=function B(d,m){return void 0===m&&(m=0),(d[m+0]<<8|d[m+1])<<16>>16},F.readUint16BE=function S(d,m){return void 0===m&&(m=0),(d[m+0]<<8|d[m+1])>>>0},F.readInt16LE=function T(d,m){return void 0===m&&(m=0),(d[m+1]<<8|d[m])<<16>>16},F.readUint16LE=function f(d,m){return void 0===m&&(m=0),(d[m+1]<<8|d[m])>>>0},F.writeUint16BE=M,F.writeInt16BE=M,F.writeUint16LE=_,F.writeInt16LE=_,F.readInt32BE=b,F.readUint32BE=C,F.readInt32LE=x,F.readUint32LE=E,F.writeUint32BE=P,F.writeInt32BE=P,F.writeUint32LE=A,F.writeInt32LE=A,F.readInt64BE=function O(d,m){void 0===m&&(m=0);var w=b(d,m),p=b(d,m+4);return 4294967296*w+p-4294967296*(p>>31)},F.readUint64BE=function N(d,m){return void 0===m&&(m=0),4294967296*C(d,m)+C(d,m+4)},F.readInt64LE=function U(d,m){void 0===m&&(m=0);var w=x(d,m);return 4294967296*x(d,m+4)+w-4294967296*(w>>31)},F.readUint64LE=function H(d,m){void 0===m&&(m=0);var w=E(d,m);return 4294967296*E(d,m+4)+w},F.writeUint64BE=V,F.writeInt64BE=V,F.writeUint64LE=G,F.writeInt64LE=G,F.readUintBE=function K(d,m,w){if(void 0===w&&(w=0),d%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(d/8>m.length-w)throw new Error("readUintBE: array is too short for the given bitLength");for(var p=0,s=1,g=d/8+w-1;g>=w;g--)p+=m[g]*s,s*=256;return p},F.readUintLE=function X(d,m,w){if(void 0===w&&(w=0),d%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(d/8>m.length-w)throw new Error("readUintLE: array is too short for the given bitLength");for(var p=0,s=1,g=w;g=p;g--)w[g]=m/s&255,s*=256;return w},F.writeUintLE=function z(d,m,w,p){if(void 0===w&&(w=new Uint8Array(d/8)),void 0===p&&(p=0),d%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!R.isSafeInteger(m))throw new Error("writeUintLE value must be an integer");for(var s=1,g=p;g{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(4502),B=I(9815);F.BLOCK_SIZE=128,F.DIGEST_LENGTH=64,F.KEY_LENGTH=64,F.PERSONALIZATION_LENGTH=16,F.SALT_LENGTH=16,F.MAX_LEAF_SIZE=Math.pow(2,32)-1,F.MAX_FANOUT=255,F.MAX_MAX_DEPTH=255;var S=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),T=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],f=function(){function _(b,C){if(void 0===b&&(b=64),this.digestLength=b,this.blockSize=F.BLOCK_SIZE,this._state=new Int32Array(S),this._buffer=new Uint8Array(F.BLOCK_SIZE),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),b<1||b>F.DIGEST_LENGTH)throw new Error("blake2b: wrong digest length");C&&this.validateConfig(C);var x=0;C&&C.key&&(x=C.key.length);var E=1,P=1;C&&C.tree&&(E=C.tree.fanout,P=C.tree.maxDepth),this._state[0]^=b|x<<8|E<<16|P<<24,C&&C.tree&&(this._state[1]^=C.tree.leafSize,this._state[2]^=C.tree.nodeOffsetLowBits,this._state[3]^=C.tree.nodeOffsetHighBits,this._state[4]^=C.tree.nodeDepth|C.tree.innerDigestLength<<8,this._lastNode=C.tree.lastNode),C&&C.salt&&(this._state[8]^=R.readUint32LE(C.salt,0),this._state[9]^=R.readUint32LE(C.salt,4),this._state[10]^=R.readUint32LE(C.salt,8),this._state[11]^=R.readUint32LE(C.salt,12)),C&&C.personalization&&(this._state[12]^=R.readUint32LE(C.personalization,0),this._state[13]^=R.readUint32LE(C.personalization,4),this._state[14]^=R.readUint32LE(C.personalization,8),this._state[15]^=R.readUint32LE(C.personalization,12)),this._initialState=new Uint32Array(this._state),C&&C.key&&x>0&&(this._paddedKey=new Uint8Array(F.BLOCK_SIZE),this._paddedKey.set(C.key),this._buffer.set(this._paddedKey),this._bufferLength=F.BLOCK_SIZE)}return _.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=F.BLOCK_SIZE):this._bufferLength=0,B.wipe(this._ctr),B.wipe(this._flag),this._finished=!1,this},_.prototype.validateConfig=function(b){if(b.key&&b.key.length>F.KEY_LENGTH)throw new Error("blake2b: wrong key length");if(b.salt&&b.salt.length!==F.SALT_LENGTH)throw new Error("blake2b: wrong salt length");if(b.personalization&&b.personalization.length!==F.PERSONALIZATION_LENGTH)throw new Error("blake2b: wrong personalization length");if(b.tree){if(b.tree.fanout<0||b.tree.fanout>F.MAX_FANOUT)throw new Error("blake2b: wrong tree fanout");if(b.tree.maxDepth<0||b.tree.maxDepth>F.MAX_MAX_DEPTH)throw new Error("blake2b: wrong tree depth");if(b.tree.leafSize<0||b.tree.leafSize>F.MAX_LEAF_SIZE)throw new Error("blake2b: wrong leaf size");if(b.tree.innerDigestLength<0||b.tree.innerDigestLength>F.DIGEST_LENGTH)throw new Error("blake2b: wrong tree inner digest length")}},_.prototype.update=function(b,C){if(void 0===C&&(C=b.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var x=F.BLOCK_SIZE-this._bufferLength,E=0;if(0===C)return this;if(C>x){for(var P=0;PF.BLOCK_SIZE;){for(P=0;P>>16,u=65535&Z,d=Z>>>16;c+=z>>>16,u+=65535&J,d+=J>>>16,u+=(c+=(l+=65535&z)>>>16)>>>16,l=65535&(X=65535&l|c<<16),c=X>>>16,u=65535&(Z=65535&u|(d+=u>>>16)<<16),d=Z>>>16,c+=H>>>16,u+=65535&V,d+=V>>>16,X=65535&(l+=65535&H)|(c+=l>>>16)<<16,l=o^=Z=65535&(u+=c>>>16)|(d+=u>>>16)<<16,o=y^=X,y=l,l=65535&re,c=re>>>16,u=65535&ve,d=ve>>>16,c+=y>>>16,u+=65535&o,d+=o>>>16,l=(z^=re=65535&(l+=65535&y)|(c+=l>>>16)<<16)<<8|(J^=ve=65535&(u+=c>>>16)|(d+=u>>>16)<<16)>>>24,z=J<<8|z>>>24,J=l,l=65535&X,c=X>>>16,u=65535&Z,d=Z>>>16,c+=z>>>16,u+=65535&J,d+=J>>>16,u+=(c+=(l+=65535&z)>>>16)>>>16,l=65535&(X=65535&l|c<<16),c=X>>>16,u=65535&(Z=65535&u|(d+=u>>>16)<<16),d=Z>>>16,c+=G>>>16,u+=65535&K,d+=K>>>16,l=(y^=X=65535&(l+=65535&G)|(c+=l>>>16)<<16)<<16|(o^=Z=65535&(u+=c>>>16)|(d+=u>>>16)<<16)>>>16,y=o<<16|y>>>16,o=l,l=65535&re,c=re>>>16,u=65535&ve,d=ve>>>16,c+=y>>>16,u+=65535&o,d+=o>>>16,l=(J^=ve=65535&(u+=(c+=(l+=65535&y)>>>16)>>>16)|(d+=u>>>16)<<16)<<1|(z^=re=65535&l|c<<16)>>>31,z=z<<1|J>>>31,J=l,b[C]=X,b[A]=Z,b[x]=z,b[O]=J,b[E]=re,b[N]=ve,b[P]=y,b[U]=o},_.prototype._incrementCounter=function(b){for(var C=0;C<3;C++){var x=this._ctr[C]+b;if(this._ctr[C]=x>>>0,this._ctr[C]===x)return;b=1}},_.prototype._processBlock=function(b){this._incrementCounter(b);var C=this._vtmp;C.set(this._state),C.set(S,16),C[24]^=this._ctr[0],C[25]^=this._ctr[1],C[26]^=this._ctr[2],C[27]^=this._ctr[3],C[28]^=this._flag[0],C[29]^=this._flag[1],C[30]^=this._flag[2],C[31]^=this._flag[3];for(var x=this._mtmp,E=0;E<32;E++)x[E]=R.readUint32LE(this._buffer,4*E);for(var P=0;P<12;P++)this._G(C,0,8,16,24,1,9,17,25,x[T[P][0]],x[T[P][0]+1],x[T[P][1]],x[T[P][1]+1]),this._G(C,2,10,18,26,3,11,19,27,x[T[P][2]],x[T[P][2]+1],x[T[P][3]],x[T[P][3]+1]),this._G(C,4,12,20,28,5,13,21,29,x[T[P][4]],x[T[P][4]+1],x[T[P][5]],x[T[P][5]+1]),this._G(C,6,14,22,30,7,15,23,31,x[T[P][6]],x[T[P][6]+1],x[T[P][7]],x[T[P][7]+1]),this._G(C,0,10,20,30,1,11,21,31,x[T[P][8]],x[T[P][8]+1],x[T[P][9]],x[T[P][9]+1]),this._G(C,2,12,22,24,3,13,23,25,x[T[P][10]],x[T[P][10]+1],x[T[P][11]],x[T[P][11]+1]),this._G(C,4,14,16,26,5,15,17,27,x[T[P][12]],x[T[P][12]+1],x[T[P][13]],x[T[P][13]+1]),this._G(C,6,8,18,28,7,9,19,29,x[T[P][14]],x[T[P][14]+1],x[T[P][15]],x[T[P][15]+1]);for(E=0;E<16;E++)this._state[E]^=C[E]^C[E+16]},_}();F.BLAKE2b=f,F.hash=function M(_,b,C){void 0===b&&(b=F.DIGEST_LENGTH);var x=new f(b,C);x.update(_);var E=x.digest();return x.clean(),E}},8401:(ne,F)=>{"use strict";F.z=function R(){for(var B=0,S=0;S{"use strict";function B(T,f){if(T.length!==f.length)return 0;for(var M=0,_=0;_>>8}Object.defineProperty(F,"__esModule",{value:!0}),F.select=function I(T,f,M){return~(T-1)&f|T-1&M},F.lessOrEqual=function R(T,f){return(0|T)-(0|f)-1>>>31&1},F.compare=B,F.equal=function S(T,f){return 0!==T.length&&0!==f.length&&0!==B(T,f)}},5553:(ne,F,I)=>{"use strict";F.zh=F.SH=F.Xx=F._w=F.aP=F.KS=F.jQ=void 0;I(5784);const S=I(6375),T=I(9815);function f(fe){const se=new Float64Array(16);if(fe)for(let ce=0;ce>16&1),ce[_e-1]&=65535;ce[15]=ee[15]-32767-(ce[14]>>16&1);const ue=ce[15]>>16&1;ce[14]&=65535,U(ee,ce,1-ue)}for(let pe=0;pe<16;pe++)fe[2*pe]=255&ee[pe],fe[2*pe+1]=ee[pe]>>8}function G(fe,se){const ce=new Uint8Array(32),ee=new Uint8Array(32);return H(ce,fe),H(ee,se),function V(fe,se){let ce=0;for(let ee=0;ee<32;ee++)ce|=fe[ee]^se[ee];return(1&ce-1>>>8)-1}(ce,ee)}function K(fe){const se=new Uint8Array(32);return H(se,fe),1&se[0]}function Z(fe,se,ce){for(let ee=0;ee<16;ee++)fe[ee]=se[ee]+ce[ee]}function z(fe,se,ce){for(let ee=0;ee<16;ee++)fe[ee]=se[ee]-ce[ee]}function J(fe,se,ce){let ee,pe,ue=0,_e=0,Me=0,le=0,ie=0,Y=0,ae=0,Le=0,xe=0,Ce=0,Re=0,we=0,Oe=0,wt=0,Be=0,oe=0,te=0,W=0,de=0,Pe=0,Ee=0,Ae=0,St=0,Xe=0,Je=0,kt=0,Ye=0,tt=0,Dn=0,nt=0,ht=0,ln=ce[0],We=ce[1],ze=ce[2],un=ce[3],at=ce[4],Ne=ce[5],Xt=ce[6],$e=ce[7],et=ce[8],pn=ce[9],lt=ce[10],ut=ce[11],cn=ce[12],it=ce[13],ct=ce[14],gn=ce[15];ee=se[0],ue+=ee*ln,_e+=ee*We,Me+=ee*ze,le+=ee*un,ie+=ee*at,Y+=ee*Ne,ae+=ee*Xt,Le+=ee*$e,xe+=ee*et,Ce+=ee*pn,Re+=ee*lt,we+=ee*ut,Oe+=ee*cn,wt+=ee*it,Be+=ee*ct,oe+=ee*gn,ee=se[1],_e+=ee*ln,Me+=ee*We,le+=ee*ze,ie+=ee*un,Y+=ee*at,ae+=ee*Ne,Le+=ee*Xt,xe+=ee*$e,Ce+=ee*et,Re+=ee*pn,we+=ee*lt,Oe+=ee*ut,wt+=ee*cn,Be+=ee*it,oe+=ee*ct,te+=ee*gn,ee=se[2],Me+=ee*ln,le+=ee*We,ie+=ee*ze,Y+=ee*un,ae+=ee*at,Le+=ee*Ne,xe+=ee*Xt,Ce+=ee*$e,Re+=ee*et,we+=ee*pn,Oe+=ee*lt,wt+=ee*ut,Be+=ee*cn,oe+=ee*it,te+=ee*ct,W+=ee*gn,ee=se[3],le+=ee*ln,ie+=ee*We,Y+=ee*ze,ae+=ee*un,Le+=ee*at,xe+=ee*Ne,Ce+=ee*Xt,Re+=ee*$e,we+=ee*et,Oe+=ee*pn,wt+=ee*lt,Be+=ee*ut,oe+=ee*cn,te+=ee*it,W+=ee*ct,de+=ee*gn,ee=se[4],ie+=ee*ln,Y+=ee*We,ae+=ee*ze,Le+=ee*un,xe+=ee*at,Ce+=ee*Ne,Re+=ee*Xt,we+=ee*$e,Oe+=ee*et,wt+=ee*pn,Be+=ee*lt,oe+=ee*ut,te+=ee*cn,W+=ee*it,de+=ee*ct,Pe+=ee*gn,ee=se[5],Y+=ee*ln,ae+=ee*We,Le+=ee*ze,xe+=ee*un,Ce+=ee*at,Re+=ee*Ne,we+=ee*Xt,Oe+=ee*$e,wt+=ee*et,Be+=ee*pn,oe+=ee*lt,te+=ee*ut,W+=ee*cn,de+=ee*it,Pe+=ee*ct,Ee+=ee*gn,ee=se[6],ae+=ee*ln,Le+=ee*We,xe+=ee*ze,Ce+=ee*un,Re+=ee*at,we+=ee*Ne,Oe+=ee*Xt,wt+=ee*$e,Be+=ee*et,oe+=ee*pn,te+=ee*lt,W+=ee*ut,de+=ee*cn,Pe+=ee*it,Ee+=ee*ct,Ae+=ee*gn,ee=se[7],Le+=ee*ln,xe+=ee*We,Ce+=ee*ze,Re+=ee*un,we+=ee*at,Oe+=ee*Ne,wt+=ee*Xt,Be+=ee*$e,oe+=ee*et,te+=ee*pn,W+=ee*lt,de+=ee*ut,Pe+=ee*cn,Ee+=ee*it,Ae+=ee*ct,St+=ee*gn,ee=se[8],xe+=ee*ln,Ce+=ee*We,Re+=ee*ze,we+=ee*un,Oe+=ee*at,wt+=ee*Ne,Be+=ee*Xt,oe+=ee*$e,te+=ee*et,W+=ee*pn,de+=ee*lt,Pe+=ee*ut,Ee+=ee*cn,Ae+=ee*it,St+=ee*ct,Xe+=ee*gn,ee=se[9],Ce+=ee*ln,Re+=ee*We,we+=ee*ze,Oe+=ee*un,wt+=ee*at,Be+=ee*Ne,oe+=ee*Xt,te+=ee*$e,W+=ee*et,de+=ee*pn,Pe+=ee*lt,Ee+=ee*ut,Ae+=ee*cn,St+=ee*it,Xe+=ee*ct,Je+=ee*gn,ee=se[10],Re+=ee*ln,we+=ee*We,Oe+=ee*ze,wt+=ee*un,Be+=ee*at,oe+=ee*Ne,te+=ee*Xt,W+=ee*$e,de+=ee*et,Pe+=ee*pn,Ee+=ee*lt,Ae+=ee*ut,St+=ee*cn,Xe+=ee*it,Je+=ee*ct,kt+=ee*gn,ee=se[11],we+=ee*ln,Oe+=ee*We,wt+=ee*ze,Be+=ee*un,oe+=ee*at,te+=ee*Ne,W+=ee*Xt,de+=ee*$e,Pe+=ee*et,Ee+=ee*pn,Ae+=ee*lt,St+=ee*ut,Xe+=ee*cn,Je+=ee*it,kt+=ee*ct,Ye+=ee*gn,ee=se[12],Oe+=ee*ln,wt+=ee*We,Be+=ee*ze,oe+=ee*un,te+=ee*at,W+=ee*Ne,de+=ee*Xt,Pe+=ee*$e,Ee+=ee*et,Ae+=ee*pn,St+=ee*lt,Xe+=ee*ut,Je+=ee*cn,kt+=ee*it,Ye+=ee*ct,tt+=ee*gn,ee=se[13],wt+=ee*ln,Be+=ee*We,oe+=ee*ze,te+=ee*un,W+=ee*at,de+=ee*Ne,Pe+=ee*Xt,Ee+=ee*$e,Ae+=ee*et,St+=ee*pn,Xe+=ee*lt,Je+=ee*ut,kt+=ee*cn,Ye+=ee*it,tt+=ee*ct,Dn+=ee*gn,ee=se[14],Be+=ee*ln,oe+=ee*We,te+=ee*ze,W+=ee*un,de+=ee*at,Pe+=ee*Ne,Ee+=ee*Xt,Ae+=ee*$e,St+=ee*et,Xe+=ee*pn,Je+=ee*lt,kt+=ee*ut,Ye+=ee*cn,tt+=ee*it,Dn+=ee*ct,nt+=ee*gn,ee=se[15],oe+=ee*ln,te+=ee*We,W+=ee*ze,de+=ee*un,Pe+=ee*at,Ee+=ee*Ne,Ae+=ee*Xt,St+=ee*$e,Xe+=ee*et,Je+=ee*pn,kt+=ee*lt,Ye+=ee*ut,tt+=ee*cn,Dn+=ee*it,nt+=ee*ct,ht+=ee*gn,ue+=38*te,_e+=38*W,Me+=38*de,le+=38*Pe,ie+=38*Ee,Y+=38*Ae,ae+=38*St,Le+=38*Xe,xe+=38*Je,Ce+=38*kt,Re+=38*Ye,we+=38*tt,Oe+=38*Dn,wt+=38*nt,Be+=38*ht,pe=1,ee=ue+pe+65535,pe=Math.floor(ee/65536),ue=ee-65536*pe,ee=_e+pe+65535,pe=Math.floor(ee/65536),_e=ee-65536*pe,ee=Me+pe+65535,pe=Math.floor(ee/65536),Me=ee-65536*pe,ee=le+pe+65535,pe=Math.floor(ee/65536),le=ee-65536*pe,ee=ie+pe+65535,pe=Math.floor(ee/65536),ie=ee-65536*pe,ee=Y+pe+65535,pe=Math.floor(ee/65536),Y=ee-65536*pe,ee=ae+pe+65535,pe=Math.floor(ee/65536),ae=ee-65536*pe,ee=Le+pe+65535,pe=Math.floor(ee/65536),Le=ee-65536*pe,ee=xe+pe+65535,pe=Math.floor(ee/65536),xe=ee-65536*pe,ee=Ce+pe+65535,pe=Math.floor(ee/65536),Ce=ee-65536*pe,ee=Re+pe+65535,pe=Math.floor(ee/65536),Re=ee-65536*pe,ee=we+pe+65535,pe=Math.floor(ee/65536),we=ee-65536*pe,ee=Oe+pe+65535,pe=Math.floor(ee/65536),Oe=ee-65536*pe,ee=wt+pe+65535,pe=Math.floor(ee/65536),wt=ee-65536*pe,ee=Be+pe+65535,pe=Math.floor(ee/65536),Be=ee-65536*pe,ee=oe+pe+65535,pe=Math.floor(ee/65536),oe=ee-65536*pe,ue+=pe-1+37*(pe-1),pe=1,ee=ue+pe+65535,pe=Math.floor(ee/65536),ue=ee-65536*pe,ee=_e+pe+65535,pe=Math.floor(ee/65536),_e=ee-65536*pe,ee=Me+pe+65535,pe=Math.floor(ee/65536),Me=ee-65536*pe,ee=le+pe+65535,pe=Math.floor(ee/65536),le=ee-65536*pe,ee=ie+pe+65535,pe=Math.floor(ee/65536),ie=ee-65536*pe,ee=Y+pe+65535,pe=Math.floor(ee/65536),Y=ee-65536*pe,ee=ae+pe+65535,pe=Math.floor(ee/65536),ae=ee-65536*pe,ee=Le+pe+65535,pe=Math.floor(ee/65536),Le=ee-65536*pe,ee=xe+pe+65535,pe=Math.floor(ee/65536),xe=ee-65536*pe,ee=Ce+pe+65535,pe=Math.floor(ee/65536),Ce=ee-65536*pe,ee=Re+pe+65535,pe=Math.floor(ee/65536),Re=ee-65536*pe,ee=we+pe+65535,pe=Math.floor(ee/65536),we=ee-65536*pe,ee=Oe+pe+65535,pe=Math.floor(ee/65536),Oe=ee-65536*pe,ee=wt+pe+65535,pe=Math.floor(ee/65536),wt=ee-65536*pe,ee=Be+pe+65535,pe=Math.floor(ee/65536),Be=ee-65536*pe,ee=oe+pe+65535,pe=Math.floor(ee/65536),oe=ee-65536*pe,ue+=pe-1+37*(pe-1),fe[0]=ue,fe[1]=_e,fe[2]=Me,fe[3]=le,fe[4]=ie,fe[5]=Y,fe[6]=ae,fe[7]=Le,fe[8]=xe,fe[9]=Ce,fe[10]=Re,fe[11]=we,fe[12]=Oe,fe[13]=wt,fe[14]=Be,fe[15]=oe}function re(fe,se){J(fe,se,se)}function ve(fe,se){const ce=f();let ee;for(ee=0;ee<16;ee++)ce[ee]=se[ee];for(ee=253;ee>=0;ee--)re(ce,ce),2!==ee&&4!==ee&&J(ce,ce,se);for(ee=0;ee<16;ee++)fe[ee]=ce[ee]}function o(fe,se){const ce=f(),ee=f(),pe=f(),ue=f(),_e=f(),Me=f(),le=f(),ie=f(),Y=f();z(ce,fe[1],fe[0]),z(Y,se[1],se[0]),J(ce,ce,Y),Z(ee,fe[0],fe[1]),Z(Y,se[0],se[1]),J(ee,ee,Y),J(pe,fe[3],se[3]),J(pe,pe,x),J(ue,fe[2],se[2]),Z(ue,ue,ue),z(_e,ee,ce),z(Me,ue,pe),Z(le,ue,pe),Z(ie,ee,ce),J(fe[0],_e,Me),J(fe[1],ie,le),J(fe[2],le,Me),J(fe[3],_e,ie)}function l(fe,se,ce){for(let ee=0;ee<4;ee++)U(fe[ee],se[ee],ce)}function c(fe,se){const ce=f(),ee=f(),pe=f();ve(pe,se[2]),J(ce,se[0],pe),J(ee,se[1],pe),H(fe,ee),fe[31]^=K(ce)<<7}function d(fe,se){const ce=[f(),f(),f(),f()];O(ce[0],E),O(ce[1],P),O(ce[2],b),J(ce[3],E,P),function u(fe,se,ce){O(fe[0],_),O(fe[1],b),O(fe[2],b),O(fe[3],_);for(let ee=255;ee>=0;--ee){const pe=ce[ee/8|0]>>(7&ee)&1;l(fe,se,pe),o(se,fe),o(fe,fe),l(fe,se,pe)}}(fe,ce,se)}F._w=function m(fe){if(fe.length!==F.aP)throw new Error(`ed25519: seed must be ${F.aP} bytes`);const se=(0,S.hash)(fe);se[0]&=248,se[31]&=127,se[31]|=64;const ce=new Uint8Array(32),ee=[f(),f(),f(),f()];d(ee,se),c(ce,ee);const pe=new Uint8Array(64);return pe.set(fe),pe.set(ce,32),{publicKey:ce,secretKey:pe}};const s=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function g(fe,se){let ce,ee,pe,ue;for(ee=63;ee>=32;--ee){for(ce=0,pe=ee-32,ue=ee-12;pe>4)*s[pe],ce=se[pe]>>8,se[pe]&=255;for(pe=0;pe<32;pe++)se[pe]-=ce*s[pe];for(ee=0;ee<32;ee++)se[ee+1]+=se[ee]>>8,fe[ee]=255&se[ee]}function $(fe){const se=new Float64Array(64);for(let ce=0;ce<64;ce++)se[ce]=fe[ce];for(let ce=0;ce<64;ce++)fe[ce]=0;g(fe,se)}F.Xx=function k(fe,se){const ce=new Float64Array(64),ee=[f(),f(),f(),f()],pe=(0,S.hash)(fe.subarray(0,32));pe[0]&=248,pe[31]&=127,pe[31]|=64;const ue=new Uint8Array(64);ue.set(pe.subarray(32),32);const _e=new S.SHA512;_e.update(ue.subarray(32)),_e.update(se);const Me=_e.digest();_e.clean(),$(Me),d(ee,Me),c(ue,ee),_e.reset(),_e.update(ue.subarray(0,32)),_e.update(fe.subarray(32)),_e.update(se);const le=_e.digest();$(le);for(let ie=0;ie<32;ie++)ce[ie]=Me[ie];for(let ie=0;ie<32;ie++)for(let Y=0;Y<32;Y++)ce[ie+Y]+=le[ie]*pe[Y];return g(ue.subarray(32),ce),ue},F.SH=function be(fe){let se=[f(),f(),f(),f()];if(function q(fe,se){const ce=f(),ee=f(),pe=f(),ue=f(),_e=f(),Me=f(),le=f();return O(fe[2],b),function X(fe,se){for(let ce=0;ce<16;ce++)fe[ce]=se[2*ce]+(se[2*ce+1]<<8);fe[15]&=32767}(fe[1],se),re(pe,fe[1]),J(ue,pe,C),z(pe,pe,fe[2]),Z(ue,fe[2],ue),re(_e,ue),re(Me,_e),J(le,Me,_e),J(ce,le,pe),J(ce,ce,ue),function y(fe,se){const ce=f();let ee;for(ee=0;ee<16;ee++)ce[ee]=se[ee];for(ee=250;ee>=0;ee--)re(ce,ce),1!==ee&&J(ce,ce,se);for(ee=0;ee<16;ee++)fe[ee]=ce[ee]}(ce,ce),J(ce,ce,pe),J(ce,ce,ue),J(ce,ce,ue),J(fe[0],ce,ue),re(ee,fe[0]),J(ee,ee,ue),G(ee,pe)&&J(fe[0],fe[0],A),re(ee,fe[0]),J(ee,ee,ue),G(ee,pe)?-1:(K(fe[0])===se[31]>>7&&z(fe[0],_,fe[0]),J(fe[3],fe[0],fe[1]),0)}(se,fe))throw new Error("Ed25519: invalid public key");let ce=f(),ee=f(),pe=se[1];Z(ce,b,pe),z(ee,b,pe),ve(ee,ee),J(ce,ce,ee);let ue=new Uint8Array(32);return H(ue,ce),ue},F.zh=function ge(fe){const se=(0,S.hash)(fe.subarray(0,32));se[0]&=248,se[31]&=127,se[31]|=64;const ce=new Uint8Array(se.subarray(0,32));return(0,T.wipe)(se),ce}},8046:(ne,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mul=Math.imul||function I(M,_){var C=65535&M,E=65535&_;return C*E+((M>>>16&65535)*E+C*(_>>>16&65535)<<16>>>0)|0},F.add=function R(M,_){return M+_|0},F.sub=function B(M,_){return M-_|0},F.rotl=function S(M,_){return M<<_|M>>>32-_},F.rotr=function T(M,_){return M<<32-_|M>>>_},F.isInteger=Number.isInteger||function f(M){return"number"==typeof M&&isFinite(M)&&Math.floor(M)===M},F.MAX_SAFE_INTEGER=9007199254740991,F.isSafeInteger=function(M){return F.isInteger(M)&&M>=-F.MAX_SAFE_INTEGER&&M<=F.MAX_SAFE_INTEGER}},5026:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.openBox=F.box=F.precomputeSharedKey=F.generateKeyPair=void 0;const R=I(5006),B=I(2152),S=I(3671),T=I(9815);var f=I(5006);Object.defineProperty(F,"generateKeyPair",{enumerable:!0,get:function(){return f.generateKeyPair}});const M=new Uint8Array(16);function _(x,E){const P=(0,R.scalarMult)(E,x);return(0,B.hsalsa)(P,M,P),P}F.precomputeSharedKey=_,F.box=function b(x,E,P,A){const O=_(x,E),N=(0,S.secretBox)(O,P,A);return(0,T.wipe)(O),N},F.openBox=function C(x,E,P,A){const O=_(x,E),N=(0,S.openSecretBox)(O,P,A);return(0,T.wipe)(O),N}},4488:function(ne,F,I){"use strict";var R=this&&this.__createBinding||(Object.create?function(S,T,f,M){void 0===M&&(M=f);var _=Object.getOwnPropertyDescriptor(T,f);(!_||("get"in _?!T.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return T[f]}}),Object.defineProperty(S,M,_)}:function(S,T,f,M){void 0===M&&(M=f),S[M]=T[f]}),B=this&&this.__exportStar||function(S,T){for(var f in S)"default"!==f&&!Object.prototype.hasOwnProperty.call(T,f)&&R(T,S,f)};Object.defineProperty(F,"__esModule",{value:!0}),B(I(5026),F),B(I(3671),F)},3671:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.generateKey=F.openSecretBox=F.secretBox=void 0;const R=I(2152),B=I(314),S=I(9815),T=I(5784);F.secretBox=function f(b,C,x){if(24!==C.length)throw new Error("secretBox nonce must be 24 bytes");const E=new Uint8Array(64),P=new Uint8Array(32);P.set(C),(0,R.stream)(b,P,E,8);const A=new Uint8Array(16+x.length);for(let N=0;N<32&&N32&&(0,R.streamXOR)(b,P,x.subarray(32),A.subarray(48),8);const O=(0,B.oneTimeAuth)(E.subarray(0,32),A.subarray(16));for(let N=0;N32&&(0,R.streamXOR)(b,P,O.subarray(32),N.subarray(32),8),(0,S.wipe)(A),(0,S.wipe)(E),(0,S.wipe)(P),N},F.generateKey=function _(b){return(0,T.randomBytes)(32,b)}},314:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(9976),B=I(9815);F.DIGEST_LENGTH=16;var S=function(){function M(_){this.digestLength=F.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var b=_[0]|_[1]<<8;this._r[0]=8191&b;var C=_[2]|_[3]<<8;this._r[1]=8191&(b>>>13|C<<3);var x=_[4]|_[5]<<8;this._r[2]=7939&(C>>>10|x<<6);var E=_[6]|_[7]<<8;this._r[3]=8191&(x>>>7|E<<9);var P=_[8]|_[9]<<8;this._r[4]=255&(E>>>4|P<<12),this._r[5]=P>>>1&8190;var A=_[10]|_[11]<<8;this._r[6]=8191&(P>>>14|A<<2);var O=_[12]|_[13]<<8;this._r[7]=8065&(A>>>11|O<<5);var N=_[14]|_[15]<<8;this._r[8]=8191&(O>>>8|N<<8),this._r[9]=N>>>5&127,this._pad[0]=_[16]|_[17]<<8,this._pad[1]=_[18]|_[19]<<8,this._pad[2]=_[20]|_[21]<<8,this._pad[3]=_[22]|_[23]<<8,this._pad[4]=_[24]|_[25]<<8,this._pad[5]=_[26]|_[27]<<8,this._pad[6]=_[28]|_[29]<<8,this._pad[7]=_[30]|_[31]<<8}return M.prototype._blocks=function(_,b,C){for(var x=this._fin?0:2048,E=this._h[0],P=this._h[1],A=this._h[2],O=this._h[3],N=this._h[4],U=this._h[5],H=this._h[6],V=this._h[7],G=this._h[8],K=this._h[9],X=this._r[0],Z=this._r[1],z=this._r[2],J=this._r[3],re=this._r[4],ve=this._r[5],y=this._r[6],o=this._r[7],l=this._r[8],c=this._r[9];C>=16;){var u=_[b+0]|_[b+1]<<8,d=_[b+2]|_[b+3]<<8,m=_[b+4]|_[b+5]<<8,w=_[b+6]|_[b+7]<<8,p=_[b+8]|_[b+9]<<8,s=_[b+10]|_[b+11]<<8,g=_[b+12]|_[b+13]<<8,$=_[b+14]|_[b+15]<<8,k=0,q=k;q+=(E+=8191&u)*X,q+=(P+=8191&(u>>>13|d<<3))*(5*c),q+=(A+=8191&(d>>>10|m<<6))*(5*l),q+=(O+=8191&(m>>>7|w<<9))*(5*o),k=(q+=(N+=8191&(w>>>4|p<<12))*(5*y))>>>13,q&=8191,q+=(U+=p>>>1&8191)*(5*ve),q+=(H+=8191&(p>>>14|s<<2))*(5*re),q+=(V+=8191&(s>>>11|g<<5))*(5*J),q+=(G+=8191&(g>>>8|$<<8))*(5*z);var he=k+=(q+=(K+=$>>>5|x)*(5*Z))>>>13;he+=E*Z,he+=P*X,he+=A*(5*c),he+=O*(5*l),k=(he+=N*(5*o))>>>13,he&=8191,he+=U*(5*y),he+=H*(5*ve),he+=V*(5*re),he+=G*(5*J),k+=(he+=K*(5*z))>>>13,he&=8191;var be=k;be+=E*z,be+=P*Z,be+=A*X,be+=O*(5*c),k=(be+=N*(5*l))>>>13,be&=8191,be+=U*(5*o),be+=H*(5*y),be+=V*(5*ve),be+=G*(5*re);var ge=k+=(be+=K*(5*J))>>>13;ge+=E*J,ge+=P*z,ge+=A*Z,ge+=O*X,k=(ge+=N*(5*c))>>>13,ge&=8191,ge+=U*(5*l),ge+=H*(5*o),ge+=V*(5*y),ge+=G*(5*ve);var fe=k+=(ge+=K*(5*re))>>>13;fe+=E*re,fe+=P*J,fe+=A*z,fe+=O*Z,k=(fe+=N*X)>>>13,fe&=8191,fe+=U*(5*c),fe+=H*(5*l),fe+=V*(5*o),fe+=G*(5*y);var se=k+=(fe+=K*(5*ve))>>>13;se+=E*ve,se+=P*re,se+=A*J,se+=O*z,k=(se+=N*Z)>>>13,se&=8191,se+=U*X,se+=H*(5*c),se+=V*(5*l),se+=G*(5*o);var ce=k+=(se+=K*(5*y))>>>13;ce+=E*y,ce+=P*ve,ce+=A*re,ce+=O*J,k=(ce+=N*z)>>>13,ce&=8191,ce+=U*Z,ce+=H*X,ce+=V*(5*c),ce+=G*(5*l);var ee=k+=(ce+=K*(5*o))>>>13;ee+=E*o,ee+=P*y,ee+=A*ve,ee+=O*re,k=(ee+=N*J)>>>13,ee&=8191,ee+=U*z,ee+=H*Z,ee+=V*X,ee+=G*(5*c);var pe=k+=(ee+=K*(5*l))>>>13;pe+=E*l,pe+=P*o,pe+=A*y,pe+=O*ve,k=(pe+=N*re)>>>13,pe&=8191,pe+=U*J,pe+=H*z,pe+=V*Z,pe+=G*X;var ue=k+=(pe+=K*(5*c))>>>13;ue+=E*c,ue+=P*l,ue+=A*o,ue+=O*y,k=(ue+=N*ve)>>>13,ue&=8191,ue+=U*re,ue+=H*J,ue+=V*z,ue+=G*Z,E=q=8191&(k=(k=((k+=(ue+=K*X)>>>13)<<2)+k|0)+(q&=8191)|0),P=he+=k>>>=13,A=be&=8191,O=ge&=8191,N=fe&=8191,U=se&=8191,H=ce&=8191,V=ee&=8191,G=pe&=8191,K=ue&=8191,b+=16,C-=16}this._h[0]=E,this._h[1]=P,this._h[2]=A,this._h[3]=O,this._h[4]=N,this._h[5]=U,this._h[6]=H,this._h[7]=V,this._h[8]=G,this._h[9]=K},M.prototype.finish=function(_,b){void 0===b&&(b=0);var x,E,P,A,C=new Uint16Array(10);if(this._leftover){for(A=this._leftover,this._buffer[A++]=1;A<16;A++)this._buffer[A]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(x=this._h[1]>>>13,this._h[1]&=8191,A=2;A<10;A++)this._h[A]+=x,x=this._h[A]>>>13,this._h[A]&=8191;for(this._h[0]+=5*x,x=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=x,x=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=x,C[0]=this._h[0]+5,x=C[0]>>>13,C[0]&=8191,A=1;A<10;A++)C[A]=this._h[A]+x,x=C[A]>>>13,C[A]&=8191;for(C[9]-=8192,E=(1^x)-1,A=0;A<10;A++)C[A]&=E;for(E=~E,A=0;A<10;A++)this._h[A]=this._h[A]&E|C[A];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),this._h[0]=65535&(P=this._h[0]+this._pad[0]),A=1;A<8;A++)this._h[A]=65535&(P=(this._h[A]+this._pad[A]|0)+(P>>>16)|0);return _[b+0]=this._h[0]>>>0,_[b+1]=this._h[0]>>>8,_[b+2]=this._h[1]>>>0,_[b+3]=this._h[1]>>>8,_[b+4]=this._h[2]>>>0,_[b+5]=this._h[2]>>>8,_[b+6]=this._h[3]>>>0,_[b+7]=this._h[3]>>>8,_[b+8]=this._h[4]>>>0,_[b+9]=this._h[4]>>>8,_[b+10]=this._h[5]>>>0,_[b+11]=this._h[5]>>>8,_[b+12]=this._h[6]>>>0,_[b+13]=this._h[6]>>>8,_[b+14]=this._h[7]>>>0,_[b+15]=this._h[7]>>>8,this._finished=!0,this},M.prototype.update=function(_){var x,b=0,C=_.length;if(this._leftover){(x=16-this._leftover)>C&&(x=C);for(var E=0;E=16&&(this._blocks(_,b,x=C-C%16),b+=x,C-=x),C){for(E=0;E{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.randomStringForEntropy=F.randomString=F.randomUint32=F.randomBytes=F.defaultRandomSource=void 0;const R=I(9753),B=I(4502),S=I(9815);function T(C,x=F.defaultRandomSource){return x.randomBytes(C)}F.defaultRandomSource=new R.SystemRandomSource,F.randomBytes=T,F.randomUint32=function f(C=F.defaultRandomSource){const x=T(4,C),E=(0,B.readUint32LE)(x);return(0,S.wipe)(x),E};const M="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function _(C,x=M,E=F.defaultRandomSource){if(x.length<2)throw new Error("randomString charset is too short");if(x.length>256)throw new Error("randomString charset is too long");let P="";const A=x.length,O=256-256%A;for(;C>0;){const N=T(Math.ceil(256*C/O),E);for(let U=0;U0;U++){const H=N[U];H{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.BrowserRandomSource=void 0,F.BrowserRandomSource=class R{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const S="undefined"!=typeof self?self.crypto||self.msCrypto:null;S&&void 0!==S.getRandomValues&&(this._crypto=S,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(S){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const T=new Uint8Array(S);for(let f=0;f{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.NodeRandomSource=void 0;const R=I(9815);F.NodeRandomSource=class B{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const T=I(1348);T&&T.randomBytes&&(this._crypto=T,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(T){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let f=this._crypto.randomBytes(T);if(f.length!==T)throw new Error("NodeRandomSource: got fewer bytes than requested");const M=new Uint8Array(T);for(let _=0;_{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SystemRandomSource=void 0;const R=I(7170),B=I(1382);F.SystemRandomSource=class S{constructor(){return this.isAvailable=!1,this.name="",this._source=new R.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new B.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(f){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(f)}}},6399:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(4502),B=I(9815);function T(b,C,x){for(var ge,E=1634760805,P=x[3]<<24|x[2]<<16|x[1]<<8|x[0],A=x[7]<<24|x[6]<<16|x[5]<<8|x[4],O=x[11]<<24|x[10]<<16|x[9]<<8|x[8],N=x[15]<<24|x[14]<<16|x[13]<<8|x[12],U=857760878,H=C[3]<<24|C[2]<<16|C[1]<<8|C[0],V=C[7]<<24|C[6]<<16|C[5]<<8|C[4],G=C[11]<<24|C[10]<<16|C[9]<<8|C[8],K=C[15]<<24|C[14]<<16|C[13]<<8|C[12],X=2036477234,Z=x[19]<<24|x[18]<<16|x[17]<<8|x[16],z=x[23]<<24|x[22]<<16|x[21]<<8|x[20],J=x[27]<<24|x[26]<<16|x[25]<<8|x[24],re=x[31]<<24|x[30]<<16|x[29]<<8|x[28],ve=1797285236,y=E,o=P,l=A,c=O,u=N,d=U,m=H,w=V,p=G,s=K,g=X,$=Z,k=z,q=J,he=re,be=ve,fe=0;fe<20;fe+=2)y^=(ge=(k^=(ge=(p^=(ge=(u^=(ge=y+k|0)<<7|ge>>>25)+y|0)<<9|ge>>>23)+u|0)<<13|ge>>>19)+p|0)<<18|ge>>>14,d^=(ge=(o^=(ge=(q^=(ge=(s^=(ge=d+o|0)<<7|ge>>>25)+d|0)<<9|ge>>>23)+s|0)<<13|ge>>>19)+q|0)<<18|ge>>>14,g^=(ge=(m^=(ge=(l^=(ge=(he^=(ge=g+m|0)<<7|ge>>>25)+g|0)<<9|ge>>>23)+he|0)<<13|ge>>>19)+l|0)<<18|ge>>>14,be^=(ge=($^=(ge=(w^=(ge=(c^=(ge=be+$|0)<<7|ge>>>25)+be|0)<<9|ge>>>23)+c|0)<<13|ge>>>19)+w|0)<<18|ge>>>14,y^=(ge=(c^=(ge=(l^=(ge=(o^=(ge=y+c|0)<<7|ge>>>25)+y|0)<<9|ge>>>23)+o|0)<<13|ge>>>19)+l|0)<<18|ge>>>14,d^=(ge=(u^=(ge=(w^=(ge=(m^=(ge=d+u|0)<<7|ge>>>25)+d|0)<<9|ge>>>23)+m|0)<<13|ge>>>19)+w|0)<<18|ge>>>14,g^=(ge=(s^=(ge=(p^=(ge=($^=(ge=g+s|0)<<7|ge>>>25)+g|0)<<9|ge>>>23)+$|0)<<13|ge>>>19)+p|0)<<18|ge>>>14,be^=(ge=(he^=(ge=(q^=(ge=(k^=(ge=be+he|0)<<7|ge>>>25)+be|0)<<9|ge>>>23)+k|0)<<13|ge>>>19)+q|0)<<18|ge>>>14;R.writeUint32LE(y+E|0,b,0),R.writeUint32LE(o+P|0,b,4),R.writeUint32LE(l+A|0,b,8),R.writeUint32LE(c+O|0,b,12),R.writeUint32LE(u+N|0,b,16),R.writeUint32LE(d+U|0,b,20),R.writeUint32LE(m+H|0,b,24),R.writeUint32LE(w+V|0,b,28),R.writeUint32LE(p+G|0,b,32),R.writeUint32LE(s+K|0,b,36),R.writeUint32LE(g+X|0,b,40),R.writeUint32LE($+Z|0,b,44),R.writeUint32LE(k+z|0,b,48),R.writeUint32LE(q+J|0,b,52),R.writeUint32LE(he+re|0,b,56),R.writeUint32LE(be+ve|0,b,60)}function f(b,C,x,E,P){if(void 0===P&&(P=0),32!==b.length)throw new Error("Salsa20: key size must be 32 bytes");if(E.length>>=8,C++;if(E>0)throw new Error("Salsa20: counter overflow")}F.streamXOR=f,F.stream=function M(b,C,x,E){return void 0===E&&(E=0),B.wipe(x),f(b,C,x,x,E)}},6375:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(4502),B=I(9815);F.DIGEST_LENGTH=64,F.BLOCK_SIZE=128;var S=function(){function _(){this.digestLength=F.DIGEST_LENGTH,this.blockSize=F.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return _.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},_.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},_.prototype.clean=function(){B.wipe(this._buffer),B.wipe(this._tempHi),B.wipe(this._tempLo),this.reset()},_.prototype.update=function(b,C){if(void 0===C&&(C=b.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var x=0;if(this._bytesHashed+=C,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=b[x++],C--;this._bufferLength===this.blockSize&&(f(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(C>=this.blockSize&&(x=f(this._tempHi,this._tempLo,this._stateHi,this._stateLo,b,x,C),C%=this.blockSize);C>0;)this._buffer[this._bufferLength++]=b[x++],C--;return this},_.prototype.finish=function(b){if(!this._finished){var C=this._bytesHashed,x=this._bufferLength,E=C/536870912|0,P=C<<3,A=C%128<112?128:256;this._buffer[x]=128;for(var O=x+1;O0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},_.prototype.restoreState=function(b){return this._stateHi.set(b.stateHi),this._stateLo.set(b.stateLo),this._bufferLength=b.bufferLength,b.buffer&&this._buffer.set(b.buffer),this._bytesHashed=b.bytesHashed,this._finished=!1,this},_.prototype.cleanSavedState=function(b){B.wipe(b.stateHi),B.wipe(b.stateLo),b.buffer&&B.wipe(b.buffer),b.bufferLength=0,b.bytesHashed=0},_}();F.SHA512=S;var T=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function f(_,b,C,x,E,P,A){for(var c,u,d,m,w,p,s,g,O=C[0],N=C[1],U=C[2],H=C[3],V=C[4],G=C[5],K=C[6],X=C[7],Z=x[0],z=x[1],J=x[2],re=x[3],ve=x[4],y=x[5],o=x[6],l=x[7];A>=128;){for(var $=0;$<16;$++)_[$]=R.readUint32BE(E,k=8*$+P),b[$]=R.readUint32BE(E,k+4);for($=0;$<80;$++){var ee,ae,he=N,be=U,ge=H,fe=V,se=G,ce=K,ue=z,_e=J,Me=re,le=ve,ie=y,Y=o;if(w=65535&(u=l),p=u>>>16,s=65535&(c=X),g=c>>>16,w+=65535&(u=(ve>>>14|V<<18)^(ve>>>18|V<<14)^(V>>>9|ve<<23)),p+=u>>>16,s+=65535&(c=(V>>>14|ve<<18)^(V>>>18|ve<<14)^(ve>>>9|V<<23)),g+=c>>>16,w+=65535&(u=ve&y^~ve&o),p+=u>>>16,s+=65535&(c=V&G^~V&K),g+=c>>>16,w+=65535&(u=T[2*$+1]),p+=u>>>16,s+=65535&(c=T[2*$]),g+=c>>>16,p+=(u=b[$%16])>>>16,s+=65535&(c=_[$%16]),g+=c>>>16,s+=(p+=(w+=65535&u)>>>16)>>>16,w=65535&(u=m=65535&w|p<<16),p=u>>>16,s=65535&(c=d=65535&s|(g+=s>>>16)<<16),g=c>>>16,w+=65535&(u=(Z>>>28|O<<4)^(O>>>2|Z<<30)^(O>>>7|Z<<25)),p+=u>>>16,s+=65535&(c=(O>>>28|Z<<4)^(Z>>>2|O<<30)^(Z>>>7|O<<25)),g+=c>>>16,p+=(u=Z&z^Z&J^z&J)>>>16,s+=65535&(c=O&N^O&U^N&U),g+=c>>>16,ee=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,ae=65535&w|p<<16,w=65535&(u=Me),p=u>>>16,s=65535&(c=ge),g=c>>>16,p+=(u=m)>>>16,s+=65535&(c=d),g+=c>>>16,N=O,U=he,H=be,V=ge=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,G=fe,K=se,X=ce,O=ee,z=Z,J=ue,re=_e,ve=Me=65535&w|p<<16,y=le,o=ie,l=Y,Z=ae,$%16==15)for(var k=0;k<16;k++)w=65535&(u=b[k]),p=u>>>16,s=65535&(c=_[k]),g=c>>>16,w+=65535&(u=b[(k+9)%16]),p+=u>>>16,s+=65535&(c=_[(k+9)%16]),g+=c>>>16,w+=65535&(u=((m=b[(k+1)%16])>>>1|(d=_[(k+1)%16])<<31)^(m>>>8|d<<24)^(m>>>7|d<<25)),p+=u>>>16,s+=65535&(c=(d>>>1|m<<31)^(d>>>8|m<<24)^d>>>7),g+=c>>>16,p+=(u=((m=b[(k+14)%16])>>>19|(d=_[(k+14)%16])<<13)^(d>>>29|m<<3)^(m>>>6|d<<26))>>>16,s+=65535&(c=(d>>>19|m<<13)^(m>>>29|d<<3)^d>>>6),g+=c>>>16,_[k]=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,b[k]=65535&w|p<<16}w=65535&(u=Z),p=u>>>16,s=65535&(c=O),g=c>>>16,p+=(u=x[0])>>>16,s+=65535&(c=C[0]),g+=c>>>16,C[0]=O=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[0]=Z=65535&w|p<<16,w=65535&(u=z),p=u>>>16,s=65535&(c=N),g=c>>>16,p+=(u=x[1])>>>16,s+=65535&(c=C[1]),g+=c>>>16,C[1]=N=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[1]=z=65535&w|p<<16,w=65535&(u=J),p=u>>>16,s=65535&(c=U),g=c>>>16,p+=(u=x[2])>>>16,s+=65535&(c=C[2]),g+=c>>>16,C[2]=U=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[2]=J=65535&w|p<<16,w=65535&(u=re),p=u>>>16,s=65535&(c=H),g=c>>>16,p+=(u=x[3])>>>16,s+=65535&(c=C[3]),g+=c>>>16,C[3]=H=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[3]=re=65535&w|p<<16,w=65535&(u=ve),p=u>>>16,s=65535&(c=V),g=c>>>16,p+=(u=x[4])>>>16,s+=65535&(c=C[4]),g+=c>>>16,C[4]=V=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[4]=ve=65535&w|p<<16,w=65535&(u=y),p=u>>>16,s=65535&(c=G),g=c>>>16,p+=(u=x[5])>>>16,s+=65535&(c=C[5]),g+=c>>>16,C[5]=G=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[5]=y=65535&w|p<<16,w=65535&(u=o),p=u>>>16,s=65535&(c=K),g=c>>>16,p+=(u=x[6])>>>16,s+=65535&(c=C[6]),g+=c>>>16,C[6]=K=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[6]=o=65535&w|p<<16,w=65535&(u=l),p=u>>>16,s=65535&(c=X),g=c>>>16,p+=(u=x[7])>>>16,s+=65535&(c=C[7]),g+=c>>>16,C[7]=X=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[7]=l=65535&w|p<<16,P+=128,A-=128}return P}F.hash=function M(_){var b=new S;b.update(_);var C=b.digest();return b.clean(),C}},3434:(ne,F)=>{"use strict";var R="utf8: invalid string";F.cv=function S(M){for(var _=new Uint8Array(function T(M){for(var _=0,b=0;b=M.length-1)throw new Error(R);b++,_+=4}}return _}(M)),b=0,C=0;C>6,_[b++]=128|63&x):x<55296?(_[b++]=224|x>>12,_[b++]=128|x>>6&63,_[b++]=128|63&x):(C++,x=(1023&x)<<10,x|=1023&M.charCodeAt(C),_[b++]=240|(x+=65536)>>18,_[b++]=128|x>>12&63,_[b++]=128|x>>6&63,_[b++]=128|63&x)}return _}},9815:(ne,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.wipe=function I(R){for(var B=0;B{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.X25519Session=F.SECRET_SEED_LENGTH=F.SAVED_STATE_LENGTH=F.ACCEPT_MESSAGE_LENGTH=F.OFFER_MESSAGE_LENGTH=void 0;const R=I(5784),B=I(9815),S=I(5006),T=I(467);F.OFFER_MESSAGE_LENGTH=S.PUBLIC_KEY_LENGTH,F.ACCEPT_MESSAGE_LENGTH=S.PUBLIC_KEY_LENGTH,F.SAVED_STATE_LENGTH=S.SECRET_KEY_LENGTH,F.SECRET_SEED_LENGTH=S.SECRET_KEY_LENGTH,F.X25519Session=class f{constructor(_,b){this.offerMessageLength=F.OFFER_MESSAGE_LENGTH,this.acceptMessageLength=F.ACCEPT_MESSAGE_LENGTH,this.sharedKeyLength=S.SHARED_KEY_LENGTH,this.savedStateLength=F.SAVED_STATE_LENGTH,this._seed=_||(0,R.randomBytes)(S.SECRET_KEY_LENGTH,b)}saveState(){return new Uint8Array(this._seed)}restoreState(_){return this._seed=new Uint8Array(_),this}clean(){this._seed&&(0,B.wipe)(this._seed),this._keyPair&&((0,B.wipe)(this._keyPair.secretKey),(0,B.wipe)(this._keyPair.publicKey)),this._sharedKey&&(0,B.wipe)(this._sharedKey),this._sessionKeys&&((0,B.wipe)(this._sessionKeys.receive),(0,B.wipe)(this._sessionKeys.send))}offer(){return this._keyPair=(0,S.generateKeyPairFromSeed)(this._seed),new Uint8Array(this._keyPair.publicKey)}accept(_){if(this._keyPair)throw new Error("X25519Session: accept shouldn't be called by offering party");if(_.length!==this.offerMessageLength)throw new Error("X25519Session: incorrect offer message length");if(this._sharedKey)throw new Error("X25519Session: accept was already called");const b=(0,S.generateKeyPairFromSeed)(this._seed);return this._sharedKey=(0,S.sharedKey)(b.secretKey,_),this._sessionKeys=(0,T.clientSessionKeysFromSharedKey)(this._sharedKey,b.publicKey,_),(0,B.wipe)(b.secretKey),b.publicKey}finish(_){if(_.length!==this.acceptMessageLength)throw new Error("X25519Session: incorrect accept message length");if(!this._keyPair)throw new Error("X25519Session: no offer state");if(this._sharedKey)throw new Error("X25519Session: finish was already called");return this._sharedKey=(0,S.sharedKey)(this._keyPair.secretKey,_),this._sessionKeys=(0,T.serverSessionKeysFromSharedKey)(this._sharedKey,this._keyPair.publicKey,_),this}getSharedKey(){if(!this._sharedKey)throw new Error("X25519Session: no shared key established");return new Uint8Array(this._sharedKey)}getSessionKeys(){if(!this._sessionKeys)throw new Error("X25519Session: no shared key established");return{receive:new Uint8Array(this._sessionKeys.receive),send:new Uint8Array(this._sessionKeys.send)}}}},467:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.clientSessionKeys=F.serverSessionKeys=F.clientSessionKeysFromSharedKey=F.serverSessionKeysFromSharedKey=F.X25519Session=void 0;const R=I(7221),B=I(5006);var S=I(4904);Object.defineProperty(F,"X25519Session",{enumerable:!0,get:function(){return S.X25519Session}});function f(C,x,E,P=R.BLAKE2b){const A=new P;if(64!==A.digestLength)throw new Error("X25519: incorrect digest length");const O=A.update(C).update(E).update(x).digest();return{send:O.subarray(0,32),receive:O.subarray(32)}}function M(C,x,E,P=R.BLAKE2b){const A=new P;if(64!==A.digestLength)throw new Error("X25519: incorrect digest length");const O=A.update(C).update(x).update(E).digest();return{receive:O.subarray(0,32),send:O.subarray(32)}}F.serverSessionKeysFromSharedKey=f,F.clientSessionKeysFromSharedKey=M,F.serverSessionKeys=function _(C,x,E=R.BLAKE2b){return f((0,B.sharedKey)(C.secretKey,x),C.publicKey,x,E)},F.clientSessionKeys=function b(C,x,E=R.BLAKE2b){return M((0,B.sharedKey)(C.secretKey,x),C.publicKey,x,E)}},5006:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sharedKey=F.generateKeyPair=F.generateKeyPairFromSeed=F.scalarMultBase=F.scalarMult=F.SHARED_KEY_LENGTH=F.SECRET_KEY_LENGTH=F.PUBLIC_KEY_LENGTH=void 0;const R=I(5784),B=I(9815);function S(K){const X=new Float64Array(16);if(K)for(let Z=0;Z=0;--m){const w=Z[m>>>3]>>>(7&m)&1;_(J,re,w),_(ve,y,w),x(o,J,ve),E(J,J,ve),x(ve,re,y),E(re,re,y),A(y,o),A(l,J),P(J,ve,J),P(ve,re,o),x(o,J,ve),E(J,J,ve),A(re,J),E(ve,y,l),P(J,ve,f),x(J,J,y),P(ve,ve,J),P(J,y,l),P(y,re,z),A(re,o),_(J,re,w),_(ve,y,w)}for(let m=0;m<16;m++)z[m+16]=J[m],z[m+32]=ve[m],z[m+48]=re[m],z[m+64]=y[m];const c=z.subarray(32),u=z.subarray(16);(function O(K,X){const Z=S();for(let z=0;z<16;z++)Z[z]=X[z];for(let z=253;z>=0;z--)A(Z,Z),2!==z&&4!==z&&P(Z,Z,X);for(let z=0;z<16;z++)K[z]=Z[z]})(c,c),P(u,u,c);const d=new Uint8Array(32);return function b(K,X){const Z=S(),z=S();for(let J=0;J<16;J++)z[J]=X[J];M(z),M(z),M(z);for(let J=0;J<2;J++){Z[0]=z[0]-65517;for(let ve=1;ve<15;ve++)Z[ve]=z[ve]-65535-(Z[ve-1]>>16&1),Z[ve-1]&=65535;Z[15]=z[15]-32767-(Z[14]>>16&1);const re=Z[15]>>16&1;Z[14]&=65535,_(z,Z,1-re)}for(let J=0;J<16;J++)K[2*J]=255&z[J],K[2*J+1]=z[J]>>8}(d,u),d}function U(K){return N(K,T)}function H(K){if(K.length!==F.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${F.SECRET_KEY_LENGTH} bytes`);const X=new Uint8Array(K);return{publicKey:U(X),secretKey:X}}F.scalarMult=N,F.scalarMultBase=U,F.generateKeyPairFromSeed=H,F.generateKeyPair=function V(K){const X=(0,R.randomBytes)(32,K),Z=H(X);return(0,B.wipe)(X),Z},F.sharedKey=function G(K,X,Z=!1){if(K.length!==F.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(X.length!==F.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const z=N(K,X);if(Z){let J=0;for(let re=0;re{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(4502),B=I(6399),S=I(9815);function T(b,C,x,E,P){if(void 0===P&&(P=0),0===P){if(24!==C.length)throw new Error("XSalsa20 nonce must be 24 bytes")}else if(32!==C.length)throw new Error("XSalsa20 nonce with counter must be 32 bytes");var A=_(b,C.subarray(0,16),new Uint8Array(32)),O=B.streamXOR(A,C.subarray(16),x,E,P);return S.wipe(A),O}function _(b,C,x){for(var y,E=1634760805,P=b[3]<<24|b[2]<<16|b[1]<<8|b[0],A=b[7]<<24|b[6]<<16|b[5]<<8|b[4],O=b[11]<<24|b[10]<<16|b[9]<<8|b[8],N=b[15]<<24|b[14]<<16|b[13]<<8|b[12],U=857760878,H=C[3]<<24|C[2]<<16|C[1]<<8|C[0],V=C[7]<<24|C[6]<<16|C[5]<<8|C[4],G=C[11]<<24|C[10]<<16|C[9]<<8|C[8],K=C[15]<<24|C[14]<<16|C[13]<<8|C[12],X=2036477234,Z=b[19]<<24|b[18]<<16|b[17]<<8|b[16],z=b[23]<<24|b[22]<<16|b[21]<<8|b[20],J=b[27]<<24|b[26]<<16|b[25]<<8|b[24],re=b[31]<<24|b[30]<<16|b[29]<<8|b[28],ve=1797285236,o=0;o<20;o+=2)E^=(y=(z^=(y=(G^=(y=(N^=(y=E+z|0)<<7|y>>>25)+E|0)<<9|y>>>23)+N|0)<<13|y>>>19)+G|0)<<18|y>>>14,U^=(y=(P^=(y=(J^=(y=(K^=(y=U+P|0)<<7|y>>>25)+U|0)<<9|y>>>23)+K|0)<<13|y>>>19)+J|0)<<18|y>>>14,X^=(y=(H^=(y=(A^=(y=(re^=(y=X+H|0)<<7|y>>>25)+X|0)<<9|y>>>23)+re|0)<<13|y>>>19)+A|0)<<18|y>>>14,ve^=(y=(Z^=(y=(V^=(y=(O^=(y=ve+Z|0)<<7|y>>>25)+ve|0)<<9|y>>>23)+O|0)<<13|y>>>19)+V|0)<<18|y>>>14,E^=(y=(O^=(y=(A^=(y=(P^=(y=E+O|0)<<7|y>>>25)+E|0)<<9|y>>>23)+P|0)<<13|y>>>19)+A|0)<<18|y>>>14,U^=(y=(N^=(y=(V^=(y=(H^=(y=U+N|0)<<7|y>>>25)+U|0)<<9|y>>>23)+H|0)<<13|y>>>19)+V|0)<<18|y>>>14,X^=(y=(K^=(y=(G^=(y=(Z^=(y=X+K|0)<<7|y>>>25)+X|0)<<9|y>>>23)+Z|0)<<13|y>>>19)+G|0)<<18|y>>>14,ve^=(y=(re^=(y=(J^=(y=(z^=(y=ve+re|0)<<7|y>>>25)+ve|0)<<9|y>>>23)+z|0)<<13|y>>>19)+J|0)<<18|y>>>14;return R.writeUint32LE(E,x,0),R.writeUint32LE(U,x,4),R.writeUint32LE(X,x,8),R.writeUint32LE(ve,x,12),R.writeUint32LE(H,x,16),R.writeUint32LE(V,x,20),R.writeUint32LE(G,x,24),R.writeUint32LE(K,x,28),x}F.streamXOR=T,F.stream=function f(b,C,x,E){return void 0===E&&(E=0),S.wipe(x),T(b,C,x,x,E)},F.hsalsa=_},1108:(ne,F,I)=>{"use strict";const B=I(5343),S=I(8461),T="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.lW=b,F.h2=50;const f=2147483647;function _(oe){if(oe>f)throw new RangeError('The value "'+oe+'" is invalid for option "size"');const te=new Uint8Array(oe);return Object.setPrototypeOf(te,b.prototype),te}function b(oe,te,W){if("number"==typeof oe){if("string"==typeof te)throw new TypeError('The "string" argument must be of type string. Received type number');return P(oe)}return C(oe,te,W)}function C(oe,te,W){if("string"==typeof oe)return function A(oe,te){if(("string"!=typeof te||""===te)&&(te="utf8"),!b.isEncoding(te))throw new TypeError("Unknown encoding: "+te);const W=0|K(oe,te);let de=_(W);const Pe=de.write(oe,te);return Pe!==W&&(de=de.slice(0,Pe)),de}(oe,te);if(ArrayBuffer.isView(oe))return function N(oe){if(Re(oe,Uint8Array)){const te=new Uint8Array(oe);return U(te.buffer,te.byteOffset,te.byteLength)}return O(oe)}(oe);if(null==oe)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oe);if(Re(oe,ArrayBuffer)||oe&&Re(oe.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(Re(oe,SharedArrayBuffer)||oe&&Re(oe.buffer,SharedArrayBuffer)))return U(oe,te,W);if("number"==typeof oe)throw new TypeError('The "value" argument must not be of type number. Received type number');const de=oe.valueOf&&oe.valueOf();if(null!=de&&de!==oe)return b.from(de,te,W);const Pe=function H(oe){if(b.isBuffer(oe)){const te=0|V(oe.length),W=_(te);return 0===W.length||oe.copy(W,0,0,te),W}return void 0!==oe.length?"number"!=typeof oe.length||we(oe.length)?_(0):O(oe):"Buffer"===oe.type&&Array.isArray(oe.data)?O(oe.data):void 0}(oe);if(Pe)return Pe;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof oe[Symbol.toPrimitive])return b.from(oe[Symbol.toPrimitive]("string"),te,W);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oe)}function x(oe){if("number"!=typeof oe)throw new TypeError('"size" argument must be of type number');if(oe<0)throw new RangeError('The value "'+oe+'" is invalid for option "size"')}function P(oe){return x(oe),_(oe<0?0:0|V(oe))}function O(oe){const te=oe.length<0?0:0|V(oe.length),W=_(te);for(let de=0;de=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|oe}function K(oe,te){if(b.isBuffer(oe))return oe.length;if(ArrayBuffer.isView(oe)||Re(oe,ArrayBuffer))return oe.byteLength;if("string"!=typeof oe)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof oe);const W=oe.length,de=arguments.length>2&&!0===arguments[2];if(!de&&0===W)return 0;let Pe=!1;for(;;)switch(te){case"ascii":case"latin1":case"binary":return W;case"utf8":case"utf-8":return Y(oe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*W;case"hex":return W>>>1;case"base64":return xe(oe).length;default:if(Pe)return de?-1:Y(oe).length;te=(""+te).toLowerCase(),Pe=!0}}function X(oe,te,W){let de=!1;if((void 0===te||te<0)&&(te=0),te>this.length||((void 0===W||W>this.length)&&(W=this.length),W<=0)||(W>>>=0)<=(te>>>=0))return"";for(oe||(oe="utf8");;)switch(oe){case"hex":return s(this,te,W);case"utf8":case"utf-8":return u(this,te,W);case"ascii":return w(this,te,W);case"latin1":case"binary":return p(this,te,W);case"base64":return c(this,te,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,te,W);default:if(de)throw new TypeError("Unknown encoding: "+oe);oe=(oe+"").toLowerCase(),de=!0}}function Z(oe,te,W){const de=oe[te];oe[te]=oe[W],oe[W]=de}function z(oe,te,W,de,Pe){if(0===oe.length)return-1;if("string"==typeof W?(de=W,W=0):W>2147483647?W=2147483647:W<-2147483648&&(W=-2147483648),we(W=+W)&&(W=Pe?0:oe.length-1),W<0&&(W=oe.length+W),W>=oe.length){if(Pe)return-1;W=oe.length-1}else if(W<0){if(!Pe)return-1;W=0}if("string"==typeof te&&(te=b.from(te,de)),b.isBuffer(te))return 0===te.length?-1:J(oe,te,W,de,Pe);if("number"==typeof te)return te&=255,"function"==typeof Uint8Array.prototype.indexOf?Pe?Uint8Array.prototype.indexOf.call(oe,te,W):Uint8Array.prototype.lastIndexOf.call(oe,te,W):J(oe,[te],W,de,Pe);throw new TypeError("val must be string, number or Buffer")}function J(oe,te,W,de,Pe){let Je,Ee=1,Ae=oe.length,St=te.length;if(void 0!==de&&("ucs2"===(de=String(de).toLowerCase())||"ucs-2"===de||"utf16le"===de||"utf-16le"===de)){if(oe.length<2||te.length<2)return-1;Ee=2,Ae/=2,St/=2,W/=2}function Xe(kt,Ye){return 1===Ee?kt[Ye]:kt.readUInt16BE(Ye*Ee)}if(Pe){let kt=-1;for(Je=W;JeAe&&(W=Ae-St),Je=W;Je>=0;Je--){let kt=!0;for(let Ye=0;YePe&&(de=Pe):de=Pe;const Ee=te.length;let Ae;for(de>Ee/2&&(de=Ee/2),Ae=0;Ae>8,Pe=W%256,Ee.push(Pe),Ee.push(de);return Ee}(te,oe.length-W),oe,W,de)}function c(oe,te,W){return B.fromByteArray(0===te&&W===oe.length?oe:oe.slice(te,W))}function u(oe,te,W){W=Math.min(oe.length,W);const de=[];let Pe=te;for(;Pe239?4:Ee>223?3:Ee>191?2:1;if(Pe+St<=W){let Xe,Je,kt,Ye;switch(St){case 1:Ee<128&&(Ae=Ee);break;case 2:Xe=oe[Pe+1],128==(192&Xe)&&(Ye=(31&Ee)<<6|63&Xe,Ye>127&&(Ae=Ye));break;case 3:Xe=oe[Pe+1],Je=oe[Pe+2],128==(192&Xe)&&128==(192&Je)&&(Ye=(15&Ee)<<12|(63&Xe)<<6|63&Je,Ye>2047&&(Ye<55296||Ye>57343)&&(Ae=Ye));break;case 4:Xe=oe[Pe+1],Je=oe[Pe+2],kt=oe[Pe+3],128==(192&Xe)&&128==(192&Je)&&128==(192&kt)&&(Ye=(15&Ee)<<18|(63&Xe)<<12|(63&Je)<<6|63&kt,Ye>65535&&Ye<1114112&&(Ae=Ye))}}null===Ae?(Ae=65533,St=1):Ae>65535&&(Ae-=65536,de.push(Ae>>>10&1023|55296),Ae=56320|1023&Ae),de.push(Ae),Pe+=St}return function m(oe){const te=oe.length;if(te<=d)return String.fromCharCode.apply(String,oe);let W="",de=0;for(;dePe.length?(b.isBuffer(Ae)||(Ae=b.from(Ae)),Ae.copy(Pe,Ee)):Uint8Array.prototype.set.call(Pe,Ae,Ee);else{if(!b.isBuffer(Ae))throw new TypeError('"list" argument must be an Array of Buffers');Ae.copy(Pe,Ee)}Ee+=Ae.length}return Pe},b.byteLength=K,b.prototype._isBuffer=!0,b.prototype.swap16=function(){const te=this.length;if(te%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let W=0;WW&&(te+=" ... "),""},T&&(b.prototype[T]=b.prototype.inspect),b.prototype.compare=function(te,W,de,Pe,Ee){if(Re(te,Uint8Array)&&(te=b.from(te,te.offset,te.byteLength)),!b.isBuffer(te))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof te);if(void 0===W&&(W=0),void 0===de&&(de=te?te.length:0),void 0===Pe&&(Pe=0),void 0===Ee&&(Ee=this.length),W<0||de>te.length||Pe<0||Ee>this.length)throw new RangeError("out of range index");if(Pe>=Ee&&W>=de)return 0;if(Pe>=Ee)return-1;if(W>=de)return 1;if(this===te)return 0;let Ae=(Ee>>>=0)-(Pe>>>=0),St=(de>>>=0)-(W>>>=0);const Xe=Math.min(Ae,St),Je=this.slice(Pe,Ee),kt=te.slice(W,de);for(let Ye=0;Ye>>=0,isFinite(de)?(de>>>=0,void 0===Pe&&(Pe="utf8")):(Pe=de,de=void 0)}const Ee=this.length-W;if((void 0===de||de>Ee)&&(de=Ee),te.length>0&&(de<0||W<0)||W>this.length)throw new RangeError("Attempt to write outside buffer bounds");Pe||(Pe="utf8");let Ae=!1;for(;;)switch(Pe){case"hex":return re(this,te,W,de);case"utf8":case"utf-8":return ve(this,te,W,de);case"ascii":case"latin1":case"binary":return y(this,te,W,de);case"base64":return o(this,te,W,de);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l(this,te,W,de);default:if(Ae)throw new TypeError("Unknown encoding: "+Pe);Pe=(""+Pe).toLowerCase(),Ae=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const d=4096;function w(oe,te,W){let de="";W=Math.min(oe.length,W);for(let Pe=te;Pede)&&(W=de);let Pe="";for(let Ee=te;EeW)throw new RangeError("Trying to access beyond buffer length")}function k(oe,te,W,de,Pe,Ee){if(!b.isBuffer(oe))throw new TypeError('"buffer" argument must be a Buffer instance');if(te>Pe||teoe.length)throw new RangeError("Index out of range")}function q(oe,te,W,de,Pe){ue(te,de,Pe,oe,W,7);let Ee=Number(te&BigInt(4294967295));oe[W++]=Ee,Ee>>=8,oe[W++]=Ee,Ee>>=8,oe[W++]=Ee,Ee>>=8,oe[W++]=Ee;let Ae=Number(te>>BigInt(32)&BigInt(4294967295));return oe[W++]=Ae,Ae>>=8,oe[W++]=Ae,Ae>>=8,oe[W++]=Ae,Ae>>=8,oe[W++]=Ae,W}function he(oe,te,W,de,Pe){ue(te,de,Pe,oe,W,7);let Ee=Number(te&BigInt(4294967295));oe[W+7]=Ee,Ee>>=8,oe[W+6]=Ee,Ee>>=8,oe[W+5]=Ee,Ee>>=8,oe[W+4]=Ee;let Ae=Number(te>>BigInt(32)&BigInt(4294967295));return oe[W+3]=Ae,Ae>>=8,oe[W+2]=Ae,Ae>>=8,oe[W+1]=Ae,Ae>>=8,oe[W]=Ae,W+8}function be(oe,te,W,de,Pe,Ee){if(W+de>oe.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("Index out of range")}function ge(oe,te,W,de,Pe){return te=+te,W>>>=0,Pe||be(oe,0,W,4),S.write(oe,te,W,de,23,4),W+4}function fe(oe,te,W,de,Pe){return te=+te,W>>>=0,Pe||be(oe,0,W,8),S.write(oe,te,W,de,52,8),W+8}b.prototype.slice=function(te,W){const de=this.length;(te=~~te)<0?(te+=de)<0&&(te=0):te>de&&(te=de),(W=void 0===W?de:~~W)<0?(W+=de)<0&&(W=0):W>de&&(W=de),W>>=0,W>>>=0,de||$(te,W,this.length);let Pe=this[te],Ee=1,Ae=0;for(;++Ae>>=0,W>>>=0,de||$(te,W,this.length);let Pe=this[te+--W],Ee=1;for(;W>0&&(Ee*=256);)Pe+=this[te+--W]*Ee;return Pe},b.prototype.readUint8=b.prototype.readUInt8=function(te,W){return te>>>=0,W||$(te,1,this.length),this[te]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(te,W){return te>>>=0,W||$(te,2,this.length),this[te]|this[te+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(te,W){return te>>>=0,W||$(te,2,this.length),this[te]<<8|this[te+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(te,W){return te>>>=0,W||$(te,4,this.length),(this[te]|this[te+1]<<8|this[te+2]<<16)+16777216*this[te+3]},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(te,W){return te>>>=0,W||$(te,4,this.length),16777216*this[te]+(this[te+1]<<16|this[te+2]<<8|this[te+3])},b.prototype.readBigUInt64LE=wt(function(te){_e(te>>>=0,"offset");const W=this[te],de=this[te+7];(void 0===W||void 0===de)&&Me(te,this.length-8);const Pe=W+256*this[++te]+65536*this[++te]+this[++te]*2**24,Ee=this[++te]+256*this[++te]+65536*this[++te]+de*2**24;return BigInt(Pe)+(BigInt(Ee)<>>=0,"offset");const W=this[te],de=this[te+7];(void 0===W||void 0===de)&&Me(te,this.length-8);const Pe=W*2**24+65536*this[++te]+256*this[++te]+this[++te],Ee=this[++te]*2**24+65536*this[++te]+256*this[++te]+de;return(BigInt(Pe)<>>=0,W>>>=0,de||$(te,W,this.length);let Pe=this[te],Ee=1,Ae=0;for(;++Ae=Ee&&(Pe-=Math.pow(2,8*W)),Pe},b.prototype.readIntBE=function(te,W,de){te>>>=0,W>>>=0,de||$(te,W,this.length);let Pe=W,Ee=1,Ae=this[te+--Pe];for(;Pe>0&&(Ee*=256);)Ae+=this[te+--Pe]*Ee;return Ee*=128,Ae>=Ee&&(Ae-=Math.pow(2,8*W)),Ae},b.prototype.readInt8=function(te,W){return te>>>=0,W||$(te,1,this.length),128&this[te]?-1*(255-this[te]+1):this[te]},b.prototype.readInt16LE=function(te,W){te>>>=0,W||$(te,2,this.length);const de=this[te]|this[te+1]<<8;return 32768&de?4294901760|de:de},b.prototype.readInt16BE=function(te,W){te>>>=0,W||$(te,2,this.length);const de=this[te+1]|this[te]<<8;return 32768&de?4294901760|de:de},b.prototype.readInt32LE=function(te,W){return te>>>=0,W||$(te,4,this.length),this[te]|this[te+1]<<8|this[te+2]<<16|this[te+3]<<24},b.prototype.readInt32BE=function(te,W){return te>>>=0,W||$(te,4,this.length),this[te]<<24|this[te+1]<<16|this[te+2]<<8|this[te+3]},b.prototype.readBigInt64LE=wt(function(te){_e(te>>>=0,"offset");const W=this[te],de=this[te+7];return(void 0===W||void 0===de)&&Me(te,this.length-8),(BigInt(this[te+4]+256*this[te+5]+65536*this[te+6]+(de<<24))<>>=0,"offset");const W=this[te],de=this[te+7];(void 0===W||void 0===de)&&Me(te,this.length-8);const Pe=(W<<24)+65536*this[++te]+256*this[++te]+this[++te];return(BigInt(Pe)<>>=0,W||$(te,4,this.length),S.read(this,te,!0,23,4)},b.prototype.readFloatBE=function(te,W){return te>>>=0,W||$(te,4,this.length),S.read(this,te,!1,23,4)},b.prototype.readDoubleLE=function(te,W){return te>>>=0,W||$(te,8,this.length),S.read(this,te,!0,52,8)},b.prototype.readDoubleBE=function(te,W){return te>>>=0,W||$(te,8,this.length),S.read(this,te,!1,52,8)},b.prototype.writeUintLE=b.prototype.writeUIntLE=function(te,W,de,Pe){te=+te,W>>>=0,de>>>=0,Pe||k(this,te,W,de,Math.pow(2,8*de)-1,0);let Ee=1,Ae=0;for(this[W]=255&te;++Ae>>=0,de>>>=0,Pe||k(this,te,W,de,Math.pow(2,8*de)-1,0);let Ee=de-1,Ae=1;for(this[W+Ee]=255&te;--Ee>=0&&(Ae*=256);)this[W+Ee]=te/Ae&255;return W+de},b.prototype.writeUint8=b.prototype.writeUInt8=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,1,255,0),this[W]=255&te,W+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,2,65535,0),this[W]=255&te,this[W+1]=te>>>8,W+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,2,65535,0),this[W]=te>>>8,this[W+1]=255&te,W+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,4,4294967295,0),this[W+3]=te>>>24,this[W+2]=te>>>16,this[W+1]=te>>>8,this[W]=255&te,W+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,4,4294967295,0),this[W]=te>>>24,this[W+1]=te>>>16,this[W+2]=te>>>8,this[W+3]=255&te,W+4},b.prototype.writeBigUInt64LE=wt(function(te,W=0){return q(this,te,W,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=wt(function(te,W=0){return he(this,te,W,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(te,W,de,Pe){if(te=+te,W>>>=0,!Pe){const Xe=Math.pow(2,8*de-1);k(this,te,W,de,Xe-1,-Xe)}let Ee=0,Ae=1,St=0;for(this[W]=255&te;++Ee>0)-St&255;return W+de},b.prototype.writeIntBE=function(te,W,de,Pe){if(te=+te,W>>>=0,!Pe){const Xe=Math.pow(2,8*de-1);k(this,te,W,de,Xe-1,-Xe)}let Ee=de-1,Ae=1,St=0;for(this[W+Ee]=255&te;--Ee>=0&&(Ae*=256);)te<0&&0===St&&0!==this[W+Ee+1]&&(St=1),this[W+Ee]=(te/Ae>>0)-St&255;return W+de},b.prototype.writeInt8=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,1,127,-128),te<0&&(te=255+te+1),this[W]=255&te,W+1},b.prototype.writeInt16LE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,2,32767,-32768),this[W]=255&te,this[W+1]=te>>>8,W+2},b.prototype.writeInt16BE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,2,32767,-32768),this[W]=te>>>8,this[W+1]=255&te,W+2},b.prototype.writeInt32LE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,4,2147483647,-2147483648),this[W]=255&te,this[W+1]=te>>>8,this[W+2]=te>>>16,this[W+3]=te>>>24,W+4},b.prototype.writeInt32BE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,4,2147483647,-2147483648),te<0&&(te=4294967295+te+1),this[W]=te>>>24,this[W+1]=te>>>16,this[W+2]=te>>>8,this[W+3]=255&te,W+4},b.prototype.writeBigInt64LE=wt(function(te,W=0){return q(this,te,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=wt(function(te,W=0){return he(this,te,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeFloatLE=function(te,W,de){return ge(this,te,W,!0,de)},b.prototype.writeFloatBE=function(te,W,de){return ge(this,te,W,!1,de)},b.prototype.writeDoubleLE=function(te,W,de){return fe(this,te,W,!0,de)},b.prototype.writeDoubleBE=function(te,W,de){return fe(this,te,W,!1,de)},b.prototype.copy=function(te,W,de,Pe){if(!b.isBuffer(te))throw new TypeError("argument should be a Buffer");if(de||(de=0),!Pe&&0!==Pe&&(Pe=this.length),W>=te.length&&(W=te.length),W||(W=0),Pe>0&&Pe=this.length)throw new RangeError("Index out of range");if(Pe<0)throw new RangeError("sourceEnd out of bounds");Pe>this.length&&(Pe=this.length),te.length-W>>=0,de=void 0===de?this.length:de>>>0,te||(te=0),"number"==typeof te)for(Ee=W;Ee=de+4;W-=3)te=`_${oe.slice(W-3,W)}${te}`;return`${oe.slice(0,W)}${te}`}function ue(oe,te,W,de,Pe,Ee){if(oe>W||oe3?0===te||te===BigInt(0)?`>= 0${Ae} and < 2${Ae} ** ${8*(Ee+1)}${Ae}`:`>= -(2${Ae} ** ${8*(Ee+1)-1}${Ae}) and < 2 ** ${8*(Ee+1)-1}${Ae}`:`>= ${te}${Ae} and <= ${W}${Ae}`,new se.ERR_OUT_OF_RANGE("value",St,oe)}!function pe(oe,te,W){_e(te,"offset"),(void 0===oe[te]||void 0===oe[te+W])&&Me(te,oe.length-(W+1))}(de,Pe,Ee)}function _e(oe,te){if("number"!=typeof oe)throw new se.ERR_INVALID_ARG_TYPE(te,"number",oe)}function Me(oe,te,W){throw Math.floor(oe)!==oe?(_e(oe,W),new se.ERR_OUT_OF_RANGE(W||"offset","an integer",oe)):te<0?new se.ERR_BUFFER_OUT_OF_BOUNDS:new se.ERR_OUT_OF_RANGE(W||"offset",`>= ${W?1:0} and <= ${te}`,oe)}ce("ERR_BUFFER_OUT_OF_BOUNDS",function(oe){return oe?`${oe} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ce("ERR_INVALID_ARG_TYPE",function(oe,te){return`The "${oe}" argument must be of type number. Received type ${typeof te}`},TypeError),ce("ERR_OUT_OF_RANGE",function(oe,te,W){let de=`The value of "${oe}" is out of range.`,Pe=W;return Number.isInteger(W)&&Math.abs(W)>2**32?Pe=ee(String(W)):"bigint"==typeof W&&(Pe=String(W),(W>BigInt(2)**BigInt(32)||W<-(BigInt(2)**BigInt(32)))&&(Pe=ee(Pe)),Pe+="n"),de+=` It must be ${te}. Received ${Pe}`,de},RangeError);const le=/[^+/0-9A-Za-z-_]/g;function Y(oe,te){let W;te=te||1/0;const de=oe.length;let Pe=null;const Ee=[];for(let Ae=0;Ae55295&&W<57344){if(!Pe){if(W>56319){(te-=3)>-1&&Ee.push(239,191,189);continue}if(Ae+1===de){(te-=3)>-1&&Ee.push(239,191,189);continue}Pe=W;continue}if(W<56320){(te-=3)>-1&&Ee.push(239,191,189),Pe=W;continue}W=65536+(Pe-55296<<10|W-56320)}else Pe&&(te-=3)>-1&&Ee.push(239,191,189);if(Pe=null,W<128){if((te-=1)<0)break;Ee.push(W)}else if(W<2048){if((te-=2)<0)break;Ee.push(W>>6|192,63&W|128)}else if(W<65536){if((te-=3)<0)break;Ee.push(W>>12|224,W>>6&63|128,63&W|128)}else{if(!(W<1114112))throw new Error("Invalid code point");if((te-=4)<0)break;Ee.push(W>>18|240,W>>12&63|128,W>>6&63|128,63&W|128)}}return Ee}function xe(oe){return B.toByteArray(function ie(oe){if((oe=(oe=oe.split("=")[0]).trim().replace(le,"")).length<2)return"";for(;oe.length%4!=0;)oe+="=";return oe}(oe))}function Ce(oe,te,W,de){let Pe;for(Pe=0;Pe=te.length||Pe>=oe.length);++Pe)te[Pe+W]=oe[Pe];return Pe}function Re(oe,te){return oe instanceof te||null!=oe&&null!=oe.constructor&&null!=oe.constructor.name&&oe.constructor.name===te.name}function we(oe){return oe!=oe}const Oe=function(){const oe="0123456789abcdef",te=new Array(256);for(let W=0;W<16;++W){const de=16*W;for(let Pe=0;Pe<16;++Pe)te[de+Pe]=oe[W]+oe[Pe]}return te}();function wt(oe){return"undefined"==typeof BigInt?Be:oe}function Be(){throw new Error("BigInt not supported")}},7977:(ne,F,I)=>{"use strict";const R=F;R.bignum=I(3854),R.define=I(9516).define,R.base=I(7813),R.constants=I(5459),R.decoders=I(196),R.encoders=I(1131)},9516:(ne,F,I)=>{"use strict";const R=I(1131),B=I(196),S=I(3894);function f(M,_){this.name=M,this.body=_,this.decoders={},this.encoders={}}F.define=function(_,b){return new f(_,b)},f.prototype._createNamed=function(_){const b=this.name;function C(x){this._initNamed(x,b)}return S(C,_),C.prototype._initNamed=function(E,P){_.call(this,E,P)},new C(this)},f.prototype._getDecoder=function(_){return this.decoders.hasOwnProperty(_=_||"der")||(this.decoders[_]=this._createNamed(B[_])),this.decoders[_]},f.prototype.decode=function(_,b,C){return this._getDecoder(b).decode(_,C)},f.prototype._getEncoder=function(_){return this.encoders.hasOwnProperty(_=_||"der")||(this.encoders[_]=this._createNamed(R[_])),this.encoders[_]},f.prototype.encode=function(_,b,C){return this._getEncoder(b).encode(_,C)}},2769:(ne,F,I)=>{"use strict";const R=I(3894),B=I(4919).b,S=I(2038).Buffer;function T(M,_){B.call(this,_),S.isBuffer(M)?(this.base=M,this.offset=0,this.length=M.length):this.error("Input not Buffer")}function f(M,_){if(Array.isArray(M))this.length=0,this.value=M.map(function(b){return f.isEncoderBuffer(b)||(b=new f(b,_)),this.length+=b.length,b},this);else if("number"==typeof M){if(!(0<=M&&M<=255))return _.error("non-byte EncoderBuffer value");this.value=M,this.length=1}else if("string"==typeof M)this.value=M,this.length=S.byteLength(M);else{if(!S.isBuffer(M))return _.error("Unsupported type: "+typeof M);this.value=M,this.length=M.length}}R(T,B),F.C=T,T.isDecoderBuffer=function(_){return _ instanceof T||"object"==typeof _&&S.isBuffer(_.base)&&"DecoderBuffer"===_.constructor.name&&"number"==typeof _.offset&&"number"==typeof _.length&&"function"==typeof _.save&&"function"==typeof _.restore&&"function"==typeof _.isEmpty&&"function"==typeof _.readUInt8&&"function"==typeof _.skip&&"function"==typeof _.raw},T.prototype.save=function(){return{offset:this.offset,reporter:B.prototype.save.call(this)}},T.prototype.restore=function(_){const b=new T(this.base);return b.offset=_.offset,b.length=this.offset,this.offset=_.offset,B.prototype.restore.call(this,_.reporter),b},T.prototype.isEmpty=function(){return this.offset===this.length},T.prototype.readUInt8=function(_){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(_||"DecoderBuffer overrun")},T.prototype.skip=function(_,b){if(!(this.offset+_<=this.length))return this.error(b||"DecoderBuffer overrun");const C=new T(this.base);return C._reporterState=this._reporterState,C.offset=this.offset,C.length=this.offset+_,this.offset+=_,C},T.prototype.raw=function(_){return this.base.slice(_?_.offset:this.offset,this.length)},F.R=f,f.isEncoderBuffer=function(_){return _ instanceof f||"object"==typeof _&&"EncoderBuffer"===_.constructor.name&&"number"==typeof _.length&&"function"==typeof _.join},f.prototype.join=function(_,b){return _||(_=S.alloc(this.length)),b||(b=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(C){C.join(_,b),b+=C.length}):("number"==typeof this.value?_[b]=this.value:"string"==typeof this.value?_.write(this.value,b):S.isBuffer(this.value)&&this.value.copy(_,b),b+=this.length)),_}},7813:(ne,F,I)=>{"use strict";const R=F;R.Reporter=I(4919).b,R.DecoderBuffer=I(2769).C,R.EncoderBuffer=I(2769).R,R.Node=I(1430)},1430:(ne,F,I)=>{"use strict";const R=I(4919).b,B=I(2769).R,S=I(2769).C,T=I(2391),f=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],M=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(f);function b(x,E,P){const A={};this._baseState=A,A.name=P,A.enc=x,A.parent=E||null,A.children=null,A.tag=null,A.args=null,A.reverseArgs=null,A.choice=null,A.optional=!1,A.any=!1,A.obj=!1,A.use=null,A.useDecoder=null,A.key=null,A.default=null,A.explicit=null,A.implicit=null,A.contains=null,A.parent||(A.children=[],this._wrap())}ne.exports=b;const C=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];b.prototype.clone=function(){const E=this._baseState,P={};C.forEach(function(O){P[O]=E[O]});const A=new this.constructor(P.parent);return A._baseState=P,A},b.prototype._wrap=function(){const E=this._baseState;M.forEach(function(P){this[P]=function(){const O=new this.constructor(this);return E.children.push(O),O[P].apply(O,arguments)}},this)},b.prototype._init=function(E){const P=this._baseState;T(null===P.parent),E.call(this),P.children=P.children.filter(function(A){return A._baseState.parent===this},this),T.equal(P.children.length,1,"Root node can have only one child")},b.prototype._useArgs=function(E){const P=this._baseState,A=E.filter(function(O){return O instanceof this.constructor},this);E=E.filter(function(O){return!(O instanceof this.constructor)},this),0!==A.length&&(T(null===P.children),P.children=A,A.forEach(function(O){O._baseState.parent=this},this)),0!==E.length&&(T(null===P.args),P.args=E,P.reverseArgs=E.map(function(O){if("object"!=typeof O||O.constructor!==Object)return O;const N={};return Object.keys(O).forEach(function(U){U==(0|U)&&(U|=0),N[O[U]]=U}),N}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(x){b.prototype[x]=function(){throw new Error(x+" not implemented for encoding: "+this._baseState.enc)}}),f.forEach(function(x){b.prototype[x]=function(){const P=this._baseState,A=Array.prototype.slice.call(arguments);return T(null===P.tag),P.tag=x,this._useArgs(A),this}}),b.prototype.use=function(E){T(E);const P=this._baseState;return T(null===P.use),P.use=E,this},b.prototype.optional=function(){return this._baseState.optional=!0,this},b.prototype.def=function(E){const P=this._baseState;return T(null===P.default),P.default=E,P.optional=!0,this},b.prototype.explicit=function(E){const P=this._baseState;return T(null===P.explicit&&null===P.implicit),P.explicit=E,this},b.prototype.implicit=function(E){const P=this._baseState;return T(null===P.explicit&&null===P.implicit),P.implicit=E,this},b.prototype.obj=function(){const E=this._baseState,P=Array.prototype.slice.call(arguments);return E.obj=!0,0!==P.length&&this._useArgs(P),this},b.prototype.key=function(E){const P=this._baseState;return T(null===P.key),P.key=E,this},b.prototype.any=function(){return this._baseState.any=!0,this},b.prototype.choice=function(E){const P=this._baseState;return T(null===P.choice),P.choice=E,this._useArgs(Object.keys(E).map(function(A){return E[A]})),this},b.prototype.contains=function(E){const P=this._baseState;return T(null===P.use),P.contains=E,this},b.prototype._decode=function(E,P){const A=this._baseState;if(null===A.parent)return E.wrapResult(A.children[0]._decode(E,P));let H,O=A.default,N=!0,U=null;if(null!==A.key&&(U=E.enterKey(A.key)),A.optional){let V=null;if(null!==A.explicit?V=A.explicit:null!==A.implicit?V=A.implicit:null!==A.tag&&(V=A.tag),null!==V||A.any){if(N=this._peekTag(E,V,A.any),E.isError(N))return N}else{const G=E.save();try{null===A.choice?this._decodeGeneric(A.tag,E,P):this._decodeChoice(E,P),N=!0}catch(K){N=!1}E.restore(G)}}if(A.obj&&N&&(H=E.enterObject()),N){if(null!==A.explicit){const G=this._decodeTag(E,A.explicit);if(E.isError(G))return G;E=G}const V=E.offset;if(null===A.use&&null===A.choice){let G;A.any&&(G=E.save());const K=this._decodeTag(E,null!==A.implicit?A.implicit:A.tag,A.any);if(E.isError(K))return K;A.any?O=E.raw(G):E=K}if(P&&P.track&&null!==A.tag&&P.track(E.path(),V,E.length,"tagged"),P&&P.track&&null!==A.tag&&P.track(E.path(),E.offset,E.length,"content"),A.any||(O=null===A.choice?this._decodeGeneric(A.tag,E,P):this._decodeChoice(E,P)),E.isError(O))return O;if(!A.any&&null===A.choice&&null!==A.children&&A.children.forEach(function(K){K._decode(E,P)}),A.contains&&("octstr"===A.tag||"bitstr"===A.tag)){const G=new S(O);O=this._getUse(A.contains,E._reporterState.obj)._decode(G,P)}}return A.obj&&N&&(O=E.leaveObject(H)),null===A.key||null===O&&!0!==N?null!==U&&E.exitKey(U):E.leaveKey(U,A.key,O),O},b.prototype._decodeGeneric=function(E,P,A){const O=this._baseState;return"seq"===E||"set"===E?null:"seqof"===E||"setof"===E?this._decodeList(P,E,O.args[0],A):/str$/.test(E)?this._decodeStr(P,E,A):"objid"===E&&O.args?this._decodeObjid(P,O.args[0],O.args[1],A):"objid"===E?this._decodeObjid(P,null,null,A):"gentime"===E||"utctime"===E?this._decodeTime(P,E,A):"null_"===E?this._decodeNull(P,A):"bool"===E?this._decodeBool(P,A):"objDesc"===E?this._decodeStr(P,E,A):"int"===E||"enum"===E?this._decodeInt(P,O.args&&O.args[0],A):null!==O.use?this._getUse(O.use,P._reporterState.obj)._decode(P,A):P.error("unknown tag: "+E)},b.prototype._getUse=function(E,P){const A=this._baseState;return A.useDecoder=this._use(E,P),T(null===A.useDecoder._baseState.parent),A.useDecoder=A.useDecoder._baseState.children[0],A.implicit!==A.useDecoder._baseState.implicit&&(A.useDecoder=A.useDecoder.clone(),A.useDecoder._baseState.implicit=A.implicit),A.useDecoder},b.prototype._decodeChoice=function(E,P){const A=this._baseState;let O=null,N=!1;return Object.keys(A.choice).some(function(U){const H=E.save(),V=A.choice[U];try{const G=V._decode(E,P);if(E.isError(G))return!1;O={type:U,value:G},N=!0}catch(G){return E.restore(H),!1}return!0},this),N?O:E.error("Choice not matched")},b.prototype._createEncoderBuffer=function(E){return new B(E,this.reporter)},b.prototype._encode=function(E,P,A){const O=this._baseState;if(null!==O.default&&O.default===E)return;const N=this._encodeValue(E,P,A);return void 0===N||this._skipDefault(N,P,A)?void 0:N},b.prototype._encodeValue=function(E,P,A){const O=this._baseState;if(null===O.parent)return O.children[0]._encode(E,P||new R);let N=null;if(this.reporter=P,O.optional&&void 0===E){if(null===O.default)return;E=O.default}let U=null,H=!1;if(O.any)N=this._createEncoderBuffer(E);else if(O.choice)N=this._encodeChoice(E,P);else if(O.contains)U=this._getUse(O.contains,A)._encode(E,P),H=!0;else if(O.children)U=O.children.map(function(V){if("null_"===V._baseState.tag)return V._encode(null,P,E);if(null===V._baseState.key)return P.error("Child should have a key");const G=P.enterKey(V._baseState.key);if("object"!=typeof E)return P.error("Child expected, but input is not object");const K=V._encode(E[V._baseState.key],P,E);return P.leaveKey(G),K},this).filter(function(V){return V}),U=this._createEncoderBuffer(U);else if("seqof"===O.tag||"setof"===O.tag){if(!O.args||1!==O.args.length)return P.error("Too many args for : "+O.tag);if(!Array.isArray(E))return P.error("seqof/setof, but data is not Array");const V=this.clone();V._baseState.implicit=null,U=this._createEncoderBuffer(E.map(function(G){return this._getUse(this._baseState.args[0],E)._encode(G,P)},V))}else null!==O.use?N=this._getUse(O.use,A)._encode(E,P):(U=this._encodePrimitive(O.tag,E),H=!0);if(!O.any&&null===O.choice){const V=null!==O.implicit?O.implicit:O.tag,G=null===O.implicit?"universal":"context";null===V?null===O.use&&P.error("Tag could be omitted only for .use()"):null===O.use&&(N=this._encodeComposite(V,H,G,U))}return null!==O.explicit&&(N=this._encodeComposite(O.explicit,!1,"context",N)),N},b.prototype._encodeChoice=function(E,P){const A=this._baseState,O=A.choice[E.type];return O||T(!1,E.type+" not found in "+JSON.stringify(Object.keys(A.choice))),O._encode(E.value,P)},b.prototype._encodePrimitive=function(E,P){const A=this._baseState;if(/str$/.test(E))return this._encodeStr(P,E);if("objid"===E&&A.args)return this._encodeObjid(P,A.reverseArgs[0],A.args[1]);if("objid"===E)return this._encodeObjid(P,null,null);if("gentime"===E||"utctime"===E)return this._encodeTime(P,E);if("null_"===E)return this._encodeNull();if("int"===E||"enum"===E)return this._encodeInt(P,A.args&&A.reverseArgs[0]);if("bool"===E)return this._encodeBool(P);if("objDesc"===E)return this._encodeStr(P,E);throw new Error("Unsupported tag: "+E)},b.prototype._isNumstr=function(E){return/^[0-9 ]*$/.test(E)},b.prototype._isPrintstr=function(E){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(E)}},4919:(ne,F,I)=>{"use strict";const R=I(3894);function B(T){this._reporterState={obj:null,path:[],options:T||{},errors:[]}}function S(T,f){this.path=T,this.rethrow(f)}F.b=B,B.prototype.isError=function(f){return f instanceof S},B.prototype.save=function(){const f=this._reporterState;return{obj:f.obj,pathLen:f.path.length}},B.prototype.restore=function(f){const M=this._reporterState;M.obj=f.obj,M.path=M.path.slice(0,f.pathLen)},B.prototype.enterKey=function(f){return this._reporterState.path.push(f)},B.prototype.exitKey=function(f){const M=this._reporterState;M.path=M.path.slice(0,f-1)},B.prototype.leaveKey=function(f,M,_){const b=this._reporterState;this.exitKey(f),null!==b.obj&&(b.obj[M]=_)},B.prototype.path=function(){return this._reporterState.path.join("/")},B.prototype.enterObject=function(){const f=this._reporterState,M=f.obj;return f.obj={},M},B.prototype.leaveObject=function(f){const M=this._reporterState,_=M.obj;return M.obj=f,_},B.prototype.error=function(f){let M;const _=this._reporterState,b=f instanceof S;if(M=b?f:new S(_.path.map(function(C){return"["+JSON.stringify(C)+"]"}).join(""),f.message||f,f.stack),!_.options.partial)throw M;return b||_.errors.push(M),M},B.prototype.wrapResult=function(f){const M=this._reporterState;return M.options.partial?{result:this.isError(f)?null:f,errors:M.errors}:f},R(S,Error),S.prototype.rethrow=function(f){if(this.message=f+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,S),!this.stack)try{throw new Error(this.message)}catch(M){this.stack=M.stack}return this}},5496:(ne,F)=>{"use strict";function I(R){const B={};return Object.keys(R).forEach(function(S){(0|S)==S&&(S|=0),B[R[S]]=S}),B}F.tagClass={0:"universal",1:"application",2:"context",3:"private"},F.tagClassByName=I(F.tagClass),F.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},F.tagByName=I(F.tag)},5459:(ne,F,I)=>{"use strict";const R=F;R._reverse=function(S){const T={};return Object.keys(S).forEach(function(f){(0|f)==f&&(f|=0),T[S[f]]=f}),T},R.der=I(5496)},7127:(ne,F,I)=>{"use strict";const R=I(3894),B=I(3854),S=I(2769).C,T=I(1430),f=I(5496);function M(x){this.enc="der",this.name=x.name,this.entity=x,this.tree=new _,this.tree._init(x.body)}function _(x){T.call(this,"der",x)}function b(x,E){let P=x.readUInt8(E);if(x.isError(P))return P;const A=f.tagClass[P>>6],O=0==(32&P);if(31==(31&P)){let U=P;for(P=0;128==(128&U);){if(U=x.readUInt8(E),x.isError(U))return U;P<<=7,P|=127&U}}else P&=31;return{cls:A,primitive:O,tag:P,tagStr:f.tag[P]}}function C(x,E,P){let A=x.readUInt8(P);if(x.isError(A))return A;if(!E&&128===A)return null;if(0==(128&A))return A;const O=127&A;if(O>4)return x.error("length octect is too long");A=0;for(let N=0;N{"use strict";const R=F;R.der=I(7127),R.pem=I(9617)},9617:(ne,F,I)=>{"use strict";const R=I(3894),B=I(2038).Buffer,S=I(7127);function T(f){S.call(this,f),this.enc="pem"}R(T,S),ne.exports=T,T.prototype.decode=function(M,_){const b=M.toString().split(/[\r\n]+/g),C=_.label.toUpperCase(),x=/^-----(BEGIN|END) ([^-]+)-----$/;let E=-1,P=-1;for(let N=0;N{"use strict";const R=I(3894),B=I(2038).Buffer,S=I(1430),T=I(5496);function f(C){this.enc="der",this.name=C.name,this.entity=C,this.tree=new M,this.tree._init(C.body)}function M(C){S.call(this,"der",C)}function _(C){return C<10?"0"+C:C}ne.exports=f,f.prototype.encode=function(x,E){return this.tree._encode(x,E).join()},R(M,S),M.prototype._encodeComposite=function(x,E,P,A){const O=function b(C,x,E,P){let A;if("seqof"===C?C="seq":"setof"===C&&(C="set"),T.tagByName.hasOwnProperty(C))A=T.tagByName[C];else{if("number"!=typeof C||(0|C)!==C)return P.error("Unknown tag: "+C);A=C}return A>=31?P.error("Multi-octet tag encoding unsupported"):(x||(A|=32),A|=T.tagClassByName[E||"universal"]<<6,A)}(x,E,P,this.reporter);if(A.length<128){const H=B.alloc(2);return H[0]=O,H[1]=A.length,this._createEncoderBuffer([H,A])}let N=1;for(let H=A.length;H>=256;H>>=8)N++;const U=B.alloc(2+N);U[0]=O,U[1]=128|N;for(let H=1+N,V=A.length;V>0;H--,V>>=8)U[H]=255&V;return this._createEncoderBuffer([U,A])},M.prototype._encodeStr=function(x,E){if("bitstr"===E)return this._createEncoderBuffer([0|x.unused,x.data]);if("bmpstr"===E){const P=B.alloc(2*x.length);for(let A=0;A=40)return this.reporter.error("Second objid identifier OOB");x.splice(0,2,40*x[0]+x[1])}let A=0;for(let U=0;U=128;H>>=7)A++}const O=B.alloc(A);let N=O.length-1;for(let U=x.length-1;U>=0;U--){let H=x[U];for(O[N--]=127&H;(H>>=7)>0;)O[N--]=128|127&H}return this._createEncoderBuffer(O)},M.prototype._encodeTime=function(x,E){let P;const A=new Date(x);return"gentime"===E?P=[_(A.getUTCFullYear()),_(A.getUTCMonth()+1),_(A.getUTCDate()),_(A.getUTCHours()),_(A.getUTCMinutes()),_(A.getUTCSeconds()),"Z"].join(""):"utctime"===E?P=[_(A.getUTCFullYear()%100),_(A.getUTCMonth()+1),_(A.getUTCDate()),_(A.getUTCHours()),_(A.getUTCMinutes()),_(A.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+E+" time is not supported yet"),this._encodeStr(P,"octstr")},M.prototype._encodeNull=function(){return this._createEncoderBuffer("")},M.prototype._encodeInt=function(x,E){if("string"==typeof x){if(!E)return this.reporter.error("String int or enum given, but no values map");if(!E.hasOwnProperty(x))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(x));x=E[x]}if("number"!=typeof x&&!B.isBuffer(x)){const O=x.toArray();!x.sign&&128&O[0]&&O.unshift(0),x=B.from(O)}if(B.isBuffer(x)){let O=x.length;0===x.length&&O++;const N=B.alloc(O);return x.copy(N),0===x.length&&(N[0]=0),this._createEncoderBuffer(N)}if(x<128)return this._createEncoderBuffer(x);if(x<256)return this._createEncoderBuffer([0,x]);let P=1;for(let O=x;O>=256;O>>=8)P++;const A=new Array(P);for(let O=A.length-1;O>=0;O--)A[O]=255&x,x>>=8;return 128&A[0]&&A.unshift(0),this._createEncoderBuffer(B.from(A))},M.prototype._encodeBool=function(x){return this._createEncoderBuffer(x?255:0)},M.prototype._use=function(x,E){return"function"==typeof x&&(x=x(E)),x._getEncoder("der").tree},M.prototype._skipDefault=function(x,E,P){const A=this._baseState;let O;if(null===A.default)return!1;const N=x.join();if(void 0===A.defaultBuffer&&(A.defaultBuffer=this._encodeValue(A.default,E,P).join()),N.length!==A.defaultBuffer.length)return!1;for(O=0;O{"use strict";const R=F;R.der=I(6374),R.pem=I(3530)},3530:(ne,F,I)=>{"use strict";const R=I(3894),B=I(6374);function S(T){B.call(this,T),this.enc="pem"}R(S,B),ne.exports=S,S.prototype.encode=function(f,M){const b=B.prototype.encode.call(this,f).toString("base64"),C=["-----BEGIN "+M.label+"-----"];for(let x=0;x=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},3014:(ne,F,I)=>{ne.exports=I(7114)},7729:(ne,F,I)=>{"use strict";var R=I(4701),B=I(858),S=I(5738),T=I(1625),f=I(5215),M=I(2099),_=I(6100),b=I(5593),C=I(3324),x=I(1413);ne.exports=function(P){return new Promise(function(O,N){var G,U=P.data,H=P.headers,V=P.responseType;function K(){P.cancelToken&&P.cancelToken.unsubscribe(G),P.signal&&P.signal.removeEventListener("abort",G)}R.isFormData(U)&&delete H["Content-Type"];var X=new XMLHttpRequest;if(P.auth){var Z=P.auth.username||"",z=P.auth.password?unescape(encodeURIComponent(P.auth.password)):"";H.Authorization="Basic "+btoa(Z+":"+z)}var J=f(P.baseURL,P.url);function re(){if(X){var y="getAllResponseHeaders"in X?M(X.getAllResponseHeaders()):null;B(function(u){O(u),K()},function(u){N(u),K()},{data:V&&"text"!==V&&"json"!==V?X.response:X.responseText,status:X.status,statusText:X.statusText,headers:y,config:P,request:X}),X=null}}if(X.open(P.method.toUpperCase(),T(J,P.params,P.paramsSerializer),!0),X.timeout=P.timeout,"onloadend"in X?X.onloadend=re:X.onreadystatechange=function(){!X||4!==X.readyState||0===X.status&&(!X.responseURL||0!==X.responseURL.indexOf("file:"))||setTimeout(re)},X.onabort=function(){!X||(N(b("Request aborted",P,"ECONNABORTED",X)),X=null)},X.onerror=function(){N(b("Network Error",P,null,X)),X=null},X.ontimeout=function(){var o=P.timeout?"timeout of "+P.timeout+"ms exceeded":"timeout exceeded";P.timeoutErrorMessage&&(o=P.timeoutErrorMessage),N(b(o,P,(P.transitional||C.transitional).clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",X)),X=null},R.isStandardBrowserEnv()){var ve=(P.withCredentials||_(J))&&P.xsrfCookieName?S.read(P.xsrfCookieName):void 0;ve&&(H[P.xsrfHeaderName]=ve)}"setRequestHeader"in X&&R.forEach(H,function(o,l){void 0===U&&"content-type"===l.toLowerCase()?delete H[l]:X.setRequestHeader(l,o)}),R.isUndefined(P.withCredentials)||(X.withCredentials=!!P.withCredentials),V&&"json"!==V&&(X.responseType=P.responseType),"function"==typeof P.onDownloadProgress&&X.addEventListener("progress",P.onDownloadProgress),"function"==typeof P.onUploadProgress&&X.upload&&X.upload.addEventListener("progress",P.onUploadProgress),(P.cancelToken||P.signal)&&(G=function(y){!X||(N(!y||y&&y.type?new x("canceled"):y),X.abort(),X=null)},P.cancelToken&&P.cancelToken.subscribe(G),P.signal&&(P.signal.aborted?G():P.signal.addEventListener("abort",G))),U||(U=null),X.send(U)})}},7114:(ne,F,I)=>{"use strict";var R=I(4701),B=I(2414),S=I(6490),T=I(2971),_=function M(b){var C=new S(b),x=B(S.prototype.request,C);return R.extend(x,S.prototype,C),R.extend(x,C),x.create=function(P){return M(T(b,P))},x}(I(3324));_.Axios=S,_.Cancel=I(1413),_.CancelToken=I(3056),_.isCancel=I(8827),_.VERSION=I(1773).version,_.all=function(C){return Promise.all(C)},_.spread=I(9211),_.isAxiosError=I(4603),ne.exports=_,ne.exports.default=_},1413:ne=>{"use strict";function F(I){this.message=I}F.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},F.prototype.__CANCEL__=!0,ne.exports=F},3056:(ne,F,I)=>{"use strict";var R=I(1413);function B(S){if("function"!=typeof S)throw new TypeError("executor must be a function.");var T;this.promise=new Promise(function(_){T=_});var f=this;this.promise.then(function(M){if(f._listeners){var _,b=f._listeners.length;for(_=0;_{"use strict";ne.exports=function(I){return!(!I||!I.__CANCEL__)}},6490:(ne,F,I)=>{"use strict";var R=I(4701),B=I(1625),S=I(607),T=I(957),f=I(2971),M=I(4828),_=M.validators;function b(C){this.defaults=C,this.interceptors={request:new S,response:new S}}b.prototype.request=function(x){"string"==typeof x?(x=arguments[1]||{}).url=arguments[0]:x=x||{},(x=f(this.defaults,x)).method=x.method?x.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var E=x.transitional;void 0!==E&&M.assertOptions(E,{silentJSONParsing:_.transitional(_.boolean),forcedJSONParsing:_.transitional(_.boolean),clarifyTimeoutError:_.transitional(_.boolean)},!1);var P=[],A=!0;this.interceptors.request.forEach(function(X){"function"==typeof X.runWhen&&!1===X.runWhen(x)||(A=A&&X.synchronous,P.unshift(X.fulfilled,X.rejected))});var N,O=[];if(this.interceptors.response.forEach(function(X){O.push(X.fulfilled,X.rejected)}),!A){var U=[T,void 0];for(Array.prototype.unshift.apply(U,P),U=U.concat(O),N=Promise.resolve(x);U.length;)N=N.then(U.shift(),U.shift());return N}for(var H=x;P.length;){var V=P.shift(),G=P.shift();try{H=V(H)}catch(K){G(K);break}}try{N=T(H)}catch(K){return Promise.reject(K)}for(;O.length;)N=N.then(O.shift(),O.shift());return N},b.prototype.getUri=function(x){return x=f(this.defaults,x),B(x.url,x.params,x.paramsSerializer).replace(/^\?/,"")},R.forEach(["delete","get","head","options"],function(x){b.prototype[x]=function(E,P){return this.request(f(P||{},{method:x,url:E,data:(P||{}).data}))}}),R.forEach(["post","put","patch"],function(x){b.prototype[x]=function(E,P,A){return this.request(f(A||{},{method:x,url:E,data:P}))}}),ne.exports=b},607:(ne,F,I)=>{"use strict";var R=I(4701);function B(){this.handlers=[]}B.prototype.use=function(T,f,M){return this.handlers.push({fulfilled:T,rejected:f,synchronous:!!M&&M.synchronous,runWhen:M?M.runWhen:null}),this.handlers.length-1},B.prototype.eject=function(T){this.handlers[T]&&(this.handlers[T]=null)},B.prototype.forEach=function(T){R.forEach(this.handlers,function(M){null!==M&&T(M)})},ne.exports=B},5215:(ne,F,I)=>{"use strict";var R=I(8692),B=I(4554);ne.exports=function(T,f){return T&&!R(f)?B(T,f):f}},5593:(ne,F,I)=>{"use strict";var R=I(5124);ne.exports=function(S,T,f,M,_){var b=new Error(S);return R(b,T,f,M,_)}},957:(ne,F,I)=>{"use strict";var R=I(4701),B=I(5134),S=I(8827),T=I(3324),f=I(1413);function M(_){if(_.cancelToken&&_.cancelToken.throwIfRequested(),_.signal&&_.signal.aborted)throw new f("canceled")}ne.exports=function(b){return M(b),b.headers=b.headers||{},b.data=B.call(b,b.data,b.headers,b.transformRequest),b.headers=R.merge(b.headers.common||{},b.headers[b.method]||{},b.headers),R.forEach(["delete","get","head","post","put","patch","common"],function(E){delete b.headers[E]}),(b.adapter||T.adapter)(b).then(function(E){return M(b),E.data=B.call(b,E.data,E.headers,b.transformResponse),E},function(E){return S(E)||(M(b),E&&E.response&&(E.response.data=B.call(b,E.response.data,E.response.headers,b.transformResponse))),Promise.reject(E)})}},5124:ne=>{"use strict";ne.exports=function(I,R,B,S,T){return I.config=R,B&&(I.code=B),I.request=S,I.response=T,I.isAxiosError=!0,I.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},I}},2971:(ne,F,I)=>{"use strict";var R=I(4701);ne.exports=function(S,T){T=T||{};var f={};function M(P,A){return R.isPlainObject(P)&&R.isPlainObject(A)?R.merge(P,A):R.isPlainObject(A)?R.merge({},A):R.isArray(A)?A.slice():A}function _(P){return R.isUndefined(T[P])?R.isUndefined(S[P])?void 0:M(void 0,S[P]):M(S[P],T[P])}function b(P){if(!R.isUndefined(T[P]))return M(void 0,T[P])}function C(P){return R.isUndefined(T[P])?R.isUndefined(S[P])?void 0:M(void 0,S[P]):M(void 0,T[P])}function x(P){return P in T?M(S[P],T[P]):P in S?M(void 0,S[P]):void 0}var E={url:b,method:b,data:b,baseURL:C,transformRequest:C,transformResponse:C,paramsSerializer:C,timeout:C,timeoutMessage:C,withCredentials:C,adapter:C,responseType:C,xsrfCookieName:C,xsrfHeaderName:C,onUploadProgress:C,onDownloadProgress:C,decompress:C,maxContentLength:C,maxBodyLength:C,transport:C,httpAgent:C,httpsAgent:C,cancelToken:C,socketPath:C,responseEncoding:C,validateStatus:x};return R.forEach(Object.keys(S).concat(Object.keys(T)),function(A){var O=E[A]||_,N=O(A);R.isUndefined(N)&&O!==x||(f[A]=N)}),f}},858:(ne,F,I)=>{"use strict";var R=I(5593);ne.exports=function(S,T,f){var M=f.config.validateStatus;f.status&&M&&!M(f.status)?T(R("Request failed with status code "+f.status,f.config,null,f.request,f)):S(f)}},5134:(ne,F,I)=>{"use strict";var R=I(4701),B=I(3324);ne.exports=function(T,f,M){var _=this||B;return R.forEach(M,function(C){T=C.call(_,T,f)}),T}},3324:(ne,F,I)=>{"use strict";var R=I(4701),B=I(5620),S=I(5124),T={"Content-Type":"application/x-www-form-urlencoded"};function f(C,x){!R.isUndefined(C)&&R.isUndefined(C["Content-Type"])&&(C["Content-Type"]=x)}var b={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function M(){var C;return("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(C=I(7729)),C}(),transformRequest:[function(x,E){return B(E,"Accept"),B(E,"Content-Type"),R.isFormData(x)||R.isArrayBuffer(x)||R.isBuffer(x)||R.isStream(x)||R.isFile(x)||R.isBlob(x)?x:R.isArrayBufferView(x)?x.buffer:R.isURLSearchParams(x)?(f(E,"application/x-www-form-urlencoded;charset=utf-8"),x.toString()):R.isObject(x)||E&&"application/json"===E["Content-Type"]?(f(E,"application/json"),function _(C,x,E){if(R.isString(C))try{return(x||JSON.parse)(C),R.trim(C)}catch(P){if("SyntaxError"!==P.name)throw P}return(E||JSON.stringify)(C)}(x)):x}],transformResponse:[function(x){var E=this.transitional||b.transitional,O=!(E&&E.silentJSONParsing)&&"json"===this.responseType;if(O||E&&E.forcedJSONParsing&&R.isString(x)&&x.length)try{return JSON.parse(x)}catch(N){if(O)throw"SyntaxError"===N.name?S(N,this,"E_JSON_PARSE"):N}return x}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(x){return x>=200&&x<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};R.forEach(["delete","get","head"],function(x){b.headers[x]={}}),R.forEach(["post","put","patch"],function(x){b.headers[x]=R.merge(T)}),ne.exports=b},1773:ne=>{ne.exports={version:"0.24.0"}},2414:ne=>{"use strict";ne.exports=function(I,R){return function(){for(var S=new Array(arguments.length),T=0;T{"use strict";var R=I(4701);function B(S){return encodeURIComponent(S).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}ne.exports=function(T,f,M){if(!f)return T;var _;if(M)_=M(f);else if(R.isURLSearchParams(f))_=f.toString();else{var b=[];R.forEach(f,function(E,P){null==E||(R.isArray(E)?P+="[]":E=[E],R.forEach(E,function(O){R.isDate(O)?O=O.toISOString():R.isObject(O)&&(O=JSON.stringify(O)),b.push(B(P)+"="+B(O))}))}),_=b.join("&")}if(_){var C=T.indexOf("#");-1!==C&&(T=T.slice(0,C)),T+=(-1===T.indexOf("?")?"?":"&")+_}return T}},4554:ne=>{"use strict";ne.exports=function(I,R){return R?I.replace(/\/+$/,"")+"/"+R.replace(/^\/+/,""):I}},5738:(ne,F,I)=>{"use strict";var R=I(4701);ne.exports=R.isStandardBrowserEnv()?{write:function(T,f,M,_,b,C){var x=[];x.push(T+"="+encodeURIComponent(f)),R.isNumber(M)&&x.push("expires="+new Date(M).toGMTString()),R.isString(_)&&x.push("path="+_),R.isString(b)&&x.push("domain="+b),!0===C&&x.push("secure"),document.cookie=x.join("; ")},read:function(T){var f=document.cookie.match(new RegExp("(^|;\\s*)("+T+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove:function(T){this.write(T,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},8692:ne=>{"use strict";ne.exports=function(I){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(I)}},4603:ne=>{"use strict";ne.exports=function(I){return"object"==typeof I&&!0===I.isAxiosError}},6100:(ne,F,I)=>{"use strict";var R=I(4701);ne.exports=R.isStandardBrowserEnv()?function(){var f,S=/(msie|trident)/i.test(navigator.userAgent),T=document.createElement("a");function M(_){var b=_;return S&&(T.setAttribute("href",b),b=T.href),T.setAttribute("href",b),{href:T.href,protocol:T.protocol?T.protocol.replace(/:$/,""):"",host:T.host,search:T.search?T.search.replace(/^\?/,""):"",hash:T.hash?T.hash.replace(/^#/,""):"",hostname:T.hostname,port:T.port,pathname:"/"===T.pathname.charAt(0)?T.pathname:"/"+T.pathname}}return f=M(window.location.href),function(b){var C=R.isString(b)?M(b):b;return C.protocol===f.protocol&&C.host===f.host}}():function(){return!0}},5620:(ne,F,I)=>{"use strict";var R=I(4701);ne.exports=function(S,T){R.forEach(S,function(M,_){_!==T&&_.toUpperCase()===T.toUpperCase()&&(S[T]=M,delete S[_])})}},2099:(ne,F,I)=>{"use strict";var R=I(4701),B=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];ne.exports=function(T){var M,_,b,f={};return T&&R.forEach(T.split("\n"),function(x){if(b=x.indexOf(":"),M=R.trim(x.substr(0,b)).toLowerCase(),_=R.trim(x.substr(b+1)),M){if(f[M]&&B.indexOf(M)>=0)return;f[M]="set-cookie"===M?(f[M]?f[M]:[]).concat([_]):f[M]?f[M]+", "+_:_}}),f}},9211:ne=>{"use strict";ne.exports=function(I){return function(B){return I.apply(null,B)}}},4828:(ne,F,I)=>{"use strict";var R=I(1773).version,B={};["object","boolean","number","function","string","symbol"].forEach(function(f,M){B[f]=function(b){return typeof b===f||"a"+(M<1?"n ":" ")+f}});var S={};B.transitional=function(M,_,b){function C(x,E){return"[Axios v"+R+"] Transitional option '"+x+"'"+E+(b?". "+b:"")}return function(x,E,P){if(!1===M)throw new Error(C(E," has been removed"+(_?" in "+_:"")));return _&&!S[E]&&(S[E]=!0,console.warn(C(E," has been deprecated since v"+_+" and will be removed in the near future"))),!M||M(x,E,P)}},ne.exports={assertOptions:function T(f,M,_){if("object"!=typeof f)throw new TypeError("options must be an object");for(var b=Object.keys(f),C=b.length;C-- >0;){var x=b[C],E=M[x];if(E){var P=f[x],A=void 0===P||E(P,x,f);if(!0!==A)throw new TypeError("option "+x+" must be "+A)}else if(!0!==_)throw Error("Unknown option "+x)}},validators:B}},4701:(ne,F,I)=>{"use strict";var R=I(2414),B=Object.prototype.toString;function S(re){return"[object Array]"===B.call(re)}function T(re){return void 0===re}function E(re){return null!==re&&"object"==typeof re}function P(re){if("[object Object]"!==B.call(re))return!1;var ve=Object.getPrototypeOf(re);return null===ve||ve===Object.prototype}function U(re){return"[object Function]"===B.call(re)}function X(re,ve){if(null!=re)if("object"!=typeof re&&(re=[re]),S(re))for(var y=0,o=re.length;y{"use strict";var R=I(3502).Buffer;ne.exports=function B(S){if(S.length>=255)throw new TypeError("Alphabet too long");for(var T=new Uint8Array(256),f=0;f>>0,X=new Uint8Array(K);U[H];){var Z=T[U.charCodeAt(H)];if(255===Z)return;for(var z=0,J=K-1;(0!==Z||z>>0)%256>>>0,Z=Z/256>>>0;if(0!==Z)throw new Error("Non-zero carry");G=z,H++}if(" "!==U[H]){for(var re=K-G;re!==K&&0===X[re];)re++;var ve=R.allocUnsafe(V+(K-re));ve.fill(0,0,V);for(var y=V;re!==K;)ve[y++]=X[re++];return ve}}}return{encode:function A(U){if((Array.isArray(U)||U instanceof Uint8Array)&&(U=R.from(U)),!R.isBuffer(U))throw new TypeError("Expected Buffer");if(0===U.length)return"";for(var H=0,V=0,G=0,K=U.length;G!==K&&0===U[G];)G++,H++;for(var X=(K-G)*P+1>>>0,Z=new Uint8Array(X);G!==K;){for(var z=U[G],J=0,re=X-1;(0!==z||J>>0)%C>>>0,z=z/C>>>0;if(0!==z)throw new Error("Non-zero carry");V=J,G++}for(var ve=X-V;ve!==X&&0===Z[ve];)ve++;for(var y=x.repeat(H);ve{"use strict";F.byteLength=function _(A){var O=M(A),U=O[1];return 3*(O[0]+U)/4-U},F.toByteArray=function C(A){var O,X,N=M(A),U=N[0],H=N[1],V=new B(function b(A,O,N){return 3*(O+N)/4-N}(0,U,H)),G=0,K=H>0?U-4:U;for(X=0;X>16&255,V[G++]=O>>8&255,V[G++]=255&O;return 2===H&&(O=R[A.charCodeAt(X)]<<2|R[A.charCodeAt(X+1)]>>4,V[G++]=255&O),1===H&&(O=R[A.charCodeAt(X)]<<10|R[A.charCodeAt(X+1)]<<4|R[A.charCodeAt(X+2)]>>2,V[G++]=O>>8&255,V[G++]=255&O),V},F.fromByteArray=function P(A){for(var O,N=A.length,U=N%3,H=[],V=16383,G=0,K=N-U;GK?K:G+V));return 1===U?H.push(I[(O=A[N-1])>>2]+I[O<<4&63]+"=="):2===U&&H.push(I[(O=(A[N-2]<<8)+A[N-1])>>10]+I[O>>4&63]+I[O<<2&63]+"="),H.join("")};for(var I=[],R=[],B="undefined"!=typeof Uint8Array?Uint8Array:Array,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=0,f=S.length;T0)throw new Error("Invalid string. Length must be a multiple of 4");var N=A.indexOf("=");return-1===N&&(N=O),[N,N===O?0:4-N%4]}function x(A){return I[A>>18&63]+I[A>>12&63]+I[A>>6&63]+I[63&A]}function E(A,O,N){for(var H=[],V=O;V{const R=I(4850);function B(V,G,K){const X=V[G]+V[K];let Z=V[G+1]+V[K+1];X>=4294967296&&Z++,V[G]=X,V[G+1]=Z}function S(V,G,K,X){let Z=V[G]+K;K<0&&(Z+=4294967296);let z=V[G+1]+X;Z>=4294967296&&z++,V[G]=Z,V[G+1]=z}function T(V,G){return V[G]^V[G+1]<<8^V[G+2]<<16^V[G+3]<<24}function f(V,G,K,X,Z,z){const J=x[Z],re=x[Z+1],ve=x[z],y=x[z+1];B(C,V,G),S(C,V,J,re);let o=C[X]^C[V],l=C[X+1]^C[V+1];C[X]=l,C[X+1]=o,B(C,K,X),o=C[G]^C[K],l=C[G+1]^C[K+1],C[G]=o>>>24^l<<8,C[G+1]=l>>>24^o<<8,B(C,V,G),S(C,V,ve,y),o=C[X]^C[V],l=C[X+1]^C[V+1],C[X]=o>>>16^l<<16,C[X+1]=l>>>16^o<<16,B(C,K,X),o=C[G]^C[K],l=C[G+1]^C[K+1],C[G]=l>>>31^o<<1,C[G+1]=o>>>31^l<<1}const M=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),b=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(V){return 2*V})),C=new Uint32Array(32),x=new Uint32Array(32);function E(V,G){let K=0;for(K=0;K<16;K++)C[K]=V.h[K],C[K+16]=M[K];for(C[24]=C[24]^V.t,C[25]=C[25]^V.t/4294967296,G&&(C[28]=~C[28],C[29]=~C[29]),K=0;K<32;K++)x[K]=T(V.b,4*K);for(K=0;K<12;K++)f(0,8,16,24,b[16*K+0],b[16*K+1]),f(2,10,18,26,b[16*K+2],b[16*K+3]),f(4,12,20,28,b[16*K+4],b[16*K+5]),f(6,14,22,30,b[16*K+6],b[16*K+7]),f(0,10,20,30,b[16*K+8],b[16*K+9]),f(2,12,22,24,b[16*K+10],b[16*K+11]),f(4,14,16,26,b[16*K+12],b[16*K+13]),f(6,8,18,28,b[16*K+14],b[16*K+15]);for(K=0;K<16;K++)V.h[K]=V.h[K]^C[K]^C[K+16]}const P=new Uint8Array([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,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,0,0,0,0,0,0,0,0,0,0]);function A(V,G,K,X){if(0===V||V>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(G&&G.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(K&&16!==K.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(X&&16!==X.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const Z={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:V};P.fill(0),P[0]=V,G&&(P[1]=G.length),P[2]=1,P[3]=1,K&&P.set(K,32),X&&P.set(X,48);for(let z=0;z<16;z++)Z.h[z]=M[z]^T(P,4*z);return G&&(O(Z,G),Z.c=128),Z}function O(V,G){for(let K=0;K>2]>>8*(3&K);return G}function U(V,G,K,X,Z){K=K||64,V=R.normalizeInput(V),X&&(X=R.normalizeInput(X)),Z&&(Z=R.normalizeInput(Z));const z=A(K,G,X,Z);return O(z,V),N(z)}ne.exports={blake2b:U,blake2bHex:function H(V,G,K,X,Z){const z=U(V,G,K,X,Z);return R.toHex(z)},blake2bInit:A,blake2bUpdate:O,blake2bFinal:N}},9370:(ne,F,I)=>{const R=I(4850);function B(N,U){return N[U]^N[U+1]<<8^N[U+2]<<16^N[U+3]<<24}function S(N,U,H,V,G,K){_[N]=_[N]+_[U]+G,_[V]=T(_[V]^_[N],16),_[H]=_[H]+_[V],_[U]=T(_[U]^_[H],12),_[N]=_[N]+_[U]+K,_[V]=T(_[V]^_[N],8),_[H]=_[H]+_[V],_[U]=T(_[U]^_[H],7)}function T(N,U){return N>>>U^N<<32-U}const f=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),M=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),_=new Uint32Array(16),b=new Uint32Array(16);function C(N,U){let H=0;for(H=0;H<8;H++)_[H]=N.h[H],_[H+8]=f[H];for(_[12]^=N.t,_[13]^=N.t/4294967296,U&&(_[14]=~_[14]),H=0;H<16;H++)b[H]=B(N.b,4*H);for(H=0;H<10;H++)S(0,4,8,12,b[M[16*H+0]],b[M[16*H+1]]),S(1,5,9,13,b[M[16*H+2]],b[M[16*H+3]]),S(2,6,10,14,b[M[16*H+4]],b[M[16*H+5]]),S(3,7,11,15,b[M[16*H+6]],b[M[16*H+7]]),S(0,5,10,15,b[M[16*H+8]],b[M[16*H+9]]),S(1,6,11,12,b[M[16*H+10]],b[M[16*H+11]]),S(2,7,8,13,b[M[16*H+12]],b[M[16*H+13]]),S(3,4,9,14,b[M[16*H+14]],b[M[16*H+15]]);for(H=0;H<8;H++)N.h[H]^=_[H]^_[H+8]}function x(N,U){if(!(N>0&&N<=32))throw new Error("Incorrect output length, should be in [1, 32]");const H=U?U.length:0;if(U&&!(H>0&&H<=32))throw new Error("Incorrect key length, should be in [1, 32]");const V={h:new Uint32Array(f),b:new Uint8Array(64),c:0,t:0,outlen:N};return V.h[0]^=16842752^H<<8^N,H>0&&(E(V,U),V.c=64),V}function E(N,U){for(let H=0;H>2]>>8*(3&H)&255;return U}function A(N,U,H){H=H||32,N=R.normalizeInput(N);const V=x(H,U);return E(V,N),P(V)}ne.exports={blake2s:A,blake2sHex:function O(N,U,H){const V=A(N,U,H);return R.toHex(V)},blake2sInit:x,blake2sUpdate:E,blake2sFinal:P}},3647:(ne,F,I)=>{const R=I(1502),B=I(9370);ne.exports={blake2b:R.blake2b,blake2bHex:R.blake2bHex,blake2bInit:R.blake2bInit,blake2bUpdate:R.blake2bUpdate,blake2bFinal:R.blake2bFinal,blake2s:B.blake2s,blake2sHex:B.blake2sHex,blake2sInit:B.blake2sInit,blake2sUpdate:B.blake2sUpdate,blake2sFinal:B.blake2sFinal}},4850:ne=>{function B(f){return(4294967296+f).toString(16).substring(1)}ne.exports={normalizeInput:function I(f){let M;if(f instanceof Uint8Array)M=f;else{if("string"!=typeof f)throw new Error("Input must be an string, Buffer or Uint8Array");M=(new TextEncoder).encode(f)}return M},toHex:function R(f){return Array.prototype.map.call(f,function(M){return(M<16?"0":"")+M.toString(16)}).join("")},debugPrint:function S(f,M,_){let b="\n"+f+" = ";for(let C=0;C=48&&d<=57?d-48:d>=65&&d<=70?d-55:d>=97&&d<=102?d-87:void S(!1,"Invalid character in "+c)}function b(c,u,d){var m=_(c,d);return d-1>=u&&(m|=_(c,d-1)<<4),m}function C(c,u,d,m){for(var w=0,p=0,s=Math.min(c.length,d),g=u;g=49?$-49+10:$>=17?$-17+10:$,S($>=0&&p0?u:d},f.min=function(u,d){return u.cmp(d)<0?u:d},f.prototype._init=function(u,d,m){if("number"==typeof u)return this._initNumber(u,d,m);if("object"==typeof u)return this._initArray(u,d,m);"hex"===d&&(d=16),S(d===(0|d)&&d>=2&&d<=36);var w=0;"-"===(u=u.toString().replace(/\s+/g,""))[0]&&(w++,this.negative=1),w=0;w-=3)this.words[p]|=(s=u[w]|u[w-1]<<8|u[w-2]<<16)<>>26-g&67108863,(g+=24)>=26&&(g-=26,p++);else if("le"===m)for(w=0,p=0;w>>26-g&67108863,(g+=24)>=26&&(g-=26,p++);return this._strip()},f.prototype._parseHex=function(u,d,m){this.length=Math.ceil((u.length-d)/6),this.words=new Array(this.length);for(var w=0;w=d;w-=2)g=b(u,d,w)<=18?(p-=18,this.words[s+=1]|=g>>>26):p+=8;else for(w=(u.length-d)%2==0?d+1:d;w=18?(p-=18,this.words[s+=1]|=g>>>26):p+=8;this._strip()},f.prototype._parseBase=function(u,d,m){this.words=[0],this.length=1;for(var w=0,p=1;p<=67108863;p*=d)w++;w--,p=p/d|0;for(var s=u.length-m,g=s%w,$=Math.min(s,s-g)+m,k=0,q=m;q<$;q+=w)k=C(u,q,q+w,d),this.imuln(p),this.words[0]+k<67108864?this.words[0]+=k:this._iaddn(k);if(0!==g){var he=1;for(k=C(u,q,u.length,d),q=0;q1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch(c){f.prototype.inspect=E}else f.prototype.inspect=E;function E(){return(this.red?""}var P=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],O=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function H(c,u,d){d.negative=u.negative^c.negative;var m=c.length+u.length|0;d.length=m,m=m-1|0;var w=0|c.words[0],p=0|u.words[0],s=w*p,$=s/67108864|0;d.words[0]=67108863&s;for(var k=1;k>>26,he=67108863&$,be=Math.min(k,u.length-1),ge=Math.max(0,k-c.length+1);ge<=be;ge++)q+=(s=(w=0|c.words[k-ge|0])*(p=0|u.words[ge])+he)/67108864|0,he=67108863&s;d.words[k]=0|he,$=0|q}return 0!==$?d.words[k]=0|$:d.length--,d._strip()}f.prototype.toString=function(u,d){var m;if(d=0|d||1,16===(u=u||10)||"hex"===u){m="";for(var w=0,p=0,s=0;s>>24-w&16777215)||s!==this.length-1?P[6-$.length]+$+m:$+m,(w+=2)>=26&&(w-=26,s--)}for(0!==p&&(m=p.toString(16)+m);m.length%d!=0;)m="0"+m;return 0!==this.negative&&(m="-"+m),m}if(u===(0|u)&&u>=2&&u<=36){var k=A[u],q=O[u];m="";var he=this.clone();for(he.negative=0;!he.isZero();){var be=he.modrn(q).toString(u);m=(he=he.idivn(q)).isZero()?be+m:P[k-be.length]+be+m}for(this.isZero()&&(m="0"+m);m.length%d!=0;)m="0"+m;return 0!==this.negative&&(m="-"+m),m}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var u=this.words[0];return 2===this.length?u+=67108864*this.words[1]:3===this.length&&1===this.words[2]?u+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-u:u},f.prototype.toJSON=function(){return this.toString(16,2)},M&&(f.prototype.toBuffer=function(u,d){return this.toArrayLike(M,u,d)}),f.prototype.toArray=function(u,d){return this.toArrayLike(Array,u,d)},f.prototype.toArrayLike=function(u,d,m){this._strip();var w=this.byteLength(),p=m||Math.max(1,w);S(w<=p,"byte array longer than desired length"),S(p>0,"Requested array length <= 0");var s=function(u,d){return u.allocUnsafe?u.allocUnsafe(d):new u(d)}(u,p);return this["_toArrayLike"+("le"===d?"LE":"BE")](s,w),s},f.prototype._toArrayLikeLE=function(u,d){for(var m=0,w=0,p=0,s=0;p>8&255),m>16&255),6===s?(m>24&255),w=0,s=0):(w=g>>>24,s+=2)}if(m=0&&(u[m--]=g>>8&255),m>=0&&(u[m--]=g>>16&255),6===s?(m>=0&&(u[m--]=g>>24&255),w=0,s=0):(w=g>>>24,s+=2)}if(m>=0)for(u[m--]=w;m>=0;)u[m--]=0},f.prototype._countBits=Math.clz32?function(u){return 32-Math.clz32(u)}:function(u){var d=u,m=0;return d>=4096&&(m+=13,d>>>=13),d>=64&&(m+=7,d>>>=7),d>=8&&(m+=4,d>>>=4),d>=2&&(m+=2,d>>>=2),m+d},f.prototype._zeroBits=function(u){if(0===u)return 26;var d=u,m=0;return 0==(8191&d)&&(m+=13,d>>>=13),0==(127&d)&&(m+=7,d>>>=7),0==(15&d)&&(m+=4,d>>>=4),0==(3&d)&&(m+=2,d>>>=2),0==(1&d)&&m++,m},f.prototype.bitLength=function(){var d=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+d},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,d=0;du.length?this.clone().ior(u):u.clone().ior(this)},f.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},f.prototype.iuand=function(u){var d;d=this.length>u.length?u:this;for(var m=0;mu.length?this.clone().iand(u):u.clone().iand(this)},f.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},f.prototype.iuxor=function(u){var d,m;this.length>u.length?(d=this,m=u):(d=u,m=this);for(var w=0;wu.length?this.clone().ixor(u):u.clone().ixor(this)},f.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},f.prototype.inotn=function(u){S("number"==typeof u&&u>=0);var d=0|Math.ceil(u/26),m=u%26;this._expand(d),m>0&&d--;for(var w=0;w0&&(this.words[w]=~this.words[w]&67108863>>26-m),this._strip()},f.prototype.notn=function(u){return this.clone().inotn(u)},f.prototype.setn=function(u,d){S("number"==typeof u&&u>=0);var m=u/26|0,w=u%26;return this._expand(m+1),this.words[m]=d?this.words[m]|1<u.length?(m=this,w=u):(m=u,w=this);for(var p=0,s=0;s>>26;for(;0!==p&&s>>26;if(this.length=m.length,0!==p)this.words[this.length]=p,this.length++;else if(m!==this)for(;su.length?this.clone().iadd(u):u.clone().iadd(this)},f.prototype.isub=function(u){if(0!==u.negative){u.negative=0;var d=this.iadd(u);return u.negative=1,d._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var w,p,m=this.cmp(u);if(0===m)return this.negative=0,this.length=1,this.words[0]=0,this;m>0?(w=this,p=u):(w=u,p=this);for(var s=0,g=0;g>26,this.words[g]=67108863&d;for(;0!==s&&g>26,this.words[g]=67108863&d;if(0===s&&g>>13,fe=0|w[1],se=8191&fe,ce=fe>>>13,ee=0|w[2],pe=8191&ee,ue=ee>>>13,_e=0|w[3],Me=8191&_e,le=_e>>>13,ie=0|w[4],Y=8191&ie,ae=ie>>>13,Le=0|w[5],xe=8191&Le,Ce=Le>>>13,Re=0|w[6],we=8191&Re,Oe=Re>>>13,wt=0|w[7],Be=8191&wt,oe=wt>>>13,te=0|w[8],W=8191&te,de=te>>>13,Pe=0|w[9],Ee=8191&Pe,Ae=Pe>>>13,St=0|p[0],Xe=8191&St,Je=St>>>13,kt=0|p[1],Ye=8191&kt,tt=kt>>>13,Dn=0|p[2],nt=8191&Dn,ht=Dn>>>13,ln=0|p[3],We=8191&ln,ze=ln>>>13,un=0|p[4],at=8191&un,Ne=un>>>13,Xt=0|p[5],$e=8191&Xt,et=Xt>>>13,pn=0|p[6],lt=8191&pn,ut=pn>>>13,cn=0|p[7],it=8191&cn,ct=cn>>>13,gn=0|p[8],mt=8191&gn,pt=gn>>>13,Xn=0|p[9],Qt=8191&Xn,Jt=Xn>>>13;m.negative=u.negative^d.negative,m.length=19;var jn=(g+($=Math.imul(be,Xe))|0)+((8191&(k=(k=Math.imul(be,Je))+Math.imul(ge,Xe)|0))<<13)|0;g=((q=Math.imul(ge,Je))+(k>>>13)|0)+(jn>>>26)|0,jn&=67108863,$=Math.imul(se,Xe),k=(k=Math.imul(se,Je))+Math.imul(ce,Xe)|0,q=Math.imul(ce,Je);var Bn=(g+($=$+Math.imul(be,Ye)|0)|0)+((8191&(k=(k=k+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0))<<13)|0;g=((q=q+Math.imul(ge,tt)|0)+(k>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,$=Math.imul(pe,Xe),k=(k=Math.imul(pe,Je))+Math.imul(ue,Xe)|0,q=Math.imul(ue,Je),$=$+Math.imul(se,Ye)|0,k=(k=k+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,q=q+Math.imul(ce,tt)|0;var $n=(g+($=$+Math.imul(be,nt)|0)|0)+((8191&(k=(k=k+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0))<<13)|0;g=((q=q+Math.imul(ge,ht)|0)+(k>>>13)|0)+($n>>>26)|0,$n&=67108863,$=Math.imul(Me,Xe),k=(k=Math.imul(Me,Je))+Math.imul(le,Xe)|0,q=Math.imul(le,Je),$=$+Math.imul(pe,Ye)|0,k=(k=k+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,q=q+Math.imul(ue,tt)|0,$=$+Math.imul(se,nt)|0,k=(k=k+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,q=q+Math.imul(ce,ht)|0;var Ln=(g+($=$+Math.imul(be,We)|0)|0)+((8191&(k=(k=k+Math.imul(be,ze)|0)+Math.imul(ge,We)|0))<<13)|0;g=((q=q+Math.imul(ge,ze)|0)+(k>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,$=Math.imul(Y,Xe),k=(k=Math.imul(Y,Je))+Math.imul(ae,Xe)|0,q=Math.imul(ae,Je),$=$+Math.imul(Me,Ye)|0,k=(k=k+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,q=q+Math.imul(le,tt)|0,$=$+Math.imul(pe,nt)|0,k=(k=k+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,q=q+Math.imul(ue,ht)|0,$=$+Math.imul(se,We)|0,k=(k=k+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,q=q+Math.imul(ce,ze)|0;var zn=(g+($=$+Math.imul(be,at)|0)|0)+((8191&(k=(k=k+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0))<<13)|0;g=((q=q+Math.imul(ge,Ne)|0)+(k>>>13)|0)+(zn>>>26)|0,zn&=67108863,$=Math.imul(xe,Xe),k=(k=Math.imul(xe,Je))+Math.imul(Ce,Xe)|0,q=Math.imul(Ce,Je),$=$+Math.imul(Y,Ye)|0,k=(k=k+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,q=q+Math.imul(ae,tt)|0,$=$+Math.imul(Me,nt)|0,k=(k=k+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,q=q+Math.imul(le,ht)|0,$=$+Math.imul(pe,We)|0,k=(k=k+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,q=q+Math.imul(ue,ze)|0,$=$+Math.imul(se,at)|0,k=(k=k+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,q=q+Math.imul(ce,Ne)|0;var hn=(g+($=$+Math.imul(be,$e)|0)|0)+((8191&(k=(k=k+Math.imul(be,et)|0)+Math.imul(ge,$e)|0))<<13)|0;g=((q=q+Math.imul(ge,et)|0)+(k>>>13)|0)+(hn>>>26)|0,hn&=67108863,$=Math.imul(we,Xe),k=(k=Math.imul(we,Je))+Math.imul(Oe,Xe)|0,q=Math.imul(Oe,Je),$=$+Math.imul(xe,Ye)|0,k=(k=k+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,q=q+Math.imul(Ce,tt)|0,$=$+Math.imul(Y,nt)|0,k=(k=k+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,q=q+Math.imul(ae,ht)|0,$=$+Math.imul(Me,We)|0,k=(k=k+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,q=q+Math.imul(le,ze)|0,$=$+Math.imul(pe,at)|0,k=(k=k+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,q=q+Math.imul(ue,Ne)|0,$=$+Math.imul(se,$e)|0,k=(k=k+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,q=q+Math.imul(ce,et)|0;var Lt=(g+($=$+Math.imul(be,lt)|0)|0)+((8191&(k=(k=k+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0))<<13)|0;g=((q=q+Math.imul(ge,ut)|0)+(k>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,$=Math.imul(Be,Xe),k=(k=Math.imul(Be,Je))+Math.imul(oe,Xe)|0,q=Math.imul(oe,Je),$=$+Math.imul(we,Ye)|0,k=(k=k+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,q=q+Math.imul(Oe,tt)|0,$=$+Math.imul(xe,nt)|0,k=(k=k+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,q=q+Math.imul(Ce,ht)|0,$=$+Math.imul(Y,We)|0,k=(k=k+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,q=q+Math.imul(ae,ze)|0,$=$+Math.imul(Me,at)|0,k=(k=k+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,q=q+Math.imul(le,Ne)|0,$=$+Math.imul(pe,$e)|0,k=(k=k+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,q=q+Math.imul(ue,et)|0,$=$+Math.imul(se,lt)|0,k=(k=k+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,q=q+Math.imul(ce,ut)|0;var Gn=(g+($=$+Math.imul(be,it)|0)|0)+((8191&(k=(k=k+Math.imul(be,ct)|0)+Math.imul(ge,it)|0))<<13)|0;g=((q=q+Math.imul(ge,ct)|0)+(k>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,$=Math.imul(W,Xe),k=(k=Math.imul(W,Je))+Math.imul(de,Xe)|0,q=Math.imul(de,Je),$=$+Math.imul(Be,Ye)|0,k=(k=k+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,q=q+Math.imul(oe,tt)|0,$=$+Math.imul(we,nt)|0,k=(k=k+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,q=q+Math.imul(Oe,ht)|0,$=$+Math.imul(xe,We)|0,k=(k=k+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,q=q+Math.imul(Ce,ze)|0,$=$+Math.imul(Y,at)|0,k=(k=k+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,q=q+Math.imul(ae,Ne)|0,$=$+Math.imul(Me,$e)|0,k=(k=k+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,q=q+Math.imul(le,et)|0,$=$+Math.imul(pe,lt)|0,k=(k=k+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,q=q+Math.imul(ue,ut)|0,$=$+Math.imul(se,it)|0,k=(k=k+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,q=q+Math.imul(ce,ct)|0;var Kn=(g+($=$+Math.imul(be,mt)|0)|0)+((8191&(k=(k=k+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;g=((q=q+Math.imul(ge,pt)|0)+(k>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,$=Math.imul(Ee,Xe),k=(k=Math.imul(Ee,Je))+Math.imul(Ae,Xe)|0,q=Math.imul(Ae,Je),$=$+Math.imul(W,Ye)|0,k=(k=k+Math.imul(W,tt)|0)+Math.imul(de,Ye)|0,q=q+Math.imul(de,tt)|0,$=$+Math.imul(Be,nt)|0,k=(k=k+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,q=q+Math.imul(oe,ht)|0,$=$+Math.imul(we,We)|0,k=(k=k+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,q=q+Math.imul(Oe,ze)|0,$=$+Math.imul(xe,at)|0,k=(k=k+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,q=q+Math.imul(Ce,Ne)|0,$=$+Math.imul(Y,$e)|0,k=(k=k+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,q=q+Math.imul(ae,et)|0,$=$+Math.imul(Me,lt)|0,k=(k=k+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,q=q+Math.imul(le,ut)|0,$=$+Math.imul(pe,it)|0,k=(k=k+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,q=q+Math.imul(ue,ct)|0,$=$+Math.imul(se,mt)|0,k=(k=k+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0,q=q+Math.imul(ce,pt)|0;var qn=(g+($=$+Math.imul(be,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(be,Jt)|0)+Math.imul(ge,Qt)|0))<<13)|0;g=((q=q+Math.imul(ge,Jt)|0)+(k>>>13)|0)+(qn>>>26)|0,qn&=67108863,$=Math.imul(Ee,Ye),k=(k=Math.imul(Ee,tt))+Math.imul(Ae,Ye)|0,q=Math.imul(Ae,tt),$=$+Math.imul(W,nt)|0,k=(k=k+Math.imul(W,ht)|0)+Math.imul(de,nt)|0,q=q+Math.imul(de,ht)|0,$=$+Math.imul(Be,We)|0,k=(k=k+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,q=q+Math.imul(oe,ze)|0,$=$+Math.imul(we,at)|0,k=(k=k+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,q=q+Math.imul(Oe,Ne)|0,$=$+Math.imul(xe,$e)|0,k=(k=k+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,q=q+Math.imul(Ce,et)|0,$=$+Math.imul(Y,lt)|0,k=(k=k+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,q=q+Math.imul(ae,ut)|0,$=$+Math.imul(Me,it)|0,k=(k=k+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,q=q+Math.imul(le,ct)|0,$=$+Math.imul(pe,mt)|0,k=(k=k+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0,q=q+Math.imul(ue,pt)|0;var xt=(g+($=$+Math.imul(se,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(se,Jt)|0)+Math.imul(ce,Qt)|0))<<13)|0;g=((q=q+Math.imul(ce,Jt)|0)+(k>>>13)|0)+(xt>>>26)|0,xt&=67108863,$=Math.imul(Ee,nt),k=(k=Math.imul(Ee,ht))+Math.imul(Ae,nt)|0,q=Math.imul(Ae,ht),$=$+Math.imul(W,We)|0,k=(k=k+Math.imul(W,ze)|0)+Math.imul(de,We)|0,q=q+Math.imul(de,ze)|0,$=$+Math.imul(Be,at)|0,k=(k=k+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,q=q+Math.imul(oe,Ne)|0,$=$+Math.imul(we,$e)|0,k=(k=k+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,q=q+Math.imul(Oe,et)|0,$=$+Math.imul(xe,lt)|0,k=(k=k+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,q=q+Math.imul(Ce,ut)|0,$=$+Math.imul(Y,it)|0,k=(k=k+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,q=q+Math.imul(ae,ct)|0,$=$+Math.imul(Me,mt)|0,k=(k=k+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0,q=q+Math.imul(le,pt)|0;var Wn=(g+($=$+Math.imul(pe,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(pe,Jt)|0)+Math.imul(ue,Qt)|0))<<13)|0;g=((q=q+Math.imul(ue,Jt)|0)+(k>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,$=Math.imul(Ee,We),k=(k=Math.imul(Ee,ze))+Math.imul(Ae,We)|0,q=Math.imul(Ae,ze),$=$+Math.imul(W,at)|0,k=(k=k+Math.imul(W,Ne)|0)+Math.imul(de,at)|0,q=q+Math.imul(de,Ne)|0,$=$+Math.imul(Be,$e)|0,k=(k=k+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,q=q+Math.imul(oe,et)|0,$=$+Math.imul(we,lt)|0,k=(k=k+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,q=q+Math.imul(Oe,ut)|0,$=$+Math.imul(xe,it)|0,k=(k=k+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,q=q+Math.imul(Ce,ct)|0,$=$+Math.imul(Y,mt)|0,k=(k=k+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0,q=q+Math.imul(ae,pt)|0;var jt=(g+($=$+Math.imul(Me,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(Me,Jt)|0)+Math.imul(le,Qt)|0))<<13)|0;g=((q=q+Math.imul(le,Jt)|0)+(k>>>13)|0)+(jt>>>26)|0,jt&=67108863,$=Math.imul(Ee,at),k=(k=Math.imul(Ee,Ne))+Math.imul(Ae,at)|0,q=Math.imul(Ae,Ne),$=$+Math.imul(W,$e)|0,k=(k=k+Math.imul(W,et)|0)+Math.imul(de,$e)|0,q=q+Math.imul(de,et)|0,$=$+Math.imul(Be,lt)|0,k=(k=k+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,q=q+Math.imul(oe,ut)|0,$=$+Math.imul(we,it)|0,k=(k=k+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,q=q+Math.imul(Oe,ct)|0,$=$+Math.imul(xe,mt)|0,k=(k=k+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0,q=q+Math.imul(Ce,pt)|0;var Rn=(g+($=$+Math.imul(Y,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(Y,Jt)|0)+Math.imul(ae,Qt)|0))<<13)|0;g=((q=q+Math.imul(ae,Jt)|0)+(k>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,$=Math.imul(Ee,$e),k=(k=Math.imul(Ee,et))+Math.imul(Ae,$e)|0,q=Math.imul(Ae,et),$=$+Math.imul(W,lt)|0,k=(k=k+Math.imul(W,ut)|0)+Math.imul(de,lt)|0,q=q+Math.imul(de,ut)|0,$=$+Math.imul(Be,it)|0,k=(k=k+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,q=q+Math.imul(oe,ct)|0,$=$+Math.imul(we,mt)|0,k=(k=k+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0,q=q+Math.imul(Oe,pt)|0;var Pn=(g+($=$+Math.imul(xe,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(xe,Jt)|0)+Math.imul(Ce,Qt)|0))<<13)|0;g=((q=q+Math.imul(Ce,Jt)|0)+(k>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,$=Math.imul(Ee,lt),k=(k=Math.imul(Ee,ut))+Math.imul(Ae,lt)|0,q=Math.imul(Ae,ut),$=$+Math.imul(W,it)|0,k=(k=k+Math.imul(W,ct)|0)+Math.imul(de,it)|0,q=q+Math.imul(de,ct)|0,$=$+Math.imul(Be,mt)|0,k=(k=k+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0,q=q+Math.imul(oe,pt)|0;var Fn=(g+($=$+Math.imul(we,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(we,Jt)|0)+Math.imul(Oe,Qt)|0))<<13)|0;g=((q=q+Math.imul(Oe,Jt)|0)+(k>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,$=Math.imul(Ee,it),k=(k=Math.imul(Ee,ct))+Math.imul(Ae,it)|0,q=Math.imul(Ae,ct),$=$+Math.imul(W,mt)|0,k=(k=k+Math.imul(W,pt)|0)+Math.imul(de,mt)|0,q=q+Math.imul(de,pt)|0;var Ll=(g+($=$+Math.imul(Be,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(Be,Jt)|0)+Math.imul(oe,Qt)|0))<<13)|0;g=((q=q+Math.imul(oe,Jt)|0)+(k>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,$=Math.imul(Ee,mt),k=(k=Math.imul(Ee,pt))+Math.imul(Ae,mt)|0,q=Math.imul(Ae,pt);var Ea=(g+($=$+Math.imul(W,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(W,Jt)|0)+Math.imul(de,Qt)|0))<<13)|0;g=((q=q+Math.imul(de,Jt)|0)+(k>>>13)|0)+(Ea>>>26)|0,Ea&=67108863;var ds=(g+($=Math.imul(Ee,Qt))|0)+((8191&(k=(k=Math.imul(Ee,Jt))+Math.imul(Ae,Qt)|0))<<13)|0;return g=((q=Math.imul(Ae,Jt))+(k>>>13)|0)+(ds>>>26)|0,ds&=67108863,s[0]=jn,s[1]=Bn,s[2]=$n,s[3]=Ln,s[4]=zn,s[5]=hn,s[6]=Lt,s[7]=Gn,s[8]=Kn,s[9]=qn,s[10]=xt,s[11]=Wn,s[12]=jt,s[13]=Rn,s[14]=Pn,s[15]=Fn,s[16]=Ll,s[17]=Ea,s[18]=ds,0!==g&&(s[19]=g,m.length++),m};function G(c,u,d){d.negative=u.negative^c.negative,d.length=c.length+u.length;for(var m=0,w=0,p=0;p>>26)|0)>>>26,s&=67108863}d.words[p]=g,m=s,s=w}return 0!==m?d.words[p]=m:d.length--,d._strip()}function K(c,u,d){return G(c,u,d)}function X(c,u){this.x=c,this.y=u}Math.imul||(V=H),f.prototype.mulTo=function(u,d){var w=this.length+u.length;return 10===this.length&&10===u.length?V(this,u,d):w<63?H(this,u,d):w<1024?G(this,u,d):K(this,u,d)},X.prototype.makeRBT=function(u){for(var d=new Array(u),m=f.prototype._countBits(u)-1,w=0;w>=1;return w},X.prototype.permute=function(u,d,m,w,p,s){for(var g=0;g>>=1)p++;return 1<>>=13),p>>>=13;for(s=2*d;s>=26,m+=p/67108864|0,m+=s>>>26,this.words[w]=67108863&s}return 0!==m&&(this.words[w]=m,this.length++),d?this.ineg():this},f.prototype.muln=function(u){return this.clone().imuln(u)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(u){var d=function U(c){for(var u=new Array(c.bitLength()),d=0;d>>d%26&1;return u}(u);if(0===d.length)return new f(1);for(var m=this,w=0;w=0);var p,d=u%26,m=(u-d)/26,w=67108863>>>26-d<<26-d;if(0!==d){var s=0;for(p=0;p>>26-d}s&&(this.words[p]=s,this.length++)}if(0!==m){for(p=this.length-1;p>=0;p--)this.words[p+m]=this.words[p];for(p=0;p=0),w=d?(d-d%26)/26:0;var p=u%26,s=Math.min((u-p)/26,this.length),g=67108863^67108863>>>p<s)for(this.length-=s,k=0;k=0&&(0!==q||k>=w);k--){var he=0|this.words[k];this.words[k]=q<<26-p|he>>>p,q=he&g}return $&&0!==q&&($.words[$.length++]=q),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(u,d,m){return S(0===this.negative),this.iushrn(u,d,m)},f.prototype.shln=function(u){return this.clone().ishln(u)},f.prototype.ushln=function(u){return this.clone().iushln(u)},f.prototype.shrn=function(u){return this.clone().ishrn(u)},f.prototype.ushrn=function(u){return this.clone().iushrn(u)},f.prototype.testn=function(u){S("number"==typeof u&&u>=0);var d=u%26,m=(u-d)/26;return!(this.length<=m||!(this.words[m]&1<=0);var d=u%26,m=(u-d)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=m?this:(0!==d&&m++,this.length=Math.min(m,this.length),0!==d&&(this.words[this.length-1]&=67108863^67108863>>>d<=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},f.prototype.isubn=function(u){if(S("number"==typeof u),S(u<67108864),u<0)return this.iaddn(-u);if(0!==this.negative)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d>26)-($/67108864|0),this.words[p+m]=67108863&s}for(;p>26,this.words[p+m]=67108863&s;if(0===g)return this._strip();for(S(-1===g),g=0,p=0;p>26,this.words[p]=67108863&s;return this.negative=1,this._strip()},f.prototype._wordDiv=function(u,d){var m,w=this.clone(),p=u,s=0|p.words[p.length-1];0!=(m=26-this._countBits(s))&&(p=p.ushln(m),w.iushln(m),s=0|p.words[p.length-1]);var k,$=w.length-p.length;if("mod"!==d){(k=new f(null)).length=$+1,k.words=new Array(k.length);for(var q=0;q=0;be--){var ge=67108864*(0|w.words[p.length+be])+(0|w.words[p.length+be-1]);for(ge=Math.min(ge/s|0,67108863),w._ishlnsubmul(p,ge,be);0!==w.negative;)ge--,w.negative=0,w._ishlnsubmul(p,1,be),w.isZero()||(w.negative^=1);k&&(k.words[be]=ge)}return k&&k._strip(),w._strip(),"div"!==d&&0!==m&&w.iushrn(m),{div:k||null,mod:w}},f.prototype.divmod=function(u,d,m){return S(!u.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===u.negative?(s=this.neg().divmod(u,d),"mod"!==d&&(w=s.div.neg()),"div"!==d&&(p=s.mod.neg(),m&&0!==p.negative&&p.iadd(u)),{div:w,mod:p}):0===this.negative&&0!==u.negative?(s=this.divmod(u.neg(),d),"mod"!==d&&(w=s.div.neg()),{div:w,mod:s.mod}):0!=(this.negative&u.negative)?(s=this.neg().divmod(u.neg(),d),"div"!==d&&(p=s.mod.neg(),m&&0!==p.negative&&p.isub(u)),{div:s.div,mod:p}):u.length>this.length||this.cmp(u)<0?{div:new f(0),mod:this}:1===u.length?"div"===d?{div:this.divn(u.words[0]),mod:null}:"mod"===d?{div:null,mod:new f(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new f(this.modrn(u.words[0]))}:this._wordDiv(u,d);var w,p,s},f.prototype.div=function(u){return this.divmod(u,"div",!1).div},f.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},f.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},f.prototype.divRound=function(u){var d=this.divmod(u);if(d.mod.isZero())return d.div;var m=0!==d.div.negative?d.mod.isub(u):d.mod,w=u.ushrn(1),p=u.andln(1),s=m.cmp(w);return s<0||1===p&&0===s?d.div:0!==d.div.negative?d.div.isubn(1):d.div.iaddn(1)},f.prototype.modrn=function(u){var d=u<0;d&&(u=-u),S(u<=67108863);for(var m=(1<<26)%u,w=0,p=this.length-1;p>=0;p--)w=(m*w+(0|this.words[p]))%u;return d?-w:w},f.prototype.modn=function(u){return this.modrn(u)},f.prototype.idivn=function(u){var d=u<0;d&&(u=-u),S(u<=67108863);for(var m=0,w=this.length-1;w>=0;w--){var p=(0|this.words[w])+67108864*m;this.words[w]=p/u|0,m=p%u}return this._strip(),d?this.ineg():this},f.prototype.divn=function(u){return this.clone().idivn(u)},f.prototype.egcd=function(u){S(0===u.negative),S(!u.isZero());var d=this,m=u.clone();d=0!==d.negative?d.umod(u):d.clone();for(var w=new f(1),p=new f(0),s=new f(0),g=new f(1),$=0;d.isEven()&&m.isEven();)d.iushrn(1),m.iushrn(1),++$;for(var k=m.clone(),q=d.clone();!d.isZero();){for(var he=0,be=1;0==(d.words[0]&be)&&he<26;++he,be<<=1);if(he>0)for(d.iushrn(he);he-- >0;)(w.isOdd()||p.isOdd())&&(w.iadd(k),p.isub(q)),w.iushrn(1),p.iushrn(1);for(var ge=0,fe=1;0==(m.words[0]&fe)&&ge<26;++ge,fe<<=1);if(ge>0)for(m.iushrn(ge);ge-- >0;)(s.isOdd()||g.isOdd())&&(s.iadd(k),g.isub(q)),s.iushrn(1),g.iushrn(1);d.cmp(m)>=0?(d.isub(m),w.isub(s),p.isub(g)):(m.isub(d),s.isub(w),g.isub(p))}return{a:s,b:g,gcd:m.iushln($)}},f.prototype._invmp=function(u){S(0===u.negative),S(!u.isZero());var he,d=this,m=u.clone();d=0!==d.negative?d.umod(u):d.clone();for(var w=new f(1),p=new f(0),s=m.clone();d.cmpn(1)>0&&m.cmpn(1)>0;){for(var g=0,$=1;0==(d.words[0]&$)&&g<26;++g,$<<=1);if(g>0)for(d.iushrn(g);g-- >0;)w.isOdd()&&w.iadd(s),w.iushrn(1);for(var k=0,q=1;0==(m.words[0]&q)&&k<26;++k,q<<=1);if(k>0)for(m.iushrn(k);k-- >0;)p.isOdd()&&p.iadd(s),p.iushrn(1);d.cmp(m)>=0?(d.isub(m),w.isub(p)):(m.isub(d),p.isub(w))}return(he=0===d.cmpn(1)?w:p).cmpn(0)<0&&he.iadd(u),he},f.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var d=this.clone(),m=u.clone();d.negative=0,m.negative=0;for(var w=0;d.isEven()&&m.isEven();w++)d.iushrn(1),m.iushrn(1);for(;;){for(;d.isEven();)d.iushrn(1);for(;m.isEven();)m.iushrn(1);var p=d.cmp(m);if(p<0){var s=d;d=m,m=s}else if(0===p||0===m.cmpn(1))break;d.isub(m)}return m.iushln(w)},f.prototype.invm=function(u){return this.egcd(u).a.umod(u)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(u){return this.words[0]&u},f.prototype.bincn=function(u){S("number"==typeof u);var d=u%26,m=(u-d)/26,w=1<>>26,this.words[s]=g&=67108863}return 0!==p&&(this.words[s]=p,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(u){var m,d=u<0;if(0!==this.negative&&!d)return-1;if(0===this.negative&&d)return 1;if(this._strip(),this.length>1)m=1;else{d&&(u=-u),S(u<=67108863,"Number is too big");var w=0|this.words[0];m=w===u?0:wu.length)return 1;if(this.length=0;m--){var w=0|this.words[m],p=0|u.words[m];if(w!==p){wp&&(d=1);break}}return d},f.prototype.gtn=function(u){return 1===this.cmpn(u)},f.prototype.gt=function(u){return 1===this.cmp(u)},f.prototype.gten=function(u){return this.cmpn(u)>=0},f.prototype.gte=function(u){return this.cmp(u)>=0},f.prototype.ltn=function(u){return-1===this.cmpn(u)},f.prototype.lt=function(u){return-1===this.cmp(u)},f.prototype.lten=function(u){return this.cmpn(u)<=0},f.prototype.lte=function(u){return this.cmp(u)<=0},f.prototype.eqn=function(u){return 0===this.cmpn(u)},f.prototype.eq=function(u){return 0===this.cmp(u)},f.red=function(u){return new o(u)},f.prototype.toRed=function(u){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),u.convertTo(this)._forceRed(u)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(u){return this.red=u,this},f.prototype.forceRed=function(u){return S(!this.red,"Already a number in reduction context"),this._forceRed(u)},f.prototype.redAdd=function(u){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},f.prototype.redIAdd=function(u){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},f.prototype.redSub=function(u){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},f.prototype.redISub=function(u){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},f.prototype.redShl=function(u){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},f.prototype.redMul=function(u){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},f.prototype.redIMul=function(u){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(u){return S(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var Z={k256:null,p224:null,p192:null,p25519:null};function z(c,u){this.name=c,this.p=new f(u,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function J(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function re(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function ve(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function o(c){if("string"==typeof c){var u=f._prime(c);this.m=u.p,this.prime=u}else S(c.gtn(1),"modulus must be greater than 1"),this.m=c,this.prime=null}function l(c){o.call(this,c),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}z.prototype._tmp=function(){var u=new f(null);return u.words=new Array(Math.ceil(this.n/13)),u},z.prototype.ireduce=function(u){var m,d=u;do{this.split(d,this.tmp),m=(d=(d=this.imulK(d)).iadd(this.tmp)).bitLength()}while(m>this.n);var w=m0?d.isub(this.p):void 0!==d.strip?d.strip():d._strip(),d},z.prototype.split=function(u,d){u.iushrn(this.n,0,d)},z.prototype.imulK=function(u){return u.imul(this.k)},T(J,z),J.prototype.split=function(u,d){for(var m=4194303,w=Math.min(u.length,9),p=0;p>>22,s=g}u.words[p-10]=s>>>=22,u.length-=0===s&&u.length>10?10:9},J.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var d=0,m=0;m>>=26,u.words[m]=p,d=w}return 0!==d&&(u.words[u.length++]=d),u},f._prime=function(u){if(Z[u])return Z[u];var d;if("k256"===u)d=new J;else if("p224"===u)d=new re;else if("p192"===u)d=new ve;else{if("p25519"!==u)throw new Error("Unknown prime "+u);d=new y}return Z[u]=d,d},o.prototype._verify1=function(u){S(0===u.negative,"red works only with positives"),S(u.red,"red works only with red numbers")},o.prototype._verify2=function(u,d){S(0==(u.negative|d.negative),"red works only with positives"),S(u.red&&u.red===d.red,"red works only with red numbers")},o.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(x(u,u.umod(this.m)._forceRed(this)),u)},o.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},o.prototype.add=function(u,d){this._verify2(u,d);var m=u.add(d);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},o.prototype.iadd=function(u,d){this._verify2(u,d);var m=u.iadd(d);return m.cmp(this.m)>=0&&m.isub(this.m),m},o.prototype.sub=function(u,d){this._verify2(u,d);var m=u.sub(d);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},o.prototype.isub=function(u,d){this._verify2(u,d);var m=u.isub(d);return m.cmpn(0)<0&&m.iadd(this.m),m},o.prototype.shl=function(u,d){return this._verify1(u),this.imod(u.ushln(d))},o.prototype.imul=function(u,d){return this._verify2(u,d),this.imod(u.imul(d))},o.prototype.mul=function(u,d){return this._verify2(u,d),this.imod(u.mul(d))},o.prototype.isqr=function(u){return this.imul(u,u.clone())},o.prototype.sqr=function(u){return this.mul(u,u)},o.prototype.sqrt=function(u){if(u.isZero())return u.clone();var d=this.m.andln(3);if(S(d%2==1),3===d){var m=this.m.add(new f(1)).iushrn(2);return this.pow(u,m)}for(var w=this.m.subn(1),p=0;!w.isZero()&&0===w.andln(1);)p++,w.iushrn(1);S(!w.isZero());var s=new f(1).toRed(this),g=s.redNeg(),$=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,$).cmp(g);)k.redIAdd(g);for(var q=this.pow(k,w),he=this.pow(u,w.addn(1).iushrn(1)),be=this.pow(u,w),ge=p;0!==be.cmp(s);){for(var fe=be,se=0;0!==fe.cmp(s);se++)fe=fe.redSqr();S(se=0;p--){for(var q=d.words[p],he=k-1;he>=0;he--){var be=q>>he&1;s!==w[0]&&(s=this.sqr(s)),0!==be||0!==g?(g<<=1,g|=be,(4==++$||0===p&&0===he)&&(s=this.mul(s,w[g]),$=0,g=0)):$=0}k=26}return s},o.prototype.convertTo=function(u){var d=u.umod(this.m);return d===u?d.clone():d},o.prototype.convertFrom=function(u){var d=u.clone();return d.red=null,d},f.mont=function(u){return new l(u)},T(l,o),l.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},l.prototype.convertFrom=function(u){var d=this.imod(u.mul(this.rinv));return d.red=null,d},l.prototype.imul=function(u,d){if(u.isZero()||d.isZero())return u.words[0]=0,u.length=1,u;var m=u.imul(d),w=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=m.isub(w).iushrn(this.shift),s=p;return p.cmp(this.m)>=0?s=p.isub(this.m):p.cmpn(0)<0&&(s=p.iadd(this.m)),s._forceRed(this)},l.prototype.mul=function(u,d){if(u.isZero()||d.isZero())return new f(0)._forceRed(this);var m=u.mul(d),w=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=m.isub(w).iushrn(this.shift),s=p;return p.cmp(this.m)>=0?s=p.isub(this.m):p.cmpn(0)<0&&(s=p.iadd(this.m)),s._forceRed(this)},l.prototype.invm=function(u){return this.imod(u._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},7950:(ne,F,I)=>{var R;function B(T){this.rand=T}if(ne.exports=function(f){return R||(R=new B(null)),R.generate(f)},ne.exports.Rand=B,B.prototype.generate=function(f){return this._rand(f)},B.prototype._rand=function(f){if(this.rand.getBytes)return this.rand.getBytes(f);for(var M=new Uint8Array(f),_=0;_{var R=I(3502).Buffer;function B(b){R.isBuffer(b)||(b=R.from(b));for(var C=b.length/4|0,x=new Array(C),E=0;E>>24]^O[V>>>16&255]^N[G>>>8&255]^U[255&K]^C[re++],Z=A[V>>>24]^O[G>>>16&255]^N[K>>>8&255]^U[255&H]^C[re++],z=A[G>>>24]^O[K>>>16&255]^N[H>>>8&255]^U[255&V]^C[re++],J=A[K>>>24]^O[H>>>16&255]^N[V>>>8&255]^U[255&G]^C[re++],H=X,V=Z,G=z,K=J;return X=(E[H>>>24]<<24|E[V>>>16&255]<<16|E[G>>>8&255]<<8|E[255&K])^C[re++],Z=(E[V>>>24]<<24|E[G>>>16&255]<<16|E[K>>>8&255]<<8|E[255&H])^C[re++],z=(E[G>>>24]<<24|E[K>>>16&255]<<16|E[H>>>8&255]<<8|E[255&V])^C[re++],J=(E[K>>>24]<<24|E[H>>>16&255]<<16|E[V>>>8&255]<<8|E[255&G])^C[re++],[X>>>=0,Z>>>=0,z>>>=0,J>>>=0]}var f=[0,1,2,4,8,16,32,64,128,27,54],M=function(){for(var b=new Array(256),C=0;C<256;C++)b[C]=C<128?C<<1:C<<1^283;for(var x=[],E=[],P=[[],[],[],[]],A=[[],[],[],[]],O=0,N=0,U=0;U<256;++U){var H=N^N<<1^N<<2^N<<3^N<<4;x[O]=H=H>>>8^255&H^99,E[H]=O;var V=b[O],G=b[V],K=b[G],X=257*b[H]^16843008*H;P[0][O]=X<<24|X>>>8,P[1][O]=X<<16|X>>>16,P[2][O]=X<<8|X>>>24,P[3][O]=X,A[0][H]=(X=16843009*K^65537*G^257*V^16843008*O)<<24|X>>>8,A[1][H]=X<<16|X>>>16,A[2][H]=X<<8|X>>>24,A[3][H]=X,0===O?O=N=1:(O=V^b[b[b[K^V]]],N^=b[b[N]])}return{SBOX:x,INV_SBOX:E,SUB_MIX:P,INV_SUB_MIX:A}}();function _(b){this._key=B(b),this._reset()}_.blockSize=16,_.keySize=32,_.prototype.blockSize=_.blockSize,_.prototype.keySize=_.keySize,_.prototype._reset=function(){for(var b=this._key,C=b.length,x=C+6,E=4*(x+1),P=[],A=0;A>>24)>>>24]<<24|M.SBOX[O>>>16&255]<<16|M.SBOX[O>>>8&255]<<8|M.SBOX[255&O],O^=f[A/C|0]<<24):C>6&&A%C==4&&(O=M.SBOX[O>>>24]<<24|M.SBOX[O>>>16&255]<<16|M.SBOX[O>>>8&255]<<8|M.SBOX[255&O]),P[A]=P[A-C]^O}for(var N=[],U=0;U>>24]]^M.INV_SUB_MIX[1][M.SBOX[V>>>16&255]]^M.INV_SUB_MIX[2][M.SBOX[V>>>8&255]]^M.INV_SUB_MIX[3][M.SBOX[255&V]]}this._nRounds=x,this._keySchedule=P,this._invKeySchedule=N},_.prototype.encryptBlockRaw=function(b){return T(b=B(b),this._keySchedule,M.SUB_MIX,M.SBOX,this._nRounds)},_.prototype.encryptBlock=function(b){var C=this.encryptBlockRaw(b),x=R.allocUnsafe(16);return x.writeUInt32BE(C[0],0),x.writeUInt32BE(C[1],4),x.writeUInt32BE(C[2],8),x.writeUInt32BE(C[3],12),x},_.prototype.decryptBlock=function(b){var C=(b=B(b))[1];b[1]=b[3],b[3]=C;var x=T(b,this._invKeySchedule,M.INV_SUB_MIX,M.INV_SBOX,this._nRounds),E=R.allocUnsafe(16);return E.writeUInt32BE(x[0],0),E.writeUInt32BE(x[3],4),E.writeUInt32BE(x[2],8),E.writeUInt32BE(x[1],12),E},_.prototype.scrub=function(){S(this._keySchedule),S(this._invKeySchedule),S(this._key)},ne.exports.AES=_},9382:(ne,F,I)=>{var R=I(1899),B=I(3502).Buffer,S=I(1052),T=I(3894),f=I(8857),M=I(8789),_=I(7968);function x(E,P,A,O){S.call(this);var N=B.alloc(4,0);this._cipher=new R.AES(P);var U=this._cipher.encryptBlock(N);this._ghash=new f(U),A=function C(E,P,A){if(12===P.length)return E._finID=B.concat([P,B.from([0,0,0,1])]),B.concat([P,B.from([0,0,0,2])]);var O=new f(A),N=P.length,U=N%16;O.update(P),U&&O.update(B.alloc(U=16-U,0)),O.update(B.alloc(8,0));var H=8*N,V=B.alloc(8);V.writeUIntBE(H,0,8),O.update(V),E._finID=O.state;var G=B.from(E._finID);return _(G),G}(this,A,U),this._prev=B.from(A),this._cache=B.allocUnsafe(0),this._secCache=B.allocUnsafe(0),this._decrypt=O,this._alen=0,this._len=0,this._mode=E,this._authTag=null,this._called=!1}T(x,S),x.prototype._update=function(E){if(!this._called&&this._alen){var P=16-this._alen%16;P<16&&(P=B.alloc(P,0),this._ghash.update(P))}this._called=!0;var A=this._mode.encrypt(this,E);return this._ghash.update(this._decrypt?E:A),this._len+=E.length,A},x.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var E=M(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function b(E,P){var A=0;E.length!==P.length&&A++;for(var O=Math.min(E.length,P.length),N=0;N{var R=I(6900),B=I(856),S=I(4946);F.createCipher=F.Cipher=R.createCipher,F.createCipheriv=F.Cipheriv=R.createCipheriv,F.createDecipher=F.Decipher=B.createDecipher,F.createDecipheriv=F.Decipheriv=B.createDecipheriv,F.listCiphers=F.getCiphers=function T(){return Object.keys(S)}},856:(ne,F,I)=>{var R=I(9382),B=I(3502).Buffer,S=I(9171),T=I(8441),f=I(1052),M=I(1899),_=I(347);function C(O,N,U){f.call(this),this._cache=new x,this._last=void 0,this._cipher=new M.AES(N),this._prev=B.from(U),this._mode=O,this._autopadding=!0}function x(){this.cache=B.allocUnsafe(0)}function P(O,N,U){var H=S[O.toLowerCase()];if(!H)throw new TypeError("invalid suite type");if("string"==typeof U&&(U=B.from(U)),"GCM"!==H.mode&&U.length!==H.iv)throw new TypeError("invalid iv length "+U.length);if("string"==typeof N&&(N=B.from(N)),N.length!==H.key/8)throw new TypeError("invalid key length "+N.length);return"stream"===H.type?new T(H.module,N,U,!0):"auth"===H.type?new R(H.module,N,U,!0):new C(H.module,N,U)}I(3894)(C,f),C.prototype._update=function(O){this._cache.add(O);for(var N,U,H=[];N=this._cache.get(this._autopadding);)U=this._mode.decrypt(this,N),H.push(U);return B.concat(H)},C.prototype._final=function(){var O=this._cache.flush();if(this._autopadding)return function E(O){var N=O[15];if(N<1||N>16)throw new Error("unable to decrypt data");for(var U=-1;++U16)return N=this.cache.slice(0,16),this.cache=this.cache.slice(16),N}else if(this.cache.length>=16)return N=this.cache.slice(0,16),this.cache=this.cache.slice(16),N;return null},x.prototype.flush=function(){if(this.cache.length)return this.cache},F.createDecipher=function A(O,N){var U=S[O.toLowerCase()];if(!U)throw new TypeError("invalid suite type");var H=_(N,!1,U.key,U.iv);return P(O,H.key,H.iv)},F.createDecipheriv=P},6900:(ne,F,I)=>{var R=I(9171),B=I(9382),S=I(3502).Buffer,T=I(8441),f=I(1052),M=I(1899),_=I(347);function C(O,N,U){f.call(this),this._cache=new E,this._cipher=new M.AES(N),this._prev=S.from(U),this._mode=O,this._autopadding=!0}I(3894)(C,f),C.prototype._update=function(O){this._cache.add(O);for(var N,U,H=[];N=this._cache.get();)U=this._mode.encrypt(this,N),H.push(U);return S.concat(H)};var x=S.alloc(16,16);function E(){this.cache=S.allocUnsafe(0)}function P(O,N,U){var H=R[O.toLowerCase()];if(!H)throw new TypeError("invalid suite type");if("string"==typeof N&&(N=S.from(N)),N.length!==H.key/8)throw new TypeError("invalid key length "+N.length);if("string"==typeof U&&(U=S.from(U)),"GCM"!==H.mode&&U.length!==H.iv)throw new TypeError("invalid iv length "+U.length);return"stream"===H.type?new T(H.module,N,U):"auth"===H.type?new B(H.module,N,U):new C(H.module,N,U)}C.prototype._final=function(){var O=this._cache.flush();if(this._autopadding)return O=this._mode.encrypt(this,O),this._cipher.scrub(),O;if(!O.equals(x))throw this._cipher.scrub(),new Error("data not multiple of block length")},C.prototype.setAutoPadding=function(O){return this._autopadding=!!O,this},E.prototype.add=function(O){this.cache=S.concat([this.cache,O])},E.prototype.get=function(){if(this.cache.length>15){var O=this.cache.slice(0,16);return this.cache=this.cache.slice(16),O}return null},E.prototype.flush=function(){for(var O=16-this.cache.length,N=S.allocUnsafe(O),U=-1;++U{var R=I(3502).Buffer,B=R.alloc(16,0);function T(M){var _=R.allocUnsafe(16);return _.writeUInt32BE(M[0]>>>0,0),_.writeUInt32BE(M[1]>>>0,4),_.writeUInt32BE(M[2]>>>0,8),_.writeUInt32BE(M[3]>>>0,12),_}function f(M){this.h=M,this.state=R.alloc(16,0),this.cache=R.allocUnsafe(0)}f.prototype.ghash=function(M){for(var _=-1;++_0;b--)M[b]=M[b]>>>1|(1&M[b-1])<<31;M[0]=M[0]>>>1,x&&(M[0]=M[0]^225<<24)}this.state=T(_)},f.prototype.update=function(M){this.cache=R.concat([this.cache,M]);for(var _;this.cache.length>=16;)_=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(_)},f.prototype.final=function(M,_){return this.cache.length&&this.ghash(R.concat([this.cache,B],16)),this.ghash(T([0,M,0,_])),this.state},ne.exports=f},7968:ne=>{ne.exports=function F(I){for(var B,R=I.length;R--;){if(255!==(B=I.readUInt8(R))){B++,I.writeUInt8(B,R);break}I.writeUInt8(0,R)}}},4903:(ne,F,I)=>{var R=I(8789);F.encrypt=function(B,S){var T=R(S,B._prev);return B._prev=B._cipher.encryptBlock(T),B._prev},F.decrypt=function(B,S){var T=B._prev;B._prev=S;var f=B._cipher.decryptBlock(S);return R(f,T)}},9885:(ne,F,I)=>{var R=I(3502).Buffer,B=I(8789);function S(T,f,M){var _=f.length,b=B(f,T._cache);return T._cache=T._cache.slice(_),T._prev=R.concat([T._prev,M?f:b]),b}F.encrypt=function(T,f,M){for(var b,_=R.allocUnsafe(0);f.length;){if(0===T._cache.length&&(T._cache=T._cipher.encryptBlock(T._prev),T._prev=R.allocUnsafe(0)),!(T._cache.length<=f.length)){_=R.concat([_,S(T,f,M)]);break}_=R.concat([_,S(T,f.slice(0,b=T._cache.length),M)]),f=f.slice(b)}return _}},6531:(ne,F,I)=>{var R=I(3502).Buffer;function B(T,f,M){for(var E,P,b=-1,x=0;++b<8;)x+=(128&(P=T._cipher.encryptBlock(T._prev)[0]^(E=f&1<<7-b?128:0)))>>b%8,T._prev=S(T._prev,M?E:P);return x}function S(T,f){var M=T.length,_=-1,b=R.allocUnsafe(T.length);for(T=R.concat([T,R.from([f])]);++_>7;return b}F.encrypt=function(T,f,M){for(var _=f.length,b=R.allocUnsafe(_),C=-1;++C<_;)b[C]=B(T,f[C],M);return b}},1641:(ne,F,I)=>{var R=I(3502).Buffer;function B(S,T,f){var _=S._cipher.encryptBlock(S._prev)[0]^T;return S._prev=R.concat([S._prev.slice(1),R.from([f?T:_])]),_}F.encrypt=function(S,T,f){for(var M=T.length,_=R.allocUnsafe(M),b=-1;++b{var R=I(8789),B=I(3502).Buffer,S=I(7968);function T(M){var _=M._cipher.encryptBlockRaw(M._prev);return S(M._prev),_}F.encrypt=function(M,_){var b=Math.ceil(_.length/16),C=M._cache.length;M._cache=B.concat([M._cache,B.allocUnsafe(16*b)]);for(var x=0;x{F.encrypt=function(I,R){return I._cipher.encryptBlock(R)},F.decrypt=function(I,R){return I._cipher.decryptBlock(R)}},9171:(ne,F,I)=>{var R={ECB:I(1704),CBC:I(4903),CFB:I(9885),CFB8:I(1641),CFB1:I(6531),OFB:I(6816),CTR:I(1150),GCM:I(1150)},B=I(4946);for(var S in B)B[S].module=R[B[S].mode];ne.exports=B},6816:(ne,F,I)=>{var R=I(8789);function B(S){return S._prev=S._cipher.encryptBlock(S._prev),S._prev}F.encrypt=function(S,T){for(;S._cache.length{var R=I(1899),B=I(3502).Buffer,S=I(1052);function f(M,_,b,C){S.call(this),this._cipher=new R.AES(_),this._prev=B.from(b),this._cache=B.allocUnsafe(0),this._secCache=B.allocUnsafe(0),this._decrypt=C,this._mode=M}I(3894)(f,S),f.prototype._update=function(M){return this._mode.encrypt(this,M,this._decrypt)},f.prototype._final=function(){this._cipher.scrub()},ne.exports=f},5255:(ne,F,I)=>{var R=I(9004),B=I(4330),S=I(9171),T=I(1115),f=I(347);function b(E,P,A){if(E=E.toLowerCase(),S[E])return B.createCipheriv(E,P,A);if(T[E])return new R({key:P,iv:A,mode:E});throw new TypeError("invalid suite type")}function C(E,P,A){if(E=E.toLowerCase(),S[E])return B.createDecipheriv(E,P,A);if(T[E])return new R({key:P,iv:A,mode:E,decrypt:!0});throw new TypeError("invalid suite type")}F.createCipher=F.Cipher=function M(E,P){var A,O;if(E=E.toLowerCase(),S[E])A=S[E].key,O=S[E].iv;else{if(!T[E])throw new TypeError("invalid suite type");A=8*T[E].key,O=T[E].iv}var N=f(P,!1,A,O);return b(E,N.key,N.iv)},F.createCipheriv=F.Cipheriv=b,F.createDecipher=F.Decipher=function _(E,P){var A,O;if(E=E.toLowerCase(),S[E])A=S[E].key,O=S[E].iv;else{if(!T[E])throw new TypeError("invalid suite type");A=8*T[E].key,O=T[E].iv}var N=f(P,!1,A,O);return C(E,N.key,N.iv)},F.createDecipheriv=F.Decipheriv=C,F.listCiphers=F.getCiphers=function x(){return Object.keys(T).concat(B.getCiphers())}},9004:(ne,F,I)=>{var R=I(1052),B=I(3684),S=I(3894),T=I(3502).Buffer,f={"des-ede3-cbc":B.CBC.instantiate(B.EDE),"des-ede3":B.EDE,"des-ede-cbc":B.CBC.instantiate(B.EDE),"des-ede":B.EDE,"des-cbc":B.CBC.instantiate(B.DES),"des-ecb":B.DES};function M(_){R.call(this);var x,b=_.mode.toLowerCase(),C=f[b];x=_.decrypt?"decrypt":"encrypt";var E=_.key;T.isBuffer(E)||(E=T.from(E)),("des-ede"===b||"des-ede-cbc"===b)&&(E=T.concat([E,E.slice(0,8)]));var P=_.iv;T.isBuffer(P)||(P=T.from(P)),this._des=C.create({key:E,iv:P,type:x})}f.des=f["des-cbc"],f.des3=f["des-ede3-cbc"],ne.exports=M,S(M,R),M.prototype._update=function(_){return T.from(this._des.update(_))},M.prototype._final=function(){return T.from(this._des.final())}},1115:(ne,F)=>{F["des-ecb"]={key:8,iv:0},F["des-cbc"]=F.des={key:8,iv:8},F["des-ede3-cbc"]=F.des3={key:24,iv:8},F["des-ede3"]={key:24,iv:0},F["des-ede-cbc"]={key:16,iv:8},F["des-ede"]={key:16,iv:0}},8466:(ne,F,I)=>{var R=I(8538),B=I(3753);function T(M){var b,_=M.modulus.byteLength();do{b=new R(B(_))}while(b.cmp(M.modulus)>=0||!b.umod(M.prime1)||!b.umod(M.prime2));return b}function f(M,_){var b=function S(M){var _=T(M);return{blinder:_.toRed(R.mont(M.modulus)).redPow(new R(M.publicExponent)).fromRed(),unblinder:_.invm(M.modulus)}}(_),C=_.modulus.byteLength(),x=new R(M).mul(b.blinder).umod(_.modulus),E=x.toRed(R.mont(_.prime1)),P=x.toRed(R.mont(_.prime2)),A=_.coefficient,O=_.prime1,N=_.prime2,U=E.redPow(_.exponent1).fromRed(),H=P.redPow(_.exponent2).fromRed(),V=U.isub(H).imul(A).umod(O).imul(N);return H.iadd(V).imul(b.unblinder).umod(_.modulus).toArrayLike(Buffer,"be",C)}f.getr=T,ne.exports=f},7793:(ne,F,I)=>{ne.exports=I(5207)},3923:(ne,F,I)=>{var R=I(3502).Buffer,B=I(6386),S=I(5685),T=I(3894),f=I(9947),M=I(3946),_=I(5207);function b(P){S.Writable.call(this);var A=_[P];if(!A)throw new Error("Unknown message digest");this._hashType=A.hash,this._hash=B(A.hash),this._tag=A.id,this._signType=A.sign}function C(P){S.Writable.call(this);var A=_[P];if(!A)throw new Error("Unknown message digest");this._hash=B(A.hash),this._tag=A.id,this._signType=A.sign}function x(P){return new b(P)}function E(P){return new C(P)}Object.keys(_).forEach(function(P){_[P].id=R.from(_[P].id,"hex"),_[P.toLowerCase()]=_[P]}),T(b,S.Writable),b.prototype._write=function(A,O,N){this._hash.update(A),N()},b.prototype.update=function(A,O){return"string"==typeof A&&(A=R.from(A,O)),this._hash.update(A),this},b.prototype.sign=function(A,O){this.end();var N=this._hash.digest(),U=f(N,A,this._hashType,this._signType,this._tag);return O?U.toString(O):U},T(C,S.Writable),C.prototype._write=function(A,O,N){this._hash.update(A),N()},C.prototype.update=function(A,O){return"string"==typeof A&&(A=R.from(A,O)),this._hash.update(A),this},C.prototype.verify=function(A,O,N){"string"==typeof O&&(O=R.from(O,N)),this.end();var U=this._hash.digest();return M(O,U,A,this._signType,this._tag)},ne.exports={Sign:x,Verify:E,createSign:x,createVerify:E}},9947:(ne,F,I)=>{var R=I(3502).Buffer,B=I(4529),S=I(8466),T=I(7715).ec,f=I(8538),M=I(2772),_=I(7036);function P(H,V,G,K){if((H=R.from(H.toArray())).length0&&G.ishrn(K),G}function N(H,V,G){var K,X;do{for(K=R.alloc(0);8*K.length{var R=I(3502).Buffer,B=I(8538),S=I(7715).ec,T=I(2772),f=I(7036);function C(x,E){if(x.cmpn(0)<=0)throw new Error("invalid sig");if(x.cmp(E)>=E)throw new Error("invalid sig")}ne.exports=function M(x,E,P,A,O){var N=T(P);if("ec"===N.type){if("ecdsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");return function _(x,E,P){var A=f[P.data.algorithm.curve.join(".")];if(!A)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));return new S(A).verify(E,x,P.data.subjectPrivateKey.data)}(x,E,N)}if("dsa"===N.type){if("dsa"!==A)throw new Error("wrong public key type");return function b(x,E,P){var A=P.data.p,O=P.data.q,N=P.data.g,U=P.data.pub_key,H=T.signature.decode(x,"der"),V=H.s,G=H.r;C(V,O),C(G,O);var K=B.mont(A),X=V.invm(O);return 0===N.toRed(K).redPow(new B(E).mul(X).mod(O)).fromRed().mul(U.toRed(K).redPow(G.mul(X).mod(O)).fromRed()).mod(A).mod(O).cmp(G)}(x,E,N)}if("rsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");E=R.concat([O,E]);for(var U=N.modulus.byteLength(),H=[1],V=0;E.length+H.length+2{var R=I(1082);ne.exports=R("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},338:(ne,F,I)=>{"use strict";var R=I(129),B=I(3502).Buffer;ne.exports=function(S){function f(b){var C=b.slice(0,-4),x=b.slice(-4),E=S(C);if(!(x[0]^E[0]|x[1]^E[1]|x[2]^E[2]|x[3]^E[3]))return C}return{encode:function T(b){var C=S(b);return R.encode(B.concat([b,C],b.length+4))},decode:function _(b){var x=f(R.decode(b));if(!x)throw new Error("Invalid checksum");return x},decodeUnsafe:function M(b){var C=R.decodeUnsafe(b);if(C)return f(C)}}}},4329:(ne,F,I)=>{"use strict";var R=I(6386),B=I(338);ne.exports=B(function S(T){var f=R("sha256").update(T).digest();return R("sha256").update(f).digest()})},8789:ne=>{ne.exports=function(I,R){for(var B=Math.min(I.length,R.length),S=new Buffer(B),T=0;T{"use strict";var R=I(5343),B=I(8461),S="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=_,F.SlowBuffer=function V(le){return+le!=le&&(le=0),_.alloc(+le)},F.INSPECT_MAX_BYTES=50;var T=2147483647;function M(le){if(le>T)throw new RangeError('The value "'+le+'" is invalid for option "size"');var ie=new Uint8Array(le);return Object.setPrototypeOf(ie,_.prototype),ie}function _(le,ie,Y){if("number"==typeof le){if("string"==typeof ie)throw new TypeError('The "string" argument must be of type string. Received type number');return E(le)}return b(le,ie,Y)}function b(le,ie,Y){if("string"==typeof le)return function P(le,ie){if(("string"!=typeof ie||""===ie)&&(ie="utf8"),!_.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);var Y=0|G(le,ie),ae=M(Y),Le=ae.write(le,ie);return Le!==Y&&(ae=ae.slice(0,Le)),ae}(le,ie);if(ArrayBuffer.isView(le))return function O(le){if(ue(le,Uint8Array)){var ie=new Uint8Array(le);return N(ie.buffer,ie.byteOffset,ie.byteLength)}return A(le)}(le);if(null==le)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le);if(ue(le,ArrayBuffer)||le&&ue(le.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(ue(le,SharedArrayBuffer)||le&&ue(le.buffer,SharedArrayBuffer)))return N(le,ie,Y);if("number"==typeof le)throw new TypeError('The "value" argument must not be of type number. Received type number');var ae=le.valueOf&&le.valueOf();if(null!=ae&&ae!==le)return _.from(ae,ie,Y);var Le=function U(le){if(_.isBuffer(le)){var ie=0|H(le.length),Y=M(ie);return 0===Y.length||le.copy(Y,0,0,ie),Y}return void 0!==le.length?"number"!=typeof le.length||_e(le.length)?M(0):A(le):"Buffer"===le.type&&Array.isArray(le.data)?A(le.data):void 0}(le);if(Le)return Le;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof le[Symbol.toPrimitive])return _.from(le[Symbol.toPrimitive]("string"),ie,Y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le)}function C(le){if("number"!=typeof le)throw new TypeError('"size" argument must be of type number');if(le<0)throw new RangeError('The value "'+le+'" is invalid for option "size"')}function E(le){return C(le),M(le<0?0:0|H(le))}function A(le){for(var ie=le.length<0?0:0|H(le.length),Y=M(ie),ae=0;ae=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return 0|le}function G(le,ie){if(_.isBuffer(le))return le.length;if(ArrayBuffer.isView(le)||ue(le,ArrayBuffer))return le.byteLength;if("string"!=typeof le)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof le);var Y=le.length,ae=arguments.length>2&&!0===arguments[2];if(!ae&&0===Y)return 0;for(var Le=!1;;)switch(ie){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return fe(le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*Y;case"hex":return Y>>>1;case"base64":return ee(le).length;default:if(Le)return ae?-1:fe(le).length;ie=(""+ie).toLowerCase(),Le=!0}}function K(le,ie,Y){var ae=!1;if((void 0===ie||ie<0)&&(ie=0),ie>this.length||((void 0===Y||Y>this.length)&&(Y=this.length),Y<=0)||(Y>>>=0)<=(ie>>>=0))return"";for(le||(le="utf8");;)switch(le){case"hex":return p(this,ie,Y);case"utf8":case"utf-8":return c(this,ie,Y);case"ascii":return m(this,ie,Y);case"latin1":case"binary":return w(this,ie,Y);case"base64":return l(this,ie,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,ie,Y);default:if(ae)throw new TypeError("Unknown encoding: "+le);le=(le+"").toLowerCase(),ae=!0}}function X(le,ie,Y){var ae=le[ie];le[ie]=le[Y],le[Y]=ae}function Z(le,ie,Y,ae,Le){if(0===le.length)return-1;if("string"==typeof Y?(ae=Y,Y=0):Y>2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),_e(Y=+Y)&&(Y=Le?0:le.length-1),Y<0&&(Y=le.length+Y),Y>=le.length){if(Le)return-1;Y=le.length-1}else if(Y<0){if(!Le)return-1;Y=0}if("string"==typeof ie&&(ie=_.from(ie,ae)),_.isBuffer(ie))return 0===ie.length?-1:z(le,ie,Y,ae,Le);if("number"==typeof ie)return ie&=255,"function"==typeof Uint8Array.prototype.indexOf?Le?Uint8Array.prototype.indexOf.call(le,ie,Y):Uint8Array.prototype.lastIndexOf.call(le,ie,Y):z(le,[ie],Y,ae,Le);throw new TypeError("val must be string, number or Buffer")}function z(le,ie,Y,ae,Le){var Oe,xe=1,Ce=le.length,Re=ie.length;if(void 0!==ae&&("ucs2"===(ae=String(ae).toLowerCase())||"ucs-2"===ae||"utf16le"===ae||"utf-16le"===ae)){if(le.length<2||ie.length<2)return-1;xe=2,Ce/=2,Re/=2,Y/=2}function we(te,W){return 1===xe?te[W]:te.readUInt16BE(W*xe)}if(Le){var wt=-1;for(Oe=Y;OeCe&&(Y=Ce-Re),Oe=Y;Oe>=0;Oe--){for(var Be=!0,oe=0;oeLe&&(ae=Le):ae=Le;var xe=ie.length;ae>xe/2&&(ae=xe/2);for(var Ce=0;Ce>8,xe.push(Y%256),xe.push(ae);return xe}(ie,le.length-Y),le,Y,ae)}function l(le,ie,Y){return R.fromByteArray(0===ie&&Y===le.length?le:le.slice(ie,Y))}function c(le,ie,Y){Y=Math.min(le.length,Y);for(var ae=[],Le=ie;Le239?4:xe>223?3:xe>191?2:1;if(Le+Re<=Y)switch(Re){case 1:xe<128&&(Ce=xe);break;case 2:128==(192&(we=le[Le+1]))&&(Be=(31&xe)<<6|63&we)>127&&(Ce=Be);break;case 3:Oe=le[Le+2],128==(192&(we=le[Le+1]))&&128==(192&Oe)&&(Be=(15&xe)<<12|(63&we)<<6|63&Oe)>2047&&(Be<55296||Be>57343)&&(Ce=Be);break;case 4:Oe=le[Le+2],wt=le[Le+3],128==(192&(we=le[Le+1]))&&128==(192&Oe)&&128==(192&wt)&&(Be=(15&xe)<<18|(63&we)<<12|(63&Oe)<<6|63&wt)>65535&&Be<1114112&&(Ce=Be)}null===Ce?(Ce=65533,Re=1):Ce>65535&&(ae.push((Ce-=65536)>>>10&1023|55296),Ce=56320|1023&Ce),ae.push(Ce),Le+=Re}return function d(le){var ie=le.length;if(ie<=u)return String.fromCharCode.apply(String,le);for(var Y="",ae=0;aeLe.length?_.from(Ce).copy(Le,xe):Uint8Array.prototype.set.call(Le,Ce,xe);else{if(!_.isBuffer(Ce))throw new TypeError('"list" argument must be an Array of Buffers');Ce.copy(Le,xe)}xe+=Ce.length}return Le},_.byteLength=G,_.prototype._isBuffer=!0,_.prototype.swap16=function(){var ie=this.length;if(ie%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Y=0;YY&&(ie+=" ... "),""},S&&(_.prototype[S]=_.prototype.inspect),_.prototype.compare=function(ie,Y,ae,Le,xe){if(ue(ie,Uint8Array)&&(ie=_.from(ie,ie.offset,ie.byteLength)),!_.isBuffer(ie))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ie);if(void 0===Y&&(Y=0),void 0===ae&&(ae=ie?ie.length:0),void 0===Le&&(Le=0),void 0===xe&&(xe=this.length),Y<0||ae>ie.length||Le<0||xe>this.length)throw new RangeError("out of range index");if(Le>=xe&&Y>=ae)return 0;if(Le>=xe)return-1;if(Y>=ae)return 1;if(this===ie)return 0;for(var Ce=(xe>>>=0)-(Le>>>=0),Re=(ae>>>=0)-(Y>>>=0),we=Math.min(Ce,Re),Oe=this.slice(Le,xe),wt=ie.slice(Y,ae),Be=0;Be>>=0,isFinite(ae)?(ae>>>=0,void 0===Le&&(Le="utf8")):(Le=ae,ae=void 0)}var xe=this.length-Y;if((void 0===ae||ae>xe)&&(ae=xe),ie.length>0&&(ae<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");Le||(Le="utf8");for(var Ce=!1;;)switch(Le){case"hex":return J(this,ie,Y,ae);case"utf8":case"utf-8":return re(this,ie,Y,ae);case"ascii":case"latin1":case"binary":return ve(this,ie,Y,ae);case"base64":return y(this,ie,Y,ae);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o(this,ie,Y,ae);default:if(Ce)throw new TypeError("Unknown encoding: "+Le);Le=(""+Le).toLowerCase(),Ce=!0}},_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var u=4096;function m(le,ie,Y){var ae="";Y=Math.min(le.length,Y);for(var Le=ie;Leae)&&(Y=ae);for(var Le="",xe=ie;xeY)throw new RangeError("Trying to access beyond buffer length")}function $(le,ie,Y,ae,Le,xe){if(!_.isBuffer(le))throw new TypeError('"buffer" argument must be a Buffer instance');if(ie>Le||iele.length)throw new RangeError("Index out of range")}function k(le,ie,Y,ae,Le,xe){if(Y+ae>le.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function q(le,ie,Y,ae,Le){return ie=+ie,Y>>>=0,Le||k(le,0,Y,4),B.write(le,ie,Y,ae,23,4),Y+4}function he(le,ie,Y,ae,Le){return ie=+ie,Y>>>=0,Le||k(le,0,Y,8),B.write(le,ie,Y,ae,52,8),Y+8}_.prototype.slice=function(ie,Y){var ae=this.length;(ie=~~ie)<0?(ie+=ae)<0&&(ie=0):ie>ae&&(ie=ae),(Y=void 0===Y?ae:~~Y)<0?(Y+=ae)<0&&(Y=0):Y>ae&&(Y=ae),Y>>=0,Y>>>=0,ae||g(ie,Y,this.length);for(var Le=this[ie],xe=1,Ce=0;++Ce>>=0,Y>>>=0,ae||g(ie,Y,this.length);for(var Le=this[ie+--Y],xe=1;Y>0&&(xe*=256);)Le+=this[ie+--Y]*xe;return Le},_.prototype.readUint8=_.prototype.readUInt8=function(ie,Y){return ie>>>=0,Y||g(ie,1,this.length),this[ie]},_.prototype.readUint16LE=_.prototype.readUInt16LE=function(ie,Y){return ie>>>=0,Y||g(ie,2,this.length),this[ie]|this[ie+1]<<8},_.prototype.readUint16BE=_.prototype.readUInt16BE=function(ie,Y){return ie>>>=0,Y||g(ie,2,this.length),this[ie]<<8|this[ie+1]},_.prototype.readUint32LE=_.prototype.readUInt32LE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),(this[ie]|this[ie+1]<<8|this[ie+2]<<16)+16777216*this[ie+3]},_.prototype.readUint32BE=_.prototype.readUInt32BE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),16777216*this[ie]+(this[ie+1]<<16|this[ie+2]<<8|this[ie+3])},_.prototype.readIntLE=function(ie,Y,ae){ie>>>=0,Y>>>=0,ae||g(ie,Y,this.length);for(var Le=this[ie],xe=1,Ce=0;++Ce=(xe*=128)&&(Le-=Math.pow(2,8*Y)),Le},_.prototype.readIntBE=function(ie,Y,ae){ie>>>=0,Y>>>=0,ae||g(ie,Y,this.length);for(var Le=Y,xe=1,Ce=this[ie+--Le];Le>0&&(xe*=256);)Ce+=this[ie+--Le]*xe;return Ce>=(xe*=128)&&(Ce-=Math.pow(2,8*Y)),Ce},_.prototype.readInt8=function(ie,Y){return ie>>>=0,Y||g(ie,1,this.length),128&this[ie]?-1*(255-this[ie]+1):this[ie]},_.prototype.readInt16LE=function(ie,Y){ie>>>=0,Y||g(ie,2,this.length);var ae=this[ie]|this[ie+1]<<8;return 32768&ae?4294901760|ae:ae},_.prototype.readInt16BE=function(ie,Y){ie>>>=0,Y||g(ie,2,this.length);var ae=this[ie+1]|this[ie]<<8;return 32768&ae?4294901760|ae:ae},_.prototype.readInt32LE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),this[ie]|this[ie+1]<<8|this[ie+2]<<16|this[ie+3]<<24},_.prototype.readInt32BE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),this[ie]<<24|this[ie+1]<<16|this[ie+2]<<8|this[ie+3]},_.prototype.readFloatLE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),B.read(this,ie,!0,23,4)},_.prototype.readFloatBE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),B.read(this,ie,!1,23,4)},_.prototype.readDoubleLE=function(ie,Y){return ie>>>=0,Y||g(ie,8,this.length),B.read(this,ie,!0,52,8)},_.prototype.readDoubleBE=function(ie,Y){return ie>>>=0,Y||g(ie,8,this.length),B.read(this,ie,!1,52,8)},_.prototype.writeUintLE=_.prototype.writeUIntLE=function(ie,Y,ae,Le){ie=+ie,Y>>>=0,ae>>>=0,Le||$(this,ie,Y,ae,Math.pow(2,8*ae)-1,0);var Ce=1,Re=0;for(this[Y]=255&ie;++Re>>=0,ae>>>=0,Le||$(this,ie,Y,ae,Math.pow(2,8*ae)-1,0);var Ce=ae-1,Re=1;for(this[Y+Ce]=255&ie;--Ce>=0&&(Re*=256);)this[Y+Ce]=ie/Re&255;return Y+ae},_.prototype.writeUint8=_.prototype.writeUInt8=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,1,255,0),this[Y]=255&ie,Y+1},_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,2,65535,0),this[Y]=255&ie,this[Y+1]=ie>>>8,Y+2},_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,2,65535,0),this[Y]=ie>>>8,this[Y+1]=255&ie,Y+2},_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,4,4294967295,0),this[Y+3]=ie>>>24,this[Y+2]=ie>>>16,this[Y+1]=ie>>>8,this[Y]=255&ie,Y+4},_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,4,4294967295,0),this[Y]=ie>>>24,this[Y+1]=ie>>>16,this[Y+2]=ie>>>8,this[Y+3]=255&ie,Y+4},_.prototype.writeIntLE=function(ie,Y,ae,Le){if(ie=+ie,Y>>>=0,!Le){var xe=Math.pow(2,8*ae-1);$(this,ie,Y,ae,xe-1,-xe)}var Ce=0,Re=1,we=0;for(this[Y]=255&ie;++Ce>0)-we&255;return Y+ae},_.prototype.writeIntBE=function(ie,Y,ae,Le){if(ie=+ie,Y>>>=0,!Le){var xe=Math.pow(2,8*ae-1);$(this,ie,Y,ae,xe-1,-xe)}var Ce=ae-1,Re=1,we=0;for(this[Y+Ce]=255&ie;--Ce>=0&&(Re*=256);)ie<0&&0===we&&0!==this[Y+Ce+1]&&(we=1),this[Y+Ce]=(ie/Re>>0)-we&255;return Y+ae},_.prototype.writeInt8=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,1,127,-128),ie<0&&(ie=255+ie+1),this[Y]=255&ie,Y+1},_.prototype.writeInt16LE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,2,32767,-32768),this[Y]=255&ie,this[Y+1]=ie>>>8,Y+2},_.prototype.writeInt16BE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,2,32767,-32768),this[Y]=ie>>>8,this[Y+1]=255&ie,Y+2},_.prototype.writeInt32LE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,4,2147483647,-2147483648),this[Y]=255&ie,this[Y+1]=ie>>>8,this[Y+2]=ie>>>16,this[Y+3]=ie>>>24,Y+4},_.prototype.writeInt32BE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,4,2147483647,-2147483648),ie<0&&(ie=4294967295+ie+1),this[Y]=ie>>>24,this[Y+1]=ie>>>16,this[Y+2]=ie>>>8,this[Y+3]=255&ie,Y+4},_.prototype.writeFloatLE=function(ie,Y,ae){return q(this,ie,Y,!0,ae)},_.prototype.writeFloatBE=function(ie,Y,ae){return q(this,ie,Y,!1,ae)},_.prototype.writeDoubleLE=function(ie,Y,ae){return he(this,ie,Y,!0,ae)},_.prototype.writeDoubleBE=function(ie,Y,ae){return he(this,ie,Y,!1,ae)},_.prototype.copy=function(ie,Y,ae,Le){if(!_.isBuffer(ie))throw new TypeError("argument should be a Buffer");if(ae||(ae=0),!Le&&0!==Le&&(Le=this.length),Y>=ie.length&&(Y=ie.length),Y||(Y=0),Le>0&&Le=this.length)throw new RangeError("Index out of range");if(Le<0)throw new RangeError("sourceEnd out of bounds");Le>this.length&&(Le=this.length),ie.length-Y>>=0,ae=void 0===ae?this.length:ae>>>0,ie||(ie=0),"number"==typeof ie)for(Ce=Y;Ce55295&&Y<57344){if(!Le){if(Y>56319){(ie-=3)>-1&&xe.push(239,191,189);continue}if(Ce+1===ae){(ie-=3)>-1&&xe.push(239,191,189);continue}Le=Y;continue}if(Y<56320){(ie-=3)>-1&&xe.push(239,191,189),Le=Y;continue}Y=65536+(Le-55296<<10|Y-56320)}else Le&&(ie-=3)>-1&&xe.push(239,191,189);if(Le=null,Y<128){if((ie-=1)<0)break;xe.push(Y)}else if(Y<2048){if((ie-=2)<0)break;xe.push(Y>>6|192,63&Y|128)}else if(Y<65536){if((ie-=3)<0)break;xe.push(Y>>12|224,Y>>6&63|128,63&Y|128)}else{if(!(Y<1114112))throw new Error("Invalid code point");if((ie-=4)<0)break;xe.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,63&Y|128)}}return xe}function ee(le){return R.toByteArray(function ge(le){if((le=(le=le.split("=")[0]).trim().replace(be,"")).length<2)return"";for(;le.length%4!=0;)le+="=";return le}(le))}function pe(le,ie,Y,ae){for(var Le=0;Le=ie.length||Le>=le.length);++Le)ie[Le+Y]=le[Le];return Le}function ue(le,ie){return le instanceof ie||null!=le&&null!=le.constructor&&null!=le.constructor.name&&le.constructor.name===ie.name}function _e(le){return le!=le}var Me=function(){for(var le="0123456789abcdef",ie=new Array(256),Y=0;Y<16;++Y)for(var ae=16*Y,Le=0;Le<16;++Le)ie[ae+Le]=le[Y]+le[Le];return ie}()},4525:ne=>{ne.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"}},5834:(ne,F,I)=>{"use strict";var R=I(5203),B=I(2871),S=B(R("String.prototype.indexOf"));ne.exports=function(f,M){var _=R(f,!!M);return"function"==typeof _&&S(f,".prototype.")>-1?B(_):_}},2871:(ne,F,I)=>{"use strict";var R=I(4444),B=I(5203),S=B("%Function.prototype.apply%"),T=B("%Function.prototype.call%"),f=B("%Reflect.apply%",!0)||R.call(T,S),M=B("%Object.getOwnPropertyDescriptor%",!0),_=B("%Object.defineProperty%",!0),b=B("%Math.max%");if(_)try{_({},"a",{value:1})}catch(x){_=null}ne.exports=function(E){var P=f(R,T,arguments);if(M&&_){var A=M(P,"length");A.configurable&&_(P,"length",{value:1+b(0,E.length-(arguments.length-1))})}return P};var C=function(){return f(R,S,arguments)};_?_(ne.exports,"apply",{value:C}):ne.exports.apply=C},1052:(ne,F,I)=>{var R=I(3502).Buffer,B=I(295).Transform,S=I(3054).s;function f(M){B.call(this),this.hashMode="string"==typeof M,this.hashMode?this[M]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}I(3894)(f,B),f.prototype.update=function(M,_,b){"string"==typeof M&&(M=R.from(M,_));var C=this._update(M);return this.hashMode?this:(b&&(C=this._toString(C,b)),C)},f.prototype.setAutoPadding=function(){},f.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},f.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},f.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},f.prototype._transform=function(M,_,b){var C;try{this.hashMode?this._update(M):this.push(this._update(M))}catch(x){C=x}finally{b(C)}},f.prototype._flush=function(M){var _;try{this.push(this.__final())}catch(b){_=b}M(_)},f.prototype._finalOrDigest=function(M){var _=this.__final()||R.alloc(0);return M&&(_=this._toString(_,M,!0)),_},f.prototype._toString=function(M,_,b){if(this._decoder||(this._decoder=new S(_),this._encoding=_),this._encoding!==_)throw new Error("can't switch encodings");var C=this._decoder.write(M);return b&&(C+=this._decoder.end()),C},ne.exports=f},2385:(ne,F)=>{!function(){"use strict";function I(T,f,M,_){return this instanceof I?(this.domain=T||void 0,this.path=f||"/",this.secure=!!M,this.script=!!_,this):new I(T,f,M,_)}function R(T,f,M){return T instanceof R?T:this instanceof R?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(M||"/"),this.explicit_path=!1,this.domain=f||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,T&&this.parse(T,f,M),this):new R(T,f,M)}I.All=Object.freeze(Object.create(null)),F.CookieAccessInfo=I,F.Cookie=R,R.prototype.toString=function(){var f=[this.name+"="+this.value];return this.expiration_date!==1/0&&f.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&f.push("domain="+this.domain),this.path&&f.push("path="+this.path),this.secure&&f.push("secure"),this.noscript&&f.push("httponly"),f.join("; ")},R.prototype.toValueString=function(){return this.name+"="+this.value};var B=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function S(){var T,f;return this instanceof S?(T=Object.create(null),this.setCookie=function(b,C,x){var E,P;if(E=(b=new R(b,C,x)).expiration_date<=Date.now(),void 0!==T[b.name]){for(f=T[b.name],P=0;P{var R=I(7715),B=I(6422);ne.exports=function(_){return new T(_)};var S={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function T(M){this.curveType=S[M],this.curveType||(this.curveType={name:M}),this.curve=new R.ec(this.curveType.name),this.keys=void 0}function f(M,_,b){Array.isArray(M)||(M=M.toArray());var C=new Buffer(M);if(b&&C.length=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},6386:(ne,F,I)=>{"use strict";var R=I(3894),B=I(8095),S=I(5634),T=I(5244),f=I(1052);function M(_){f.call(this,"digest"),this._hash=_}R(M,f),M.prototype._update=function(_){this._hash.update(_)},M.prototype._final=function(){return this._hash.digest()},ne.exports=function(b){return"md5"===(b=b.toLowerCase())?new B:"rmd160"===b||"ripemd160"===b?new S:new M(T(b))}},5640:(ne,F,I)=>{var R=I(8095);ne.exports=function(B){return(new R).update(B).digest()}},4529:(ne,F,I)=>{"use strict";var R=I(3894),B=I(7309),S=I(1052),T=I(3502).Buffer,f=I(5640),M=I(5634),_=I(5244),b=T.alloc(128);function C(x,E){S.call(this,"digest"),"string"==typeof E&&(E=T.from(E));var P="sha512"===x||"sha384"===x?128:64;this._alg=x,this._key=E,E.length>P?E=("rmd160"===x?new M:_(x)).update(E).digest():E.length{"use strict";var R=I(3894),B=I(3502).Buffer,S=I(1052),T=B.alloc(128),f=64;function M(_,b){S.call(this,"digest"),"string"==typeof b&&(b=B.from(b)),this._alg=_,this._key=b,b.length>f?b=_(b):b.length{"use strict";F.randomBytes=F.rng=F.pseudoRandomBytes=F.prng=I(3753),F.createHash=F.Hash=I(6386),F.createHmac=F.Hmac=I(4529);var R=I(7793),B=Object.keys(R),S=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(B);F.getHashes=function(){return S};var T=I(9357);F.pbkdf2=T.pbkdf2,F.pbkdf2Sync=T.pbkdf2Sync;var f=I(5255);F.Cipher=f.Cipher,F.createCipher=f.createCipher,F.Cipheriv=f.Cipheriv,F.createCipheriv=f.createCipheriv,F.Decipher=f.Decipher,F.createDecipher=f.createDecipher,F.Decipheriv=f.Decipheriv,F.createDecipheriv=f.createDecipheriv,F.getCiphers=f.getCiphers,F.listCiphers=f.listCiphers;var M=I(8829);F.DiffieHellmanGroup=M.DiffieHellmanGroup,F.createDiffieHellmanGroup=M.createDiffieHellmanGroup,F.getDiffieHellman=M.getDiffieHellman,F.createDiffieHellman=M.createDiffieHellman,F.DiffieHellman=M.DiffieHellman;var _=I(3923);F.createSign=_.createSign,F.Sign=_.Sign,F.createVerify=_.createVerify,F.Verify=_.Verify,F.createECDH=I(4746);var b=I(3701);F.publicEncrypt=b.publicEncrypt,F.privateEncrypt=b.privateEncrypt,F.publicDecrypt=b.publicDecrypt,F.privateDecrypt=b.privateDecrypt;var C=I(4275);F.randomFill=C.randomFill,F.randomFillSync=C.randomFillSync,F.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},F.constants={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,ALPN_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}},3684:(ne,F,I)=>{"use strict";F.utils=I(7451),F.Cipher=I(8170),F.DES=I(4631),F.CBC=I(9454),F.EDE=I(1862)},9454:(ne,F,I)=>{"use strict";var R=I(2391),B=I(3894),S={};function T(M){R.equal(M.length,8,"Invalid IV length"),this.iv=new Array(8);for(var _=0;_{"use strict";var R=I(2391);function B(S){this.options=S,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}ne.exports=B,B.prototype._init=function(){},B.prototype.update=function(T){return 0===T.length?[]:"decrypt"===this.type?this._updateDecrypt(T):this._updateEncrypt(T)},B.prototype._buffer=function(T,f){for(var M=Math.min(this.buffer.length-this.bufferOff,T.length-f),_=0;_0;_--)f+=this._buffer(T,f),M+=this._flushBuffer(b,M);return f+=this._buffer(T,f),b},B.prototype.final=function(T){var f,M;return T&&(f=this.update(T)),M="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),f?f.concat(M):M},B.prototype._pad=function(T,f){if(0===f)return!1;for(;f{"use strict";var R=I(2391),B=I(3894),S=I(7451),T=I(8170);function f(){this.tmp=new Array(2),this.keys=null}function M(b){T.call(this,b);var C=new f;this._desState=C,this.deriveKeys(C,b.key)}B(M,T),ne.exports=M,M.create=function(C){return new M(C)};var _=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];M.prototype.deriveKeys=function(C,x){C.keys=new Array(32),R.equal(x.length,this.blockSize,"Invalid key length");var E=S.readUInt32BE(x,0),P=S.readUInt32BE(x,4);S.pc1(E,P,C.tmp,0),E=C.tmp[0],P=C.tmp[1];for(var A=0;A>>1];E=S.r28shl(E,O),P=S.r28shl(P,O),S.pc2(E,P,C.keys,A)}},M.prototype._update=function(C,x,E,P){var A=this._desState,O=S.readUInt32BE(C,x),N=S.readUInt32BE(C,x+4);S.ip(O,N,A.tmp,0),O=A.tmp[0],N=A.tmp[1],"encrypt"===this.type?this._encrypt(A,O,N,A.tmp,0):this._decrypt(A,O,N,A.tmp,0),N=A.tmp[1],S.writeUInt32BE(E,O=A.tmp[0],P),S.writeUInt32BE(E,N,P+4)},M.prototype._pad=function(C,x){for(var E=C.length-x,P=x;P>>0,O=X}S.rip(N,O,P,A)},M.prototype._decrypt=function(C,x,E,P,A){for(var O=E,N=x,U=C.keys.length-2;U>=0;U-=2){var H=C.keys[U],V=C.keys[U+1];S.expand(O,C.tmp,0);var G=S.substitute(H^=C.tmp[0],V^=C.tmp[1]),X=O;O=(N^S.permute(G))>>>0,N=X}S.rip(O,N,P,A)}},1862:(ne,F,I)=>{"use strict";var R=I(2391),B=I(3894),S=I(8170),T=I(4631);function f(_,b){R.equal(b.length,24,"Invalid key length");var C=b.slice(0,8),x=b.slice(8,16),E=b.slice(16,24);this.ciphers="encrypt"===_?[T.create({type:"encrypt",key:C}),T.create({type:"decrypt",key:x}),T.create({type:"encrypt",key:E})]:[T.create({type:"decrypt",key:E}),T.create({type:"encrypt",key:x}),T.create({type:"decrypt",key:C})]}function M(_){S.call(this,_);var b=new f(this.type,this.options.key);this._edeState=b}B(M,S),ne.exports=M,M.create=function(b){return new M(b)},M.prototype._update=function(b,C,x,E){var P=this._edeState;P.ciphers[0]._update(b,C,x,E),P.ciphers[1]._update(x,E,x,E),P.ciphers[2]._update(x,E,x,E)},M.prototype._pad=T.prototype._pad,M.prototype._unpad=T.prototype._unpad},7451:(ne,F)=>{"use strict";F.readUInt32BE=function(T,f){return(T[0+f]<<24|T[1+f]<<16|T[2+f]<<8|T[3+f])>>>0},F.writeUInt32BE=function(T,f,M){T[0+M]=f>>>24,T[1+M]=f>>>16&255,T[2+M]=f>>>8&255,T[3+M]=255&f},F.ip=function(T,f,M,_){for(var b=0,C=0,x=6;x>=0;x-=2){for(var E=0;E<=24;E+=8)b<<=1,b|=f>>>E+x&1;for(E=0;E<=24;E+=8)b<<=1,b|=T>>>E+x&1}for(x=6;x>=0;x-=2){for(E=1;E<=25;E+=8)C<<=1,C|=f>>>E+x&1;for(E=1;E<=25;E+=8)C<<=1,C|=T>>>E+x&1}M[_+0]=b>>>0,M[_+1]=C>>>0},F.rip=function(T,f,M,_){for(var b=0,C=0,x=0;x<4;x++)for(var E=24;E>=0;E-=8)b<<=1,b|=f>>>E+x&1,b<<=1,b|=T>>>E+x&1;for(x=4;x<8;x++)for(E=24;E>=0;E-=8)C<<=1,C|=f>>>E+x&1,C<<=1,C|=T>>>E+x&1;M[_+0]=b>>>0,M[_+1]=C>>>0},F.pc1=function(T,f,M,_){for(var b=0,C=0,x=7;x>=5;x--){for(var E=0;E<=24;E+=8)b<<=1,b|=f>>E+x&1;for(E=0;E<=24;E+=8)b<<=1,b|=T>>E+x&1}for(E=0;E<=24;E+=8)b<<=1,b|=f>>E+x&1;for(x=1;x<=3;x++){for(E=0;E<=24;E+=8)C<<=1,C|=f>>E+x&1;for(E=0;E<=24;E+=8)C<<=1,C|=T>>E+x&1}for(E=0;E<=24;E+=8)C<<=1,C|=T>>E+x&1;M[_+0]=b>>>0,M[_+1]=C>>>0},F.r28shl=function(T,f){return T<>>28-f};var I=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];F.pc2=function(T,f,M,_){for(var b=0,C=0,x=I.length>>>1,E=0;E>>I[E]&1;for(E=x;E>>I[E]&1;M[_+0]=b>>>0,M[_+1]=C>>>0},F.expand=function(T,f,M){var _=0,b=0;_=(1&T)<<5|T>>>27;for(var C=23;C>=15;C-=4)_<<=6,_|=T>>>C&63;for(C=11;C>=3;C-=4)b|=T>>>C&63,b<<=6;b|=(31&T)<<1|T>>>31,f[M+0]=_>>>0,f[M+1]=b>>>0};var R=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];F.substitute=function(T,f){for(var M=0,_=0;_<4;_++)M<<=4,M|=R[64*_+(T>>>18-6*_&63)];for(_=0;_<4;_++)M<<=4,M|=R[256+64*_+(f>>>18-6*_&63)];return M>>>0};var B=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];F.permute=function(T){for(var f=0,M=0;M>>B[M]&1;return f>>>0},F.padSplit=function(T,f,M){for(var _=T.toString(2);_.length{var R=I(5563),B=I(9799),S=I(1419),f={binary:!0,hex:!0,base64:!0};F.DiffieHellmanGroup=F.createDiffieHellmanGroup=F.getDiffieHellman=function T(_){var b=new Buffer(B[_].prime,"hex"),C=new Buffer(B[_].gen,"hex");return new S(b,C)},F.createDiffieHellman=F.DiffieHellman=function M(_,b,C,x){return Buffer.isBuffer(b)||void 0===f[b]?M(_,"binary",b,C):(b=b||"binary",x=x||"binary",C=C||new Buffer([2]),Buffer.isBuffer(C)||(C=new Buffer(C,x)),"number"==typeof _?new S(R(_,C),C,!0):(Buffer.isBuffer(_)||(_=new Buffer(_,b)),new S(_,C,!0)))}},1419:(ne,F,I)=>{var R=I(8313),S=new(I(7079)),T=new R(24),f=new R(11),M=new R(10),_=new R(3),b=new R(7),C=I(5563),x=I(3753);function E(H,V){return V=V||"utf8",Buffer.isBuffer(H)||(H=new Buffer(H,V)),this._pub=new R(H),this}function P(H,V){return V=V||"utf8",Buffer.isBuffer(H)||(H=new Buffer(H,V)),this._priv=new R(H),this}ne.exports=N;var A={};function N(H,V,G){this.setGenerator(V),this.__prime=new R(H),this._prime=R.mont(this.__prime),this._primeLen=H.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,G?(this.setPublicKey=E,this.setPrivateKey=P):this._primeCode=8}function U(H,V){var G=new Buffer(H.toArray());return V?G.toString(V):G}Object.defineProperty(N.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function O(H,V){var G=V.toString("hex"),K=[G,H.toString(16)].join("_");if(K in A)return A[K];var Z,X=0;if(H.isEven()||!C.simpleSieve||!C.fermatTest(H)||!S.test(H))return X+=1,A[K]=X+="02"===G||"05"===G?8:4,X;switch(S.test(H.shrn(1))||(X+=2),G){case"02":H.mod(T).cmp(f)&&(X+=8);break;case"05":(Z=H.mod(M)).cmp(_)&&Z.cmp(b)&&(X+=8);break;default:X+=4}return A[K]=X,X}(this.__prime,this.__gen)),this._primeCode}}),N.prototype.generateKeys=function(){return this._priv||(this._priv=new R(x(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},N.prototype.computeSecret=function(H){var V=(H=(H=new R(H)).toRed(this._prime)).redPow(this._priv).fromRed(),G=new Buffer(V.toArray()),K=this.getPrime();if(G.length{var R=I(3753);ne.exports=X,X.simpleSieve=G,X.fermatTest=K;var B=I(8313),S=new B(24),f=new(I(7079)),M=new B(1),_=new B(2),b=new B(5),E=(new B(16),new B(8),new B(10)),P=new B(3),O=(new B(7),new B(11)),N=new B(4),H=(new B(12),null);function G(Z){for(var z=function V(){if(null!==H)return H;var z=[];z[0]=2;for(var J=1,re=3;re<1048576;re+=2){for(var ve=Math.ceil(Math.sqrt(re)),y=0;yZ;)J.ishrn(1);if(J.isEven()&&J.iadd(M),J.testn(1)||J.iadd(_),z.cmp(_)){if(!z.cmp(b))for(;J.mod(E).cmp(P);)J.iadd(N)}else for(;J.mod(S).cmp(O);)J.iadd(N);if(G(re=J.shrn(1))&&G(J)&&K(re)&&K(J)&&f.test(re)&&f.test(J))return J}}},8313:function(ne,F,I){!function(R,B){"use strict";function S(y,o){if(!y)throw new Error(o||"Assertion failed")}function T(y,o){y.super_=o;var l=function(){};l.prototype=o.prototype,y.prototype=new l,y.prototype.constructor=y}function f(y,o,l){if(f.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,null!==y&&(("le"===o||"be"===o)&&(l=o,o=10),this._init(y||0,o||10,l||"be"))}var M;"object"==typeof R?R.exports=f:B.BN=f,f.BN=f,f.wordSize=26;try{M="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:I(7748).Buffer}catch(y){}function _(y,o){var l=y.charCodeAt(o);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},4901:ne=>{"use strict";var F={single_source_shortest_paths:function(I,R,B){var S={},T={};T[R]=0;var M,_,b,C,x,P,f=F.PriorityQueue.make();for(f.push(R,0);!f.empty();)for(b in C=(M=f.pop()).cost,x=I[_=M.value]||{})x.hasOwnProperty(b)&&(P=C+x[b],(void 0===T[b]||T[b]>P)&&(T[b]=P,f.push(b,P),S[b]=_));if(void 0!==B&&void 0===T[B]){var N=["Could not find a path from ",R," to ",B,"."].join("");throw new Error(N)}return S},extract_shortest_path_from_predecessor_list:function(I,R){for(var B=[],S=R;S;)B.push(S),S=I[S];return B.reverse(),B},find_path:function(I,R,B){var S=F.single_source_shortest_paths(I,R,B);return F.extract_shortest_path_from_predecessor_list(S,B)},PriorityQueue:{make:function(I){var S,R=F.PriorityQueue,B={};for(S in I=I||{},R)R.hasOwnProperty(S)&&(B[S]=R[S]);return B.queue=[],B.sorter=I.sorter||R.default_sorter,B},default_sorter:function(I,R){return I.cost-R.cost},push:function(I,R){this.queue.push({value:I,cost:R}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};ne.exports=F},7715:(ne,F,I)=>{"use strict";var R=F;R.version=I(8597).i8,R.utils=I(1970),R.rand=I(7950),R.curve=I(6270),R.curves=I(2916),R.ec=I(7626),R.eddsa=I(1885)},7902:(ne,F,I)=>{"use strict";var R=I(7433),B=I(1970),S=B.getNAF,T=B.getJSF,f=B.assert;function M(b,C){this.type=b,this.p=new R(C.p,16),this.red=C.prime?R.red(C.prime):R.mont(this.p),this.zero=new R(0).toRed(this.red),this.one=new R(1).toRed(this.red),this.two=new R(2).toRed(this.red),this.n=C.n&&new R(C.n,16),this.g=C.g&&this.pointFromJSON(C.g,C.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var x=this.n&&this.p.div(this.n);!x||x.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function _(b,C){this.curve=b,this.type=C,this.precomputed=null}ne.exports=M,M.prototype.point=function(){throw new Error("Not implemented")},M.prototype.validate=function(){throw new Error("Not implemented")},M.prototype._fixedNafMul=function(C,x){f(C.precomputed);var E=C._getDoubles(),P=S(x,1,this._bitLength),A=(1<=N;H--)U=(U<<1)+P[H];O.push(U)}for(var V=this.jpoint(null,null,null),G=this.jpoint(null,null,null),K=A;K>0;K--){for(N=0;N=0;U--){for(var H=0;U>=0&&0===O[U];U--)H++;if(U>=0&&H++,N=N.dblp(H),U<0)break;var V=O[U];f(0!==V),N="affine"===C.type?N.mixedAdd(V>0?A[V-1>>1]:A[-V-1>>1].neg()):N.add(V>0?A[V-1>>1]:A[-V-1>>1].neg())}return"affine"===C.type?N.toP():N},M.prototype._wnafMulAdd=function(C,x,E,P,A){var V,G,K,O=this._wnafT1,N=this._wnafT2,U=this._wnafT3,H=0;for(V=0;V=1;V-=2){var Z=V-1,z=V;if(1===O[Z]&&1===O[z]){var J=[x[Z],null,null,x[z]];0===x[Z].y.cmp(x[z].y)?(J[1]=x[Z].add(x[z]),J[2]=x[Z].toJ().mixedAdd(x[z].neg())):0===x[Z].y.cmp(x[z].y.redNeg())?(J[1]=x[Z].toJ().mixedAdd(x[z]),J[2]=x[Z].add(x[z].neg())):(J[1]=x[Z].toJ().mixedAdd(x[z]),J[2]=x[Z].toJ().mixedAdd(x[z].neg()));var re=[-3,-1,-5,-7,0,7,5,1,3],ve=T(E[Z],E[z]);for(H=Math.max(ve[0].length,H),U[Z]=new Array(H),U[z]=new Array(H),G=0;G=0;V--){for(var u=0;V>=0;){var d=!0;for(G=0;G=0&&u++,l=l.dblp(u),V<0)break;for(G=0;G0?K=N[G][m-1>>1]:m<0&&(K=N[G][-m-1>>1].neg()),l="affine"===K.type?l.mixedAdd(K):l.add(K))}}for(V=0;V=Math.ceil((C.bitLength()+1)/x.step)},_.prototype._getDoubles=function(C,x){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var E=[this],P=this,A=0;A{"use strict";var R=I(1970),B=I(7433),S=I(3894),T=I(7902),f=R.assert;function M(b){this.twisted=1!=(0|b.a),this.mOneA=this.twisted&&-1==(0|b.a),this.extended=this.mOneA,T.call(this,"edwards",b),this.a=new B(b.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new B(b.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new B(b.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),f(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|b.c)}function _(b,C,x,E,P){T.BasePoint.call(this,b,"projective"),null===C&&null===x&&null===E?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new B(C,16),this.y=new B(x,16),this.z=E?new B(E,16):this.curve.one,this.t=P&&new B(P,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}S(M,T),ne.exports=M,M.prototype._mulA=function(C){return this.mOneA?C.redNeg():this.a.redMul(C)},M.prototype._mulC=function(C){return this.oneC?C:this.c.redMul(C)},M.prototype.jpoint=function(C,x,E,P){return this.point(C,x,E,P)},M.prototype.pointFromX=function(C,x){(C=new B(C,16)).red||(C=C.toRed(this.red));var E=C.redSqr(),P=this.c2.redSub(this.a.redMul(E)),A=this.one.redSub(this.c2.redMul(this.d).redMul(E)),O=P.redMul(A.redInvm()),N=O.redSqrt();if(0!==N.redSqr().redSub(O).cmp(this.zero))throw new Error("invalid point");var U=N.fromRed().isOdd();return(x&&!U||!x&&U)&&(N=N.redNeg()),this.point(C,N)},M.prototype.pointFromY=function(C,x){(C=new B(C,16)).red||(C=C.toRed(this.red));var E=C.redSqr(),P=E.redSub(this.c2),A=E.redMul(this.d).redMul(this.c2).redSub(this.a),O=P.redMul(A.redInvm());if(0===O.cmp(this.zero)){if(x)throw new Error("invalid point");return this.point(this.zero,C)}var N=O.redSqrt();if(0!==N.redSqr().redSub(O).cmp(this.zero))throw new Error("invalid point");return N.fromRed().isOdd()!==x&&(N=N.redNeg()),this.point(N,C)},M.prototype.validate=function(C){if(C.isInfinity())return!0;C.normalize();var x=C.x.redSqr(),E=C.y.redSqr(),P=x.redMul(this.a).redAdd(E),A=this.c2.redMul(this.one.redAdd(this.d.redMul(x).redMul(E)));return 0===P.cmp(A)},S(_,T.BasePoint),M.prototype.pointFromJSON=function(C){return _.fromJSON(this,C)},M.prototype.point=function(C,x,E,P){return new _(this,C,x,E,P)},_.fromJSON=function(C,x){return new _(C,x[0],x[1],x[2])},_.prototype.inspect=function(){return this.isInfinity()?"":""},_.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},_.prototype._extDbl=function(){var C=this.x.redSqr(),x=this.y.redSqr(),E=this.z.redSqr();E=E.redIAdd(E);var P=this.curve._mulA(C),A=this.x.redAdd(this.y).redSqr().redISub(C).redISub(x),O=P.redAdd(x),N=O.redSub(E),U=P.redSub(x),H=A.redMul(N),V=O.redMul(U),G=A.redMul(U),K=N.redMul(O);return this.curve.point(H,V,K,G)},_.prototype._projDbl=function(){var P,A,O,N,U,H,C=this.x.redAdd(this.y).redSqr(),x=this.x.redSqr(),E=this.y.redSqr();if(this.curve.twisted){var V=(N=this.curve._mulA(x)).redAdd(E);this.zOne?(P=C.redSub(x).redSub(E).redMul(V.redSub(this.curve.two)),A=V.redMul(N.redSub(E)),O=V.redSqr().redSub(V).redSub(V)):(U=this.z.redSqr(),H=V.redSub(U).redISub(U),P=C.redSub(x).redISub(E).redMul(H),A=V.redMul(N.redSub(E)),O=V.redMul(H))}else N=x.redAdd(E),U=this.curve._mulC(this.z).redSqr(),H=N.redSub(U).redSub(U),P=this.curve._mulC(C.redISub(N)).redMul(H),A=this.curve._mulC(N).redMul(x.redISub(E)),O=N.redMul(H);return this.curve.point(P,A,O)},_.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},_.prototype._extAdd=function(C){var x=this.y.redSub(this.x).redMul(C.y.redSub(C.x)),E=this.y.redAdd(this.x).redMul(C.y.redAdd(C.x)),P=this.t.redMul(this.curve.dd).redMul(C.t),A=this.z.redMul(C.z.redAdd(C.z)),O=E.redSub(x),N=A.redSub(P),U=A.redAdd(P),H=E.redAdd(x),V=O.redMul(N),G=U.redMul(H),K=O.redMul(H),X=N.redMul(U);return this.curve.point(V,G,X,K)},_.prototype._projAdd=function(C){var G,K,x=this.z.redMul(C.z),E=x.redSqr(),P=this.x.redMul(C.x),A=this.y.redMul(C.y),O=this.curve.d.redMul(P).redMul(A),N=E.redSub(O),U=E.redAdd(O),H=this.x.redAdd(this.y).redMul(C.x.redAdd(C.y)).redISub(P).redISub(A),V=x.redMul(N).redMul(H);return this.curve.twisted?(G=x.redMul(U).redMul(A.redSub(this.curve._mulA(P))),K=N.redMul(U)):(G=x.redMul(U).redMul(A.redSub(P)),K=this.curve._mulC(N).redMul(U)),this.curve.point(V,G,K)},_.prototype.add=function(C){return this.isInfinity()?C:C.isInfinity()?this:this.curve.extended?this._extAdd(C):this._projAdd(C)},_.prototype.mul=function(C){return this._hasDoubles(C)?this.curve._fixedNafMul(this,C):this.curve._wnafMul(this,C)},_.prototype.mulAdd=function(C,x,E){return this.curve._wnafMulAdd(1,[this,x],[C,E],2,!1)},_.prototype.jmulAdd=function(C,x,E){return this.curve._wnafMulAdd(1,[this,x],[C,E],2,!0)},_.prototype.normalize=function(){if(this.zOne)return this;var C=this.z.redInvm();return this.x=this.x.redMul(C),this.y=this.y.redMul(C),this.t&&(this.t=this.t.redMul(C)),this.z=this.curve.one,this.zOne=!0,this},_.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},_.prototype.getX=function(){return this.normalize(),this.x.fromRed()},_.prototype.getY=function(){return this.normalize(),this.y.fromRed()},_.prototype.eq=function(C){return this===C||0===this.getX().cmp(C.getX())&&0===this.getY().cmp(C.getY())},_.prototype.eqXToP=function(C){var x=C.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(x))return!0;for(var E=C.clone(),P=this.curve.redN.redMul(this.z);;){if(E.iadd(this.curve.n),E.cmp(this.curve.p)>=0)return!1;if(x.redIAdd(P),0===this.x.cmp(x))return!0}},_.prototype.toP=_.prototype.normalize,_.prototype.mixedAdd=_.prototype.add},6270:(ne,F,I)=>{"use strict";var R=F;R.base=I(7902),R.short=I(1781),R.mont=I(7064),R.edwards=I(3835)},7064:(ne,F,I)=>{"use strict";var R=I(7433),B=I(3894),S=I(7902),T=I(1970);function f(_){S.call(this,"mont",_),this.a=new R(_.a,16).toRed(this.red),this.b=new R(_.b,16).toRed(this.red),this.i4=new R(4).toRed(this.red).redInvm(),this.two=new R(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function M(_,b,C){S.BasePoint.call(this,_,"projective"),null===b&&null===C?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new R(b,16),this.z=new R(C,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}B(f,S),ne.exports=f,f.prototype.validate=function(b){var C=b.normalize().x,x=C.redSqr(),E=x.redMul(C).redAdd(x.redMul(this.a)).redAdd(C);return 0===E.redSqrt().redSqr().cmp(E)},B(M,S.BasePoint),f.prototype.decodePoint=function(b,C){return this.point(T.toArray(b,C),1)},f.prototype.point=function(b,C){return new M(this,b,C)},f.prototype.pointFromJSON=function(b){return M.fromJSON(this,b)},M.prototype.precompute=function(){},M.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},M.fromJSON=function(b,C){return new M(b,C[0],C[1]||b.one)},M.prototype.inspect=function(){return this.isInfinity()?"":""},M.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},M.prototype.dbl=function(){var C=this.x.redAdd(this.z).redSqr(),E=this.x.redSub(this.z).redSqr(),P=C.redSub(E),A=C.redMul(E),O=P.redMul(E.redAdd(this.curve.a24.redMul(P)));return this.curve.point(A,O)},M.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},M.prototype.diffAdd=function(b,C){var x=this.x.redAdd(this.z),E=this.x.redSub(this.z),P=b.x.redAdd(b.z),O=b.x.redSub(b.z).redMul(x),N=P.redMul(E),U=C.z.redMul(O.redAdd(N).redSqr()),H=C.x.redMul(O.redISub(N).redSqr());return this.curve.point(U,H)},M.prototype.mul=function(b){for(var C=b.clone(),x=this,E=this.curve.point(null,null),A=[];0!==C.cmpn(0);C.iushrn(1))A.push(C.andln(1));for(var O=A.length-1;O>=0;O--)0===A[O]?(x=x.diffAdd(E,this),E=E.dbl()):(E=x.diffAdd(E,this),x=x.dbl());return E},M.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},M.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},M.prototype.eq=function(b){return 0===this.getX().cmp(b.getX())},M.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},M.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},1781:(ne,F,I)=>{"use strict";var R=I(1970),B=I(7433),S=I(3894),T=I(7902),f=R.assert;function M(C){T.call(this,"short",C),this.a=new B(C.a,16).toRed(this.red),this.b=new B(C.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(C),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function _(C,x,E,P){T.BasePoint.call(this,C,"affine"),null===x&&null===E?(this.x=null,this.y=null,this.inf=!0):(this.x=new B(x,16),this.y=new B(E,16),P&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function b(C,x,E,P){T.BasePoint.call(this,C,"jacobian"),null===x&&null===E&&null===P?(this.x=this.curve.one,this.y=this.curve.one,this.z=new B(0)):(this.x=new B(x,16),this.y=new B(E,16),this.z=new B(P,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}S(M,T),ne.exports=M,M.prototype._getEndomorphism=function(x){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var E,P;if(x.beta)E=new B(x.beta,16).toRed(this.red);else{var A=this._getEndoRoots(this.p);E=(E=A[0].cmp(A[1])<0?A[0]:A[1]).toRed(this.red)}if(x.lambda)P=new B(x.lambda,16);else{var O=this._getEndoRoots(this.n);0===this.g.mul(O[0]).x.cmp(this.g.x.redMul(E))?P=O[0]:f(0===this.g.mul(P=O[1]).x.cmp(this.g.x.redMul(E)))}return{beta:E,lambda:P,basis:x.basis?x.basis.map(function(U){return{a:new B(U.a,16),b:new B(U.b,16)}}):this._getEndoBasis(P)}}},M.prototype._getEndoRoots=function(x){var E=x===this.p?this.red:B.mont(x),P=new B(2).toRed(E).redInvm(),A=P.redNeg(),O=new B(3).toRed(E).redNeg().redSqrt().redMul(P);return[A.redAdd(O).fromRed(),A.redSub(O).fromRed()]},M.prototype._getEndoBasis=function(x){for(var V,G,K,X,Z,z,J,ve,y,E=this.n.ushrn(Math.floor(this.n.bitLength()/2)),P=x,A=this.n.clone(),O=new B(1),N=new B(0),U=new B(0),H=new B(1),re=0;0!==P.cmpn(0);){var o=A.div(P);ve=A.sub(o.mul(P)),y=U.sub(o.mul(O));var l=H.sub(o.mul(N));if(!K&&ve.cmp(E)<0)V=J.neg(),G=O,K=ve.neg(),X=y;else if(K&&2==++re)break;J=ve,A=P,P=ve,U=O,O=y,H=N,N=l}Z=ve.neg(),z=y;var c=K.sqr().add(X.sqr());return Z.sqr().add(z.sqr()).cmp(c)>=0&&(Z=V,z=G),K.negative&&(K=K.neg(),X=X.neg()),Z.negative&&(Z=Z.neg(),z=z.neg()),[{a:K,b:X},{a:Z,b:z}]},M.prototype._endoSplit=function(x){var E=this.endo.basis,P=E[0],A=E[1],O=A.b.mul(x).divRound(this.n),N=P.b.neg().mul(x).divRound(this.n),U=O.mul(P.a),H=N.mul(A.a),V=O.mul(P.b),G=N.mul(A.b);return{k1:x.sub(U).sub(H),k2:V.add(G).neg()}},M.prototype.pointFromX=function(x,E){(x=new B(x,16)).red||(x=x.toRed(this.red));var P=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),A=P.redSqrt();if(0!==A.redSqr().redSub(P).cmp(this.zero))throw new Error("invalid point");var O=A.fromRed().isOdd();return(E&&!O||!E&&O)&&(A=A.redNeg()),this.point(x,A)},M.prototype.validate=function(x){if(x.inf)return!0;var E=x.x,P=x.y,A=this.a.redMul(E),O=E.redSqr().redMul(E).redIAdd(A).redIAdd(this.b);return 0===P.redSqr().redISub(O).cmpn(0)},M.prototype._endoWnafMulAdd=function(x,E,P){for(var A=this._endoWnafT1,O=this._endoWnafT2,N=0;N":""},_.prototype.isInfinity=function(){return this.inf},_.prototype.add=function(x){if(this.inf)return x;if(x.inf)return this;if(this.eq(x))return this.dbl();if(this.neg().eq(x))return this.curve.point(null,null);if(0===this.x.cmp(x.x))return this.curve.point(null,null);var E=this.y.redSub(x.y);0!==E.cmpn(0)&&(E=E.redMul(this.x.redSub(x.x).redInvm()));var P=E.redSqr().redISub(this.x).redISub(x.x),A=E.redMul(this.x.redSub(P)).redISub(this.y);return this.curve.point(P,A)},_.prototype.dbl=function(){if(this.inf)return this;var x=this.y.redAdd(this.y);if(0===x.cmpn(0))return this.curve.point(null,null);var E=this.curve.a,P=this.x.redSqr(),A=x.redInvm(),O=P.redAdd(P).redIAdd(P).redIAdd(E).redMul(A),N=O.redSqr().redISub(this.x.redAdd(this.x)),U=O.redMul(this.x.redSub(N)).redISub(this.y);return this.curve.point(N,U)},_.prototype.getX=function(){return this.x.fromRed()},_.prototype.getY=function(){return this.y.fromRed()},_.prototype.mul=function(x){return x=new B(x,16),this.isInfinity()?this:this._hasDoubles(x)?this.curve._fixedNafMul(this,x):this.curve.endo?this.curve._endoWnafMulAdd([this],[x]):this.curve._wnafMul(this,x)},_.prototype.mulAdd=function(x,E,P){var A=[this,E],O=[x,P];return this.curve.endo?this.curve._endoWnafMulAdd(A,O):this.curve._wnafMulAdd(1,A,O,2)},_.prototype.jmulAdd=function(x,E,P){var A=[this,E],O=[x,P];return this.curve.endo?this.curve._endoWnafMulAdd(A,O,!0):this.curve._wnafMulAdd(1,A,O,2,!0)},_.prototype.eq=function(x){return this===x||this.inf===x.inf&&(this.inf||0===this.x.cmp(x.x)&&0===this.y.cmp(x.y))},_.prototype.neg=function(x){if(this.inf)return this;var E=this.curve.point(this.x,this.y.redNeg());if(x&&this.precomputed){var P=this.precomputed,A=function(O){return O.neg()};E.precomputed={naf:P.naf&&{wnd:P.naf.wnd,points:P.naf.points.map(A)},doubles:P.doubles&&{step:P.doubles.step,points:P.doubles.points.map(A)}}}return E},_.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},S(b,T.BasePoint),M.prototype.jpoint=function(x,E,P){return new b(this,x,E,P)},b.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var x=this.z.redInvm(),E=x.redSqr(),P=this.x.redMul(E),A=this.y.redMul(E).redMul(x);return this.curve.point(P,A)},b.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},b.prototype.add=function(x){if(this.isInfinity())return x;if(x.isInfinity())return this;var E=x.z.redSqr(),P=this.z.redSqr(),A=this.x.redMul(E),O=x.x.redMul(P),N=this.y.redMul(E.redMul(x.z)),U=x.y.redMul(P.redMul(this.z)),H=A.redSub(O),V=N.redSub(U);if(0===H.cmpn(0))return 0!==V.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var G=H.redSqr(),K=G.redMul(H),X=A.redMul(G),Z=V.redSqr().redIAdd(K).redISub(X).redISub(X),z=V.redMul(X.redISub(Z)).redISub(N.redMul(K)),J=this.z.redMul(x.z).redMul(H);return this.curve.jpoint(Z,z,J)},b.prototype.mixedAdd=function(x){if(this.isInfinity())return x.toJ();if(x.isInfinity())return this;var E=this.z.redSqr(),P=this.x,A=x.x.redMul(E),O=this.y,N=x.y.redMul(E).redMul(this.z),U=P.redSub(A),H=O.redSub(N);if(0===U.cmpn(0))return 0!==H.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var V=U.redSqr(),G=V.redMul(U),K=P.redMul(V),X=H.redSqr().redIAdd(G).redISub(K).redISub(K),Z=H.redMul(K.redISub(X)).redISub(O.redMul(G)),z=this.z.redMul(U);return this.curve.jpoint(X,Z,z)},b.prototype.dblp=function(x){if(0===x)return this;if(this.isInfinity())return this;if(!x)return this.dbl();var E;if(this.curve.zeroA||this.curve.threeA){var P=this;for(E=0;E=0)return!1;if(P.redIAdd(O),0===this.x.cmp(P))return!0}},b.prototype.inspect=function(){return this.isInfinity()?"":""},b.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},2916:(ne,F,I)=>{"use strict";var b,R=F,B=I(7084),S=I(6270),f=I(1970).assert;function M(C){this.curve="short"===C.type?new S.short(C):"edwards"===C.type?new S.edwards(C):new S.mont(C),this.g=this.curve.g,this.n=this.curve.n,this.hash=C.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function _(C,x){Object.defineProperty(R,C,{configurable:!0,enumerable:!0,get:function(){var E=new M(x);return Object.defineProperty(R,C,{configurable:!0,enumerable:!0,value:E}),E}})}R.PresetCurve=M,_("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:B.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),_("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:B.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),_("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:B.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),_("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:B.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),_("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:B.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),_("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:B.sha256,gRed:!1,g:["9"]}),_("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:B.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{b=I(5150)}catch(C){b=void 0}_("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:B.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",b]})},7626:(ne,F,I)=>{"use strict";var R=I(7433),B=I(2438),S=I(1970),T=I(2916),f=I(7950),M=S.assert,_=I(1259),b=I(5957);function C(x){if(!(this instanceof C))return new C(x);"string"==typeof x&&(M(Object.prototype.hasOwnProperty.call(T,x),"Unknown curve "+x),x=T[x]),x instanceof T.PresetCurve&&(x={curve:x}),this.curve=x.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=x.curve.g,this.g.precompute(x.curve.n.bitLength()+1),this.hash=x.hash||x.curve.hash}ne.exports=C,C.prototype.keyPair=function(E){return new _(this,E)},C.prototype.keyFromPrivate=function(E,P){return _.fromPrivate(this,E,P)},C.prototype.keyFromPublic=function(E,P){return _.fromPublic(this,E,P)},C.prototype.genKeyPair=function(E){E||(E={});for(var P=new B({hash:this.hash,pers:E.pers,persEnc:E.persEnc||"utf8",entropy:E.entropy||f(this.hash.hmacStrength),entropyEnc:E.entropy&&E.entropyEnc||"utf8",nonce:this.n.toArray()}),A=this.n.byteLength(),O=this.n.sub(new R(2));;){var N=new R(P.generate(A));if(!(N.cmp(O)>0))return N.iaddn(1),this.keyFromPrivate(N)}},C.prototype._truncateToN=function(E,P){var A=8*E.byteLength()-this.n.bitLength();return A>0&&(E=E.ushrn(A)),!P&&E.cmp(this.n)>=0?E.sub(this.n):E},C.prototype.sign=function(E,P,A,O){"object"==typeof A&&(O=A,A=null),O||(O={}),P=this.keyFromPrivate(P,A),E=this._truncateToN(new R(E,16));for(var N=this.n.byteLength(),U=P.getPrivate().toArray("be",N),H=E.toArray("be",N),V=new B({hash:this.hash,entropy:U,nonce:H,pers:O.pers,persEnc:O.persEnc||"utf8"}),G=this.n.sub(new R(1)),K=0;;K++){var X=O.k?O.k(K):new R(V.generate(this.n.byteLength()));if(!((X=this._truncateToN(X,!0)).cmpn(1)<=0||X.cmp(G)>=0)){var Z=this.g.mul(X);if(!Z.isInfinity()){var z=Z.getX(),J=z.umod(this.n);if(0!==J.cmpn(0)){var re=X.invm(this.n).mul(J.mul(P.getPrivate()).iadd(E));if(0!==(re=re.umod(this.n)).cmpn(0)){var ve=(Z.getY().isOdd()?1:0)|(0!==z.cmp(J)?2:0);return O.canonical&&re.cmp(this.nh)>0&&(re=this.n.sub(re),ve^=1),new b({r:J,s:re,recoveryParam:ve})}}}}}},C.prototype.verify=function(E,P,A,O){E=this._truncateToN(new R(E,16)),A=this.keyFromPublic(A,O);var N=(P=new b(P,"hex")).r,U=P.s;if(N.cmpn(1)<0||N.cmp(this.n)>=0||U.cmpn(1)<0||U.cmp(this.n)>=0)return!1;var K,H=U.invm(this.n),V=H.mul(E).umod(this.n),G=H.mul(N).umod(this.n);return this.curve._maxwellTrick?!(K=this.g.jmulAdd(V,A.getPublic(),G)).isInfinity()&&K.eqXToP(N):!(K=this.g.mulAdd(V,A.getPublic(),G)).isInfinity()&&0===K.getX().umod(this.n).cmp(N)},C.prototype.recoverPubKey=function(x,E,P,A){M((3&P)===P,"The recovery param is more than two bits"),E=new b(E,A);var O=this.n,N=new R(x),U=E.r,H=E.s,V=1&P,G=P>>1;if(U.cmp(this.curve.p.umod(this.curve.n))>=0&&G)throw new Error("Unable to find sencond key candinate");U=this.curve.pointFromX(G?U.add(this.curve.n):U,V);var K=E.r.invm(O),X=O.sub(N).mul(K).umod(O),Z=H.mul(K).umod(O);return this.g.mulAdd(X,U,Z)},C.prototype.getKeyRecoveryParam=function(x,E,P,A){if(null!==(E=new b(E,A)).recoveryParam)return E.recoveryParam;for(var O=0;O<4;O++){var N;try{N=this.recoverPubKey(x,E,O)}catch(U){continue}if(N.eq(P))return O}throw new Error("Unable to find valid recovery factor")}},1259:(ne,F,I)=>{"use strict";var R=I(7433),S=I(1970).assert;function T(f,M){this.ec=f,this.priv=null,this.pub=null,M.priv&&this._importPrivate(M.priv,M.privEnc),M.pub&&this._importPublic(M.pub,M.pubEnc)}ne.exports=T,T.fromPublic=function(M,_,b){return _ instanceof T?_:new T(M,{pub:_,pubEnc:b})},T.fromPrivate=function(M,_,b){return _ instanceof T?_:new T(M,{priv:_,privEnc:b})},T.prototype.validate=function(){var M=this.getPublic();return M.isInfinity()?{result:!1,reason:"Invalid public key"}:M.validate()?M.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},T.prototype.getPublic=function(M,_){return"string"==typeof M&&(_=M,M=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),_?this.pub.encode(_,M):this.pub},T.prototype.getPrivate=function(M){return"hex"===M?this.priv.toString(16,2):this.priv},T.prototype._importPrivate=function(M,_){this.priv=new R(M,_||16),this.priv=this.priv.umod(this.ec.curve.n)},T.prototype._importPublic=function(M,_){if(M.x||M.y)return"mont"===this.ec.curve.type?S(M.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&S(M.x&&M.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(M.x,M.y));this.pub=this.ec.curve.decodePoint(M,_)},T.prototype.derive=function(M){return M.validate()||S(M.validate(),"public point not validated"),M.mul(this.priv).getX()},T.prototype.sign=function(M,_,b){return this.ec.sign(M,this,_,b)},T.prototype.verify=function(M,_){return this.ec.verify(M,_,this)},T.prototype.inspect=function(){return""}},5957:(ne,F,I)=>{"use strict";var R=I(7433),B=I(1970),S=B.assert;function T(C,x){if(C instanceof T)return C;this._importDER(C,x)||(S(C.r&&C.s,"Signature without r or s"),this.r=new R(C.r,16),this.s=new R(C.s,16),this.recoveryParam=void 0===C.recoveryParam?null:C.recoveryParam)}function f(){this.place=0}function M(C,x){var E=C[x.place++];if(!(128&E))return E;var P=15&E;if(0===P||P>4)return!1;for(var A=0,O=0,N=x.place;O>>=0;return!(A<=127)&&(x.place=N,A)}function _(C){for(var x=0,E=C.length-1;!C[x]&&!(128&C[x+1])&&x>>3);for(C.push(128|E);--E;)C.push(x>>>(E<<3)&255);C.push(x)}}ne.exports=T,T.prototype._importDER=function(x,E){x=B.toArray(x,E);var P=new f;if(48!==x[P.place++])return!1;var A=M(x,P);if(!1===A||A+P.place!==x.length||2!==x[P.place++])return!1;var O=M(x,P);if(!1===O)return!1;var N=x.slice(P.place,O+P.place);if(P.place+=O,2!==x[P.place++])return!1;var U=M(x,P);if(!1===U||x.length!==U+P.place)return!1;var H=x.slice(P.place,U+P.place);if(0===N[0]){if(!(128&N[1]))return!1;N=N.slice(1)}if(0===H[0]){if(!(128&H[1]))return!1;H=H.slice(1)}return this.r=new R(N),this.s=new R(H),this.recoveryParam=null,!0},T.prototype.toDER=function(x){var E=this.r.toArray(),P=this.s.toArray();for(128&E[0]&&(E=[0].concat(E)),128&P[0]&&(P=[0].concat(P)),E=_(E),P=_(P);!(P[0]||128&P[1]);)P=P.slice(1);var A=[2];b(A,E.length),(A=A.concat(E)).push(2),b(A,P.length);var O=A.concat(P),N=[48];return b(N,O.length),N=N.concat(O),B.encode(N,x)}},1885:(ne,F,I)=>{"use strict";var R=I(7084),B=I(2916),S=I(1970),T=S.assert,f=S.parseBytes,M=I(7535),_=I(8241);function b(C){if(T("ed25519"===C,"only tested with ed25519 so far"),!(this instanceof b))return new b(C);this.curve=C=B[C].curve,this.g=C.g,this.g.precompute(C.n.bitLength()+1),this.pointClass=C.point().constructor,this.encodingLength=Math.ceil(C.n.bitLength()/8),this.hash=R.sha512}ne.exports=b,b.prototype.sign=function(x,E){x=f(x);var P=this.keyFromSecret(E),A=this.hashInt(P.messagePrefix(),x),O=this.g.mul(A),N=this.encodePoint(O),U=this.hashInt(N,P.pubBytes(),x).mul(P.priv()),H=A.add(U).umod(this.curve.n);return this.makeSignature({R:O,S:H,Rencoded:N})},b.prototype.verify=function(x,E,P){x=f(x),E=this.makeSignature(E);var A=this.keyFromPublic(P),O=this.hashInt(E.Rencoded(),A.pubBytes(),x),N=this.g.mul(E.S());return E.R().add(A.pub().mul(O)).eq(N)},b.prototype.hashInt=function(){for(var x=this.hash(),E=0;E{"use strict";var R=I(1970),B=R.assert,S=R.parseBytes,T=R.cachedProperty;function f(M,_){this.eddsa=M,this._secret=S(_.secret),M.isPoint(_.pub)?this._pub=_.pub:this._pubBytes=S(_.pub)}f.fromPublic=function(_,b){return b instanceof f?b:new f(_,{pub:b})},f.fromSecret=function(_,b){return b instanceof f?b:new f(_,{secret:b})},f.prototype.secret=function(){return this._secret},T(f,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),T(f,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),T(f,"privBytes",function(){var _=this.eddsa,b=this.hash(),C=_.encodingLength-1,x=b.slice(0,_.encodingLength);return x[0]&=248,x[C]&=127,x[C]|=64,x}),T(f,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),T(f,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),T(f,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),f.prototype.sign=function(_){return B(this._secret,"KeyPair can only verify"),this.eddsa.sign(_,this)},f.prototype.verify=function(_,b){return this.eddsa.verify(_,b,this)},f.prototype.getSecret=function(_){return B(this._secret,"KeyPair is public only"),R.encode(this.secret(),_)},f.prototype.getPublic=function(_){return R.encode(this.pubBytes(),_)},ne.exports=f},8241:(ne,F,I)=>{"use strict";var R=I(7433),B=I(1970),S=B.assert,T=B.cachedProperty,f=B.parseBytes;function M(_,b){this.eddsa=_,"object"!=typeof b&&(b=f(b)),Array.isArray(b)&&(b={R:b.slice(0,_.encodingLength),S:b.slice(_.encodingLength)}),S(b.R&&b.S,"Signature without R or S"),_.isPoint(b.R)&&(this._R=b.R),b.S instanceof R&&(this._S=b.S),this._Rencoded=Array.isArray(b.R)?b.R:b.Rencoded,this._Sencoded=Array.isArray(b.S)?b.S:b.Sencoded}T(M,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),T(M,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),T(M,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),T(M,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),M.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},M.prototype.toHex=function(){return B.encode(this.toBytes(),"hex").toUpperCase()},ne.exports=M},5150:ne=>{ne.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},1970:(ne,F,I)=>{"use strict";var R=F,B=I(7433),S=I(2391),T=I(8195);R.assert=S,R.toArray=T.toArray,R.zero2=T.zero2,R.toHex=T.toHex,R.encode=T.encode,R.getNAF=function f(x,E,P){var A=new Array(Math.max(x.bitLength(),P)+1);A.fill(0);for(var O=1<(O>>1)-1?(O>>1)-V:V):H=0,A[U]=H,N.iushrn(1)}return A},R.getJSF=function M(x,E){var P=[[],[]];x=x.clone(),E=E.clone();for(var N,A=0,O=0;x.cmpn(-A)>0||E.cmpn(-O)>0;){var V,G,U=x.andln(3)+A&3,H=E.andln(3)+O&3;3===U&&(U=-1),3===H&&(H=-1),V=0==(1&U)?0:3!=(N=x.andln(7)+A&7)&&5!==N||2!==H?U:-U,P[0].push(V),G=0==(1&H)?0:3!=(N=E.andln(7)+O&7)&&5!==N||2!==U?H:-H,P[1].push(G),2*A===V+1&&(A=1-A),2*O===G+1&&(O=1-O),x.iushrn(1),E.iushrn(1)}return P},R.cachedProperty=function _(x,E,P){var A="_"+E;x.prototype[E]=function(){return void 0!==this[A]?this[A]:this[A]=P.call(this)}},R.parseBytes=function b(x){return"string"==typeof x?R.toArray(x,"hex"):x},R.intFromLE=function C(x){return new B(x,"hex","le")}},7433:function(ne,F,I){!function(R,B){"use strict";function S(y,o){if(!y)throw new Error(o||"Assertion failed")}function T(y,o){y.super_=o;var l=function(){};l.prototype=o.prototype,y.prototype=new l,y.prototype.constructor=y}function f(y,o,l){if(f.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,null!==y&&(("le"===o||"be"===o)&&(l=o,o=10),this._init(y||0,o||10,l||"be"))}var M;"object"==typeof R?R.exports=f:B.BN=f,f.BN=f,f.wordSize=26;try{M="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:I(5568).Buffer}catch(y){}function _(y,o){var l=y.charCodeAt(o);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},8419:ne=>{"use strict";ne.exports=function(I){for(var R=[],B=I.length,S=0;S=55296&&T<=56319&&B>S+1){var f=I.charCodeAt(S+1);f>=56320&&f<=57343&&(T=1024*(T-55296)+f-56320+65536,S+=1)}T<128?R.push(T):T<2048?(R.push(T>>6|192),R.push(63&T|128)):T<55296||T>=57344&&T<65536?(R.push(T>>12|224),R.push(T>>6&63|128),R.push(63&T|128)):T>=65536&&T<=1114111?(R.push(T>>18|240),R.push(T>>12&63|128),R.push(T>>6&63|128),R.push(63&T|128)):R.push(239,191,189)}return new Uint8Array(R).buffer}},9069:ne=>{"use strict";var R,F="object"==typeof Reflect?Reflect:null,I=F&&"function"==typeof F.apply?F.apply:function(K,X,Z){return Function.prototype.apply.call(K,X,Z)};R=F&&"function"==typeof F.ownKeys?F.ownKeys:Object.getOwnPropertySymbols?function(K){return Object.getOwnPropertyNames(K).concat(Object.getOwnPropertySymbols(K))}:function(K){return Object.getOwnPropertyNames(K)};var S=Number.isNaN||function(K){return K!=K};function T(){T.init.call(this)}ne.exports=T,ne.exports.once=function U(G,K){return new Promise(function(X,Z){function z(re){G.removeListener(K,J),Z(re)}function J(){"function"==typeof G.removeListener&&G.removeListener("error",z),X([].slice.call(arguments))}V(G,K,J,{once:!0}),"error"!==K&&function H(G,K,X){"function"==typeof G.on&&V(G,"error",K,X)}(G,z,{once:!0})})},T.EventEmitter=T,T.prototype._events=void 0,T.prototype._eventsCount=0,T.prototype._maxListeners=void 0;var f=10;function M(G){if("function"!=typeof G)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}function _(G){return void 0===G._maxListeners?T.defaultMaxListeners:G._maxListeners}function b(G,K,X,Z){var z,J,re;if(M(X),void 0===(J=G._events)?(J=G._events=Object.create(null),G._eventsCount=0):(void 0!==J.newListener&&(G.emit("newListener",K,X.listener?X.listener:X),J=G._events),re=J[K]),void 0===re)re=J[K]=X,++G._eventsCount;else if("function"==typeof re?re=J[K]=Z?[X,re]:[re,X]:Z?re.unshift(X):re.push(X),(z=_(G))>0&&re.length>z&&!re.warned){re.warned=!0;var ve=new Error("Possible EventEmitter memory leak detected. "+re.length+" "+String(K)+" listeners added. Use emitter.setMaxListeners() to increase limit");ve.name="MaxListenersExceededWarning",ve.emitter=G,ve.type=K,ve.count=re.length,function B(G){console&&console.warn&&console.warn(G)}(ve)}return G}function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function x(G,K,X){var Z={fired:!1,wrapFn:void 0,target:G,type:K,listener:X},z=C.bind(Z);return z.listener=X,Z.wrapFn=z,z}function E(G,K,X){var Z=G._events;if(void 0===Z)return[];var z=Z[K];return void 0===z?[]:"function"==typeof z?X?[z.listener||z]:[z]:X?function N(G){for(var K=new Array(G.length),X=0;X0&&(re=X[0]),re instanceof Error)throw re;var ve=new Error("Unhandled error."+(re?" ("+re.message+")":""));throw ve.context=re,ve}var y=J[K];if(void 0===y)return!1;if("function"==typeof y)I(y,this,X);else{var o=y.length,l=A(y,o);for(Z=0;Z=0;re--)if(Z[re]===X||Z[re].listener===X){ve=Z[re].listener,J=re;break}if(J<0)return this;0===J?Z.shift():function O(G,K){for(;K+1=0;z--)this.removeListener(K,X[z]);return this},T.prototype.listeners=function(K){return E(this,K,!0)},T.prototype.rawListeners=function(K){return E(this,K,!1)},T.listenerCount=function(G,K){return"function"==typeof G.listenerCount?G.listenerCount(K):P.call(G,K)},T.prototype.listenerCount=P,T.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]}},347:(ne,F,I)=>{var R=I(3502).Buffer,B=I(8095);ne.exports=function S(T,f,M,_){if(R.isBuffer(T)||(T=R.from(T,"binary")),f&&(R.isBuffer(f)||(f=R.from(f,"binary")),8!==f.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var b=M/8,C=R.alloc(b),x=R.alloc(_||0),E=R.alloc(0);b>0||_>0;){var P=new B;P.update(E),P.update(T),f&&P.update(f),E=P.digest();var A=0;if(b>0){var O=C.length-b;A=Math.min(b,E.length),E.copy(C,O,0,A),b-=A}if(A0){var N=x.length-_,U=Math.min(_,E.length-A);E.copy(x,N,A,A+U),_-=U}}return E.fill(0),{key:C,iv:x}}},9076:ne=>{var F=Object.prototype.hasOwnProperty,I=Object.prototype.toString;ne.exports=function(B,S,T){if("[object Function]"!==I.call(S))throw new TypeError("iterator must be a function");var f=B.length;if(f===+f)for(var M=0;M{"use strict";var F="Function.prototype.bind called on incompatible ",I=Array.prototype.slice,R=Object.prototype.toString,B="[object Function]";ne.exports=function(T){var f=this;if("function"!=typeof f||R.call(f)!==B)throw new TypeError(F+f);for(var _,M=I.call(arguments,1),b=function(){if(this instanceof _){var A=f.apply(this,M.concat(I.call(arguments)));return Object(A)===A?A:this}return f.apply(T,M.concat(I.call(arguments)))},C=Math.max(0,f.length-M.length),x=[],E=0;E{"use strict";var R=I(3457);ne.exports=Function.prototype.bind||R},5203:(ne,F,I)=>{"use strict";var R,B=SyntaxError,S=Function,T=TypeError,f=function(l){try{return S('"use strict"; return ('+l+").constructor;")()}catch(c){}},M=Object.getOwnPropertyDescriptor;if(M)try{M({},"")}catch(l){M=null}var _=function(){throw new T},b=M?function(){try{return _}catch(l){try{return M(arguments,"callee").get}catch(c){return _}}}():_,C=I(2969)(),x=I(9757)(),E=Object.getPrototypeOf||(x?function(l){return l.__proto__}:null),P={},A="undefined"!=typeof Uint8Array&&E?E(Uint8Array):R,O={"%AggregateError%":"undefined"==typeof AggregateError?R:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?R:ArrayBuffer,"%ArrayIteratorPrototype%":C&&E?E([][Symbol.iterator]()):R,"%AsyncFromSyncIteratorPrototype%":R,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?R:Atomics,"%BigInt%":"undefined"==typeof BigInt?R:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?R:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?R:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?R:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?R:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?R:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?R:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?R:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?R:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?R:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":C&&E?E(E([][Symbol.iterator]())):R,"%JSON%":"object"==typeof JSON?JSON:R,"%Map%":"undefined"==typeof Map?R:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&C&&E?E((new Map)[Symbol.iterator]()):R,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?R:Promise,"%Proxy%":"undefined"==typeof Proxy?R:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?R:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?R:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&C&&E?E((new Set)[Symbol.iterator]()):R,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?R:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":C&&E?E(""[Symbol.iterator]()):R,"%Symbol%":C?Symbol:R,"%SyntaxError%":B,"%ThrowTypeError%":b,"%TypedArray%":A,"%TypeError%":T,"%Uint8Array%":"undefined"==typeof Uint8Array?R:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?R:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?R:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?R:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?R:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?R:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?R:WeakSet};if(E)try{null.error}catch(l){var N=E(E(l));O["%Error.prototype%"]=N}var U=function l(c){var u;if("%AsyncFunction%"===c)u=f("async function () {}");else if("%GeneratorFunction%"===c)u=f("function* () {}");else if("%AsyncGeneratorFunction%"===c)u=f("async function* () {}");else if("%AsyncGenerator%"===c){var d=l("%AsyncGeneratorFunction%");d&&(u=d.prototype)}else if("%AsyncIteratorPrototype%"===c){var m=l("%AsyncGenerator%");m&&E&&(u=E(m.prototype))}return O[c]=u,u},H={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},V=I(4444),G=I(3164),K=V.call(Function.call,Array.prototype.concat),X=V.call(Function.apply,Array.prototype.splice),Z=V.call(Function.call,String.prototype.replace),z=V.call(Function.call,String.prototype.slice),J=V.call(Function.call,RegExp.prototype.exec),re=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ve=/\\(\\)?/g,y=function(c){var u=z(c,0,1),d=z(c,-1);if("%"===u&&"%"!==d)throw new B("invalid intrinsic syntax, expected closing `%`");if("%"===d&&"%"!==u)throw new B("invalid intrinsic syntax, expected opening `%`");var m=[];return Z(c,re,function(w,p,s,g){m[m.length]=s?Z(g,ve,"$1"):p||w}),m},o=function(c,u){var m,d=c;if(G(H,d)&&(d="%"+(m=H[d])[0]+"%"),G(O,d)){var w=O[d];if(w===P&&(w=U(d)),void 0===w&&!u)throw new T("intrinsic "+c+" exists, but is not available. Please file an issue!");return{alias:m,name:d,value:w}}throw new B("intrinsic "+c+" does not exist!")};ne.exports=function(c,u){if("string"!=typeof c||0===c.length)throw new T("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof u)throw new T('"allowMissing" argument must be a boolean');if(null===J(/^%?[^%]*%?$/,c))throw new B("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var d=y(c),m=d.length>0?d[0]:"",w=o("%"+m+"%",u),p=w.name,s=w.value,g=!1,$=w.alias;$&&(m=$[0],X(d,K([0,1],$)));for(var k=1,q=!0;k=d.length){var fe=M(s,he);s=(q=!!fe)&&"get"in fe&&!("originalValue"in fe.get)?fe.get:s[he]}else q=G(s,he),s=s[he];q&&!g&&(O[p]=s)}}return s}},9757:ne=>{"use strict";var F={foo:{}},I=Object;ne.exports=function(){return{__proto__:F}.foo===F.foo&&!({__proto__:null}instanceof I)}},2969:(ne,F,I)=>{"use strict";var R="undefined"!=typeof Symbol&&Symbol,B=I(1983);ne.exports=function(){return"function"==typeof R&&"function"==typeof Symbol&&"symbol"==typeof R("foo")&&"symbol"==typeof Symbol("bar")&&B()}},1983:ne=>{"use strict";ne.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var I={},R=Symbol("test"),B=Object(R);if("string"==typeof R||"[object Symbol]"!==Object.prototype.toString.call(R)||"[object Symbol]"!==Object.prototype.toString.call(B))return!1;for(R in I[R]=42,I)return!1;if("function"==typeof Object.keys&&0!==Object.keys(I).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(I).length)return!1;var T=Object.getOwnPropertySymbols(I);if(1!==T.length||T[0]!==R||!Object.prototype.propertyIsEnumerable.call(I,R))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var f=Object.getOwnPropertyDescriptor(I,R);if(42!==f.value||!0!==f.enumerable)return!1}return!0}},3164:(ne,F,I)=>{"use strict";var R=I(4444);ne.exports=R.call(Function.call,Object.prototype.hasOwnProperty)},9650:(ne,F,I)=>{"use strict";var R=I(3502).Buffer,B=I(5685).Transform;function f(M){B.call(this),this._block=R.allocUnsafe(M),this._blockSize=M,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}I(3894)(f,B),f.prototype._transform=function(M,_,b){var C=null;try{this.update(M,_)}catch(x){C=x}b(C)},f.prototype._flush=function(M){var _=null;try{this.push(this.digest())}catch(b){_=b}M(_)},f.prototype.update=function(M,_){if(function T(M,_){if(!R.isBuffer(M)&&"string"!=typeof M)throw new TypeError(_+" must be a string or a buffer")}(M,"Data"),this._finalized)throw new Error("Digest already called");R.isBuffer(M)||(M=R.from(M,_));for(var b=this._block,C=0;this._blockOffset+M.length-C>=this._blockSize;){for(var x=this._blockOffset;x0;++E)this._length[E]+=P,(P=this._length[E]/4294967296|0)>0&&(this._length[E]-=4294967296*P);return this},f.prototype._update=function(){throw new Error("_update is not implemented")},f.prototype.digest=function(M){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var _=this._digest();void 0!==M&&(_=_.toString(M)),this._block.fill(0),this._blockOffset=0;for(var b=0;b<4;++b)this._length[b]=0;return _},f.prototype._digest=function(){throw new Error("_digest is not implemented")},ne.exports=f},7084:(ne,F,I)=>{var R=F;R.utils=I(9299),R.common=I(3800),R.sha=I(4962),R.ripemd=I(9458),R.hmac=I(2194),R.sha1=R.sha.sha1,R.sha256=R.sha.sha256,R.sha224=R.sha.sha224,R.sha384=R.sha.sha384,R.sha512=R.sha.sha512,R.ripemd160=R.ripemd.ripemd160},3800:(ne,F,I)=>{"use strict";var R=I(9299),B=I(2391);function S(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}F.BlockHash=S,S.prototype.update=function(f,M){if(f=R.toArray(f,M),this.pending=this.pending?this.pending.concat(f):f,this.pendingTotal+=f.length,this.pending.length>=this._delta8){var _=(f=this.pending).length%this._delta8;this.pending=f.slice(f.length-_,f.length),0===this.pending.length&&(this.pending=null),f=R.join32(f,0,f.length-_,this.endian);for(var b=0;b>>24&255,b[C++]=f>>>16&255,b[C++]=f>>>8&255,b[C++]=255&f}else for(b[C++]=255&f,b[C++]=f>>>8&255,b[C++]=f>>>16&255,b[C++]=f>>>24&255,b[C++]=0,b[C++]=0,b[C++]=0,b[C++]=0,x=8;x{"use strict";var R=I(9299),B=I(2391);function S(T,f,M){if(!(this instanceof S))return new S(T,f,M);this.Hash=T,this.blockSize=T.blockSize/8,this.outSize=T.outSize/8,this.inner=null,this.outer=null,this._init(R.toArray(f,M))}ne.exports=S,S.prototype._init=function(f){f.length>this.blockSize&&(f=(new this.Hash).update(f).digest()),B(f.length<=this.blockSize);for(var M=f.length;M{"use strict";var R=I(9299),B=I(3800),S=R.rotl32,T=R.sum32,f=R.sum32_3,M=R.sum32_4,_=B.BlockHash;function b(){if(!(this instanceof b))return new b;_.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function C(U,H,V,G){return U<=15?H^V^G:U<=31?H&V|~H&G:U<=47?(H|~V)^G:U<=63?H&G|V&~G:H^(V|~G)}function E(U){return U<=15?1352829926:U<=31?1548603684:U<=47?1836072691:U<=63?2053994217:0}R.inherits(b,_),F.ripemd160=b,b.blockSize=512,b.outSize=160,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(H,V){for(var G=this.h[0],K=this.h[1],X=this.h[2],Z=this.h[3],z=this.h[4],J=G,re=K,ve=X,y=Z,o=z,l=0;l<80;l++){var c=T(S(M(G,C(l,K,X,Z),H[P[l]+V],(U=l)<=15?0:U<=31?1518500249:U<=47?1859775393:U<=63?2400959708:2840853838),O[l]),z);G=z,z=Z,Z=S(X,10),X=K,K=c,c=T(S(M(J,C(79-l,re,ve,y),H[A[l]+V],E(l)),N[l]),o),J=o,o=y,y=S(ve,10),ve=re,re=c}var U;c=f(this.h[1],X,y),this.h[1]=f(this.h[2],Z,o),this.h[2]=f(this.h[3],z,J),this.h[3]=f(this.h[4],G,re),this.h[4]=f(this.h[0],K,ve),this.h[0]=c},b.prototype._digest=function(H){return"hex"===H?R.toHex32(this.h,"little"):R.split32(this.h,"little")};var P=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],A=[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=[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],N=[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]},4962:(ne,F,I)=>{"use strict";F.sha1=I(9007),F.sha224=I(55),F.sha256=I(9342),F.sha384=I(8634),F.sha512=I(39)},9007:(ne,F,I)=>{"use strict";var R=I(9299),B=I(3800),S=I(3113),T=R.rotl32,f=R.sum32,M=R.sum32_5,_=S.ft_1,b=B.BlockHash,C=[1518500249,1859775393,2400959708,3395469782];function x(){if(!(this instanceof x))return new x;b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}R.inherits(x,b),ne.exports=x,x.blockSize=512,x.outSize=160,x.hmacStrength=80,x.padLength=64,x.prototype._update=function(P,A){for(var O=this.W,N=0;N<16;N++)O[N]=P[A+N];for(;N{"use strict";var R=I(9299),B=I(9342);function S(){if(!(this instanceof S))return new S;B.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}R.inherits(S,B),ne.exports=S,S.blockSize=512,S.outSize=224,S.hmacStrength=192,S.padLength=64,S.prototype._digest=function(f){return"hex"===f?R.toHex32(this.h.slice(0,7),"big"):R.split32(this.h.slice(0,7),"big")}},9342:(ne,F,I)=>{"use strict";var R=I(9299),B=I(3800),S=I(3113),T=I(2391),f=R.sum32,M=R.sum32_4,_=R.sum32_5,b=S.ch32,C=S.maj32,x=S.s0_256,E=S.s1_256,P=S.g0_256,A=S.g1_256,O=B.BlockHash,N=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function U(){if(!(this instanceof U))return new U;O.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=N,this.W=new Array(64)}R.inherits(U,O),ne.exports=U,U.blockSize=512,U.outSize=256,U.hmacStrength=192,U.padLength=64,U.prototype._update=function(V,G){for(var K=this.W,X=0;X<16;X++)K[X]=V[G+X];for(;X{"use strict";var R=I(9299),B=I(39);function S(){if(!(this instanceof S))return new S;B.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}R.inherits(S,B),ne.exports=S,S.blockSize=1024,S.outSize=384,S.hmacStrength=192,S.padLength=128,S.prototype._digest=function(f){return"hex"===f?R.toHex32(this.h.slice(0,12),"big"):R.split32(this.h.slice(0,12),"big")}},39:(ne,F,I)=>{"use strict";var R=I(9299),B=I(3800),S=I(2391),T=R.rotr64_hi,f=R.rotr64_lo,M=R.shr64_hi,_=R.shr64_lo,b=R.sum64,C=R.sum64_hi,x=R.sum64_lo,E=R.sum64_4_hi,P=R.sum64_4_lo,A=R.sum64_5_hi,O=R.sum64_5_lo,N=B.BlockHash,U=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function H(){if(!(this instanceof H))return new H;N.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=U,this.W=new Array(160)}function V(c,u,d,m,w){var p=c&d^~c&w;return p<0&&(p+=4294967296),p}function G(c,u,d,m,w,p){var s=u&m^~u&p;return s<0&&(s+=4294967296),s}function K(c,u,d,m,w){var p=c&d^c&w^d&w;return p<0&&(p+=4294967296),p}function X(c,u,d,m,w,p){var s=u&m^u&p^m&p;return s<0&&(s+=4294967296),s}function Z(c,u){var p=T(c,u,28)^T(u,c,2)^T(u,c,7);return p<0&&(p+=4294967296),p}function z(c,u){var p=f(c,u,28)^f(u,c,2)^f(u,c,7);return p<0&&(p+=4294967296),p}function J(c,u){var p=T(c,u,14)^T(c,u,18)^T(u,c,9);return p<0&&(p+=4294967296),p}function re(c,u){var p=f(c,u,14)^f(c,u,18)^f(u,c,9);return p<0&&(p+=4294967296),p}function ve(c,u){var p=T(c,u,1)^T(c,u,8)^M(c,u,7);return p<0&&(p+=4294967296),p}function y(c,u){var p=f(c,u,1)^f(c,u,8)^_(c,u,7);return p<0&&(p+=4294967296),p}function o(c,u){var p=T(c,u,19)^T(u,c,29)^M(c,u,6);return p<0&&(p+=4294967296),p}function l(c,u){var p=f(c,u,19)^f(u,c,29)^_(c,u,6);return p<0&&(p+=4294967296),p}R.inherits(H,N),ne.exports=H,H.blockSize=1024,H.outSize=512,H.hmacStrength=192,H.padLength=128,H.prototype._prepareBlock=function(u,d){for(var m=this.W,w=0;w<32;w++)m[w]=u[d+w];for(;w{"use strict";var B=I(9299).rotr32;function T(E,P,A){return E&P^~E&A}function f(E,P,A){return E&P^E&A^P&A}function M(E,P,A){return E^P^A}F.ft_1=function S(E,P,A,O){return 0===E?T(P,A,O):1===E||3===E?M(P,A,O):2===E?f(P,A,O):void 0},F.ch32=T,F.maj32=f,F.p32=M,F.s0_256=function _(E){return B(E,2)^B(E,13)^B(E,22)},F.s1_256=function b(E){return B(E,6)^B(E,11)^B(E,25)},F.g0_256=function C(E){return B(E,7)^B(E,18)^E>>>3},F.g1_256=function x(E){return B(E,17)^B(E,19)^E>>>10}},9299:(ne,F,I)=>{"use strict";var R=I(2391),B=I(3894);function S(l,c){return!(55296!=(64512&l.charCodeAt(c))||c<0||c+1>=l.length)&&56320==(64512&l.charCodeAt(c+1))}function M(l){return(l>>>24|l>>>8&65280|l<<8&16711680|(255&l)<<24)>>>0}function b(l){return 1===l.length?"0"+l:l}function C(l){return 7===l.length?"0"+l:6===l.length?"00"+l:5===l.length?"000"+l:4===l.length?"0000"+l:3===l.length?"00000"+l:2===l.length?"000000"+l:1===l.length?"0000000"+l:l}F.inherits=B,F.toArray=function T(l,c){if(Array.isArray(l))return l.slice();if(!l)return[];var u=[];if("string"==typeof l)if(c){if("hex"===c)for((l=l.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(l="0"+l),m=0;m>6|192,u[d++]=63&w|128):S(l,m)?(w=65536+((1023&w)<<10)+(1023&l.charCodeAt(++m)),u[d++]=w>>18|240,u[d++]=w>>12&63|128,u[d++]=w>>6&63|128,u[d++]=63&w|128):(u[d++]=w>>12|224,u[d++]=w>>6&63|128,u[d++]=63&w|128)}else for(m=0;m>>0;return w},F.split32=function E(l,c){for(var u=new Array(4*l.length),d=0,m=0;d>>24,u[m+1]=w>>>16&255,u[m+2]=w>>>8&255,u[m+3]=255&w):(u[m+3]=w>>>24,u[m+2]=w>>>16&255,u[m+1]=w>>>8&255,u[m]=255&w)}return u},F.rotr32=function P(l,c){return l>>>c|l<<32-c},F.rotl32=function A(l,c){return l<>>32-c},F.sum32=function O(l,c){return l+c>>>0},F.sum32_3=function N(l,c,u){return l+c+u>>>0},F.sum32_4=function U(l,c,u,d){return l+c+u+d>>>0},F.sum32_5=function H(l,c,u,d,m){return l+c+u+d+m>>>0},F.sum64=function V(l,c,u,d){var p=d+l[c+1]>>>0;l[c]=(p>>0,l[c+1]=p},F.sum64_hi=function G(l,c,u,d){return(c+d>>>0>>0},F.sum64_lo=function K(l,c,u,d){return c+d>>>0},F.sum64_4_hi=function X(l,c,u,d,m,w,p,s){var g=0,$=c;return g+=($=$+d>>>0)>>0)>>0)>>0},F.sum64_4_lo=function Z(l,c,u,d,m,w,p,s){return c+d+w+s>>>0},F.sum64_5_hi=function z(l,c,u,d,m,w,p,s,g,$){var k=0,q=c;return k+=(q=q+d>>>0)>>0)>>0)>>0)<$?1:0)>>>0},F.sum64_5_lo=function J(l,c,u,d,m,w,p,s,g,$){return c+d+w+s+$>>>0},F.rotr64_hi=function re(l,c,u){return(c<<32-u|l>>>u)>>>0},F.rotr64_lo=function ve(l,c,u){return(l<<32-u|c>>>u)>>>0},F.shr64_hi=function y(l,c,u){return l>>>u},F.shr64_lo=function o(l,c,u){return(l<<32-u|c>>>u)>>>0}},2438:(ne,F,I)=>{"use strict";var R=I(7084),B=I(8195),S=I(2391);function T(f){if(!(this instanceof T))return new T(f);this.hash=f.hash,this.predResist=!!f.predResist,this.outLen=this.hash.outSize,this.minEntropy=f.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var M=B.toArray(f.entropy,f.entropyEnc||"hex"),_=B.toArray(f.nonce,f.nonceEnc||"hex"),b=B.toArray(f.pers,f.persEnc||"hex");S(M.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(M,_,b)}ne.exports=T,T.prototype._init=function(M,_,b){var C=M.concat(_).concat(b);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var x=0;x=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(M.concat(b||[])),this._reseed=1},T.prototype.generate=function(M,_,b,C){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof _&&(C=b,b=_,_=null),b&&(b=B.toArray(b,C||"hex"),this._update(b));for(var x=[];x.length{var R=I(4216),B=I(8762),S=ne.exports;for(var T in R)R.hasOwnProperty(T)&&(S[T]=R[T]);function f(M){if("string"==typeof M&&(M=B.parse(M)),M.protocol||(M.protocol="https:"),"https:"!==M.protocol)throw new Error('Protocol "'+M.protocol+'" not supported. Expected "https:"');return M}S.request=function(M,_){return M=f(M),R.request.call(this,M,_)},S.get=function(M,_){return M=f(M),R.get.call(this,M,_)}},8461:(ne,F)=>{F.read=function(I,R,B,S,T){var f,M,_=8*T-S-1,b=(1<<_)-1,C=b>>1,x=-7,E=B?T-1:0,P=B?-1:1,A=I[R+E];for(E+=P,f=A&(1<<-x)-1,A>>=-x,x+=_;x>0;f=256*f+I[R+E],E+=P,x-=8);for(M=f&(1<<-x)-1,f>>=-x,x+=S;x>0;M=256*M+I[R+E],E+=P,x-=8);if(0===f)f=1-C;else{if(f===b)return M?NaN:1/0*(A?-1:1);M+=Math.pow(2,S),f-=C}return(A?-1:1)*M*Math.pow(2,f-S)},F.write=function(I,R,B,S,T,f){var M,_,b,C=8*f-T-1,x=(1<>1,P=23===T?Math.pow(2,-24)-Math.pow(2,-77):0,A=S?0:f-1,O=S?1:-1,N=R<0||0===R&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(_=isNaN(R)?1:0,M=x):(M=Math.floor(Math.log(R)/Math.LN2),R*(b=Math.pow(2,-M))<1&&(M--,b*=2),(R+=M+E>=1?P/b:P*Math.pow(2,1-E))*b>=2&&(M++,b/=2),M+E>=x?(_=0,M=x):M+E>=1?(_=(R*b-1)*Math.pow(2,T),M+=E):(_=R*Math.pow(2,E-1)*Math.pow(2,T),M=0));T>=8;I[B+A]=255&_,A+=O,_/=256,T-=8);for(M=M<0;I[B+A]=255&M,A+=O,M/=256,C-=8);I[B+A-O]|=128*N}},3894:ne=>{ne.exports="function"==typeof Object.create?function(I,R){R&&(I.super_=R,I.prototype=Object.create(R.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}))}:function(I,R){if(R){I.super_=R;var B=function(){};B.prototype=R.prototype,I.prototype=new B,I.prototype.constructor=I}}},3407:(ne,F,I)=>{"use strict";var R="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,S=I(5834)("Object.prototype.toString"),T=function(b){return!(R&&b&&"object"==typeof b&&Symbol.toStringTag in b)&&"[object Arguments]"===S(b)},f=function(b){return!!T(b)||null!==b&&"object"==typeof b&&"number"==typeof b.length&&b.length>=0&&"[object Array]"!==S(b)&&"[object Function]"===S(b.callee)},M=function(){return T(arguments)}();T.isLegacyArguments=f,ne.exports=M?T:f},110:ne=>{"use strict";var f,F=Object.prototype.toString,I=Function.prototype.toString,R=/^\s*(?:function)?\*/,B="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,S=Object.getPrototypeOf;ne.exports=function(_){if("function"!=typeof _)return!1;if(R.test(I.call(_)))return!0;if(!B)return"[object GeneratorFunction]"===F.call(_);if(!S)return!1;if(void 0===f){var C=function(){if(!B)return!1;try{return Function("return function*() {}")()}catch(M){}}();f=!!C&&S(C)}return S(_)===f}},597:(ne,F,I)=>{"use strict";var R=I(9076),B=I(7029),S=I(5834),T=S("Object.prototype.toString"),M=I(2969)()&&"symbol"==typeof Symbol.toStringTag,_=B(),b=S("Array.prototype.indexOf",!0)||function(N,U){for(var H=0;H-1}return!!E&&function(N){var U=!1;return R(x,function(H,V){if(!U)try{U=H.call(N)===V}catch(G){}}),U}(N)}},4994:(ne,F,I)=>{var R=I(4312),B=I(6421),S=I(5764),T=I(8685),f=I(6676);function M(_){var b=-1,C=null==_?0:_.length;for(this.clear();++b{var R=I(1840),B=I(4378),S=I(4981),T=I(7343),f=I(8895);function M(_){var b=-1,C=null==_?0:_.length;for(this.clear();++b{var S=I(3436)(I(2119),"Map");ne.exports=S},9850:(ne,F,I)=>{var R=I(638),B=I(1184),S=I(866),T=I(3771),f=I(1772);function M(_){var b=-1,C=null==_?0:_.length;for(this.clear();++b{var R=I(2119);ne.exports=R.Symbol},4633:ne=>{ne.exports=function F(I,R){for(var B=-1,S=null==I?0:I.length,T=Array(S);++B{var R=I(5683),B=I(217),T=Object.prototype.hasOwnProperty;ne.exports=function f(M,_,b){var C=M[_];(!T.call(M,_)||!B(C,b)||void 0===b&&!(_ in M))&&R(M,_,b)}},3503:(ne,F,I)=>{var R=I(217);ne.exports=function B(S,T){for(var f=S.length;f--;)if(R(S[f][0],T))return f;return-1}},5683:(ne,F,I)=>{var R=I(6713);ne.exports=function B(S,T,f){"__proto__"==T&&R?R(S,T,{configurable:!0,enumerable:!0,value:f,writable:!0}):S[T]=f}},5456:(ne,F,I)=>{var R=I(6884),B=I(8533);ne.exports=function S(T,f){for(var M=0,_=(f=R(f,T)).length;null!=T&&M<_;)T=T[B(f[M++])];return M&&M==_?T:void 0}},3337:(ne,F,I)=>{var R=I(443),B=I(1318),S=I(2902),M=R?R.toStringTag:void 0;ne.exports=function _(b){return null==b?void 0===b?"[object Undefined]":"[object Null]":M&&M in Object(b)?B(b):S(b)}},7304:(ne,F,I)=>{var R=I(5946),B=I(1943),S=I(5940),T=I(2827),M=/^\[object .+?Constructor\]$/,E=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");ne.exports=function P(A){return!(!S(A)||B(A))&&(R(A)?E:M).test(T(A))}},5963:(ne,F,I)=>{var R=I(9719),B=I(6884),S=I(8442),T=I(5940),f=I(8533);ne.exports=function M(_,b,C,x){if(!T(_))return _;for(var E=-1,P=(b=B(b,_)).length,A=P-1,O=_;null!=O&&++E{var R=I(443),B=I(4633),S=I(1503),T=I(4129),M=R?R.prototype:void 0,_=M?M.toString:void 0;ne.exports=function b(C){if("string"==typeof C)return C;if(S(C))return B(C,b)+"";if(T(C))return _?_.call(C):"";var x=C+"";return"0"==x&&1/C==-1/0?"-0":x}},6884:(ne,F,I)=>{var R=I(1503),B=I(5352),S=I(2855),T=I(3943);ne.exports=function f(M,_){return R(M)?M:B(M,_)?[M]:S(T(M))}},4610:(ne,F,I)=>{var R=I(2119);ne.exports=R["__core-js_shared__"]},6713:(ne,F,I)=>{var R=I(3436),B=function(){try{var S=R(Object,"defineProperty");return S({},"",{}),S}catch(T){}}();ne.exports=B},9122:ne=>{var F="object"==typeof global&&global&&global.Object===Object&&global;ne.exports=F},4537:(ne,F,I)=>{var R=I(3819);ne.exports=function B(S,T){var f=S.__data__;return R(T)?f["string"==typeof T?"string":"hash"]:f.map}},3436:(ne,F,I)=>{var R=I(7304),B=I(1990);ne.exports=function S(T,f){var M=B(T,f);return R(M)?M:void 0}},1318:(ne,F,I)=>{var R=I(443),B=Object.prototype,S=B.hasOwnProperty,T=B.toString,f=R?R.toStringTag:void 0;ne.exports=function M(_){var b=S.call(_,f),C=_[f];try{_[f]=void 0;var x=!0}catch(P){}var E=T.call(_);return x&&(b?_[f]=C:delete _[f]),E}},1990:ne=>{ne.exports=function F(I,R){return null==I?void 0:I[R]}},4312:(ne,F,I)=>{var R=I(862);ne.exports=function B(){this.__data__=R?R(null):{},this.size=0}},6421:ne=>{ne.exports=function F(I){var R=this.has(I)&&delete this.__data__[I];return this.size-=R?1:0,R}},5764:(ne,F,I)=>{var R=I(862),T=Object.prototype.hasOwnProperty;ne.exports=function f(M){var _=this.__data__;if(R){var b=_[M];return"__lodash_hash_undefined__"===b?void 0:b}return T.call(_,M)?_[M]:void 0}},8685:(ne,F,I)=>{var R=I(862),S=Object.prototype.hasOwnProperty;ne.exports=function T(f){var M=this.__data__;return R?void 0!==M[f]:S.call(M,f)}},6676:(ne,F,I)=>{var R=I(862);ne.exports=function S(T,f){var M=this.__data__;return this.size+=this.has(T)?0:1,M[T]=R&&void 0===f?"__lodash_hash_undefined__":f,this}},8442:ne=>{var I=/^(?:0|[1-9]\d*)$/;ne.exports=function R(B,S){var T=typeof B;return!!(S=null==S?9007199254740991:S)&&("number"==T||"symbol"!=T&&I.test(B))&&B>-1&&B%1==0&&B{var R=I(1503),B=I(4129),S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/;ne.exports=function f(M,_){if(R(M))return!1;var b=typeof M;return!("number"!=b&&"symbol"!=b&&"boolean"!=b&&null!=M&&!B(M))||T.test(M)||!S.test(M)||null!=_&&M in Object(_)}},3819:ne=>{ne.exports=function F(I){var R=typeof I;return"string"==R||"number"==R||"symbol"==R||"boolean"==R?"__proto__"!==I:null===I}},1943:(ne,F,I)=>{var T,R=I(4610),B=(T=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";ne.exports=function S(T){return!!B&&B in T}},1840:ne=>{ne.exports=function F(){this.__data__=[],this.size=0}},4378:(ne,F,I)=>{var R=I(3503),S=Array.prototype.splice;ne.exports=function T(f){var M=this.__data__,_=R(M,f);return!(_<0||(_==M.length-1?M.pop():S.call(M,_,1),--this.size,0))}},4981:(ne,F,I)=>{var R=I(3503);ne.exports=function B(S){var T=this.__data__,f=R(T,S);return f<0?void 0:T[f][1]}},7343:(ne,F,I)=>{var R=I(3503);ne.exports=function B(S){return R(this.__data__,S)>-1}},8895:(ne,F,I)=>{var R=I(3503);ne.exports=function B(S,T){var f=this.__data__,M=R(f,S);return M<0?(++this.size,f.push([S,T])):f[M][1]=T,this}},638:(ne,F,I)=>{var R=I(4994),B=I(9215),S=I(1501);ne.exports=function T(){this.size=0,this.__data__={hash:new R,map:new(S||B),string:new R}}},1184:(ne,F,I)=>{var R=I(4537);ne.exports=function B(S){var T=R(this,S).delete(S);return this.size-=T?1:0,T}},866:(ne,F,I)=>{var R=I(4537);ne.exports=function B(S){return R(this,S).get(S)}},3771:(ne,F,I)=>{var R=I(4537);ne.exports=function B(S){return R(this,S).has(S)}},1772:(ne,F,I)=>{var R=I(4537);ne.exports=function B(S,T){var f=R(this,S),M=f.size;return f.set(S,T),this.size+=f.size==M?0:1,this}},719:(ne,F,I)=>{var R=I(535);ne.exports=function S(T){var f=R(T,function(_){return 500===M.size&&M.clear(),_}),M=f.cache;return f}},862:(ne,F,I)=>{var B=I(3436)(Object,"create");ne.exports=B},2902:ne=>{var I=Object.prototype.toString;ne.exports=function R(B){return I.call(B)}},2119:(ne,F,I)=>{var R=I(9122),B="object"==typeof self&&self&&self.Object===Object&&self,S=R||B||Function("return this")();ne.exports=S},2855:(ne,F,I)=>{var R=I(719),B=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/\\(\\)?/g,T=R(function(f){var M=[];return 46===f.charCodeAt(0)&&M.push(""),f.replace(B,function(_,b,C,x){M.push(C?x.replace(S,"$1"):b||_)}),M});ne.exports=T},8533:(ne,F,I)=>{var R=I(4129);ne.exports=function S(T){if("string"==typeof T||R(T))return T;var f=T+"";return"0"==f&&1/T==-1/0?"-0":f}},2827:ne=>{var I=Function.prototype.toString;ne.exports=function R(B){if(null!=B){try{return I.call(B)}catch(S){}try{return B+""}catch(S){}}return""}},217:ne=>{ne.exports=function F(I,R){return I===R||I!=I&&R!=R}},8817:(ne,F,I)=>{var R=I(5456);ne.exports=function B(S,T,f){var M=null==S?void 0:R(S,T);return void 0===M?f:M}},1503:ne=>{ne.exports=Array.isArray},5946:(ne,F,I)=>{var R=I(3337),B=I(5940);ne.exports=function _(b){if(!B(b))return!1;var C=R(b);return"[object Function]"==C||"[object GeneratorFunction]"==C||"[object AsyncFunction]"==C||"[object Proxy]"==C}},5940:ne=>{ne.exports=function F(I){var R=typeof I;return null!=I&&("object"==R||"function"==R)}},2671:ne=>{ne.exports=function F(I){return null!=I&&"object"==typeof I}},4129:(ne,F,I)=>{var R=I(3337),B=I(2671);ne.exports=function T(f){return"symbol"==typeof f||B(f)&&"[object Symbol]"==R(f)}},535:(ne,F,I)=>{var R=I(9850);function S(T,f){if("function"!=typeof T||null!=f&&"function"!=typeof f)throw new TypeError("Expected a function");var M=function(){var _=arguments,b=f?f.apply(this,_):_[0],C=M.cache;if(C.has(b))return C.get(b);var x=T.apply(this,_);return M.cache=C.set(b,x)||C,x};return M.cache=new(S.Cache||R),M}S.Cache=R,ne.exports=S},4793:(ne,F,I)=>{var R=I(5963);ne.exports=function B(S,T,f){return null==S?S:R(S,T,f)}},3943:(ne,F,I)=>{var R=I(3935);ne.exports=function B(S){return null==S?"":R(S)}},8095:(ne,F,I)=>{"use strict";var R=I(3894),B=I(9650),S=I(3502).Buffer,T=new Array(16);function f(){B.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function M(E,P){return E<>>32-P}function _(E,P,A,O,N,U,H){return M(E+(P&A|~P&O)+N+U|0,H)+P|0}function b(E,P,A,O,N,U,H){return M(E+(P&O|A&~O)+N+U|0,H)+P|0}function C(E,P,A,O,N,U,H){return M(E+(P^A^O)+N+U|0,H)+P|0}function x(E,P,A,O,N,U,H){return M(E+(A^(P|~O))+N+U|0,H)+P|0}R(f,B),f.prototype._update=function(){for(var E=T,P=0;P<16;++P)E[P]=this._block.readInt32LE(4*P);var A=this._a,O=this._b,N=this._c,U=this._d;A=_(A,O,N,U,E[0],3614090360,7),U=_(U,A,O,N,E[1],3905402710,12),N=_(N,U,A,O,E[2],606105819,17),O=_(O,N,U,A,E[3],3250441966,22),A=_(A,O,N,U,E[4],4118548399,7),U=_(U,A,O,N,E[5],1200080426,12),N=_(N,U,A,O,E[6],2821735955,17),O=_(O,N,U,A,E[7],4249261313,22),A=_(A,O,N,U,E[8],1770035416,7),U=_(U,A,O,N,E[9],2336552879,12),N=_(N,U,A,O,E[10],4294925233,17),O=_(O,N,U,A,E[11],2304563134,22),A=_(A,O,N,U,E[12],1804603682,7),U=_(U,A,O,N,E[13],4254626195,12),N=_(N,U,A,O,E[14],2792965006,17),A=b(A,O=_(O,N,U,A,E[15],1236535329,22),N,U,E[1],4129170786,5),U=b(U,A,O,N,E[6],3225465664,9),N=b(N,U,A,O,E[11],643717713,14),O=b(O,N,U,A,E[0],3921069994,20),A=b(A,O,N,U,E[5],3593408605,5),U=b(U,A,O,N,E[10],38016083,9),N=b(N,U,A,O,E[15],3634488961,14),O=b(O,N,U,A,E[4],3889429448,20),A=b(A,O,N,U,E[9],568446438,5),U=b(U,A,O,N,E[14],3275163606,9),N=b(N,U,A,O,E[3],4107603335,14),O=b(O,N,U,A,E[8],1163531501,20),A=b(A,O,N,U,E[13],2850285829,5),U=b(U,A,O,N,E[2],4243563512,9),N=b(N,U,A,O,E[7],1735328473,14),A=C(A,O=b(O,N,U,A,E[12],2368359562,20),N,U,E[5],4294588738,4),U=C(U,A,O,N,E[8],2272392833,11),N=C(N,U,A,O,E[11],1839030562,16),O=C(O,N,U,A,E[14],4259657740,23),A=C(A,O,N,U,E[1],2763975236,4),U=C(U,A,O,N,E[4],1272893353,11),N=C(N,U,A,O,E[7],4139469664,16),O=C(O,N,U,A,E[10],3200236656,23),A=C(A,O,N,U,E[13],681279174,4),U=C(U,A,O,N,E[0],3936430074,11),N=C(N,U,A,O,E[3],3572445317,16),O=C(O,N,U,A,E[6],76029189,23),A=C(A,O,N,U,E[9],3654602809,4),U=C(U,A,O,N,E[12],3873151461,11),N=C(N,U,A,O,E[15],530742520,16),A=x(A,O=C(O,N,U,A,E[2],3299628645,23),N,U,E[0],4096336452,6),U=x(U,A,O,N,E[7],1126891415,10),N=x(N,U,A,O,E[14],2878612391,15),O=x(O,N,U,A,E[5],4237533241,21),A=x(A,O,N,U,E[12],1700485571,6),U=x(U,A,O,N,E[3],2399980690,10),N=x(N,U,A,O,E[10],4293915773,15),O=x(O,N,U,A,E[1],2240044497,21),A=x(A,O,N,U,E[8],1873313359,6),U=x(U,A,O,N,E[15],4264355552,10),N=x(N,U,A,O,E[6],2734768916,15),O=x(O,N,U,A,E[13],1309151649,21),A=x(A,O,N,U,E[4],4149444226,6),U=x(U,A,O,N,E[11],3174756917,10),N=x(N,U,A,O,E[2],718787259,15),O=x(O,N,U,A,E[9],3951481745,21),this._a=this._a+A|0,this._b=this._b+O|0,this._c=this._c+N|0,this._d=this._d+U|0},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var E=S.allocUnsafe(16);return E.writeInt32LE(this._a,0),E.writeInt32LE(this._b,4),E.writeInt32LE(this._c,8),E.writeInt32LE(this._d,12),E},ne.exports=f},7079:(ne,F,I)=>{var R=I(1378),B=I(7950);function S(T){this.rand=T||new B.Rand}ne.exports=S,S.create=function(f){return new S(f)},S.prototype._randbelow=function(f){var M=f.bitLength(),_=Math.ceil(M/8);do{var b=new R(this.rand.generate(_))}while(b.cmp(f)>=0);return b},S.prototype._randrange=function(f,M){var _=M.sub(f);return f.add(this._randbelow(_))},S.prototype.test=function(f,M,_){var b=f.bitLength(),C=R.mont(f),x=new R(1).toRed(C);M||(M=Math.max(1,b/48|0));for(var E=f.subn(1),P=0;!E.testn(P);P++);for(var A=f.shrn(P),O=E.toRed(C);M>0;M--){var U=this._randrange(new R(2),E);_&&_(U);var H=U.toRed(C).redPow(A);if(0!==H.cmp(x)&&0!==H.cmp(O)){for(var V=1;V0;M--){var O=this._randrange(new R(2),x),N=f.gcd(O);if(0!==N.cmpn(1))return N;var U=O.toRed(b).redPow(P);if(0!==U.cmp(C)&&0!==U.cmp(A)){for(var H=1;H=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},2391:ne=>{function F(I,R){if(!I)throw new Error(R||"Assertion failed")}ne.exports=F,F.equal=function(R,B,S){if(R!=B)throw new Error(S||"Assertion failed: "+R+" != "+B)}},8195:(ne,F)=>{"use strict";var I=F;function B(T){return 1===T.length?"0"+T:T}function S(T){for(var f="",M=0;M>8,x=255&b;C?M.push(C,x):M.push(x)}return M},I.zero2=B,I.toHex=S,I.encode=function(f,M){return"hex"===M?S(f):f}},7024:(ne,F,I)=>{var R="function"==typeof Map&&Map.prototype,B=Object.getOwnPropertyDescriptor&&R?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,S=R&&B&&"function"==typeof B.get?B.get:null,T=R&&Map.prototype.forEach,f="function"==typeof Set&&Set.prototype,M=Object.getOwnPropertyDescriptor&&f?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_=f&&M&&"function"==typeof M.get?M.get:null,b=f&&Set.prototype.forEach,x="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,P="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,O="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,N=Boolean.prototype.valueOf,U=Object.prototype.toString,H=Function.prototype.toString,V=String.prototype.match,G="function"==typeof BigInt?BigInt.prototype.valueOf:null,K=Object.getOwnPropertySymbols,X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Z="function"==typeof Symbol&&"object"==typeof Symbol.iterator,z=Object.prototype.propertyIsEnumerable,J=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Re){return Re.__proto__}:null),re=I(4654).custom,ve=re&&g(re)?re:null,y="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function o(Re,we,Oe){var wt="double"===(Oe.quoteStyle||we)?'"':"'";return wt+Re+wt}function l(Re){return String(Re).replace(/"/g,""")}function c(Re){return!("[object Array]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}function g(Re){if(Z)return Re&&"object"==typeof Re&&Re instanceof Symbol;if("symbol"==typeof Re)return!0;if(!Re||"object"!=typeof Re||!X)return!1;try{return X.call(Re),!0}catch(we){}return!1}ne.exports=function Re(we,Oe,wt,Be){var oe=Oe||{};if(q(oe,"quoteStyle")&&"single"!==oe.quoteStyle&&"double"!==oe.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(oe,"maxStringLength")&&("number"==typeof oe.maxStringLength?oe.maxStringLength<0&&oe.maxStringLength!==1/0:null!==oe.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var te=!q(oe,"customInspect")||oe.customInspect;if("boolean"!=typeof te&&"symbol"!==te)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(oe,"indent")&&null!==oe.indent&&"\t"!==oe.indent&&!(parseInt(oe.indent,10)===oe.indent&&oe.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===we)return"undefined";if(null===we)return"null";if("boolean"==typeof we)return we?"true":"false";if("string"==typeof we)return _e(we,oe);if("number"==typeof we)return 0===we?1/0/we>0?"0":"-0":String(we);if("bigint"==typeof we)return String(we)+"n";var W=void 0===oe.depth?5:oe.depth;if(void 0===wt&&(wt=0),wt>=W&&W>0&&"object"==typeof we)return c(we)?"[Array]":"[Object]";var de=function Le(Re,we){var Oe;if("\t"===Re.indent)Oe="\t";else{if(!("number"==typeof Re.indent&&Re.indent>0))return null;Oe=Array(Re.indent+1).join(" ")}return{base:Oe,prev:Array(we+1).join(Oe)}}(oe,wt);if(void 0===Be)Be=[];else if(ge(Be,we)>=0)return"[Circular]";function Pe(Ne,Xt,$e){if(Xt&&(Be=Be.slice()).push(Xt),$e){var et={depth:oe.depth};return q(oe,"quoteStyle")&&(et.quoteStyle=oe.quoteStyle),Re(Ne,et,wt+1,Be)}return Re(Ne,oe,wt+1,Be)}if("function"==typeof we){var Ee=function be(Re){if(Re.name)return Re.name;var we=V.call(H.call(Re),/^function\s*([\w$]+)/);return we?we[1]:null}(we),Ae=Ce(we,Pe);return"[Function"+(Ee?": "+Ee:" (anonymous)")+"]"+(Ae.length>0?" { "+Ae.join(", ")+" }":"")}if(g(we)){var St=Z?String(we).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):X.call(we);return"object"!=typeof we||Z?St:le(St)}if(function ue(Re){return!(!Re||"object"!=typeof Re)&&("undefined"!=typeof HTMLElement&&Re instanceof HTMLElement||"string"==typeof Re.nodeName&&"function"==typeof Re.getAttribute)}(we)){for(var Xe="<"+String(we.nodeName).toLowerCase(),Je=we.attributes||[],kt=0;kt"}if(c(we)){if(0===we.length)return"[]";var Ye=Ce(we,Pe);return de&&!function ae(Re){for(var we=0;we=0)return!1;return!0}(Ye)?"["+xe(Ye,de)+"]":"[ "+Ye.join(", ")+" ]"}if(function m(Re){return!("[object Error]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we)){var tt=Ce(we,Pe);return 0===tt.length?"["+String(we)+"]":"{ ["+String(we)+"] "+tt.join(", ")+" }"}if("object"==typeof we&&te){if(ve&&"function"==typeof we[ve])return we[ve]();if("symbol"!==te&&"function"==typeof we.inspect)return we.inspect()}if(function fe(Re){if(!S||!Re||"object"!=typeof Re)return!1;try{S.call(Re);try{_.call(Re)}catch(we){return!0}return Re instanceof Map}catch(we){}return!1}(we)){var Dn=[];return T.call(we,function(Ne,Xt){Dn.push(Pe(Xt,we,!0)+" => "+Pe(Ne,we))}),Y("Map",S.call(we),Dn,de)}if(function ee(Re){if(!_||!Re||"object"!=typeof Re)return!1;try{_.call(Re);try{S.call(Re)}catch(we){return!0}return Re instanceof Set}catch(we){}return!1}(we)){var nt=[];return b.call(we,function(Ne){nt.push(Pe(Ne,we))}),Y("Set",_.call(we),nt,de)}if(function se(Re){if(!x||!Re||"object"!=typeof Re)return!1;try{x.call(Re,x);try{P.call(Re,P)}catch(we){return!0}return Re instanceof WeakMap}catch(we){}return!1}(we))return ie("WeakMap");if(function pe(Re){if(!P||!Re||"object"!=typeof Re)return!1;try{P.call(Re,P);try{x.call(Re,x)}catch(we){return!0}return Re instanceof WeakSet}catch(we){}return!1}(we))return ie("WeakSet");if(function ce(Re){if(!O||!Re||"object"!=typeof Re)return!1;try{return O.call(Re),!0}catch(we){}return!1}(we))return ie("WeakRef");if(function p(Re){return!("[object Number]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we))return le(Pe(Number(we)));if(function $(Re){if(!Re||"object"!=typeof Re||!G)return!1;try{return G.call(Re),!0}catch(we){}return!1}(we))return le(Pe(G.call(we)));if(function s(Re){return!("[object Boolean]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we))return le(N.call(we));if(function w(Re){return!("[object String]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we))return le(Pe(String(we)));if(!function u(Re){return!("[object Date]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we)&&!function d(Re){return!("[object RegExp]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we)){var ht=Ce(we,Pe),ln=J?J(we)===Object.prototype:we instanceof Object||we.constructor===Object,We=we instanceof Object?"":"null prototype",ze=!ln&&y&&Object(we)===we&&y in we?he(we).slice(8,-1):We?"Object":"",at=(ln||"function"!=typeof we.constructor?"":we.constructor.name?we.constructor.name+" ":"")+(ze||We?"["+[].concat(ze||[],We||[]).join(": ")+"] ":"");return 0===ht.length?at+"{}":de?at+"{"+xe(ht,de)+"}":at+"{ "+ht.join(", ")+" }"}return String(we)};var k=Object.prototype.hasOwnProperty||function(Re){return Re in this};function q(Re,we){return k.call(Re,we)}function he(Re){return U.call(Re)}function ge(Re,we){if(Re.indexOf)return Re.indexOf(we);for(var Oe=0,wt=Re.length;Oewe.maxStringLength){var Oe=Re.length-we.maxStringLength,wt="... "+Oe+" more character"+(Oe>1?"s":"");return _e(Re.slice(0,we.maxStringLength),we)+wt}return o(Re.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,Me),"single",we)}function Me(Re){var we=Re.charCodeAt(0),Oe={8:"b",9:"t",10:"n",12:"f",13:"r"}[we];return Oe?"\\"+Oe:"\\x"+(we<16?"0":"")+we.toString(16).toUpperCase()}function le(Re){return"Object("+Re+")"}function ie(Re){return Re+" { ? }"}function Y(Re,we,Oe,wt){return Re+" ("+we+") {"+(wt?xe(Oe,wt):Oe.join(", "))+"}"}function xe(Re,we){if(0===Re.length)return"";var Oe="\n"+we.prev+we.base;return Oe+Re.join(","+Oe)+"\n"+we.prev}function Ce(Re,we){var Oe=c(Re),wt=[];if(Oe){wt.length=Re.length;for(var Be=0;Be{F.endianness=function(){return"LE"},F.hostname=function(){return"undefined"!=typeof location?location.hostname:""},F.loadavg=function(){return[]},F.uptime=function(){return 0},F.freemem=function(){return Number.MAX_VALUE},F.totalmem=function(){return Number.MAX_VALUE},F.cpus=function(){return[]},F.type=function(){return"Browser"},F.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},F.networkInterfaces=F.getNetworkInterfaces=function(){return{}},F.arch=function(){return"javascript"},F.platform=function(){return"browser"},F.tmpdir=F.tmpDir=function(){return"/tmp"},F.EOL="\n",F.homedir=function(){return"/"}},2999:(ne,F,I)=>{"use strict";var R=I(7977);F.certificate=I(2390);var B=R.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});F.RSAPrivateKey=B;var S=R.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});F.RSAPublicKey=S;var T=R.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(f),this.key("subjectPublicKey").bitstr())});F.PublicKey=T;var f=R.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),M=R.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(f),this.key("subjectPrivateKey").octstr())});F.PrivateKey=M;var _=R.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});F.EncryptedPrivateKey=_;var b=R.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});F.DSAPrivateKey=b,F.DSAparam=R.define("DSAparam",function(){this.int()});var C=R.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(x),this.key("publicKey").optional().explicit(1).bitstr())});F.ECPrivateKey=C;var x=R.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});F.signature=R.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},2390:(ne,F,I)=>{"use strict";var R=I(7977),B=R.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),S=R.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),T=R.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),f=R.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(T),this.key("subjectPublicKey").bitstr())}),M=R.define("RelativeDistinguishedName",function(){this.setof(S)}),_=R.define("RDNSequence",function(){this.seqof(M)}),b=R.define("Name",function(){this.choice({rdnSequence:this.use(_)})}),C=R.define("Validity",function(){this.seq().obj(this.key("notBefore").use(B),this.key("notAfter").use(B))}),x=R.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),E=R.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(T),this.key("issuer").use(b),this.key("validity").use(C),this.key("subject").use(b),this.key("subjectPublicKeyInfo").use(f),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(x).optional())}),P=R.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(E),this.key("signatureAlgorithm").use(T),this.key("signatureValue").bitstr())});ne.exports=P},5269:(ne,F,I)=>{var R=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,B=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,S=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,T=I(347),f=I(4330),M=I(3502).Buffer;ne.exports=function(_,b){var E,C=_.toString(),x=C.match(R);if(x){var A="aes"+x[1],O=M.from(x[2],"hex"),N=M.from(x[3].replace(/[\r\n]/g,""),"base64"),U=T(b,O.slice(0,8),parseInt(x[1],10)).key,H=[],V=f.createDecipheriv(A,U,O);H.push(V.update(N)),H.push(V.final()),E=M.concat(H)}else{var P=C.match(S);E=M.from(P[2].replace(/[\r\n]/g,""),"base64")}return{tag:C.match(B)[1],data:E}}},2772:(ne,F,I)=>{var R=I(2999),B=I(2562),S=I(5269),T=I(4330),f=I(9357),M=I(3502).Buffer;function _(C){var x;"object"==typeof C&&!M.isBuffer(C)&&(x=C.passphrase,C=C.key),"string"==typeof C&&(C=M.from(C));var O,N,E=S(C,x),P=E.tag,A=E.data;switch(P){case"CERTIFICATE":N=R.certificate.decode(A,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(N||(N=R.PublicKey.decode(A,"der")),O=N.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return R.RSAPublicKey.decode(N.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return N.subjectPrivateKey=N.subjectPublicKey,{type:"ec",data:N};case"1.2.840.10040.4.1":return N.algorithm.params.pub_key=R.DSAparam.decode(N.subjectPublicKey.data,"der"),{type:"dsa",data:N.algorithm.params};default:throw new Error("unknown key id "+O)}case"ENCRYPTED PRIVATE KEY":A=function b(C,x){var E=C.algorithm.decrypt.kde.kdeparams.salt,P=parseInt(C.algorithm.decrypt.kde.kdeparams.iters.toString(),10),A=B[C.algorithm.decrypt.cipher.algo.join(".")],O=C.algorithm.decrypt.cipher.iv,N=C.subjectPrivateKey,U=parseInt(A.split("-")[1],10)/8,H=f.pbkdf2Sync(x,E,P,U,"sha1"),V=T.createDecipheriv(A,H,O),G=[];return G.push(V.update(N)),G.push(V.final()),M.concat(G)}(A=R.EncryptedPrivateKey.decode(A,"der"),x);case"PRIVATE KEY":switch(O=(N=R.PrivateKey.decode(A,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return R.RSAPrivateKey.decode(N.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:N.algorithm.curve,privateKey:R.ECPrivateKey.decode(N.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return N.algorithm.params.priv_key=R.DSAparam.decode(N.subjectPrivateKey,"der"),{type:"dsa",params:N.algorithm.params};default:throw new Error("unknown key id "+O)}case"RSA PUBLIC KEY":return R.RSAPublicKey.decode(A,"der");case"RSA PRIVATE KEY":return R.RSAPrivateKey.decode(A,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:R.DSAPrivateKey.decode(A,"der")};case"EC PRIVATE KEY":return{curve:(A=R.ECPrivateKey.decode(A,"der")).parameters.value,privateKey:A.privateKey};default:throw new Error("unknown key type "+P)}}ne.exports=_,_.signature=R.signature},9357:(ne,F,I)=>{F.pbkdf2=I(415),F.pbkdf2Sync=I(7472)},415:(ne,F,I)=>{var M,E,R=I(3502).Buffer,B=I(2697),S=I(8867),T=I(7472),f=I(4566),_=global.crypto&&global.crypto.subtle,b={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},C=[];function P(){return E||(E=global.process&&global.process.nextTick?global.process.nextTick:global.queueMicrotask?global.queueMicrotask:global.setImmediate?global.setImmediate:global.setTimeout)}function A(N,U,H,V,G){return _.importKey("raw",N,{name:"PBKDF2"},!1,["deriveBits"]).then(function(K){return _.deriveBits({name:"PBKDF2",salt:U,iterations:H,hash:{name:G}},K,V<<3)}).then(function(K){return R.from(K)})}ne.exports=function(N,U,H,V,G,K){"function"==typeof G&&(K=G,G=void 0);var X=b[(G=G||"sha1").toLowerCase()];if(X&&"function"==typeof global.Promise){if(B(H,V),N=f(N,S,"Password"),U=f(U,S,"Salt"),"function"!=typeof K)throw new Error("No callback provided to pbkdf2");!function O(N,U){N.then(function(H){P()(function(){U(null,H)})},function(H){P()(function(){U(H)})})}(function x(N){if(global.process&&!global.process.browser||!_||!_.importKey||!_.deriveBits)return Promise.resolve(!1);if(void 0!==C[N])return C[N];var U=A(M=M||R.alloc(8),M,10,128,N).then(function(){return!0}).catch(function(){return!1});return C[N]=U,U}(X).then(function(Z){return Z?A(N,U,H,V,X):T(N,U,H,V,G)}),K)}else P()(function(){var Z;try{Z=T(N,U,H,V,G)}catch(z){return K(z)}K(null,Z)})}},8867:ne=>{var F;F=global.process&&global.process.browser?"utf-8":global.process&&global.process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",ne.exports=F},2697:ne=>{var F=Math.pow(2,30)-1;ne.exports=function(I,R){if("number"!=typeof I)throw new TypeError("Iterations not a number");if(I<0)throw new TypeError("Bad iterations");if("number"!=typeof R)throw new TypeError("Key length not a number");if(R<0||R>F||R!=R)throw new TypeError("Bad key length")}},7472:(ne,F,I)=>{var R=I(5640),B=I(5634),S=I(5244),T=I(3502).Buffer,f=I(2697),M=I(8867),_=I(4566),b=T.alloc(128),C={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function x(A,O,N){var U=function E(A){return"rmd160"===A||"ripemd160"===A?function N(U){return(new B).update(U).digest()}:"md5"===A?R:function O(U){return S(A).update(U).digest()}}(A),H="sha512"===A||"sha384"===A?128:64;O.length>H?O=U(O):O.length{var R=I(3502).Buffer;ne.exports=function(B,S,T){if(R.isBuffer(B))return B;if("string"==typeof B)return R.from(B,S);if(ArrayBuffer.isView(B))return R.from(B.buffer);throw new TypeError(T+" must be a string, a Buffer, a typed array or a DataView")}},3701:(ne,F,I)=>{F.publicEncrypt=I(6562),F.privateDecrypt=I(6705),F.privateEncrypt=function(B,S){return F.publicEncrypt(B,S,!0)},F.publicDecrypt=function(B,S){return F.privateDecrypt(B,S,!0)}},6945:(ne,F,I)=>{var R=I(6386),B=I(3502).Buffer;function S(T){var f=B.allocUnsafe(4);return f.writeUInt32BE(T,0),f}ne.exports=function(T,f){for(var b,M=B.alloc(0),_=0;M.length=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},6705:(ne,F,I)=>{var R=I(2772),B=I(6945),S=I(9401),T=I(2057),f=I(8466),M=I(6386),_=I(8651),b=I(3502).Buffer;ne.exports=function(A,O,N){var U;U=A.padding?A.padding:N?1:4;var G,H=R(A),V=H.modulus.byteLength();if(O.length>V||new T(O).cmp(H.modulus)>=0)throw new Error("decryption error");G=N?_(new T(O),H):f(O,H);var K=b.alloc(V-G.length);if(G=b.concat([K,G],V),4===U)return function C(P,A){var O=P.modulus.byteLength(),N=M("sha1").update(b.alloc(0)).digest(),U=N.length;if(0!==A[0])throw new Error("decryption error");var H=A.slice(1,U+1),V=A.slice(U+1),G=S(H,B(V,U)),K=S(V,B(G,O-U-1));if(function E(P,A){P=b.from(P),A=b.from(A);var O=0,N=P.length;P.length!==A.length&&(O++,N=Math.min(P.length,A.length));for(var U=-1;++U=A.length){H++;break}var V=A.slice(2,U-1);if(("0002"!==N.toString("hex")&&!O||"0001"!==N.toString("hex")&&O)&&H++,V.length<8&&H++,H)throw new Error("decryption error");return A.slice(U)}(0,G,N);if(3===U)return G;throw new Error("unknown padding")}},6562:(ne,F,I)=>{var R=I(2772),B=I(3753),S=I(6386),T=I(6945),f=I(9401),M=I(2057),_=I(8651),b=I(8466),C=I(3502).Buffer;ne.exports=function(O,N,U){var H;H=O.padding?O.padding:U?1:4;var G,V=R(O);if(4===H)G=function x(A,O){var N=A.modulus.byteLength(),U=O.length,H=S("sha1").update(C.alloc(0)).digest(),V=H.length,G=2*V;if(U>N-G-2)throw new Error("message too long");var K=C.alloc(N-U-G-2),X=N-V-1,Z=B(V),z=f(C.concat([H,K,C.alloc(1,1),O],X),T(Z,X)),J=f(Z,T(z,V));return new M(C.concat([C.alloc(1),J,z],N))}(V,N);else if(1===H)G=function E(A,O,N){var V,U=O.length,H=A.modulus.byteLength();if(U>H-11)throw new Error("message too long");return V=N?C.alloc(H-U-3,255):function P(A){for(var V,O=C.allocUnsafe(A),N=0,U=B(2*A),H=0;N=0)throw new Error("data too long for modulus")}return U?b(G,V):_(G,V)}},8651:(ne,F,I)=>{var R=I(2057),B=I(3502).Buffer;ne.exports=function S(T,f){return B.from(T.toRed(R.mont(f.modulus)).redPow(new R(f.publicExponent)).fromRed().toArray())}},9401:ne=>{ne.exports=function(I,R){for(var B=I.length,S=-1;++S{"use strict";var R=65536,T=I(3502).Buffer,f=global.crypto||global.msCrypto;ne.exports=f&&f.getRandomValues?function M(_,b){if(_>4294967295)throw new RangeError("requested too many random bytes");var C=T.allocUnsafe(_);if(_>0)if(_>R)for(var x=0;x<_;x+=R)f.getRandomValues(C.slice(x,x+R));else f.getRandomValues(C);return"function"==typeof b?process.nextTick(function(){b(null,C)}):C}:function S(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},4275:(ne,F,I)=>{"use strict";function R(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var B=I(3502),S=I(3753),T=B.Buffer,f=B.kMaxLength,M=global.crypto||global.msCrypto,_=Math.pow(2,32)-1;function b(A,O){if("number"!=typeof A||A!=A)throw new TypeError("offset must be a number");if(A>_||A<0)throw new TypeError("offset must be a uint32");if(A>f||A>O)throw new RangeError("offset out of range")}function C(A,O,N){if("number"!=typeof A||A!=A)throw new TypeError("size must be a number");if(A>_||A<0)throw new TypeError("size must be a uint32");if(A+O>N||A>f)throw new RangeError("buffer too small")}function E(A,O,N,U){if(process.browser){var V=new Uint8Array(A.buffer,O,N);return M.getRandomValues(V),U?void process.nextTick(function(){U(null,A)}):A}if(!U)return S(N).copy(A,O),A;S(N,function(K,X){if(K)return U(K);X.copy(A,O),U(null,A)})}M&&M.getRandomValues||!process.browser?(F.randomFill=function x(A,O,N,U){if(!(T.isBuffer(A)||A instanceof global.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof O)U=O,O=0,N=A.length;else if("function"==typeof N)U=N,N=A.length-O;else if("function"!=typeof U)throw new TypeError('"cb" argument must be a function');return b(O,A.length),C(N,O,A.length),E(A,O,N,U)},F.randomFillSync=function P(A,O,N){if(void 0===O&&(O=0),!(T.isBuffer(A)||A instanceof global.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return b(O,A.length),void 0===N&&(N=A.length-O),C(N,O,A.length),E(A,O,N)}):(F.randomFill=R,F.randomFillSync=R)},891:ne=>{"use strict";var I={};function R(M,_,b){b||(b=Error);var x=function(E){function P(A,O,N){return E.call(this,function C(E,P,A){return"string"==typeof _?_:_(E,P,A)}(A,O,N))||this}return function F(M,_){M.prototype=Object.create(_.prototype),M.prototype.constructor=M,M.__proto__=_}(P,E),P}(b);x.prototype.name=b.name,x.prototype.code=M,I[M]=x}function B(M,_){if(Array.isArray(M)){var b=M.length;return M=M.map(function(C){return String(C)}),b>2?"one of ".concat(_," ").concat(M.slice(0,b-1).join(", "),", or ")+M[b-1]:2===b?"one of ".concat(_," ").concat(M[0]," or ").concat(M[1]):"of ".concat(_," ").concat(M[0])}return"of ".concat(_," ").concat(String(M))}R("ERR_INVALID_OPT_VALUE",function(M,_){return'The value "'+_+'" is invalid for option "'+M+'"'},TypeError),R("ERR_INVALID_ARG_TYPE",function(M,_,b){var C,x;if("string"==typeof _&&function S(M,_,b){return M.substr(!b||b<0?0:+b,_.length)===_}(_,"not ")?(C="must not be",_=_.replace(/^not /,"")):C="must be",function T(M,_,b){return(void 0===b||b>M.length)&&(b=M.length),M.substring(b-_.length,b)===_}(M," argument"))x="The ".concat(M," ").concat(C," ").concat(B(_,"type"));else{var E=function f(M,_,b){return"number"!=typeof b&&(b=0),!(b+_.length>M.length)&&-1!==M.indexOf(_,b)}(M,".")?"property":"argument";x='The "'.concat(M,'" ').concat(E," ").concat(C," ").concat(B(_,"type"))}return x+". Received type ".concat(typeof b)},TypeError),R("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),R("ERR_METHOD_NOT_IMPLEMENTED",function(M){return"The "+M+" method is not implemented"}),R("ERR_STREAM_PREMATURE_CLOSE","Premature close"),R("ERR_STREAM_DESTROYED",function(M){return"Cannot call "+M+" after a stream was destroyed"}),R("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),R("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),R("ERR_STREAM_WRITE_AFTER_END","write after end"),R("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),R("ERR_UNKNOWN_ENCODING",function(M){return"Unknown encoding: "+M},TypeError),R("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),ne.exports.q=I},1339:(ne,F,I)=>{"use strict";var R=Object.keys||function(x){var E=[];for(var P in x)E.push(P);return E};ne.exports=_;var B=I(3154),S=I(520);I(3894)(_,B);for(var T=R(S.prototype),f=0;f{"use strict";ne.exports=B;var R=I(6025);function B(S){if(!(this instanceof B))return new B(S);R.call(this,S)}I(3894)(B,R),B.prototype._transform=function(S,T,f){f(null,S)}},3154:(ne,F,I)=>{"use strict";var R;ne.exports=y,y.ReadableState=ve,I(9069);var x,S=function(_e,Me){return _e.listeners(Me).length},T=I(4970),f=I(3172).Buffer,M=global.Uint8Array||function(){},C=I(6788);x=C&&C.debuglog?C.debuglog("stream"):function(){};var K,X,Z,E=I(5019),P=I(1920),O=I(7102).getHighWaterMark,N=I(891).q,U=N.ERR_INVALID_ARG_TYPE,H=N.ERR_STREAM_PUSH_AFTER_EOF,V=N.ERR_METHOD_NOT_IMPLEMENTED,G=N.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;I(3894)(y,T);var z=P.errorOrDestroy,J=["error","close","destroy","pause","resume"];function ve(ue,_e,Me){R=R||I(1339),"boolean"!=typeof Me&&(Me=_e instanceof R),this.objectMode=!!(ue=ue||{}).objectMode,Me&&(this.objectMode=this.objectMode||!!ue.readableObjectMode),this.highWaterMark=O(this,ue,"readableHighWaterMark",Me),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.paused=!0,this.emitClose=!1!==ue.emitClose,this.autoDestroy=!!ue.autoDestroy,this.destroyed=!1,this.defaultEncoding=ue.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ue.encoding&&(K||(K=I(3054).s),this.decoder=new K(ue.encoding),this.encoding=ue.encoding)}function y(ue){if(R=R||I(1339),!(this instanceof y))return new y(ue);this._readableState=new ve(ue,this,this instanceof R),this.readable=!0,ue&&("function"==typeof ue.read&&(this._read=ue.read),"function"==typeof ue.destroy&&(this._destroy=ue.destroy)),T.call(this)}function o(ue,_e,Me,le,ie){x("readableAddChunk",_e);var ae,Y=ue._readableState;if(null===_e)Y.reading=!1,function w(ue,_e){if(x("onEofChunk"),!_e.ended){if(_e.decoder){var Me=_e.decoder.end();Me&&Me.length&&(_e.buffer.push(Me),_e.length+=_e.objectMode?1:Me.length)}_e.ended=!0,_e.sync?p(ue):(_e.needReadable=!1,_e.emittedReadable||(_e.emittedReadable=!0,s(ue)))}}(ue,Y);else if(ie||(ae=function c(ue,_e){var Me;return!function b(ue){return f.isBuffer(ue)||ue instanceof M}(_e)&&"string"!=typeof _e&&void 0!==_e&&!ue.objectMode&&(Me=new U("chunk",["string","Buffer","Uint8Array"],_e)),Me}(Y,_e)),ae)z(ue,ae);else if(Y.objectMode||_e&&_e.length>0)if("string"!=typeof _e&&!Y.objectMode&&Object.getPrototypeOf(_e)!==f.prototype&&(_e=function _(ue){return f.from(ue)}(_e)),le)Y.endEmitted?z(ue,new G):l(ue,Y,_e,!0);else if(Y.ended)z(ue,new H);else{if(Y.destroyed)return!1;Y.reading=!1,Y.decoder&&!Me?(_e=Y.decoder.write(_e),Y.objectMode||0!==_e.length?l(ue,Y,_e,!1):g(ue,Y)):l(ue,Y,_e,!1)}else le||(Y.reading=!1,g(ue,Y));return!Y.ended&&(Y.length_e.highWaterMark&&(_e.highWaterMark=function d(ue){return ue>=u?ue=u:(ue--,ue|=ue>>>1,ue|=ue>>>2,ue|=ue>>>4,ue|=ue>>>8,ue|=ue>>>16,ue++),ue}(ue)),ue<=_e.length?ue:_e.ended?_e.length:(_e.needReadable=!0,0))}function p(ue){var _e=ue._readableState;x("emitReadable",_e.needReadable,_e.emittedReadable),_e.needReadable=!1,_e.emittedReadable||(x("emitReadable",_e.flowing),_e.emittedReadable=!0,process.nextTick(s,ue))}function s(ue){var _e=ue._readableState;x("emitReadable_",_e.destroyed,_e.length,_e.ended),!_e.destroyed&&(_e.length||_e.ended)&&(ue.emit("readable"),_e.emittedReadable=!1),_e.needReadable=!_e.flowing&&!_e.ended&&_e.length<=_e.highWaterMark,fe(ue)}function g(ue,_e){_e.readingMore||(_e.readingMore=!0,process.nextTick($,ue,_e))}function $(ue,_e){for(;!_e.reading&&!_e.ended&&(_e.length<_e.highWaterMark||_e.flowing&&0===_e.length);){var Me=_e.length;if(x("maybeReadMore read 0"),ue.read(0),Me===_e.length)break}_e.readingMore=!1}function q(ue){var _e=ue._readableState;_e.readableListening=ue.listenerCount("readable")>0,_e.resumeScheduled&&!_e.paused?_e.flowing=!0:ue.listenerCount("data")>0&&ue.resume()}function he(ue){x("readable nexttick read 0"),ue.read(0)}function ge(ue,_e){x("resume",_e.reading),_e.reading||ue.read(0),_e.resumeScheduled=!1,ue.emit("resume"),fe(ue),_e.flowing&&!_e.reading&&ue.read(0)}function fe(ue){var _e=ue._readableState;for(x("flow",_e.flowing);_e.flowing&&null!==ue.read(););}function se(ue,_e){return 0===_e.length?null:(_e.objectMode?Me=_e.buffer.shift():!ue||ue>=_e.length?(Me=_e.decoder?_e.buffer.join(""):1===_e.buffer.length?_e.buffer.first():_e.buffer.concat(_e.length),_e.buffer.clear()):Me=_e.buffer.consume(ue,_e.decoder),Me);var Me}function ce(ue){var _e=ue._readableState;x("endReadable",_e.endEmitted),_e.endEmitted||(_e.ended=!0,process.nextTick(ee,_e,ue))}function ee(ue,_e){if(x("endReadableNT",ue.endEmitted,ue.length),!ue.endEmitted&&0===ue.length&&(ue.endEmitted=!0,_e.readable=!1,_e.emit("end"),ue.autoDestroy)){var Me=_e._writableState;(!Me||Me.autoDestroy&&Me.finished)&&_e.destroy()}}function pe(ue,_e){for(var Me=0,le=ue.length;Me=_e.highWaterMark:_e.length>0)||_e.ended))return x("read: emitReadable",_e.length,_e.ended),0===_e.length&&_e.ended?ce(this):p(this),null;if(0===(ue=m(ue,_e))&&_e.ended)return 0===_e.length&&ce(this),null;var ie,le=_e.needReadable;return x("need readable",le),(0===_e.length||_e.length-ue<_e.highWaterMark)&&x("length less than watermark",le=!0),_e.ended||_e.reading?x("reading or ended",le=!1):le&&(x("do read"),_e.reading=!0,_e.sync=!0,0===_e.length&&(_e.needReadable=!0),this._read(_e.highWaterMark),_e.sync=!1,_e.reading||(ue=m(Me,_e))),null===(ie=ue>0?se(ue,_e):null)?(_e.needReadable=_e.length<=_e.highWaterMark,ue=0):(_e.length-=ue,_e.awaitDrain=0),0===_e.length&&(_e.ended||(_e.needReadable=!0),Me!==ue&&_e.ended&&ce(this)),null!==ie&&this.emit("data",ie),ie},y.prototype._read=function(ue){z(this,new V("_read()"))},y.prototype.pipe=function(ue,_e){var Me=this,le=this._readableState;switch(le.pipesCount){case 0:le.pipes=ue;break;case 1:le.pipes=[le.pipes,ue];break;default:le.pipes.push(ue)}le.pipesCount+=1,x("pipe count=%d opts=%j",le.pipesCount,_e);var Y=_e&&!1===_e.end||ue===process.stdout||ue===process.stderr?oe:Le;function Le(){x("onend"),ue.end()}le.endEmitted?process.nextTick(Y):Me.once("end",Y),ue.on("unpipe",function ae(te,W){x("onunpipe"),te===Me&&W&&!1===W.hasUnpiped&&(W.hasUnpiped=!0,function Re(){x("cleanup"),ue.removeListener("close",wt),ue.removeListener("finish",Be),ue.removeListener("drain",xe),ue.removeListener("error",Oe),ue.removeListener("unpipe",ae),Me.removeListener("end",Le),Me.removeListener("end",oe),Me.removeListener("data",we),Ce=!0,le.awaitDrain&&(!ue._writableState||ue._writableState.needDrain)&&xe()}())});var xe=function k(ue){return function(){var Me=ue._readableState;x("pipeOnDrain",Me.awaitDrain),Me.awaitDrain&&Me.awaitDrain--,0===Me.awaitDrain&&S(ue,"data")&&(Me.flowing=!0,fe(ue))}}(Me);ue.on("drain",xe);var Ce=!1;function we(te){x("ondata");var W=ue.write(te);x("dest.write",W),!1===W&&((1===le.pipesCount&&le.pipes===ue||le.pipesCount>1&&-1!==pe(le.pipes,ue))&&!Ce&&(x("false write response, pause",le.awaitDrain),le.awaitDrain++),Me.pause())}function Oe(te){x("onerror",te),oe(),ue.removeListener("error",Oe),0===S(ue,"error")&&z(ue,te)}function wt(){ue.removeListener("finish",Be),oe()}function Be(){x("onfinish"),ue.removeListener("close",wt),oe()}function oe(){x("unpipe"),Me.unpipe(ue)}return Me.on("data",we),function re(ue,_e,Me){if("function"==typeof ue.prependListener)return ue.prependListener(_e,Me);ue._events&&ue._events[_e]?Array.isArray(ue._events[_e])?ue._events[_e].unshift(Me):ue._events[_e]=[Me,ue._events[_e]]:ue.on(_e,Me)}(ue,"error",Oe),ue.once("close",wt),ue.once("finish",Be),ue.emit("pipe",Me),le.flowing||(x("pipe resume"),Me.resume()),ue},y.prototype.unpipe=function(ue){var _e=this._readableState,Me={hasUnpiped:!1};if(0===_e.pipesCount)return this;if(1===_e.pipesCount)return ue&&ue!==_e.pipes||(ue||(ue=_e.pipes),_e.pipes=null,_e.pipesCount=0,_e.flowing=!1,ue&&ue.emit("unpipe",this,Me)),this;if(!ue){var le=_e.pipes,ie=_e.pipesCount;_e.pipes=null,_e.pipesCount=0,_e.flowing=!1;for(var Y=0;Y0,!1!==le.flowing&&this.resume()):"readable"===ue&&!le.endEmitted&&!le.readableListening&&(le.readableListening=le.needReadable=!0,le.flowing=!1,le.emittedReadable=!1,x("on readable",le.length,le.reading),le.length?p(this):le.reading||process.nextTick(he,this)),Me},y.prototype.removeListener=function(ue,_e){var Me=T.prototype.removeListener.call(this,ue,_e);return"readable"===ue&&process.nextTick(q,this),Me},y.prototype.removeAllListeners=function(ue){var _e=T.prototype.removeAllListeners.apply(this,arguments);return("readable"===ue||void 0===ue)&&process.nextTick(q,this),_e},y.prototype.resume=function(){var ue=this._readableState;return ue.flowing||(x("resume"),ue.flowing=!ue.readableListening,function be(ue,_e){_e.resumeScheduled||(_e.resumeScheduled=!0,process.nextTick(ge,ue,_e))}(this,ue)),ue.paused=!1,this},y.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},y.prototype.wrap=function(ue){var _e=this,Me=this._readableState,le=!1;for(var ie in ue.on("end",function(){if(x("wrapped end"),Me.decoder&&!Me.ended){var ae=Me.decoder.end();ae&&ae.length&&_e.push(ae)}_e.push(null)}),ue.on("data",function(ae){x("wrapped data"),Me.decoder&&(ae=Me.decoder.write(ae)),Me.objectMode&&null==ae||!(Me.objectMode||ae&&ae.length)||_e.push(ae)||(le=!0,ue.pause())}),ue)void 0===this[ie]&&"function"==typeof ue[ie]&&(this[ie]=function(Le){return function(){return ue[Le].apply(ue,arguments)}}(ie));for(var Y=0;Y{"use strict";ne.exports=b;var R=I(891).q,B=R.ERR_METHOD_NOT_IMPLEMENTED,S=R.ERR_MULTIPLE_CALLBACK,T=R.ERR_TRANSFORM_ALREADY_TRANSFORMING,f=R.ERR_TRANSFORM_WITH_LENGTH_0,M=I(1339);function _(E,P){var A=this._transformState;A.transforming=!1;var O=A.writecb;if(null===O)return this.emit("error",new S);A.writechunk=null,A.writecb=null,null!=P&&this.push(P),O(E);var N=this._readableState;N.reading=!1,(N.needReadable||N.length{"use strict";function B(fe){var se=this;this.next=null,this.entry=null,this.finish=function(){!function ge(fe,se,ce){var ee=fe.entry;for(fe.entry=null;ee;){var pe=ee.callback;se.pendingcb--,pe(ce),ee=ee.next}se.corkedRequestsFree.next=fe}(se,fe)}}var S;ne.exports=ve,ve.WritableState=J;var re,T={deprecate:I(3532)},f=I(4970),M=I(3172).Buffer,_=global.Uint8Array||function(){},x=I(1920),P=I(7102).getHighWaterMark,A=I(891).q,O=A.ERR_INVALID_ARG_TYPE,N=A.ERR_METHOD_NOT_IMPLEMENTED,U=A.ERR_MULTIPLE_CALLBACK,H=A.ERR_STREAM_CANNOT_PIPE,V=A.ERR_STREAM_DESTROYED,G=A.ERR_STREAM_NULL_VALUES,K=A.ERR_STREAM_WRITE_AFTER_END,X=A.ERR_UNKNOWN_ENCODING,Z=x.errorOrDestroy;function z(){}function J(fe,se,ce){S=S||I(1339),"boolean"!=typeof ce&&(ce=se instanceof S),this.objectMode=!!(fe=fe||{}).objectMode,ce&&(this.objectMode=this.objectMode||!!fe.writableObjectMode),this.highWaterMark=P(this,fe,"writableHighWaterMark",ce),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===fe.decodeStrings),this.defaultEncoding=fe.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(pe){!function w(fe,se){var ce=fe._writableState,ee=ce.sync,pe=ce.writecb;if("function"!=typeof pe)throw new U;if(function m(fe){fe.writing=!1,fe.writecb=null,fe.length-=fe.writelen,fe.writelen=0}(ce),se)!function d(fe,se,ce,ee,pe){--se.pendingcb,ce?(process.nextTick(pe,ee),process.nextTick(he,fe,se),fe._writableState.errorEmitted=!0,Z(fe,ee)):(pe(ee),fe._writableState.errorEmitted=!0,Z(fe,ee),he(fe,se))}(fe,ce,ee,se,pe);else{var ue=$(ce)||fe.destroyed;!ue&&!ce.corked&&!ce.bufferProcessing&&ce.bufferedRequest&&g(fe,ce),ee?process.nextTick(p,fe,ce,ue,pe):p(fe,ce,ue,pe)}}(se,pe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==fe.emitClose,this.autoDestroy=!!fe.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new B(this)}function ve(fe){var se=this instanceof(S=S||I(1339));if(!se&&!re.call(ve,this))return new ve(fe);this._writableState=new J(fe,this,se),this.writable=!0,fe&&("function"==typeof fe.write&&(this._write=fe.write),"function"==typeof fe.writev&&(this._writev=fe.writev),"function"==typeof fe.destroy&&(this._destroy=fe.destroy),"function"==typeof fe.final&&(this._final=fe.final)),f.call(this)}function u(fe,se,ce,ee,pe,ue,_e){se.writelen=ee,se.writecb=_e,se.writing=!0,se.sync=!0,se.destroyed?se.onwrite(new V("write")):ce?fe._writev(pe,se.onwrite):fe._write(pe,ue,se.onwrite),se.sync=!1}function p(fe,se,ce,ee){ce||function s(fe,se){0===se.length&&se.needDrain&&(se.needDrain=!1,fe.emit("drain"))}(fe,se),se.pendingcb--,ee(),he(fe,se)}function g(fe,se){se.bufferProcessing=!0;var ce=se.bufferedRequest;if(fe._writev&&ce&&ce.next){var pe=new Array(se.bufferedRequestCount),ue=se.corkedRequestsFree;ue.entry=ce;for(var _e=0,Me=!0;ce;)pe[_e]=ce,ce.isBuf||(Me=!1),ce=ce.next,_e+=1;pe.allBuffers=Me,u(fe,se,!0,se.length,pe,"",ue.finish),se.pendingcb++,se.lastBufferedRequest=null,ue.next?(se.corkedRequestsFree=ue.next,ue.next=null):se.corkedRequestsFree=new B(se),se.bufferedRequestCount=0}else{for(;ce;){var le=ce.chunk;if(u(fe,se,!1,se.objectMode?1:le.length,le,ce.encoding,ce.callback),ce=ce.next,se.bufferedRequestCount--,se.writing)break}null===ce&&(se.lastBufferedRequest=null)}se.bufferedRequest=ce,se.bufferProcessing=!1}function $(fe){return fe.ending&&0===fe.length&&null===fe.bufferedRequest&&!fe.finished&&!fe.writing}function k(fe,se){fe._final(function(ce){se.pendingcb--,ce&&Z(fe,ce),se.prefinished=!0,fe.emit("prefinish"),he(fe,se)})}function he(fe,se){var ce=$(se);if(ce&&(function q(fe,se){!se.prefinished&&!se.finalCalled&&("function"!=typeof fe._final||se.destroyed?(se.prefinished=!0,fe.emit("prefinish")):(se.pendingcb++,se.finalCalled=!0,process.nextTick(k,fe,se)))}(fe,se),0===se.pendingcb&&(se.finished=!0,fe.emit("finish"),se.autoDestroy))){var ee=fe._readableState;(!ee||ee.autoDestroy&&ee.endEmitted)&&fe.destroy()}return ce}I(3894)(ve,f),J.prototype.getBuffer=function(){for(var se=this.bufferedRequest,ce=[];se;)ce.push(se),se=se.next;return ce},function(){try{Object.defineProperty(J.prototype,"buffer",{get:T.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(fe){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(re=Function.prototype[Symbol.hasInstance],Object.defineProperty(ve,Symbol.hasInstance,{value:function(se){return!!re.call(this,se)||this===ve&&se&&se._writableState instanceof J}})):re=function(se){return se instanceof this},ve.prototype.pipe=function(){Z(this,new H)},ve.prototype.write=function(fe,se,ce){var ee=this._writableState,pe=!1,ue=!ee.objectMode&&function C(fe){return M.isBuffer(fe)||fe instanceof _}(fe);return ue&&!M.isBuffer(fe)&&(fe=function b(fe){return M.from(fe)}(fe)),"function"==typeof se&&(ce=se,se=null),ue?se="buffer":se||(se=ee.defaultEncoding),"function"!=typeof ce&&(ce=z),ee.ending?function y(fe,se){var ce=new K;Z(fe,ce),process.nextTick(se,ce)}(this,ce):(ue||function o(fe,se,ce,ee){var pe;return null===ce?pe=new G:"string"!=typeof ce&&!se.objectMode&&(pe=new O("chunk",["string","Buffer"],ce)),!pe||(Z(fe,pe),process.nextTick(ee,pe),!1)}(this,ee,fe,ce))&&(ee.pendingcb++,pe=function c(fe,se,ce,ee,pe,ue){if(!ce){var _e=function l(fe,se,ce){return!fe.objectMode&&!1!==fe.decodeStrings&&"string"==typeof se&&(se=M.from(se,ce)),se}(se,ee,pe);ee!==_e&&(ce=!0,pe="buffer",ee=_e)}var Me=se.objectMode?1:ee.length;se.length+=Me;var le=se.length-1))throw new X(se);return this._writableState.defaultEncoding=se,this},Object.defineProperty(ve.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(ve.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),ve.prototype._write=function(fe,se,ce){ce(new N("_write()"))},ve.prototype._writev=null,ve.prototype.end=function(fe,se,ce){var ee=this._writableState;return"function"==typeof fe?(ce=fe,fe=null,se=null):"function"==typeof se&&(ce=se,se=null),null!=fe&&this.write(fe,se),ee.corked&&(ee.corked=1,this.uncork()),ee.ending||function be(fe,se,ce){se.ending=!0,he(fe,se),ce&&(se.finished?process.nextTick(ce):fe.once("finish",ce)),se.ended=!0,fe.writable=!1}(this,ee,ce),this},Object.defineProperty(ve.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(ve.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(se){!this._writableState||(this._writableState.destroyed=se)}}),ve.prototype.destroy=x.destroy,ve.prototype._undestroy=x.undestroy,ve.prototype._destroy=function(fe,se){se(fe)}},3872:(ne,F,I)=>{"use strict";var R;function B(V,G,K){return G in V?Object.defineProperty(V,G,{value:K,enumerable:!0,configurable:!0,writable:!0}):V[G]=K,V}var S=I(7542),T=Symbol("lastResolve"),f=Symbol("lastReject"),M=Symbol("error"),_=Symbol("ended"),b=Symbol("lastPromise"),C=Symbol("handlePromise"),x=Symbol("stream");function E(V,G){return{value:V,done:G}}function P(V){var G=V[T];if(null!==G){var K=V[x].read();null!==K&&(V[b]=null,V[T]=null,V[f]=null,G(E(K,!1)))}}function A(V){process.nextTick(P,V)}var N=Object.getPrototypeOf(function(){}),U=Object.setPrototypeOf((B(R={get stream(){return this[x]},next:function(){var G=this,K=this[M];if(null!==K)return Promise.reject(K);if(this[_])return Promise.resolve(E(void 0,!0));if(this[x].destroyed)return new Promise(function(J,re){process.nextTick(function(){G[M]?re(G[M]):J(E(void 0,!0))})});var Z,X=this[b];if(X)Z=new Promise(function O(V,G){return function(K,X){V.then(function(){G[_]?K(E(void 0,!0)):G[C](K,X)},X)}}(X,this));else{var z=this[x].read();if(null!==z)return Promise.resolve(E(z,!1));Z=new Promise(this[C])}return this[b]=Z,Z}},Symbol.asyncIterator,function(){return this}),B(R,"return",function(){var G=this;return new Promise(function(K,X){G[x].destroy(null,function(Z){Z?X(Z):K(E(void 0,!0))})})}),R),N);ne.exports=function(G){var K,X=Object.create(U,(B(K={},x,{value:G,writable:!0}),B(K,T,{value:null,writable:!0}),B(K,f,{value:null,writable:!0}),B(K,M,{value:null,writable:!0}),B(K,_,{value:G._readableState.endEmitted,writable:!0}),B(K,C,{value:function(z,J){var re=X[x].read();re?(X[b]=null,X[T]=null,X[f]=null,z(E(re,!1))):(X[T]=z,X[f]=J)},writable:!0}),K));return X[b]=null,S(G,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var z=X[f];return null!==z&&(X[b]=null,X[T]=null,X[f]=null,z(Z)),void(X[M]=Z)}var J=X[T];null!==J&&(X[b]=null,X[T]=null,X[f]=null,J(E(void 0,!0))),X[_]=!0}),G.on("readable",A.bind(null,X)),X}},5019:(ne,F,I)=>{"use strict";function R(A,O){var N=Object.keys(A);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(A);O&&(U=U.filter(function(H){return Object.getOwnPropertyDescriptor(A,H).enumerable})),N.push.apply(N,U)}return N}function S(A,O,N){return O in A?Object.defineProperty(A,O,{value:N,enumerable:!0,configurable:!0,writable:!0}):A[O]=N,A}function f(A,O){for(var N=0;N0?this.tail.next=U:this.head=U,this.tail=U,++this.length}},{key:"unshift",value:function(N){var U={data:N,next:this.head};0===this.length&&(this.tail=U),this.head=U,++this.length}},{key:"shift",value:function(){if(0!==this.length){var N=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,N}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(N){if(0===this.length)return"";for(var U=this.head,H=""+U.data;U=U.next;)H+=N+U.data;return H}},{key:"concat",value:function(N){if(0===this.length)return b.alloc(0);for(var U=b.allocUnsafe(N>>>0),H=this.head,V=0;H;)P(H.data,U,V),V+=H.data.length,H=H.next;return U}},{key:"consume",value:function(N,U){var H;return NG.length?G.length:N;if(V+=K===G.length?G:G.slice(0,N),0==(N-=K)){K===G.length?(++H,this.head=U.next?U.next:this.tail=null):(this.head=U,U.data=G.slice(K));break}++H}return this.length-=H,V}},{key:"_getBuffer",value:function(N){var U=b.allocUnsafe(N),H=this.head,V=1;for(H.data.copy(U),N-=H.data.length;H=H.next;){var G=H.data,K=N>G.length?G.length:N;if(G.copy(U,U.length-N,0,K),0==(N-=K)){K===G.length?(++V,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=G.slice(K));break}++V}return this.length-=V,U}},{key:E,value:function(N,U){return x(this,function B(A){for(var O=1;O{"use strict";function I(f,M){S(f,M),R(f)}function R(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function S(f,M){f.emit("error",M)}ne.exports={destroy:function F(f,M){var _=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(M?M(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(S,this,f)):process.nextTick(S,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(x){!M&&x?_._writableState?_._writableState.errorEmitted?process.nextTick(R,_):(_._writableState.errorEmitted=!0,process.nextTick(I,_,x)):process.nextTick(I,_,x):M?(process.nextTick(R,_),M(x)):process.nextTick(R,_)}),this)},undestroy:function B(){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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function T(f,M){var _=f._readableState,b=f._writableState;_&&_.autoDestroy||b&&b.autoDestroy?f.destroy(M):f.emit("error",M)}}},7542:(ne,F,I)=>{"use strict";var R=I(891).q.ERR_STREAM_PREMATURE_CLOSE;function S(){}ne.exports=function f(M,_,b){if("function"==typeof _)return f(M,null,_);_||(_={}),b=function B(M){var _=!1;return function(){if(!_){_=!0;for(var b=arguments.length,C=new Array(b),x=0;x{ne.exports=function(){throw new Error("Readable.from is not available in the browser")}},954:(ne,F,I)=>{"use strict";var R,S=I(891).q,T=S.ERR_MISSING_ARGS,f=S.ERR_STREAM_DESTROYED;function M(A){if(A)throw A}function b(A,O,N,U){U=function B(A){var O=!1;return function(){O||(O=!0,A.apply(void 0,arguments))}}(U);var H=!1;A.on("close",function(){H=!0}),void 0===R&&(R=I(7542)),R(A,{readable:O,writable:N},function(G){if(G)return U(G);H=!0,U()});var V=!1;return function(G){if(!H&&!V){if(V=!0,function _(A){return A.setHeader&&"function"==typeof A.abort}(A))return A.abort();if("function"==typeof A.destroy)return A.destroy();U(G||new f("pipe"))}}}function C(A){A()}function x(A,O){return A.pipe(O)}function E(A){return A.length&&"function"==typeof A[A.length-1]?A.pop():M}ne.exports=function P(){for(var A=arguments.length,O=new Array(A),N=0;N0,function(z){H||(H=z),z&&V.forEach(C),!X&&(V.forEach(C),U(H))})});return O.reduce(x)}},7102:(ne,F,I)=>{"use strict";var R=I(891).q.ERR_INVALID_OPT_VALUE;ne.exports={getHighWaterMark:function S(T,f,M,_){var b=function B(T,f,M){return null!=T.highWaterMark?T.highWaterMark:f?T[M]:null}(f,_,M);if(null!=b){if(!isFinite(b)||Math.floor(b)!==b||b<0)throw new R(_?M:"highWaterMark",b);return Math.floor(b)}return T.objectMode?16:16384}}},4970:(ne,F,I)=>{ne.exports=I(9069).EventEmitter},5685:(ne,F,I)=>{(F=ne.exports=I(3154)).Stream=F,F.Readable=F,F.Writable=I(520),F.Duplex=I(1339),F.Transform=I(6025),F.PassThrough=I(6071),F.finished=I(7542),F.pipeline=I(954)},5634:(ne,F,I)=>{"use strict";var R=I(3172).Buffer,B=I(3894),S=I(9650),T=new Array(16),f=[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],M=[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],_=[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],b=[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],C=[0,1518500249,1859775393,2400959708,2840853838],x=[1352829926,1548603684,1836072691,2053994217,0];function E(){S.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function P(V,G){return V<>>32-G}function A(V,G,K,X,Z,z,J,re){return P(V+(G^K^X)+z+J|0,re)+Z|0}function O(V,G,K,X,Z,z,J,re){return P(V+(G&K|~G&X)+z+J|0,re)+Z|0}function N(V,G,K,X,Z,z,J,re){return P(V+((G|~K)^X)+z+J|0,re)+Z|0}function U(V,G,K,X,Z,z,J,re){return P(V+(G&X|K&~X)+z+J|0,re)+Z|0}function H(V,G,K,X,Z,z,J,re){return P(V+(G^(K|~X))+z+J|0,re)+Z|0}B(E,S),E.prototype._update=function(){for(var V=T,G=0;G<16;++G)V[G]=this._block.readInt32LE(4*G);for(var K=0|this._a,X=0|this._b,Z=0|this._c,z=0|this._d,J=0|this._e,re=0|this._a,ve=0|this._b,y=0|this._c,o=0|this._d,l=0|this._e,c=0;c<80;c+=1){var u,d;c<16?(u=A(K,X,Z,z,J,V[f[c]],C[0],_[c]),d=H(re,ve,y,o,l,V[M[c]],x[0],b[c])):c<32?(u=O(K,X,Z,z,J,V[f[c]],C[1],_[c]),d=U(re,ve,y,o,l,V[M[c]],x[1],b[c])):c<48?(u=N(K,X,Z,z,J,V[f[c]],C[2],_[c]),d=N(re,ve,y,o,l,V[M[c]],x[2],b[c])):c<64?(u=U(K,X,Z,z,J,V[f[c]],C[3],_[c]),d=O(re,ve,y,o,l,V[M[c]],x[3],b[c])):(u=H(K,X,Z,z,J,V[f[c]],C[4],_[c]),d=A(re,ve,y,o,l,V[M[c]],x[4],b[c])),K=J,J=z,z=P(Z,10),Z=X,X=u,re=l,l=o,o=P(y,10),y=ve,ve=d}var m=this._b+Z+o|0;this._b=this._c+z+l|0,this._c=this._d+J+re|0,this._d=this._e+K+ve|0,this._e=this._a+X+y|0,this._a=m},E.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var V=R.alloc?R.alloc(20):new R(20);return V.writeInt32LE(this._a,0),V.writeInt32LE(this._b,4),V.writeInt32LE(this._c,8),V.writeInt32LE(this._d,12),V.writeInt32LE(this._e,16),V},ne.exports=E},3502:(ne,F,I)=>{var R=I(3172),B=R.Buffer;function S(f,M){for(var _ in f)M[_]=f[_]}function T(f,M,_){return B(f,M,_)}B.from&&B.alloc&&B.allocUnsafe&&B.allocUnsafeSlow?ne.exports=R:(S(R,F),F.Buffer=T),T.prototype=Object.create(B.prototype),S(B,T),T.from=function(f,M,_){if("number"==typeof f)throw new TypeError("Argument must not be a number");return B(f,M,_)},T.alloc=function(f,M,_){if("number"!=typeof f)throw new TypeError("Argument must be a number");var b=B(f);return void 0!==M?"string"==typeof _?b.fill(M,_):b.fill(M):b.fill(0),b},T.allocUnsafe=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return B(f)},T.allocUnsafeSlow=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return R.SlowBuffer(f)}},2038:(ne,F,I)=>{"use strict";var T,R=I(3172),B=R.Buffer,S={};for(T in R)!R.hasOwnProperty(T)||"SlowBuffer"===T||"Buffer"===T||(S[T]=R[T]);var f=S.Buffer={};for(T in B)!B.hasOwnProperty(T)||"allocUnsafe"===T||"allocUnsafeSlow"===T||(f[T]=B[T]);if(S.Buffer.prototype=B.prototype,(!f.from||f.from===Uint8Array.from)&&(f.from=function(M,_,b){if("number"==typeof M)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof M);if(M&&void 0===M.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);return B(M,_,b)}),f.alloc||(f.alloc=function(M,_,b){if("number"!=typeof M)throw new TypeError('The "size" argument must be of type number. Received type '+typeof M);if(M<0||M>=2*(1<<30))throw new RangeError('The value "'+M+'" is invalid for option "size"');var C=B(M);return _&&0!==_.length?"string"==typeof b?C.fill(_,b):C.fill(_):C.fill(0),C}),!S.kStringMaxLength)try{S.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(M){}S.constants||(S.constants={MAX_LENGTH:S.kMaxLength},S.kStringMaxLength&&(S.constants.MAX_STRING_LENGTH=S.kStringMaxLength)),ne.exports=S},6692:(ne,F,I)=>{var R=I(3502).Buffer;function B(S,T){this._block=R.alloc(S),this._finalSize=T,this._blockSize=S,this._len=0}B.prototype.update=function(S,T){"string"==typeof S&&(S=R.from(S,T=T||"utf8"));for(var f=this._block,M=this._blockSize,_=S.length,b=this._len,C=0;C<_;){for(var x=b%M,E=Math.min(_-C,M-x),P=0;P=this._finalSize&&(this._update(this._block),this._block.fill(0));var f=8*this._len;if(f<=4294967295)this._block.writeUInt32BE(f,this._blockSize-4);else{var M=(4294967295&f)>>>0;this._block.writeUInt32BE((f-M)/4294967296,this._blockSize-8),this._block.writeUInt32BE(M,this._blockSize-4)}this._update(this._block);var b=this._hash();return S?b.toString(S):b},B.prototype._update=function(){throw new Error("_update must be implemented by subclass")},ne.exports=B},5244:(ne,F,I)=>{var R=ne.exports=function(S){S=S.toLowerCase();var T=R[S];if(!T)throw new Error(S+" is not supported (we accept pull requests)");return new T};R.sha=I(8932),R.sha1=I(7736),R.sha224=I(5044),R.sha256=I(5014),R.sha384=I(6540),R.sha512=I(117)},8932:(ne,F,I)=>{var R=I(3894),B=I(6692),S=I(3502).Buffer,T=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function M(){this.init(),this._w=f,B.call(this,64,56)}function _(x){return x<<5|x>>>27}function b(x){return x<<30|x>>>2}function C(x,E,P,A){return 0===x?E&P|~E&A:2===x?E&P|E&A|P&A:E^P^A}R(M,B),M.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},M.prototype._update=function(x){for(var E=this._w,P=0|this._a,A=0|this._b,O=0|this._c,N=0|this._d,U=0|this._e,H=0;H<16;++H)E[H]=x.readInt32BE(4*H);for(;H<80;++H)E[H]=E[H-3]^E[H-8]^E[H-14]^E[H-16];for(var V=0;V<80;++V){var G=~~(V/20),K=_(P)+C(G,A,O,N)+U+E[V]+T[G]|0;U=N,N=O,O=b(A),A=P,P=K}this._a=P+this._a|0,this._b=A+this._b|0,this._c=O+this._c|0,this._d=N+this._d|0,this._e=U+this._e|0},M.prototype._hash=function(){var x=S.allocUnsafe(20);return x.writeInt32BE(0|this._a,0),x.writeInt32BE(0|this._b,4),x.writeInt32BE(0|this._c,8),x.writeInt32BE(0|this._d,12),x.writeInt32BE(0|this._e,16),x},ne.exports=M},7736:(ne,F,I)=>{var R=I(3894),B=I(6692),S=I(3502).Buffer,T=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function M(){this.init(),this._w=f,B.call(this,64,56)}function _(E){return E<<1|E>>>31}function b(E){return E<<5|E>>>27}function C(E){return E<<30|E>>>2}function x(E,P,A,O){return 0===E?P&A|~P&O:2===E?P&A|P&O|A&O:P^A^O}R(M,B),M.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},M.prototype._update=function(E){for(var P=this._w,A=0|this._a,O=0|this._b,N=0|this._c,U=0|this._d,H=0|this._e,V=0;V<16;++V)P[V]=E.readInt32BE(4*V);for(;V<80;++V)P[V]=_(P[V-3]^P[V-8]^P[V-14]^P[V-16]);for(var G=0;G<80;++G){var K=~~(G/20),X=b(A)+x(K,O,N,U)+H+P[G]+T[K]|0;H=U,U=N,N=C(O),O=A,A=X}this._a=A+this._a|0,this._b=O+this._b|0,this._c=N+this._c|0,this._d=U+this._d|0,this._e=H+this._e|0},M.prototype._hash=function(){var E=S.allocUnsafe(20);return E.writeInt32BE(0|this._a,0),E.writeInt32BE(0|this._b,4),E.writeInt32BE(0|this._c,8),E.writeInt32BE(0|this._d,12),E.writeInt32BE(0|this._e,16),E},ne.exports=M},5044:(ne,F,I)=>{var R=I(3894),B=I(5014),S=I(6692),T=I(3502).Buffer,f=new Array(64);function M(){this.init(),this._w=f,S.call(this,64,56)}R(M,B),M.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},M.prototype._hash=function(){var _=T.allocUnsafe(28);return _.writeInt32BE(this._a,0),_.writeInt32BE(this._b,4),_.writeInt32BE(this._c,8),_.writeInt32BE(this._d,12),_.writeInt32BE(this._e,16),_.writeInt32BE(this._f,20),_.writeInt32BE(this._g,24),_},ne.exports=M},5014:(ne,F,I)=>{var R=I(3894),B=I(6692),S=I(3502).Buffer,T=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=new Array(64);function M(){this.init(),this._w=f,B.call(this,64,56)}function _(A,O,N){return N^A&(O^N)}function b(A,O,N){return A&O|N&(A|O)}function C(A){return(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10)}function x(A){return(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7)}function E(A){return(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3}function P(A){return(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10}R(M,B),M.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},M.prototype._update=function(A){for(var O=this._w,N=0|this._a,U=0|this._b,H=0|this._c,V=0|this._d,G=0|this._e,K=0|this._f,X=0|this._g,Z=0|this._h,z=0;z<16;++z)O[z]=A.readInt32BE(4*z);for(;z<64;++z)O[z]=P(O[z-2])+O[z-7]+E(O[z-15])+O[z-16]|0;for(var J=0;J<64;++J){var re=Z+x(G)+_(G,K,X)+T[J]+O[J]|0,ve=C(N)+b(N,U,H)|0;Z=X,X=K,K=G,G=V+re|0,V=H,H=U,U=N,N=re+ve|0}this._a=N+this._a|0,this._b=U+this._b|0,this._c=H+this._c|0,this._d=V+this._d|0,this._e=G+this._e|0,this._f=K+this._f|0,this._g=X+this._g|0,this._h=Z+this._h|0},M.prototype._hash=function(){var A=S.allocUnsafe(32);return A.writeInt32BE(this._a,0),A.writeInt32BE(this._b,4),A.writeInt32BE(this._c,8),A.writeInt32BE(this._d,12),A.writeInt32BE(this._e,16),A.writeInt32BE(this._f,20),A.writeInt32BE(this._g,24),A.writeInt32BE(this._h,28),A},ne.exports=M},6540:(ne,F,I)=>{var R=I(3894),B=I(117),S=I(6692),T=I(3502).Buffer,f=new Array(160);function M(){this.init(),this._w=f,S.call(this,128,112)}R(M,B),M.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},M.prototype._hash=function(){var _=T.allocUnsafe(48);function b(C,x,E){_.writeInt32BE(C,E),_.writeInt32BE(x,E+4)}return b(this._ah,this._al,0),b(this._bh,this._bl,8),b(this._ch,this._cl,16),b(this._dh,this._dl,24),b(this._eh,this._el,32),b(this._fh,this._fl,40),_},ne.exports=M},117:(ne,F,I)=>{var R=I(3894),B=I(6692),S=I(3502).Buffer,T=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],f=new Array(160);function M(){this.init(),this._w=f,B.call(this,128,112)}function _(U,H,V){return V^U&(H^V)}function b(U,H,V){return U&H|V&(U|H)}function C(U,H){return(U>>>28|H<<4)^(H>>>2|U<<30)^(H>>>7|U<<25)}function x(U,H){return(U>>>14|H<<18)^(U>>>18|H<<14)^(H>>>9|U<<23)}function E(U,H){return(U>>>1|H<<31)^(U>>>8|H<<24)^U>>>7}function P(U,H){return(U>>>1|H<<31)^(U>>>8|H<<24)^(U>>>7|H<<25)}function A(U,H){return(U>>>19|H<<13)^(H>>>29|U<<3)^U>>>6}function O(U,H){return(U>>>19|H<<13)^(H>>>29|U<<3)^(U>>>6|H<<26)}function N(U,H){return U>>>0>>0?1:0}R(M,B),M.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},M.prototype._update=function(U){for(var H=this._w,V=0|this._ah,G=0|this._bh,K=0|this._ch,X=0|this._dh,Z=0|this._eh,z=0|this._fh,J=0|this._gh,re=0|this._hh,ve=0|this._al,y=0|this._bl,o=0|this._cl,l=0|this._dl,c=0|this._el,u=0|this._fl,d=0|this._gl,m=0|this._hl,w=0;w<32;w+=2)H[w]=U.readInt32BE(4*w),H[w+1]=U.readInt32BE(4*w+4);for(;w<160;w+=2){var p=H[w-30],s=H[w-30+1],g=E(p,s),$=P(s,p),k=A(p=H[w-4],s=H[w-4+1]),q=O(s,p),ge=H[w-32],fe=H[w-32+1],se=$+H[w-14+1]|0,ce=g+H[w-14]+N(se,$)|0;ce=(ce=ce+k+N(se=se+q|0,q)|0)+ge+N(se=se+fe|0,fe)|0,H[w]=ce,H[w+1]=se}for(var ee=0;ee<160;ee+=2){ce=H[ee],se=H[ee+1];var pe=b(V,G,K),ue=b(ve,y,o),_e=C(V,ve),Me=C(ve,V),le=x(Z,c),ie=x(c,Z),Y=T[ee],ae=T[ee+1],Le=_(Z,z,J),xe=_(c,u,d),Ce=m+ie|0,Re=re+le+N(Ce,m)|0;Re=(Re=(Re=Re+Le+N(Ce=Ce+xe|0,xe)|0)+Y+N(Ce=Ce+ae|0,ae)|0)+ce+N(Ce=Ce+se|0,se)|0;var we=Me+ue|0,Oe=_e+pe+N(we,Me)|0;re=J,m=d,J=z,d=u,z=Z,u=c,Z=X+Re+N(c=l+Ce|0,l)|0,X=K,l=o,K=G,o=y,G=V,y=ve,V=Re+Oe+N(ve=Ce+we|0,Ce)|0}this._al=this._al+ve|0,this._bl=this._bl+y|0,this._cl=this._cl+o|0,this._dl=this._dl+l|0,this._el=this._el+c|0,this._fl=this._fl+u|0,this._gl=this._gl+d|0,this._hl=this._hl+m|0,this._ah=this._ah+V+N(this._al,ve)|0,this._bh=this._bh+G+N(this._bl,y)|0,this._ch=this._ch+K+N(this._cl,o)|0,this._dh=this._dh+X+N(this._dl,l)|0,this._eh=this._eh+Z+N(this._el,c)|0,this._fh=this._fh+z+N(this._fl,u)|0,this._gh=this._gh+J+N(this._gl,d)|0,this._hh=this._hh+re+N(this._hl,m)|0},M.prototype._hash=function(){var U=S.allocUnsafe(64);function H(V,G,K){U.writeInt32BE(V,K),U.writeInt32BE(G,K+4)}return H(this._ah,this._al,0),H(this._bh,this._bl,8),H(this._ch,this._cl,16),H(this._dh,this._dl,24),H(this._eh,this._el,32),H(this._fh,this._fl,40),H(this._gh,this._gl,48),H(this._hh,this._hl,56),U},ne.exports=M},8475:(ne,F,I)=>{"use strict";var R=I(5203),B=I(5834),S=I(7024),T=R("%TypeError%"),f=R("%WeakMap%",!0),M=R("%Map%",!0),_=B("WeakMap.prototype.get",!0),b=B("WeakMap.prototype.set",!0),C=B("WeakMap.prototype.has",!0),x=B("Map.prototype.get",!0),E=B("Map.prototype.set",!0),P=B("Map.prototype.has",!0),A=function(H,V){for(var K,G=H;null!==(K=G.next);G=K)if(K.key===V)return G.next=K.next,K.next=H.next,H.next=K,K};ne.exports=function(){var V,G,K,X={assert:function(Z){if(!X.has(Z))throw new T("Side channel does not contain "+S(Z))},get:function(Z){if(f&&Z&&("object"==typeof Z||"function"==typeof Z)){if(V)return _(V,Z)}else if(M){if(G)return x(G,Z)}else if(K)return function(H,V){var G=A(H,V);return G&&G.value}(K,Z)},has:function(Z){if(f&&Z&&("object"==typeof Z||"function"==typeof Z)){if(V)return C(V,Z)}else if(M){if(G)return P(G,Z)}else if(K)return function(H,V){return!!A(H,V)}(K,Z);return!1},set:function(Z,z){f&&Z&&("object"==typeof Z||"function"==typeof Z)?(V||(V=new f),b(V,Z,z)):M?(G||(G=new M),E(G,Z,z)):(K||(K={key:{},next:null}),function(H,V,G){var K=A(H,V);K?K.value=G:H.next={key:V,next:H.next,value:G}}(K,Z,z))}};return X}},295:(ne,F,I)=>{ne.exports=S;var R=I(9069).EventEmitter;function S(){R.call(this)}I(3894)(S,R),S.Readable=I(3154),S.Writable=I(520),S.Duplex=I(1339),S.Transform=I(6025),S.PassThrough=I(6071),S.finished=I(7542),S.pipeline=I(954),S.Stream=S,S.prototype.pipe=function(T,f){var M=this;function _(O){T.writable&&!1===T.write(O)&&M.pause&&M.pause()}function b(){M.readable&&M.resume&&M.resume()}M.on("data",_),T.on("drain",b),!T._isStdio&&(!f||!1!==f.end)&&(M.on("end",x),M.on("close",E));var C=!1;function x(){C||(C=!0,T.end())}function E(){C||(C=!0,"function"==typeof T.destroy&&T.destroy())}function P(O){if(A(),0===R.listenerCount(this,"error"))throw O}function A(){M.removeListener("data",_),T.removeListener("drain",b),M.removeListener("end",x),M.removeListener("close",E),M.removeListener("error",P),T.removeListener("error",P),M.removeListener("end",A),M.removeListener("close",A),T.removeListener("close",A)}return M.on("error",P),T.on("error",P),M.on("end",A),M.on("close",A),T.on("close",A),T.emit("pipe",M),T}},4216:(ne,F,I)=>{var R=I(3724),B=I(2359),S=I(4703),T=I(4525),f=I(8762),M=F;M.request=function(_,b){_="string"==typeof _?f.parse(_):S(_);var C=-1===global.location.protocol.search(/^https?:$/)?"http:":"",x=_.protocol||C,E=_.hostname||_.host,P=_.port,A=_.path||"/";E&&-1!==E.indexOf(":")&&(E="["+E+"]"),_.url=(E?x+"//"+E:"")+(P?":"+P:"")+A,_.method=(_.method||"GET").toUpperCase(),_.headers=_.headers||{};var O=new R(_);return b&&O.on("response",b),O},M.get=function(b,C){var x=M.request(b,C);return x.end(),x},M.ClientRequest=R,M.IncomingMessage=B.IncomingMessage,M.Agent=function(){},M.Agent.defaultMaxSockets=4,M.globalAgent=new M.Agent,M.STATUS_CODES=T,M.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"]},7976:(ne,F)=>{var I;function R(){if(void 0!==I)return I;if(global.XMLHttpRequest){I=new global.XMLHttpRequest;try{I.open("GET",global.XDomainRequest?"/":"https://example.com")}catch(T){I=null}}else I=null;return I}function B(T){var f=R();if(!f)return!1;try{return f.responseType=T,f.responseType===T}catch(M){}return!1}function S(T){return"function"==typeof T}F.fetch=S(global.fetch)&&S(global.ReadableStream),F.writableStream=S(global.WritableStream),F.abortController=S(global.AbortController),F.arraybuffer=F.fetch||B("arraybuffer"),F.msstream=!F.fetch&&B("ms-stream"),F.mozchunkedarraybuffer=!F.fetch&&B("moz-chunked-arraybuffer"),F.overrideMimeType=F.fetch||!!R()&&S(R().overrideMimeType),I=null},3724:(ne,F,I)=>{var R=I(7976),B=I(3894),S=I(2359),T=I(5685),f=S.IncomingMessage,M=S.readyStates,b=ne.exports=function(E){var P=this;T.Writable.call(P),P._opts=E,P._body=[],P._headers={},E.auth&&P.setHeader("Authorization","Basic "+Buffer.from(E.auth).toString("base64")),Object.keys(E.headers).forEach(function(N){P.setHeader(N,E.headers[N])});var A,O=!0;if("disable-fetch"===E.mode||"requestTimeout"in E&&!R.abortController)O=!1,A=!0;else if("prefer-streaming"===E.mode)A=!1;else if("allow-wrong-content-type"===E.mode)A=!R.overrideMimeType;else{if(E.mode&&"default"!==E.mode&&"prefer-fast"!==E.mode)throw new Error("Invalid value for opts.mode");A=!0}P._mode=function _(E,P){return R.fetch&&P?"fetch":R.mozchunkedarraybuffer?"moz-chunked-arraybuffer":R.msstream?"ms-stream":R.arraybuffer&&E?"arraybuffer":"text"}(A,O),P._fetchTimer=null,P._socketTimeout=null,P._socketTimer=null,P.on("finish",function(){P._onFinish()})};B(b,T.Writable),b.prototype.setHeader=function(E,P){var O=E.toLowerCase();-1===x.indexOf(O)&&(this._headers[O]={name:E,value:P})},b.prototype.getHeader=function(E){var P=this._headers[E.toLowerCase()];return P?P.value:null},b.prototype.removeHeader=function(E){delete this._headers[E.toLowerCase()]},b.prototype._onFinish=function(){var E=this;if(!E._destroyed){var P=E._opts;"timeout"in P&&0!==P.timeout&&E.setTimeout(P.timeout);var A=E._headers,O=null;"GET"!==P.method&&"HEAD"!==P.method&&(O=new Blob(E._body,{type:(A["content-type"]||{}).value||""}));var N=[];if(Object.keys(A).forEach(function(G){var K=A[G].name,X=A[G].value;Array.isArray(X)?X.forEach(function(Z){N.push([K,Z])}):N.push([K,X])}),"fetch"===E._mode){var U=null;if(R.abortController){var H=new AbortController;U=H.signal,E._fetchAbortController=H,"requestTimeout"in P&&0!==P.requestTimeout&&(E._fetchTimer=global.setTimeout(function(){E.emit("requestTimeout"),E._fetchAbortController&&E._fetchAbortController.abort()},P.requestTimeout))}global.fetch(E._opts.url,{method:E._opts.method,headers:N,body:O||void 0,mode:"cors",credentials:P.withCredentials?"include":"same-origin",signal:U}).then(function(G){E._fetchResponse=G,E._resetTimers(!1),E._connect()},function(G){E._resetTimers(!0),E._destroyed||E.emit("error",G)})}else{var V=E._xhr=new global.XMLHttpRequest;try{V.open(E._opts.method,E._opts.url,!0)}catch(G){return void process.nextTick(function(){E.emit("error",G)})}"responseType"in V&&(V.responseType=E._mode),"withCredentials"in V&&(V.withCredentials=!!P.withCredentials),"text"===E._mode&&"overrideMimeType"in V&&V.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in P&&(V.timeout=P.requestTimeout,V.ontimeout=function(){E.emit("requestTimeout")}),N.forEach(function(G){V.setRequestHeader(G[0],G[1])}),E._response=null,V.onreadystatechange=function(){switch(V.readyState){case M.LOADING:case M.DONE:E._onXHRProgress()}},"moz-chunked-arraybuffer"===E._mode&&(V.onprogress=function(){E._onXHRProgress()}),V.onerror=function(){E._destroyed||(E._resetTimers(!0),E.emit("error",new Error("XHR error")))};try{V.send(O)}catch(G){return void process.nextTick(function(){E.emit("error",G)})}}}},b.prototype._onXHRProgress=function(){var E=this;E._resetTimers(!1),function C(E){try{var P=E.status;return null!==P&&0!==P}catch(A){return!1}}(E._xhr)&&!E._destroyed&&(E._response||E._connect(),E._response._onXHRProgress(E._resetTimers.bind(E)))},b.prototype._connect=function(){var E=this;E._destroyed||(E._response=new f(E._xhr,E._fetchResponse,E._mode,E._resetTimers.bind(E)),E._response.on("error",function(P){E.emit("error",P)}),E.emit("response",E._response))},b.prototype._write=function(E,P,A){this._body.push(E),A()},b.prototype._resetTimers=function(E){var P=this;global.clearTimeout(P._socketTimer),P._socketTimer=null,E?(global.clearTimeout(P._fetchTimer),P._fetchTimer=null):P._socketTimeout&&(P._socketTimer=global.setTimeout(function(){P.emit("timeout")},P._socketTimeout))},b.prototype.abort=b.prototype.destroy=function(E){var P=this;P._destroyed=!0,P._resetTimers(!0),P._response&&(P._response._destroyed=!0),P._xhr?P._xhr.abort():P._fetchAbortController&&P._fetchAbortController.abort(),E&&P.emit("error",E)},b.prototype.end=function(E,P,A){"function"==typeof E&&(A=E,E=void 0),T.Writable.prototype.end.call(this,E,P,A)},b.prototype.setTimeout=function(E,P){var A=this;P&&A.once("timeout",P),A._socketTimeout=E,A._resetTimers(!1)},b.prototype.flushHeaders=function(){},b.prototype.setNoDelay=function(){},b.prototype.setSocketKeepAlive=function(){};var x=["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","via"]},2359:(ne,F,I)=>{var R=I(7976),B=I(3894),S=I(5685),T=F.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=F.IncomingMessage=function(M,_,b,C){var x=this;if(S.Readable.call(x),x._mode=b,x.headers={},x.rawHeaders=[],x.trailers={},x.rawTrailers=[],x.on("end",function(){process.nextTick(function(){x.emit("close")})}),"fetch"===b){let H=function(){P.read().then(function(V){if(!x._destroyed){if(C(V.done),V.done)return void x.push(null);x.push(Buffer.from(V.value)),H()}}).catch(function(V){C(!0),x._destroyed||x.emit("error",V)})};if(x._fetchResponse=_,x.url=_.url,x.statusCode=_.status,x.statusMessage=_.statusText,_.headers.forEach(function(V,G){x.headers[G.toLowerCase()]=V,x.rawHeaders.push(G,V)}),R.writableStream){var E=new WritableStream({write:function(V){return C(!1),new Promise(function(G,K){x._destroyed?K():x.push(Buffer.from(V))?G():x._resumeFetch=G})},close:function(){C(!0),x._destroyed||x.push(null)},abort:function(V){C(!0),x._destroyed||x.emit("error",V)}});try{return void _.body.pipeTo(E).catch(function(V){C(!0),x._destroyed||x.emit("error",V)})}catch(V){}}var P=_.body.getReader();H()}else if(x._xhr=M,x._pos=0,x.url=M.responseURL,x.statusCode=M.status,x.statusMessage=M.statusText,M.getAllResponseHeaders().split(/\r?\n/).forEach(function(H){var V=H.match(/^([^:]+):\s*(.*)/);if(V){var G=V[1].toLowerCase();"set-cookie"===G?(void 0===x.headers[G]&&(x.headers[G]=[]),x.headers[G].push(V[2])):void 0!==x.headers[G]?x.headers[G]+=", "+V[2]:x.headers[G]=V[2],x.rawHeaders.push(V[1],V[2])}}),x._charset="x-user-defined",!R.overrideMimeType){var O=x.rawHeaders["mime-type"];if(O){var N=O.match(/;\s*charset=([^;])(;|$)/);N&&(x._charset=N[1].toLowerCase())}x._charset||(x._charset="utf-8")}};B(f,S.Readable),f.prototype._read=function(){var _=this._resumeFetch;_&&(this._resumeFetch=null,_())},f.prototype._onXHRProgress=function(M){var _=this,b=_._xhr,C=null;switch(_._mode){case"text":if((C=b.responseText).length>_._pos){var x=C.substr(_._pos);if("x-user-defined"===_._charset){for(var E=Buffer.alloc(x.length),P=0;P_._pos&&(_.push(Buffer.from(new Uint8Array(A.result.slice(_._pos)))),_._pos=A.result.byteLength)},A.onload=function(){M(!0),_.push(null)},A.readAsArrayBuffer(C)}_._xhr.readyState===T.DONE&&"ms-stream"!==_._mode&&(M(!0),_.push(null))}},3054:(ne,F,I)=>{"use strict";var R=I(3502).Buffer,B=R.isEncoding||function(V){switch((V=""+V)&&V.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 f(V){var G;switch(this.encoding=function T(V){var G=function S(V){if(!V)return"utf8";for(var G;;)switch(V){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 V;default:if(G)return;V=(""+V).toLowerCase(),G=!0}}(V);if("string"!=typeof G&&(R.isEncoding===B||!B(V)))throw new Error("Unknown encoding: "+V);return G||V}(V),this.encoding){case"utf16le":this.text=P,this.end=A,G=4;break;case"utf8":this.fillLast=C,G=4;break;case"base64":this.text=O,this.end=N,G=3;break;default:return this.write=U,void(this.end=H)}this.lastNeed=0,this.lastTotal=0,this.lastChar=R.allocUnsafe(G)}function M(V){return V<=127?0:V>>5==6?2:V>>4==14?3:V>>3==30?4:V>>6==2?-1:-2}function C(V){var G=this.lastTotal-this.lastNeed,K=function b(V,G,K){if(128!=(192&G[0]))return V.lastNeed=0,"\ufffd";if(V.lastNeed>1&&G.length>1){if(128!=(192&G[1]))return V.lastNeed=1,"\ufffd";if(V.lastNeed>2&&G.length>2&&128!=(192&G[2]))return V.lastNeed=2,"\ufffd"}}(this,V);return void 0!==K?K:this.lastNeed<=V.length?(V.copy(this.lastChar,G,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(V.copy(this.lastChar,G,0,V.length),void(this.lastNeed-=V.length))}function P(V,G){if((V.length-G)%2==0){var K=V.toString("utf16le",G);if(K){var X=K.charCodeAt(K.length-1);if(X>=55296&&X<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=V[V.length-2],this.lastChar[1]=V[V.length-1],K.slice(0,-1)}return K}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=V[V.length-1],V.toString("utf16le",G,V.length-1)}function A(V){var G=V&&V.length?this.write(V):"";return this.lastNeed?G+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):G}function O(V,G){var K=(V.length-G)%3;return 0===K?V.toString("base64",G):(this.lastNeed=3-K,this.lastTotal=3,1===K?this.lastChar[0]=V[V.length-1]:(this.lastChar[0]=V[V.length-2],this.lastChar[1]=V[V.length-1]),V.toString("base64",G,V.length-K))}function N(V){var G=V&&V.length?this.write(V):"";return this.lastNeed?G+this.lastChar.toString("base64",0,3-this.lastNeed):G}function U(V){return V.toString(this.encoding)}function H(V){return V&&V.length?this.write(V):""}F.s=f,f.prototype.write=function(V){if(0===V.length)return"";var G,K;if(this.lastNeed){if(void 0===(G=this.fillLast(V)))return"";K=this.lastNeed,this.lastNeed=0}else K=0;return K=0?(Z>0&&(V.lastNeed=Z-1),Z):--X=0?(Z>0&&(V.lastNeed=Z-2),Z):--X=0?(Z>0&&(2===Z?Z=0:V.lastNeed=Z-3),Z):0}(this,V,G);if(!this.lastNeed)return V.toString("utf8",G);this.lastTotal=K;var X=V.length-(K-this.lastNeed);return V.copy(this.lastChar,0,X),V.toString("utf8",G,X)},f.prototype.fillLast=function(V){if(this.lastNeed<=V.length)return V.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);V.copy(this.lastChar,this.lastTotal-this.lastNeed,0,V.length),this.lastNeed-=V.length}},8517:ne=>{ne.exports=function(I){return ArrayBuffer.isView(I)?Buffer.from(I.buffer,I.byteOffset,I.byteLength):Buffer.from(I)}},1308:function(ne,F,I){var R;ne=I.nmd(ne),function(B){"object"==typeof global&&global;var M,_=2147483647,b=36,U=/^xn--/,H=/[^\x20-\x7E]/,V=/[\x2E\u3002\uFF0E\uFF61]/g,G={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=Math.floor,Z=String.fromCharCode;function J(s){throw new RangeError(G[s])}function re(s,g){for(var $=s.length,k=[];$--;)k[$]=g(s[$]);return k}function ve(s,g){var $=s.split("@"),k="";return $.length>1&&(k=$[0]+"@",s=$[1]),k+re((s=s.replace(V,".")).split("."),g).join(".")}function y(s){for(var q,he,g=[],$=0,k=s.length;$=55296&&q<=56319&&$65535&&($+=Z((g-=65536)>>>10&1023|55296),g=56320|1023&g),$+Z(g)}).join("")}function l(s){return s-48<10?s-22:s-65<26?s-65:s-97<26?s-97:b}function c(s,g){return s+22+75*(s<26)-((0!=g)<<5)}function u(s,g,$){var k=0;for(s=$?X(s/700):s>>1,s+=X(s/g);s>455;k+=b)s=X(s/35);return X(k+36*s/(s+38))}function d(s){var k,ge,fe,se,ce,ee,pe,ue,_e,Me,g=[],$=s.length,q=0,he=128,be=72;for((ge=s.lastIndexOf("-"))<0&&(ge=0),fe=0;fe=128&&J("not-basic"),g.push(s.charCodeAt(fe));for(se=ge>0?ge+1:0;se<$;){for(ce=q,ee=1,pe=b;se>=$&&J("invalid-input"),((ue=l(s.charCodeAt(se++)))>=b||ue>X((_-q)/ee))&&J("overflow"),q+=ue*ee,!(ue<(_e=pe<=be?1:pe>=be+26?26:pe-be));pe+=b)ee>X(_/(Me=b-_e))&&J("overflow"),ee*=Me;be=u(q-ce,k=g.length+1,0==ce),X(q/k)>_-he&&J("overflow"),he+=X(q/k),q%=k,g.splice(q++,0,he)}return o(g)}function m(s){var g,$,k,q,he,be,ge,fe,se,ce,ee,ue,_e,Me,le,pe=[];for(ue=(s=y(s)).length,g=128,$=0,he=72,be=0;be=g&&eeX((_-$)/(_e=k+1))&&J("overflow"),$+=(ge-g)*_e,g=ge,be=0;be_&&J("overflow"),ee==g){for(fe=$,se=b;!(fe<(ce=se<=he?1:se>=he+26?26:se-he));se+=b)pe.push(Z(c(ce+(le=fe-ce)%(Me=b-ce),0))),fe=X(le/Me);pe.push(Z(c(fe,0))),he=u($,_e,k==q),$=0,++k}++$,++g}return pe.join("")}M={version:"1.4.1",ucs2:{decode:y,encode:o},decode:d,encode:m,toASCII:function p(s){return ve(s,function(g){return H.test(g)?"xn--"+m(g):g})},toUnicode:function w(s){return ve(s,function(g){return U.test(g)?d(g.slice(4).toLowerCase()):g})}},void 0!==(R=function(){return M}.call(F,I,F,ne))&&(ne.exports=R)}()},4277:ne=>{"use strict";var F=String.prototype.replace,I=/%20/g;ne.exports={default:"RFC3986",formatters:{RFC1738:function(B){return F.call(B,I,"+")},RFC3986:function(B){return String(B)}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},8011:(ne,F,I)=>{"use strict";var R=I(902),B=I(6830),S=I(4277);ne.exports={formats:S,parse:B,stringify:R}},6830:(ne,F,I)=>{"use strict";var R=I(3295),B=Object.prototype.hasOwnProperty,S=Array.isArray,T={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:R.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},M=function(A,O){return A&&"string"==typeof A&&O.comma&&A.indexOf(",")>-1?A.split(","):A},E=function(O,N,U,H){if(O){var V=U.allowDots?O.replace(/\.([^.[]+)/g,"[$1]"):O,K=/(\[[^[\]]*])/g,X=U.depth>0&&/(\[[^[\]]*])/.exec(V),Z=X?V.slice(0,X.index):V,z=[];if(Z){if(!U.plainObjects&&B.call(Object.prototype,Z)&&!U.allowPrototypes)return;z.push(Z)}for(var J=0;U.depth>0&&null!==(X=K.exec(V))&&J=0;--V){var G,K=A[V];if("[]"===K&&N.parseArrays)G=[].concat(H);else{G=N.plainObjects?Object.create(null):{};var X="["===K.charAt(0)&&"]"===K.charAt(K.length-1)?K.slice(1,-1):K,Z=parseInt(X,10);N.parseArrays||""!==X?!isNaN(Z)&&K!==X&&String(Z)===X&&Z>=0&&N.parseArrays&&Z<=N.arrayLimit?(G=[])[Z]=H:"__proto__"!==X&&(G[X]=H):G={0:H}}H=G}return H}(z,N,U,H)}};ne.exports=function(A,O){var N=function(O){if(!O)return T;if(null!=O.decoder&&"function"!=typeof O.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==O.charset&&"utf-8"!==O.charset&&"iso-8859-1"!==O.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");return{allowDots:void 0===O.allowDots?T.allowDots:!!O.allowDots,allowPrototypes:"boolean"==typeof O.allowPrototypes?O.allowPrototypes:T.allowPrototypes,allowSparse:"boolean"==typeof O.allowSparse?O.allowSparse:T.allowSparse,arrayLimit:"number"==typeof O.arrayLimit?O.arrayLimit:T.arrayLimit,charset:void 0===O.charset?T.charset:O.charset,charsetSentinel:"boolean"==typeof O.charsetSentinel?O.charsetSentinel:T.charsetSentinel,comma:"boolean"==typeof O.comma?O.comma:T.comma,decoder:"function"==typeof O.decoder?O.decoder:T.decoder,delimiter:"string"==typeof O.delimiter||R.isRegExp(O.delimiter)?O.delimiter:T.delimiter,depth:"number"==typeof O.depth||!1===O.depth?+O.depth:T.depth,ignoreQueryPrefix:!0===O.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof O.interpretNumericEntities?O.interpretNumericEntities:T.interpretNumericEntities,parameterLimit:"number"==typeof O.parameterLimit?O.parameterLimit:T.parameterLimit,parseArrays:!1!==O.parseArrays,plainObjects:"boolean"==typeof O.plainObjects?O.plainObjects:T.plainObjects,strictNullHandling:"boolean"==typeof O.strictNullHandling?O.strictNullHandling:T.strictNullHandling}}(O);if(""===A||null==A)return N.plainObjects?Object.create(null):{};for(var U="string"==typeof A?function(O,N){var X,U={__proto__:null},G=(N.ignoreQueryPrefix?O.replace(/^\?/,""):O).split(N.delimiter,N.parameterLimit===1/0?void 0:N.parameterLimit),K=-1,Z=N.charset;if(N.charsetSentinel)for(X=0;X{"use strict";var R=I(8475),B=I(3295),S=I(4277),T=Object.prototype.hasOwnProperty,f={brackets:function(H){return H+"[]"},comma:"comma",indices:function(H,V){return H+"["+V+"]"},repeat:function(H){return H}},M=Array.isArray,_=Array.prototype.push,b=function(U,H){_.apply(U,M(H)?H:[H])},C=Date.prototype.toISOString,x=S.default,E={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:B.encode,encodeValuesOnly:!1,format:x,formatter:S.formatters[x],indices:!1,serializeDate:function(H){return C.call(H)},skipNulls:!1,strictNullHandling:!1},A={},O=function U(H,V,G,K,X,Z,z,J,re,ve,y,o,l,c,u,d){for(var m=H,w=d,p=0,s=!1;void 0!==(w=w.get(A))&&!s;){var g=w.get(H);if(p+=1,void 0!==g){if(g===p)throw new RangeError("Cyclic object value");s=!0}void 0===w.get(A)&&(p=0)}if("function"==typeof J?m=J(V,m):m instanceof Date?m=y(m):"comma"===G&&M(m)&&(m=B.maybeMap(m,function(pe){return pe instanceof Date?y(pe):pe})),null===m){if(X)return z&&!c?z(V,E.encoder,u,"key",o):V;m=""}if(function(H){return"string"==typeof H||"number"==typeof H||"boolean"==typeof H||"symbol"==typeof H||"bigint"==typeof H}(m)||B.isBuffer(m))return z?[l(c?V:z(V,E.encoder,u,"key",o))+"="+l(z(m,E.encoder,u,"value",o))]:[l(V)+"="+l(String(m))];var q,k=[];if(void 0===m)return k;if("comma"===G&&M(m))c&&z&&(m=B.maybeMap(m,z)),q=[{value:m.length>0?m.join(",")||null:void 0}];else if(M(J))q=J;else{var he=Object.keys(m);q=re?he.sort(re):he}for(var be=K&&M(m)&&1===m.length?V+"[]":V,ge=0;ge0?c+l:""}},3295:(ne,F,I)=>{"use strict";var R=I(4277),B=Object.prototype.hasOwnProperty,S=Array.isArray,T=function(){for(var U=[],H=0;H<256;++H)U.push("%"+((H<16?"0":"")+H.toString(16)).toUpperCase());return U}(),M=function(H,V){for(var G=V&&V.plainObjects?Object.create(null):{},K=0;K1;){var V=H.pop(),G=V.obj[V.prop];if(S(G)){for(var K=[],X=0;X=48&&re<=57||re>=65&&re<=90||re>=97&&re<=122||X===R.RFC1738&&(40===re||41===re)?z+=Z.charAt(J):re<128?z+=T[re]:re<2048?z+=T[192|re>>6]+T[128|63&re]:re<55296||re>=57344?z+=T[224|re>>12]+T[128|re>>6&63]+T[128|63&re]:(re=65536+((1023&re)<<10|1023&Z.charCodeAt(J+=1)),z+=T[240|re>>18]+T[128|re>>12&63]+T[128|re>>6&63]+T[128|63&re])}return z},isBuffer:function(H){return!(!H||"object"!=typeof H||!(H.constructor&&H.constructor.isBuffer&&H.constructor.isBuffer(H)))},isRegExp:function(H){return"[object RegExp]"===Object.prototype.toString.call(H)},maybeMap:function(H,V){if(S(H)){for(var G=[],K=0;K{"use strict";var R=I(1308);function B(){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 S=/^([a-z0-9.+-]+:)/i,T=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,_=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),b=["'"].concat(_),C=["%","/","?",";","#"].concat(b),x=["/","?","#"],P=/^[+a-z0-9A-Z_-]{0,63}$/,A=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},N={javascript:!0,"javascript:":!0},U={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=I(8011);function V(Z,z,J){if(Z&&"object"==typeof Z&&Z instanceof B)return Z;var re=new B;return re.parse(Z,z,J),re}B.prototype.parse=function(Z,z,J){if("string"!=typeof Z)throw new TypeError("Parameter 'url' must be a string, not "+typeof Z);var re=Z.indexOf("?"),ve=-1!==re&&re127?ge+="x":ge+=be[fe];if(!ge.match(P)){var ce=q.slice(0,p),ee=q.slice(p+1),pe=be.match(A);pe&&(ce.push(pe[1]),ee.unshift(pe[2])),ee.length&&(l="/"+ee.join(".")+l),this.hostname=ce.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),k||(this.hostname=R.toASCII(this.hostname)),this.host=(this.hostname||"")+(this.port?":"+this.port:""),this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==l[0]&&(l="/"+l))}if(!O[d])for(p=0,he=b.length;p0)&&J.host.split("@"))&&(J.auth=ge.shift(),J.hostname=ge.shift(),J.host=J.hostname)),J.search=Z.search,J.query=Z.query,(null!==J.pathname||null!==J.search)&&(J.path=(J.pathname?J.pathname:"")+(J.search?J.search:"")),J.href=J.format(),J;if(!q.length)return J.pathname=null,J.path=J.search?"/"+J.search:null,J.href=J.format(),J;for(var fe=q.slice(-1)[0],se=(J.host||Z.host||q.length>1)&&("."===fe||".."===fe)||""===fe,ce=0,ee=q.length;ee>=0;ee--)"."===(fe=q[ee])?q.splice(ee,1):".."===fe?(q.splice(ee,1),ce++):ce&&(q.splice(ee,1),ce--);if(!$&&!k)for(;ce--;ce)q.unshift("..");$&&""!==q[0]&&(!q[0]||"/"!==q[0].charAt(0))&&q.unshift(""),se&&"/"!==q.join("/").substr(-1)&&q.push("");var ge,pe=""===q[0]||q[0]&&"/"===q[0].charAt(0);return be&&(J.hostname=pe?"":q.length?q.shift():"",J.host=J.hostname,(ge=!!(J.host&&J.host.indexOf("@")>0)&&J.host.split("@"))&&(J.auth=ge.shift(),J.hostname=ge.shift(),J.host=J.hostname)),($=$||J.host&&q.length)&&!pe&&q.unshift(""),q.length>0?J.pathname=q.join("/"):(J.pathname=null,J.path=null),(null!==J.pathname||null!==J.search)&&(J.path=(J.pathname?J.pathname:"")+(J.search?J.search:"")),J.auth=Z.auth||J.auth,J.slashes=J.slashes||Z.slashes,J.href=J.format(),J},B.prototype.parseHost=function(){var Z=this.host,z=T.exec(Z);z&&(":"!==(z=z[0])&&(this.port=z.substr(1)),Z=Z.substr(0,Z.length-z.length)),Z&&(this.hostname=Z)},F.parse=V,F.resolve=function K(Z,z){return V(Z,!1,!0).resolve(z)},F.resolveObject=function X(Z,z){return Z?V(Z,!1,!0).resolveObject(z):z},F.format=function G(Z){return"string"==typeof Z&&(Z=V(Z)),Z instanceof B?Z.format():B.prototype.format.call(Z)},F.Url=B},3532:ne=>{function I(R){try{if(!global.localStorage)return!1}catch(S){return!1}var B=global.localStorage[R];return null!=B&&"true"===String(B).toLowerCase()}ne.exports=function F(R,B){if(I("noDeprecation"))return R;var S=!1;return function T(){if(!S){if(I("throwDeprecation"))throw new Error(B);I("traceDeprecation")?console.trace(B):console.warn(B),S=!0}return R.apply(this,arguments)}}},1451:ne=>{ne.exports=function(I){return I&&"object"==typeof I&&"function"==typeof I.copy&&"function"==typeof I.fill&&"function"==typeof I.readUInt8}},8791:(ne,F,I)=>{"use strict";var R=I(3407),B=I(110),S=I(2031),T=I(597);function f(ae){return ae.call.bind(ae)}var M="undefined"!=typeof BigInt,_="undefined"!=typeof Symbol,b=f(Object.prototype.toString),C=f(Number.prototype.valueOf),x=f(String.prototype.valueOf),E=f(Boolean.prototype.valueOf);if(M)var P=f(BigInt.prototype.valueOf);if(_)var A=f(Symbol.prototype.valueOf);function O(ae,Le){if("object"!=typeof ae)return!1;try{return Le(ae),!0}catch(xe){return!1}}function o(ae){return"[object Map]"===b(ae)}function c(ae){return"[object Set]"===b(ae)}function d(ae){return"[object WeakMap]"===b(ae)}function w(ae){return"[object WeakSet]"===b(ae)}function s(ae){return"[object ArrayBuffer]"===b(ae)}function g(ae){return"undefined"!=typeof ArrayBuffer&&(s.working?s(ae):ae instanceof ArrayBuffer)}function $(ae){return"[object DataView]"===b(ae)}function k(ae){return"undefined"!=typeof DataView&&($.working?$(ae):ae instanceof DataView)}F.isArgumentsObject=R,F.isGeneratorFunction=B,F.isTypedArray=T,F.isPromise=function N(ae){return"undefined"!=typeof Promise&&ae instanceof Promise||null!==ae&&"object"==typeof ae&&"function"==typeof ae.then&&"function"==typeof ae.catch},F.isArrayBufferView=function U(ae){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(ae):T(ae)||k(ae)},F.isUint8Array=function H(ae){return"Uint8Array"===S(ae)},F.isUint8ClampedArray=function V(ae){return"Uint8ClampedArray"===S(ae)},F.isUint16Array=function G(ae){return"Uint16Array"===S(ae)},F.isUint32Array=function K(ae){return"Uint32Array"===S(ae)},F.isInt8Array=function X(ae){return"Int8Array"===S(ae)},F.isInt16Array=function Z(ae){return"Int16Array"===S(ae)},F.isInt32Array=function z(ae){return"Int32Array"===S(ae)},F.isFloat32Array=function J(ae){return"Float32Array"===S(ae)},F.isFloat64Array=function re(ae){return"Float64Array"===S(ae)},F.isBigInt64Array=function ve(ae){return"BigInt64Array"===S(ae)},F.isBigUint64Array=function y(ae){return"BigUint64Array"===S(ae)},o.working="undefined"!=typeof Map&&o(new Map),F.isMap=function l(ae){return"undefined"!=typeof Map&&(o.working?o(ae):ae instanceof Map)},c.working="undefined"!=typeof Set&&c(new Set),F.isSet=function u(ae){return"undefined"!=typeof Set&&(c.working?c(ae):ae instanceof Set)},d.working="undefined"!=typeof WeakMap&&d(new WeakMap),F.isWeakMap=function m(ae){return"undefined"!=typeof WeakMap&&(d.working?d(ae):ae instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),F.isWeakSet=function p(ae){return w(ae)},s.working="undefined"!=typeof ArrayBuffer&&s(new ArrayBuffer),F.isArrayBuffer=g,$.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&$(new DataView(new ArrayBuffer(1),0,1)),F.isDataView=k;var q="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function he(ae){return"[object SharedArrayBuffer]"===b(ae)}function be(ae){return void 0!==q&&(void 0===he.working&&(he.working=he(new q)),he.working?he(ae):ae instanceof q)}function pe(ae){return O(ae,C)}function ue(ae){return O(ae,x)}function _e(ae){return O(ae,E)}function Me(ae){return M&&O(ae,P)}function le(ae){return _&&O(ae,A)}F.isSharedArrayBuffer=be,F.isAsyncFunction=function ge(ae){return"[object AsyncFunction]"===b(ae)},F.isMapIterator=function fe(ae){return"[object Map Iterator]"===b(ae)},F.isSetIterator=function se(ae){return"[object Set Iterator]"===b(ae)},F.isGeneratorObject=function ce(ae){return"[object Generator]"===b(ae)},F.isWebAssemblyCompiledModule=function ee(ae){return"[object WebAssembly.Module]"===b(ae)},F.isNumberObject=pe,F.isStringObject=ue,F.isBooleanObject=_e,F.isBigIntObject=Me,F.isSymbolObject=le,F.isBoxedPrimitive=function ie(ae){return pe(ae)||ue(ae)||_e(ae)||Me(ae)||le(ae)},F.isAnyArrayBuffer=function Y(ae){return"undefined"!=typeof Uint8Array&&(g(ae)||be(ae))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ae){Object.defineProperty(F,ae,{enumerable:!1,value:function(){throw new Error(ae+" is not supported in userland")}})})},6788:(ne,F,I)=>{var R=Object.getOwnPropertyDescriptors||function(k){for(var q=Object.keys(k),he={},be=0;be=be)return se;switch(se){case"%s":return String(he[q++]);case"%d":return Number(he[q++]);case"%j":try{return JSON.stringify(he[q++])}catch(ce){return"[Circular]"}default:return se}}),fe=he[q];q=3&&(q.depth=arguments[2]),arguments.length>=4&&(q.colors=arguments[3]),H(k)?q.showHidden=k:k&&F._extend(q,k),z(q.showHidden)&&(q.showHidden=!1),z(q.depth)&&(q.depth=2),z(q.colors)&&(q.colors=!1),z(q.customInspect)&&(q.customInspect=!0),q.colors&&(q.stylize=_),x(q,$,q.depth)}function _($,k){var q=M.styles[k];return q?"\x1b["+M.colors[q][0]+"m"+$+"\x1b["+M.colors[q][1]+"m":$}function b($,k){return $}function x($,k,q){if($.customInspect&&k&&o(k.inspect)&&k.inspect!==F.inspect&&(!k.constructor||k.constructor.prototype!==k)){var he=k.inspect(q,$);return X(he)||(he=x($,he,q)),he}var be=function E($,k){if(z(k))return $.stylize("undefined","undefined");if(X(k)){var q="'"+JSON.stringify(k).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(q,"string")}return K(k)?$.stylize(""+k,"number"):H(k)?$.stylize(""+k,"boolean"):V(k)?$.stylize("null","null"):void 0}($,k);if(be)return be;var ge=Object.keys(k),fe=function C($){var k={};return $.forEach(function(q,he){k[q]=!0}),k}(ge);if($.showHidden&&(ge=Object.getOwnPropertyNames(k)),y(k)&&(ge.indexOf("message")>=0||ge.indexOf("description")>=0))return P(k);if(0===ge.length){if(o(k))return $.stylize("[Function"+(k.name?": "+k.name:"")+"]","special");if(J(k))return $.stylize(RegExp.prototype.toString.call(k),"regexp");if(ve(k))return $.stylize(Date.prototype.toString.call(k),"date");if(y(k))return P(k)}var _e,ce="",ee=!1,pe=["{","}"];return U(k)&&(ee=!0,pe=["[","]"]),o(k)&&(ce=" [Function"+(k.name?": "+k.name:"")+"]"),J(k)&&(ce=" "+RegExp.prototype.toString.call(k)),ve(k)&&(ce=" "+Date.prototype.toUTCString.call(k)),y(k)&&(ce=" "+P(k)),0!==ge.length||ee&&0!=k.length?q<0?J(k)?$.stylize(RegExp.prototype.toString.call(k),"regexp"):$.stylize("[Object]","special"):($.seen.push(k),_e=ee?function A($,k,q,he,be){for(var ge=[],fe=0,se=k.length;fe60?q[0]+(""===k?"":k+"\n ")+" "+$.join(",\n ")+" "+q[1]:q[0]+k+" "+$.join(", ")+" "+q[1]}(_e,ce,pe)):pe[0]+ce+pe[1]}function P($){return"["+Error.prototype.toString.call($)+"]"}function O($,k,q,he,be,ge){var fe,se,ce;if((ce=Object.getOwnPropertyDescriptor(k,be)||{value:k[be]}).get?se=$.stylize(ce.set?"[Getter/Setter]":"[Getter]","special"):ce.set&&(se=$.stylize("[Setter]","special")),w(he,be)||(fe="["+be+"]"),se||($.seen.indexOf(ce.value)<0?(se=V(q)?x($,ce.value,null):x($,ce.value,q-1)).indexOf("\n")>-1&&(se=ge?se.split("\n").map(function(ee){return" "+ee}).join("\n").substr(2):"\n"+se.split("\n").map(function(ee){return" "+ee}).join("\n")):se=$.stylize("[Circular]","special")),z(fe)){if(ge&&be.match(/^\d+$/))return se;(fe=JSON.stringify(""+be)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(fe=fe.substr(1,fe.length-2),fe=$.stylize(fe,"name")):(fe=fe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),fe=$.stylize(fe,"string"))}return fe+": "+se}function U($){return Array.isArray($)}function H($){return"boolean"==typeof $}function V($){return null===$}function K($){return"number"==typeof $}function X($){return"string"==typeof $}function z($){return void 0===$}function J($){return re($)&&"[object RegExp]"===c($)}function re($){return"object"==typeof $&&null!==$}function ve($){return re($)&&"[object Date]"===c($)}function y($){return re($)&&("[object Error]"===c($)||$ instanceof Error)}function o($){return"function"==typeof $}function c($){return Object.prototype.toString.call($)}function u($){return $<10?"0"+$.toString(10):$.toString(10)}F.debuglog=function($){if($=$.toUpperCase(),!S[$])if(T.test($)){var k=process.pid;S[$]=function(){var q=F.format.apply(F,arguments);console.error("%s %d: %s",$,k,q)}}else S[$]=function(){};return S[$]},F.inspect=M,M.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]},M.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},F.types=I(8791),F.isArray=U,F.isBoolean=H,F.isNull=V,F.isNullOrUndefined=function G($){return null==$},F.isNumber=K,F.isString=X,F.isSymbol=function Z($){return"symbol"==typeof $},F.isUndefined=z,F.isRegExp=J,F.types.isRegExp=J,F.isObject=re,F.isDate=ve,F.types.isDate=ve,F.isError=y,F.types.isNativeError=y,F.isFunction=o,F.isPrimitive=function l($){return null===$||"boolean"==typeof $||"number"==typeof $||"string"==typeof $||"symbol"==typeof $||void 0===$},F.isBuffer=I(1451);var d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(){var $=new Date,k=[u($.getHours()),u($.getMinutes()),u($.getSeconds())].join(":");return[$.getDate(),d[$.getMonth()],k].join(" ")}function w($,k){return Object.prototype.hasOwnProperty.call($,k)}F.log=function(){console.log("%s - %s",m(),F.format.apply(F,arguments))},F.inherits=I(3894),F._extend=function($,k){if(!k||!re(k))return $;for(var q=Object.keys(k),he=q.length;he--;)$[q[he]]=k[q[he]];return $};var p="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function s($,k){if(!$){var q=new Error("Promise was rejected with a falsy value");q.reason=$,$=q}return k($)}F.promisify=function(k){if("function"!=typeof k)throw new TypeError('The "original" argument must be of type Function');if(p&&k[p]){var q;if("function"!=typeof(q=k[p]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(q,p,{value:q,enumerable:!1,writable:!1,configurable:!0}),q}function q(){for(var he,be,ge=new Promise(function(ce,ee){he=ce,be=ee}),fe=[],se=0;se{"use strict";var R=I(9076),B=I(7029),S=I(5834),T=S("Object.prototype.toString"),M=I(2969)()&&"symbol"==typeof Symbol.toStringTag,_=B(),b=S("String.prototype.slice"),C={},x=I(8555),E=Object.getPrototypeOf;M&&x&&E&&R(_,function(O){if("function"==typeof global[O]){var N=new global[O];if(!(Symbol.toStringTag in N))throw new EvalError("this engine has support for Symbol.toStringTag, but "+O+" does not have the property! Please report this.");var U=E(N),H=x(U,Symbol.toStringTag);if(!H){var V=E(U);H=x(V,Symbol.toStringTag)}C[O]=H.get}});var A=I(597);ne.exports=function(N){return!!A(N)&&(M?function(N){var U=!1;return R(C,function(H,V){if(!U)try{var G=H.call(N);G===V&&(U=G)}catch(K){}}),U}(N):b(T(N),8,-1))}},8930:function(ne,F){"use strict";var f,I=this&&this.__extends||(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,_){M.__proto__=_}||function(M,_){for(var b in _)_.hasOwnProperty(b)&&(M[b]=_[b])},function(M,_){function b(){this.constructor=M}f(M,_),M.prototype=null===_?Object.create(_):(b.prototype=_.prototype,new b)});Object.defineProperty(F,"__esModule",{value:!0});var R=function(f){function M(){return null!==f&&f.apply(this,arguments)||this}return I(M,f),M}(Error);F.SecurityError=R;var B=function(f){function M(){return null!==f&&f.apply(this,arguments)||this}return I(M,f),M}(Error);F.InvalidStateError=B;var S=function(f){function M(){return null!==f&&f.apply(this,arguments)||this}return I(M,f),M}(Error);F.NetworkError=S;var T=function(f){function M(){return null!==f&&f.apply(this,arguments)||this}return I(M,f),M}(Error);F.SyntaxError=T},2015:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),function R(S){for(var T in S)F.hasOwnProperty(T)||(F[T]=S[T])}(I(8223));var B=I(2747);F.XMLHttpRequestEventTarget=B.XMLHttpRequestEventTarget},8717:(ne,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ProgressEvent=function R(B){this.type=B,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0}},2747:(ne,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var I=function(){function R(){this.listeners={}}return R.prototype.addEventListener=function(B,S){B=B.toLowerCase(),this.listeners[B]=this.listeners[B]||[],this.listeners[B].push(S.handleEvent||S)},R.prototype.removeEventListener=function(B,S){if(B=B.toLowerCase(),this.listeners[B]){var T=this.listeners[B].indexOf(S.handleEvent||S);T<0||this.listeners[B].splice(T,1)}},R.prototype.dispatchEvent=function(B){var S=B.type.toLowerCase();if(B.target=this,this.listeners[S])for(var T=0,f=this.listeners[S];T=0)return this._url=this._parseUrl(U.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=U,this._response.on("data",function(G){return H._onHttpResponseData(U,G)}),this._response.on("end",function(){return H._onHttpResponseEnd(U)}),this._response.on("close",function(){return H._onHttpResponseClose(U)}),this.responseUrl=this._url.href.split("#")[0],this.status=U.statusCode,this.statusText=S.STATUS_CODES[this.status],this._parseResponseHeaders(U);var V=this._responseHeaders["content-length"]||"";this._totalBytes=+V,this._lengthComputable=!!V,this._setReadyState(O.HEADERS_RECEIVED)}},O.prototype._onHttpResponseData=function(N,U){this._response===N&&(this._responseParts.push(new Buffer(U)),this._loadedBytes+=U.length,this.readyState!==O.LOADING&&this._setReadyState(O.LOADING),this._dispatchProgress("progress"))},O.prototype._onHttpResponseEnd=function(N){this._response===N&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(O.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},O.prototype._onHttpResponseClose=function(N){if(this._response===N){var U=this._request;this._setError(),U.abort(),this._setReadyState(O.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},O.prototype._onHttpTimeout=function(N){this._request===N&&(this._setError(),N.abort(),this._setReadyState(O.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},O.prototype._onHttpRequestError=function(N,U){this._request===N&&(this._setError(),N.abort(),this._setReadyState(O.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},O.prototype._dispatchProgress=function(N){var U=new O.ProgressEvent(N);U.lengthComputable=this._lengthComputable,U.loaded=this._loadedBytes,U.total=this._totalBytes,this.dispatchEvent(U)},O.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},O.prototype._parseUrl=function(N,U,H){var V=null==this.nodejsBaseUrl?N:M.resolve(this.nodejsBaseUrl,N),G=M.parse(V,!1,!0);G.hash=null;var K=(G.auth||"").split(":"),X=K[0],Z=K[1];return(X||Z||U||H)&&(G.auth=(U||X||"")+":"+(H||Z||"")),G},O.prototype._parseResponseHeaders=function(N){for(var U in this._responseHeaders={},N.headers){var H=U.toLowerCase();this._privateHeaders[H]||(this._responseHeaders[H]=N.headers[U])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},O.prototype._parseResponse=function(){var N=Buffer.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(N.toString("utf-8"))}catch(G){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=N);case"arraybuffer":this.responseText=null;for(var U=new ArrayBuffer(N.length),H=new Uint8Array(U),V=0;V{ne.exports=function I(){for(var R={},B=0;B{},6601:()=>{},8623:()=>{},7748:()=>{},5568:()=>{},6619:()=>{},4654:()=>{},7108:()=>{},7029:ne=>{"use strict";var F=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];ne.exports=function(){for(var R=[],B=0;B{"use strict";var B=I(5203)("%Object.getOwnPropertyDescriptor%");if(B)try{B([],"length")}catch(S){B=null}ne.exports=B},4946:ne=>{"use strict";ne.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},5207:ne=>{"use strict";ne.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},7036:ne=>{"use strict";ne.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},9799:ne=>{"use strict";ne.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},8597:ne=>{"use strict";ne.exports={i8:"6.5.4"}},2562:ne=>{"use strict";ne.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},ne=>{ne(ne.s=3581)}]); \ No newline at end of file diff --git a/main.f74c269f1aac0972.js b/main.f74c269f1aac0972.js new file mode 100644 index 0000000..cf494fe --- /dev/null +++ b/main.f74c269f1aac0972.js @@ -0,0 +1 @@ +(self.webpackChunktezos_snaps_wallet=self.webpackChunktezos_snaps_wallet||[]).push([[179],{5876:(ne,F,I)=>{const B=I(532),S=I(7554),T=I(179),f=I(1036);function M(_,b,C,x,E){const P=[].slice.call(arguments,1),A=P.length,O="function"==typeof P[A-1];if(!O&&!B())throw new Error("Callback required as last argument");if(!O){if(A<1)throw new Error("Too few arguments provided");return 1===A?(C=b,b=x=void 0):2===A&&!b.getContext&&(x=C,C=b,b=void 0),new Promise(function(N,U){try{const H=S.create(C,x);N(_(H,b,x))}catch(H){U(H)}})}if(A<2)throw new Error("Too few arguments provided");2===A?(E=C,C=b,b=x=void 0):3===A&&(b.getContext&&void 0===E?(E=x,x=void 0):(E=x,x=C,C=b,b=void 0));try{const N=S.create(C,x);E(null,_(N,b,x))}catch(N){E(N)}}F.rT=M.bind(null,T.render),F.hz=M.bind(null,T.renderToDataURL),F.toString=M.bind(null,function(_,b,C){return f.render(_,C)})},532:ne=>{ne.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},3012:(ne,F,I)=>{const R=I(4860).getSymbolSize;F.getRowColCoords=function(S){if(1===S)return[];const T=Math.floor(S/7)+2,f=R(S),M=145===f?26:2*Math.ceil((f-13)/(2*T-2)),_=[f-7];for(let b=1;b{const R=I(6906),B=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function S(T){this.mode=R.ALPHANUMERIC,this.data=T}S.getBitsLength=function(f){return 11*Math.floor(f/2)+f%2*6},S.prototype.getLength=function(){return this.data.length},S.prototype.getBitsLength=function(){return S.getBitsLength(this.data.length)},S.prototype.write=function(f){let M;for(M=0;M+2<=this.data.length;M+=2){let _=45*B.indexOf(this.data[M]);_+=B.indexOf(this.data[M+1]),f.put(_,11)}this.data.length%2&&f.put(B.indexOf(this.data[M]),6)},ne.exports=S},3044:ne=>{function F(){this.buffer=[],this.length=0}F.prototype={get:function(I){const R=Math.floor(I/8);return 1==(this.buffer[R]>>>7-I%8&1)},put:function(I,R){for(let B=0;B>>R-B-1&1))},getLengthInBits:function(){return this.length},putBit:function(I){const R=Math.floor(this.length/8);this.buffer.length<=R&&this.buffer.push(0),I&&(this.buffer[R]|=128>>>this.length%8),this.length++}},ne.exports=F},1973:ne=>{function F(I){if(!I||I<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=I,this.data=new Uint8Array(I*I),this.reservedBit=new Uint8Array(I*I)}F.prototype.set=function(I,R,B,S){const T=I*this.size+R;this.data[T]=B,S&&(this.reservedBit[T]=!0)},F.prototype.get=function(I,R){return this.data[I*this.size+R]},F.prototype.xor=function(I,R,B){this.data[I*this.size+R]^=B},F.prototype.isReserved=function(I,R){return this.reservedBit[I*this.size+R]},ne.exports=F},1824:(ne,F,I)=>{const R=I(8419),B=I(6906);function S(T){this.mode=B.BYTE,this.data=new Uint8Array(R(T))}S.getBitsLength=function(f){return 8*f},S.prototype.getLength=function(){return this.data.length},S.prototype.getBitsLength=function(){return S.getBitsLength(this.data.length)},S.prototype.write=function(T){for(let f=0,M=this.data.length;f{const R=I(9020),B=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],S=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];F.getBlocksCount=function(f,M){switch(M){case R.L:return B[4*(f-1)+0];case R.M:return B[4*(f-1)+1];case R.Q:return B[4*(f-1)+2];case R.H:return B[4*(f-1)+3];default:return}},F.getTotalCodewordsCount=function(f,M){switch(M){case R.L:return S[4*(f-1)+0];case R.M:return S[4*(f-1)+1];case R.Q:return S[4*(f-1)+2];case R.H:return S[4*(f-1)+3];default:return}}},9020:(ne,F)=>{F.L={bit:1},F.M={bit:0},F.Q={bit:3},F.H={bit:2},F.isValid=function(B){return B&&void 0!==B.bit&&B.bit>=0&&B.bit<4},F.from=function(B,S){if(F.isValid(B))return B;try{return function I(R){if("string"!=typeof R)throw new Error("Param is not a string");switch(R.toLowerCase()){case"l":case"low":return F.L;case"m":case"medium":return F.M;case"q":case"quartile":return F.Q;case"h":case"high":return F.H;default:throw new Error("Unknown EC Level: "+R)}}(B)}catch(T){return S}}},9172:(ne,F,I)=>{const R=I(4860).getSymbolSize;F.getPositions=function(T){const f=R(T);return[[0,0],[f-7,0],[0,f-7]]}},611:(ne,F,I)=>{const R=I(4860),T=R.getBCHDigit(1335);F.getEncodedBits=function(M,_){const b=M.bit<<3|_;let C=b<<10;for(;R.getBCHDigit(C)-T>=0;)C^=1335<{const I=new Uint8Array(512),R=new Uint8Array(256);(function(){let S=1;for(let T=0;T<255;T++)I[T]=S,R[S]=T,S<<=1,256&S&&(S^=285);for(let T=255;T<512;T++)I[T]=I[T-255]})(),F.log=function(S){if(S<1)throw new Error("log("+S+")");return R[S]},F.exp=function(S){return I[S]},F.mul=function(S,T){return 0===S||0===T?0:I[R[S]+R[T]]}},8043:(ne,F,I)=>{const R=I(6906),B=I(4860);function S(T){this.mode=R.KANJI,this.data=T}S.getBitsLength=function(f){return 13*f},S.prototype.getLength=function(){return this.data.length},S.prototype.getBitsLength=function(){return S.getBitsLength(this.data.length)},S.prototype.write=function(T){let f;for(f=0;f=33088&&M<=40956)M-=33088;else{if(!(M>=57408&&M<=60351))throw new Error("Invalid SJIS character: "+this.data[f]+"\nMake sure your charset is UTF-8");M-=49472}M=192*(M>>>8&255)+(255&M),T.put(M,13)}},ne.exports=S},7135:(ne,F)=>{F.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function R(B,S,T){switch(B){case F.Patterns.PATTERN000:return(S+T)%2==0;case F.Patterns.PATTERN001:return S%2==0;case F.Patterns.PATTERN010:return T%3==0;case F.Patterns.PATTERN011:return(S+T)%3==0;case F.Patterns.PATTERN100:return(Math.floor(S/2)+Math.floor(T/3))%2==0;case F.Patterns.PATTERN101:return S*T%2+S*T%3==0;case F.Patterns.PATTERN110:return(S*T%2+S*T%3)%2==0;case F.Patterns.PATTERN111:return(S*T%3+(S+T)%2)%2==0;default:throw new Error("bad maskPattern:"+B)}}F.isValid=function(S){return null!=S&&""!==S&&!isNaN(S)&&S>=0&&S<=7},F.from=function(S){return F.isValid(S)?parseInt(S,10):void 0},F.getPenaltyN1=function(S){const T=S.size;let f=0,M=0,_=0,b=null,C=null;for(let x=0;x=5&&(f+=M-5+3),b=P,M=1),P=S.get(E,x),P===C?_++:(_>=5&&(f+=_-5+3),C=P,_=1)}M>=5&&(f+=M-5+3),_>=5&&(f+=_-5+3)}return f},F.getPenaltyN2=function(S){const T=S.size;let f=0;for(let M=0;M=10&&(1488===M||93===M)&&f++,_=_<<1&2047|S.get(C,b),C>=10&&(1488===_||93===_)&&f++}return 40*f},F.getPenaltyN4=function(S){let T=0;const f=S.data.length;for(let _=0;_{const R=I(2316),B=I(4677);F.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},F.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},F.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},F.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},F.MIXED={bit:-1},F.getCharCountIndicator=function(f,M){if(!f.ccBits)throw new Error("Invalid mode: "+f);if(!R.isValid(M))throw new Error("Invalid version: "+M);return M>=1&&M<10?f.ccBits[0]:M<27?f.ccBits[1]:f.ccBits[2]},F.getBestModeForData=function(f){return B.testNumeric(f)?F.NUMERIC:B.testAlphanumeric(f)?F.ALPHANUMERIC:B.testKanji(f)?F.KANJI:F.BYTE},F.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},F.isValid=function(f){return f&&f.bit&&f.ccBits},F.from=function(f,M){if(F.isValid(f))return f;try{return function S(T){if("string"!=typeof T)throw new Error("Param is not a string");switch(T.toLowerCase()){case"numeric":return F.NUMERIC;case"alphanumeric":return F.ALPHANUMERIC;case"kanji":return F.KANJI;case"byte":return F.BYTE;default:throw new Error("Unknown mode: "+T)}}(f)}catch(_){return M}}},6002:(ne,F,I)=>{const R=I(6906);function B(S){this.mode=R.NUMERIC,this.data=S.toString()}B.getBitsLength=function(T){return 10*Math.floor(T/3)+(T%3?T%3*3+1:0)},B.prototype.getLength=function(){return this.data.length},B.prototype.getBitsLength=function(){return B.getBitsLength(this.data.length)},B.prototype.write=function(T){let f,M,_;for(f=0;f+3<=this.data.length;f+=3)M=this.data.substr(f,3),_=parseInt(M,10),T.put(_,10);const b=this.data.length-f;b>0&&(M=this.data.substr(f),_=parseInt(M,10),T.put(_,3*b+1))},ne.exports=B},5179:(ne,F,I)=>{const R=I(7794);F.mul=function(S,T){const f=new Uint8Array(S.length+T.length-1);for(let M=0;M=0;){const M=f[0];for(let b=0;b{const R=I(4860),B=I(9020),S=I(3044),T=I(1973),f=I(3012),M=I(9172),_=I(7135),b=I(6194),C=I(8098),x=I(6602),E=I(611),P=I(6906),A=I(9465);function V(z,J,re){const ve=z.size,y=E.getEncodedBits(J,re);let o,l;for(o=0;o<15;o++)l=1==(y>>o&1),z.set(o<6?o:o<8?o+1:ve-15+o,8,l,!0),z.set(8,o<8?ve-o-1:o<9?15-o-1+1:15-o-1,l,!0);z.set(ve-8,8,1,!0)}function Z(z,J,re,ve){let y;if(Array.isArray(z))y=A.fromArray(z);else{if("string"!=typeof z)throw new Error("Invalid data");{let d=J;if(!d){const m=A.rawSplit(z);d=x.getBestVersionForData(m,re)}y=A.fromString(z,d||40)}}const o=x.getBestVersionForData(y,re);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(J){if(J=0&&c<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===c||6===c)||c>=2&&c<=4&&u>=2&&u<=4,!0)}}(u,J),function N(z){const J=z.size;for(let re=8;re=7&&function H(z,J){const re=z.size,ve=x.getEncodedBits(J);let y,o,l;for(let c=0;c<18;c++)y=Math.floor(c/3),o=c%3+re-8-3,l=1==(ve>>c&1),z.set(y,o,l,!0),z.set(o,y,l,!0)}(u,J),function G(z,J){const re=z.size;let ve=-1,y=re-1,o=7,l=0;for(let c=re-1;c>0;c-=2)for(6===c&&c--;;){for(let u=0;u<2;u++)if(!z.isReserved(y,c-u)){let d=!1;l>>o&1)),z.set(y,c-u,d),o--,-1===o&&(l++,o=7)}if(y+=ve,y<0||re<=y){y-=ve,ve=-ve;break}}}(u,l),isNaN(ve)&&(ve=_.getBestMask(u,V.bind(null,u,re))),_.applyMask(ve,u),V(u,re,ve),{modules:u,version:J,errorCorrectionLevel:re,maskPattern:ve,segments:y}}F.create=function(J,re){if(void 0===J||""===J)throw new Error("No input text");let y,o,ve=B.M;return void 0!==re&&(ve=B.from(re.errorCorrectionLevel,B.M),y=x.from(re.version),o=_.from(re.maskPattern),re.toSJISFunc&&R.setToSJISFunction(re.toSJISFunc)),Z(J,y,ve,o)}},8098:(ne,F,I)=>{const R=I(5179);function B(S){this.genPoly=void 0,this.degree=S,this.degree&&this.initialize(this.degree)}B.prototype.initialize=function(T){this.degree=T,this.genPoly=R.generateECPolynomial(this.degree)},B.prototype.encode=function(T){if(!this.genPoly)throw new Error("Encoder not initialized");const f=new Uint8Array(T.length+this.degree);f.set(T);const M=R.mod(f,this.genPoly),_=this.degree-M.length;if(_>0){const b=new Uint8Array(this.degree);return b.set(M,_),b}return M},ne.exports=B},4677:(ne,F)=>{const I="[0-9]+";let B="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";B=B.replace(/u/g,"\\u");const S="(?:(?![A-Z0-9 $%*+\\-./:]|"+B+")(?:.|[\r\n]))+";F.KANJI=new RegExp(B,"g"),F.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),F.BYTE=new RegExp(S,"g"),F.NUMERIC=new RegExp(I,"g"),F.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const T=new RegExp("^"+B+"$"),f=new RegExp("^"+I+"$"),M=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");F.testKanji=function(b){return T.test(b)},F.testNumeric=function(b){return f.test(b)},F.testAlphanumeric=function(b){return M.test(b)}},9465:(ne,F,I)=>{const R=I(6906),B=I(6002),S=I(812),T=I(1824),f=I(8043),M=I(4677),_=I(4860),b=I(4901);function C(H){return unescape(encodeURIComponent(H)).length}function x(H,V,G){const K=[];let X;for(;null!==(X=H.exec(G));)K.push({data:X[0],index:X.index,mode:V,length:X[0].length});return K}function E(H){const V=x(M.NUMERIC,R.NUMERIC,H),G=x(M.ALPHANUMERIC,R.ALPHANUMERIC,H);let K,X;return _.isKanjiModeEnabled()?(K=x(M.BYTE,R.BYTE,H),X=x(M.KANJI,R.KANJI,H)):(K=x(M.BYTE_KANJI,R.BYTE,H),X=[]),V.concat(G,K,X).sort(function(z,J){return z.index-J.index}).map(function(z){return{data:z.data,mode:z.mode,length:z.length}})}function P(H,V){switch(V){case R.NUMERIC:return B.getBitsLength(H);case R.ALPHANUMERIC:return S.getBitsLength(H);case R.KANJI:return f.getBitsLength(H);case R.BYTE:return T.getBitsLength(H)}}function U(H,V){let G;const K=R.getBestModeForData(H);if(G=R.from(V,K),G!==R.BYTE&&G.bit=0?V[V.length-1]:null;return K&&K.mode===G.mode?(V[V.length-1].data+=G.data,V):(V.push(G),V)},[])}(J))},F.rawSplit=function(V){return F.fromArray(E(V,_.isKanjiModeEnabled()))}},4860:(ne,F)=>{let I;const R=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];F.getSymbolSize=function(S){if(!S)throw new Error('"version" cannot be null or undefined');if(S<1||S>40)throw new Error('"version" should be in range from 1 to 40');return 4*S+17},F.getSymbolTotalCodewords=function(S){return R[S]},F.getBCHDigit=function(B){let S=0;for(;0!==B;)S++,B>>>=1;return S},F.setToSJISFunction=function(S){if("function"!=typeof S)throw new Error('"toSJISFunc" is not a valid function.');I=S},F.isKanjiModeEnabled=function(){return void 0!==I},F.toSJIS=function(S){return I(S)}},2316:(ne,F)=>{F.isValid=function(R){return!isNaN(R)&&R>=1&&R<=40}},6602:(ne,F,I)=>{const R=I(4860),B=I(6194),S=I(9020),T=I(6906),f=I(2316),_=R.getBCHDigit(7973);function C(P,A){return T.getCharCountIndicator(P,A)+4}function x(P,A){let O=0;return P.forEach(function(N){O+=C(N.mode,A)+N.getBitsLength()}),O}F.from=function(A,O){return f.isValid(A)?parseInt(A,10):O},F.getCapacity=function(A,O,N){if(!f.isValid(A))throw new Error("Invalid QR Code version");void 0===N&&(N=T.BYTE);const V=8*(R.getSymbolTotalCodewords(A)-B.getTotalCodewordsCount(A,O));if(N===T.MIXED)return V;const G=V-C(N,A);switch(N){case T.NUMERIC:return Math.floor(G/10*3);case T.ALPHANUMERIC:return Math.floor(G/11*2);case T.KANJI:return Math.floor(G/13);default:return Math.floor(G/8)}},F.getBestVersionForData=function(A,O){let N;const U=S.from(O,S.M);if(Array.isArray(A)){if(A.length>1)return function E(P,A){for(let O=1;O<=40;O++)if(x(P,O)<=F.getCapacity(O,A,T.MIXED))return O}(A,U);if(0===A.length)return 1;N=A[0]}else N=A;return function b(P,A,O){for(let N=1;N<=40;N++)if(A<=F.getCapacity(N,O,P))return N}(N.mode,N.getLength(),U)},F.getEncodedBits=function(A){if(!f.isValid(A)||A<7)throw new Error("Invalid QR Code version");let O=A<<12;for(;R.getBCHDigit(O)-_>=0;)O^=7973<{const R=I(714);F.render=function(f,M,_){let b=_,C=M;void 0===b&&(!M||!M.getContext)&&(b=M,M=void 0),M||(C=function S(){try{return document.createElement("canvas")}catch(T){throw new Error("You need to specify a canvas element")}}()),b=R.getOptions(b);const x=R.getImageWidth(f.modules.size,b),E=C.getContext("2d"),P=E.createImageData(x,x);return R.qrToImageData(P.data,f,b),function B(T,f,M){T.clearRect(0,0,f.width,f.height),f.style||(f.style={}),f.height=M,f.width=M,f.style.height=M+"px",f.style.width=M+"px"}(E,C,x),E.putImageData(P,0,0),C},F.renderToDataURL=function(f,M,_){let b=_;return void 0===b&&(!M||!M.getContext)&&(b=M,M=void 0),b||(b={}),F.render(f,M,b).toDataURL(b.type||"image/png",(b.rendererOpts||{}).quality)}},1036:(ne,F,I)=>{const R=I(714);function B(f,M){const _=f.a/255,b=M+'="'+f.hex+'"';return _<1?b+" "+M+'-opacity="'+_.toFixed(2).slice(1)+'"':b}function S(f,M,_){let b=f+M;return void 0!==_&&(b+=" "+_),b}F.render=function(M,_,b){const C=R.getOptions(_),x=M.modules.size,E=M.modules.data,P=x+2*C.margin,A=C.color.light.a?"':"",O="0&&A>0&&f[P-1]||(b+=x?S("M",A+_,.5+O+_):S("m",C,0),C=0,x=!1),A+1',H=''+A+O+"\n";return"function"==typeof b&&b(null,H),H}},714:(ne,F)=>{function I(R){if("number"==typeof R&&(R=R.toString()),"string"!=typeof R)throw new Error("Color should be defined as hex string");let B=R.slice().replace("#","").split("");if(B.length<3||5===B.length||B.length>8)throw new Error("Invalid hex color: "+R);(3===B.length||4===B.length)&&(B=Array.prototype.concat.apply([],B.map(function(T){return[T,T]}))),6===B.length&&B.push("F","F");const S=parseInt(B.join(""),16);return{r:S>>24&255,g:S>>16&255,b:S>>8&255,a:255&S,hex:"#"+B.slice(0,6).join("")}}F.getOptions=function(B){B||(B={}),B.color||(B.color={});const T=B.width&&B.width>=21?B.width:void 0;return{width:T,scale:T?4:B.scale||4,margin:null==B.margin||B.margin<0?4:B.margin,color:{dark:I(B.color.dark||"#000000ff"),light:I(B.color.light||"#ffffffff")},type:B.type,rendererOpts:B.rendererOpts||{}}},F.getScale=function(B,S){return S.width&&S.width>=B+2*S.margin?S.width/(B+2*S.margin):S.scale},F.getImageWidth=function(B,S){const T=F.getScale(B,S);return Math.floor((B+2*S.margin)*T)},F.qrToImageData=function(B,S,T){const f=S.modules.size,M=S.modules.data,_=F.getScale(f,T),b=Math.floor((f+2*T.margin)*_),C=T.margin*_,x=[T.color.light,T.color.dark];for(let E=0;E=C&&P>=C&&E{"use strict";function R(n){return"function"==typeof n}let B=!1;const S={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else B&&console.log("RxJS: Back to a better error behavior. Thank you. <3");B=n},get useDeprecatedSynchronousErrorHandling(){return B}};function T(n){setTimeout(()=>{throw n},0)}const f={closed:!0,next(n){},error(n){if(S.useDeprecatedSynchronousErrorHandling)throw n;T(n)},complete(){}},M=Array.isArray||(n=>n&&"number"==typeof n.length);function _(n){return null!==n&&"object"==typeof n}const C=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,r)=>`${r+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class x{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:r,_unsubscribe:i,_subscriptions:a}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof x)t.remove(this);else if(null!==t)for(let h=0;he.concat(t instanceof C?t.errors:t),[])}x.EMPTY=((n=new x).closed=!0,n);const P="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class O extends x{constructor(e,t,r){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=f;break;case 1:if(!e){this.destination=f;break}if("object"==typeof e){e instanceof O?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new N(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new N(this,e,t,r)}}[P](){return this}static create(e,t,r){const i=new O(e,t,r);return i.syncErrorThrowable=!1,i}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class N extends O{constructor(e,t,r,i){super(),this._parentSubscriber=e;let a,h=this;R(t)?a=t:t&&(a=t.next,r=t.error,i=t.complete,t!==f&&(h=Object.create(t),R(h.unsubscribe)&&this.add(h.unsubscribe.bind(h)),h.unsubscribe=this.unsubscribe.bind(this))),this._context=h,this._next=a,this._error=r,this._complete=i}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;S.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:r}=S;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):T(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;T(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);S.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(r){if(this.unsubscribe(),S.useDeprecatedSynchronousErrorHandling)throw r;T(r)}}__tryOrSetError(e,t,r){if(!S.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(i){return S.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=i,e.syncErrorThrown=!0,!0):(T(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const V="function"==typeof Symbol&&Symbol.observable||"@@observable";function G(n){return n}let Z=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const r=new n;return r.source=this,r.operator=t,r}subscribe(t,r,i){const{operator:a}=this,h=function H(n,e,t){if(n){if(n instanceof O)return n;if(n[P])return n[P]()}return n||e||t?new O(n,e,t):new O(f)}(t,r,i);if(h.add(a?a.call(h,this.source):this.source||S.useDeprecatedSynchronousErrorHandling&&!h.syncErrorThrowable?this._subscribe(h):this._trySubscribe(h)),S.useDeprecatedSynchronousErrorHandling&&h.syncErrorThrowable&&(h.syncErrorThrowable=!1,h.syncErrorThrown))throw h.syncErrorValue;return h}_trySubscribe(t){try{return this._subscribe(t)}catch(r){S.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=r),function U(n){for(;n;){const{closed:e,destination:t,isStopped:r}=n;if(e||r)return!1;n=t&&t instanceof O?t:null}return!0}(t)?t.error(r):console.warn(r)}}forEach(t,r){return new(r=z(r))((i,a)=>{let h;h=this.subscribe(v=>{try{t(v)}catch(D){a(D),h&&h.unsubscribe()}},a,i)})}_subscribe(t){const{source:r}=this;return r&&r.subscribe(t)}[V](){return this}pipe(...t){return 0===t.length?this:function X(n){return 0===n.length?G:1===n.length?n[0]:function(t){return n.reduce((r,i)=>i(r),t)}}(t)(this)}toPromise(t){return new(t=z(t))((r,i)=>{let a;this.subscribe(h=>a=h,h=>i(h),()=>r(a))})}}return n.create=e=>new n(e),n})();function z(n){if(n||(n=S.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const re=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class ve extends x{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}class y extends O{constructor(e){super(e),this.destination=e}}let o=(()=>{class n extends Z{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[P](){return new y(this)}lift(t){const r=new l(this,this);return r.operator=t,r}next(t){if(this.closed)throw new re;if(!this.isStopped){const{observers:r}=this,i=r.length,a=r.slice();for(let h=0;hnew l(e,t),n})();class l extends o{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):x.EMPTY}}function c(n){return n&&"function"==typeof n.schedule}function u(n,e){return function(r){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new d(n,e))}}class d{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new m(e,this.project,this.thisArg))}}class m extends O{constructor(e,t,r){super(e),this.project=t,this.count=0,this.thisArg=r||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(r){return void this.destination.error(r)}this.destination.next(t)}}const w=n=>e=>{for(let t=0,r=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function be(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const ge=n=>{if(n&&"function"==typeof n[V])return(n=>e=>{const t=n[V]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(he(n))return w(n);if(be(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,T),e))(n);if(n&&"function"==typeof n[g])return(n=>e=>{const t=n[g]();for(;;){let r;try{r=t.next()}catch(i){return e.error(i),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${_(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function ce(n,e){return new Z(t=>{const r=new x;let i=0;return r.add(e.schedule(function(){i!==n.length?(t.next(n[i++]),t.closed||r.add(this.schedule())):t.complete()})),r})}function Me(n,e){return e?function _e(n,e){if(null!=n){if(function pe(n){return n&&"function"==typeof n[V]}(n))return function fe(n,e){return new Z(t=>{const r=new x;return r.add(e.schedule(()=>{const i=n[V]();r.add(i.subscribe({next(a){r.add(e.schedule(()=>t.next(a)))},error(a){r.add(e.schedule(()=>t.error(a)))},complete(){r.add(e.schedule(()=>t.complete()))}}))})),r})}(n,e);if(be(n))return function se(n,e){return new Z(t=>{const r=new x;return r.add(e.schedule(()=>n.then(i=>{r.add(e.schedule(()=>{t.next(i),r.add(e.schedule(()=>t.complete()))}))},i=>{r.add(e.schedule(()=>t.error(i)))}))),r})}(n,e);if(he(n))return ce(n,e);if(function ue(n){return n&&"function"==typeof n[g]}(n)||"string"==typeof n)return function ee(n,e){if(!n)throw new Error("Iterable cannot be null");return new Z(t=>{const r=new x;let i;return r.add(()=>{i&&"function"==typeof i.return&&i.return()}),r.add(e.schedule(()=>{i=n[g](),r.add(e.schedule(function(){if(t.closed)return;let a,h;try{const v=i.next();a=v.value,h=v.done}catch(v){return void t.error(v)}h?t.complete():(t.next(a),this.schedule())}))})),r})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof Z?n:new Z(ge(n))}class le extends O{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class Y extends O{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function Le(n,e){if(e.closed)return;if(n instanceof Z)return n.subscribe(e);let t;try{t=ge(n)(e)}catch(r){e.error(r)}return t}function xe(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?r=>r.pipe(xe((i,a)=>Me(n(i,a)).pipe(u((h,v)=>e(i,h,a,v))),t)):("number"==typeof e&&(t=e),r=>r.lift(new Ce(n,t)))}class Ce{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new Re(e,this.project,this.concurrent))}}class Re extends Y{constructor(e,t,r=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function Oe(n=Number.POSITIVE_INFINITY){return xe(G,n)}function wt(n,e){return e?ce(n,e):new Z(w(n))}function Be(...n){let e=Number.POSITIVE_INFINITY,t=null,r=n[n.length-1];return c(r)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof r&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof Z?n[0]:Oe(e)(wt(n,t))}function oe(){return function(e){return e.lift(new te(e))}}class te{constructor(e){this.connectable=e}call(e,t){const{connectable:r}=this;r._refCount++;const i=new W(e,r),a=t.subscribe(i);return i.closed||(i.connection=r.connect()),a}}class W extends O{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:r}=this,i=e._connection;this.connection=null,i&&(!r||i===r)&&i.unsubscribe()}}class de extends Z{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new x,e.add(this.source.subscribe(new Ee(this.getSubject(),this))),e.closed&&(this._connection=null,e=x.EMPTY)),e}refCount(){return oe()(this)}}const Pe=(()=>{const n=de.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class Ee extends y{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}class Je{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:r}=this,i=this.subjectFactory(),a=r(i).subscribe(e);return a.add(t.subscribe(i)),a}}function kt(){return new o}function tt(n){for(let e in n)if(n[e]===tt)return e;throw Error("Could not find renamed property on target object.")}function Dn(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function nt(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(nt).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function ht(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const ln=tt({__forward_ref__:tt});function We(n){return n.__forward_ref__=We,n.toString=function(){return nt(this())},n}function ze(n){return un(n)?n():n}function un(n){return"function"==typeof n&&n.hasOwnProperty(ln)&&n.__forward_ref__===We}class Ne extends Error{constructor(e,t){super(function Xt(n,e){return`NG0${Math.abs(n)}${e?": "+e:""}`}(e,t)),this.code=e}}function $e(n){return"string"==typeof n?n:null==n?"":String(n)}function et(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():$e(n)}function cn(n,e){const t=e?` in ${e}`:"";throw new Ne(-201,`No provider for ${et(n)} found${t}`)}function hn(n,e){null==n&&function Lt(n,e,t,r){throw new Error(`ASSERTION ERROR: ${n}`+(null==r?"":` [Expected=> ${t} ${r} ${e} <=Actual]`))}(e,n,null,"!=")}function xt(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function jt(n){return{providers:n.providers||[],imports:n.imports||[]}}function Rn(n){return Pn(n,ds)||Pn(n,o1)}function Pn(n,e){return n.hasOwnProperty(e)?n[e]:null}function Ea(n){return n&&(n.hasOwnProperty(xd)||n.hasOwnProperty(NS))?n[xd]:null}const ds=tt({\u0275prov:tt}),xd=tt({\u0275inj:tt}),o1=tt({ngInjectableDef:tt}),NS=tt({ngInjectorDef:tt});var en=(()=>((en=en||{})[en.Default=0]="Default",en[en.Host=1]="Host",en[en.Self=2]="Self",en[en.SkipSelf=4]="SkipSelf",en[en.Optional=8]="Optional",en))();let Sd;function ps(n){const e=Sd;return Sd=n,e}function s1(n,e,t){const r=Rn(n);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:t&en.Optional?null:void 0!==e?e:void cn(nt(n),"Injector")}function gs(n){return{toString:n}.toString()}var Yi=(()=>((Yi=Yi||{})[Yi.OnPush=0]="OnPush",Yi[Yi.Default=1]="Default",Yi))(),Qi=(()=>(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom"}(Qi||(Qi={})),Qi))();const BS="undefined"!=typeof globalThis&&globalThis,LS="undefined"!=typeof window&&window,FS="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Zn=BS||"undefined"!=typeof global&&global||LS||FS,xa={},Yn=[],xc=tt({\u0275cmp:tt}),Cd=tt({\u0275dir:tt}),Ad=tt({\u0275pipe:tt}),a1=tt({\u0275mod:tt}),zo=tt({\u0275fac:tt}),Fl=tt({__NG_ELEMENT_ID__:tt});let US=0;function Un(n){return gs(()=>{const t={},r={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===Yi.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||Yn,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Qi.Emulated,id:"c",styles:n.styles||Yn,_:null,setInput:null,schemas:n.schemas||null,tView:null},i=n.directives,a=n.features,h=n.pipes;return r.id+=US++,r.inputs=f1(n.inputs,t),r.outputs=f1(n.outputs),a&&a.forEach(v=>v(r)),r.directiveDefs=i?()=>("function"==typeof i?i():i).map(l1):null,r.pipeDefs=h?()=>("function"==typeof h?h():h).map(u1):null,r})}function l1(n){return jr(n)||function ms(n){return n[Cd]||null}(n)}function u1(n){return function Vs(n){return n[Ad]||null}(n)}const c1={};function _r(n){return gs(()=>{const e={type:n.type,bootstrap:n.bootstrap||Yn,declarations:n.declarations||Yn,imports:n.imports||Yn,exports:n.exports||Yn,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(c1[n.id]=n.type),e})}function f1(n,e){if(null==n)return xa;const t={};for(const r in n)if(n.hasOwnProperty(r)){let i=n[r],a=i;Array.isArray(i)&&(a=i[1],i=i[0]),t[i]=r,e&&(e[i]=a)}return t}const $t=Un;function Gr(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function jr(n){return n[xc]||null}function Pi(n,e){const t=n[a1]||null;if(!t&&!0===e)throw new Error(`Type ${nt(n)} does not have '\u0275mod' property.`);return t}function xo(n){return Array.isArray(n)&&"object"==typeof n[1]}function eo(n){return Array.isArray(n)&&!0===n[1]}function Id(n){return 0!=(8&n.flags)}function Tc(n){return 2==(2&n.flags)}function Dc(n){return 1==(1&n.flags)}function to(n){return null!==n.template}function GS(n){return 0!=(512&n[2])}function Gs(n,e){return n.hasOwnProperty(zo)?n[zo]:null}class WS{constructor(e,t,r){this.previousValue=e,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}}function qr(){return d1}function d1(n){return n.type.prototype.ngOnChanges&&(n.setInput=XS),ZS}function ZS(){const n=g1(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===xa)n.previous=e;else for(let r in e)t[r]=e[r];n.current=null,this.ngOnChanges(e)}}function XS(n,e,t,r){const i=g1(n)||function YS(n,e){return n[p1]=e}(n,{previous:xa,current:null}),a=i.current||(i.current={}),h=i.previous,v=this.declaredInputs[t],D=h[v];a[v]=new WS(D&&D.currentValue,e,h===xa),n[r]=e}qr.ngInherit=!0;const p1="__ngSimpleChanges__";function g1(n){return n[p1]||null}let kd;function Bd(){return void 0!==kd?kd:"undefined"!=typeof document?document:void 0}function pr(n){return!!n.listen}const m1={createRenderer:(n,e)=>Bd()};function Sr(n){for(;Array.isArray(n);)n=n[0];return n}function Ic(n,e){return Sr(e[n])}function _i(n,e){return Sr(e[n.index])}function Ld(n,e){return n.data[e]}function Da(n,e){return n[e]}function wi(n,e){const t=e[n];return xo(t)?t:t[0]}function v1(n){return 4==(4&n[2])}function Fd(n){return 128==(128&n[2])}function vs(n,e){return null==e?null:n[e]}function y1(n){n[18]=0}function Ud(n,e){n[5]+=e;let t=n,r=n[3];for(;null!==r&&(1===e&&1===t[5]||-1===e&&0===t[5]);)r[5]+=e,t=r,r=r[3]}const rn={lFrame:A1(null),bindingsEnabled:!0};function _1(){return rn.bindingsEnabled}function Et(){return rn.lFrame.lView}function Cn(){return rn.lFrame.tView}function ui(n){return rn.lFrame.contextLView=n,n[8]}function Rr(){let n=w1();for(;null!==n&&64===n.type;)n=n.parent;return n}function w1(){return rn.lFrame.currentTNode}function So(n,e){const t=rn.lFrame;t.currentTNode=n,t.isParent=e}function Hd(){return rn.lFrame.isParent}function Vd(){rn.lFrame.isParent=!1}function ei(){const n=rn.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Ia(){return rn.lFrame.bindingIndex++}function Ko(n){const e=rn.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function pC(n,e){const t=rn.lFrame;t.bindingIndex=t.bindingRootIndex=n,jd(e)}function jd(n){rn.lFrame.currentDirectiveIndex=n}function $d(n){const e=rn.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function x1(){return rn.lFrame.currentQueryIndex}function zd(n){rn.lFrame.currentQueryIndex=n}function mC(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function S1(n,e,t){if(t&en.SkipSelf){let i=e,a=n;for(;!(i=i.parent,null!==i||t&en.Host||(i=mC(a),null===i||(a=a[15],10&i.type))););if(null===i)return!1;e=i,n=a}const r=rn.lFrame=C1();return r.currentTNode=e,r.lView=n,!0}function Oc(n){const e=C1(),t=n[1];rn.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function C1(){const n=rn.lFrame,e=null===n?null:n.child;return null===e?A1(n):e}function A1(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function T1(){const n=rn.lFrame;return rn.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const D1=T1;function Pc(){const n=T1();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function ti(){return rn.lFrame.selectedIndex}function ys(n){rn.lFrame.selectedIndex=n}function lr(){const n=rn.lFrame;return Ld(n.tView,n.selectedIndex)}function Nc(){rn.lFrame.currentNamespace="svg"}function kc(){!function _C(){rn.lFrame.currentNamespace=null}()}function Bc(n,e){for(let t=e.directiveStart,r=e.directiveEnd;t=r)break}else e[D]<0&&(n[18]+=65536),(v>11>16&&(3&n[2])===e){n[2]+=2048;try{a.call(v)}finally{}}}else try{a.call(v)}finally{}}class $l{constructor(e,t,r){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=r}}function Uc(n,e,t){const r=pr(n);let i=0;for(;ie){h=a-1;break}}}for(;a>16}(n),r=e;for(;t>0;)r=r[15],t--;return r}let Wd=!0;function Vc(n){const e=Wd;return Wd=n,e}let DC=0;function Gl(n,e){const t=Xd(n,e);if(-1!==t)return t;const r=e[1];r.firstCreatePass&&(n.injectorIndex=e.length,Zd(r.data,n),Zd(e,null),Zd(r.blueprint,null));const i=jc(n,e),a=n.injectorIndex;if(P1(i)){const h=Ra(i),v=Oa(i,e),D=v[1].data;for(let L=0;L<8;L++)e[a+L]=v[h+L]|D[h+L]}return e[a+8]=i,a}function Zd(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Xd(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function jc(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,r=null,i=e;for(;null!==i;){const a=i[1],h=a.type;if(r=2===h?a.declTNode:1===h?i[6]:null,null===r)return-1;if(t++,i=i[15],-1!==r.injectorIndex)return r.injectorIndex|t<<16}return-1}function $c(n,e,t){!function IC(n,e,t){let r;"string"==typeof t?r=t.charCodeAt(0)||0:t.hasOwnProperty(Fl)&&(r=t[Fl]),null==r&&(r=t[Fl]=DC++);const i=255&r;e.data[n+(i>>5)]|=1<=0?255&e:OC:e}(t);if("function"==typeof a){if(!S1(e,n,r))return r&en.Host?B1(i,t,r):L1(e,t,r,i);try{const h=a(r);if(null!=h||r&en.Optional)return h;cn(t)}finally{D1()}}else if("number"==typeof a){let h=null,v=Xd(n,e),D=-1,L=r&en.Host?e[16][6]:null;for((-1===v||r&en.SkipSelf)&&(D=-1===v?jc(n,e):e[v+8],-1!==D&&V1(r,!1)?(h=e[1],v=Ra(D),e=Oa(D,e)):v=-1);-1!==v;){const j=e[1];if(H1(a,v,j.data)){const Q=PC(v,e,t,h,r,L);if(Q!==U1)return Q}D=e[v+8],-1!==D&&V1(r,e[1].data[v+8]===L)&&H1(a,v,e)?(h=j,v=Ra(D),e=Oa(D,e)):v=-1}}}return L1(e,t,r,i)}const U1={};function OC(){return new Pa(Rr(),Et())}function PC(n,e,t,r,i,a){const h=e[1],v=h.data[n+8],j=zc(v,h,t,null==r?Tc(v)&&Wd:r!=h&&0!=(3&v.type),i&en.Host&&a===v);return null!==j?Kl(e,h,j,v):U1}function zc(n,e,t,r,i){const a=n.providerIndexes,h=e.data,v=1048575&a,D=n.directiveStart,j=a>>20,me=i?v+j:n.directiveEnd;for(let ye=r?v:v+j;ye=D&&Te.type===t)return ye}if(i){const ye=h[D];if(ye&&to(ye)&&ye.type===t)return D}return null}function Kl(n,e,t,r){let i=n[t];const a=e.data;if(function xC(n){return n instanceof $l}(i)){const h=i;h.resolving&&function pn(n,e){const t=e?`. Dependency path: ${e.join(" > ")} > ${n}`:"";throw new Ne(-200,`Circular dependency in DI detected for ${n}${t}`)}(et(a[t]));const v=Vc(h.canSeeViewProviders);h.resolving=!0;const D=h.injectImpl?ps(h.injectImpl):null;S1(n,r,en.Default);try{i=n[t]=h.factory(void 0,a,n,r),e.firstCreatePass&&t>=r.directiveStart&&function MC(n,e,t){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:a}=e.type.prototype;if(r){const h=d1(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,h),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,h)}i&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,i),a&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,a),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,a))}(t,a[t],e)}finally{null!==D&&ps(D),Vc(v),h.resolving=!1,D1()}}return i}function H1(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[zo]||Yd(e),r=Object.prototype;let i=Object.getPrototypeOf(n.prototype).constructor;for(;i&&i!==r;){const a=i[zo]||Yd(i);if(a&&a!==t)return a;i=Object.getPrototypeOf(i)}return a=>new a})}function Yd(n){return un(n)?()=>{const e=Yd(ze(n));return e&&e()}:Gs(n)}const ka="__parameters__";function La(n,e,t){return gs(()=>{const r=function Qd(n){return function(...t){if(n){const r=n(...t);for(const i in r)this[i]=r[i]}}}(e);function i(...a){if(this instanceof i)return r.apply(this,a),this;const h=new i(...a);return v.annotation=h,v;function v(D,L,j){const Q=D.hasOwnProperty(ka)?D[ka]:Object.defineProperty(D,ka,{value:[]})[ka];for(;Q.length<=j;)Q.push(null);return(Q[j]=Q[j]||[]).push(h),D}}return t&&(i.prototype=Object.create(t.prototype)),i.prototype.ngMetadataName=n,i.annotationCls=i,i})}class Kt{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=xt({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const BC=new Kt("AnalyzeForEntryComponents");function Bi(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Co(t,e):e(t))}function $1(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Gc(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Xl(n,e){const t=[];for(let r=0;r=0?n[1|r]=t:(r=~r,function UC(n,e,t,r){let i=n.length;if(i==e)n.push(t,r);else if(1===i)n.push(r,n[0]),n[0]=t;else{for(i--,n.push(n[i-1],n[i]);i>e;)n[i]=n[i-2],i--;n[e]=t,n[e+1]=r}}(n,r,e,t)),r}function e0(n,e){const t=Fa(n,e);if(t>=0)return n[1|t]}function Fa(n,e){return function K1(n,e,t){let r=0,i=n.length>>t;for(;i!==r;){const a=r+(i-r>>1),h=n[a<e?i=a:r=a+1}return~(i<({token:n})),-1),_s=Jl(La("Optional"),8),eu=Jl(La("SkipSelf"),4);var Ei=(()=>((Ei=Ei||{})[Ei.Important=1]="Important",Ei[Ei.DashCase=2]="DashCase",Ei))();const ry="__ngContext__";function Wr(n,e){n[ry]=e}function a0(n){const e=function nu(n){return n[ry]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function u0(n,e){return undefined(n,e)}function ru(n){const e=n[3];return eo(e)?e[3]:e}function c0(n){return cy(n[13])}function f0(n){return cy(n[4])}function cy(n){for(;null!==n&&!eo(n);)n=n[4];return n}function Ha(n,e,t,r,i){if(null!=r){let a,h=!1;eo(r)?a=r:xo(r)&&(h=!0,r=r[0]);const v=Sr(r);0===n&&null!==t?null==i?my(e,t,v):Ks(e,t,v,i||null,!0):1===n&&null!==t?Ks(e,t,v,i||null,!0):2===n?function y0(n,e,t){const r=Xc(n,e);r&&function TA(n,e,t,r){pr(n)?n.removeChild(e,t,r):e.removeChild(t)}(n,r,e,t)}(e,v,h):3===n&&e.destroyNode(v),null!=a&&function RA(n,e,t,r,i){const a=t[7];a!==Sr(t)&&Ha(e,n,r,a,i);for(let v=10;v0&&(n[t-1][4]=r[4]);const a=Gc(n,10+e);!function _A(n,e){iu(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(r[1],r);const h=a[19];null!==h&&h.detachView(a[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function dy(n,e){if(!(256&e[2])){const t=e[11];pr(t)&&t.destroyNode&&iu(n,e,t,3,null,null),function EA(n){let e=n[13];if(!e)return g0(n[1],n);for(;e;){let t=null;if(xo(e))t=e[13];else{const r=e[10];r&&(t=r)}if(!t){for(;e&&!e[4]&&e!==n;)xo(e)&&g0(e[1],e),e=e[3];null===e&&(e=n),xo(e)&&g0(e[1],e),t=e&&e[4]}e=t}}(e)}}function g0(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function AA(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let r=0;r=0?r[i=L]():r[i=-L].unsubscribe(),a+=2}else{const h=r[i=t[a+1]];t[a].call(h)}if(null!==r){for(let a=i+1;an,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Jc}())||void 0===e?void 0:e.createHTML(n))||n}function Sy(n){var e;return(null===(e=function M0(){if(void 0===ef&&(ef=null,Zn.trustedTypes))try{ef=Zn.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return ef}())||void 0===e?void 0:e.createHTML(n))||n}class Ws{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class BA extends Ws{getTypeName(){return"HTML"}}class LA extends Ws{getTypeName(){return"Style"}}class FA extends Ws{getTypeName(){return"Script"}}class UA extends Ws{getTypeName(){return"URL"}}class HA extends Ws{getTypeName(){return"ResourceURL"}}function xi(n){return n instanceof Ws?n.changingThisBreaksApplicationSecurity:n}function Ao(n,e){const t=Ty(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Ty(n){return n instanceof Ws&&n.getTypeName()||null}class KA{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(qs(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class qA{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const r=this.inertDocument.createElement("body");t.appendChild(r)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=qs(e),t;const r=this.inertDocument.createElement("body");return r.innerHTML=qs(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(r),r}stripCustomNsAttrs(e){const t=e.attributes;for(let i=t.length-1;0ou(e.trim())).join(", ")}function To(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function su(...n){const e={};for(const t of n)for(const r in t)t.hasOwnProperty(r)&&(e[r]=!0);return e}const Ry=To("area,br,col,hr,img,wbr"),Oy=To("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Py=To("rp,rt"),E0=su(Ry,su(Oy,To("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),su(Py,To("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),su(Py,Oy)),x0=To("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),S0=To("srcset"),Ny=su(x0,S0,To("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),To("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),YA=To("script,style,template");class QA{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,r=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?r=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,r&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let i=this.checkClobberedElement(t,t.nextSibling);if(i){t=i;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!E0.hasOwnProperty(t))return this.sanitizedSomething=!0,!YA.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const r=e.attributes;for(let i=0;i"),!0}endElement(e){const t=e.nodeName.toLowerCase();E0.hasOwnProperty(t)&&!Ry.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(ky(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const JA=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,e4=/([^\#-~ |!])/g;function ky(n){return n.replace(/&/g,"&").replace(JA,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(e4,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let tf;function By(n,e){let t=null;try{tf=tf||function Dy(n){const e=new qA(n);return function WA(){try{return!!(new window.DOMParser).parseFromString(qs(""),"text/html")}catch(n){return!1}}()?new KA(e):e}(n);let r=e?String(e):"";t=tf.getInertBodyElement(r);let i=5,a=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=a,a=t.innerHTML,t=tf.getInertBodyElement(r)}while(r!==a);return qs((new QA).sanitizeChildren(C0(t)||t))}finally{if(t){const r=C0(t)||t;for(;r.firstChild;)r.removeChild(r.firstChild)}}}function C0(n){return"content"in n&&function t4(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var Qn=(()=>((Qn=Qn||{})[Qn.NONE=0]="NONE",Qn[Qn.HTML=1]="HTML",Qn[Qn.STYLE=2]="STYLE",Qn[Qn.SCRIPT=3]="SCRIPT",Qn[Qn.URL=4]="URL",Qn[Qn.RESOURCE_URL=5]="RESOURCE_URL",Qn))();function nf(n){const e=au();return e?Sy(e.sanitize(Qn.HTML,n)||""):Ao(n,"HTML")?Sy(xi(n)):By(Bd(),$e(n))}function ws(n){const e=au();return e?e.sanitize(Qn.URL,n)||"":Ao(n,"URL")?xi(n):ou($e(n))}function au(){const n=Et();return n&&n[12]}function T0(n){return n.ngOriginalError}function f4(n,...e){n.error(...e)}class lu{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),r=function c4(n){return n&&n.ngErrorLogger||f4}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t)}_findOriginalError(e){let t=e&&T0(e);for(;t&&T0(t);)t=T0(t);return t||null}}const y4=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Zn))();function D0(n){return n.ownerDocument.defaultView}function Do(n){return n instanceof Function?n():n}function Uy(n,e,t){let r=n.length;for(;;){const i=n.indexOf(e,t);if(-1===i)return i;if(0===i||n.charCodeAt(i-1)<=32){const a=e.length;if(i+a===r||n.charCodeAt(i+a)<=32)return i}t=i+1}}const Hy="ng-template";function w4(n,e,t){let r=0;for(;ra?"":i[Q+1].toLowerCase();const ye=8&r?me:null;if(ye&&-1!==Uy(ye,L,0)||2&r&&L!==me){if(no(r))return!1;h=!0}}}}else{if(!h&&!no(r)&&!no(D))return!1;if(h&&no(D))continue;h=!1,r=D|1&r}}return no(r)||h}function no(n){return 0==(1&n)}function x4(n,e,t,r){if(null===e)return-1;let i=0;if(r||!t){let a=!1;for(;i-1)for(t++;t0?'="'+v+'"':"")+"]"}else 8&r?i+="."+h:4&r&&(i+=" "+h);else""!==i&&!no(h)&&(e+=$y(a,i),i=""),r=h,a=a||!no(r);t++}return""!==i&&(e+=$y(a,i)),e}const on={};function bt(n){zy(Cn(),Et(),ti()+n,!1)}function zy(n,e,t,r){if(!r)if(3==(3&e[2])){const a=n.preOrderCheckHooks;null!==a&&Lc(e,a,t)}else{const a=n.preOrderHooks;null!==a&&Fc(e,a,0,t)}ys(t)}function rf(n,e){return n<<17|e<<2}function ro(n){return n>>17&32767}function I0(n){return 2|n}function qo(n){return(131068&n)>>2}function R0(n,e){return-131069&n|e<<2}function O0(n){return 1|n}function tb(n,e){const t=n.contentQueries;if(null!==t)for(let r=0;r20&&zy(n,e,20,!1),t(r,i)}finally{ys(a)}}function rb(n,e,t){if(Id(e)){const i=e.directiveEnd;for(let a=e.directiveStart;a0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(v)!=D&&v.push(D),v.push(r,i,h)}}function fb(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function hb(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function i5(n,e,t){if(t){if(e.exportAs)for(let r=0;r0&&K0(t)}}function K0(n){for(let r=c0(n);null!==r;r=f0(r))for(let i=10;i0&&K0(a)}const t=n[1].components;if(null!==t)for(let r=0;r0&&K0(i)}}function f5(n,e){const t=wi(e,n),r=t[1];(function h5(n,e){for(let t=e.length;tPromise.resolve(null))();function vb(n){return n[7]||(n[7]=[])}function yb(n){return n.cleanup||(n.cleanup=[])}function _b(n,e){const t=n[9],r=t?t.get(lu,null):null;r&&r.handleError(e)}function wb(n,e,t,r,i){for(let a=0;athis.processProvider(v,e,t)),Co([e],v=>this.processInjectorType(v,[],a)),this.records.set(Y0,Ga(void 0,this));const h=this.records.get(Q0);this.scope=null!=h?h.value:null,this.source=i||("object"==typeof e?null:nt(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=Yl,r=en.Default){this.assertNotDestroyed();const i=Z1(this),a=ps(void 0);try{if(!(r&en.SkipSelf)){let v=this.records.get(e);if(void 0===v){const D=function C5(n){return"function"==typeof n||"object"==typeof n&&n instanceof Kt}(e)&&Rn(e);v=D&&this.injectableDefInScope(D)?Ga(ep(e),fu):null,this.records.set(e,v)}if(null!=v)return this.hydrate(e,v)}return(r&en.Self?Eb():this.parent).get(e,t=r&en.Optional&&t===Yl?null:t)}catch(h){if("NullInjectorError"===h.name){if((h[qc]=h[qc]||[]).unshift(nt(e)),i)throw h;return function QC(n,e,t,r){const i=n[qc];throw e[W1]&&i.unshift(e[W1]),n.message=function JC(n,e,t,r=null){n=n&&"\n"===n.charAt(0)&&"\u0275"==n.charAt(1)?n.substr(2):n;let i=nt(e);if(Array.isArray(e))i=e.map(nt).join(" -> ");else if("object"==typeof e){let a=[];for(let h in e)if(e.hasOwnProperty(h)){let v=e[h];a.push(h+":"+("string"==typeof v?JSON.stringify(v):nt(v)))}i=`{${a.join(", ")}}`}return`${t}${r?"("+r+")":""}[${i}]: ${n.replace(KC,"\n ")}`}("\n"+n.message,i,t,r),n.ngTokenPath=i,n[qc]=null,n}(h,e,"R3InjectorError",this.source)}throw h}finally{ps(a),Z1(i)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((r,i)=>e.push(nt(i))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Ne(205,!1)}processInjectorType(e,t,r){if(!(e=ze(e)))return!1;let i=Ea(e);const a=null==i&&e.ngModule||void 0,h=void 0===a?e:a,v=-1!==r.indexOf(h);if(void 0!==a&&(i=Ea(a)),null==i)return!1;if(null!=i.imports&&!v){let j;r.push(h);try{Co(i.imports,Q=>{this.processInjectorType(Q,t,r)&&(void 0===j&&(j=[]),j.push(Q))})}finally{}if(void 0!==j)for(let Q=0;Qthis.processProvider(Te,me,ye||Yn))}}this.injectorDefTypes.add(h);const D=Gs(h)||(()=>new h);this.records.set(h,Ga(D,fu));const L=i.providers;if(null!=L&&!v){const j=e;Co(L,Q=>this.processProvider(Q,j,L))}return void 0!==a&&void 0!==e.providers}processProvider(e,t,r){let i=Ka(e=ze(e))?e:ze(e&&e.provide);const a=function _5(n,e,t){return Ab(n)?Ga(void 0,n.useValue):Ga(Cb(n),fu)}(e);if(Ka(e)||!0!==e.multi)this.records.get(i);else{let h=this.records.get(i);h||(h=Ga(void 0,fu,!0),h.factory=()=>r0(h.multi),this.records.set(i,h)),i=e,h.multi.push(e)}this.records.set(i,a)}hydrate(e,t){return t.value===fu&&(t.value=v5,t.value=t.factory()),"object"==typeof t.value&&t.value&&function S5(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ze(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function ep(n){const e=Rn(n),t=null!==e?e.factory:Gs(n);if(null!==t)return t;if(n instanceof Kt)throw new Ne(204,!1);if(n instanceof Function)return function b5(n){const e=n.length;if(e>0)throw Xl(e,"?"),new Ne(204,!1);const t=function Fn(n){const e=n&&(n[ds]||n[o1]);if(e){const t=function Ll(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Ne(204,!1)}function Cb(n,e,t){let r;if(Ka(n)){const i=ze(n);return Gs(i)||ep(i)}if(Ab(n))r=()=>ze(n.useValue);else if(function M5(n){return!(!n||!n.useFactory)}(n))r=()=>n.useFactory(...r0(n.deps||[]));else if(function w5(n){return!(!n||!n.useExisting)}(n))r=()=>Mt(ze(n.useExisting));else{const i=ze(n&&(n.useClass||n.provide));if(!function x5(n){return!!n.deps}(n))return Gs(i)||ep(i);r=()=>new i(...r0(n.deps))}return r}function Ga(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function Ab(n){return null!==n&&"object"==typeof n&&WC in n}function Ka(n){return"function"==typeof n}let Cr=(()=>{class n{static create(t,r){var i;if(Array.isArray(t))return xb({name:""},r,t,"");{const a=null!==(i=t.name)&&void 0!==i?i:"";return xb({name:a},t.parent,t.providers,a)}}}return n.THROW_IF_NOT_FOUND=Yl,n.NULL=new Mb,n.\u0275prov=xt({token:n,providedIn:"any",factory:()=>Mt(Y0)}),n.__NG_ELEMENT_ID__=-1,n})();function N5(n,e){Bc(a0(n)[1],Rr())}function Hn(n){let e=function Ub(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const r=[n];for(;e;){let i;if(to(n))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Ne(903,"");i=e.\u0275dir}if(i){if(t){r.push(i);const h=n;h.inputs=rp(n.inputs),h.declaredInputs=rp(n.declaredInputs),h.outputs=rp(n.outputs);const v=i.hostBindings;v&&F5(n,v);const D=i.viewQuery,L=i.contentQueries;if(D&&B5(n,D),L&&L5(n,L),Dn(n.inputs,i.inputs),Dn(n.declaredInputs,i.declaredInputs),Dn(n.outputs,i.outputs),to(i)&&i.data.animation){const j=n.data;j.animation=(j.animation||[]).concat(i.data.animation)}}const a=i.features;if(a)for(let h=0;h=0;r--){const i=n[r];i.hostVars=e+=i.hostVars,i.hostAttrs=Hc(i.hostAttrs,t=Hc(t,i.hostAttrs))}}(r)}function rp(n){return n===xa?{}:n===Yn?[]:n}function B5(n,e){const t=n.viewQuery;n.viewQuery=t?(r,i)=>{e(r,i),t(r,i)}:e}function L5(n,e){const t=n.contentQueries;n.contentQueries=t?(r,i,a)=>{e(r,i,a),t(r,i,a)}:e}function F5(n,e){const t=n.hostBindings;n.hostBindings=t?(r,i)=>{e(r,i),t(r,i)}:e}let cf=null;function qa(){if(!cf){const n=Zn.Symbol;if(n&&n.iterator)cf=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;tv(Sr(At[r.index])):r.index;if(pr(t)){let At=null;if(!v&&D&&(At=function g8(n,e,t,r){const i=n.cleanup;if(null!=i)for(let a=0;aD?v[D]:null}"string"==typeof h&&(a+=2)}return null}(n,e,i,r.index)),null!==At)(At.__ngLastListenerFn__||At).__ngNextListenerFn__=a,At.__ngLastListenerFn__=a,ye=!1;else{a=hp(r,e,Q,a,!1);const Nt=t.listen(gt,i,a);me.push(a,Nt),j&&j.push(i,_t,Ie,Ie+1)}}else a=hp(r,e,Q,a,!0),gt.addEventListener(i,a,h),me.push(a),j&&j.push(i,_t,Ie,h)}else a=hp(r,e,Q,a,!1);const Te=r.outputs;let Ve;if(ye&&null!==Te&&(Ve=Te[i])){const je=Ve.length;if(je)for(let gt=0;gt0;)e=e[15],n--;return e}(n,rn.lFrame.contextLView))[8]}(n)}function m8(n,e){let t=null;const r=function S4(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let i=0;i=0}const Pr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function M_(n){return n.substring(Pr.key,Pr.keyEnd)}function E_(n,e){const t=Pr.textEnd;return t===e?-1:(e=Pr.keyEnd=function E8(n,e,t){for(;e32;)e++;return e}(n,Pr.key=e,t),il(n,e,t))}function il(n,e,t){for(;e=0;t=E_(e,t))Mi(n,M_(e),!0)}function ao(n,e,t,r){const i=Et(),a=Cn(),h=Ko(2);a.firstUpdatePass&&D_(a,n,h,r),e!==on&&Zr(i,h,e)&&R_(a,a.data[ti()],i,i[11],n,i[h+1]=function P8(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=nt(xi(n)))),n}(e,t),r,h)}function T_(n,e){return e>=n.expandoStartIndex}function D_(n,e,t,r){const i=n.data;if(null===i[t+1]){const a=i[ti()],h=T_(n,t);P_(a,r)&&null===e&&!h&&(e=!1),e=function A8(n,e,t,r){const i=$d(n);let a=r?e.residualClasses:e.residualStyles;if(null===i)0===(r?e.classBindings:e.styleBindings)&&(t=mu(t=dp(null,n,e,t,r),e.attrs,r),a=null);else{const h=e.directiveStylingLast;if(-1===h||n[h]!==i)if(t=dp(i,n,e,t,r),null===a){let D=function T8(n,e,t){const r=t?e.classBindings:e.styleBindings;if(0!==qo(r))return n[ro(r)]}(n,e,r);void 0!==D&&Array.isArray(D)&&(D=dp(null,n,e,D[1],r),D=mu(D,e.attrs,r),function D8(n,e,t,r){n[ro(t?e.classBindings:e.styleBindings)]=r}(n,e,r,D))}else a=function I8(n,e,t){let r;const i=e.directiveEnd;for(let a=1+e.directiveStylingLast;a0)&&(L=!0)}else j=t;if(i)if(0!==D){const me=ro(n[v+1]);n[r+1]=rf(me,v),0!==me&&(n[me+1]=R0(n[me+1],r)),n[v+1]=function O4(n,e){return 131071&n|e<<17}(n[v+1],r)}else n[r+1]=rf(v,0),0!==v&&(n[v+1]=R0(n[v+1],r)),v=r;else n[r+1]=rf(D,0),0===v?v=r:n[D+1]=R0(n[D+1],r),D=r;L&&(n[r+1]=I0(n[r+1])),w_(n,j,r,!0),w_(n,j,r,!1),function y8(n,e,t,r,i){const a=i?n.residualClasses:n.residualStyles;null!=a&&"string"==typeof e&&Fa(a,e)>=0&&(t[r+1]=O0(t[r+1]))}(e,j,n,r,a),h=rf(v,D),a?e.classBindings=h:e.styleBindings=h}(i,a,e,t,h,r)}}function dp(n,e,t,r,i){let a=null;const h=t.directiveEnd;let v=t.directiveStylingLast;for(-1===v?v=t.directiveStart:v++;v0;){const D=n[i],L=Array.isArray(D),j=L?D[1]:D,Q=null===j;let me=t[i+1];me===on&&(me=Q?Yn:void 0);let ye=Q?e0(me,r):j===r?me:void 0;if(L&&!pf(ye)&&(ye=e0(D,r)),pf(ye)&&(v=ye,h))return v;const Te=n[i+1];i=h?ro(Te):qo(Te)}if(null!==e){let D=a?e.residualClasses:e.residualStyles;null!=D&&(v=e0(D,r))}return v}function pf(n){return void 0!==n}function P_(n,e){return 0!=(n.flags&(e?16:32))}function ft(n,e=""){const t=Et(),r=Cn(),i=n+20,a=r.firstCreatePass?ja(r,i,1,e,null):r.data[i],h=t[i]=function h0(n,e){return pr(n)?n.createText(e):n.createTextNode(e)}(t[11],e);Yc(r,t,h,a),So(a,!1)}function Nr(n){return Vn("",n,""),Nr}function Vn(n,e,t){const r=Et(),i=Za(r,n,e,t);return i!==on&&Wo(r,ti(),i),Vn}function gf(n,e,t,r,i){const a=Et(),h=Xa(a,n,e,t,r,i);return h!==on&&Wo(a,ti(),h),gf}function pp(n,e,t){const r=Et();if(Zr(r,Ia(),e)){const a=Cn(),h=lr();Si(a,h,r,n,e,function bb(n,e,t){return(null===n||to(n))&&(t=function iC(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}($d(a.data),h,r),t,!0)}return pp}const mf="en-US";let J_=mf;function vp(n,e,t,r,i){if(n=ze(n),Array.isArray(n))for(let a=0;a>20;if(Ka(n)||!n.multi){const ye=new $l(D,i,ot),Te=bp(v,e,i?j:j+me,Q);-1===Te?($c(Gl(L,h),a,v),yp(a,n,e.length),e.push(v),L.directiveStart++,L.directiveEnd++,i&&(L.providerIndexes+=1048576),t.push(ye),h.push(ye)):(t[Te]=ye,h[Te]=ye)}else{const ye=bp(v,e,j+me,Q),Te=bp(v,e,j,j+me),Ve=ye>=0&&t[ye],je=Te>=0&&t[Te];if(i&&!je||!i&&!Ve){$c(Gl(L,h),a,v);const gt=function QT(n,e,t,r,i){const a=new $l(n,t,ot);return a.multi=[],a.index=e,a.componentProviders=0,Ew(a,i,r&&!t),a}(i?YT:XT,t.length,i,r,D);!i&&je&&(t[Te].providerFactory=gt),yp(a,n,e.length,0),e.push(v),L.directiveStart++,L.directiveEnd++,i&&(L.providerIndexes+=1048576),t.push(gt),h.push(gt)}else yp(a,n,ye>-1?ye:Te,Ew(t[i?Te:ye],D,!i&&r));!i&&r&&je&&t[Te].componentProviders++}}}function yp(n,e,t,r){const i=Ka(e),a=function E5(n){return!!n.useClass}(e);if(i||a){const D=(a?ze(e.useClass):e).prototype.ngOnDestroy;if(D){const L=n.destroyHooks||(n.destroyHooks=[]);if(!i&&e.multi){const j=L.indexOf(t);-1===j?L.push(t,[r,D]):L[j+1].push(r,D)}else L.push(t,D)}}}function Ew(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function bp(n,e,t,r){for(let i=t;i{t.providersResolver=(r,i)=>function ZT(n,e,t){const r=Cn();if(r.firstCreatePass){const i=to(n);vp(t,r.data,r.blueprint,i,!0),vp(e,r.data,r.blueprint,i,!1)}}(r,i?i(n):n,e)}}class xw{}class tD{resolveComponentFactory(e){throw function eD(n){const e=Error(`No component factory found for ${nt(n)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=n,e}(e)}}let Ys=(()=>{class n{}return n.NULL=new tD,n})();function nD(){return ll(Rr(),Et())}function ll(n,e){return new kr(_i(n,e))}let kr=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=nD,n})();function rD(n){return n instanceof kr?n.nativeElement:n}class Qs{}let Fi=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>function oD(){const n=Et(),t=wi(Rr().index,n);return function iD(n){return n[11]}(xo(t)?t:n)}(),n})(),sD=(()=>{class n{}return n.\u0275prov=xt({token:n,providedIn:"root",factory:()=>null}),n})();class wu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const aD=new wu("13.4.0"),wp={};function wf(n,e,t,r,i=!1){for(;null!==t;){const a=e[t.index];if(null!==a&&r.push(Sr(a)),eo(a))for(let v=10;v-1&&(p0(e,r),Gc(t,r))}this._attachedToViewContainer=!1}dy(this._lView[1],this._lView)}onDestroy(e){ab(this._lView[1],this._lView,null,e)}markForCheck(){q0(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){!function Z0(n,e,t){const r=e[10];r.begin&&r.begin();try{za(n,e,n.template,t)}catch(i){throw _b(e,i),i}finally{r.end&&r.end()}}(this._lView[1],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Ne(902,"");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function MA(n,e){iu(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Ne(902,"");this._appRef=e}}class lD extends Mu{constructor(e){super(e),this._view=e}detectChanges(){mb(this._view)}checkNoChanges(){}get context(){return null}}class Cw extends Ys{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){const t=jr(e);return new Mp(t,this.ngModule)}}function Aw(n){const e=[];for(let t in n)n.hasOwnProperty(t)&&e.push({propName:n[t],templateName:t});return e}class Mp extends xw{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function I4(n){return n.map(D4).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return Aw(this.componentDef.inputs)}get outputs(){return Aw(this.componentDef.outputs)}create(e,t,r,i){const a=(i=i||this.ngModule)?function cD(n,e){return{get:(t,r,i)=>{const a=n.get(t,wp,i);return a!==wp||r===wp?a:e.get(t,r,i)}}}(e,i.injector):e,h=a.get(Qs,m1),v=a.get(sD,null),D=h.createRenderer(null,this.componentDef),L=this.componentDef.selectors[0][0]||"div",j=r?function sb(n,e,t){if(pr(n))return n.selectRootElement(e,t===Qi.ShadowDom);let r="string"==typeof e?n.querySelector(e):e;return r.textContent="",r}(D,r,this.componentDef.encapsulation):d0(h.createRenderer(null,this.componentDef),L,function uD(n){const e=n.toLowerCase();return"svg"===e?"svg":"math"===e?"math":null}(L)),Q=this.componentDef.onPush?576:528,me=function Fb(n,e){return{components:[],scheduler:n||y4,clean:p5,playerHandler:e||null,flags:0}}(),ye=af(0,null,null,1,0,null,null,null,null,null),Te=uu(null,ye,me,Q,null,null,h,D,v,a);let Ve,je;Oc(Te);try{const gt=function Bb(n,e,t,r,i,a){const h=t[1];t[20]=n;const D=ja(h,20,2,"#host",null),L=D.mergedAttrs=e.hostAttrs;null!==L&&(uf(D,L,!0),null!==n&&(Uc(i,n,L),null!==D.classes&&_0(i,n,D.classes),null!==D.styles&&xy(i,n,D.styles)));const j=r.createRenderer(n,e),Q=uu(t,ib(e),null,e.onPush?64:16,t[20],D,r,j,a||null,null);return h.firstCreatePass&&($c(Gl(D,t),h,e.type),hb(h,D),db(D,t.length,1)),lf(t,Q),t[20]=Q}(j,this.componentDef,Te,h,D);if(j)if(r)Uc(D,j,["ng-version",aD.full]);else{const{attrs:Ie,classes:_t}=function R4(n){const e=[],t=[];let r=1,i=2;for(;r0&&_0(D,j,_t.join(" "))}if(je=Ld(ye,20),void 0!==t){const Ie=je.projection=[];for(let _t=0;_tD(h,e)),e.contentQueries){const D=Rr();e.contentQueries(1,h,D.directiveStart)}const v=Rr();return!a.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(ys(v.index),cb(t[1],v,0,v.directiveStart,v.directiveEnd,e),fb(e,h)),h}(gt,this.componentDef,Te,me,[N5]),cu(ye,Te,null)}finally{Pc()}return new hD(this.componentType,Ve,ll(je,Te),Te,je)}}class hD extends class JT{}{constructor(e,t,r,i,a){super(),this.location=r,this._rootLView=i,this._tNode=a,this.instance=t,this.hostView=this.changeDetectorRef=new lD(i),this.componentType=e}get injector(){return new Pa(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}class Yo{}class Tw{}const ul=new Map;class Rw extends Yo{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new Cw(this);const r=Pi(e);this._bootstrapComponents=Do(r.bootstrap),this._r3Injector=Sb(e,t,[{provide:Yo,useValue:this},{provide:Ys,useValue:this.componentFactoryResolver}],nt(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Cr.THROW_IF_NOT_FOUND,r=en.Default){return e===Cr||e===Yo||e===Y0?this:this._r3Injector.get(e,t,r)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class Ep extends Tw{constructor(e){super(),this.moduleType=e,null!==Pi(e)&&function pD(n){const e=new Set;!function t(r){const i=Pi(r,!0),a=i.id;null!==a&&(function Dw(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${nt(e)} vs ${nt(e.name)}`)}(a,ul.get(a),r),ul.set(a,r));const h=Do(i.imports);for(const v of h)e.has(v)||(e.add(v),t(v))}(n)}(e)}create(e){return new Rw(this.moduleType,e)}}function Eu(n,e){const t=n[e];return t===on?void 0:t}function Qo(n,e){const t=Cn();let r;const i=n+20;t.firstCreatePass?(r=function SD(n,e){if(e)for(let t=e.length-1;t>=0;t--){const r=e[t];if(n===r.name)return r}}(e,t.pipeRegistry),t.data[i]=r,r.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(i,r.onDestroy)):r=t.data[i];const a=r.factory||(r.factory=Gs(r.type)),h=ps(ot);try{const v=Vc(!1),D=a();return Vc(v),function K5(n,e,t,r){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=r}(t,Et(),i,D),D}finally{ps(h)}}function Js(n,e,t){const r=n+20,i=Et(),a=Da(i,r);return xu(i,r)?function Ow(n,e,t,r,i,a){const h=e+t;return Zr(n,h,i)?Ro(n,h+1,a?r.call(a,i):r(i)):Eu(n,h+1)}(i,ei(),e,a.transform,t,a):a.transform(t)}function xp(n,e,t,r){const i=n+20,a=Et(),h=Da(a,i);return xu(a,i)?function Pw(n,e,t,r,i,a,h){const v=e+t;return Zs(n,v,i,a)?Ro(n,v+2,h?r.call(h,i,a):r(i,a)):Eu(n,v+2)}(a,ei(),e,h.transform,t,r,h):h.transform(t,r)}function xu(n,e){return n[1].data[e].pure}function Sp(n){return e=>{setTimeout(n,void 0,e)}}const vn=class DD extends o{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,r){var i,a,h;let v=e,D=t||(()=>null),L=r;if(e&&"object"==typeof e){const Q=e;v=null===(i=Q.next)||void 0===i?void 0:i.bind(Q),D=null===(a=Q.error)||void 0===a?void 0:a.bind(Q),L=null===(h=Q.complete)||void 0===h?void 0:h.bind(Q)}this.__isAsync&&(D=Sp(D),v&&(v=Sp(v)),L&&(L=Sp(L)));const j=super.subscribe({next:v,error:D,complete:L});return e instanceof x&&e.add(j),j}};function ID(){return this._results[qa()]()}class Cp{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=qa(),r=Cp.prototype;r[t]||(r[t]=ID)}get changes(){return this._changes||(this._changes=new vn)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const r=this;r.dirty=!1;const i=Bi(e);(this._changesDetected=!function LC(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r{class n{}return n.__NG_ELEMENT_ID__=PD,n})();const RD=No,OD=class extends RD{constructor(e,t,r){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=r}createEmbeddedView(e){const t=this._declarationTContainer.tViews,r=uu(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);r[17]=this._declarationLView[this._declarationTContainer.index];const a=this._declarationLView[19];return null!==a&&(r[19]=a.createEmbeddedView(t)),cu(t,r,e),new Mu(r)}};function PD(){return Mf(Rr(),Et())}function Mf(n,e){return 4&n.type?new OD(e,n,ll(n,e)):null}let uo=(()=>{class n{}return n.__NG_ELEMENT_ID__=ND,n})();function ND(){return Uw(Rr(),Et())}const kD=uo,Lw=class extends kD{constructor(e,t,r){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=r}get element(){return ll(this._hostTNode,this._hostLView)}get injector(){return new Pa(this._hostTNode,this._hostLView)}get parentInjector(){const e=jc(this._hostTNode,this._hostLView);if(P1(e)){const t=Oa(e,this._hostLView),r=Ra(e);return new Pa(t[1].data[r+8],t)}return new Pa(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=Fw(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,r){const i=e.createEmbeddedView(t||{});return this.insert(i,r),i}createComponent(e,t,r,i,a){const h=e&&!function Zl(n){return"function"==typeof n}(e);let v;if(h)v=t;else{const Q=t||{};v=Q.index,r=Q.injector,i=Q.projectableNodes,a=Q.ngModuleRef}const D=h?e:new Mp(jr(e)),L=r||this.parentInjector;if(!a&&null==D.ngModule){const me=(h?L:this.parentInjector).get(Yo,null);me&&(a=me)}const j=D.create(L,i,void 0,a);return this.insert(j.hostView,v),j}insert(e,t){const r=e._lView,i=r[1];if(function sC(n){return eo(n[3])}(r)){const j=this.indexOf(e);if(-1!==j)this.detach(j);else{const Q=r[3],me=new Lw(Q,Q[6],Q[3]);me.detach(me.indexOf(e))}}const a=this._adjustIndex(t),h=this._lContainer;!function xA(n,e,t,r){const i=10+r,a=t.length;r>0&&(t[i-1][4]=e),r0)r.push(h[v/2]);else{const L=a[v+1],j=e[-D];for(let Q=10;Q{class n{constructor(t){this.appInits=t,this.resolve=Af,this.reject=Af,this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i})}runInitializers(){if(this.initialized)return;const t=[],r=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i{a.subscribe({complete:v,error:D})});t.push(h)}}Promise.all(t).then(()=>{r()}).catch(i=>{this.reject(i)}),0===t.length&&r(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(Mt(Up,8))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const Cu=new Kt("AppId",{providedIn:"root",factory:function u2(){return`${Vp()}${Vp()}${Vp()}`}});function Vp(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const c2=new Kt("Platform Initializer"),Au=new Kt("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),f2=new Kt("appBootstrapListener");let aI=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();const xs=new Kt("LocaleId",{providedIn:"root",factory:()=>XC(xs,en.Optional|en.SkipSelf)||function lI(){return"undefined"!=typeof $localize&&$localize.locale||mf}()});class cI{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}let h2=(()=>{class n{compileModuleSync(t){return new Ep(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){const r=this.compileModuleSync(t),a=Do(Pi(t).declarations).reduce((h,v)=>{const D=jr(v);return D&&h.push(new Mp(D)),h},[]);return new cI(r,a)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const hI=(()=>Promise.resolve(0))();function jp(n){"undefined"==typeof Zone?hI.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class or{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new vn(!1),this.onMicrotaskEmpty=new vn(!1),this.onStable=new vn(!1),this.onError=new vn(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!r&&t,i.shouldCoalesceRunChangeDetection=r,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function dI(){let n=Zn.requestAnimationFrame,e=Zn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const r=e[Zone.__symbol__("OriginalDelegate")];r&&(e=r)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function mI(n){const e=()=>{!function gI(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(Zn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,zp(n),n.isCheckStableRunning=!0,$p(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),zp(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,r,i,a,h,v)=>{try{return d2(n),t.invokeTask(i,a,h,v)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===a.type||n.shouldCoalesceRunChangeDetection)&&e(),p2(n)}},onInvoke:(t,r,i,a,h,v,D)=>{try{return d2(n),t.invoke(i,a,h,v,D)}finally{n.shouldCoalesceRunChangeDetection&&e(),p2(n)}},onHasTask:(t,r,i,a)=>{t.hasTask(i,a),r===i&&("microTask"==a.change?(n._hasPendingMicrotasks=a.microTask,zp(n),$p(n)):"macroTask"==a.change&&(n.hasPendingMacrotasks=a.macroTask))},onHandleError:(t,r,i,a)=>(t.handleError(i,a),n.runOutsideAngular(()=>n.onError.emit(a)),!1)})}(i)}static isInAngularZone(){return"undefined"!=typeof Zone&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!or.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(or.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,r){return this._inner.run(e,t,r)}runTask(e,t,r,i){const a=this._inner,h=a.scheduleEventTask("NgZoneEvent: "+i,e,pI,Af,Af);try{return a.runTask(h,t,r)}finally{a.cancelTask(h)}}runGuarded(e,t,r){return this._inner.runGuarded(e,t,r)}runOutsideAngular(e){return this._outer.run(e)}}const pI={};function $p(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function zp(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function d2(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function p2(n){n._nesting--,$p(n)}class vI{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new vn,this.onMicrotaskEmpty=new vn,this.onStable=new vn,this.onError=new vn}run(e,t,r){return e.apply(t,r)}runGuarded(e,t,r){return e.apply(t,r)}runOutsideAngular(e){return e()}runTask(e,t,r,i){return e.apply(t,r)}}let Gp=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{or.assertNotInAngularZone(),jp(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())jp(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(t)||(clearTimeout(r.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,r,i){let a=-1;r&&r>0&&(a=setTimeout(()=>{this._callbacks=this._callbacks.filter(h=>h.timeoutId!==a),t(this._didWork,this.getPendingTasks())},r)),this._callbacks.push({doneCb:t,timeoutId:a,updateCb:i})}whenStable(t,r,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,r,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,r,i){return[]}}return n.\u0275fac=function(t){return new(t||n)(Mt(or))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),yI=(()=>{class n{constructor(){this._applications=new Map,Kp.addToWindow(this)}registerApplication(t,r){this._applications.set(t,r)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,r=!0){return Kp.findTestabilityInTree(this,t,r)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();class bI{addToWindow(e){}findTestabilityInTree(e,t,r){return null}}let Kp=new bI,ea=null;const g2=new Kt("AllowMultipleToken"),m2=new Kt("PlatformOnDestroy");class v2{constructor(e,t){this.name=e,this.token=t}}function y2(n,e,t=[]){const r=`Platform: ${e}`,i=new Kt(r);return(a=[])=>{let h=qp();if(!h||h.injector.get(g2,!1)){const v=[...t,...a,{provide:i,useValue:!0}];n?n(v):function EI(n){if(ea&&!ea.get(g2,!1))throw new Ne(400,"");ea=n;const e=n.get(b2),t=n.get(c2,null);t&&t.forEach(r=>r())}(function SI(n=[],e){return Cr.create({name:e,providers:[{provide:Q0,useValue:"platform"},{provide:m2,useValue:()=>ea=null},...n]})}(v,r))}return function xI(n){const e=qp();if(!e)throw new Ne(401,"");return e}()}}function qp(){var n;return null!==(n=null==ea?void 0:ea.get(b2))&&void 0!==n?n:null}let b2=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,r){const v=function CI(n,e){let t;return t="noop"===n?new vI:("zone.js"===n?void 0:n)||new or({enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(r?r.ngZone:void 0,{ngZoneEventCoalescing:r&&r.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:r&&r.ngZoneRunCoalescing||!1}),D=[{provide:or,useValue:v}];return v.run(()=>{const L=Cr.create({providers:D,parent:this.injector,name:t.moduleType.name}),j=t.create(L),Q=j.injector.get(lu,null);if(!Q)throw new Ne(402,"");return v.runOutsideAngular(()=>{const me=v.onError.subscribe({next:ye=>{Q.handleError(ye)}});j.onDestroy(()=>{Wp(this._modules,j),me.unsubscribe()})}),function AI(n,e,t){try{const r=t();return pu(r)?r.catch(i=>{throw e.runOutsideAngular(()=>n.handleError(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>n.handleError(r)),r}}(Q,v,()=>{const me=j.injector.get(Hp);return me.runInitializers(),me.donePromise.then(()=>(function iT(n){hn(n,"Expected localeId to be defined"),"string"==typeof n&&(J_=n.toLowerCase().replace(/_/g,"-"))}(j.injector.get(xs,mf)||mf),this._moduleDoBootstrap(j),j))})})}bootstrapModule(t,r=[]){const i=_2({},r);return function wI(n,e,t){const r=new Ep(t);return Promise.resolve(r)}(0,0,t).then(a=>this.bootstrapModuleFactory(a,i))}_moduleDoBootstrap(t){const r=t.injector.get(fl);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!t.instance.ngDoBootstrap)throw new Ne(403,"");t.instance.ngDoBootstrap(r)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Ne(404,"");this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());const t=this._injector.get(m2,null);null==t||t(),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(Mt(Cr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();function _2(n,e){return Array.isArray(e)?e.reduce(_2,n):Object.assign(Object.assign({},n),e)}let fl=(()=>{class n{constructor(t,r,i,a){this._zone=t,this._injector=r,this._exceptionHandler=i,this._initStatus=a,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const h=new Z(D=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{D.next(this._stable),D.complete()})}),v=new Z(D=>{let L;this._zone.runOutsideAngular(()=>{L=this._zone.onStable.subscribe(()=>{or.assertNotInAngularZone(),jp(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,D.next(!0))})})});const j=this._zone.onUnstable.subscribe(()=>{or.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{D.next(!1)}))});return()=>{L.unsubscribe(),j.unsubscribe()}});this.isStable=Be(h,v.pipe(function Ye(){return n=>oe()(function Xe(n,e){return function(r){let i;if(i="function"==typeof n?n:function(){return n},"function"==typeof e)return r.lift(new Je(i,e));const a=Object.create(r,Pe);return a.source=r,a.subjectFactory=i,a}}(kt)(n))}()))}bootstrap(t,r){if(!this._initStatus.done)throw new Ne(405,"");let i;i=t instanceof xw?t:this._injector.get(Ys).resolveComponentFactory(t),this.componentTypes.push(i.componentType);const a=function MI(n){return n.isBoundToModule}(i)?void 0:this._injector.get(Yo),v=i.create(Cr.NULL,[],r||i.selector,a),D=v.location.nativeElement,L=v.injector.get(Gp,null),j=L&&v.injector.get(yI);return L&&j&&j.registerApplication(D,L),v.onDestroy(()=>{this.detachView(v.hostView),Wp(this.components,v),j&&j.unregisterApplication(D)}),this._loadComponent(v),v}tick(){if(this._runningTick)throw new Ne(101,"");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const r=t;this._views.push(r),r.attachToAppRef(this)}detachView(t){const r=t;Wp(this._views,r),r.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(f2,[]).concat(this._bootstrapListeners).forEach(i=>i(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(Mt(or),Mt(Cr),Mt(lu),Mt(Hp))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function Wp(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}let M2=!0,hl=(()=>{class n{}return n.__NG_ELEMENT_ID__=II,n})();function II(n){return function RI(n,e,t){if(Tc(n)&&!t){const r=wi(n.index,e);return new Mu(r,r)}return 47&n.type?new Mu(e[16],e):null}(Rr(),Et(),16==(16&n))}class A2{constructor(){}supports(e){return hu(e)}create(e){return new LI(e)}}const BI=(n,e)=>e;class LI{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||BI}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,r=this._removalsHead,i=0,a=null;for(;t||r;){const h=!r||t&&t.currentIndex{h=this._trackByFn(i,v),null!==t&&Object.is(t.trackById,h)?(r&&(t=this._verifyReinsertion(t,v,h,i)),Object.is(t.item,v)||this._addIdentityChange(t,v)):(t=this._mismatch(t,v,h,i),r=!0),t=t._next,i++}),this.length=i;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,r,i){let a;return null===e?a=this._itTail:(a=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,a,i)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(r,i))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,a,i)):e=this._addAfter(new FI(t,r),a,i),e}_verifyReinsertion(e,t,r,i){let a=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==a?e=this._reinsertAfter(a,e._prev,i):e.currentIndex!=i&&(e.currentIndex=i,this._addToMoves(e,i)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const i=e._prevRemoved,a=e._nextRemoved;return null===i?this._removalsHead=a:i._nextRemoved=a,null===a?this._removalsTail=i:a._prevRemoved=i,this._insertAfter(e,t,r),this._addToMoves(e,r),e}_moveAfter(e,t,r){return this._unlink(e),this._insertAfter(e,t,r),this._addToMoves(e,r),e}_addAfter(e,t,r){return this._insertAfter(e,t,r),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,r){const i=null===t?this._itHead:t._next;return e._next=i,e._prev=t,null===i?this._itTail=e:i._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new T2),this._linkedRecords.put(e),e.currentIndex=r,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,r=e._next;return null===t?this._itHead=r:t._next=r,null===r?this._itTail=t:r._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new T2),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class FI{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class UI{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===t||t<=r.currentIndex)&&Object.is(r.trackById,e))return r;return null}remove(e){const t=e._prevDup,r=e._nextDup;return null===t?this._head=r:t._nextDup=r,null===r?this._tail=t:r._prevDup=t,null===this._head}}class T2{constructor(){this.map=new Map}put(e){const t=e.trackById;let r=this.map.get(t);r||(r=new UI,this.map.set(t,r)),r.add(e)}get(e,t){const i=this.map.get(e);return i?i.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function D2(n,e,t){const r=n.previousIndex;if(null===r)return r;let i=0;return t&&r{class n{constructor(t){this.factories=t}static create(t,r){if(null!=r){const i=r.factories.slice();t=t.concat(i)}return new n(t)}static extend(t){return{provide:n,useFactory:r=>n.create(t,r||R2()),deps:[[n,new eu,new _s]]}}find(t){const r=this.factories.find(i=>i.supports(t));if(null!=r)return r;throw new Ne(901,"")}}return n.\u0275prov=xt({token:n,providedIn:"root",factory:R2}),n})();const zI=y2(null,"core",[]);let GI=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(Mt(fl))},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})(),Rf=null;function ko(){return Rf}const wr=new Kt("DocumentToken");let na=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:function(){return function ZI(){return Mt(P2)}()},providedIn:"platform"}),n})();const XI=new Kt("Location Initialized");let P2=(()=>{class n extends na{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ko().getBaseHref(this._doc)}onPopState(t){const r=ko().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",t,!1),()=>r.removeEventListener("popstate",t)}onHashChange(t){const r=ko().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",t,!1),()=>r.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,r,i){N2()?this._history.pushState(t,r,i):this.location.hash=i}replaceState(t,r,i){N2()?this._history.replaceState(t,r,i):this.location.hash=i}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:function(){return function YI(){return new P2(Mt(wr))}()},providedIn:"platform"}),n})();function N2(){return!!window.history.pushState}function Jp(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}function k2(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function Jo(n){return n&&"?"!==n[0]?"?"+n:n}let dl=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:function(){return function QI(n){const e=Mt(wr).location;return new B2(Mt(na),e&&e.origin||"")}()},providedIn:"root"}),n})();const eg=new Kt("appBaseHref");let B2=(()=>{class n extends dl{constructor(t,r){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==r&&(r=this._platformLocation.getBaseHrefFromDOM()),null==r)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=r}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return Jp(this._baseHref,t)}path(t=!1){const r=this._platformLocation.pathname+Jo(this._platformLocation.search),i=this._platformLocation.hash;return i&&t?`${r}${i}`:r}pushState(t,r,i,a){const h=this.prepareExternalUrl(i+Jo(a));this._platformLocation.pushState(t,r,h)}replaceState(t,r,i,a){const h=this.prepareExternalUrl(i+Jo(a));this._platformLocation.replaceState(t,r,h)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var r,i;null===(i=(r=this._platformLocation).historyGo)||void 0===i||i.call(r,t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(na),Mt(eg,8))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),JI=(()=>{class n extends dl{constructor(t,r){super(),this._platformLocation=t,this._baseHref="",this._removeListenerFns=[],null!=r&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}path(t=!1){let r=this._platformLocation.hash;return null==r&&(r="#"),r.length>0?r.substring(1):r}prepareExternalUrl(t){const r=Jp(this._baseHref,t);return r.length>0?"#"+r:r}pushState(t,r,i,a){let h=this.prepareExternalUrl(i+Jo(a));0==h.length&&(h=this._platformLocation.pathname),this._platformLocation.pushState(t,r,h)}replaceState(t,r,i,a){let h=this.prepareExternalUrl(i+Jo(a));0==h.length&&(h=this._platformLocation.pathname),this._platformLocation.replaceState(t,r,h)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var r,i;null===(i=(r=this._platformLocation).historyGo)||void 0===i||i.call(r,t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(na),Mt(eg,8))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),tg=(()=>{class n{constructor(t,r){this._subject=new vn,this._urlChangeListeners=[],this._platformStrategy=t;const i=this._platformStrategy.getBaseHref();this._platformLocation=r,this._baseHref=k2(L2(i)),this._platformStrategy.onPopState(a=>{this._subject.emit({url:this.path(!0),pop:!0,state:a.state,type:a.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,r=""){return this.path()==this.normalize(t+Jo(r))}normalize(t){return n.stripTrailingSlash(function tR(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,L2(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,r="",i=null){this._platformStrategy.pushState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Jo(r)),i)}replaceState(t,r="",i=null){this._platformStrategy.replaceState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Jo(r)),i)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var r,i;null===(i=(r=this._platformStrategy).historyGo)||void 0===i||i.call(r,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}))}_notifyUrlChangeListeners(t="",r){this._urlChangeListeners.forEach(i=>i(t,r))}subscribe(t,r,i){return this._subject.subscribe({next:t,error:r,complete:i})}}return n.normalizeQueryParams=Jo,n.joinWithSlash=Jp,n.stripTrailingSlash=k2,n.\u0275fac=function(t){return new(t||n)(Mt(dl),Mt(na))},n.\u0275prov=xt({token:n,factory:function(){return function eR(){return new tg(Mt(dl),Mt(na))}()},providedIn:"root"}),n})();function L2(n){return n.replace(/\/index.html$/,"")}function K2(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const r=t.indexOf("="),[i,a]=-1==r?[t,""]:[t.slice(0,r),t.slice(r+1)];if(i.trim()===e)return decodeURIComponent(a)}return null}class HR{constructor(e,t,r,i){this.$implicit=e,this.ngForOf=t,this.index=r,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ru=(()=>{class n{constructor(t,r,i){this._viewContainer=t,this._template=r,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;!this._differ&&t&&(this._differ=this._differs.find(t).create(this.ngForTrackBy))}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const r=this._viewContainer;t.forEachOperation((i,a,h)=>{if(null==i.previousIndex)r.createEmbeddedView(this._template,new HR(i.item,this._ngForOf,-1,-1),null===h?void 0:h);else if(null==h)r.remove(null===a?void 0:a);else if(null!==a){const v=r.get(a);r.move(v,h),q2(v,i)}});for(let i=0,a=r.length;i{q2(r.get(i.currentIndex),i)})}static ngTemplateContextGuard(t,r){return!0}}return n.\u0275fac=function(t){return new(t||n)(ot(uo),ot(No),ot(If))},n.\u0275dir=$t({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();function q2(n,e){n.context.$implicit=e.item}let fo=(()=>{class n{constructor(t,r){this._viewContainer=t,this._context=new VR,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=r}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){W2("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){W2("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,r){return!0}}return n.\u0275fac=function(t){return new(t||n)(ot(uo),ot(No))},n.\u0275dir=$t({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class VR{constructor(){this.$implicit=null,this.ngIf=null}}function W2(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${nt(e)}'.`)}const Z2="browser";function X2(n){return n===Z2}let Pu=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})(),jO=(()=>{class n{}return n.\u0275prov=xt({token:n,providedIn:"root",factory:()=>new $O(Mt(wr),window)}),n})();class $O{constructor(e,t){this.document=e,this.window=t,this.offset=()=>[0,0]}setOffset(e){this.offset=Array.isArray(e)?()=>e:e}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(e){this.supportsScrolling()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(!this.supportsScrolling())return;const t=function zO(n,e){const t=n.getElementById(e)||n.getElementsByName(e)[0];if(t)return t;if("function"==typeof n.createTreeWalker&&n.body&&(n.body.createShadowRoot||n.body.attachShadow)){const r=n.createTreeWalker(n.body,NodeFilter.SHOW_ELEMENT);let i=r.currentNode;for(;i;){const a=i.shadowRoot;if(a){const h=a.getElementById(e)||a.querySelector(`[name="${e}"]`);if(h)return h}i=r.nextNode()}}return null}(this.document,e);t&&(this.scrollToElement(t),t.focus())}setHistoryScrollRestoration(e){if(this.supportScrollRestoration()){const t=this.window.history;t&&t.scrollRestoration&&(t.scrollRestoration=e)}}scrollToElement(e){const t=e.getBoundingClientRect(),r=t.left+this.window.pageXOffset,i=t.top+this.window.pageYOffset,a=this.offset();this.window.scrollTo(r-a[0],i-a[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const e=rM(this.window.history)||rM(Object.getPrototypeOf(this.window.history));return!(!e||!e.writable&&!e.set)}catch(e){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(e){return!1}}}function rM(n){return Object.getOwnPropertyDescriptor(n,"scrollRestoration")}class iM{}class vg extends class KO extends class WI{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function qI(n){Rf||(Rf=n)}(new vg)}onAndCancel(e,t,r){return e.addEventListener(t,r,!1),()=>{e.removeEventListener(t,r,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=function qO(){return Nu=Nu||document.querySelector("base"),Nu?Nu.getAttribute("href"):null}();return null==t?null:function WO(n){$f=$f||document.createElement("a"),$f.setAttribute("href",n);const e=$f.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){Nu=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return K2(document.cookie,e)}}let $f,Nu=null;const oM=new Kt("TRANSITION_ID"),XO=[{provide:Up,useFactory:function ZO(n,e,t){return()=>{t.get(Hp).donePromise.then(()=>{const r=ko(),i=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let a=0;a{const a=e.findTestabilityInTree(r,i);if(null==a)throw new Error("Could not find testability for element.");return a},Zn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Zn.getAllAngularRootElements=()=>e.getAllRootElements(),Zn.frameworkStabilizers||(Zn.frameworkStabilizers=[]),Zn.frameworkStabilizers.push(r=>{const i=Zn.getAllAngularTestabilities();let a=i.length,h=!1;const v=function(D){h=h||D,a--,0==a&&r(h)};i.forEach(function(D){D.whenStable(v)})})}findTestabilityInTree(e,t,r){if(null==t)return null;const i=e.getTestability(t);return null!=i?i:r?ko().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let YO=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const zf=new Kt("EventManagerPlugins");let Gf=(()=>{class n{constructor(t,r){this._zone=r,this._eventNameToPlugin=new Map,t.forEach(i=>i.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,r,i){return this._findPluginFor(r).addEventListener(t,r,i)}addGlobalEventListener(t,r,i){return this._findPluginFor(r).addGlobalEventListener(t,r,i)}getZone(){return this._zone}_findPluginFor(t){const r=this._eventNameToPlugin.get(t);if(r)return r;const i=this._plugins;for(let a=0;a{class n{constructor(){this._stylesSet=new Set}addStyles(t){const r=new Set;t.forEach(i=>{this._stylesSet.has(i)||(this._stylesSet.add(i),r.add(i))}),this.onStylesAdded(r)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),ku=(()=>{class n extends aM{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,r,i){t.forEach(a=>{const h=this._doc.createElement("style");h.textContent=a,i.push(r.appendChild(h))})}addHost(t){const r=[];this._addStylesToHost(this._stylesSet,t,r),this._hostNodes.set(t,r)}removeHost(t){const r=this._hostNodes.get(t);r&&r.forEach(lM),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((r,i)=>{this._addStylesToHost(t,i,r)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(lM))}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();function lM(n){ko().remove(n)}const bg={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},_g=/%COMP%/g;function Kf(n,e,t){for(let r=0;r{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let qf=(()=>{class n{constructor(t,r,i){this.eventManager=t,this.sharedStylesHost=r,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new wg(t)}createRenderer(t,r){if(!t||!r)return this.defaultRenderer;switch(r.encapsulation){case Qi.Emulated:{let i=this.rendererByCompId.get(r.id);return i||(i=new r7(this.eventManager,this.sharedStylesHost,r,this.appId),this.rendererByCompId.set(r.id,i)),i.applyToHost(t),i}case 1:case Qi.ShadowDom:return new i7(this.eventManager,this.sharedStylesHost,t,r);default:if(!this.rendererByCompId.has(r.id)){const i=Kf(r.id,r.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(r.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(Mt(Gf),Mt(ku),Mt(Cu))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class wg{constructor(e){this.eventManager=e,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(e,t){return t?document.createElementNS(bg[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,r){e&&e.insertBefore(t,r)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let r="string"==typeof e?document.querySelector(e):e;if(!r)throw new Error(`The selector "${e}" did not match any elements`);return t||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,r,i){if(i){t=i+":"+t;const a=bg[i];a?e.setAttributeNS(a,t,r):e.setAttribute(t,r)}else e.setAttribute(t,r)}removeAttribute(e,t,r){if(r){const i=bg[r];i?e.removeAttributeNS(i,t):e.removeAttribute(`${r}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,r,i){i&(Ei.DashCase|Ei.Important)?e.style.setProperty(t,r,i&Ei.Important?"important":""):e.style[t]=r}removeStyle(e,t,r){r&Ei.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,r){e[t]=r}setValue(e,t){e.nodeValue=t}listen(e,t,r){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,fM(r)):this.eventManager.addEventListener(e,t,fM(r))}}class r7 extends wg{constructor(e,t,r,i){super(e),this.component=r;const a=Kf(i+"-"+r.id,r.styles,[]);t.addStyles(a),this.contentAttr=function e7(n){return"_ngcontent-%COMP%".replace(_g,n)}(i+"-"+r.id),this.hostAttr=function t7(n){return"_nghost-%COMP%".replace(_g,n)}(i+"-"+r.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const r=super.createElement(e,t);return super.setAttribute(r,this.contentAttr,""),r}}class i7 extends wg{constructor(e,t,r,i){super(e),this.sharedStylesHost=t,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const a=Kf(i.id,i.styles,[]);for(let h=0;h{class n extends sM{constructor(t){super(t)}supports(t){return!0}addEventListener(t,r,i){return t.addEventListener(r,i,!1),()=>this.removeEventListener(t,r,i)}removeEventListener(t,r,i){return t.removeEventListener(r,i)}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const dM=["alt","control","meta","shift"],a7={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},pM={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},l7={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let u7=(()=>{class n extends sM{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,r,i){const a=n.parseEventName(r),h=n.eventCallback(a.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ko().onAndCancel(t,a.domEventName,h))}static parseEventName(t){const r=t.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const a=n._normalizeKey(r.pop());let h="";if(dM.forEach(D=>{const L=r.indexOf(D);L>-1&&(r.splice(L,1),h+=D+".")}),h+=a,0!=r.length||0===a.length)return null;const v={};return v.domEventName=i,v.fullKey=h,v}static getEventFullKey(t){let r="",i=function c7(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&pM.hasOwnProperty(e)&&(e=pM[e]))}return a7[e]||e}(t);return i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),dM.forEach(a=>{a!=i&&l7[a](t)&&(r+=a+".")}),r+=i,r}static eventCallback(t,r,i){return a=>{n.getEventFullKey(a)===t&&i.runGuarded(()=>r(a))}}static _normalizeKey(t){return"esc"===t?"escape":t}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const p7=y2(zI,"browser",[{provide:Au,useValue:Z2},{provide:c2,useValue:function f7(){vg.makeCurrent(),yg.init()},multi:!0},{provide:wr,useFactory:function d7(){return function nC(n){kd=n}(document),document},deps:[]}]),g7=[{provide:Q0,useValue:"root"},{provide:lu,useFactory:function h7(){return new lu},deps:[]},{provide:zf,useClass:o7,multi:!0,deps:[wr,or,Au]},{provide:zf,useClass:u7,multi:!0,deps:[wr]},{provide:qf,useClass:qf,deps:[Gf,ku,Cu]},{provide:Qs,useExisting:qf},{provide:aM,useExisting:ku},{provide:ku,useClass:ku,deps:[wr]},{provide:Gp,useClass:Gp,deps:[or]},{provide:Gf,useClass:Gf,deps:[zf,or]},{provide:iM,useClass:YO,deps:[]}];let gM=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:Cu,useValue:t.appId},{provide:oM,useExisting:Cu},XO]}}}return n.\u0275fac=function(t){return new(t||n)(Mt(n,12))},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:g7,imports:[Pu,GI]}),n})();"undefined"!=typeof window&&window;let Wf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:function(t){let r=null;return r=t?new(t||n):Mt(yM),r},providedIn:"root"}),n})(),yM=(()=>{class n extends Wf{constructor(t){super(),this._doc=t}sanitize(t,r){if(null==r)return null;switch(t){case Qn.NONE:return r;case Qn.HTML:return Ao(r,"HTML")?xi(r):By(this._doc,String(r)).toString();case Qn.STYLE:return Ao(r,"Style")?xi(r):r;case Qn.SCRIPT:if(Ao(r,"Script"))return xi(r);throw new Error("unsafe value used in a script context");case Qn.URL:return Ty(r),Ao(r,"URL")?xi(r):ou(String(r));case Qn.RESOURCE_URL:if(Ao(r,"ResourceURL"))return xi(r);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function VA(n){return new BA(n)}(t)}bypassSecurityTrustStyle(t){return function jA(n){return new LA(n)}(t)}bypassSecurityTrustScript(t){return function $A(n){return new FA(n)}(t)}bypassSecurityTrustUrl(t){return function zA(n){return new UA(n)}(t)}bypassSecurityTrustResourceUrl(t){return function GA(n){return new HA(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:function(t){let r=null;return r=t?new t:function S7(n){return new yM(n.get(wr))}(Mt(Cr)),r},providedIn:"root"}),n})();class bM{}const ts="*";function _M(n,e){return{type:7,name:n,definitions:e,options:{}}}function pl(n,e=null){return{type:4,styles:e,timings:n}}function wM(n,e=null){return{type:2,steps:n,options:e}}function Ci(n){return{type:6,styles:n,offset:null}}function Eg(n,e,t){return{type:0,name:n,styles:e,options:t}}function xg(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function MM(n){Promise.resolve(null).then(n)}class Bu{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){MM(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class EM{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,r=0,i=0;const a=this.players.length;0==a?MM(()=>this._onFinish()):this.players.forEach(h=>{h.onDone(()=>{++t==a&&this._onFinish()}),h.onDestroy(()=>{++r==a&&this._onDestroy()}),h.onStart(()=>{++i==a&&this._onStart()})}),this.totalTime=this.players.reduce((h,v)=>Math.max(h,v.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(r=>{const i=r.totalTime?Math.min(1,t/r.totalTime):1;r.setPosition(i)})}getPosition(){const e=this.players.reduce((t,r)=>null===t||r.totalTime>t.totalTime?r:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class A7{constructor(e,t){this.open=e,this.close=t||e}isManual(){return"manual"===this.open||"manual"===this.close}}const T7={hover:["mouseover","mouseout"],focus:["focusin","focusout"]};const sr="undefined"!=typeof window&&window||{};var Zf=(()=>(function(n){n.isBs3="bs3",n.isBs4="bs4",n.isBs5="bs5"}(Zf||(Zf={})),Zf))();let Ai;function Cg(){if(void 0===sr.document)return"bs4";const n=sr.document.createElement("span");n.innerText="testing bs version",n.classList.add("d-none"),n.classList.add("pl-1"),sr.document.head.appendChild(n);const e=n.getBoundingClientRect(),t=sr.getComputedStyle(n).paddingLeft;return!e||e&&0!==e.top?(sr.document.head.removeChild(n),"bs3"):t&&parseFloat(t)?(sr.document.head.removeChild(n),"bs4"):(sr.document.head.removeChild(n),"bs5")}function gl(){return void 0===sr||(void 0===sr.__theme?(Ai||(Ai=Cg()),"bs3"===Ai):"bs3"===sr.__theme)}function SM(){return!gl()&&(Ai||(Ai=Cg()),"bs4"===Ai)}function Lu(){return{isBs3:gl(),isBs4:SM(),isBs5:!gl()&&!SM()&&(Ai||(Ai=Cg()),"bs5"===Ai)}}function Ag(n,e,t,r){return R(t)&&(r=t,t=void 0),r?Ag(n,e,t).pipe(u(i=>M(i)?r(...i):r(i))):new Z(i=>{AM(n,e,function a(h){i.next(arguments.length>1?Array.prototype.slice.call(arguments):h)},i,t)})}function AM(n,e,t,r,i){let a;if(function F7(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const h=n;n.addEventListener(e,t,i),a=()=>h.removeEventListener(e,t,i)}else if(function L7(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const h=n;n.on(e,t),a=()=>h.off(e,t)}else if(function B7(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const h=n;n.addListener(e,t),a=()=>h.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let h=0,v=n.length;h{class n{constructor(t,r=n.now){this.SchedulerAction=t,this.now=r}schedule(t,r=0,i){return new this.SchedulerAction(this,t).schedule(i,r)}}return n.now=()=>Date.now(),n})();class ns extends DM{constructor(e,t=DM.now){super(e,()=>ns.delegate&&ns.delegate!==this?ns.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,r){return ns.delegate&&ns.delegate!==this?ns.delegate.schedule(e,t,r):super.schedule(e,t,r)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let r;this.active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}}const j7=new class V7 extends ns{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let r,i=-1,a=t.length;e=e||t.shift();do{if(r=e.execute(e.state,e.delay))break}while(++i0?super.requestAsyncId(e,t,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,r=0){if(null!==r&&r>0||null===r&&this.delay>0)return super.recycleAsyncId(e,t,r);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});var Xf=(()=>(function(n){n.top="top",n.bottom="bottom",n.left="left",n.right="right",n.auto="auto",n.end="right",n.start="left",n["top left"]="top left",n["top right"]="top right",n["right top"]="right top",n["right bottom"]="right bottom",n["bottom right"]="bottom right",n["bottom left"]="bottom left",n["left bottom"]="left bottom",n["left top"]="left top",n["top start"]="top left",n["top end"]="top right",n["end top"]="right top",n["end bottom"]="right bottom",n["bottom end"]="bottom right",n["bottom start"]="bottom left",n["start bottom"]="start bottom",n["start top"]="left top"}(Xf||(Xf={})),Xf))(),Fu=(()=>(function(n){n.top="top",n.bottom="bottom",n.left="start",n.right="end",n.auto="auto",n.end="end",n.start="start",n["top left"]="top start",n["top right"]="top end",n["right top"]="end top",n["right bottom"]="end bottom",n["bottom right"]="bottom end",n["bottom left"]="bottom start",n["left bottom"]="start bottom",n["left top"]="start top",n["top start"]="top start",n["top end"]="top end",n["end top"]="end top",n["end bottom"]="end bottom",n["bottom end"]="bottom end",n["bottom start"]="bottom start",n["start bottom"]="start bottom",n["start top"]="start top"}(Fu||(Fu={})),Fu))();function ra(n,e){if(1!==n.nodeType)return[];const t=n.ownerDocument.defaultView,r=null==t?void 0:t.getComputedStyle(n,null);return e?r&&r[e]:r}function Tg(n){if(!n)return document.documentElement;let r,t=null==n?void 0:n.offsetParent;for(;null===t&&n.nextElementSibling&&r!==n.nextElementSibling;)r=n.nextElementSibling,t=r.offsetParent;const i=t&&t.nodeName;return i&&"BODY"!==i&&"HTML"!==i?t&&-1!==["TH","TD","TABLE"].indexOf(t.nodeName)&&"static"===ra(t,"position")?Tg(t):t:r?r.ownerDocument.documentElement:document.documentElement}function Dg(n){return null!==n.parentNode?Dg(n.parentNode):n}function Yf(n,e){if(!(n&&n.nodeType&&e&&e.nodeType))return document.documentElement;const t=n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=t?n:e,i=t?e:n,a=document.createRange();a.setStart(r,0),a.setEnd(i,0);const h=a.commonAncestorContainer;if(n!==h&&e!==h||r.contains(i))return function $7(n){const{nodeName:e}=n;return"BODY"!==e&&("HTML"===e||Tg(n.firstElementChild)===n)}(h)?h:Tg(h);const v=Dg(n);return v.host?Yf(v.host,e):Yf(n,Dg(e).host)}function IM(n){if(!n||!n.parentElement)return document.documentElement;let e=n.parentElement;for(;(null==e?void 0:e.parentElement)&&"none"===ra(e,"transform");)e=e.parentElement;return e||document.documentElement}function RM(n,e){const t="x"===e?"Left":"Top",r="Left"===t?"Right":"Bottom";return parseFloat(n[`border${t}Width`])+parseFloat(n[`border${r}Width`])}function OM(n,e,t,r){return Math.max(e[`offset${n}`],e[`scroll${n}`],t[`client${n}`],t[`offset${n}`],t[`scroll${n}`],0)}function PM(n){const e=n.body,t=n.documentElement;return{height:OM("Height",e,t),width:OM("Width",e,t)}}function Uu(n){return Object.assign(Object.assign({},n),{right:(n.left||0)+n.width,bottom:(n.top||0)+n.height})}function ar(n){return"number"==typeof n||"[object Number]"===Object.prototype.toString.call(n)}function NM(n){const e=n.getBoundingClientRect();if(!(e&&ar(e.top)&&ar(e.left)&&ar(e.bottom)&&ar(e.right)))return e;const t={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},r="HTML"===n.nodeName?PM(n.ownerDocument):void 0,i=(null==r?void 0:r.width)||n.clientWidth||ar(e.right)&&ar(t.left)&&e.right-t.left||0,a=(null==r?void 0:r.height)||n.clientHeight||ar(e.bottom)&&ar(t.top)&&e.bottom-t.top||0;let h=n.offsetWidth-i,v=n.offsetHeight-a;if(h||v){const D=ra(n);h-=RM(D,"x"),v-=RM(D,"y"),t.width-=h,t.height-=v}return Uu(t)}function Ig(n){return"HTML"===n.nodeName?n:n.parentNode||n.host}function Rg(n){if(!n)return document.body;switch(n.nodeName){case"HTML":case"BODY":return n.ownerDocument.body;case"#document":return n.body}const{overflow:e,overflowX:t,overflowY:r}=ra(n);return/(auto|scroll|overlay)/.test(String(e)+String(r)+String(t))?n:Rg(Ig(n))}function Og(n,e,t=!1){var r,i,a,h,v,D;const L="HTML"===e.nodeName,j=NM(n),Q=NM(e),ye=(Rg(n),ra(e)),Te=parseFloat(ye.borderTopWidth),Ve=parseFloat(ye.borderLeftWidth);t&&L&&(Q.top=Math.max(null!==(r=Q.top)&&void 0!==r?r:0,0),Q.left=Math.max(null!==(i=Q.left)&&void 0!==i?i:0,0));const je=Uu({top:(null!==(a=j.top)&&void 0!==a?a:0)-(null!==(h=Q.top)&&void 0!==h?h:0)-Te,left:(null!==(v=j.left)&&void 0!==v?v:0)-(null!==(D=Q.left)&&void 0!==D?D:0)-Ve,width:j.width,height:j.height});if(je.marginTop=0,je.marginLeft=0,L){const gt=parseFloat(ye.marginTop),Ie=parseFloat(ye.marginLeft);ar(je.top)&&(je.top-=Te-gt),ar(je.bottom)&&(je.bottom-=Te-gt),ar(je.left)&&(je.left-=Ve-Ie),ar(je.right)&&(je.right-=Ve-Ie),je.marginTop=gt,je.marginLeft=Ie}return je}function kM(n,e="top"){const t="top"===e?"scrollTop":"scrollLeft",r=n.nodeName;if("BODY"===r||"HTML"===r){const i=n.ownerDocument.documentElement;return(n.ownerDocument.scrollingElement||i)[t]}return n[t]}function BM(n){const e=n.nodeName;return"BODY"!==e&&"HTML"!==e&&("fixed"===ra(n,"position")||BM(Ig(n)))}function Pg(n,e,t=0,r,i=!1){let a={top:0,left:0};const h=i?IM(n):Yf(n,e);if("viewport"===r)a=function G7(n,e=!1){const t=n.ownerDocument.documentElement,r=Og(n,t),i=Math.max(t.clientWidth,window.innerWidth||0),a=Math.max(t.clientHeight,window.innerHeight||0),h=e?0:kM(t),v=e?0:kM(t,"left");return Uu({top:h-Number(null==r?void 0:r.top)+Number(null==r?void 0:r.marginTop),left:v-Number(null==r?void 0:r.left)+Number(null==r?void 0:r.marginLeft),width:i,height:a})}(h,i);else{let v;"scrollParent"===r?(v=Rg(Ig(e)),"BODY"===v.nodeName&&(v=n.ownerDocument.documentElement)):v="window"===r?n.ownerDocument.documentElement:r;const D=Og(v,h,i);if(D&&"HTML"===v.nodeName&&!BM(h)){const{height:L,width:j}=PM(n.ownerDocument);ar(a.top)&&ar(D.top)&&ar(D.marginTop)&&(a.top+=D.top-D.marginTop),ar(a.top)&&(a.bottom=Number(L)+Number(D.top)),ar(a.left)&&ar(D.left)&&ar(D.marginLeft)&&(a.left+=D.left-D.marginLeft),ar(a.top)&&(a.right=Number(j)+Number(D.left))}else D&&(a=D)}return ar(a.left)&&(a.left+=t),ar(a.top)&&(a.top+=t),ar(a.right)&&(a.right-=t),ar(a.bottom)&&(a.bottom-=t),a}function K7({width:n,height:e}){return n*e}function LM(n,e,t,r,i=["top","bottom","right","left"],a="viewport",h=0){var v,D,L,j,Q,me,ye,Te,Ve,je,gt,Ie;if(-1===n.indexOf("auto"))return n;const _t=Pg(t,r,h,a),At={top:{width:null!==(v=null==_t?void 0:_t.width)&&void 0!==v?v:0,height:(null!==(D=null==e?void 0:e.top)&&void 0!==D?D:0)-(null!==(L=null==_t?void 0:_t.top)&&void 0!==L?L:0)},right:{width:(null!==(j=null==_t?void 0:_t.right)&&void 0!==j?j:0)-(null!==(Q=null==e?void 0:e.right)&&void 0!==Q?Q:0),height:null!==(me=null==_t?void 0:_t.height)&&void 0!==me?me:0},bottom:{width:null!==(ye=null==_t?void 0:_t.width)&&void 0!==ye?ye:0,height:(null!==(Te=null==_t?void 0:_t.bottom)&&void 0!==Te?Te:0)-(null!==(Ve=null==e?void 0:e.bottom)&&void 0!==Ve?Ve:0)},left:{width:(null!==(je=e.left)&&void 0!==je?je:0)-(null!==(gt=null==_t?void 0:_t.left)&&void 0!==gt?gt:0),height:null!==(Ie=null==_t?void 0:_t.height)&&void 0!==Ie?Ie:0}},Nt=Object.keys(At).map(De=>Object.assign(Object.assign({position:De},At[De]),{area:K7(At[De])})).sort((De,ke)=>ke.area-De.area);let Vt=Nt.filter(({width:De,height:ke})=>De>=t.clientWidth&&ke>=t.clientHeight);Vt=Vt.filter(({position:De})=>i.some(ke=>ke===De));const Zt=Vt.length>0?Vt[0].position:Nt[0].position,Se=n.split(" ")[1];return t.className=t.className.replace(/bs-tooltip-auto/g,`bs-tooltip-${Lu().isBs5?Fu[Zt]:Zt}`),Zt+(Se?`-${Se}`:"")}const Qf=(n,e=0)=>n?parseFloat(n):e;function FM(n){const e=n.ownerDocument.defaultView,t=null==e?void 0:e.getComputedStyle(n),r=Qf(null==t?void 0:t.marginTop)+Qf(null==t?void 0:t.marginBottom),i=Qf(null==t?void 0:t.marginLeft)+Qf(null==t?void 0:t.marginRight);return{width:Number(n.offsetWidth)+i,height:Number(n.offsetHeight)+r}}function UM(n,e,t){return Og(e,t?IM(n):Yf(n,e),t)}function Ng(n,e,t){var r,i,a;const h=t.split(" ")[0],v=FM(n),D={width:v.width,height:v.height},L=-1!==["right","left"].indexOf(h),j=L?"top":"left",Q=L?"left":"top",me=L?"height":"width",ye=L?"width":"height";return D[j]=(null!==(r=e[j])&&void 0!==r?r:0)+e[me]/2-v[me]/2,D[Q]=h===Q?(null!==(i=e[Q])&&void 0!==i?i:0)-v[ye]:null!==(a=e[function W7(n){const e={left:"right",right:"left",bottom:"top",top:"bottom"};return n.replace(/left|right|bottom|top/g,t=>e[t])}(Q)])&&void 0!==a?a:0,D}function HM(n,e){var t;return!!(null===(t=n.modifiers[e])||void 0===t?void 0:t.enabled)}const X7={top:["top","top start","top end"],bottom:["bottom","bottom start","bottom end"],start:["start","start top","start bottom"],end:["end","end top","end bottom"]};function Jf(n,e){return!!Lu().isBs5&&X7[e].includes(n)}function VM(n,e,t){!n||!e||Object.keys(e).forEach(r=>{let i="";-1!==["width","height","top","right","bottom","left"].indexOf(r)&&function z7(n){return""!==n&&!isNaN(parseFloat(n))&&isFinite(Number(n))}(e[r])&&(i="px"),t?t.setStyle(n,r,`${String(e[r])}${i}`):n.style[r]=String(e[r])+i})}function J7(n){var e,t,r,i,a,h;let v=n.offsets.target;const D=n.instance.target.querySelector(".arrow");if(!D)return n;const L=-1!==["left","right"].indexOf(n.placement.split(" ")[0]),j=L?"height":"width",Q=L?"Top":"Left",me=Q.toLowerCase(),ye=L?"left":"top",Te=L?"bottom":"right",Ve=FM(D)[j],je=n.placement.split(" ")[1];(null!==(e=n.offsets.host[Te])&&void 0!==e?e:0)-Ve<(null!==(t=v[me])&&void 0!==t?t:0)&&(v[me]-=(null!==(r=v[me])&&void 0!==r?r:0)-((null!==(i=n.offsets.host[Te])&&void 0!==i?i:0)-Ve)),Number(n.offsets.host[me])+Number(Ve)>(null!==(a=v[Te])&&void 0!==a?a:0)&&(v[me]+=Number(n.offsets.host[me])+Number(Ve)-Number(v[Te])),v=Uu(v);const gt=ra(n.instance.target),Ie=parseFloat(gt[`margin${Q}`])||0,_t=parseFloat(gt[`border${Q}Width`])||0;let At;if(je){const Vt=parseFloat(gt.borderRadius)||0,Zt=Number(Ie+_t+Vt);At=me===je?Number(n.offsets.host[me])+Zt:Number(n.offsets.host[me])+Number(n.offsets.host[j]-Zt)}else At=Number(n.offsets.host[me])+Number(n.offsets.host[j]/2-Ve/2);let Nt=At-(null!==(h=v[me])&&void 0!==h?h:0)-Ie-_t;return Nt=Math.max(Math.min(v[j]-(Ve+5),Nt),0),n.offsets.arrow={[me]:Math.round(Nt),[ye]:""},n.instance.arrow=D,n}function eP(n){if(n.offsets.target=Uu(n.offsets.target),!HM(n.options,"flip"))return n.offsets.target=Object.assign(Object.assign({},n.offsets.target),Ng(n.instance.target,n.offsets.host,n.placement)),n;const e=Pg(n.instance.target,n.instance.host,0,"viewport",!1);let t=n.placement.split(" ")[0],r=n.placement.split(" ")[1]||"";const v=LM("auto",n.offsets.host,n.instance.target,n.instance.host,n.options.allowedPositions),D=[t,v];return D.forEach((L,j)=>{var Q,me,ye,Te,Ve,je,gt,Ie,_t,At,Nt,Vt,Zt,Se,De,ke;if(t!==L||D.length===j+1)return;t=n.placement.split(" ")[0];const dt="left"===t&&Math.floor(null!==(Q=n.offsets.target.right)&&void 0!==Q?Q:0)>Math.floor(null!==(me=n.offsets.host.left)&&void 0!==me?me:0)||"right"===t&&Math.floor(null!==(ye=n.offsets.target.left)&&void 0!==ye?ye:0)Math.floor(null!==(je=n.offsets.host.top)&&void 0!==je?je:0)||"bottom"===t&&Math.floor(null!==(gt=n.offsets.target.top)&&void 0!==gt?gt:0)Math.floor(null!==(Vt=e.right)&&void 0!==Vt?Vt:0),vt=Math.floor(null!==(Zt=n.offsets.target.top)&&void 0!==Zt?Zt:0)Math.floor(null!==(ke=e.bottom)&&void 0!==ke?ke:0),Fe="left"===t&&Qe||"right"===t&&st||"top"===t&&vt||"bottom"===t&&Ze,Ke=-1!==["top","bottom"].indexOf(t),qe=Ke&&"left"===r&&Qe||Ke&&"right"===r&&st||!Ke&&"left"===r&&vt||!Ke&&"right"===r&&Ze;(dt||Fe||qe)&&((dt||Fe)&&(t=D[j+1]),qe&&(r=function Z7(n){return"right"===n?"left":"left"===n?"right":n}(r)),n.placement=t+(r?` ${r}`:""),n.offsets.target=Object.assign(Object.assign({},n.offsets.target),Ng(n.instance.target,n.offsets.host,n.placement)))}),n}function nP(n){var e;if(!HM(n.options,"preventOverflow"))return n;const t="transform",r=n.instance.target.style,{top:i,left:a,[t]:h}=r;r.top="",r.left="",r[t]="";const v=Pg(n.instance.target,n.instance.host,0,(null===(e=n.options.modifiers.preventOverflow)||void 0===e?void 0:e.boundariesElement)||"scrollParent",!1);r.top=i,r.left=a,r[t]=h;const L={primary(j){var Q,me,ye,Te;let Ve=n.offsets.target[j];return(null!==(Q=n.offsets.target[j])&&void 0!==Q?Q:0)<(null!==(me=v[j])&&void 0!==me?me:0)&&(Ve=Math.max(null!==(ye=n.offsets.target[j])&&void 0!==ye?ye:0,null!==(Te=v[j])&&void 0!==Te?Te:0)),{[j]:Ve}},secondary(j){var Q,me,ye,Te;const Ve="right"===j,je=Ve?"left":"top";let Ie=n.offsets.target[je];return(null!==(Q=n.offsets.target[j])&&void 0!==Q?Q:0)>(null!==(me=v[j])&&void 0!==me?me:0)&&(Ie=Math.min(null!==(ye=n.offsets.target[je])&&void 0!==ye?ye:0,(null!==(Te=v[j])&&void 0!==Te?Te:0)-n.offsets.target[Ve?"width":"height"])),{[je]:Ie}}};return["left","right","top","bottom"].forEach(j=>{const Q=-1!==["left","top","start"].indexOf(j)?L.primary:L.secondary;n.offsets.target=Object.assign(Object.assign({},n.offsets.target),Q(j))}),n}function rP(n){var e;const t=n.placement,r=t.split(" ")[0],i=t.split(" ")[1];if(i){const{host:a,target:h}=n.offsets,v=-1!==["bottom","top"].indexOf(r),D=v?"left":"top",L=v?"width":"height",j={start:{[D]:a[D]},end:{[D]:(null!==(e=a[D])&&void 0!==e?e:0)+a[L]-h[L]}};n.offsets.target=Object.assign(Object.assign({},h),{[D]:D===i?j.start[D]:j.end[D]})}return n}const oP=new class iP{position(e,t){return this.offset(e,t)}offset(e,t){return UM(t,e)}positionElements(e,t,r,i,a){const h=[eP,rP,nP,J7],D=function tP(n,e,t,r){if(!n||!e)return;const i=UM(n,e);!t.match(/^(auto)*\s*(left|right|top|bottom|start|end)*$/)&&!t.match(/^(left|right|top|bottom|start|end)*(?: (left|right|top|bottom|start|end))*$/)&&(t="auto");const a=!!t.match(/auto/g);let h=t.match(/auto\s(left|right|top|bottom|start|end)/)?t.split(" ")[1]||"auto":t;const v=h.match(/^(left|right|top|bottom|start|end)* ?(?!\1)(left|right|top|bottom|start|end)?/);return v&&(h=v[1]+(v[2]?` ${v[2]}`:"")),-1!==["left right","right left","top bottom","bottom top"].indexOf(h)&&(h="auto"),h=LM(h,i,n,e,r?r.allowedPositions:void 0),{options:r||{modifiers:{}},instance:{target:n,host:e,arrow:void 0},offsets:{target:Ng(n,i,h),host:i,arrow:void 0},positionFixed:!1,placement:h,placementAuto:a}}(t,e,Xf[r],a);if(D)return h.reduce((L,j)=>j(L),D)}};function sP(n,e,t,r,i,a){const h=oP.positionElements(n,e,t,r,i);if(!h)return;const v=function q7(n){var e,t,r,i;return{width:n.offsets.target.width,height:n.offsets.target.height,left:Math.floor(null!==(e=n.offsets.target.left)&&void 0!==e?e:0),top:Math.round(null!==(t=n.offsets.target.top)&&void 0!==t?t:0),bottom:Math.round(null!==(r=n.offsets.target.bottom)&&void 0!==r?r:0),right:Math.floor(null!==(i=n.offsets.target.right)&&void 0!==i?i:0)}}(h);VM(e,{"will-change":"transform",top:"0px",left:"0px",transform:`translate3d(${v.left}px, ${v.top}px, 0px)`},a),h.instance.arrow&&VM(h.instance.arrow,h.offsets.arrow,a),function Q7(n,e){const t=n.instance.target;let r=t.className;const i=Lu().isBs5?Fu[n.placement]:n.placement;n.placementAuto&&(r=r.replace(/bs-popover-auto/g,`bs-popover-${i}`),r=r.replace(/ms-2|me-2|mb-2|mt-2/g,""),r=r.replace(/bs-tooltip-auto/g,`bs-tooltip-${i}`),r=r.replace(/\sauto/g,` ${i}`),-1!==r.indexOf("popover")&&(r=r+" "+function Y7(n){return Lu().isBs5?Jf(n,"end")?"ms-2":Jf(n,"start")?"me-2":Jf(n,"top")?"mb-2":Jf(n,"bottom")?"mt-2":"":""}(i)),-1!==r.indexOf("popover")&&-1===r.indexOf("popover-auto")&&(r+=" popover-auto"),-1!==r.indexOf("tooltip")&&-1===r.indexOf("tooltip-auto")&&(r+=" tooltip-auto")),r=r.replace(/left|right|top|bottom|end|start/g,`${i.split(" ")[0]}`),e?e.setAttribute(t,"class",r):t.className=r}(h,a)}let eh=(()=>{class n{constructor(t,r,i){this.update$$=new o,this.positionElements=new Map,this.isDisabled=!1,X2(i)&&t.runOutsideAngular(()=>{this.triggerEvent$=Be(Ag(window,"scroll",{passive:!0}),Ag(window,"resize",{passive:!0}),tn(0,j7),this.update$$),this.triggerEvent$.subscribe(()=>{this.isDisabled||this.positionElements.forEach(a=>{sP(th(a.target),th(a.element),a.attachment,a.appendToBody,this.options,r.createRenderer(null,null))})})})}position(t){this.addPositionElement(t)}get event$(){return this.triggerEvent$}disable(){this.isDisabled=!0}enable(){this.isDisabled=!1}addPositionElement(t){this.positionElements.set(th(t.element),t)}calcPosition(){this.update$$.next(null)}deletePositionElement(t){this.positionElements.delete(th(t))}setOptions(t){this.options=t}}return n.\u0275fac=function(t){return new(t||n)(Mt(or),Mt(Qs),Mt(Au))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function th(n){return"string"==typeof n?document.querySelector(n):n instanceof kr?n.nativeElement:null!=n?n:null}class Hu{constructor(e,t,r){this.nodes=e,this.viewRef=t,this.componentRef=r}}class aP{constructor(e,t,r,i,a,h,v,D){this._viewContainerRef=e,this._renderer=t,this._elementRef=r,this._injector=i,this._componentFactoryResolver=a,this._ngZone=h,this._applicationRef=v,this._posService=D,this.onBeforeShow=new vn,this.onShown=new vn,this.onBeforeHide=new vn,this.onHidden=new vn,this._providers=[],this._isHiding=!1,this.containerDefaultSelector="body",this._listenOpts={},this._globalListener=Function.prototype}get isShown(){return!this._isHiding&&!!this._componentRef}attach(e){return this._componentFactory=this._componentFactoryResolver.resolveComponentFactory(e),this}to(e){return this.container=e||this.container,this}position(e){return e?(this.attachment=e.attachment||this.attachment,this._elementRef=e.target||this._elementRef,this):this}provide(e){return this._providers.push(e),this}show(e={}){if(this._subscribePositioning(),this._innerComponent=void 0,!this._componentRef){this.onBeforeShow.emit(),this._contentRef=this._getContentRef(e.content,e.context,e.initialState);const t=Cr.create({providers:this._providers,parent:this._injector});if(!this._componentFactory)return;if(this._componentRef=this._componentFactory.create(t,this._contentRef.nodes),this._applicationRef.attachView(this._componentRef.hostView),this.instance=this._componentRef.instance,Object.assign(this._componentRef.instance,e),this.container instanceof kr&&this.container.nativeElement.appendChild(this._componentRef.location.nativeElement),"string"==typeof this.container&&"undefined"!=typeof document){const r=document.querySelector(this.container)||document.querySelector(this.containerDefaultSelector);if(!r)return;r.appendChild(this._componentRef.location.nativeElement)}!this.container&&this._elementRef&&this._elementRef.nativeElement.parentElement&&this._elementRef.nativeElement.parentElement.appendChild(this._componentRef.location.nativeElement),this._contentRef.componentRef&&(this._innerComponent=this._contentRef.componentRef.instance,this._contentRef.componentRef.changeDetectorRef.markForCheck(),this._contentRef.componentRef.changeDetectorRef.detectChanges()),this._componentRef.changeDetectorRef.markForCheck(),this._componentRef.changeDetectorRef.detectChanges(),this.onShown.emit(e.id?{id:e.id}:this._componentRef.instance)}return this._registerOutsideClick(),this._componentRef}hide(e){var t,r,i,a,h,v;if(!this._componentRef)return this;this._posService.deletePositionElement(this._componentRef.location),this.onBeforeHide.emit(this._componentRef.instance);const D=this._componentRef.location.nativeElement;return null===(t=D.parentNode)||void 0===t||t.removeChild(D),null===(i=null===(r=this._contentRef)||void 0===r?void 0:r.componentRef)||void 0===i||i.destroy(),this._viewContainerRef&&(null===(a=this._contentRef)||void 0===a?void 0:a.viewRef)&&this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._contentRef.viewRef)),null===(v=null===(h=this._contentRef)||void 0===h?void 0:h.viewRef)||void 0===v||v.destroy(),this._contentRef=void 0,this._componentRef=void 0,this._removeGlobalListener(),this.onHidden.emit(e?{id:e}:null),this}toggle(){this.isShown?this.hide():this.show()}dispose(){this.isShown&&this.hide(),this._unsubscribePositioning(),this._unregisterListenersFn&&this._unregisterListenersFn()}listen(e){var t;this.triggers=e.triggers||this.triggers,this._listenOpts.outsideClick=e.outsideClick,this._listenOpts.outsideEsc=e.outsideEsc,e.target=e.target||(null===(t=this._elementRef)||void 0===t?void 0:t.nativeElement);const r=this._listenOpts.hide=()=>e.hide?e.hide():void this.hide(),i=this._listenOpts.show=h=>{e.show?e.show(h):this.show(h),h()};return this._renderer&&(this._unregisterListenersFn=function D7(n,e){const t=function xM(n,e=T7){const t=(n||"").trim();if(0===t.length)return[];const r=t.split(/\s+/).map(a=>a.split(":")).map(a=>{const h=e[a[0]]||a;return new A7(h[0],h[1])}),i=r.filter(a=>a.isManual());if(i.length>1)throw new Error("Triggers parse error: only one manual trigger is allowed");if(1===i.length&&r.length>1)throw new Error("Triggers parse error: manual trigger can't be mixed with other triggers");return r}(e.triggers),r=e.target;if(1===t.length&&t[0].isManual())return Function.prototype;const i=[],a=[],h=()=>{a.forEach(v=>i.push(v())),a.length=0};return t.forEach(v=>{const D=v.open===v.close,L=D?e.toggle:e.show;if(!D&&v.close&&e.hide){const j=n.listen(r,v.close,e.hide);a.push(()=>j)}L&&i.push(n.listen(r,v.open,()=>L(h)))}),()=>{i.forEach(v=>v())}}(this._renderer,{target:e.target,triggers:e.triggers,show:i,hide:r,toggle:h=>{this.isShown?r():i(h)}})),this}_removeGlobalListener(){this._globalListener&&(this._globalListener(),this._globalListener=Function.prototype)}attachInline(e,t){return e&&t&&(this._inlineViewRef=e.createEmbeddedView(t)),this}_registerOutsideClick(){if(this._componentRef&&this._componentRef.location){if(this._listenOpts.outsideClick){const e=this._componentRef.location.nativeElement;setTimeout(()=>{this._renderer&&this._elementRef&&(this._globalListener=function I7(n,e){return e.outsideClick?n.listen("document","click",t=>{e.target&&e.target.contains(t.target)||e.targets&&e.targets.some(r=>r.contains(t.target))||e.hide&&e.hide()}):Function.prototype}(this._renderer,{targets:[e,this._elementRef.nativeElement],outsideClick:this._listenOpts.outsideClick,hide:()=>this._listenOpts.hide&&this._listenOpts.hide()}))})}this._listenOpts.outsideEsc&&this._renderer&&this._elementRef&&(this._globalListener=function R7(n,e){return e.outsideEsc?n.listen("document","keyup.esc",t=>{e.target&&e.target.contains(t.target)||e.targets&&e.targets.some(r=>r.contains(t.target))||e.hide&&e.hide()}):Function.prototype}(this._renderer,{targets:[this._componentRef.location.nativeElement,this._elementRef.nativeElement],outsideEsc:this._listenOpts.outsideEsc,hide:()=>this._listenOpts.hide&&this._listenOpts.hide()}))}}getInnerComponent(){return this._innerComponent}_subscribePositioning(){this._zoneSubscription||!this.attachment||(this.onShown.subscribe(()=>{var e;this._posService.position({element:null===(e=this._componentRef)||void 0===e?void 0:e.location,target:this._elementRef,attachment:this.attachment,appendToBody:"body"===this.container})}),this._zoneSubscription=this._ngZone.onStable.subscribe(()=>{!this._componentRef||this._posService.calcPosition()}))}_unsubscribePositioning(){!this._zoneSubscription||(this._zoneSubscription.unsubscribe(),this._zoneSubscription=void 0)}_getContentRef(e,t,r){if(!e)return new Hu([]);if(e instanceof No){if(this._viewContainerRef){const h=this._viewContainerRef.createEmbeddedView(e,t);return h.markForCheck(),new Hu([h.rootNodes],h)}const a=e.createEmbeddedView({});return this._applicationRef.attachView(a),new Hu([a.rootNodes],a)}if("function"==typeof e){const a=this._componentFactoryResolver.resolveComponentFactory(e),h=Cr.create({providers:this._providers,parent:this._injector}),v=a.create(h);return Object.assign(v.instance,r),this._applicationRef.attachView(v.hostView),new Hu([[v.location.nativeElement]],v.hostView,v)}const i=this._renderer?[this._renderer.createText(`${e}`)]:[];return new Hu([i])}}let nh=(()=>{class n{constructor(t,r,i,a,h){this._componentFactoryResolver=t,this._ngZone=r,this._injector=i,this._posService=a,this._applicationRef=h}createLoader(t,r,i){return new aP(r,i,t,this._injector,this._componentFactoryResolver,this._ngZone,this._applicationRef,this._posService)}}return n.\u0275fac=function(t){return new(t||n)(Mt(Ys),Mt(or),Mt(Cr),Mt(eh),Mt(fl))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();Ci({height:0,overflow:"hidden"}),pl("220ms cubic-bezier(0, 0, 0.2, 1)",Ci({height:"*",overflow:"hidden"}));let uP=(()=>{class n{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new vn,this.isDisabledChange=new vn,this.toggleClick=new vn,this.counts=0,this.dropdownMenu=new Promise(t=>{this.resolveDropdownMenu=t})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})(),cP=(()=>{class n{static forRoot(){return{ngModule:n,providers:[nh,eh,uP]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Pu]]}),n})();class Vi extends o{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new re;return this._value}next(e){super.next(this._value=e)}}class fP extends O{notifyNext(e,t,r,i,a){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class hP extends O{constructor(e,t,r){super(),this.parent=e,this.outerValue=t,this.outerIndex=r,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function dP(n,e,t,r,i=new hP(n,t,r)){if(!i.closed)return e instanceof Z?e.subscribe(i):ge(e)(i)}const jM={};class gP{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new mP(e,this.resultSelector))}}class mP extends fP{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(jM),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let r=0;re.schedule(vP,0,{error:n,subscriber:t}):t=>t.error(n))}function vP({error:n,subscriber:e}){e.error(n)}const ih=(()=>{function n(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return n.prototype=Object.create(Error.prototype),n})();function kg(...n){return function yP(){return Oe(1)}()(tn(...n))}const ml=new Z(n=>n.complete());function oh(n){return n?function bP(n){return new Z(e=>n.schedule(()=>e.complete()))}(n):ml}function $M(n){return new Z(e=>{let t;try{t=n()}catch(i){return void e.error(i)}return(t?Me(t):oh()).subscribe(e)})}function Cs(n,e){return"function"==typeof e?t=>t.pipe(Cs((r,i)=>Me(n(r,i)).pipe(u((a,h)=>e(r,a,i,h))))):t=>t.lift(new _P(n))}class _P{constructor(e){this.project=e}call(e,t){return t.subscribe(new wP(e,this.project))}}class wP extends Y{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const r=this.index++;try{t=this.project(e,r)}catch(i){return void this.destination.error(i)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const r=new le(this),i=this.destination;i.add(r),this.innerSubscription=Le(e,r),this.innerSubscription!==r&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const zM=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function sh(n){return e=>0===n?oh():e.lift(new MP(n))}class MP{constructor(e){if(this.total=e,this.total<0)throw new zM}call(e,t){return t.subscribe(new EP(e,this.total))}}class EP extends O{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))}}function GM(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(i){return i.lift(new SP(n,e,t))}}class SP{constructor(e,t,r=!1){this.accumulator=e,this.seed=t,this.hasSeed=r}call(e,t){return t.subscribe(new CP(e,this.accumulator,this.seed,this.hasSeed))}}class CP extends O{constructor(e,t,r,i){super(e),this.accumulator=t,this._seed=r,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let r;try{r=this.accumulator(this.seed,e,t)}catch(i){this.destination.error(i)}this.seed=r,this.destination.next(r)}}function rs(n,e){return function(r){return r.lift(new AP(n,e))}}class AP{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new TP(e,this.predicate,this.thisArg))}}class TP extends O{constructor(e,t,r){super(e),this.predicate=t,this.thisArg=r,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(r){return void this.destination.error(r)}t&&this.destination.next(e)}}function ia(n){return function(t){const r=new DP(n),i=t.lift(r);return r.caught=i}}class DP{constructor(e){this.selector=e}call(e,t){return t.subscribe(new IP(e,this.selector,this.caught))}}class IP extends Y{constructor(e,t,r){super(e),this.selector=t,this.caught=r}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(a){return void super.error(a)}this._unsubscribeAndRecycle();const r=new le(this);this.add(r);const i=Le(t,r);i!==r&&this.add(i)}}}function vl(n,e){return xe(n,e,1)}function Bg(n){return function(t){return 0===n?oh():t.lift(new RP(n))}}class RP{constructor(e){if(this.total=e,this.total<0)throw new zM}call(e,t){return t.subscribe(new OP(e,this.total))}}class OP extends O{constructor(e,t){super(e),this.total=t,this.ring=new Array,this.count=0}_next(e){const t=this.ring,r=this.total,i=this.count++;t.length0){const r=this.count>=this.total?this.total:this.count,i=this.ring;for(let a=0;ae.lift(new PP(n))}class PP{constructor(e){this.errorFactory=e}call(e,t){return t.subscribe(new NP(e,this.errorFactory))}}class NP extends O{constructor(e,t){super(e),this.errorFactory=t,this.hasValue=!1}_next(e){this.hasValue=!0,this.destination.next(e)}_complete(){if(this.hasValue)return this.destination.complete();{let e;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)}}}function kP(){return new ih}function qM(n=null){return e=>e.lift(new BP(n))}class BP{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new LP(e,this.defaultValue))}}class LP extends O{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function fi(n,e){const t=arguments.length>=2;return r=>r.pipe(n?rs((i,a)=>n(i,a,r)):G,sh(1),t?qM(e):KM(()=>new ih))}function As(){}function Ti(n,e,t){return function(i){return i.lift(new UP(n,e,t))}}class UP{constructor(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}call(e,t){return t.subscribe(new HP(e,this.nextOrObserver,this.error,this.complete))}}class HP extends O{constructor(e,t,r,i){super(e),this._tapNext=As,this._tapError=As,this._tapComplete=As,this._tapError=r||As,this._tapComplete=i||As,R(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||As,this._tapError=t.error||As,this._tapComplete=t.complete||As)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class jP{constructor(e){this.callback=e}call(e,t){return t.subscribe(new $P(e,this.callback))}}class $P extends O{constructor(e,t){super(e),this.add(new x(t))}}class is{constructor(e,t){this.id=e,this.url=t}}class Lg extends is{constructor(e,t,r="imperative",i=null){super(e,t),this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class yl extends is{constructor(e,t,r){super(e,t),this.urlAfterRedirects=r}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class WM extends is{constructor(e,t,r){super(e,t),this.reason=r}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class zP extends is{constructor(e,t,r){super(e,t),this.error=r}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class GP extends is{constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class KP extends is{constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class qP extends is{constructor(e,t,r,i,a){super(e,t),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=a}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class WP extends is{constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ZP extends is{constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ZM{constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class XM{constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class XP{constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class YP{constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class QP{constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class JP{constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class YM{constructor(e,t,r){this.routerEvent=e,this.position=t,this.anchor=r}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const yn="primary";class e9{constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function bl(n){return new e9(n)}const QM="ngNavigationCancelingError";function Fg(n){const e=Error("NavigationCancelingError: "+n);return e[QM]=!0,e}function n9(n,e,t){const r=t.path.split("/");if(r.length>n.length||"full"===t.pathMatch&&(e.hasChildren()||r.lengthr[a]===i)}return n===e}function eE(n){return Array.prototype.concat.apply([],n)}function tE(n){return n.length>0?n[n.length-1]:null}function $r(n,e){for(const t in n)n.hasOwnProperty(t)&&e(n[t],t)}function Lo(n){return fp(n)?n:pu(n)?Me(Promise.resolve(n)):tn(n)}const o9={exact:function iE(n,e,t){if(!sa(n.segments,e.segments)||!ah(n.segments,e.segments,t)||n.numberOfChildren!==e.numberOfChildren)return!1;for(const r in e.children)if(!n.children[r]||!iE(n.children[r],e.children[r],t))return!1;return!0},subset:oE},nE={exact:function s9(n,e){return Bo(n,e)},subset:function a9(n,e){return Object.keys(e).length<=Object.keys(n).length&&Object.keys(e).every(t=>JM(n[t],e[t]))},ignored:()=>!0};function rE(n,e,t){return o9[t.paths](n.root,e.root,t.matrixParams)&&nE[t.queryParams](n.queryParams,e.queryParams)&&!("exact"===t.fragment&&n.fragment!==e.fragment)}function oE(n,e,t){return sE(n,e,e.segments,t)}function sE(n,e,t,r){if(n.segments.length>t.length){const i=n.segments.slice(0,t.length);return!(!sa(i,t)||e.hasChildren()||!ah(i,t,r))}if(n.segments.length===t.length){if(!sa(n.segments,t)||!ah(n.segments,t,r))return!1;for(const i in e.children)if(!n.children[i]||!oE(n.children[i],e.children[i],r))return!1;return!0}{const i=t.slice(0,n.segments.length),a=t.slice(n.segments.length);return!!(sa(n.segments,i)&&ah(n.segments,i,r)&&n.children[yn])&&sE(n.children[yn],e,a,r)}}function ah(n,e,t){return e.every((r,i)=>nE[t](n[i].parameters,r.parameters))}class oa{constructor(e,t,r){this.root=e,this.queryParams=t,this.fragment=r}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=bl(this.queryParams)),this._queryParamMap}toString(){return c9.serialize(this)}}class _n{constructor(e,t){this.segments=e,this.children=t,this.parent=null,$r(t,(r,i)=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return lh(this)}}class Vu{constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap||(this._parameterMap=bl(this.parameters)),this._parameterMap}toString(){return fE(this)}}function sa(n,e){return n.length===e.length&&n.every((t,r)=>t.path===e[r].path)}class aE{}class lE{parse(e){const t=new b9(e);return new oa(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){const t=`/${ju(e.root,!0)}`,r=function d9(n){const e=Object.keys(n).map(t=>{const r=n[t];return Array.isArray(r)?r.map(i=>`${uh(t)}=${uh(i)}`).join("&"):`${uh(t)}=${uh(r)}`}).filter(t=>!!t);return e.length?`?${e.join("&")}`:""}(e.queryParams),i="string"==typeof e.fragment?`#${function f9(n){return encodeURI(n)}(e.fragment)}`:"";return`${t}${r}${i}`}}const c9=new lE;function lh(n){return n.segments.map(e=>fE(e)).join("/")}function ju(n,e){if(!n.hasChildren())return lh(n);if(e){const t=n.children[yn]?ju(n.children[yn],!1):"",r=[];return $r(n.children,(i,a)=>{a!==yn&&r.push(`${a}:${ju(i,!1)}`)}),r.length>0?`${t}(${r.join("//")})`:t}{const t=function u9(n,e){let t=[];return $r(n.children,(r,i)=>{i===yn&&(t=t.concat(e(r,i)))}),$r(n.children,(r,i)=>{i!==yn&&(t=t.concat(e(r,i)))}),t}(n,(r,i)=>i===yn?[ju(n.children[yn],!1)]:[`${i}:${ju(r,!1)}`]);return 1===Object.keys(n.children).length&&null!=n.children[yn]?`${lh(n)}/${t[0]}`:`${lh(n)}/(${t.join("//")})`}}function uE(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function uh(n){return uE(n).replace(/%3B/gi,";")}function Ug(n){return uE(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function ch(n){return decodeURIComponent(n)}function cE(n){return ch(n.replace(/\+/g,"%20"))}function fE(n){return`${Ug(n.path)}${function h9(n){return Object.keys(n).map(e=>`;${Ug(e)}=${Ug(n[e])}`).join("")}(n.parameters)}`}const p9=/^[^\/()?;=#]+/;function fh(n){const e=n.match(p9);return e?e[0]:""}const g9=/^[^=?&#]+/,v9=/^[^&#]+/;class b9{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new _n([],{}):new _n([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(r[yn]=new _n(e,t)),r}parseSegment(){const e=fh(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(e),new Vu(ch(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=fh(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const i=fh(this.remaining);i&&(r=i,this.capture(r))}e[ch(t)]=ch(r)}parseQueryParam(e){const t=function m9(n){const e=n.match(g9);return e?e[0]:""}(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const h=function y9(n){const e=n.match(v9);return e?e[0]:""}(this.remaining);h&&(r=h,this.capture(r))}const i=cE(t),a=cE(r);if(e.hasOwnProperty(i)){let h=e[i];Array.isArray(h)||(h=[h],e[i]=h),h.push(a)}else e[i]=a}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=fh(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let a;r.indexOf(":")>-1?(a=r.substr(0,r.indexOf(":")),this.capture(a),this.capture(":")):e&&(a=yn);const h=this.parseChildren();t[a]=1===Object.keys(h).length?h[yn]:new _n([],h),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new Error(`Expected "${e}".`)}}class hE{constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=Hg(e,this._root);return t?t.children.map(r=>r.value):[]}firstChild(e){const t=Hg(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=Vg(e,this._root);return t.length<2?[]:t[t.length-2].children.map(i=>i.value).filter(i=>i!==e)}pathFromRoot(e){return Vg(e,this._root).map(t=>t.value)}}function Hg(n,e){if(n===e.value)return e;for(const t of e.children){const r=Hg(n,t);if(r)return r}return null}function Vg(n,e){if(n===e.value)return[e];for(const t of e.children){const r=Vg(n,t);if(r.length)return r.unshift(e),r}return[]}class os{constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function _l(n){const e={};return n&&n.children.forEach(t=>e[t.value.outlet]=t),e}class dE extends hE{constructor(e,t){super(e),this.snapshot=t,jg(this,e)}toString(){return this.snapshot.toString()}}function pE(n,e){const t=function _9(n,e){const h=new hh([],{},{},"",{},yn,e,null,n.root,-1,{});return new mE("",new os(h,[]))}(n,e),r=new Vi([new Vu("",{})]),i=new Vi({}),a=new Vi({}),h=new Vi({}),v=new Vi(""),D=new wl(r,i,h,v,a,yn,e,t.root);return D.snapshot=t.root,new dE(new os(D,[]),t)}class wl{constructor(e,t,r,i,a,h,v,D){this.url=e,this.params=t,this.queryParams=r,this.fragment=i,this.data=a,this.outlet=h,this.component=v,this._futureSnapshot=D}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(u(e=>bl(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(u(e=>bl(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function gE(n,e="emptyOnly"){const t=n.pathFromRoot;let r=0;if("always"!==e)for(r=t.length-1;r>=1;){const i=t[r],a=t[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(a.component)break;r--}}return function w9(n){return n.reduce((e,t)=>({params:Object.assign(Object.assign({},e.params),t.params),data:Object.assign(Object.assign({},e.data),t.data),resolve:Object.assign(Object.assign({},e.resolve),t._resolvedData)}),{params:{},data:{},resolve:{}})}(t.slice(r))}class hh{constructor(e,t,r,i,a,h,v,D,L,j,Q){this.url=e,this.params=t,this.queryParams=r,this.fragment=i,this.data=a,this.outlet=h,this.component=v,this.routeConfig=D,this._urlSegment=L,this._lastPathIndex=j,this._resolve=Q}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=bl(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=bl(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class mE extends hE{constructor(e,t){super(t),this.url=e,jg(this,t)}toString(){return vE(this._root)}}function jg(n,e){e.value._routerState=n,e.children.forEach(t=>jg(n,t))}function vE(n){const e=n.children.length>0?` { ${n.children.map(vE).join(", ")} } `:"";return`${n.value}${e}`}function $g(n){if(n.snapshot){const e=n.snapshot,t=n._futureSnapshot;n.snapshot=t,Bo(e.queryParams,t.queryParams)||n.queryParams.next(t.queryParams),e.fragment!==t.fragment&&n.fragment.next(t.fragment),Bo(e.params,t.params)||n.params.next(t.params),function r9(n,e){if(n.length!==e.length)return!1;for(let t=0;tBo(t.parameters,e[r].parameters))}(n.url,e.url);return t&&!(!n.parent!=!e.parent)&&(!n.parent||zg(n.parent,e.parent))}function $u(n,e,t){if(t&&n.shouldReuseRoute(e.value,t.value.snapshot)){const r=t.value;r._futureSnapshot=e.value;const i=function E9(n,e,t){return e.children.map(r=>{for(const i of t.children)if(n.shouldReuseRoute(r.value,i.value.snapshot))return $u(n,r,i);return $u(n,r)})}(n,e,t);return new os(r,i)}{if(n.shouldAttach(e.value)){const a=n.retrieve(e.value);if(null!==a){const h=a.route;return h.value._futureSnapshot=e.value,h.children=e.children.map(v=>$u(n,v)),h}}const r=function x9(n){return new wl(new Vi(n.url),new Vi(n.params),new Vi(n.queryParams),new Vi(n.fragment),new Vi(n.data),n.outlet,n.component,n)}(e.value),i=e.children.map(a=>$u(n,a));return new os(r,i)}}function dh(n){return"object"==typeof n&&null!=n&&!n.outlets&&!n.segmentPath}function zu(n){return"object"==typeof n&&null!=n&&n.outlets}function Gg(n,e,t,r,i){let a={};if(r&&$r(r,(v,D)=>{a[D]=Array.isArray(v)?v.map(L=>`${L}`):`${v}`}),n===e)return new oa(t,a,i);const h=yE(n,e,t);return new oa(h,a,i)}function yE(n,e,t){const r={};return $r(n.children,(i,a)=>{r[a]=i===e?t:yE(i,e,t)}),new _n(n.segments,r)}class bE{constructor(e,t,r){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=r,e&&r.length>0&&dh(r[0]))throw new Error("Root segment cannot have matrix parameters");const i=r.find(zu);if(i&&i!==tE(r))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Kg{constructor(e,t,r){this.segmentGroup=e,this.processChildren=t,this.index=r}}function _E(n,e,t){if(n||(n=new _n([],{})),0===n.segments.length&&n.hasChildren())return ph(n,e,t);const r=function I9(n,e,t){let r=0,i=e;const a={match:!1,pathIndex:0,commandIndex:0};for(;i=t.length)return a;const h=n.segments[i],v=t[r];if(zu(v))break;const D=`${v}`,L=r0&&void 0===D)break;if(D&&L&&"object"==typeof L&&void 0===L.outlets){if(!ME(D,L,h))return a;r+=2}else{if(!ME(D,{},h))return a;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(n,e,t),i=t.slice(r.commandIndex);if(r.match&&r.pathIndex{"string"==typeof a&&(a=[a]),null!==a&&(i[h]=_E(n.children[h],e,a))}),$r(n.children,(a,h)=>{void 0===r[h]&&(i[h]=a)}),new _n(n.segments,i)}}function qg(n,e,t){const r=n.segments.slice(0,e);let i=0;for(;i{"string"==typeof t&&(t=[t]),null!==t&&(e[r]=qg(new _n([],{}),0,t))}),e}function wE(n){const e={};return $r(n,(t,r)=>e[r]=`${t}`),e}function ME(n,e,t){return n==t.path&&Bo(e,t.parameters)}class P9{constructor(e,t,r,i){this.routeReuseStrategy=e,this.futureState=t,this.currState=r,this.forwardEvent=i}activate(e){const t=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,r,e),$g(this.futureState.root),this.activateChildRoutes(t,r,e)}deactivateChildRoutes(e,t,r){const i=_l(t);e.children.forEach(a=>{const h=a.value.outlet;this.deactivateRoutes(a,i[h],r),delete i[h]}),$r(i,(a,h)=>{this.deactivateRouteAndItsChildren(a,r)})}deactivateRoutes(e,t,r){const i=e.value,a=t?t.value:null;if(i===a)if(i.component){const h=r.getContext(i.outlet);h&&this.deactivateChildRoutes(e,t,h.children)}else this.deactivateChildRoutes(e,t,r);else a&&this.deactivateRouteAndItsChildren(t,r)}deactivateRouteAndItsChildren(e,t){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const r=t.getContext(e.value.outlet),i=r&&e.value.component?r.children:t,a=_l(e);for(const h of Object.keys(a))this.deactivateRouteAndItsChildren(a[h],i);if(r&&r.outlet){const h=r.outlet.detach(),v=r.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:h,route:e,contexts:v})}}deactivateRouteAndOutlet(e,t){const r=t.getContext(e.value.outlet),i=r&&e.value.component?r.children:t,a=_l(e);for(const h of Object.keys(a))this.deactivateRouteAndItsChildren(a[h],i);r&&r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated(),r.attachRef=null,r.resolver=null,r.route=null)}activateChildRoutes(e,t,r){const i=_l(t);e.children.forEach(a=>{this.activateRoutes(a,i[a.value.outlet],r),this.forwardEvent(new JP(a.value.snapshot))}),e.children.length&&this.forwardEvent(new YP(e.value.snapshot))}activateRoutes(e,t,r){const i=e.value,a=t?t.value:null;if($g(i),i===a)if(i.component){const h=r.getOrCreateContext(i.outlet);this.activateChildRoutes(e,t,h.children)}else this.activateChildRoutes(e,t,r);else if(i.component){const h=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const v=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),h.children.onOutletReAttached(v.contexts),h.attachRef=v.componentRef,h.route=v.route.value,h.outlet&&h.outlet.attach(v.componentRef,v.route.value),$g(v.route.value),this.activateChildRoutes(e,null,h.children)}else{const v=function N9(n){for(let e=n.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig;if(t&&t.component)return null}return null}(i.snapshot),D=v?v.module.componentFactoryResolver:null;h.attachRef=null,h.route=i,h.resolver=D,h.outlet&&h.outlet.activateWith(i,D),this.activateChildRoutes(e,null,h.children)}}else this.activateChildRoutes(e,null,r)}}class Wg{constructor(e,t){this.routes=e,this.module=t}}function Ts(n){return"function"==typeof n}function aa(n){return n instanceof oa}const Gu=Symbol("INITIAL_VALUE");function Ku(){return Cs(n=>function pP(...n){let e,t;return c(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&M(n[0])&&(n=n[0]),wt(n,t).lift(new gP(e))}(n.map(e=>e.pipe(sh(1),function xP(...n){const e=n[n.length-1];return c(e)?(n.pop(),t=>kg(n,t,e)):t=>kg(n,t)}(Gu)))).pipe(GM((e,t)=>{let r=!1;return t.reduce((i,a,h)=>i!==Gu?i:(a===Gu&&(r=!0),r||!1!==a&&h!==t.length-1&&!aa(a)?i:a),e)},Gu),rs(e=>e!==Gu),u(e=>aa(e)?e:!0===e),sh(1)))}class H9{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new qu,this.attachRef=null}}class qu{constructor(){this.contexts=new Map}onChildOutletCreated(e,t){const r=this.getOrCreateContext(e);r.outlet=t,this.contexts.set(e,r)}onChildOutletDestroyed(e){const t=this.getContext(e);t&&(t.outlet=null,t.attachRef=null)}onOutletDeactivated(){const e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let t=this.getContext(e);return t||(t=new H9,this.contexts.set(e,t)),t}getContext(e){return this.contexts.get(e)||null}}let Zg=(()=>{class n{constructor(t,r,i,a,h){this.parentContexts=t,this.location=r,this.resolver=i,this.changeDetector=h,this.activated=null,this._activatedRoute=null,this.activateEvents=new vn,this.deactivateEvents=new vn,this.attachEvents=new vn,this.detachEvents=new vn,this.name=a||yn,t.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,r){this.activated=t,this._activatedRoute=r,this.location.insert(t.hostView),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,r){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;const h=(r=r||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),v=this.parentContexts.getOrCreateContext(this.name).children,D=new V9(t,v,this.location.injector);this.activated=this.location.createComponent(h,this.location.length,D),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return n.\u0275fac=function(t){return new(t||n)(ot(qu),ot(uo),ot(Ys),function ql(n){return function RC(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const r=t.length;let i=0;for(;i{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Un({type:n,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,r){1&t&&Bt(0,"router-outlet")},directives:[Zg],encapsulation:2}),n})();function xE(n,e=""){for(let t=0;tji(r)===e);return t.push(...n.filter(r=>ji(r)!==e)),t}const CE={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function gh(n,e,t){var r;if(""===e.path)return"full"===e.pathMatch&&(n.hasChildren()||t.length>0)?Object.assign({},CE):{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};const a=(e.matcher||n9)(t,n,e);if(!a)return Object.assign({},CE);const h={};$r(a.posParams,(D,L)=>{h[L]=D.path});const v=a.consumed.length>0?Object.assign(Object.assign({},h),a.consumed[a.consumed.length-1].parameters):h;return{matched:!0,consumedSegments:a.consumed,remainingSegments:t.slice(a.consumed.length),parameters:v,positionalParamSegments:null!==(r=a.posParams)&&void 0!==r?r:{}}}function mh(n,e,t,r,i="corrected"){if(t.length>0&&function K9(n,e,t){return t.some(r=>vh(n,e,r)&&ji(r)!==yn)}(n,t,r)){const h=new _n(e,function G9(n,e,t,r){const i={};i[yn]=r,r._sourceSegment=n,r._segmentIndexShift=e.length;for(const a of t)if(""===a.path&&ji(a)!==yn){const h=new _n([],{});h._sourceSegment=n,h._segmentIndexShift=e.length,i[ji(a)]=h}return i}(n,e,r,new _n(t,n.children)));return h._sourceSegment=n,h._segmentIndexShift=e.length,{segmentGroup:h,slicedSegments:[]}}if(0===t.length&&function q9(n,e,t){return t.some(r=>vh(n,e,r))}(n,t,r)){const h=new _n(n.segments,function z9(n,e,t,r,i,a){const h={};for(const v of r)if(vh(n,t,v)&&!i[ji(v)]){const D=new _n([],{});D._sourceSegment=n,D._segmentIndexShift="legacy"===a?n.segments.length:e.length,h[ji(v)]=D}return Object.assign(Object.assign({},i),h)}(n,e,t,r,n.children,i));return h._sourceSegment=n,h._segmentIndexShift=e.length,{segmentGroup:h,slicedSegments:t}}const a=new _n(n.segments,n.children);return a._sourceSegment=n,a._segmentIndexShift=e.length,{segmentGroup:a,slicedSegments:t}}function vh(n,e,t){return(!(n.hasChildren()||e.length>0)||"full"!==t.pathMatch)&&""===t.path}function AE(n,e,t,r){return!!(ji(n)===r||r!==yn&&vh(e,t,n))&&("**"===n.path||gh(e,n,t).matched)}function TE(n,e,t){return 0===e.length&&!n.children[t]}class yh{constructor(e){this.segmentGroup=e||null}}class DE{constructor(e){this.urlTree=e}}function Wu(n){return rh(new yh(n))}function IE(n){return rh(new DE(n))}function W9(n){return rh(new Error(`Only absolute redirects can have named outlets. redirectTo: '${n}'`))}class Y9{constructor(e,t,r,i,a){this.configLoader=t,this.urlSerializer=r,this.urlTree=i,this.config=a,this.allowRedirects=!0,this.ngModule=e.get(Yo)}apply(){const e=mh(this.urlTree.root,[],[],this.config).segmentGroup,t=new _n(e.segments,e.children);return this.expandSegmentGroup(this.ngModule,this.config,t,yn).pipe(u(a=>this.createUrlTree(Yg(a),this.urlTree.queryParams,this.urlTree.fragment))).pipe(ia(a=>{if(a instanceof DE)return this.allowRedirects=!1,this.match(a.urlTree);throw a instanceof yh?this.noMatchError(a):a}))}match(e){return this.expandSegmentGroup(this.ngModule,this.config,e.root,yn).pipe(u(i=>this.createUrlTree(Yg(i),e.queryParams,e.fragment))).pipe(ia(i=>{throw i instanceof yh?this.noMatchError(i):i}))}noMatchError(e){return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`)}createUrlTree(e,t,r){const i=e.segments.length>0?new _n([],{[yn]:e}):e;return new oa(i,t,r)}expandSegmentGroup(e,t,r,i){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(e,t,r).pipe(u(a=>new _n([],a))):this.expandSegment(e,r,t,r.segments,i,!0)}expandChildren(e,t,r){const i=[];for(const a of Object.keys(r.children))"primary"===a?i.unshift(a):i.push(a);return Me(i).pipe(vl(a=>{const h=r.children[a],v=SE(t,a);return this.expandSegmentGroup(e,v,h,a).pipe(u(D=>({segment:D,outlet:a})))}),GM((a,h)=>(a[h.outlet]=h.segment,a),{}),function FP(n,e){const t=arguments.length>=2;return r=>r.pipe(n?rs((i,a)=>n(i,a,r)):G,Bg(1),t?qM(e):KM(()=>new ih))}())}expandSegment(e,t,r,i,a,h){return Me(r).pipe(vl(v=>this.expandSegmentAgainstRoute(e,t,r,v,i,a,h).pipe(ia(L=>{if(L instanceof yh)return tn(null);throw L}))),fi(v=>!!v),ia((v,D)=>{if(v instanceof ih||"EmptyError"===v.name)return TE(t,i,a)?tn(new _n([],{})):Wu(t);throw v}))}expandSegmentAgainstRoute(e,t,r,i,a,h,v){return AE(i,t,a,h)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(e,t,i,a,h):v&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,r,i,a,h):Wu(t):Wu(t)}expandSegmentAgainstRouteUsingRedirect(e,t,r,i,a,h){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,r,i,h):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,r,i,a,h)}expandWildCardWithParamsAgainstRouteUsingRedirect(e,t,r,i){const a=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?IE(a):this.lineralizeSegments(r,a).pipe(xe(h=>{const v=new _n(h,{});return this.expandSegment(e,v,t,h,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(e,t,r,i,a,h){const{matched:v,consumedSegments:D,remainingSegments:L,positionalParamSegments:j}=gh(t,i,a);if(!v)return Wu(t);const Q=this.applyRedirectCommands(D,i.redirectTo,j);return i.redirectTo.startsWith("/")?IE(Q):this.lineralizeSegments(i,Q).pipe(xe(me=>this.expandSegment(e,t,r,me.concat(L),h,!1)))}matchSegmentAgainstRoute(e,t,r,i,a){if("**"===r.path)return r.loadChildren?(r._loadedConfig?tn(r._loadedConfig):this.configLoader.load(e.injector,r)).pipe(u(Q=>(r._loadedConfig=Q,new _n(i,{})))):tn(new _n(i,{}));const{matched:h,consumedSegments:v,remainingSegments:D}=gh(t,r,i);return h?this.getChildConfig(e,r,i).pipe(xe(j=>{const Q=j.module,me=j.routes,{segmentGroup:ye,slicedSegments:Te}=mh(t,v,D,me),Ve=new _n(ye.segments,ye.children);if(0===Te.length&&Ve.hasChildren())return this.expandChildren(Q,me,Ve).pipe(u(_t=>new _n(v,_t)));if(0===me.length&&0===Te.length)return tn(new _n(v,{}));const je=ji(r)===a;return this.expandSegment(Q,Ve,me,Te,je?yn:a,!0).pipe(u(Ie=>new _n(v.concat(Ie.segments),Ie.children)))})):Wu(t)}getChildConfig(e,t,r){return t.children?tn(new Wg(t.children,e)):t.loadChildren?void 0!==t._loadedConfig?tn(t._loadedConfig):this.runCanLoadGuards(e.injector,t,r).pipe(xe(i=>i?this.configLoader.load(e.injector,t).pipe(u(a=>(t._loadedConfig=a,a))):function Z9(n){return rh(Fg(`Cannot load children because the guard of the route "path: '${n.path}'" returned false`))}(t))):tn(new Wg([],e))}runCanLoadGuards(e,t,r){const i=t.canLoad;if(!i||0===i.length)return tn(!0);const a=i.map(h=>{const v=e.get(h);let D;if(function B9(n){return n&&Ts(n.canLoad)}(v))D=v.canLoad(t,r);else{if(!Ts(v))throw new Error("Invalid CanLoad guard");D=v(t,r)}return Lo(D)});return tn(a).pipe(Ku(),Ti(h=>{if(!aa(h))return;const v=Fg(`Redirecting to "${this.urlSerializer.serialize(h)}"`);throw v.url=h,v}),u(h=>!0===h))}lineralizeSegments(e,t){let r=[],i=t.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return tn(r);if(i.numberOfChildren>1||!i.children[yn])return W9(e.redirectTo);i=i.children[yn]}}applyRedirectCommands(e,t,r){return this.applyRedirectCreatreUrlTree(t,this.urlSerializer.parse(t),e,r)}applyRedirectCreatreUrlTree(e,t,r,i){const a=this.createSegmentGroup(e,t.root,r,i);return new oa(a,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const r={};return $r(e,(i,a)=>{if("string"==typeof i&&i.startsWith(":")){const v=i.substring(1);r[a]=t[v]}else r[a]=i}),r}createSegmentGroup(e,t,r,i){const a=this.createSegments(e,t.segments,r,i);let h={};return $r(t.children,(v,D)=>{h[D]=this.createSegmentGroup(e,v,r,i)}),new _n(a,h)}createSegments(e,t,r,i){return t.map(a=>a.path.startsWith(":")?this.findPosParam(e,a,i):this.findOrReturn(a,r))}findPosParam(e,t,r){const i=r[t.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${e}'. Cannot find '${t.path}'.`);return i}findOrReturn(e,t){let r=0;for(const i of t){if(i.path===e.path)return t.splice(r),i;r++}return e}}function Yg(n){const e={};for(const r of Object.keys(n.children)){const a=Yg(n.children[r]);(a.segments.length>0||a.hasChildren())&&(e[r]=a)}return function Q9(n){if(1===n.numberOfChildren&&n.children[yn]){const e=n.children[yn];return new _n(n.segments.concat(e.segments),e.children)}return n}(new _n(n.segments,e))}class RE{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class bh{constructor(e,t){this.component=e,this.route=t}}function eN(n,e,t){const r=n._root;return Zu(r,e?e._root:null,t,[r.value])}function _h(n,e,t){const r=function nN(n){if(!n)return null;for(let e=n.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(e);return(r?r.module.injector:t).get(n)}function Zu(n,e,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const a=_l(e);return n.children.forEach(h=>{(function rN(n,e,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const a=n.value,h=e?e.value:null,v=t?t.getContext(n.value.outlet):null;if(h&&a.routeConfig===h.routeConfig){const D=function iN(n,e,t){if("function"==typeof t)return t(n,e);switch(t){case"pathParamsChange":return!sa(n.url,e.url);case"pathParamsOrQueryParamsChange":return!sa(n.url,e.url)||!Bo(n.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!zg(n,e)||!Bo(n.queryParams,e.queryParams);default:return!zg(n,e)}}(h,a,a.routeConfig.runGuardsAndResolvers);D?i.canActivateChecks.push(new RE(r)):(a.data=h.data,a._resolvedData=h._resolvedData),Zu(n,e,a.component?v?v.children:null:t,r,i),D&&v&&v.outlet&&v.outlet.isActivated&&i.canDeactivateChecks.push(new bh(v.outlet.component,h))}else h&&Xu(e,v,i),i.canActivateChecks.push(new RE(r)),Zu(n,null,a.component?v?v.children:null:t,r,i)})(h,a[h.value.outlet],t,r.concat([h.value]),i),delete a[h.value.outlet]}),$r(a,(h,v)=>Xu(h,t.getContext(v),i)),i}function Xu(n,e,t){const r=_l(n),i=n.value;$r(r,(a,h)=>{Xu(a,i.component?e?e.children.getContext(h):null:e,t)}),t.canDeactivateChecks.push(new bh(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))}class dN{}function OE(n){return new Z(e=>e.error(n))}class gN{constructor(e,t,r,i,a,h){this.rootComponentType=e,this.config=t,this.urlTree=r,this.url=i,this.paramsInheritanceStrategy=a,this.relativeLinkResolution=h}recognize(){const e=mh(this.urlTree.root,[],[],this.config.filter(h=>void 0===h.redirectTo),this.relativeLinkResolution).segmentGroup,t=this.processSegmentGroup(this.config,e,yn);if(null===t)return null;const r=new hh([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},yn,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new os(r,t),a=new mE(this.url,i);return this.inheritParamsAndData(a._root),a}inheritParamsAndData(e){const t=e.value,r=gE(t,this.paramsInheritanceStrategy);t.params=Object.freeze(r.params),t.data=Object.freeze(r.data),e.children.forEach(i=>this.inheritParamsAndData(i))}processSegmentGroup(e,t,r){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t):this.processSegment(e,t,t.segments,r)}processChildren(e,t){const r=[];for(const a of Object.keys(t.children)){const h=t.children[a],v=SE(e,a),D=this.processSegmentGroup(v,h,a);if(null===D)return null;r.push(...D)}const i=PE(r);return function mN(n){n.sort((e,t)=>e.value.outlet===yn?-1:t.value.outlet===yn?1:e.value.outlet.localeCompare(t.value.outlet))}(i),i}processSegment(e,t,r,i){for(const a of e){const h=this.processSegmentAgainstRoute(a,t,r,i);if(null!==h)return h}return TE(t,r,i)?[]:null}processSegmentAgainstRoute(e,t,r,i){if(e.redirectTo||!AE(e,t,r,i))return null;let a,h=[],v=[];if("**"===e.path){const ye=r.length>0?tE(r).parameters:{};a=new hh(r,ye,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,BE(e),ji(e),e.component,e,NE(t),kE(t)+r.length,LE(e))}else{const ye=gh(t,e,r);if(!ye.matched)return null;h=ye.consumedSegments,v=ye.remainingSegments,a=new hh(h,ye.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,BE(e),ji(e),e.component,e,NE(t),kE(t)+h.length,LE(e))}const D=function vN(n){return n.children?n.children:n.loadChildren?n._loadedConfig.routes:[]}(e),{segmentGroup:L,slicedSegments:j}=mh(t,h,v,D.filter(ye=>void 0===ye.redirectTo),this.relativeLinkResolution);if(0===j.length&&L.hasChildren()){const ye=this.processChildren(D,L);return null===ye?null:[new os(a,ye)]}if(0===D.length&&0===j.length)return[new os(a,[])];const Q=ji(e)===i,me=this.processSegment(D,L,j,Q?yn:i);return null===me?null:[new os(a,me)]}}function yN(n){const e=n.value.routeConfig;return e&&""===e.path&&void 0===e.redirectTo}function PE(n){const e=[],t=new Set;for(const r of n){if(!yN(r)){e.push(r);continue}const i=e.find(a=>r.value.routeConfig===a.value.routeConfig);void 0!==i?(i.children.push(...r.children),t.add(i)):e.push(r)}for(const r of t){const i=PE(r.children);e.push(new os(r.value,i))}return e.filter(r=>!t.has(r))}function NE(n){let e=n;for(;e._sourceSegment;)e=e._sourceSegment;return e}function kE(n){let e=n,t=e._segmentIndexShift?e._segmentIndexShift:0;for(;e._sourceSegment;)e=e._sourceSegment,t+=e._segmentIndexShift?e._segmentIndexShift:0;return t-1}function BE(n){return n.data||{}}function LE(n){return n.resolve||{}}function FE(n){return[...Object.keys(n),...Object.getOwnPropertySymbols(n)]}function Qg(n){return Cs(e=>{const t=n(e);return t?Me(t).pipe(u(()=>e)):tn(e)})}class CN extends class SN{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}{}const Jg=new Kt("ROUTES");class UE{constructor(e,t,r,i){this.injector=e,this.compiler=t,this.onLoadStartListener=r,this.onLoadEndListener=i}load(e,t){if(t._loader$)return t._loader$;this.onLoadStartListener&&this.onLoadStartListener(t);const i=this.loadModuleFactory(t.loadChildren).pipe(u(a=>{this.onLoadEndListener&&this.onLoadEndListener(t);const h=a.create(e);return new Wg(eE(h.injector.get(Jg,void 0,en.Self|en.Optional)).map(Xg),h)}),ia(a=>{throw t._loader$=void 0,a}));return t._loader$=new de(i,()=>new o).pipe(oe()),t._loader$}loadModuleFactory(e){return Lo(e()).pipe(xe(t=>t instanceof Tw?tn(t):Me(this.compiler.compileModuleAsync(t))))}}class TN{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,t){return e}}function DN(n){throw n}function IN(n,e,t){return e.parse("/")}function HE(n,e){return tn(null)}const RN={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},ON={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let hi=(()=>{class n{constructor(t,r,i,a,h,v,D){this.rootComponentType=t,this.urlSerializer=r,this.rootContexts=i,this.location=a,this.config=D,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new o,this.errorHandler=DN,this.malformedUriErrorHandler=IN,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:HE,afterPreactivation:HE},this.urlHandlingStrategy=new TN,this.routeReuseStrategy=new CN,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.ngModule=h.get(Yo),this.console=h.get(aI);const Q=h.get(or);this.isNgZoneEnabled=Q instanceof or&&or.isInAngularZone(),this.resetConfig(D),this.currentUrlTree=function i9(){return new oa(new _n([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new UE(h,v,me=>this.triggerEvent(new ZM(me)),me=>this.triggerEvent(new XM(me))),this.routerState=pE(this.currentUrlTree,this.rootComponentType),this.transitions=new Vi({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){var t;return null===(t=this.location.getState())||void 0===t?void 0:t.\u0275routerPageId}setupNavigations(t){const r=this.events;return t.pipe(rs(i=>0!==i.id),u(i=>Object.assign(Object.assign({},i),{extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),Cs(i=>{let a=!1,h=!1;return tn(i).pipe(Ti(v=>{this.currentNavigation={id:v.id,initialUrl:v.currentRawUrl,extractedUrl:v.extractedUrl,trigger:v.source,extras:v.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Cs(v=>{const D=this.browserUrlTree.toString(),L=!this.navigated||v.extractedUrl.toString()!==D||D!==this.currentUrlTree.toString();if(("reload"===this.onSameUrlNavigation||L)&&this.urlHandlingStrategy.shouldProcessUrl(v.rawUrl))return VE(v.source)&&(this.browserUrlTree=v.extractedUrl),tn(v).pipe(Cs(Q=>{const me=this.transitions.getValue();return r.next(new Lg(Q.id,this.serializeUrl(Q.extractedUrl),Q.source,Q.restoredState)),me!==this.transitions.getValue()?ml:Promise.resolve(Q)}),function J9(n,e,t,r){return Cs(i=>function X9(n,e,t,r,i){return new Y9(n,e,t,r,i).apply()}(n,e,t,i.extractedUrl,r).pipe(u(a=>Object.assign(Object.assign({},i),{urlAfterRedirects:a}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),Ti(Q=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:Q.urlAfterRedirects})}),function bN(n,e,t,r,i){return xe(a=>function pN(n,e,t,r,i="emptyOnly",a="legacy"){try{const h=new gN(n,e,t,r,i,a).recognize();return null===h?OE(new dN):tn(h)}catch(h){return OE(h)}}(n,e,a.urlAfterRedirects,t(a.urlAfterRedirects),r,i).pipe(u(h=>Object.assign(Object.assign({},a),{targetSnapshot:h}))))}(this.rootComponentType,this.config,Q=>this.serializeUrl(Q),this.paramsInheritanceStrategy,this.relativeLinkResolution),Ti(Q=>{if("eager"===this.urlUpdateStrategy){if(!Q.extras.skipLocationChange){const ye=this.urlHandlingStrategy.merge(Q.urlAfterRedirects,Q.rawUrl);this.setBrowserUrl(ye,Q)}this.browserUrlTree=Q.urlAfterRedirects}const me=new GP(Q.id,this.serializeUrl(Q.extractedUrl),this.serializeUrl(Q.urlAfterRedirects),Q.targetSnapshot);r.next(me)}));if(L&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:me,extractedUrl:ye,source:Te,restoredState:Ve,extras:je}=v,gt=new Lg(me,this.serializeUrl(ye),Te,Ve);r.next(gt);const Ie=pE(ye,this.rootComponentType).snapshot;return tn(Object.assign(Object.assign({},v),{targetSnapshot:Ie,urlAfterRedirects:ye,extras:Object.assign(Object.assign({},je),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=v.rawUrl,v.resolve(null),ml}),Qg(v=>{const{targetSnapshot:D,id:L,extractedUrl:j,rawUrl:Q,extras:{skipLocationChange:me,replaceUrl:ye}}=v;return this.hooks.beforePreactivation(D,{navigationId:L,appliedUrlTree:j,rawUrlTree:Q,skipLocationChange:!!me,replaceUrl:!!ye})}),Ti(v=>{const D=new KP(v.id,this.serializeUrl(v.extractedUrl),this.serializeUrl(v.urlAfterRedirects),v.targetSnapshot);this.triggerEvent(D)}),u(v=>Object.assign(Object.assign({},v),{guards:eN(v.targetSnapshot,v.currentSnapshot,this.rootContexts)})),function oN(n,e){return xe(t=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:a,canDeactivateChecks:h}}=t;return 0===h.length&&0===a.length?tn(Object.assign(Object.assign({},t),{guardsResult:!0})):function sN(n,e,t,r){return Me(n).pipe(xe(i=>function hN(n,e,t,r,i){const a=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return a&&0!==a.length?tn(a.map(v=>{const D=_h(v,e,i);let L;if(function U9(n){return n&&Ts(n.canDeactivate)}(D))L=Lo(D.canDeactivate(n,e,t,r));else{if(!Ts(D))throw new Error("Invalid CanDeactivate guard");L=Lo(D(n,e,t,r))}return L.pipe(fi())})).pipe(Ku()):tn(!0)}(i.component,i.route,t,e,r)),fi(i=>!0!==i,!0))}(h,r,i,n).pipe(xe(v=>v&&function k9(n){return"boolean"==typeof n}(v)?function aN(n,e,t,r){return Me(e).pipe(vl(i=>kg(function uN(n,e){return null!==n&&e&&e(new XP(n)),tn(!0)}(i.route.parent,r),function lN(n,e){return null!==n&&e&&e(new QP(n)),tn(!0)}(i.route,r),function fN(n,e,t){const r=e[e.length-1],a=e.slice(0,e.length-1).reverse().map(h=>function tN(n){const e=n.routeConfig?n.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:n,guards:e}:null}(h)).filter(h=>null!==h).map(h=>$M(()=>tn(h.guards.map(D=>{const L=_h(D,h.node,t);let j;if(function F9(n){return n&&Ts(n.canActivateChild)}(L))j=Lo(L.canActivateChild(r,n));else{if(!Ts(L))throw new Error("Invalid CanActivateChild guard");j=Lo(L(r,n))}return j.pipe(fi())})).pipe(Ku())));return tn(a).pipe(Ku())}(n,i.path,t),function cN(n,e,t){const r=e.routeConfig?e.routeConfig.canActivate:null;if(!r||0===r.length)return tn(!0);const i=r.map(a=>$M(()=>{const h=_h(a,e,t);let v;if(function L9(n){return n&&Ts(n.canActivate)}(h))v=Lo(h.canActivate(e,n));else{if(!Ts(h))throw new Error("Invalid CanActivate guard");v=Lo(h(e,n))}return v.pipe(fi())}));return tn(i).pipe(Ku())}(n,i.route,t))),fi(i=>!0!==i,!0))}(r,a,n,e):tn(v)),u(v=>Object.assign(Object.assign({},t),{guardsResult:v})))})}(this.ngModule.injector,v=>this.triggerEvent(v)),Ti(v=>{if(aa(v.guardsResult)){const L=Fg(`Redirecting to "${this.serializeUrl(v.guardsResult)}"`);throw L.url=v.guardsResult,L}const D=new qP(v.id,this.serializeUrl(v.extractedUrl),this.serializeUrl(v.urlAfterRedirects),v.targetSnapshot,!!v.guardsResult);this.triggerEvent(D)}),rs(v=>!!v.guardsResult||(this.restoreHistory(v),this.cancelNavigationTransition(v,""),!1)),Qg(v=>{if(v.guards.canActivateChecks.length)return tn(v).pipe(Ti(D=>{const L=new WP(D.id,this.serializeUrl(D.extractedUrl),this.serializeUrl(D.urlAfterRedirects),D.targetSnapshot);this.triggerEvent(L)}),Cs(D=>{let L=!1;return tn(D).pipe(function _N(n,e){return xe(t=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=t;if(!i.length)return tn(t);let a=0;return Me(i).pipe(vl(h=>function wN(n,e,t,r){return function MN(n,e,t,r){const i=FE(n);if(0===i.length)return tn({});const a={};return Me(i).pipe(xe(h=>function EN(n,e,t,r){const i=_h(n,e,r);return Lo(i.resolve?i.resolve(e,t):i(e,t))}(n[h],e,t,r).pipe(Ti(v=>{a[h]=v}))),Bg(1),xe(()=>FE(a).length===i.length?tn(a):ml))}(n._resolve,n,e,r).pipe(u(a=>(n._resolvedData=a,n.data=Object.assign(Object.assign({},n.data),gE(n,t).resolve),null)))}(h.route,r,n,e)),Ti(()=>a++),Bg(1),xe(h=>a===i.length?tn(t):ml))})}(this.paramsInheritanceStrategy,this.ngModule.injector),Ti({next:()=>L=!0,complete:()=>{L||(this.restoreHistory(D),this.cancelNavigationTransition(D,"At least one route resolver didn't emit any value."))}}))}),Ti(D=>{const L=new ZP(D.id,this.serializeUrl(D.extractedUrl),this.serializeUrl(D.urlAfterRedirects),D.targetSnapshot);this.triggerEvent(L)}))}),Qg(v=>{const{targetSnapshot:D,id:L,extractedUrl:j,rawUrl:Q,extras:{skipLocationChange:me,replaceUrl:ye}}=v;return this.hooks.afterPreactivation(D,{navigationId:L,appliedUrlTree:j,rawUrlTree:Q,skipLocationChange:!!me,replaceUrl:!!ye})}),u(v=>{const D=function M9(n,e,t){const r=$u(n,e._root,t?t._root:void 0);return new dE(r,e)}(this.routeReuseStrategy,v.targetSnapshot,v.currentRouterState);return Object.assign(Object.assign({},v),{targetRouterState:D})}),Ti(v=>{this.currentUrlTree=v.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(v.urlAfterRedirects,v.rawUrl),this.routerState=v.targetRouterState,"deferred"===this.urlUpdateStrategy&&(v.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,v),this.browserUrlTree=v.urlAfterRedirects)}),((n,e,t)=>u(r=>(new P9(e,r.targetRouterState,r.currentRouterState,t).activate(n),r)))(this.rootContexts,this.routeReuseStrategy,v=>this.triggerEvent(v)),Ti({next(){a=!0},complete(){a=!0}}),function VP(n){return e=>e.lift(new jP(n))}(()=>{var v;a||h||this.cancelNavigationTransition(i,`Navigation ID ${i.id} is not equal to the current navigation id ${this.navigationId}`),(null===(v=this.currentNavigation)||void 0===v?void 0:v.id)===i.id&&(this.currentNavigation=null)}),ia(v=>{if(h=!0,function t9(n){return n&&n[QM]}(v)){const D=aa(v.url);D||(this.navigated=!0,this.restoreHistory(i,!0));const L=new WM(i.id,this.serializeUrl(i.extractedUrl),v.message);r.next(L),D?setTimeout(()=>{const j=this.urlHandlingStrategy.merge(v.url,this.rawUrlTree),Q={skipLocationChange:i.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||VE(i.source)};this.scheduleNavigation(j,"imperative",null,Q,{resolve:i.resolve,reject:i.reject,promise:i.promise})},0):i.resolve(!1)}else{this.restoreHistory(i,!0);const D=new zP(i.id,this.serializeUrl(i.extractedUrl),v);r.next(D);try{i.resolve(this.errorHandler(v))}catch(L){i.reject(L)}}return ml}))}))}resetRootComponentType(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType}setTransition(t){this.transitions.next(Object.assign(Object.assign({},this.transitions.value),t))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{const r="popstate"===t.type?"popstate":"hashchange";"popstate"===r&&setTimeout(()=>{var i;const a={replaceUrl:!0},h=(null===(i=t.state)||void 0===i?void 0:i.navigationId)?t.state:null;if(h){const D=Object.assign({},h);delete D.navigationId,delete D.\u0275routerPageId,0!==Object.keys(D).length&&(a.state=D)}const v=this.parseUrl(t.url);this.scheduleNavigation(v,r,h,a)},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(t){this.events.next(t)}resetConfig(t){xE(t),this.config=t.map(Xg),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(t,r={}){const{relativeTo:i,queryParams:a,fragment:h,queryParamsHandling:v,preserveFragment:D}=r,L=i||this.routerState.root,j=D?this.currentUrlTree.fragment:h;let Q=null;switch(v){case"merge":Q=Object.assign(Object.assign({},this.currentUrlTree.queryParams),a);break;case"preserve":Q=this.currentUrlTree.queryParams;break;default:Q=a||null}return null!==Q&&(Q=this.removeEmptyProps(Q)),function S9(n,e,t,r,i){if(0===t.length)return Gg(e.root,e.root,e.root,r,i);const a=function C9(n){if("string"==typeof n[0]&&1===n.length&&"/"===n[0])return new bE(!0,0,n);let e=0,t=!1;const r=n.reduce((i,a,h)=>{if("object"==typeof a&&null!=a){if(a.outlets){const v={};return $r(a.outlets,(D,L)=>{v[L]="string"==typeof D?D.split("/"):D}),[...i,{outlets:v}]}if(a.segmentPath)return[...i,a.segmentPath]}return"string"!=typeof a?[...i,a]:0===h?(a.split("/").forEach((v,D)=>{0==D&&"."===v||(0==D&&""===v?t=!0:".."===v?e++:""!=v&&i.push(v))}),i):[...i,a]},[]);return new bE(t,e,r)}(t);if(a.toRoot())return Gg(e.root,e.root,new _n([],{}),r,i);const h=function A9(n,e,t){if(n.isAbsolute)return new Kg(e.root,!0,0);if(-1===t.snapshot._lastPathIndex){const a=t.snapshot._urlSegment;return new Kg(a,a===e.root,0)}const r=dh(n.commands[0])?0:1;return function T9(n,e,t){let r=n,i=e,a=t;for(;a>i;){if(a-=i,r=r.parent,!r)throw new Error("Invalid number of '../'");i=r.segments.length}return new Kg(r,!1,i-a)}(t.snapshot._urlSegment,t.snapshot._lastPathIndex+r,n.numberOfDoubleDots)}(a,e,n),v=h.processChildren?ph(h.segmentGroup,h.index,a.commands):_E(h.segmentGroup,h.index,a.commands);return Gg(e.root,h.segmentGroup,v,r,i)}(L,this.currentUrlTree,t,Q,null!=j?j:null)}navigateByUrl(t,r={skipLocationChange:!1}){const i=aa(t)?t:this.parseUrl(t),a=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(a,"imperative",null,r)}navigate(t,r={skipLocationChange:!1}){return function PN(n){for(let e=0;e{const a=t[i];return null!=a&&(r[i]=a),r},{})}processNavigations(){this.navigations.subscribe(t=>{this.navigated=!0,this.lastSuccessfulId=t.id,this.currentPageId=t.targetPageId,this.events.next(new yl(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,t.resolve(!0)},t=>{this.console.warn(`Unhandled Navigation Error: ${t}`)})}scheduleNavigation(t,r,i,a,h){var v,D;if(this.disposed)return Promise.resolve(!1);let L,j,Q;h?(L=h.resolve,j=h.reject,Q=h.promise):Q=new Promise((Te,Ve)=>{L=Te,j=Ve});const me=++this.navigationId;let ye;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(i=this.location.getState()),ye=i&&i.\u0275routerPageId?i.\u0275routerPageId:a.replaceUrl||a.skipLocationChange?null!==(v=this.browserPageId)&&void 0!==v?v:0:(null!==(D=this.browserPageId)&&void 0!==D?D:0)+1):ye=0,this.setTransition({id:me,targetPageId:ye,source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:a,resolve:L,reject:j,promise:Q,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),Q.catch(Te=>Promise.reject(Te))}setBrowserUrl(t,r){const i=this.urlSerializer.serialize(t),a=Object.assign(Object.assign({},r.extras.state),this.generateNgRouterState(r.id,r.targetPageId));this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl?this.location.replaceState(i,"",a):this.location.go(i,"",a)}restoreHistory(t,r=!1){var i,a;if("computed"===this.canceledNavigationResolution){const h=this.currentPageId-t.targetPageId;"popstate"!==t.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==(null===(i=this.currentNavigation)||void 0===i?void 0:i.finalUrl)||0===h?this.currentUrlTree===(null===(a=this.currentNavigation)||void 0===a?void 0:a.finalUrl)&&0===h&&(this.resetState(t),this.browserUrlTree=t.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(h)}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(t),this.resetUrlToCurrentUrlTree())}resetState(t){this.routerState=t.currentRouterState,this.currentUrlTree=t.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(t,r){const i=new WM(t.id,this.serializeUrl(t.extractedUrl),r);this.triggerEvent(i),t.resolve(!1)}generateNgRouterState(t,r){return"computed"===this.canceledNavigationResolution?{navigationId:t,\u0275routerPageId:r}:{navigationId:t}}}return n.\u0275fac=function(t){up()},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();function VE(n){return"imperative"!==n}class jE{}class $E{preload(e,t){return tn(null)}}let zE=(()=>{class n{constructor(t,r,i,a){this.router=t,this.injector=i,this.preloadingStrategy=a,this.loader=new UE(i,r,D=>t.triggerEvent(new ZM(D)),D=>t.triggerEvent(new XM(D)))}setUpPreloading(){this.subscription=this.router.events.pipe(rs(t=>t instanceof yl),vl(()=>this.preload())).subscribe(()=>{})}preload(){const t=this.injector.get(Yo);return this.processRoutes(t,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,r){const i=[];for(const a of r)if(a.loadChildren&&!a.canLoad&&a._loadedConfig){const h=a._loadedConfig;i.push(this.processRoutes(h.module,h.routes))}else a.loadChildren&&!a.canLoad?i.push(this.preloadConfig(t,a)):a.children&&i.push(this.processRoutes(t,a.children));return Me(i).pipe(Oe(),u(a=>{}))}preloadConfig(t,r){return this.preloadingStrategy.preload(r,()=>(r._loadedConfig?tn(r._loadedConfig):this.loader.load(t.injector,r)).pipe(xe(a=>(r._loadedConfig=a,this.processRoutes(a.module,a.routes)))))}}return n.\u0275fac=function(t){return new(t||n)(Mt(hi),Mt(h2),Mt(Cr),Mt(jE))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),nm=(()=>{class n{constructor(t,r,i={}){this.router=t,this.viewportScroller=r,this.options=i,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},i.scrollPositionRestoration=i.scrollPositionRestoration||"disabled",i.anchorScrolling=i.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(t=>{t instanceof Lg?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof yl&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.router.parseUrl(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(t=>{t instanceof YM&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,r){this.router.triggerEvent(new YM(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,r))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return n.\u0275fac=function(t){up()},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const la=new Kt("ROUTER_CONFIGURATION"),GE=new Kt("ROUTER_FORROOT_GUARD"),LN=[tg,{provide:aE,useClass:lE},{provide:hi,useFactory:function jN(n,e,t,r,i,a,h={},v,D){const L=new hi(null,n,e,t,r,i,eE(a));return v&&(L.urlHandlingStrategy=v),D&&(L.routeReuseStrategy=D),function $N(n,e){n.errorHandler&&(e.errorHandler=n.errorHandler),n.malformedUriErrorHandler&&(e.malformedUriErrorHandler=n.malformedUriErrorHandler),n.onSameUrlNavigation&&(e.onSameUrlNavigation=n.onSameUrlNavigation),n.paramsInheritanceStrategy&&(e.paramsInheritanceStrategy=n.paramsInheritanceStrategy),n.relativeLinkResolution&&(e.relativeLinkResolution=n.relativeLinkResolution),n.urlUpdateStrategy&&(e.urlUpdateStrategy=n.urlUpdateStrategy),n.canceledNavigationResolution&&(e.canceledNavigationResolution=n.canceledNavigationResolution)}(h,L),h.enableTracing&&L.events.subscribe(j=>{var Q,me;null===(Q=console.group)||void 0===Q||Q.call(console,`Router Event: ${j.constructor.name}`),console.log(j.toString()),console.log(j),null===(me=console.groupEnd)||void 0===me||me.call(console)}),L},deps:[aE,qu,tg,Cr,h2,Jg,la,[class AN{},new _s],[class xN{},new _s]]},qu,{provide:wl,useFactory:function zN(n){return n.routerState.root},deps:[hi]},zE,$E,class BN{preload(e,t){return t().pipe(ia(()=>tn(null)))}},{provide:la,useValue:{enableTracing:!1}}];function FN(){return new v2("Router",hi)}let KE=(()=>{class n{constructor(t,r){}static forRoot(t,r){return{ngModule:n,providers:[LN,qE(t),{provide:GE,useFactory:VN,deps:[[hi,new _s,new eu]]},{provide:la,useValue:r||{}},{provide:dl,useFactory:HN,deps:[na,[new Wc(eg),new _s],la]},{provide:nm,useFactory:UN,deps:[hi,jO,la]},{provide:jE,useExisting:r&&r.preloadingStrategy?r.preloadingStrategy:$E},{provide:v2,multi:!0,useFactory:FN},[rm,{provide:Up,multi:!0,useFactory:GN,deps:[rm]},{provide:WE,useFactory:KN,deps:[rm]},{provide:f2,multi:!0,useExisting:WE}]]}}static forChild(t){return{ngModule:n,providers:[qE(t)]}}}return n.\u0275fac=function(t){return new(t||n)(Mt(GE,8),Mt(hi,8))},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})();function UN(n,e,t){return t.scrollOffset&&e.setOffset(t.scrollOffset),new nm(n,e,t)}function HN(n,e,t={}){return t.useHash?new JI(n,e):new B2(n,e)}function VN(n){return"guarded"}function qE(n){return[{provide:BC,multi:!0,useValue:n},{provide:Jg,multi:!0,useValue:n}]}let rm=(()=>{class n{constructor(t){this.injector=t,this.initNavigation=!1,this.destroyed=!1,this.resultOfPreactivationDone=new o}appInitializer(){return this.injector.get(XI,Promise.resolve(null)).then(()=>{if(this.destroyed)return Promise.resolve(!0);let r=null;const i=new Promise(v=>r=v),a=this.injector.get(hi),h=this.injector.get(la);return"disabled"===h.initialNavigation?(a.setUpLocationChangeListener(),r(!0)):"enabled"===h.initialNavigation||"enabledBlocking"===h.initialNavigation?(a.hooks.afterPreactivation=()=>this.initNavigation?tn(null):(this.initNavigation=!0,r(!0),this.resultOfPreactivationDone),a.initialNavigation()):r(!0),i})}bootstrapListener(t){const r=this.injector.get(la),i=this.injector.get(zE),a=this.injector.get(nm),h=this.injector.get(hi),v=this.injector.get(fl);t===v.components[0]&&(("enabledNonBlocking"===r.initialNavigation||void 0===r.initialNavigation)&&h.initialNavigation(),i.setUpPreloading(),a.init(),h.resetRootComponentType(v.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}ngOnDestroy(){this.destroyed=!0}}return n.\u0275fac=function(t){return new(t||n)(Mt(Cr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();function GN(n){return n.appInitializer.bind(n)}function KN(n){return n.bootstrapListener.bind(n)}const WE=new Kt("Router Initializer"),WN=[];let ZN=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[KE.forRoot(WN)],KE]}),n})();function ZE(n,e,t,r,i,a,h){try{var v=n[a](h),D=v.value}catch(L){return void t(L)}v.done?e(D):Promise.resolve(D).then(r,i)}function Ot(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function h(D){ZE(a,r,i,h,v,"next",D)}function v(D){ZE(a,r,i,h,v,"throw",D)}h(void 0)})}}var XN=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,im=Math.ceil,Fo=Math.floor,di="[BigNumber Error] ",XE=di+"Number primitive has more than 15 significant digits: ",po=1e14,om=9007199254740991,sm=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ds=1e7,Hr=1e9;function $i(n){var e=0|n;return n>0||n===e?e:e-1}function zi(n){for(var e,t,r=1,i=n.length,a=n[0]+"";rL^t?1:-1;for(v=(D=i.length)<(L=a.length)?D:L,h=0;ha[h]^t?1:-1;return D==L?0:D>L^t?1:-1}function cr(n,e,t,r){if(nt||n!==Fo(n))throw Error(di+(r||"Argument")+("number"==typeof n?nt?" out of range: ":" not an integer: ":" not a primitive number: ")+String(n))}function wh(n){var e=n.c.length-1;return $i(n.e/14)==e&&n.c[e]%2!=0}function Mh(n,e){return(n.length>1?n.charAt(0)+"."+n.slice(1):n)+(e<0?"e":"e+")+e}function ss(n,e,t){var r,i;if(e<0){for(i=t+".";++e;i+=t);n=i+n}else if(++e>(r=n.length)){for(i=t,e-=r;--e;i+=t);n+=i}else eQ?qe.c=qe.e=null:Se.e=10;vt/=10,st++);return void(st>Q?qe.c=qe.e=null:(qe.e=st,qe.c=[Se]))}Ke=String(Se)}else{if(!XN.test(Ke=String(Se)))return r(qe,Ke,Ze);qe.s=45==Ke.charCodeAt(0)?(Ke=Ke.slice(1),-1):1}(st=Ke.indexOf("."))>-1&&(Ke=Ke.replace(".","")),(vt=Ke.search(/e/i))>0?(st<0&&(st=vt),st+=+Ke.slice(vt+1),Ke=Ke.substring(0,vt)):st<0&&(st=Ke.length)}else{if(cr(De,2,je.length,"Base"),10==De&>)return Vt(qe=new Ie(Se),h+qe.e+1,v);if(Ke=String(Se),Ze="number"==typeof Se){if(0*Se!=0)return r(qe,Ke,Ze,De);if(qe.s=1/Se<0?(Ke=Ke.slice(1),-1):1,Ie.DEBUG&&Ke.replace(/^0\.0*|\./,"").length>15)throw Error(XE+Se)}else qe.s=45===Ke.charCodeAt(0)?(Ke=Ke.slice(1),-1):1;for(ke=je.slice(0,De),st=vt=0,Fe=Ke.length;vtst){st=Fe;continue}}else if(!Qe&&(Ke==Ke.toUpperCase()&&(Ke=Ke.toLowerCase())||Ke==Ke.toLowerCase()&&(Ke=Ke.toUpperCase()))){Qe=!0,vt=-1,st=0;continue}return r(qe,String(Se),Ze,De)}Ze=!1,(st=(Ke=t(Ke,De,10,qe.s)).indexOf("."))>-1?Ke=Ke.replace(".",""):st=Ke.length}for(vt=0;48===Ke.charCodeAt(vt);vt++);for(Fe=Ke.length;48===Ke.charCodeAt(--Fe););if(Ke=Ke.slice(vt,++Fe)){if(Fe-=vt,Ze&&Ie.DEBUG&&Fe>15&&(Se>om||Se!==Fo(Se)))throw Error(XE+qe.s*Se);if((st=st-vt-1)>Q)qe.c=qe.e=null;else if(st=L)?Mh(Fe,vt):ss(Fe,vt,"0");else if(st=(Se=Vt(new Ie(Se),De,ke)).e,Ze=(Fe=zi(Se.c)).length,1==dt||2==dt&&(De<=st||st<=D)){for(;ZeZe){if(--De>0)for(Fe+=".";De--;Fe+="0");}else if((De+=st-Ze)>0)for(st+1==Ze&&(Fe+=".");De--;Fe+="0");return Se.s<0&&Qe?"-"+Fe:Fe}function At(Se,De){for(var ke,dt=1,Qe=new Ie(Se[0]);dt=10;Qe/=10,dt++);return(ke=dt+14*ke-1)>Q?Se.c=Se.e=null:ke=10;Ze/=10,Qe++);if((st=De-Qe)<0)st+=14,qe=(Fe=yt[Ke=0])/Dt[Qe-(vt=De)-1]%10|0;else if((Ke=im((st+1)/14))>=yt.length){if(!dt)break e;for(;yt.length<=Ke;yt.push(0));Fe=qe=0,Qe=1,vt=(st%=14)-14+1}else{for(Fe=Ze=yt[Ke],Qe=1;Ze>=10;Ze/=10,Qe++);qe=(vt=(st%=14)-14+Qe)<0?0:Fe/Dt[Qe-vt-1]%10|0}if(dt=dt||De<0||null!=yt[Ke+1]||(vt<0?Fe:Fe%Dt[Qe-vt-1]),dt=ke<4?(qe||dt)&&(0==ke||ke==(Se.s<0?3:2)):qe>5||5==qe&&(4==ke||dt||6==ke&&(st>0?vt>0?Fe/Dt[Qe-vt]:0:yt[Ke-1])%10&1||ke==(Se.s<0?8:7)),De<1||!yt[0])return yt.length=0,dt?(yt[0]=Dt[(14-(De-=Se.e+1)%14)%14],Se.e=-De||0):yt[0]=Se.e=0,Se;if(0==st?(yt.length=Ke,Ze=1,Ke--):(yt.length=Ke+1,Ze=Dt[14-st],yt[Ke]=vt>0?Fo(Fe/Dt[Qe-vt]%Dt[vt])*Ze:0),dt)for(;;){if(0==Ke){for(st=1,vt=yt[0];vt>=10;vt/=10,st++);for(vt=yt[0]+=Ze,Ze=1;vt>=10;vt/=10,Ze++);st!=Ze&&(Se.e++,yt[0]==po&&(yt[0]=1));break}if(yt[Ke]+=Ze,yt[Ke]!=po)break;yt[Ke--]=0,Ze=1}for(st=yt.length;0===yt[--st];yt.pop());}Se.e>Q?Se.c=Se.e=null:Se.e=L?Mh(De,ke):ss(De,ke,"0"),Se.s<0?"-"+De:De)}return Ie.clone=YE,Ie.ROUND_UP=0,Ie.ROUND_DOWN=1,Ie.ROUND_CEIL=2,Ie.ROUND_FLOOR=3,Ie.ROUND_HALF_UP=4,Ie.ROUND_HALF_DOWN=5,Ie.ROUND_HALF_EVEN=6,Ie.ROUND_HALF_CEIL=7,Ie.ROUND_HALF_FLOOR=8,Ie.EUCLID=9,Ie.config=Ie.set=function(Se){var De,ke;if(null!=Se){if("object"!=typeof Se)throw Error(di+"Object expected: "+Se);if(Se.hasOwnProperty(De="DECIMAL_PLACES")&&(cr(ke=Se[De],0,Hr,De),h=ke),Se.hasOwnProperty(De="ROUNDING_MODE")&&(cr(ke=Se[De],0,8,De),v=ke),Se.hasOwnProperty(De="EXPONENTIAL_AT")&&((ke=Se[De])&&ke.pop?(cr(ke[0],-Hr,0,De),cr(ke[1],0,Hr,De),D=ke[0],L=ke[1]):(cr(ke,-Hr,Hr,De),D=-(L=ke<0?-ke:ke))),Se.hasOwnProperty(De="RANGE"))if((ke=Se[De])&&ke.pop)cr(ke[0],-Hr,-1,De),cr(ke[1],1,Hr,De),j=ke[0],Q=ke[1];else{if(cr(ke,-Hr,Hr,De),!ke)throw Error(di+De+" cannot be zero: "+ke);j=-(Q=ke<0?-ke:ke)}if(Se.hasOwnProperty(De="CRYPTO")){if((ke=Se[De])!==!!ke)throw Error(di+De+" not true or false: "+ke);if(ke){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw me=!ke,Error(di+"crypto unavailable");me=ke}else me=ke}if(Se.hasOwnProperty(De="MODULO_MODE")&&(cr(ke=Se[De],0,9,De),ye=ke),Se.hasOwnProperty(De="POW_PRECISION")&&(cr(ke=Se[De],0,Hr,De),Te=ke),Se.hasOwnProperty(De="FORMAT")){if("object"!=typeof(ke=Se[De]))throw Error(di+De+" not an object: "+ke);Ve=ke}if(Se.hasOwnProperty(De="ALPHABET")){if("string"!=typeof(ke=Se[De])||/^.?$|[+\-.\s]|(.).*\1/.test(ke))throw Error(di+De+" invalid: "+ke);gt="0123456789"==ke.slice(0,10),je=ke}}return{DECIMAL_PLACES:h,ROUNDING_MODE:v,EXPONENTIAL_AT:[D,L],RANGE:[j,Q],CRYPTO:me,MODULO_MODE:ye,POW_PRECISION:Te,FORMAT:Ve,ALPHABET:je}},Ie.isBigNumber=function(Se){if(!Se||!0!==Se._isBigNumber)return!1;if(!Ie.DEBUG)return!0;var De,ke,dt=Se.c,Qe=Se.e,st=Se.s;e:if("[object Array]"=={}.toString.call(dt)){if((1===st||-1===st)&&Qe>=-Hr&&Qe<=Hr&&Qe===Fo(Qe)){if(0===dt[0]){if(0===Qe&&1===dt.length)return!0;break e}if((De=(Qe+1)%14)<1&&(De+=14),String(dt[0]).length==De){for(De=0;De=po||ke!==Fo(ke))break e;if(0!==ke)return!0}}}else if(null===dt&&null===Qe&&(null===st||1===st||-1===st))return!0;throw Error(di+"Invalid BigNumber: "+Se)},Ie.maximum=Ie.max=function(){return At(arguments,i.lt)},Ie.minimum=Ie.min=function(){return At(arguments,i.gt)},Ie.random=(Se=9007199254740992,De=Math.random()*Se&2097151?function(){return Fo(Math.random()*Se)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(ke){var dt,Qe,st,vt,Ze,Fe=0,Ke=[],qe=new Ie(a);if(null==ke?ke=h:cr(ke,0,Hr),vt=im(ke/14),me)if(crypto.getRandomValues){for(dt=crypto.getRandomValues(new Uint32Array(vt*=2));Fe>>11))>=9e15?(Qe=crypto.getRandomValues(new Uint32Array(2)),dt[Fe]=Qe[0],dt[Fe+1]=Qe[1]):(Ke.push(Ze%1e14),Fe+=2);Fe=vt/2}else{if(!crypto.randomBytes)throw me=!1,Error(di+"crypto unavailable");for(dt=crypto.randomBytes(vt*=7);Fe=9e15?crypto.randomBytes(7).copy(dt,Fe):(Ke.push(Ze%1e14),Fe+=7);Fe=vt/7}if(!me)for(;Fe=10;Ze/=10,Fe++);Fe<14&&(st-=14-Fe)}return qe.e=st,qe.c=Ke,qe}),Ie.sum=function(){for(var Se=1,De=arguments,ke=new Ie(De[0]);SeQe-1&&(null==Ze[vt+1]&&(Ze[vt+1]=0),Ze[vt+1]+=Ze[vt]/Qe|0,Ze[vt]%=Qe)}return Ze.reverse()}return function(ke,dt,Qe,st,vt){var Ze,Fe,Ke,qe,yt,Dt,Pt,Yt,On=ke.indexOf("."),an=h,Sn=v;for(On>=0&&(qe=Te,Te=0,ke=ke.replace(".",""),Dt=(Yt=new Ie(dt)).pow(ke.length-On),Te=qe,Yt.c=De(ss(zi(Dt.c),Dt.e,"0"),10,Qe,Se),Yt.e=Yt.c.length),Ke=qe=(Pt=De(ke,dt,Qe,vt?(Ze=je,Se):(Ze=Se,je))).length;0==Pt[--qe];Pt.pop());if(!Pt[0])return Ze.charAt(0);if(On<0?--Ke:(Dt.c=Pt,Dt.e=Ke,Dt.s=st,Pt=(Dt=e(Dt,Yt,an,Sn,Qe)).c,yt=Dt.r,Ke=Dt.e),On=Pt[Fe=Ke+an+1],qe=Qe/2,yt=yt||Fe<0||null!=Pt[Fe+1],yt=Sn<4?(null!=On||yt)&&(0==Sn||Sn==(Dt.s<0?3:2)):On>qe||On==qe&&(4==Sn||yt||6==Sn&&1&Pt[Fe-1]||Sn==(Dt.s<0?8:7)),Fe<1||!Pt[0])ke=yt?ss(Ze.charAt(1),-an,Ze.charAt(0)):Ze.charAt(0);else{if(Pt.length=Fe,yt)for(--Qe;++Pt[--Fe]>Qe;)Pt[Fe]=0,Fe||(++Ke,Pt=[1].concat(Pt));for(qe=Pt.length;!Pt[--qe];);for(On=0,ke="";On<=qe;ke+=Ze.charAt(Pt[On++]));ke=ss(ke,Ke,Ze.charAt(0))}return ke}}(),e=function(){function Se(dt,Qe,st){var vt,Ze,Fe,Ke,qe=0,yt=dt.length,Dt=Qe%Ds,Pt=Qe/Ds|0;for(dt=dt.slice();yt--;)qe=((Ze=Dt*(Fe=dt[yt]%Ds)+(vt=Pt*Fe+(Ke=dt[yt]/Ds|0)*Dt)%Ds*Ds+qe)/st|0)+(vt/Ds|0)+Pt*Ke,dt[yt]=Ze%st;return qe&&(dt=[qe].concat(dt)),dt}function De(dt,Qe,st,vt){var Ze,Fe;if(st!=vt)Fe=st>vt?1:-1;else for(Ze=Fe=0;ZeQe[Ze]?1:-1;break}return Fe}function ke(dt,Qe,st,vt){for(var Ze=0;st--;)dt[st]-=Ze,dt[st]=(Ze=dt[st]1;dt.splice(0,1));}return function(dt,Qe,st,vt,Ze){var Fe,Ke,qe,yt,Dt,Pt,Yt,On,an,Sn,kn,In,Wi,Zi,Eo,yi,Ec,Xi=dt.s==Qe.s?1:-1,li=dt.c,br=Qe.c;if(!(li&&li[0]&&br&&br[0]))return new Ie(dt.s&&Qe.s&&(li?!br||li[0]!=br[0]:br)?li&&0==li[0]||!br?0*Xi:Xi/0:NaN);for(an=(On=new Ie(Xi)).c=[],Xi=st+(Ke=dt.e-Qe.e)+1,Ze||(Ze=po,Ke=$i(dt.e/14)-$i(Qe.e/14),Xi=Xi/14|0),qe=0;br[qe]==(li[qe]||0);qe++);if(br[qe]>(li[qe]||0)&&Ke--,Xi<0)an.push(1),yt=!0;else{for(Zi=li.length,yi=br.length,qe=0,Xi+=2,(Dt=Fo(Ze/(br[0]+1)))>1&&(br=Se(br,Dt,Ze),li=Se(li,Dt,Ze),yi=br.length,Zi=li.length),Wi=yi,kn=(Sn=li.slice(0,yi)).length;kn=Ze/2&&Eo++;do{if(Dt=0,(Fe=De(br,Sn,yi,kn))<0){if(In=Sn[0],yi!=kn&&(In=In*Ze+(Sn[1]||0)),(Dt=Fo(In/Eo))>1)for(Dt>=Ze&&(Dt=Ze-1),Yt=(Pt=Se(br,Dt,Ze)).length,kn=Sn.length;1==De(Pt,Sn,Yt,kn);)Dt--,ke(Pt,yi=10;Xi/=10,qe++);Vt(On,st+(On.e=qe+14*Ke-1)+1,vt,yt)}else On.e=Ke,On.r=+yt;return On}}(),r=function(){var Se=/^(-?)0([xbo])(?=\w[\w.]*$)/i,De=/^([^.]+)\.$/,ke=/^\.([^.]+)$/,dt=/^-?(Infinity|NaN)$/,Qe=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(st,vt,Ze,Fe){var Ke,qe=Ze?vt:vt.replace(Qe,"");if(dt.test(qe))st.s=isNaN(qe)?null:qe<0?-1:1;else{if(!Ze&&(qe=qe.replace(Se,function(yt,Dt,Pt){return Ke="x"==(Pt=Pt.toLowerCase())?16:"b"==Pt?2:8,Fe&&Fe!=Ke?yt:Dt}),Fe&&(Ke=Fe,qe=qe.replace(De,"$1").replace(ke,"0.$1")),vt!=qe))return new Ie(qe,Ke);if(Ie.DEBUG)throw Error(di+"Not a"+(Fe?" base "+Fe:"")+" number: "+vt);st.s=null}st.c=st.e=null}}(),i.absoluteValue=i.abs=function(){var Se=new Ie(this);return Se.s<0&&(Se.s=1),Se},i.comparedTo=function(Se,De){return El(this,new Ie(Se,De))},i.decimalPlaces=i.dp=function(Se,De){var ke,dt,Qe;if(null!=Se)return cr(Se,0,Hr),null==De?De=v:cr(De,0,8),Vt(new Ie(this),Se+this.e+1,De);if(!(ke=this.c))return null;if(dt=14*((Qe=ke.length-1)-$i(this.e/14)),Qe=ke[Qe])for(;Qe%10==0;Qe/=10,dt--);return dt<0&&(dt=0),dt},i.dividedBy=i.div=function(Se,De){return e(this,new Ie(Se,De),h,v)},i.dividedToIntegerBy=i.idiv=function(Se,De){return e(this,new Ie(Se,De),0,1)},i.exponentiatedBy=i.pow=function(Se,De){var ke,dt,Qe,st,Ze,Fe,Ke,qe,yt=this;if((Se=new Ie(Se)).c&&!Se.isInteger())throw Error(di+"Exponent not an integer: "+Zt(Se));if(null!=De&&(De=new Ie(De)),Ze=Se.e>14,!yt.c||!yt.c[0]||1==yt.c[0]&&!yt.e&&1==yt.c.length||!Se.c||!Se.c[0])return qe=new Ie(Math.pow(+Zt(yt),Ze?Se.s*(2-wh(Se)):+Zt(Se))),De?qe.mod(De):qe;if(Fe=Se.s<0,De){if(De.c?!De.c[0]:!De.s)return new Ie(NaN);(dt=!Fe&&yt.isInteger()&&De.isInteger())&&(yt=yt.mod(De))}else{if(Se.e>9&&(yt.e>0||yt.e<-1||(0==yt.e?yt.c[0]>1||Ze&&yt.c[1]>=24e7:yt.c[0]<8e13||Ze&&yt.c[0]<=9999975e7)))return st=yt.s<0&&wh(Se)?-0:0,yt.e>-1&&(st=1/st),new Ie(Fe?1/st:st);Te&&(st=im(Te/14+2))}for(Ze?(ke=new Ie(.5),Fe&&(Se.s=1),Ke=wh(Se)):Ke=(Qe=Math.abs(+Zt(Se)))%2,qe=new Ie(a);;){if(Ke){if(!(qe=qe.times(yt)).c)break;st?qe.c.length>st&&(qe.c.length=st):dt&&(qe=qe.mod(De))}if(Qe){if(0===(Qe=Fo(Qe/2)))break;Ke=Qe%2}else if(Vt(Se=Se.times(ke),Se.e+1,1),Se.e>14)Ke=wh(Se);else{if(0==(Qe=+Zt(Se)))break;Ke=Qe%2}yt=yt.times(yt),st?yt.c&&yt.c.length>st&&(yt.c.length=st):dt&&(yt=yt.mod(De))}return dt?qe:(Fe&&(qe=a.div(qe)),De?qe.mod(De):st?Vt(qe,Te,v,void 0):qe)},i.integerValue=function(Se){var De=new Ie(this);return null==Se?Se=v:cr(Se,0,8),Vt(De,De.e+1,Se)},i.isEqualTo=i.eq=function(Se,De){return 0===El(this,new Ie(Se,De))},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(Se,De){return El(this,new Ie(Se,De))>0},i.isGreaterThanOrEqualTo=i.gte=function(Se,De){return 1===(De=El(this,new Ie(Se,De)))||0===De},i.isInteger=function(){return!!this.c&&$i(this.e/14)>this.c.length-2},i.isLessThan=i.lt=function(Se,De){return El(this,new Ie(Se,De))<0},i.isLessThanOrEqualTo=i.lte=function(Se,De){return-1===(De=El(this,new Ie(Se,De)))||0===De},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.minus=function(Se,De){var ke,dt,Qe,st,vt=this,Ze=vt.s;if(De=(Se=new Ie(Se,De)).s,!Ze||!De)return new Ie(NaN);if(Ze!=De)return Se.s=-De,vt.plus(Se);var Fe=vt.e/14,Ke=Se.e/14,qe=vt.c,yt=Se.c;if(!Fe||!Ke){if(!qe||!yt)return qe?(Se.s=-De,Se):new Ie(yt?vt:NaN);if(!qe[0]||!yt[0])return yt[0]?(Se.s=-De,Se):new Ie(qe[0]?vt:3==v?-0:0)}if(Fe=$i(Fe),Ke=$i(Ke),qe=qe.slice(),Ze=Fe-Ke){for((st=Ze<0)?(Ze=-Ze,Qe=qe):(Ke=Fe,Qe=yt),Qe.reverse(),De=Ze;De--;Qe.push(0));Qe.reverse()}else for(dt=(st=(Ze=qe.length)<(De=yt.length))?Ze:De,Ze=De=0;De0)for(;De--;qe[ke++]=0);for(De=po-1;dt>Ze;){if(qe[--dt]=0;){for(ke=0,Dt=In[Qe]%an,Pt=In[Qe]/an|0,st=Qe+(vt=Fe);st>Qe;)ke=((Ke=Dt*(Ke=kn[--vt]%an)+(Ze=Pt*Ke+(qe=kn[vt]/an|0)*Dt)%an*an+Yt[st]+ke)/On|0)+(Ze/an|0)+Pt*qe,Yt[st--]=Ke%On;Yt[st]=ke}return ke?++dt:Yt.splice(0,1),Nt(Se,Yt,dt)},i.negated=function(){var Se=new Ie(this);return Se.s=-Se.s||null,Se},i.plus=function(Se,De){var ke,dt=this,Qe=dt.s;if(De=(Se=new Ie(Se,De)).s,!Qe||!De)return new Ie(NaN);if(Qe!=De)return Se.s=-De,dt.minus(Se);var st=dt.e/14,vt=Se.e/14,Ze=dt.c,Fe=Se.c;if(!st||!vt){if(!Ze||!Fe)return new Ie(Qe/0);if(!Ze[0]||!Fe[0])return Fe[0]?Se:new Ie(Ze[0]?dt:0*Qe)}if(st=$i(st),vt=$i(vt),Ze=Ze.slice(),Qe=st-vt){for(Qe>0?(vt=st,ke=Fe):(Qe=-Qe,ke=Ze),ke.reverse();Qe--;ke.push(0));ke.reverse()}for((Qe=Ze.length)-(De=Fe.length)<0&&(ke=Fe,Fe=Ze,Ze=ke,De=Qe),Qe=0;De;)Qe=(Ze[--De]=Ze[De]+Fe[De]+Qe)/po|0,Ze[De]=po===Ze[De]?0:Ze[De]%po;return Qe&&(Ze=[Qe].concat(Ze),++vt),Nt(Se,Ze,vt)},i.precision=i.sd=function(Se,De){var ke,dt,Qe;if(null!=Se&&Se!==!!Se)return cr(Se,1,Hr),null==De?De=v:cr(De,0,8),Vt(new Ie(this),Se,De);if(!(ke=this.c))return null;if(dt=14*(Qe=ke.length-1)+1,Qe=ke[Qe]){for(;Qe%10==0;Qe/=10,dt--);for(Qe=ke[0];Qe>=10;Qe/=10,dt++);}return Se&&this.e+1>dt&&(dt=this.e+1),dt},i.shiftedBy=function(Se){return cr(Se,-om,om),this.times("1e"+Se)},i.squareRoot=i.sqrt=function(){var Se,De,ke,dt,Qe,st=this,vt=st.c,Ze=st.s,Fe=st.e,Ke=h+4,qe=new Ie("0.5");if(1!==Ze||!vt||!vt[0])return new Ie(!Ze||Ze<0&&(!vt||vt[0])?NaN:vt?st:1/0);if(0==(Ze=Math.sqrt(+Zt(st)))||Ze==1/0?(((De=zi(vt)).length+Fe)%2==0&&(De+="0"),Ze=Math.sqrt(+De),Fe=$i((Fe+1)/2)-(Fe<0||Fe%2),ke=new Ie(De=Ze==1/0?"5e"+Fe:(De=Ze.toExponential()).slice(0,De.indexOf("e")+1)+Fe)):ke=new Ie(Ze+""),ke.c[0])for((Ze=(Fe=ke.e)+Ke)<3&&(Ze=0);;)if(ke=qe.times((Qe=ke).plus(e(st,Qe,Ke,1))),zi(Qe.c).slice(0,Ze)===(De=zi(ke.c)).slice(0,Ze)){if(ke.e0&&Yt>0){for(qe=Pt.substr(0,st=Yt%Ze||Ze);st0&&(qe+=Ke+Pt.slice(st)),Dt&&(qe="-"+qe)}dt=yt?qe+(ke.decimalSeparator||"")+((Fe=+ke.fractionGroupSize)?yt.replace(new RegExp("\\d{"+Fe+"}\\B","g"),"$&"+(ke.fractionGroupSeparator||"")):yt):qe}return(ke.prefix||"")+dt+(ke.suffix||"")},i.toFraction=function(Se){var De,ke,dt,Qe,st,vt,Ze,Fe,Ke,qe,yt,Dt,Pt=this,Yt=Pt.c;if(null!=Se&&(!(Ze=new Ie(Se)).isInteger()&&(Ze.c||1!==Ze.s)||Ze.lt(a)))throw Error(di+"Argument "+(Ze.isInteger()?"out of range: ":"not an integer: ")+Zt(Ze));if(!Yt)return new Ie(Pt);for(De=new Ie(a),Ke=ke=new Ie(a),dt=Fe=new Ie(a),Dt=zi(Yt),st=De.e=Dt.length-Pt.e-1,De.c[0]=sm[(vt=st%14)<0?14+vt:vt],Se=!Se||Ze.comparedTo(De)>0?st>0?De:Ke:Ze,vt=Q,Q=1/0,Ze=new Ie(Dt),Fe.c[0]=0;qe=e(Ze,De,0,1),1!=(Qe=ke.plus(qe.times(dt))).comparedTo(Se);)ke=dt,dt=Qe,Ke=Fe.plus(qe.times(Qe=Ke)),Fe=Qe,De=Ze.minus(qe.times(Qe=De)),Ze=Qe;return Qe=e(Se.minus(ke),dt,0,1),Fe=Fe.plus(Qe.times(Ke)),ke=ke.plus(Qe.times(dt)),Fe.s=Ke.s=Pt.s,yt=e(Ke,dt,st*=2,v).minus(Pt).abs().comparedTo(e(Fe,ke,st,v).minus(Pt).abs())<1?[Ke,dt]:[Fe,ke],Q=vt,yt},i.toNumber=function(){return+Zt(this)},i.toPrecision=function(Se,De){return null!=Se&&cr(Se,1,Hr),_t(this,Se,De,2)},i.toString=function(Se){var De,ke=this,dt=ke.s,Qe=ke.e;return null===Qe?dt?(De="Infinity",dt<0&&(De="-"+De)):De="NaN":(null==Se?De=Qe<=D||Qe>=L?Mh(zi(ke.c),Qe):ss(zi(ke.c),Qe,"0"):10===Se&>?De=ss(zi((ke=Vt(new Ie(ke),h+Qe+1,v)).c),ke.e,"0"):(cr(Se,2,je.length,"Base"),De=t(ss(zi(ke.c),Qe,"0"),10,Se,dt,!0)),dt<0&&ke.c[0]&&(De="-"+De)),De},i.valueOf=i.toJSON=function(){return Zt(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,null!=n&&Ie.set(n),Ie}();const Nn=am;var wn=(()=>(function(n){n.BlockchainRequest="blockchain_request",n.PermissionRequest="permission_request",n.SignPayloadRequest="sign_payload_request",n.OperationRequest="operation_request",n.BroadcastRequest="broadcast_request",n.ChangeAccountRequest="change_account_request",n.BlockchainResponse="blockchain_response",n.PermissionResponse="permission_response",n.SignPayloadResponse="sign_payload_response",n.OperationResponse="operation_response",n.BroadcastResponse="broadcast_response",n.Acknowledge="acknowledge",n.Disconnect="disconnect",n.Error="error"}(wn||(wn={})),wn))(),ua=(()=>(function(n){n.SIGN="sign",n.OPERATION_REQUEST="operation_request",n.ENCRYPT="encrypt",n.NOTIFICATION="notification",n.THRESHOLD="threshold"}(ua||(ua={})),ua))(),Gi=(()=>(function(n){n.MAINNET="mainnet",n.GHOSTNET="ghostnet",n.MONDAYNET="mondaynet",n.DAILYNET="dailynet",n.DELPHINET="delphinet",n.EDONET="edonet",n.FLORENCENET="florencenet",n.GRANADANET="granadanet",n.HANGZHOUNET="hangzhounet",n.ITHACANET="ithacanet",n.JAKARTANET="jakartanet",n.KATHMANDUNET="kathmandunet",n.LIMANET="limanet",n.MUMBAINET="mumbainet",n.NAIROBINET="nairobinet",n.OXFORDNET="oxfordnet",n.CUSTOM="custom"}(Gi||(Gi={})),Gi))(),xl=(()=>(function(n){n.ENDORSEMENT="endorsement",n.SEED_NONCE_REVELATION="seed_nonce_revelation",n.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",n.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",n.ACTIVATE_ACCOUNT="activate_account",n.PROPOSALS="proposals",n.BALLOT="ballot",n.REVEAL="reveal",n.TRANSACTION="transaction",n.ORIGINATION="origination",n.DELEGATION="delegation"}(xl||(xl={})),xl))(),Eh=(()=>(function(n){n.WEBSITE="website",n.EXTENSION="extension",n.P2P="p2p",n.WALLETCONNECT="walletconnect"}(Eh||(Eh={})),Eh))(),as=(()=>(function(n){n.BROADCAST_ERROR="BROADCAST_ERROR",n.NETWORK_NOT_SUPPORTED="NETWORK_NOT_SUPPORTED",n.NO_ADDRESS_ERROR="NO_ADDRESS_ERROR",n.NO_PRIVATE_KEY_FOUND_ERROR="NO_PRIVATE_KEY_FOUND_ERROR",n.NOT_GRANTED_ERROR="NOT_GRANTED_ERROR",n.PARAMETERS_INVALID_ERROR="PARAMETERS_INVALID_ERROR",n.TOO_MANY_OPERATIONS="TOO_MANY_OPERATIONS",n.TRANSACTION_INVALID_ERROR="TRANSACTION_INVALID_ERROR",n.SIGNATURE_TYPE_NOT_SUPPORTED="SIGNATURE_TYPE_NOT_SUPPORTED",n.ABORTED_ERROR="ABORTED_ERROR",n.UNKNOWN_ERROR="UNKNOWN_ERROR"}(as||(as={})),as))(),Uo=(()=>(function(n){n.NOT_CONNECTED="NOT_CONNECTED",n.CONNECTING="CONNECTING",n.CONNECTED="CONNECTED"}(Uo||(Uo={})),Uo))(),Yu=(()=>(function(n){n.CHROME_MESSAGE="chrome_message",n.WALLETCONNECT="walletconnect",n.POST_MESSAGE="post_message",n.LEDGER="ledger",n.P2P="p2p"}(Yu||(Yu={})),Yu))(),nn=(()=>(function(n){n.TRANSPORT_P2P_PEERS_DAPP="beacon:communication-peers-dapp",n.TRANSPORT_P2P_PEERS_WALLET="beacon:communication-peers-wallet",n.TRANSPORT_POSTMESSAGE_PEERS_DAPP="beacon:postmessage-peers-dapp",n.TRANSPORT_POSTMESSAGE_PEERS_WALLET="beacon:postmessage-peers-wallet",n.TRANSPORT_WALLETCONNECT_PEERS_DAPP="beacon:walletconnect-peers-dapp",n.LAST_SELECTED_WALLET="beacon:last-selected-wallet",n.ACCOUNTS="beacon:accounts",n.ACTIVE_ACCOUNT="beacon:active-account",n.PUSH_TOKENS="beacon:push-tokens",n.BEACON_SDK_SECRET_SEED="beacon:sdk-secret-seed",n.APP_METADATA_LIST="beacon:app-metadata-list",n.PERMISSION_LIST="beacon:permissions",n.BEACON_SDK_VERSION="beacon:sdk_version",n.MATRIX_PRESERVED_STATE="beacon:sdk-matrix-preserved-state",n.MATRIX_PEER_ROOM_IDS="beacon:matrix-peer-rooms",n.MATRIX_SELECTED_NODE="beacon:matrix-selected-node",n.MULTI_NODE_SETUP_DONE="beacon:multi-node-setup"}(nn||(nn={})),nn))();const lm={[nn.TRANSPORT_P2P_PEERS_DAPP]:[],[nn.TRANSPORT_P2P_PEERS_WALLET]:[],[nn.TRANSPORT_POSTMESSAGE_PEERS_DAPP]:[],[nn.TRANSPORT_POSTMESSAGE_PEERS_WALLET]:[],[nn.TRANSPORT_WALLETCONNECT_PEERS_DAPP]:[],[nn.LAST_SELECTED_WALLET]:void 0,[nn.ACCOUNTS]:[],[nn.ACTIVE_ACCOUNT]:void 0,[nn.PUSH_TOKENS]:[],[nn.BEACON_SDK_SECRET_SEED]:void 0,[nn.APP_METADATA_LIST]:[],[nn.PERMISSION_LIST]:[],[nn.BEACON_SDK_VERSION]:void 0,[nn.MATRIX_PRESERVED_STATE]:{},[nn.MATRIX_PEER_ROOM_IDS]:{},[nn.MATRIX_SELECTED_NODE]:void 0,[nn.MULTI_NODE_SETUP_DONE]:void 0};var xh=(()=>(function(n){n.EUROPE_EAST="europe-east",n.EUROPE_WEST="europe-west",n.NORTH_AMERICA_EAST="north-america-east",n.NORTH_AMERICA_WEST="north-america-west",n.CENTRAL_AMERICA="central-america",n.SOUTH_AMERICA="south-america",n.ASIA_EAST="asia-east",n.ASIA_WEST="asia-west",n.AFRICA="africa",n.AUSTRALIA="australia"}(xh||(xh={})),xh))(),Sh=(()=>(function(n){n[n.CONTINUE=100]="CONTINUE",n[n.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",n[n.PROCESSING=102]="PROCESSING",n[n.OK=200]="OK",n[n.CREATED=201]="CREATED",n[n.ACCEPTED=202]="ACCEPTED",n[n.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",n[n.NO_CONTENT=204]="NO_CONTENT",n[n.RESET_CONTENT=205]="RESET_CONTENT",n[n.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",n[n.MULTI_STATUS=207]="MULTI_STATUS",n[n.ALREADY_REPORTED=208]="ALREADY_REPORTED",n[n.IM_USED=226]="IM_USED",n[n.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",n[n.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",n[n.FOUND=302]="FOUND",n[n.SEE_OTHER=303]="SEE_OTHER",n[n.NOT_MODIFIED=304]="NOT_MODIFIED",n[n.USE_PROXY=305]="USE_PROXY",n[n.SWITCH_PROXY=306]="SWITCH_PROXY",n[n.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",n[n.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.UNAUTHORIZED=401]="UNAUTHORIZED",n[n.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",n[n.FORBIDDEN=403]="FORBIDDEN",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",n[n.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",n[n.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",n[n.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",n[n.CONFLICT=409]="CONFLICT",n[n.GONE=410]="GONE",n[n.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",n[n.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",n[n.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",n[n.URI_TOO_LONG=414]="URI_TOO_LONG",n[n.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",n[n.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",n[n.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",n[n.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",n[n.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",n[n.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",n[n.LOCKED=423]="LOCKED",n[n.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",n[n.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",n[n.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",n[n.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",n[n.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",n[n.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n[n.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",n[n.BAD_GATEWAY=502]="BAD_GATEWAY",n[n.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",n[n.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",n[n.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",n[n.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",n[n.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",n[n.LOOP_DETECTED=508]="LOOP_DETECTED",n[n.NOT_EXTENDED=510]="NOT_EXTENDED",n[n.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(Sh||(Sh={})),Sh))(),QN="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node?I(2015).XMLHttpRequest:XMLHttpRequest,QE=function n(e,t,r,i,a){this.message=e,this.status=t,this.statusText=r,this.body=i,this.url=a,this.name="HttpResponse"},ek=function n(e,t){this.url=e,this.innerEvent=t,this.name="HttpRequestFailed",this.message="Request to "+e+" failed"},tk=function(){function n(){}return n.prototype.serialize=function(e){if(!e)return"";var t=[],r=function(h){if(e.hasOwnProperty(h)&&void 0!==e[h]){var v="function"==typeof e[h].toJSON?e[h].toJSON():e[h];if(null===v)return t.push(encodeURIComponent(h)),"continue";if(Array.isArray(v))return v.forEach(function(D){t.push(encodeURIComponent(h)+"="+encodeURIComponent(D))}),"continue";t.push(encodeURIComponent(h)+"="+encodeURIComponent(v))}};for(var i in e)r(i);var a=t.join("&");return a?"?"+a:""},n.prototype.createXHR=function(){return new QN},n.prototype.createRequest=function(e,t){var r=this,i=e.url,a=e.method,h=e.timeout,v=e.query,D=e.headers,L=void 0===D?{}:D,j=e.json,Q=void 0===j||j,me=e.mimeType,ye=void 0===me?void 0:me;return new Promise(function(Te,Ve){var je=r.createXHR();for(var gt in je.open(a||"GET",""+i+r.serialize(v)),L["Content-Type"]||je.setRequestHeader("Content-Type","application/json"),ye&&je.overrideMimeType(""+ye),L)je.setRequestHeader(gt,L[gt]);if(je.timeout=h||3e4,je.onload=function(){if(this.status>=200&&this.status<300)if(Q)try{Te(JSON.parse(je.response))}catch(_t){Ve(new Error("Unable to parse response: "+je.response))}else Te(je.response);else Ve(new QE("Http error response: ("+this.status+") "+je.response,this.status,je.statusText,je.response,i))},je.ontimeout=function(){Ve(new Error("Request timed out after: "+je.timeout+"ms"))},je.onerror=function(_t){Ve(new ek(i,_t))},t){var Ie=JSON.stringify(t);je.send(Ie)}else je.send()})},n}(),ls=function(){return ls=Object.assign||function(e){for(var t,r=1,i=arguments.length;r0&&a[a.length-1])&&(6===L[0]||2===L[0])){t=0;continue}if(3===L[0]&&(!a||L[1]>a[0]&&L[1](function(n){n.ORIGINATION="origination",n.DELEGATION="delegation",n.REVEAL="reveal",n.TRANSACTION="transaction",n.ACTIVATION="activate_account",n.ENDORSEMENT="endorsement",n.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",n.SEED_NONCE_REVELATION="seed_nonce_revelation",n.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",n.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",n.PROPOSALS="proposals",n.BALLOT="ballot",n.FAILING_NOOP="failing_noop"}(Ch||(Ch={})),Ch))(),An={block:"head"},t3=function(){function n(e,t,r){void 0===t&&(t="main"),void 0===r&&(r=new tk),this.url=e,this.chain=t,this.httpBackend=r}return n.prototype.createURL=function(e){return""+this.url.replace(/\/+$/g,"")+e},n.prototype.getBlockHash=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/hash"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getLiveBlocks=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/live_blocks"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBalance=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a;return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/balance"),method:"GET"})];case 1:return a=h.sent(),[2,new Nn(a)]}})})},n.prototype.getStorage=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/storage"),method:"GET"})]})})},n.prototype.getScript=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/script"),method:"GET"})]})})},n.prototype.getContract=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a;return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e),method:"GET"})];case 1:return a=h.sent(),[2,ls(ls({},a),{balance:new Nn(a.balance)})]}})})},n.prototype.getManagerKey=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/manager_key"),method:"GET"})]})})},n.prototype.getDelegate=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a,h;return En(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/delegate"),method:"GET"})];case 1:return a=v.sent(),[3,3];case 2:if(!((h=v.sent())instanceof QE&&h.status===Sh.NOT_FOUND))throw h;return a=null,[3,3];case 3:return[2,a]}})})},n.prototype.getBigMapKey=function(e,t,r){var a=(void 0===r?An:r).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+a+"/context/contracts/"+e+"/big_map_get"),method:"POST"},t)]})})},n.prototype.getBigMapExpr=function(e,t,r){var a=(void 0===r?An:r).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+a+"/context/big_maps/"+e+"/"+t),method:"GET"})]})})},n.prototype.getDelegates=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a;return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/delegates/"+e),method:"GET"})];case 1:return[2,{deactivated:(a=h.sent()).deactivated,balance:new Nn(a.balance),frozen_balance:new Nn(a.frozen_balance),frozen_balance_by_cycle:a.frozen_balance_by_cycle.map(function(v){var D=v.deposit,L=v.deposits,j=v.fees,Q=v.rewards,me=JE(v,["deposit","deposits","fees","rewards"]),ye=um({deposit:D,deposits:L,fees:j,rewards:Q},["deposit","deposits","fees","rewards"]);return ls(ls({},me),{deposit:ye.deposit,deposits:ye.deposits,fees:ye.fees,rewards:ye.rewards})}),staking_balance:new Nn(a.staking_balance),delegated_contracts:a.delegated_contracts,delegated_balance:new Nn(a.delegated_balance),grace_period:a.grace_period,voting_power:a.voting_power}]}})})},n.prototype.getConstants=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){var i,a;return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/context/constants"),method:"GET"})];case 1:return i=h.sent(),a=um(i,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy"]),[2,ls(ls({},i),a)]}})})},n.prototype.getBlock=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBlockHeader=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/header"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBlockMetadata=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/metadata"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBakingRights=function(e,t){void 0===e&&(e={});var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/baking_rights"),method:"GET",query:e})];case 1:return[2,h.sent()]}})})},n.prototype.getEndorsingRights=function(e,t){void 0===e&&(e={});var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/endorsing_rights"),method:"GET",query:e})];case 1:return[2,h.sent()]}})})},n.prototype.getBallotList=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/ballot_list"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getBallots=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/ballots"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getCurrentPeriodKind=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/current_period_kind"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getCurrentProposal=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/current_proposal"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getCurrentQuorum=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/current_quorum"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getVotesListings=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/listings"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getProposals=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/proposals"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.forgeOperations=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/forge/operations"),method:"POST"},e)]})})},n.prototype.injectOperation=function(e){return Mn(this,void 0,void 0,function(){return En(this,function(t){return[2,this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},e)]})})},n.prototype.preapplyOperations=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/preapply/operations"),method:"POST"},e)];case 1:return[2,h.sent()]}})})},n.prototype.getEntrypoints=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/entrypoints"),method:"GET"})];case 1:return[2,h.sent()]}})})},n.prototype.runOperation=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/scripts/run_operation"),method:"POST"},e)];case 1:return[2,h.sent()]}})})},n.prototype.runCode=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(h){switch(h.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/scripts/run_code"),method:"POST"},e)];case 1:return[2,h.sent()]}})})},n.prototype.getChainId=function(){return Mn(this,void 0,void 0,function(){return En(this,function(e){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/chain_id"),method:"GET"})]})})},n.prototype.packData=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){var a,h,v,D,L;return En(this,function(j){switch(j.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/helpers/scripts/pack_data"),method:"POST"},e)];case 1:return a=j.sent(),h=a.gas,v=JE(a,["gas"]),D=h,(L=new Nn(h||"")).isNaN()||(D=L),[2,ls({gas:D},v)]}})})},n.prototype.getRpcUrl=function(){return this.url},n.prototype.getCurrentPeriod=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/current_period"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getSuccessorPeriod=function(e){var r=(void 0===e?An:e).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){switch(a.label){case 0:return[4,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+r+"/votes/successor_period"),method:"GET"})];case 1:return[2,a.sent()]}})})},n.prototype.getSaplingDiffById=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/sapling/"+e+"/get_diff"),method:"GET"})]})})},n.prototype.getSaplingDiffByContract=function(e,t){var i=(void 0===t?An:t).block;return Mn(this,void 0,void 0,function(){return En(this,function(a){return[2,this.httpBackend.createRequest({url:this.createURL("/chains/"+this.chain+"/blocks/"+i+"/context/contracts/"+e+"/single_sapling_get_diff"),method:"GET"})]})})},n}();class n3{}class r3{}class us{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const r=t.indexOf(":");if(r>0){const i=t.slice(0,r),a=i.toLowerCase(),h=t.slice(r+1).trim();this.maybeSetNormalizedName(i,a),this.headers.has(a)?this.headers.get(a).push(h):this.headers.set(a,[h])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let r=e[t];const i=t.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(i,r),this.maybeSetNormalizedName(t,i))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof us?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new us;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof us?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let r=e.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(e.name,t);const i=("a"===e.op?this.headers.get(t):void 0)||[];i.push(...r),this.headers.set(t,i);break;case"d":const a=e.value;if(a){let h=this.headers.get(t);if(!h)return;h=h.filter(v=>-1===a.indexOf(v)),0===h.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,h)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class ik{encodeKey(e){return o3(e)}encodeValue(e){return o3(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const sk=/%(\d[a-f0-9])/gi,ak={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function o3(n){return encodeURIComponent(n).replace(sk,(e,t)=>{var r;return null!==(r=ak[t])&&void 0!==r?r:e})}function s3(n){return`${n}`}class Is{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new ik,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function ok(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(i=>{const a=i.indexOf("="),[h,v]=-1==a?[e.decodeKey(i),""]:[e.decodeKey(i.slice(0,a)),e.decodeValue(i.slice(a+1))],D=t.get(h)||[];D.push(v),t.set(h,D)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const r=e.fromObject[t];this.map.set(t,Array.isArray(r)?r:[r])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(r=>{const i=e[r];Array.isArray(i)?i.forEach(a=>{t.push({param:r,value:a,op:"a"})}):t.push({param:r,value:i,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(r=>t+"="+this.encoder.encodeValue(r)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new Is({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(s3(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let r=this.map.get(e.param)||[];const i=r.indexOf(s3(e.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(e.param,r):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class lk{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}}function a3(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function l3(n){return"undefined"!=typeof Blob&&n instanceof Blob}function u3(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Qu{constructor(e,t,r,i){let a;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function uk(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,a=i):a=r,a&&(this.reportProgress=!!a.reportProgress,this.withCredentials=!!a.withCredentials,a.responseType&&(this.responseType=a.responseType),a.headers&&(this.headers=a.headers),a.context&&(this.context=a.context),a.params&&(this.params=a.params)),this.headers||(this.headers=new us),this.context||(this.context=new lk),this.params){const h=this.params.toString();if(0===h.length)this.urlWithParams=t;else{const v=t.indexOf("?");this.urlWithParams=t+(-1===v?"?":vme.set(ye,e.setHeaders[ye]),L)),e.setParams&&(j=Object.keys(e.setParams).reduce((me,ye)=>me.set(ye,e.setParams[ye]),j)),new Qu(r,i,h,{params:j,headers:L,context:Q,reportProgress:D,responseType:a,withCredentials:v})}}var Dr=(()=>((Dr=Dr||{})[Dr.Sent=0]="Sent",Dr[Dr.UploadProgress=1]="UploadProgress",Dr[Dr.ResponseHeader=2]="ResponseHeader",Dr[Dr.DownloadProgress=3]="DownloadProgress",Dr[Dr.Response=4]="Response",Dr[Dr.User=5]="User",Dr))();class cm{constructor(e,t=200,r="OK"){this.headers=e.headers||new us,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||r,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class fm extends cm{constructor(e={}){super(e),this.type=Dr.ResponseHeader}clone(e={}){return new fm({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Ah extends cm{constructor(e={}){super(e),this.type=Dr.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new Ah({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class c3 extends cm{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function hm(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let f3=(()=>{class n{constructor(t){this.handler=t}request(t,r,i={}){let a;if(t instanceof Qu)a=t;else{let D,L;D=i.headers instanceof us?i.headers:new us(i.headers),i.params&&(L=i.params instanceof Is?i.params:new Is({fromObject:i.params})),a=new Qu(t,r,void 0!==i.body?i.body:null,{headers:D,context:i.context,params:L,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const h=tn(a).pipe(vl(D=>this.handler.handle(D)));if(t instanceof Qu||"events"===i.observe)return h;const v=h.pipe(rs(D=>D instanceof Ah));switch(i.observe||"body"){case"body":switch(a.responseType){case"arraybuffer":return v.pipe(u(D=>{if(null!==D.body&&!(D.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return D.body}));case"blob":return v.pipe(u(D=>{if(null!==D.body&&!(D.body instanceof Blob))throw new Error("Response is not a Blob.");return D.body}));case"text":return v.pipe(u(D=>{if(null!==D.body&&"string"!=typeof D.body)throw new Error("Response is not a string.");return D.body}));default:return v.pipe(u(D=>D.body))}case"response":return v;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(t,r={}){return this.request("DELETE",t,r)}get(t,r={}){return this.request("GET",t,r)}head(t,r={}){return this.request("HEAD",t,r)}jsonp(t,r){return this.request("JSONP",t,{params:(new Is).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,r={}){return this.request("OPTIONS",t,r)}patch(t,r,i={}){return this.request("PATCH",t,hm(i,r))}post(t,r,i={}){return this.request("POST",t,hm(i,r))}put(t,r,i={}){return this.request("PUT",t,hm(i,r))}}return n.\u0275fac=function(t){return new(t||n)(Mt(n3))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class h3{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const d3=new Kt("HTTP_INTERCEPTORS");let fk=(()=>{class n{intercept(t,r){return r.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const hk=/^\)\]\}',?\n/;let p3=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new Z(r=>{const i=this.xhrFactory.build();if(i.open(t.method,t.urlWithParams),t.withCredentials&&(i.withCredentials=!0),t.headers.forEach((ye,Te)=>i.setRequestHeader(ye,Te.join(","))),t.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const ye=t.detectContentTypeHeader();null!==ye&&i.setRequestHeader("Content-Type",ye)}if(t.responseType){const ye=t.responseType.toLowerCase();i.responseType="json"!==ye?ye:"text"}const a=t.serializeBody();let h=null;const v=()=>{if(null!==h)return h;const ye=i.statusText||"OK",Te=new us(i.getAllResponseHeaders()),Ve=function dk(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(i)||t.url;return h=new fm({headers:Te,status:i.status,statusText:ye,url:Ve}),h},D=()=>{let{headers:ye,status:Te,statusText:Ve,url:je}=v(),gt=null;204!==Te&&(gt=void 0===i.response?i.responseText:i.response),0===Te&&(Te=gt?200:0);let Ie=Te>=200&&Te<300;if("json"===t.responseType&&"string"==typeof gt){const _t=gt;gt=gt.replace(hk,"");try{gt=""!==gt?JSON.parse(gt):null}catch(At){gt=_t,Ie&&(Ie=!1,gt={error:At,text:gt})}}Ie?(r.next(new Ah({body:gt,headers:ye,status:Te,statusText:Ve,url:je||void 0})),r.complete()):r.error(new c3({error:gt,headers:ye,status:Te,statusText:Ve,url:je||void 0}))},L=ye=>{const{url:Te}=v(),Ve=new c3({error:ye,status:i.status||0,statusText:i.statusText||"Unknown Error",url:Te||void 0});r.error(Ve)};let j=!1;const Q=ye=>{j||(r.next(v()),j=!0);let Te={type:Dr.DownloadProgress,loaded:ye.loaded};ye.lengthComputable&&(Te.total=ye.total),"text"===t.responseType&&!!i.responseText&&(Te.partialText=i.responseText),r.next(Te)},me=ye=>{let Te={type:Dr.UploadProgress,loaded:ye.loaded};ye.lengthComputable&&(Te.total=ye.total),r.next(Te)};return i.addEventListener("load",D),i.addEventListener("error",L),i.addEventListener("timeout",L),i.addEventListener("abort",L),t.reportProgress&&(i.addEventListener("progress",Q),null!==a&&i.upload&&i.upload.addEventListener("progress",me)),i.send(a),r.next({type:Dr.Sent}),()=>{i.removeEventListener("error",L),i.removeEventListener("abort",L),i.removeEventListener("load",D),i.removeEventListener("timeout",L),t.reportProgress&&(i.removeEventListener("progress",Q),null!==a&&i.upload&&i.upload.removeEventListener("progress",me)),i.readyState!==i.DONE&&i.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(Mt(iM))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const dm=new Kt("XSRF_COOKIE_NAME"),pm=new Kt("XSRF_HEADER_NAME");class g3{}let pk=(()=>{class n{constructor(t,r,i){this.doc=t,this.platform=r,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=K2(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr),Mt(Au),Mt(dm))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),gm=(()=>{class n{constructor(t,r){this.tokenService=t,this.headerName=r}intercept(t,r){const i=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||i.startsWith("http://")||i.startsWith("https://"))return r.handle(t);const a=this.tokenService.getToken();return null!==a&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,a)})),r.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(g3),Mt(pm))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),gk=(()=>{class n{constructor(t,r){this.backend=t,this.injector=r,this.chain=null}handle(t){if(null===this.chain){const r=this.injector.get(d3,[]);this.chain=r.reduceRight((i,a)=>new h3(i,a),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(r3),Mt(Cr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),mk=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:gm,useClass:fk}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:dm,useValue:t.cookieName}:[],t.headerName?{provide:pm,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:[gm,{provide:d3,useExisting:gm,multi:!0},{provide:g3,useClass:pk},{provide:dm,useValue:"XSRF-TOKEN"},{provide:pm,useValue:"X-XSRF-TOKEN"}]}),n})(),vk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:[f3,{provide:n3,useClass:gk},p3,{provide:r3,useExisting:p3}],imports:[[mk.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})(),m3=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const yk={[Gi.MAINNET]:{selected:"https://tezos-node.prod.gke.papers.tech",all:["https://tezos-node.prod.gke.papers.tech"]},[Gi.GHOSTNET]:{selected:"https://tezos-ghostnet-node-1.diamond.papers.tech",all:["https://tezos-ghostnet-node-1.diamond.papers.tech"]}};let Ju=(()=>{class n{constructor(t,r,i){var a;this.http=t,this.storage=r,this.domSanitizer=i,this.RPCs=yk;try{const h=JSON.parse(null!==(a=localStorage.getItem("nodes"))&&void 0!==a?a:"");this.RPCs=h}catch(h){}}getPublicKeyForAddress(t){var r=this;return Ot(function*(){const i=Object.entries(r.RPCs).filter(a=>!!a[1].selected).map(a=>({network:a[0],url:a[1].selected}));i.unshift({network:Gi.MAINNET,url:r.RPCs.mainnet.selected});for(let a of i){const h=yield r.getPublicKeyForAddressFromRPC(a.url,t);if(h)return{network:a.network,publicKey:h}}throw new Error("No entry found")})()}getPublicKeyForAddressFromRPC(t,r){var i=this;return Ot(function*(){const a=`${t}/chains/main/blocks/head/context/contracts/${r}/manager_key`,h=yield i.http.get(a).toPromise();return console.log(h),h})()}selectRpc(t,r){var i=this;return Ot(function*(){i.RPCs[t].selected=r,localStorage.setItem("nodes",JSON.stringify(i.RPCs))})()}addCustomRpc(t,r){var i=this;return Ot(function*(){i.RPCs[t].all.push(r),i.selectRpc(t,r)})()}getBalanceOfAddress(t){var r=this;return Ot(function*(){return new t3(r.RPCs.mainnet.selected).getBalance(t)})()}getOperationHistory(t){var r=this;return Ot(function*(){return yield r.http.get(`https://api.tzkt.io/v1/accounts/${t}/operations?limit=10`).toPromise()})()}getTokenTransactionHistory(t){var r=this;return Ot(function*(){return yield r.http.get(`https://api.tzkt.io/v1/tokens/transfers?anyof.from.to=${t}&sort.desc=id&limit=10`).toPromise()})()}getBlockexplorerAddressLink(t){return Ot(function*(){return`https://tzkt.io/${t}`})()}getTokenBalances(t){var r=this;return Ot(function*(){return r.http.get(`https://api.tzkt.io/v1/tokens/balances?token.metadata.displayUri.null=true&balance.ne=0&account=${t}&sort.desc=balance&limit=5`).toPromise().then(i=>i.map(a=>(a.token.metadata.sanitizedThumbnailUri=a.token.metadata.thumbnailUri?r.domSanitizer.bypassSecurityTrustUrl(a.token.metadata.thumbnailUri.startsWith("ipfs://")?`https://cloudflare-ipfs.com/ipfs/${a.token.metadata.thumbnailUri.slice(6)}/`:a.token.metadata.thumbnailUri):void 0,a.humanReadableBalance=new Nn(a.balance).shiftedBy(-new Nn(a.token.metadata.decimals).toNumber()).decimalPlaces(6).toString(10),a)))})()}getNftBalances(t){var r=this;return Ot(function*(){return r.http.get(`https://api.tzkt.io/v1/tokens/balances?token.standard=fa2&token.metadata.displayUri.null=false&balance.ne=0&account=${t}&limit=20`).toPromise().then(i=>i.map(a=>(a.token.metadata.sanitizedThumbnailUri=a.token.metadata.displayUri?r.domSanitizer.bypassSecurityTrustUrl(`https://cloudflare-ipfs.com/ipfs/${a.token.metadata.displayUri.slice(6)}/`):a.token.metadata.artifactUri?r.domSanitizer.bypassSecurityTrustUrl(`https://cloudflare-ipfs.com/ipfs/${a.token.metadata.artifactUri.slice(6)}/`):void 0,a)))})()}getXtzPrice(){var t=this;return Ot(function*(){return t.http.get("https://min-api.cryptocompare.com/data/price?fsym=XTZ&tsyms=USD").toPromise().then(r=>r.USD)})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(f3),Mt(m3),Mt(Wf))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function mm(n){return Object.keys(n)}var go=(()=>(function(n){n.PENDING="pending",n.RESOLVED="resolved",n.REJECTED="rejected"}(go||(go={})),go))();const v3=()=>{throw new Error("ExposedPromise not initialized yet.")};class pi{constructor(){this._resolve=v3,this._reject=v3,this._status=go.PENDING,this._promise=new Promise((e,t)=>{this._resolve=r=>{this.isSettled()||(this._promiseResult=r,e(r),this._status=go.RESOLVED)},this._reject=r=>{this.isSettled()||(this._promiseError=r,t(r),this._status=go.REJECTED)}})}get promise(){return this._promise}get resolve(){return this._resolve}get reject(){return this._reject}get status(){return this._status}get promiseResult(){return this._promiseResult}get promiseError(){return this._promiseError}static resolve(e){const t=new pi;return t.resolve(e),t}static reject(e){const t=new pi;return t.reject(e),t}isPending(){return this.status===go.PENDING}isResolved(){return this.status===go.RESOLVED}isRejected(){return this.status===go.REJECTED}isSettled(){return this.isResolved()||this.isRejected()}}var ca=I(4329),vm=I.n(ca),ec=I(4488),y3=I(5784),Sl=I(3434),cs=I(7221),mo=I(5553),bk=I(8401),vo=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};function fs(n){return Buffer.from(n).toString("hex")}function Cl(n){return vo(this,void 0,void 0,function*(){return fs((0,cs.hash)("string"==typeof n?(0,Sl.cv)(n):n,32))})}function b3(n){return vo(this,void 0,void 0,function*(){return(0,mo._w)((0,cs.hash)((0,Sl.cv)(n),32))})}function _3(n,e){return`@${n}:${e}`}function bm(){return function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){const n=(0,y3.randomBytes)(16);return[n.slice(0,4),n.slice(4,6),n.slice(6,8),n.slice(8,10),n.slice(10,16)].map(function(e){return Buffer.from(e).toString("hex")}).join("-")})}const E3="https://beacon-notification-oracle.dev.gke.papers.tech",tc=[n=>{}];let Al={postMessage:(n,e)=>{console.log("GOT MOCK POST MESSAGE",n),tc.forEach(t=>{t({data:n})})},addEventListener:(n,e)=>{tc.push(e)},removeEventListener:(n,e)=>{tc.splice(tc.indexOf(t=>t===e),1)},location:{origin:"*"}};try{"undefined"!=typeof window&&(Al=window)}catch(n){console.log(`not defined: ${n}`)}class Ik{track(e,t,r,i){}}var Th=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})},nc=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class Dh{constructor(e,t){this.storage=e,this.storageKey=t}getAll(){var e;return nc(this,void 0,void 0,function*(){return null!==(e=yield this.storage.get(this.storageKey))&&void 0!==e?e:[]})}getOne(e){return nc(this,void 0,void 0,function*(){return(yield this.storage.get(this.storageKey)).find(e)})}addOne(e,t,r=!0){return nc(this,void 0,void 0,function*(){const i=yield this.storage.get(this.storageKey);if(i.some(t)){if(r)for(let a=0;a!e(i));return this.storage.set(this.storageKey,r)})}removeAll(){return nc(this,void 0,void 0,function*(){return this.storage.delete(this.storageKey)})}}const x3=(n,e)=>function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(void 0,void 0,void 0,function*(){const t=[n,e.type];e.name&&t.push(`name:${e.name}`),e.rpcUrl&&t.push(`rpc:${e.rpcUrl}`);const r=Buffer.from((0,cs.hash)((0,Sl.cv)(t.join("-")),10));return ca.encode(r)});class S3{static hasPermission(e,t,r){return function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){switch(e.type){case wn.PermissionRequest:case wn.BroadcastRequest:return!0;case wn.OperationRequest:{const i=yield x3(e.sourceAddress,e.network),a=yield t(i);return!!a&&a.scopes.includes(ua.OPERATION_REQUEST)}case wn.SignPayloadRequest:{const a=(yield r()).filter(h=>h.address===e.sourceAddress);return 0!==a.length&&a.some(h=>h.scopes.includes(ua.SIGN))}default:throw new Error("Message not handled")}})}}var fa=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class Nk{constructor(e){this.storageManager=new Dh(e,nn.ACCOUNTS)}getAccounts(){var e;return fa(this,void 0,void 0,function*(){return null!==(e=yield this.storageManager.getAll())&&void 0!==e?e:[]})}getAccount(e){return fa(this,void 0,void 0,function*(){return this.storageManager.getOne(t=>t.accountIdentifier===e)})}addAccount(e){return fa(this,void 0,void 0,function*(){return this.storageManager.addOne(e,t=>t.accountIdentifier===e.accountIdentifier)})}removeAccount(e){return fa(this,void 0,void 0,function*(){return this.storageManager.remove(t=>t.accountIdentifier===e)})}removeAccounts(e){return fa(this,void 0,void 0,function*(){return this.storageManager.remove(t=>e.includes(t.accountIdentifier))})}removeAllAccounts(){return fa(this,void 0,void 0,function*(){return this.storageManager.removeAll()})}hasPermission(e){return fa(this,void 0,void 0,function*(){return S3.hasPermission(e,this.getAccount.bind(this),this.getAccounts.bind(this))})}}const Tl=n=>function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(void 0,void 0,void 0,function*(){const e=Buffer.from((0,cs.hash)(Buffer.from(n,"hex"),5));return ca.encode(e)});let _m=!!Al.beaconSdkDebugEnabled;_m&&console.log("[BEACON]: Debug mode is ON (turned on either by the developer or a browser extension)");class yo{constructor(e){this.name=e}debug(e,...t){ha.debug(this.name,e,t)}log(e,...t){ha.log(this.name,e,t)}warn(e,...t){ha.warn(this.name,e,t)}error(e,...t){ha.error(this.name,e,t)}time(e,t){ha.time(e,t)}timeLog(e,...t){ha.timeLog(e,t)}}new yo("");let ha=new class Lk{constructor(){}debug(e,t,...r){this._log("debug",e,t,r)}log(e,t,...r){this._log("log",e,t,r)}warn(e,t,...r){this._log("warn",e,t,r)}error(e,t,...r){this._log("error",e,t,r)}time(e,t){e?console.time(t):console.timeEnd(t)}timeLog(e,t,...r){this._log("timeLog",e,t,r)}_log(e,t,r,i=[]){if(!_m)return;let a=`[BEACON] ${(new Date).toISOString()} [${t}](${r})`,h=i;switch(i[0]&&"string"==typeof i[0]&&(a+=` ${i[0]}`,h=i.slice(1)),e){case"error":console.group(a),console.error(...h);break;case"warn":console.group(a),console.warn(...h);break;case"debug":console.groupCollapsed(a),console.debug(...h);break;case"timeLog":console.group(a),console.timeLog(...h);break;default:console.group(a),console.log(...h)}console.groupEnd()}};var gi=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const Uk=new yo("Client");var bo=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const hs=new yo("Transport");var Rh=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class jk{constructor(e){this.prefix=e}static isSupported(){return Rh(this,void 0,void 0,function*(){return Promise.resolve(Boolean("undefined"!=typeof window)&&Boolean(window.localStorage))})}get(e){return Rh(this,void 0,void 0,function*(){const t=localStorage.getItem(this.getPrefixedKey(e));if(!t)return"object"==typeof lm[e]?JSON.parse(JSON.stringify(lm[e])):lm[e];try{return JSON.parse(t)}catch(r){return t}})}set(e,t){return Rh(this,void 0,void 0,function*(){return"string"==typeof t?localStorage.setItem(this.getPrefixedKey(e),t):localStorage.setItem(this.getPrefixedKey(e),JSON.stringify(t))})}delete(e){return Rh(this,void 0,void 0,function*(){return Promise.resolve(localStorage.removeItem(this.getPrefixedKey(e)))})}getPrefixedKey(e){return this.prefix?`${this.prefix}-${e}`:e}}new yo("STORAGE");var A3=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class rc{serialize(e){return A3(this,void 0,void 0,function*(){const t=JSON.stringify(e);return ca.encode(Buffer.from(t))})}deserialize(e){return A3(this,void 0,void 0,function*(){if("string"!=typeof e)throw new Error("Encoded payload needs to be a string");return JSON.parse(ca.decode(e).toString())})}}var Dl=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class zk{constructor(e){this.storageManager=new Dh(e,nn.APP_METADATA_LIST)}getAppMetadataList(){var e;return Dl(this,void 0,void 0,function*(){return null!==(e=yield this.storageManager.getAll())&&void 0!==e?e:[]})}getAppMetadata(e){return Dl(this,void 0,void 0,function*(){return this.storageManager.getOne(t=>t.senderId===e)})}addAppMetadata(e){return Dl(this,void 0,void 0,function*(){return this.storageManager.addOne(e,t=>t.senderId===e.senderId)})}removeAppMetadata(e){return Dl(this,void 0,void 0,function*(){return this.storageManager.remove(t=>t.senderId===e)})}removeAppMetadatas(e){return Dl(this,void 0,void 0,function*(){return this.storageManager.remove(t=>e.includes(t.senderId))})}removeAllAppMetadata(){return Dl(this,void 0,void 0,function*(){return this.storageManager.removeAll()})}}var da=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class Gk{constructor(e){this.storageManager=new Dh(e,nn.PERMISSION_LIST)}getPermissions(){var e;return da(this,void 0,void 0,function*(){return null!==(e=yield this.storageManager.getAll())&&void 0!==e?e:[]})}getPermission(e){return da(this,void 0,void 0,function*(){return this.storageManager.getOne(t=>t.accountIdentifier===e)})}addPermission(e){return da(this,void 0,void 0,function*(){return this.storageManager.addOne(e,t=>t.accountIdentifier===e.accountIdentifier&&t.senderId===e.senderId)})}removePermission(e){return da(this,void 0,void 0,function*(){return this.storageManager.remove(t=>t.accountIdentifier===e)})}removePermissions(e){return da(this,void 0,void 0,function*(){return this.storageManager.remove(t=>e.includes(t.accountIdentifier))})}removeAllPermissions(){return da(this,void 0,void 0,function*(){return this.storageManager.removeAll()})}hasPermission(e){return da(this,void 0,void 0,function*(){return S3.hasPermission(e,this.getPermission.bind(this),this.getPermissions.bind(this))})}}var pa=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class wm{constructor(e,t){this.storageManager=new Dh(e,t)}hasPeer(e){return pa(this,void 0,void 0,function*(){return!!(yield this.getPeer(e))})}getPeers(){var e;return pa(this,void 0,void 0,function*(){return null!==(e=yield this.storageManager.getAll())&&void 0!==e?e:[]})}getPeer(e){return pa(this,void 0,void 0,function*(){return this.storageManager.getOne(t=>t.publicKey===e)})}addPeer(e){return pa(this,void 0,void 0,function*(){return this.storageManager.addOne(e,t=>t.publicKey===e.publicKey)})}removePeer(e){return pa(this,void 0,void 0,function*(){return this.storageManager.remove(t=>t.publicKey===e)})}removePeers(e){return pa(this,void 0,void 0,function*(){return this.storageManager.remove(t=>e.includes(t.publicKey))})}removeAllPeers(){return pa(this,void 0,void 0,function*(){return this.storageManager.removeAll()})}}var T3=I(467),ic=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})},qk=I(3014),oc=I.n(qk),sc=(()=>(function(n){n.TEXT="m.text"}(sc||(sc={})),sc))();class Mm{constructor(e,t,r,i){this.type=e,this.sender=t,this.content=r,this.timestamp=i}static from(e){if(Xk(e))return new Mm(e.content.msgtype,e.sender,e.content.body,e.origin_server_ts)}}const D3=n=>"m.room.message"===n.type,Xk=n=>D3(n)&&n.content instanceof Object&&"msgtype"in n.content&&n.content.msgtype===sc.TEXT;var zr=(()=>(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.JOINED=1]="JOINED",n[n.INVITED=2]="INVITED",n[n.LEFT=3]="LEFT"}(zr||(zr={})),zr))();class xr{constructor(e,t=zr.UNKNOWN,r=[],i=[]){this.id=e,this.status=t,this.members=r,this.messages=i}static fromSync(e){var t,r,i;if(!e)return[];function a(h,v){return Object.entries(h).map(([D,L])=>v(D,L))}return[...a(null!==(t=e.join)&&void 0!==t?t:{},xr.fromJoined),...a(null!==(r=e.invite)&&void 0!==r?r:{},xr.fromInvited),...a(null!==(i=e.leave)&&void 0!==i?i:{},xr.fromLeft)]}static from(e,t){return"string"==typeof e?new xr(e,t||zr.UNKNOWN):void 0!==t?new xr(e.id,t,e.members,e.messages):e}static merge(e,t){return t&&t.id===e.id?new xr(e.id,e.status,[...t.members,...e.members].filter((r,i,a)=>a.indexOf(r)===i),[...t.messages,...e.messages]):xr.from(e)}static fromJoined(e,t){const r=[...t.state.events,...t.timeline.events],i=xr.getMembersFromEvents(r),a=xr.getMessagesFromEvents(r);return new xr(e,zr.JOINED,i,a)}static fromInvited(e,t){const r=xr.getMembersFromEvents(t.invite_state.events);return new xr(e,zr.INVITED,r)}static fromLeft(e,t){const r=[...t.state.events,...t.timeline.events],i=xr.getMembersFromEvents(r),a=xr.getMessagesFromEvents(r);return new xr(e,zr.LEFT,i,a)}static getMembersFromEvents(e){return xr.getUniqueEvents(e.filter(t=>(n=>"m.room.create"===n.type&&n.content instanceof Object&&"creator"in n.content)(t)||(n=>"m.room.member"===n.type&&n.content instanceof Object&&"membership"in n.content&&"join"===n.content.membership)(t))).map(t=>t.sender).filter((t,r,i)=>i.indexOf(t)===r)}static getMessagesFromEvents(e){return xr.getUniqueEvents(e.filter(D3)).map(t=>Mm.from(t)).filter(Boolean)}static getUniqueEvents(e){const t={},r=[];return e.forEach((i,a)=>{const h=i.event_id;(void 0===h||!(h in t))&&(void 0!==h&&(t[h]=a),r.push(i))}),r}}var Oh=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const I3=["syncToken","rooms"];class Yk{constructor(e){this.storage=e,this.state={isRunning:!1,userId:void 0,deviceId:void 0,txnNo:0,accessToken:void 0,syncToken:void 0,pollingTimeout:void 0,pollingRetries:0,rooms:{}},this.onStateChangedListeners=new Map,this.waitReadyPromise=new Promise((t,r)=>Oh(this,void 0,void 0,function*(){try{yield this.initFromStorage(),t()}catch(i){r(i)}}))}get(e){return this.state[e]}getRoom(e){const t=xr.from(e,zr.UNKNOWN);return this.state.rooms[t.id]||t}update(e){return Oh(this,void 0,void 0,function*(){yield this.waitReady();const t=Object.assign({},this.state);this.setState(e),this.updateStorage(e),this.notifyListeners(t,this.state,e)})}onStateChanged(e,...t){t.length>0?t.forEach(r=>{this.onStateChangedListeners.set(r,e)}):this.onStateChangedListeners.set("all",e)}waitReady(){return Oh(this,void 0,void 0,function*(){return this.waitReadyPromise})}initFromStorage(){return Oh(this,void 0,void 0,function*(){const e=yield this.storage.get(nn.MATRIX_PRESERVED_STATE);this.setState(e)})}prepareData(e){const r=["rooms"].some(i=>void 0!==e[i])?JSON.parse(JSON.stringify(e)):e;return Object.values(r.rooms||{}).forEach(i=>{i.messages=[]}),r}updateStorage(e){if(Object.entries(e).filter(([r,i])=>I3.includes(r)&&Boolean(i)).length>0){const r={};I3.forEach(i=>{r[i]=this.state[i]}),this.storage.set(nn.MATRIX_PRESERVED_STATE,this.prepareData(r))}}setState(e){this.state={isRunning:e.isRunning||this.state.isRunning,userId:e.userId||this.state.userId,deviceId:e.deviceId||this.state.deviceId,txnNo:e.txnNo||this.state.txnNo,accessToken:e.accessToken||this.state.accessToken,syncToken:e.syncToken||this.state.syncToken,pollingTimeout:e.pollingTimeout||this.state.pollingTimeout,pollingRetries:e.pollingRetries||this.state.pollingRetries,rooms:this.mergeRooms(this.state.rooms,e.rooms)}}mergeRooms(e,t){if(!t)return e;const r=Array.isArray(t)?t:Object.values(t),i=Object.assign({},e);return r.forEach(a=>{i[a.id]=xr.merge(a,e[a.id])}),i}notifyListeners(e,t,r){const i=this.onStateChangedListeners.get("all");i&&i(e,t,r),mm(r).filter(a=>void 0!==r[a]).forEach(a=>{const h=this.onStateChangedListeners.get(a);h&&h(e,t,r)})}}var ac=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const Qk=new yo("MatrixHttpClient");class eB{constructor(e){this.baseUrl=e,this.cancelTokenSource=oc().CancelToken.source()}get(e,t,r){return ac(this,void 0,void 0,function*(){return this.send("GET",e,r,t)})}post(e,t,r,i){return ac(this,void 0,void 0,function*(){return this.send("POST",e,r,i,t)})}put(e,t,r,i){return ac(this,void 0,void 0,function*(){return this.send("PUT",e,r,i,t)})}cancelAllRequests(){return ac(this,void 0,void 0,function*(){return this.cancelTokenSource.cancel("Manually cancelled")})}send(e,t,r,i,a){return ac(this,void 0,void 0,function*(){const h=r?this.getHeaders(r):void 0,v=i?this.getParams(i):void 0;let D;try{D=yield oc().request({method:e,url:t,baseURL:this.apiUrl("/_matrix/client/r0"),headers:h,data:a,params:v,cancelToken:this.cancelTokenSource.token})}catch(L){throw Qk.error("send",L.code,L.message,L.response.data),L.response.data}return D.data})}getHeaders(e){const t={},r=[];if(e.accessToken&&r.push(["Authorization",`Bearer ${e.accessToken}`]),0!==r.length){for(const[i,a]of r)t[i]=a;return t}}getParams(e){if(!e)return;const t=Object.assign(e,{});return mm(t).forEach(r=>void 0===t[r]&&delete t[r]),t}apiUrl(...e){return[this.baseUrl.endsWith("/")?this.baseUrl.substr(0,this.baseUrl.length-1):this.baseUrl,...e.map(i=>i.startsWith("/")?i.substr(1):i)].join("/")}}var Ph=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class tB{constructor(e){this.httpClient=e}createRoom(e,t={}){return Ph(this,void 0,void 0,function*(){return this.httpClient.post("/createRoom",t,{accessToken:e})})}inviteToRoom(e,t,r){return Ph(this,void 0,void 0,function*(){return r.status!==zr.JOINED&&r.status!==zr.UNKNOWN?Promise.reject(`User is not a member of room ${r.id}.`):this.httpClient.post(`/rooms/${encodeURIComponent(r.id)}/invite`,{user_id:t},{accessToken:e})})}joinRoom(e,t){return Ph(this,void 0,void 0,function*(){return t.status===zr.JOINED?Promise.resolve({room_id:t.id}):this.httpClient.post(`/rooms/${encodeURIComponent(t.id)}/join`,{},{accessToken:e})})}getJoinedRooms(e){return Ph(this,void 0,void 0,function*(){return this.httpClient.get("/joined_rooms",void 0,{accessToken:e})})}}class rB{constructor(e){this.httpClient=e}login(e,t,r){return function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){return this.httpClient.post("/login",{type:"m.login.password",identifier:{type:"m.id.user",user:e},password:t,device_id:r})})}}var Em=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};class iB{constructor(e){this.httpClient=e,this.cachedPromises=new Map}sync(e,t){return Em(this,void 0,void 0,function*(){return this.withCache("sync",()=>this.httpClient.get("/sync",{timeout:t?t.pollingTimeout:void 0,since:t?t.syncToken:void 0},{accessToken:e}))})}sendMessage(e,t,r,i){return Em(this,void 0,void 0,function*(){return new Promise((a,h)=>this.scheduleEvent({accessToken:e,roomId:t,type:"m.room.message",content:r,txnId:i,onSuccess:a,onError:h}))})}scheduleEvent(e){this.sendEvent(e)}sendEvent(e){return Em(this,void 0,void 0,function*(){const{roomId:t,type:r,txnId:i,content:a,accessToken:h}=e;try{const v=yield this.httpClient.put(`/rooms/${encodeURIComponent(t)}/send/${r}/${encodeURIComponent(i)}`,a,{accessToken:h});e.onSuccess(v)}catch(v){e.onError(v)}})}withCache(e,t){let r=this.cachedPromises.get(e);return r||(r=t().finally(()=>{this.cachedPromises.delete(e)}),this.cachedPromises.set(e,r)),r}}var mi=(()=>(function(n){n.INVITE="invite",n.MESSAGE="message"}(mi||(mi={})),mi))();class sB extends class oB{constructor(){this.events={}}on(e,t){return"object"!=typeof this.events[e]&&(this.events[e]=[]),this.events[e].push(t),()=>this.removeListener(e,t)}removeListener(e,t){if("object"!=typeof this.events[e])return;if(!t)return void(this.events[e]=[]);const r=this.events[e].indexOf(t);r>-1&&this.events[e].splice(r,1)}removeAllListeners(){Object.keys(this.events).forEach(e=>this.events[e].splice(0,this.events[e].length))}emit(e,...t){"object"==typeof this.events[e]&&[...this.events[e]].forEach(r=>r.apply(this,t))}once(e,t){const r=this.on(e,(...i)=>{r(),t.apply(this,i)});return r}}{constructor(){super(...arguments),this.eventEmitProviders=new Map([[mi.INVITE,()=>[this.isInvite,this.emitInvite.bind(this)]],[mi.MESSAGE,()=>[this.isMessage,this.emitMessage.bind(this)]]])}onStateChanged(e,t,r){for(const i of mm(mi))this.emitIfEvent(mi[i],r)}emitIfEvent(e,t){const r=this.eventEmitProviders.get(e);if(r){const[i,a]=r();i(t)&&a(e,t)}}emitClientEvent(e,t,r){this.emit(e,{type:e,content:t,timestamp:r})}isInvite(e){return!!e.rooms&&e.rooms.some(t=>t.status===zr.INVITED)}emitInvite(e,t){t.rooms.filter(r=>r.status===zr.INVITED).map(r=>[r.id,r.members]).forEach(([r,i])=>{this.emitClientEvent(e,{roomId:r,members:i})})}isMessage(e){return!!e.rooms&&e.rooms.some(t=>t.messages.length>0)}emitMessage(e,t){t.rooms.filter(r=>r.messages.length>0).map(r=>r.messages.map(i=>[r.id,i,i.timestamp])).reduce((r,i)=>r.concat(i),[]).forEach(([r,i,a])=>{this.emitClientEvent(e,{roomId:r,message:i},a)})}}var fr=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const xm=new yo("MatrixClient");class Sm{constructor(e,t,r,i,a,h){this.store=e,this.eventEmitter=t,this.userService=r,this.roomService=i,this.eventService=a,this.httpClient=h,this.isActive=!0,this._isReady=new pi,this.store.onStateChanged((v,D,L)=>{this.eventEmitter.onStateChanged(v,D,L)},"rooms")}static create(e){const t=new Yk(e.storage),r=new sB,i=new eB(e.baseUrl),a=new rB(i),h=new tB(i),v=new iB(i);return new Sm(t,r,a,h,v,i)}get joinedRooms(){return new Promise(e=>fr(this,void 0,void 0,function*(){yield this.isConnected(),e(Object.values(this.store.get("rooms")).filter(t=>t.status===zr.JOINED))}))}get invitedRooms(){return new Promise(e=>fr(this,void 0,void 0,function*(){yield this.isConnected(),e(Object.values(this.store.get("rooms")).filter(t=>t.status===zr.INVITED))}))}get leftRooms(){return new Promise(e=>fr(this,void 0,void 0,function*(){yield this.isConnected(),e(Object.values(this.store.get("rooms")).filter(t=>t.status===zr.LEFT))}))}start(e){return fr(this,void 0,void 0,function*(){const t=yield this.userService.login(e.id,e.password,e.deviceId);yield this.store.update({accessToken:t.access_token});const r=new Promise((i,a)=>fr(this,void 0,void 0,function*(){yield this.poll(0,h=>fr(this,void 0,void 0,function*(){this.store.get("isRunning")||i(),yield this.store.update({isRunning:!0,syncToken:h.next_batch,pollingTimeout:3e4,pollingRetries:0,rooms:xr.fromSync(h.rooms)})}),h=>fr(this,void 0,void 0,function*(){this.store.get("isRunning")||a(h),yield this.store.update({isRunning:!1,pollingRetries:this.store.get("pollingRetries")+1})}))}));return r.then(()=>{this._isReady.resolve()}).catch(console.error),r})}isConnected(){return fr(this,void 0,void 0,function*(){return this._isReady.promise})}stop(){return fr(this,void 0,void 0,function*(){return xm.log("MATRIX CLIENT STOPPED"),this.isActive=!1,this._isReady=new pi,this.httpClient.cancelAllRequests()})}subscribe(e,t){this.eventEmitter.on(e,t)}unsubscribe(e,t){t&&this.eventEmitter.removeListener(e,t)}unsubscribeAll(e){this.eventEmitter.removeListener(e)}getRoomById(e){return fr(this,void 0,void 0,function*(){return yield this.isConnected(),this.store.getRoom(e)})}createTrustedPrivateRoom(...e){return fr(this,void 0,void 0,function*(){return yield this.isConnected(),this.requiresAuthorization("createRoom",t=>fr(this,void 0,void 0,function*(){return(yield this.roomService.createRoom(t,{room_version:"5",invite:e,preset:"public_chat",is_direct:!0})).room_id}))})}inviteToRooms(e,...t){return fr(this,void 0,void 0,function*(){yield this.isConnected(),yield this.requiresAuthorization("invite",r=>Promise.all(t.map(i=>{const a=this.store.getRoom(i);this.roomService.inviteToRoom(r,e,a).catch(h=>xm.warn("inviteToRooms",h))})))})}joinRooms(...e){return fr(this,void 0,void 0,function*(){yield this.isConnected(),yield this.requiresAuthorization("join",t=>Promise.all(e.map(r=>{const i=this.store.getRoom(r);return this.roomService.joinRoom(t,i)})))})}sendTextMessage(e,t){return fr(this,void 0,void 0,function*(){yield this.isConnected(),yield this.requiresAuthorization("send",r=>fr(this,void 0,void 0,function*(){const i=yield this.createTxnId();return this.eventService.sendMessage(r,e,{msgtype:"m.text",body:t},i)}))})}poll(e,t,r){return fr(this,void 0,void 0,function*(){const i=this.store,a=this.sync.bind(this),h=(v,D)=>fr(this,void 0,void 0,function*(){let L=0;try{const j=yield a();t(j)}catch(j){r(j),L=i.get("pollingRetries"),this.isActive&&xm.log(`Retry syncing... ${L} retries so far`)}finally{this.isActive?setTimeout(()=>fr(this,void 0,void 0,function*(){yield h(v,D)}),L>3?5e3+e:e):D(new Error("Syncing stopped manually."))}});return new Promise(h)})}sync(){return fr(this,void 0,void 0,function*(){return this.requiresAuthorization("sync",e=>fr(this,void 0,void 0,function*(){return this.eventService.sync(e,{pollingTimeout:this.store.get("pollingTimeout"),syncToken:this.store.get("syncToken")})}))})}requiresAuthorization(e,t){return fr(this,void 0,void 0,function*(){const r=this.store.get("accessToken");return r?t(r):Promise.reject(`${e} requires authorization but no access token has been provided.`)})}createTxnId(){return fr(this,void 0,void 0,function*(){const e=(new Date).getTime(),t=this.store.get("txnNo");return yield this.store.update({txnNo:t+1}),`m${e}.${t}`})}}var Tn=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const Ht=new yo("P2PCommunicationClient"),R3={[xh.EUROPE_WEST]:["beacon-node-1.diamond.papers.tech","beacon-node-1.sky.papers.tech","beacon-node-2.sky.papers.tech","beacon-node-1.hope.papers.tech","beacon-node-1.hope-2.papers.tech","beacon-node-1.hope-3.papers.tech","beacon-node-1.hope-4.papers.tech","beacon-node-1.hope-5.papers.tech"]};class uB extends class Kk{constructor(e){this.keyPair=e,this.eventHandlers=new Map}getPublicKey(){var e;return ic(this,void 0,void 0,function*(){return fs(null===(e=this.keyPair)||void 0===e?void 0:e.publicKey)})}getPublicKeyHash(){return ic(this,void 0,void 0,function*(){return Cl(this.keyPair.publicKey)})}createCryptoBoxServer(e,t){return ic(this,void 0,void 0,function*(){return(0,T3.serverSessionKeys)({publicKey:(0,mo.SH)(t.publicKey),secretKey:(0,mo.zh)(t.secretKey)},(0,mo.SH)(Buffer.from(e,"hex")))})}createCryptoBoxClient(e,t){return ic(this,void 0,void 0,function*(){return(0,T3.clientSessionKeys)({publicKey:(0,mo.SH)(t.publicKey),secretKey:(0,mo.zh)(t.secretKey)},(0,mo.SH)(Buffer.from(e,"hex")))})}encryptMessageAsymmetric(e,t){return ic(this,void 0,void 0,function*(){return function Mk(n,e){return vo(this,void 0,void 0,function*(){const t=(0,mo.SH)(Buffer.from(e)),r=(0,ec.generateKeyPair)(),a=new cs.BLAKE2b(24).update(r.publicKey,32).update(t,32).digest(),h="string"==typeof n?(0,Sl.cv)(n):n,v=(0,ec.box)(t,r.secretKey,a,h);return fs((0,bk.z)(r.publicKey,v))})}(t,Buffer.from(e,"hex"))})}}{constructor(e,t,r,i,a,h,v){super(t),this.name=e,this.replicationCount=r,this.storage=i,this.iconUrl=h,this.appUrl=v,this.client=new pi,this.activeListeners=new Map,this.ignoredRooms=[],this.loginCounter=0,Ht.log("constructor","P2PCommunicationClient created"),this.ENABLED_RELAY_SERVERS=R3,a&&(this.ENABLED_RELAY_SERVERS=Object.assign(Object.assign({},R3),a))}getPairingRequestInfo(){return Tn(this,void 0,void 0,function*(){const e={id:yield bm(),type:"p2p-pairing-request",name:this.name,version:"3",publicKey:yield this.getPublicKey(),relayServer:(yield this.getRelayServer()).server};return this.iconUrl&&(e.icon=this.iconUrl),this.appUrl&&(e.appUrl=this.appUrl),e})}getPairingResponseInfo(e){return Tn(this,void 0,void 0,function*(){const t={id:e.id,type:"p2p-pairing-response",name:this.name,version:e.version,publicKey:yield this.getPublicKey(),relayServer:(yield this.getRelayServer()).server};return this.iconUrl&&(t.icon=this.iconUrl),this.appUrl&&(t.appUrl=this.appUrl),t})}findBestRegion(){return Tn(this,void 0,void 0,function*(){if(this.selectedRegion)return this.selectedRegion;const e=Object.keys(this.ENABLED_RELAY_SERVERS),t=[];e.forEach(i=>{var a;const h=null!==(a=this.ENABLED_RELAY_SERVERS[i])&&void 0!==a?a:[];if(0===h.length)return;const v=Math.floor(Math.random()*h.length);t.push(this.getBeaconInfo(h[v]).then(D=>({region:i,server:h[v],response:D})).catch(D=>new Promise((L,j)=>{setTimeout(()=>j(D),2e3)})))});const r=yield Promise.race(t);return this.selectedRegion=r.region,r.region})}getRelayServer(){return Tn(this,void 0,void 0,function*(){if(this.relayServer){const a=yield this.relayServer.promise;if(Date.now()-a.localTimestamp<6e4)return{server:a.server,timestamp:a.timestamp};const h=yield this.getBeaconInfo(a.server);return this.relayServer.resolve({server:a.server,timestamp:h.timestamp,localTimestamp:(new Date).getTime()}),{server:a.server,timestamp:h.timestamp}}this.relayServer=new pi;const e=yield this.storage.get(nn.MATRIX_SELECTED_NODE);if(e&&e.length>0){const a=yield this.getBeaconInfo(e);return this.relayServer.resolve({server:e,timestamp:a.timestamp,localTimestamp:(new Date).getTime()}),{server:e,timestamp:a.timestamp}}const t=yield this.findBestRegion(),r=this.ENABLED_RELAY_SERVERS[t];if(!r)throw new Error(`No servers found for region ${t}`);const i=[...r];for(;i.length>0;){const a=Math.floor(Math.random()*i.length),h=i[a];try{const v=yield this.getBeaconInfo(h);return this.storage.set(nn.MATRIX_SELECTED_NODE,h).catch(D=>Ht.log(D)),this.relayServer.resolve({server:h,timestamp:v.timestamp,localTimestamp:(new Date).getTime()}),{server:h,timestamp:v.timestamp}}catch(v){Ht.log(`Ignoring server "${h}", trying another one...`),i.splice(a,1)}}throw this.relayServer.reject("No matrix server reachable!"),new Error("No matrix server reachable!")})}getBeaconInfo(e){return Tn(this,void 0,void 0,function*(){return oc().get(`https://${e}/_synapse/client/beacon/info`).then(t=>({region:t.data.region,known_servers:t.data.known_servers,timestamp:Math.floor(t.data.timestamp)}))})}tryJoinRooms(e,t=1){return Tn(this,void 0,void 0,function*(){try{yield(yield this.client.promise).joinRooms(e)}catch(r){t<=10&&"M_FORBIDDEN"===r.errcode?(Ht.log("Retrying to join...",r),setTimeout(()=>Tn(this,void 0,void 0,function*(){yield this.tryJoinRooms(e,t+1)}),200)):Ht.log(`Failed to join after ${t} tries.`,r)}})}start(){var e,t;return Tn(this,void 0,void 0,function*(){Ht.log("start","starting client"),Ht.log("start","connecting to server");const r=yield this.getRelayServer(),i=Sm.create({baseUrl:`https://${r.server}`,storage:this.storage});if(this.initialListener=j=>Tn(this,void 0,void 0,function*(){this.initialEvent&&this.initialEvent.timestamp&&j&&j.timestamp?this.initialEvent.timestampTn(this,void 0,void 0,function*(){let Q;1===j.content.members.length&&(Q=j.content.members[0]),yield this.tryJoinRooms(j.content.roomId),Q&&(yield this.updateRelayServer(Q),yield this.updatePeerRoom(Q,j.content.roomId))})),!r.timestamp)throw new Error("No timestamp received from relay server");const a=Math.floor(r.timestamp),h=`login:${Math.floor(a/300)}`;Ht.log("start",`login ${h}, ${yield this.getPublicKeyHash()} on ${r.server}`);const v=(0,cs.hash)((0,Sl.cv)(h),32),D=null!==(e=this.keyPair.secretKey)&&void 0!==e?e:this.keyPair.privateKey,L=(0,mo.Xx)(D,v);try{yield i.start({id:yield this.getPublicKeyHash(),password:`ed:${fs(L)}:${yield this.getPublicKey()}`,deviceId:fs(this.keyPair.publicKey)})}catch(j){if(Ht.error("start","Could not log in, retrying"),yield this.reset(),!this.selectedRegion)throw new Error("No region selected.");if(this.loginCounter<=(null!==(t=this.ENABLED_RELAY_SERVERS[this.selectedRegion])&&void 0!==t?t:[]).length)return this.loginCounter++,void this.start();throw Ht.error("start","Tried to log in to every known beacon node, but no login was successful."),new Error("Could not connect to any beacon nodes. Try again later.")}Ht.log("start","login successful, client is ready"),this.client.resolve(i)})}stop(){return Tn(this,void 0,void 0,function*(){Ht.log("stop","stopping client"),this.client.isResolved()&&(yield(yield this.client.promise).stop().catch(e=>Ht.error(e))),yield this.reset()})}reset(){return Tn(this,void 0,void 0,function*(){Ht.log("reset","resetting connection"),yield this.storage.delete(nn.MATRIX_PEER_ROOM_IDS).catch(e=>Ht.log(e)),yield this.storage.delete(nn.MATRIX_PRESERVED_STATE).catch(e=>Ht.log(e)),yield this.storage.delete(nn.MATRIX_SELECTED_NODE).catch(e=>Ht.log(e)),this.relayServer=void 0,this.client=new pi,this.initialEvent=void 0,this.initialListener=void 0})}listenForEncryptedMessage(e,t){return Tn(this,void 0,void 0,function*(){if(this.activeListeners.has(e))return;Ht.log("listenForEncryptedMessage",`start listening for encrypted messages from publicKey ${e}`);const r=yield this.createCryptoBoxServer(e,this.keyPair),i=v=>Tn(this,void 0,void 0,function*(){if(this.isTextMessage(v.content)&&(yield this.isSender(v,e))){let D;yield this.updateRelayServer(v.content.message.sender),yield this.updatePeerRoom(v.content.message.sender,v.content.roomId);try{D=Buffer.from(v.content.message.content,"hex")}catch(L){}if(D&&D.length>=40)try{const L=yield function wk(n,e){return vo(this,void 0,void 0,function*(){const t=n.slice(0,24),r=n.slice(24),i=(0,ec.openSecretBox)(e,t,r);if(!i)throw new Error("Decryption failed");return Buffer.from(i).toString("utf8")})}(D,r.receive);Ht.log("listenForEncryptedMessage",`received a message from ${e}`,L),t(L)}catch(L){}}});this.activeListeners.set(e,i),(yield this.client.promise).subscribe(mi.MESSAGE,i);const a=this.initialEvent;a&&a.timestamp&&(new Date).getTime()-a.timestamp<3e5?(Ht.log("listenForEncryptedMessage","Handling previous event"),yield i(a)):Ht.log("listenForEncryptedMessage","No previous event found");const h=this.initialListener;h&&(yield this.client.promise).unsubscribe(mi.MESSAGE,h),this.initialListener=void 0,this.initialEvent=void 0})}unsubscribeFromEncryptedMessage(e){return Tn(this,void 0,void 0,function*(){const t=this.activeListeners.get(e);!t||((yield this.client.promise).unsubscribe(mi.MESSAGE,t),this.activeListeners.delete(e))})}unsubscribeFromEncryptedMessages(){return Tn(this,void 0,void 0,function*(){(yield this.client.promise).unsubscribeAll(mi.MESSAGE),this.activeListeners.clear()})}sendMessage(e,t){return Tn(this,void 0,void 0,function*(){const r=yield this.createCryptoBoxClient(t.publicKey,this.keyPair),a=_3(yield Cl(Buffer.from(t.publicKey,"hex")),t.relayServer),h=yield this.getRelevantRoom(a);yield this.waitForJoin(h);const v=yield function _k(n,e){return vo(this,void 0,void 0,function*(){const t=Buffer.from((0,y3.randomBytes)(24));return fs(Buffer.concat([t,Buffer.from((0,ec.secretBox)(e,t,Buffer.from(n,"utf8")))]))})}(e,r.send);Ht.log("sendMessage","sending encrypted message",t.publicKey,h,e),(yield this.client.promise).sendTextMessage(h,v).catch(D=>Tn(this,void 0,void 0,function*(){if("M_FORBIDDEN"===D.errcode){Ht.log("sendMessage","M_FORBIDDEN",h,D),yield this.deleteRoomIdFromRooms(h);const L=yield this.getRelevantRoom(a);Ht.log("sendMessage","Old room deleted, new room created",L),(yield this.client.promise).sendTextMessage(L,v).catch(j=>Tn(this,void 0,void 0,function*(){Ht.log("sendMessage","inner error",L,j)}))}else Ht.log("sendMessage","unexpected error",D)}))})}updatePeerRoom(e,t){return Tn(this,void 0,void 0,function*(){Ht.log("updatePeerRoom",e,t);const r=e.split(":");if(r.length<2||!r[0].startsWith("@"))throw new Error("Invalid sender");const i=yield this.storage.get(nn.MATRIX_PEER_ROOM_IDS),a=i[e];a===t&&Ht.debug("updatePeerRoom","rooms are the same, not updating"),Ht.debug("updatePeerRoom","current room",a,"new room",t),a&&a[1]&&(Ht.log("updatePeerRoom",`adding room "${a[1]}" to ignored array`),this.ignoredRooms.push(a[1])),i[e]=t,yield this.storage.set(nn.MATRIX_PEER_ROOM_IDS,i)})}deleteRoomIdFromRooms(e){return Tn(this,void 0,void 0,function*(){const t=yield this.storage.get(nn.MATRIX_PEER_ROOM_IDS),r=Object.entries(t).filter(i=>i[1]!==e).reduce((i,a)=>Object.assign(Object.assign({},i),{[a[0]]:a[1]}),{});yield this.storage.set(nn.MATRIX_PEER_ROOM_IDS,r),this.ignoredRooms.push(e)})}listenForChannelOpening(e){return Tn(this,void 0,void 0,function*(){Ht.debug("listenForChannelOpening"),(yield this.client.promise).subscribe(mi.MESSAGE,t=>Tn(this,void 0,void 0,function*(){if(this.isTextMessage(t.content)&&(yield this.isChannelOpenMessage(t.content))){Ht.log("listenForChannelOpening","channel opening received, trying to decrypt",JSON.stringify(t)),yield this.updateRelayServer(t.content.message.sender),yield this.updatePeerRoom(t.content.message.sender,t.content.roomId);const r=t.content.message.content.split(":"),i=Buffer.from(r[r.length-1],"hex");if(i.length>=40)try{const a=JSON.parse(yield function Ek(n,e,t){return vo(this,void 0,void 0,function*(){const r=(0,mo.zh)(Buffer.from(t)),i=(0,mo.SH)(Buffer.from(e)),a="string"==typeof n?(0,Sl.cv)(n):n,h=a.slice(0,32),v=a.slice(32),L=new cs.BLAKE2b(24).update(h,32).update(i,32).digest(),j=(0,ec.openBox)(h,r,L,v);if(!j)throw new Error("Decryption failed");return Buffer.from(j).toString()})}(i,this.keyPair.publicKey,this.keyPair.secretKey));Ht.log("listenForChannelOpening","channel opening received and decrypted",JSON.stringify(a)),e(Object.assign(Object.assign({},a),{senderId:yield Tl(a.publicKey)}))}catch(a){}}}))})}waitForJoin(e,t=0){return Tn(this,void 0,void 0,function*(){const r=yield(yield this.client.promise).getRoomById(e);if(Ht.log("waitForJoin",`Currently ${r.members.length} members, we need at least 2`),!(r.members.length>=2)){if(t<=200)return Ht.log(`Waiting for join... Try: ${t}`),new Promise(i=>{setTimeout(()=>Tn(this,void 0,void 0,function*(){i(this.waitForJoin(e,t+1))}),100*(t>50?10:1))});throw new Error(`No one joined after ${t} tries.`)}})}sendPairingResponse(e){return Tn(this,void 0,void 0,function*(){Ht.log("sendPairingResponse");const r=_3(yield Cl(Buffer.from(e.publicKey,"hex")),e.relayServer),i=yield(yield this.client.promise).createTrustedPrivateRoom(r);Ht.debug("sendPairingResponse",`Connecting to room "${i}"`),yield this.updatePeerRoom(r,i),yield this.waitForJoin(i),Ht.debug("sendPairingResponse","Successfully joined room.");const a=void 0===e.version?yield this.getPublicKey():JSON.stringify(yield this.getPairingResponseInfo(e));Ht.debug("sendPairingResponse","Sending pairing response",a);const h=yield this.encryptMessageAsymmetric(e.publicKey,a),v=["@channel-open",r,h].join(":");(yield this.client.promise).sendTextMessage(i,v).catch(D=>Tn(this,void 0,void 0,function*(){if("M_FORBIDDEN"===D.errcode){Ht.log("sendPairingResponse","M_FORBIDDEN",i,D),yield this.deleteRoomIdFromRooms(i);const L=yield this.getRelevantRoom(r);Ht.log("sendPairingResponse","Old room deleted, new room created",L),(yield this.client.promise).sendTextMessage(L,v).catch(j=>Tn(this,void 0,void 0,function*(){Ht.log("sendPairingResponse","inner error",L,j)}))}else Ht.log("sendPairingResponse","unexpected error",D)}))})}isTextMessage(e){return e.message.type===sc.TEXT}updateRelayServer(e){return Tn(this,void 0,void 0,function*(){Ht.log("updateRelayServer",e);const t=e.split(":");if(t.length<2||!t[0].startsWith("@"))throw new Error("Invalid sender");const r=t.shift(),i=t.join(":"),a=localStorage.getItem("beacon:communication-peers-dapp")?new wm(this.storage,nn.TRANSPORT_P2P_PEERS_DAPP):new wm(this.storage,nn.TRANSPORT_P2P_PEERS_WALLET),v=(yield a.getPeers()).map(D=>Tn(this,void 0,void 0,function*(){`@${yield Cl(Buffer.from(D.publicKey,"hex"))}`===r&&D.relayServer!==i&&(D.relayServer=i,yield a.addPeer(D))}));yield Promise.all(v)})}isChannelOpenMessage(e){return Tn(this,void 0,void 0,function*(){return e.message.content.startsWith(`@channel-open:@${yield Cl(Buffer.from(yield this.getPublicKey(),"hex"))}`)})}isSender(e,t){return Tn(this,void 0,void 0,function*(){return e.content.message.sender.startsWith(`@${yield Cl(Buffer.from(t,"hex"))}`)})}getRelevantRoom(e){return Tn(this,void 0,void 0,function*(){const t=yield this.storage.get(nn.MATRIX_PEER_ROOM_IDS);let r=t[e];if(!r){Ht.log("getRelevantRoom",`No room found for peer ${e}, checking joined ones.`);const i=yield this.getRelevantJoinedRoom(e);r=i.id,t[e]=i.id,yield this.storage.set(nn.MATRIX_PEER_ROOM_IDS,t)}return Ht.log("getRelevantRoom",`Using room ${r}`),r})}getRelevantJoinedRoom(e){return Tn(this,void 0,void 0,function*(){const t=yield(yield this.client.promise).joinedRooms;Ht.log("checking joined rooms",t,e);const r=t.filter(a=>!this.ignoredRooms.some(h=>a.id===h)).filter(a=>a.members.some(h=>h===e));let i;if(0===r.length||this.ignoredRooms.length>0){Ht.log("getRelevantJoinedRoom","no relevant rooms found, creating new one");const a=yield(yield this.client.promise).createTrustedPrivateRoom(e);i=yield(yield this.client.promise).getRoomById(a),Ht.log("getRelevantJoinedRoom",`waiting for other party to join room: ${i.id}`),yield this.waitForJoin(a),Ht.log("getRelevantJoinedRoom",`new room created and peer invited: ${i.id}`)}else i=r[0],Ht.log("getRelevantJoinedRoom",`channel already open, reusing room ${i.id}`);return i})}}var ma=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const Cm=new yo("P2PTransport");class hB extends class cB extends class Vk{constructor(e,t,r){this.type=Yu.POST_MESSAGE,this._isConnected=Uo.NOT_CONNECTED,this.listeners=[],this.name=e,this.client=t,this.peerManager=r}setEventHandler(e,t){this.client.eventHandlers.set(e,t)}get connectionStatus(){return this._isConnected}static isAvailable(){return bo(this,void 0,void 0,function*(){return Promise.resolve(!1)})}connect(){return bo(this,void 0,void 0,function*(){hs.log("connect"),this._isConnected=Uo.CONNECTED})}disconnect(){return bo(this,void 0,void 0,function*(){hs.log("disconnect"),this._isConnected=Uo.NOT_CONNECTED})}send(e,t){return bo(this,void 0,void 0,function*(){if(t)return this.client.sendMessage(e,t);{const i=(yield this.getPeers()).map(a=>this.client.sendMessage(e,a));return(yield Promise.all(i))[0]}})}addListener(e){return bo(this,void 0,void 0,function*(){hs.debug("addListener"),this.listeners.push(e)})}removeListener(e){return bo(this,void 0,void 0,function*(){hs.log("removeListener"),this.listeners=this.listeners.filter(t=>t!==e)})}getPeers(){return bo(this,void 0,void 0,function*(){return this.peerManager.getPeers()})}addPeer(e,t=!0){return bo(this,void 0,void 0,function*(){hs.log("addPeer","adding peer",e),yield this.peerManager.addPeer(e),yield this.listen(e.publicKey)})}removePeer(e){return bo(this,void 0,void 0,function*(){hs.log("removePeer","removing peer",e),yield this.peerManager.removePeer(e.publicKey),this.client&&(yield this.client.unsubscribeFromEncryptedMessage(e.publicKey))})}removeAllPeers(){return bo(this,void 0,void 0,function*(){hs.log("removeAllPeers"),yield this.peerManager.removeAllPeers(),this.client&&(yield this.client.unsubscribeFromEncryptedMessages())})}notifyListeners(e,t){return bo(this,void 0,void 0,function*(){0===this.listeners.length?hs.warn("notifyListeners","0 listeners notified!",this):hs.log("notifyListeners",`Notifying ${this.listeners.length} listeners`,this),this.listeners.forEach(r=>{r(e,t)})})}}{constructor(e,t,r,i,a,h,v){super(e,new uB(e,t,1,r,i,h,v),new wm(r,a)),this.type=Yu.P2P}static isAvailable(){return ma(this,void 0,void 0,function*(){return Promise.resolve(!0)})}connect(){const e=Object.create(null,{connect:{get:()=>super.connect}});return ma(this,void 0,void 0,function*(){if(this._isConnected!==Uo.NOT_CONNECTED)return;Cm.log("connect"),this._isConnected=Uo.CONNECTING,yield this.client.start();const t=yield this.getPeers();if(t.length>0){Cm.log("connect",`connecting to ${t.length} peers`);const r=t.map(i=>ma(this,void 0,void 0,function*(){return this.listen(i.publicKey)}));Promise.all(r).catch(i=>Cm.error("connect",i))}return yield this.startOpenChannelListener(),e.connect.call(this)})}disconnect(){const e=Object.create(null,{disconnect:{get:()=>super.disconnect}});return ma(this,void 0,void 0,function*(){return yield this.client.stop(),e.disconnect.call(this)})}startOpenChannelListener(){return ma(this,void 0,void 0,function*(){})}getPairingRequestInfo(){return ma(this,void 0,void 0,function*(){return this.client.getPairingRequestInfo()})}listen(e){return ma(this,void 0,void 0,function*(){yield this.client.listenForEncryptedMessage(e,t=>{this.notifyListeners(t,{origin:Eh.P2P,id:e}).catch(i=>{throw i})}).catch(t=>{throw t})})}}{constructor(e,t,r,i,a,h){super(e,t,r,i,nn.TRANSPORT_P2P_PEERS_WALLET,a,h)}addPeer(e,t=!0){const r=Object.create(null,{addPeer:{get:()=>super.addPeer}});return function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){yield r.addPeer.call(this,e),t&&(yield this.client.sendPairingResponse(e))})}}var Nh=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const O3=new yo("IncomingRequestInterceptor");class Rs{static intercept(e){return Nh(this,void 0,void 0,function*(){console.log("INTERCEPTING REQUEST",e.message),"2"===e.message.version?Rs.handleV2Message(e):"3"===e.message.version&&Rs.handleV3Message(e)})}static getAppMetadata(e,t){return Nh(this,void 0,void 0,function*(){const r=yield e.getAppMetadata(t);if(!r)throw new Error("AppMetadata not found");return r})}static handleV2Message(e){return Nh(this,void 0,void 0,function*(){const{message:t,connectionInfo:r,appMetadataManager:i,interceptorCallback:a}=e;switch(t.type){case wn.PermissionRequest:console.log("PERMISSION REQUEST V*",t),t.appMetadata.beaconId&&!t.appMetadata.senderId&&(t.appMetadata.senderId=t.appMetadata.beaconId,delete t.appMetadata.beaconId),yield i.addAppMetadata(t.appMetadata),a(t,r);break;case wn.OperationRequest:{const h=yield Rs.getAppMetadata(i,t.senderId);a(Object.assign({appMetadata:h},t),r)}break;case wn.SignPayloadRequest:{const h=yield Rs.getAppMetadata(i,t.senderId);a(Object.assign({appMetadata:h},t),r)}break;case wn.BroadcastRequest:{const h=yield Rs.getAppMetadata(i,t.senderId);a(Object.assign({appMetadata:h},t),r)}break;default:O3.log("intercept","Message not handled"),P3()}})}static handleV3Message(e){return Nh(this,void 0,void 0,function*(){const{message:t,connectionInfo:r,appMetadataManager:i,interceptorCallback:a}=e,h=t,v=h.message;switch(v.type){case wn.PermissionRequest:yield i.addAppMetadata(Object.assign(Object.assign({},v.blockchainData.appMetadata),{senderId:t.senderId})),a(h,r);break;case wn.BlockchainRequest:a(Object.assign({},h),r);break;default:O3.log("intercept","Message not handled"),P3()}})}}function P3(n){throw new Error("Function not implemented.")}var Am=function(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})};const N3=new yo("OutgoingResponseInterceptor");class lc{static intercept(e){return Am(this,void 0,void 0,function*(){"2"===e.request.version?lc.handleV2Message(e):"3"===e.request.version&&lc.handleV3Message(e)})}static handleV3Message(e){return Am(this,void 0,void 0,function*(){const{message:t,appMetadataManager:r,interceptorCallback:i}=e;console.log("LOGGING OUTGOING V3",t.message,r),i(t)})}static handleV2Message(e){return Am(this,void 0,void 0,function*(){const{senderId:t,request:r,message:i,ownAppMetadata:a,permissionManager:h,appMetadataManager:v,interceptorCallback:D}=e;switch(i.type){case wn.Error:{const L={type:i.type,version:"2",senderId:t,id:i.id,errorType:i.errorType};if(i.errorType===as.TRANSACTION_INVALID_ERROR&&i.errorData){const j=i.errorData;Array.isArray(j)&&j.every(Q=>Boolean(Q.kind)&&Boolean(Q.id))?L.errorData=i.errorData:N3.warn("ErrorData provided is not in correct format. It needs to be an array of RPC errors. It will not be included in the message sent to the dApp")}D(L);break}case wn.Acknowledge:D({type:i.type,version:"2",senderId:t,id:i.id});break;case wn.PermissionResponse:{const L=Object.assign({senderId:t,version:"2",appMetadata:a},i),j=L.publicKey,Q=yield function xk(n){return vo(this,void 0,void 0,function*(){const e={edpk:{length:54,prefix:Buffer.from(new Uint8Array([6,161,159]))},sppk:{length:55,prefix:Buffer.from(new Uint8Array([6,161,161]))},p2pk:{length:55,prefix:Buffer.from(new Uint8Array([6,161,164]))}};let t,r;if(64===n.length)t=e.edpk.prefix,r=n;else{const a=Object.entries(e);for(let h=0;h{this._beaconId.resolve(fs(e.publicKey))})})}removeBeaconEntriesFromStorage(){return Th(this,void 0,void 0,function*(){const e=Object.values(nn);yield Promise.all(e.map(t=>this.storage.delete(t)))})}loadOrCreateBeaconSecret(){return Th(this,void 0,void 0,function*(){const e=yield this.storage.get(nn.BEACON_SDK_SECRET_SEED);if(e&&"string"==typeof e)this._keyPair.resolve(yield b3(e));else{const t=yield bm();yield this.storage.set(nn.BEACON_SDK_SECRET_SEED,t),this._keyPair.resolve(yield b3(t))}})}}{constructor(e){var t;super(e),this.rateLimit=2,this.rateLimitWindowInSeconds=5,this.requestCounter=[],this._transport=new pi,this.accountManager=new Nk(e.storage),this.matrixNodes=null!==(t=e.matrixNodes)&&void 0!==t?t:{},this.handleResponse=(r,i)=>{throw new Error(`not overwritten${JSON.stringify(r)} - ${JSON.stringify(i)}`)}}get transport(){return this._transport.promise}get connectionStatus(){var e,t;return null!==(t=null===(e=this._transport.promiseResult)||void 0===e?void 0:e.connectionStatus)&&void 0!==t?t:Uo.NOT_CONNECTED}get ready(){return this.transport.then(()=>{})}getAccounts(){return gi(this,void 0,void 0,function*(){return this.accountManager.getAccounts()})}getAccount(e){return gi(this,void 0,void 0,function*(){return this.accountManager.getAccount(e)})}removeAccount(e){return gi(this,void 0,void 0,function*(){return this.accountManager.removeAccount(e)})}removeAllAccounts(){return gi(this,void 0,void 0,function*(){return this.accountManager.removeAllAccounts()})}addRequestAndCheckIfRateLimited(){return gi(this,void 0,void 0,function*(){const e=(new Date).getTime();return this.requestCounter=this.requestCounter.filter(t=>t+1e3*this.rateLimitWindowInSeconds>e),this.requestCounter.push(e),this.requestCounter.length>this.rateLimit})}init(e){return gi(this,void 0,void 0,function*(){return this._transport.status===go.RESOLVED?(yield this.transport).type:(yield this.setTransport(e),e.type)})}getOwnAppMetadata(){return gi(this,void 0,void 0,function*(){return{senderId:yield Tl(yield this.beaconId),name:this.name,icon:this.iconUrl}})}getPeers(){return gi(this,void 0,void 0,function*(){return(yield this.transport).getPeers()})}addPeer(e){return gi(this,void 0,void 0,function*(){return(yield this.transport).addPeer(e)})}destroy(){const e=Object.create(null,{destroy:{get:()=>super.destroy}});return gi(this,void 0,void 0,function*(){this._transport.status===go.RESOLVED&&(yield(yield this.transport).disconnect()),yield e.destroy.call(this)})}setTransport(e){return gi(this,void 0,void 0,function*(){e?this._transport.isSettled()?this._transport=pi.resolve(e):this._transport.resolve(e):this._transport.isSettled()&&(this._transport=new pi)})}addListener(e){return gi(this,void 0,void 0,function*(){e.addListener((t,r)=>gi(this,void 0,void 0,function*(){if("string"==typeof t){const i=yield(new rc).deserialize(t);this.handleResponse(i,r)}})).catch(t=>Uk.error("addListener",t))})}sendDisconnectToPeer(e,t){return gi(this,void 0,void 0,function*(){const r={id:yield bm(),version:e.version,senderId:yield Tl(yield this.beaconId),type:wn.Disconnect},i=yield(new rc).serialize(r);yield(null!=t?t:yield this.transport).send(i,e)})}}{constructor(e){super(Object.assign({storage:e&&e.storage?e.storage:new jk},e)),this._isConnected=new pi,this.pendingRequests=[],this.permissionManager=new Gk(this.storage),this.appMetadataManager=new zk(this.storage)}get isConnected(){return this._isConnected.promise}init(){const e=Object.create(null,{init:{get:()=>super.init}});return tr(this,void 0,void 0,function*(){const t=yield this.keyPair,r=new hB(this.name,t,this.storage,this.matrixNodes,this.iconUrl,this.appUrl);return e.init.call(this,r)})}connect(e){return tr(this,void 0,void 0,function*(){return this.handleResponse=(t,r)=>tr(this,void 0,void 0,function*(){if("3"===t.version){const i=t;if(i.message.type===wn.Disconnect)return this.disconnect(i.senderId);this.pendingRequests.some(a=>a[0].id===t.id)||(this.pendingRequests.push([i,r]),yield this.sendAcknowledgeResponse(i,r),yield Rs.intercept({message:i,connectionInfo:r,appMetadataManager:this.appMetadataManager,interceptorCallback:e}))}else{const i=t;if(i.type===wn.Disconnect)return this.disconnect(i.senderId);this.pendingRequests.some(a=>a[0].id===t.id)||(this.pendingRequests.push([i,r]),"1"!==i.version&&(yield this.sendAcknowledgeResponse(i,r)),yield Rs.intercept({message:i,connectionInfo:r,appMetadataManager:this.appMetadataManager,interceptorCallback:e}))}}),this._connect()})}getRegisterPushChallenge(e,t,r=E3){return tr(this,void 0,void 0,function*(){const i=(yield oc().get(`${r}/challenge`)).data,h=fs(["Tezos Signed Message: ",i.id,i.timestamp,t,e].join(" "));return{challenge:i,payloadToSign:"0501"+h.length.toString(16).padStart(8,"0")+h}})}registerPush(e,t,r,i,a,h,v=E3){return tr(this,void 0,void 0,function*(){const D=yield this.storage.get(nn.PUSH_TOKENS),L=D.find(me=>me.publicKey===i&&me.backendUrl===r);if(L)return L;const j=(yield oc().post(`${v}/register`,{name:this.name,challenge:e,accountPublicKey:i,signature:t,backendUrl:r,protocolIdentifier:a,deviceId:h})).data,Q={publicKey:i,backendUrl:r,accessToken:j.accessToken,managementToken:j.managementToken};return D.push(Q),yield this.storage.set(nn.PUSH_TOKENS,D),Q})}_connect(){return tr(this,void 0,void 0,function*(){const e=yield this.transport;e.connectionStatus===Uo.NOT_CONNECTED&&(yield e.connect(),e.addListener((t,r)=>tr(this,void 0,void 0,function*(){if("string"==typeof t){const i=yield(new rc).deserialize(t);this.handleResponse(i,r)}})).catch(t=>pB.log("_connect",t)),this._isConnected.resolve(!0))})}respond(e){return tr(this,void 0,void 0,function*(){console.log("RESPONSE",e);const t=this.pendingRequests.find(r=>r[0].id===e.id);if(!t)throw new Error("No matching request found!");this.pendingRequests=this.pendingRequests.filter(r=>r[0].id!==e.id),yield lc.intercept({senderId:yield Tl(yield this.beaconId),request:t[0],message:e,ownAppMetadata:yield this.getOwnAppMetadata(),permissionManager:this.permissionManager,appMetadataManager:this.appMetadataManager,interceptorCallback:r=>tr(this,void 0,void 0,function*(){yield this.respondToMessage(r,t[1])})})})}getAppMetadataList(){return tr(this,void 0,void 0,function*(){return this.appMetadataManager.getAppMetadataList()})}getAppMetadata(e){return tr(this,void 0,void 0,function*(){return this.appMetadataManager.getAppMetadata(e)})}removeAppMetadata(e){return tr(this,void 0,void 0,function*(){return this.appMetadataManager.removeAppMetadata(e)})}removeAllAppMetadata(){return tr(this,void 0,void 0,function*(){return this.appMetadataManager.removeAllAppMetadata()})}getPermissions(){return tr(this,void 0,void 0,function*(){return this.permissionManager.getPermissions()})}getPermission(e){return tr(this,void 0,void 0,function*(){return this.permissionManager.getPermission(e)})}removePermission(e){return tr(this,void 0,void 0,function*(){return this.permissionManager.removePermission(e)})}removeAllPermissions(){return tr(this,void 0,void 0,function*(){return this.permissionManager.removeAllPermissions()})}addPeer(e,t=!0){return tr(this,void 0,void 0,function*(){const r=Object.assign(Object.assign({},e),{senderId:yield Tl(e.publicKey)});return(yield this.transport).addPeer(r,t)})}removePeer(e,t=!1){return tr(this,void 0,void 0,function*(){const r=(yield this.transport).removePeer(e);return yield this.removePermissionsForPeers([e]),t&&(yield this.sendDisconnectToPeer(e)),r})}removeAllPeers(e=!1){return tr(this,void 0,void 0,function*(){const t=yield(yield this.transport).getPeers(),r=(yield this.transport).removeAllPeers();if(yield this.removePermissionsForPeers(t),e){const i=t.map(a=>this.sendDisconnectToPeer(a));yield Promise.all(i)}return r})}removePermissionsForPeers(e){return tr(this,void 0,void 0,function*(){const t=yield this.permissionManager.getPermissions(),r=e.map(h=>h.senderId),a=t.filter(h=>r.includes(h.appMetadata.senderId)).map(h=>h.accountIdentifier);yield this.permissionManager.removePermissions(a)})}sendAcknowledgeResponse(e,t){return tr(this,void 0,void 0,function*(){const r={id:e.id,type:wn.Acknowledge};yield lc.intercept({senderId:yield Tl(yield this.beaconId),request:e,message:r,ownAppMetadata:yield this.getOwnAppMetadata(),permissionManager:this.permissionManager,appMetadataManager:this.appMetadataManager,interceptorCallback:i=>tr(this,void 0,void 0,function*(){yield this.respondToMessage(i,t)})})})}respondToMessage(e,t){return tr(this,void 0,void 0,function*(){const r=yield(new rc).serialize(e);if(t){const a=(yield this.getPeers()).find(h=>h.publicKey===t.id);yield(yield this.transport).send(r,a)}else yield(yield this.transport).send(r)})}disconnect(e){return tr(this,void 0,void 0,function*(){const i=(yield(yield this.transport).getPeers()).find(a=>a.senderId===e);i&&(yield this.removePeer(i))})}}var Vr=(()=>(function(n){n.ACCOUNTS="explorer:accounts",n.REQUEST_ID_PREFIX="explorer:req_id_",n.METAMASK_BUSY="explorer:metamask_busy"}(Vr||(Vr={})),Vr))(),kh=(()=>(function(n){n.METAMASK="metamask"}(kh||(kh={})),kh))();let Os=(()=>{class n{constructor(t){var r;this._storage=t,this._accounts$=new Vi([]),this.hasAccounts=!1,this.accounts$=this._accounts$.asObservable();const i=JSON.parse(null!==(r=localStorage.getItem(Vr.ACCOUNTS))&&void 0!==r?r:"[]");this._accounts$.next(i),this.accounts$.subscribe(a=>{this.hasAccounts=a.length>0})}addOrUpdateAccount(t){var r=this;return Ot(function*(){const i=r._accounts$.value;i.every(a=>a.address!==t.address)&&i.push(t),localStorage.setItem(Vr.ACCOUNTS,JSON.stringify(i)),r._accounts$.next(i)})()}removeAccount(t){var r=this;return Ot(function*(){const i=r._accounts$.value.filter(a=>a.address!==t.address);localStorage.setItem(Vr.ACCOUNTS,JSON.stringify(i)),r._accounts$.next(i)})()}disconnect(){var t=this;return Ot(function*(){Object.keys(localStorage).forEach(r=>{r.startsWith("explorer:")&&localStorage.removeItem(r)}),t._accounts$.next([]),t.hasAccounts=!1})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(m3))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const uc="npm:tezos-metamask-snap",mB=function(){var n=Ot(function*(){return yield window.ethereum.request({method:"wallet_getSnaps"})});return function(){return n.apply(this,arguments)}}(),vB=function(){var n=Ot(function*(e=uc,t={}){yield window.ethereum.request({method:"wallet_requestSnaps",params:{[e]:t}})});return function(){return n.apply(this,arguments)}}(),k3=function(){var n=Ot(function*(e){try{const t=yield mB();return Object.values(t).find(r=>r.id===uc&&(!e||r.version===e))}catch(t){return void console.log("Failed to obtain installed snap",t)}});return function(t){return n.apply(this,arguments)}}(),yB=function(){var n=Ot(function*(){const e=yield window.ethereum.request({method:"wallet_invokeSnap",params:{snapId:uc,request:{method:"tezos_getAccount"}}});return console.log("tezos_getAccount",e),{publicKey:null==e?void 0:e.publicKey,address:null==e?void 0:e.address}});return function(){return n.apply(this,arguments)}}(),Tm=function(){var n=Ot(function*(e){const t=yield window.ethereum.request({method:"wallet_invokeSnap",params:{snapId:uc,request:{method:"tezos_sendOperation",params:{payload:e}}}});return console.log("tezos_sendOperation",t),t.opHash});return function(t){return n.apply(this,arguments)}}(),bB=function(){var n=Ot(function*(e){const t=yield window.ethereum.request({method:"wallet_invokeSnap",params:{snapId:uc,request:{method:"tezos_signPayload",params:{payload:e}}}});return console.log("tezos_signPayload",t),t.signature.prefixSig});return function(t){return n.apply(this,arguments)}}();var _o=(()=>(function(n){n.PAGE_OPEN_PING="explorer:evt_page_open_ping",n.PAGE_OPEN_PONG="explorer:evt_page_open_pong",n.CLEAR="explorer:evt_clear"}(_o||(_o={})),_o))();let Dm,B3=(()=>{class n{constructor(){this.clear$=new vn,this.tabWillClose$=new vn,this.tabClosedEventHandlers=[],this.setupListener()}sendEvent(t){localStorage[t]=Date.now()}setupListener(){var t=this;localStorage[_o.PAGE_OPEN_PING]=Date.now();var r=function(){var i=Ot(function*(a){a.key===_o.PAGE_OPEN_PING&&(localStorage[_o.PAGE_OPEN_PONG]=Date.now()),a.key===_o.PAGE_OPEN_PONG&&console.log("Another page was opened"),a.key===_o.CLEAR&&(console.log("CLEAR REQUEST RECEIVED"),t.clear$.next(!0))});return function(h){return i.apply(this,arguments)}}();window.addEventListener("storage",r,!1),window.addEventListener("beforeunload",i=>{this.tabWillClose$.emit(!0),this.tabClosedEventHandlers.forEach(a=>{a()})})}addTabClosedEventHandler(t){this.tabClosedEventHandlers.push(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),_B=(()=>{class n{constructor(){this._focusTrapStack=[]}register(t){this._focusTrapStack=this._focusTrapStack.filter(i=>i!==t);let r=this._focusTrapStack;r.length&&r[r.length-1]._disable(),r.push(t),t._enable()}deregister(t){t._disable();const r=this._focusTrapStack,i=r.indexOf(t);-1!==i&&(r.splice(i,1),r.length&&r[r.length-1]._enable())}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();try{Dm="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){Dm=!1}let L3=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?X2(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!Dm)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(Mt(Au))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),F3=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function MB(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const r=function wB(n){try{return n.frameElement}catch(e){return null}}(function IB(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(r&&(-1===H3(r)||!this.isVisible(r)))return!1;let i=t.nodeName.toLowerCase(),a=H3(t);return t.hasAttribute("contenteditable")?-1!==a:!("iframe"===i||"object"===i||this._platform.WEBKIT&&this._platform.IOS&&!function TB(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===i?!!t.hasAttribute("controls")&&-1!==a:"video"===i?-1!==a&&(null!==a||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,r){return function DB(n){return!function xB(n){return function CB(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function EB(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function SB(n){return function AB(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||U3(n))}(t)&&!this.isDisabled(t)&&((null==r?void 0:r.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(Mt(L3))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function U3(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function H3(n){if(!U3(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}function V3(n){return null!=n&&"false"!=`${n}`}class RB{constructor(e,t,r,i,a=!1){this._element=e,this._checker=t,this._ngZone=r,this._document=i,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,a||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement()))})}focusFirstTabbableElementWhenReady(){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement()))})}focusLastTabbableElementWhenReady(){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement()))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let r=0;r=0;r--){let i=t[r].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[r]):null;if(i)return i}return null}_createAnchor(){const e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(sh(1)).subscribe(e)}}let OB=(()=>{class n{constructor(t,r,i){this._checker=t,this._ngZone=r,this._document=i}create(t,r=!1){return new RB(t,this._checker,this._ngZone,this._document,r)}}return n.\u0275fac=function(t){return new(t||n)(Mt(F3),Mt(or),Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),PB=(()=>{class n{constructor(t,r,i){this._elementRef=t,this._focusTrapFactory=r,this._previouslyFocusedElement=null,this._autoCapture=!1,this._document=i,this.focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement,!0)}get enabled(){return this.focusTrap.enabled}set enabled(t){this.focusTrap.enabled=V3(t)}get autoCapture(){return this._autoCapture}set autoCapture(t){this._autoCapture=V3(t)}ngOnDestroy(){this.focusTrap.destroy(),this._previouslyFocusedElement&&(this._previouslyFocusedElement.focus(),this._previouslyFocusedElement=null)}ngAfterContentInit(){this.focusTrap.attachAnchors(),this.autoCapture&&this._captureFocus()}ngDoCheck(){this.focusTrap.hasAttached()||this.focusTrap.attachAnchors()}ngOnChanges(t){const r=t.autoCapture;r&&!r.firstChange&&this.autoCapture&&this.focusTrap.hasAttached()&&this._captureFocus()}_captureFocus(){this._previouslyFocusedElement=this._document.activeElement,this.focusTrap.focusInitialElementWhenReady()}}return n.\u0275fac=function(t){return new(t||n)(ot(kr),ot(OB),ot(wr))},n.\u0275dir=$t({type:n,selectors:[["","focusTrap",""]],inputs:{enabled:["cdkTrapFocus","enabled"],autoCapture:["cdkTrapFocusAutoCapture","autoCapture"]},exportAs:["focusTrap"],features:[qr]}),n})(),j3=(()=>{class n{static forRoot(){return{ngModule:n,providers:[_B,L3,F3]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Pu]]}),n})();const NB=["*"];let Xr=(()=>{class n{constructor(){this.hide=()=>{},this.setClass=()=>{}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})(),$3=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();const Bh={backdrop:!0,keyboard:!0,focus:!0,show:!1,ignoreBackdropClick:!1,class:"",animated:!0,initialState:{},closeInterceptor:void 0},kB=new Kt("override-default-config");let BB=(()=>{class n{constructor(t,r,i){this._element=r,this._renderer=i,this.isShown=!1,this.isAnimated=!1,this.isModalHiding=!1,this.clickStartedInContent=!1,this.config=Object.assign({},t)}ngOnInit(){this.isAnimated&&this._renderer.addClass(this._element.nativeElement,"fade"),this._renderer.setStyle(this._element.nativeElement,"display","block"),setTimeout(()=>{this.isShown=!0,this._renderer.addClass(this._element.nativeElement,gl()?"in":"show")},this.isAnimated?150:0),document&&document.body&&(this.bsModalService&&1===this.bsModalService.getModalsCount()&&(this.bsModalService.checkScrollbar(),this.bsModalService.setScrollbar()),this._renderer.addClass(document.body,"modal-open"),this._renderer.setStyle(document.body,"overflow-y","hidden")),this._element.nativeElement&&this._element.nativeElement.focus()}onClickStarted(t){this.clickStartedInContent=t.target!==this._element.nativeElement}onClickStop(t){var r;this.config.ignoreBackdropClick||"static"===this.config.backdrop||t.target!==this._element.nativeElement||this.clickStartedInContent?this.clickStartedInContent=!1:(null===(r=this.bsModalService)||void 0===r||r.setDismissReason("backdrop-click"),this.hide())}onPopState(){var t;null===(t=this.bsModalService)||void 0===t||t.setDismissReason("browser-back-navigation-clicked"),this.hide()}onEsc(t){var r,i;!this.isShown||((27===t.keyCode||"Escape"===t.key)&&t.preventDefault(),this.config.keyboard&&this.level===(null===(r=this.bsModalService)||void 0===r?void 0:r.getModalsCount())&&(null===(i=this.bsModalService)||void 0===i||i.setDismissReason("esc"),this.hide()))}ngOnDestroy(){this.isShown&&this._hide()}hide(){if(!this.isModalHiding&&this.isShown){if(this.config.closeInterceptor)return void this.config.closeInterceptor().then(()=>this._hide(),()=>{});this._hide()}}_hide(){this.isModalHiding=!0,this._renderer.removeClass(this._element.nativeElement,gl()?"in":"show"),setTimeout(()=>{var t,r;this.isShown=!1,document&&document.body&&1===(null===(t=this.bsModalService)||void 0===t?void 0:t.getModalsCount())&&(this._renderer.removeClass(document.body,"modal-open"),this._renderer.setStyle(document.body,"overflow-y","")),null===(r=this.bsModalService)||void 0===r||r.hide(this.config.id),this.isModalHiding=!1},this.isAnimated?300:0)}}return n.\u0275fac=function(t){return new(t||n)(ot($3),ot(kr),ot(Fi))},n.\u0275cmp=Un({type:n,selectors:[["modal-container"]],hostAttrs:["role","dialog","tabindex","-1",1,"modal"],hostVars:3,hostBindings:function(t,r){1&t&&Tt("mousedown",function(a){return r.onClickStarted(a)})("click",function(a){return r.onClickStop(a)})("popstate",function(){return r.onPopState()},!1,D0)("keydown.esc",function(a){return r.onEsc(a)},!1,D0),2&t&&ri("aria-modal",!0)("aria-labelledby",r.config.ariaLabelledBy)("aria-describedby",r.config.ariaDescribedby)},ngContentSelectors:NB,decls:3,vars:2,consts:[["role","document","focusTrap",""],[1,"modal-content"]],template:function(t,r){1&t&&(function c_(n){const e=Et()[16][6];if(!e.projection){const r=e.projection=Xl(n?n.length:1,null),i=r.slice();let a=e.child;for(;null!==a;){const h=n?m8(a,n):0;null!==h&&(i[h]?i[h].projectionNext=a:r[h]=a,i[h]=a),a=a.next}}}(),Ue(0,"div",0)(1,"div",1),function f_(n,e=0,t){const r=Et(),i=Cn(),a=ja(i,20+n,16,null,t||null);null===a.projection&&(a.projection=e),Vd(),64!=(64&a.flags)&&function IA(n,e,t){Ey(e[11],0,e,t,py(n,t,e),yy(t.parent||e[6],t,e))}(i,r,a)}(2),Ge()()),2&t&&so("modal-dialog"+(r.config.class?" "+r.config.class:""))},directives:[PB],encapsulation:2}),n})(),LB=(()=>{class n{constructor(t,r){this._isAnimated=!1,this._isShown=!1,this.element=t,this.renderer=r}get isAnimated(){return this._isAnimated}set isAnimated(t){this._isAnimated=t}get isShown(){return this._isShown}set isShown(t){this._isShown=t,t?this.renderer.addClass(this.element.nativeElement,"in"):this.renderer.removeClass(this.element.nativeElement,"in"),gl()||(t?this.renderer.addClass(this.element.nativeElement,"show"):this.renderer.removeClass(this.element.nativeElement,"show"))}ngOnInit(){this.isAnimated&&(this.renderer.addClass(this.element.nativeElement,"fade"),class N7{static reflow(e){}static getStyles(e){let t=e.ownerDocument.defaultView;return(!t||!t.opener)&&(t=sr),t.getComputedStyle(e)}static stackOverflowConfig(){const e=function P7(){const n=Lu(),e=Object.keys(n).find(t=>n[t]);return Zf[e]}();return{crossorigin:"bs3"!==e?"anonymous":void 0,integrity:"bs5"===e?"sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We":"bs4"===e?"sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2":void 0,cdnLink:"bs5"===e?"https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css":"bs4"===e?"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css":"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"}}}.reflow(this.element.nativeElement)),this.isShown=!0}}return n.\u0275fac=function(t){return new(t||n)(ot(kr),ot(Fi))},n.\u0275cmp=Un({type:n,selectors:[["bs-modal-backdrop"]],hostAttrs:[1,"modal-backdrop"],decls:0,vars:0,template:function(t,r){},encapsulation:2}),n})(),FB=1,Rm=(()=>{class n{constructor(t,r,i){this.clf=r,this.modalDefaultOption=i,this.onShow=new vn,this.onShown=new vn,this.onHide=new vn,this.onHidden=new vn,this.isBodyOverflowing=!1,this.originalBodyPadding=0,this.scrollbarWidth=0,this.modalsCount=0,this.loaders=[],this._backdropLoader=this.clf.createLoader(),this._renderer=t.createRenderer(null,null),this.config=i?Object.assign({},Bh,i):Bh}show(t,r){this.modalsCount++,this._createLoaders();const i=(null==r?void 0:r.id)||FB++;return this.config=this.modalDefaultOption?Object.assign({},Bh,this.modalDefaultOption,r):Object.assign({},Bh,r),this.config.id=i,this._showBackdrop(),this.lastDismissReason=void 0,this._showModal(t)}hide(t){(1===this.modalsCount||null==t)&&(this._hideBackdrop(),this.resetScrollbar()),this.modalsCount=this.modalsCount>=1&&null!=t?this.modalsCount-1:0,setTimeout(()=>{this._hideModal(t),this.removeLoaders(t)},this.config.animated?150:0)}_showBackdrop(){const t=!0===this.config.backdrop||"static"===this.config.backdrop,r=!this.backdropRef||!this.backdropRef.instance.isShown;1===this.modalsCount&&(this.removeBackdrop(),t&&r&&(this._backdropLoader.attach(LB).to("body").show({isAnimated:this.config.animated}),this.backdropRef=this._backdropLoader._componentRef))}_hideBackdrop(){this.backdropRef&&(this.backdropRef.instance.isShown=!1,setTimeout(()=>this.removeBackdrop(),this.config.animated?150:0))}_showModal(t){var r;const i=this.loaders[this.loaders.length-1];if(this.config&&this.config.providers)for(const v of this.config.providers)i.provide(v);const a=new Xr,h=i.provide({provide:$3,useValue:this.config}).provide({provide:Xr,useValue:a}).attach(BB).to("body");return a.hide=()=>{var v;return null===(v=h.instance)||void 0===v?void 0:v.hide()},a.setClass=v=>{h.instance&&(h.instance.config.class=v)},a.onHidden=new vn,a.onHide=new vn,this.copyEvent(i.onBeforeHide,a.onHide),this.copyEvent(i.onHidden,a.onHidden),h.show({content:t,isAnimated:this.config.animated,initialState:this.config.initialState,bsModalService:this,id:this.config.id}),h.instance&&(h.instance.level=this.getModalsCount(),a.content=i.getInnerComponent(),a.id=null===(r=h.instance.config)||void 0===r?void 0:r.id),a}_hideModal(t){if(null!=t){const r=this.loaders.findIndex(a=>{var h;return(null===(h=a.instance)||void 0===h?void 0:h.config.id)===t}),i=this.loaders[r];i&&i.hide(t)}else this.loaders.forEach(r=>{r.instance&&r.hide(r.instance.config.id)})}getModalsCount(){return this.modalsCount}setDismissReason(t){this.lastDismissReason=t}removeBackdrop(){this._renderer.removeClass(document.body,"modal-open"),this._renderer.setStyle(document.body,"overflow-y",""),this._backdropLoader.hide(),this.backdropRef=void 0}checkScrollbar(){this.isBodyOverflowing=document.body.clientWidth{var a;return(null===(a=i.instance)||void 0===a?void 0:a.config.id)===t});r>=0&&(this.loaders.splice(r,1),this.loaders.forEach((i,a)=>{i.instance&&(i.instance.level=a+1)}))}else this.loaders.splice(0,this.loaders.length)}copyEvent(t,r){t.subscribe(i=>{r.emit(this.lastDismissReason||i)})}}return n.\u0275fac=function(t){return new(t||n)(Mt(Qs),Mt(nh),Mt(kB,8))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"platform"}),n})();j3.forRoot();let UB=(()=>{class n{static forRoot(){return{ngModule:n,providers:[Rm,nh,eh]}}static forChild(){return{ngModule:n,providers:[Rm,nh,eh]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[j3]]}),n})(),HB=(()=>{class n{constructor(t){this.bsModalRef=t,this.text="Loading..."}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-loading-modal"]],decls:7,vars:1,consts:[[1,"modal-body"],[1,"d-flex","align-items-center","justify-content-between"],[1,"m-0"],["role","status",1,"spinner-border","mr-3"],[1,"sr-only"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1)(2,"h5",2),ft(3),Ge(),Ue(4,"div",3)(5,"span",4),ft(6,"Loading..."),Ge()()()()),2&t&&(bt(3),Nr(r.text))},styles:[""]}),n})(),VB=(()=>{class n{constructor(t){this.bsModalRef=t,this.title="",this.text=""}confirm(){var t;this.confirmCallback&&this.confirmCallback(),null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("confirm"),this.bsModalRef.hide()}decline(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("decline"),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-confirm-modal"]],decls:14,vars:2,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-primary","btn-circle",3,"click"],["type","button",1,"btn","btn-primary","btn-circle","button",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2),Ge(),Ue(3,"button",2),Tt("click",function(){return r.decline()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"p"),ft(8),Ge()(),Ue(9,"div",5)(10,"button",6),Tt("click",function(){return r.decline()}),ft(11," Close "),Ge(),Ue(12,"button",7),Tt("click",function(){return r.confirm()}),ft(13," Confirm "),Ge()()),2&t&&(bt(2),Nr(r.title),bt(6),Nr(r.text))},styles:[".button[_ngcontent-%COMP%]{width:100px;height:40px;padding:0 24px;gap:10px;background-color:#0f61ff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#183fd7}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{color:#0f61ff;border-color:#d2d2d7;background-color:transparent}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]:hover{color:#0f61ff;border-color:#0f61ff;background-color:transparent;outline:none}"]}),n})();function Fh(n,e){return new Z(t=>{const r=n.length;if(0===r)return void t.complete();const i=new Array(r);let a=0,h=0;for(let v=0;v{L||(L=!0,h++),i[v]=j},error:j=>t.error(j),complete:()=>{a++,(a===r||!L)&&(h===r&&t.next(e?e.reduce((j,Q,me)=>(j[Q]=i[me],j),{}):i),t.complete())}}))}})}let z3=(()=>{class n{constructor(t,r){this._renderer=t,this._elementRef=r,this.onChange=i=>{},this.onTouched=()=>{}}setProperty(t,r){this._renderer.setProperty(this._elementRef.nativeElement,t,r)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(ot(Fi),ot(kr))},n.\u0275dir=$t({type:n}),n})(),va=(()=>{class n extends z3{}return n.\u0275fac=function(){let e;return function(r){return(e||(e=Ur(n)))(r||n)}}(),n.\u0275dir=$t({type:n,features:[Hn]}),n})();const Ho=new Kt("NgValueAccessor"),zB={provide:Ho,useExisting:We(()=>Il),multi:!0},KB=new Kt("CompositionEventMode");let Il=(()=>{class n extends z3{constructor(t,r,i){super(t,r),this._compositionMode=i,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function GB(){const n=ko()?ko().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return n.\u0275fac=function(t){return new(t||n)(ot(Fi),ot(kr),ot(KB,8))},n.\u0275dir=$t({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,r){1&t&&Tt("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},features:[ir([zB]),Hn]}),n})();const Yr=new Kt("NgValidators"),Ns=new Kt("NgAsyncValidators");function tx(n){return null!=n}function nx(n){const e=pu(n)?Me(n):n;return fp(e),e}function rx(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function ix(n,e){return e.map(t=>t(n))}function ox(n){return n.map(e=>function WB(n){return!n.validate}(e)?e:t=>e.validate(t))}function Om(n){return null!=n?function sx(n){if(!n)return null;const e=n.filter(tx);return 0==e.length?null:function(t){return rx(ix(t,e))}}(ox(n)):null}function Pm(n){return null!=n?function ax(n){if(!n)return null;const e=n.filter(tx);return 0==e.length?null:function(t){return function jB(...n){if(1===n.length){const e=n[0];if(M(e))return Fh(e,null);if(_(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return Fh(t.map(r=>e[r]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return Fh(n=1===n.length&&M(n[0])?n[0]:n,null).pipe(u(t=>e(...t)))}return Fh(n,null)}(ix(t,e).map(nx)).pipe(u(rx))}}(ox(n)):null}function lx(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function Nm(n){return n?Array.isArray(n)?n:[n]:[]}function Hh(n,e){return Array.isArray(n)?n.includes(e):n===e}function fx(n,e){const t=Nm(e);return Nm(n).forEach(i=>{Hh(t,i)||t.push(i)}),t}function hx(n,e){return Nm(e).filter(t=>!Hh(n,t))}class dx{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=Om(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=Pm(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}class ks extends dx{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class si extends dx{get formDirective(){return null}get path(){return null}}let Vh=(()=>{class n extends class px{constructor(e){this._cd=e}is(e){var t,r,i;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(i=null===(r=this._cd)||void 0===r?void 0:r.control)||void 0===i?void 0:i[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(ot(ks,2))},n.\u0275dir=$t({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,r){2&t&&df("ng-untouched",r.is("untouched"))("ng-touched",r.is("touched"))("ng-pristine",r.is("pristine"))("ng-dirty",r.is("dirty"))("ng-valid",r.is("valid"))("ng-invalid",r.is("invalid"))("ng-pending",r.is("pending"))},features:[Hn]}),n})();function cc(n,e){(function Lm(n,e){const t=function ux(n){return n._rawValidators}(n);null!==e.validator?n.setValidators(lx(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const r=function cx(n){return n._rawAsyncValidators}(n);null!==e.asyncValidator?n.setAsyncValidators(lx(r,e.asyncValidator)):"function"==typeof r&&n.setAsyncValidators([r]);const i=()=>n.updateValueAndValidity();Gh(e._rawValidators,i),Gh(e._rawAsyncValidators,i)})(n,e),e.valueAccessor.writeValue(n.value),function rL(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&mx(n,e)})}(n,e),function oL(n,e){const t=(r,i)=>{e.valueAccessor.writeValue(r),i&&e.viewToModelUpdate(r)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function iL(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&mx(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function nL(n,e){if(e.valueAccessor.setDisabledState){const t=r=>{e.valueAccessor.setDisabledState(r)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function Gh(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function mx(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function Hm(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const fc="VALID",qh="INVALID",Rl="PENDING",hc="DISABLED";function jm(n){return(Wh(n)?n.validators:n)||null}function _x(n){return Array.isArray(n)?Om(n):n||null}function $m(n,e){return(Wh(e)?e.asyncValidators:n)||null}function wx(n){return Array.isArray(n)?Pm(n):n||null}function Wh(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}const zm=n=>n instanceof Km;function Ex(n){return(n=>n instanceof Cx)(n)?n.value:n.getRawValue()}function xx(n,e){const t=zm(n),r=n.controls;if(!(t?Object.keys(r):r).length)throw new Ne(1e3,"");if(!r[e])throw new Ne(1001,"")}function Sx(n,e){zm(n),n._forEachChild((r,i)=>{if(void 0===e[i])throw new Ne(1002,"")})}class Gm{constructor(e,t){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=_x(this._rawValidators),this._composedAsyncValidatorFn=wx(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===fc}get invalid(){return this.status===qh}get pending(){return this.status==Rl}get disabled(){return this.status===hc}get enabled(){return this.status!==hc}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=_x(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=wx(e)}addValidators(e){this.setValidators(fx(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(fx(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(hx(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(hx(e,this._rawAsyncValidators))}hasValidator(e){return Hh(this._rawValidators,e)}hasAsyncValidator(e){return Hh(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Rl,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=hc,this.errors=null,this._forEachChild(r=>{r.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=fc,this._forEachChild(r=>{r.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===fc||this.status===Rl)&&this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?hc:fc}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Rl,this._hasOwnPendingAsyncValidator=!0;const t=nx(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(r=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(r,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function uL(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(t)),Array.isArray(e)&&0===e.length))return null;let r=n;return e.forEach(i=>{r=zm(r)?r.controls.hasOwnProperty(i)?r.controls[i]:null:(n=>n instanceof fL)(r)&&r.at(i)||null}),r}(this,e,".")}getError(e,t){const r=t?this.get(t):this;return r&&r.errors?r.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new vn,this.statusChanges=new vn}_calculateStatus(){return this._allControlsDisabled()?hc:this.errors?qh:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Rl)?Rl:this._anyControlsHaveStatus(qh)?qh:fc}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Wh(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class Cx extends Gm{constructor(e=null,t,r){super(jm(t),$m(r,t)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Wh(t)&&t.initialValueIsDefault&&(this.defaultValue=this._isBoxedValue(e)?e.value:e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(r=>r(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){Hm(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){Hm(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class Km extends Gm{constructor(e,t,r){super(jm(t),$m(r,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,r={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){Sx(this,e),Object.keys(e).forEach(r=>{xx(this,r),this.controls[r].setValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(r=>{this.controls[r]&&this.controls[r].patchValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((r,i)=>{r.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,r)=>(e[r]=Ex(t),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,r)=>!!r._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const r=this.controls[t];r&&e(r,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const r=this.controls[t];if(this.contains(t)&&e(r))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,r)=>((t.enabled||this.disabled)&&(e[r]=t.value),e))}_reduceChildren(e,t){let r=e;return this._forEachChild((i,a)=>{r=t(r,i,a)}),r}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}}class fL extends Gm{constructor(e,t,r){super(jm(t),$m(r,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,r={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:r.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){Sx(this,e),e.forEach((r,i)=>{xx(this,i),this.at(i).setValue(r,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((r,i)=>{this.at(i)&&this.at(i).patchValue(r,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((r,i)=>{r.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>Ex(e))}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,r)=>!!r._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){this.controls.forEach((t,r)=>{e(t,r)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const pL={provide:ks,useExisting:We(()=>pc)},Dx=(()=>Promise.resolve(null))();let pc=(()=>{class n extends ks{constructor(t,r,i,a,h){super(),this._changeDetectorRef=h,this.control=new Cx,this._registered=!1,this.update=new vn,this._parent=t,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=function Um(n,e){if(!e)return null;let t,r,i;return Array.isArray(e),e.forEach(a=>{a.constructor===Il?t=a:function lL(n){return Object.getPrototypeOf(n.constructor)===va}(a)?r=a:i=a}),i||r||t||null}(0,a)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){const r=t.name.previousValue;this.formDirective.removeControl({name:r,path:this._getPath(r)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),function Fm(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){cc(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){Dx.then(()=>{var r;this.control.setValue(t,{emitViewToModelChange:!1}),null===(r=this._changeDetectorRef)||void 0===r||r.markForCheck()})}_updateDisabled(t){const r=t.isDisabled.currentValue,i=""===r||r&&"false"!==r;Dx.then(()=>{var a;i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable(),null===(a=this._changeDetectorRef)||void 0===a||a.markForCheck()})}_getPath(t){return this._parent?function $h(n,e){return[...e.path,n]}(t,this._parent):[t]}}return n.\u0275fac=function(t){return new(t||n)(ot(si,9),ot(Yr,10),ot(Ns,10),ot(Ho,10),ot(hl,8))},n.\u0275dir=$t({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[ir([pL]),Hn,qr]}),n})(),Rx=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})();const SL={provide:Ho,useExisting:We(()=>Zh),multi:!0};function Fx(n,e){return null==n?`${e}`:(e&&"object"==typeof e&&(e="Object"),`${n}: ${e}`.slice(0,50))}let Zh=(()=>{class n extends va{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;const i=Fx(this._getOptionId(t),t);this.setProperty("value",i)}registerOnChange(t){this.onChange=r=>{this.value=this._getOptionValue(r),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(const r of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(r),t))return r;return null}_getOptionValue(t){const r=function CL(n){return n.split(":")[0]}(t);return this._optionMap.has(r)?this._optionMap.get(r):t}}return n.\u0275fac=function(){let e;return function(r){return(e||(e=Ur(n)))(r||n)}}(),n.\u0275dir=$t({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(t,r){1&t&&Tt("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},features:[ir([SL]),Hn]}),n})(),Ux=(()=>{class n{constructor(t,r,i){this._element=t,this._renderer=r,this._select=i,this._select&&(this.id=this._select._registerOption())}set ngValue(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(Fx(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return n.\u0275fac=function(t){return new(t||n)(ot(kr),ot(Fi),ot(Zh,9))},n.\u0275dir=$t({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),n})();const AL={provide:Ho,useExisting:We(()=>Ym),multi:!0};function Hx(n,e){return null==n?`${e}`:("string"==typeof e&&(e=`'${e}'`),e&&"object"==typeof e&&(e="Object"),`${n}: ${e}`.slice(0,50))}let Ym=(()=>{class n extends va{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){let r;if(this.value=t,Array.isArray(t)){const i=t.map(a=>this._getOptionId(a));r=(a,h)=>{a._setSelected(i.indexOf(h.toString())>-1)}}else r=(i,a)=>{i._setSelected(!1)};this._optionMap.forEach(r)}registerOnChange(t){this.onChange=r=>{const i=[],a=r.selectedOptions;if(void 0!==a){const h=a;for(let v=0;v{class n{constructor(t,r,i){this._element=t,this._renderer=r,this._select=i,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){null!=this._select&&(this._value=t,this._setElementValue(Hx(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(Hx(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return n.\u0275fac=function(t){return new(t||n)(ot(kr),ot(Fi),ot(Ym,9))},n.\u0275dir=$t({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),n})(),FL=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Rx]]}),n})(),UL=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[FL]}),n})();function HL(n,e){if(1&n){const t=oo();Ue(0,"div",16)(1,"input",17),Tt("click",function(){const a=ui(t).$implicit,h=zt().$implicit;return zt().selectNode(h[0],a.url)}),Ge(),Ue(2,"label",18),ft(3),Ge()()}if(2&n){const t=e.$implicit,r=zt().$implicit;bt(1),Ct("name",r[0])("id",r[0])("value",t.url)("checked",t.selected),bt(1),Ct("for",r[0]),bt(1),Vn(" ",t.url," ")}}function VL(n,e){if(1&n&&(Zo(0),Ue(1,"div",5)(2,"p",6)(3,"small"),ft(4),Ge()(),Ft(5,HL,4,6,"div",15),Ge(),Xo()),2&n){const t=e.$implicit;bt(4),Nr(t[0]),bt(1),Ct("ngForOf",t[1])}}function jL(n,e){if(1&n&&(Ue(0,"option"),ft(1),Ge()),2&n){const t=e.$implicit;bt(1),Nr(t)}}let $L=(()=>{class n{constructor(t,r){this.bsModalRef=t,this.api=r,this.customNodeAddress="",this.customNodeNetwork=Gi.MAINNET,this.networks=[Gi.MAINNET,Gi.GHOSTNET],this.nodes=[],this.loadRPCs()}ngOnInit(){}loadRPCs(){this.nodes=Object.entries(this.api.RPCs).filter(t=>t[1].all.length>0).map(t=>[t[0],t[1].all.map(r=>({selected:t[1].selected===r,url:r}))])}selectNode(t,r){this.api.selectRpc(t,r),this.loadRPCs()}addNode(){this.api.addCustomRpc(this.customNodeNetwork,this.customNodeAddress),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Ju))},n.\u0275cmp=Un({type:n,selectors:[["app-node-selector-modal"]],decls:26,vars:4,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"pb-3"],[1,"text-muted","mb-1"],[4,"ngFor","ngForOf"],[1,"input-group","mb-3"],[1,"input-group-prepend"],[1,"custom-select",3,"ngModel","ngModelChange"],["type","text","placeholder","RPC URL","aria-label","RPC URL",1,"form-control",3,"ngModel","ngModelChange"],["type","button",1,"btn","btn-light",3,"click"],[1,"modal-footer"],["type","button",1,"btn","btn-primary",3,"click"],["class","form-check",4,"ngFor","ngForOf"],[1,"form-check"],["type","radio",1,"form-check-input",3,"name","id","value","checked","click"],[1,"form-check-label",3,"for"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2,"Tezos RPC Node Selection"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.bsModalRef.hide()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"div",5)(8,"p",6)(9,"small"),ft(10,"Select Tezos RPC Node"),Ge()(),Ft(11,VL,6,2,"ng-container",7),Ge(),Ue(12,"div")(13,"p",6)(14,"small"),ft(15,"Custom Tezos RPC Node"),Ge()(),Ue(16,"div",8)(17,"div",9)(18,"select",10),Tt("ngModelChange",function(a){return r.customNodeNetwork=a}),Ft(19,jL,2,1,"option",7),Ge()(),Ue(20,"input",11),Tt("ngModelChange",function(a){return r.customNodeAddress=a}),Ge()(),Ue(21,"button",12),Tt("click",function(){return r.addNode()}),ft(22," Add Custom Node "),Ge()()(),Ue(23,"div",13)(24,"button",14),Tt("click",function(){return r.bsModalRef.hide()}),ft(25," Save "),Ge()()),2&t&&(bt(11),Ct("ngForOf",r.nodes),bt(7),Ct("ngModel",r.customNodeNetwork),bt(1),Ct("ngForOf",r.networks),bt(1),Ct("ngModel",r.customNodeAddress))},directives:[Ru,Zh,Vh,pc,Ux,Vx,Il],styles:[""]}),n})(),zL=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-how-to-modal"]],decls:29,vars:1,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"pb-4"],[1,"pb-2"],[1,"modal-footer"],["type","button",1,"btn","btn-default",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2,"How To Connect"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.bsModalRef.hide()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"p"),ft(8," The Beacon Debug Wallet can be used to simulate a connection between a wallet and a dApp. All relevant details are exposed and in the Beacon Debug Wallet to simplify testing and debugging. "),Ge(),Ue(9,"p",5),ft(10," With the Beacon Debug Wallet dApp developer can also view their application from the perspective of specific addresses. "),Ge(),Ue(11,"h6",6),ft(12,"How To Connect A dApp To The Beacon Debug Wallet"),Ge(),Ue(13,"ol")(14,"li"),ft(15,"Go to the dApp you want to establish a connection."),Ge(),Ue(16,"li"),ft(17,' Use the functionality on the dApp to open the Beacon dialog. Usually this is a button labelled "Connect Wallet" or "sync". '),Ge(),Ue(18,"li"),ft(19,'Select "Pair with another device" on the beacon dialog.'),Ge(),Ue(20,"li"),ft(21," Hover over the QR code, click on the Copy button, the Beacon Connection code has now been copied to your clipboard. "),Ge(),Ue(22,"li"),ft(23,' Come Back to the Beacon Debug Wallet and click on the button "Connect To A New dApp" '),Ge(),Ue(24,"li"),ft(25,"You're now connected an can trigger operations from the dApp. \u{1f389}"),Ge()()(),Ue(26,"div",7)(27,"button",8),Tt("click",function(){return r.bsModalRef.hide()}),ft(28),Ge()()),2&t&&(bt(28),Vn(" ",r.closeBtnName," "))},styles:["ol[_ngcontent-%COMP%]{padding-inline-start:1rem}li[_ngcontent-%COMP%]{padding-bottom:.5rem}"]}),n})();const GL=function(){var n=Ot(function*(){const e=window.ethereum;try{const t=yield null==e?void 0:e.request({method:"web3_clientVersion"}),r=null==t?void 0:t.includes("flask");return Boolean(e&&r)}catch(t){return!1}});return function(){return n.apply(this,arguments)}}();let Xh=(()=>{class n{constructor(t){this.accountService=t,this.isConnected=!1,this.isSnapInstalled().then(r=>this.isConnected=r)}connect(){var t=this;return Ot(function*(){console.log("isFlask",yield GL()),yield vB();const r=yield k3();if(console.log("snap installed",r),localStorage.getItem(Vr.METAMASK_BUSY))throw console.log("MetaMaskService: MetaMask is busy handling another request"),new Error("MetaMask is busy handling another request");localStorage.setItem(Vr.METAMASK_BUSY,"true");const i=yield yB();localStorage.removeItem(Vr.METAMASK_BUSY),t.accountService.addOrUpdateAccount({address:i.address,publicKey:i.publicKey,type:kh.METAMASK,description:"",tags:[],network:Gi.MAINNET,wallet:{name:"MetaMask"}}),t.isSnapInstalled().then(a=>t.isConnected=a)})()}disconnect(){return Ot(function*(){alert("NOT IMPLEMENTED")})()}isSnapInstalled(){return Ot(function*(){const t=yield k3();return Boolean(t)})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(Os))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Yx=(()=>{class n{constructor(t,r,i){this.bsModalRef=t,this.modalService=r,this.metamaskService=i}ngOnInit(){}cancel(){this.bsModalRef.hide()}connect(){var t=this;return Ot(function*(){t.bsModalRef.hide();const r=t.showLoadingModal();t.metamaskService.connect().then(()=>{r.hide(),t.successCallback&&t.successCallback()}).catch(Ot(function*(){r.hide(),t.errorCallback&&t.errorCallback()}))})()}showLoadingModal(){return this.modalService.showLoadingModal("Connecting...")}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Fs),ot(Xh))},n.\u0275cmp=Un({type:n,selectors:[["app-not-connected-modal"]],decls:12,vars:0,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","text-center"],[1,"modal-title"],[1,"text-left"],[1,"text-left","mt-3"],["type","button",1,"btn","btn-primary","btn-circle","btn-block","mt-3",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.cancel()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6,"Not connected to MetaMask"),Ge(),Bt(7,"div",5),Ue(8,"div",6),ft(9," You need to connect to MetaMask before you can interact with a dApp. Please do this now. "),Ge(),Ue(10,"button",7),Tt("click",function(){return r.connect()}),ft(11," Connect "),Ge()())},styles:[""]}),n})();const Qx=["toast-component",""];function qL(n,e){if(1&n){const t=oo();Ue(0,"button",5),Tt("click",function(){return ui(t),zt().remove()}),Ue(1,"span",6),ft(2,"\xd7"),Ge()()}}function WL(n,e){if(1&n&&(Zo(0),ft(1),Xo()),2&n){const t=zt(2);bt(1),Vn("[",t.duplicatesCount+1,"]")}}function ZL(n,e){if(1&n&&(Ue(0,"div"),ft(1),Ft(2,WL,2,1,"ng-container",4),Ge()),2&n){const t=zt();so(t.options.titleClass),ri("aria-label",t.title),bt(1),Vn(" ",t.title," "),bt(1),Ct("ngIf",t.duplicatesCount)}}function XL(n,e){if(1&n&&Bt(0,"div",7),2&n){const t=zt();so(t.options.messageClass),Ct("innerHTML",t.message,nf)}}function YL(n,e){if(1&n&&(Ue(0,"div",8),ft(1),Ge()),2&n){const t=zt();so(t.options.messageClass),ri("aria-label",t.message),bt(1),Vn(" ",t.message," ")}}function QL(n,e){if(1&n&&(Ue(0,"div"),Bt(1,"div",9),Ge()),2&n){const t=zt();bt(1),ol("width",t.width+"%")}}function JL(n,e){if(1&n){const t=oo();Ue(0,"button",5),Tt("click",function(){return ui(t),zt().remove()}),Ue(1,"span",6),ft(2,"\xd7"),Ge()()}}function eF(n,e){if(1&n&&(Zo(0),ft(1),Xo()),2&n){const t=zt(2);bt(1),Vn("[",t.duplicatesCount+1,"]")}}function tF(n,e){if(1&n&&(Ue(0,"div"),ft(1),Ft(2,eF,2,1,"ng-container",4),Ge()),2&n){const t=zt();so(t.options.titleClass),ri("aria-label",t.title),bt(1),Vn(" ",t.title," "),bt(1),Ct("ngIf",t.duplicatesCount)}}function nF(n,e){if(1&n&&Bt(0,"div",7),2&n){const t=zt();so(t.options.messageClass),Ct("innerHTML",t.message,nf)}}function rF(n,e){if(1&n&&(Ue(0,"div",8),ft(1),Ge()),2&n){const t=zt();so(t.options.messageClass),ri("aria-label",t.message),bt(1),Vn(" ",t.message," ")}}function iF(n,e){if(1&n&&(Ue(0,"div"),Bt(1,"div",9),Ge()),2&n){const t=zt();bt(1),ol("width",t.width+"%")}}class oF{constructor(e,t){this.component=e,this.injector=t}attach(e,t){return this._attachedHost=e,e.attach(this,t)}detach(){const e=this._attachedHost;if(e)return this._attachedHost=void 0,e.detach()}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class Yh{constructor(e,t,r,i,a,h){this.toastId=e,this.config=t,this.message=r,this.title=i,this.toastType=a,this.toastRef=h,this._onTap=new o,this._onAction=new o,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(e){this._onAction.next(e)}onAction(){return this._onAction.asObservable()}}const Jx={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing",payload:null},e6=new Kt("ToastConfig");class aF{constructor(e){this._overlayRef=e,this.duplicatesCount=0,this._afterClosed=new o,this._activate=new o,this._manualClose=new o,this._resetTimeout=new o,this._countDuplicate=new o}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(e,t){e&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}}class lF{constructor(e,t){this._toastPackage=e,this._parentInjector=t}get(e,t,r){return e===Yh?this._toastPackage:this._parentInjector.get(e,t,r)}}class uF extends class sF{attach(e,t){return this._attachedPortal=e,this.attachComponentPortal(e,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(e){this._disposeFn=e}}{constructor(e,t,r){super(),this._hostDomElement=e,this._componentFactoryResolver=t,this._appRef=r}attachComponentPortal(e,t){const r=this._componentFactoryResolver.resolveComponentFactory(e.component);let i;return i=r.create(e.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}class cF{constructor(e){this._portalHost=e}attach(e,t=!0){return this._portalHost.attach(e,t)}detach(){return this._portalHost.detach()}}let fF=(()=>{class n{constructor(t){this._document=t}ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),hF=(()=>{class n{constructor(t,r,i,a){this._overlayContainer=t,this._componentFactoryResolver=r,this._appRef=i,this._document=a,this._paneElements=new Map}create(t,r){return this._createOverlayRef(this.getPaneElement(t,r))}getPaneElement(t="",r){return this._paneElements.get(r)||this._paneElements.set(r,{}),this._paneElements.get(r)[t]||(this._paneElements.get(r)[t]=this._createPaneElement(t,r)),this._paneElements.get(r)[t]}_createPaneElement(t,r){const i=this._document.createElement("div");return i.id="toast-container",i.classList.add(t),i.classList.add("toast-container"),r?r.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(t){return new uF(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new cF(this._createPortalHost(t))}}return n.\u0275fac=function(t){return new(t||n)(Mt(fF),Mt(Ys),Mt(fl),Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Qh=(()=>{class n{constructor(t,r,i,a,h){this.overlay=r,this._injector=i,this.sanitizer=a,this.ngZone=h,this.currentlyActive=0,this.toasts=[],this.index=0,this.toastrConfig=Object.assign(Object.assign({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=Object.assign(Object.assign({},t.default.iconClasses),t.config.iconClasses))}show(t,r,i={},a=""){return this._preBuildNotification(a,t,r,this.applyConfig(i))}success(t,r,i={}){return this._preBuildNotification(this.toastrConfig.iconClasses.success||"",t,r,this.applyConfig(i))}error(t,r,i={}){return this._preBuildNotification(this.toastrConfig.iconClasses.error||"",t,r,this.applyConfig(i))}info(t,r,i={}){return this._preBuildNotification(this.toastrConfig.iconClasses.info||"",t,r,this.applyConfig(i))}warning(t,r,i={}){return this._preBuildNotification(this.toastrConfig.iconClasses.warning||"",t,r,this.applyConfig(i))}clear(t){for(const r of this.toasts)if(void 0!==t){if(r.toastId===t)return void r.toastRef.manualClose()}else r.toastRef.manualClose()}remove(t){const r=this._findToast(t);if(!r||(r.activeToast.toastRef.close(),this.toasts.splice(r.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActivethis._buildNotification(t,r,i,a)):this._buildNotification(t,r,i,a)}_buildNotification(t,r,i,a){if(!a.toastComponent)throw new Error("toastComponent required");const h=this.findDuplicate(i,r,this.toastrConfig.resetTimeoutOnDuplicate&&a.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||r)&&this.toastrConfig.preventDuplicates&&null!==h)return h;this.previousToastMessage=r;let v=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(v=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));const D=this.overlay.create(a.positionClass,this.overlayContainer);this.index=this.index+1;let L=r;r&&a.enableHtml&&(L=this.sanitizer.sanitize(Qn.HTML,r));const j=new aF(D),Q=new Yh(this.index,a,L,i,t,j),me=new lF(Q,this._injector),ye=new oF(a.toastComponent,me),Te=D.attach(ye,this.toastrConfig.newestOnTop);j.componentInstance=Te.instance;const Ve={toastId:this.index,title:i||"",message:r||"",toastRef:j,onShown:j.afterActivate(),onHidden:j.afterClosed(),onTap:Q.onTap(),onAction:Q.onAction(),portal:Te};return v||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{Ve.toastRef.activate()})),this.toasts.push(Ve),Ve}}return n.\u0275fac=function(t){return new(t||n)(Mt(e6),Mt(hF),Mt(Cr),Mt(Wf),Mt(or))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),dF=(()=>{class n{constructor(t,r,i){this.toastrService=t,this.toastPackage=r,this.ngZone=i,this.width=-1,this.toastClasses="",this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}},this.message=r.message,this.title=r.title,this.options=r.config,this.originalTimeout=r.config.timeOut,this.toastClasses=`${r.toastType} ${r.config.toastClass}`,this.sub=r.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=r.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=r.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=r.toastRef.countDuplicate().subscribe(a=>{this.duplicatesCount=a})}get displayStyle(){if("inactive"===this.state.value)return"none"}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=Object.assign(Object.assign({},this.state),{value:"active"}),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(0===this.width||100===this.width||!this.options.timeOut)return;const t=(new Date).getTime();this.width=(this.hideTime-t)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=Object.assign(Object.assign({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.state=Object.assign(Object.assign({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){"removed"!==this.state.value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){!0===this.options.disableTimeOut||"extendedTimeOut"===this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state.value||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,r){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),r)):this.timeout=setTimeout(()=>t(),r)}outsideInterval(t,r){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),r)):this.intervalId=setInterval(()=>t(),r)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}}return n.\u0275fac=function(t){return new(t||n)(ot(Qh),ot(Yh),ot(or))},n.\u0275cmp=Un({type:n,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,r){1&t&&Tt("click",function(){return r.tapToast()})("mouseenter",function(){return r.stickAround()})("mouseleave",function(){return r.delayedHideToast()}),2&t&&(pp("@flyInOut",r.state),so(r.toastClasses),ol("display",r.displayStyle))},attrs:Qx,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,r){1&t&&(Ft(0,qL,3,0,"button",0),Ft(1,ZL,3,5,"div",1),Ft(2,XL,1,3,"div",2),Ft(3,YL,2,4,"div",3),Ft(4,QL,2,2,"div",4)),2&t&&(Ct("ngIf",r.options.closeButton),bt(1),Ct("ngIf",r.title),bt(1),Ct("ngIf",r.message&&r.options.enableHtml),bt(1),Ct("ngIf",r.message&&!r.options.enableHtml),bt(1),Ct("ngIf",r.options.progressBar))},directives:[fo],encapsulation:2,data:{animation:[_M("flyInOut",[Eg("inactive",Ci({opacity:0})),Eg("active",Ci({opacity:1})),Eg("removed",Ci({opacity:0})),xg("inactive => active",pl("{{ easeTime }}ms {{ easing }}")),xg("active => removed",pl("{{ easeTime }}ms {{ easing }}"))])]}}),n})();const pF=Object.assign(Object.assign({},Jx),{toastComponent:dF});let gF=(()=>{class n{static forRoot(t={}){return{ngModule:n,providers:[{provide:e6,useValue:{default:pF,config:t}}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Pu]]}),n})(),mF=(()=>{class n{constructor(t,r,i){this.toastrService=t,this.toastPackage=r,this.appRef=i,this.width=-1,this.toastClasses="",this.state="inactive",this.message=r.message,this.title=r.title,this.options=r.config,this.originalTimeout=r.config.timeOut,this.toastClasses=`${r.toastType} ${r.config.toastClass}`,this.sub=r.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=r.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=r.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=r.toastRef.countDuplicate().subscribe(a=>{this.duplicatesCount=a})}get displayStyle(){if("inactive"===this.state)return"none"}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state="active",!(!0===this.options.disableTimeOut||"timeOut"===this.options.disableTimeOut)&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(0===this.width||100===this.width||!this.options.timeOut)return;const t=(new Date).getTime();this.width=(this.hideTime-t)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=(new Date).getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){"removed"!==this.state&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){"removed"!==this.state&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){!0===this.options.disableTimeOut||"extendedTimeOut"===this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}}return n.\u0275fac=function(t){return new(t||n)(ot(Qh),ot(Yh),ot(fl))},n.\u0275cmp=Un({type:n,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,r){1&t&&Tt("click",function(){return r.tapToast()})("mouseenter",function(){return r.stickAround()})("mouseleave",function(){return r.delayedHideToast()}),2&t&&(so(r.toastClasses),ol("display",r.displayStyle))},attrs:Qx,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,r){1&t&&(Ft(0,JL,3,0,"button",0),Ft(1,tF,3,5,"div",1),Ft(2,nF,1,3,"div",2),Ft(3,rF,2,4,"div",3),Ft(4,iF,2,2,"div",4)),2&t&&(Ct("ngIf",r.options.closeButton),bt(1),Ct("ngIf",r.title),bt(1),Ct("ngIf",r.message&&r.options.enableHtml),bt(1),Ct("ngIf",r.message&&!r.options.enableHtml),bt(1),Ct("ngIf",r.options.progressBar))},directives:[fo],encapsulation:2}),n})();Object.assign(Object.assign({},Jx),{toastComponent:mF});let vF=(()=>{class n{constructor(t,r){this.bsModalRef=t,this.toastService=r}ngOnInit(){}confirm(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("confirm"),this.bsModalRef.hide(),this.toastService.success("Connected to dApp","Success",{progressBar:!0,positionClass:"toast-bottom-center"})}decline(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("decline"),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Qh))},n.\u0275cmp=Un({type:n,selectors:[["app-permission-modal"]],decls:23,vars:2,consts:[[1,"modal-header"],[1,"modalTitle","modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modalContainer"],[1,"modal-body"],[1,"inputTitle"],[1,"inputBox"],[1,"inputText"],[1,"modal-footer",2,"width","fit-content"],["type","button",1,"button","btn","btn-block","btn-primary",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h2",1),ft(2,"Connect DApp"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.decline()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"div",5)(8,"p"),ft(9,"Do you want to connect to the following DApp?"),Ge(),Ue(10,"p",6),ft(11,"DApp:"),Ge(),Ue(12,"div",7)(13,"p",8),ft(14),Ge()(),Ue(15,"p",6),ft(16,"Account:"),Ge(),Ue(17,"div",7)(18,"p",8),ft(19),Ge()()(),Ue(20,"div",9)(21,"button",10),Tt("click",function(){return r.confirm()}),ft(22," Connect "),Ge()()()),2&t&&(bt(14),Nr(null==r.appMetadata?null:r.appMetadata.name),bt(5),Nr(null==r.account?null:r.account.address))},styles:[".modalContainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}.modal-footer[_ngcontent-%COMP%]{display:flex;justify-content:center}.modalTitle[_ngcontent-%COMP%]{font-family:Inter;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:center;margin:0 auto}.inputTitle[_ngcontent-%COMP%]{font-family:Inter;font-size:16px;font-weight:600;line-height:19px;letter-spacing:0em;text-align:left;margin-top:10px}.inputBox[_ngcontent-%COMP%]{width:400px;height:50px;padding:0 24px;border-radius:100px;border:2px;gap:10px;background-color:#f5f5f7;display:flex;justify-content:left;align-items:center}.inputText[_ngcontent-%COMP%]{font-family:Inter;font-size:14px;font-weight:600;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto}.infoInputBox[_ngcontent-%COMP%]{width:400px;padding:20px;border-radius:10px;gap:10px;background-color:#f5f5f7;display:flex;justify-content:left;align-items:center;margin-top:20px}.infoInputText[_ngcontent-%COMP%]{font-family:Inter;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto}.button[_ngcontent-%COMP%]{width:400px;height:52px;padding:0 24px;border-radius:100px;gap:10px;background-color:#0f61ff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#0079ff}"]}),n})(),yF=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}test(){this.callback&&this.callback()}confirm(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("confirm"),this.bsModalRef.hide()}decline(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("decline"),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-operation-modal"]],decls:15,vars:0,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[3,"click"],[1,"modal-footer"],["type","button",1,"btn","btn-light",3,"click"],["type","button",1,"btn","btn-primary","ml-1",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2,"Submit Operation"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.decline()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"p"),ft(8," Do you want to create this transaction? "),Ue(9,"button",5),Tt("click",function(){return r.test()}),Ge()()(),Ue(10,"div",6)(11,"button",7),Tt("click",function(){return r.decline()}),ft(12," Decline "),Ge(),Ue(13,"button",8),Tt("click",function(){return r.confirm()}),ft(14," Sign transaction "),Ge()())},styles:[""]}),n})(),bF=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}confirm(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("confirm"),this.bsModalRef.hide()}decline(){var t;null===(t=this.bsModalRef.onHide)||void 0===t||t.emit("decline"),this.bsModalRef.hide()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-sign-payload-modal"]],decls:14,vars:0,consts:[[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-light",3,"click"],["type","button",1,"btn","btn-primary","ml-1",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h4",1),ft(2,"Sign Payload"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.decline()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"p"),ft(8,"Do you want to sign this payload?"),Ge()(),Ue(9,"div",5)(10,"button",6),Tt("click",function(){return r.decline()}),ft(11," Decline "),Ge(),Ue(12,"button",7),Tt("click",function(){return r.confirm()}),ft(13," Sign Payload "),Ge()())},styles:[""]}),n})();var Ir=(()=>(function(n){n.ENDORSEMENT="endorsement",n.SEED_NONCE_REVELATION="seed_nonce_revelation",n.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",n.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",n.ACTIVATE_ACCOUNT="activate_account",n.PROPOSALS="proposals",n.BALLOT="ballot",n.REVEAL="reveal",n.TRANSACTION="transaction",n.ORIGINATION="origination",n.DELEGATION="delegation"}(Ir||(Ir={})),Ir))();const gc="1040000",Jm="60000",RF=function(){var n=Ot(function*(e,t,r,i=new Nn("1300").toFixed()){return{kind:Ir.REVEAL,fee:i,gas_limit:"10000",storage_limit:"0",counter:e.toFixed(),public_key:t,source:r}});return function(t,r,i){return n.apply(this,arguments)}}();var o6=I(1108);I(3647);class OF extends Error{}class Lr extends OF{}class s6 extends Lr{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidAddressError",this.message=`Invalid address "${e}"`,this.message+=t?` ${t}.`:"."}}class PF extends Lr{constructor(e,t){super(),this.blockHash=e,this.errorDetail=t,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${e}"`,this.message+=t?` ${t}.`:"."}}class a6 extends Lr{constructor(e,t){super(),this.hexString=e,this.errorDetail=t,this.name="InvalidHexStringError",this.message=`Invalid hex string "${e}"`,this.message+=t?` ${t}.`:"."}}class l6 extends Lr{constructor(e,t){super(),this.publicKey=e,this.errorDetail=t,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${e}"`,this.message+=t?` ${t}.`:"."}}class u6 extends Lr{constructor(e,t){super(),this.contractAddress=e,this.errorDetail=t,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${e}"`,this.message+=t?` ${t}.`:"."}}class NF extends Lr{constructor(e,t){super(),this.keyHash=e,this.errorDetail=t,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${e}"`,this.message+=t?` ${t}.`:"."}}class c6 extends Lr{constructor(e,t){super(),this.operationKind=e,this.errorDetail=t,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${e}"`,this.message+=t?` ${t}.`:"."}}I(7715),I(8517);var rt=(()=>(function(n){n.TZ1="tz1",n.TZ2="tz2",n.TZ3="tz3",n.TZ4="tz4",n.KT="KT",n.KT1="KT1",n.EDSK2="edsk2",n.SPSK="spsk",n.P2SK="p2sk",n.EDPK="edpk",n.SPPK="sppk",n.P2PK="p2pk",n.BLPK="BLpk",n.EDESK="edesk",n.SPESK="spesk",n.P2ESK="p2esk",n.EDSK="edsk",n.EDSIG="edsig",n.SPSIG="spsig",n.P2SIG="p2sig",n.SIG="sig",n.NET="Net",n.NCE="nce",n.B="B",n.O="o",n.LO="Lo",n.LLO="LLo",n.P="P",n.CO="Co",n.ID="id",n.EXPR="expr",n.TZ="TZ",n.VH="vh",n.SASK="sask",n.ZET1="zet1",n.TXR1="txr1",n.TXI="txi",n.TXM="txm",n.TXC="txc",n.TXMR="txmr",n.TXRL="txM",n.TXW="txw",n.SR1="sr1",n.SRC1="src1"}(rt||(rt={})),rt))();const hr={[rt.TZ1]:new Uint8Array([6,161,159]),[rt.TZ2]:new Uint8Array([6,161,161]),[rt.TZ3]:new Uint8Array([6,161,164]),[rt.TZ4]:new Uint8Array([6,161,166]),[rt.KT]:new Uint8Array([2,90,121]),[rt.KT1]:new Uint8Array([2,90,121]),[rt.EDSK]:new Uint8Array([43,246,78,7]),[rt.EDSK2]:new Uint8Array([13,15,58,7]),[rt.SPSK]:new Uint8Array([17,162,224,201]),[rt.P2SK]:new Uint8Array([16,81,238,189]),[rt.EDPK]:new Uint8Array([13,15,37,217]),[rt.SPPK]:new Uint8Array([3,254,226,86]),[rt.P2PK]:new Uint8Array([3,178,139,127]),[rt.BLPK]:new Uint8Array([6,149,135,204]),[rt.EDESK]:new Uint8Array([7,90,60,179,41]),[rt.SPESK]:new Uint8Array([9,237,241,174,150]),[rt.P2ESK]:new Uint8Array([9,48,57,115,171]),[rt.EDSIG]:new Uint8Array([9,245,205,134,18]),[rt.SPSIG]:new Uint8Array([13,115,101,19,63]),[rt.P2SIG]:new Uint8Array([54,240,44,52]),[rt.SIG]:new Uint8Array([4,130,43]),[rt.NET]:new Uint8Array([87,82,0]),[rt.NCE]:new Uint8Array([69,220,169]),[rt.B]:new Uint8Array([1,52]),[rt.O]:new Uint8Array([5,116]),[rt.LO]:new Uint8Array([133,233]),[rt.LLO]:new Uint8Array([29,159,109]),[rt.P]:new Uint8Array([2,170]),[rt.CO]:new Uint8Array([79,179]),[rt.ID]:new Uint8Array([153,103]),[rt.EXPR]:new Uint8Array([13,44,64,27]),[rt.TZ]:new Uint8Array([2,90,121]),[rt.VH]:new Uint8Array([1,106,242]),[rt.SASK]:new Uint8Array([11,237,20,92]),[rt.ZET1]:new Uint8Array([18,71,40,223]),[rt.TXR1]:new Uint8Array([1,128,120,31]),[rt.TXI]:new Uint8Array([79,148,196]),[rt.TXM]:new Uint8Array([79,149,30]),[rt.TXC]:new Uint8Array([79,148,17]),[rt.TXMR]:new Uint8Array([18,7,206,87]),[rt.TXRL]:new Uint8Array([79,146,82]),[rt.TXW]:new Uint8Array([79,150,72]),[rt.SR1]:new Uint8Array([6,124,117]),[rt.SRC1]:new Uint8Array([17,165,134,138])},Ol={[rt.TZ1]:20,[rt.TZ2]:20,[rt.TZ3]:20,[rt.TZ4]:20,[rt.KT]:20,[rt.KT1]:20,[rt.EDPK]:32,[rt.SPPK]:33,[rt.P2PK]:33,[rt.BLPK]:48,[rt.EDSIG]:64,[rt.SPSIG]:64,[rt.P2SIG]:64,[rt.SIG]:64,[rt.NET]:4,[rt.B]:32,[rt.P]:32,[rt.O]:32,[rt.VH]:32,[rt.SASK]:169,[rt.ZET1]:43,[rt.TXR1]:20,[rt.TXI]:32,[rt.TXM]:32,[rt.TXC]:32,[rt.TXMR]:32,[rt.TXRL]:32,[rt.TXW]:32,[rt.SR1]:20,[rt.SRC1]:32};var nr=(()=>(function(n){n[n.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",n[n.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",n[n.INVALID_LENGTH=2]="INVALID_LENGTH",n[n.VALID=3]="VALID"}(nr||(nr={})),nr))();const KF=[rt.B];function Di(n){switch(n){case nr.NO_PREFIX_MATCHED:return"with unsupported prefix";case nr.INVALID_CHECKSUM:return"failed checksum";case nr.INVALID_LENGTH:return"with incorrect length";default:return""}}const y6=n=>n.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),mr=(n,e=8)=>n.toString(16).padStart(e,"0");var He=(()=>(function(n){n.SECRET="secret",n.RAW="raw",n.TZ1="tz1",n.BRANCH="branch",n.ZARITH="zarith",n.PUBLIC_KEY="public_key",n.PKH="pkh",n.DELEGATE="delegate",n.SCRIPT="script",n.BALLOT_STATEMENT="ballotStmt",n.PROPOSAL="proposal",n.PROPOSAL_ARR="proposalArr",n.INT32="int32",n.INT16="int16",n.PARAMETERS="parameters",n.ADDRESS="address",n.SMART_CONTRACT_ADDRESS="smart_contract_address",n.SMART_ROLLUP_ADDRESS="smart_rollup_address",n.SMART_ROLLUP_COMMITMENT_HASH="smart_rollup_commitment_hash",n.VALUE="value",n.PADDED_BYTES="padded_bytes",n.SMART_ROLLUP_MESSAGE="smart_rollup_message",n.MANAGER="manager",n.BLOCK_PAYLOAD_HASH="blockPayloadHash",n.ENTRYPOINT="entrypoint",n.OPERATION="operation",n.OP_ACTIVATE_ACCOUNT="activate_account",n.OP_DELEGATION="delegation",n.OP_TRANSACTION="transaction",n.OP_ORIGINATION="origination",n.OP_BALLOT="ballot",n.OP_FAILING_NOOP="failing_noop",n.OP_ENDORSEMENT="endorsement",n.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",n.OP_REVEAL="reveal",n.OP_PROPOSALS="proposals",n.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",n.OP_TRANSFER_TICKET="transfer_ticket",n.OP_TX_ROLLUP_ORIGINATION="tx_rollup_origination",n.OP_TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",n.BURN_LIMIT="burn_limit",n.TX_ROLLUP_ORIGINATION_PARAM="tx_rollup_origination_param",n.TX_ROLLUP_ID="tx_rollup_id",n.TX_ROLLUP_BATCH_CONTENT="tx_rollup_batch_content",n.OP_INCREASE_PAID_STORAGE="increase_paid_storage",n.OP_UPDATE_CONSENSUS_KEY="update_consensus_key",n.OP_DRAIN_DELEGATE="drain_delegate",n.DEPOSITS_LIMIT="deposits_limit",n.OP_SET_DEPOSITS_LIMIT="set_deposits_limit",n.OP_SMART_ROLLUP_ORIGINATE="smart_rollup_originate",n.PVM_KIND="pvm_kind",n.OP_SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",n.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message"}(He||(He={})),He))();const jo={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET_DEPRECATED",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT",98:"Lambda_rec",99:"LAMBDA_REC","9a":"TICKET","9b":"BYTES","9c":"NAT"},tU=(()=>{const n={};return Object.keys(jo).forEach(e=>{n[jo[e]]=e}),n})(),tv={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"endorsement",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",150:"tx_rollup_origination",151:"tx_rollup_submit_batch",158:"transfer_ticket",112:"set_deposits_limit",113:"increase_paid_storage",114:"update_consensus_key",9:"drain_delegate",200:"smart_rollup_originate",201:"smart_rollup_add_messages",206:"smart_rollup_execute_outbox_message",17:"failing_noop"},b6=(()=>{const n={};return Object.keys(tv).forEach(e=>{const t="string"==typeof e?parseInt(e,10):e;n[tv[t]]=mr(t,2)}),n})(),td={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate","05":"deposit"},_6=(()=>{const n={};return Object.keys(td).forEach(e=>{n[td[e]]=e}),n})();class w6 extends Lr{constructor(e,t){super(),this.operation=e,this.errorDetail=t,this.name="InvalidOperationSchemaError",this.message="Invalid operation content recevied",t&&(this.message+=` ${t}.`)}}class M6 extends Lr{constructor(e){super(),this.entrypoint=e,this.name="OversizedEntryPointError",this.message=`Invalid entrypoint length "${e.length}", maximum length is "31".`}}class nU extends Lr{constructor(e){super(),this.ballotValue=e,this.name="InvalidBallotValueError",this.message=`Invalid ballot value "${e}" expecting one of the following: "yay", "nay", "pass".`}}class rU extends Lr{constructor(e){super(),this.ballotValue=e,this.name="DecodeBallotValueError",this.message=`Invalid ballot value "${e}", cannot be decoded.`}}class iU extends Lr{constructor(e){super(),this.value=e,this.name="UnexpectedMichelsonValueError",this.message=`Invalid Michelson value "${e}", unalbe to encode.`}}class E6 extends Lr{constructor(e){super(),this.message=e,this.name="OperationDecodingError"}}class oU extends Lr{constructor(e){super(),this.message=e,this.name="OperationEncodingError"}}class sU extends Lr{constructor(e){super(),this.op=e,this.name="UnsupportedOperationError",this.message=`Unsupported operation "${e}", can submit an issue on our github for feature request.`}}class aU extends Lr{constructor(e){super(),this.pvm=e,this.name="UnsupportedPvmKindError",this.message=`Invalid Pvm kind "${e}" expecting either "arith" or "wasm_2_0_0".`}}class lU extends Lr{constructor(e){super(),this.pvm=e,this.name="DecodePvmKindError",this.message=`Invalid Pvm kind "${e}", cannot be decoded.`}}class x6 extends Lr{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidSmartRollupAddress",this.message=`Invalid smart rollup address "${e}"`,t&&(this.message+=` ${t}.`)}}class S6 extends Lr{constructor(e,t){super(),this.hash=e,this.errorDetail=t,this.name="InvalidSmartRollupCommitmentHashError",this.message=`Invalid smart rollup commitment hash "${e}"`,t&&(this.message+=` ${t}.`)}}class Mo{constructor(e,t=0){this.arr=e,this.offset=t}static fromHexString(e){const t=e.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(t)){const r=new Uint8Array((t.match(/([a-z]|\d){2}/g)||[]).map(i=>parseInt(i,16)));return new Mo(r)}throw new a6(t)}consume(e){const t=this.arr.subarray(this.offset,this.offset+e);return this.offset+=e,t}get(e){return this.arr[this.offset+e]}length(){return this.arr.length-this.offset}slice(e,t){return new Mo(this.arr.slice(e,t))}}const Bs=n=>{if(Array.isArray(n)){const e=n.map(r=>Bs(r)).join("");return`02${mr(e.length/2)}${e}`}if((n=>"prim"in n)(n))return MU(n);if((n=>"bytes"in n&&"string"==typeof n.bytes)(n))return mU(n);if((n=>"string"in n&&"string"==typeof n.string)(n))return yU(n);if((n=>"int"in n&&"string"==typeof n.int)(n))return _U(n);throw new iU(JSON.stringify(n))},Ls=n=>{const e=n.consume(1);switch(e[0]){case 10:return vU(n);case 1:return bU(n);case 0:return wU(n);case 2:{const t=new Mo(Ii(n)),r=[];for(;t.length()>0;)r.push(Ls(t));return r}default:return EU(n,e)}},Ii=(n,e=4)=>{const t=n.consume(e),r=parseInt(Buffer.from(t).toString("hex"),16);return n.consume(r)},mU=n=>{if(!/^([A-Fa-f0-9]{2})*$/.test(n.bytes))throw new a6(n.bytes);return`0a${mr(n.bytes.length/2)}${n.bytes}`},vU=n=>{const e=Ii(n);return{bytes:Buffer.from(e).toString("hex")}},yU=n=>{const e=Buffer.from(n.string,"utf8").toString("hex");return`01${mr(e.length/2)}${e}`},bU=n=>{const e=Ii(n);return{string:Buffer.from(e).toString("utf8")}},_U=({int:n})=>{const e=new am(n,10),t="-"===e.toString(2)[0]?"1":"0",r=e.toString(2).replace(/-/g,""),h=r.padStart(r.length<=6?6:(r.length-6)%7?r.length+7-(r.length-6)%7:r.length,"0").match(/\d{6,7}/g).reverse();return h[0]=t+h[0],`00${h.map((D,L)=>parseInt((L===h.length-1?"0":"1")+D,2).toString(16).padStart(2,"0")).join("")}`},wU=n=>{let e=n.consume(1)[0];const t=[];for(;128&e;)t.push(e),e=n.consume(1)[0];t.push(e);const i=!!(64&t[0]);t[0]=127&t[0];const a=t.map((v,D)=>v.toString(2).slice(0===D?-6:-7).padStart(0===D?6:7,"0")).reverse();let h=new am(a.join(""),2);return i&&(h=h.times(-1)),{int:h.toFixed()}},MU=n=>{const e=+Array.isArray(n.annots),t=Array.isArray(n.args)?n.args.length:0,r=mr(Math.min(2*t+e+3,9),2),i=tU[n.prim];let a=(n.args||[]).map(v=>Bs(v)).join("");const h=Array.isArray(n.annots)?CU(n.annots):"";return("LAMBDA"===n.prim||"LAMBDA_REC"===n.prim)&&t&&(a=mr(a.length/2)+a+mr(0)),("pair"===n.prim||"Pair"===n.prim)&&t>2&&(a=""===h?mr(a.length/2)+a+mr(0):mr(a.length/2)+a),"view"===n.prim&&n.args&&(a=mr(a.length/2)+a+mr(0)),`${r}${i}${a}${h}`},EU=(n,e)=>{const t=(e[0]-3)%2==1;let r=Math.floor((e[0]-3)/2);const i=n.consume(1)[0].toString(16).padStart(2,"0"),a={prim:jo[i]};if(("LAMBDA"===jo[i]||"LAMBDA_REC"===jo[i])&&n.consume(4),"view"===jo[i])return 0!=r?xU(n,a):a;let h,v;("pair"===jo[i]||"Pair"===jo[i])&&r>2&&(h=SU(n),r=0,v=C6(n));const D=new Array(r).fill(0).map(()=>Ls(n));return("LAMBDA"===jo[i]||"LAMBDA_REC"===jo[i])&&n.consume(4),h?a.args=h:D.length&&(a.args=D),v&&""!==v[0]?a.annots=v:t&&(a.annots=C6(n)),a},xU=(n,e)=>(n.consume(4),e.args=new Array(4).fill(0).map(()=>Ls(n)),n.consume(4),e),SU=n=>{const e=new Mo(Ii(n)),t=[];for(;e.length()>0;)t.push(Ls(e));return t},CU=n=>{const e=n.map(r=>Buffer.from(r,"utf8").toString("hex")).join("20");return`${mr(e.length/2)}${e}`},C6=n=>{const e=n.consume(4),t=parseInt(Buffer.from(e).toString("hex"),16),r=n.consume(t);return Buffer.from(r).toString("hex").split("20").map(a=>Buffer.from(a,"hex").toString("utf8"))},Qr=n=>e=>(n=>{const e=new Uint8Array(n),t=[];return e.forEach(r=>{const a=`00${r.toString(16)}`.slice(-2);t.push(a)}),t.join("")})(Buffer.from(((n,e)=>vm().decode(n).slice(e.length))(e,hr[n]))),ai=n=>e=>function Vo(n,e){const t="string"==typeof n?Uint8Array.from(o6.lW.from(n,"hex")):n,r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),vm().encode(o6.lW.from(r.buffer))}(e.consume(Ol[n]),hr[n]),AU=ai(rt.TZ1),TU=ai(rt.B),nv=n=>{const e=n.consume(1);return 0===e[0]?ai(rt.TZ1)(n):1===e[0]?ai(rt.TZ2)(n):2===e[0]?ai(rt.TZ3)(n):void 0},DU=Qr(rt.B),IU=Qr(rt.TZ1),A6=n=>n?"ff":"00",T6=n=>Qr(rt.P)(n),D6=n=>ai(rt.P)(n),rv=n=>{switch(n.substring(0,3)){case rt.TZ1:return"00"+Qr(rt.TZ1)(n);case rt.TZ2:return"01"+Qr(rt.TZ2)(n);case rt.TZ3:return"02"+Qr(rt.TZ3)(n);case rt.TZ4:return"03"+Qr(rt.TZ4)(n);default:throw new NF(n,Di(nr.NO_PREFIX_MATCHED)+` expecting one for the following "${rt.TZ1}", "${rt.TZ2}", "${rt.TZ3}" or "${rt.TZ4}".`)}},iv=n=>{const e=[];let t=new Nn(n,10);if(t.isNaN())throw new TypeError(`Invalid zarith number ${n}`);for(;;){if(t.lt(128)){t.lt(16)&&e.push("0"),e.push(t.toString(16));break}{let r=t.mod(128);t=t.minus(r),t=t.dividedBy(128),r=r.plus(128),e.push(r.toString(16))}}return e.join("")},ov=n=>{let e=0;for(;e=0;r-=1){const i=127&n.get(r);t=t.multipliedBy(128),t=t.plus(i)}return n.consume(e+1),new Nn(t).toString()},sH=Qr(rt.VH),aH=ai(rt.VH),hH=Qr(rt.TXR1),dH=ai(rt.TXR1),I6={branch:He.BRANCH,contents:[He.OPERATION]},sv={pkh:He.TZ1,secret:He.SECRET},av={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,public_key:He.PUBLIC_KEY},lv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,delegate:He.DELEGATE},uv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,amount:He.ZARITH,destination:He.ADDRESS,parameters:He.PARAMETERS},cv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,balance:He.ZARITH,delegate:He.DELEGATE,script:He.SCRIPT},fv={source:He.PKH,period:He.INT32,proposal:He.PROPOSAL,ballot:He.BALLOT_STATEMENT},hv={slot:He.INT16,level:He.INT32,round:He.INT32,block_payload_hash:He.BLOCK_PAYLOAD_HASH},dv={level:He.INT32,nonce:He.RAW},pv={source:He.PKH,period:He.INT32,proposals:He.PROPOSAL_ARR},gv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,value:He.VALUE},mv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,ticket_contents:He.VALUE,ticket_ty:He.VALUE,ticket_ticketer:He.ADDRESS,ticket_amount:He.ZARITH,destination:He.ADDRESS,entrypoint:He.ENTRYPOINT},vv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,tx_rollup_origination:He.TX_ROLLUP_ORIGINATION_PARAM},yv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,rollup:He.TX_ROLLUP_ID,content:He.TX_ROLLUP_BATCH_CONTENT,burn_limit:He.BURN_LIMIT},bv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,amount:He.ZARITH,destination:He.SMART_CONTRACT_ADDRESS},_v={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,pk:He.PUBLIC_KEY},wv={consensus_key:He.PKH,delegate:He.PKH,destination:He.PKH},Mv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,limit:He.DEPOSITS_LIMIT},Ev={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,pvm_kind:He.PVM_KIND,kernel:He.PADDED_BYTES,origination_proof:He.PADDED_BYTES,parameters_ty:He.VALUE},xv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,message:He.SMART_ROLLUP_MESSAGE},Sv={source:He.PKH,fee:He.ZARITH,counter:He.ZARITH,gas_limit:He.ZARITH,storage_limit:He.ZARITH,rollup:He.SMART_ROLLUP_ADDRESS,cemented_commitment:He.SMART_ROLLUP_COMMITMENT_HASH,output_proof:He.PADDED_BYTES},Cv={arbitrary:He.PADDED_BYTES},vr=n=>e=>t=>Object.keys(e).reduce((i,a)=>{const h=e[a];if(t&&Array.isArray(h)){const v=n[h[0]],D=t[a];if(!Array.isArray(D))throw new oU(`Invalid operation value "${JSON.stringify(D)}" of key "${a}, expected value to be Array.`);return i+D.reduce((L,j)=>L+v(j),"")}return i+(0,n[h])(t[a])},""),yr=n=>e=>t=>Object.keys(e).reduce((i,a)=>{const h=e[a];if(Array.isArray(h)){const v=n[h[0]],D=[],L=t.length();for(;t.length()>0;)if(D.push(v(t)),L===t.length())throw new E6("Unable to decode value");return Object.assign(Object.assign({},i),{[a]:D})}{const D=n[h](t);return void 0!==D?Object.assign(Object.assign({},i),{[a]:D}):Object.assign({},i)}},{}),qt={[He.SECRET]:n=>y6(n.consume(20)),[He.RAW]:n=>y6(n.consume(32)),[He.TZ1]:AU,[He.BRANCH]:TU,[He.ZARITH]:ov,[He.PUBLIC_KEY]:n=>{switch(n.consume(1)[0]){case 0:return ai(rt.EDPK)(n);case 1:return ai(rt.SPPK)(n);case 2:return ai(rt.P2PK)(n);default:throw new l6(n.toString(),Di(nr.NO_PREFIX_MATCHED))}},[He.PKH]:nv,[He.DELEGATE]:n=>{if((n=>255===n.consume(1)[0])(n))return nv(n)},[He.INT32]:n=>{const e=n.consume(4);let t=0;for(let r=0;r{const e=Ii(n),t=Ii(n);return{code:Ls(new Mo(e)),storage:Ls(new Mo(t))}},[He.BALLOT_STATEMENT]:n=>{const e=n.consume(1);switch(e[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new rU(e[0].toString())}},[He.PROPOSAL]:D6,[He.PROPOSAL_ARR]:n=>{const e=[];for(n.consume(4);n.length()>0;)e.push(D6(n));return e},[He.PARAMETERS]:n=>{if(0!==n.consume(1)[0]){const t=(n=>{const e=mr(n.consume(1)[0],2);if(e in td)return td[e];{const t=Ii(n,1),r=Buffer.from(t).toString("utf8");if(r.length>31)throw new M6(r);return r}})(n),r=Ii(n);return{entrypoint:t,value:Ls(new Mo(r))}}},[He.ADDRESS]:n=>{switch(n.consume(1)[0]){case 0:return nv(n);case 1:{const t=ai(rt.KT1)(n);return n.consume(1),t}default:throw new s6(n.toString(),": Unable to decode.")}},[He.SMART_ROLLUP_ADDRESS]:n=>{const e=ai(rt.SR1)(n);if(e.substring(0,3)!==rt.SR1)throw new x6(e,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.SR1}'.`);return e},[He.SMART_CONTRACT_ADDRESS]:n=>{if(1===n.consume(1)[0]){const t=ai(rt.KT1)(n);return n.consume(1),t}throw new u6(n.toString(),Di(nr.NO_PREFIX_MATCHED))},[He.SMART_ROLLUP_COMMITMENT_HASH]:n=>{const e=ai(rt.SRC1)(n);if(e.substring(0,4)!==rt.SRC1)throw new S6(e,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.SRC1}'`);return e},[He.VALUE]:n=>{const e=Ii(n);return Ls(new Mo(e))},[He.INT16]:n=>{const e=n.consume(2);let t=0;for(let r=0;r{const e=Ii(n);return Buffer.from(e).toString("utf8")},[He.TX_ROLLUP_ORIGINATION_PARAM]:n=>({}),[He.TX_ROLLUP_ID]:dH,[He.TX_ROLLUP_BATCH_CONTENT]:n=>{const e=Ii(n);return Buffer.from(e).toString("hex")},[He.BURN_LIMIT]:n=>{const e=n.consume(1);if("00"!==Buffer.from(e).toString("hex"))return ov(n)},[He.DEPOSITS_LIMIT]:n=>{const e=n.consume(1);if("00"!==Buffer.from(e).toString("hex"))return ov(n)},[He.PVM_KIND]:n=>{const e=n.consume(1);switch(e[0]){case 0:return"arith";case 1:return"wasm_2_0_0";default:throw new lU(e[0].toString())}},[He.PADDED_BYTES]:n=>{const e=Ii(n);return Buffer.from(e).toString("hex")},[He.SMART_ROLLUP_MESSAGE]:n=>{const e=Ii(n);return((n,e=4)=>{const t=[];let r=n;for(;r.length();){const i=r.consume(e),a=parseInt(Buffer.from(i).toString("hex"),16);t.push(r.consume(a)),r=r.slice(a+e)}return t})(new Mo(e)).map(r=>Buffer.from(r).toString("hex"))}};qt[He.OPERATION]=(n=>e=>{const t=e.consume(1),r=tv[t[0]];if(void 0===r)throw new sU(t[0].toString());const i=n[r](e);if("object"!=typeof i)throw new E6("Invalid operation, cannot be decoded.");return Object.assign({kind:r},i)})(qt),qt[He.OP_ACTIVATE_ACCOUNT]=n=>yr(qt)(sv)(n),qt[He.OP_FAILING_NOOP]=n=>yr(qt)(Cv)(n),qt[He.OP_DELEGATION]=n=>yr(qt)(lv)(n),qt[He.OP_TRANSACTION]=n=>yr(qt)(uv)(n),qt[He.OP_ORIGINATION]=n=>yr(qt)(cv)(n),qt[He.OP_BALLOT]=n=>yr(qt)(fv)(n),qt[He.OP_ENDORSEMENT]=n=>yr(qt)(hv)(n),qt[He.OP_SEED_NONCE_REVELATION]=n=>yr(qt)(dv)(n),qt[He.OP_PROPOSALS]=n=>yr(qt)(pv)(n),qt[He.OP_REVEAL]=n=>yr(qt)(av)(n),qt[He.OP_REGISTER_GLOBAL_CONSTANT]=n=>yr(qt)(gv)(n),qt[He.OP_TRANSFER_TICKET]=n=>yr(qt)(mv)(n),qt[He.OP_TX_ROLLUP_ORIGINATION]=n=>yr(qt)(vv)(n),qt[He.OP_TX_ROLLUP_SUBMIT_BATCH]=n=>yr(qt)(yv)(n),qt[He.OP_INCREASE_PAID_STORAGE]=n=>yr(qt)(bv)(n),qt[He.OP_UPDATE_CONSENSUS_KEY]=n=>yr(qt)(_v)(n),qt[He.OP_DRAIN_DELEGATE]=n=>yr(qt)(wv)(n),qt[He.OP_SMART_ROLLUP_ORIGINATE]=n=>yr(qt)(Ev)(n),qt[He.OP_SMART_ROLLUP_ADD_MESSAGES]=n=>yr(qt)(xv)(n),qt[He.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=n=>yr(qt)(Sv)(n),qt[He.MANAGER]=yr(qt)(I6),qt[He.OP_SET_DEPOSITS_LIMIT]=n=>yr(qt)(Mv)(n);const Wt={[He.SECRET]:n=>n,[He.RAW]:n=>n,[He.TZ1]:IU,[He.BRANCH]:DU,[He.ZARITH]:iv,[He.PUBLIC_KEY]:n=>{switch(n.substring(0,4)){case rt.EDPK:return"00"+Qr(rt.EDPK)(n);case rt.SPPK:return"01"+Qr(rt.SPPK)(n);case rt.P2PK:return"02"+Qr(rt.P2PK)(n);default:throw new l6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting one of the following '${rt.EDPK}', '${rt.SPPK}', '${rt.P2PK}' or '${rt.BLPK}'.`)}},[He.PKH]:rv,[He.DELEGATE]:n=>n?A6(!0)+rv(n):A6(!1),[He.SCRIPT]:n=>{const e=Bs(n.code),t=Bs(n.storage);return`${mr(e.length/2,8)}${e}${mr(t.length/2,8)}${t}`},[He.BALLOT_STATEMENT]:n=>{switch(n){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new nU(n)}},[He.PROPOSAL]:T6,[He.PROPOSAL_ARR]:n=>mr(32*n.length)+n.map(e=>T6(e)).join(""),[He.INT32]:n=>{const e=parseInt(String(n),10),t=[];for(let r=0;r<4;r++){const i=8*(4-(r+1));t.push((e&255<>i)}return Buffer.from(t).toString("hex")},[He.PARAMETERS]:n=>{if(!n||"default"===n.entrypoint&&"prim"in n.value&&"Unit"===n.value.prim)return"00";const e=(n=>{if(n in _6)return`${_6[n]}`;if(n.length>31)throw new M6(n);return`ff${Bs({string:n}).slice(8)}`})(n.entrypoint),t=Bs(n.value);return`ff${e}${(t.length/2).toString(16).padStart(8,"0")}${t}`},[He.ADDRESS]:n=>{switch(n.substring(0,3)){case rt.TZ1:case rt.TZ2:case rt.TZ3:case rt.TZ4:return"00"+rv(n);case rt.KT1:return"01"+Qr(rt.KT1)(n)+"00";default:throw new s6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting one of the following prefix '${rt.TZ1}', ${rt.TZ2}', '${rt.TZ3}', '${rt.TZ4}' or '${rt.KT1}'.`)}},[He.SMART_ROLLUP_ADDRESS]:n=>{if(n.substring(0,3)!==rt.SR1)throw new x6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.SR1}'.`);return Qr(rt.SR1)(n)},[He.SMART_CONTRACT_ADDRESS]:n=>{if(n.substring(0,3)===rt.KT1)return"01"+Qr(rt.KT1)(n)+"00";throw new u6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.KT1}'.`)},[He.SMART_ROLLUP_COMMITMENT_HASH]:n=>{if(n.substring(0,4)===rt.SRC1)return Qr(rt.SRC1)(n);throw new S6(n,Di(nr.NO_PREFIX_MATCHED)+` expecting prefix '${rt.SRC1}'`)},[He.VALUE]:n=>{const e=Bs(n);return`${mr(e.length/2)}${e}`},[He.INT16]:n=>{const e=parseInt(String(n),10),t=[];for(let r=0;r<2;r++){const i=8*(2-(r+1));t.push((e&255<>i)}return Buffer.from(t).toString("hex")},[He.BLOCK_PAYLOAD_HASH]:sH,[He.ENTRYPOINT]:n=>`${Bs({string:n}).slice(2)}`,[He.TX_ROLLUP_ORIGINATION_PARAM]:n=>"",[He.TX_ROLLUP_ID]:hH,[He.TX_ROLLUP_BATCH_CONTENT]:n=>`${mr(n.length/2)}${n}`,[He.BURN_LIMIT]:n=>n?`ff${iv(n)}`:"00",[He.DEPOSITS_LIMIT]:n=>n?`ff${iv(n)}`:"00",[He.PVM_KIND]:n=>{switch(n){case"arith":return"00";case"wasm_2_0_0":return"01";default:throw new aU(n)}},[He.PADDED_BYTES]:(n,e=8)=>`${mr(n.length/2,e)}${n}`,[He.SMART_ROLLUP_MESSAGE]:n=>{const e=n.reduce((t,r)=>t+`${mr(r.length/2)}${r}`,"");return`${mr(e.length/2)}${e}`}};Wt[He.OPERATION]=(n=>e=>{if(!(e.kind in n)||!(e.kind in b6))throw new c6(e.kind);return b6[e.kind]+n[e.kind](e)})(Wt),Wt[He.OP_ACTIVATE_ACCOUNT]=n=>vr(Wt)(sv)(n),Wt[He.OP_DELEGATION]=n=>vr(Wt)(lv)(n),Wt[He.OP_TRANSACTION]=n=>vr(Wt)(uv)(n),Wt[He.OP_ORIGINATION]=n=>vr(Wt)(cv)(n),Wt[He.OP_BALLOT]=n=>vr(Wt)(fv)(n),Wt[He.OP_ENDORSEMENT]=n=>vr(Wt)(hv)(n),Wt[He.OP_SEED_NONCE_REVELATION]=n=>vr(Wt)(dv)(n),Wt[He.OP_PROPOSALS]=n=>vr(Wt)(pv)(n),Wt[He.OP_REVEAL]=n=>vr(Wt)(av)(n),Wt[He.OP_REGISTER_GLOBAL_CONSTANT]=n=>vr(Wt)(gv)(n),Wt[He.OP_TRANSFER_TICKET]=n=>vr(Wt)(mv)(n),Wt[He.OP_TX_ROLLUP_ORIGINATION]=n=>vr(Wt)(vv)(n),Wt[He.OP_TX_ROLLUP_SUBMIT_BATCH]=n=>vr(Wt)(yv)(n),Wt[He.OP_INCREASE_PAID_STORAGE]=n=>vr(Wt)(bv)(n),Wt[He.OP_UPDATE_CONSENSUS_KEY]=n=>vr(Wt)(_v)(n),Wt[He.OP_DRAIN_DELEGATE]=n=>vr(Wt)(wv)(n),Wt[He.OP_SMART_ROLLUP_ORIGINATE]=n=>vr(Wt)(Ev)(n),Wt[He.OP_SMART_ROLLUP_ADD_MESSAGES]=n=>vr(Wt)(xv)(n),Wt[He.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=n=>vr(Wt)(Sv)(n),Wt[He.MANAGER]=vr(Wt)(I6),Wt[He.OP_SET_DEPOSITS_LIMIT]=n=>vr(Wt)(Mv)(n),Wt[He.OP_FAILING_NOOP]=n=>vr(Wt)(Cv)(n);const R6={activate_account:sv,reveal:av,delegation:lv,transaction:uv,origination:cv,ballot:fv,endorsement:hv,seed_nonce_revelation:dv,proposals:pv,register_global_constant:gv,transfer_ticket:mv,tx_rollup_origination:vv,tx_rollup_submit_batch:yv,increase_paid_storage:bv,update_consensus_key:_v,drain_delegate:wv,set_deposits_limit:Mv,smart_rollup_originate:Ev,smart_rollup_add_messages:xv,smart_rollup_execute_outbox_message:Sv,failing_noop:Cv},TH=n=>Object.keys(R6).includes(n),DH=n=>{const e=n.kind,r=((n,e)=>n.filter(t=>"kind"!==t))(Object.keys(n));return((n,e)=>e.filter(t=>!n.includes(t)))(r,Object.keys(R6[e]))};var nd=(()=>(function(n){n.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",n.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",n.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",n.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",n.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",n.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",n.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",n.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",n.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",n.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",n.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",n.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",n.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",n.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",n.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",n.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",n.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(nd||(nd={})),nd))();const IH=nd.PtMumbai2,PH=new class OH{constructor(e=IH){this.protocolHash=e,this.codec=function RH(n,e){return{encoder:Wt[n],decoder:t=>{const r=Mo.fromHexString(t);return qt[n](r)}}}(He.MANAGER)}forge(e){const t=function ZF(n){return function wo(n,e){const t=new RegExp(`^(${e.join("|")})`).exec(n);if(!t||0===t.length)return nr.NO_PREFIX_MATCHED;const r=t[0];if(!function VF(n){return"string"==typeof n&&n in hr}(r))return nr.NO_PREFIX_MATCHED;if(n.includes("%")&&(n=n.split("%")[0]),!/^(KT1\w{33})$/.test(n)&&"KT1"===r)return nr.INVALID_CHECKSUM;let a=vm().decodeUnsafe(n);return a?(a=a.slice(hr[r].length),a.length!==Ol[r]?nr.INVALID_LENGTH:nr.VALID):nr.INVALID_CHECKSUM}(n,KF)}(e.branch);if(t!==nr.VALID)throw new PF(e.branch,Di(t));for(const i of e.contents){if(!TH(i.kind))throw new c6(i.kind);const a=DH(i);if(1===a.length){if("delegation"===i.kind&&"delegate"===a[0])continue;if("origination"===i.kind&&"delegate"===a[0])continue;if("transaction"===i.kind&&"parameters"===a[0])continue;if("set_deposits_limit"===i.kind&&"limit"===a[0])continue;if("tx_rollup_submit_batch"===i.kind&&"burn_limit"===a[0])continue;throw new w6(i,`missing properties "${a.join(", ")}"`)}if(a.length>1)throw new w6(i,`missing properties "${a.join(", ")}"`)}const r=this.codec.encoder(e).toLowerCase();return Promise.resolve(r)}parse(e){return Promise.resolve(this.codec.decoder(e))}},kH=function(){var n=Ot(function*(e,t,r){let i=0;return e.contents.forEach((a,h)=>{const{metadata:v}=t.contents[h];if(!v.operation_result)return;const D=a,L=v.operation_result;if(L.errors)throw new Error(`The operation produced an error ${JSON.stringify(L.errors)}`);let{gasLimit:j,storageLimit:Q}=(n=>{let e=0,t=0;return n.internal_operation_results?(n.internal_operation_results.forEach(r=>{if(null==r?void 0:r.result){if(r.result.errors)throw new Error(`An internal operation produced an error ${JSON.stringify(r.result.errors)}`);e+=Math.ceil(Number(r.result.consumed_milligas)/1e3),r.result.paid_storage_size_diff&&(t+=Number(r.result.paid_storage_size_diff)),r.result.originated_contracts&&(t+=257*r.result.originated_contracts.length),r.result.allocated_destination_contract&&(t+=257)}}),{gasLimit:e,storageLimit:t}):{gasLimit:e,storageLimit:t}})(v);j+=Math.ceil(Number(L.consumed_milligas)/1e3),L.paid_storage_size_diff&&(Q+=Number(L.paid_storage_size_diff)),L.originated_contracts&&(Q+=257*L.originated_contracts.length),L.allocated_destination_contract&&(Q+=257),(D.gas_limit&&r||D.gas_limit===gc)&&(D.gas_limit=j.toString()),(D.storage_limit&&r||D.storage_limit===Jm)&&(D.storage_limit=Q.toString()),i+=j}),i});return function(t,r,i){return n.apply(this,arguments)}}(),BH=function(){var n=Ot(function*(e,t,r=!0,i){const h=[Ir.TRANSACTION,Ir.REVEAL,Ir.ORIGINATION,Ir.DELEGATION],v=e.contents.map((ye,Te)=>{if(!h.includes(ye.kind))return ye;const Ve=ye,je=new Nn(1733333).dividedToIntegerBy(e.contents.length),gt=new Nn(gc).gt(je)?je:gc,Ie=i?i.plus(Te).toString():Ve.counter;return Object.assign(Object.assign({},ye),{gas_limit:gt,counter:Ie})}),L={chain_id:(yield fetch(`${t}chains/main/blocks/head/header`).then(ye=>ye.json())).chain_id,operation:{branch:e.branch,contents:v,signature:"sigUHx32f9wesZ1n2BWpixXz4AQaZggEtchaQNHYGRCoWNAXx45WGW2ua3apUUUAGMLPwAU41QoaFCzVSL61VaessLg4YbbP"}},j=yield PH.forge(e),Q=yield fetch(`${t}chains/main/blocks/head/helpers/scripts/run_operation`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)}).then(ye=>ye.json()).catch(ye=>{throw ye});if(e.contents.length!==Q.contents.length)throw new Error(`Run Operation did not return same number of operations. Locally we have ${e.contents.length}, but got back ${Q.contents.length}`);const me=yield kH(e,Q,r);if(r||e.contents.some(ye=>"0"===(null==ye?void 0:ye.fee))){const ye=100+1*Math.ceil((j.length+128)/2)+.1*me+100,Te=e.contents.filter(je=>"reveal"!==je.kind),Ve=Math.ceil(ye/Te.length);e.contents.forEach(je=>{je.fee&&"reveal"!==je.kind&&(je.fee=Ve.toString())})}return e});return function(t,r){return n.apply(this,arguments)}}(),LH=function(){var n=Ot(function*(e,t,r){let i=new Nn(0);try{const a=yield fetch(`${t}chains/main/blocks/head/context/contracts/${e}/balance`).then(h=>h.json());i=i.plus(new Nn(a))}catch(a){if(a.response&&404!==a.response.status)throw new Error("Error fetching balance")}return i.toString(10)});return function(t,r,i){return n.apply(this,arguments)}}(),FH=function(){var n=Ot(function*(e,t,r,i,a,h){var v,D,L,j,Q;const me=e;if(!me.public_key)throw new Error('property "public_key" was not defined');return me.source=null!==(v=me.source)&&void 0!==v?v:t,me.counter=null!==(D=me.counter)&&void 0!==D?D:r,me.fee=null!==(L=me.fee)&&void 0!==L?L:i,me.gas_limit=null!==(j=me.gas_limit)&&void 0!==j?j:a,me.storage_limit=null!==(Q=me.storage_limit)&&void 0!==Q?Q:h,me});return function(t,r,i,a,h,v){return n.apply(this,arguments)}}(),UH=function(){var n=Ot(function*(e,t,r,i,a,h){var v,D,L,j,Q;const me=e;return me.source=null!==(v=me.source)&&void 0!==v?v:t,me.counter=null!==(D=me.counter)&&void 0!==D?D:r,me.fee=null!==(L=me.fee)&&void 0!==L?L:i,me.gas_limit=null!==(j=me.gas_limit)&&void 0!==j?j:a,me.storage_limit=null!==(Q=me.storage_limit)&&void 0!==Q?Q:h,me});return function(t,r,i,a,h,v){return n.apply(this,arguments)}}(),HH=function(){var n=Ot(function*(e,t,r,i){var a,h,v,D,L;const j=e;if(!j.amount)throw new Error('property "amount" was not defined');if(!j.destination)throw new Error('property "destination" was not defined');return j.source=null!==(a=j.source)&&void 0!==a?a:t,j.counter=null!==(h=j.counter)&&void 0!==h?h:r,j.fee=null!==(v=j.fee)&&void 0!==v?v:i,j.gas_limit=null!==(D=j.gas_limit)&&void 0!==D?D:gc,j.storage_limit=null!==(L=j.storage_limit)&&void 0!==L?L:Jm,j});return function(t,r,i,a){return n.apply(this,arguments)}}(),VH=function(){var n=Ot(function*(e,t,r,i){var a,h,v,D,L;const j=e;if(!j.balance)throw new Error('property "balance" was not defined');if(!j.script)throw new Error('property "script" was not defined');return j.source=null!==(a=j.source)&&void 0!==a?a:t,j.counter=null!==(h=j.counter)&&void 0!==h?h:r,j.fee=null!==(v=j.fee)&&void 0!==v?v:i,j.gas_limit=null!==(D=j.gas_limit)&&void 0!==D?D:gc,j.storage_limit=null!==(L=j.storage_limit)&&void 0!==L?L:Jm,j});return function(t,r,i,a){return n.apply(this,arguments)}}(),O6=function(){var n=Ot(function*(e,t,r,i,a=!0){let h=new Nn(1);const v=[],D=yield Promise.all((yield Promise.all([fetch(`${i}chains/main/blocks/head/context/contracts/${e}/counter`),fetch(`${i}chains/main/blocks/head~2/hash`),fetch(`${i}chains/main/blocks/head/context/contracts/${e}/manager_key`)]).catch(Ve=>{throw new Error(Ve)})).map(Ve=>Ve.json()));h=new Nn(D[0]).plus(1);const L=D[1],j=D[2],Q=r.some(Ve=>Ve.kind===Ir.REVEAL);!j&&!Q&&(v.push(yield RF(h,t,e)),h=h.plus(1));const me=r.map(function(){var Ve=Ot(function*(je,gt){if(!je.kind)throw new Error(`property "kind" was not defined ${JSON.stringify(je)}`);const Ie=je.destination;let _t;(null==Ie?void 0:Ie.toLowerCase().startsWith("tz"))&&(_t=new Nn(yield LH(Ie,i)));const At=h.plus(gt).toFixed(),Zt=(null==_t?void 0:_t.isZero())&&Ie&&Ie.toLowerCase().startsWith("tz")?"300":"0";switch(je.kind){case Ir.REVEAL:return FH(je,e,At,"0","10300",Zt);case Ir.DELEGATION:return UH(je,e,At,"0","10300",Zt);case Ir.TRANSACTION:return HH(je,e,At,"0");case Ir.ORIGINATION:return VH(je,e,At,"0");case Ir.ENDORSEMENT:case Ir.SEED_NONCE_REVELATION:case Ir.DOUBLE_ENDORSEMENT_EVIDENCE:case Ir.DOUBLE_BAKING_EVIDENCE:case Ir.ACTIVATE_ACCOUNT:case Ir.PROPOSALS:case Ir.BALLOT:return je;default:throw new Error(`unsupported operation type "${JSON.stringify(je.kind)}"`)}});return function(je,gt){return Ve.apply(this,arguments)}}());return v.push(...yield Promise.all(me)),yield BH({branch:L,contents:v},i,a)});return function(t,r,i,a){return n.apply(this,arguments)}}();let rd=(()=>{class n{constructor(t){this.toastr=t}showTxSuccessToast(){return this.toastr.success("Operation sent",void 0,{progressBar:!0,positionClass:"toast-bottom-center"})}showTxErrorToast(){return this.toastr.error("Operaton failed to send",void 0,{progressBar:!0,positionClass:"toast-bottom-center"})}showCopiedToClipboard(){return this.toastr.success("Copied to clipboard","Success",{progressBar:!0,positionClass:"toast-bottom-center"})}showOperationRequestReceivedToast(){return this.toastr.success("Operation request received","Success",{closeButton:!0,timeOut:0,positionClass:"toast-bottom-center"})}showSignRequestReceivedToast(){return this.toastr.success("Sign request received","Success",{closeButton:!0,timeOut:0,positionClass:"toast-bottom-center"})}}return n.\u0275fac=function(t){return new(t||n)(Mt(Qh))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function jH(n,e){if(1&n&&(Ue(0,"small",10),ft(1),Ge()),2&n){const t=zt();bt(1),Vn("Fee: ",t.fee," \ua729")}}let $H=(()=>{class n{constructor(t,r,i,a,h){this.bsModalRef=t,this.apiService=r,this.accountService=i,this.beaconService=a,this.toastService=h,this.recipient="",this.amount="",this.usdAmount="0.00",this.usdPrice=0,this.apiService.getXtzPrice().then(v=>this.usdPrice=v)}ngOnInit(){}send(){var t=this;return Ot(function*(){t.accountService.accounts$.pipe(fi()).subscribe(function(){var r=Ot(function*(i){const a=i[0],h=[{kind:xl.TRANSACTION,amount:new Nn(t.amount).times(1e6).toString(),destination:t.recipient}];try{const v=yield O6(a.address,a.publicKey,h,t.apiService.RPCs[Gi.MAINNET].selected+"/");t.fee=new Nn(v.contents[0].fee).div(1e6).toString();const D=yield Tm(h);t.toastService.showTxSuccessToast(),console.log("RESULT",D)}catch(v){t.toastService.showTxErrorToast()}t.bsModalRef.hide()});return function(i){return r.apply(this,arguments)}}())})()}onAmountChanged(t){this.amount=t,this.usdAmount=new Nn(t).times(this.usdPrice).toString(10)}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Ju),ot(Os),ot(mc),ot(rd))},n.\u0275cmp=Un({type:n,selectors:[["app-send-tez-modal"]],decls:23,vars:5,consts:[[1,"modal-header","send-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","text-center",2,"padding","0"],[1,"modal-title"],[1,"text-left"],["for","amount",2,"margin","0"],[1,"amount-text"],["type","input","id","amount","placeholder","0.00",1,"form-control","custom-input",3,"ngModel","ngModelChange"],[1,"d-flex","justify-content-between"],[1,"form-text","text-muted"],["class","form-text text-muted",4,"ngIf"],["for","sendTo",2,"margin","0"],[1,"send-text"],["type","input","id","sendTo","placeholder","Paste tz address here",1,"form-control","custom-input",3,"ngModel","ngModelChange"],["type","button",1,"btn","button","btn-circle","btn-block",3,"disabled","click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6,"Send tez"),Ge(),Ue(7,"div",5)(8,"label",6)(9,"h5",7),ft(10,"Amount:"),Ge()(),Ue(11,"input",8),Tt("ngModelChange",function(a){return r.onAmountChanged(a)}),Ge(),Ue(12,"div",9)(13,"small",10),ft(14),Ge(),Ft(15,jH,2,1,"small",11),Ge()(),Ue(16,"div",5)(17,"label",12)(18,"h5",13),ft(19,"Send To:"),Ge()(),Ue(20,"input",14),Tt("ngModelChange",function(a){return r.recipient=a}),Ge()(),Ue(21,"button",15),Tt("click",function(){return r.send()}),ft(22," Preview "),Ge()()),2&t&&(bt(11),Ct("ngModel",r.amount),bt(3),Vn("USD: $",r.usdAmount,""),bt(1),Ct("ngIf",r.fee),bt(5),Ct("ngModel",r.recipient),bt(1),Ct("disabled",0===r.amount.length||0===r.recipient.length))},directives:[Il,Vh,pc,fo],styles:[".custom-input[_ngcontent-%COMP%]{padding:0 24px;border-radius:100px;border:1px solid #d2d2d7;min-height:52px}.button[_ngcontent-%COMP%]{width:100%;height:52px;padding:0 24px;border-radius:100px;gap:10px;background-color:#0f61ff;color:#fff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;margin-top:30px;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#183fd7}.btn[_ngcontent-%COMP%]:disabled{background-color:#d2d2d7;color:#86868b}.send-header[_ngcontent-%COMP%]{padding:10px 10px 0 0}.amount-text[_ngcontent-%COMP%]{margin:0 0 12px}.form-text[_ngcontent-%COMP%]{margin:12px 0 0}.send-text[_ngcontent-%COMP%]{margin:24px 0 12px}"]}),n})(),Av=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-text-modal"]],decls:11,vars:3,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body"],[1,"modal-title","pull-left"],[3,"innerHTML"],[1,"modal-footer"],["type","button",1,"btn","btn-default",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6),Ge(),Bt(7,"p",5),Ge(),Ue(8,"div",6)(9,"button",7),Tt("click",function(){return r.bsModalRef.hide()}),ft(10),Ge()()),2&t&&(bt(6),Nr(r.title),bt(1),Ct("innerHTML",r.text,nf),bt(3),Vn(" ",r.closeBtnName," "))},styles:[""]}),n})(),Tv=(()=>{class n{constructor(t){this.toastService=t}copy(t){var r=this;return Ot(function*(){navigator.clipboard.writeText(t).then(()=>{r.toastService.showCopiedToClipboard()}).catch(i=>console.error("Failed to copy!",i))})()}paste(){return Ot(function*(){return navigator.clipboard.readText().then(function(){var t=Ot(function*(r){return r});return function(r){return t.apply(this,arguments)}}()).catch(t=>{throw t})})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(rd))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function N6(n,e,t,r){return new(t||(t=Promise))(function(a,h){function v(j){try{L(r.next(j))}catch(Q){h(Q)}}function D(j){try{L(r.throw(j))}catch(Q){h(Q)}}function L(j){j.done?a(j.value):function i(a){return a instanceof t?a:new t(function(h){h(a)})}(j.value).then(v,D)}L((r=r.apply(n,e||[])).next())})}var Iv=I(5876);const KH=["qrcElement"];let qH=(()=>{class n{constructor(t,r){this.renderer=t,this.sanitizer=r,this.allowEmptyString=!1,this.colorDark="#000000ff",this.colorLight="#ffffffff",this.cssClass="qrcode",this.elementType="canvas",this.errorCorrectionLevel="M",this.margin=4,this.qrdata="",this.scale=4,this.width=10,this.qrCodeURL=new vn,this.context=null}ngOnChanges(){return N6(this,void 0,void 0,function*(){yield this.createQRCode()})}isValidQrCodeText(t){return!1===this.allowEmptyString?!(void 0===t||""===t||"null"===t||null===t):void 0!==t}toDataURL(t){return new Promise((r,i)=>{Iv.hz(this.qrdata,t,(a,h)=>{a?i(a):r(h)})})}toCanvas(t,r){return new Promise((i,a)=>{Iv.rT(t,this.qrdata,r,h=>{h?a(h):i("success")})})}toSVG(t){return new Promise((r,i)=>{Iv.toString(this.qrdata,t,(a,h)=>{a?i(a):r(h)})})}renderElement(t){for(const r of this.qrcElement.nativeElement.childNodes)this.renderer.removeChild(this.qrcElement.nativeElement,r);this.renderer.appendChild(this.qrcElement.nativeElement,t)}createQRCode(){return N6(this,void 0,void 0,function*(){this.version&&this.version>40?(console.warn("[angularx-qrcode] max value for `version` is 40"),this.version=40):this.version&&this.version<1?(console.warn("[angularx-qrcode]`min value for `version` is 1"),this.version=1):void 0!==this.version&&isNaN(this.version)&&(console.warn("[angularx-qrcode] version should be a number, defaulting to auto."),this.version=void 0);try{if(!this.isValidQrCodeText(this.qrdata))throw new Error("[angularx-qrcode] Field `qrdata` is empty, set 'allowEmptyString=\"true\"' to overwrite this behaviour.");this.isValidQrCodeText(this.qrdata)&&""===this.qrdata&&(this.qrdata=" ");const t={color:{dark:this.colorDark,light:this.colorLight},errorCorrectionLevel:this.errorCorrectionLevel,margin:this.margin,scale:this.scale,type:this.elementType,version:this.version,width:this.width},r=this.imageSrc,i=this.imageHeight||40,a=this.imageWidth||40;switch(this.elementType){case"canvas":const h=this.renderer.createElement("canvas");this.context=h.getContext("2d"),this.toCanvas(h,t).then(()=>{if(this.ariaLabel&&this.renderer.setAttribute(h,"aria-label",`${this.ariaLabel}`),this.title&&this.renderer.setAttribute(h,"title",`${this.title}`),r&&this.context){this.centerImage=new Image(a,i),r!==this.centerImage.src&&(this.centerImage.src=r),i!==this.centerImage.height&&(this.centerImage.height=i),a!==this.centerImage.width&&(this.centerImage.width=a);const L=this.centerImage;L&&(L.onload=()=>{var j;null===(j=this.context)||void 0===j||j.drawImage(L,h.width/2-a/2,h.height/2-i/2,a,i)})}this.renderElement(h),this.emitQRCodeURL(h)}).catch(L=>{console.error("[angularx-qrcode] canvas error:",L)});break;case"svg":const v=this.renderer.createElement("div");this.toSVG(t).then(L=>{this.renderer.setProperty(v,"innerHTML",L);const j=v.firstChild;this.renderer.setAttribute(j,"height",`${this.width}`),this.renderer.setAttribute(j,"width",`${this.width}`),this.renderElement(j),this.emitQRCodeURL(j)}).catch(L=>{console.error("[angularx-qrcode] svg error:",L)});break;default:const D=this.renderer.createElement("img");this.toDataURL(t).then(L=>{this.alt&&D.setAttribute("alt",this.alt),this.ariaLabel&&D.setAttribute("aria-label",this.ariaLabel),D.setAttribute("src",L),this.title&&D.setAttribute("title",this.title),this.renderElement(D),this.emitQRCodeURL(D)}).catch(L=>{console.error("[angularx-qrcode] img/url error:",L)})}}catch(t){console.error("[angularx-qrcode] Error generating QR Code:",t.message)}})}emitQRCodeURL(t){const r=t.constructor.name;if(r===SVGSVGElement.name){const h=new Blob([t.outerHTML],{type:"image/svg+xml"}),v=URL.createObjectURL(h),D=this.sanitizer.bypassSecurityTrustUrl(v);return void this.qrCodeURL.emit(D)}let i="";r===HTMLCanvasElement.name&&(i=t.toDataURL("image/png")),r===HTMLImageElement.name&&(i=t.src),fetch(i).then(a=>a.blob()).then(a=>URL.createObjectURL(a)).then(a=>this.sanitizer.bypassSecurityTrustUrl(a)).then(a=>{this.qrCodeURL.emit(a)}).catch(a=>{console.error("[angularx-qrcode] Error when fetching image/png URL: "+a)})}}return n.\u0275fac=function(t){return new(t||n)(ot(Fi),ot(Wf))},n.\u0275cmp=Un({type:n,selectors:[["qrcode"]],viewQuery:function(t,r){if(1&t&&jw(KH,7),2&t){let i;Ef(i=function xf(){return function jD(n,e){return n[19].queries[e].queryList}(Et(),x1())}())&&(r.qrcElement=i.first)}},inputs:{allowEmptyString:"allowEmptyString",colorDark:"colorDark",colorLight:"colorLight",cssClass:"cssClass",elementType:"elementType",errorCorrectionLevel:"errorCorrectionLevel",imageSrc:"imageSrc",imageHeight:"imageHeight",imageWidth:"imageWidth",margin:"margin",qrdata:"qrdata",scale:"scale",version:"version",width:"width",alt:"alt",ariaLabel:"ariaLabel",title:"title"},outputs:{qrCodeURL:"qrCodeURL"},features:[qr],decls:2,vars:2,consts:[["qrcElement",""]],template:function(t,r){1&t&&Bt(0,"div",null,0),2&t&&so(r.cssClass)},encapsulation:2,changeDetection:0}),n})(),WH=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:[]}),n})(),Rv=(()=>{class n{transform(t,r={}){if(!t||"string"!=typeof t)return"";let i=t;return t.length>=13&&(void 0===r.ifMatches||i.match(r.ifMatches))&&(i=`${t.substr(0,7)}...${t.substr(-4)}`),i}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=Gr({name:"shortenString",type:n,pure:!0}),n})(),ZH=(()=>{class n{constructor(t,r){this.bsModalRef=t,this.clipboardService=r,this.qrData=""}ngOnInit(){}copyToClipboard(){this.clipboardService.copy(this.qrData)}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Tv))},n.\u0275cmp=Un({type:n,selectors:[["app-qr-modal"]],decls:15,vars:7,consts:[[1,"modal-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","d-flex","flex-column","align-items-center"],[1,"modal-title"],[3,"qrdata","width","errorCorrectionLevel","click"],[1,"addressBox"],["src","./assets/metamask-logo-sm.svg","alt","SVG Image",2,"width","16px","height","16px"],[1,"addressContainer"],[1,"textAddress"],["src","./assets/icons/FiCopy.svg","alt","SVG Image",1,"copy-button",2,"width","16px","height","16px",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6),Ge(),Ue(7,"qrcode",5),Tt("click",function(){return r.copyToClipboard()}),Ge(),Ue(8,"div",6),Bt(9,"img",7),Ue(10,"div",8)(11,"div",9),ft(12),Qo(13,"shortenString"),Ge(),Ue(14,"img",10),Tt("click",function(){return r.copyToClipboard()}),Ge()()()()),2&t&&(bt(6),Nr(r.title),bt(1),Ct("qrdata",r.qrData)("width",256)("errorCorrectionLevel","M"),bt(5),Vn(" ",Js(13,5,r.qrData)," "))},directives:[qH],pipes:[Rv],styles:[".addressContainer[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.addressBox[_ngcontent-%COMP%]{width:200px;display:flex;justify-content:center;align-items:center;margin:10px;gap:6px;padding:11px 16px;background:#f5f5f7;border-radius:100px;height:40px;cursor:pointer}.textAddress[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;color:#1d1d1f;word-wrap:break-word}.addressBox[_ngcontent-%COMP%]:hover{background-color:#d2d2d7}.addressBox[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:focus{background-color:#d2d2d7;outline:none}.addressBox[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{background-color:#d2d2d7;cursor:pointer}"]}),n})(),XH=(()=>{class n{constructor(t,r,i){var a=this;this.bsModalRef=t,this.accountService=r,this.beaconService=i,this.address="",this.accountService.accounts$.pipe(fi()).subscribe(function(){var h=Ot(function*(v){v[0]&&(a.address=v[0].address)});return function(v){return h.apply(this,arguments)}}())}ngOnInit(){}close(){this.bsModalRef.hide(),this.beaconService.handlePendingRequest()}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Os),ot(mc))},n.\u0275cmp=Un({type:n,selectors:[["app-connected-modal"]],decls:29,vars:1,consts:[[1,"modal-header"],[1,"modalTitle","modal-title"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modalContainer"],[1,"modal-body",2,"padding","20px"],[1,"inputTitle"],[1,"inputBox"],[1,"inputText"],[1,"inputTitleA"],[1,"infoInputBox"],["src","./assets/icons/FiAlertCircleRed.svg","alt","alert",2,"width","20px","height","20px"],[1,"infoInputText"],["src","./assets/icons/FiAlertCircleBlack.svg","alt","alert",2,"width","20px","height","20px"],[1,"modal-footer",2,"width","fit-content","padding","0"],["type","button",1,"button","btn","btn-block","btn-primary",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"h2",1),ft(2,"Connected To MetaMask"),Ge(),Ue(3,"button",2),Tt("click",function(){return r.close()}),Ue(4,"span",3),ft(5,"\xd7"),Ge()()(),Ue(6,"div",4)(7,"div",5)(8,"p",6),ft(9,"Network:"),Ge(),Ue(10,"div",7)(11,"p",8),ft(12,"Mainnet"),Ge()(),Ue(13,"p",9),ft(14,"Account:"),Ge(),Ue(15,"div",7)(16,"p",8),ft(17),Ge()(),Ue(18,"div",10),Bt(19,"img",11),Ue(20,"p",12),ft(21," This account was generated with your MetaMask Secret Recovery Phrase. "),Ge()(),Ue(22,"div",10),Bt(23,"img",13),Ue(24,"p",12),ft(25," This explorer will allow you to connect with Tezos dApps and send/receive tokens via the MetaMask Wallet. Note, this account won't be visible in your MetaMask browser extension. "),Ge()()(),Ue(26,"div",14)(27,"button",15),Tt("click",function(){return r.close()}),ft(28," Got it! "),Ge()()()),2&t&&(bt(17),Nr(r.address))},styles:[".modalContainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}.modal-footer[_ngcontent-%COMP%]{display:flex;justify-content:center}.modalTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:center;margin:0 auto;padding-left:30px}.inputTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:19px;letter-spacing:0em;text-align:left;margin:0 0 12px}.inputTitleA[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:19px;letter-spacing:0em;text-align:left;margin:24px 0 12px}.inputBox[_ngcontent-%COMP%]{width:400px;height:50px;padding:0 24px;border-radius:100px;border:2px;gap:10px;background-color:#f5f5f7;display:flex;justify-content:left;align-items:center}.inputText[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:600;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto;color:#424245}.infoInputBox[_ngcontent-%COMP%]{width:400px;padding:20px;border-radius:10px;gap:10px;background-color:#f5f5f7;display:flex;justify-content:left;align-items:center;margin-top:30px}.infoInputText[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto}.button[_ngcontent-%COMP%]{width:400px;height:52px;padding:0 24px;border-radius:100px;gap:10px;background-color:#0f61ff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#183fd7;color:#fff}"]}),n})();function YH(n,e){if(1&n){const t=oo();Ue(0,"span",5)(1,"div",6)(2,"div",7),Bt(3,"img",8),Ge(),Ue(4,"div",9)(5,"div")(6,"p",10),ft(7),Ge(),Ue(8,"p",11),ft(9),Ge()(),Ue(10,"div",12)(11,"div",13)(12,"a",14),Tt("click",function(){ui(t);const i=zt();return i.openLink("https://tzkt.io/"+i.nft.token.contract.address+"/tokens/"+i.nft.token.tokenId+"/transfers")}),ft(13," Tezos Blockchain "),Bt(14,"img",15),Ge(),Ue(15,"a",16),Tt("click",function(){ui(t);const i=zt();return i.openLink("https://better-call.dev/mainnet/"+i.nft.token.contract.address+"/operations")}),ft(16," Smart Contract "),Bt(17,"img",15),Ge()()()()()()}if(2&n){const t=zt();bt(3),Ct("src",t.nft.token.metadata.sanitizedThumbnailUri,ws),bt(4),Nr(t.nft.token.metadata.name),bt(2),Nr(t.nft.token.metadata.description)}}let QH=(()=>{class n{constructor(t){this.bsModalRef=t}ngOnInit(){}openLink(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr))},n.\u0275cmp=Un({type:n,selectors:[["app-nft-modal"]],decls:6,vars:1,consts:[[1,"modal-header",2,"padding","0","padding-top","10px","padding-right","10px"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","text-center",2,"padding","0"],["class","nft-info",4,"ngIf"],[1,"nft-info"],[1,"d-flex","flex-lg-row","flex-column","align-items-start"],[1,"image-container"],[1,"img-fluid","max-400",3,"src"],[1,"text-container","ml-lg-3","d-flex","flex-column"],[1,"text-name"],[1,"text-description"],[1,"mt-auto"],[1,"links"],["href","#",1,"custom-link",3,"click"],["src","./assets/icons/Links.svg","alt","SVG Image",1,"link-icon"],["href","#",1,"custom-link",2,"margin-left","10px",3,"click"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3),Ft(5,YH,18,3,"span",4),Ge()),2&t&&(bt(5),Ct("ngIf",r.nft))},directives:[fo],styles:[".nft-info[_ngcontent-%COMP%]{display:flex;align-items:center;max-width:100%;max-height:100%;overflow:hidden;height:100%;width:100%;box-sizing:border-box;flex-wrap:wrap}.text-container[_ngcontent-%COMP%]{flex:1;text-align:left}.max-400[_ngcontent-%COMP%]{max-width:400px;max-height:400px;width:auto;height:auto;object-fit:contain}.custom-link[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:12px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;color:#0f61ff;text-decoration:none;display:inline-block;margin-top:5px}.text-name[_ngcontent-%COMP%]{font-weight:700}.custom-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.link-icon[_ngcontent-%COMP%]{width:14px;height:14px;margin-left:1px;margin-bottom:1px}@media (max-width: 767px){.max-400[_ngcontent-%COMP%]{max-width:100%;max-height:none}.text-container[_ngcontent-%COMP%]{margin-top:30px}}@media (min-width: 992px){.text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between;height:400px}.image-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;justify-content:center;align-items:center}.text-container[_ngcontent-%COMP%] .links[_ngcontent-%COMP%]{margin-top:auto}}"]}),n})();function JH(n,e){if(1&n&&(Ue(0,"small",15),ft(1),Ge()),2&n){const t=zt();bt(1),Vn("Fee: ",t.fee," \ua729")}}let eV=(()=>{class n{constructor(t,r,i,a,h){this.bsModalRef=t,this.apiService=r,this.accountService=i,this.beaconService=a,this.toastService=h,this.recipient="",this.amount=""}ngOnInit(){}send(){var t=this;return Ot(function*(){const r=(a,h,v,D,L)=>({kind:xl.TRANSACTION,amount:"0",destination:a,parameters:{entrypoint:"transfer",value:[{prim:"Pair",args:[{string:h},[{prim:"Pair",args:[{string:v},{prim:"Pair",args:[{int:D},{int:L}]}]}]]}]}}),i=(a,h,v,D)=>({kind:xl.TRANSACTION,amount:"0",destination:a,parameters:{entrypoint:"transfer",value:{prim:"Pair",args:[{string:h},{prim:"Pair",args:[{string:v},{int:D}]}]}}});t.accountService.accounts$.pipe(fi()).subscribe(function(){var a=Ot(function*(h){if(!t.token)return;const v=h[0],D=new Nn(t.amount).shiftedBy(new Nn(t.token.token.metadata.decimals).toNumber()).toString(10),L=["fa2"===t.token.token.standard?r(t.token.token.contract.address,v.address,t.recipient,t.token.token.tokenId,D):i(t.token.token.contract.address,v.address,t.recipient,D)];try{const j=yield O6(v.address,v.publicKey,L,t.apiService.RPCs[Gi.MAINNET].selected+"/");t.fee=new Nn(j.contents[0].fee).div(1e6).toString();const Q=yield Tm(L);t.toastService.showTxSuccessToast(),console.log("RESULT",Q)}catch(j){t.toastService.showTxErrorToast()}t.bsModalRef.hide()});return function(h){return a.apply(this,arguments)}}())})()}onAmountChanged(t){this.amount=t}}return n.\u0275fac=function(t){return new(t||n)(ot(Xr),ot(Ju),ot(Os),ot(mc),ot(rd))},n.\u0275cmp=Un({type:n,selectors:[["app-send-token-modal"]],decls:21,vars:5,consts:[[1,"modal-header","send-header"],["type","button","aria-label","Close",1,"btn-close","close","pull-right",3,"click"],["aria-hidden","true",1,"visually-hidden"],[1,"modal-body","text-center",2,"padding","0"],[1,"modal-title"],[1,"text-left"],["for","amount",2,"margin","0"],[1,"amount-text"],["type","input","id","amount","placeholder","0.00",1,"form-control","custom-input",3,"ngModel","ngModelChange"],[1,"d-flex","justify-content-between"],["class","form-text text-muted",4,"ngIf"],["for","sendTo",2,"margin","0"],[1,"send-text"],["type","input","id","sendTo","placeholder","Paste tz address here",1,"form-control","custom-input",3,"ngModel","ngModelChange"],["type","button",1,"btn","button","btn-circle","btn-block",3,"disabled","click"],[1,"form-text","text-muted"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"button",1),Tt("click",function(){return r.bsModalRef.hide()}),Ue(2,"span",2),ft(3,"\xd7"),Ge()()(),Ue(4,"div",3)(5,"h4",4),ft(6),Ge(),Ue(7,"div",5)(8,"label",6)(9,"h5",7),ft(10,"Amount:"),Ge()(),Ue(11,"input",8),Tt("ngModelChange",function(a){return r.onAmountChanged(a)}),Ge(),Ue(12,"div",9),Ft(13,JH,2,1,"small",10),Ge()(),Ue(14,"div",5)(15,"label",11)(16,"h5",12),ft(17,"Send To:"),Ge()(),Ue(18,"input",13),Tt("ngModelChange",function(a){return r.recipient=a}),Ge()(),Ue(19,"button",14),Tt("click",function(){return r.send()}),ft(20," Send "),Ge()()),2&t&&(bt(6),Vn("Send ",null==r.token||null==r.token.token||null==r.token.token.metadata?null:r.token.token.metadata.symbol,""),bt(5),Ct("ngModel",r.amount),bt(2),Ct("ngIf",r.fee),bt(5),Ct("ngModel",r.recipient),bt(1),Ct("disabled",0===r.amount.length||0===r.recipient.length))},directives:[Il,Vh,pc,fo],styles:[".custom-input[_ngcontent-%COMP%]{padding:0 24px;border-radius:100px;border:1px solid #d2d2d7;min-height:52px}.button[_ngcontent-%COMP%]{width:100%;height:52px;padding:0 24px;border-radius:100px;gap:10px;background-color:#0f61ff;color:#fff;display:flex;justify-content:center;align-items:center;border:none;outline:none;cursor:pointer;margin-top:30px;transition:background-color .3s ease-in-out}.button[_ngcontent-%COMP%]:hover{background-color:#183fd7}.btn[_ngcontent-%COMP%]:disabled{background-color:#d2d2d7;color:#86868b}.send-header[_ngcontent-%COMP%]{padding:10px 10px 0 0}.amount-text[_ngcontent-%COMP%]{margin:0 0 12px}.form-text[_ngcontent-%COMP%]{margin:12px 0 0}.send-text[_ngcontent-%COMP%]{margin:24px 0 12px}"]}),n})(),Fs=(()=>{class n{constructor(t){this.modalService=t,this.modalOptions={class:"modal-dialog-centered"}}showLoadingModal(t="Loading..."){const r=Object.assign(Object.assign({},this.modalOptions),{initialState:{text:t}});return this.modalService.show(HB,r)}showNodeSelectorModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{}});return this.modalService.show($L,t)}showHowToModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{closeBtnName:"Close"}});return this.modalService.show(zL,t)}showNoAccountModal(){const t=Object.assign(Object.assign({},this.modalOptions),{ignoreBackdropClick:!0,keyboard:!1,initialState:{}});return this.modalService.show(Yx,t)}showPermissionModal(t,r){const i=Object.assign(Object.assign({},this.modalOptions),{ignoreBackdropClick:!0,keyboard:!1,initialState:{account:t,appMetadata:r}});return this.modalService.show(vF,i)}showOperationModal(){const t=Object.assign(Object.assign({},this.modalOptions),{ignoreBackdropClick:!0,keyboard:!1,initialState:{callback:()=>{console.log("callback")}}});return this.modalService.show(yF,t)}showSignModal(){const t=Object.assign(Object.assign({},this.modalOptions),{ignoreBackdropClick:!0,keyboard:!1,initialState:{}});return this.modalService.show(bF,t)}showSendTezModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{recipient:"",amount:""}});return this.modalService.show($H,t)}showSendTokenModal(t){const r=Object.assign(Object.assign({},this.modalOptions),{initialState:{token:t,recipient:"",amount:""}});return this.modalService.show(eV,r)}showXModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"header",text:"text",closeBtnName:"Close"}});return this.modalService.show(Av,t)}showQRModal(t){const r=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"Your Account QR Code",qrData:t}});return this.modalService.show(ZH,r)}showConfirmModal(t){const r=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"Disconnect",text:"Are you sure you want to disconnet from MetaMask?",confirmCallback:t}});return this.modalService.show(VB,r)}showInstructionsModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"Installation Instructions",text:"
    \n
  1. To get started make sure you have MetaMask chrome extension installed and then go to the Tezos Wallet powered by Metamask here.
  2. \n
  3. Connect with MetaMask
  4. \n
  5. Accept the connection in MetaMask
  6. \n
  7. Approve and install the Tezos snap
  8. \n
"}});return this.modalService.show(Av,t)}showNFTModal(t){const r=Object.assign(Object.assign({},this.modalOptions),{class:"modal-lg",initialState:{nft:t}});return this.modalService.show(QH,r)}showFaqModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{title:"FAQ",text:"text"}});return this.modalService.show(Av,t)}showNotConnectedModal(t,r){const i=Object.assign(Object.assign({},this.modalOptions),{initialState:{successCallback:t,errorCallback:r}});return this.modalService.show(Yx,i)}showConnectedModal(){const t=Object.assign(Object.assign({},this.modalOptions),{initialState:{}});return this.modalService.show(XH,t)}}return n.\u0275fac=function(t){return new(t||n)(Mt(Rm))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),mc=(()=>{class n{constructor(t,r,i,a,h){var v=this;this.tabSyncService=t,this.accountService=r,this.modalService=i,this.apiService=a,this.toastService=h,this.log=[],this.walletClient=new gB({name:"MetaMask"}),this.connect(),this.tabSyncService.clear$.subscribe(()=>{var D;null===(D=this.modalRef)||void 0===D||D.hide()}),this.tabSyncService.tabWillClose$.subscribe(Ot(function*(){if(v.pendingRequest){localStorage.setItem("tab_closing_while_pending",(new Date).toLocaleTimeString());const D={type:wn.Error,id:v.pendingRequest.id,errorType:as.ABORTED_ERROR};yield v.walletClient.respond(D),v.requestCleanup(v.pendingRequest.id),localStorage.setItem("tab_closing_while_pending","error sent")}}))}handleMessage(t){var r=this;return Ot(function*(){var i,a,h;localStorage.getItem(Vr.METAMASK_BUSY)&&t.type!==wn.PermissionRequest?console.log("BeaconService: MetaMask is busy handling another request"):localStorage.getItem(`${Vr.REQUEST_ID_PREFIX}${t.id}`)?console.log("This request is already being handled"):(localStorage.setItem(`${Vr.REQUEST_ID_PREFIX}${t.id}`,Date.now().toString()),r.tabSyncService.addTabClosedEventHandler(()=>{r.requestCleanup(t.id)}),r.log.push([new Date,`${t.appMetadata.name}: INCOMING MESSAGE (${t.type}) ${t.type===wn.OperationRequest?1===t.operationDetails.length?`${null===(i=t.operationDetails[0])||void 0===i?void 0:i.amount} mutez, Entrypoint: ${null===(h=null===(a=t.operationDetails[0])||void 0===a?void 0:a.parameters)||void 0===h?void 0:h.entrypoint}`:`${t.operationDetails.length} operations`:""}`,t,[]]),console.log("message",t),r.pendingRequest=t,r.accountService.accounts$.pipe(fi()).subscribe(v=>{var D;if(t.type===wn.PermissionRequest){if(0===v.length)return console.error("No account found, need to wait for user to connect"),localStorage.removeItem(`${Vr.REQUEST_ID_PREFIX}${t.id}`),void localStorage.removeItem(Vr.METAMASK_BUSY);r.modalRef=r.modalService.showPermissionModal(v[0],t.appMetadata),null===(D=r.modalRef.onHide)||void 0===D||D.pipe(fi()).subscribe(L=>{r.tabSyncService.sendEvent(_o.CLEAR),L&&"confirm"===L?r.handlePermissionRequest(v[0],t):(r.sendAbortedError(t),console.log("DENIED",L))})}else if(t.type===wn.OperationRequest){const L=v.find(Q=>Q.address===t.sourceAddress);if(!L)return void console.error("No account found for "+t.sourceAddress);const j=r.toastService.showOperationRequestReceivedToast();r.handleOperationRequest(L,t).then(()=>{j.toastRef.close(),r.toastService.showTxSuccessToast()}).catch(()=>{j.toastRef.close(),r.toastService.showTxErrorToast()}).finally(()=>{r.tabSyncService.sendEvent(_o.CLEAR)})}else if(t.type===wn.SignPayloadRequest){const L=v.find(Q=>Q.address===t.sourceAddress);if(!L)return void console.error("No account found for "+t.sourceAddress);const j=r.toastService.showSignRequestReceivedToast();r.handleSignPayload(L,t).then(()=>{j.toastRef.close(),r.toastService.showTxSuccessToast()}).catch(()=>{j.toastRef.close(),r.toastService.showTxErrorToast()}).finally(()=>{r.tabSyncService.sendEvent(_o.CLEAR)})}else console.error("Message type not supported"),console.error("Received: ",t),r.walletClient.respond({type:wn.Error,id:t.id,errorType:as.ABORTED_ERROR}),r.requestCleanup(t.id)}))})()}connect(){var t=this;this.walletClient.init().then(Ot(function*(){t.walletClient.connect(t.handleMessage.bind(t)).catch(r=>console.error("connect error",r))}))}sendAbortedError(t){var r=this;return Ot(function*(){r.walletClient.respond({type:wn.Error,id:t.id,errorType:as.ABORTED_ERROR}),r.requestCleanup(t.id)})()}addPeer(t){var r=this;return Ot(function*(){return(new rc).deserialize(t).then(a=>(console.log("Adding peer",a),r.walletClient.addPeer(a).then(()=>{console.log("Peer added")}))).catch(a=>{console.error("not a valid sync code: ",a,t)})})()}handlePendingRequest(){this.pendingRequest?(console.log("Have pending request, handling now"),this.handleMessage(this.pendingRequest)):console.log("Have NO pending request")}handlePermissionRequest(t,r){console.log("Sharing ",t),this.walletClient.respond({type:wn.PermissionResponse,network:r.network,scopes:[ua.OPERATION_REQUEST,ua.SIGN],id:r.id,publicKey:t.publicKey}),this.requestCleanup(r.id)}handleOperationRequest(t,r){var i=this;return Ot(function*(){localStorage.setItem(Vr.METAMASK_BUSY,"true");const a=r.operationDetails;i.runOperation(t.address,a,r.network.type).then(h=>{console.log("RUN_OPERATION RESULT",h)}).catch(h=>{console.log("RUN_OPERATION ERROR",h)}).finally(Ot(function*(){let h;console.log("METAMASK SENDING OPERATION REQUEST");try{const v=yield Tm(a);h={id:r.id,type:wn.OperationResponse,transactionHash:v}}catch(v){h={type:wn.Error,id:r.id,errorType:as.ABORTED_ERROR}}console.log("RESPONSE",h),i.walletClient.respond(h),i.requestCleanup(r.id)}))})()}handleSignPayload(t,r){var i=this;return Ot(function*(){let a;console.log("METAMASK SIGN REQUEST",r),localStorage.setItem(Vr.METAMASK_BUSY,"true");try{const h=yield bB(r.payload);a={id:r.id,type:wn.SignPayloadResponse,signature:h,signingType:r.signingType}}catch(h){a={type:wn.Error,id:r.id,errorType:as.ABORTED_ERROR}}i.walletClient.respond(a),console.log("METAMASK SIGN RESPONSE",a),i.requestCleanup(r.id)})()}metamaskDisconnected(){this.pendingRequest&&this.requestCleanup(this.pendingRequest.id)}requestCleanup(t){this.pendingRequest=void 0,localStorage.removeItem(`${Vr.REQUEST_ID_PREFIX}${t}`),localStorage.removeItem(Vr.METAMASK_BUSY)}runOperation(t,r,i){var a=this;return Ot(function*(){console.log("RPCs",a.apiService.RPCs[i]);const h=new t3(a.apiService.RPCs[i].selected),{counter:v}=yield h.getContract(t);console.log("COUNTER FROM API",v);let D=parseInt(v||"0",10)+1;console.log("nextCounter",D);const L=(yield h.getBlockHeader()).hash,Q=yield h.getChainId(),me=r.map(ye=>Object.assign(Object.assign({source:t,counter:String(D++),fee:"10000",gas_limit:"1040000",storage_limit:"60000"},ye),{kind:Ch.TRANSACTION}));return h.runOperation({operation:{branch:L,contents:me,signature:"edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg"},chain_id:Q})})()}}return n.\u0275fac=function(t){return new(t||n)(Mt(B3),Mt(Os),Mt(Fs),Mt(Ju),Mt(rd))},n.\u0275prov=xt({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const L6=()=>!!/Android|iPhone/i.test(navigator.userAgent);function tV(n,e){1&n&&(Ue(0,"span"),ft(1,"The Tezos Wallet Explorer is not supported on mobile."),Ge())}function nV(n,e){1&n&&(Ue(0,"span"),ft(1," You need to install MetaMask. You can download it "),Ue(2,"a",30),ft(3,"here"),Ge(),ft(4,". "),Ge())}function rV(n,e){1&n&&(Ue(0,"span"),ft(1," Connect your MetaMask to access the Tezos Wallet Explorer. "),Ge())}function iV(n,e){if(1&n&&(Zo(0),Ft(1,nV,5,0,"span",15),Ft(2,rV,2,0,"span",15),Xo()),2&n){const t=zt();bt(1),Ct("ngIf",!t.isMetaMaskInstalled),bt(1),Ct("ngIf",t.isMetaMaskInstalled)}}function oV(n,e){if(1&n){const t=oo();Ue(0,"div",34),Tt("click",function(){return ui(t),zt(2).connect()}),Bt(1,"img",35),Ue(2,"div",36),ft(3,"Connect with MetaMask"),Ge()()}}function sV(n,e){1&n&&(Ue(0,"div",37)(1,"span",38),ft(2,"Loading..."),Ge()())}function aV(n,e){if(1&n&&(Ue(0,"div",31),Ft(1,oV,4,0,"div",32),Ft(2,sV,3,0,"div",33),Ge()),2&n){const t=zt();bt(1),Ct("ngIf",!t.isLoading),bt(1),Ct("ngIf",t.isLoading)}}function lV(n,e){1&n&&(Ue(0,"div",39),ft(1," Your version of MetaMask wallet does not support Snaps. Please update your MetaMask "),Ue(2,"a",30),ft(3,"here"),Ge(),ft(4,". "),Ge())}console.log("isMobile",L6());let uV=(()=>{class n{constructor(t,r){this.metamaskService=t,this.modalService=r,this.isMetaMaskInstalled=void 0!==window.ethereum&&window.ethereum.isMetaMask&&!window.ethereum.isBraveWallet,this.isMobile=L6(),this.isLoading=!1,this.errorCode=0}ngOnInit(){}connect(){var t=this;return Ot(function*(){t.isLoading||(t.isLoading=!0,t.metamaskService.connect().then(()=>{t.errorCode=0,t.modalService.showConnectedModal()}).catch(r=>{t.errorCode=r.code}).finally(Ot(function*(){t.isLoading=!1})))})()}showInstructionsModal(){this.modalService.showInstructionsModal()}openLink(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(ot(Xh),ot(Fs))},n.\u0275cmp=Un({type:n,selectors:[["app-landing"]],decls:51,vars:4,consts:[[1,"containerbox","container-fluid","px-md-5","pb-3",2,"flex-direction","column"],[1,"flex-container"],["src","./assets/tezos-logo-main.svg",1,"logo"],[1,"text-container"],[1,"header","large"],[1,"header","ml-1","small"],[1,"imageBox"],[1,"d-flex","justify-content-center",2,"width","40px","height","40px"],["src","./assets/tezos-logo-sm.svg","alt","SVG Image",2,"width","100%","height","100%"],["src","./assets/icons/close.svg","alt","SVG Image",2,"width","20px","height","100%","margin-left","20px"],["src","./assets/metamask-logo-sm.svg","alt","SVG Image",2,"width","100%","height","100%","margin-left","20px"],[1,"textBox"],[1,"metamasTextBox"],[1,"metamaskTitle"],[1,"metamaskSubtitle"],[4,"ngIf"],["class","metamaskContainer",4,"ngIf"],["class","metamaskSubtitle red-text mt-3",4,"ngIf"],[1,"containerModal",3,"click"],[1,"instructionsModal"],[1,"instructionsBox"],[1,"footer"],["src","./assets/icons/FiAlertCircle.svg",1,"icon"],[1,"text"],[1,"footer-menu"],["href","#",1,"footer-link",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","2","height","20","viewBox","0 0 2 20","fill","none"],["d","M1 0V20","stroke","#D2D2D7"],[1,"footerTezos"],["href","https://metamask.io/snaps/",2,"text-decoration","underline","color","#86868b"],["href","https://metamask.io/download/","target","_blank"],[1,"metamaskContainer"],["class","metamaskModal",3,"click",4,"ngIf"],["class","spinner-border mr-3","role","status",4,"ngIf"],[1,"metamaskModal",3,"click"],["src","./assets/metamask-logo.svg",1,"metamaskLogo"],[1,"metamaskText"],["role","status",1,"spinner-border","mr-3"],[1,"sr-only"],[1,"metamaskSubtitle","red-text","mt-3"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1),Bt(2,"img",2),Ue(3,"div",3)(4,"span",4),ft(5,"Tezos Wallet Explorer"),Ge(),Ue(6,"span",5),ft(7,"powered by MetaMask"),Ge()()(),Bt(8,"br"),Ue(9,"div",6)(10,"div",7),Bt(11,"img",8)(12,"img",9)(13,"img",10),Ge(),Ue(14,"div",11)(15,"div",12)(16,"div",13),ft(17," Tezos Wallet Explorer, powered by MetaMask "),Ge(),Ue(18,"div",14),Ft(19,tV,2,0,"span",15),Ft(20,iV,3,2,"ng-container",15),Ge()(),Ue(21,"div"),Ft(22,aV,3,2,"div",16),Ft(23,lV,5,0,"div",17),Ge(),Ue(24,"div",18),Tt("click",function(){return r.showInstructionsModal()}),Ue(25,"div",19)(26,"div",20)(27,"div",21),Bt(28,"img",22),Ue(29,"span",23),ft(30,"Installation Guide"),Ge()()()()()()(),Ue(31,"div",24)(32,"a",25),Tt("click",function(){return r.openLink("https://github.com/airgap-it/tezos-snaps-wallet")}),ft(33,"GitHub"),Ge(),Nc(),Ue(34,"svg",26),Bt(35,"path",27),Ge(),kc(),Ue(36,"a",25),Tt("click",function(){return r.openLink("./assets/documents/privacy-policy.pdf")}),ft(37,"Privacy Policy"),Ge(),Nc(),Ue(38,"svg",26),Bt(39,"path",27),Ge(),kc(),Ue(40,"a",25),Tt("click",function(){return r.openLink("./assets/documents/terms-of-service.pdf")}),ft(41,"Terms of Service"),Ge(),Nc(),Ue(42,"svg",26),Bt(43,"path",27),Ge(),kc(),Ue(44,"a",25),Tt("click",function(){return r.openLink("https://github.com/airgap-it/tezos-metamask-snap/wiki/FAQs")}),ft(45,"FAQs"),Ge()(),Ue(46,"div",28)(47,"span"),ft(48,"Powered by "),Ue(49,"a",29),ft(50,"MetaMask Snaps"),Ge()()()()),2&t&&(bt(19),Ct("ngIf",r.isMobile),bt(1),Ct("ngIf",!r.isMobile),bt(2),Ct("ngIf",r.isMetaMaskInstalled&&!r.isMobile),bt(1),Ct("ngIf",-32601===r.errorCode))},directives:[fo],styles:[".imageBox[_ngcontent-%COMP%]{width:500px;padding:60px 90px;background:white;box-shadow:0 0 20px #0003;border-radius:30px;flex-direction:column;justify-content:flex-start;align-items:center;gap:30px;display:inline-flex}.textBox[_ngcontent-%COMP%], .metamaskContainer[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:30px;display:flex}.metamaskModal[_ngcontent-%COMP%]{width:320px;padding:16px 24px;border-radius:100px;border:.5px #d2d2d7 solid;justify-content:center;align-items:center;gap:10px;display:inline-flex;cursor:pointer}.metamaskModal[_ngcontent-%COMP%]:hover{color:#0f61ff;border-color:#0f61ff;background-color:transparent;outline:none}.containerModal[_ngcontent-%COMP%]{justify-content:flex-start;align-items:center;gap:4px;display:inline-flex}@media (max-width: 768px){.metamaskModal[_ngcontent-%COMP%]{width:100%;max-width:320px}}.instructionsModal[_ngcontent-%COMP%]{justify-content:center;align-items:center;display:flex}.instructionsBox[_ngcontent-%COMP%]{position:relative;flex-direction:column;justify-content:flex-start;align-items:flex-start;display:flex}.containerbox[_ngcontent-%COMP%]{height:100vh;width:100vw;display:flex;justify-content:center;align-items:center}@media (max-width: 768px){.containerbox[_ngcontent-%COMP%]{flex-direction:column;justify-content:center;padding:20px}}.large[_ngcontent-%COMP%]{font-size:24px;font-weight:300;line-height:26px;letter-spacing:0em;text-align:left;color:#1d1d1f;margin:0 0 0 3px}.small[_ngcontent-%COMP%]{font-size:12px;color:#6e6e73;margin:0}.flex-container[_ngcontent-%COMP%]{display:flex;align-items:center;max-height:40px;margin-bottom:40px;margin-top:40px}.logo[_ngcontent-%COMP%]{height:auto;max-height:100%;margin-left:10px}.text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:5px}.footer[_ngcontent-%COMP%]{color:#0f61ff;font-size:14px;font-weight:400;display:flex;align-items:center}.footer[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]:hover{cursor:pointer}.icon[_ngcontent-%COMP%]{width:20px;height:20px;margin-right:10px}.metamaskText[_ngcontent-%COMP%]{text-align:center;color:#0f61ff;font-size:16px;font-weight:600;line-height:18px;word-wrap:break-word}.metamaskTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:28px;font-weight:600;line-height:34px;letter-spacing:0em;text-align:center}.metamaskSubtitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:center}.metamasTextBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:20px;display:flex}.metamaskLogo[_ngcontent-%COMP%]{width:20px;height:20px}.footer-menu[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:3rem}.footer-link[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:normal;margin-right:1.5rem;margin-left:1.5rem;text-decoration:none;color:#424245}.footer-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.footerTezos[_ngcontent-%COMP%]{text-align:center;font-size:12px;color:#86868b;margin-top:4rem}.red-text[_ngcontent-%COMP%]{color:#d0342c}.red-text[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#d0342c;text-decoration:underline}@media (max-width: 768px){.flex-container[_ngcontent-%COMP%]{margin-bottom:20px;margin-top:20px}.imageBox[_ngcontent-%COMP%]{width:100%;max-width:400px;padding:40px}.large[_ngcontent-%COMP%]{font-size:20px}.small[_ngcontent-%COMP%]{font-size:10px}.metamaskTitle[_ngcontent-%COMP%]{font-size:24px}.textBox[_ngcontent-%COMP%]{text-align:center}.logo[_ngcontent-%COMP%]{margin-right:5px}.footer-menu[_ngcontent-%COMP%]{flex-wrap:wrap;justify-content:center}.footer-link[_ngcontent-%COMP%]{margin:.5rem}.footerTezos[_ngcontent-%COMP%]{margin-top:2rem}}.text[_ngcontent-%COMP%]:hover{text-decoration:underline}"]}),n})(),cV=(()=>{class n{constructor(t,r,i,a,h){this.metamaskService=t,this.accountService=r,this.modalService=i,this.clipboardService=a,this.beaconService=h,this.address="",this.network="Mainnet",this.otherNetwork="Ghostnet",this.loadAccountInfo()}ngOnInit(){}loadAccountInfo(){var t=this;this.accountService.accounts$.pipe(fi()).subscribe(function(){var r=Ot(function*(i){i[0]&&(t.address=i[0].address)});return function(i){return r.apply(this,arguments)}}())}showQrModal(){this.modalService.showQRModal(this.address)}disconnect(){this.modalService.showConfirmModal(()=>{this.accountService.hasAccounts?(this.accountService.disconnect(),this.beaconService.metamaskDisconnected()):this.metamaskService.connect()})}changeNetwork(){"Mainnet"===this.network?(this.network="Ghostnet",this.otherNetwork="Mainnet"):(this.network="Mainnet",this.otherNetwork="Ghostnet")}copyToClipboard(){this.clipboardService.copy(this.address)}}return n.\u0275fac=function(t){return new(t||n)(ot(Xh),ot(Os),ot(Fs),ot(Tv),ot(mc))},n.\u0275cmp=Un({type:n,selectors:[["app-header-item"]],decls:28,vars:4,consts:[[1,"container-fluid","py-3","px-0","px-md-4"],[1,"navbar","navbar-expand-md","navbar-light","d-flex","justify-content-between"],[1,"flex-container"],["src","./assets/tezos-logo-main.svg",1,"logo"],[1,"text-container"],[1,"header","pt-1","ml-1","large"],[1,"header","ml-1","small"],[1,"navbar-nav","d-flex","align-items-md-center"],[1,"ml-md-3",3,"click"],[1,"addressBox"],["src","./assets/metamask-logo-sm.svg","alt","SVG Image",2,"width","16px","height","16px"],[1,"addressContainer"],[1,"textAddress"],[1,"copy-button",2,"background","none","border","none","cursor","pointer"],["src","./assets/icons/FiCopy.svg","alt","SVG Image",2,"width","16px","height","16px"],[1,"ml-md-3","qr-code"],[1,"qr-button",3,"click"],[1,"d-flex","align-items-center"],["src","./assets/icons/qr-code-icon.svg",1,"fa-icon"],[1,"ml-md-3"],[1,"addressBoxConnect"],[1,"d-flex","align-items-center",3,"click"],["src","./assets/icons/FiLogOut.svg",1,"fa-icon"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"nav",1)(2,"div",2),Bt(3,"img",3),Ue(4,"div",4)(5,"span",5),ft(6,"Tezos Wallet Explorer"),Ge(),Ue(7,"span",6),ft(8,"powered by MetaMask"),Ge()()(),Ue(9,"ul",7)(10,"li",8),Tt("click",function(){return r.copyToClipboard()}),Ue(11,"div",9),Bt(12,"img",10),Ue(13,"div",11)(14,"div",12),ft(15),Qo(16,"shortenString"),Ge(),Ue(17,"button",13),Bt(18,"img",14),Ge()()()(),Ue(19,"li",15)(20,"button",16),Tt("click",function(){return r.showQrModal()}),Ue(21,"span",17),Bt(22,"img",18),Ge()()(),Ue(23,"li",19)(24,"div",20)(25,"span",21),Tt("click",function(){return r.disconnect()}),Bt(26,"img",22),ft(27),Ge()()()()()()),2&t&&(bt(15),Vn(" ",Js(16,2,r.address)," "),bt(12),Vn(" ",r.accountService.hasAccounts?"Disconnect":"Connect"," "))},pipes:[Rv],styles:[".addressBox[_ngcontent-%COMP%], .addressBoxConnect[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;gap:6px;padding:11px 16px;background:#f5f5f7;border-radius:100px;height:40px;cursor:pointer;margin-right:10px}.addressBoxConnect[_ngcontent-%COMP%]:hover{background-color:#d2d2d7}.addressBoxConnect[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:focus{background-color:#d2d2d7;outline:none}.addressBoxConnect[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{background-color:#d2d2d7;cursor:pointer}.addressContainer[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}.addressBox[_ngcontent-%COMP%]:hover{background-color:#d2d2d7}.addressBox[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:focus{background-color:#d2d2d7;outline:none}.addressBox[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{background-color:#d2d2d7;cursor:pointer}.large[_ngcontent-%COMP%]{font-size:24px;font-weight:300;line-height:26px;letter-spacing:0em;text-align:left;color:#1d1d1f}.small[_ngcontent-%COMP%]{font-size:12px;color:#6e6e73}.flex-container[_ngcontent-%COMP%]{display:flex;align-items:center;max-height:40px}.logo[_ngcontent-%COMP%]{height:auto;max-height:100%;margin-left:10px}.text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:5px}.buttonContainer[_ngcontent-%COMP%]{margin-left:3rem}.textAddress[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;color:#1d1d1f;word-wrap:break-word;margin-right:5px}.buttonNetwork[_ngcontent-%COMP%]{background-color:#f5f5f7;color:#1d1d1f;border:none;width:110px;height:40px;padding:11px 16px;display:flex;justify-content:center;align-items:center;box-shadow:none;transition:background-color .3s ease-in-out,color .3s ease-in-out}.buttonContainer[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .buttonContainer[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{outline:none!important;box-shadow:none;border:none}.buttonContainer[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover, .buttonContainer[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{border:none;box-shadow:none;background-color:#0f61ff;color:#fff}.buttonContainer[_ngcontent-%COMP%]:focus{outline:none;box-shadow:none;border:none}.buttonContainer[_ngcontent-%COMP%]:not(:hover) button[_ngcontent-%COMP%]{background-color:#f5f5f7;color:#1d1d1f}.custom-dropdown-toggle[_ngcontent-%COMP%]:after{content:none}.custom-dropdown-toggle[_ngcontent-%COMP%]{background-color:#f5f5f7;color:#1d1d1f;border:none;width:40px;height:40px;padding:10px;border-radius:100px;gap:10px;display:flex;justify-content:center;align-items:center;transition:background-color .3s ease-in-out}.custom-dropdown-toggle[_ngcontent-%COMP%]:focus{outline:none}.dropdown-menu-container[_ngcontent-%COMP%]{position:relative}.dropdown-menu.custom-dropdown-menu[_ngcontent-%COMP%]{right:auto;left:calc(-100% + 40px);position:absolute}.qr-button[_ngcontent-%COMP%]{width:40px;height:40px;padding:12px;border-radius:100px;background-color:#f5f5f7;border:none;cursor:pointer;outline:none}.qr-button[_ngcontent-%COMP%]:hover{background-color:#d2d2d7}.qr-code[_ngcontent-%COMP%], .copy-button[_ngcontent-%COMP%]{cursor:pointer}@media (max-width: 768px){.addressBoxConnect[_ngcontent-%COMP%]{margin-top:10px}.buttonContainer[_ngcontent-%COMP%], .addressBox[_ngcontent-%COMP%], .qr-code[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .qr-button[_ngcontent-%COMP%]{display:none}}"]}),n})();const Ov=_M("fadeInAnimation",[xg(":enter",[Ci({opacity:0}),pl("1s ease-out",Ci({opacity:1}))])]);function fV(n,e){1&n&&(Ue(0,"div",11),Bt(1,"img",12),Ge())}function hV(n,e){1&n&&(Ue(0,"span"),ft(1,"."),Ge())}function dV(n,e){if(1&n&&(Zo(0),Ue(1,"p",13),ft(2),Ft(3,hV,2,0,"span",5),Ue(4,"span",14),ft(5),Ge()(),Ue(6,"p",15),ft(7),Ge(),Xo()),2&n){const t=zt();bt(1),Ct("@fadeInAnimation",void 0),bt(1),Vn(" ",t.tezMainAmount,""),bt(1),Ct("ngIf",t.tezDecimalAmount),bt(2),Vn("",t.tezDecimalAmount," \ua729"),bt(1),Ct("@fadeInAnimation",void 0),bt(1),Vn("$",t.usdBalance,"")}}function pV(n,e){1&n&&(Ue(0,"span"),ft(1,"."),Ge())}function gV(n,e){if(1&n){const t=oo();Ue(0,"div")(1,"div",16)(2,"div",17),Bt(3,"img",18),Ue(4,"span",19),ft(5),Ge(),Ue(6,"span",20),ft(7),Ft(8,pV,2,0,"span",5),Ue(9,"span",21),ft(10),Ge()(),Ue(11,"button",22),Tt("click",function(){const a=ui(t).$implicit;return zt().sendToken(a)}),Bt(12,"img",23),Ge()()()()}if(2&n){const t=e.$implicit,r=zt();let i;Ct("@fadeInAnimation",void 0),bt(3),Ct("src",null!==(i=null==t||null==t.token||null==t.token.metadata?null:t.token.metadata.sanitizedThumbnailUri)&&void 0!==i?i:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",ws),bt(2),Nr(null==t||null==t.token||null==t.token.metadata?null:t.token.metadata.symbol),bt(2),Vn(" ",r.splitNumber(null==t?null:t.humanReadableBalance)[0],""),bt(1),Ct("ngIf",r.splitNumber(null==t?null:t.humanReadableBalance)[1]),bt(2),Nr(r.splitNumber(null==t?null:t.humanReadableBalance)[1])}}function mV(n,e){if(1&n&&(Ue(0,"div",24)(1,"div",25)(2,"div")(3,"a",26),ft(4,"Load More"),Ge(),Bt(5,"img",27),Ge()()()),2&n){const t=zt();bt(3),gu("href","https://tzkt.io/",t.address,"/balances/",ws)}}let vV=(()=>{class n{constructor(t){this.modalService=t,this.address="",this.balance="",this.usdBalance="",this.tokens=[],this.isLoading=!0,this.tezMainAmount="0",this.tezDecimalAmount="0"}ngOnInit(){}ngOnChanges(t){var r;const i=null===(r=t.balance)||void 0===r?void 0:r.currentValue;i&&([this.tezMainAmount,this.tezDecimalAmount]=i.split("."))}openLink(t){window.open(t,"_blank")}sendTez(){this.modalService.showSendTezModal()}splitNumber(t){return t?t.split("."):["",""]}sendToken(t){this.modalService.showSendTokenModal(t)}}return n.\u0275fac=function(t){return new(t||n)(ot(Fs))},n.\u0275cmp=Un({type:n,selectors:[["app-account"]],inputs:{address:"address",balance:"balance",usdBalance:"usdBalance",tokens:"tokens",isLoading:"isLoading"},features:[qr],decls:16,vars:5,consts:[[1,"card","cardBox"],[1,"card-body",2,"padding","30px"],[1,"card-title"],[1,"d-flex","flex-column","flex-md-row","justify-content-between","align-items-center"],["role","status",4,"ngIf"],[4,"ngIf"],[1,"d-flex","justify-content-center","align-items-center","mt-3","mt-md-0"],["type","button",1,"btn","btn-outline-primary","btn-circle","mr-2",3,"click"],["type","button",1,"btn","btn-primary","btn-circle",3,"click"],[4,"ngFor","ngForOf"],["class","load-more-box justify-content-between align-items-center","style","padding-top: 18px; margin-top: 18px; display: flex",4,"ngIf"],["role","status"],["src","./assets/icons/arrow-spin.svg","alt","Loading...",1,"svg-spinner"],[1,"cardBalance"],[1,"cardBalanceDecimal"],[1,"text-muted"],[1,"token-box",2,"padding-top","18px","margin-top","18px"],[1,"justify-content-between","align-items-center"],[2,"width","40px","height","100%","margin-right","12px",3,"src"],[2,"font-weight","600"],[2,"position","absolute","left","170px","margin-top","8px"],[1,"small-text"],["type","button",1,"btn","btn-outline-primary","btn-circle",2,"float","right","width","40px",3,"click"],["src","./assets/icons/MdOutlineCallReceivedBlue.svg","alt","Sent",1,"copy-button",2,"width","16px","height","16px","transform","rotate(180deg)"],[1,"load-more-box","justify-content-between","align-items-center",2,"padding-top","18px","margin-top","18px","display","flex"],[2,"display","flex","align-items","center","justify-content","center","width","100%","height","100%"],["target","_blank",1,"explorer-link",3,"href"],["src","./assets/icons/FiExternalLink.svg","alt","SVG Image",2,"width","16px","height","16px"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1)(2,"h2",2),ft(3,"Balance"),Ge(),Ue(4,"div",3)(5,"div"),Ft(6,fV,2,0,"div",4),Ft(7,dV,8,6,"ng-container",5),Ge(),Ue(8,"div",6)(9,"button",7),Tt("click",function(){return r.openLink("https://widget.wert.io/default/widget/?commodity=XTZ%3ATezos&address="+r.address)}),ft(10," Buy tez "),Ge(),Ue(11,"button",8),Tt("click",function(){return r.sendTez()}),ft(12," Send "),Ge()()(),Ue(13,"div"),Ft(14,gV,13,6,"div",9),Ft(15,mV,6,1,"div",10),Ge()()()),2&t&&(bt(6),Ct("ngIf",r.isLoading),bt(1),Ct("ngIf",!r.isLoading),bt(6),Ct("@fadeInAnimation",void 0),bt(1),Ct("ngForOf",r.tokens),bt(1),Ct("ngIf",r.tokens.length>=5))},directives:[fo,Ru],styles:[".cardBox[_ngcontent-%COMP%]{min-height:153px;border-radius:20px;background:var(--Netural-1, #f5f5f7);box-shadow:none;box-sizing:border-box;margin:0 auto}.card-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:left}.cardBalance[_ngcontent-%COMP%]{color:var(--Black, #1d1d1f);font-family:Inter,sans-serif;font-size:28px;font-weight:600;line-height:26px;text-align:center;margin:0 0 6px}.cardBalanceDecimal[_ngcontent-%COMP%]{font-size:20px}.btn.btn-primary.btn-circle[_ngcontent-%COMP%], .btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{height:40px;width:88px;border-radius:20px;display:flex;justify-content:center;align-items:center;outline:none;font-size:16px;transition:background-color .3s ease-in-out}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{color:#0f61ff;border-color:#d2d2d7;background-color:transparent}.btn.btn-primary.btn-circle[_ngcontent-%COMP%]{background-color:#0f61ff;color:#fff;border:none}.btn.btn-primary.btn-circle[_ngcontent-%COMP%]:hover{color:#fff;outline:none}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]:hover{color:#0f61ff;border-color:#0f61ff;background-color:transparent;outline:none}@media (max-width: 1490px){.cardBox[_ngcontent-%COMP%]{width:100%!important}}@media (min-width: 768px){.cardBox[_ngcontent-%COMP%]{width:100%;margin:0 auto}.btn.btn-primary.btn-circle[_ngcontent-%COMP%], .btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{font-size:16px;margin:0}.btn.btn-primary.btn-circle[_ngcontent-%COMP%]:hover{background-color:#183fd7}}@media (max-width: 768px){.cardBox[_ngcontent-%COMP%]{max-width:100%;margin-left:0;margin-right:0}.cardBalance[_ngcontent-%COMP%]{font-size:24px;line-height:28px}.text-muted[_ngcontent-%COMP%]{font-size:14px}.cardBalanceDecimal[_ngcontent-%COMP%]{font-size:14px;line-height:16px}.btn.btn-primary.btn-circle[_ngcontent-%COMP%], .btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{width:154px}.btn.btn-primary.btn-circle[_ngcontent-%COMP%]:hover{background-color:#183fd7}}@media (max-width: 1300px){.cardBalance[_ngcontent-%COMP%]{font-size:18px;line-height:18px}.cardBalanceDecimal[_ngcontent-%COMP%]{font-size:14px;line-height:14px}}.svg-spinner[_ngcontent-%COMP%]{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.token-box[_ngcontent-%COMP%]{font-family:Inter;font-size:16px;font-style:normal;font-weight:600;line-height:normal;border-top:1px solid #d2d2d7}.small-text[_ngcontent-%COMP%]{font-size:14px}.explorer-link[_ngcontent-%COMP%]{color:#0f61ff;font-size:14px;font-family:Inter;font-weight:400;margin-right:4px}.load-more-box[_ngcontent-%COMP%]{border-top:1px solid #d2d2d7}"],data:{animation:[Ov]}}),n})();const yV=new ns(TM);function F6(n){return!M(n)&&n-parseFloat(n)+1>=0}function _V(n){const{index:e,period:t,subscriber:r}=n;if(r.next(e),!r.closed){if(-1===t)return r.complete();n.index=e+1,this.schedule(n,t)}}class MV{constructor(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}call(e,t){return t.subscribe(new Pv(e,this.project,this.concurrent,this.scheduler))}}class Pv extends Y{constructor(e,t,r,i){super(e),this.project=t,this.concurrent=r,this.scheduler=i,this.index=0,this.active=0,this.hasCompleted=!1,r0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()}}class xV{constructor(e){this.total=e}call(e,t){return t.subscribe(new SV(e,this.total))}}class SV extends O{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}class bc{}let G6=(()=>{class n extends bc{tick(t){return tn(0).pipe(function wV(n,e=Number.POSITIVE_INFINITY,t){return e=(e||0)<1?Number.POSITIVE_INFINITY:e,r=>r.lift(new MV(n,e,t))}(()=>{const r=Date.now(),i=Math.round(Math.abs(r-t)/1e3),a=i<60?1e3:i<3600?6e4:i<86400?36e5:0;return a?function bV(n=0,e,t){let r=-1;return F6(e)?r=Number(e)<1?1:Number(e):c(e)&&(t=e),c(t)||(t=yV),new Z(i=>{const a=F6(n)?n:+n-t.now();return t.schedule(_V,a,{index:0,period:r,subscriber:i})})}(a):oh()}),function EV(n){return e=>e.lift(new xV(n))}(1))}}return n.\u0275fac=function(){let e;return function(r){return(e||(e=Ur(n)))(r||n)}}(),n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),K6=(()=>{class n{constructor(){this.changes=new o}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class _c{}let q6=(()=>{class n extends _c{format(t){const{suffix:r,value:i,unit:a}=function(n){const e=Date.now(),t=Math.round(Math.abs(e-n)/1e3),r=n{class n{constructor(t,r,i,a){this.clock=a,this.live=!0,this.stateChanges=new o,t&&(this.intlSubscription=t.changes.subscribe(()=>this.stateChanges.next())),this.stateChanges.subscribe(()=>{this.value=i.format(this.date),r.markForCheck()})}transform(t,...r){const i=function V6(n){const e=new Date(n);if(!Number.isNaN(e.valueOf()))return e;const t=String(n).match(/\d+/g);if(null===t||t.length<=2)return e;{const[r,i,...a]=t.map(h=>parseInt(h,10));return new Date(Date.UTC(r,i-1,...a))}}(t).valueOf();let a;if(a=function U6(n){return null!=n}(r[0])?function H6(n){return null!=n&&"false"!=`${n}`}(r[0]):this.live,this.date===i&&this.live===a)return this.value;if(this.date=i,this.live=a,!this.date)throw new SyntaxError(`Wrong parameter in TimeagoPipe. Expected a valid date, received: ${t}`);return this.clockSubscription&&(this.clockSubscription.unsubscribe(),this.clockSubscription=void 0),this.clockSubscription=this.clock.tick(this.date).pipe(rs(()=>this.live,this)).subscribe(()=>this.stateChanges.next()),this.stateChanges.next(),this.value}ngOnDestroy(){this.intlSubscription&&(this.intlSubscription.unsubscribe(),this.intlSubscription=void 0),this.clockSubscription&&(this.clockSubscription.unsubscribe(),this.clockSubscription=void 0),this.stateChanges.complete()}}return n.\u0275fac=function(t){return new(t||n)(ot(K6,24),ot(hl,16),ot(_c,16),ot(bc,16))},n.\u0275pipe=Gr({name:"timeago",type:n,pure:!1}),n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),TV=(()=>{class n{static forRoot(t={}){return{ngModule:n,providers:[t.clock||{provide:bc,useClass:G6},t.intl||[],t.formatter||{provide:_c,useClass:q6}]}}static forChild(t={}){return{ngModule:n,providers:[t.clock||{provide:bc,useClass:G6},t.intl||[],t.formatter||{provide:_c,useClass:q6}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})();function DV(n,e){1&n&&(Ue(0,"div",10)(1,"div",11),Bt(2,"img",12),Ge()())}function IV(n,e){if(1&n){const t=oo();Ue(0,"div")(1,"div",13)(2,"div",14),ft(3,"No 'operations' to show"),Ge(),Ue(4,"div",15)(5,"p"),ft(6,"Buy tez to see your operation history here..."),Ge()(),Ue(7,"button",16),Tt("click",function(){ui(t);const i=zt();return i.openLink("https://widget.wert.io/default/widget/?commodity=XTZ%3ATezos&address="+i.address)}),ft(8," Buy tez "),Ge()()()}2&n&&Ct("@fadeInAnimation",void 0)}function RV(n,e){if(1&n&&(Ue(0,"div",22),ft(1),Ge()),2&n){const t=zt().$implicit;bt(1),Vn(" ","origination"===t.type?"Origination":"delegation"===t.type?"Delegation":"reveal"===t.type?"Reveal":t.type," ")}}function OV(n,e){1&n&&Bt(0,"img",37)}function PV(n,e){1&n&&Bt(0,"img",38)}function NV(n,e){if(1&n&&(Ue(0,"span",39)(1,"strong",40),ft(2,"From:"),Ge(),ft(3),Qo(4,"shortenString"),Ge()),2&n){const t=zt(2).$implicit;let r;bt(3),Vn(" ",Js(4,1,null!==(r=null==t||null==t.sender?null:t.sender.address)&&void 0!==r?r:"")," ")}}function kV(n,e){if(1&n&&(Ue(0,"span",39)(1,"strong",41),ft(2,"To:"),Ge(),ft(3),Qo(4,"shortenString"),Ge()),2&n){const t=zt(2).$implicit;let r;bt(3),Vn(" ",Js(4,1,null!==(r=null==t||null==t.target?null:t.target.address)&&void 0!==r?r:"")," ")}}function BV(n,e){if(1&n){const t=oo();Ue(0,"div",22)(1,"div",23),Ft(2,OV,1,0,"img",24),Ft(3,PV,1,0,"img",25),Ue(4,"div",26)(5,"p",27)(6,"span",28),ft(7),Ge()()()(),Ue(8,"div",29)(9,"div",30),Ft(10,NV,5,3,"span",31),Ft(11,kV,5,3,"span",31),Ue(12,"img",32),Tt("click",function(i){ui(t);const a=zt().$implicit,h=zt(2);return h.copyAddressToClipboard(i,(null==a||null==a.target?null:a.target.address)===h.address?a.sender.address:a.target.address)}),Ge()(),Ue(13,"div",33)(14,"div",34),Tt("click",function(){ui(t);const i=zt().$implicit;return zt(2).openLink("https://tzkt.io/"+i.hash)}),Ue(15,"span",35),ft(16),Qo(17,"timeago"),Ge()(),Ue(18,"div"),Bt(19,"img",36),Ge()()()()}if(2&n){const t=zt().$implicit,r=zt(2);bt(2),Ct("ngIf",(null==t||null==t.target?null:t.target.address)===r.address),bt(1),Ct("ngIf",(null==t||null==t.target?null:t.target.address)!==r.address),bt(4),gf(" ",(null==t||null==t.target?null:t.target.address)===r.address?"+":"-","",t.amount/1e6," tez "),bt(3),Ct("ngIf",(null==t||null==t.target?null:t.target.address)===r.address),bt(1),Ct("ngIf",(null==t||null==t.target?null:t.target.address)!==r.address),bt(5),Nr(xp(17,7,t.timestamp,"live"))}}function LV(n,e){1&n&&Bt(0,"img",37)}function FV(n,e){1&n&&Bt(0,"img",38)}function UV(n,e){if(1&n&&(Ue(0,"span",39)(1,"strong",40),ft(2,"From:"),Ge(),ft(3),Qo(4,"shortenString"),Ge()),2&n){const t=zt(2).$implicit;let r;bt(3),Vn(" ",Js(4,1,null!==(r=null==t||null==t.from?null:t.from.address)&&void 0!==r?r:""),"")}}function HV(n,e){if(1&n&&(Ue(0,"span",39)(1,"strong",41),ft(2,"To:"),Ge(),ft(3),Qo(4,"shortenString"),Ge()),2&n){const t=zt(2).$implicit;let r;bt(3),Vn(" ",Js(4,1,null!==(r=null==t||null==t.to?null:t.to.address)&&void 0!==r?r:""),"")}}function VV(n,e){if(1&n){const t=oo();Ue(0,"div",22)(1,"div",23),Ft(2,LV,1,0,"img",24),Ft(3,FV,1,0,"img",25),Ue(4,"div",26)(5,"p",27)(6,"span",28),ft(7),ft(8),Ge()()()(),Ue(9,"div",29)(10,"div",30),Ft(11,UV,5,3,"span",31),Ft(12,HV,5,3,"span",31),Ue(13,"img",32),Tt("click",function(i){ui(t);const a=zt().$implicit,h=zt(2);let v;return h.copyAddressToClipboard(i,null!==(v=(null==a||null==a.to?null:a.to.address)===h.address?null==a.from?null:a.from.address:null==a.to?null:a.to.address)&&void 0!==v?v:"")}),Ge()(),Ue(14,"div",33)(15,"div",34),Tt("click",function(){ui(t);const i=zt().$implicit;return zt(2).openLink("https://tzkt.io/transactions/"+i.transactionId)}),Ue(16,"span",35),ft(17),Qo(18,"timeago"),Ge()(),Ue(19,"div"),Bt(20,"img",36),Ge()()()()}if(2&n){const t=zt().$implicit,r=zt(2);bt(2),Ct("ngIf",(null==t||null==t.to?null:t.to.address)===r.address),bt(1),Ct("ngIf",(null==t||null==t.to?null:t.to.address)!==r.address),bt(4),gf(" ",(null==t||null==t.to?null:t.to.address)===r.address?"+":"-","",t.formattedAmount," "),bt(1),Vn(" ",null==t.token||null==t.token.metadata?null:t.token.metadata.name," "),bt(3),Ct("ngIf",(null==t||null==t.to?null:t.to.address)===r.address),bt(1),Ct("ngIf",(null==t||null==t.to?null:t.to.address)!==r.address),bt(5),Nr(xp(18,8,t.timestamp,"live"))}}function jV(n,e){if(1&n&&(Ue(0,"div",18)(1,"div",19)(2,"div",20),Ft(3,RV,2,1,"div",21),Ft(4,BV,20,10,"div",21),Ft(5,VV,21,11,"div",21),Ge()()()),2&n){const t=e.$implicit;Ct("@fadeInAnimation",void 0),bt(3),Ct("ngIf","transaction"!==t.type&&"tokenTransfer"!==t.type),bt(1),Ct("ngIf","transaction"===t.type),bt(1),Ct("ngIf","tokenTransfer"===t.type)}}function $V(n,e){if(1&n&&(Zo(0),Ft(1,jV,6,4,"div",17),Xo()),2&n){const t=zt();bt(1),Ct("ngForOf",t.operations)}}let zV=(()=>{class n{constructor(t,r){var i=this;this.accountService=t,this.clipboardService=r,this.operations=[],this.isLoading=!0,this.address="",this.accountService.accounts$.pipe(fi()).subscribe(function(){var a=Ot(function*(h){h[0]&&(i.address=h[0].address)});return function(h){return a.apply(this,arguments)}}())}ngOnInit(){}openLink(t){window.open(t,"_blank")}copyAddressToClipboard(t,r){t.stopPropagation(),this.clipboardService.copy(r)}}return n.\u0275fac=function(t){return new(t||n)(ot(Os),ot(Tv))},n.\u0275cmp=Un({type:n,selectors:[["app-operations"]],inputs:{operations:"operations",isLoading:"isLoading"},decls:13,vars:4,consts:[[1,"card","no-shadow","cardBox"],[1,"card-body",2,"padding","30px"],[1,"row","operations-header"],[1,"col-6"],[1,"card-title"],[1,"col-6","text-right"],["target","_blank",1,"explorer-link",3,"href"],["src","./assets/icons/FiExternalLink.svg","alt","SVG Image",2,"width","16px","height","16px"],["class","spinner-container",4,"ngIf"],[4,"ngIf"],[1,"spinner-container"],[1,"spinner"],["src","./assets/icons/arrow-spin.svg","alt","Loading...",1,"svg-spinner"],[1,"stateBox"],[1,"metamaskTitle"],[1,"metamaskSubtitle"],["type","button",1,"btn","btn-outline-primary","btn-circle","mr-2",3,"click"],["class","card card-container",4,"ngFor","ngForOf"],[1,"card","card-container"],[1,"card-body",2,"padding","15px"],[1,"justify-content-between","align-items-center"],["class","d-flex flex-column",4,"ngIf"],[1,"d-flex","flex-column"],[1,"d-flex","flex-row"],["src","./assets/icons/MdOutlineCallReceived.svg","alt","Received","style","\n width: 18px;\n height: 18px;\n margin-right: 4px;\n margin-top: 2px;\n ",4,"ngIf"],["src","./assets/icons/MdOutlineCallReceived.svg","alt","Sent","style","\n color: #6e6e73;\n width: 18px;\n height: 18px;\n margin-right: 4px;\n margin-top: 2px;\n transform: rotate(180deg);\n ",4,"ngIf"],[1,"flex-grow-1"],[1,"text-amount"],[1,"truncate-text","truncate-container"],[1,"d-flex","align-items-center","mobile-container",2,"margin-left","22px","justify-content","space-between"],[1,"elements-left"],["class","text-address",4,"ngIf"],["src","./assets/icons/FiCopy.svg","alt","Copy",1,"copy-button",2,"width","16px","height","16px","margin-left","6px",3,"click"],[1,"elements-right","d-flex","align-items-center"],[3,"click"],[1,"timestamp"],["src","./assets/icons/MdOutlineCheckCircle.svg","alt","Checked",2,"width","16px","height","16px","margin-left","4px"],["src","./assets/icons/MdOutlineCallReceived.svg","alt","Received",2,"width","18px","height","18px","margin-right","4px","margin-top","2px"],["src","./assets/icons/MdOutlineCallReceived.svg","alt","Sent",2,"color","#6e6e73","width","18px","height","18px","margin-right","4px","margin-top","2px","transform","rotate(180deg)"],[1,"text-address"],[2,"font-weight","600","font-family","Inter"],[2,"font-weight","600"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h2",4),ft(5,"Operations"),Ge()(),Ue(6,"div",5)(7,"a",6),ft(8,"View in Explorer"),Ge(),Bt(9,"img",7),Ge()(),Ft(10,DV,3,0,"div",8),Ft(11,IV,9,1,"div",9),Ft(12,$V,2,1,"ng-container",9),Ge()()),2&t&&(bt(7),gu("href","https://tzkt.io/",r.address,"",ws),bt(3),Ct("ngIf",r.isLoading),bt(1),Ct("ngIf",!r.isLoading&&0===r.operations.length),bt(1),Ct("ngIf",!r.isLoading))},directives:[fo,Ru],pipes:[Rv,AV],styles:[".no-shadow[_ngcontent-%COMP%]{box-shadow:none}.cardBox[_ngcontent-%COMP%]{border-radius:20px;background:var(--Netural-1, #f5f5f7);box-shadow:none;min-height:472px}.operations-header[_ngcontent-%COMP%]{margin-bottom:30px}.card-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:left;margin:0}.card-container[_ngcontent-%COMP%]{border-radius:10px;background-color:#fff;box-shadow:0 0 10px #0000001a;overflow:hidden;min-height:87px}.copy-button[_ngcontent-%COMP%]{cursor:pointer;color:#d2d2d7}.explorer-link[_ngcontent-%COMP%]{color:#0f61ff;margin-right:4px}.badge-light[_ngcontent-%COMP%]{background-color:#0079ff;color:#fff}.timestamp[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:right;color:#6e6e73;cursor:pointer;white-space:nowrap;max-width:100%;margin-left:auto}.timestamp[_ngcontent-%COMP%]:hover{text-decoration:underline}.text-amount[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:16px;font-weight:600;letter-spacing:0em;text-align:left;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-grow:1;word-break:break-word;flex-shrink:1;max-width:100%}.truncate-text[_ngcontent-%COMP%]{display:inline-block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (max-width: 837px){.truncate-text[_ngcontent-%COMP%]{max-width:600px!important}}@media (max-width: 837px) and (max-width: 796px){.truncate-text[_ngcontent-%COMP%]{max-width:550px!important}}@media (max-width: 837px) and (max-width: 680px){.truncate-text[_ngcontent-%COMP%]{max-width:500px!important}}@media (max-width: 837px) and (max-width: 630px){.truncate-text[_ngcontent-%COMP%]{max-width:400px!important}}@media (max-width: 837px) and (max-width: 540px){.truncate-text[_ngcontent-%COMP%]{max-width:350px!important}}@media (max-width: 837px) and (max-width: 485px){.truncate-text[_ngcontent-%COMP%]{max-width:300px!important}}@media (max-width: 837px) and (max-width: 440px){.truncate-text[_ngcontent-%COMP%]{max-width:280px!important}}@media (max-width: 837px) and (max-width: 400px){.truncate-text[_ngcontent-%COMP%]{max-width:250px!important}}@media (max-width: 837px) and (max-width: 375px){.truncate-text[_ngcontent-%COMP%]{max-width:230px!important}}@media (max-width: 837px) and (max-width: 360px){.truncate-text[_ngcontent-%COMP%]{max-width:200px!important}}@media (min-width: 837px){.truncate-text[_ngcontent-%COMP%]{max-width:360px}}.text-address[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;color:#6e6e73}.text-strong[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:600;line-height:17px;letter-spacing:0em;text-align:left}.explorer-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.metamasTextBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:20px;display:flex;padding:1rem}.stateBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex;padding:1rem;height:48vh}.metamaskTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:28px;font-weight:600;line-height:34px;letter-spacing:0em;text-align:center;color:#6e6e73}.metamaskSubtitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:center;max-width:400px;color:#86868b}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]{color:#0f61ff;border-color:#d2d2d7;background-color:transparent}.btn.btn-outline-primary.btn-circle[_ngcontent-%COMP%]:hover{color:#0f61ff;border-color:#0f61ff;background-color:transparent;outline:none}@media (max-width: 1490px){.cardBox[_ngcontent-%COMP%]{width:100%!important}}@media (min-width: 768px){.cardBox[_ngcontent-%COMP%]{width:100%;margin:0 auto}.card-container[_ngcontent-%COMP%]{margin:10px auto 0}}@media (max-width: 768px){.card-container[_ngcontent-%COMP%]{min-height:72px!important}.timestamp[_ngcontent-%COMP%]{font-size:12px}.text-amount[_ngcontent-%COMP%]{font-size:14px}.text-address[_ngcontent-%COMP%]{font-size:12px}.card-container[_ngcontent-%COMP%]{margin-top:10px}.card-title[_ngcontent-%COMP%]{margin:0}}.spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:36vh}.spinner[_ngcontent-%COMP%]{text-align:center}.svg-spinner[_ngcontent-%COMP%]{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"],data:{animation:[Ov]}}),n})();function GV(n,e){1&n&&(Ue(0,"h2",6),ft(1," Collectibles "),Ge()),2&n&&Ct("@fadeInAnimation",void 0)}function KV(n,e){1&n&&(Ue(0,"div",7)(1,"div",8),Bt(2,"img",9),Ue(3,"div",10),Bt(4,"img",11),Ge()()())}function qV(n,e){1&n&&(Ue(0,"div",12)(1,"div",10),Bt(2,"img",11),Ge(),Ue(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16),Bt(7,"img",17)(8,"img",18)(9,"img",19),Ge()(),Ue(10,"div",20)(11,"div",21),ft(12," Welcome to Tezos Wallet Explorer, powered by MetaMask "),Ge(),Ue(13,"div",22)(14,"p"),ft(15," This explorer will allow you to connect with Tezos dApps and view and manage tokens via the MetaMask Wallet. Note, this account won't be visible in your MetaMask browser extension. "),Ge()()()()()()),2&n&&Ct("@fadeInAnimation",void 0)}function WV(n,e){if(1&n){const t=oo();Ue(0,"div",25),Tt("click",function(){const a=ui(t).$implicit;return zt(2).showNFTModal(a)}),Ue(1,"div",26),Bt(2,"img",27),Ge(),Ue(3,"p",28),ft(4),Ge()()}if(2&n){const t=e.$implicit;bt(2),Ct("src",t.token.metadata.sanitizedThumbnailUri,ws),bt(2),Nr(t.token.metadata.name)}}function ZV(n,e){if(1&n&&(Ue(0,"div",23),Ft(1,WV,5,2,"div",24),Ge()),2&n){const t=zt();Ct("@fadeInAnimation",void 0),bt(1),Ct("ngForOf",t.nfts)}}let XV=(()=>{class n{constructor(t){this.modalService=t,this.nfts=[],this.isLoading=!0}ngOnInit(){}showNFTModal(t){this.modalService.showNFTModal(t)}}return n.\u0275fac=function(t){return new(t||n)(ot(Fs))},n.\u0275cmp=Un({type:n,selectors:[["app-nft-list"]],inputs:{nfts:"nfts",isLoading:"isLoading"},decls:6,vars:4,consts:[[1,"card","cardBox"],[1,"card-body",2,"padding","10px"],["class","card-title",4,"ngIf"],["class","spinner-container",4,"ngIf"],["class","container",4,"ngIf"],["class","grid-container",4,"ngIf"],[1,"card-title"],[1,"spinner-container"],[1,"spinner"],["src","./assets/icons/arrow-spin.svg","alt","Loading...",1,"svg-spinner"],[1,"background-image"],["src","./assets/icons/Vector.svg","alt","SVG Image",1,"max-height-300"],[1,"container"],[1,"centered-content"],[1,"textBox"],[1,"imageBox"],[1,"d-flex","justify-content-center",2,"width","40px","height","40px"],["src","./assets/tezos-logo-sm.svg","alt","SVG Image",2,"width","100%","height","100%"],["src","./assets/icons/close.svg","alt","SVG Image",2,"width","20px","height","100%","margin-left","20px"],["src","./assets/metamask-logo-sm.svg","alt","SVG Image",2,"width","100%","height","100%","margin-left","20px"],[1,"metamasTextBox"],[1,"metamaskTitle"],[1,"metamaskSubtitle"],[1,"grid-container"],["class","grid-item custom-grid-item",3,"click",4,"ngFor","ngForOf"],[1,"grid-item","custom-grid-item",3,"click"],[1,"image-container"],[3,"src"],[1,"text-name"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1),Ft(2,GV,2,1,"h2",2),Ft(3,KV,5,0,"div",3),Ft(4,qV,16,1,"div",4),Ft(5,ZV,2,2,"div",5),Ge()()),2&t&&(bt(2),Ct("ngIf",r.nfts.length>0),bt(1),Ct("ngIf",r.isLoading),bt(1),Ct("ngIf",!r.isLoading&&0===r.nfts.length),bt(1),Ct("ngIf",r.nfts.length>0))},directives:[fo,Ru],styles:[".cardBox[_ngcontent-%COMP%]{width:100%;border-radius:20px;background:var(--Netural-1, #f5f5f7);margin:0 0 0 auto;box-sizing:border-box;box-shadow:none;min-height:692px}.card-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:20px;font-weight:600;line-height:24px;letter-spacing:0em;text-align:left;padding:20px 20px 0}.container[_ngcontent-%COMP%]{position:relative}.background-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;text-align:center}.background-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{vertical-align:middle}.centered-content[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100vh}.grid-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(182px,1fr));align-content:center;justify-content:center;align-items:center;justify-items:center;grid-gap:10px;gap:10px;padding:20px}.custom-grid-item[_ngcontent-%COMP%]{width:100%;min-width:182px;height:226px;border-radius:10px;background-color:#fff;box-shadow:0 0 10px #0000001a;display:flex;flex-direction:column;border:none}.image-container[_ngcontent-%COMP%]{flex:1;display:flex;justify-content:center;align-items:center;padding:10px;overflow:hidden}.image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:162px;height:162px}.text-name[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;padding-left:10px;padding-right:10px;word-wrap:break-word;max-height:34px;overflow:hidden;text-overflow:ellipsis}.imageBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:30px;display:inline-flex}.textBox[_ngcontent-%COMP%]{flex-direction:column;gap:30px;max-width:480px;display:flex;justify-content:center;align-items:center;z-index:1}.metamasTextBox[_ngcontent-%COMP%]{flex-direction:column;justify-content:flex-start;align-items:center;gap:20px;display:flex}.metamaskTitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:28px;font-weight:600;line-height:34px;letter-spacing:0em;text-align:center}.metamaskSubtitle[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:center;max-width:400px;color:#1d1d1f}@media (max-width: 768px){.card-title[_ngcontent-%COMP%]{margin-left:10px}.grid-container[_ngcontent-%COMP%]{padding:10px}.image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:134px;height:134px}.custom-grid-item[_ngcontent-%COMP%]{min-width:0px}.max-height-300[_ngcontent-%COMP%]{max-height:300px;width:auto}.cardBox[_ngcontent-%COMP%]{max-width:100%;margin-left:0;padding:0}.grid-container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}@media (min-width: 1200px){.background-image[_ngcontent-%COMP%]{margin-top:3rem}}.spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:90vh}.spinner[_ngcontent-%COMP%]{text-align:center}.svg-spinner[_ngcontent-%COMP%]{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"],data:{animation:[Ov]}}),n})(),YV=(()=>{class n{constructor(t){this.modalService=t}ngOnInit(){}openLink(t){window.open(t,"_blank")}}return n.\u0275fac=function(t){return new(t||n)(ot(Fs))},n.\u0275cmp=Un({type:n,selectors:[["app-footer"]],decls:20,vars:0,consts:[[1,"footer-container","mt-3","px-lg-5","py-lg-2"],[1,"row","custom-footer","justify-content-between","text-muted"],[1,"d-flex","align-items-center"],["href","#",1,"footer-link",3,"click"],[1,"separator"],["href","#",1,"footer-link","footer-link-faqs",3,"click"],[1,"text-right","text-tezos"],["href","https://metamask.io/snaps/","target","_blank",1,"text-footer"]],template:function(t,r){1&t&&(Ue(0,"div",0)(1,"div",1)(2,"div",2)(3,"a",3),Tt("click",function(){return r.openLink("https://github.com/airgap-it/tezos-snaps-wallet")}),ft(4,"GitHub"),Ge(),Bt(5,"div",4),Ue(6,"a",3),Tt("click",function(){return r.openLink("./assets/documents/privacy-policy.pdf")}),ft(7,"Privacy Policy"),Ge(),Bt(8,"div",4),Ue(9,"a",3),Tt("click",function(){return r.openLink("./assets/documents/terms-of-service.pdf")}),ft(10,"Terms of Service"),Ge(),Bt(11,"div",4),Ue(12,"a",5),Tt("click",function(){return r.openLink("https://github.com/airgap-it/tezos-metamask-snap/wiki/FAQs")}),ft(13,"FAQs"),Ge()(),Ue(14,"div",2)(15,"span",6),ft(16," Powered by "),Ue(17,"u")(18,"a",7),ft(19,"MetaMask Snaps"),Ge()()()()()())},styles:[".footer-container[_ngcontent-%COMP%]{background:#f5f5f7;border-radius:20px;min-height:100px}.footer-link[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:normal;text-decoration:none;color:#424245;white-space:nowrap;padding:20px}.footer-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.custom-footer[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;margin-top:inherit}.separator[_ngcontent-%COMP%]{width:1px;height:20px;background:#d2d2d7;margin:10px}.text-footer[_ngcontent-%COMP%]{color:#86868b}.text-footer[_ngcontent-%COMP%]:hover{text-decoration:underline}.custom-footer[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:nowrap}.text-tezos[_ngcontent-%COMP%]{font-size:12px}@media (min-width: 768px){.custom-footer[_ngcontent-%COMP%]{flex-direction:row;justify-content:space-between;align-items:center;white-space:nowrap}}@media (max-width: 768px){.custom-footer[_ngcontent-%COMP%]{margin-top:0}.footer-container[_ngcontent-%COMP%]{padding:20px}.footer-link[_ngcontent-%COMP%]{padding:10px}.text-tezos[_ngcontent-%COMP%]{margin-top:10px}.separator[_ngcontent-%COMP%]{margin:2px}}@media (max-width: 991px){.custom-footer[_ngcontent-%COMP%]{max-width:-moz-fit-content;max-width:fit-content;margin:auto;padding-top:20px}}@media (max-width: 423px){.footer-link[_ngcontent-%COMP%]{font-size:x-small}}"]}),n})();function QV(n,e){1&n&&Bt(0,"app-landing")}function JV(n,e){1&n&&Bt(0,"app-header-item")}function ej(n,e){if(1&n&&(Ue(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5),Bt(4,"app-account",6),Ge(),Ue(5,"div",7)(6,"div",8)(7,"div",9),Bt(8,"img",10),Ue(9,"p",11),ft(10," This explorer will allow you to connect with Tezos dApps and send/receive tokens via the MetaMask Wallet. Note, this account won't be visible in your MetaMask browser extension. "),Ge()()()(),Ue(11,"div",12),Bt(12,"app-operations",13),Ge()(),Ue(13,"div",14)(14,"div",15),Bt(15,"app-nft-list",16),Ge(),Ue(16,"div",17),Bt(17,"app-operations",13),Ge()()(),Bt(18,"app-footer"),Ge()),2&n){const t=zt();bt(4),Ct("isLoading",t.isLoading)("balance",t.balance)("usdBalance",t.usdBalance)("address",t.address)("tokens",t.tokens),bt(8),Ct("isLoading",t.isLoading)("operations",t.operations),bt(3),Ct("isLoading",t.isLoading)("nfts",t.nfts),bt(2),Ct("isLoading",t.isLoading)("operations",t.operations)}}let tj=(()=>{class n{constructor(t,r,i,a,h,v,D){var L=this;this.api=t,this.beacon=r,this.metamaskService=i,this.accountService=a,this.modalService=h,this.router=v,this.tabSyncService=D,this.balance="0",this.usdBalance="0",this.address="",this.operations=[],this.price=0,this.nfts=[],this.tokens=[],this.isLoading=!0,this.isCollapsed=!0,this.syncCode="",this.connected=!1,this.peersAndPermissions=[],this.selectedNodes=[],this.accounts$=this.accountService.accounts$,this.loadNodes(),this.router.events.subscribe(function(){var j=Ot(function*(Q){if(Q instanceof yl){const me=`https://placeholder.com/${Q.url}`;if(me.includes("?type=tzip10&data=")){console.log(me);const Te=new URL(me).searchParams.get("data");Te&&(console.log("ADDING PEER"),yield L.beacon.addPeer(Te),L.router.navigate(["/"]))}}});return function(Q){return j.apply(this,arguments)}}()),setInterval(()=>{this.loadAccountInfo()},1e4),this.loadAccountInfo()}loadAccountInfo(){var t=this;this.accountService.accounts$.pipe(fi()).subscribe(function(){var r=Ot(function*(i){if(i[0]){const a=i[0].address;t.address=a,Promise.all([t.api.getXtzPrice(),t.api.getBalanceOfAddress(a),t.api.getOperationHistory(a),t.api.getTokenTransactionHistory(a),t.api.getNftBalances(a),t.api.getTokenBalances(a)]).then(([h,v,D,L,j,Q])=>{t.isLoading=!1,t.balance=v.shiftedBy(-6).toString(10);const me=[...D,...L.map(ye=>{var Te,Ve,je;const gt=Object.assign(Object.assign({},ye),{type:"tokenTransfer"});return gt.formattedAmount=new Nn(gt.amount).shiftedBy(-new Nn(null!==(je=null===(Ve=null===(Te=null==gt?void 0:gt.token)||void 0===Te?void 0:Te.metadata)||void 0===Ve?void 0:Ve.decimals)&&void 0!==je?je:0).toNumber()).decimalPlaces(6).toString(10),gt})].sort((ye,Te)=>Te.id-ye.id).slice(0,10);me.some((ye,Te)=>{var Ve;return(null==ye?void 0:ye.id)!==(null===(Ve=t.operations[Te])||void 0===Ve?void 0:Ve.id)})&&(t.operations=me),j.some((ye,Te)=>{var Ve;return(null==ye?void 0:ye.id)!==(null===(Ve=t.nfts[Te])||void 0===Ve?void 0:Ve.id)})&&(t.nfts=j),Q.some((ye,Te)=>{var Ve,je;return(null==ye?void 0:ye.id)!==(null===(Ve=t.tokens[Te])||void 0===Ve?void 0:Ve.id)||(null==ye?void 0:ye.humanReadableBalance)!==(null===(je=t.tokens[Te])||void 0===je?void 0:je.humanReadableBalance)})&&(t.tokens=Q),t.price=h,t.usdBalance=new Nn(t.balance).times(t.price).decimalPlaces(2).toString(10),console.log("BALANCE: ",t.balance),console.log("TXs: ",t.operations),console.log("tokenTransfers: ",L),console.log("NFTs: ",t.nfts),console.log("TOKENs: ",t.tokens)})}});return function(i){return r.apply(this,arguments)}}())}loadNodes(){this.selectedNodes=Object.entries(this.api.RPCs).filter(t=>t[1].all.length>0).map(t=>[t[0],t[1].selected])}ngOnInit(){var t=this;return Ot(function*(){t.connected=yield t.beacon.walletClient.isConnected,t.getPeers()})()}paste(){var t=this;return Ot(function*(){navigator.clipboard.readText().then(function(){var r=Ot(function*(i){try{t.syncCode=i}catch(a){}});return function(i){return r.apply(this,arguments)}}())})()}connect(){var t=this;return Ot(function*(){const r=t.modalService.showLoadingModal();setTimeout(()=>{t.beacon.addPeer(t.syncCode).finally(()=>r.hide())},500)})()}getPeers(){var t=this;return Ot(function*(){const r=yield t.beacon.walletClient.getPeers(),i=yield t.beacon.walletClient.getPermissions();t.peersAndPermissions=r.map(a=>[a,i.filter(h=>h.senderId===a.senderId)])})()}removePeer(t,r){var i=this;return Ot(function*(){t.stopPropagation(),i.modalService.showConfirmModal(Ot(function*(){yield i.beacon.walletClient.removePeer(r,!0),i.getPeers()}))})()}removePermission(t){var r=this;return Ot(function*(){r.modalService.showConfirmModal(Ot(function*(){yield r.beacon.walletClient.removePermission(t.accountIdentifier),r.getPeers()}))})()}removeAccount(t){var r=this;return Ot(function*(){r.modalService.showConfirmModal(()=>{r.accountService.removeAccount(t)})})()}openNodeSelectorModal(){var t;null===(t=this.modalService.showNodeSelectorModal().onHide)||void 0===t||t.subscribe(()=>{this.loadNodes()})}openHowToModal(){this.modalService.showHowToModal()}}return n.\u0275fac=function(t){return new(t||n)(ot(Ju),ot(mc),ot(Xh),ot(Os),ot(Fs),ot(hi),ot(B3))},n.\u0275cmp=Un({type:n,selectors:[["app-root"]],decls:5,vars:3,consts:[[4,"ngIf"],["class","container-fluid px-md-5 pb-3",4,"ngIf"],[1,"container-fluid","px-md-5","pb-3"],[1,"row"],[1,"col","fixed-width"],[1,"card","no-shadow","mb-3"],[3,"isLoading","balance","usdBalance","address","tokens"],[1,"card","no-shadow","mb-3","cardBox"],[1,"card-body",2,"padding","30px"],[1,"infoInputBox"],["src","./assets/icons/FiAlertCircleBlack.svg","alt","alert",2,"width","20px","height","20px"],[1,"infoInputText"],[1,"card","no-shadow","mb-3","d-none","d-md-block"],[3,"isLoading","operations"],[1,"col"],[1,"max-width"],[3,"isLoading","nfts"],[1,"card","no-shadow","mb-3","d-md-none","operations-mobile"]],template:function(t,r){1&t&&(Ft(0,QV,1,0,"app-landing",0),Ue(1,"div"),Ft(2,JV,1,0,"app-header-item",0),Ge(),Ft(3,ej,19,11,"div",1),Bt(4,"router-outlet")),2&t&&(Ct("ngIf",!r.accountService.hasAccounts),bt(2),Ct("ngIf",r.accountService.hasAccounts),bt(1),Ct("ngIf",r.accountService.hasAccounts))},directives:[fo,uV,cV,vV,zV,XV,YV,Zg],styles:[".header[_ngcontent-%COMP%]{font-size:24px} .card{background:#f5f5f7;border-radius:20px;border:none} .card-header{border:none} .btn-circle{border-radius:100px} modal-container{-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px)} modal-container .modal-header{border-bottom:none} modal-container .modal-footer{border-top:none} .modal-content{border-radius:20px;padding:50px} .modal-content .close{margin-top:-50px;margin-right:-50px;width:40px;height:40px;padding:10px;background:#f5f5f7;border-radius:100px;justify-content:center;align-items:center}.no-shadow[_ngcontent-%COMP%]{box-shadow:none}.infoInputBox[_ngcontent-%COMP%]{gap:10px;display:flex;justify-content:left;align-items:center}.infoInputText[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:17px;letter-spacing:0em;text-align:left;margin-top:auto;margin-bottom:auto}.cardBox[_ngcontent-%COMP%]{box-shadow:none;box-sizing:border-box;margin:0 auto}@media (max-width: 768px){.fixed-width[_ngcontent-%COMP%]{min-width:none!important;max-width:none!important}.operations-mobile[_ngcontent-%COMP%]{margin-top:20px}}@media (min-width: 768px){.fixed-width[_ngcontent-%COMP%]{min-width:500px;max-width:500px}}@media (max-width: 837px){.col[_ngcontent-%COMP%]{max-width:none!important}.d-md-block[_ngcontent-%COMP%]{display:none!important}.operations-mobile[_ngcontent-%COMP%]{display:block!important;margin-top:20px}}"]}),n})();const xn=!1;function W6(n){return new Ne(3e3,xn)}function kj(){return"undefined"!=typeof window&&void 0!==window.document}function Nv(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Us(n){switch(n.length){case 0:return new Bu;case 1:return n[0];default:return new EM(n)}}function Z6(n,e,t,r,i={},a={}){const h=[],v=[];let D=-1,L=null;if(r.forEach(j=>{const Q=j.offset,me=Q==D,ye=me&&L||{};Object.keys(j).forEach(Te=>{let Ve=Te,je=j[Te];if("offset"!==Te)switch(Ve=e.normalizePropertyName(Ve,h),je){case"!":je=i[Te];break;case ts:je=a[Te];break;default:je=e.normalizeStyleValue(Te,Ve,je,h)}ye[Ve]=je}),me||v.push(ye),L=ye,D=Q}),h.length)throw function xj(n){return new Ne(3502,xn)}();return v}function kv(n,e,t,r){switch(e){case"start":n.onStart(()=>r(t&&Bv(t,"start",n)));break;case"done":n.onDone(()=>r(t&&Bv(t,"done",n)));break;case"destroy":n.onDestroy(()=>r(t&&Bv(t,"destroy",n)))}}function Bv(n,e,t){const r=t.totalTime,a=Lv(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==r?n.totalTime:r,!!t.disabled),h=n._data;return null!=h&&(a._data=h),a}function Lv(n,e,t,r,i="",a=0,h){return{element:n,triggerName:e,fromState:t,toState:r,phaseName:i,totalTime:a,disabled:!!h}}function Ri(n,e,t){let r;return n instanceof Map?(r=n.get(e),r||n.set(e,r=t)):(r=n[e],r||(r=n[e]=t)),r}function X6(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let Fv=(n,e)=>!1,Y6=(n,e,t)=>[],Q6=null;function Uv(n){const e=n.parentNode||n.host;return e===Q6?null:e}(Nv()||"undefined"!=typeof Element)&&(kj()?(Q6=(()=>document.documentElement)(),Fv=(n,e)=>{for(;e;){if(e===n)return!0;e=Uv(e)}return!1}):Fv=(n,e)=>n.contains(e),Y6=(n,e,t)=>{if(t)return Array.from(n.querySelectorAll(e));const r=n.querySelector(e);return r?[r]:[]});let ba=null,J6=!1;function eS(n){ba||(ba=function Lj(){return"undefined"!=typeof document?document.body:null}()||{},J6=!!ba.style&&"WebkitAppearance"in ba.style);let e=!0;return ba.style&&!function Bj(n){return"ebkit"==n.substring(1,6)}(n)&&(e=n in ba.style,!e&&J6&&(e="Webkit"+n.charAt(0).toUpperCase()+n.substr(1)in ba.style)),e}const tS=Fv,nS=Y6;let rS=(()=>{class n{validateStyleProperty(t){return eS(t)}matchesElement(t,r){return!1}containsElement(t,r){return tS(t,r)}getParentElement(t){return Uv(t)}query(t,r,i){return nS(t,r,i)}computeStyle(t,r,i){return i||""}animate(t,r,i,a,h,v=[],D){return new Bu(i,a)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})(),Hv=(()=>{class n{}return n.NOOP=new rS,n})();const Vv="ng-enter",sd="ng-leave",ad="ng-trigger",ld=".ng-trigger",oS="ng-animating",jv=".ng-animating";function _a(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:$v(parseFloat(e[1]),e[2])}function $v(n,e){return"s"===e?1e3*n:n}function ud(n,e,t){return n.hasOwnProperty("duration")?n:function Hj(n,e,t){let i,a=0,h="";if("string"==typeof n){const v=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===v)return e.push(W6()),{duration:0,delay:0,easing:""};i=$v(parseFloat(v[1]),v[2]);const D=v[3];null!=D&&(a=$v(parseFloat(D),v[4]));const L=v[5];L&&(h=L)}else i=n;if(!t){let v=!1,D=e.length;i<0&&(e.push(function nj(){return new Ne(3100,xn)}()),v=!0),a<0&&(e.push(function rj(){return new Ne(3101,xn)}()),v=!0),v&&e.splice(D,0,W6())}return{duration:i,delay:a,easing:h}}(n,e,t)}function kl(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function Hs(n,e,t={}){if(e)for(let r in n)t[r]=n[r];else kl(n,t);return t}function aS(n,e,t){return t?e+":"+t+";":""}function lS(n){let e="";for(let t=0;t{const i=Gv(r);t&&!t.hasOwnProperty(r)&&(t[r]=n.style[i]),n.style[i]=e[r]}),Nv()&&lS(n))}function wa(n,e){n.style&&(Object.keys(e).forEach(t=>{const r=Gv(t);n.style[r]=""}),Nv()&&lS(n))}function wc(n){return Array.isArray(n)?1==n.length?n[0]:wM(n):n}const zv=new RegExp("{{\\s*(.+?)\\s*}}","g");function uS(n){let e=[];if("string"==typeof n){let t;for(;t=zv.exec(n);)e.push(t[1]);zv.lastIndex=0}return e}function cd(n,e,t){const r=n.toString(),i=r.replace(zv,(a,h)=>{let v=e[h];return e.hasOwnProperty(h)||(t.push(function oj(n){return new Ne(3003,xn)}()),v=""),v.toString()});return i==r?n:i}function fd(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const jj=/-+([a-z0-9])/g;function Gv(n){return n.replace(jj,(...e)=>e[1].toUpperCase())}function $j(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Oi(n,e,t){switch(e.type){case 7:return n.visitTrigger(e,t);case 0:return n.visitState(e,t);case 1:return n.visitTransition(e,t);case 2:return n.visitSequence(e,t);case 3:return n.visitGroup(e,t);case 4:return n.visitAnimate(e,t);case 5:return n.visitKeyframes(e,t);case 6:return n.visitStyle(e,t);case 8:return n.visitReference(e,t);case 9:return n.visitAnimateChild(e,t);case 10:return n.visitAnimateRef(e,t);case 11:return n.visitQuery(e,t);case 12:return n.visitStagger(e,t);default:throw function sj(n){return new Ne(3004,xn)}()}}function cS(n,e){return window.getComputedStyle(n)[e]}function Zj(n,e){const t=[];return"string"==typeof n?n.split(/\s*,\s*/).forEach(r=>function Xj(n,e,t){if(":"==n[0]){const D=function Yj(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,r)=>parseFloat(r)>parseFloat(t);case":decrement":return(t,r)=>parseFloat(r) *"}}(n,t);if("function"==typeof D)return void e.push(D);n=D}const r=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==r||r.length<4)return t.push(function bj(n){return new Ne(3015,xn)}()),e;const i=r[1],a=r[2],h=r[3];e.push(fS(i,h));"<"==a[0]&&!("*"==i&&"*"==h)&&e.push(fS(h,i))}(r,t,e)):t.push(n),t}const gd=new Set(["true","1"]),md=new Set(["false","0"]);function fS(n,e){const t=gd.has(n)||md.has(n),r=gd.has(e)||md.has(e);return(i,a)=>{let h="*"==n||n==i,v="*"==e||e==a;return!h&&t&&"boolean"==typeof i&&(h=i?gd.has(n):md.has(n)),!v&&r&&"boolean"==typeof a&&(v=a?gd.has(e):md.has(e)),h&&v}}const Qj=new RegExp("s*:selfs*,?","g");function Kv(n,e,t,r){return new Jj(n).build(e,t,r)}class Jj{constructor(e){this._driver=e}build(e,t,r){const i=new n$(t);this._resetContextStyleTimingState(i);const a=Oi(this,wc(e),i);return i.unsupportedCSSPropertiesFound.size&&i.unsupportedCSSPropertiesFound.keys(),a}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let r=t.queryCount=0,i=t.depCount=0;const a=[],h=[];return"@"==e.name.charAt(0)&&t.errors.push(function lj(){return new Ne(3006,xn)}()),e.definitions.forEach(v=>{if(this._resetContextStyleTimingState(t),0==v.type){const D=v,L=D.name;L.toString().split(/\s*,\s*/).forEach(j=>{D.name=j,a.push(this.visitState(D,t))}),D.name=L}else if(1==v.type){const D=this.visitTransition(v,t);r+=D.queryCount,i+=D.depCount,h.push(D)}else t.errors.push(function uj(){return new Ne(3007,xn)}())}),{type:7,name:e.name,states:a,transitions:h,queryCount:r,depCount:i,options:null}}visitState(e,t){const r=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(r.containsDynamicStyles){const a=new Set,h=i||{};r.styles.forEach(v=>{if(vd(v)){const D=v;Object.keys(D).forEach(L=>{uS(D[L]).forEach(j=>{h.hasOwnProperty(j)||a.add(j)})})}}),a.size&&(fd(a.values()),t.errors.push(function cj(n,e){return new Ne(3008,xn)}()))}return{type:0,name:e.name,style:r,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const r=Oi(this,wc(e.animation),t);return{type:1,matchers:Zj(e.expr,t.errors),animation:r,queryCount:t.queryCount,depCount:t.depCount,options:Ma(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(r=>Oi(this,r,t)),options:Ma(e.options)}}visitGroup(e,t){const r=t.currentTime;let i=0;const a=e.steps.map(h=>{t.currentTime=r;const v=Oi(this,h,t);return i=Math.max(i,t.currentTime),v});return t.currentTime=i,{type:3,steps:a,options:Ma(e.options)}}visitAnimate(e,t){const r=function i$(n,e){if(n.hasOwnProperty("duration"))return n;if("number"==typeof n)return qv(ud(n,e).duration,0,"");const t=n;if(t.split(/\s+/).some(a=>"{"==a.charAt(0)&&"{"==a.charAt(1))){const a=qv(0,0,"");return a.dynamic=!0,a.strValue=t,a}const i=ud(t,e);return qv(i.duration,i.delay,i.easing)}(e.timings,t.errors);t.currentAnimateTimings=r;let i,a=e.styles?e.styles:Ci({});if(5==a.type)i=this.visitKeyframes(a,t);else{let h=e.styles,v=!1;if(!h){v=!0;const L={};r.easing&&(L.easing=r.easing),h=Ci(L)}t.currentTime+=r.duration+r.delay;const D=this.visitStyle(h,t);D.isEmptyStep=v,i=D}return t.currentAnimateTimings=null,{type:4,timings:r,style:i,options:null}}visitStyle(e,t){const r=this._makeStyleAst(e,t);return this._validateStyleAst(r,t),r}_makeStyleAst(e,t){const r=[];Array.isArray(e.styles)?e.styles.forEach(h=>{"string"==typeof h?h==ts?r.push(h):t.errors.push(function fj(n){return new Ne(3002,xn)}()):r.push(h)}):r.push(e.styles);let i=!1,a=null;return r.forEach(h=>{if(vd(h)){const v=h,D=v.easing;if(D&&(a=D,delete v.easing),!i)for(let L in v)if(v[L].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:r,easing:a,offset:e.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(e,t){const r=t.currentAnimateTimings;let i=t.currentTime,a=t.currentTime;r&&a>0&&(a-=r.duration+r.delay),e.styles.forEach(h=>{"string"!=typeof h&&Object.keys(h).forEach(v=>{if(!this._driver.validateStyleProperty(v))return delete h[v],void t.unsupportedCSSPropertiesFound.add(v);const D=t.collectedStyles[t.currentQuerySelector],L=D[v];let j=!0;L&&(a!=i&&a>=L.startTime&&i<=L.endTime&&(t.errors.push(function hj(n,e,t,r,i){return new Ne(3010,xn)}()),j=!1),a=L.startTime),j&&(D[v]={startTime:a,endTime:i}),t.options&&function Vj(n,e,t){const r=e.params||{},i=uS(n);i.length&&i.forEach(a=>{r.hasOwnProperty(a)||t.push(function ij(n){return new Ne(3001,xn)}())})}(h[v],t.options,t.errors)})})}visitKeyframes(e,t){const r={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(function dj(){return new Ne(3011,xn)}()),r;let a=0;const h=[];let v=!1,D=!1,L=0;const j=e.steps.map(gt=>{const Ie=this._makeStyleAst(gt,t);let _t=null!=Ie.offset?Ie.offset:function r$(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(vd(t)&&t.hasOwnProperty("offset")){const r=t;e=parseFloat(r.offset),delete r.offset}});else if(vd(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(Ie.styles),At=0;return null!=_t&&(a++,At=Ie.offset=_t),D=D||At<0||At>1,v=v||At0&&a{const _t=me>0?Ie==ye?1:me*Ie:h[Ie],At=_t*je;t.currentTime=Te+Ve.delay+At,Ve.duration=At,this._validateStyleAst(gt,t),gt.offset=_t,r.styles.push(gt)}),r}visitReference(e,t){return{type:8,animation:Oi(this,wc(e.animation),t),options:Ma(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:Ma(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Ma(e.options)}}visitQuery(e,t){const r=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;const[a,h]=function e$(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(Qj,"")),n=n.replace(/@\*/g,ld).replace(/@\w+/g,t=>ld+"-"+t.substr(1)).replace(/:animating/g,jv),[n,e]}(e.selector);t.currentQuerySelector=r.length?r+" "+a:a,Ri(t.collectedStyles,t.currentQuerySelector,{});const v=Oi(this,wc(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=r,{type:11,selector:a,limit:i.limit||0,optional:!!i.optional,includeSelf:h,animation:v,originalSelector:e.selector,options:Ma(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(function vj(){return new Ne(3013,xn)}());const r="full"===e.timings?{duration:0,delay:0,easing:"full"}:ud(e.timings,t.errors,!0);return{type:12,animation:Oi(this,wc(e.animation),t),timings:r,options:null}}}class n${constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function vd(n){return!Array.isArray(n)&&"object"==typeof n}function Ma(n){return n?(n=kl(n)).params&&(n.params=function t$(n){return n?kl(n):null}(n.params)):n={},n}function qv(n,e,t){return{duration:n,delay:e,easing:t}}function Wv(n,e,t,r,i,a,h=null,v=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:r,duration:i,delay:a,totalTime:i+a,easing:h,subTimeline:v}}class yd{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,t){let r=this._map.get(e);r||this._map.set(e,r=[]),r.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const a$=new RegExp(":enter","g"),u$=new RegExp(":leave","g");function Zv(n,e,t,r,i,a={},h={},v,D,L=[]){return(new c$).buildKeyframes(n,e,t,r,i,a,h,v,D,L)}class c${buildKeyframes(e,t,r,i,a,h,v,D,L,j=[]){L=L||new yd;const Q=new Xv(e,t,L,i,a,j,[]);Q.options=D,Q.currentTimeline.setStyles([h],null,Q.errors,D),Oi(this,r,Q);const me=Q.timelines.filter(ye=>ye.containsAnimation());if(Object.keys(v).length){let ye;for(let Te=me.length-1;Te>=0;Te--){const Ve=me[Te];if(Ve.element===t){ye=Ve;break}}ye&&!ye.allowOnlyTimelineStyles()&&ye.setStyles([v],null,Q.errors,D)}return me.length?me.map(ye=>ye.buildKeyframes()):[Wv(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const r=t.subInstructions.get(t.element);if(r){const i=t.createSubContext(e.options),a=t.currentTimeline.currentTime,h=this._visitSubInstructions(r,i,i.options);a!=h&&t.transformIntoNewTimeline(h)}t.previousNode=e}visitAnimateRef(e,t){const r=t.createSubContext(e.options);r.transformIntoNewTimeline(),this.visitReference(e.animation,r),t.transformIntoNewTimeline(r.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,r){let a=t.currentTimeline.currentTime;const h=null!=r.duration?_a(r.duration):null,v=null!=r.delay?_a(r.delay):null;return 0!==h&&e.forEach(D=>{const L=t.appendInstructionToTimeline(D,h,v);a=Math.max(a,L.duration+L.delay)}),a}visitReference(e,t){t.updateOptions(e.options,!0),Oi(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const r=t.subContextCount;let i=t;const a=e.options;if(a&&(a.params||a.delay)&&(i=t.createSubContext(a),i.transformIntoNewTimeline(),null!=a.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=bd);const h=_a(a.delay);i.delayNextStep(h)}e.steps.length&&(e.steps.forEach(h=>Oi(this,h,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const r=[];let i=t.currentTimeline.currentTime;const a=e.options&&e.options.delay?_a(e.options.delay):0;e.steps.forEach(h=>{const v=t.createSubContext(e.options);a&&v.delayNextStep(a),Oi(this,h,v),i=Math.max(i,v.currentTimeline.currentTime),r.push(v.currentTimeline)}),r.forEach(h=>t.currentTimeline.mergeTimelineCollectedStyles(h)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const r=e.strValue;return ud(t.params?cd(r,t.params,t.errors):r,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const r=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;r.delay&&(t.incrementTime(r.delay),i.snapshotCurrentStyles());const a=e.style;5==a.type?this.visitKeyframes(a,t):(t.incrementTime(r.duration),this.visitStyle(a,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const r=t.currentTimeline,i=t.currentAnimateTimings;!i&&r.getCurrentStyleProperties().length&&r.forwardFrame();const a=i&&i.easing||e.easing;e.isEmptyStep?r.applyEmptyStep(a):r.setStyles(e.styles,a,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const r=t.currentAnimateTimings,i=t.currentTimeline.duration,a=r.duration,v=t.createSubContext().currentTimeline;v.easing=r.easing,e.styles.forEach(D=>{v.forwardTime((D.offset||0)*a),v.setStyles(D.styles,D.easing,t.errors,t.options),v.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(v),t.transformIntoNewTimeline(i+a),t.previousNode=e}visitQuery(e,t){const r=t.currentTimeline.currentTime,i=e.options||{},a=i.delay?_a(i.delay):0;a&&(6===t.previousNode.type||0==r&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=bd);let h=r;const v=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=v.length;let D=null;v.forEach((L,j)=>{t.currentQueryIndex=j;const Q=t.createSubContext(e.options,L);a&&Q.delayNextStep(a),L===t.element&&(D=Q.currentTimeline),Oi(this,e.animation,Q),Q.currentTimeline.applyStylesToKeyframe(),h=Math.max(h,Q.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(h),D&&(t.currentTimeline.mergeTimelineCollectedStyles(D),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const r=t.parentContext,i=t.currentTimeline,a=e.timings,h=Math.abs(a.duration),v=h*(t.currentQueryTotal-1);let D=h*t.currentQueryIndex;switch(a.duration<0?"reverse":a.easing){case"reverse":D=v-D;break;case"full":D=r.currentStaggerTime}const j=t.currentTimeline;D&&j.delayNextStep(D);const Q=j.currentTime;Oi(this,e.animation,t),t.previousNode=e,r.currentStaggerTime=i.currentTime-Q+(i.startTime-r.currentTimeline.startTime)}}const bd={};class Xv{constructor(e,t,r,i,a,h,v,D){this._driver=e,this.element=t,this.subInstructions=r,this._enterClassName=i,this._leaveClassName=a,this.errors=h,this.timelines=v,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=bd,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=D||new _d(this._driver,t,0),v.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const r=e;let i=this.options;null!=r.duration&&(i.duration=_a(r.duration)),null!=r.delay&&(i.delay=_a(r.delay));const a=r.params;if(a){let h=i.params;h||(h=this.options.params={}),Object.keys(a).forEach(v=>{(!t||!h.hasOwnProperty(v))&&(h[v]=cd(a[v],h,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const r=e.params={};Object.keys(t).forEach(i=>{r[i]=t[i]})}}return e}createSubContext(e=null,t,r){const i=t||this.element,a=new Xv(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return a.previousNode=this.previousNode,a.currentAnimateTimings=this.currentAnimateTimings,a.options=this._copyOptions(),a.updateOptions(e),a.currentQueryIndex=this.currentQueryIndex,a.currentQueryTotal=this.currentQueryTotal,a.parentContext=this,this.subContextCount++,a}transformIntoNewTimeline(e){return this.previousNode=bd,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,r){const i={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=r?r:0)+e.delay,easing:""},a=new f$(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(a),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,r,i,a,h){let v=[];if(i&&v.push(this.element),e.length>0){e=(e=e.replace(a$,"."+this._enterClassName)).replace(u$,"."+this._leaveClassName);let L=this._driver.query(this.element,e,1!=r);0!==r&&(L=r<0?L.slice(L.length+r,L.length):L.slice(0,r)),v.push(...L)}return!a&&0==v.length&&h.push(function yj(n){return new Ne(3014,xn)}()),v}}class _d{constructor(e,t,r,i){this._driver=e,this.element=t,this.startTime=r,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new _d(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||ts,this._currentKeyframe[t]=ts}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,r,i){t&&(this._previousKeyframe.easing=t);const a=i&&i.params||{},h=function h$(n,e){const t={};let r;return n.forEach(i=>{"*"===i?(r=r||Object.keys(e),r.forEach(a=>{t[a]=ts})):Hs(i,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(h).forEach(v=>{const D=cd(h[v],a,r);this._pendingStyles[v]=D,this._localTimelineStyles.hasOwnProperty(v)||(this._backFill[v]=this._globalTimelineStyles.hasOwnProperty(v)?this._globalTimelineStyles[v]:ts),this._updateStyle(v,D)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(r=>{this._currentKeyframe[r]=e[r]}),Object.keys(this._localTimelineStyles).forEach(r=>{this._currentKeyframe.hasOwnProperty(r)||(this._currentKeyframe[r]=this._localTimelineStyles[r])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const r=this._styleSummary[t],i=e._styleSummary[t];(!r||i.time>r.time)&&this._updateStyle(t,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,r=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((v,D)=>{const L=Hs(v,!0);Object.keys(L).forEach(j=>{const Q=L[j];"!"==Q?e.add(j):Q==ts&&t.add(j)}),r||(L.offset=D/this.duration),i.push(L)});const a=e.size?fd(e.values()):[],h=t.size?fd(t.values()):[];if(r){const v=i[0],D=kl(v);v.offset=0,D.offset=1,i=[v,D]}return Wv(this.element,i,a,h,this.duration,this.startTime,this.easing,!1)}}class f$ extends _d{constructor(e,t,r,i,a,h,v=!1){super(e,t,h.delay),this.keyframes=r,this.preStyleProps=i,this.postStyleProps=a,this._stretchStartingKeyframe=v,this.timings={duration:h.duration,delay:h.delay,easing:h.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:r,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){const a=[],h=r+t,v=t/h,D=Hs(e[0],!1);D.offset=0,a.push(D);const L=Hs(e[0],!1);L.offset=pS(v),a.push(L);const j=e.length-1;for(let Q=1;Q<=j;Q++){let me=Hs(e[Q],!1);me.offset=pS((t+me.offset*r)/h),a.push(me)}r=h,t=0,i="",e=a}return Wv(this.element,e,this.preStyleProps,this.postStyleProps,r,t,i,!0)}}function pS(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class Yv{}class d$ extends Yv{normalizePropertyName(e,t){return Gv(e)}normalizeStyleValue(e,t,r,i){let a="";const h=r.toString().trim();if(p$[t]&&0!==r&&"0"!==r)if("number"==typeof r)a="px";else{const v=r.match(/^[+-]?[\d\.]+([a-z]*)$/);v&&0==v[1].length&&i.push(function aj(n,e){return new Ne(3005,xn)}())}return h+a}}const p$=(()=>function g$(n){const e={};return n.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function gS(n,e,t,r,i,a,h,v,D,L,j,Q,me){return{type:0,element:n,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:a,toState:r,toStyles:h,timelines:v,queriedElements:D,preStyleProps:L,postStyleProps:j,totalTime:Q,errors:me}}const Qv={};class mS{constructor(e,t,r){this._triggerName=e,this.ast=t,this._stateStyles=r}match(e,t,r,i){return function m$(n,e,t,r,i){return n.some(a=>a(e,t,r,i))}(this.ast.matchers,e,t,r,i)}buildStyles(e,t,r){const i=this._stateStyles["*"],a=this._stateStyles[e],h=i?i.buildStyles(t,r):{};return a?a.buildStyles(t,r):h}build(e,t,r,i,a,h,v,D,L,j){const Q=[],me=this.ast.options&&this.ast.options.params||Qv,Te=this.buildStyles(r,v&&v.params||Qv,Q),Ve=D&&D.params||Qv,je=this.buildStyles(i,Ve,Q),gt=new Set,Ie=new Map,_t=new Map,At="void"===i,Nt={params:Object.assign(Object.assign({},me),Ve)},Vt=j?[]:Zv(e,t,this.ast.animation,a,h,Te,je,Nt,L,Q);let Zt=0;if(Vt.forEach(De=>{Zt=Math.max(De.duration+De.delay,Zt)}),Q.length)return gS(t,this._triggerName,r,i,At,Te,je,[],[],Ie,_t,Zt,Q);Vt.forEach(De=>{const ke=De.element,dt=Ri(Ie,ke,{});De.preStyleProps.forEach(st=>dt[st]=!0);const Qe=Ri(_t,ke,{});De.postStyleProps.forEach(st=>Qe[st]=!0),ke!==t&>.add(ke)});const Se=fd(gt.values());return gS(t,this._triggerName,r,i,At,Te,je,Vt,Se,Ie,_t,Zt)}}class v${constructor(e,t,r){this.styles=e,this.defaultParams=t,this.normalizer=r}buildStyles(e,t){const r={},i=kl(this.defaultParams);return Object.keys(e).forEach(a=>{const h=e[a];null!=h&&(i[a]=h)}),this.styles.styles.forEach(a=>{if("string"!=typeof a){const h=a;Object.keys(h).forEach(v=>{let D=h[v];D.length>1&&(D=cd(D,i,t));const L=this.normalizer.normalizePropertyName(v,t);D=this.normalizer.normalizeStyleValue(v,L,D,t),r[L]=D})}}),r}}class b${constructor(e,t,r){this.name=e,this.ast=t,this._normalizer=r,this.transitionFactories=[],this.states={},t.states.forEach(i=>{this.states[i.name]=new v$(i.style,i.options&&i.options.params||{},r)}),vS(this.states,"true","1"),vS(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new mS(e,i,this.states))}),this.fallbackTransition=function _$(n,e,t){return new mS(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(h,v)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,r,i){return this.transitionFactories.find(h=>h.match(e,t,r,i))||null}matchStyles(e,t,r){return this.fallbackTransition.buildStyles(e,t,r)}}function vS(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const w$=new yd;class M${constructor(e,t,r){this.bodyNode=e,this._driver=t,this._normalizer=r,this._animations={},this._playersById={},this.players=[]}register(e,t){const r=[],a=Kv(this._driver,t,r,[]);if(r.length)throw function Sj(n){return new Ne(3503,xn)}();this._animations[e]=a}_buildPlayer(e,t,r){const i=e.element,a=Z6(0,this._normalizer,0,e.keyframes,t,r);return this._driver.animate(i,a,e.duration,e.delay,e.easing,[],!0)}create(e,t,r={}){const i=[],a=this._animations[e];let h;const v=new Map;if(a?(h=Zv(this._driver,t,a,Vv,sd,{},{},r,w$,i),h.forEach(j=>{const Q=Ri(v,j.element,{});j.postStyleProps.forEach(me=>Q[me]=null)})):(i.push(function Cj(){return new Ne(3300,xn)}()),h=[]),i.length)throw function Aj(n){return new Ne(3504,xn)}();v.forEach((j,Q)=>{Object.keys(j).forEach(me=>{j[me]=this._driver.computeStyle(Q,me,ts)})});const L=Us(h.map(j=>{const Q=v.get(j.element);return this._buildPlayer(j,{},Q)}));return this._playersById[e]=L,L.onDestroy(()=>this.destroy(e)),this.players.push(L),L}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const r=this.players.indexOf(t);r>=0&&this.players.splice(r,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw function Tj(n){return new Ne(3301,xn)}();return t}listen(e,t,r,i){const a=Lv(t,"","","");return kv(this._getPlayer(e),r,a,i),()=>{}}command(e,t,r,i){if("register"==r)return void this.register(e,i[0]);if("create"==r)return void this.create(e,t,i[0]||{});const a=this._getPlayer(e);switch(r){case"play":a.play();break;case"pause":a.pause();break;case"reset":a.reset();break;case"restart":a.restart();break;case"finish":a.finish();break;case"init":a.init();break;case"setPosition":a.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e)}}}const yS="ng-animate-queued",Jv="ng-animate-disabled",A$=[],bS={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},T$={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Ki="__ng_removed";class e1{constructor(e,t=""){this.namespaceId=t;const r=e&&e.hasOwnProperty("value");if(this.value=function O$(n){return null!=n?n:null}(r?e.value:e),r){const a=kl(e);delete a.value,this.options=a}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const r=this.options.params;Object.keys(t).forEach(i=>{null==r[i]&&(r[i]=t[i])})}}}const Mc="void",t1=new e1(Mc);class D${constructor(e,t,r){this.id=e,this.hostElement=t,this._engine=r,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,qi(t,this._hostClassName)}listen(e,t,r,i){if(!this._triggers.hasOwnProperty(t))throw function Dj(n,e){return new Ne(3302,xn)}();if(null==r||0==r.length)throw function Ij(n){return new Ne(3303,xn)}();if(!function P$(n){return"start"==n||"done"==n}(r))throw function Rj(n,e){return new Ne(3400,xn)}();const a=Ri(this._elementListeners,e,[]),h={name:t,phase:r,callback:i};a.push(h);const v=Ri(this._engine.statesByElement,e,{});return v.hasOwnProperty(t)||(qi(e,ad),qi(e,ad+"-"+t),v[t]=t1),()=>{this._engine.afterFlush(()=>{const D=a.indexOf(h);D>=0&&a.splice(D,1),this._triggers[t]||delete v[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw function Oj(n){return new Ne(3401,xn)}();return t}trigger(e,t,r,i=!0){const a=this._getTrigger(t),h=new n1(this.id,t,e);let v=this._engine.statesByElement.get(e);v||(qi(e,ad),qi(e,ad+"-"+t),this._engine.statesByElement.set(e,v={}));let D=v[t];const L=new e1(r,this.id);if(!(r&&r.hasOwnProperty("value"))&&D&&L.absorbOptions(D.options),v[t]=L,D||(D=t1),L.value!==Mc&&D.value===L.value){if(!function B$(n,e){const t=Object.keys(n),r=Object.keys(e);if(t.length!=r.length)return!1;for(let i=0;i{wa(e,je),$o(e,gt)})}return}const me=Ri(this._engine.playersByElement,e,[]);me.forEach(Ve=>{Ve.namespaceId==this.id&&Ve.triggerName==t&&Ve.queued&&Ve.destroy()});let ye=a.matchTransition(D.value,L.value,e,L.params),Te=!1;if(!ye){if(!i)return;ye=a.fallbackTransition,Te=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:ye,fromState:D,toState:L,player:h,isFallbackTransition:Te}),Te||(qi(e,yS),h.onStart(()=>{Bl(e,yS)})),h.onDone(()=>{let Ve=this.players.indexOf(h);Ve>=0&&this.players.splice(Ve,1);const je=this._engine.playersByElement.get(e);if(je){let gt=je.indexOf(h);gt>=0&&je.splice(gt,1)}}),this.players.push(h),me.push(h),h}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,r)=>{delete t[e]}),this._elementListeners.forEach((t,r)=>{this._elementListeners.set(r,t.filter(i=>i.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(r=>r.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const r=this._engine.driver.query(e,ld,!0);r.forEach(i=>{if(i[Ki])return;const a=this._engine.fetchNamespacesByElement(i);a.size?a.forEach(h=>h.triggerLeaveAnimation(i,t,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>r.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,r,i){const a=this._engine.statesByElement.get(e),h=new Map;if(a){const v=[];if(Object.keys(a).forEach(D=>{if(h.set(D,a[D].value),this._triggers[D]){const L=this.trigger(e,D,Mc,i);L&&v.push(L)}}),v.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,h),r&&Us(v).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),r=this._engine.statesByElement.get(e);if(t&&r){const i=new Set;t.forEach(a=>{const h=a.name;if(i.has(h))return;i.add(h);const D=this._triggers[h].fallbackTransition,L=r[h]||t1,j=new e1(Mc),Q=new n1(this.id,h,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:h,transition:D,fromState:L,toState:j,player:Q,isFallbackTransition:!0})})}}removeNode(e,t){const r=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(r.totalAnimations){const a=r.players.length?r.playersByQueriedElement.get(e):[];if(a&&a.length)i=!0;else{let h=e;for(;h=h.parentNode;)if(r.statesByElement.get(h)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)r.markElementAsRemoved(this.id,e,!1,t);else{const a=e[Ki];(!a||a===bS)&&(r.afterFlush(()=>this.clearElementCache(e)),r.destroyInnerAnimations(e),r._onRemovalComplete(e,t))}}insertNode(e,t){qi(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(r=>{const i=r.player;if(i.destroyed)return;const a=r.element,h=this._elementListeners.get(a);h&&h.forEach(v=>{if(v.name==r.triggerName){const D=Lv(a,r.triggerName,r.fromState.value,r.toState.value);D._data=e,kv(r.player,v.phase,D,v.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(r)}),this._queue=[],t.sort((r,i)=>{const a=r.transition.ast.depCount,h=i.transition.ast.depCount;return 0==a||0==h?a-h:this._engine.driver.containsElement(r.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(r=>r.element===e)||t,t}}class I${constructor(e,t,r){this.bodyNode=e,this.driver=t,this._normalizer=r,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(i,a)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(r=>{r.queued&&e.push(r)})}),e}createNamespace(e,t){const r=new D$(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(r,t):(this.newHostElements.set(t,r),this.collectEnterElement(t)),this._namespaceLookup[e]=r}_balanceNamespaceList(e,t){const r=this._namespaceList,i=this.namespacesByHostElement,a=r.length-1;if(a>=0){let h=!1;if(void 0!==this.driver.getParentElement){let v=this.driver.getParentElement(t);for(;v;){const D=i.get(v);if(D){const L=r.indexOf(D);r.splice(L+1,0,e),h=!0;break}v=this.driver.getParentElement(v)}}else for(let v=a;v>=0;v--)if(this.driver.containsElement(r[v].hostElement,t)){r.splice(v+1,0,e),h=!0;break}h||r.unshift(e)}else r.push(e);return i.set(t,e),e}register(e,t){let r=this._namespaceLookup[e];return r||(r=this.createNamespace(e,t)),r}registerTrigger(e,t,r){let i=this._namespaceLookup[e];i&&i.register(t,r)&&this.totalAnimations++}destroy(e,t){if(!e)return;const r=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(r.hostElement),delete this._namespaceLookup[e];const i=this._namespaceList.indexOf(r);i>=0&&this._namespaceList.splice(i,1)}),this.afterFlushAnimationsDone(()=>r.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,r=this.statesByElement.get(e);if(r){const i=Object.keys(r);for(let a=0;a=0&&this.collectedLeaveElements.splice(h,1)}if(e){const h=this._fetchNamespace(e);h&&h.insertNode(t,r)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),qi(e,Jv)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Bl(e,Jv))}removeNode(e,t,r,i){if(wd(t)){const a=e?this._fetchNamespace(e):null;if(a?a.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i),r){const h=this.namespacesByHostElement.get(t);h&&h.id!==e&&h.removeNode(t,i)}}else this._onRemovalComplete(t,i)}markElementAsRemoved(e,t,r,i,a){this.collectedLeaveElements.push(t),t[Ki]={namespaceId:e,setForRemoval:i,hasAnimation:r,removedBeforeQueried:!1,previousTriggersValues:a}}listen(e,t,r,i,a){return wd(t)?this._fetchNamespace(e).listen(t,r,i,a):()=>{}}_buildInstruction(e,t,r,i,a){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,r,i,e.fromState.options,e.toState.options,t,a)}destroyInnerAnimations(e){let t=this.driver.query(e,ld,!0);t.forEach(r=>this.destroyActiveAnimationsForElement(r)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,jv,!0),t.forEach(r=>this.finishActiveQueriedAnimationOnElement(r)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(r=>{r.queued?r.markedForDestroy=!0:r.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(r=>r.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Us(this.players).onDone(()=>e());e()})}processLeaveNode(e){var t;const r=e[Ki];if(r&&r.setForRemoval){if(e[Ki]=bS,r.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,r.setForRemoval)}(null===(t=e.classList)||void 0===t?void 0:t.contains(Jv))&&this.markElementAsDisabled(e,!1),this.driver.query(e,".ng-animate-disabled",!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((r,i)=>this._balanceNamespaceList(r,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let r=0;rr()),this._flushFns=[],this._whenQuietFns.length){const r=this._whenQuietFns;this._whenQuietFns=[],t.length?Us(t).onDone(()=>{r.forEach(i=>i())}):r.forEach(i=>i())}}reportError(e){throw function Pj(n){return new Ne(3402,xn)}()}_flushAnimations(e,t){const r=new yd,i=[],a=new Map,h=[],v=new Map,D=new Map,L=new Map,j=new Set;this.disabledNodes.forEach(Fe=>{j.add(Fe);const Ke=this.driver.query(Fe,".ng-animate-queued",!0);for(let qe=0;qe{const qe=Vv+Ve++;Te.set(Ke,qe),Fe.forEach(yt=>qi(yt,qe))});const je=[],gt=new Set,Ie=new Set;for(let Fe=0;Fegt.add(yt)):Ie.add(Ke))}const _t=new Map,At=MS(me,Array.from(gt));At.forEach((Fe,Ke)=>{const qe=sd+Ve++;_t.set(Ke,qe),Fe.forEach(yt=>qi(yt,qe))}),e.push(()=>{ye.forEach((Fe,Ke)=>{const qe=Te.get(Ke);Fe.forEach(yt=>Bl(yt,qe))}),At.forEach((Fe,Ke)=>{const qe=_t.get(Ke);Fe.forEach(yt=>Bl(yt,qe))}),je.forEach(Fe=>{this.processLeaveNode(Fe)})});const Nt=[],Vt=[];for(let Fe=this._namespaceList.length-1;Fe>=0;Fe--)this._namespaceList[Fe].drainQueuedTransitions(t).forEach(qe=>{const yt=qe.player,Dt=qe.element;if(Nt.push(yt),this.collectedEnterElements.length){const In=Dt[Ki];if(In&&In.setForMove){if(In.previousTriggersValues&&In.previousTriggersValues.has(qe.triggerName)){const Wi=In.previousTriggersValues.get(qe.triggerName),Zi=this.statesByElement.get(qe.element);Zi&&Zi[qe.triggerName]&&(Zi[qe.triggerName].value=Wi)}return void yt.destroy()}}const Pt=!Q||!this.driver.containsElement(Q,Dt),Yt=_t.get(Dt),On=Te.get(Dt),an=this._buildInstruction(qe,r,On,Yt,Pt);if(an.errors&&an.errors.length)return void Vt.push(an);if(Pt)return yt.onStart(()=>wa(Dt,an.fromStyles)),yt.onDestroy(()=>$o(Dt,an.toStyles)),void i.push(yt);if(qe.isFallbackTransition)return yt.onStart(()=>wa(Dt,an.fromStyles)),yt.onDestroy(()=>$o(Dt,an.toStyles)),void i.push(yt);const Sn=[];an.timelines.forEach(In=>{In.stretchStartingKeyframe=!0,this.disabledNodes.has(In.element)||Sn.push(In)}),an.timelines=Sn,r.append(Dt,an.timelines),h.push({instruction:an,player:yt,element:Dt}),an.queriedElements.forEach(In=>Ri(v,In,[]).push(yt)),an.preStyleProps.forEach((In,Wi)=>{const Zi=Object.keys(In);if(Zi.length){let Eo=D.get(Wi);Eo||D.set(Wi,Eo=new Set),Zi.forEach(yi=>Eo.add(yi))}}),an.postStyleProps.forEach((In,Wi)=>{const Zi=Object.keys(In);let Eo=L.get(Wi);Eo||L.set(Wi,Eo=new Set),Zi.forEach(yi=>Eo.add(yi))})});if(Vt.length){const Fe=[];Vt.forEach(Ke=>{Fe.push(function Nj(n,e){return new Ne(3505,xn)}())}),Nt.forEach(Ke=>Ke.destroy()),this.reportError(Fe)}const Zt=new Map,Se=new Map;h.forEach(Fe=>{const Ke=Fe.element;r.has(Ke)&&(Se.set(Ke,Ke),this._beforeAnimationBuild(Fe.player.namespaceId,Fe.instruction,Zt))}),i.forEach(Fe=>{const Ke=Fe.element;this._getPreviousPlayers(Ke,!1,Fe.namespaceId,Fe.triggerName,null).forEach(yt=>{Ri(Zt,Ke,[]).push(yt),yt.destroy()})});const De=je.filter(Fe=>xS(Fe,D,L)),ke=new Map;wS(ke,this.driver,Ie,L,ts).forEach(Fe=>{xS(Fe,D,L)&&De.push(Fe)});const Qe=new Map;ye.forEach((Fe,Ke)=>{wS(Qe,this.driver,new Set(Fe),D,"!")}),De.forEach(Fe=>{const Ke=ke.get(Fe),qe=Qe.get(Fe);ke.set(Fe,Object.assign(Object.assign({},Ke),qe))});const st=[],vt=[],Ze={};h.forEach(Fe=>{const{element:Ke,player:qe,instruction:yt}=Fe;if(r.has(Ke)){if(j.has(Ke))return qe.onDestroy(()=>$o(Ke,yt.toStyles)),qe.disabled=!0,qe.overrideTotalTime(yt.totalTime),void i.push(qe);let Dt=Ze;if(Se.size>1){let Yt=Ke;const On=[];for(;Yt=Yt.parentNode;){const an=Se.get(Yt);if(an){Dt=an;break}On.push(Yt)}On.forEach(an=>Se.set(an,Dt))}const Pt=this._buildAnimation(qe.namespaceId,yt,Zt,a,Qe,ke);if(qe.setRealPlayer(Pt),Dt===Ze)st.push(qe);else{const Yt=this.playersByElement.get(Dt);Yt&&Yt.length&&(qe.parentPlayer=Us(Yt)),i.push(qe)}}else wa(Ke,yt.fromStyles),qe.onDestroy(()=>$o(Ke,yt.toStyles)),vt.push(qe),j.has(Ke)&&i.push(qe)}),vt.forEach(Fe=>{const Ke=a.get(Fe.element);if(Ke&&Ke.length){const qe=Us(Ke);Fe.setRealPlayer(qe)}}),i.forEach(Fe=>{Fe.parentPlayer?Fe.syncPlayerEvents(Fe.parentPlayer):Fe.destroy()});for(let Fe=0;Fe!Pt.destroyed);Dt.length?N$(this,Ke,Dt):this.processLeaveNode(Ke)}return je.length=0,st.forEach(Fe=>{this.players.push(Fe),Fe.onDone(()=>{Fe.destroy();const Ke=this.players.indexOf(Fe);this.players.splice(Ke,1)}),Fe.play()}),st}elementContainsData(e,t){let r=!1;const i=t[Ki];return i&&i.setForRemoval&&(r=!0),this.playersByElement.has(t)&&(r=!0),this.playersByQueriedElement.has(t)&&(r=!0),this.statesByElement.has(t)&&(r=!0),this._fetchNamespace(e).elementContainsData(t)||r}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,r,i,a){let h=[];if(t){const v=this.playersByQueriedElement.get(e);v&&(h=v)}else{const v=this.playersByElement.get(e);if(v){const D=!a||a==Mc;v.forEach(L=>{L.queued||!D&&L.triggerName!=i||h.push(L)})}}return(r||i)&&(h=h.filter(v=>!(r&&r!=v.namespaceId||i&&i!=v.triggerName))),h}_beforeAnimationBuild(e,t,r){const a=t.element,h=t.isRemovalTransition?void 0:e,v=t.isRemovalTransition?void 0:t.triggerName;for(const D of t.timelines){const L=D.element,j=L!==a,Q=Ri(r,L,[]);this._getPreviousPlayers(L,j,h,v,t.toState).forEach(ye=>{const Te=ye.getRealPlayer();Te.beforeDestroy&&Te.beforeDestroy(),ye.destroy(),Q.push(ye)})}wa(a,t.fromStyles)}_buildAnimation(e,t,r,i,a,h){const v=t.triggerName,D=t.element,L=[],j=new Set,Q=new Set,me=t.timelines.map(Te=>{const Ve=Te.element;j.add(Ve);const je=Ve[Ki];if(je&&je.removedBeforeQueried)return new Bu(Te.duration,Te.delay);const gt=Ve!==D,Ie=function k$(n){const e=[];return ES(n,e),e}((r.get(Ve)||A$).map(Zt=>Zt.getRealPlayer())).filter(Zt=>!!Zt.element&&Zt.element===Ve),_t=a.get(Ve),At=h.get(Ve),Nt=Z6(0,this._normalizer,0,Te.keyframes,_t,At),Vt=this._buildPlayer(Te,Nt,Ie);if(Te.subTimeline&&i&&Q.add(Ve),gt){const Zt=new n1(e,v,Ve);Zt.setRealPlayer(Vt),L.push(Zt)}return Vt});L.forEach(Te=>{Ri(this.playersByQueriedElement,Te.element,[]).push(Te),Te.onDone(()=>function R$(n,e,t){let r;if(n instanceof Map){if(r=n.get(e),r){if(r.length){const i=r.indexOf(t);r.splice(i,1)}0==r.length&&n.delete(e)}}else if(r=n[e],r){if(r.length){const i=r.indexOf(t);r.splice(i,1)}0==r.length&&delete n[e]}return r}(this.playersByQueriedElement,Te.element,Te))}),j.forEach(Te=>qi(Te,oS));const ye=Us(me);return ye.onDestroy(()=>{j.forEach(Te=>Bl(Te,oS)),$o(D,t.toStyles)}),Q.forEach(Te=>{Ri(i,Te,[]).push(ye)}),ye}_buildPlayer(e,t,r){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,r):new Bu(e.duration,e.delay)}}class n1{constructor(e,t,r){this.namespaceId=e,this.triggerName=t,this.element=r,this._player=new Bu,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(r=>kv(e,t,void 0,r))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){Ri(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function wd(n){return n&&1===n.nodeType}function _S(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function wS(n,e,t,r,i){const a=[];t.forEach(D=>a.push(_S(D)));const h=[];r.forEach((D,L)=>{const j={};D.forEach(Q=>{const me=j[Q]=e.computeStyle(L,Q,i);(!me||0==me.length)&&(L[Ki]=T$,h.push(L))}),n.set(L,j)});let v=0;return t.forEach(D=>_S(D,a[v++])),h}function MS(n,e){const t=new Map;if(n.forEach(v=>t.set(v,[])),0==e.length)return t;const i=new Set(e),a=new Map;function h(v){if(!v)return 1;let D=a.get(v);if(D)return D;const L=v.parentNode;return D=t.has(L)?L:i.has(L)?1:h(L),a.set(v,D),D}return e.forEach(v=>{const D=h(v);1!==D&&t.get(D).push(v)}),t}function qi(n,e){var t;null===(t=n.classList)||void 0===t||t.add(e)}function Bl(n,e){var t;null===(t=n.classList)||void 0===t||t.remove(e)}function N$(n,e,t){Us(t).onDone(()=>n.processLeaveNode(e))}function ES(n,e){for(let t=0;ti.add(a)):e.set(n,r),t.delete(n),!0}class Md{constructor(e,t,r){this.bodyNode=e,this._driver=t,this._normalizer=r,this._triggerCache={},this.onRemovalComplete=(i,a)=>{},this._transitionEngine=new I$(e,t,r),this._timelineEngine=new M$(e,t,r),this._transitionEngine.onRemovalComplete=(i,a)=>this.onRemovalComplete(i,a)}registerTrigger(e,t,r,i,a){const h=e+"-"+i;let v=this._triggerCache[h];if(!v){const D=[],j=Kv(this._driver,a,D,[]);if(D.length)throw function Ej(n,e){return new Ne(3404,xn)}();v=function y$(n,e,t){return new b$(n,e,t)}(i,j,this._normalizer),this._triggerCache[h]=v}this._transitionEngine.registerTrigger(t,i,v)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,r,i){this._transitionEngine.insertNode(e,t,r,i)}onRemove(e,t,r,i){this._transitionEngine.removeNode(e,t,i||!1,r)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,r,i){if("@"==r.charAt(0)){const[a,h]=X6(r);this._timelineEngine.command(a,t,h,i)}else this._transitionEngine.trigger(e,t,r,i)}listen(e,t,r,i,a){if("@"==r.charAt(0)){const[h,v]=X6(r);return this._timelineEngine.listen(h,t,v,a)}return this._transitionEngine.listen(e,t,r,i,a)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}let F$=(()=>{class n{constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i,this._state=0;let a=n.initialStylesByElement.get(t);a||n.initialStylesByElement.set(t,a={}),this._initialStyles=a}start(){this._state<1&&(this._startStyles&&$o(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&($o(this._element,this._initialStyles),this._endStyles&&($o(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(wa(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(wa(this._element,this._endStyles),this._endStyles=null),$o(this._element,this._initialStyles),this._state=3)}}return n.initialStylesByElement=new WeakMap,n})();function r1(n){let e=null;const t=Object.keys(n);for(let r=0;re()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,r){return e.animate(t,r)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};if(this.hasStarted()){const t=this._finalKeyframe;Object.keys(t).forEach(r=>{"offset"!=r&&(e[r]=this._finished?t[r]:cS(this.element,r))})}this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class H${validateStyleProperty(e){return eS(e)}matchesElement(e,t){return!1}containsElement(e,t){return tS(e,t)}getParentElement(e){return Uv(e)}query(e,t,r){return nS(e,t,r)}computeStyle(e,t,r){return window.getComputedStyle(e)[t]}animate(e,t,r,i,a,h=[]){const D={duration:r,delay:i,fill:0==i?"both":"forwards"};a&&(D.easing=a);const L={},j=h.filter(me=>me instanceof SS);(function zj(n,e){return 0===n||0===e})(r,i)&&j.forEach(me=>{let ye=me.currentSnapshot;Object.keys(ye).forEach(Te=>L[Te]=ye[Te])}),t=function Gj(n,e,t){const r=Object.keys(t);if(r.length&&e.length){let a=e[0],h=[];if(r.forEach(v=>{a.hasOwnProperty(v)||h.push(v),a[v]=t[v]}),h.length)for(var i=1;iHs(me,!1)),L);const Q=function L$(n,e){let t=null,r=null;return Array.isArray(e)&&e.length?(t=r1(e[0]),e.length>1&&(r=r1(e[e.length-1]))):e&&(t=r1(e)),t||r?new F$(n,t,r):null}(e,t);return new SS(e,t,D,Q)}}let V$=(()=>{class n extends bM{constructor(t,r){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(r.body,{id:"0",encapsulation:Qi.None,styles:[],data:{animation:[]}})}build(t){const r=this._nextAnimationId.toString();this._nextAnimationId++;const i=Array.isArray(t)?wM(t):t;return CS(this._renderer,null,r,"register",[i]),new j$(r,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(Mt(Qs),Mt(wr))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class j$ extends class C7{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new $$(this._id,e,t||{},this._renderer)}}class $${constructor(e,t,r,i){this.id=e,this.element=t,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",r)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return CS(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function CS(n,e,t,r,i){return n.setProperty(e,`@@${t}:${r}`,i)}const AS="@.disabled";let z$=(()=>{class n{constructor(t,r,i){this.delegate=t,this.engine=r,this._zone=i,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),r.onRemovalComplete=(a,h)=>{const v=null==h?void 0:h.parentNode(a);v&&h.removeChild(v,a)}}createRenderer(t,r){const a=this.delegate.createRenderer(t,r);if(!(t&&r&&r.data&&r.data.animation)){let j=this._rendererCache.get(a);return j||(j=new TS("",a,this.engine),this._rendererCache.set(a,j)),j}const h=r.id,v=r.id+"-"+this._currentId;this._currentId++,this.engine.register(v,t);const D=j=>{Array.isArray(j)?j.forEach(D):this.engine.registerTrigger(h,v,t,j.name,j)};return r.data.animation.forEach(D),new G$(this,v,a,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,r,i){t>=0&&tr(i)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(a=>{const[h,v]=a;h(v)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([r,i]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return n.\u0275fac=function(t){return new(t||n)(Mt(Qs),Mt(Md),Mt(or))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();class TS{constructor(e,t,r){this.namespaceId=e,this.delegate=t,this.engine=r,this.destroyNode=this.delegate.destroyNode?i=>t.destroyNode(i):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,r,i=!0){this.delegate.insertBefore(e,t,r),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,r){this.engine.onRemove(this.namespaceId,t,this.delegate,r)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,r,i){this.delegate.setAttribute(e,t,r,i)}removeAttribute(e,t,r){this.delegate.removeAttribute(e,t,r)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,r,i){this.delegate.setStyle(e,t,r,i)}removeStyle(e,t,r){this.delegate.removeStyle(e,t,r)}setProperty(e,t,r){"@"==t.charAt(0)&&t==AS?this.disableAnimations(e,!!r):this.delegate.setProperty(e,t,r)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,r){return this.delegate.listen(e,t,r)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class G$ extends TS{constructor(e,t,r,i){super(t,r,i),this.factory=e,this.namespaceId=t}setProperty(e,t,r){"@"==t.charAt(0)?"."==t.charAt(1)&&t==AS?this.disableAnimations(e,r=void 0===r||!!r):this.engine.process(this.namespaceId,e,t.substr(1),r):this.delegate.setProperty(e,t,r)}listen(e,t,r){if("@"==t.charAt(0)){const i=function K$(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let a=t.substr(1),h="";return"@"!=a.charAt(0)&&([a,h]=function q$(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(a)),this.engine.listen(this.namespaceId,i,a,h,v=>{this.factory.scheduleListenerCallback(v._data||-1,r,v)})}return this.delegate.listen(e,t,r)}}let W$=(()=>{class n extends Md{constructor(t,r,i){super(t.body,r,i)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(Mt(wr),Mt(Hv),Mt(Yv))},n.\u0275prov=xt({token:n,factory:n.\u0275fac}),n})();const DS=new Kt("AnimationModuleType"),IS=[{provide:bM,useClass:V$},{provide:Yv,useFactory:function Z$(){return new d$}},{provide:Md,useClass:W$},{provide:Qs,useFactory:function X$(n,e,t){return new z$(n,e,t)},deps:[qf,Md,or]}],RS=[{provide:Hv,useFactory:()=>new H$},{provide:DS,useValue:"BrowserAnimations"},...IS],Y$=[{provide:Hv,useClass:rS},{provide:DS,useValue:"NoopAnimations"},...IS];let Q$=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Y$:RS}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({providers:RS,imports:[gM]}),n})();const OS="400ms cubic-bezier(0.4,0.0,0.2,1)";Ci({height:0,visibility:"hidden"}),pl(OS,Ci({height:"*",visibility:"visible"})),Ci({height:"*",visibility:"visible"}),pl(OS,Ci({height:0,visibility:"hidden"}));let PS=(()=>{class n{static forRoot(){return{ngModule:n,providers:[]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({}),n})(),ez=(()=>{class n{static forRoot(){return{ngModule:n,providers:[]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n}),n.\u0275inj=jt({imports:[[Pu,PS]]}),n})(),tz=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=_r({type:n,bootstrap:[tj]}),n.\u0275inj=jt({providers:[],imports:[[gM,ZN,vk,UL,Q$,UB.forRoot(),ez.forRoot(),PS.forRoot(),cP.forRoot(),WH,TV.forRoot(),gF.forRoot()]]}),n})();(function DI(){M2=!1})(),p7().bootstrapModule(tz).catch(n=>console.error(n))},4502:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(8046);function M(d,m,w){return void 0===m&&(m=new Uint8Array(2)),void 0===w&&(w=0),m[w+0]=d>>>8,m[w+1]=d>>>0,m}function _(d,m,w){return void 0===m&&(m=new Uint8Array(2)),void 0===w&&(w=0),m[w+0]=d>>>0,m[w+1]=d>>>8,m}function b(d,m){return void 0===m&&(m=0),d[m]<<24|d[m+1]<<16|d[m+2]<<8|d[m+3]}function C(d,m){return void 0===m&&(m=0),(d[m]<<24|d[m+1]<<16|d[m+2]<<8|d[m+3])>>>0}function x(d,m){return void 0===m&&(m=0),d[m+3]<<24|d[m+2]<<16|d[m+1]<<8|d[m]}function E(d,m){return void 0===m&&(m=0),(d[m+3]<<24|d[m+2]<<16|d[m+1]<<8|d[m])>>>0}function P(d,m,w){return void 0===m&&(m=new Uint8Array(4)),void 0===w&&(w=0),m[w+0]=d>>>24,m[w+1]=d>>>16,m[w+2]=d>>>8,m[w+3]=d>>>0,m}function A(d,m,w){return void 0===m&&(m=new Uint8Array(4)),void 0===w&&(w=0),m[w+0]=d>>>0,m[w+1]=d>>>8,m[w+2]=d>>>16,m[w+3]=d>>>24,m}function V(d,m,w){return void 0===m&&(m=new Uint8Array(8)),void 0===w&&(w=0),P(d/4294967296>>>0,m,w),P(d>>>0,m,w+4),m}function G(d,m,w){return void 0===m&&(m=new Uint8Array(8)),void 0===w&&(w=0),A(d>>>0,m,w),A(d/4294967296>>>0,m,w+4),m}F.readInt16BE=function B(d,m){return void 0===m&&(m=0),(d[m+0]<<8|d[m+1])<<16>>16},F.readUint16BE=function S(d,m){return void 0===m&&(m=0),(d[m+0]<<8|d[m+1])>>>0},F.readInt16LE=function T(d,m){return void 0===m&&(m=0),(d[m+1]<<8|d[m])<<16>>16},F.readUint16LE=function f(d,m){return void 0===m&&(m=0),(d[m+1]<<8|d[m])>>>0},F.writeUint16BE=M,F.writeInt16BE=M,F.writeUint16LE=_,F.writeInt16LE=_,F.readInt32BE=b,F.readUint32BE=C,F.readInt32LE=x,F.readUint32LE=E,F.writeUint32BE=P,F.writeInt32BE=P,F.writeUint32LE=A,F.writeInt32LE=A,F.readInt64BE=function O(d,m){void 0===m&&(m=0);var w=b(d,m),p=b(d,m+4);return 4294967296*w+p-4294967296*(p>>31)},F.readUint64BE=function N(d,m){return void 0===m&&(m=0),4294967296*C(d,m)+C(d,m+4)},F.readInt64LE=function U(d,m){void 0===m&&(m=0);var w=x(d,m);return 4294967296*x(d,m+4)+w-4294967296*(w>>31)},F.readUint64LE=function H(d,m){void 0===m&&(m=0);var w=E(d,m);return 4294967296*E(d,m+4)+w},F.writeUint64BE=V,F.writeInt64BE=V,F.writeUint64LE=G,F.writeInt64LE=G,F.readUintBE=function K(d,m,w){if(void 0===w&&(w=0),d%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(d/8>m.length-w)throw new Error("readUintBE: array is too short for the given bitLength");for(var p=0,s=1,g=d/8+w-1;g>=w;g--)p+=m[g]*s,s*=256;return p},F.readUintLE=function X(d,m,w){if(void 0===w&&(w=0),d%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(d/8>m.length-w)throw new Error("readUintLE: array is too short for the given bitLength");for(var p=0,s=1,g=w;g=p;g--)w[g]=m/s&255,s*=256;return w},F.writeUintLE=function z(d,m,w,p){if(void 0===w&&(w=new Uint8Array(d/8)),void 0===p&&(p=0),d%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!R.isSafeInteger(m))throw new Error("writeUintLE value must be an integer");for(var s=1,g=p;g{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(4502),B=I(9815);F.BLOCK_SIZE=128,F.DIGEST_LENGTH=64,F.KEY_LENGTH=64,F.PERSONALIZATION_LENGTH=16,F.SALT_LENGTH=16,F.MAX_LEAF_SIZE=Math.pow(2,32)-1,F.MAX_FANOUT=255,F.MAX_MAX_DEPTH=255;var S=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),T=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],f=function(){function _(b,C){if(void 0===b&&(b=64),this.digestLength=b,this.blockSize=F.BLOCK_SIZE,this._state=new Int32Array(S),this._buffer=new Uint8Array(F.BLOCK_SIZE),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),b<1||b>F.DIGEST_LENGTH)throw new Error("blake2b: wrong digest length");C&&this.validateConfig(C);var x=0;C&&C.key&&(x=C.key.length);var E=1,P=1;C&&C.tree&&(E=C.tree.fanout,P=C.tree.maxDepth),this._state[0]^=b|x<<8|E<<16|P<<24,C&&C.tree&&(this._state[1]^=C.tree.leafSize,this._state[2]^=C.tree.nodeOffsetLowBits,this._state[3]^=C.tree.nodeOffsetHighBits,this._state[4]^=C.tree.nodeDepth|C.tree.innerDigestLength<<8,this._lastNode=C.tree.lastNode),C&&C.salt&&(this._state[8]^=R.readUint32LE(C.salt,0),this._state[9]^=R.readUint32LE(C.salt,4),this._state[10]^=R.readUint32LE(C.salt,8),this._state[11]^=R.readUint32LE(C.salt,12)),C&&C.personalization&&(this._state[12]^=R.readUint32LE(C.personalization,0),this._state[13]^=R.readUint32LE(C.personalization,4),this._state[14]^=R.readUint32LE(C.personalization,8),this._state[15]^=R.readUint32LE(C.personalization,12)),this._initialState=new Uint32Array(this._state),C&&C.key&&x>0&&(this._paddedKey=new Uint8Array(F.BLOCK_SIZE),this._paddedKey.set(C.key),this._buffer.set(this._paddedKey),this._bufferLength=F.BLOCK_SIZE)}return _.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=F.BLOCK_SIZE):this._bufferLength=0,B.wipe(this._ctr),B.wipe(this._flag),this._finished=!1,this},_.prototype.validateConfig=function(b){if(b.key&&b.key.length>F.KEY_LENGTH)throw new Error("blake2b: wrong key length");if(b.salt&&b.salt.length!==F.SALT_LENGTH)throw new Error("blake2b: wrong salt length");if(b.personalization&&b.personalization.length!==F.PERSONALIZATION_LENGTH)throw new Error("blake2b: wrong personalization length");if(b.tree){if(b.tree.fanout<0||b.tree.fanout>F.MAX_FANOUT)throw new Error("blake2b: wrong tree fanout");if(b.tree.maxDepth<0||b.tree.maxDepth>F.MAX_MAX_DEPTH)throw new Error("blake2b: wrong tree depth");if(b.tree.leafSize<0||b.tree.leafSize>F.MAX_LEAF_SIZE)throw new Error("blake2b: wrong leaf size");if(b.tree.innerDigestLength<0||b.tree.innerDigestLength>F.DIGEST_LENGTH)throw new Error("blake2b: wrong tree inner digest length")}},_.prototype.update=function(b,C){if(void 0===C&&(C=b.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var x=F.BLOCK_SIZE-this._bufferLength,E=0;if(0===C)return this;if(C>x){for(var P=0;PF.BLOCK_SIZE;){for(P=0;P>>16,u=65535&Z,d=Z>>>16;c+=z>>>16,u+=65535&J,d+=J>>>16,u+=(c+=(l+=65535&z)>>>16)>>>16,l=65535&(X=65535&l|c<<16),c=X>>>16,u=65535&(Z=65535&u|(d+=u>>>16)<<16),d=Z>>>16,c+=H>>>16,u+=65535&V,d+=V>>>16,X=65535&(l+=65535&H)|(c+=l>>>16)<<16,l=o^=Z=65535&(u+=c>>>16)|(d+=u>>>16)<<16,o=y^=X,y=l,l=65535&re,c=re>>>16,u=65535&ve,d=ve>>>16,c+=y>>>16,u+=65535&o,d+=o>>>16,l=(z^=re=65535&(l+=65535&y)|(c+=l>>>16)<<16)<<8|(J^=ve=65535&(u+=c>>>16)|(d+=u>>>16)<<16)>>>24,z=J<<8|z>>>24,J=l,l=65535&X,c=X>>>16,u=65535&Z,d=Z>>>16,c+=z>>>16,u+=65535&J,d+=J>>>16,u+=(c+=(l+=65535&z)>>>16)>>>16,l=65535&(X=65535&l|c<<16),c=X>>>16,u=65535&(Z=65535&u|(d+=u>>>16)<<16),d=Z>>>16,c+=G>>>16,u+=65535&K,d+=K>>>16,l=(y^=X=65535&(l+=65535&G)|(c+=l>>>16)<<16)<<16|(o^=Z=65535&(u+=c>>>16)|(d+=u>>>16)<<16)>>>16,y=o<<16|y>>>16,o=l,l=65535&re,c=re>>>16,u=65535&ve,d=ve>>>16,c+=y>>>16,u+=65535&o,d+=o>>>16,l=(J^=ve=65535&(u+=(c+=(l+=65535&y)>>>16)>>>16)|(d+=u>>>16)<<16)<<1|(z^=re=65535&l|c<<16)>>>31,z=z<<1|J>>>31,J=l,b[C]=X,b[A]=Z,b[x]=z,b[O]=J,b[E]=re,b[N]=ve,b[P]=y,b[U]=o},_.prototype._incrementCounter=function(b){for(var C=0;C<3;C++){var x=this._ctr[C]+b;if(this._ctr[C]=x>>>0,this._ctr[C]===x)return;b=1}},_.prototype._processBlock=function(b){this._incrementCounter(b);var C=this._vtmp;C.set(this._state),C.set(S,16),C[24]^=this._ctr[0],C[25]^=this._ctr[1],C[26]^=this._ctr[2],C[27]^=this._ctr[3],C[28]^=this._flag[0],C[29]^=this._flag[1],C[30]^=this._flag[2],C[31]^=this._flag[3];for(var x=this._mtmp,E=0;E<32;E++)x[E]=R.readUint32LE(this._buffer,4*E);for(var P=0;P<12;P++)this._G(C,0,8,16,24,1,9,17,25,x[T[P][0]],x[T[P][0]+1],x[T[P][1]],x[T[P][1]+1]),this._G(C,2,10,18,26,3,11,19,27,x[T[P][2]],x[T[P][2]+1],x[T[P][3]],x[T[P][3]+1]),this._G(C,4,12,20,28,5,13,21,29,x[T[P][4]],x[T[P][4]+1],x[T[P][5]],x[T[P][5]+1]),this._G(C,6,14,22,30,7,15,23,31,x[T[P][6]],x[T[P][6]+1],x[T[P][7]],x[T[P][7]+1]),this._G(C,0,10,20,30,1,11,21,31,x[T[P][8]],x[T[P][8]+1],x[T[P][9]],x[T[P][9]+1]),this._G(C,2,12,22,24,3,13,23,25,x[T[P][10]],x[T[P][10]+1],x[T[P][11]],x[T[P][11]+1]),this._G(C,4,14,16,26,5,15,17,27,x[T[P][12]],x[T[P][12]+1],x[T[P][13]],x[T[P][13]+1]),this._G(C,6,8,18,28,7,9,19,29,x[T[P][14]],x[T[P][14]+1],x[T[P][15]],x[T[P][15]+1]);for(E=0;E<16;E++)this._state[E]^=C[E]^C[E+16]},_}();F.BLAKE2b=f,F.hash=function M(_,b,C){void 0===b&&(b=F.DIGEST_LENGTH);var x=new f(b,C);x.update(_);var E=x.digest();return x.clean(),E}},8401:(ne,F)=>{"use strict";F.z=function R(){for(var B=0,S=0;S{"use strict";function B(T,f){if(T.length!==f.length)return 0;for(var M=0,_=0;_>>8}Object.defineProperty(F,"__esModule",{value:!0}),F.select=function I(T,f,M){return~(T-1)&f|T-1&M},F.lessOrEqual=function R(T,f){return(0|T)-(0|f)-1>>>31&1},F.compare=B,F.equal=function S(T,f){return 0!==T.length&&0!==f.length&&0!==B(T,f)}},5553:(ne,F,I)=>{"use strict";F.zh=F.SH=F.Xx=F._w=F.aP=F.KS=F.jQ=void 0;I(5784);const S=I(6375),T=I(9815);function f(fe){const se=new Float64Array(16);if(fe)for(let ce=0;ce>16&1),ce[_e-1]&=65535;ce[15]=ee[15]-32767-(ce[14]>>16&1);const ue=ce[15]>>16&1;ce[14]&=65535,U(ee,ce,1-ue)}for(let pe=0;pe<16;pe++)fe[2*pe]=255&ee[pe],fe[2*pe+1]=ee[pe]>>8}function G(fe,se){const ce=new Uint8Array(32),ee=new Uint8Array(32);return H(ce,fe),H(ee,se),function V(fe,se){let ce=0;for(let ee=0;ee<32;ee++)ce|=fe[ee]^se[ee];return(1&ce-1>>>8)-1}(ce,ee)}function K(fe){const se=new Uint8Array(32);return H(se,fe),1&se[0]}function Z(fe,se,ce){for(let ee=0;ee<16;ee++)fe[ee]=se[ee]+ce[ee]}function z(fe,se,ce){for(let ee=0;ee<16;ee++)fe[ee]=se[ee]-ce[ee]}function J(fe,se,ce){let ee,pe,ue=0,_e=0,Me=0,le=0,ie=0,Y=0,ae=0,Le=0,xe=0,Ce=0,Re=0,we=0,Oe=0,wt=0,Be=0,oe=0,te=0,W=0,de=0,Pe=0,Ee=0,Ae=0,St=0,Xe=0,Je=0,kt=0,Ye=0,tt=0,Dn=0,nt=0,ht=0,ln=ce[0],We=ce[1],ze=ce[2],un=ce[3],at=ce[4],Ne=ce[5],Xt=ce[6],$e=ce[7],et=ce[8],pn=ce[9],lt=ce[10],ut=ce[11],cn=ce[12],it=ce[13],ct=ce[14],gn=ce[15];ee=se[0],ue+=ee*ln,_e+=ee*We,Me+=ee*ze,le+=ee*un,ie+=ee*at,Y+=ee*Ne,ae+=ee*Xt,Le+=ee*$e,xe+=ee*et,Ce+=ee*pn,Re+=ee*lt,we+=ee*ut,Oe+=ee*cn,wt+=ee*it,Be+=ee*ct,oe+=ee*gn,ee=se[1],_e+=ee*ln,Me+=ee*We,le+=ee*ze,ie+=ee*un,Y+=ee*at,ae+=ee*Ne,Le+=ee*Xt,xe+=ee*$e,Ce+=ee*et,Re+=ee*pn,we+=ee*lt,Oe+=ee*ut,wt+=ee*cn,Be+=ee*it,oe+=ee*ct,te+=ee*gn,ee=se[2],Me+=ee*ln,le+=ee*We,ie+=ee*ze,Y+=ee*un,ae+=ee*at,Le+=ee*Ne,xe+=ee*Xt,Ce+=ee*$e,Re+=ee*et,we+=ee*pn,Oe+=ee*lt,wt+=ee*ut,Be+=ee*cn,oe+=ee*it,te+=ee*ct,W+=ee*gn,ee=se[3],le+=ee*ln,ie+=ee*We,Y+=ee*ze,ae+=ee*un,Le+=ee*at,xe+=ee*Ne,Ce+=ee*Xt,Re+=ee*$e,we+=ee*et,Oe+=ee*pn,wt+=ee*lt,Be+=ee*ut,oe+=ee*cn,te+=ee*it,W+=ee*ct,de+=ee*gn,ee=se[4],ie+=ee*ln,Y+=ee*We,ae+=ee*ze,Le+=ee*un,xe+=ee*at,Ce+=ee*Ne,Re+=ee*Xt,we+=ee*$e,Oe+=ee*et,wt+=ee*pn,Be+=ee*lt,oe+=ee*ut,te+=ee*cn,W+=ee*it,de+=ee*ct,Pe+=ee*gn,ee=se[5],Y+=ee*ln,ae+=ee*We,Le+=ee*ze,xe+=ee*un,Ce+=ee*at,Re+=ee*Ne,we+=ee*Xt,Oe+=ee*$e,wt+=ee*et,Be+=ee*pn,oe+=ee*lt,te+=ee*ut,W+=ee*cn,de+=ee*it,Pe+=ee*ct,Ee+=ee*gn,ee=se[6],ae+=ee*ln,Le+=ee*We,xe+=ee*ze,Ce+=ee*un,Re+=ee*at,we+=ee*Ne,Oe+=ee*Xt,wt+=ee*$e,Be+=ee*et,oe+=ee*pn,te+=ee*lt,W+=ee*ut,de+=ee*cn,Pe+=ee*it,Ee+=ee*ct,Ae+=ee*gn,ee=se[7],Le+=ee*ln,xe+=ee*We,Ce+=ee*ze,Re+=ee*un,we+=ee*at,Oe+=ee*Ne,wt+=ee*Xt,Be+=ee*$e,oe+=ee*et,te+=ee*pn,W+=ee*lt,de+=ee*ut,Pe+=ee*cn,Ee+=ee*it,Ae+=ee*ct,St+=ee*gn,ee=se[8],xe+=ee*ln,Ce+=ee*We,Re+=ee*ze,we+=ee*un,Oe+=ee*at,wt+=ee*Ne,Be+=ee*Xt,oe+=ee*$e,te+=ee*et,W+=ee*pn,de+=ee*lt,Pe+=ee*ut,Ee+=ee*cn,Ae+=ee*it,St+=ee*ct,Xe+=ee*gn,ee=se[9],Ce+=ee*ln,Re+=ee*We,we+=ee*ze,Oe+=ee*un,wt+=ee*at,Be+=ee*Ne,oe+=ee*Xt,te+=ee*$e,W+=ee*et,de+=ee*pn,Pe+=ee*lt,Ee+=ee*ut,Ae+=ee*cn,St+=ee*it,Xe+=ee*ct,Je+=ee*gn,ee=se[10],Re+=ee*ln,we+=ee*We,Oe+=ee*ze,wt+=ee*un,Be+=ee*at,oe+=ee*Ne,te+=ee*Xt,W+=ee*$e,de+=ee*et,Pe+=ee*pn,Ee+=ee*lt,Ae+=ee*ut,St+=ee*cn,Xe+=ee*it,Je+=ee*ct,kt+=ee*gn,ee=se[11],we+=ee*ln,Oe+=ee*We,wt+=ee*ze,Be+=ee*un,oe+=ee*at,te+=ee*Ne,W+=ee*Xt,de+=ee*$e,Pe+=ee*et,Ee+=ee*pn,Ae+=ee*lt,St+=ee*ut,Xe+=ee*cn,Je+=ee*it,kt+=ee*ct,Ye+=ee*gn,ee=se[12],Oe+=ee*ln,wt+=ee*We,Be+=ee*ze,oe+=ee*un,te+=ee*at,W+=ee*Ne,de+=ee*Xt,Pe+=ee*$e,Ee+=ee*et,Ae+=ee*pn,St+=ee*lt,Xe+=ee*ut,Je+=ee*cn,kt+=ee*it,Ye+=ee*ct,tt+=ee*gn,ee=se[13],wt+=ee*ln,Be+=ee*We,oe+=ee*ze,te+=ee*un,W+=ee*at,de+=ee*Ne,Pe+=ee*Xt,Ee+=ee*$e,Ae+=ee*et,St+=ee*pn,Xe+=ee*lt,Je+=ee*ut,kt+=ee*cn,Ye+=ee*it,tt+=ee*ct,Dn+=ee*gn,ee=se[14],Be+=ee*ln,oe+=ee*We,te+=ee*ze,W+=ee*un,de+=ee*at,Pe+=ee*Ne,Ee+=ee*Xt,Ae+=ee*$e,St+=ee*et,Xe+=ee*pn,Je+=ee*lt,kt+=ee*ut,Ye+=ee*cn,tt+=ee*it,Dn+=ee*ct,nt+=ee*gn,ee=se[15],oe+=ee*ln,te+=ee*We,W+=ee*ze,de+=ee*un,Pe+=ee*at,Ee+=ee*Ne,Ae+=ee*Xt,St+=ee*$e,Xe+=ee*et,Je+=ee*pn,kt+=ee*lt,Ye+=ee*ut,tt+=ee*cn,Dn+=ee*it,nt+=ee*ct,ht+=ee*gn,ue+=38*te,_e+=38*W,Me+=38*de,le+=38*Pe,ie+=38*Ee,Y+=38*Ae,ae+=38*St,Le+=38*Xe,xe+=38*Je,Ce+=38*kt,Re+=38*Ye,we+=38*tt,Oe+=38*Dn,wt+=38*nt,Be+=38*ht,pe=1,ee=ue+pe+65535,pe=Math.floor(ee/65536),ue=ee-65536*pe,ee=_e+pe+65535,pe=Math.floor(ee/65536),_e=ee-65536*pe,ee=Me+pe+65535,pe=Math.floor(ee/65536),Me=ee-65536*pe,ee=le+pe+65535,pe=Math.floor(ee/65536),le=ee-65536*pe,ee=ie+pe+65535,pe=Math.floor(ee/65536),ie=ee-65536*pe,ee=Y+pe+65535,pe=Math.floor(ee/65536),Y=ee-65536*pe,ee=ae+pe+65535,pe=Math.floor(ee/65536),ae=ee-65536*pe,ee=Le+pe+65535,pe=Math.floor(ee/65536),Le=ee-65536*pe,ee=xe+pe+65535,pe=Math.floor(ee/65536),xe=ee-65536*pe,ee=Ce+pe+65535,pe=Math.floor(ee/65536),Ce=ee-65536*pe,ee=Re+pe+65535,pe=Math.floor(ee/65536),Re=ee-65536*pe,ee=we+pe+65535,pe=Math.floor(ee/65536),we=ee-65536*pe,ee=Oe+pe+65535,pe=Math.floor(ee/65536),Oe=ee-65536*pe,ee=wt+pe+65535,pe=Math.floor(ee/65536),wt=ee-65536*pe,ee=Be+pe+65535,pe=Math.floor(ee/65536),Be=ee-65536*pe,ee=oe+pe+65535,pe=Math.floor(ee/65536),oe=ee-65536*pe,ue+=pe-1+37*(pe-1),pe=1,ee=ue+pe+65535,pe=Math.floor(ee/65536),ue=ee-65536*pe,ee=_e+pe+65535,pe=Math.floor(ee/65536),_e=ee-65536*pe,ee=Me+pe+65535,pe=Math.floor(ee/65536),Me=ee-65536*pe,ee=le+pe+65535,pe=Math.floor(ee/65536),le=ee-65536*pe,ee=ie+pe+65535,pe=Math.floor(ee/65536),ie=ee-65536*pe,ee=Y+pe+65535,pe=Math.floor(ee/65536),Y=ee-65536*pe,ee=ae+pe+65535,pe=Math.floor(ee/65536),ae=ee-65536*pe,ee=Le+pe+65535,pe=Math.floor(ee/65536),Le=ee-65536*pe,ee=xe+pe+65535,pe=Math.floor(ee/65536),xe=ee-65536*pe,ee=Ce+pe+65535,pe=Math.floor(ee/65536),Ce=ee-65536*pe,ee=Re+pe+65535,pe=Math.floor(ee/65536),Re=ee-65536*pe,ee=we+pe+65535,pe=Math.floor(ee/65536),we=ee-65536*pe,ee=Oe+pe+65535,pe=Math.floor(ee/65536),Oe=ee-65536*pe,ee=wt+pe+65535,pe=Math.floor(ee/65536),wt=ee-65536*pe,ee=Be+pe+65535,pe=Math.floor(ee/65536),Be=ee-65536*pe,ee=oe+pe+65535,pe=Math.floor(ee/65536),oe=ee-65536*pe,ue+=pe-1+37*(pe-1),fe[0]=ue,fe[1]=_e,fe[2]=Me,fe[3]=le,fe[4]=ie,fe[5]=Y,fe[6]=ae,fe[7]=Le,fe[8]=xe,fe[9]=Ce,fe[10]=Re,fe[11]=we,fe[12]=Oe,fe[13]=wt,fe[14]=Be,fe[15]=oe}function re(fe,se){J(fe,se,se)}function ve(fe,se){const ce=f();let ee;for(ee=0;ee<16;ee++)ce[ee]=se[ee];for(ee=253;ee>=0;ee--)re(ce,ce),2!==ee&&4!==ee&&J(ce,ce,se);for(ee=0;ee<16;ee++)fe[ee]=ce[ee]}function o(fe,se){const ce=f(),ee=f(),pe=f(),ue=f(),_e=f(),Me=f(),le=f(),ie=f(),Y=f();z(ce,fe[1],fe[0]),z(Y,se[1],se[0]),J(ce,ce,Y),Z(ee,fe[0],fe[1]),Z(Y,se[0],se[1]),J(ee,ee,Y),J(pe,fe[3],se[3]),J(pe,pe,x),J(ue,fe[2],se[2]),Z(ue,ue,ue),z(_e,ee,ce),z(Me,ue,pe),Z(le,ue,pe),Z(ie,ee,ce),J(fe[0],_e,Me),J(fe[1],ie,le),J(fe[2],le,Me),J(fe[3],_e,ie)}function l(fe,se,ce){for(let ee=0;ee<4;ee++)U(fe[ee],se[ee],ce)}function c(fe,se){const ce=f(),ee=f(),pe=f();ve(pe,se[2]),J(ce,se[0],pe),J(ee,se[1],pe),H(fe,ee),fe[31]^=K(ce)<<7}function d(fe,se){const ce=[f(),f(),f(),f()];O(ce[0],E),O(ce[1],P),O(ce[2],b),J(ce[3],E,P),function u(fe,se,ce){O(fe[0],_),O(fe[1],b),O(fe[2],b),O(fe[3],_);for(let ee=255;ee>=0;--ee){const pe=ce[ee/8|0]>>(7&ee)&1;l(fe,se,pe),o(se,fe),o(fe,fe),l(fe,se,pe)}}(fe,ce,se)}F._w=function m(fe){if(fe.length!==F.aP)throw new Error(`ed25519: seed must be ${F.aP} bytes`);const se=(0,S.hash)(fe);se[0]&=248,se[31]&=127,se[31]|=64;const ce=new Uint8Array(32),ee=[f(),f(),f(),f()];d(ee,se),c(ce,ee);const pe=new Uint8Array(64);return pe.set(fe),pe.set(ce,32),{publicKey:ce,secretKey:pe}};const s=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function g(fe,se){let ce,ee,pe,ue;for(ee=63;ee>=32;--ee){for(ce=0,pe=ee-32,ue=ee-12;pe>4)*s[pe],ce=se[pe]>>8,se[pe]&=255;for(pe=0;pe<32;pe++)se[pe]-=ce*s[pe];for(ee=0;ee<32;ee++)se[ee+1]+=se[ee]>>8,fe[ee]=255&se[ee]}function $(fe){const se=new Float64Array(64);for(let ce=0;ce<64;ce++)se[ce]=fe[ce];for(let ce=0;ce<64;ce++)fe[ce]=0;g(fe,se)}F.Xx=function k(fe,se){const ce=new Float64Array(64),ee=[f(),f(),f(),f()],pe=(0,S.hash)(fe.subarray(0,32));pe[0]&=248,pe[31]&=127,pe[31]|=64;const ue=new Uint8Array(64);ue.set(pe.subarray(32),32);const _e=new S.SHA512;_e.update(ue.subarray(32)),_e.update(se);const Me=_e.digest();_e.clean(),$(Me),d(ee,Me),c(ue,ee),_e.reset(),_e.update(ue.subarray(0,32)),_e.update(fe.subarray(32)),_e.update(se);const le=_e.digest();$(le);for(let ie=0;ie<32;ie++)ce[ie]=Me[ie];for(let ie=0;ie<32;ie++)for(let Y=0;Y<32;Y++)ce[ie+Y]+=le[ie]*pe[Y];return g(ue.subarray(32),ce),ue},F.SH=function be(fe){let se=[f(),f(),f(),f()];if(function q(fe,se){const ce=f(),ee=f(),pe=f(),ue=f(),_e=f(),Me=f(),le=f();return O(fe[2],b),function X(fe,se){for(let ce=0;ce<16;ce++)fe[ce]=se[2*ce]+(se[2*ce+1]<<8);fe[15]&=32767}(fe[1],se),re(pe,fe[1]),J(ue,pe,C),z(pe,pe,fe[2]),Z(ue,fe[2],ue),re(_e,ue),re(Me,_e),J(le,Me,_e),J(ce,le,pe),J(ce,ce,ue),function y(fe,se){const ce=f();let ee;for(ee=0;ee<16;ee++)ce[ee]=se[ee];for(ee=250;ee>=0;ee--)re(ce,ce),1!==ee&&J(ce,ce,se);for(ee=0;ee<16;ee++)fe[ee]=ce[ee]}(ce,ce),J(ce,ce,pe),J(ce,ce,ue),J(ce,ce,ue),J(fe[0],ce,ue),re(ee,fe[0]),J(ee,ee,ue),G(ee,pe)&&J(fe[0],fe[0],A),re(ee,fe[0]),J(ee,ee,ue),G(ee,pe)?-1:(K(fe[0])===se[31]>>7&&z(fe[0],_,fe[0]),J(fe[3],fe[0],fe[1]),0)}(se,fe))throw new Error("Ed25519: invalid public key");let ce=f(),ee=f(),pe=se[1];Z(ce,b,pe),z(ee,b,pe),ve(ee,ee),J(ce,ce,ee);let ue=new Uint8Array(32);return H(ue,ce),ue},F.zh=function ge(fe){const se=(0,S.hash)(fe.subarray(0,32));se[0]&=248,se[31]&=127,se[31]|=64;const ce=new Uint8Array(se.subarray(0,32));return(0,T.wipe)(se),ce}},8046:(ne,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mul=Math.imul||function I(M,_){var C=65535&M,E=65535&_;return C*E+((M>>>16&65535)*E+C*(_>>>16&65535)<<16>>>0)|0},F.add=function R(M,_){return M+_|0},F.sub=function B(M,_){return M-_|0},F.rotl=function S(M,_){return M<<_|M>>>32-_},F.rotr=function T(M,_){return M<<32-_|M>>>_},F.isInteger=Number.isInteger||function f(M){return"number"==typeof M&&isFinite(M)&&Math.floor(M)===M},F.MAX_SAFE_INTEGER=9007199254740991,F.isSafeInteger=function(M){return F.isInteger(M)&&M>=-F.MAX_SAFE_INTEGER&&M<=F.MAX_SAFE_INTEGER}},5026:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.openBox=F.box=F.precomputeSharedKey=F.generateKeyPair=void 0;const R=I(5006),B=I(2152),S=I(3671),T=I(9815);var f=I(5006);Object.defineProperty(F,"generateKeyPair",{enumerable:!0,get:function(){return f.generateKeyPair}});const M=new Uint8Array(16);function _(x,E){const P=(0,R.scalarMult)(E,x);return(0,B.hsalsa)(P,M,P),P}F.precomputeSharedKey=_,F.box=function b(x,E,P,A){const O=_(x,E),N=(0,S.secretBox)(O,P,A);return(0,T.wipe)(O),N},F.openBox=function C(x,E,P,A){const O=_(x,E),N=(0,S.openSecretBox)(O,P,A);return(0,T.wipe)(O),N}},4488:function(ne,F,I){"use strict";var R=this&&this.__createBinding||(Object.create?function(S,T,f,M){void 0===M&&(M=f);var _=Object.getOwnPropertyDescriptor(T,f);(!_||("get"in _?!T.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return T[f]}}),Object.defineProperty(S,M,_)}:function(S,T,f,M){void 0===M&&(M=f),S[M]=T[f]}),B=this&&this.__exportStar||function(S,T){for(var f in S)"default"!==f&&!Object.prototype.hasOwnProperty.call(T,f)&&R(T,S,f)};Object.defineProperty(F,"__esModule",{value:!0}),B(I(5026),F),B(I(3671),F)},3671:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.generateKey=F.openSecretBox=F.secretBox=void 0;const R=I(2152),B=I(314),S=I(9815),T=I(5784);F.secretBox=function f(b,C,x){if(24!==C.length)throw new Error("secretBox nonce must be 24 bytes");const E=new Uint8Array(64),P=new Uint8Array(32);P.set(C),(0,R.stream)(b,P,E,8);const A=new Uint8Array(16+x.length);for(let N=0;N<32&&N32&&(0,R.streamXOR)(b,P,x.subarray(32),A.subarray(48),8);const O=(0,B.oneTimeAuth)(E.subarray(0,32),A.subarray(16));for(let N=0;N32&&(0,R.streamXOR)(b,P,O.subarray(32),N.subarray(32),8),(0,S.wipe)(A),(0,S.wipe)(E),(0,S.wipe)(P),N},F.generateKey=function _(b){return(0,T.randomBytes)(32,b)}},314:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(9976),B=I(9815);F.DIGEST_LENGTH=16;var S=function(){function M(_){this.digestLength=F.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var b=_[0]|_[1]<<8;this._r[0]=8191&b;var C=_[2]|_[3]<<8;this._r[1]=8191&(b>>>13|C<<3);var x=_[4]|_[5]<<8;this._r[2]=7939&(C>>>10|x<<6);var E=_[6]|_[7]<<8;this._r[3]=8191&(x>>>7|E<<9);var P=_[8]|_[9]<<8;this._r[4]=255&(E>>>4|P<<12),this._r[5]=P>>>1&8190;var A=_[10]|_[11]<<8;this._r[6]=8191&(P>>>14|A<<2);var O=_[12]|_[13]<<8;this._r[7]=8065&(A>>>11|O<<5);var N=_[14]|_[15]<<8;this._r[8]=8191&(O>>>8|N<<8),this._r[9]=N>>>5&127,this._pad[0]=_[16]|_[17]<<8,this._pad[1]=_[18]|_[19]<<8,this._pad[2]=_[20]|_[21]<<8,this._pad[3]=_[22]|_[23]<<8,this._pad[4]=_[24]|_[25]<<8,this._pad[5]=_[26]|_[27]<<8,this._pad[6]=_[28]|_[29]<<8,this._pad[7]=_[30]|_[31]<<8}return M.prototype._blocks=function(_,b,C){for(var x=this._fin?0:2048,E=this._h[0],P=this._h[1],A=this._h[2],O=this._h[3],N=this._h[4],U=this._h[5],H=this._h[6],V=this._h[7],G=this._h[8],K=this._h[9],X=this._r[0],Z=this._r[1],z=this._r[2],J=this._r[3],re=this._r[4],ve=this._r[5],y=this._r[6],o=this._r[7],l=this._r[8],c=this._r[9];C>=16;){var u=_[b+0]|_[b+1]<<8,d=_[b+2]|_[b+3]<<8,m=_[b+4]|_[b+5]<<8,w=_[b+6]|_[b+7]<<8,p=_[b+8]|_[b+9]<<8,s=_[b+10]|_[b+11]<<8,g=_[b+12]|_[b+13]<<8,$=_[b+14]|_[b+15]<<8,k=0,q=k;q+=(E+=8191&u)*X,q+=(P+=8191&(u>>>13|d<<3))*(5*c),q+=(A+=8191&(d>>>10|m<<6))*(5*l),q+=(O+=8191&(m>>>7|w<<9))*(5*o),k=(q+=(N+=8191&(w>>>4|p<<12))*(5*y))>>>13,q&=8191,q+=(U+=p>>>1&8191)*(5*ve),q+=(H+=8191&(p>>>14|s<<2))*(5*re),q+=(V+=8191&(s>>>11|g<<5))*(5*J),q+=(G+=8191&(g>>>8|$<<8))*(5*z);var he=k+=(q+=(K+=$>>>5|x)*(5*Z))>>>13;he+=E*Z,he+=P*X,he+=A*(5*c),he+=O*(5*l),k=(he+=N*(5*o))>>>13,he&=8191,he+=U*(5*y),he+=H*(5*ve),he+=V*(5*re),he+=G*(5*J),k+=(he+=K*(5*z))>>>13,he&=8191;var be=k;be+=E*z,be+=P*Z,be+=A*X,be+=O*(5*c),k=(be+=N*(5*l))>>>13,be&=8191,be+=U*(5*o),be+=H*(5*y),be+=V*(5*ve),be+=G*(5*re);var ge=k+=(be+=K*(5*J))>>>13;ge+=E*J,ge+=P*z,ge+=A*Z,ge+=O*X,k=(ge+=N*(5*c))>>>13,ge&=8191,ge+=U*(5*l),ge+=H*(5*o),ge+=V*(5*y),ge+=G*(5*ve);var fe=k+=(ge+=K*(5*re))>>>13;fe+=E*re,fe+=P*J,fe+=A*z,fe+=O*Z,k=(fe+=N*X)>>>13,fe&=8191,fe+=U*(5*c),fe+=H*(5*l),fe+=V*(5*o),fe+=G*(5*y);var se=k+=(fe+=K*(5*ve))>>>13;se+=E*ve,se+=P*re,se+=A*J,se+=O*z,k=(se+=N*Z)>>>13,se&=8191,se+=U*X,se+=H*(5*c),se+=V*(5*l),se+=G*(5*o);var ce=k+=(se+=K*(5*y))>>>13;ce+=E*y,ce+=P*ve,ce+=A*re,ce+=O*J,k=(ce+=N*z)>>>13,ce&=8191,ce+=U*Z,ce+=H*X,ce+=V*(5*c),ce+=G*(5*l);var ee=k+=(ce+=K*(5*o))>>>13;ee+=E*o,ee+=P*y,ee+=A*ve,ee+=O*re,k=(ee+=N*J)>>>13,ee&=8191,ee+=U*z,ee+=H*Z,ee+=V*X,ee+=G*(5*c);var pe=k+=(ee+=K*(5*l))>>>13;pe+=E*l,pe+=P*o,pe+=A*y,pe+=O*ve,k=(pe+=N*re)>>>13,pe&=8191,pe+=U*J,pe+=H*z,pe+=V*Z,pe+=G*X;var ue=k+=(pe+=K*(5*c))>>>13;ue+=E*c,ue+=P*l,ue+=A*o,ue+=O*y,k=(ue+=N*ve)>>>13,ue&=8191,ue+=U*re,ue+=H*J,ue+=V*z,ue+=G*Z,E=q=8191&(k=(k=((k+=(ue+=K*X)>>>13)<<2)+k|0)+(q&=8191)|0),P=he+=k>>>=13,A=be&=8191,O=ge&=8191,N=fe&=8191,U=se&=8191,H=ce&=8191,V=ee&=8191,G=pe&=8191,K=ue&=8191,b+=16,C-=16}this._h[0]=E,this._h[1]=P,this._h[2]=A,this._h[3]=O,this._h[4]=N,this._h[5]=U,this._h[6]=H,this._h[7]=V,this._h[8]=G,this._h[9]=K},M.prototype.finish=function(_,b){void 0===b&&(b=0);var x,E,P,A,C=new Uint16Array(10);if(this._leftover){for(A=this._leftover,this._buffer[A++]=1;A<16;A++)this._buffer[A]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(x=this._h[1]>>>13,this._h[1]&=8191,A=2;A<10;A++)this._h[A]+=x,x=this._h[A]>>>13,this._h[A]&=8191;for(this._h[0]+=5*x,x=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=x,x=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=x,C[0]=this._h[0]+5,x=C[0]>>>13,C[0]&=8191,A=1;A<10;A++)C[A]=this._h[A]+x,x=C[A]>>>13,C[A]&=8191;for(C[9]-=8192,E=(1^x)-1,A=0;A<10;A++)C[A]&=E;for(E=~E,A=0;A<10;A++)this._h[A]=this._h[A]&E|C[A];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),this._h[0]=65535&(P=this._h[0]+this._pad[0]),A=1;A<8;A++)this._h[A]=65535&(P=(this._h[A]+this._pad[A]|0)+(P>>>16)|0);return _[b+0]=this._h[0]>>>0,_[b+1]=this._h[0]>>>8,_[b+2]=this._h[1]>>>0,_[b+3]=this._h[1]>>>8,_[b+4]=this._h[2]>>>0,_[b+5]=this._h[2]>>>8,_[b+6]=this._h[3]>>>0,_[b+7]=this._h[3]>>>8,_[b+8]=this._h[4]>>>0,_[b+9]=this._h[4]>>>8,_[b+10]=this._h[5]>>>0,_[b+11]=this._h[5]>>>8,_[b+12]=this._h[6]>>>0,_[b+13]=this._h[6]>>>8,_[b+14]=this._h[7]>>>0,_[b+15]=this._h[7]>>>8,this._finished=!0,this},M.prototype.update=function(_){var x,b=0,C=_.length;if(this._leftover){(x=16-this._leftover)>C&&(x=C);for(var E=0;E=16&&(this._blocks(_,b,x=C-C%16),b+=x,C-=x),C){for(E=0;E{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.randomStringForEntropy=F.randomString=F.randomUint32=F.randomBytes=F.defaultRandomSource=void 0;const R=I(9753),B=I(4502),S=I(9815);function T(C,x=F.defaultRandomSource){return x.randomBytes(C)}F.defaultRandomSource=new R.SystemRandomSource,F.randomBytes=T,F.randomUint32=function f(C=F.defaultRandomSource){const x=T(4,C),E=(0,B.readUint32LE)(x);return(0,S.wipe)(x),E};const M="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function _(C,x=M,E=F.defaultRandomSource){if(x.length<2)throw new Error("randomString charset is too short");if(x.length>256)throw new Error("randomString charset is too long");let P="";const A=x.length,O=256-256%A;for(;C>0;){const N=T(Math.ceil(256*C/O),E);for(let U=0;U0;U++){const H=N[U];H{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.BrowserRandomSource=void 0,F.BrowserRandomSource=class R{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const S="undefined"!=typeof self?self.crypto||self.msCrypto:null;S&&void 0!==S.getRandomValues&&(this._crypto=S,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(S){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const T=new Uint8Array(S);for(let f=0;f{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.NodeRandomSource=void 0;const R=I(9815);F.NodeRandomSource=class B{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const T=I(1348);T&&T.randomBytes&&(this._crypto=T,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(T){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let f=this._crypto.randomBytes(T);if(f.length!==T)throw new Error("NodeRandomSource: got fewer bytes than requested");const M=new Uint8Array(T);for(let _=0;_{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SystemRandomSource=void 0;const R=I(7170),B=I(1382);F.SystemRandomSource=class S{constructor(){return this.isAvailable=!1,this.name="",this._source=new R.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new B.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(f){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(f)}}},6399:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(4502),B=I(9815);function T(b,C,x){for(var ge,E=1634760805,P=x[3]<<24|x[2]<<16|x[1]<<8|x[0],A=x[7]<<24|x[6]<<16|x[5]<<8|x[4],O=x[11]<<24|x[10]<<16|x[9]<<8|x[8],N=x[15]<<24|x[14]<<16|x[13]<<8|x[12],U=857760878,H=C[3]<<24|C[2]<<16|C[1]<<8|C[0],V=C[7]<<24|C[6]<<16|C[5]<<8|C[4],G=C[11]<<24|C[10]<<16|C[9]<<8|C[8],K=C[15]<<24|C[14]<<16|C[13]<<8|C[12],X=2036477234,Z=x[19]<<24|x[18]<<16|x[17]<<8|x[16],z=x[23]<<24|x[22]<<16|x[21]<<8|x[20],J=x[27]<<24|x[26]<<16|x[25]<<8|x[24],re=x[31]<<24|x[30]<<16|x[29]<<8|x[28],ve=1797285236,y=E,o=P,l=A,c=O,u=N,d=U,m=H,w=V,p=G,s=K,g=X,$=Z,k=z,q=J,he=re,be=ve,fe=0;fe<20;fe+=2)y^=(ge=(k^=(ge=(p^=(ge=(u^=(ge=y+k|0)<<7|ge>>>25)+y|0)<<9|ge>>>23)+u|0)<<13|ge>>>19)+p|0)<<18|ge>>>14,d^=(ge=(o^=(ge=(q^=(ge=(s^=(ge=d+o|0)<<7|ge>>>25)+d|0)<<9|ge>>>23)+s|0)<<13|ge>>>19)+q|0)<<18|ge>>>14,g^=(ge=(m^=(ge=(l^=(ge=(he^=(ge=g+m|0)<<7|ge>>>25)+g|0)<<9|ge>>>23)+he|0)<<13|ge>>>19)+l|0)<<18|ge>>>14,be^=(ge=($^=(ge=(w^=(ge=(c^=(ge=be+$|0)<<7|ge>>>25)+be|0)<<9|ge>>>23)+c|0)<<13|ge>>>19)+w|0)<<18|ge>>>14,y^=(ge=(c^=(ge=(l^=(ge=(o^=(ge=y+c|0)<<7|ge>>>25)+y|0)<<9|ge>>>23)+o|0)<<13|ge>>>19)+l|0)<<18|ge>>>14,d^=(ge=(u^=(ge=(w^=(ge=(m^=(ge=d+u|0)<<7|ge>>>25)+d|0)<<9|ge>>>23)+m|0)<<13|ge>>>19)+w|0)<<18|ge>>>14,g^=(ge=(s^=(ge=(p^=(ge=($^=(ge=g+s|0)<<7|ge>>>25)+g|0)<<9|ge>>>23)+$|0)<<13|ge>>>19)+p|0)<<18|ge>>>14,be^=(ge=(he^=(ge=(q^=(ge=(k^=(ge=be+he|0)<<7|ge>>>25)+be|0)<<9|ge>>>23)+k|0)<<13|ge>>>19)+q|0)<<18|ge>>>14;R.writeUint32LE(y+E|0,b,0),R.writeUint32LE(o+P|0,b,4),R.writeUint32LE(l+A|0,b,8),R.writeUint32LE(c+O|0,b,12),R.writeUint32LE(u+N|0,b,16),R.writeUint32LE(d+U|0,b,20),R.writeUint32LE(m+H|0,b,24),R.writeUint32LE(w+V|0,b,28),R.writeUint32LE(p+G|0,b,32),R.writeUint32LE(s+K|0,b,36),R.writeUint32LE(g+X|0,b,40),R.writeUint32LE($+Z|0,b,44),R.writeUint32LE(k+z|0,b,48),R.writeUint32LE(q+J|0,b,52),R.writeUint32LE(he+re|0,b,56),R.writeUint32LE(be+ve|0,b,60)}function f(b,C,x,E,P){if(void 0===P&&(P=0),32!==b.length)throw new Error("Salsa20: key size must be 32 bytes");if(E.length>>=8,C++;if(E>0)throw new Error("Salsa20: counter overflow")}F.streamXOR=f,F.stream=function M(b,C,x,E){return void 0===E&&(E=0),B.wipe(x),f(b,C,x,x,E)}},6375:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(4502),B=I(9815);F.DIGEST_LENGTH=64,F.BLOCK_SIZE=128;var S=function(){function _(){this.digestLength=F.DIGEST_LENGTH,this.blockSize=F.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return _.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},_.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},_.prototype.clean=function(){B.wipe(this._buffer),B.wipe(this._tempHi),B.wipe(this._tempLo),this.reset()},_.prototype.update=function(b,C){if(void 0===C&&(C=b.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var x=0;if(this._bytesHashed+=C,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=b[x++],C--;this._bufferLength===this.blockSize&&(f(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(C>=this.blockSize&&(x=f(this._tempHi,this._tempLo,this._stateHi,this._stateLo,b,x,C),C%=this.blockSize);C>0;)this._buffer[this._bufferLength++]=b[x++],C--;return this},_.prototype.finish=function(b){if(!this._finished){var C=this._bytesHashed,x=this._bufferLength,E=C/536870912|0,P=C<<3,A=C%128<112?128:256;this._buffer[x]=128;for(var O=x+1;O0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},_.prototype.restoreState=function(b){return this._stateHi.set(b.stateHi),this._stateLo.set(b.stateLo),this._bufferLength=b.bufferLength,b.buffer&&this._buffer.set(b.buffer),this._bytesHashed=b.bytesHashed,this._finished=!1,this},_.prototype.cleanSavedState=function(b){B.wipe(b.stateHi),B.wipe(b.stateLo),b.buffer&&B.wipe(b.buffer),b.bufferLength=0,b.bytesHashed=0},_}();F.SHA512=S;var T=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function f(_,b,C,x,E,P,A){for(var c,u,d,m,w,p,s,g,O=C[0],N=C[1],U=C[2],H=C[3],V=C[4],G=C[5],K=C[6],X=C[7],Z=x[0],z=x[1],J=x[2],re=x[3],ve=x[4],y=x[5],o=x[6],l=x[7];A>=128;){for(var $=0;$<16;$++)_[$]=R.readUint32BE(E,k=8*$+P),b[$]=R.readUint32BE(E,k+4);for($=0;$<80;$++){var ee,ae,he=N,be=U,ge=H,fe=V,se=G,ce=K,ue=z,_e=J,Me=re,le=ve,ie=y,Y=o;if(w=65535&(u=l),p=u>>>16,s=65535&(c=X),g=c>>>16,w+=65535&(u=(ve>>>14|V<<18)^(ve>>>18|V<<14)^(V>>>9|ve<<23)),p+=u>>>16,s+=65535&(c=(V>>>14|ve<<18)^(V>>>18|ve<<14)^(ve>>>9|V<<23)),g+=c>>>16,w+=65535&(u=ve&y^~ve&o),p+=u>>>16,s+=65535&(c=V&G^~V&K),g+=c>>>16,w+=65535&(u=T[2*$+1]),p+=u>>>16,s+=65535&(c=T[2*$]),g+=c>>>16,p+=(u=b[$%16])>>>16,s+=65535&(c=_[$%16]),g+=c>>>16,s+=(p+=(w+=65535&u)>>>16)>>>16,w=65535&(u=m=65535&w|p<<16),p=u>>>16,s=65535&(c=d=65535&s|(g+=s>>>16)<<16),g=c>>>16,w+=65535&(u=(Z>>>28|O<<4)^(O>>>2|Z<<30)^(O>>>7|Z<<25)),p+=u>>>16,s+=65535&(c=(O>>>28|Z<<4)^(Z>>>2|O<<30)^(Z>>>7|O<<25)),g+=c>>>16,p+=(u=Z&z^Z&J^z&J)>>>16,s+=65535&(c=O&N^O&U^N&U),g+=c>>>16,ee=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,ae=65535&w|p<<16,w=65535&(u=Me),p=u>>>16,s=65535&(c=ge),g=c>>>16,p+=(u=m)>>>16,s+=65535&(c=d),g+=c>>>16,N=O,U=he,H=be,V=ge=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,G=fe,K=se,X=ce,O=ee,z=Z,J=ue,re=_e,ve=Me=65535&w|p<<16,y=le,o=ie,l=Y,Z=ae,$%16==15)for(var k=0;k<16;k++)w=65535&(u=b[k]),p=u>>>16,s=65535&(c=_[k]),g=c>>>16,w+=65535&(u=b[(k+9)%16]),p+=u>>>16,s+=65535&(c=_[(k+9)%16]),g+=c>>>16,w+=65535&(u=((m=b[(k+1)%16])>>>1|(d=_[(k+1)%16])<<31)^(m>>>8|d<<24)^(m>>>7|d<<25)),p+=u>>>16,s+=65535&(c=(d>>>1|m<<31)^(d>>>8|m<<24)^d>>>7),g+=c>>>16,p+=(u=((m=b[(k+14)%16])>>>19|(d=_[(k+14)%16])<<13)^(d>>>29|m<<3)^(m>>>6|d<<26))>>>16,s+=65535&(c=(d>>>19|m<<13)^(m>>>29|d<<3)^d>>>6),g+=c>>>16,_[k]=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,b[k]=65535&w|p<<16}w=65535&(u=Z),p=u>>>16,s=65535&(c=O),g=c>>>16,p+=(u=x[0])>>>16,s+=65535&(c=C[0]),g+=c>>>16,C[0]=O=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[0]=Z=65535&w|p<<16,w=65535&(u=z),p=u>>>16,s=65535&(c=N),g=c>>>16,p+=(u=x[1])>>>16,s+=65535&(c=C[1]),g+=c>>>16,C[1]=N=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[1]=z=65535&w|p<<16,w=65535&(u=J),p=u>>>16,s=65535&(c=U),g=c>>>16,p+=(u=x[2])>>>16,s+=65535&(c=C[2]),g+=c>>>16,C[2]=U=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[2]=J=65535&w|p<<16,w=65535&(u=re),p=u>>>16,s=65535&(c=H),g=c>>>16,p+=(u=x[3])>>>16,s+=65535&(c=C[3]),g+=c>>>16,C[3]=H=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[3]=re=65535&w|p<<16,w=65535&(u=ve),p=u>>>16,s=65535&(c=V),g=c>>>16,p+=(u=x[4])>>>16,s+=65535&(c=C[4]),g+=c>>>16,C[4]=V=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[4]=ve=65535&w|p<<16,w=65535&(u=y),p=u>>>16,s=65535&(c=G),g=c>>>16,p+=(u=x[5])>>>16,s+=65535&(c=C[5]),g+=c>>>16,C[5]=G=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[5]=y=65535&w|p<<16,w=65535&(u=o),p=u>>>16,s=65535&(c=K),g=c>>>16,p+=(u=x[6])>>>16,s+=65535&(c=C[6]),g+=c>>>16,C[6]=K=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[6]=o=65535&w|p<<16,w=65535&(u=l),p=u>>>16,s=65535&(c=X),g=c>>>16,p+=(u=x[7])>>>16,s+=65535&(c=C[7]),g+=c>>>16,C[7]=X=65535&(s+=(p+=(w+=65535&u)>>>16)>>>16)|(g+=s>>>16)<<16,x[7]=l=65535&w|p<<16,P+=128,A-=128}return P}F.hash=function M(_){var b=new S;b.update(_);var C=b.digest();return b.clean(),C}},3434:(ne,F)=>{"use strict";var R="utf8: invalid string";F.cv=function S(M){for(var _=new Uint8Array(function T(M){for(var _=0,b=0;b=M.length-1)throw new Error(R);b++,_+=4}}return _}(M)),b=0,C=0;C>6,_[b++]=128|63&x):x<55296?(_[b++]=224|x>>12,_[b++]=128|x>>6&63,_[b++]=128|63&x):(C++,x=(1023&x)<<10,x|=1023&M.charCodeAt(C),_[b++]=240|(x+=65536)>>18,_[b++]=128|x>>12&63,_[b++]=128|x>>6&63,_[b++]=128|63&x)}return _}},9815:(ne,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.wipe=function I(R){for(var B=0;B{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.X25519Session=F.SECRET_SEED_LENGTH=F.SAVED_STATE_LENGTH=F.ACCEPT_MESSAGE_LENGTH=F.OFFER_MESSAGE_LENGTH=void 0;const R=I(5784),B=I(9815),S=I(5006),T=I(467);F.OFFER_MESSAGE_LENGTH=S.PUBLIC_KEY_LENGTH,F.ACCEPT_MESSAGE_LENGTH=S.PUBLIC_KEY_LENGTH,F.SAVED_STATE_LENGTH=S.SECRET_KEY_LENGTH,F.SECRET_SEED_LENGTH=S.SECRET_KEY_LENGTH,F.X25519Session=class f{constructor(_,b){this.offerMessageLength=F.OFFER_MESSAGE_LENGTH,this.acceptMessageLength=F.ACCEPT_MESSAGE_LENGTH,this.sharedKeyLength=S.SHARED_KEY_LENGTH,this.savedStateLength=F.SAVED_STATE_LENGTH,this._seed=_||(0,R.randomBytes)(S.SECRET_KEY_LENGTH,b)}saveState(){return new Uint8Array(this._seed)}restoreState(_){return this._seed=new Uint8Array(_),this}clean(){this._seed&&(0,B.wipe)(this._seed),this._keyPair&&((0,B.wipe)(this._keyPair.secretKey),(0,B.wipe)(this._keyPair.publicKey)),this._sharedKey&&(0,B.wipe)(this._sharedKey),this._sessionKeys&&((0,B.wipe)(this._sessionKeys.receive),(0,B.wipe)(this._sessionKeys.send))}offer(){return this._keyPair=(0,S.generateKeyPairFromSeed)(this._seed),new Uint8Array(this._keyPair.publicKey)}accept(_){if(this._keyPair)throw new Error("X25519Session: accept shouldn't be called by offering party");if(_.length!==this.offerMessageLength)throw new Error("X25519Session: incorrect offer message length");if(this._sharedKey)throw new Error("X25519Session: accept was already called");const b=(0,S.generateKeyPairFromSeed)(this._seed);return this._sharedKey=(0,S.sharedKey)(b.secretKey,_),this._sessionKeys=(0,T.clientSessionKeysFromSharedKey)(this._sharedKey,b.publicKey,_),(0,B.wipe)(b.secretKey),b.publicKey}finish(_){if(_.length!==this.acceptMessageLength)throw new Error("X25519Session: incorrect accept message length");if(!this._keyPair)throw new Error("X25519Session: no offer state");if(this._sharedKey)throw new Error("X25519Session: finish was already called");return this._sharedKey=(0,S.sharedKey)(this._keyPair.secretKey,_),this._sessionKeys=(0,T.serverSessionKeysFromSharedKey)(this._sharedKey,this._keyPair.publicKey,_),this}getSharedKey(){if(!this._sharedKey)throw new Error("X25519Session: no shared key established");return new Uint8Array(this._sharedKey)}getSessionKeys(){if(!this._sessionKeys)throw new Error("X25519Session: no shared key established");return{receive:new Uint8Array(this._sessionKeys.receive),send:new Uint8Array(this._sessionKeys.send)}}}},467:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.clientSessionKeys=F.serverSessionKeys=F.clientSessionKeysFromSharedKey=F.serverSessionKeysFromSharedKey=F.X25519Session=void 0;const R=I(7221),B=I(5006);var S=I(4904);Object.defineProperty(F,"X25519Session",{enumerable:!0,get:function(){return S.X25519Session}});function f(C,x,E,P=R.BLAKE2b){const A=new P;if(64!==A.digestLength)throw new Error("X25519: incorrect digest length");const O=A.update(C).update(E).update(x).digest();return{send:O.subarray(0,32),receive:O.subarray(32)}}function M(C,x,E,P=R.BLAKE2b){const A=new P;if(64!==A.digestLength)throw new Error("X25519: incorrect digest length");const O=A.update(C).update(x).update(E).digest();return{receive:O.subarray(0,32),send:O.subarray(32)}}F.serverSessionKeysFromSharedKey=f,F.clientSessionKeysFromSharedKey=M,F.serverSessionKeys=function _(C,x,E=R.BLAKE2b){return f((0,B.sharedKey)(C.secretKey,x),C.publicKey,x,E)},F.clientSessionKeys=function b(C,x,E=R.BLAKE2b){return M((0,B.sharedKey)(C.secretKey,x),C.publicKey,x,E)}},5006:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sharedKey=F.generateKeyPair=F.generateKeyPairFromSeed=F.scalarMultBase=F.scalarMult=F.SHARED_KEY_LENGTH=F.SECRET_KEY_LENGTH=F.PUBLIC_KEY_LENGTH=void 0;const R=I(5784),B=I(9815);function S(K){const X=new Float64Array(16);if(K)for(let Z=0;Z=0;--m){const w=Z[m>>>3]>>>(7&m)&1;_(J,re,w),_(ve,y,w),x(o,J,ve),E(J,J,ve),x(ve,re,y),E(re,re,y),A(y,o),A(l,J),P(J,ve,J),P(ve,re,o),x(o,J,ve),E(J,J,ve),A(re,J),E(ve,y,l),P(J,ve,f),x(J,J,y),P(ve,ve,J),P(J,y,l),P(y,re,z),A(re,o),_(J,re,w),_(ve,y,w)}for(let m=0;m<16;m++)z[m+16]=J[m],z[m+32]=ve[m],z[m+48]=re[m],z[m+64]=y[m];const c=z.subarray(32),u=z.subarray(16);(function O(K,X){const Z=S();for(let z=0;z<16;z++)Z[z]=X[z];for(let z=253;z>=0;z--)A(Z,Z),2!==z&&4!==z&&P(Z,Z,X);for(let z=0;z<16;z++)K[z]=Z[z]})(c,c),P(u,u,c);const d=new Uint8Array(32);return function b(K,X){const Z=S(),z=S();for(let J=0;J<16;J++)z[J]=X[J];M(z),M(z),M(z);for(let J=0;J<2;J++){Z[0]=z[0]-65517;for(let ve=1;ve<15;ve++)Z[ve]=z[ve]-65535-(Z[ve-1]>>16&1),Z[ve-1]&=65535;Z[15]=z[15]-32767-(Z[14]>>16&1);const re=Z[15]>>16&1;Z[14]&=65535,_(z,Z,1-re)}for(let J=0;J<16;J++)K[2*J]=255&z[J],K[2*J+1]=z[J]>>8}(d,u),d}function U(K){return N(K,T)}function H(K){if(K.length!==F.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${F.SECRET_KEY_LENGTH} bytes`);const X=new Uint8Array(K);return{publicKey:U(X),secretKey:X}}F.scalarMult=N,F.scalarMultBase=U,F.generateKeyPairFromSeed=H,F.generateKeyPair=function V(K){const X=(0,R.randomBytes)(32,K),Z=H(X);return(0,B.wipe)(X),Z},F.sharedKey=function G(K,X,Z=!1){if(K.length!==F.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(X.length!==F.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const z=N(K,X);if(Z){let J=0;for(let re=0;re{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var R=I(4502),B=I(6399),S=I(9815);function T(b,C,x,E,P){if(void 0===P&&(P=0),0===P){if(24!==C.length)throw new Error("XSalsa20 nonce must be 24 bytes")}else if(32!==C.length)throw new Error("XSalsa20 nonce with counter must be 32 bytes");var A=_(b,C.subarray(0,16),new Uint8Array(32)),O=B.streamXOR(A,C.subarray(16),x,E,P);return S.wipe(A),O}function _(b,C,x){for(var y,E=1634760805,P=b[3]<<24|b[2]<<16|b[1]<<8|b[0],A=b[7]<<24|b[6]<<16|b[5]<<8|b[4],O=b[11]<<24|b[10]<<16|b[9]<<8|b[8],N=b[15]<<24|b[14]<<16|b[13]<<8|b[12],U=857760878,H=C[3]<<24|C[2]<<16|C[1]<<8|C[0],V=C[7]<<24|C[6]<<16|C[5]<<8|C[4],G=C[11]<<24|C[10]<<16|C[9]<<8|C[8],K=C[15]<<24|C[14]<<16|C[13]<<8|C[12],X=2036477234,Z=b[19]<<24|b[18]<<16|b[17]<<8|b[16],z=b[23]<<24|b[22]<<16|b[21]<<8|b[20],J=b[27]<<24|b[26]<<16|b[25]<<8|b[24],re=b[31]<<24|b[30]<<16|b[29]<<8|b[28],ve=1797285236,o=0;o<20;o+=2)E^=(y=(z^=(y=(G^=(y=(N^=(y=E+z|0)<<7|y>>>25)+E|0)<<9|y>>>23)+N|0)<<13|y>>>19)+G|0)<<18|y>>>14,U^=(y=(P^=(y=(J^=(y=(K^=(y=U+P|0)<<7|y>>>25)+U|0)<<9|y>>>23)+K|0)<<13|y>>>19)+J|0)<<18|y>>>14,X^=(y=(H^=(y=(A^=(y=(re^=(y=X+H|0)<<7|y>>>25)+X|0)<<9|y>>>23)+re|0)<<13|y>>>19)+A|0)<<18|y>>>14,ve^=(y=(Z^=(y=(V^=(y=(O^=(y=ve+Z|0)<<7|y>>>25)+ve|0)<<9|y>>>23)+O|0)<<13|y>>>19)+V|0)<<18|y>>>14,E^=(y=(O^=(y=(A^=(y=(P^=(y=E+O|0)<<7|y>>>25)+E|0)<<9|y>>>23)+P|0)<<13|y>>>19)+A|0)<<18|y>>>14,U^=(y=(N^=(y=(V^=(y=(H^=(y=U+N|0)<<7|y>>>25)+U|0)<<9|y>>>23)+H|0)<<13|y>>>19)+V|0)<<18|y>>>14,X^=(y=(K^=(y=(G^=(y=(Z^=(y=X+K|0)<<7|y>>>25)+X|0)<<9|y>>>23)+Z|0)<<13|y>>>19)+G|0)<<18|y>>>14,ve^=(y=(re^=(y=(J^=(y=(z^=(y=ve+re|0)<<7|y>>>25)+ve|0)<<9|y>>>23)+z|0)<<13|y>>>19)+J|0)<<18|y>>>14;return R.writeUint32LE(E,x,0),R.writeUint32LE(U,x,4),R.writeUint32LE(X,x,8),R.writeUint32LE(ve,x,12),R.writeUint32LE(H,x,16),R.writeUint32LE(V,x,20),R.writeUint32LE(G,x,24),R.writeUint32LE(K,x,28),x}F.streamXOR=T,F.stream=function f(b,C,x,E){return void 0===E&&(E=0),S.wipe(x),T(b,C,x,x,E)},F.hsalsa=_},1108:(ne,F,I)=>{"use strict";const B=I(5343),S=I(8461),T="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.lW=b,F.h2=50;const f=2147483647;function _(oe){if(oe>f)throw new RangeError('The value "'+oe+'" is invalid for option "size"');const te=new Uint8Array(oe);return Object.setPrototypeOf(te,b.prototype),te}function b(oe,te,W){if("number"==typeof oe){if("string"==typeof te)throw new TypeError('The "string" argument must be of type string. Received type number');return P(oe)}return C(oe,te,W)}function C(oe,te,W){if("string"==typeof oe)return function A(oe,te){if(("string"!=typeof te||""===te)&&(te="utf8"),!b.isEncoding(te))throw new TypeError("Unknown encoding: "+te);const W=0|K(oe,te);let de=_(W);const Pe=de.write(oe,te);return Pe!==W&&(de=de.slice(0,Pe)),de}(oe,te);if(ArrayBuffer.isView(oe))return function N(oe){if(Re(oe,Uint8Array)){const te=new Uint8Array(oe);return U(te.buffer,te.byteOffset,te.byteLength)}return O(oe)}(oe);if(null==oe)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oe);if(Re(oe,ArrayBuffer)||oe&&Re(oe.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(Re(oe,SharedArrayBuffer)||oe&&Re(oe.buffer,SharedArrayBuffer)))return U(oe,te,W);if("number"==typeof oe)throw new TypeError('The "value" argument must not be of type number. Received type number');const de=oe.valueOf&&oe.valueOf();if(null!=de&&de!==oe)return b.from(de,te,W);const Pe=function H(oe){if(b.isBuffer(oe)){const te=0|V(oe.length),W=_(te);return 0===W.length||oe.copy(W,0,0,te),W}return void 0!==oe.length?"number"!=typeof oe.length||we(oe.length)?_(0):O(oe):"Buffer"===oe.type&&Array.isArray(oe.data)?O(oe.data):void 0}(oe);if(Pe)return Pe;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof oe[Symbol.toPrimitive])return b.from(oe[Symbol.toPrimitive]("string"),te,W);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oe)}function x(oe){if("number"!=typeof oe)throw new TypeError('"size" argument must be of type number');if(oe<0)throw new RangeError('The value "'+oe+'" is invalid for option "size"')}function P(oe){return x(oe),_(oe<0?0:0|V(oe))}function O(oe){const te=oe.length<0?0:0|V(oe.length),W=_(te);for(let de=0;de=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|oe}function K(oe,te){if(b.isBuffer(oe))return oe.length;if(ArrayBuffer.isView(oe)||Re(oe,ArrayBuffer))return oe.byteLength;if("string"!=typeof oe)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof oe);const W=oe.length,de=arguments.length>2&&!0===arguments[2];if(!de&&0===W)return 0;let Pe=!1;for(;;)switch(te){case"ascii":case"latin1":case"binary":return W;case"utf8":case"utf-8":return Y(oe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*W;case"hex":return W>>>1;case"base64":return xe(oe).length;default:if(Pe)return de?-1:Y(oe).length;te=(""+te).toLowerCase(),Pe=!0}}function X(oe,te,W){let de=!1;if((void 0===te||te<0)&&(te=0),te>this.length||((void 0===W||W>this.length)&&(W=this.length),W<=0)||(W>>>=0)<=(te>>>=0))return"";for(oe||(oe="utf8");;)switch(oe){case"hex":return s(this,te,W);case"utf8":case"utf-8":return u(this,te,W);case"ascii":return w(this,te,W);case"latin1":case"binary":return p(this,te,W);case"base64":return c(this,te,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,te,W);default:if(de)throw new TypeError("Unknown encoding: "+oe);oe=(oe+"").toLowerCase(),de=!0}}function Z(oe,te,W){const de=oe[te];oe[te]=oe[W],oe[W]=de}function z(oe,te,W,de,Pe){if(0===oe.length)return-1;if("string"==typeof W?(de=W,W=0):W>2147483647?W=2147483647:W<-2147483648&&(W=-2147483648),we(W=+W)&&(W=Pe?0:oe.length-1),W<0&&(W=oe.length+W),W>=oe.length){if(Pe)return-1;W=oe.length-1}else if(W<0){if(!Pe)return-1;W=0}if("string"==typeof te&&(te=b.from(te,de)),b.isBuffer(te))return 0===te.length?-1:J(oe,te,W,de,Pe);if("number"==typeof te)return te&=255,"function"==typeof Uint8Array.prototype.indexOf?Pe?Uint8Array.prototype.indexOf.call(oe,te,W):Uint8Array.prototype.lastIndexOf.call(oe,te,W):J(oe,[te],W,de,Pe);throw new TypeError("val must be string, number or Buffer")}function J(oe,te,W,de,Pe){let Je,Ee=1,Ae=oe.length,St=te.length;if(void 0!==de&&("ucs2"===(de=String(de).toLowerCase())||"ucs-2"===de||"utf16le"===de||"utf-16le"===de)){if(oe.length<2||te.length<2)return-1;Ee=2,Ae/=2,St/=2,W/=2}function Xe(kt,Ye){return 1===Ee?kt[Ye]:kt.readUInt16BE(Ye*Ee)}if(Pe){let kt=-1;for(Je=W;JeAe&&(W=Ae-St),Je=W;Je>=0;Je--){let kt=!0;for(let Ye=0;YePe&&(de=Pe):de=Pe;const Ee=te.length;let Ae;for(de>Ee/2&&(de=Ee/2),Ae=0;Ae>8,Pe=W%256,Ee.push(Pe),Ee.push(de);return Ee}(te,oe.length-W),oe,W,de)}function c(oe,te,W){return B.fromByteArray(0===te&&W===oe.length?oe:oe.slice(te,W))}function u(oe,te,W){W=Math.min(oe.length,W);const de=[];let Pe=te;for(;Pe239?4:Ee>223?3:Ee>191?2:1;if(Pe+St<=W){let Xe,Je,kt,Ye;switch(St){case 1:Ee<128&&(Ae=Ee);break;case 2:Xe=oe[Pe+1],128==(192&Xe)&&(Ye=(31&Ee)<<6|63&Xe,Ye>127&&(Ae=Ye));break;case 3:Xe=oe[Pe+1],Je=oe[Pe+2],128==(192&Xe)&&128==(192&Je)&&(Ye=(15&Ee)<<12|(63&Xe)<<6|63&Je,Ye>2047&&(Ye<55296||Ye>57343)&&(Ae=Ye));break;case 4:Xe=oe[Pe+1],Je=oe[Pe+2],kt=oe[Pe+3],128==(192&Xe)&&128==(192&Je)&&128==(192&kt)&&(Ye=(15&Ee)<<18|(63&Xe)<<12|(63&Je)<<6|63&kt,Ye>65535&&Ye<1114112&&(Ae=Ye))}}null===Ae?(Ae=65533,St=1):Ae>65535&&(Ae-=65536,de.push(Ae>>>10&1023|55296),Ae=56320|1023&Ae),de.push(Ae),Pe+=St}return function m(oe){const te=oe.length;if(te<=d)return String.fromCharCode.apply(String,oe);let W="",de=0;for(;dePe.length?(b.isBuffer(Ae)||(Ae=b.from(Ae)),Ae.copy(Pe,Ee)):Uint8Array.prototype.set.call(Pe,Ae,Ee);else{if(!b.isBuffer(Ae))throw new TypeError('"list" argument must be an Array of Buffers');Ae.copy(Pe,Ee)}Ee+=Ae.length}return Pe},b.byteLength=K,b.prototype._isBuffer=!0,b.prototype.swap16=function(){const te=this.length;if(te%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let W=0;WW&&(te+=" ... "),""},T&&(b.prototype[T]=b.prototype.inspect),b.prototype.compare=function(te,W,de,Pe,Ee){if(Re(te,Uint8Array)&&(te=b.from(te,te.offset,te.byteLength)),!b.isBuffer(te))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof te);if(void 0===W&&(W=0),void 0===de&&(de=te?te.length:0),void 0===Pe&&(Pe=0),void 0===Ee&&(Ee=this.length),W<0||de>te.length||Pe<0||Ee>this.length)throw new RangeError("out of range index");if(Pe>=Ee&&W>=de)return 0;if(Pe>=Ee)return-1;if(W>=de)return 1;if(this===te)return 0;let Ae=(Ee>>>=0)-(Pe>>>=0),St=(de>>>=0)-(W>>>=0);const Xe=Math.min(Ae,St),Je=this.slice(Pe,Ee),kt=te.slice(W,de);for(let Ye=0;Ye>>=0,isFinite(de)?(de>>>=0,void 0===Pe&&(Pe="utf8")):(Pe=de,de=void 0)}const Ee=this.length-W;if((void 0===de||de>Ee)&&(de=Ee),te.length>0&&(de<0||W<0)||W>this.length)throw new RangeError("Attempt to write outside buffer bounds");Pe||(Pe="utf8");let Ae=!1;for(;;)switch(Pe){case"hex":return re(this,te,W,de);case"utf8":case"utf-8":return ve(this,te,W,de);case"ascii":case"latin1":case"binary":return y(this,te,W,de);case"base64":return o(this,te,W,de);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l(this,te,W,de);default:if(Ae)throw new TypeError("Unknown encoding: "+Pe);Pe=(""+Pe).toLowerCase(),Ae=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const d=4096;function w(oe,te,W){let de="";W=Math.min(oe.length,W);for(let Pe=te;Pede)&&(W=de);let Pe="";for(let Ee=te;EeW)throw new RangeError("Trying to access beyond buffer length")}function k(oe,te,W,de,Pe,Ee){if(!b.isBuffer(oe))throw new TypeError('"buffer" argument must be a Buffer instance');if(te>Pe||teoe.length)throw new RangeError("Index out of range")}function q(oe,te,W,de,Pe){ue(te,de,Pe,oe,W,7);let Ee=Number(te&BigInt(4294967295));oe[W++]=Ee,Ee>>=8,oe[W++]=Ee,Ee>>=8,oe[W++]=Ee,Ee>>=8,oe[W++]=Ee;let Ae=Number(te>>BigInt(32)&BigInt(4294967295));return oe[W++]=Ae,Ae>>=8,oe[W++]=Ae,Ae>>=8,oe[W++]=Ae,Ae>>=8,oe[W++]=Ae,W}function he(oe,te,W,de,Pe){ue(te,de,Pe,oe,W,7);let Ee=Number(te&BigInt(4294967295));oe[W+7]=Ee,Ee>>=8,oe[W+6]=Ee,Ee>>=8,oe[W+5]=Ee,Ee>>=8,oe[W+4]=Ee;let Ae=Number(te>>BigInt(32)&BigInt(4294967295));return oe[W+3]=Ae,Ae>>=8,oe[W+2]=Ae,Ae>>=8,oe[W+1]=Ae,Ae>>=8,oe[W]=Ae,W+8}function be(oe,te,W,de,Pe,Ee){if(W+de>oe.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("Index out of range")}function ge(oe,te,W,de,Pe){return te=+te,W>>>=0,Pe||be(oe,0,W,4),S.write(oe,te,W,de,23,4),W+4}function fe(oe,te,W,de,Pe){return te=+te,W>>>=0,Pe||be(oe,0,W,8),S.write(oe,te,W,de,52,8),W+8}b.prototype.slice=function(te,W){const de=this.length;(te=~~te)<0?(te+=de)<0&&(te=0):te>de&&(te=de),(W=void 0===W?de:~~W)<0?(W+=de)<0&&(W=0):W>de&&(W=de),W>>=0,W>>>=0,de||$(te,W,this.length);let Pe=this[te],Ee=1,Ae=0;for(;++Ae>>=0,W>>>=0,de||$(te,W,this.length);let Pe=this[te+--W],Ee=1;for(;W>0&&(Ee*=256);)Pe+=this[te+--W]*Ee;return Pe},b.prototype.readUint8=b.prototype.readUInt8=function(te,W){return te>>>=0,W||$(te,1,this.length),this[te]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(te,W){return te>>>=0,W||$(te,2,this.length),this[te]|this[te+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(te,W){return te>>>=0,W||$(te,2,this.length),this[te]<<8|this[te+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(te,W){return te>>>=0,W||$(te,4,this.length),(this[te]|this[te+1]<<8|this[te+2]<<16)+16777216*this[te+3]},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(te,W){return te>>>=0,W||$(te,4,this.length),16777216*this[te]+(this[te+1]<<16|this[te+2]<<8|this[te+3])},b.prototype.readBigUInt64LE=wt(function(te){_e(te>>>=0,"offset");const W=this[te],de=this[te+7];(void 0===W||void 0===de)&&Me(te,this.length-8);const Pe=W+256*this[++te]+65536*this[++te]+this[++te]*2**24,Ee=this[++te]+256*this[++te]+65536*this[++te]+de*2**24;return BigInt(Pe)+(BigInt(Ee)<>>=0,"offset");const W=this[te],de=this[te+7];(void 0===W||void 0===de)&&Me(te,this.length-8);const Pe=W*2**24+65536*this[++te]+256*this[++te]+this[++te],Ee=this[++te]*2**24+65536*this[++te]+256*this[++te]+de;return(BigInt(Pe)<>>=0,W>>>=0,de||$(te,W,this.length);let Pe=this[te],Ee=1,Ae=0;for(;++Ae=Ee&&(Pe-=Math.pow(2,8*W)),Pe},b.prototype.readIntBE=function(te,W,de){te>>>=0,W>>>=0,de||$(te,W,this.length);let Pe=W,Ee=1,Ae=this[te+--Pe];for(;Pe>0&&(Ee*=256);)Ae+=this[te+--Pe]*Ee;return Ee*=128,Ae>=Ee&&(Ae-=Math.pow(2,8*W)),Ae},b.prototype.readInt8=function(te,W){return te>>>=0,W||$(te,1,this.length),128&this[te]?-1*(255-this[te]+1):this[te]},b.prototype.readInt16LE=function(te,W){te>>>=0,W||$(te,2,this.length);const de=this[te]|this[te+1]<<8;return 32768&de?4294901760|de:de},b.prototype.readInt16BE=function(te,W){te>>>=0,W||$(te,2,this.length);const de=this[te+1]|this[te]<<8;return 32768&de?4294901760|de:de},b.prototype.readInt32LE=function(te,W){return te>>>=0,W||$(te,4,this.length),this[te]|this[te+1]<<8|this[te+2]<<16|this[te+3]<<24},b.prototype.readInt32BE=function(te,W){return te>>>=0,W||$(te,4,this.length),this[te]<<24|this[te+1]<<16|this[te+2]<<8|this[te+3]},b.prototype.readBigInt64LE=wt(function(te){_e(te>>>=0,"offset");const W=this[te],de=this[te+7];return(void 0===W||void 0===de)&&Me(te,this.length-8),(BigInt(this[te+4]+256*this[te+5]+65536*this[te+6]+(de<<24))<>>=0,"offset");const W=this[te],de=this[te+7];(void 0===W||void 0===de)&&Me(te,this.length-8);const Pe=(W<<24)+65536*this[++te]+256*this[++te]+this[++te];return(BigInt(Pe)<>>=0,W||$(te,4,this.length),S.read(this,te,!0,23,4)},b.prototype.readFloatBE=function(te,W){return te>>>=0,W||$(te,4,this.length),S.read(this,te,!1,23,4)},b.prototype.readDoubleLE=function(te,W){return te>>>=0,W||$(te,8,this.length),S.read(this,te,!0,52,8)},b.prototype.readDoubleBE=function(te,W){return te>>>=0,W||$(te,8,this.length),S.read(this,te,!1,52,8)},b.prototype.writeUintLE=b.prototype.writeUIntLE=function(te,W,de,Pe){te=+te,W>>>=0,de>>>=0,Pe||k(this,te,W,de,Math.pow(2,8*de)-1,0);let Ee=1,Ae=0;for(this[W]=255&te;++Ae>>=0,de>>>=0,Pe||k(this,te,W,de,Math.pow(2,8*de)-1,0);let Ee=de-1,Ae=1;for(this[W+Ee]=255&te;--Ee>=0&&(Ae*=256);)this[W+Ee]=te/Ae&255;return W+de},b.prototype.writeUint8=b.prototype.writeUInt8=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,1,255,0),this[W]=255&te,W+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,2,65535,0),this[W]=255&te,this[W+1]=te>>>8,W+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,2,65535,0),this[W]=te>>>8,this[W+1]=255&te,W+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,4,4294967295,0),this[W+3]=te>>>24,this[W+2]=te>>>16,this[W+1]=te>>>8,this[W]=255&te,W+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,4,4294967295,0),this[W]=te>>>24,this[W+1]=te>>>16,this[W+2]=te>>>8,this[W+3]=255&te,W+4},b.prototype.writeBigUInt64LE=wt(function(te,W=0){return q(this,te,W,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=wt(function(te,W=0){return he(this,te,W,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(te,W,de,Pe){if(te=+te,W>>>=0,!Pe){const Xe=Math.pow(2,8*de-1);k(this,te,W,de,Xe-1,-Xe)}let Ee=0,Ae=1,St=0;for(this[W]=255&te;++Ee>0)-St&255;return W+de},b.prototype.writeIntBE=function(te,W,de,Pe){if(te=+te,W>>>=0,!Pe){const Xe=Math.pow(2,8*de-1);k(this,te,W,de,Xe-1,-Xe)}let Ee=de-1,Ae=1,St=0;for(this[W+Ee]=255&te;--Ee>=0&&(Ae*=256);)te<0&&0===St&&0!==this[W+Ee+1]&&(St=1),this[W+Ee]=(te/Ae>>0)-St&255;return W+de},b.prototype.writeInt8=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,1,127,-128),te<0&&(te=255+te+1),this[W]=255&te,W+1},b.prototype.writeInt16LE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,2,32767,-32768),this[W]=255&te,this[W+1]=te>>>8,W+2},b.prototype.writeInt16BE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,2,32767,-32768),this[W]=te>>>8,this[W+1]=255&te,W+2},b.prototype.writeInt32LE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,4,2147483647,-2147483648),this[W]=255&te,this[W+1]=te>>>8,this[W+2]=te>>>16,this[W+3]=te>>>24,W+4},b.prototype.writeInt32BE=function(te,W,de){return te=+te,W>>>=0,de||k(this,te,W,4,2147483647,-2147483648),te<0&&(te=4294967295+te+1),this[W]=te>>>24,this[W+1]=te>>>16,this[W+2]=te>>>8,this[W+3]=255&te,W+4},b.prototype.writeBigInt64LE=wt(function(te,W=0){return q(this,te,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=wt(function(te,W=0){return he(this,te,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeFloatLE=function(te,W,de){return ge(this,te,W,!0,de)},b.prototype.writeFloatBE=function(te,W,de){return ge(this,te,W,!1,de)},b.prototype.writeDoubleLE=function(te,W,de){return fe(this,te,W,!0,de)},b.prototype.writeDoubleBE=function(te,W,de){return fe(this,te,W,!1,de)},b.prototype.copy=function(te,W,de,Pe){if(!b.isBuffer(te))throw new TypeError("argument should be a Buffer");if(de||(de=0),!Pe&&0!==Pe&&(Pe=this.length),W>=te.length&&(W=te.length),W||(W=0),Pe>0&&Pe=this.length)throw new RangeError("Index out of range");if(Pe<0)throw new RangeError("sourceEnd out of bounds");Pe>this.length&&(Pe=this.length),te.length-W>>=0,de=void 0===de?this.length:de>>>0,te||(te=0),"number"==typeof te)for(Ee=W;Ee=de+4;W-=3)te=`_${oe.slice(W-3,W)}${te}`;return`${oe.slice(0,W)}${te}`}function ue(oe,te,W,de,Pe,Ee){if(oe>W||oe3?0===te||te===BigInt(0)?`>= 0${Ae} and < 2${Ae} ** ${8*(Ee+1)}${Ae}`:`>= -(2${Ae} ** ${8*(Ee+1)-1}${Ae}) and < 2 ** ${8*(Ee+1)-1}${Ae}`:`>= ${te}${Ae} and <= ${W}${Ae}`,new se.ERR_OUT_OF_RANGE("value",St,oe)}!function pe(oe,te,W){_e(te,"offset"),(void 0===oe[te]||void 0===oe[te+W])&&Me(te,oe.length-(W+1))}(de,Pe,Ee)}function _e(oe,te){if("number"!=typeof oe)throw new se.ERR_INVALID_ARG_TYPE(te,"number",oe)}function Me(oe,te,W){throw Math.floor(oe)!==oe?(_e(oe,W),new se.ERR_OUT_OF_RANGE(W||"offset","an integer",oe)):te<0?new se.ERR_BUFFER_OUT_OF_BOUNDS:new se.ERR_OUT_OF_RANGE(W||"offset",`>= ${W?1:0} and <= ${te}`,oe)}ce("ERR_BUFFER_OUT_OF_BOUNDS",function(oe){return oe?`${oe} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ce("ERR_INVALID_ARG_TYPE",function(oe,te){return`The "${oe}" argument must be of type number. Received type ${typeof te}`},TypeError),ce("ERR_OUT_OF_RANGE",function(oe,te,W){let de=`The value of "${oe}" is out of range.`,Pe=W;return Number.isInteger(W)&&Math.abs(W)>2**32?Pe=ee(String(W)):"bigint"==typeof W&&(Pe=String(W),(W>BigInt(2)**BigInt(32)||W<-(BigInt(2)**BigInt(32)))&&(Pe=ee(Pe)),Pe+="n"),de+=` It must be ${te}. Received ${Pe}`,de},RangeError);const le=/[^+/0-9A-Za-z-_]/g;function Y(oe,te){let W;te=te||1/0;const de=oe.length;let Pe=null;const Ee=[];for(let Ae=0;Ae55295&&W<57344){if(!Pe){if(W>56319){(te-=3)>-1&&Ee.push(239,191,189);continue}if(Ae+1===de){(te-=3)>-1&&Ee.push(239,191,189);continue}Pe=W;continue}if(W<56320){(te-=3)>-1&&Ee.push(239,191,189),Pe=W;continue}W=65536+(Pe-55296<<10|W-56320)}else Pe&&(te-=3)>-1&&Ee.push(239,191,189);if(Pe=null,W<128){if((te-=1)<0)break;Ee.push(W)}else if(W<2048){if((te-=2)<0)break;Ee.push(W>>6|192,63&W|128)}else if(W<65536){if((te-=3)<0)break;Ee.push(W>>12|224,W>>6&63|128,63&W|128)}else{if(!(W<1114112))throw new Error("Invalid code point");if((te-=4)<0)break;Ee.push(W>>18|240,W>>12&63|128,W>>6&63|128,63&W|128)}}return Ee}function xe(oe){return B.toByteArray(function ie(oe){if((oe=(oe=oe.split("=")[0]).trim().replace(le,"")).length<2)return"";for(;oe.length%4!=0;)oe+="=";return oe}(oe))}function Ce(oe,te,W,de){let Pe;for(Pe=0;Pe=te.length||Pe>=oe.length);++Pe)te[Pe+W]=oe[Pe];return Pe}function Re(oe,te){return oe instanceof te||null!=oe&&null!=oe.constructor&&null!=oe.constructor.name&&oe.constructor.name===te.name}function we(oe){return oe!=oe}const Oe=function(){const oe="0123456789abcdef",te=new Array(256);for(let W=0;W<16;++W){const de=16*W;for(let Pe=0;Pe<16;++Pe)te[de+Pe]=oe[W]+oe[Pe]}return te}();function wt(oe){return"undefined"==typeof BigInt?Be:oe}function Be(){throw new Error("BigInt not supported")}},7977:(ne,F,I)=>{"use strict";const R=F;R.bignum=I(3854),R.define=I(9516).define,R.base=I(7813),R.constants=I(5459),R.decoders=I(196),R.encoders=I(1131)},9516:(ne,F,I)=>{"use strict";const R=I(1131),B=I(196),S=I(3894);function f(M,_){this.name=M,this.body=_,this.decoders={},this.encoders={}}F.define=function(_,b){return new f(_,b)},f.prototype._createNamed=function(_){const b=this.name;function C(x){this._initNamed(x,b)}return S(C,_),C.prototype._initNamed=function(E,P){_.call(this,E,P)},new C(this)},f.prototype._getDecoder=function(_){return this.decoders.hasOwnProperty(_=_||"der")||(this.decoders[_]=this._createNamed(B[_])),this.decoders[_]},f.prototype.decode=function(_,b,C){return this._getDecoder(b).decode(_,C)},f.prototype._getEncoder=function(_){return this.encoders.hasOwnProperty(_=_||"der")||(this.encoders[_]=this._createNamed(R[_])),this.encoders[_]},f.prototype.encode=function(_,b,C){return this._getEncoder(b).encode(_,C)}},2769:(ne,F,I)=>{"use strict";const R=I(3894),B=I(4919).b,S=I(2038).Buffer;function T(M,_){B.call(this,_),S.isBuffer(M)?(this.base=M,this.offset=0,this.length=M.length):this.error("Input not Buffer")}function f(M,_){if(Array.isArray(M))this.length=0,this.value=M.map(function(b){return f.isEncoderBuffer(b)||(b=new f(b,_)),this.length+=b.length,b},this);else if("number"==typeof M){if(!(0<=M&&M<=255))return _.error("non-byte EncoderBuffer value");this.value=M,this.length=1}else if("string"==typeof M)this.value=M,this.length=S.byteLength(M);else{if(!S.isBuffer(M))return _.error("Unsupported type: "+typeof M);this.value=M,this.length=M.length}}R(T,B),F.C=T,T.isDecoderBuffer=function(_){return _ instanceof T||"object"==typeof _&&S.isBuffer(_.base)&&"DecoderBuffer"===_.constructor.name&&"number"==typeof _.offset&&"number"==typeof _.length&&"function"==typeof _.save&&"function"==typeof _.restore&&"function"==typeof _.isEmpty&&"function"==typeof _.readUInt8&&"function"==typeof _.skip&&"function"==typeof _.raw},T.prototype.save=function(){return{offset:this.offset,reporter:B.prototype.save.call(this)}},T.prototype.restore=function(_){const b=new T(this.base);return b.offset=_.offset,b.length=this.offset,this.offset=_.offset,B.prototype.restore.call(this,_.reporter),b},T.prototype.isEmpty=function(){return this.offset===this.length},T.prototype.readUInt8=function(_){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(_||"DecoderBuffer overrun")},T.prototype.skip=function(_,b){if(!(this.offset+_<=this.length))return this.error(b||"DecoderBuffer overrun");const C=new T(this.base);return C._reporterState=this._reporterState,C.offset=this.offset,C.length=this.offset+_,this.offset+=_,C},T.prototype.raw=function(_){return this.base.slice(_?_.offset:this.offset,this.length)},F.R=f,f.isEncoderBuffer=function(_){return _ instanceof f||"object"==typeof _&&"EncoderBuffer"===_.constructor.name&&"number"==typeof _.length&&"function"==typeof _.join},f.prototype.join=function(_,b){return _||(_=S.alloc(this.length)),b||(b=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(C){C.join(_,b),b+=C.length}):("number"==typeof this.value?_[b]=this.value:"string"==typeof this.value?_.write(this.value,b):S.isBuffer(this.value)&&this.value.copy(_,b),b+=this.length)),_}},7813:(ne,F,I)=>{"use strict";const R=F;R.Reporter=I(4919).b,R.DecoderBuffer=I(2769).C,R.EncoderBuffer=I(2769).R,R.Node=I(1430)},1430:(ne,F,I)=>{"use strict";const R=I(4919).b,B=I(2769).R,S=I(2769).C,T=I(2391),f=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],M=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(f);function b(x,E,P){const A={};this._baseState=A,A.name=P,A.enc=x,A.parent=E||null,A.children=null,A.tag=null,A.args=null,A.reverseArgs=null,A.choice=null,A.optional=!1,A.any=!1,A.obj=!1,A.use=null,A.useDecoder=null,A.key=null,A.default=null,A.explicit=null,A.implicit=null,A.contains=null,A.parent||(A.children=[],this._wrap())}ne.exports=b;const C=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];b.prototype.clone=function(){const E=this._baseState,P={};C.forEach(function(O){P[O]=E[O]});const A=new this.constructor(P.parent);return A._baseState=P,A},b.prototype._wrap=function(){const E=this._baseState;M.forEach(function(P){this[P]=function(){const O=new this.constructor(this);return E.children.push(O),O[P].apply(O,arguments)}},this)},b.prototype._init=function(E){const P=this._baseState;T(null===P.parent),E.call(this),P.children=P.children.filter(function(A){return A._baseState.parent===this},this),T.equal(P.children.length,1,"Root node can have only one child")},b.prototype._useArgs=function(E){const P=this._baseState,A=E.filter(function(O){return O instanceof this.constructor},this);E=E.filter(function(O){return!(O instanceof this.constructor)},this),0!==A.length&&(T(null===P.children),P.children=A,A.forEach(function(O){O._baseState.parent=this},this)),0!==E.length&&(T(null===P.args),P.args=E,P.reverseArgs=E.map(function(O){if("object"!=typeof O||O.constructor!==Object)return O;const N={};return Object.keys(O).forEach(function(U){U==(0|U)&&(U|=0),N[O[U]]=U}),N}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(x){b.prototype[x]=function(){throw new Error(x+" not implemented for encoding: "+this._baseState.enc)}}),f.forEach(function(x){b.prototype[x]=function(){const P=this._baseState,A=Array.prototype.slice.call(arguments);return T(null===P.tag),P.tag=x,this._useArgs(A),this}}),b.prototype.use=function(E){T(E);const P=this._baseState;return T(null===P.use),P.use=E,this},b.prototype.optional=function(){return this._baseState.optional=!0,this},b.prototype.def=function(E){const P=this._baseState;return T(null===P.default),P.default=E,P.optional=!0,this},b.prototype.explicit=function(E){const P=this._baseState;return T(null===P.explicit&&null===P.implicit),P.explicit=E,this},b.prototype.implicit=function(E){const P=this._baseState;return T(null===P.explicit&&null===P.implicit),P.implicit=E,this},b.prototype.obj=function(){const E=this._baseState,P=Array.prototype.slice.call(arguments);return E.obj=!0,0!==P.length&&this._useArgs(P),this},b.prototype.key=function(E){const P=this._baseState;return T(null===P.key),P.key=E,this},b.prototype.any=function(){return this._baseState.any=!0,this},b.prototype.choice=function(E){const P=this._baseState;return T(null===P.choice),P.choice=E,this._useArgs(Object.keys(E).map(function(A){return E[A]})),this},b.prototype.contains=function(E){const P=this._baseState;return T(null===P.use),P.contains=E,this},b.prototype._decode=function(E,P){const A=this._baseState;if(null===A.parent)return E.wrapResult(A.children[0]._decode(E,P));let H,O=A.default,N=!0,U=null;if(null!==A.key&&(U=E.enterKey(A.key)),A.optional){let V=null;if(null!==A.explicit?V=A.explicit:null!==A.implicit?V=A.implicit:null!==A.tag&&(V=A.tag),null!==V||A.any){if(N=this._peekTag(E,V,A.any),E.isError(N))return N}else{const G=E.save();try{null===A.choice?this._decodeGeneric(A.tag,E,P):this._decodeChoice(E,P),N=!0}catch(K){N=!1}E.restore(G)}}if(A.obj&&N&&(H=E.enterObject()),N){if(null!==A.explicit){const G=this._decodeTag(E,A.explicit);if(E.isError(G))return G;E=G}const V=E.offset;if(null===A.use&&null===A.choice){let G;A.any&&(G=E.save());const K=this._decodeTag(E,null!==A.implicit?A.implicit:A.tag,A.any);if(E.isError(K))return K;A.any?O=E.raw(G):E=K}if(P&&P.track&&null!==A.tag&&P.track(E.path(),V,E.length,"tagged"),P&&P.track&&null!==A.tag&&P.track(E.path(),E.offset,E.length,"content"),A.any||(O=null===A.choice?this._decodeGeneric(A.tag,E,P):this._decodeChoice(E,P)),E.isError(O))return O;if(!A.any&&null===A.choice&&null!==A.children&&A.children.forEach(function(K){K._decode(E,P)}),A.contains&&("octstr"===A.tag||"bitstr"===A.tag)){const G=new S(O);O=this._getUse(A.contains,E._reporterState.obj)._decode(G,P)}}return A.obj&&N&&(O=E.leaveObject(H)),null===A.key||null===O&&!0!==N?null!==U&&E.exitKey(U):E.leaveKey(U,A.key,O),O},b.prototype._decodeGeneric=function(E,P,A){const O=this._baseState;return"seq"===E||"set"===E?null:"seqof"===E||"setof"===E?this._decodeList(P,E,O.args[0],A):/str$/.test(E)?this._decodeStr(P,E,A):"objid"===E&&O.args?this._decodeObjid(P,O.args[0],O.args[1],A):"objid"===E?this._decodeObjid(P,null,null,A):"gentime"===E||"utctime"===E?this._decodeTime(P,E,A):"null_"===E?this._decodeNull(P,A):"bool"===E?this._decodeBool(P,A):"objDesc"===E?this._decodeStr(P,E,A):"int"===E||"enum"===E?this._decodeInt(P,O.args&&O.args[0],A):null!==O.use?this._getUse(O.use,P._reporterState.obj)._decode(P,A):P.error("unknown tag: "+E)},b.prototype._getUse=function(E,P){const A=this._baseState;return A.useDecoder=this._use(E,P),T(null===A.useDecoder._baseState.parent),A.useDecoder=A.useDecoder._baseState.children[0],A.implicit!==A.useDecoder._baseState.implicit&&(A.useDecoder=A.useDecoder.clone(),A.useDecoder._baseState.implicit=A.implicit),A.useDecoder},b.prototype._decodeChoice=function(E,P){const A=this._baseState;let O=null,N=!1;return Object.keys(A.choice).some(function(U){const H=E.save(),V=A.choice[U];try{const G=V._decode(E,P);if(E.isError(G))return!1;O={type:U,value:G},N=!0}catch(G){return E.restore(H),!1}return!0},this),N?O:E.error("Choice not matched")},b.prototype._createEncoderBuffer=function(E){return new B(E,this.reporter)},b.prototype._encode=function(E,P,A){const O=this._baseState;if(null!==O.default&&O.default===E)return;const N=this._encodeValue(E,P,A);return void 0===N||this._skipDefault(N,P,A)?void 0:N},b.prototype._encodeValue=function(E,P,A){const O=this._baseState;if(null===O.parent)return O.children[0]._encode(E,P||new R);let N=null;if(this.reporter=P,O.optional&&void 0===E){if(null===O.default)return;E=O.default}let U=null,H=!1;if(O.any)N=this._createEncoderBuffer(E);else if(O.choice)N=this._encodeChoice(E,P);else if(O.contains)U=this._getUse(O.contains,A)._encode(E,P),H=!0;else if(O.children)U=O.children.map(function(V){if("null_"===V._baseState.tag)return V._encode(null,P,E);if(null===V._baseState.key)return P.error("Child should have a key");const G=P.enterKey(V._baseState.key);if("object"!=typeof E)return P.error("Child expected, but input is not object");const K=V._encode(E[V._baseState.key],P,E);return P.leaveKey(G),K},this).filter(function(V){return V}),U=this._createEncoderBuffer(U);else if("seqof"===O.tag||"setof"===O.tag){if(!O.args||1!==O.args.length)return P.error("Too many args for : "+O.tag);if(!Array.isArray(E))return P.error("seqof/setof, but data is not Array");const V=this.clone();V._baseState.implicit=null,U=this._createEncoderBuffer(E.map(function(G){return this._getUse(this._baseState.args[0],E)._encode(G,P)},V))}else null!==O.use?N=this._getUse(O.use,A)._encode(E,P):(U=this._encodePrimitive(O.tag,E),H=!0);if(!O.any&&null===O.choice){const V=null!==O.implicit?O.implicit:O.tag,G=null===O.implicit?"universal":"context";null===V?null===O.use&&P.error("Tag could be omitted only for .use()"):null===O.use&&(N=this._encodeComposite(V,H,G,U))}return null!==O.explicit&&(N=this._encodeComposite(O.explicit,!1,"context",N)),N},b.prototype._encodeChoice=function(E,P){const A=this._baseState,O=A.choice[E.type];return O||T(!1,E.type+" not found in "+JSON.stringify(Object.keys(A.choice))),O._encode(E.value,P)},b.prototype._encodePrimitive=function(E,P){const A=this._baseState;if(/str$/.test(E))return this._encodeStr(P,E);if("objid"===E&&A.args)return this._encodeObjid(P,A.reverseArgs[0],A.args[1]);if("objid"===E)return this._encodeObjid(P,null,null);if("gentime"===E||"utctime"===E)return this._encodeTime(P,E);if("null_"===E)return this._encodeNull();if("int"===E||"enum"===E)return this._encodeInt(P,A.args&&A.reverseArgs[0]);if("bool"===E)return this._encodeBool(P);if("objDesc"===E)return this._encodeStr(P,E);throw new Error("Unsupported tag: "+E)},b.prototype._isNumstr=function(E){return/^[0-9 ]*$/.test(E)},b.prototype._isPrintstr=function(E){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(E)}},4919:(ne,F,I)=>{"use strict";const R=I(3894);function B(T){this._reporterState={obj:null,path:[],options:T||{},errors:[]}}function S(T,f){this.path=T,this.rethrow(f)}F.b=B,B.prototype.isError=function(f){return f instanceof S},B.prototype.save=function(){const f=this._reporterState;return{obj:f.obj,pathLen:f.path.length}},B.prototype.restore=function(f){const M=this._reporterState;M.obj=f.obj,M.path=M.path.slice(0,f.pathLen)},B.prototype.enterKey=function(f){return this._reporterState.path.push(f)},B.prototype.exitKey=function(f){const M=this._reporterState;M.path=M.path.slice(0,f-1)},B.prototype.leaveKey=function(f,M,_){const b=this._reporterState;this.exitKey(f),null!==b.obj&&(b.obj[M]=_)},B.prototype.path=function(){return this._reporterState.path.join("/")},B.prototype.enterObject=function(){const f=this._reporterState,M=f.obj;return f.obj={},M},B.prototype.leaveObject=function(f){const M=this._reporterState,_=M.obj;return M.obj=f,_},B.prototype.error=function(f){let M;const _=this._reporterState,b=f instanceof S;if(M=b?f:new S(_.path.map(function(C){return"["+JSON.stringify(C)+"]"}).join(""),f.message||f,f.stack),!_.options.partial)throw M;return b||_.errors.push(M),M},B.prototype.wrapResult=function(f){const M=this._reporterState;return M.options.partial?{result:this.isError(f)?null:f,errors:M.errors}:f},R(S,Error),S.prototype.rethrow=function(f){if(this.message=f+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,S),!this.stack)try{throw new Error(this.message)}catch(M){this.stack=M.stack}return this}},5496:(ne,F)=>{"use strict";function I(R){const B={};return Object.keys(R).forEach(function(S){(0|S)==S&&(S|=0),B[R[S]]=S}),B}F.tagClass={0:"universal",1:"application",2:"context",3:"private"},F.tagClassByName=I(F.tagClass),F.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},F.tagByName=I(F.tag)},5459:(ne,F,I)=>{"use strict";const R=F;R._reverse=function(S){const T={};return Object.keys(S).forEach(function(f){(0|f)==f&&(f|=0),T[S[f]]=f}),T},R.der=I(5496)},7127:(ne,F,I)=>{"use strict";const R=I(3894),B=I(3854),S=I(2769).C,T=I(1430),f=I(5496);function M(x){this.enc="der",this.name=x.name,this.entity=x,this.tree=new _,this.tree._init(x.body)}function _(x){T.call(this,"der",x)}function b(x,E){let P=x.readUInt8(E);if(x.isError(P))return P;const A=f.tagClass[P>>6],O=0==(32&P);if(31==(31&P)){let U=P;for(P=0;128==(128&U);){if(U=x.readUInt8(E),x.isError(U))return U;P<<=7,P|=127&U}}else P&=31;return{cls:A,primitive:O,tag:P,tagStr:f.tag[P]}}function C(x,E,P){let A=x.readUInt8(P);if(x.isError(A))return A;if(!E&&128===A)return null;if(0==(128&A))return A;const O=127&A;if(O>4)return x.error("length octect is too long");A=0;for(let N=0;N{"use strict";const R=F;R.der=I(7127),R.pem=I(9617)},9617:(ne,F,I)=>{"use strict";const R=I(3894),B=I(2038).Buffer,S=I(7127);function T(f){S.call(this,f),this.enc="pem"}R(T,S),ne.exports=T,T.prototype.decode=function(M,_){const b=M.toString().split(/[\r\n]+/g),C=_.label.toUpperCase(),x=/^-----(BEGIN|END) ([^-]+)-----$/;let E=-1,P=-1;for(let N=0;N{"use strict";const R=I(3894),B=I(2038).Buffer,S=I(1430),T=I(5496);function f(C){this.enc="der",this.name=C.name,this.entity=C,this.tree=new M,this.tree._init(C.body)}function M(C){S.call(this,"der",C)}function _(C){return C<10?"0"+C:C}ne.exports=f,f.prototype.encode=function(x,E){return this.tree._encode(x,E).join()},R(M,S),M.prototype._encodeComposite=function(x,E,P,A){const O=function b(C,x,E,P){let A;if("seqof"===C?C="seq":"setof"===C&&(C="set"),T.tagByName.hasOwnProperty(C))A=T.tagByName[C];else{if("number"!=typeof C||(0|C)!==C)return P.error("Unknown tag: "+C);A=C}return A>=31?P.error("Multi-octet tag encoding unsupported"):(x||(A|=32),A|=T.tagClassByName[E||"universal"]<<6,A)}(x,E,P,this.reporter);if(A.length<128){const H=B.alloc(2);return H[0]=O,H[1]=A.length,this._createEncoderBuffer([H,A])}let N=1;for(let H=A.length;H>=256;H>>=8)N++;const U=B.alloc(2+N);U[0]=O,U[1]=128|N;for(let H=1+N,V=A.length;V>0;H--,V>>=8)U[H]=255&V;return this._createEncoderBuffer([U,A])},M.prototype._encodeStr=function(x,E){if("bitstr"===E)return this._createEncoderBuffer([0|x.unused,x.data]);if("bmpstr"===E){const P=B.alloc(2*x.length);for(let A=0;A=40)return this.reporter.error("Second objid identifier OOB");x.splice(0,2,40*x[0]+x[1])}let A=0;for(let U=0;U=128;H>>=7)A++}const O=B.alloc(A);let N=O.length-1;for(let U=x.length-1;U>=0;U--){let H=x[U];for(O[N--]=127&H;(H>>=7)>0;)O[N--]=128|127&H}return this._createEncoderBuffer(O)},M.prototype._encodeTime=function(x,E){let P;const A=new Date(x);return"gentime"===E?P=[_(A.getUTCFullYear()),_(A.getUTCMonth()+1),_(A.getUTCDate()),_(A.getUTCHours()),_(A.getUTCMinutes()),_(A.getUTCSeconds()),"Z"].join(""):"utctime"===E?P=[_(A.getUTCFullYear()%100),_(A.getUTCMonth()+1),_(A.getUTCDate()),_(A.getUTCHours()),_(A.getUTCMinutes()),_(A.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+E+" time is not supported yet"),this._encodeStr(P,"octstr")},M.prototype._encodeNull=function(){return this._createEncoderBuffer("")},M.prototype._encodeInt=function(x,E){if("string"==typeof x){if(!E)return this.reporter.error("String int or enum given, but no values map");if(!E.hasOwnProperty(x))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(x));x=E[x]}if("number"!=typeof x&&!B.isBuffer(x)){const O=x.toArray();!x.sign&&128&O[0]&&O.unshift(0),x=B.from(O)}if(B.isBuffer(x)){let O=x.length;0===x.length&&O++;const N=B.alloc(O);return x.copy(N),0===x.length&&(N[0]=0),this._createEncoderBuffer(N)}if(x<128)return this._createEncoderBuffer(x);if(x<256)return this._createEncoderBuffer([0,x]);let P=1;for(let O=x;O>=256;O>>=8)P++;const A=new Array(P);for(let O=A.length-1;O>=0;O--)A[O]=255&x,x>>=8;return 128&A[0]&&A.unshift(0),this._createEncoderBuffer(B.from(A))},M.prototype._encodeBool=function(x){return this._createEncoderBuffer(x?255:0)},M.prototype._use=function(x,E){return"function"==typeof x&&(x=x(E)),x._getEncoder("der").tree},M.prototype._skipDefault=function(x,E,P){const A=this._baseState;let O;if(null===A.default)return!1;const N=x.join();if(void 0===A.defaultBuffer&&(A.defaultBuffer=this._encodeValue(A.default,E,P).join()),N.length!==A.defaultBuffer.length)return!1;for(O=0;O{"use strict";const R=F;R.der=I(6374),R.pem=I(3530)},3530:(ne,F,I)=>{"use strict";const R=I(3894),B=I(6374);function S(T){B.call(this,T),this.enc="pem"}R(S,B),ne.exports=S,S.prototype.encode=function(f,M){const b=B.prototype.encode.call(this,f).toString("base64"),C=["-----BEGIN "+M.label+"-----"];for(let x=0;x=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},3014:(ne,F,I)=>{ne.exports=I(7114)},7729:(ne,F,I)=>{"use strict";var R=I(4701),B=I(858),S=I(5738),T=I(1625),f=I(5215),M=I(2099),_=I(6100),b=I(5593),C=I(3324),x=I(1413);ne.exports=function(P){return new Promise(function(O,N){var G,U=P.data,H=P.headers,V=P.responseType;function K(){P.cancelToken&&P.cancelToken.unsubscribe(G),P.signal&&P.signal.removeEventListener("abort",G)}R.isFormData(U)&&delete H["Content-Type"];var X=new XMLHttpRequest;if(P.auth){var Z=P.auth.username||"",z=P.auth.password?unescape(encodeURIComponent(P.auth.password)):"";H.Authorization="Basic "+btoa(Z+":"+z)}var J=f(P.baseURL,P.url);function re(){if(X){var y="getAllResponseHeaders"in X?M(X.getAllResponseHeaders()):null;B(function(u){O(u),K()},function(u){N(u),K()},{data:V&&"text"!==V&&"json"!==V?X.response:X.responseText,status:X.status,statusText:X.statusText,headers:y,config:P,request:X}),X=null}}if(X.open(P.method.toUpperCase(),T(J,P.params,P.paramsSerializer),!0),X.timeout=P.timeout,"onloadend"in X?X.onloadend=re:X.onreadystatechange=function(){!X||4!==X.readyState||0===X.status&&(!X.responseURL||0!==X.responseURL.indexOf("file:"))||setTimeout(re)},X.onabort=function(){!X||(N(b("Request aborted",P,"ECONNABORTED",X)),X=null)},X.onerror=function(){N(b("Network Error",P,null,X)),X=null},X.ontimeout=function(){var o=P.timeout?"timeout of "+P.timeout+"ms exceeded":"timeout exceeded";P.timeoutErrorMessage&&(o=P.timeoutErrorMessage),N(b(o,P,(P.transitional||C.transitional).clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",X)),X=null},R.isStandardBrowserEnv()){var ve=(P.withCredentials||_(J))&&P.xsrfCookieName?S.read(P.xsrfCookieName):void 0;ve&&(H[P.xsrfHeaderName]=ve)}"setRequestHeader"in X&&R.forEach(H,function(o,l){void 0===U&&"content-type"===l.toLowerCase()?delete H[l]:X.setRequestHeader(l,o)}),R.isUndefined(P.withCredentials)||(X.withCredentials=!!P.withCredentials),V&&"json"!==V&&(X.responseType=P.responseType),"function"==typeof P.onDownloadProgress&&X.addEventListener("progress",P.onDownloadProgress),"function"==typeof P.onUploadProgress&&X.upload&&X.upload.addEventListener("progress",P.onUploadProgress),(P.cancelToken||P.signal)&&(G=function(y){!X||(N(!y||y&&y.type?new x("canceled"):y),X.abort(),X=null)},P.cancelToken&&P.cancelToken.subscribe(G),P.signal&&(P.signal.aborted?G():P.signal.addEventListener("abort",G))),U||(U=null),X.send(U)})}},7114:(ne,F,I)=>{"use strict";var R=I(4701),B=I(2414),S=I(6490),T=I(2971),_=function M(b){var C=new S(b),x=B(S.prototype.request,C);return R.extend(x,S.prototype,C),R.extend(x,C),x.create=function(P){return M(T(b,P))},x}(I(3324));_.Axios=S,_.Cancel=I(1413),_.CancelToken=I(3056),_.isCancel=I(8827),_.VERSION=I(1773).version,_.all=function(C){return Promise.all(C)},_.spread=I(9211),_.isAxiosError=I(4603),ne.exports=_,ne.exports.default=_},1413:ne=>{"use strict";function F(I){this.message=I}F.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},F.prototype.__CANCEL__=!0,ne.exports=F},3056:(ne,F,I)=>{"use strict";var R=I(1413);function B(S){if("function"!=typeof S)throw new TypeError("executor must be a function.");var T;this.promise=new Promise(function(_){T=_});var f=this;this.promise.then(function(M){if(f._listeners){var _,b=f._listeners.length;for(_=0;_{"use strict";ne.exports=function(I){return!(!I||!I.__CANCEL__)}},6490:(ne,F,I)=>{"use strict";var R=I(4701),B=I(1625),S=I(607),T=I(957),f=I(2971),M=I(4828),_=M.validators;function b(C){this.defaults=C,this.interceptors={request:new S,response:new S}}b.prototype.request=function(x){"string"==typeof x?(x=arguments[1]||{}).url=arguments[0]:x=x||{},(x=f(this.defaults,x)).method=x.method?x.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var E=x.transitional;void 0!==E&&M.assertOptions(E,{silentJSONParsing:_.transitional(_.boolean),forcedJSONParsing:_.transitional(_.boolean),clarifyTimeoutError:_.transitional(_.boolean)},!1);var P=[],A=!0;this.interceptors.request.forEach(function(X){"function"==typeof X.runWhen&&!1===X.runWhen(x)||(A=A&&X.synchronous,P.unshift(X.fulfilled,X.rejected))});var N,O=[];if(this.interceptors.response.forEach(function(X){O.push(X.fulfilled,X.rejected)}),!A){var U=[T,void 0];for(Array.prototype.unshift.apply(U,P),U=U.concat(O),N=Promise.resolve(x);U.length;)N=N.then(U.shift(),U.shift());return N}for(var H=x;P.length;){var V=P.shift(),G=P.shift();try{H=V(H)}catch(K){G(K);break}}try{N=T(H)}catch(K){return Promise.reject(K)}for(;O.length;)N=N.then(O.shift(),O.shift());return N},b.prototype.getUri=function(x){return x=f(this.defaults,x),B(x.url,x.params,x.paramsSerializer).replace(/^\?/,"")},R.forEach(["delete","get","head","options"],function(x){b.prototype[x]=function(E,P){return this.request(f(P||{},{method:x,url:E,data:(P||{}).data}))}}),R.forEach(["post","put","patch"],function(x){b.prototype[x]=function(E,P,A){return this.request(f(A||{},{method:x,url:E,data:P}))}}),ne.exports=b},607:(ne,F,I)=>{"use strict";var R=I(4701);function B(){this.handlers=[]}B.prototype.use=function(T,f,M){return this.handlers.push({fulfilled:T,rejected:f,synchronous:!!M&&M.synchronous,runWhen:M?M.runWhen:null}),this.handlers.length-1},B.prototype.eject=function(T){this.handlers[T]&&(this.handlers[T]=null)},B.prototype.forEach=function(T){R.forEach(this.handlers,function(M){null!==M&&T(M)})},ne.exports=B},5215:(ne,F,I)=>{"use strict";var R=I(8692),B=I(4554);ne.exports=function(T,f){return T&&!R(f)?B(T,f):f}},5593:(ne,F,I)=>{"use strict";var R=I(5124);ne.exports=function(S,T,f,M,_){var b=new Error(S);return R(b,T,f,M,_)}},957:(ne,F,I)=>{"use strict";var R=I(4701),B=I(5134),S=I(8827),T=I(3324),f=I(1413);function M(_){if(_.cancelToken&&_.cancelToken.throwIfRequested(),_.signal&&_.signal.aborted)throw new f("canceled")}ne.exports=function(b){return M(b),b.headers=b.headers||{},b.data=B.call(b,b.data,b.headers,b.transformRequest),b.headers=R.merge(b.headers.common||{},b.headers[b.method]||{},b.headers),R.forEach(["delete","get","head","post","put","patch","common"],function(E){delete b.headers[E]}),(b.adapter||T.adapter)(b).then(function(E){return M(b),E.data=B.call(b,E.data,E.headers,b.transformResponse),E},function(E){return S(E)||(M(b),E&&E.response&&(E.response.data=B.call(b,E.response.data,E.response.headers,b.transformResponse))),Promise.reject(E)})}},5124:ne=>{"use strict";ne.exports=function(I,R,B,S,T){return I.config=R,B&&(I.code=B),I.request=S,I.response=T,I.isAxiosError=!0,I.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},I}},2971:(ne,F,I)=>{"use strict";var R=I(4701);ne.exports=function(S,T){T=T||{};var f={};function M(P,A){return R.isPlainObject(P)&&R.isPlainObject(A)?R.merge(P,A):R.isPlainObject(A)?R.merge({},A):R.isArray(A)?A.slice():A}function _(P){return R.isUndefined(T[P])?R.isUndefined(S[P])?void 0:M(void 0,S[P]):M(S[P],T[P])}function b(P){if(!R.isUndefined(T[P]))return M(void 0,T[P])}function C(P){return R.isUndefined(T[P])?R.isUndefined(S[P])?void 0:M(void 0,S[P]):M(void 0,T[P])}function x(P){return P in T?M(S[P],T[P]):P in S?M(void 0,S[P]):void 0}var E={url:b,method:b,data:b,baseURL:C,transformRequest:C,transformResponse:C,paramsSerializer:C,timeout:C,timeoutMessage:C,withCredentials:C,adapter:C,responseType:C,xsrfCookieName:C,xsrfHeaderName:C,onUploadProgress:C,onDownloadProgress:C,decompress:C,maxContentLength:C,maxBodyLength:C,transport:C,httpAgent:C,httpsAgent:C,cancelToken:C,socketPath:C,responseEncoding:C,validateStatus:x};return R.forEach(Object.keys(S).concat(Object.keys(T)),function(A){var O=E[A]||_,N=O(A);R.isUndefined(N)&&O!==x||(f[A]=N)}),f}},858:(ne,F,I)=>{"use strict";var R=I(5593);ne.exports=function(S,T,f){var M=f.config.validateStatus;f.status&&M&&!M(f.status)?T(R("Request failed with status code "+f.status,f.config,null,f.request,f)):S(f)}},5134:(ne,F,I)=>{"use strict";var R=I(4701),B=I(3324);ne.exports=function(T,f,M){var _=this||B;return R.forEach(M,function(C){T=C.call(_,T,f)}),T}},3324:(ne,F,I)=>{"use strict";var R=I(4701),B=I(5620),S=I(5124),T={"Content-Type":"application/x-www-form-urlencoded"};function f(C,x){!R.isUndefined(C)&&R.isUndefined(C["Content-Type"])&&(C["Content-Type"]=x)}var b={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function M(){var C;return("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(C=I(7729)),C}(),transformRequest:[function(x,E){return B(E,"Accept"),B(E,"Content-Type"),R.isFormData(x)||R.isArrayBuffer(x)||R.isBuffer(x)||R.isStream(x)||R.isFile(x)||R.isBlob(x)?x:R.isArrayBufferView(x)?x.buffer:R.isURLSearchParams(x)?(f(E,"application/x-www-form-urlencoded;charset=utf-8"),x.toString()):R.isObject(x)||E&&"application/json"===E["Content-Type"]?(f(E,"application/json"),function _(C,x,E){if(R.isString(C))try{return(x||JSON.parse)(C),R.trim(C)}catch(P){if("SyntaxError"!==P.name)throw P}return(E||JSON.stringify)(C)}(x)):x}],transformResponse:[function(x){var E=this.transitional||b.transitional,O=!(E&&E.silentJSONParsing)&&"json"===this.responseType;if(O||E&&E.forcedJSONParsing&&R.isString(x)&&x.length)try{return JSON.parse(x)}catch(N){if(O)throw"SyntaxError"===N.name?S(N,this,"E_JSON_PARSE"):N}return x}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(x){return x>=200&&x<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};R.forEach(["delete","get","head"],function(x){b.headers[x]={}}),R.forEach(["post","put","patch"],function(x){b.headers[x]=R.merge(T)}),ne.exports=b},1773:ne=>{ne.exports={version:"0.24.0"}},2414:ne=>{"use strict";ne.exports=function(I,R){return function(){for(var S=new Array(arguments.length),T=0;T{"use strict";var R=I(4701);function B(S){return encodeURIComponent(S).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}ne.exports=function(T,f,M){if(!f)return T;var _;if(M)_=M(f);else if(R.isURLSearchParams(f))_=f.toString();else{var b=[];R.forEach(f,function(E,P){null==E||(R.isArray(E)?P+="[]":E=[E],R.forEach(E,function(O){R.isDate(O)?O=O.toISOString():R.isObject(O)&&(O=JSON.stringify(O)),b.push(B(P)+"="+B(O))}))}),_=b.join("&")}if(_){var C=T.indexOf("#");-1!==C&&(T=T.slice(0,C)),T+=(-1===T.indexOf("?")?"?":"&")+_}return T}},4554:ne=>{"use strict";ne.exports=function(I,R){return R?I.replace(/\/+$/,"")+"/"+R.replace(/^\/+/,""):I}},5738:(ne,F,I)=>{"use strict";var R=I(4701);ne.exports=R.isStandardBrowserEnv()?{write:function(T,f,M,_,b,C){var x=[];x.push(T+"="+encodeURIComponent(f)),R.isNumber(M)&&x.push("expires="+new Date(M).toGMTString()),R.isString(_)&&x.push("path="+_),R.isString(b)&&x.push("domain="+b),!0===C&&x.push("secure"),document.cookie=x.join("; ")},read:function(T){var f=document.cookie.match(new RegExp("(^|;\\s*)("+T+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove:function(T){this.write(T,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},8692:ne=>{"use strict";ne.exports=function(I){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(I)}},4603:ne=>{"use strict";ne.exports=function(I){return"object"==typeof I&&!0===I.isAxiosError}},6100:(ne,F,I)=>{"use strict";var R=I(4701);ne.exports=R.isStandardBrowserEnv()?function(){var f,S=/(msie|trident)/i.test(navigator.userAgent),T=document.createElement("a");function M(_){var b=_;return S&&(T.setAttribute("href",b),b=T.href),T.setAttribute("href",b),{href:T.href,protocol:T.protocol?T.protocol.replace(/:$/,""):"",host:T.host,search:T.search?T.search.replace(/^\?/,""):"",hash:T.hash?T.hash.replace(/^#/,""):"",hostname:T.hostname,port:T.port,pathname:"/"===T.pathname.charAt(0)?T.pathname:"/"+T.pathname}}return f=M(window.location.href),function(b){var C=R.isString(b)?M(b):b;return C.protocol===f.protocol&&C.host===f.host}}():function(){return!0}},5620:(ne,F,I)=>{"use strict";var R=I(4701);ne.exports=function(S,T){R.forEach(S,function(M,_){_!==T&&_.toUpperCase()===T.toUpperCase()&&(S[T]=M,delete S[_])})}},2099:(ne,F,I)=>{"use strict";var R=I(4701),B=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];ne.exports=function(T){var M,_,b,f={};return T&&R.forEach(T.split("\n"),function(x){if(b=x.indexOf(":"),M=R.trim(x.substr(0,b)).toLowerCase(),_=R.trim(x.substr(b+1)),M){if(f[M]&&B.indexOf(M)>=0)return;f[M]="set-cookie"===M?(f[M]?f[M]:[]).concat([_]):f[M]?f[M]+", "+_:_}}),f}},9211:ne=>{"use strict";ne.exports=function(I){return function(B){return I.apply(null,B)}}},4828:(ne,F,I)=>{"use strict";var R=I(1773).version,B={};["object","boolean","number","function","string","symbol"].forEach(function(f,M){B[f]=function(b){return typeof b===f||"a"+(M<1?"n ":" ")+f}});var S={};B.transitional=function(M,_,b){function C(x,E){return"[Axios v"+R+"] Transitional option '"+x+"'"+E+(b?". "+b:"")}return function(x,E,P){if(!1===M)throw new Error(C(E," has been removed"+(_?" in "+_:"")));return _&&!S[E]&&(S[E]=!0,console.warn(C(E," has been deprecated since v"+_+" and will be removed in the near future"))),!M||M(x,E,P)}},ne.exports={assertOptions:function T(f,M,_){if("object"!=typeof f)throw new TypeError("options must be an object");for(var b=Object.keys(f),C=b.length;C-- >0;){var x=b[C],E=M[x];if(E){var P=f[x],A=void 0===P||E(P,x,f);if(!0!==A)throw new TypeError("option "+x+" must be "+A)}else if(!0!==_)throw Error("Unknown option "+x)}},validators:B}},4701:(ne,F,I)=>{"use strict";var R=I(2414),B=Object.prototype.toString;function S(re){return"[object Array]"===B.call(re)}function T(re){return void 0===re}function E(re){return null!==re&&"object"==typeof re}function P(re){if("[object Object]"!==B.call(re))return!1;var ve=Object.getPrototypeOf(re);return null===ve||ve===Object.prototype}function U(re){return"[object Function]"===B.call(re)}function X(re,ve){if(null!=re)if("object"!=typeof re&&(re=[re]),S(re))for(var y=0,o=re.length;y{"use strict";var R=I(3502).Buffer;ne.exports=function B(S){if(S.length>=255)throw new TypeError("Alphabet too long");for(var T=new Uint8Array(256),f=0;f>>0,X=new Uint8Array(K);U[H];){var Z=T[U.charCodeAt(H)];if(255===Z)return;for(var z=0,J=K-1;(0!==Z||z>>0)%256>>>0,Z=Z/256>>>0;if(0!==Z)throw new Error("Non-zero carry");G=z,H++}if(" "!==U[H]){for(var re=K-G;re!==K&&0===X[re];)re++;var ve=R.allocUnsafe(V+(K-re));ve.fill(0,0,V);for(var y=V;re!==K;)ve[y++]=X[re++];return ve}}}return{encode:function A(U){if((Array.isArray(U)||U instanceof Uint8Array)&&(U=R.from(U)),!R.isBuffer(U))throw new TypeError("Expected Buffer");if(0===U.length)return"";for(var H=0,V=0,G=0,K=U.length;G!==K&&0===U[G];)G++,H++;for(var X=(K-G)*P+1>>>0,Z=new Uint8Array(X);G!==K;){for(var z=U[G],J=0,re=X-1;(0!==z||J>>0)%C>>>0,z=z/C>>>0;if(0!==z)throw new Error("Non-zero carry");V=J,G++}for(var ve=X-V;ve!==X&&0===Z[ve];)ve++;for(var y=x.repeat(H);ve{"use strict";F.byteLength=function _(A){var O=M(A),U=O[1];return 3*(O[0]+U)/4-U},F.toByteArray=function C(A){var O,X,N=M(A),U=N[0],H=N[1],V=new B(function b(A,O,N){return 3*(O+N)/4-N}(0,U,H)),G=0,K=H>0?U-4:U;for(X=0;X>16&255,V[G++]=O>>8&255,V[G++]=255&O;return 2===H&&(O=R[A.charCodeAt(X)]<<2|R[A.charCodeAt(X+1)]>>4,V[G++]=255&O),1===H&&(O=R[A.charCodeAt(X)]<<10|R[A.charCodeAt(X+1)]<<4|R[A.charCodeAt(X+2)]>>2,V[G++]=O>>8&255,V[G++]=255&O),V},F.fromByteArray=function P(A){for(var O,N=A.length,U=N%3,H=[],V=16383,G=0,K=N-U;GK?K:G+V));return 1===U?H.push(I[(O=A[N-1])>>2]+I[O<<4&63]+"=="):2===U&&H.push(I[(O=(A[N-2]<<8)+A[N-1])>>10]+I[O>>4&63]+I[O<<2&63]+"="),H.join("")};for(var I=[],R=[],B="undefined"!=typeof Uint8Array?Uint8Array:Array,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=0,f=S.length;T0)throw new Error("Invalid string. Length must be a multiple of 4");var N=A.indexOf("=");return-1===N&&(N=O),[N,N===O?0:4-N%4]}function x(A){return I[A>>18&63]+I[A>>12&63]+I[A>>6&63]+I[63&A]}function E(A,O,N){for(var H=[],V=O;V{const R=I(4850);function B(V,G,K){const X=V[G]+V[K];let Z=V[G+1]+V[K+1];X>=4294967296&&Z++,V[G]=X,V[G+1]=Z}function S(V,G,K,X){let Z=V[G]+K;K<0&&(Z+=4294967296);let z=V[G+1]+X;Z>=4294967296&&z++,V[G]=Z,V[G+1]=z}function T(V,G){return V[G]^V[G+1]<<8^V[G+2]<<16^V[G+3]<<24}function f(V,G,K,X,Z,z){const J=x[Z],re=x[Z+1],ve=x[z],y=x[z+1];B(C,V,G),S(C,V,J,re);let o=C[X]^C[V],l=C[X+1]^C[V+1];C[X]=l,C[X+1]=o,B(C,K,X),o=C[G]^C[K],l=C[G+1]^C[K+1],C[G]=o>>>24^l<<8,C[G+1]=l>>>24^o<<8,B(C,V,G),S(C,V,ve,y),o=C[X]^C[V],l=C[X+1]^C[V+1],C[X]=o>>>16^l<<16,C[X+1]=l>>>16^o<<16,B(C,K,X),o=C[G]^C[K],l=C[G+1]^C[K+1],C[G]=l>>>31^o<<1,C[G+1]=o>>>31^l<<1}const M=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),b=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(V){return 2*V})),C=new Uint32Array(32),x=new Uint32Array(32);function E(V,G){let K=0;for(K=0;K<16;K++)C[K]=V.h[K],C[K+16]=M[K];for(C[24]=C[24]^V.t,C[25]=C[25]^V.t/4294967296,G&&(C[28]=~C[28],C[29]=~C[29]),K=0;K<32;K++)x[K]=T(V.b,4*K);for(K=0;K<12;K++)f(0,8,16,24,b[16*K+0],b[16*K+1]),f(2,10,18,26,b[16*K+2],b[16*K+3]),f(4,12,20,28,b[16*K+4],b[16*K+5]),f(6,14,22,30,b[16*K+6],b[16*K+7]),f(0,10,20,30,b[16*K+8],b[16*K+9]),f(2,12,22,24,b[16*K+10],b[16*K+11]),f(4,14,16,26,b[16*K+12],b[16*K+13]),f(6,8,18,28,b[16*K+14],b[16*K+15]);for(K=0;K<16;K++)V.h[K]=V.h[K]^C[K]^C[K+16]}const P=new Uint8Array([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,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,0,0,0,0,0,0,0,0,0,0]);function A(V,G,K,X){if(0===V||V>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(G&&G.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(K&&16!==K.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(X&&16!==X.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const Z={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:V};P.fill(0),P[0]=V,G&&(P[1]=G.length),P[2]=1,P[3]=1,K&&P.set(K,32),X&&P.set(X,48);for(let z=0;z<16;z++)Z.h[z]=M[z]^T(P,4*z);return G&&(O(Z,G),Z.c=128),Z}function O(V,G){for(let K=0;K>2]>>8*(3&K);return G}function U(V,G,K,X,Z){K=K||64,V=R.normalizeInput(V),X&&(X=R.normalizeInput(X)),Z&&(Z=R.normalizeInput(Z));const z=A(K,G,X,Z);return O(z,V),N(z)}ne.exports={blake2b:U,blake2bHex:function H(V,G,K,X,Z){const z=U(V,G,K,X,Z);return R.toHex(z)},blake2bInit:A,blake2bUpdate:O,blake2bFinal:N}},9370:(ne,F,I)=>{const R=I(4850);function B(N,U){return N[U]^N[U+1]<<8^N[U+2]<<16^N[U+3]<<24}function S(N,U,H,V,G,K){_[N]=_[N]+_[U]+G,_[V]=T(_[V]^_[N],16),_[H]=_[H]+_[V],_[U]=T(_[U]^_[H],12),_[N]=_[N]+_[U]+K,_[V]=T(_[V]^_[N],8),_[H]=_[H]+_[V],_[U]=T(_[U]^_[H],7)}function T(N,U){return N>>>U^N<<32-U}const f=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),M=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),_=new Uint32Array(16),b=new Uint32Array(16);function C(N,U){let H=0;for(H=0;H<8;H++)_[H]=N.h[H],_[H+8]=f[H];for(_[12]^=N.t,_[13]^=N.t/4294967296,U&&(_[14]=~_[14]),H=0;H<16;H++)b[H]=B(N.b,4*H);for(H=0;H<10;H++)S(0,4,8,12,b[M[16*H+0]],b[M[16*H+1]]),S(1,5,9,13,b[M[16*H+2]],b[M[16*H+3]]),S(2,6,10,14,b[M[16*H+4]],b[M[16*H+5]]),S(3,7,11,15,b[M[16*H+6]],b[M[16*H+7]]),S(0,5,10,15,b[M[16*H+8]],b[M[16*H+9]]),S(1,6,11,12,b[M[16*H+10]],b[M[16*H+11]]),S(2,7,8,13,b[M[16*H+12]],b[M[16*H+13]]),S(3,4,9,14,b[M[16*H+14]],b[M[16*H+15]]);for(H=0;H<8;H++)N.h[H]^=_[H]^_[H+8]}function x(N,U){if(!(N>0&&N<=32))throw new Error("Incorrect output length, should be in [1, 32]");const H=U?U.length:0;if(U&&!(H>0&&H<=32))throw new Error("Incorrect key length, should be in [1, 32]");const V={h:new Uint32Array(f),b:new Uint8Array(64),c:0,t:0,outlen:N};return V.h[0]^=16842752^H<<8^N,H>0&&(E(V,U),V.c=64),V}function E(N,U){for(let H=0;H>2]>>8*(3&H)&255;return U}function A(N,U,H){H=H||32,N=R.normalizeInput(N);const V=x(H,U);return E(V,N),P(V)}ne.exports={blake2s:A,blake2sHex:function O(N,U,H){const V=A(N,U,H);return R.toHex(V)},blake2sInit:x,blake2sUpdate:E,blake2sFinal:P}},3647:(ne,F,I)=>{const R=I(1502),B=I(9370);ne.exports={blake2b:R.blake2b,blake2bHex:R.blake2bHex,blake2bInit:R.blake2bInit,blake2bUpdate:R.blake2bUpdate,blake2bFinal:R.blake2bFinal,blake2s:B.blake2s,blake2sHex:B.blake2sHex,blake2sInit:B.blake2sInit,blake2sUpdate:B.blake2sUpdate,blake2sFinal:B.blake2sFinal}},4850:ne=>{function B(f){return(4294967296+f).toString(16).substring(1)}ne.exports={normalizeInput:function I(f){let M;if(f instanceof Uint8Array)M=f;else{if("string"!=typeof f)throw new Error("Input must be an string, Buffer or Uint8Array");M=(new TextEncoder).encode(f)}return M},toHex:function R(f){return Array.prototype.map.call(f,function(M){return(M<16?"0":"")+M.toString(16)}).join("")},debugPrint:function S(f,M,_){let b="\n"+f+" = ";for(let C=0;C=48&&d<=57?d-48:d>=65&&d<=70?d-55:d>=97&&d<=102?d-87:void S(!1,"Invalid character in "+c)}function b(c,u,d){var m=_(c,d);return d-1>=u&&(m|=_(c,d-1)<<4),m}function C(c,u,d,m){for(var w=0,p=0,s=Math.min(c.length,d),g=u;g=49?$-49+10:$>=17?$-17+10:$,S($>=0&&p0?u:d},f.min=function(u,d){return u.cmp(d)<0?u:d},f.prototype._init=function(u,d,m){if("number"==typeof u)return this._initNumber(u,d,m);if("object"==typeof u)return this._initArray(u,d,m);"hex"===d&&(d=16),S(d===(0|d)&&d>=2&&d<=36);var w=0;"-"===(u=u.toString().replace(/\s+/g,""))[0]&&(w++,this.negative=1),w=0;w-=3)this.words[p]|=(s=u[w]|u[w-1]<<8|u[w-2]<<16)<>>26-g&67108863,(g+=24)>=26&&(g-=26,p++);else if("le"===m)for(w=0,p=0;w>>26-g&67108863,(g+=24)>=26&&(g-=26,p++);return this._strip()},f.prototype._parseHex=function(u,d,m){this.length=Math.ceil((u.length-d)/6),this.words=new Array(this.length);for(var w=0;w=d;w-=2)g=b(u,d,w)<=18?(p-=18,this.words[s+=1]|=g>>>26):p+=8;else for(w=(u.length-d)%2==0?d+1:d;w=18?(p-=18,this.words[s+=1]|=g>>>26):p+=8;this._strip()},f.prototype._parseBase=function(u,d,m){this.words=[0],this.length=1;for(var w=0,p=1;p<=67108863;p*=d)w++;w--,p=p/d|0;for(var s=u.length-m,g=s%w,$=Math.min(s,s-g)+m,k=0,q=m;q<$;q+=w)k=C(u,q,q+w,d),this.imuln(p),this.words[0]+k<67108864?this.words[0]+=k:this._iaddn(k);if(0!==g){var he=1;for(k=C(u,q,u.length,d),q=0;q1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=E}catch(c){f.prototype.inspect=E}else f.prototype.inspect=E;function E(){return(this.red?""}var P=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],O=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function H(c,u,d){d.negative=u.negative^c.negative;var m=c.length+u.length|0;d.length=m,m=m-1|0;var w=0|c.words[0],p=0|u.words[0],s=w*p,$=s/67108864|0;d.words[0]=67108863&s;for(var k=1;k>>26,he=67108863&$,be=Math.min(k,u.length-1),ge=Math.max(0,k-c.length+1);ge<=be;ge++)q+=(s=(w=0|c.words[k-ge|0])*(p=0|u.words[ge])+he)/67108864|0,he=67108863&s;d.words[k]=0|he,$=0|q}return 0!==$?d.words[k]=0|$:d.length--,d._strip()}f.prototype.toString=function(u,d){var m;if(d=0|d||1,16===(u=u||10)||"hex"===u){m="";for(var w=0,p=0,s=0;s>>24-w&16777215)||s!==this.length-1?P[6-$.length]+$+m:$+m,(w+=2)>=26&&(w-=26,s--)}for(0!==p&&(m=p.toString(16)+m);m.length%d!=0;)m="0"+m;return 0!==this.negative&&(m="-"+m),m}if(u===(0|u)&&u>=2&&u<=36){var k=A[u],q=O[u];m="";var he=this.clone();for(he.negative=0;!he.isZero();){var be=he.modrn(q).toString(u);m=(he=he.idivn(q)).isZero()?be+m:P[k-be.length]+be+m}for(this.isZero()&&(m="0"+m);m.length%d!=0;)m="0"+m;return 0!==this.negative&&(m="-"+m),m}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var u=this.words[0];return 2===this.length?u+=67108864*this.words[1]:3===this.length&&1===this.words[2]?u+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-u:u},f.prototype.toJSON=function(){return this.toString(16,2)},M&&(f.prototype.toBuffer=function(u,d){return this.toArrayLike(M,u,d)}),f.prototype.toArray=function(u,d){return this.toArrayLike(Array,u,d)},f.prototype.toArrayLike=function(u,d,m){this._strip();var w=this.byteLength(),p=m||Math.max(1,w);S(w<=p,"byte array longer than desired length"),S(p>0,"Requested array length <= 0");var s=function(u,d){return u.allocUnsafe?u.allocUnsafe(d):new u(d)}(u,p);return this["_toArrayLike"+("le"===d?"LE":"BE")](s,w),s},f.prototype._toArrayLikeLE=function(u,d){for(var m=0,w=0,p=0,s=0;p>8&255),m>16&255),6===s?(m>24&255),w=0,s=0):(w=g>>>24,s+=2)}if(m=0&&(u[m--]=g>>8&255),m>=0&&(u[m--]=g>>16&255),6===s?(m>=0&&(u[m--]=g>>24&255),w=0,s=0):(w=g>>>24,s+=2)}if(m>=0)for(u[m--]=w;m>=0;)u[m--]=0},f.prototype._countBits=Math.clz32?function(u){return 32-Math.clz32(u)}:function(u){var d=u,m=0;return d>=4096&&(m+=13,d>>>=13),d>=64&&(m+=7,d>>>=7),d>=8&&(m+=4,d>>>=4),d>=2&&(m+=2,d>>>=2),m+d},f.prototype._zeroBits=function(u){if(0===u)return 26;var d=u,m=0;return 0==(8191&d)&&(m+=13,d>>>=13),0==(127&d)&&(m+=7,d>>>=7),0==(15&d)&&(m+=4,d>>>=4),0==(3&d)&&(m+=2,d>>>=2),0==(1&d)&&m++,m},f.prototype.bitLength=function(){var d=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+d},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,d=0;du.length?this.clone().ior(u):u.clone().ior(this)},f.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},f.prototype.iuand=function(u){var d;d=this.length>u.length?u:this;for(var m=0;mu.length?this.clone().iand(u):u.clone().iand(this)},f.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},f.prototype.iuxor=function(u){var d,m;this.length>u.length?(d=this,m=u):(d=u,m=this);for(var w=0;wu.length?this.clone().ixor(u):u.clone().ixor(this)},f.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},f.prototype.inotn=function(u){S("number"==typeof u&&u>=0);var d=0|Math.ceil(u/26),m=u%26;this._expand(d),m>0&&d--;for(var w=0;w0&&(this.words[w]=~this.words[w]&67108863>>26-m),this._strip()},f.prototype.notn=function(u){return this.clone().inotn(u)},f.prototype.setn=function(u,d){S("number"==typeof u&&u>=0);var m=u/26|0,w=u%26;return this._expand(m+1),this.words[m]=d?this.words[m]|1<u.length?(m=this,w=u):(m=u,w=this);for(var p=0,s=0;s>>26;for(;0!==p&&s>>26;if(this.length=m.length,0!==p)this.words[this.length]=p,this.length++;else if(m!==this)for(;su.length?this.clone().iadd(u):u.clone().iadd(this)},f.prototype.isub=function(u){if(0!==u.negative){u.negative=0;var d=this.iadd(u);return u.negative=1,d._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var w,p,m=this.cmp(u);if(0===m)return this.negative=0,this.length=1,this.words[0]=0,this;m>0?(w=this,p=u):(w=u,p=this);for(var s=0,g=0;g>26,this.words[g]=67108863&d;for(;0!==s&&g>26,this.words[g]=67108863&d;if(0===s&&g>>13,fe=0|w[1],se=8191&fe,ce=fe>>>13,ee=0|w[2],pe=8191&ee,ue=ee>>>13,_e=0|w[3],Me=8191&_e,le=_e>>>13,ie=0|w[4],Y=8191&ie,ae=ie>>>13,Le=0|w[5],xe=8191&Le,Ce=Le>>>13,Re=0|w[6],we=8191&Re,Oe=Re>>>13,wt=0|w[7],Be=8191&wt,oe=wt>>>13,te=0|w[8],W=8191&te,de=te>>>13,Pe=0|w[9],Ee=8191&Pe,Ae=Pe>>>13,St=0|p[0],Xe=8191&St,Je=St>>>13,kt=0|p[1],Ye=8191&kt,tt=kt>>>13,Dn=0|p[2],nt=8191&Dn,ht=Dn>>>13,ln=0|p[3],We=8191&ln,ze=ln>>>13,un=0|p[4],at=8191&un,Ne=un>>>13,Xt=0|p[5],$e=8191&Xt,et=Xt>>>13,pn=0|p[6],lt=8191&pn,ut=pn>>>13,cn=0|p[7],it=8191&cn,ct=cn>>>13,gn=0|p[8],mt=8191&gn,pt=gn>>>13,Xn=0|p[9],Qt=8191&Xn,Jt=Xn>>>13;m.negative=u.negative^d.negative,m.length=19;var jn=(g+($=Math.imul(be,Xe))|0)+((8191&(k=(k=Math.imul(be,Je))+Math.imul(ge,Xe)|0))<<13)|0;g=((q=Math.imul(ge,Je))+(k>>>13)|0)+(jn>>>26)|0,jn&=67108863,$=Math.imul(se,Xe),k=(k=Math.imul(se,Je))+Math.imul(ce,Xe)|0,q=Math.imul(ce,Je);var Bn=(g+($=$+Math.imul(be,Ye)|0)|0)+((8191&(k=(k=k+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0))<<13)|0;g=((q=q+Math.imul(ge,tt)|0)+(k>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,$=Math.imul(pe,Xe),k=(k=Math.imul(pe,Je))+Math.imul(ue,Xe)|0,q=Math.imul(ue,Je),$=$+Math.imul(se,Ye)|0,k=(k=k+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,q=q+Math.imul(ce,tt)|0;var $n=(g+($=$+Math.imul(be,nt)|0)|0)+((8191&(k=(k=k+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0))<<13)|0;g=((q=q+Math.imul(ge,ht)|0)+(k>>>13)|0)+($n>>>26)|0,$n&=67108863,$=Math.imul(Me,Xe),k=(k=Math.imul(Me,Je))+Math.imul(le,Xe)|0,q=Math.imul(le,Je),$=$+Math.imul(pe,Ye)|0,k=(k=k+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,q=q+Math.imul(ue,tt)|0,$=$+Math.imul(se,nt)|0,k=(k=k+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,q=q+Math.imul(ce,ht)|0;var Ln=(g+($=$+Math.imul(be,We)|0)|0)+((8191&(k=(k=k+Math.imul(be,ze)|0)+Math.imul(ge,We)|0))<<13)|0;g=((q=q+Math.imul(ge,ze)|0)+(k>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,$=Math.imul(Y,Xe),k=(k=Math.imul(Y,Je))+Math.imul(ae,Xe)|0,q=Math.imul(ae,Je),$=$+Math.imul(Me,Ye)|0,k=(k=k+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,q=q+Math.imul(le,tt)|0,$=$+Math.imul(pe,nt)|0,k=(k=k+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,q=q+Math.imul(ue,ht)|0,$=$+Math.imul(se,We)|0,k=(k=k+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,q=q+Math.imul(ce,ze)|0;var zn=(g+($=$+Math.imul(be,at)|0)|0)+((8191&(k=(k=k+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0))<<13)|0;g=((q=q+Math.imul(ge,Ne)|0)+(k>>>13)|0)+(zn>>>26)|0,zn&=67108863,$=Math.imul(xe,Xe),k=(k=Math.imul(xe,Je))+Math.imul(Ce,Xe)|0,q=Math.imul(Ce,Je),$=$+Math.imul(Y,Ye)|0,k=(k=k+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,q=q+Math.imul(ae,tt)|0,$=$+Math.imul(Me,nt)|0,k=(k=k+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,q=q+Math.imul(le,ht)|0,$=$+Math.imul(pe,We)|0,k=(k=k+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,q=q+Math.imul(ue,ze)|0,$=$+Math.imul(se,at)|0,k=(k=k+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,q=q+Math.imul(ce,Ne)|0;var hn=(g+($=$+Math.imul(be,$e)|0)|0)+((8191&(k=(k=k+Math.imul(be,et)|0)+Math.imul(ge,$e)|0))<<13)|0;g=((q=q+Math.imul(ge,et)|0)+(k>>>13)|0)+(hn>>>26)|0,hn&=67108863,$=Math.imul(we,Xe),k=(k=Math.imul(we,Je))+Math.imul(Oe,Xe)|0,q=Math.imul(Oe,Je),$=$+Math.imul(xe,Ye)|0,k=(k=k+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,q=q+Math.imul(Ce,tt)|0,$=$+Math.imul(Y,nt)|0,k=(k=k+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,q=q+Math.imul(ae,ht)|0,$=$+Math.imul(Me,We)|0,k=(k=k+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,q=q+Math.imul(le,ze)|0,$=$+Math.imul(pe,at)|0,k=(k=k+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,q=q+Math.imul(ue,Ne)|0,$=$+Math.imul(se,$e)|0,k=(k=k+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,q=q+Math.imul(ce,et)|0;var Lt=(g+($=$+Math.imul(be,lt)|0)|0)+((8191&(k=(k=k+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0))<<13)|0;g=((q=q+Math.imul(ge,ut)|0)+(k>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,$=Math.imul(Be,Xe),k=(k=Math.imul(Be,Je))+Math.imul(oe,Xe)|0,q=Math.imul(oe,Je),$=$+Math.imul(we,Ye)|0,k=(k=k+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,q=q+Math.imul(Oe,tt)|0,$=$+Math.imul(xe,nt)|0,k=(k=k+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,q=q+Math.imul(Ce,ht)|0,$=$+Math.imul(Y,We)|0,k=(k=k+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,q=q+Math.imul(ae,ze)|0,$=$+Math.imul(Me,at)|0,k=(k=k+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,q=q+Math.imul(le,Ne)|0,$=$+Math.imul(pe,$e)|0,k=(k=k+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,q=q+Math.imul(ue,et)|0,$=$+Math.imul(se,lt)|0,k=(k=k+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,q=q+Math.imul(ce,ut)|0;var Gn=(g+($=$+Math.imul(be,it)|0)|0)+((8191&(k=(k=k+Math.imul(be,ct)|0)+Math.imul(ge,it)|0))<<13)|0;g=((q=q+Math.imul(ge,ct)|0)+(k>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,$=Math.imul(W,Xe),k=(k=Math.imul(W,Je))+Math.imul(de,Xe)|0,q=Math.imul(de,Je),$=$+Math.imul(Be,Ye)|0,k=(k=k+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,q=q+Math.imul(oe,tt)|0,$=$+Math.imul(we,nt)|0,k=(k=k+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,q=q+Math.imul(Oe,ht)|0,$=$+Math.imul(xe,We)|0,k=(k=k+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,q=q+Math.imul(Ce,ze)|0,$=$+Math.imul(Y,at)|0,k=(k=k+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,q=q+Math.imul(ae,Ne)|0,$=$+Math.imul(Me,$e)|0,k=(k=k+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,q=q+Math.imul(le,et)|0,$=$+Math.imul(pe,lt)|0,k=(k=k+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,q=q+Math.imul(ue,ut)|0,$=$+Math.imul(se,it)|0,k=(k=k+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,q=q+Math.imul(ce,ct)|0;var Kn=(g+($=$+Math.imul(be,mt)|0)|0)+((8191&(k=(k=k+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;g=((q=q+Math.imul(ge,pt)|0)+(k>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,$=Math.imul(Ee,Xe),k=(k=Math.imul(Ee,Je))+Math.imul(Ae,Xe)|0,q=Math.imul(Ae,Je),$=$+Math.imul(W,Ye)|0,k=(k=k+Math.imul(W,tt)|0)+Math.imul(de,Ye)|0,q=q+Math.imul(de,tt)|0,$=$+Math.imul(Be,nt)|0,k=(k=k+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,q=q+Math.imul(oe,ht)|0,$=$+Math.imul(we,We)|0,k=(k=k+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,q=q+Math.imul(Oe,ze)|0,$=$+Math.imul(xe,at)|0,k=(k=k+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,q=q+Math.imul(Ce,Ne)|0,$=$+Math.imul(Y,$e)|0,k=(k=k+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,q=q+Math.imul(ae,et)|0,$=$+Math.imul(Me,lt)|0,k=(k=k+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,q=q+Math.imul(le,ut)|0,$=$+Math.imul(pe,it)|0,k=(k=k+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,q=q+Math.imul(ue,ct)|0,$=$+Math.imul(se,mt)|0,k=(k=k+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0,q=q+Math.imul(ce,pt)|0;var qn=(g+($=$+Math.imul(be,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(be,Jt)|0)+Math.imul(ge,Qt)|0))<<13)|0;g=((q=q+Math.imul(ge,Jt)|0)+(k>>>13)|0)+(qn>>>26)|0,qn&=67108863,$=Math.imul(Ee,Ye),k=(k=Math.imul(Ee,tt))+Math.imul(Ae,Ye)|0,q=Math.imul(Ae,tt),$=$+Math.imul(W,nt)|0,k=(k=k+Math.imul(W,ht)|0)+Math.imul(de,nt)|0,q=q+Math.imul(de,ht)|0,$=$+Math.imul(Be,We)|0,k=(k=k+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,q=q+Math.imul(oe,ze)|0,$=$+Math.imul(we,at)|0,k=(k=k+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,q=q+Math.imul(Oe,Ne)|0,$=$+Math.imul(xe,$e)|0,k=(k=k+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,q=q+Math.imul(Ce,et)|0,$=$+Math.imul(Y,lt)|0,k=(k=k+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,q=q+Math.imul(ae,ut)|0,$=$+Math.imul(Me,it)|0,k=(k=k+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,q=q+Math.imul(le,ct)|0,$=$+Math.imul(pe,mt)|0,k=(k=k+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0,q=q+Math.imul(ue,pt)|0;var xt=(g+($=$+Math.imul(se,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(se,Jt)|0)+Math.imul(ce,Qt)|0))<<13)|0;g=((q=q+Math.imul(ce,Jt)|0)+(k>>>13)|0)+(xt>>>26)|0,xt&=67108863,$=Math.imul(Ee,nt),k=(k=Math.imul(Ee,ht))+Math.imul(Ae,nt)|0,q=Math.imul(Ae,ht),$=$+Math.imul(W,We)|0,k=(k=k+Math.imul(W,ze)|0)+Math.imul(de,We)|0,q=q+Math.imul(de,ze)|0,$=$+Math.imul(Be,at)|0,k=(k=k+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,q=q+Math.imul(oe,Ne)|0,$=$+Math.imul(we,$e)|0,k=(k=k+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,q=q+Math.imul(Oe,et)|0,$=$+Math.imul(xe,lt)|0,k=(k=k+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,q=q+Math.imul(Ce,ut)|0,$=$+Math.imul(Y,it)|0,k=(k=k+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,q=q+Math.imul(ae,ct)|0,$=$+Math.imul(Me,mt)|0,k=(k=k+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0,q=q+Math.imul(le,pt)|0;var Wn=(g+($=$+Math.imul(pe,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(pe,Jt)|0)+Math.imul(ue,Qt)|0))<<13)|0;g=((q=q+Math.imul(ue,Jt)|0)+(k>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,$=Math.imul(Ee,We),k=(k=Math.imul(Ee,ze))+Math.imul(Ae,We)|0,q=Math.imul(Ae,ze),$=$+Math.imul(W,at)|0,k=(k=k+Math.imul(W,Ne)|0)+Math.imul(de,at)|0,q=q+Math.imul(de,Ne)|0,$=$+Math.imul(Be,$e)|0,k=(k=k+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,q=q+Math.imul(oe,et)|0,$=$+Math.imul(we,lt)|0,k=(k=k+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,q=q+Math.imul(Oe,ut)|0,$=$+Math.imul(xe,it)|0,k=(k=k+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,q=q+Math.imul(Ce,ct)|0,$=$+Math.imul(Y,mt)|0,k=(k=k+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0,q=q+Math.imul(ae,pt)|0;var jt=(g+($=$+Math.imul(Me,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(Me,Jt)|0)+Math.imul(le,Qt)|0))<<13)|0;g=((q=q+Math.imul(le,Jt)|0)+(k>>>13)|0)+(jt>>>26)|0,jt&=67108863,$=Math.imul(Ee,at),k=(k=Math.imul(Ee,Ne))+Math.imul(Ae,at)|0,q=Math.imul(Ae,Ne),$=$+Math.imul(W,$e)|0,k=(k=k+Math.imul(W,et)|0)+Math.imul(de,$e)|0,q=q+Math.imul(de,et)|0,$=$+Math.imul(Be,lt)|0,k=(k=k+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,q=q+Math.imul(oe,ut)|0,$=$+Math.imul(we,it)|0,k=(k=k+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,q=q+Math.imul(Oe,ct)|0,$=$+Math.imul(xe,mt)|0,k=(k=k+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0,q=q+Math.imul(Ce,pt)|0;var Rn=(g+($=$+Math.imul(Y,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(Y,Jt)|0)+Math.imul(ae,Qt)|0))<<13)|0;g=((q=q+Math.imul(ae,Jt)|0)+(k>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,$=Math.imul(Ee,$e),k=(k=Math.imul(Ee,et))+Math.imul(Ae,$e)|0,q=Math.imul(Ae,et),$=$+Math.imul(W,lt)|0,k=(k=k+Math.imul(W,ut)|0)+Math.imul(de,lt)|0,q=q+Math.imul(de,ut)|0,$=$+Math.imul(Be,it)|0,k=(k=k+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,q=q+Math.imul(oe,ct)|0,$=$+Math.imul(we,mt)|0,k=(k=k+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0,q=q+Math.imul(Oe,pt)|0;var Pn=(g+($=$+Math.imul(xe,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(xe,Jt)|0)+Math.imul(Ce,Qt)|0))<<13)|0;g=((q=q+Math.imul(Ce,Jt)|0)+(k>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,$=Math.imul(Ee,lt),k=(k=Math.imul(Ee,ut))+Math.imul(Ae,lt)|0,q=Math.imul(Ae,ut),$=$+Math.imul(W,it)|0,k=(k=k+Math.imul(W,ct)|0)+Math.imul(de,it)|0,q=q+Math.imul(de,ct)|0,$=$+Math.imul(Be,mt)|0,k=(k=k+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0,q=q+Math.imul(oe,pt)|0;var Fn=(g+($=$+Math.imul(we,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(we,Jt)|0)+Math.imul(Oe,Qt)|0))<<13)|0;g=((q=q+Math.imul(Oe,Jt)|0)+(k>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,$=Math.imul(Ee,it),k=(k=Math.imul(Ee,ct))+Math.imul(Ae,it)|0,q=Math.imul(Ae,ct),$=$+Math.imul(W,mt)|0,k=(k=k+Math.imul(W,pt)|0)+Math.imul(de,mt)|0,q=q+Math.imul(de,pt)|0;var Ll=(g+($=$+Math.imul(Be,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(Be,Jt)|0)+Math.imul(oe,Qt)|0))<<13)|0;g=((q=q+Math.imul(oe,Jt)|0)+(k>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,$=Math.imul(Ee,mt),k=(k=Math.imul(Ee,pt))+Math.imul(Ae,mt)|0,q=Math.imul(Ae,pt);var Ea=(g+($=$+Math.imul(W,Qt)|0)|0)+((8191&(k=(k=k+Math.imul(W,Jt)|0)+Math.imul(de,Qt)|0))<<13)|0;g=((q=q+Math.imul(de,Jt)|0)+(k>>>13)|0)+(Ea>>>26)|0,Ea&=67108863;var ds=(g+($=Math.imul(Ee,Qt))|0)+((8191&(k=(k=Math.imul(Ee,Jt))+Math.imul(Ae,Qt)|0))<<13)|0;return g=((q=Math.imul(Ae,Jt))+(k>>>13)|0)+(ds>>>26)|0,ds&=67108863,s[0]=jn,s[1]=Bn,s[2]=$n,s[3]=Ln,s[4]=zn,s[5]=hn,s[6]=Lt,s[7]=Gn,s[8]=Kn,s[9]=qn,s[10]=xt,s[11]=Wn,s[12]=jt,s[13]=Rn,s[14]=Pn,s[15]=Fn,s[16]=Ll,s[17]=Ea,s[18]=ds,0!==g&&(s[19]=g,m.length++),m};function G(c,u,d){d.negative=u.negative^c.negative,d.length=c.length+u.length;for(var m=0,w=0,p=0;p>>26)|0)>>>26,s&=67108863}d.words[p]=g,m=s,s=w}return 0!==m?d.words[p]=m:d.length--,d._strip()}function K(c,u,d){return G(c,u,d)}function X(c,u){this.x=c,this.y=u}Math.imul||(V=H),f.prototype.mulTo=function(u,d){var w=this.length+u.length;return 10===this.length&&10===u.length?V(this,u,d):w<63?H(this,u,d):w<1024?G(this,u,d):K(this,u,d)},X.prototype.makeRBT=function(u){for(var d=new Array(u),m=f.prototype._countBits(u)-1,w=0;w>=1;return w},X.prototype.permute=function(u,d,m,w,p,s){for(var g=0;g>>=1)p++;return 1<>>=13),p>>>=13;for(s=2*d;s>=26,m+=p/67108864|0,m+=s>>>26,this.words[w]=67108863&s}return 0!==m&&(this.words[w]=m,this.length++),d?this.ineg():this},f.prototype.muln=function(u){return this.clone().imuln(u)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(u){var d=function U(c){for(var u=new Array(c.bitLength()),d=0;d>>d%26&1;return u}(u);if(0===d.length)return new f(1);for(var m=this,w=0;w=0);var p,d=u%26,m=(u-d)/26,w=67108863>>>26-d<<26-d;if(0!==d){var s=0;for(p=0;p>>26-d}s&&(this.words[p]=s,this.length++)}if(0!==m){for(p=this.length-1;p>=0;p--)this.words[p+m]=this.words[p];for(p=0;p=0),w=d?(d-d%26)/26:0;var p=u%26,s=Math.min((u-p)/26,this.length),g=67108863^67108863>>>p<s)for(this.length-=s,k=0;k=0&&(0!==q||k>=w);k--){var he=0|this.words[k];this.words[k]=q<<26-p|he>>>p,q=he&g}return $&&0!==q&&($.words[$.length++]=q),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(u,d,m){return S(0===this.negative),this.iushrn(u,d,m)},f.prototype.shln=function(u){return this.clone().ishln(u)},f.prototype.ushln=function(u){return this.clone().iushln(u)},f.prototype.shrn=function(u){return this.clone().ishrn(u)},f.prototype.ushrn=function(u){return this.clone().iushrn(u)},f.prototype.testn=function(u){S("number"==typeof u&&u>=0);var d=u%26,m=(u-d)/26;return!(this.length<=m||!(this.words[m]&1<=0);var d=u%26,m=(u-d)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=m?this:(0!==d&&m++,this.length=Math.min(m,this.length),0!==d&&(this.words[this.length-1]&=67108863^67108863>>>d<=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},f.prototype.isubn=function(u){if(S("number"==typeof u),S(u<67108864),u<0)return this.iaddn(-u);if(0!==this.negative)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d>26)-($/67108864|0),this.words[p+m]=67108863&s}for(;p>26,this.words[p+m]=67108863&s;if(0===g)return this._strip();for(S(-1===g),g=0,p=0;p>26,this.words[p]=67108863&s;return this.negative=1,this._strip()},f.prototype._wordDiv=function(u,d){var m,w=this.clone(),p=u,s=0|p.words[p.length-1];0!=(m=26-this._countBits(s))&&(p=p.ushln(m),w.iushln(m),s=0|p.words[p.length-1]);var k,$=w.length-p.length;if("mod"!==d){(k=new f(null)).length=$+1,k.words=new Array(k.length);for(var q=0;q=0;be--){var ge=67108864*(0|w.words[p.length+be])+(0|w.words[p.length+be-1]);for(ge=Math.min(ge/s|0,67108863),w._ishlnsubmul(p,ge,be);0!==w.negative;)ge--,w.negative=0,w._ishlnsubmul(p,1,be),w.isZero()||(w.negative^=1);k&&(k.words[be]=ge)}return k&&k._strip(),w._strip(),"div"!==d&&0!==m&&w.iushrn(m),{div:k||null,mod:w}},f.prototype.divmod=function(u,d,m){return S(!u.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===u.negative?(s=this.neg().divmod(u,d),"mod"!==d&&(w=s.div.neg()),"div"!==d&&(p=s.mod.neg(),m&&0!==p.negative&&p.iadd(u)),{div:w,mod:p}):0===this.negative&&0!==u.negative?(s=this.divmod(u.neg(),d),"mod"!==d&&(w=s.div.neg()),{div:w,mod:s.mod}):0!=(this.negative&u.negative)?(s=this.neg().divmod(u.neg(),d),"div"!==d&&(p=s.mod.neg(),m&&0!==p.negative&&p.isub(u)),{div:s.div,mod:p}):u.length>this.length||this.cmp(u)<0?{div:new f(0),mod:this}:1===u.length?"div"===d?{div:this.divn(u.words[0]),mod:null}:"mod"===d?{div:null,mod:new f(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new f(this.modrn(u.words[0]))}:this._wordDiv(u,d);var w,p,s},f.prototype.div=function(u){return this.divmod(u,"div",!1).div},f.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},f.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},f.prototype.divRound=function(u){var d=this.divmod(u);if(d.mod.isZero())return d.div;var m=0!==d.div.negative?d.mod.isub(u):d.mod,w=u.ushrn(1),p=u.andln(1),s=m.cmp(w);return s<0||1===p&&0===s?d.div:0!==d.div.negative?d.div.isubn(1):d.div.iaddn(1)},f.prototype.modrn=function(u){var d=u<0;d&&(u=-u),S(u<=67108863);for(var m=(1<<26)%u,w=0,p=this.length-1;p>=0;p--)w=(m*w+(0|this.words[p]))%u;return d?-w:w},f.prototype.modn=function(u){return this.modrn(u)},f.prototype.idivn=function(u){var d=u<0;d&&(u=-u),S(u<=67108863);for(var m=0,w=this.length-1;w>=0;w--){var p=(0|this.words[w])+67108864*m;this.words[w]=p/u|0,m=p%u}return this._strip(),d?this.ineg():this},f.prototype.divn=function(u){return this.clone().idivn(u)},f.prototype.egcd=function(u){S(0===u.negative),S(!u.isZero());var d=this,m=u.clone();d=0!==d.negative?d.umod(u):d.clone();for(var w=new f(1),p=new f(0),s=new f(0),g=new f(1),$=0;d.isEven()&&m.isEven();)d.iushrn(1),m.iushrn(1),++$;for(var k=m.clone(),q=d.clone();!d.isZero();){for(var he=0,be=1;0==(d.words[0]&be)&&he<26;++he,be<<=1);if(he>0)for(d.iushrn(he);he-- >0;)(w.isOdd()||p.isOdd())&&(w.iadd(k),p.isub(q)),w.iushrn(1),p.iushrn(1);for(var ge=0,fe=1;0==(m.words[0]&fe)&&ge<26;++ge,fe<<=1);if(ge>0)for(m.iushrn(ge);ge-- >0;)(s.isOdd()||g.isOdd())&&(s.iadd(k),g.isub(q)),s.iushrn(1),g.iushrn(1);d.cmp(m)>=0?(d.isub(m),w.isub(s),p.isub(g)):(m.isub(d),s.isub(w),g.isub(p))}return{a:s,b:g,gcd:m.iushln($)}},f.prototype._invmp=function(u){S(0===u.negative),S(!u.isZero());var he,d=this,m=u.clone();d=0!==d.negative?d.umod(u):d.clone();for(var w=new f(1),p=new f(0),s=m.clone();d.cmpn(1)>0&&m.cmpn(1)>0;){for(var g=0,$=1;0==(d.words[0]&$)&&g<26;++g,$<<=1);if(g>0)for(d.iushrn(g);g-- >0;)w.isOdd()&&w.iadd(s),w.iushrn(1);for(var k=0,q=1;0==(m.words[0]&q)&&k<26;++k,q<<=1);if(k>0)for(m.iushrn(k);k-- >0;)p.isOdd()&&p.iadd(s),p.iushrn(1);d.cmp(m)>=0?(d.isub(m),w.isub(p)):(m.isub(d),p.isub(w))}return(he=0===d.cmpn(1)?w:p).cmpn(0)<0&&he.iadd(u),he},f.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var d=this.clone(),m=u.clone();d.negative=0,m.negative=0;for(var w=0;d.isEven()&&m.isEven();w++)d.iushrn(1),m.iushrn(1);for(;;){for(;d.isEven();)d.iushrn(1);for(;m.isEven();)m.iushrn(1);var p=d.cmp(m);if(p<0){var s=d;d=m,m=s}else if(0===p||0===m.cmpn(1))break;d.isub(m)}return m.iushln(w)},f.prototype.invm=function(u){return this.egcd(u).a.umod(u)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(u){return this.words[0]&u},f.prototype.bincn=function(u){S("number"==typeof u);var d=u%26,m=(u-d)/26,w=1<>>26,this.words[s]=g&=67108863}return 0!==p&&(this.words[s]=p,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(u){var m,d=u<0;if(0!==this.negative&&!d)return-1;if(0===this.negative&&d)return 1;if(this._strip(),this.length>1)m=1;else{d&&(u=-u),S(u<=67108863,"Number is too big");var w=0|this.words[0];m=w===u?0:wu.length)return 1;if(this.length=0;m--){var w=0|this.words[m],p=0|u.words[m];if(w!==p){wp&&(d=1);break}}return d},f.prototype.gtn=function(u){return 1===this.cmpn(u)},f.prototype.gt=function(u){return 1===this.cmp(u)},f.prototype.gten=function(u){return this.cmpn(u)>=0},f.prototype.gte=function(u){return this.cmp(u)>=0},f.prototype.ltn=function(u){return-1===this.cmpn(u)},f.prototype.lt=function(u){return-1===this.cmp(u)},f.prototype.lten=function(u){return this.cmpn(u)<=0},f.prototype.lte=function(u){return this.cmp(u)<=0},f.prototype.eqn=function(u){return 0===this.cmpn(u)},f.prototype.eq=function(u){return 0===this.cmp(u)},f.red=function(u){return new o(u)},f.prototype.toRed=function(u){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),u.convertTo(this)._forceRed(u)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(u){return this.red=u,this},f.prototype.forceRed=function(u){return S(!this.red,"Already a number in reduction context"),this._forceRed(u)},f.prototype.redAdd=function(u){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},f.prototype.redIAdd=function(u){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},f.prototype.redSub=function(u){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},f.prototype.redISub=function(u){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},f.prototype.redShl=function(u){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},f.prototype.redMul=function(u){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},f.prototype.redIMul=function(u){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(u){return S(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var Z={k256:null,p224:null,p192:null,p25519:null};function z(c,u){this.name=c,this.p=new f(u,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function J(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function re(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function ve(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function o(c){if("string"==typeof c){var u=f._prime(c);this.m=u.p,this.prime=u}else S(c.gtn(1),"modulus must be greater than 1"),this.m=c,this.prime=null}function l(c){o.call(this,c),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}z.prototype._tmp=function(){var u=new f(null);return u.words=new Array(Math.ceil(this.n/13)),u},z.prototype.ireduce=function(u){var m,d=u;do{this.split(d,this.tmp),m=(d=(d=this.imulK(d)).iadd(this.tmp)).bitLength()}while(m>this.n);var w=m0?d.isub(this.p):void 0!==d.strip?d.strip():d._strip(),d},z.prototype.split=function(u,d){u.iushrn(this.n,0,d)},z.prototype.imulK=function(u){return u.imul(this.k)},T(J,z),J.prototype.split=function(u,d){for(var m=4194303,w=Math.min(u.length,9),p=0;p>>22,s=g}u.words[p-10]=s>>>=22,u.length-=0===s&&u.length>10?10:9},J.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var d=0,m=0;m>>=26,u.words[m]=p,d=w}return 0!==d&&(u.words[u.length++]=d),u},f._prime=function(u){if(Z[u])return Z[u];var d;if("k256"===u)d=new J;else if("p224"===u)d=new re;else if("p192"===u)d=new ve;else{if("p25519"!==u)throw new Error("Unknown prime "+u);d=new y}return Z[u]=d,d},o.prototype._verify1=function(u){S(0===u.negative,"red works only with positives"),S(u.red,"red works only with red numbers")},o.prototype._verify2=function(u,d){S(0==(u.negative|d.negative),"red works only with positives"),S(u.red&&u.red===d.red,"red works only with red numbers")},o.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(x(u,u.umod(this.m)._forceRed(this)),u)},o.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},o.prototype.add=function(u,d){this._verify2(u,d);var m=u.add(d);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},o.prototype.iadd=function(u,d){this._verify2(u,d);var m=u.iadd(d);return m.cmp(this.m)>=0&&m.isub(this.m),m},o.prototype.sub=function(u,d){this._verify2(u,d);var m=u.sub(d);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},o.prototype.isub=function(u,d){this._verify2(u,d);var m=u.isub(d);return m.cmpn(0)<0&&m.iadd(this.m),m},o.prototype.shl=function(u,d){return this._verify1(u),this.imod(u.ushln(d))},o.prototype.imul=function(u,d){return this._verify2(u,d),this.imod(u.imul(d))},o.prototype.mul=function(u,d){return this._verify2(u,d),this.imod(u.mul(d))},o.prototype.isqr=function(u){return this.imul(u,u.clone())},o.prototype.sqr=function(u){return this.mul(u,u)},o.prototype.sqrt=function(u){if(u.isZero())return u.clone();var d=this.m.andln(3);if(S(d%2==1),3===d){var m=this.m.add(new f(1)).iushrn(2);return this.pow(u,m)}for(var w=this.m.subn(1),p=0;!w.isZero()&&0===w.andln(1);)p++,w.iushrn(1);S(!w.isZero());var s=new f(1).toRed(this),g=s.redNeg(),$=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,$).cmp(g);)k.redIAdd(g);for(var q=this.pow(k,w),he=this.pow(u,w.addn(1).iushrn(1)),be=this.pow(u,w),ge=p;0!==be.cmp(s);){for(var fe=be,se=0;0!==fe.cmp(s);se++)fe=fe.redSqr();S(se=0;p--){for(var q=d.words[p],he=k-1;he>=0;he--){var be=q>>he&1;s!==w[0]&&(s=this.sqr(s)),0!==be||0!==g?(g<<=1,g|=be,(4==++$||0===p&&0===he)&&(s=this.mul(s,w[g]),$=0,g=0)):$=0}k=26}return s},o.prototype.convertTo=function(u){var d=u.umod(this.m);return d===u?d.clone():d},o.prototype.convertFrom=function(u){var d=u.clone();return d.red=null,d},f.mont=function(u){return new l(u)},T(l,o),l.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},l.prototype.convertFrom=function(u){var d=this.imod(u.mul(this.rinv));return d.red=null,d},l.prototype.imul=function(u,d){if(u.isZero()||d.isZero())return u.words[0]=0,u.length=1,u;var m=u.imul(d),w=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=m.isub(w).iushrn(this.shift),s=p;return p.cmp(this.m)>=0?s=p.isub(this.m):p.cmpn(0)<0&&(s=p.iadd(this.m)),s._forceRed(this)},l.prototype.mul=function(u,d){if(u.isZero()||d.isZero())return new f(0)._forceRed(this);var m=u.mul(d),w=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=m.isub(w).iushrn(this.shift),s=p;return p.cmp(this.m)>=0?s=p.isub(this.m):p.cmpn(0)<0&&(s=p.iadd(this.m)),s._forceRed(this)},l.prototype.invm=function(u){return this.imod(u._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},7950:(ne,F,I)=>{var R;function B(T){this.rand=T}if(ne.exports=function(f){return R||(R=new B(null)),R.generate(f)},ne.exports.Rand=B,B.prototype.generate=function(f){return this._rand(f)},B.prototype._rand=function(f){if(this.rand.getBytes)return this.rand.getBytes(f);for(var M=new Uint8Array(f),_=0;_{var R=I(3502).Buffer;function B(b){R.isBuffer(b)||(b=R.from(b));for(var C=b.length/4|0,x=new Array(C),E=0;E>>24]^O[V>>>16&255]^N[G>>>8&255]^U[255&K]^C[re++],Z=A[V>>>24]^O[G>>>16&255]^N[K>>>8&255]^U[255&H]^C[re++],z=A[G>>>24]^O[K>>>16&255]^N[H>>>8&255]^U[255&V]^C[re++],J=A[K>>>24]^O[H>>>16&255]^N[V>>>8&255]^U[255&G]^C[re++],H=X,V=Z,G=z,K=J;return X=(E[H>>>24]<<24|E[V>>>16&255]<<16|E[G>>>8&255]<<8|E[255&K])^C[re++],Z=(E[V>>>24]<<24|E[G>>>16&255]<<16|E[K>>>8&255]<<8|E[255&H])^C[re++],z=(E[G>>>24]<<24|E[K>>>16&255]<<16|E[H>>>8&255]<<8|E[255&V])^C[re++],J=(E[K>>>24]<<24|E[H>>>16&255]<<16|E[V>>>8&255]<<8|E[255&G])^C[re++],[X>>>=0,Z>>>=0,z>>>=0,J>>>=0]}var f=[0,1,2,4,8,16,32,64,128,27,54],M=function(){for(var b=new Array(256),C=0;C<256;C++)b[C]=C<128?C<<1:C<<1^283;for(var x=[],E=[],P=[[],[],[],[]],A=[[],[],[],[]],O=0,N=0,U=0;U<256;++U){var H=N^N<<1^N<<2^N<<3^N<<4;x[O]=H=H>>>8^255&H^99,E[H]=O;var V=b[O],G=b[V],K=b[G],X=257*b[H]^16843008*H;P[0][O]=X<<24|X>>>8,P[1][O]=X<<16|X>>>16,P[2][O]=X<<8|X>>>24,P[3][O]=X,A[0][H]=(X=16843009*K^65537*G^257*V^16843008*O)<<24|X>>>8,A[1][H]=X<<16|X>>>16,A[2][H]=X<<8|X>>>24,A[3][H]=X,0===O?O=N=1:(O=V^b[b[b[K^V]]],N^=b[b[N]])}return{SBOX:x,INV_SBOX:E,SUB_MIX:P,INV_SUB_MIX:A}}();function _(b){this._key=B(b),this._reset()}_.blockSize=16,_.keySize=32,_.prototype.blockSize=_.blockSize,_.prototype.keySize=_.keySize,_.prototype._reset=function(){for(var b=this._key,C=b.length,x=C+6,E=4*(x+1),P=[],A=0;A>>24)>>>24]<<24|M.SBOX[O>>>16&255]<<16|M.SBOX[O>>>8&255]<<8|M.SBOX[255&O],O^=f[A/C|0]<<24):C>6&&A%C==4&&(O=M.SBOX[O>>>24]<<24|M.SBOX[O>>>16&255]<<16|M.SBOX[O>>>8&255]<<8|M.SBOX[255&O]),P[A]=P[A-C]^O}for(var N=[],U=0;U>>24]]^M.INV_SUB_MIX[1][M.SBOX[V>>>16&255]]^M.INV_SUB_MIX[2][M.SBOX[V>>>8&255]]^M.INV_SUB_MIX[3][M.SBOX[255&V]]}this._nRounds=x,this._keySchedule=P,this._invKeySchedule=N},_.prototype.encryptBlockRaw=function(b){return T(b=B(b),this._keySchedule,M.SUB_MIX,M.SBOX,this._nRounds)},_.prototype.encryptBlock=function(b){var C=this.encryptBlockRaw(b),x=R.allocUnsafe(16);return x.writeUInt32BE(C[0],0),x.writeUInt32BE(C[1],4),x.writeUInt32BE(C[2],8),x.writeUInt32BE(C[3],12),x},_.prototype.decryptBlock=function(b){var C=(b=B(b))[1];b[1]=b[3],b[3]=C;var x=T(b,this._invKeySchedule,M.INV_SUB_MIX,M.INV_SBOX,this._nRounds),E=R.allocUnsafe(16);return E.writeUInt32BE(x[0],0),E.writeUInt32BE(x[3],4),E.writeUInt32BE(x[2],8),E.writeUInt32BE(x[1],12),E},_.prototype.scrub=function(){S(this._keySchedule),S(this._invKeySchedule),S(this._key)},ne.exports.AES=_},9382:(ne,F,I)=>{var R=I(1899),B=I(3502).Buffer,S=I(1052),T=I(3894),f=I(8857),M=I(8789),_=I(7968);function x(E,P,A,O){S.call(this);var N=B.alloc(4,0);this._cipher=new R.AES(P);var U=this._cipher.encryptBlock(N);this._ghash=new f(U),A=function C(E,P,A){if(12===P.length)return E._finID=B.concat([P,B.from([0,0,0,1])]),B.concat([P,B.from([0,0,0,2])]);var O=new f(A),N=P.length,U=N%16;O.update(P),U&&O.update(B.alloc(U=16-U,0)),O.update(B.alloc(8,0));var H=8*N,V=B.alloc(8);V.writeUIntBE(H,0,8),O.update(V),E._finID=O.state;var G=B.from(E._finID);return _(G),G}(this,A,U),this._prev=B.from(A),this._cache=B.allocUnsafe(0),this._secCache=B.allocUnsafe(0),this._decrypt=O,this._alen=0,this._len=0,this._mode=E,this._authTag=null,this._called=!1}T(x,S),x.prototype._update=function(E){if(!this._called&&this._alen){var P=16-this._alen%16;P<16&&(P=B.alloc(P,0),this._ghash.update(P))}this._called=!0;var A=this._mode.encrypt(this,E);return this._ghash.update(this._decrypt?E:A),this._len+=E.length,A},x.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var E=M(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function b(E,P){var A=0;E.length!==P.length&&A++;for(var O=Math.min(E.length,P.length),N=0;N{var R=I(6900),B=I(856),S=I(4946);F.createCipher=F.Cipher=R.createCipher,F.createCipheriv=F.Cipheriv=R.createCipheriv,F.createDecipher=F.Decipher=B.createDecipher,F.createDecipheriv=F.Decipheriv=B.createDecipheriv,F.listCiphers=F.getCiphers=function T(){return Object.keys(S)}},856:(ne,F,I)=>{var R=I(9382),B=I(3502).Buffer,S=I(9171),T=I(8441),f=I(1052),M=I(1899),_=I(347);function C(O,N,U){f.call(this),this._cache=new x,this._last=void 0,this._cipher=new M.AES(N),this._prev=B.from(U),this._mode=O,this._autopadding=!0}function x(){this.cache=B.allocUnsafe(0)}function P(O,N,U){var H=S[O.toLowerCase()];if(!H)throw new TypeError("invalid suite type");if("string"==typeof U&&(U=B.from(U)),"GCM"!==H.mode&&U.length!==H.iv)throw new TypeError("invalid iv length "+U.length);if("string"==typeof N&&(N=B.from(N)),N.length!==H.key/8)throw new TypeError("invalid key length "+N.length);return"stream"===H.type?new T(H.module,N,U,!0):"auth"===H.type?new R(H.module,N,U,!0):new C(H.module,N,U)}I(3894)(C,f),C.prototype._update=function(O){this._cache.add(O);for(var N,U,H=[];N=this._cache.get(this._autopadding);)U=this._mode.decrypt(this,N),H.push(U);return B.concat(H)},C.prototype._final=function(){var O=this._cache.flush();if(this._autopadding)return function E(O){var N=O[15];if(N<1||N>16)throw new Error("unable to decrypt data");for(var U=-1;++U16)return N=this.cache.slice(0,16),this.cache=this.cache.slice(16),N}else if(this.cache.length>=16)return N=this.cache.slice(0,16),this.cache=this.cache.slice(16),N;return null},x.prototype.flush=function(){if(this.cache.length)return this.cache},F.createDecipher=function A(O,N){var U=S[O.toLowerCase()];if(!U)throw new TypeError("invalid suite type");var H=_(N,!1,U.key,U.iv);return P(O,H.key,H.iv)},F.createDecipheriv=P},6900:(ne,F,I)=>{var R=I(9171),B=I(9382),S=I(3502).Buffer,T=I(8441),f=I(1052),M=I(1899),_=I(347);function C(O,N,U){f.call(this),this._cache=new E,this._cipher=new M.AES(N),this._prev=S.from(U),this._mode=O,this._autopadding=!0}I(3894)(C,f),C.prototype._update=function(O){this._cache.add(O);for(var N,U,H=[];N=this._cache.get();)U=this._mode.encrypt(this,N),H.push(U);return S.concat(H)};var x=S.alloc(16,16);function E(){this.cache=S.allocUnsafe(0)}function P(O,N,U){var H=R[O.toLowerCase()];if(!H)throw new TypeError("invalid suite type");if("string"==typeof N&&(N=S.from(N)),N.length!==H.key/8)throw new TypeError("invalid key length "+N.length);if("string"==typeof U&&(U=S.from(U)),"GCM"!==H.mode&&U.length!==H.iv)throw new TypeError("invalid iv length "+U.length);return"stream"===H.type?new T(H.module,N,U):"auth"===H.type?new B(H.module,N,U):new C(H.module,N,U)}C.prototype._final=function(){var O=this._cache.flush();if(this._autopadding)return O=this._mode.encrypt(this,O),this._cipher.scrub(),O;if(!O.equals(x))throw this._cipher.scrub(),new Error("data not multiple of block length")},C.prototype.setAutoPadding=function(O){return this._autopadding=!!O,this},E.prototype.add=function(O){this.cache=S.concat([this.cache,O])},E.prototype.get=function(){if(this.cache.length>15){var O=this.cache.slice(0,16);return this.cache=this.cache.slice(16),O}return null},E.prototype.flush=function(){for(var O=16-this.cache.length,N=S.allocUnsafe(O),U=-1;++U{var R=I(3502).Buffer,B=R.alloc(16,0);function T(M){var _=R.allocUnsafe(16);return _.writeUInt32BE(M[0]>>>0,0),_.writeUInt32BE(M[1]>>>0,4),_.writeUInt32BE(M[2]>>>0,8),_.writeUInt32BE(M[3]>>>0,12),_}function f(M){this.h=M,this.state=R.alloc(16,0),this.cache=R.allocUnsafe(0)}f.prototype.ghash=function(M){for(var _=-1;++_0;b--)M[b]=M[b]>>>1|(1&M[b-1])<<31;M[0]=M[0]>>>1,x&&(M[0]=M[0]^225<<24)}this.state=T(_)},f.prototype.update=function(M){this.cache=R.concat([this.cache,M]);for(var _;this.cache.length>=16;)_=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(_)},f.prototype.final=function(M,_){return this.cache.length&&this.ghash(R.concat([this.cache,B],16)),this.ghash(T([0,M,0,_])),this.state},ne.exports=f},7968:ne=>{ne.exports=function F(I){for(var B,R=I.length;R--;){if(255!==(B=I.readUInt8(R))){B++,I.writeUInt8(B,R);break}I.writeUInt8(0,R)}}},4903:(ne,F,I)=>{var R=I(8789);F.encrypt=function(B,S){var T=R(S,B._prev);return B._prev=B._cipher.encryptBlock(T),B._prev},F.decrypt=function(B,S){var T=B._prev;B._prev=S;var f=B._cipher.decryptBlock(S);return R(f,T)}},9885:(ne,F,I)=>{var R=I(3502).Buffer,B=I(8789);function S(T,f,M){var _=f.length,b=B(f,T._cache);return T._cache=T._cache.slice(_),T._prev=R.concat([T._prev,M?f:b]),b}F.encrypt=function(T,f,M){for(var b,_=R.allocUnsafe(0);f.length;){if(0===T._cache.length&&(T._cache=T._cipher.encryptBlock(T._prev),T._prev=R.allocUnsafe(0)),!(T._cache.length<=f.length)){_=R.concat([_,S(T,f,M)]);break}_=R.concat([_,S(T,f.slice(0,b=T._cache.length),M)]),f=f.slice(b)}return _}},6531:(ne,F,I)=>{var R=I(3502).Buffer;function B(T,f,M){for(var E,P,b=-1,x=0;++b<8;)x+=(128&(P=T._cipher.encryptBlock(T._prev)[0]^(E=f&1<<7-b?128:0)))>>b%8,T._prev=S(T._prev,M?E:P);return x}function S(T,f){var M=T.length,_=-1,b=R.allocUnsafe(T.length);for(T=R.concat([T,R.from([f])]);++_>7;return b}F.encrypt=function(T,f,M){for(var _=f.length,b=R.allocUnsafe(_),C=-1;++C<_;)b[C]=B(T,f[C],M);return b}},1641:(ne,F,I)=>{var R=I(3502).Buffer;function B(S,T,f){var _=S._cipher.encryptBlock(S._prev)[0]^T;return S._prev=R.concat([S._prev.slice(1),R.from([f?T:_])]),_}F.encrypt=function(S,T,f){for(var M=T.length,_=R.allocUnsafe(M),b=-1;++b{var R=I(8789),B=I(3502).Buffer,S=I(7968);function T(M){var _=M._cipher.encryptBlockRaw(M._prev);return S(M._prev),_}F.encrypt=function(M,_){var b=Math.ceil(_.length/16),C=M._cache.length;M._cache=B.concat([M._cache,B.allocUnsafe(16*b)]);for(var x=0;x{F.encrypt=function(I,R){return I._cipher.encryptBlock(R)},F.decrypt=function(I,R){return I._cipher.decryptBlock(R)}},9171:(ne,F,I)=>{var R={ECB:I(1704),CBC:I(4903),CFB:I(9885),CFB8:I(1641),CFB1:I(6531),OFB:I(6816),CTR:I(1150),GCM:I(1150)},B=I(4946);for(var S in B)B[S].module=R[B[S].mode];ne.exports=B},6816:(ne,F,I)=>{var R=I(8789);function B(S){return S._prev=S._cipher.encryptBlock(S._prev),S._prev}F.encrypt=function(S,T){for(;S._cache.length{var R=I(1899),B=I(3502).Buffer,S=I(1052);function f(M,_,b,C){S.call(this),this._cipher=new R.AES(_),this._prev=B.from(b),this._cache=B.allocUnsafe(0),this._secCache=B.allocUnsafe(0),this._decrypt=C,this._mode=M}I(3894)(f,S),f.prototype._update=function(M){return this._mode.encrypt(this,M,this._decrypt)},f.prototype._final=function(){this._cipher.scrub()},ne.exports=f},5255:(ne,F,I)=>{var R=I(9004),B=I(4330),S=I(9171),T=I(1115),f=I(347);function b(E,P,A){if(E=E.toLowerCase(),S[E])return B.createCipheriv(E,P,A);if(T[E])return new R({key:P,iv:A,mode:E});throw new TypeError("invalid suite type")}function C(E,P,A){if(E=E.toLowerCase(),S[E])return B.createDecipheriv(E,P,A);if(T[E])return new R({key:P,iv:A,mode:E,decrypt:!0});throw new TypeError("invalid suite type")}F.createCipher=F.Cipher=function M(E,P){var A,O;if(E=E.toLowerCase(),S[E])A=S[E].key,O=S[E].iv;else{if(!T[E])throw new TypeError("invalid suite type");A=8*T[E].key,O=T[E].iv}var N=f(P,!1,A,O);return b(E,N.key,N.iv)},F.createCipheriv=F.Cipheriv=b,F.createDecipher=F.Decipher=function _(E,P){var A,O;if(E=E.toLowerCase(),S[E])A=S[E].key,O=S[E].iv;else{if(!T[E])throw new TypeError("invalid suite type");A=8*T[E].key,O=T[E].iv}var N=f(P,!1,A,O);return C(E,N.key,N.iv)},F.createDecipheriv=F.Decipheriv=C,F.listCiphers=F.getCiphers=function x(){return Object.keys(T).concat(B.getCiphers())}},9004:(ne,F,I)=>{var R=I(1052),B=I(3684),S=I(3894),T=I(3502).Buffer,f={"des-ede3-cbc":B.CBC.instantiate(B.EDE),"des-ede3":B.EDE,"des-ede-cbc":B.CBC.instantiate(B.EDE),"des-ede":B.EDE,"des-cbc":B.CBC.instantiate(B.DES),"des-ecb":B.DES};function M(_){R.call(this);var x,b=_.mode.toLowerCase(),C=f[b];x=_.decrypt?"decrypt":"encrypt";var E=_.key;T.isBuffer(E)||(E=T.from(E)),("des-ede"===b||"des-ede-cbc"===b)&&(E=T.concat([E,E.slice(0,8)]));var P=_.iv;T.isBuffer(P)||(P=T.from(P)),this._des=C.create({key:E,iv:P,type:x})}f.des=f["des-cbc"],f.des3=f["des-ede3-cbc"],ne.exports=M,S(M,R),M.prototype._update=function(_){return T.from(this._des.update(_))},M.prototype._final=function(){return T.from(this._des.final())}},1115:(ne,F)=>{F["des-ecb"]={key:8,iv:0},F["des-cbc"]=F.des={key:8,iv:8},F["des-ede3-cbc"]=F.des3={key:24,iv:8},F["des-ede3"]={key:24,iv:0},F["des-ede-cbc"]={key:16,iv:8},F["des-ede"]={key:16,iv:0}},8466:(ne,F,I)=>{var R=I(8538),B=I(3753);function T(M){var b,_=M.modulus.byteLength();do{b=new R(B(_))}while(b.cmp(M.modulus)>=0||!b.umod(M.prime1)||!b.umod(M.prime2));return b}function f(M,_){var b=function S(M){var _=T(M);return{blinder:_.toRed(R.mont(M.modulus)).redPow(new R(M.publicExponent)).fromRed(),unblinder:_.invm(M.modulus)}}(_),C=_.modulus.byteLength(),x=new R(M).mul(b.blinder).umod(_.modulus),E=x.toRed(R.mont(_.prime1)),P=x.toRed(R.mont(_.prime2)),A=_.coefficient,O=_.prime1,N=_.prime2,U=E.redPow(_.exponent1).fromRed(),H=P.redPow(_.exponent2).fromRed(),V=U.isub(H).imul(A).umod(O).imul(N);return H.iadd(V).imul(b.unblinder).umod(_.modulus).toArrayLike(Buffer,"be",C)}f.getr=T,ne.exports=f},7793:(ne,F,I)=>{ne.exports=I(5207)},3923:(ne,F,I)=>{var R=I(3502).Buffer,B=I(6386),S=I(5685),T=I(3894),f=I(9947),M=I(3946),_=I(5207);function b(P){S.Writable.call(this);var A=_[P];if(!A)throw new Error("Unknown message digest");this._hashType=A.hash,this._hash=B(A.hash),this._tag=A.id,this._signType=A.sign}function C(P){S.Writable.call(this);var A=_[P];if(!A)throw new Error("Unknown message digest");this._hash=B(A.hash),this._tag=A.id,this._signType=A.sign}function x(P){return new b(P)}function E(P){return new C(P)}Object.keys(_).forEach(function(P){_[P].id=R.from(_[P].id,"hex"),_[P.toLowerCase()]=_[P]}),T(b,S.Writable),b.prototype._write=function(A,O,N){this._hash.update(A),N()},b.prototype.update=function(A,O){return"string"==typeof A&&(A=R.from(A,O)),this._hash.update(A),this},b.prototype.sign=function(A,O){this.end();var N=this._hash.digest(),U=f(N,A,this._hashType,this._signType,this._tag);return O?U.toString(O):U},T(C,S.Writable),C.prototype._write=function(A,O,N){this._hash.update(A),N()},C.prototype.update=function(A,O){return"string"==typeof A&&(A=R.from(A,O)),this._hash.update(A),this},C.prototype.verify=function(A,O,N){"string"==typeof O&&(O=R.from(O,N)),this.end();var U=this._hash.digest();return M(O,U,A,this._signType,this._tag)},ne.exports={Sign:x,Verify:E,createSign:x,createVerify:E}},9947:(ne,F,I)=>{var R=I(3502).Buffer,B=I(4529),S=I(8466),T=I(7715).ec,f=I(8538),M=I(2772),_=I(7036);function P(H,V,G,K){if((H=R.from(H.toArray())).length0&&G.ishrn(K),G}function N(H,V,G){var K,X;do{for(K=R.alloc(0);8*K.length{var R=I(3502).Buffer,B=I(8538),S=I(7715).ec,T=I(2772),f=I(7036);function C(x,E){if(x.cmpn(0)<=0)throw new Error("invalid sig");if(x.cmp(E)>=E)throw new Error("invalid sig")}ne.exports=function M(x,E,P,A,O){var N=T(P);if("ec"===N.type){if("ecdsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");return function _(x,E,P){var A=f[P.data.algorithm.curve.join(".")];if(!A)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));return new S(A).verify(E,x,P.data.subjectPrivateKey.data)}(x,E,N)}if("dsa"===N.type){if("dsa"!==A)throw new Error("wrong public key type");return function b(x,E,P){var A=P.data.p,O=P.data.q,N=P.data.g,U=P.data.pub_key,H=T.signature.decode(x,"der"),V=H.s,G=H.r;C(V,O),C(G,O);var K=B.mont(A),X=V.invm(O);return 0===N.toRed(K).redPow(new B(E).mul(X).mod(O)).fromRed().mul(U.toRed(K).redPow(G.mul(X).mod(O)).fromRed()).mod(A).mod(O).cmp(G)}(x,E,N)}if("rsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");E=R.concat([O,E]);for(var U=N.modulus.byteLength(),H=[1],V=0;E.length+H.length+2{var R=I(1082);ne.exports=R("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},338:(ne,F,I)=>{"use strict";var R=I(129),B=I(3502).Buffer;ne.exports=function(S){function f(b){var C=b.slice(0,-4),x=b.slice(-4),E=S(C);if(!(x[0]^E[0]|x[1]^E[1]|x[2]^E[2]|x[3]^E[3]))return C}return{encode:function T(b){var C=S(b);return R.encode(B.concat([b,C],b.length+4))},decode:function _(b){var x=f(R.decode(b));if(!x)throw new Error("Invalid checksum");return x},decodeUnsafe:function M(b){var C=R.decodeUnsafe(b);if(C)return f(C)}}}},4329:(ne,F,I)=>{"use strict";var R=I(6386),B=I(338);ne.exports=B(function S(T){var f=R("sha256").update(T).digest();return R("sha256").update(f).digest()})},8789:ne=>{ne.exports=function(I,R){for(var B=Math.min(I.length,R.length),S=new Buffer(B),T=0;T{"use strict";var R=I(5343),B=I(8461),S="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=_,F.SlowBuffer=function V(le){return+le!=le&&(le=0),_.alloc(+le)},F.INSPECT_MAX_BYTES=50;var T=2147483647;function M(le){if(le>T)throw new RangeError('The value "'+le+'" is invalid for option "size"');var ie=new Uint8Array(le);return Object.setPrototypeOf(ie,_.prototype),ie}function _(le,ie,Y){if("number"==typeof le){if("string"==typeof ie)throw new TypeError('The "string" argument must be of type string. Received type number');return E(le)}return b(le,ie,Y)}function b(le,ie,Y){if("string"==typeof le)return function P(le,ie){if(("string"!=typeof ie||""===ie)&&(ie="utf8"),!_.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);var Y=0|G(le,ie),ae=M(Y),Le=ae.write(le,ie);return Le!==Y&&(ae=ae.slice(0,Le)),ae}(le,ie);if(ArrayBuffer.isView(le))return function O(le){if(ue(le,Uint8Array)){var ie=new Uint8Array(le);return N(ie.buffer,ie.byteOffset,ie.byteLength)}return A(le)}(le);if(null==le)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le);if(ue(le,ArrayBuffer)||le&&ue(le.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(ue(le,SharedArrayBuffer)||le&&ue(le.buffer,SharedArrayBuffer)))return N(le,ie,Y);if("number"==typeof le)throw new TypeError('The "value" argument must not be of type number. Received type number');var ae=le.valueOf&&le.valueOf();if(null!=ae&&ae!==le)return _.from(ae,ie,Y);var Le=function U(le){if(_.isBuffer(le)){var ie=0|H(le.length),Y=M(ie);return 0===Y.length||le.copy(Y,0,0,ie),Y}return void 0!==le.length?"number"!=typeof le.length||_e(le.length)?M(0):A(le):"Buffer"===le.type&&Array.isArray(le.data)?A(le.data):void 0}(le);if(Le)return Le;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof le[Symbol.toPrimitive])return _.from(le[Symbol.toPrimitive]("string"),ie,Y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le)}function C(le){if("number"!=typeof le)throw new TypeError('"size" argument must be of type number');if(le<0)throw new RangeError('The value "'+le+'" is invalid for option "size"')}function E(le){return C(le),M(le<0?0:0|H(le))}function A(le){for(var ie=le.length<0?0:0|H(le.length),Y=M(ie),ae=0;ae=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return 0|le}function G(le,ie){if(_.isBuffer(le))return le.length;if(ArrayBuffer.isView(le)||ue(le,ArrayBuffer))return le.byteLength;if("string"!=typeof le)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof le);var Y=le.length,ae=arguments.length>2&&!0===arguments[2];if(!ae&&0===Y)return 0;for(var Le=!1;;)switch(ie){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return fe(le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*Y;case"hex":return Y>>>1;case"base64":return ee(le).length;default:if(Le)return ae?-1:fe(le).length;ie=(""+ie).toLowerCase(),Le=!0}}function K(le,ie,Y){var ae=!1;if((void 0===ie||ie<0)&&(ie=0),ie>this.length||((void 0===Y||Y>this.length)&&(Y=this.length),Y<=0)||(Y>>>=0)<=(ie>>>=0))return"";for(le||(le="utf8");;)switch(le){case"hex":return p(this,ie,Y);case"utf8":case"utf-8":return c(this,ie,Y);case"ascii":return m(this,ie,Y);case"latin1":case"binary":return w(this,ie,Y);case"base64":return l(this,ie,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,ie,Y);default:if(ae)throw new TypeError("Unknown encoding: "+le);le=(le+"").toLowerCase(),ae=!0}}function X(le,ie,Y){var ae=le[ie];le[ie]=le[Y],le[Y]=ae}function Z(le,ie,Y,ae,Le){if(0===le.length)return-1;if("string"==typeof Y?(ae=Y,Y=0):Y>2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),_e(Y=+Y)&&(Y=Le?0:le.length-1),Y<0&&(Y=le.length+Y),Y>=le.length){if(Le)return-1;Y=le.length-1}else if(Y<0){if(!Le)return-1;Y=0}if("string"==typeof ie&&(ie=_.from(ie,ae)),_.isBuffer(ie))return 0===ie.length?-1:z(le,ie,Y,ae,Le);if("number"==typeof ie)return ie&=255,"function"==typeof Uint8Array.prototype.indexOf?Le?Uint8Array.prototype.indexOf.call(le,ie,Y):Uint8Array.prototype.lastIndexOf.call(le,ie,Y):z(le,[ie],Y,ae,Le);throw new TypeError("val must be string, number or Buffer")}function z(le,ie,Y,ae,Le){var Oe,xe=1,Ce=le.length,Re=ie.length;if(void 0!==ae&&("ucs2"===(ae=String(ae).toLowerCase())||"ucs-2"===ae||"utf16le"===ae||"utf-16le"===ae)){if(le.length<2||ie.length<2)return-1;xe=2,Ce/=2,Re/=2,Y/=2}function we(te,W){return 1===xe?te[W]:te.readUInt16BE(W*xe)}if(Le){var wt=-1;for(Oe=Y;OeCe&&(Y=Ce-Re),Oe=Y;Oe>=0;Oe--){for(var Be=!0,oe=0;oeLe&&(ae=Le):ae=Le;var xe=ie.length;ae>xe/2&&(ae=xe/2);for(var Ce=0;Ce>8,xe.push(Y%256),xe.push(ae);return xe}(ie,le.length-Y),le,Y,ae)}function l(le,ie,Y){return R.fromByteArray(0===ie&&Y===le.length?le:le.slice(ie,Y))}function c(le,ie,Y){Y=Math.min(le.length,Y);for(var ae=[],Le=ie;Le239?4:xe>223?3:xe>191?2:1;if(Le+Re<=Y)switch(Re){case 1:xe<128&&(Ce=xe);break;case 2:128==(192&(we=le[Le+1]))&&(Be=(31&xe)<<6|63&we)>127&&(Ce=Be);break;case 3:Oe=le[Le+2],128==(192&(we=le[Le+1]))&&128==(192&Oe)&&(Be=(15&xe)<<12|(63&we)<<6|63&Oe)>2047&&(Be<55296||Be>57343)&&(Ce=Be);break;case 4:Oe=le[Le+2],wt=le[Le+3],128==(192&(we=le[Le+1]))&&128==(192&Oe)&&128==(192&wt)&&(Be=(15&xe)<<18|(63&we)<<12|(63&Oe)<<6|63&wt)>65535&&Be<1114112&&(Ce=Be)}null===Ce?(Ce=65533,Re=1):Ce>65535&&(ae.push((Ce-=65536)>>>10&1023|55296),Ce=56320|1023&Ce),ae.push(Ce),Le+=Re}return function d(le){var ie=le.length;if(ie<=u)return String.fromCharCode.apply(String,le);for(var Y="",ae=0;aeLe.length?_.from(Ce).copy(Le,xe):Uint8Array.prototype.set.call(Le,Ce,xe);else{if(!_.isBuffer(Ce))throw new TypeError('"list" argument must be an Array of Buffers');Ce.copy(Le,xe)}xe+=Ce.length}return Le},_.byteLength=G,_.prototype._isBuffer=!0,_.prototype.swap16=function(){var ie=this.length;if(ie%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Y=0;YY&&(ie+=" ... "),""},S&&(_.prototype[S]=_.prototype.inspect),_.prototype.compare=function(ie,Y,ae,Le,xe){if(ue(ie,Uint8Array)&&(ie=_.from(ie,ie.offset,ie.byteLength)),!_.isBuffer(ie))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ie);if(void 0===Y&&(Y=0),void 0===ae&&(ae=ie?ie.length:0),void 0===Le&&(Le=0),void 0===xe&&(xe=this.length),Y<0||ae>ie.length||Le<0||xe>this.length)throw new RangeError("out of range index");if(Le>=xe&&Y>=ae)return 0;if(Le>=xe)return-1;if(Y>=ae)return 1;if(this===ie)return 0;for(var Ce=(xe>>>=0)-(Le>>>=0),Re=(ae>>>=0)-(Y>>>=0),we=Math.min(Ce,Re),Oe=this.slice(Le,xe),wt=ie.slice(Y,ae),Be=0;Be>>=0,isFinite(ae)?(ae>>>=0,void 0===Le&&(Le="utf8")):(Le=ae,ae=void 0)}var xe=this.length-Y;if((void 0===ae||ae>xe)&&(ae=xe),ie.length>0&&(ae<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");Le||(Le="utf8");for(var Ce=!1;;)switch(Le){case"hex":return J(this,ie,Y,ae);case"utf8":case"utf-8":return re(this,ie,Y,ae);case"ascii":case"latin1":case"binary":return ve(this,ie,Y,ae);case"base64":return y(this,ie,Y,ae);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o(this,ie,Y,ae);default:if(Ce)throw new TypeError("Unknown encoding: "+Le);Le=(""+Le).toLowerCase(),Ce=!0}},_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var u=4096;function m(le,ie,Y){var ae="";Y=Math.min(le.length,Y);for(var Le=ie;Leae)&&(Y=ae);for(var Le="",xe=ie;xeY)throw new RangeError("Trying to access beyond buffer length")}function $(le,ie,Y,ae,Le,xe){if(!_.isBuffer(le))throw new TypeError('"buffer" argument must be a Buffer instance');if(ie>Le||iele.length)throw new RangeError("Index out of range")}function k(le,ie,Y,ae,Le,xe){if(Y+ae>le.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function q(le,ie,Y,ae,Le){return ie=+ie,Y>>>=0,Le||k(le,0,Y,4),B.write(le,ie,Y,ae,23,4),Y+4}function he(le,ie,Y,ae,Le){return ie=+ie,Y>>>=0,Le||k(le,0,Y,8),B.write(le,ie,Y,ae,52,8),Y+8}_.prototype.slice=function(ie,Y){var ae=this.length;(ie=~~ie)<0?(ie+=ae)<0&&(ie=0):ie>ae&&(ie=ae),(Y=void 0===Y?ae:~~Y)<0?(Y+=ae)<0&&(Y=0):Y>ae&&(Y=ae),Y>>=0,Y>>>=0,ae||g(ie,Y,this.length);for(var Le=this[ie],xe=1,Ce=0;++Ce>>=0,Y>>>=0,ae||g(ie,Y,this.length);for(var Le=this[ie+--Y],xe=1;Y>0&&(xe*=256);)Le+=this[ie+--Y]*xe;return Le},_.prototype.readUint8=_.prototype.readUInt8=function(ie,Y){return ie>>>=0,Y||g(ie,1,this.length),this[ie]},_.prototype.readUint16LE=_.prototype.readUInt16LE=function(ie,Y){return ie>>>=0,Y||g(ie,2,this.length),this[ie]|this[ie+1]<<8},_.prototype.readUint16BE=_.prototype.readUInt16BE=function(ie,Y){return ie>>>=0,Y||g(ie,2,this.length),this[ie]<<8|this[ie+1]},_.prototype.readUint32LE=_.prototype.readUInt32LE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),(this[ie]|this[ie+1]<<8|this[ie+2]<<16)+16777216*this[ie+3]},_.prototype.readUint32BE=_.prototype.readUInt32BE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),16777216*this[ie]+(this[ie+1]<<16|this[ie+2]<<8|this[ie+3])},_.prototype.readIntLE=function(ie,Y,ae){ie>>>=0,Y>>>=0,ae||g(ie,Y,this.length);for(var Le=this[ie],xe=1,Ce=0;++Ce=(xe*=128)&&(Le-=Math.pow(2,8*Y)),Le},_.prototype.readIntBE=function(ie,Y,ae){ie>>>=0,Y>>>=0,ae||g(ie,Y,this.length);for(var Le=Y,xe=1,Ce=this[ie+--Le];Le>0&&(xe*=256);)Ce+=this[ie+--Le]*xe;return Ce>=(xe*=128)&&(Ce-=Math.pow(2,8*Y)),Ce},_.prototype.readInt8=function(ie,Y){return ie>>>=0,Y||g(ie,1,this.length),128&this[ie]?-1*(255-this[ie]+1):this[ie]},_.prototype.readInt16LE=function(ie,Y){ie>>>=0,Y||g(ie,2,this.length);var ae=this[ie]|this[ie+1]<<8;return 32768&ae?4294901760|ae:ae},_.prototype.readInt16BE=function(ie,Y){ie>>>=0,Y||g(ie,2,this.length);var ae=this[ie+1]|this[ie]<<8;return 32768&ae?4294901760|ae:ae},_.prototype.readInt32LE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),this[ie]|this[ie+1]<<8|this[ie+2]<<16|this[ie+3]<<24},_.prototype.readInt32BE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),this[ie]<<24|this[ie+1]<<16|this[ie+2]<<8|this[ie+3]},_.prototype.readFloatLE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),B.read(this,ie,!0,23,4)},_.prototype.readFloatBE=function(ie,Y){return ie>>>=0,Y||g(ie,4,this.length),B.read(this,ie,!1,23,4)},_.prototype.readDoubleLE=function(ie,Y){return ie>>>=0,Y||g(ie,8,this.length),B.read(this,ie,!0,52,8)},_.prototype.readDoubleBE=function(ie,Y){return ie>>>=0,Y||g(ie,8,this.length),B.read(this,ie,!1,52,8)},_.prototype.writeUintLE=_.prototype.writeUIntLE=function(ie,Y,ae,Le){ie=+ie,Y>>>=0,ae>>>=0,Le||$(this,ie,Y,ae,Math.pow(2,8*ae)-1,0);var Ce=1,Re=0;for(this[Y]=255&ie;++Re>>=0,ae>>>=0,Le||$(this,ie,Y,ae,Math.pow(2,8*ae)-1,0);var Ce=ae-1,Re=1;for(this[Y+Ce]=255&ie;--Ce>=0&&(Re*=256);)this[Y+Ce]=ie/Re&255;return Y+ae},_.prototype.writeUint8=_.prototype.writeUInt8=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,1,255,0),this[Y]=255&ie,Y+1},_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,2,65535,0),this[Y]=255&ie,this[Y+1]=ie>>>8,Y+2},_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,2,65535,0),this[Y]=ie>>>8,this[Y+1]=255&ie,Y+2},_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,4,4294967295,0),this[Y+3]=ie>>>24,this[Y+2]=ie>>>16,this[Y+1]=ie>>>8,this[Y]=255&ie,Y+4},_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,4,4294967295,0),this[Y]=ie>>>24,this[Y+1]=ie>>>16,this[Y+2]=ie>>>8,this[Y+3]=255&ie,Y+4},_.prototype.writeIntLE=function(ie,Y,ae,Le){if(ie=+ie,Y>>>=0,!Le){var xe=Math.pow(2,8*ae-1);$(this,ie,Y,ae,xe-1,-xe)}var Ce=0,Re=1,we=0;for(this[Y]=255&ie;++Ce>0)-we&255;return Y+ae},_.prototype.writeIntBE=function(ie,Y,ae,Le){if(ie=+ie,Y>>>=0,!Le){var xe=Math.pow(2,8*ae-1);$(this,ie,Y,ae,xe-1,-xe)}var Ce=ae-1,Re=1,we=0;for(this[Y+Ce]=255&ie;--Ce>=0&&(Re*=256);)ie<0&&0===we&&0!==this[Y+Ce+1]&&(we=1),this[Y+Ce]=(ie/Re>>0)-we&255;return Y+ae},_.prototype.writeInt8=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,1,127,-128),ie<0&&(ie=255+ie+1),this[Y]=255&ie,Y+1},_.prototype.writeInt16LE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,2,32767,-32768),this[Y]=255&ie,this[Y+1]=ie>>>8,Y+2},_.prototype.writeInt16BE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,2,32767,-32768),this[Y]=ie>>>8,this[Y+1]=255&ie,Y+2},_.prototype.writeInt32LE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,4,2147483647,-2147483648),this[Y]=255&ie,this[Y+1]=ie>>>8,this[Y+2]=ie>>>16,this[Y+3]=ie>>>24,Y+4},_.prototype.writeInt32BE=function(ie,Y,ae){return ie=+ie,Y>>>=0,ae||$(this,ie,Y,4,2147483647,-2147483648),ie<0&&(ie=4294967295+ie+1),this[Y]=ie>>>24,this[Y+1]=ie>>>16,this[Y+2]=ie>>>8,this[Y+3]=255&ie,Y+4},_.prototype.writeFloatLE=function(ie,Y,ae){return q(this,ie,Y,!0,ae)},_.prototype.writeFloatBE=function(ie,Y,ae){return q(this,ie,Y,!1,ae)},_.prototype.writeDoubleLE=function(ie,Y,ae){return he(this,ie,Y,!0,ae)},_.prototype.writeDoubleBE=function(ie,Y,ae){return he(this,ie,Y,!1,ae)},_.prototype.copy=function(ie,Y,ae,Le){if(!_.isBuffer(ie))throw new TypeError("argument should be a Buffer");if(ae||(ae=0),!Le&&0!==Le&&(Le=this.length),Y>=ie.length&&(Y=ie.length),Y||(Y=0),Le>0&&Le=this.length)throw new RangeError("Index out of range");if(Le<0)throw new RangeError("sourceEnd out of bounds");Le>this.length&&(Le=this.length),ie.length-Y>>=0,ae=void 0===ae?this.length:ae>>>0,ie||(ie=0),"number"==typeof ie)for(Ce=Y;Ce55295&&Y<57344){if(!Le){if(Y>56319){(ie-=3)>-1&&xe.push(239,191,189);continue}if(Ce+1===ae){(ie-=3)>-1&&xe.push(239,191,189);continue}Le=Y;continue}if(Y<56320){(ie-=3)>-1&&xe.push(239,191,189),Le=Y;continue}Y=65536+(Le-55296<<10|Y-56320)}else Le&&(ie-=3)>-1&&xe.push(239,191,189);if(Le=null,Y<128){if((ie-=1)<0)break;xe.push(Y)}else if(Y<2048){if((ie-=2)<0)break;xe.push(Y>>6|192,63&Y|128)}else if(Y<65536){if((ie-=3)<0)break;xe.push(Y>>12|224,Y>>6&63|128,63&Y|128)}else{if(!(Y<1114112))throw new Error("Invalid code point");if((ie-=4)<0)break;xe.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,63&Y|128)}}return xe}function ee(le){return R.toByteArray(function ge(le){if((le=(le=le.split("=")[0]).trim().replace(be,"")).length<2)return"";for(;le.length%4!=0;)le+="=";return le}(le))}function pe(le,ie,Y,ae){for(var Le=0;Le=ie.length||Le>=le.length);++Le)ie[Le+Y]=le[Le];return Le}function ue(le,ie){return le instanceof ie||null!=le&&null!=le.constructor&&null!=le.constructor.name&&le.constructor.name===ie.name}function _e(le){return le!=le}var Me=function(){for(var le="0123456789abcdef",ie=new Array(256),Y=0;Y<16;++Y)for(var ae=16*Y,Le=0;Le<16;++Le)ie[ae+Le]=le[Y]+le[Le];return ie}()},4525:ne=>{ne.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"}},5834:(ne,F,I)=>{"use strict";var R=I(5203),B=I(2871),S=B(R("String.prototype.indexOf"));ne.exports=function(f,M){var _=R(f,!!M);return"function"==typeof _&&S(f,".prototype.")>-1?B(_):_}},2871:(ne,F,I)=>{"use strict";var R=I(4444),B=I(5203),S=B("%Function.prototype.apply%"),T=B("%Function.prototype.call%"),f=B("%Reflect.apply%",!0)||R.call(T,S),M=B("%Object.getOwnPropertyDescriptor%",!0),_=B("%Object.defineProperty%",!0),b=B("%Math.max%");if(_)try{_({},"a",{value:1})}catch(x){_=null}ne.exports=function(E){var P=f(R,T,arguments);if(M&&_){var A=M(P,"length");A.configurable&&_(P,"length",{value:1+b(0,E.length-(arguments.length-1))})}return P};var C=function(){return f(R,S,arguments)};_?_(ne.exports,"apply",{value:C}):ne.exports.apply=C},1052:(ne,F,I)=>{var R=I(3502).Buffer,B=I(295).Transform,S=I(3054).s;function f(M){B.call(this),this.hashMode="string"==typeof M,this.hashMode?this[M]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}I(3894)(f,B),f.prototype.update=function(M,_,b){"string"==typeof M&&(M=R.from(M,_));var C=this._update(M);return this.hashMode?this:(b&&(C=this._toString(C,b)),C)},f.prototype.setAutoPadding=function(){},f.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},f.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},f.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},f.prototype._transform=function(M,_,b){var C;try{this.hashMode?this._update(M):this.push(this._update(M))}catch(x){C=x}finally{b(C)}},f.prototype._flush=function(M){var _;try{this.push(this.__final())}catch(b){_=b}M(_)},f.prototype._finalOrDigest=function(M){var _=this.__final()||R.alloc(0);return M&&(_=this._toString(_,M,!0)),_},f.prototype._toString=function(M,_,b){if(this._decoder||(this._decoder=new S(_),this._encoding=_),this._encoding!==_)throw new Error("can't switch encodings");var C=this._decoder.write(M);return b&&(C+=this._decoder.end()),C},ne.exports=f},2385:(ne,F)=>{!function(){"use strict";function I(T,f,M,_){return this instanceof I?(this.domain=T||void 0,this.path=f||"/",this.secure=!!M,this.script=!!_,this):new I(T,f,M,_)}function R(T,f,M){return T instanceof R?T:this instanceof R?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(M||"/"),this.explicit_path=!1,this.domain=f||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,T&&this.parse(T,f,M),this):new R(T,f,M)}I.All=Object.freeze(Object.create(null)),F.CookieAccessInfo=I,F.Cookie=R,R.prototype.toString=function(){var f=[this.name+"="+this.value];return this.expiration_date!==1/0&&f.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&f.push("domain="+this.domain),this.path&&f.push("path="+this.path),this.secure&&f.push("secure"),this.noscript&&f.push("httponly"),f.join("; ")},R.prototype.toValueString=function(){return this.name+"="+this.value};var B=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function S(){var T,f;return this instanceof S?(T=Object.create(null),this.setCookie=function(b,C,x){var E,P;if(E=(b=new R(b,C,x)).expiration_date<=Date.now(),void 0!==T[b.name]){for(f=T[b.name],P=0;P{var R=I(7715),B=I(6422);ne.exports=function(_){return new T(_)};var S={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function T(M){this.curveType=S[M],this.curveType||(this.curveType={name:M}),this.curve=new R.ec(this.curveType.name),this.keys=void 0}function f(M,_,b){Array.isArray(M)||(M=M.toArray());var C=new Buffer(M);if(b&&C.length=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},6386:(ne,F,I)=>{"use strict";var R=I(3894),B=I(8095),S=I(5634),T=I(5244),f=I(1052);function M(_){f.call(this,"digest"),this._hash=_}R(M,f),M.prototype._update=function(_){this._hash.update(_)},M.prototype._final=function(){return this._hash.digest()},ne.exports=function(b){return"md5"===(b=b.toLowerCase())?new B:"rmd160"===b||"ripemd160"===b?new S:new M(T(b))}},5640:(ne,F,I)=>{var R=I(8095);ne.exports=function(B){return(new R).update(B).digest()}},4529:(ne,F,I)=>{"use strict";var R=I(3894),B=I(7309),S=I(1052),T=I(3502).Buffer,f=I(5640),M=I(5634),_=I(5244),b=T.alloc(128);function C(x,E){S.call(this,"digest"),"string"==typeof E&&(E=T.from(E));var P="sha512"===x||"sha384"===x?128:64;this._alg=x,this._key=E,E.length>P?E=("rmd160"===x?new M:_(x)).update(E).digest():E.length{"use strict";var R=I(3894),B=I(3502).Buffer,S=I(1052),T=B.alloc(128),f=64;function M(_,b){S.call(this,"digest"),"string"==typeof b&&(b=B.from(b)),this._alg=_,this._key=b,b.length>f?b=_(b):b.length{"use strict";F.randomBytes=F.rng=F.pseudoRandomBytes=F.prng=I(3753),F.createHash=F.Hash=I(6386),F.createHmac=F.Hmac=I(4529);var R=I(7793),B=Object.keys(R),S=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(B);F.getHashes=function(){return S};var T=I(9357);F.pbkdf2=T.pbkdf2,F.pbkdf2Sync=T.pbkdf2Sync;var f=I(5255);F.Cipher=f.Cipher,F.createCipher=f.createCipher,F.Cipheriv=f.Cipheriv,F.createCipheriv=f.createCipheriv,F.Decipher=f.Decipher,F.createDecipher=f.createDecipher,F.Decipheriv=f.Decipheriv,F.createDecipheriv=f.createDecipheriv,F.getCiphers=f.getCiphers,F.listCiphers=f.listCiphers;var M=I(8829);F.DiffieHellmanGroup=M.DiffieHellmanGroup,F.createDiffieHellmanGroup=M.createDiffieHellmanGroup,F.getDiffieHellman=M.getDiffieHellman,F.createDiffieHellman=M.createDiffieHellman,F.DiffieHellman=M.DiffieHellman;var _=I(3923);F.createSign=_.createSign,F.Sign=_.Sign,F.createVerify=_.createVerify,F.Verify=_.Verify,F.createECDH=I(4746);var b=I(3701);F.publicEncrypt=b.publicEncrypt,F.privateEncrypt=b.privateEncrypt,F.publicDecrypt=b.publicDecrypt,F.privateDecrypt=b.privateDecrypt;var C=I(4275);F.randomFill=C.randomFill,F.randomFillSync=C.randomFillSync,F.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},F.constants={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,ALPN_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}},3684:(ne,F,I)=>{"use strict";F.utils=I(7451),F.Cipher=I(8170),F.DES=I(4631),F.CBC=I(9454),F.EDE=I(1862)},9454:(ne,F,I)=>{"use strict";var R=I(2391),B=I(3894),S={};function T(M){R.equal(M.length,8,"Invalid IV length"),this.iv=new Array(8);for(var _=0;_{"use strict";var R=I(2391);function B(S){this.options=S,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}ne.exports=B,B.prototype._init=function(){},B.prototype.update=function(T){return 0===T.length?[]:"decrypt"===this.type?this._updateDecrypt(T):this._updateEncrypt(T)},B.prototype._buffer=function(T,f){for(var M=Math.min(this.buffer.length-this.bufferOff,T.length-f),_=0;_0;_--)f+=this._buffer(T,f),M+=this._flushBuffer(b,M);return f+=this._buffer(T,f),b},B.prototype.final=function(T){var f,M;return T&&(f=this.update(T)),M="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),f?f.concat(M):M},B.prototype._pad=function(T,f){if(0===f)return!1;for(;f{"use strict";var R=I(2391),B=I(3894),S=I(7451),T=I(8170);function f(){this.tmp=new Array(2),this.keys=null}function M(b){T.call(this,b);var C=new f;this._desState=C,this.deriveKeys(C,b.key)}B(M,T),ne.exports=M,M.create=function(C){return new M(C)};var _=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];M.prototype.deriveKeys=function(C,x){C.keys=new Array(32),R.equal(x.length,this.blockSize,"Invalid key length");var E=S.readUInt32BE(x,0),P=S.readUInt32BE(x,4);S.pc1(E,P,C.tmp,0),E=C.tmp[0],P=C.tmp[1];for(var A=0;A>>1];E=S.r28shl(E,O),P=S.r28shl(P,O),S.pc2(E,P,C.keys,A)}},M.prototype._update=function(C,x,E,P){var A=this._desState,O=S.readUInt32BE(C,x),N=S.readUInt32BE(C,x+4);S.ip(O,N,A.tmp,0),O=A.tmp[0],N=A.tmp[1],"encrypt"===this.type?this._encrypt(A,O,N,A.tmp,0):this._decrypt(A,O,N,A.tmp,0),N=A.tmp[1],S.writeUInt32BE(E,O=A.tmp[0],P),S.writeUInt32BE(E,N,P+4)},M.prototype._pad=function(C,x){for(var E=C.length-x,P=x;P>>0,O=X}S.rip(N,O,P,A)},M.prototype._decrypt=function(C,x,E,P,A){for(var O=E,N=x,U=C.keys.length-2;U>=0;U-=2){var H=C.keys[U],V=C.keys[U+1];S.expand(O,C.tmp,0);var G=S.substitute(H^=C.tmp[0],V^=C.tmp[1]),X=O;O=(N^S.permute(G))>>>0,N=X}S.rip(O,N,P,A)}},1862:(ne,F,I)=>{"use strict";var R=I(2391),B=I(3894),S=I(8170),T=I(4631);function f(_,b){R.equal(b.length,24,"Invalid key length");var C=b.slice(0,8),x=b.slice(8,16),E=b.slice(16,24);this.ciphers="encrypt"===_?[T.create({type:"encrypt",key:C}),T.create({type:"decrypt",key:x}),T.create({type:"encrypt",key:E})]:[T.create({type:"decrypt",key:E}),T.create({type:"encrypt",key:x}),T.create({type:"decrypt",key:C})]}function M(_){S.call(this,_);var b=new f(this.type,this.options.key);this._edeState=b}B(M,S),ne.exports=M,M.create=function(b){return new M(b)},M.prototype._update=function(b,C,x,E){var P=this._edeState;P.ciphers[0]._update(b,C,x,E),P.ciphers[1]._update(x,E,x,E),P.ciphers[2]._update(x,E,x,E)},M.prototype._pad=T.prototype._pad,M.prototype._unpad=T.prototype._unpad},7451:(ne,F)=>{"use strict";F.readUInt32BE=function(T,f){return(T[0+f]<<24|T[1+f]<<16|T[2+f]<<8|T[3+f])>>>0},F.writeUInt32BE=function(T,f,M){T[0+M]=f>>>24,T[1+M]=f>>>16&255,T[2+M]=f>>>8&255,T[3+M]=255&f},F.ip=function(T,f,M,_){for(var b=0,C=0,x=6;x>=0;x-=2){for(var E=0;E<=24;E+=8)b<<=1,b|=f>>>E+x&1;for(E=0;E<=24;E+=8)b<<=1,b|=T>>>E+x&1}for(x=6;x>=0;x-=2){for(E=1;E<=25;E+=8)C<<=1,C|=f>>>E+x&1;for(E=1;E<=25;E+=8)C<<=1,C|=T>>>E+x&1}M[_+0]=b>>>0,M[_+1]=C>>>0},F.rip=function(T,f,M,_){for(var b=0,C=0,x=0;x<4;x++)for(var E=24;E>=0;E-=8)b<<=1,b|=f>>>E+x&1,b<<=1,b|=T>>>E+x&1;for(x=4;x<8;x++)for(E=24;E>=0;E-=8)C<<=1,C|=f>>>E+x&1,C<<=1,C|=T>>>E+x&1;M[_+0]=b>>>0,M[_+1]=C>>>0},F.pc1=function(T,f,M,_){for(var b=0,C=0,x=7;x>=5;x--){for(var E=0;E<=24;E+=8)b<<=1,b|=f>>E+x&1;for(E=0;E<=24;E+=8)b<<=1,b|=T>>E+x&1}for(E=0;E<=24;E+=8)b<<=1,b|=f>>E+x&1;for(x=1;x<=3;x++){for(E=0;E<=24;E+=8)C<<=1,C|=f>>E+x&1;for(E=0;E<=24;E+=8)C<<=1,C|=T>>E+x&1}for(E=0;E<=24;E+=8)C<<=1,C|=T>>E+x&1;M[_+0]=b>>>0,M[_+1]=C>>>0},F.r28shl=function(T,f){return T<>>28-f};var I=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];F.pc2=function(T,f,M,_){for(var b=0,C=0,x=I.length>>>1,E=0;E>>I[E]&1;for(E=x;E>>I[E]&1;M[_+0]=b>>>0,M[_+1]=C>>>0},F.expand=function(T,f,M){var _=0,b=0;_=(1&T)<<5|T>>>27;for(var C=23;C>=15;C-=4)_<<=6,_|=T>>>C&63;for(C=11;C>=3;C-=4)b|=T>>>C&63,b<<=6;b|=(31&T)<<1|T>>>31,f[M+0]=_>>>0,f[M+1]=b>>>0};var R=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];F.substitute=function(T,f){for(var M=0,_=0;_<4;_++)M<<=4,M|=R[64*_+(T>>>18-6*_&63)];for(_=0;_<4;_++)M<<=4,M|=R[256+64*_+(f>>>18-6*_&63)];return M>>>0};var B=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];F.permute=function(T){for(var f=0,M=0;M>>B[M]&1;return f>>>0},F.padSplit=function(T,f,M){for(var _=T.toString(2);_.length{var R=I(5563),B=I(9799),S=I(1419),f={binary:!0,hex:!0,base64:!0};F.DiffieHellmanGroup=F.createDiffieHellmanGroup=F.getDiffieHellman=function T(_){var b=new Buffer(B[_].prime,"hex"),C=new Buffer(B[_].gen,"hex");return new S(b,C)},F.createDiffieHellman=F.DiffieHellman=function M(_,b,C,x){return Buffer.isBuffer(b)||void 0===f[b]?M(_,"binary",b,C):(b=b||"binary",x=x||"binary",C=C||new Buffer([2]),Buffer.isBuffer(C)||(C=new Buffer(C,x)),"number"==typeof _?new S(R(_,C),C,!0):(Buffer.isBuffer(_)||(_=new Buffer(_,b)),new S(_,C,!0)))}},1419:(ne,F,I)=>{var R=I(8313),S=new(I(7079)),T=new R(24),f=new R(11),M=new R(10),_=new R(3),b=new R(7),C=I(5563),x=I(3753);function E(H,V){return V=V||"utf8",Buffer.isBuffer(H)||(H=new Buffer(H,V)),this._pub=new R(H),this}function P(H,V){return V=V||"utf8",Buffer.isBuffer(H)||(H=new Buffer(H,V)),this._priv=new R(H),this}ne.exports=N;var A={};function N(H,V,G){this.setGenerator(V),this.__prime=new R(H),this._prime=R.mont(this.__prime),this._primeLen=H.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,G?(this.setPublicKey=E,this.setPrivateKey=P):this._primeCode=8}function U(H,V){var G=new Buffer(H.toArray());return V?G.toString(V):G}Object.defineProperty(N.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function O(H,V){var G=V.toString("hex"),K=[G,H.toString(16)].join("_");if(K in A)return A[K];var Z,X=0;if(H.isEven()||!C.simpleSieve||!C.fermatTest(H)||!S.test(H))return X+=1,A[K]=X+="02"===G||"05"===G?8:4,X;switch(S.test(H.shrn(1))||(X+=2),G){case"02":H.mod(T).cmp(f)&&(X+=8);break;case"05":(Z=H.mod(M)).cmp(_)&&Z.cmp(b)&&(X+=8);break;default:X+=4}return A[K]=X,X}(this.__prime,this.__gen)),this._primeCode}}),N.prototype.generateKeys=function(){return this._priv||(this._priv=new R(x(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},N.prototype.computeSecret=function(H){var V=(H=(H=new R(H)).toRed(this._prime)).redPow(this._priv).fromRed(),G=new Buffer(V.toArray()),K=this.getPrime();if(G.length{var R=I(3753);ne.exports=X,X.simpleSieve=G,X.fermatTest=K;var B=I(8313),S=new B(24),f=new(I(7079)),M=new B(1),_=new B(2),b=new B(5),E=(new B(16),new B(8),new B(10)),P=new B(3),O=(new B(7),new B(11)),N=new B(4),H=(new B(12),null);function G(Z){for(var z=function V(){if(null!==H)return H;var z=[];z[0]=2;for(var J=1,re=3;re<1048576;re+=2){for(var ve=Math.ceil(Math.sqrt(re)),y=0;yZ;)J.ishrn(1);if(J.isEven()&&J.iadd(M),J.testn(1)||J.iadd(_),z.cmp(_)){if(!z.cmp(b))for(;J.mod(E).cmp(P);)J.iadd(N)}else for(;J.mod(S).cmp(O);)J.iadd(N);if(G(re=J.shrn(1))&&G(J)&&K(re)&&K(J)&&f.test(re)&&f.test(J))return J}}},8313:function(ne,F,I){!function(R,B){"use strict";function S(y,o){if(!y)throw new Error(o||"Assertion failed")}function T(y,o){y.super_=o;var l=function(){};l.prototype=o.prototype,y.prototype=new l,y.prototype.constructor=y}function f(y,o,l){if(f.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,null!==y&&(("le"===o||"be"===o)&&(l=o,o=10),this._init(y||0,o||10,l||"be"))}var M;"object"==typeof R?R.exports=f:B.BN=f,f.BN=f,f.wordSize=26;try{M="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:I(7748).Buffer}catch(y){}function _(y,o){var l=y.charCodeAt(o);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},4901:ne=>{"use strict";var F={single_source_shortest_paths:function(I,R,B){var S={},T={};T[R]=0;var M,_,b,C,x,P,f=F.PriorityQueue.make();for(f.push(R,0);!f.empty();)for(b in C=(M=f.pop()).cost,x=I[_=M.value]||{})x.hasOwnProperty(b)&&(P=C+x[b],(void 0===T[b]||T[b]>P)&&(T[b]=P,f.push(b,P),S[b]=_));if(void 0!==B&&void 0===T[B]){var N=["Could not find a path from ",R," to ",B,"."].join("");throw new Error(N)}return S},extract_shortest_path_from_predecessor_list:function(I,R){for(var B=[],S=R;S;)B.push(S),S=I[S];return B.reverse(),B},find_path:function(I,R,B){var S=F.single_source_shortest_paths(I,R,B);return F.extract_shortest_path_from_predecessor_list(S,B)},PriorityQueue:{make:function(I){var S,R=F.PriorityQueue,B={};for(S in I=I||{},R)R.hasOwnProperty(S)&&(B[S]=R[S]);return B.queue=[],B.sorter=I.sorter||R.default_sorter,B},default_sorter:function(I,R){return I.cost-R.cost},push:function(I,R){this.queue.push({value:I,cost:R}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};ne.exports=F},7715:(ne,F,I)=>{"use strict";var R=F;R.version=I(8597).i8,R.utils=I(1970),R.rand=I(7950),R.curve=I(6270),R.curves=I(2916),R.ec=I(7626),R.eddsa=I(1885)},7902:(ne,F,I)=>{"use strict";var R=I(7433),B=I(1970),S=B.getNAF,T=B.getJSF,f=B.assert;function M(b,C){this.type=b,this.p=new R(C.p,16),this.red=C.prime?R.red(C.prime):R.mont(this.p),this.zero=new R(0).toRed(this.red),this.one=new R(1).toRed(this.red),this.two=new R(2).toRed(this.red),this.n=C.n&&new R(C.n,16),this.g=C.g&&this.pointFromJSON(C.g,C.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var x=this.n&&this.p.div(this.n);!x||x.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function _(b,C){this.curve=b,this.type=C,this.precomputed=null}ne.exports=M,M.prototype.point=function(){throw new Error("Not implemented")},M.prototype.validate=function(){throw new Error("Not implemented")},M.prototype._fixedNafMul=function(C,x){f(C.precomputed);var E=C._getDoubles(),P=S(x,1,this._bitLength),A=(1<=N;H--)U=(U<<1)+P[H];O.push(U)}for(var V=this.jpoint(null,null,null),G=this.jpoint(null,null,null),K=A;K>0;K--){for(N=0;N=0;U--){for(var H=0;U>=0&&0===O[U];U--)H++;if(U>=0&&H++,N=N.dblp(H),U<0)break;var V=O[U];f(0!==V),N="affine"===C.type?N.mixedAdd(V>0?A[V-1>>1]:A[-V-1>>1].neg()):N.add(V>0?A[V-1>>1]:A[-V-1>>1].neg())}return"affine"===C.type?N.toP():N},M.prototype._wnafMulAdd=function(C,x,E,P,A){var V,G,K,O=this._wnafT1,N=this._wnafT2,U=this._wnafT3,H=0;for(V=0;V=1;V-=2){var Z=V-1,z=V;if(1===O[Z]&&1===O[z]){var J=[x[Z],null,null,x[z]];0===x[Z].y.cmp(x[z].y)?(J[1]=x[Z].add(x[z]),J[2]=x[Z].toJ().mixedAdd(x[z].neg())):0===x[Z].y.cmp(x[z].y.redNeg())?(J[1]=x[Z].toJ().mixedAdd(x[z]),J[2]=x[Z].add(x[z].neg())):(J[1]=x[Z].toJ().mixedAdd(x[z]),J[2]=x[Z].toJ().mixedAdd(x[z].neg()));var re=[-3,-1,-5,-7,0,7,5,1,3],ve=T(E[Z],E[z]);for(H=Math.max(ve[0].length,H),U[Z]=new Array(H),U[z]=new Array(H),G=0;G=0;V--){for(var u=0;V>=0;){var d=!0;for(G=0;G=0&&u++,l=l.dblp(u),V<0)break;for(G=0;G0?K=N[G][m-1>>1]:m<0&&(K=N[G][-m-1>>1].neg()),l="affine"===K.type?l.mixedAdd(K):l.add(K))}}for(V=0;V=Math.ceil((C.bitLength()+1)/x.step)},_.prototype._getDoubles=function(C,x){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var E=[this],P=this,A=0;A{"use strict";var R=I(1970),B=I(7433),S=I(3894),T=I(7902),f=R.assert;function M(b){this.twisted=1!=(0|b.a),this.mOneA=this.twisted&&-1==(0|b.a),this.extended=this.mOneA,T.call(this,"edwards",b),this.a=new B(b.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new B(b.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new B(b.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),f(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|b.c)}function _(b,C,x,E,P){T.BasePoint.call(this,b,"projective"),null===C&&null===x&&null===E?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new B(C,16),this.y=new B(x,16),this.z=E?new B(E,16):this.curve.one,this.t=P&&new B(P,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}S(M,T),ne.exports=M,M.prototype._mulA=function(C){return this.mOneA?C.redNeg():this.a.redMul(C)},M.prototype._mulC=function(C){return this.oneC?C:this.c.redMul(C)},M.prototype.jpoint=function(C,x,E,P){return this.point(C,x,E,P)},M.prototype.pointFromX=function(C,x){(C=new B(C,16)).red||(C=C.toRed(this.red));var E=C.redSqr(),P=this.c2.redSub(this.a.redMul(E)),A=this.one.redSub(this.c2.redMul(this.d).redMul(E)),O=P.redMul(A.redInvm()),N=O.redSqrt();if(0!==N.redSqr().redSub(O).cmp(this.zero))throw new Error("invalid point");var U=N.fromRed().isOdd();return(x&&!U||!x&&U)&&(N=N.redNeg()),this.point(C,N)},M.prototype.pointFromY=function(C,x){(C=new B(C,16)).red||(C=C.toRed(this.red));var E=C.redSqr(),P=E.redSub(this.c2),A=E.redMul(this.d).redMul(this.c2).redSub(this.a),O=P.redMul(A.redInvm());if(0===O.cmp(this.zero)){if(x)throw new Error("invalid point");return this.point(this.zero,C)}var N=O.redSqrt();if(0!==N.redSqr().redSub(O).cmp(this.zero))throw new Error("invalid point");return N.fromRed().isOdd()!==x&&(N=N.redNeg()),this.point(N,C)},M.prototype.validate=function(C){if(C.isInfinity())return!0;C.normalize();var x=C.x.redSqr(),E=C.y.redSqr(),P=x.redMul(this.a).redAdd(E),A=this.c2.redMul(this.one.redAdd(this.d.redMul(x).redMul(E)));return 0===P.cmp(A)},S(_,T.BasePoint),M.prototype.pointFromJSON=function(C){return _.fromJSON(this,C)},M.prototype.point=function(C,x,E,P){return new _(this,C,x,E,P)},_.fromJSON=function(C,x){return new _(C,x[0],x[1],x[2])},_.prototype.inspect=function(){return this.isInfinity()?"":""},_.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},_.prototype._extDbl=function(){var C=this.x.redSqr(),x=this.y.redSqr(),E=this.z.redSqr();E=E.redIAdd(E);var P=this.curve._mulA(C),A=this.x.redAdd(this.y).redSqr().redISub(C).redISub(x),O=P.redAdd(x),N=O.redSub(E),U=P.redSub(x),H=A.redMul(N),V=O.redMul(U),G=A.redMul(U),K=N.redMul(O);return this.curve.point(H,V,K,G)},_.prototype._projDbl=function(){var P,A,O,N,U,H,C=this.x.redAdd(this.y).redSqr(),x=this.x.redSqr(),E=this.y.redSqr();if(this.curve.twisted){var V=(N=this.curve._mulA(x)).redAdd(E);this.zOne?(P=C.redSub(x).redSub(E).redMul(V.redSub(this.curve.two)),A=V.redMul(N.redSub(E)),O=V.redSqr().redSub(V).redSub(V)):(U=this.z.redSqr(),H=V.redSub(U).redISub(U),P=C.redSub(x).redISub(E).redMul(H),A=V.redMul(N.redSub(E)),O=V.redMul(H))}else N=x.redAdd(E),U=this.curve._mulC(this.z).redSqr(),H=N.redSub(U).redSub(U),P=this.curve._mulC(C.redISub(N)).redMul(H),A=this.curve._mulC(N).redMul(x.redISub(E)),O=N.redMul(H);return this.curve.point(P,A,O)},_.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},_.prototype._extAdd=function(C){var x=this.y.redSub(this.x).redMul(C.y.redSub(C.x)),E=this.y.redAdd(this.x).redMul(C.y.redAdd(C.x)),P=this.t.redMul(this.curve.dd).redMul(C.t),A=this.z.redMul(C.z.redAdd(C.z)),O=E.redSub(x),N=A.redSub(P),U=A.redAdd(P),H=E.redAdd(x),V=O.redMul(N),G=U.redMul(H),K=O.redMul(H),X=N.redMul(U);return this.curve.point(V,G,X,K)},_.prototype._projAdd=function(C){var G,K,x=this.z.redMul(C.z),E=x.redSqr(),P=this.x.redMul(C.x),A=this.y.redMul(C.y),O=this.curve.d.redMul(P).redMul(A),N=E.redSub(O),U=E.redAdd(O),H=this.x.redAdd(this.y).redMul(C.x.redAdd(C.y)).redISub(P).redISub(A),V=x.redMul(N).redMul(H);return this.curve.twisted?(G=x.redMul(U).redMul(A.redSub(this.curve._mulA(P))),K=N.redMul(U)):(G=x.redMul(U).redMul(A.redSub(P)),K=this.curve._mulC(N).redMul(U)),this.curve.point(V,G,K)},_.prototype.add=function(C){return this.isInfinity()?C:C.isInfinity()?this:this.curve.extended?this._extAdd(C):this._projAdd(C)},_.prototype.mul=function(C){return this._hasDoubles(C)?this.curve._fixedNafMul(this,C):this.curve._wnafMul(this,C)},_.prototype.mulAdd=function(C,x,E){return this.curve._wnafMulAdd(1,[this,x],[C,E],2,!1)},_.prototype.jmulAdd=function(C,x,E){return this.curve._wnafMulAdd(1,[this,x],[C,E],2,!0)},_.prototype.normalize=function(){if(this.zOne)return this;var C=this.z.redInvm();return this.x=this.x.redMul(C),this.y=this.y.redMul(C),this.t&&(this.t=this.t.redMul(C)),this.z=this.curve.one,this.zOne=!0,this},_.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},_.prototype.getX=function(){return this.normalize(),this.x.fromRed()},_.prototype.getY=function(){return this.normalize(),this.y.fromRed()},_.prototype.eq=function(C){return this===C||0===this.getX().cmp(C.getX())&&0===this.getY().cmp(C.getY())},_.prototype.eqXToP=function(C){var x=C.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(x))return!0;for(var E=C.clone(),P=this.curve.redN.redMul(this.z);;){if(E.iadd(this.curve.n),E.cmp(this.curve.p)>=0)return!1;if(x.redIAdd(P),0===this.x.cmp(x))return!0}},_.prototype.toP=_.prototype.normalize,_.prototype.mixedAdd=_.prototype.add},6270:(ne,F,I)=>{"use strict";var R=F;R.base=I(7902),R.short=I(1781),R.mont=I(7064),R.edwards=I(3835)},7064:(ne,F,I)=>{"use strict";var R=I(7433),B=I(3894),S=I(7902),T=I(1970);function f(_){S.call(this,"mont",_),this.a=new R(_.a,16).toRed(this.red),this.b=new R(_.b,16).toRed(this.red),this.i4=new R(4).toRed(this.red).redInvm(),this.two=new R(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function M(_,b,C){S.BasePoint.call(this,_,"projective"),null===b&&null===C?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new R(b,16),this.z=new R(C,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}B(f,S),ne.exports=f,f.prototype.validate=function(b){var C=b.normalize().x,x=C.redSqr(),E=x.redMul(C).redAdd(x.redMul(this.a)).redAdd(C);return 0===E.redSqrt().redSqr().cmp(E)},B(M,S.BasePoint),f.prototype.decodePoint=function(b,C){return this.point(T.toArray(b,C),1)},f.prototype.point=function(b,C){return new M(this,b,C)},f.prototype.pointFromJSON=function(b){return M.fromJSON(this,b)},M.prototype.precompute=function(){},M.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},M.fromJSON=function(b,C){return new M(b,C[0],C[1]||b.one)},M.prototype.inspect=function(){return this.isInfinity()?"":""},M.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},M.prototype.dbl=function(){var C=this.x.redAdd(this.z).redSqr(),E=this.x.redSub(this.z).redSqr(),P=C.redSub(E),A=C.redMul(E),O=P.redMul(E.redAdd(this.curve.a24.redMul(P)));return this.curve.point(A,O)},M.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},M.prototype.diffAdd=function(b,C){var x=this.x.redAdd(this.z),E=this.x.redSub(this.z),P=b.x.redAdd(b.z),O=b.x.redSub(b.z).redMul(x),N=P.redMul(E),U=C.z.redMul(O.redAdd(N).redSqr()),H=C.x.redMul(O.redISub(N).redSqr());return this.curve.point(U,H)},M.prototype.mul=function(b){for(var C=b.clone(),x=this,E=this.curve.point(null,null),A=[];0!==C.cmpn(0);C.iushrn(1))A.push(C.andln(1));for(var O=A.length-1;O>=0;O--)0===A[O]?(x=x.diffAdd(E,this),E=E.dbl()):(E=x.diffAdd(E,this),x=x.dbl());return E},M.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},M.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},M.prototype.eq=function(b){return 0===this.getX().cmp(b.getX())},M.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},M.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},1781:(ne,F,I)=>{"use strict";var R=I(1970),B=I(7433),S=I(3894),T=I(7902),f=R.assert;function M(C){T.call(this,"short",C),this.a=new B(C.a,16).toRed(this.red),this.b=new B(C.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(C),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function _(C,x,E,P){T.BasePoint.call(this,C,"affine"),null===x&&null===E?(this.x=null,this.y=null,this.inf=!0):(this.x=new B(x,16),this.y=new B(E,16),P&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function b(C,x,E,P){T.BasePoint.call(this,C,"jacobian"),null===x&&null===E&&null===P?(this.x=this.curve.one,this.y=this.curve.one,this.z=new B(0)):(this.x=new B(x,16),this.y=new B(E,16),this.z=new B(P,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}S(M,T),ne.exports=M,M.prototype._getEndomorphism=function(x){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var E,P;if(x.beta)E=new B(x.beta,16).toRed(this.red);else{var A=this._getEndoRoots(this.p);E=(E=A[0].cmp(A[1])<0?A[0]:A[1]).toRed(this.red)}if(x.lambda)P=new B(x.lambda,16);else{var O=this._getEndoRoots(this.n);0===this.g.mul(O[0]).x.cmp(this.g.x.redMul(E))?P=O[0]:f(0===this.g.mul(P=O[1]).x.cmp(this.g.x.redMul(E)))}return{beta:E,lambda:P,basis:x.basis?x.basis.map(function(U){return{a:new B(U.a,16),b:new B(U.b,16)}}):this._getEndoBasis(P)}}},M.prototype._getEndoRoots=function(x){var E=x===this.p?this.red:B.mont(x),P=new B(2).toRed(E).redInvm(),A=P.redNeg(),O=new B(3).toRed(E).redNeg().redSqrt().redMul(P);return[A.redAdd(O).fromRed(),A.redSub(O).fromRed()]},M.prototype._getEndoBasis=function(x){for(var V,G,K,X,Z,z,J,ve,y,E=this.n.ushrn(Math.floor(this.n.bitLength()/2)),P=x,A=this.n.clone(),O=new B(1),N=new B(0),U=new B(0),H=new B(1),re=0;0!==P.cmpn(0);){var o=A.div(P);ve=A.sub(o.mul(P)),y=U.sub(o.mul(O));var l=H.sub(o.mul(N));if(!K&&ve.cmp(E)<0)V=J.neg(),G=O,K=ve.neg(),X=y;else if(K&&2==++re)break;J=ve,A=P,P=ve,U=O,O=y,H=N,N=l}Z=ve.neg(),z=y;var c=K.sqr().add(X.sqr());return Z.sqr().add(z.sqr()).cmp(c)>=0&&(Z=V,z=G),K.negative&&(K=K.neg(),X=X.neg()),Z.negative&&(Z=Z.neg(),z=z.neg()),[{a:K,b:X},{a:Z,b:z}]},M.prototype._endoSplit=function(x){var E=this.endo.basis,P=E[0],A=E[1],O=A.b.mul(x).divRound(this.n),N=P.b.neg().mul(x).divRound(this.n),U=O.mul(P.a),H=N.mul(A.a),V=O.mul(P.b),G=N.mul(A.b);return{k1:x.sub(U).sub(H),k2:V.add(G).neg()}},M.prototype.pointFromX=function(x,E){(x=new B(x,16)).red||(x=x.toRed(this.red));var P=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),A=P.redSqrt();if(0!==A.redSqr().redSub(P).cmp(this.zero))throw new Error("invalid point");var O=A.fromRed().isOdd();return(E&&!O||!E&&O)&&(A=A.redNeg()),this.point(x,A)},M.prototype.validate=function(x){if(x.inf)return!0;var E=x.x,P=x.y,A=this.a.redMul(E),O=E.redSqr().redMul(E).redIAdd(A).redIAdd(this.b);return 0===P.redSqr().redISub(O).cmpn(0)},M.prototype._endoWnafMulAdd=function(x,E,P){for(var A=this._endoWnafT1,O=this._endoWnafT2,N=0;N":""},_.prototype.isInfinity=function(){return this.inf},_.prototype.add=function(x){if(this.inf)return x;if(x.inf)return this;if(this.eq(x))return this.dbl();if(this.neg().eq(x))return this.curve.point(null,null);if(0===this.x.cmp(x.x))return this.curve.point(null,null);var E=this.y.redSub(x.y);0!==E.cmpn(0)&&(E=E.redMul(this.x.redSub(x.x).redInvm()));var P=E.redSqr().redISub(this.x).redISub(x.x),A=E.redMul(this.x.redSub(P)).redISub(this.y);return this.curve.point(P,A)},_.prototype.dbl=function(){if(this.inf)return this;var x=this.y.redAdd(this.y);if(0===x.cmpn(0))return this.curve.point(null,null);var E=this.curve.a,P=this.x.redSqr(),A=x.redInvm(),O=P.redAdd(P).redIAdd(P).redIAdd(E).redMul(A),N=O.redSqr().redISub(this.x.redAdd(this.x)),U=O.redMul(this.x.redSub(N)).redISub(this.y);return this.curve.point(N,U)},_.prototype.getX=function(){return this.x.fromRed()},_.prototype.getY=function(){return this.y.fromRed()},_.prototype.mul=function(x){return x=new B(x,16),this.isInfinity()?this:this._hasDoubles(x)?this.curve._fixedNafMul(this,x):this.curve.endo?this.curve._endoWnafMulAdd([this],[x]):this.curve._wnafMul(this,x)},_.prototype.mulAdd=function(x,E,P){var A=[this,E],O=[x,P];return this.curve.endo?this.curve._endoWnafMulAdd(A,O):this.curve._wnafMulAdd(1,A,O,2)},_.prototype.jmulAdd=function(x,E,P){var A=[this,E],O=[x,P];return this.curve.endo?this.curve._endoWnafMulAdd(A,O,!0):this.curve._wnafMulAdd(1,A,O,2,!0)},_.prototype.eq=function(x){return this===x||this.inf===x.inf&&(this.inf||0===this.x.cmp(x.x)&&0===this.y.cmp(x.y))},_.prototype.neg=function(x){if(this.inf)return this;var E=this.curve.point(this.x,this.y.redNeg());if(x&&this.precomputed){var P=this.precomputed,A=function(O){return O.neg()};E.precomputed={naf:P.naf&&{wnd:P.naf.wnd,points:P.naf.points.map(A)},doubles:P.doubles&&{step:P.doubles.step,points:P.doubles.points.map(A)}}}return E},_.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},S(b,T.BasePoint),M.prototype.jpoint=function(x,E,P){return new b(this,x,E,P)},b.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var x=this.z.redInvm(),E=x.redSqr(),P=this.x.redMul(E),A=this.y.redMul(E).redMul(x);return this.curve.point(P,A)},b.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},b.prototype.add=function(x){if(this.isInfinity())return x;if(x.isInfinity())return this;var E=x.z.redSqr(),P=this.z.redSqr(),A=this.x.redMul(E),O=x.x.redMul(P),N=this.y.redMul(E.redMul(x.z)),U=x.y.redMul(P.redMul(this.z)),H=A.redSub(O),V=N.redSub(U);if(0===H.cmpn(0))return 0!==V.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var G=H.redSqr(),K=G.redMul(H),X=A.redMul(G),Z=V.redSqr().redIAdd(K).redISub(X).redISub(X),z=V.redMul(X.redISub(Z)).redISub(N.redMul(K)),J=this.z.redMul(x.z).redMul(H);return this.curve.jpoint(Z,z,J)},b.prototype.mixedAdd=function(x){if(this.isInfinity())return x.toJ();if(x.isInfinity())return this;var E=this.z.redSqr(),P=this.x,A=x.x.redMul(E),O=this.y,N=x.y.redMul(E).redMul(this.z),U=P.redSub(A),H=O.redSub(N);if(0===U.cmpn(0))return 0!==H.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var V=U.redSqr(),G=V.redMul(U),K=P.redMul(V),X=H.redSqr().redIAdd(G).redISub(K).redISub(K),Z=H.redMul(K.redISub(X)).redISub(O.redMul(G)),z=this.z.redMul(U);return this.curve.jpoint(X,Z,z)},b.prototype.dblp=function(x){if(0===x)return this;if(this.isInfinity())return this;if(!x)return this.dbl();var E;if(this.curve.zeroA||this.curve.threeA){var P=this;for(E=0;E=0)return!1;if(P.redIAdd(O),0===this.x.cmp(P))return!0}},b.prototype.inspect=function(){return this.isInfinity()?"":""},b.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},2916:(ne,F,I)=>{"use strict";var b,R=F,B=I(7084),S=I(6270),f=I(1970).assert;function M(C){this.curve="short"===C.type?new S.short(C):"edwards"===C.type?new S.edwards(C):new S.mont(C),this.g=this.curve.g,this.n=this.curve.n,this.hash=C.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function _(C,x){Object.defineProperty(R,C,{configurable:!0,enumerable:!0,get:function(){var E=new M(x);return Object.defineProperty(R,C,{configurable:!0,enumerable:!0,value:E}),E}})}R.PresetCurve=M,_("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:B.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),_("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:B.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),_("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:B.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),_("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:B.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),_("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:B.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),_("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:B.sha256,gRed:!1,g:["9"]}),_("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:B.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{b=I(5150)}catch(C){b=void 0}_("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:B.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",b]})},7626:(ne,F,I)=>{"use strict";var R=I(7433),B=I(2438),S=I(1970),T=I(2916),f=I(7950),M=S.assert,_=I(1259),b=I(5957);function C(x){if(!(this instanceof C))return new C(x);"string"==typeof x&&(M(Object.prototype.hasOwnProperty.call(T,x),"Unknown curve "+x),x=T[x]),x instanceof T.PresetCurve&&(x={curve:x}),this.curve=x.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=x.curve.g,this.g.precompute(x.curve.n.bitLength()+1),this.hash=x.hash||x.curve.hash}ne.exports=C,C.prototype.keyPair=function(E){return new _(this,E)},C.prototype.keyFromPrivate=function(E,P){return _.fromPrivate(this,E,P)},C.prototype.keyFromPublic=function(E,P){return _.fromPublic(this,E,P)},C.prototype.genKeyPair=function(E){E||(E={});for(var P=new B({hash:this.hash,pers:E.pers,persEnc:E.persEnc||"utf8",entropy:E.entropy||f(this.hash.hmacStrength),entropyEnc:E.entropy&&E.entropyEnc||"utf8",nonce:this.n.toArray()}),A=this.n.byteLength(),O=this.n.sub(new R(2));;){var N=new R(P.generate(A));if(!(N.cmp(O)>0))return N.iaddn(1),this.keyFromPrivate(N)}},C.prototype._truncateToN=function(E,P){var A=8*E.byteLength()-this.n.bitLength();return A>0&&(E=E.ushrn(A)),!P&&E.cmp(this.n)>=0?E.sub(this.n):E},C.prototype.sign=function(E,P,A,O){"object"==typeof A&&(O=A,A=null),O||(O={}),P=this.keyFromPrivate(P,A),E=this._truncateToN(new R(E,16));for(var N=this.n.byteLength(),U=P.getPrivate().toArray("be",N),H=E.toArray("be",N),V=new B({hash:this.hash,entropy:U,nonce:H,pers:O.pers,persEnc:O.persEnc||"utf8"}),G=this.n.sub(new R(1)),K=0;;K++){var X=O.k?O.k(K):new R(V.generate(this.n.byteLength()));if(!((X=this._truncateToN(X,!0)).cmpn(1)<=0||X.cmp(G)>=0)){var Z=this.g.mul(X);if(!Z.isInfinity()){var z=Z.getX(),J=z.umod(this.n);if(0!==J.cmpn(0)){var re=X.invm(this.n).mul(J.mul(P.getPrivate()).iadd(E));if(0!==(re=re.umod(this.n)).cmpn(0)){var ve=(Z.getY().isOdd()?1:0)|(0!==z.cmp(J)?2:0);return O.canonical&&re.cmp(this.nh)>0&&(re=this.n.sub(re),ve^=1),new b({r:J,s:re,recoveryParam:ve})}}}}}},C.prototype.verify=function(E,P,A,O){E=this._truncateToN(new R(E,16)),A=this.keyFromPublic(A,O);var N=(P=new b(P,"hex")).r,U=P.s;if(N.cmpn(1)<0||N.cmp(this.n)>=0||U.cmpn(1)<0||U.cmp(this.n)>=0)return!1;var K,H=U.invm(this.n),V=H.mul(E).umod(this.n),G=H.mul(N).umod(this.n);return this.curve._maxwellTrick?!(K=this.g.jmulAdd(V,A.getPublic(),G)).isInfinity()&&K.eqXToP(N):!(K=this.g.mulAdd(V,A.getPublic(),G)).isInfinity()&&0===K.getX().umod(this.n).cmp(N)},C.prototype.recoverPubKey=function(x,E,P,A){M((3&P)===P,"The recovery param is more than two bits"),E=new b(E,A);var O=this.n,N=new R(x),U=E.r,H=E.s,V=1&P,G=P>>1;if(U.cmp(this.curve.p.umod(this.curve.n))>=0&&G)throw new Error("Unable to find sencond key candinate");U=this.curve.pointFromX(G?U.add(this.curve.n):U,V);var K=E.r.invm(O),X=O.sub(N).mul(K).umod(O),Z=H.mul(K).umod(O);return this.g.mulAdd(X,U,Z)},C.prototype.getKeyRecoveryParam=function(x,E,P,A){if(null!==(E=new b(E,A)).recoveryParam)return E.recoveryParam;for(var O=0;O<4;O++){var N;try{N=this.recoverPubKey(x,E,O)}catch(U){continue}if(N.eq(P))return O}throw new Error("Unable to find valid recovery factor")}},1259:(ne,F,I)=>{"use strict";var R=I(7433),S=I(1970).assert;function T(f,M){this.ec=f,this.priv=null,this.pub=null,M.priv&&this._importPrivate(M.priv,M.privEnc),M.pub&&this._importPublic(M.pub,M.pubEnc)}ne.exports=T,T.fromPublic=function(M,_,b){return _ instanceof T?_:new T(M,{pub:_,pubEnc:b})},T.fromPrivate=function(M,_,b){return _ instanceof T?_:new T(M,{priv:_,privEnc:b})},T.prototype.validate=function(){var M=this.getPublic();return M.isInfinity()?{result:!1,reason:"Invalid public key"}:M.validate()?M.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},T.prototype.getPublic=function(M,_){return"string"==typeof M&&(_=M,M=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),_?this.pub.encode(_,M):this.pub},T.prototype.getPrivate=function(M){return"hex"===M?this.priv.toString(16,2):this.priv},T.prototype._importPrivate=function(M,_){this.priv=new R(M,_||16),this.priv=this.priv.umod(this.ec.curve.n)},T.prototype._importPublic=function(M,_){if(M.x||M.y)return"mont"===this.ec.curve.type?S(M.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&S(M.x&&M.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(M.x,M.y));this.pub=this.ec.curve.decodePoint(M,_)},T.prototype.derive=function(M){return M.validate()||S(M.validate(),"public point not validated"),M.mul(this.priv).getX()},T.prototype.sign=function(M,_,b){return this.ec.sign(M,this,_,b)},T.prototype.verify=function(M,_){return this.ec.verify(M,_,this)},T.prototype.inspect=function(){return""}},5957:(ne,F,I)=>{"use strict";var R=I(7433),B=I(1970),S=B.assert;function T(C,x){if(C instanceof T)return C;this._importDER(C,x)||(S(C.r&&C.s,"Signature without r or s"),this.r=new R(C.r,16),this.s=new R(C.s,16),this.recoveryParam=void 0===C.recoveryParam?null:C.recoveryParam)}function f(){this.place=0}function M(C,x){var E=C[x.place++];if(!(128&E))return E;var P=15&E;if(0===P||P>4)return!1;for(var A=0,O=0,N=x.place;O>>=0;return!(A<=127)&&(x.place=N,A)}function _(C){for(var x=0,E=C.length-1;!C[x]&&!(128&C[x+1])&&x>>3);for(C.push(128|E);--E;)C.push(x>>>(E<<3)&255);C.push(x)}}ne.exports=T,T.prototype._importDER=function(x,E){x=B.toArray(x,E);var P=new f;if(48!==x[P.place++])return!1;var A=M(x,P);if(!1===A||A+P.place!==x.length||2!==x[P.place++])return!1;var O=M(x,P);if(!1===O)return!1;var N=x.slice(P.place,O+P.place);if(P.place+=O,2!==x[P.place++])return!1;var U=M(x,P);if(!1===U||x.length!==U+P.place)return!1;var H=x.slice(P.place,U+P.place);if(0===N[0]){if(!(128&N[1]))return!1;N=N.slice(1)}if(0===H[0]){if(!(128&H[1]))return!1;H=H.slice(1)}return this.r=new R(N),this.s=new R(H),this.recoveryParam=null,!0},T.prototype.toDER=function(x){var E=this.r.toArray(),P=this.s.toArray();for(128&E[0]&&(E=[0].concat(E)),128&P[0]&&(P=[0].concat(P)),E=_(E),P=_(P);!(P[0]||128&P[1]);)P=P.slice(1);var A=[2];b(A,E.length),(A=A.concat(E)).push(2),b(A,P.length);var O=A.concat(P),N=[48];return b(N,O.length),N=N.concat(O),B.encode(N,x)}},1885:(ne,F,I)=>{"use strict";var R=I(7084),B=I(2916),S=I(1970),T=S.assert,f=S.parseBytes,M=I(7535),_=I(8241);function b(C){if(T("ed25519"===C,"only tested with ed25519 so far"),!(this instanceof b))return new b(C);this.curve=C=B[C].curve,this.g=C.g,this.g.precompute(C.n.bitLength()+1),this.pointClass=C.point().constructor,this.encodingLength=Math.ceil(C.n.bitLength()/8),this.hash=R.sha512}ne.exports=b,b.prototype.sign=function(x,E){x=f(x);var P=this.keyFromSecret(E),A=this.hashInt(P.messagePrefix(),x),O=this.g.mul(A),N=this.encodePoint(O),U=this.hashInt(N,P.pubBytes(),x).mul(P.priv()),H=A.add(U).umod(this.curve.n);return this.makeSignature({R:O,S:H,Rencoded:N})},b.prototype.verify=function(x,E,P){x=f(x),E=this.makeSignature(E);var A=this.keyFromPublic(P),O=this.hashInt(E.Rencoded(),A.pubBytes(),x),N=this.g.mul(E.S());return E.R().add(A.pub().mul(O)).eq(N)},b.prototype.hashInt=function(){for(var x=this.hash(),E=0;E{"use strict";var R=I(1970),B=R.assert,S=R.parseBytes,T=R.cachedProperty;function f(M,_){this.eddsa=M,this._secret=S(_.secret),M.isPoint(_.pub)?this._pub=_.pub:this._pubBytes=S(_.pub)}f.fromPublic=function(_,b){return b instanceof f?b:new f(_,{pub:b})},f.fromSecret=function(_,b){return b instanceof f?b:new f(_,{secret:b})},f.prototype.secret=function(){return this._secret},T(f,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),T(f,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),T(f,"privBytes",function(){var _=this.eddsa,b=this.hash(),C=_.encodingLength-1,x=b.slice(0,_.encodingLength);return x[0]&=248,x[C]&=127,x[C]|=64,x}),T(f,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),T(f,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),T(f,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),f.prototype.sign=function(_){return B(this._secret,"KeyPair can only verify"),this.eddsa.sign(_,this)},f.prototype.verify=function(_,b){return this.eddsa.verify(_,b,this)},f.prototype.getSecret=function(_){return B(this._secret,"KeyPair is public only"),R.encode(this.secret(),_)},f.prototype.getPublic=function(_){return R.encode(this.pubBytes(),_)},ne.exports=f},8241:(ne,F,I)=>{"use strict";var R=I(7433),B=I(1970),S=B.assert,T=B.cachedProperty,f=B.parseBytes;function M(_,b){this.eddsa=_,"object"!=typeof b&&(b=f(b)),Array.isArray(b)&&(b={R:b.slice(0,_.encodingLength),S:b.slice(_.encodingLength)}),S(b.R&&b.S,"Signature without R or S"),_.isPoint(b.R)&&(this._R=b.R),b.S instanceof R&&(this._S=b.S),this._Rencoded=Array.isArray(b.R)?b.R:b.Rencoded,this._Sencoded=Array.isArray(b.S)?b.S:b.Sencoded}T(M,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),T(M,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),T(M,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),T(M,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),M.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},M.prototype.toHex=function(){return B.encode(this.toBytes(),"hex").toUpperCase()},ne.exports=M},5150:ne=>{ne.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},1970:(ne,F,I)=>{"use strict";var R=F,B=I(7433),S=I(2391),T=I(8195);R.assert=S,R.toArray=T.toArray,R.zero2=T.zero2,R.toHex=T.toHex,R.encode=T.encode,R.getNAF=function f(x,E,P){var A=new Array(Math.max(x.bitLength(),P)+1);A.fill(0);for(var O=1<(O>>1)-1?(O>>1)-V:V):H=0,A[U]=H,N.iushrn(1)}return A},R.getJSF=function M(x,E){var P=[[],[]];x=x.clone(),E=E.clone();for(var N,A=0,O=0;x.cmpn(-A)>0||E.cmpn(-O)>0;){var V,G,U=x.andln(3)+A&3,H=E.andln(3)+O&3;3===U&&(U=-1),3===H&&(H=-1),V=0==(1&U)?0:3!=(N=x.andln(7)+A&7)&&5!==N||2!==H?U:-U,P[0].push(V),G=0==(1&H)?0:3!=(N=E.andln(7)+O&7)&&5!==N||2!==U?H:-H,P[1].push(G),2*A===V+1&&(A=1-A),2*O===G+1&&(O=1-O),x.iushrn(1),E.iushrn(1)}return P},R.cachedProperty=function _(x,E,P){var A="_"+E;x.prototype[E]=function(){return void 0!==this[A]?this[A]:this[A]=P.call(this)}},R.parseBytes=function b(x){return"string"==typeof x?R.toArray(x,"hex"):x},R.intFromLE=function C(x){return new B(x,"hex","le")}},7433:function(ne,F,I){!function(R,B){"use strict";function S(y,o){if(!y)throw new Error(o||"Assertion failed")}function T(y,o){y.super_=o;var l=function(){};l.prototype=o.prototype,y.prototype=new l,y.prototype.constructor=y}function f(y,o,l){if(f.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,null!==y&&(("le"===o||"be"===o)&&(l=o,o=10),this._init(y||0,o||10,l||"be"))}var M;"object"==typeof R?R.exports=f:B.BN=f,f.BN=f,f.wordSize=26;try{M="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:I(5568).Buffer}catch(y){}function _(y,o){var l=y.charCodeAt(o);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},8419:ne=>{"use strict";ne.exports=function(I){for(var R=[],B=I.length,S=0;S=55296&&T<=56319&&B>S+1){var f=I.charCodeAt(S+1);f>=56320&&f<=57343&&(T=1024*(T-55296)+f-56320+65536,S+=1)}T<128?R.push(T):T<2048?(R.push(T>>6|192),R.push(63&T|128)):T<55296||T>=57344&&T<65536?(R.push(T>>12|224),R.push(T>>6&63|128),R.push(63&T|128)):T>=65536&&T<=1114111?(R.push(T>>18|240),R.push(T>>12&63|128),R.push(T>>6&63|128),R.push(63&T|128)):R.push(239,191,189)}return new Uint8Array(R).buffer}},9069:ne=>{"use strict";var R,F="object"==typeof Reflect?Reflect:null,I=F&&"function"==typeof F.apply?F.apply:function(K,X,Z){return Function.prototype.apply.call(K,X,Z)};R=F&&"function"==typeof F.ownKeys?F.ownKeys:Object.getOwnPropertySymbols?function(K){return Object.getOwnPropertyNames(K).concat(Object.getOwnPropertySymbols(K))}:function(K){return Object.getOwnPropertyNames(K)};var S=Number.isNaN||function(K){return K!=K};function T(){T.init.call(this)}ne.exports=T,ne.exports.once=function U(G,K){return new Promise(function(X,Z){function z(re){G.removeListener(K,J),Z(re)}function J(){"function"==typeof G.removeListener&&G.removeListener("error",z),X([].slice.call(arguments))}V(G,K,J,{once:!0}),"error"!==K&&function H(G,K,X){"function"==typeof G.on&&V(G,"error",K,X)}(G,z,{once:!0})})},T.EventEmitter=T,T.prototype._events=void 0,T.prototype._eventsCount=0,T.prototype._maxListeners=void 0;var f=10;function M(G){if("function"!=typeof G)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}function _(G){return void 0===G._maxListeners?T.defaultMaxListeners:G._maxListeners}function b(G,K,X,Z){var z,J,re;if(M(X),void 0===(J=G._events)?(J=G._events=Object.create(null),G._eventsCount=0):(void 0!==J.newListener&&(G.emit("newListener",K,X.listener?X.listener:X),J=G._events),re=J[K]),void 0===re)re=J[K]=X,++G._eventsCount;else if("function"==typeof re?re=J[K]=Z?[X,re]:[re,X]:Z?re.unshift(X):re.push(X),(z=_(G))>0&&re.length>z&&!re.warned){re.warned=!0;var ve=new Error("Possible EventEmitter memory leak detected. "+re.length+" "+String(K)+" listeners added. Use emitter.setMaxListeners() to increase limit");ve.name="MaxListenersExceededWarning",ve.emitter=G,ve.type=K,ve.count=re.length,function B(G){console&&console.warn&&console.warn(G)}(ve)}return G}function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function x(G,K,X){var Z={fired:!1,wrapFn:void 0,target:G,type:K,listener:X},z=C.bind(Z);return z.listener=X,Z.wrapFn=z,z}function E(G,K,X){var Z=G._events;if(void 0===Z)return[];var z=Z[K];return void 0===z?[]:"function"==typeof z?X?[z.listener||z]:[z]:X?function N(G){for(var K=new Array(G.length),X=0;X0&&(re=X[0]),re instanceof Error)throw re;var ve=new Error("Unhandled error."+(re?" ("+re.message+")":""));throw ve.context=re,ve}var y=J[K];if(void 0===y)return!1;if("function"==typeof y)I(y,this,X);else{var o=y.length,l=A(y,o);for(Z=0;Z=0;re--)if(Z[re]===X||Z[re].listener===X){ve=Z[re].listener,J=re;break}if(J<0)return this;0===J?Z.shift():function O(G,K){for(;K+1=0;z--)this.removeListener(K,X[z]);return this},T.prototype.listeners=function(K){return E(this,K,!0)},T.prototype.rawListeners=function(K){return E(this,K,!1)},T.listenerCount=function(G,K){return"function"==typeof G.listenerCount?G.listenerCount(K):P.call(G,K)},T.prototype.listenerCount=P,T.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]}},347:(ne,F,I)=>{var R=I(3502).Buffer,B=I(8095);ne.exports=function S(T,f,M,_){if(R.isBuffer(T)||(T=R.from(T,"binary")),f&&(R.isBuffer(f)||(f=R.from(f,"binary")),8!==f.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var b=M/8,C=R.alloc(b),x=R.alloc(_||0),E=R.alloc(0);b>0||_>0;){var P=new B;P.update(E),P.update(T),f&&P.update(f),E=P.digest();var A=0;if(b>0){var O=C.length-b;A=Math.min(b,E.length),E.copy(C,O,0,A),b-=A}if(A0){var N=x.length-_,U=Math.min(_,E.length-A);E.copy(x,N,A,A+U),_-=U}}return E.fill(0),{key:C,iv:x}}},9076:ne=>{var F=Object.prototype.hasOwnProperty,I=Object.prototype.toString;ne.exports=function(B,S,T){if("[object Function]"!==I.call(S))throw new TypeError("iterator must be a function");var f=B.length;if(f===+f)for(var M=0;M{"use strict";var F="Function.prototype.bind called on incompatible ",I=Array.prototype.slice,R=Object.prototype.toString,B="[object Function]";ne.exports=function(T){var f=this;if("function"!=typeof f||R.call(f)!==B)throw new TypeError(F+f);for(var _,M=I.call(arguments,1),b=function(){if(this instanceof _){var A=f.apply(this,M.concat(I.call(arguments)));return Object(A)===A?A:this}return f.apply(T,M.concat(I.call(arguments)))},C=Math.max(0,f.length-M.length),x=[],E=0;E{"use strict";var R=I(3457);ne.exports=Function.prototype.bind||R},5203:(ne,F,I)=>{"use strict";var R,B=SyntaxError,S=Function,T=TypeError,f=function(l){try{return S('"use strict"; return ('+l+").constructor;")()}catch(c){}},M=Object.getOwnPropertyDescriptor;if(M)try{M({},"")}catch(l){M=null}var _=function(){throw new T},b=M?function(){try{return _}catch(l){try{return M(arguments,"callee").get}catch(c){return _}}}():_,C=I(2969)(),x=I(9757)(),E=Object.getPrototypeOf||(x?function(l){return l.__proto__}:null),P={},A="undefined"!=typeof Uint8Array&&E?E(Uint8Array):R,O={"%AggregateError%":"undefined"==typeof AggregateError?R:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?R:ArrayBuffer,"%ArrayIteratorPrototype%":C&&E?E([][Symbol.iterator]()):R,"%AsyncFromSyncIteratorPrototype%":R,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?R:Atomics,"%BigInt%":"undefined"==typeof BigInt?R:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?R:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?R:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?R:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?R:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?R:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?R:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?R:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?R:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?R:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":C&&E?E(E([][Symbol.iterator]())):R,"%JSON%":"object"==typeof JSON?JSON:R,"%Map%":"undefined"==typeof Map?R:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&C&&E?E((new Map)[Symbol.iterator]()):R,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?R:Promise,"%Proxy%":"undefined"==typeof Proxy?R:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?R:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?R:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&C&&E?E((new Set)[Symbol.iterator]()):R,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?R:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":C&&E?E(""[Symbol.iterator]()):R,"%Symbol%":C?Symbol:R,"%SyntaxError%":B,"%ThrowTypeError%":b,"%TypedArray%":A,"%TypeError%":T,"%Uint8Array%":"undefined"==typeof Uint8Array?R:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?R:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?R:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?R:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?R:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?R:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?R:WeakSet};if(E)try{null.error}catch(l){var N=E(E(l));O["%Error.prototype%"]=N}var U=function l(c){var u;if("%AsyncFunction%"===c)u=f("async function () {}");else if("%GeneratorFunction%"===c)u=f("function* () {}");else if("%AsyncGeneratorFunction%"===c)u=f("async function* () {}");else if("%AsyncGenerator%"===c){var d=l("%AsyncGeneratorFunction%");d&&(u=d.prototype)}else if("%AsyncIteratorPrototype%"===c){var m=l("%AsyncGenerator%");m&&E&&(u=E(m.prototype))}return O[c]=u,u},H={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},V=I(4444),G=I(3164),K=V.call(Function.call,Array.prototype.concat),X=V.call(Function.apply,Array.prototype.splice),Z=V.call(Function.call,String.prototype.replace),z=V.call(Function.call,String.prototype.slice),J=V.call(Function.call,RegExp.prototype.exec),re=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ve=/\\(\\)?/g,y=function(c){var u=z(c,0,1),d=z(c,-1);if("%"===u&&"%"!==d)throw new B("invalid intrinsic syntax, expected closing `%`");if("%"===d&&"%"!==u)throw new B("invalid intrinsic syntax, expected opening `%`");var m=[];return Z(c,re,function(w,p,s,g){m[m.length]=s?Z(g,ve,"$1"):p||w}),m},o=function(c,u){var m,d=c;if(G(H,d)&&(d="%"+(m=H[d])[0]+"%"),G(O,d)){var w=O[d];if(w===P&&(w=U(d)),void 0===w&&!u)throw new T("intrinsic "+c+" exists, but is not available. Please file an issue!");return{alias:m,name:d,value:w}}throw new B("intrinsic "+c+" does not exist!")};ne.exports=function(c,u){if("string"!=typeof c||0===c.length)throw new T("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof u)throw new T('"allowMissing" argument must be a boolean');if(null===J(/^%?[^%]*%?$/,c))throw new B("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var d=y(c),m=d.length>0?d[0]:"",w=o("%"+m+"%",u),p=w.name,s=w.value,g=!1,$=w.alias;$&&(m=$[0],X(d,K([0,1],$)));for(var k=1,q=!0;k=d.length){var fe=M(s,he);s=(q=!!fe)&&"get"in fe&&!("originalValue"in fe.get)?fe.get:s[he]}else q=G(s,he),s=s[he];q&&!g&&(O[p]=s)}}return s}},9757:ne=>{"use strict";var F={foo:{}},I=Object;ne.exports=function(){return{__proto__:F}.foo===F.foo&&!({__proto__:null}instanceof I)}},2969:(ne,F,I)=>{"use strict";var R="undefined"!=typeof Symbol&&Symbol,B=I(1983);ne.exports=function(){return"function"==typeof R&&"function"==typeof Symbol&&"symbol"==typeof R("foo")&&"symbol"==typeof Symbol("bar")&&B()}},1983:ne=>{"use strict";ne.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var I={},R=Symbol("test"),B=Object(R);if("string"==typeof R||"[object Symbol]"!==Object.prototype.toString.call(R)||"[object Symbol]"!==Object.prototype.toString.call(B))return!1;for(R in I[R]=42,I)return!1;if("function"==typeof Object.keys&&0!==Object.keys(I).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(I).length)return!1;var T=Object.getOwnPropertySymbols(I);if(1!==T.length||T[0]!==R||!Object.prototype.propertyIsEnumerable.call(I,R))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var f=Object.getOwnPropertyDescriptor(I,R);if(42!==f.value||!0!==f.enumerable)return!1}return!0}},3164:(ne,F,I)=>{"use strict";var R=I(4444);ne.exports=R.call(Function.call,Object.prototype.hasOwnProperty)},9650:(ne,F,I)=>{"use strict";var R=I(3502).Buffer,B=I(5685).Transform;function f(M){B.call(this),this._block=R.allocUnsafe(M),this._blockSize=M,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}I(3894)(f,B),f.prototype._transform=function(M,_,b){var C=null;try{this.update(M,_)}catch(x){C=x}b(C)},f.prototype._flush=function(M){var _=null;try{this.push(this.digest())}catch(b){_=b}M(_)},f.prototype.update=function(M,_){if(function T(M,_){if(!R.isBuffer(M)&&"string"!=typeof M)throw new TypeError(_+" must be a string or a buffer")}(M,"Data"),this._finalized)throw new Error("Digest already called");R.isBuffer(M)||(M=R.from(M,_));for(var b=this._block,C=0;this._blockOffset+M.length-C>=this._blockSize;){for(var x=this._blockOffset;x0;++E)this._length[E]+=P,(P=this._length[E]/4294967296|0)>0&&(this._length[E]-=4294967296*P);return this},f.prototype._update=function(){throw new Error("_update is not implemented")},f.prototype.digest=function(M){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var _=this._digest();void 0!==M&&(_=_.toString(M)),this._block.fill(0),this._blockOffset=0;for(var b=0;b<4;++b)this._length[b]=0;return _},f.prototype._digest=function(){throw new Error("_digest is not implemented")},ne.exports=f},7084:(ne,F,I)=>{var R=F;R.utils=I(9299),R.common=I(3800),R.sha=I(4962),R.ripemd=I(9458),R.hmac=I(2194),R.sha1=R.sha.sha1,R.sha256=R.sha.sha256,R.sha224=R.sha.sha224,R.sha384=R.sha.sha384,R.sha512=R.sha.sha512,R.ripemd160=R.ripemd.ripemd160},3800:(ne,F,I)=>{"use strict";var R=I(9299),B=I(2391);function S(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}F.BlockHash=S,S.prototype.update=function(f,M){if(f=R.toArray(f,M),this.pending=this.pending?this.pending.concat(f):f,this.pendingTotal+=f.length,this.pending.length>=this._delta8){var _=(f=this.pending).length%this._delta8;this.pending=f.slice(f.length-_,f.length),0===this.pending.length&&(this.pending=null),f=R.join32(f,0,f.length-_,this.endian);for(var b=0;b>>24&255,b[C++]=f>>>16&255,b[C++]=f>>>8&255,b[C++]=255&f}else for(b[C++]=255&f,b[C++]=f>>>8&255,b[C++]=f>>>16&255,b[C++]=f>>>24&255,b[C++]=0,b[C++]=0,b[C++]=0,b[C++]=0,x=8;x{"use strict";var R=I(9299),B=I(2391);function S(T,f,M){if(!(this instanceof S))return new S(T,f,M);this.Hash=T,this.blockSize=T.blockSize/8,this.outSize=T.outSize/8,this.inner=null,this.outer=null,this._init(R.toArray(f,M))}ne.exports=S,S.prototype._init=function(f){f.length>this.blockSize&&(f=(new this.Hash).update(f).digest()),B(f.length<=this.blockSize);for(var M=f.length;M{"use strict";var R=I(9299),B=I(3800),S=R.rotl32,T=R.sum32,f=R.sum32_3,M=R.sum32_4,_=B.BlockHash;function b(){if(!(this instanceof b))return new b;_.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function C(U,H,V,G){return U<=15?H^V^G:U<=31?H&V|~H&G:U<=47?(H|~V)^G:U<=63?H&G|V&~G:H^(V|~G)}function E(U){return U<=15?1352829926:U<=31?1548603684:U<=47?1836072691:U<=63?2053994217:0}R.inherits(b,_),F.ripemd160=b,b.blockSize=512,b.outSize=160,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(H,V){for(var G=this.h[0],K=this.h[1],X=this.h[2],Z=this.h[3],z=this.h[4],J=G,re=K,ve=X,y=Z,o=z,l=0;l<80;l++){var c=T(S(M(G,C(l,K,X,Z),H[P[l]+V],(U=l)<=15?0:U<=31?1518500249:U<=47?1859775393:U<=63?2400959708:2840853838),O[l]),z);G=z,z=Z,Z=S(X,10),X=K,K=c,c=T(S(M(J,C(79-l,re,ve,y),H[A[l]+V],E(l)),N[l]),o),J=o,o=y,y=S(ve,10),ve=re,re=c}var U;c=f(this.h[1],X,y),this.h[1]=f(this.h[2],Z,o),this.h[2]=f(this.h[3],z,J),this.h[3]=f(this.h[4],G,re),this.h[4]=f(this.h[0],K,ve),this.h[0]=c},b.prototype._digest=function(H){return"hex"===H?R.toHex32(this.h,"little"):R.split32(this.h,"little")};var P=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],A=[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=[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],N=[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]},4962:(ne,F,I)=>{"use strict";F.sha1=I(9007),F.sha224=I(55),F.sha256=I(9342),F.sha384=I(8634),F.sha512=I(39)},9007:(ne,F,I)=>{"use strict";var R=I(9299),B=I(3800),S=I(3113),T=R.rotl32,f=R.sum32,M=R.sum32_5,_=S.ft_1,b=B.BlockHash,C=[1518500249,1859775393,2400959708,3395469782];function x(){if(!(this instanceof x))return new x;b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}R.inherits(x,b),ne.exports=x,x.blockSize=512,x.outSize=160,x.hmacStrength=80,x.padLength=64,x.prototype._update=function(P,A){for(var O=this.W,N=0;N<16;N++)O[N]=P[A+N];for(;N{"use strict";var R=I(9299),B=I(9342);function S(){if(!(this instanceof S))return new S;B.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}R.inherits(S,B),ne.exports=S,S.blockSize=512,S.outSize=224,S.hmacStrength=192,S.padLength=64,S.prototype._digest=function(f){return"hex"===f?R.toHex32(this.h.slice(0,7),"big"):R.split32(this.h.slice(0,7),"big")}},9342:(ne,F,I)=>{"use strict";var R=I(9299),B=I(3800),S=I(3113),T=I(2391),f=R.sum32,M=R.sum32_4,_=R.sum32_5,b=S.ch32,C=S.maj32,x=S.s0_256,E=S.s1_256,P=S.g0_256,A=S.g1_256,O=B.BlockHash,N=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function U(){if(!(this instanceof U))return new U;O.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=N,this.W=new Array(64)}R.inherits(U,O),ne.exports=U,U.blockSize=512,U.outSize=256,U.hmacStrength=192,U.padLength=64,U.prototype._update=function(V,G){for(var K=this.W,X=0;X<16;X++)K[X]=V[G+X];for(;X{"use strict";var R=I(9299),B=I(39);function S(){if(!(this instanceof S))return new S;B.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}R.inherits(S,B),ne.exports=S,S.blockSize=1024,S.outSize=384,S.hmacStrength=192,S.padLength=128,S.prototype._digest=function(f){return"hex"===f?R.toHex32(this.h.slice(0,12),"big"):R.split32(this.h.slice(0,12),"big")}},39:(ne,F,I)=>{"use strict";var R=I(9299),B=I(3800),S=I(2391),T=R.rotr64_hi,f=R.rotr64_lo,M=R.shr64_hi,_=R.shr64_lo,b=R.sum64,C=R.sum64_hi,x=R.sum64_lo,E=R.sum64_4_hi,P=R.sum64_4_lo,A=R.sum64_5_hi,O=R.sum64_5_lo,N=B.BlockHash,U=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function H(){if(!(this instanceof H))return new H;N.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=U,this.W=new Array(160)}function V(c,u,d,m,w){var p=c&d^~c&w;return p<0&&(p+=4294967296),p}function G(c,u,d,m,w,p){var s=u&m^~u&p;return s<0&&(s+=4294967296),s}function K(c,u,d,m,w){var p=c&d^c&w^d&w;return p<0&&(p+=4294967296),p}function X(c,u,d,m,w,p){var s=u&m^u&p^m&p;return s<0&&(s+=4294967296),s}function Z(c,u){var p=T(c,u,28)^T(u,c,2)^T(u,c,7);return p<0&&(p+=4294967296),p}function z(c,u){var p=f(c,u,28)^f(u,c,2)^f(u,c,7);return p<0&&(p+=4294967296),p}function J(c,u){var p=T(c,u,14)^T(c,u,18)^T(u,c,9);return p<0&&(p+=4294967296),p}function re(c,u){var p=f(c,u,14)^f(c,u,18)^f(u,c,9);return p<0&&(p+=4294967296),p}function ve(c,u){var p=T(c,u,1)^T(c,u,8)^M(c,u,7);return p<0&&(p+=4294967296),p}function y(c,u){var p=f(c,u,1)^f(c,u,8)^_(c,u,7);return p<0&&(p+=4294967296),p}function o(c,u){var p=T(c,u,19)^T(u,c,29)^M(c,u,6);return p<0&&(p+=4294967296),p}function l(c,u){var p=f(c,u,19)^f(u,c,29)^_(c,u,6);return p<0&&(p+=4294967296),p}R.inherits(H,N),ne.exports=H,H.blockSize=1024,H.outSize=512,H.hmacStrength=192,H.padLength=128,H.prototype._prepareBlock=function(u,d){for(var m=this.W,w=0;w<32;w++)m[w]=u[d+w];for(;w{"use strict";var B=I(9299).rotr32;function T(E,P,A){return E&P^~E&A}function f(E,P,A){return E&P^E&A^P&A}function M(E,P,A){return E^P^A}F.ft_1=function S(E,P,A,O){return 0===E?T(P,A,O):1===E||3===E?M(P,A,O):2===E?f(P,A,O):void 0},F.ch32=T,F.maj32=f,F.p32=M,F.s0_256=function _(E){return B(E,2)^B(E,13)^B(E,22)},F.s1_256=function b(E){return B(E,6)^B(E,11)^B(E,25)},F.g0_256=function C(E){return B(E,7)^B(E,18)^E>>>3},F.g1_256=function x(E){return B(E,17)^B(E,19)^E>>>10}},9299:(ne,F,I)=>{"use strict";var R=I(2391),B=I(3894);function S(l,c){return!(55296!=(64512&l.charCodeAt(c))||c<0||c+1>=l.length)&&56320==(64512&l.charCodeAt(c+1))}function M(l){return(l>>>24|l>>>8&65280|l<<8&16711680|(255&l)<<24)>>>0}function b(l){return 1===l.length?"0"+l:l}function C(l){return 7===l.length?"0"+l:6===l.length?"00"+l:5===l.length?"000"+l:4===l.length?"0000"+l:3===l.length?"00000"+l:2===l.length?"000000"+l:1===l.length?"0000000"+l:l}F.inherits=B,F.toArray=function T(l,c){if(Array.isArray(l))return l.slice();if(!l)return[];var u=[];if("string"==typeof l)if(c){if("hex"===c)for((l=l.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(l="0"+l),m=0;m>6|192,u[d++]=63&w|128):S(l,m)?(w=65536+((1023&w)<<10)+(1023&l.charCodeAt(++m)),u[d++]=w>>18|240,u[d++]=w>>12&63|128,u[d++]=w>>6&63|128,u[d++]=63&w|128):(u[d++]=w>>12|224,u[d++]=w>>6&63|128,u[d++]=63&w|128)}else for(m=0;m>>0;return w},F.split32=function E(l,c){for(var u=new Array(4*l.length),d=0,m=0;d>>24,u[m+1]=w>>>16&255,u[m+2]=w>>>8&255,u[m+3]=255&w):(u[m+3]=w>>>24,u[m+2]=w>>>16&255,u[m+1]=w>>>8&255,u[m]=255&w)}return u},F.rotr32=function P(l,c){return l>>>c|l<<32-c},F.rotl32=function A(l,c){return l<>>32-c},F.sum32=function O(l,c){return l+c>>>0},F.sum32_3=function N(l,c,u){return l+c+u>>>0},F.sum32_4=function U(l,c,u,d){return l+c+u+d>>>0},F.sum32_5=function H(l,c,u,d,m){return l+c+u+d+m>>>0},F.sum64=function V(l,c,u,d){var p=d+l[c+1]>>>0;l[c]=(p>>0,l[c+1]=p},F.sum64_hi=function G(l,c,u,d){return(c+d>>>0>>0},F.sum64_lo=function K(l,c,u,d){return c+d>>>0},F.sum64_4_hi=function X(l,c,u,d,m,w,p,s){var g=0,$=c;return g+=($=$+d>>>0)>>0)>>0)>>0},F.sum64_4_lo=function Z(l,c,u,d,m,w,p,s){return c+d+w+s>>>0},F.sum64_5_hi=function z(l,c,u,d,m,w,p,s,g,$){var k=0,q=c;return k+=(q=q+d>>>0)>>0)>>0)>>0)<$?1:0)>>>0},F.sum64_5_lo=function J(l,c,u,d,m,w,p,s,g,$){return c+d+w+s+$>>>0},F.rotr64_hi=function re(l,c,u){return(c<<32-u|l>>>u)>>>0},F.rotr64_lo=function ve(l,c,u){return(l<<32-u|c>>>u)>>>0},F.shr64_hi=function y(l,c,u){return l>>>u},F.shr64_lo=function o(l,c,u){return(l<<32-u|c>>>u)>>>0}},2438:(ne,F,I)=>{"use strict";var R=I(7084),B=I(8195),S=I(2391);function T(f){if(!(this instanceof T))return new T(f);this.hash=f.hash,this.predResist=!!f.predResist,this.outLen=this.hash.outSize,this.minEntropy=f.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var M=B.toArray(f.entropy,f.entropyEnc||"hex"),_=B.toArray(f.nonce,f.nonceEnc||"hex"),b=B.toArray(f.pers,f.persEnc||"hex");S(M.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(M,_,b)}ne.exports=T,T.prototype._init=function(M,_,b){var C=M.concat(_).concat(b);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var x=0;x=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(M.concat(b||[])),this._reseed=1},T.prototype.generate=function(M,_,b,C){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof _&&(C=b,b=_,_=null),b&&(b=B.toArray(b,C||"hex"),this._update(b));for(var x=[];x.length{var R=I(4216),B=I(8762),S=ne.exports;for(var T in R)R.hasOwnProperty(T)&&(S[T]=R[T]);function f(M){if("string"==typeof M&&(M=B.parse(M)),M.protocol||(M.protocol="https:"),"https:"!==M.protocol)throw new Error('Protocol "'+M.protocol+'" not supported. Expected "https:"');return M}S.request=function(M,_){return M=f(M),R.request.call(this,M,_)},S.get=function(M,_){return M=f(M),R.get.call(this,M,_)}},8461:(ne,F)=>{F.read=function(I,R,B,S,T){var f,M,_=8*T-S-1,b=(1<<_)-1,C=b>>1,x=-7,E=B?T-1:0,P=B?-1:1,A=I[R+E];for(E+=P,f=A&(1<<-x)-1,A>>=-x,x+=_;x>0;f=256*f+I[R+E],E+=P,x-=8);for(M=f&(1<<-x)-1,f>>=-x,x+=S;x>0;M=256*M+I[R+E],E+=P,x-=8);if(0===f)f=1-C;else{if(f===b)return M?NaN:1/0*(A?-1:1);M+=Math.pow(2,S),f-=C}return(A?-1:1)*M*Math.pow(2,f-S)},F.write=function(I,R,B,S,T,f){var M,_,b,C=8*f-T-1,x=(1<>1,P=23===T?Math.pow(2,-24)-Math.pow(2,-77):0,A=S?0:f-1,O=S?1:-1,N=R<0||0===R&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(_=isNaN(R)?1:0,M=x):(M=Math.floor(Math.log(R)/Math.LN2),R*(b=Math.pow(2,-M))<1&&(M--,b*=2),(R+=M+E>=1?P/b:P*Math.pow(2,1-E))*b>=2&&(M++,b/=2),M+E>=x?(_=0,M=x):M+E>=1?(_=(R*b-1)*Math.pow(2,T),M+=E):(_=R*Math.pow(2,E-1)*Math.pow(2,T),M=0));T>=8;I[B+A]=255&_,A+=O,_/=256,T-=8);for(M=M<0;I[B+A]=255&M,A+=O,M/=256,C-=8);I[B+A-O]|=128*N}},3894:ne=>{ne.exports="function"==typeof Object.create?function(I,R){R&&(I.super_=R,I.prototype=Object.create(R.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}))}:function(I,R){if(R){I.super_=R;var B=function(){};B.prototype=R.prototype,I.prototype=new B,I.prototype.constructor=I}}},3407:(ne,F,I)=>{"use strict";var R="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,S=I(5834)("Object.prototype.toString"),T=function(b){return!(R&&b&&"object"==typeof b&&Symbol.toStringTag in b)&&"[object Arguments]"===S(b)},f=function(b){return!!T(b)||null!==b&&"object"==typeof b&&"number"==typeof b.length&&b.length>=0&&"[object Array]"!==S(b)&&"[object Function]"===S(b.callee)},M=function(){return T(arguments)}();T.isLegacyArguments=f,ne.exports=M?T:f},110:ne=>{"use strict";var f,F=Object.prototype.toString,I=Function.prototype.toString,R=/^\s*(?:function)?\*/,B="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,S=Object.getPrototypeOf;ne.exports=function(_){if("function"!=typeof _)return!1;if(R.test(I.call(_)))return!0;if(!B)return"[object GeneratorFunction]"===F.call(_);if(!S)return!1;if(void 0===f){var C=function(){if(!B)return!1;try{return Function("return function*() {}")()}catch(M){}}();f=!!C&&S(C)}return S(_)===f}},597:(ne,F,I)=>{"use strict";var R=I(9076),B=I(7029),S=I(5834),T=S("Object.prototype.toString"),M=I(2969)()&&"symbol"==typeof Symbol.toStringTag,_=B(),b=S("Array.prototype.indexOf",!0)||function(N,U){for(var H=0;H-1}return!!E&&function(N){var U=!1;return R(x,function(H,V){if(!U)try{U=H.call(N)===V}catch(G){}}),U}(N)}},4994:(ne,F,I)=>{var R=I(4312),B=I(6421),S=I(5764),T=I(8685),f=I(6676);function M(_){var b=-1,C=null==_?0:_.length;for(this.clear();++b{var R=I(1840),B=I(4378),S=I(4981),T=I(7343),f=I(8895);function M(_){var b=-1,C=null==_?0:_.length;for(this.clear();++b{var S=I(3436)(I(2119),"Map");ne.exports=S},9850:(ne,F,I)=>{var R=I(638),B=I(1184),S=I(866),T=I(3771),f=I(1772);function M(_){var b=-1,C=null==_?0:_.length;for(this.clear();++b{var R=I(2119);ne.exports=R.Symbol},4633:ne=>{ne.exports=function F(I,R){for(var B=-1,S=null==I?0:I.length,T=Array(S);++B{var R=I(5683),B=I(217),T=Object.prototype.hasOwnProperty;ne.exports=function f(M,_,b){var C=M[_];(!T.call(M,_)||!B(C,b)||void 0===b&&!(_ in M))&&R(M,_,b)}},3503:(ne,F,I)=>{var R=I(217);ne.exports=function B(S,T){for(var f=S.length;f--;)if(R(S[f][0],T))return f;return-1}},5683:(ne,F,I)=>{var R=I(6713);ne.exports=function B(S,T,f){"__proto__"==T&&R?R(S,T,{configurable:!0,enumerable:!0,value:f,writable:!0}):S[T]=f}},5456:(ne,F,I)=>{var R=I(6884),B=I(8533);ne.exports=function S(T,f){for(var M=0,_=(f=R(f,T)).length;null!=T&&M<_;)T=T[B(f[M++])];return M&&M==_?T:void 0}},3337:(ne,F,I)=>{var R=I(443),B=I(1318),S=I(2902),M=R?R.toStringTag:void 0;ne.exports=function _(b){return null==b?void 0===b?"[object Undefined]":"[object Null]":M&&M in Object(b)?B(b):S(b)}},7304:(ne,F,I)=>{var R=I(5946),B=I(1943),S=I(5940),T=I(2827),M=/^\[object .+?Constructor\]$/,E=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");ne.exports=function P(A){return!(!S(A)||B(A))&&(R(A)?E:M).test(T(A))}},5963:(ne,F,I)=>{var R=I(9719),B=I(6884),S=I(8442),T=I(5940),f=I(8533);ne.exports=function M(_,b,C,x){if(!T(_))return _;for(var E=-1,P=(b=B(b,_)).length,A=P-1,O=_;null!=O&&++E{var R=I(443),B=I(4633),S=I(1503),T=I(4129),M=R?R.prototype:void 0,_=M?M.toString:void 0;ne.exports=function b(C){if("string"==typeof C)return C;if(S(C))return B(C,b)+"";if(T(C))return _?_.call(C):"";var x=C+"";return"0"==x&&1/C==-1/0?"-0":x}},6884:(ne,F,I)=>{var R=I(1503),B=I(5352),S=I(2855),T=I(3943);ne.exports=function f(M,_){return R(M)?M:B(M,_)?[M]:S(T(M))}},4610:(ne,F,I)=>{var R=I(2119);ne.exports=R["__core-js_shared__"]},6713:(ne,F,I)=>{var R=I(3436),B=function(){try{var S=R(Object,"defineProperty");return S({},"",{}),S}catch(T){}}();ne.exports=B},9122:ne=>{var F="object"==typeof global&&global&&global.Object===Object&&global;ne.exports=F},4537:(ne,F,I)=>{var R=I(3819);ne.exports=function B(S,T){var f=S.__data__;return R(T)?f["string"==typeof T?"string":"hash"]:f.map}},3436:(ne,F,I)=>{var R=I(7304),B=I(1990);ne.exports=function S(T,f){var M=B(T,f);return R(M)?M:void 0}},1318:(ne,F,I)=>{var R=I(443),B=Object.prototype,S=B.hasOwnProperty,T=B.toString,f=R?R.toStringTag:void 0;ne.exports=function M(_){var b=S.call(_,f),C=_[f];try{_[f]=void 0;var x=!0}catch(P){}var E=T.call(_);return x&&(b?_[f]=C:delete _[f]),E}},1990:ne=>{ne.exports=function F(I,R){return null==I?void 0:I[R]}},4312:(ne,F,I)=>{var R=I(862);ne.exports=function B(){this.__data__=R?R(null):{},this.size=0}},6421:ne=>{ne.exports=function F(I){var R=this.has(I)&&delete this.__data__[I];return this.size-=R?1:0,R}},5764:(ne,F,I)=>{var R=I(862),T=Object.prototype.hasOwnProperty;ne.exports=function f(M){var _=this.__data__;if(R){var b=_[M];return"__lodash_hash_undefined__"===b?void 0:b}return T.call(_,M)?_[M]:void 0}},8685:(ne,F,I)=>{var R=I(862),S=Object.prototype.hasOwnProperty;ne.exports=function T(f){var M=this.__data__;return R?void 0!==M[f]:S.call(M,f)}},6676:(ne,F,I)=>{var R=I(862);ne.exports=function S(T,f){var M=this.__data__;return this.size+=this.has(T)?0:1,M[T]=R&&void 0===f?"__lodash_hash_undefined__":f,this}},8442:ne=>{var I=/^(?:0|[1-9]\d*)$/;ne.exports=function R(B,S){var T=typeof B;return!!(S=null==S?9007199254740991:S)&&("number"==T||"symbol"!=T&&I.test(B))&&B>-1&&B%1==0&&B{var R=I(1503),B=I(4129),S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/;ne.exports=function f(M,_){if(R(M))return!1;var b=typeof M;return!("number"!=b&&"symbol"!=b&&"boolean"!=b&&null!=M&&!B(M))||T.test(M)||!S.test(M)||null!=_&&M in Object(_)}},3819:ne=>{ne.exports=function F(I){var R=typeof I;return"string"==R||"number"==R||"symbol"==R||"boolean"==R?"__proto__"!==I:null===I}},1943:(ne,F,I)=>{var T,R=I(4610),B=(T=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"";ne.exports=function S(T){return!!B&&B in T}},1840:ne=>{ne.exports=function F(){this.__data__=[],this.size=0}},4378:(ne,F,I)=>{var R=I(3503),S=Array.prototype.splice;ne.exports=function T(f){var M=this.__data__,_=R(M,f);return!(_<0||(_==M.length-1?M.pop():S.call(M,_,1),--this.size,0))}},4981:(ne,F,I)=>{var R=I(3503);ne.exports=function B(S){var T=this.__data__,f=R(T,S);return f<0?void 0:T[f][1]}},7343:(ne,F,I)=>{var R=I(3503);ne.exports=function B(S){return R(this.__data__,S)>-1}},8895:(ne,F,I)=>{var R=I(3503);ne.exports=function B(S,T){var f=this.__data__,M=R(f,S);return M<0?(++this.size,f.push([S,T])):f[M][1]=T,this}},638:(ne,F,I)=>{var R=I(4994),B=I(9215),S=I(1501);ne.exports=function T(){this.size=0,this.__data__={hash:new R,map:new(S||B),string:new R}}},1184:(ne,F,I)=>{var R=I(4537);ne.exports=function B(S){var T=R(this,S).delete(S);return this.size-=T?1:0,T}},866:(ne,F,I)=>{var R=I(4537);ne.exports=function B(S){return R(this,S).get(S)}},3771:(ne,F,I)=>{var R=I(4537);ne.exports=function B(S){return R(this,S).has(S)}},1772:(ne,F,I)=>{var R=I(4537);ne.exports=function B(S,T){var f=R(this,S),M=f.size;return f.set(S,T),this.size+=f.size==M?0:1,this}},719:(ne,F,I)=>{var R=I(535);ne.exports=function S(T){var f=R(T,function(_){return 500===M.size&&M.clear(),_}),M=f.cache;return f}},862:(ne,F,I)=>{var B=I(3436)(Object,"create");ne.exports=B},2902:ne=>{var I=Object.prototype.toString;ne.exports=function R(B){return I.call(B)}},2119:(ne,F,I)=>{var R=I(9122),B="object"==typeof self&&self&&self.Object===Object&&self,S=R||B||Function("return this")();ne.exports=S},2855:(ne,F,I)=>{var R=I(719),B=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/\\(\\)?/g,T=R(function(f){var M=[];return 46===f.charCodeAt(0)&&M.push(""),f.replace(B,function(_,b,C,x){M.push(C?x.replace(S,"$1"):b||_)}),M});ne.exports=T},8533:(ne,F,I)=>{var R=I(4129);ne.exports=function S(T){if("string"==typeof T||R(T))return T;var f=T+"";return"0"==f&&1/T==-1/0?"-0":f}},2827:ne=>{var I=Function.prototype.toString;ne.exports=function R(B){if(null!=B){try{return I.call(B)}catch(S){}try{return B+""}catch(S){}}return""}},217:ne=>{ne.exports=function F(I,R){return I===R||I!=I&&R!=R}},8817:(ne,F,I)=>{var R=I(5456);ne.exports=function B(S,T,f){var M=null==S?void 0:R(S,T);return void 0===M?f:M}},1503:ne=>{ne.exports=Array.isArray},5946:(ne,F,I)=>{var R=I(3337),B=I(5940);ne.exports=function _(b){if(!B(b))return!1;var C=R(b);return"[object Function]"==C||"[object GeneratorFunction]"==C||"[object AsyncFunction]"==C||"[object Proxy]"==C}},5940:ne=>{ne.exports=function F(I){var R=typeof I;return null!=I&&("object"==R||"function"==R)}},2671:ne=>{ne.exports=function F(I){return null!=I&&"object"==typeof I}},4129:(ne,F,I)=>{var R=I(3337),B=I(2671);ne.exports=function T(f){return"symbol"==typeof f||B(f)&&"[object Symbol]"==R(f)}},535:(ne,F,I)=>{var R=I(9850);function S(T,f){if("function"!=typeof T||null!=f&&"function"!=typeof f)throw new TypeError("Expected a function");var M=function(){var _=arguments,b=f?f.apply(this,_):_[0],C=M.cache;if(C.has(b))return C.get(b);var x=T.apply(this,_);return M.cache=C.set(b,x)||C,x};return M.cache=new(S.Cache||R),M}S.Cache=R,ne.exports=S},4793:(ne,F,I)=>{var R=I(5963);ne.exports=function B(S,T,f){return null==S?S:R(S,T,f)}},3943:(ne,F,I)=>{var R=I(3935);ne.exports=function B(S){return null==S?"":R(S)}},8095:(ne,F,I)=>{"use strict";var R=I(3894),B=I(9650),S=I(3502).Buffer,T=new Array(16);function f(){B.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function M(E,P){return E<>>32-P}function _(E,P,A,O,N,U,H){return M(E+(P&A|~P&O)+N+U|0,H)+P|0}function b(E,P,A,O,N,U,H){return M(E+(P&O|A&~O)+N+U|0,H)+P|0}function C(E,P,A,O,N,U,H){return M(E+(P^A^O)+N+U|0,H)+P|0}function x(E,P,A,O,N,U,H){return M(E+(A^(P|~O))+N+U|0,H)+P|0}R(f,B),f.prototype._update=function(){for(var E=T,P=0;P<16;++P)E[P]=this._block.readInt32LE(4*P);var A=this._a,O=this._b,N=this._c,U=this._d;A=_(A,O,N,U,E[0],3614090360,7),U=_(U,A,O,N,E[1],3905402710,12),N=_(N,U,A,O,E[2],606105819,17),O=_(O,N,U,A,E[3],3250441966,22),A=_(A,O,N,U,E[4],4118548399,7),U=_(U,A,O,N,E[5],1200080426,12),N=_(N,U,A,O,E[6],2821735955,17),O=_(O,N,U,A,E[7],4249261313,22),A=_(A,O,N,U,E[8],1770035416,7),U=_(U,A,O,N,E[9],2336552879,12),N=_(N,U,A,O,E[10],4294925233,17),O=_(O,N,U,A,E[11],2304563134,22),A=_(A,O,N,U,E[12],1804603682,7),U=_(U,A,O,N,E[13],4254626195,12),N=_(N,U,A,O,E[14],2792965006,17),A=b(A,O=_(O,N,U,A,E[15],1236535329,22),N,U,E[1],4129170786,5),U=b(U,A,O,N,E[6],3225465664,9),N=b(N,U,A,O,E[11],643717713,14),O=b(O,N,U,A,E[0],3921069994,20),A=b(A,O,N,U,E[5],3593408605,5),U=b(U,A,O,N,E[10],38016083,9),N=b(N,U,A,O,E[15],3634488961,14),O=b(O,N,U,A,E[4],3889429448,20),A=b(A,O,N,U,E[9],568446438,5),U=b(U,A,O,N,E[14],3275163606,9),N=b(N,U,A,O,E[3],4107603335,14),O=b(O,N,U,A,E[8],1163531501,20),A=b(A,O,N,U,E[13],2850285829,5),U=b(U,A,O,N,E[2],4243563512,9),N=b(N,U,A,O,E[7],1735328473,14),A=C(A,O=b(O,N,U,A,E[12],2368359562,20),N,U,E[5],4294588738,4),U=C(U,A,O,N,E[8],2272392833,11),N=C(N,U,A,O,E[11],1839030562,16),O=C(O,N,U,A,E[14],4259657740,23),A=C(A,O,N,U,E[1],2763975236,4),U=C(U,A,O,N,E[4],1272893353,11),N=C(N,U,A,O,E[7],4139469664,16),O=C(O,N,U,A,E[10],3200236656,23),A=C(A,O,N,U,E[13],681279174,4),U=C(U,A,O,N,E[0],3936430074,11),N=C(N,U,A,O,E[3],3572445317,16),O=C(O,N,U,A,E[6],76029189,23),A=C(A,O,N,U,E[9],3654602809,4),U=C(U,A,O,N,E[12],3873151461,11),N=C(N,U,A,O,E[15],530742520,16),A=x(A,O=C(O,N,U,A,E[2],3299628645,23),N,U,E[0],4096336452,6),U=x(U,A,O,N,E[7],1126891415,10),N=x(N,U,A,O,E[14],2878612391,15),O=x(O,N,U,A,E[5],4237533241,21),A=x(A,O,N,U,E[12],1700485571,6),U=x(U,A,O,N,E[3],2399980690,10),N=x(N,U,A,O,E[10],4293915773,15),O=x(O,N,U,A,E[1],2240044497,21),A=x(A,O,N,U,E[8],1873313359,6),U=x(U,A,O,N,E[15],4264355552,10),N=x(N,U,A,O,E[6],2734768916,15),O=x(O,N,U,A,E[13],1309151649,21),A=x(A,O,N,U,E[4],4149444226,6),U=x(U,A,O,N,E[11],3174756917,10),N=x(N,U,A,O,E[2],718787259,15),O=x(O,N,U,A,E[9],3951481745,21),this._a=this._a+A|0,this._b=this._b+O|0,this._c=this._c+N|0,this._d=this._d+U|0},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var E=S.allocUnsafe(16);return E.writeInt32LE(this._a,0),E.writeInt32LE(this._b,4),E.writeInt32LE(this._c,8),E.writeInt32LE(this._d,12),E},ne.exports=f},7079:(ne,F,I)=>{var R=I(1378),B=I(7950);function S(T){this.rand=T||new B.Rand}ne.exports=S,S.create=function(f){return new S(f)},S.prototype._randbelow=function(f){var M=f.bitLength(),_=Math.ceil(M/8);do{var b=new R(this.rand.generate(_))}while(b.cmp(f)>=0);return b},S.prototype._randrange=function(f,M){var _=M.sub(f);return f.add(this._randbelow(_))},S.prototype.test=function(f,M,_){var b=f.bitLength(),C=R.mont(f),x=new R(1).toRed(C);M||(M=Math.max(1,b/48|0));for(var E=f.subn(1),P=0;!E.testn(P);P++);for(var A=f.shrn(P),O=E.toRed(C);M>0;M--){var U=this._randrange(new R(2),E);_&&_(U);var H=U.toRed(C).redPow(A);if(0!==H.cmp(x)&&0!==H.cmp(O)){for(var V=1;V0;M--){var O=this._randrange(new R(2),x),N=f.gcd(O);if(0!==N.cmpn(1))return N;var U=O.toRed(b).redPow(P);if(0!==U.cmp(C)&&0!==U.cmp(A)){for(var H=1;H=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},2391:ne=>{function F(I,R){if(!I)throw new Error(R||"Assertion failed")}ne.exports=F,F.equal=function(R,B,S){if(R!=B)throw new Error(S||"Assertion failed: "+R+" != "+B)}},8195:(ne,F)=>{"use strict";var I=F;function B(T){return 1===T.length?"0"+T:T}function S(T){for(var f="",M=0;M>8,x=255&b;C?M.push(C,x):M.push(x)}return M},I.zero2=B,I.toHex=S,I.encode=function(f,M){return"hex"===M?S(f):f}},7024:(ne,F,I)=>{var R="function"==typeof Map&&Map.prototype,B=Object.getOwnPropertyDescriptor&&R?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,S=R&&B&&"function"==typeof B.get?B.get:null,T=R&&Map.prototype.forEach,f="function"==typeof Set&&Set.prototype,M=Object.getOwnPropertyDescriptor&&f?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_=f&&M&&"function"==typeof M.get?M.get:null,b=f&&Set.prototype.forEach,x="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,P="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,O="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,N=Boolean.prototype.valueOf,U=Object.prototype.toString,H=Function.prototype.toString,V=String.prototype.match,G="function"==typeof BigInt?BigInt.prototype.valueOf:null,K=Object.getOwnPropertySymbols,X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Z="function"==typeof Symbol&&"object"==typeof Symbol.iterator,z=Object.prototype.propertyIsEnumerable,J=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Re){return Re.__proto__}:null),re=I(4654).custom,ve=re&&g(re)?re:null,y="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function o(Re,we,Oe){var wt="double"===(Oe.quoteStyle||we)?'"':"'";return wt+Re+wt}function l(Re){return String(Re).replace(/"/g,""")}function c(Re){return!("[object Array]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}function g(Re){if(Z)return Re&&"object"==typeof Re&&Re instanceof Symbol;if("symbol"==typeof Re)return!0;if(!Re||"object"!=typeof Re||!X)return!1;try{return X.call(Re),!0}catch(we){}return!1}ne.exports=function Re(we,Oe,wt,Be){var oe=Oe||{};if(q(oe,"quoteStyle")&&"single"!==oe.quoteStyle&&"double"!==oe.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(oe,"maxStringLength")&&("number"==typeof oe.maxStringLength?oe.maxStringLength<0&&oe.maxStringLength!==1/0:null!==oe.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var te=!q(oe,"customInspect")||oe.customInspect;if("boolean"!=typeof te&&"symbol"!==te)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(oe,"indent")&&null!==oe.indent&&"\t"!==oe.indent&&!(parseInt(oe.indent,10)===oe.indent&&oe.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===we)return"undefined";if(null===we)return"null";if("boolean"==typeof we)return we?"true":"false";if("string"==typeof we)return _e(we,oe);if("number"==typeof we)return 0===we?1/0/we>0?"0":"-0":String(we);if("bigint"==typeof we)return String(we)+"n";var W=void 0===oe.depth?5:oe.depth;if(void 0===wt&&(wt=0),wt>=W&&W>0&&"object"==typeof we)return c(we)?"[Array]":"[Object]";var de=function Le(Re,we){var Oe;if("\t"===Re.indent)Oe="\t";else{if(!("number"==typeof Re.indent&&Re.indent>0))return null;Oe=Array(Re.indent+1).join(" ")}return{base:Oe,prev:Array(we+1).join(Oe)}}(oe,wt);if(void 0===Be)Be=[];else if(ge(Be,we)>=0)return"[Circular]";function Pe(Ne,Xt,$e){if(Xt&&(Be=Be.slice()).push(Xt),$e){var et={depth:oe.depth};return q(oe,"quoteStyle")&&(et.quoteStyle=oe.quoteStyle),Re(Ne,et,wt+1,Be)}return Re(Ne,oe,wt+1,Be)}if("function"==typeof we){var Ee=function be(Re){if(Re.name)return Re.name;var we=V.call(H.call(Re),/^function\s*([\w$]+)/);return we?we[1]:null}(we),Ae=Ce(we,Pe);return"[Function"+(Ee?": "+Ee:" (anonymous)")+"]"+(Ae.length>0?" { "+Ae.join(", ")+" }":"")}if(g(we)){var St=Z?String(we).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):X.call(we);return"object"!=typeof we||Z?St:le(St)}if(function ue(Re){return!(!Re||"object"!=typeof Re)&&("undefined"!=typeof HTMLElement&&Re instanceof HTMLElement||"string"==typeof Re.nodeName&&"function"==typeof Re.getAttribute)}(we)){for(var Xe="<"+String(we.nodeName).toLowerCase(),Je=we.attributes||[],kt=0;kt"}if(c(we)){if(0===we.length)return"[]";var Ye=Ce(we,Pe);return de&&!function ae(Re){for(var we=0;we=0)return!1;return!0}(Ye)?"["+xe(Ye,de)+"]":"[ "+Ye.join(", ")+" ]"}if(function m(Re){return!("[object Error]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we)){var tt=Ce(we,Pe);return 0===tt.length?"["+String(we)+"]":"{ ["+String(we)+"] "+tt.join(", ")+" }"}if("object"==typeof we&&te){if(ve&&"function"==typeof we[ve])return we[ve]();if("symbol"!==te&&"function"==typeof we.inspect)return we.inspect()}if(function fe(Re){if(!S||!Re||"object"!=typeof Re)return!1;try{S.call(Re);try{_.call(Re)}catch(we){return!0}return Re instanceof Map}catch(we){}return!1}(we)){var Dn=[];return T.call(we,function(Ne,Xt){Dn.push(Pe(Xt,we,!0)+" => "+Pe(Ne,we))}),Y("Map",S.call(we),Dn,de)}if(function ee(Re){if(!_||!Re||"object"!=typeof Re)return!1;try{_.call(Re);try{S.call(Re)}catch(we){return!0}return Re instanceof Set}catch(we){}return!1}(we)){var nt=[];return b.call(we,function(Ne){nt.push(Pe(Ne,we))}),Y("Set",_.call(we),nt,de)}if(function se(Re){if(!x||!Re||"object"!=typeof Re)return!1;try{x.call(Re,x);try{P.call(Re,P)}catch(we){return!0}return Re instanceof WeakMap}catch(we){}return!1}(we))return ie("WeakMap");if(function pe(Re){if(!P||!Re||"object"!=typeof Re)return!1;try{P.call(Re,P);try{x.call(Re,x)}catch(we){return!0}return Re instanceof WeakSet}catch(we){}return!1}(we))return ie("WeakSet");if(function ce(Re){if(!O||!Re||"object"!=typeof Re)return!1;try{return O.call(Re),!0}catch(we){}return!1}(we))return ie("WeakRef");if(function p(Re){return!("[object Number]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we))return le(Pe(Number(we)));if(function $(Re){if(!Re||"object"!=typeof Re||!G)return!1;try{return G.call(Re),!0}catch(we){}return!1}(we))return le(Pe(G.call(we)));if(function s(Re){return!("[object Boolean]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we))return le(N.call(we));if(function w(Re){return!("[object String]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we))return le(Pe(String(we)));if(!function u(Re){return!("[object Date]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we)&&!function d(Re){return!("[object RegExp]"!==he(Re)||y&&"object"==typeof Re&&y in Re)}(we)){var ht=Ce(we,Pe),ln=J?J(we)===Object.prototype:we instanceof Object||we.constructor===Object,We=we instanceof Object?"":"null prototype",ze=!ln&&y&&Object(we)===we&&y in we?he(we).slice(8,-1):We?"Object":"",at=(ln||"function"!=typeof we.constructor?"":we.constructor.name?we.constructor.name+" ":"")+(ze||We?"["+[].concat(ze||[],We||[]).join(": ")+"] ":"");return 0===ht.length?at+"{}":de?at+"{"+xe(ht,de)+"}":at+"{ "+ht.join(", ")+" }"}return String(we)};var k=Object.prototype.hasOwnProperty||function(Re){return Re in this};function q(Re,we){return k.call(Re,we)}function he(Re){return U.call(Re)}function ge(Re,we){if(Re.indexOf)return Re.indexOf(we);for(var Oe=0,wt=Re.length;Oewe.maxStringLength){var Oe=Re.length-we.maxStringLength,wt="... "+Oe+" more character"+(Oe>1?"s":"");return _e(Re.slice(0,we.maxStringLength),we)+wt}return o(Re.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,Me),"single",we)}function Me(Re){var we=Re.charCodeAt(0),Oe={8:"b",9:"t",10:"n",12:"f",13:"r"}[we];return Oe?"\\"+Oe:"\\x"+(we<16?"0":"")+we.toString(16).toUpperCase()}function le(Re){return"Object("+Re+")"}function ie(Re){return Re+" { ? }"}function Y(Re,we,Oe,wt){return Re+" ("+we+") {"+(wt?xe(Oe,wt):Oe.join(", "))+"}"}function xe(Re,we){if(0===Re.length)return"";var Oe="\n"+we.prev+we.base;return Oe+Re.join(","+Oe)+"\n"+we.prev}function Ce(Re,we){var Oe=c(Re),wt=[];if(Oe){wt.length=Re.length;for(var Be=0;Be{F.endianness=function(){return"LE"},F.hostname=function(){return"undefined"!=typeof location?location.hostname:""},F.loadavg=function(){return[]},F.uptime=function(){return 0},F.freemem=function(){return Number.MAX_VALUE},F.totalmem=function(){return Number.MAX_VALUE},F.cpus=function(){return[]},F.type=function(){return"Browser"},F.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},F.networkInterfaces=F.getNetworkInterfaces=function(){return{}},F.arch=function(){return"javascript"},F.platform=function(){return"browser"},F.tmpdir=F.tmpDir=function(){return"/tmp"},F.EOL="\n",F.homedir=function(){return"/"}},2999:(ne,F,I)=>{"use strict";var R=I(7977);F.certificate=I(2390);var B=R.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});F.RSAPrivateKey=B;var S=R.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});F.RSAPublicKey=S;var T=R.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(f),this.key("subjectPublicKey").bitstr())});F.PublicKey=T;var f=R.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),M=R.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(f),this.key("subjectPrivateKey").octstr())});F.PrivateKey=M;var _=R.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});F.EncryptedPrivateKey=_;var b=R.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});F.DSAPrivateKey=b,F.DSAparam=R.define("DSAparam",function(){this.int()});var C=R.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(x),this.key("publicKey").optional().explicit(1).bitstr())});F.ECPrivateKey=C;var x=R.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});F.signature=R.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},2390:(ne,F,I)=>{"use strict";var R=I(7977),B=R.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),S=R.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),T=R.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),f=R.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(T),this.key("subjectPublicKey").bitstr())}),M=R.define("RelativeDistinguishedName",function(){this.setof(S)}),_=R.define("RDNSequence",function(){this.seqof(M)}),b=R.define("Name",function(){this.choice({rdnSequence:this.use(_)})}),C=R.define("Validity",function(){this.seq().obj(this.key("notBefore").use(B),this.key("notAfter").use(B))}),x=R.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),E=R.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(T),this.key("issuer").use(b),this.key("validity").use(C),this.key("subject").use(b),this.key("subjectPublicKeyInfo").use(f),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(x).optional())}),P=R.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(E),this.key("signatureAlgorithm").use(T),this.key("signatureValue").bitstr())});ne.exports=P},5269:(ne,F,I)=>{var R=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,B=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,S=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,T=I(347),f=I(4330),M=I(3502).Buffer;ne.exports=function(_,b){var E,C=_.toString(),x=C.match(R);if(x){var A="aes"+x[1],O=M.from(x[2],"hex"),N=M.from(x[3].replace(/[\r\n]/g,""),"base64"),U=T(b,O.slice(0,8),parseInt(x[1],10)).key,H=[],V=f.createDecipheriv(A,U,O);H.push(V.update(N)),H.push(V.final()),E=M.concat(H)}else{var P=C.match(S);E=M.from(P[2].replace(/[\r\n]/g,""),"base64")}return{tag:C.match(B)[1],data:E}}},2772:(ne,F,I)=>{var R=I(2999),B=I(2562),S=I(5269),T=I(4330),f=I(9357),M=I(3502).Buffer;function _(C){var x;"object"==typeof C&&!M.isBuffer(C)&&(x=C.passphrase,C=C.key),"string"==typeof C&&(C=M.from(C));var O,N,E=S(C,x),P=E.tag,A=E.data;switch(P){case"CERTIFICATE":N=R.certificate.decode(A,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(N||(N=R.PublicKey.decode(A,"der")),O=N.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return R.RSAPublicKey.decode(N.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return N.subjectPrivateKey=N.subjectPublicKey,{type:"ec",data:N};case"1.2.840.10040.4.1":return N.algorithm.params.pub_key=R.DSAparam.decode(N.subjectPublicKey.data,"der"),{type:"dsa",data:N.algorithm.params};default:throw new Error("unknown key id "+O)}case"ENCRYPTED PRIVATE KEY":A=function b(C,x){var E=C.algorithm.decrypt.kde.kdeparams.salt,P=parseInt(C.algorithm.decrypt.kde.kdeparams.iters.toString(),10),A=B[C.algorithm.decrypt.cipher.algo.join(".")],O=C.algorithm.decrypt.cipher.iv,N=C.subjectPrivateKey,U=parseInt(A.split("-")[1],10)/8,H=f.pbkdf2Sync(x,E,P,U,"sha1"),V=T.createDecipheriv(A,H,O),G=[];return G.push(V.update(N)),G.push(V.final()),M.concat(G)}(A=R.EncryptedPrivateKey.decode(A,"der"),x);case"PRIVATE KEY":switch(O=(N=R.PrivateKey.decode(A,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return R.RSAPrivateKey.decode(N.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:N.algorithm.curve,privateKey:R.ECPrivateKey.decode(N.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return N.algorithm.params.priv_key=R.DSAparam.decode(N.subjectPrivateKey,"der"),{type:"dsa",params:N.algorithm.params};default:throw new Error("unknown key id "+O)}case"RSA PUBLIC KEY":return R.RSAPublicKey.decode(A,"der");case"RSA PRIVATE KEY":return R.RSAPrivateKey.decode(A,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:R.DSAPrivateKey.decode(A,"der")};case"EC PRIVATE KEY":return{curve:(A=R.ECPrivateKey.decode(A,"der")).parameters.value,privateKey:A.privateKey};default:throw new Error("unknown key type "+P)}}ne.exports=_,_.signature=R.signature},9357:(ne,F,I)=>{F.pbkdf2=I(415),F.pbkdf2Sync=I(7472)},415:(ne,F,I)=>{var M,E,R=I(3502).Buffer,B=I(2697),S=I(8867),T=I(7472),f=I(4566),_=global.crypto&&global.crypto.subtle,b={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},C=[];function P(){return E||(E=global.process&&global.process.nextTick?global.process.nextTick:global.queueMicrotask?global.queueMicrotask:global.setImmediate?global.setImmediate:global.setTimeout)}function A(N,U,H,V,G){return _.importKey("raw",N,{name:"PBKDF2"},!1,["deriveBits"]).then(function(K){return _.deriveBits({name:"PBKDF2",salt:U,iterations:H,hash:{name:G}},K,V<<3)}).then(function(K){return R.from(K)})}ne.exports=function(N,U,H,V,G,K){"function"==typeof G&&(K=G,G=void 0);var X=b[(G=G||"sha1").toLowerCase()];if(X&&"function"==typeof global.Promise){if(B(H,V),N=f(N,S,"Password"),U=f(U,S,"Salt"),"function"!=typeof K)throw new Error("No callback provided to pbkdf2");!function O(N,U){N.then(function(H){P()(function(){U(null,H)})},function(H){P()(function(){U(H)})})}(function x(N){if(global.process&&!global.process.browser||!_||!_.importKey||!_.deriveBits)return Promise.resolve(!1);if(void 0!==C[N])return C[N];var U=A(M=M||R.alloc(8),M,10,128,N).then(function(){return!0}).catch(function(){return!1});return C[N]=U,U}(X).then(function(Z){return Z?A(N,U,H,V,X):T(N,U,H,V,G)}),K)}else P()(function(){var Z;try{Z=T(N,U,H,V,G)}catch(z){return K(z)}K(null,Z)})}},8867:ne=>{var F;F=global.process&&global.process.browser?"utf-8":global.process&&global.process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",ne.exports=F},2697:ne=>{var F=Math.pow(2,30)-1;ne.exports=function(I,R){if("number"!=typeof I)throw new TypeError("Iterations not a number");if(I<0)throw new TypeError("Bad iterations");if("number"!=typeof R)throw new TypeError("Key length not a number");if(R<0||R>F||R!=R)throw new TypeError("Bad key length")}},7472:(ne,F,I)=>{var R=I(5640),B=I(5634),S=I(5244),T=I(3502).Buffer,f=I(2697),M=I(8867),_=I(4566),b=T.alloc(128),C={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function x(A,O,N){var U=function E(A){return"rmd160"===A||"ripemd160"===A?function N(U){return(new B).update(U).digest()}:"md5"===A?R:function O(U){return S(A).update(U).digest()}}(A),H="sha512"===A||"sha384"===A?128:64;O.length>H?O=U(O):O.length{var R=I(3502).Buffer;ne.exports=function(B,S,T){if(R.isBuffer(B))return B;if("string"==typeof B)return R.from(B,S);if(ArrayBuffer.isView(B))return R.from(B.buffer);throw new TypeError(T+" must be a string, a Buffer, a typed array or a DataView")}},3701:(ne,F,I)=>{F.publicEncrypt=I(6562),F.privateDecrypt=I(6705),F.privateEncrypt=function(B,S){return F.publicEncrypt(B,S,!0)},F.publicDecrypt=function(B,S){return F.privateDecrypt(B,S,!0)}},6945:(ne,F,I)=>{var R=I(6386),B=I(3502).Buffer;function S(T){var f=B.allocUnsafe(4);return f.writeUInt32BE(T,0),f}ne.exports=function(T,f){for(var b,M=B.alloc(0),_=0;M.length=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function b(y,o,l){var c=_(y,l);return l-1>=o&&(c|=_(y,l-1)<<4),c}function C(y,o,l,c){for(var u=0,d=Math.min(y.length,l),m=o;m=49?w-49+10:w>=17?w-17+10:w}return u}f.isBN=function(o){return o instanceof f||null!==o&&"object"==typeof o&&o.constructor.wordSize===f.wordSize&&Array.isArray(o.words)},f.max=function(o,l){return o.cmp(l)>0?o:l},f.min=function(o,l){return o.cmp(l)<0?o:l},f.prototype._init=function(o,l,c){if("number"==typeof o)return this._initNumber(o,l,c);if("object"==typeof o)return this._initArray(o,l,c);"hex"===l&&(l=16),S(l===(0|l)&&l>=2&&l<=36);var u=0;"-"===(o=o.toString().replace(/\s+/g,""))[0]&&(u++,this.negative=1),u=0;u-=3)this.words[d]|=(m=o[u]|o[u-1]<<8|o[u-2]<<16)<>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);else if("le"===c)for(u=0,d=0;u>>26-w&67108863,(w+=24)>=26&&(w-=26,d++);return this.strip()},f.prototype._parseHex=function(o,l,c){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u=l;u-=2)w=b(o,l,u)<=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;else for(u=(o.length-l)%2==0?l+1:l;u=18?(d-=18,this.words[m+=1]|=w>>>26):d+=8;this.strip()},f.prototype._parseBase=function(o,l,c){this.words=[0],this.length=1;for(var u=0,d=1;d<=67108863;d*=l)u++;u--,d=d/l|0;for(var m=o.length-c,w=m%u,p=Math.min(m,m-w)+c,s=0,g=c;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],E=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function O(y,o,l){l.negative=o.negative^y.negative;var c=y.length+o.length|0;l.length=c,c=c-1|0;var u=0|y.words[0],d=0|o.words[0],m=u*d,p=m/67108864|0;l.words[0]=67108863&m;for(var s=1;s>>26,$=67108863&p,k=Math.min(s,o.length-1),q=Math.max(0,s-y.length+1);q<=k;q++)g+=(m=(u=0|y.words[s-q|0])*(d=0|o.words[q])+$)/67108864|0,$=67108863&m;l.words[s]=0|$,p=0|g}return 0!==p?l.words[s]=0|p:l.length--,l.strip()}f.prototype.toString=function(o,l){var c;if(l=0|l||1,16===(o=o||10)||"hex"===o){c="";for(var u=0,d=0,m=0;m>>24-u&16777215)||m!==this.length-1?x[6-p.length]+p+c:p+c,(u+=2)>=26&&(u-=26,m--)}for(0!==d&&(c=d.toString(16)+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(o===(0|o)&&o>=2&&o<=36){var s=E[o],g=P[o];c="";var $=this.clone();for($.negative=0;!$.isZero();){var k=$.modn(g).toString(o);c=($=$.idivn(g)).isZero()?k+c:x[s-k.length]+k+c}for(this.isZero()&&(c="0"+c);c.length%l!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}S(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var o=this.words[0];return 2===this.length?o+=67108864*this.words[1]:3===this.length&&1===this.words[2]?o+=4503599627370496+67108864*this.words[1]:this.length>2&&S(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-o:o},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(o,l){return S(void 0!==M),this.toArrayLike(M,o,l)},f.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},f.prototype.toArrayLike=function(o,l,c){var u=this.byteLength(),d=c||Math.max(1,u);S(u<=d,"byte array longer than desired length"),S(d>0,"Requested array length <= 0"),this.strip();var p,s,m="le"===l,w=new o(d),g=this.clone();if(m){for(s=0;!g.isZero();s++)p=g.andln(255),g.iushrn(8),w[s]=p;for(;s=4096&&(c+=13,l>>>=13),l>=64&&(c+=7,l>>>=7),l>=8&&(c+=4,l>>>=4),l>=2&&(c+=2,l>>>=2),c+l},f.prototype._zeroBits=function(o){if(0===o)return 26;var l=o,c=0;return 0==(8191&l)&&(c+=13,l>>>=13),0==(127&l)&&(c+=7,l>>>=7),0==(15&l)&&(c+=4,l>>>=4),0==(3&l)&&(c+=2,l>>>=2),0==(1&l)&&c++,c},f.prototype.bitLength=function(){var l=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+l},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},f.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},f.prototype.iuand=function(o){var l;l=this.length>o.length?o:this;for(var c=0;co.length?this.clone().iand(o):o.clone().iand(this)},f.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},f.prototype.iuxor=function(o){var l,c;this.length>o.length?(l=this,c=o):(l=o,c=this);for(var u=0;uo.length?this.clone().ixor(o):o.clone().ixor(this)},f.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},f.prototype.inotn=function(o){S("number"==typeof o&&o>=0);var l=0|Math.ceil(o/26),c=o%26;this._expand(l),c>0&&l--;for(var u=0;u0&&(this.words[u]=~this.words[u]&67108863>>26-c),this.strip()},f.prototype.notn=function(o){return this.clone().inotn(o)},f.prototype.setn=function(o,l){S("number"==typeof o&&o>=0);var c=o/26|0,u=o%26;return this._expand(c+1),this.words[c]=l?this.words[c]|1<o.length?(c=this,u=o):(c=o,u=this);for(var d=0,m=0;m>>26;for(;0!==d&&m>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;mo.length?this.clone().iadd(o):o.clone().iadd(this)},f.prototype.isub=function(o){if(0!==o.negative){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var u,d,c=this.cmp(o);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;c>0?(u=this,d=o):(u=o,d=this);for(var m=0,w=0;w>26,this.words[w]=67108863&l;for(;0!==m&&w>26,this.words[w]=67108863&l;if(0===m&&w>>13,he=0|u[1],be=8191&he,ge=he>>>13,fe=0|u[2],se=8191&fe,ce=fe>>>13,ee=0|u[3],pe=8191&ee,ue=ee>>>13,_e=0|u[4],Me=8191&_e,le=_e>>>13,ie=0|u[5],Y=8191&ie,ae=ie>>>13,Le=0|u[6],xe=8191&Le,Ce=Le>>>13,Re=0|u[7],we=8191&Re,Oe=Re>>>13,wt=0|u[8],Be=8191&wt,oe=wt>>>13,te=0|u[9],W=8191&te,de=te>>>13,Pe=0|d[0],Ee=8191&Pe,Ae=Pe>>>13,St=0|d[1],Xe=8191&St,Je=St>>>13,kt=0|d[2],Ye=8191&kt,tt=kt>>>13,Dn=0|d[3],nt=8191&Dn,ht=Dn>>>13,ln=0|d[4],We=8191&ln,ze=ln>>>13,un=0|d[5],at=8191&un,Ne=un>>>13,Xt=0|d[6],$e=8191&Xt,et=Xt>>>13,pn=0|d[7],lt=8191&pn,ut=pn>>>13,cn=0|d[8],it=8191&cn,ct=cn>>>13,gn=0|d[9],mt=8191&gn,pt=gn>>>13;c.negative=o.negative^l.negative,c.length=19;var Xn=(w+(p=Math.imul(k,Ee))|0)+((8191&(s=(s=Math.imul(k,Ae))+Math.imul(q,Ee)|0))<<13)|0;w=((g=Math.imul(q,Ae))+(s>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(be,Ee),s=(s=Math.imul(be,Ae))+Math.imul(ge,Ee)|0,g=Math.imul(ge,Ae);var Qt=(w+(p=p+Math.imul(k,Xe)|0)|0)+((8191&(s=(s=s+Math.imul(k,Je)|0)+Math.imul(q,Xe)|0))<<13)|0;w=((g=g+Math.imul(q,Je)|0)+(s>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,p=Math.imul(se,Ee),s=(s=Math.imul(se,Ae))+Math.imul(ce,Ee)|0,g=Math.imul(ce,Ae),p=p+Math.imul(be,Xe)|0,s=(s=s+Math.imul(be,Je)|0)+Math.imul(ge,Xe)|0,g=g+Math.imul(ge,Je)|0;var Jt=(w+(p=p+Math.imul(k,Ye)|0)|0)+((8191&(s=(s=s+Math.imul(k,tt)|0)+Math.imul(q,Ye)|0))<<13)|0;w=((g=g+Math.imul(q,tt)|0)+(s>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,p=Math.imul(pe,Ee),s=(s=Math.imul(pe,Ae))+Math.imul(ue,Ee)|0,g=Math.imul(ue,Ae),p=p+Math.imul(se,Xe)|0,s=(s=s+Math.imul(se,Je)|0)+Math.imul(ce,Xe)|0,g=g+Math.imul(ce,Je)|0,p=p+Math.imul(be,Ye)|0,s=(s=s+Math.imul(be,tt)|0)+Math.imul(ge,Ye)|0,g=g+Math.imul(ge,tt)|0;var jn=(w+(p=p+Math.imul(k,nt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ht)|0)+Math.imul(q,nt)|0))<<13)|0;w=((g=g+Math.imul(q,ht)|0)+(s>>>13)|0)+(jn>>>26)|0,jn&=67108863,p=Math.imul(Me,Ee),s=(s=Math.imul(Me,Ae))+Math.imul(le,Ee)|0,g=Math.imul(le,Ae),p=p+Math.imul(pe,Xe)|0,s=(s=s+Math.imul(pe,Je)|0)+Math.imul(ue,Xe)|0,g=g+Math.imul(ue,Je)|0,p=p+Math.imul(se,Ye)|0,s=(s=s+Math.imul(se,tt)|0)+Math.imul(ce,Ye)|0,g=g+Math.imul(ce,tt)|0,p=p+Math.imul(be,nt)|0,s=(s=s+Math.imul(be,ht)|0)+Math.imul(ge,nt)|0,g=g+Math.imul(ge,ht)|0;var Bn=(w+(p=p+Math.imul(k,We)|0)|0)+((8191&(s=(s=s+Math.imul(k,ze)|0)+Math.imul(q,We)|0))<<13)|0;w=((g=g+Math.imul(q,ze)|0)+(s>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,p=Math.imul(Y,Ee),s=(s=Math.imul(Y,Ae))+Math.imul(ae,Ee)|0,g=Math.imul(ae,Ae),p=p+Math.imul(Me,Xe)|0,s=(s=s+Math.imul(Me,Je)|0)+Math.imul(le,Xe)|0,g=g+Math.imul(le,Je)|0,p=p+Math.imul(pe,Ye)|0,s=(s=s+Math.imul(pe,tt)|0)+Math.imul(ue,Ye)|0,g=g+Math.imul(ue,tt)|0,p=p+Math.imul(se,nt)|0,s=(s=s+Math.imul(se,ht)|0)+Math.imul(ce,nt)|0,g=g+Math.imul(ce,ht)|0,p=p+Math.imul(be,We)|0,s=(s=s+Math.imul(be,ze)|0)+Math.imul(ge,We)|0,g=g+Math.imul(ge,ze)|0;var $n=(w+(p=p+Math.imul(k,at)|0)|0)+((8191&(s=(s=s+Math.imul(k,Ne)|0)+Math.imul(q,at)|0))<<13)|0;w=((g=g+Math.imul(q,Ne)|0)+(s>>>13)|0)+($n>>>26)|0,$n&=67108863,p=Math.imul(xe,Ee),s=(s=Math.imul(xe,Ae))+Math.imul(Ce,Ee)|0,g=Math.imul(Ce,Ae),p=p+Math.imul(Y,Xe)|0,s=(s=s+Math.imul(Y,Je)|0)+Math.imul(ae,Xe)|0,g=g+Math.imul(ae,Je)|0,p=p+Math.imul(Me,Ye)|0,s=(s=s+Math.imul(Me,tt)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,tt)|0,p=p+Math.imul(pe,nt)|0,s=(s=s+Math.imul(pe,ht)|0)+Math.imul(ue,nt)|0,g=g+Math.imul(ue,ht)|0,p=p+Math.imul(se,We)|0,s=(s=s+Math.imul(se,ze)|0)+Math.imul(ce,We)|0,g=g+Math.imul(ce,ze)|0,p=p+Math.imul(be,at)|0,s=(s=s+Math.imul(be,Ne)|0)+Math.imul(ge,at)|0,g=g+Math.imul(ge,Ne)|0;var Ln=(w+(p=p+Math.imul(k,$e)|0)|0)+((8191&(s=(s=s+Math.imul(k,et)|0)+Math.imul(q,$e)|0))<<13)|0;w=((g=g+Math.imul(q,et)|0)+(s>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,p=Math.imul(we,Ee),s=(s=Math.imul(we,Ae))+Math.imul(Oe,Ee)|0,g=Math.imul(Oe,Ae),p=p+Math.imul(xe,Xe)|0,s=(s=s+Math.imul(xe,Je)|0)+Math.imul(Ce,Xe)|0,g=g+Math.imul(Ce,Je)|0,p=p+Math.imul(Y,Ye)|0,s=(s=s+Math.imul(Y,tt)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,tt)|0,p=p+Math.imul(Me,nt)|0,s=(s=s+Math.imul(Me,ht)|0)+Math.imul(le,nt)|0,g=g+Math.imul(le,ht)|0,p=p+Math.imul(pe,We)|0,s=(s=s+Math.imul(pe,ze)|0)+Math.imul(ue,We)|0,g=g+Math.imul(ue,ze)|0,p=p+Math.imul(se,at)|0,s=(s=s+Math.imul(se,Ne)|0)+Math.imul(ce,at)|0,g=g+Math.imul(ce,Ne)|0,p=p+Math.imul(be,$e)|0,s=(s=s+Math.imul(be,et)|0)+Math.imul(ge,$e)|0,g=g+Math.imul(ge,et)|0;var zn=(w+(p=p+Math.imul(k,lt)|0)|0)+((8191&(s=(s=s+Math.imul(k,ut)|0)+Math.imul(q,lt)|0))<<13)|0;w=((g=g+Math.imul(q,ut)|0)+(s>>>13)|0)+(zn>>>26)|0,zn&=67108863,p=Math.imul(Be,Ee),s=(s=Math.imul(Be,Ae))+Math.imul(oe,Ee)|0,g=Math.imul(oe,Ae),p=p+Math.imul(we,Xe)|0,s=(s=s+Math.imul(we,Je)|0)+Math.imul(Oe,Xe)|0,g=g+Math.imul(Oe,Je)|0,p=p+Math.imul(xe,Ye)|0,s=(s=s+Math.imul(xe,tt)|0)+Math.imul(Ce,Ye)|0,g=g+Math.imul(Ce,tt)|0,p=p+Math.imul(Y,nt)|0,s=(s=s+Math.imul(Y,ht)|0)+Math.imul(ae,nt)|0,g=g+Math.imul(ae,ht)|0,p=p+Math.imul(Me,We)|0,s=(s=s+Math.imul(Me,ze)|0)+Math.imul(le,We)|0,g=g+Math.imul(le,ze)|0,p=p+Math.imul(pe,at)|0,s=(s=s+Math.imul(pe,Ne)|0)+Math.imul(ue,at)|0,g=g+Math.imul(ue,Ne)|0,p=p+Math.imul(se,$e)|0,s=(s=s+Math.imul(se,et)|0)+Math.imul(ce,$e)|0,g=g+Math.imul(ce,et)|0,p=p+Math.imul(be,lt)|0,s=(s=s+Math.imul(be,ut)|0)+Math.imul(ge,lt)|0,g=g+Math.imul(ge,ut)|0;var hn=(w+(p=p+Math.imul(k,it)|0)|0)+((8191&(s=(s=s+Math.imul(k,ct)|0)+Math.imul(q,it)|0))<<13)|0;w=((g=g+Math.imul(q,ct)|0)+(s>>>13)|0)+(hn>>>26)|0,hn&=67108863,p=Math.imul(W,Ee),s=(s=Math.imul(W,Ae))+Math.imul(de,Ee)|0,g=Math.imul(de,Ae),p=p+Math.imul(Be,Xe)|0,s=(s=s+Math.imul(Be,Je)|0)+Math.imul(oe,Xe)|0,g=g+Math.imul(oe,Je)|0,p=p+Math.imul(we,Ye)|0,s=(s=s+Math.imul(we,tt)|0)+Math.imul(Oe,Ye)|0,g=g+Math.imul(Oe,tt)|0,p=p+Math.imul(xe,nt)|0,s=(s=s+Math.imul(xe,ht)|0)+Math.imul(Ce,nt)|0,g=g+Math.imul(Ce,ht)|0,p=p+Math.imul(Y,We)|0,s=(s=s+Math.imul(Y,ze)|0)+Math.imul(ae,We)|0,g=g+Math.imul(ae,ze)|0,p=p+Math.imul(Me,at)|0,s=(s=s+Math.imul(Me,Ne)|0)+Math.imul(le,at)|0,g=g+Math.imul(le,Ne)|0,p=p+Math.imul(pe,$e)|0,s=(s=s+Math.imul(pe,et)|0)+Math.imul(ue,$e)|0,g=g+Math.imul(ue,et)|0,p=p+Math.imul(se,lt)|0,s=(s=s+Math.imul(se,ut)|0)+Math.imul(ce,lt)|0,g=g+Math.imul(ce,ut)|0,p=p+Math.imul(be,it)|0,s=(s=s+Math.imul(be,ct)|0)+Math.imul(ge,it)|0,g=g+Math.imul(ge,ct)|0;var Lt=(w+(p=p+Math.imul(k,mt)|0)|0)+((8191&(s=(s=s+Math.imul(k,pt)|0)+Math.imul(q,mt)|0))<<13)|0;w=((g=g+Math.imul(q,pt)|0)+(s>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,p=Math.imul(W,Xe),s=(s=Math.imul(W,Je))+Math.imul(de,Xe)|0,g=Math.imul(de,Je),p=p+Math.imul(Be,Ye)|0,s=(s=s+Math.imul(Be,tt)|0)+Math.imul(oe,Ye)|0,g=g+Math.imul(oe,tt)|0,p=p+Math.imul(we,nt)|0,s=(s=s+Math.imul(we,ht)|0)+Math.imul(Oe,nt)|0,g=g+Math.imul(Oe,ht)|0,p=p+Math.imul(xe,We)|0,s=(s=s+Math.imul(xe,ze)|0)+Math.imul(Ce,We)|0,g=g+Math.imul(Ce,ze)|0,p=p+Math.imul(Y,at)|0,s=(s=s+Math.imul(Y,Ne)|0)+Math.imul(ae,at)|0,g=g+Math.imul(ae,Ne)|0,p=p+Math.imul(Me,$e)|0,s=(s=s+Math.imul(Me,et)|0)+Math.imul(le,$e)|0,g=g+Math.imul(le,et)|0,p=p+Math.imul(pe,lt)|0,s=(s=s+Math.imul(pe,ut)|0)+Math.imul(ue,lt)|0,g=g+Math.imul(ue,ut)|0,p=p+Math.imul(se,it)|0,s=(s=s+Math.imul(se,ct)|0)+Math.imul(ce,it)|0,g=g+Math.imul(ce,ct)|0;var Gn=(w+(p=p+Math.imul(be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(be,pt)|0)+Math.imul(ge,mt)|0))<<13)|0;w=((g=g+Math.imul(ge,pt)|0)+(s>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,p=Math.imul(W,Ye),s=(s=Math.imul(W,tt))+Math.imul(de,Ye)|0,g=Math.imul(de,tt),p=p+Math.imul(Be,nt)|0,s=(s=s+Math.imul(Be,ht)|0)+Math.imul(oe,nt)|0,g=g+Math.imul(oe,ht)|0,p=p+Math.imul(we,We)|0,s=(s=s+Math.imul(we,ze)|0)+Math.imul(Oe,We)|0,g=g+Math.imul(Oe,ze)|0,p=p+Math.imul(xe,at)|0,s=(s=s+Math.imul(xe,Ne)|0)+Math.imul(Ce,at)|0,g=g+Math.imul(Ce,Ne)|0,p=p+Math.imul(Y,$e)|0,s=(s=s+Math.imul(Y,et)|0)+Math.imul(ae,$e)|0,g=g+Math.imul(ae,et)|0,p=p+Math.imul(Me,lt)|0,s=(s=s+Math.imul(Me,ut)|0)+Math.imul(le,lt)|0,g=g+Math.imul(le,ut)|0,p=p+Math.imul(pe,it)|0,s=(s=s+Math.imul(pe,ct)|0)+Math.imul(ue,it)|0,g=g+Math.imul(ue,ct)|0;var Kn=(w+(p=p+Math.imul(se,mt)|0)|0)+((8191&(s=(s=s+Math.imul(se,pt)|0)+Math.imul(ce,mt)|0))<<13)|0;w=((g=g+Math.imul(ce,pt)|0)+(s>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,p=Math.imul(W,nt),s=(s=Math.imul(W,ht))+Math.imul(de,nt)|0,g=Math.imul(de,ht),p=p+Math.imul(Be,We)|0,s=(s=s+Math.imul(Be,ze)|0)+Math.imul(oe,We)|0,g=g+Math.imul(oe,ze)|0,p=p+Math.imul(we,at)|0,s=(s=s+Math.imul(we,Ne)|0)+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,Ne)|0,p=p+Math.imul(xe,$e)|0,s=(s=s+Math.imul(xe,et)|0)+Math.imul(Ce,$e)|0,g=g+Math.imul(Ce,et)|0,p=p+Math.imul(Y,lt)|0,s=(s=s+Math.imul(Y,ut)|0)+Math.imul(ae,lt)|0,g=g+Math.imul(ae,ut)|0,p=p+Math.imul(Me,it)|0,s=(s=s+Math.imul(Me,ct)|0)+Math.imul(le,it)|0,g=g+Math.imul(le,ct)|0;var qn=(w+(p=p+Math.imul(pe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(pe,pt)|0)+Math.imul(ue,mt)|0))<<13)|0;w=((g=g+Math.imul(ue,pt)|0)+(s>>>13)|0)+(qn>>>26)|0,qn&=67108863,p=Math.imul(W,We),s=(s=Math.imul(W,ze))+Math.imul(de,We)|0,g=Math.imul(de,ze),p=p+Math.imul(Be,at)|0,s=(s=s+Math.imul(Be,Ne)|0)+Math.imul(oe,at)|0,g=g+Math.imul(oe,Ne)|0,p=p+Math.imul(we,$e)|0,s=(s=s+Math.imul(we,et)|0)+Math.imul(Oe,$e)|0,g=g+Math.imul(Oe,et)|0,p=p+Math.imul(xe,lt)|0,s=(s=s+Math.imul(xe,ut)|0)+Math.imul(Ce,lt)|0,g=g+Math.imul(Ce,ut)|0,p=p+Math.imul(Y,it)|0,s=(s=s+Math.imul(Y,ct)|0)+Math.imul(ae,it)|0,g=g+Math.imul(ae,ct)|0;var xt=(w+(p=p+Math.imul(Me,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Me,pt)|0)+Math.imul(le,mt)|0))<<13)|0;w=((g=g+Math.imul(le,pt)|0)+(s>>>13)|0)+(xt>>>26)|0,xt&=67108863,p=Math.imul(W,at),s=(s=Math.imul(W,Ne))+Math.imul(de,at)|0,g=Math.imul(de,Ne),p=p+Math.imul(Be,$e)|0,s=(s=s+Math.imul(Be,et)|0)+Math.imul(oe,$e)|0,g=g+Math.imul(oe,et)|0,p=p+Math.imul(we,lt)|0,s=(s=s+Math.imul(we,ut)|0)+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,ut)|0,p=p+Math.imul(xe,it)|0,s=(s=s+Math.imul(xe,ct)|0)+Math.imul(Ce,it)|0,g=g+Math.imul(Ce,ct)|0;var Wn=(w+(p=p+Math.imul(Y,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Y,pt)|0)+Math.imul(ae,mt)|0))<<13)|0;w=((g=g+Math.imul(ae,pt)|0)+(s>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,p=Math.imul(W,$e),s=(s=Math.imul(W,et))+Math.imul(de,$e)|0,g=Math.imul(de,et),p=p+Math.imul(Be,lt)|0,s=(s=s+Math.imul(Be,ut)|0)+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ut)|0,p=p+Math.imul(we,it)|0,s=(s=s+Math.imul(we,ct)|0)+Math.imul(Oe,it)|0,g=g+Math.imul(Oe,ct)|0;var jt=(w+(p=p+Math.imul(xe,mt)|0)|0)+((8191&(s=(s=s+Math.imul(xe,pt)|0)+Math.imul(Ce,mt)|0))<<13)|0;w=((g=g+Math.imul(Ce,pt)|0)+(s>>>13)|0)+(jt>>>26)|0,jt&=67108863,p=Math.imul(W,lt),s=(s=Math.imul(W,ut))+Math.imul(de,lt)|0,g=Math.imul(de,ut),p=p+Math.imul(Be,it)|0,s=(s=s+Math.imul(Be,ct)|0)+Math.imul(oe,it)|0,g=g+Math.imul(oe,ct)|0;var Rn=(w+(p=p+Math.imul(we,mt)|0)|0)+((8191&(s=(s=s+Math.imul(we,pt)|0)+Math.imul(Oe,mt)|0))<<13)|0;w=((g=g+Math.imul(Oe,pt)|0)+(s>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,p=Math.imul(W,it),s=(s=Math.imul(W,ct))+Math.imul(de,it)|0,g=Math.imul(de,ct);var Pn=(w+(p=p+Math.imul(Be,mt)|0)|0)+((8191&(s=(s=s+Math.imul(Be,pt)|0)+Math.imul(oe,mt)|0))<<13)|0;w=((g=g+Math.imul(oe,pt)|0)+(s>>>13)|0)+(Pn>>>26)|0,Pn&=67108863;var Fn=(w+(p=Math.imul(W,mt))|0)+((8191&(s=(s=Math.imul(W,pt))+Math.imul(de,mt)|0))<<13)|0;return w=((g=Math.imul(de,pt))+(s>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,m[0]=Xn,m[1]=Qt,m[2]=Jt,m[3]=jn,m[4]=Bn,m[5]=$n,m[6]=Ln,m[7]=zn,m[8]=hn,m[9]=Lt,m[10]=Gn,m[11]=Kn,m[12]=qn,m[13]=xt,m[14]=Wn,m[15]=jt,m[16]=Rn,m[17]=Pn,m[18]=Fn,0!==w&&(m[19]=w,c.length++),c};function H(y,o,l){return(new V).mulp(y,o,l)}function V(y,o){this.x=y,this.y=o}Math.imul||(N=O),f.prototype.mulTo=function(o,l){var c,u=this.length+o.length;return c=10===this.length&&10===o.length?N(this,o,l):u<63?O(this,o,l):u<1024?function U(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var c=0,u=0,d=0;d>>26)|0)>>>26,m&=67108863}l.words[d]=w,c=m,m=u}return 0!==c?l.words[d]=c:l.length--,l.strip()}(this,o,l):H(this,o,l),c},V.prototype.makeRBT=function(o){for(var l=new Array(o),c=f.prototype._countBits(o)-1,u=0;u>=1;return u},V.prototype.permute=function(o,l,c,u,d,m){for(var w=0;w>>=1)d++;return 1<>>=13),d>>>=13;for(m=2*l;m>=26,l+=u/67108864|0,l+=d>>>26,this.words[c]=67108863&d}return 0!==l&&(this.words[c]=l,this.length++),this},f.prototype.muln=function(o){return this.clone().imuln(o)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(o){var l=function A(y){for(var o=new Array(y.bitLength()),l=0;l>>u}return o}(o);if(0===l.length)return new f(1);for(var c=this,u=0;u=0);var d,l=o%26,c=(o-l)/26,u=67108863>>>26-l<<26-l;if(0!==l){var m=0;for(d=0;d>>26-l}m&&(this.words[d]=m,this.length++)}if(0!==c){for(d=this.length-1;d>=0;d--)this.words[d+c]=this.words[d];for(d=0;d=0),u=l?(l-l%26)/26:0;var d=o%26,m=Math.min((o-d)/26,this.length),w=67108863^67108863>>>d<m)for(this.length-=m,s=0;s=0&&(0!==g||s>=u);s--){var $=0|this.words[s];this.words[s]=g<<26-d|$>>>d,g=$&w}return p&&0!==g&&(p.words[p.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(o,l,c){return S(0===this.negative),this.iushrn(o,l,c)},f.prototype.shln=function(o){return this.clone().ishln(o)},f.prototype.ushln=function(o){return this.clone().iushln(o)},f.prototype.shrn=function(o){return this.clone().ishrn(o)},f.prototype.ushrn=function(o){return this.clone().iushrn(o)},f.prototype.testn=function(o){S("number"==typeof o&&o>=0);var l=o%26,c=(o-l)/26;return!(this.length<=c||!(this.words[c]&1<=0);var l=o%26,c=(o-l)/26;return S(0===this.negative,"imaskn works only with positive numbers"),this.length<=c?this:(0!==l&&c++,this.length=Math.min(c,this.length),0!==l&&(this.words[this.length-1]&=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},f.prototype.isubn=function(o){if(S("number"==typeof o),S(o<67108864),o<0)return this.iaddn(-o);if(0!==this.negative)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[d+c]=67108863&m}for(;d>26,this.words[d+c]=67108863&m;if(0===w)return this.strip();for(S(-1===w),w=0,d=0;d>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},f.prototype._wordDiv=function(o,l){var c,u=this.clone(),d=o,m=0|d.words[d.length-1];0!=(c=26-this._countBits(m))&&(d=d.ushln(c),u.iushln(c),m=0|d.words[d.length-1]);var s,p=u.length-d.length;if("mod"!==l){(s=new f(null)).length=p+1,s.words=new Array(s.length);for(var g=0;g=0;k--){var q=67108864*(0|u.words[d.length+k])+(0|u.words[d.length+k-1]);for(q=Math.min(q/m|0,67108863),u._ishlnsubmul(d,q,k);0!==u.negative;)q--,u.negative=0,u._ishlnsubmul(d,1,k),u.isZero()||(u.negative^=1);s&&(s.words[k]=q)}return s&&s.strip(),u.strip(),"div"!==l&&0!==c&&u.iushrn(c),{div:s||null,mod:u}},f.prototype.divmod=function(o,l,c){return S(!o.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===o.negative?(m=this.neg().divmod(o,l),"mod"!==l&&(u=m.div.neg()),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.iadd(o)),{div:u,mod:d}):0===this.negative&&0!==o.negative?(m=this.divmod(o.neg(),l),"mod"!==l&&(u=m.div.neg()),{div:u,mod:m.mod}):0!=(this.negative&o.negative)?(m=this.neg().divmod(o.neg(),l),"div"!==l&&(d=m.mod.neg(),c&&0!==d.negative&&d.isub(o)),{div:m.div,mod:d}):o.length>this.length||this.cmp(o)<0?{div:new f(0),mod:this}:1===o.length?"div"===l?{div:this.divn(o.words[0]),mod:null}:"mod"===l?{div:null,mod:new f(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new f(this.modn(o.words[0]))}:this._wordDiv(o,l);var u,d,m},f.prototype.div=function(o){return this.divmod(o,"div",!1).div},f.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},f.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},f.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var c=0!==l.div.negative?l.mod.isub(o):l.mod,u=o.ushrn(1),d=o.andln(1),m=c.cmp(u);return m<0||1===d&&0===m?l.div:0!==l.div.negative?l.div.isubn(1):l.div.iaddn(1)},f.prototype.modn=function(o){S(o<=67108863);for(var l=(1<<26)%o,c=0,u=this.length-1;u>=0;u--)c=(l*c+(0|this.words[u]))%o;return c},f.prototype.idivn=function(o){S(o<=67108863);for(var l=0,c=this.length-1;c>=0;c--){var u=(0|this.words[c])+67108864*l;this.words[c]=u/o|0,l=u%o}return this.strip()},f.prototype.divn=function(o){return this.clone().idivn(o)},f.prototype.egcd=function(o){S(0===o.negative),S(!o.isZero());var l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=new f(0),w=new f(1),p=0;l.isEven()&&c.isEven();)l.iushrn(1),c.iushrn(1),++p;for(var s=c.clone(),g=l.clone();!l.isZero();){for(var $=0,k=1;0==(l.words[0]&k)&&$<26;++$,k<<=1);if($>0)for(l.iushrn($);$-- >0;)(u.isOdd()||d.isOdd())&&(u.iadd(s),d.isub(g)),u.iushrn(1),d.iushrn(1);for(var q=0,he=1;0==(c.words[0]&he)&&q<26;++q,he<<=1);if(q>0)for(c.iushrn(q);q-- >0;)(m.isOdd()||w.isOdd())&&(m.iadd(s),w.isub(g)),m.iushrn(1),w.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(m),d.isub(w)):(c.isub(l),m.isub(u),w.isub(d))}return{a:m,b:w,gcd:c.iushln(p)}},f.prototype._invmp=function(o){S(0===o.negative),S(!o.isZero());var $,l=this,c=o.clone();l=0!==l.negative?l.umod(o):l.clone();for(var u=new f(1),d=new f(0),m=c.clone();l.cmpn(1)>0&&c.cmpn(1)>0;){for(var w=0,p=1;0==(l.words[0]&p)&&w<26;++w,p<<=1);if(w>0)for(l.iushrn(w);w-- >0;)u.isOdd()&&u.iadd(m),u.iushrn(1);for(var s=0,g=1;0==(c.words[0]&g)&&s<26;++s,g<<=1);if(s>0)for(c.iushrn(s);s-- >0;)d.isOdd()&&d.iadd(m),d.iushrn(1);l.cmp(c)>=0?(l.isub(c),u.isub(d)):(c.isub(l),d.isub(u))}return($=0===l.cmpn(1)?u:d).cmpn(0)<0&&$.iadd(o),$},f.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),c=o.clone();l.negative=0,c.negative=0;for(var u=0;l.isEven()&&c.isEven();u++)l.iushrn(1),c.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=l.cmp(c);if(d<0){var m=l;l=c,c=m}else if(0===d||0===c.cmpn(1))break;l.isub(c)}return c.iushln(u)},f.prototype.invm=function(o){return this.egcd(o).a.umod(o)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(o){return this.words[0]&o},f.prototype.bincn=function(o){S("number"==typeof o);var l=o%26,c=(o-l)/26,u=1<>>26,this.words[m]=w&=67108863}return 0!==d&&(this.words[m]=d,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(o){var c,l=o<0;if(0!==this.negative&&!l)return-1;if(0===this.negative&&l)return 1;if(this.strip(),this.length>1)c=1;else{l&&(o=-o),S(o<=67108863,"Number is too big");var u=0|this.words[0];c=u===o?0:uo.length)return 1;if(this.length=0;c--){var u=0|this.words[c],d=0|o.words[c];if(u!==d){ud&&(l=1);break}}return l},f.prototype.gtn=function(o){return 1===this.cmpn(o)},f.prototype.gt=function(o){return 1===this.cmp(o)},f.prototype.gten=function(o){return this.cmpn(o)>=0},f.prototype.gte=function(o){return this.cmp(o)>=0},f.prototype.ltn=function(o){return-1===this.cmpn(o)},f.prototype.lt=function(o){return-1===this.cmp(o)},f.prototype.lten=function(o){return this.cmpn(o)<=0},f.prototype.lte=function(o){return this.cmp(o)<=0},f.prototype.eqn=function(o){return 0===this.cmpn(o)},f.prototype.eq=function(o){return 0===this.cmp(o)},f.red=function(o){return new re(o)},f.prototype.toRed=function(o){return S(!this.red,"Already a number in reduction context"),S(0===this.negative,"red works only with positives"),o.convertTo(this)._forceRed(o)},f.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(o){return this.red=o,this},f.prototype.forceRed=function(o){return S(!this.red,"Already a number in reduction context"),this._forceRed(o)},f.prototype.redAdd=function(o){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},f.prototype.redIAdd=function(o){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},f.prototype.redSub=function(o){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},f.prototype.redISub=function(o){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},f.prototype.redShl=function(o){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},f.prototype.redMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},f.prototype.redIMul=function(o){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},f.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(o){return S(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var G={k256:null,p224:null,p192:null,p25519:null};function K(y,o){this.name=y,this.p=new f(o,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function X(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Z(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function J(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function re(y){if("string"==typeof y){var o=f._prime(y);this.m=o.p,this.prime=o}else S(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}function ve(y){re.call(this,y),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K.prototype._tmp=function(){var o=new f(null);return o.words=new Array(Math.ceil(this.n/13)),o},K.prototype.ireduce=function(o){var c,l=o;do{this.split(l,this.tmp),c=(l=(l=this.imulK(l)).iadd(this.tmp)).bitLength()}while(c>this.n);var u=c0?l.isub(this.p):void 0!==l.strip?l.strip():l._strip(),l},K.prototype.split=function(o,l){o.iushrn(this.n,0,l)},K.prototype.imulK=function(o){return o.imul(this.k)},T(X,K),X.prototype.split=function(o,l){for(var c=4194303,u=Math.min(o.length,9),d=0;d>>22,m=w}o.words[d-10]=m>>>=22,o.length-=0===m&&o.length>10?10:9},X.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,c=0;c>>=26,o.words[c]=d,l=u}return 0!==l&&(o.words[o.length++]=l),o},f._prime=function(o){if(G[o])return G[o];var l;if("k256"===o)l=new X;else if("p224"===o)l=new Z;else if("p192"===o)l=new z;else{if("p25519"!==o)throw new Error("Unknown prime "+o);l=new J}return G[o]=l,l},re.prototype._verify1=function(o){S(0===o.negative,"red works only with positives"),S(o.red,"red works only with red numbers")},re.prototype._verify2=function(o,l){S(0==(o.negative|l.negative),"red works only with positives"),S(o.red&&o.red===l.red,"red works only with red numbers")},re.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},re.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},re.prototype.add=function(o,l){this._verify2(o,l);var c=o.add(l);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},re.prototype.iadd=function(o,l){this._verify2(o,l);var c=o.iadd(l);return c.cmp(this.m)>=0&&c.isub(this.m),c},re.prototype.sub=function(o,l){this._verify2(o,l);var c=o.sub(l);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},re.prototype.isub=function(o,l){this._verify2(o,l);var c=o.isub(l);return c.cmpn(0)<0&&c.iadd(this.m),c},re.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},re.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},re.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},re.prototype.isqr=function(o){return this.imul(o,o.clone())},re.prototype.sqr=function(o){return this.mul(o,o)},re.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(S(l%2==1),3===l){var c=this.m.add(new f(1)).iushrn(2);return this.pow(o,c)}for(var u=this.m.subn(1),d=0;!u.isZero()&&0===u.andln(1);)d++,u.iushrn(1);S(!u.isZero());var m=new f(1).toRed(this),w=m.redNeg(),p=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new f(2*s*s).toRed(this);0!==this.pow(s,p).cmp(w);)s.redIAdd(w);for(var g=this.pow(s,u),$=this.pow(o,u.addn(1).iushrn(1)),k=this.pow(o,u),q=d;0!==k.cmp(m);){for(var he=k,be=0;0!==he.cmp(m);be++)he=he.redSqr();S(be=0;d--){for(var g=l.words[d],$=s-1;$>=0;$--){var k=g>>$&1;m!==u[0]&&(m=this.sqr(m)),0!==k||0!==w?(w<<=1,w|=k,(4==++p||0===d&&0===$)&&(m=this.mul(m,u[w]),p=0,w=0)):p=0}s=26}return m},re.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},re.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},f.mont=function(o){return new ve(o)},T(ve,re),ve.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ve.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},ve.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var c=o.imul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new f(0)._forceRed(this);var c=o.mul(l),u=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(u).iushrn(this.shift),m=d;return d.cmp(this.m)>=0?m=d.isub(this.m):d.cmpn(0)<0&&(m=d.iadd(this.m)),m._forceRed(this)},ve.prototype.invm=function(o){return this.imod(o._invmp(this.m).mul(this.r2))._forceRed(this)}}(ne=I.nmd(ne),this)},6705:(ne,F,I)=>{var R=I(2772),B=I(6945),S=I(9401),T=I(2057),f=I(8466),M=I(6386),_=I(8651),b=I(3502).Buffer;ne.exports=function(A,O,N){var U;U=A.padding?A.padding:N?1:4;var G,H=R(A),V=H.modulus.byteLength();if(O.length>V||new T(O).cmp(H.modulus)>=0)throw new Error("decryption error");G=N?_(new T(O),H):f(O,H);var K=b.alloc(V-G.length);if(G=b.concat([K,G],V),4===U)return function C(P,A){var O=P.modulus.byteLength(),N=M("sha1").update(b.alloc(0)).digest(),U=N.length;if(0!==A[0])throw new Error("decryption error");var H=A.slice(1,U+1),V=A.slice(U+1),G=S(H,B(V,U)),K=S(V,B(G,O-U-1));if(function E(P,A){P=b.from(P),A=b.from(A);var O=0,N=P.length;P.length!==A.length&&(O++,N=Math.min(P.length,A.length));for(var U=-1;++U=A.length){H++;break}var V=A.slice(2,U-1);if(("0002"!==N.toString("hex")&&!O||"0001"!==N.toString("hex")&&O)&&H++,V.length<8&&H++,H)throw new Error("decryption error");return A.slice(U)}(0,G,N);if(3===U)return G;throw new Error("unknown padding")}},6562:(ne,F,I)=>{var R=I(2772),B=I(3753),S=I(6386),T=I(6945),f=I(9401),M=I(2057),_=I(8651),b=I(8466),C=I(3502).Buffer;ne.exports=function(O,N,U){var H;H=O.padding?O.padding:U?1:4;var G,V=R(O);if(4===H)G=function x(A,O){var N=A.modulus.byteLength(),U=O.length,H=S("sha1").update(C.alloc(0)).digest(),V=H.length,G=2*V;if(U>N-G-2)throw new Error("message too long");var K=C.alloc(N-U-G-2),X=N-V-1,Z=B(V),z=f(C.concat([H,K,C.alloc(1,1),O],X),T(Z,X)),J=f(Z,T(z,V));return new M(C.concat([C.alloc(1),J,z],N))}(V,N);else if(1===H)G=function E(A,O,N){var V,U=O.length,H=A.modulus.byteLength();if(U>H-11)throw new Error("message too long");return V=N?C.alloc(H-U-3,255):function P(A){for(var V,O=C.allocUnsafe(A),N=0,U=B(2*A),H=0;N=0)throw new Error("data too long for modulus")}return U?b(G,V):_(G,V)}},8651:(ne,F,I)=>{var R=I(2057),B=I(3502).Buffer;ne.exports=function S(T,f){return B.from(T.toRed(R.mont(f.modulus)).redPow(new R(f.publicExponent)).fromRed().toArray())}},9401:ne=>{ne.exports=function(I,R){for(var B=I.length,S=-1;++S{"use strict";var R=65536,T=I(3502).Buffer,f=global.crypto||global.msCrypto;ne.exports=f&&f.getRandomValues?function M(_,b){if(_>4294967295)throw new RangeError("requested too many random bytes");var C=T.allocUnsafe(_);if(_>0)if(_>R)for(var x=0;x<_;x+=R)f.getRandomValues(C.slice(x,x+R));else f.getRandomValues(C);return"function"==typeof b?process.nextTick(function(){b(null,C)}):C}:function S(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},4275:(ne,F,I)=>{"use strict";function R(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var B=I(3502),S=I(3753),T=B.Buffer,f=B.kMaxLength,M=global.crypto||global.msCrypto,_=Math.pow(2,32)-1;function b(A,O){if("number"!=typeof A||A!=A)throw new TypeError("offset must be a number");if(A>_||A<0)throw new TypeError("offset must be a uint32");if(A>f||A>O)throw new RangeError("offset out of range")}function C(A,O,N){if("number"!=typeof A||A!=A)throw new TypeError("size must be a number");if(A>_||A<0)throw new TypeError("size must be a uint32");if(A+O>N||A>f)throw new RangeError("buffer too small")}function E(A,O,N,U){if(process.browser){var V=new Uint8Array(A.buffer,O,N);return M.getRandomValues(V),U?void process.nextTick(function(){U(null,A)}):A}if(!U)return S(N).copy(A,O),A;S(N,function(K,X){if(K)return U(K);X.copy(A,O),U(null,A)})}M&&M.getRandomValues||!process.browser?(F.randomFill=function x(A,O,N,U){if(!(T.isBuffer(A)||A instanceof global.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof O)U=O,O=0,N=A.length;else if("function"==typeof N)U=N,N=A.length-O;else if("function"!=typeof U)throw new TypeError('"cb" argument must be a function');return b(O,A.length),C(N,O,A.length),E(A,O,N,U)},F.randomFillSync=function P(A,O,N){if(void 0===O&&(O=0),!(T.isBuffer(A)||A instanceof global.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return b(O,A.length),void 0===N&&(N=A.length-O),C(N,O,A.length),E(A,O,N)}):(F.randomFill=R,F.randomFillSync=R)},891:ne=>{"use strict";var I={};function R(M,_,b){b||(b=Error);var x=function(E){function P(A,O,N){return E.call(this,function C(E,P,A){return"string"==typeof _?_:_(E,P,A)}(A,O,N))||this}return function F(M,_){M.prototype=Object.create(_.prototype),M.prototype.constructor=M,M.__proto__=_}(P,E),P}(b);x.prototype.name=b.name,x.prototype.code=M,I[M]=x}function B(M,_){if(Array.isArray(M)){var b=M.length;return M=M.map(function(C){return String(C)}),b>2?"one of ".concat(_," ").concat(M.slice(0,b-1).join(", "),", or ")+M[b-1]:2===b?"one of ".concat(_," ").concat(M[0]," or ").concat(M[1]):"of ".concat(_," ").concat(M[0])}return"of ".concat(_," ").concat(String(M))}R("ERR_INVALID_OPT_VALUE",function(M,_){return'The value "'+_+'" is invalid for option "'+M+'"'},TypeError),R("ERR_INVALID_ARG_TYPE",function(M,_,b){var C,x;if("string"==typeof _&&function S(M,_,b){return M.substr(!b||b<0?0:+b,_.length)===_}(_,"not ")?(C="must not be",_=_.replace(/^not /,"")):C="must be",function T(M,_,b){return(void 0===b||b>M.length)&&(b=M.length),M.substring(b-_.length,b)===_}(M," argument"))x="The ".concat(M," ").concat(C," ").concat(B(_,"type"));else{var E=function f(M,_,b){return"number"!=typeof b&&(b=0),!(b+_.length>M.length)&&-1!==M.indexOf(_,b)}(M,".")?"property":"argument";x='The "'.concat(M,'" ').concat(E," ").concat(C," ").concat(B(_,"type"))}return x+". Received type ".concat(typeof b)},TypeError),R("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),R("ERR_METHOD_NOT_IMPLEMENTED",function(M){return"The "+M+" method is not implemented"}),R("ERR_STREAM_PREMATURE_CLOSE","Premature close"),R("ERR_STREAM_DESTROYED",function(M){return"Cannot call "+M+" after a stream was destroyed"}),R("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),R("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),R("ERR_STREAM_WRITE_AFTER_END","write after end"),R("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),R("ERR_UNKNOWN_ENCODING",function(M){return"Unknown encoding: "+M},TypeError),R("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),ne.exports.q=I},1339:(ne,F,I)=>{"use strict";var R=Object.keys||function(x){var E=[];for(var P in x)E.push(P);return E};ne.exports=_;var B=I(3154),S=I(520);I(3894)(_,B);for(var T=R(S.prototype),f=0;f{"use strict";ne.exports=B;var R=I(6025);function B(S){if(!(this instanceof B))return new B(S);R.call(this,S)}I(3894)(B,R),B.prototype._transform=function(S,T,f){f(null,S)}},3154:(ne,F,I)=>{"use strict";var R;ne.exports=y,y.ReadableState=ve,I(9069);var x,S=function(_e,Me){return _e.listeners(Me).length},T=I(4970),f=I(3172).Buffer,M=global.Uint8Array||function(){},C=I(6788);x=C&&C.debuglog?C.debuglog("stream"):function(){};var K,X,Z,E=I(5019),P=I(1920),O=I(7102).getHighWaterMark,N=I(891).q,U=N.ERR_INVALID_ARG_TYPE,H=N.ERR_STREAM_PUSH_AFTER_EOF,V=N.ERR_METHOD_NOT_IMPLEMENTED,G=N.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;I(3894)(y,T);var z=P.errorOrDestroy,J=["error","close","destroy","pause","resume"];function ve(ue,_e,Me){R=R||I(1339),"boolean"!=typeof Me&&(Me=_e instanceof R),this.objectMode=!!(ue=ue||{}).objectMode,Me&&(this.objectMode=this.objectMode||!!ue.readableObjectMode),this.highWaterMark=O(this,ue,"readableHighWaterMark",Me),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.paused=!0,this.emitClose=!1!==ue.emitClose,this.autoDestroy=!!ue.autoDestroy,this.destroyed=!1,this.defaultEncoding=ue.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ue.encoding&&(K||(K=I(3054).s),this.decoder=new K(ue.encoding),this.encoding=ue.encoding)}function y(ue){if(R=R||I(1339),!(this instanceof y))return new y(ue);this._readableState=new ve(ue,this,this instanceof R),this.readable=!0,ue&&("function"==typeof ue.read&&(this._read=ue.read),"function"==typeof ue.destroy&&(this._destroy=ue.destroy)),T.call(this)}function o(ue,_e,Me,le,ie){x("readableAddChunk",_e);var ae,Y=ue._readableState;if(null===_e)Y.reading=!1,function w(ue,_e){if(x("onEofChunk"),!_e.ended){if(_e.decoder){var Me=_e.decoder.end();Me&&Me.length&&(_e.buffer.push(Me),_e.length+=_e.objectMode?1:Me.length)}_e.ended=!0,_e.sync?p(ue):(_e.needReadable=!1,_e.emittedReadable||(_e.emittedReadable=!0,s(ue)))}}(ue,Y);else if(ie||(ae=function c(ue,_e){var Me;return!function b(ue){return f.isBuffer(ue)||ue instanceof M}(_e)&&"string"!=typeof _e&&void 0!==_e&&!ue.objectMode&&(Me=new U("chunk",["string","Buffer","Uint8Array"],_e)),Me}(Y,_e)),ae)z(ue,ae);else if(Y.objectMode||_e&&_e.length>0)if("string"!=typeof _e&&!Y.objectMode&&Object.getPrototypeOf(_e)!==f.prototype&&(_e=function _(ue){return f.from(ue)}(_e)),le)Y.endEmitted?z(ue,new G):l(ue,Y,_e,!0);else if(Y.ended)z(ue,new H);else{if(Y.destroyed)return!1;Y.reading=!1,Y.decoder&&!Me?(_e=Y.decoder.write(_e),Y.objectMode||0!==_e.length?l(ue,Y,_e,!1):g(ue,Y)):l(ue,Y,_e,!1)}else le||(Y.reading=!1,g(ue,Y));return!Y.ended&&(Y.length_e.highWaterMark&&(_e.highWaterMark=function d(ue){return ue>=u?ue=u:(ue--,ue|=ue>>>1,ue|=ue>>>2,ue|=ue>>>4,ue|=ue>>>8,ue|=ue>>>16,ue++),ue}(ue)),ue<=_e.length?ue:_e.ended?_e.length:(_e.needReadable=!0,0))}function p(ue){var _e=ue._readableState;x("emitReadable",_e.needReadable,_e.emittedReadable),_e.needReadable=!1,_e.emittedReadable||(x("emitReadable",_e.flowing),_e.emittedReadable=!0,process.nextTick(s,ue))}function s(ue){var _e=ue._readableState;x("emitReadable_",_e.destroyed,_e.length,_e.ended),!_e.destroyed&&(_e.length||_e.ended)&&(ue.emit("readable"),_e.emittedReadable=!1),_e.needReadable=!_e.flowing&&!_e.ended&&_e.length<=_e.highWaterMark,fe(ue)}function g(ue,_e){_e.readingMore||(_e.readingMore=!0,process.nextTick($,ue,_e))}function $(ue,_e){for(;!_e.reading&&!_e.ended&&(_e.length<_e.highWaterMark||_e.flowing&&0===_e.length);){var Me=_e.length;if(x("maybeReadMore read 0"),ue.read(0),Me===_e.length)break}_e.readingMore=!1}function q(ue){var _e=ue._readableState;_e.readableListening=ue.listenerCount("readable")>0,_e.resumeScheduled&&!_e.paused?_e.flowing=!0:ue.listenerCount("data")>0&&ue.resume()}function he(ue){x("readable nexttick read 0"),ue.read(0)}function ge(ue,_e){x("resume",_e.reading),_e.reading||ue.read(0),_e.resumeScheduled=!1,ue.emit("resume"),fe(ue),_e.flowing&&!_e.reading&&ue.read(0)}function fe(ue){var _e=ue._readableState;for(x("flow",_e.flowing);_e.flowing&&null!==ue.read(););}function se(ue,_e){return 0===_e.length?null:(_e.objectMode?Me=_e.buffer.shift():!ue||ue>=_e.length?(Me=_e.decoder?_e.buffer.join(""):1===_e.buffer.length?_e.buffer.first():_e.buffer.concat(_e.length),_e.buffer.clear()):Me=_e.buffer.consume(ue,_e.decoder),Me);var Me}function ce(ue){var _e=ue._readableState;x("endReadable",_e.endEmitted),_e.endEmitted||(_e.ended=!0,process.nextTick(ee,_e,ue))}function ee(ue,_e){if(x("endReadableNT",ue.endEmitted,ue.length),!ue.endEmitted&&0===ue.length&&(ue.endEmitted=!0,_e.readable=!1,_e.emit("end"),ue.autoDestroy)){var Me=_e._writableState;(!Me||Me.autoDestroy&&Me.finished)&&_e.destroy()}}function pe(ue,_e){for(var Me=0,le=ue.length;Me=_e.highWaterMark:_e.length>0)||_e.ended))return x("read: emitReadable",_e.length,_e.ended),0===_e.length&&_e.ended?ce(this):p(this),null;if(0===(ue=m(ue,_e))&&_e.ended)return 0===_e.length&&ce(this),null;var ie,le=_e.needReadable;return x("need readable",le),(0===_e.length||_e.length-ue<_e.highWaterMark)&&x("length less than watermark",le=!0),_e.ended||_e.reading?x("reading or ended",le=!1):le&&(x("do read"),_e.reading=!0,_e.sync=!0,0===_e.length&&(_e.needReadable=!0),this._read(_e.highWaterMark),_e.sync=!1,_e.reading||(ue=m(Me,_e))),null===(ie=ue>0?se(ue,_e):null)?(_e.needReadable=_e.length<=_e.highWaterMark,ue=0):(_e.length-=ue,_e.awaitDrain=0),0===_e.length&&(_e.ended||(_e.needReadable=!0),Me!==ue&&_e.ended&&ce(this)),null!==ie&&this.emit("data",ie),ie},y.prototype._read=function(ue){z(this,new V("_read()"))},y.prototype.pipe=function(ue,_e){var Me=this,le=this._readableState;switch(le.pipesCount){case 0:le.pipes=ue;break;case 1:le.pipes=[le.pipes,ue];break;default:le.pipes.push(ue)}le.pipesCount+=1,x("pipe count=%d opts=%j",le.pipesCount,_e);var Y=_e&&!1===_e.end||ue===process.stdout||ue===process.stderr?oe:Le;function Le(){x("onend"),ue.end()}le.endEmitted?process.nextTick(Y):Me.once("end",Y),ue.on("unpipe",function ae(te,W){x("onunpipe"),te===Me&&W&&!1===W.hasUnpiped&&(W.hasUnpiped=!0,function Re(){x("cleanup"),ue.removeListener("close",wt),ue.removeListener("finish",Be),ue.removeListener("drain",xe),ue.removeListener("error",Oe),ue.removeListener("unpipe",ae),Me.removeListener("end",Le),Me.removeListener("end",oe),Me.removeListener("data",we),Ce=!0,le.awaitDrain&&(!ue._writableState||ue._writableState.needDrain)&&xe()}())});var xe=function k(ue){return function(){var Me=ue._readableState;x("pipeOnDrain",Me.awaitDrain),Me.awaitDrain&&Me.awaitDrain--,0===Me.awaitDrain&&S(ue,"data")&&(Me.flowing=!0,fe(ue))}}(Me);ue.on("drain",xe);var Ce=!1;function we(te){x("ondata");var W=ue.write(te);x("dest.write",W),!1===W&&((1===le.pipesCount&&le.pipes===ue||le.pipesCount>1&&-1!==pe(le.pipes,ue))&&!Ce&&(x("false write response, pause",le.awaitDrain),le.awaitDrain++),Me.pause())}function Oe(te){x("onerror",te),oe(),ue.removeListener("error",Oe),0===S(ue,"error")&&z(ue,te)}function wt(){ue.removeListener("finish",Be),oe()}function Be(){x("onfinish"),ue.removeListener("close",wt),oe()}function oe(){x("unpipe"),Me.unpipe(ue)}return Me.on("data",we),function re(ue,_e,Me){if("function"==typeof ue.prependListener)return ue.prependListener(_e,Me);ue._events&&ue._events[_e]?Array.isArray(ue._events[_e])?ue._events[_e].unshift(Me):ue._events[_e]=[Me,ue._events[_e]]:ue.on(_e,Me)}(ue,"error",Oe),ue.once("close",wt),ue.once("finish",Be),ue.emit("pipe",Me),le.flowing||(x("pipe resume"),Me.resume()),ue},y.prototype.unpipe=function(ue){var _e=this._readableState,Me={hasUnpiped:!1};if(0===_e.pipesCount)return this;if(1===_e.pipesCount)return ue&&ue!==_e.pipes||(ue||(ue=_e.pipes),_e.pipes=null,_e.pipesCount=0,_e.flowing=!1,ue&&ue.emit("unpipe",this,Me)),this;if(!ue){var le=_e.pipes,ie=_e.pipesCount;_e.pipes=null,_e.pipesCount=0,_e.flowing=!1;for(var Y=0;Y0,!1!==le.flowing&&this.resume()):"readable"===ue&&!le.endEmitted&&!le.readableListening&&(le.readableListening=le.needReadable=!0,le.flowing=!1,le.emittedReadable=!1,x("on readable",le.length,le.reading),le.length?p(this):le.reading||process.nextTick(he,this)),Me},y.prototype.removeListener=function(ue,_e){var Me=T.prototype.removeListener.call(this,ue,_e);return"readable"===ue&&process.nextTick(q,this),Me},y.prototype.removeAllListeners=function(ue){var _e=T.prototype.removeAllListeners.apply(this,arguments);return("readable"===ue||void 0===ue)&&process.nextTick(q,this),_e},y.prototype.resume=function(){var ue=this._readableState;return ue.flowing||(x("resume"),ue.flowing=!ue.readableListening,function be(ue,_e){_e.resumeScheduled||(_e.resumeScheduled=!0,process.nextTick(ge,ue,_e))}(this,ue)),ue.paused=!1,this},y.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},y.prototype.wrap=function(ue){var _e=this,Me=this._readableState,le=!1;for(var ie in ue.on("end",function(){if(x("wrapped end"),Me.decoder&&!Me.ended){var ae=Me.decoder.end();ae&&ae.length&&_e.push(ae)}_e.push(null)}),ue.on("data",function(ae){x("wrapped data"),Me.decoder&&(ae=Me.decoder.write(ae)),Me.objectMode&&null==ae||!(Me.objectMode||ae&&ae.length)||_e.push(ae)||(le=!0,ue.pause())}),ue)void 0===this[ie]&&"function"==typeof ue[ie]&&(this[ie]=function(Le){return function(){return ue[Le].apply(ue,arguments)}}(ie));for(var Y=0;Y{"use strict";ne.exports=b;var R=I(891).q,B=R.ERR_METHOD_NOT_IMPLEMENTED,S=R.ERR_MULTIPLE_CALLBACK,T=R.ERR_TRANSFORM_ALREADY_TRANSFORMING,f=R.ERR_TRANSFORM_WITH_LENGTH_0,M=I(1339);function _(E,P){var A=this._transformState;A.transforming=!1;var O=A.writecb;if(null===O)return this.emit("error",new S);A.writechunk=null,A.writecb=null,null!=P&&this.push(P),O(E);var N=this._readableState;N.reading=!1,(N.needReadable||N.length{"use strict";function B(fe){var se=this;this.next=null,this.entry=null,this.finish=function(){!function ge(fe,se,ce){var ee=fe.entry;for(fe.entry=null;ee;){var pe=ee.callback;se.pendingcb--,pe(ce),ee=ee.next}se.corkedRequestsFree.next=fe}(se,fe)}}var S;ne.exports=ve,ve.WritableState=J;var re,T={deprecate:I(3532)},f=I(4970),M=I(3172).Buffer,_=global.Uint8Array||function(){},x=I(1920),P=I(7102).getHighWaterMark,A=I(891).q,O=A.ERR_INVALID_ARG_TYPE,N=A.ERR_METHOD_NOT_IMPLEMENTED,U=A.ERR_MULTIPLE_CALLBACK,H=A.ERR_STREAM_CANNOT_PIPE,V=A.ERR_STREAM_DESTROYED,G=A.ERR_STREAM_NULL_VALUES,K=A.ERR_STREAM_WRITE_AFTER_END,X=A.ERR_UNKNOWN_ENCODING,Z=x.errorOrDestroy;function z(){}function J(fe,se,ce){S=S||I(1339),"boolean"!=typeof ce&&(ce=se instanceof S),this.objectMode=!!(fe=fe||{}).objectMode,ce&&(this.objectMode=this.objectMode||!!fe.writableObjectMode),this.highWaterMark=P(this,fe,"writableHighWaterMark",ce),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===fe.decodeStrings),this.defaultEncoding=fe.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(pe){!function w(fe,se){var ce=fe._writableState,ee=ce.sync,pe=ce.writecb;if("function"!=typeof pe)throw new U;if(function m(fe){fe.writing=!1,fe.writecb=null,fe.length-=fe.writelen,fe.writelen=0}(ce),se)!function d(fe,se,ce,ee,pe){--se.pendingcb,ce?(process.nextTick(pe,ee),process.nextTick(he,fe,se),fe._writableState.errorEmitted=!0,Z(fe,ee)):(pe(ee),fe._writableState.errorEmitted=!0,Z(fe,ee),he(fe,se))}(fe,ce,ee,se,pe);else{var ue=$(ce)||fe.destroyed;!ue&&!ce.corked&&!ce.bufferProcessing&&ce.bufferedRequest&&g(fe,ce),ee?process.nextTick(p,fe,ce,ue,pe):p(fe,ce,ue,pe)}}(se,pe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==fe.emitClose,this.autoDestroy=!!fe.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new B(this)}function ve(fe){var se=this instanceof(S=S||I(1339));if(!se&&!re.call(ve,this))return new ve(fe);this._writableState=new J(fe,this,se),this.writable=!0,fe&&("function"==typeof fe.write&&(this._write=fe.write),"function"==typeof fe.writev&&(this._writev=fe.writev),"function"==typeof fe.destroy&&(this._destroy=fe.destroy),"function"==typeof fe.final&&(this._final=fe.final)),f.call(this)}function u(fe,se,ce,ee,pe,ue,_e){se.writelen=ee,se.writecb=_e,se.writing=!0,se.sync=!0,se.destroyed?se.onwrite(new V("write")):ce?fe._writev(pe,se.onwrite):fe._write(pe,ue,se.onwrite),se.sync=!1}function p(fe,se,ce,ee){ce||function s(fe,se){0===se.length&&se.needDrain&&(se.needDrain=!1,fe.emit("drain"))}(fe,se),se.pendingcb--,ee(),he(fe,se)}function g(fe,se){se.bufferProcessing=!0;var ce=se.bufferedRequest;if(fe._writev&&ce&&ce.next){var pe=new Array(se.bufferedRequestCount),ue=se.corkedRequestsFree;ue.entry=ce;for(var _e=0,Me=!0;ce;)pe[_e]=ce,ce.isBuf||(Me=!1),ce=ce.next,_e+=1;pe.allBuffers=Me,u(fe,se,!0,se.length,pe,"",ue.finish),se.pendingcb++,se.lastBufferedRequest=null,ue.next?(se.corkedRequestsFree=ue.next,ue.next=null):se.corkedRequestsFree=new B(se),se.bufferedRequestCount=0}else{for(;ce;){var le=ce.chunk;if(u(fe,se,!1,se.objectMode?1:le.length,le,ce.encoding,ce.callback),ce=ce.next,se.bufferedRequestCount--,se.writing)break}null===ce&&(se.lastBufferedRequest=null)}se.bufferedRequest=ce,se.bufferProcessing=!1}function $(fe){return fe.ending&&0===fe.length&&null===fe.bufferedRequest&&!fe.finished&&!fe.writing}function k(fe,se){fe._final(function(ce){se.pendingcb--,ce&&Z(fe,ce),se.prefinished=!0,fe.emit("prefinish"),he(fe,se)})}function he(fe,se){var ce=$(se);if(ce&&(function q(fe,se){!se.prefinished&&!se.finalCalled&&("function"!=typeof fe._final||se.destroyed?(se.prefinished=!0,fe.emit("prefinish")):(se.pendingcb++,se.finalCalled=!0,process.nextTick(k,fe,se)))}(fe,se),0===se.pendingcb&&(se.finished=!0,fe.emit("finish"),se.autoDestroy))){var ee=fe._readableState;(!ee||ee.autoDestroy&&ee.endEmitted)&&fe.destroy()}return ce}I(3894)(ve,f),J.prototype.getBuffer=function(){for(var se=this.bufferedRequest,ce=[];se;)ce.push(se),se=se.next;return ce},function(){try{Object.defineProperty(J.prototype,"buffer",{get:T.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(fe){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(re=Function.prototype[Symbol.hasInstance],Object.defineProperty(ve,Symbol.hasInstance,{value:function(se){return!!re.call(this,se)||this===ve&&se&&se._writableState instanceof J}})):re=function(se){return se instanceof this},ve.prototype.pipe=function(){Z(this,new H)},ve.prototype.write=function(fe,se,ce){var ee=this._writableState,pe=!1,ue=!ee.objectMode&&function C(fe){return M.isBuffer(fe)||fe instanceof _}(fe);return ue&&!M.isBuffer(fe)&&(fe=function b(fe){return M.from(fe)}(fe)),"function"==typeof se&&(ce=se,se=null),ue?se="buffer":se||(se=ee.defaultEncoding),"function"!=typeof ce&&(ce=z),ee.ending?function y(fe,se){var ce=new K;Z(fe,ce),process.nextTick(se,ce)}(this,ce):(ue||function o(fe,se,ce,ee){var pe;return null===ce?pe=new G:"string"!=typeof ce&&!se.objectMode&&(pe=new O("chunk",["string","Buffer"],ce)),!pe||(Z(fe,pe),process.nextTick(ee,pe),!1)}(this,ee,fe,ce))&&(ee.pendingcb++,pe=function c(fe,se,ce,ee,pe,ue){if(!ce){var _e=function l(fe,se,ce){return!fe.objectMode&&!1!==fe.decodeStrings&&"string"==typeof se&&(se=M.from(se,ce)),se}(se,ee,pe);ee!==_e&&(ce=!0,pe="buffer",ee=_e)}var Me=se.objectMode?1:ee.length;se.length+=Me;var le=se.length-1))throw new X(se);return this._writableState.defaultEncoding=se,this},Object.defineProperty(ve.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(ve.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),ve.prototype._write=function(fe,se,ce){ce(new N("_write()"))},ve.prototype._writev=null,ve.prototype.end=function(fe,se,ce){var ee=this._writableState;return"function"==typeof fe?(ce=fe,fe=null,se=null):"function"==typeof se&&(ce=se,se=null),null!=fe&&this.write(fe,se),ee.corked&&(ee.corked=1,this.uncork()),ee.ending||function be(fe,se,ce){se.ending=!0,he(fe,se),ce&&(se.finished?process.nextTick(ce):fe.once("finish",ce)),se.ended=!0,fe.writable=!1}(this,ee,ce),this},Object.defineProperty(ve.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(ve.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(se){!this._writableState||(this._writableState.destroyed=se)}}),ve.prototype.destroy=x.destroy,ve.prototype._undestroy=x.undestroy,ve.prototype._destroy=function(fe,se){se(fe)}},3872:(ne,F,I)=>{"use strict";var R;function B(V,G,K){return G in V?Object.defineProperty(V,G,{value:K,enumerable:!0,configurable:!0,writable:!0}):V[G]=K,V}var S=I(7542),T=Symbol("lastResolve"),f=Symbol("lastReject"),M=Symbol("error"),_=Symbol("ended"),b=Symbol("lastPromise"),C=Symbol("handlePromise"),x=Symbol("stream");function E(V,G){return{value:V,done:G}}function P(V){var G=V[T];if(null!==G){var K=V[x].read();null!==K&&(V[b]=null,V[T]=null,V[f]=null,G(E(K,!1)))}}function A(V){process.nextTick(P,V)}var N=Object.getPrototypeOf(function(){}),U=Object.setPrototypeOf((B(R={get stream(){return this[x]},next:function(){var G=this,K=this[M];if(null!==K)return Promise.reject(K);if(this[_])return Promise.resolve(E(void 0,!0));if(this[x].destroyed)return new Promise(function(J,re){process.nextTick(function(){G[M]?re(G[M]):J(E(void 0,!0))})});var Z,X=this[b];if(X)Z=new Promise(function O(V,G){return function(K,X){V.then(function(){G[_]?K(E(void 0,!0)):G[C](K,X)},X)}}(X,this));else{var z=this[x].read();if(null!==z)return Promise.resolve(E(z,!1));Z=new Promise(this[C])}return this[b]=Z,Z}},Symbol.asyncIterator,function(){return this}),B(R,"return",function(){var G=this;return new Promise(function(K,X){G[x].destroy(null,function(Z){Z?X(Z):K(E(void 0,!0))})})}),R),N);ne.exports=function(G){var K,X=Object.create(U,(B(K={},x,{value:G,writable:!0}),B(K,T,{value:null,writable:!0}),B(K,f,{value:null,writable:!0}),B(K,M,{value:null,writable:!0}),B(K,_,{value:G._readableState.endEmitted,writable:!0}),B(K,C,{value:function(z,J){var re=X[x].read();re?(X[b]=null,X[T]=null,X[f]=null,z(E(re,!1))):(X[T]=z,X[f]=J)},writable:!0}),K));return X[b]=null,S(G,function(Z){if(Z&&"ERR_STREAM_PREMATURE_CLOSE"!==Z.code){var z=X[f];return null!==z&&(X[b]=null,X[T]=null,X[f]=null,z(Z)),void(X[M]=Z)}var J=X[T];null!==J&&(X[b]=null,X[T]=null,X[f]=null,J(E(void 0,!0))),X[_]=!0}),G.on("readable",A.bind(null,X)),X}},5019:(ne,F,I)=>{"use strict";function R(A,O){var N=Object.keys(A);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(A);O&&(U=U.filter(function(H){return Object.getOwnPropertyDescriptor(A,H).enumerable})),N.push.apply(N,U)}return N}function S(A,O,N){return O in A?Object.defineProperty(A,O,{value:N,enumerable:!0,configurable:!0,writable:!0}):A[O]=N,A}function f(A,O){for(var N=0;N0?this.tail.next=U:this.head=U,this.tail=U,++this.length}},{key:"unshift",value:function(N){var U={data:N,next:this.head};0===this.length&&(this.tail=U),this.head=U,++this.length}},{key:"shift",value:function(){if(0!==this.length){var N=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,N}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(N){if(0===this.length)return"";for(var U=this.head,H=""+U.data;U=U.next;)H+=N+U.data;return H}},{key:"concat",value:function(N){if(0===this.length)return b.alloc(0);for(var U=b.allocUnsafe(N>>>0),H=this.head,V=0;H;)P(H.data,U,V),V+=H.data.length,H=H.next;return U}},{key:"consume",value:function(N,U){var H;return NG.length?G.length:N;if(V+=K===G.length?G:G.slice(0,N),0==(N-=K)){K===G.length?(++H,this.head=U.next?U.next:this.tail=null):(this.head=U,U.data=G.slice(K));break}++H}return this.length-=H,V}},{key:"_getBuffer",value:function(N){var U=b.allocUnsafe(N),H=this.head,V=1;for(H.data.copy(U),N-=H.data.length;H=H.next;){var G=H.data,K=N>G.length?G.length:N;if(G.copy(U,U.length-N,0,K),0==(N-=K)){K===G.length?(++V,this.head=H.next?H.next:this.tail=null):(this.head=H,H.data=G.slice(K));break}++V}return this.length-=V,U}},{key:E,value:function(N,U){return x(this,function B(A){for(var O=1;O{"use strict";function I(f,M){S(f,M),R(f)}function R(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function S(f,M){f.emit("error",M)}ne.exports={destroy:function F(f,M){var _=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(M?M(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(S,this,f)):process.nextTick(S,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(x){!M&&x?_._writableState?_._writableState.errorEmitted?process.nextTick(R,_):(_._writableState.errorEmitted=!0,process.nextTick(I,_,x)):process.nextTick(I,_,x):M?(process.nextTick(R,_),M(x)):process.nextTick(R,_)}),this)},undestroy:function B(){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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function T(f,M){var _=f._readableState,b=f._writableState;_&&_.autoDestroy||b&&b.autoDestroy?f.destroy(M):f.emit("error",M)}}},7542:(ne,F,I)=>{"use strict";var R=I(891).q.ERR_STREAM_PREMATURE_CLOSE;function S(){}ne.exports=function f(M,_,b){if("function"==typeof _)return f(M,null,_);_||(_={}),b=function B(M){var _=!1;return function(){if(!_){_=!0;for(var b=arguments.length,C=new Array(b),x=0;x{ne.exports=function(){throw new Error("Readable.from is not available in the browser")}},954:(ne,F,I)=>{"use strict";var R,S=I(891).q,T=S.ERR_MISSING_ARGS,f=S.ERR_STREAM_DESTROYED;function M(A){if(A)throw A}function b(A,O,N,U){U=function B(A){var O=!1;return function(){O||(O=!0,A.apply(void 0,arguments))}}(U);var H=!1;A.on("close",function(){H=!0}),void 0===R&&(R=I(7542)),R(A,{readable:O,writable:N},function(G){if(G)return U(G);H=!0,U()});var V=!1;return function(G){if(!H&&!V){if(V=!0,function _(A){return A.setHeader&&"function"==typeof A.abort}(A))return A.abort();if("function"==typeof A.destroy)return A.destroy();U(G||new f("pipe"))}}}function C(A){A()}function x(A,O){return A.pipe(O)}function E(A){return A.length&&"function"==typeof A[A.length-1]?A.pop():M}ne.exports=function P(){for(var A=arguments.length,O=new Array(A),N=0;N0,function(z){H||(H=z),z&&V.forEach(C),!X&&(V.forEach(C),U(H))})});return O.reduce(x)}},7102:(ne,F,I)=>{"use strict";var R=I(891).q.ERR_INVALID_OPT_VALUE;ne.exports={getHighWaterMark:function S(T,f,M,_){var b=function B(T,f,M){return null!=T.highWaterMark?T.highWaterMark:f?T[M]:null}(f,_,M);if(null!=b){if(!isFinite(b)||Math.floor(b)!==b||b<0)throw new R(_?M:"highWaterMark",b);return Math.floor(b)}return T.objectMode?16:16384}}},4970:(ne,F,I)=>{ne.exports=I(9069).EventEmitter},5685:(ne,F,I)=>{(F=ne.exports=I(3154)).Stream=F,F.Readable=F,F.Writable=I(520),F.Duplex=I(1339),F.Transform=I(6025),F.PassThrough=I(6071),F.finished=I(7542),F.pipeline=I(954)},5634:(ne,F,I)=>{"use strict";var R=I(3172).Buffer,B=I(3894),S=I(9650),T=new Array(16),f=[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],M=[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],_=[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],b=[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],C=[0,1518500249,1859775393,2400959708,2840853838],x=[1352829926,1548603684,1836072691,2053994217,0];function E(){S.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function P(V,G){return V<>>32-G}function A(V,G,K,X,Z,z,J,re){return P(V+(G^K^X)+z+J|0,re)+Z|0}function O(V,G,K,X,Z,z,J,re){return P(V+(G&K|~G&X)+z+J|0,re)+Z|0}function N(V,G,K,X,Z,z,J,re){return P(V+((G|~K)^X)+z+J|0,re)+Z|0}function U(V,G,K,X,Z,z,J,re){return P(V+(G&X|K&~X)+z+J|0,re)+Z|0}function H(V,G,K,X,Z,z,J,re){return P(V+(G^(K|~X))+z+J|0,re)+Z|0}B(E,S),E.prototype._update=function(){for(var V=T,G=0;G<16;++G)V[G]=this._block.readInt32LE(4*G);for(var K=0|this._a,X=0|this._b,Z=0|this._c,z=0|this._d,J=0|this._e,re=0|this._a,ve=0|this._b,y=0|this._c,o=0|this._d,l=0|this._e,c=0;c<80;c+=1){var u,d;c<16?(u=A(K,X,Z,z,J,V[f[c]],C[0],_[c]),d=H(re,ve,y,o,l,V[M[c]],x[0],b[c])):c<32?(u=O(K,X,Z,z,J,V[f[c]],C[1],_[c]),d=U(re,ve,y,o,l,V[M[c]],x[1],b[c])):c<48?(u=N(K,X,Z,z,J,V[f[c]],C[2],_[c]),d=N(re,ve,y,o,l,V[M[c]],x[2],b[c])):c<64?(u=U(K,X,Z,z,J,V[f[c]],C[3],_[c]),d=O(re,ve,y,o,l,V[M[c]],x[3],b[c])):(u=H(K,X,Z,z,J,V[f[c]],C[4],_[c]),d=A(re,ve,y,o,l,V[M[c]],x[4],b[c])),K=J,J=z,z=P(Z,10),Z=X,X=u,re=l,l=o,o=P(y,10),y=ve,ve=d}var m=this._b+Z+o|0;this._b=this._c+z+l|0,this._c=this._d+J+re|0,this._d=this._e+K+ve|0,this._e=this._a+X+y|0,this._a=m},E.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var V=R.alloc?R.alloc(20):new R(20);return V.writeInt32LE(this._a,0),V.writeInt32LE(this._b,4),V.writeInt32LE(this._c,8),V.writeInt32LE(this._d,12),V.writeInt32LE(this._e,16),V},ne.exports=E},3502:(ne,F,I)=>{var R=I(3172),B=R.Buffer;function S(f,M){for(var _ in f)M[_]=f[_]}function T(f,M,_){return B(f,M,_)}B.from&&B.alloc&&B.allocUnsafe&&B.allocUnsafeSlow?ne.exports=R:(S(R,F),F.Buffer=T),T.prototype=Object.create(B.prototype),S(B,T),T.from=function(f,M,_){if("number"==typeof f)throw new TypeError("Argument must not be a number");return B(f,M,_)},T.alloc=function(f,M,_){if("number"!=typeof f)throw new TypeError("Argument must be a number");var b=B(f);return void 0!==M?"string"==typeof _?b.fill(M,_):b.fill(M):b.fill(0),b},T.allocUnsafe=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return B(f)},T.allocUnsafeSlow=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return R.SlowBuffer(f)}},2038:(ne,F,I)=>{"use strict";var T,R=I(3172),B=R.Buffer,S={};for(T in R)!R.hasOwnProperty(T)||"SlowBuffer"===T||"Buffer"===T||(S[T]=R[T]);var f=S.Buffer={};for(T in B)!B.hasOwnProperty(T)||"allocUnsafe"===T||"allocUnsafeSlow"===T||(f[T]=B[T]);if(S.Buffer.prototype=B.prototype,(!f.from||f.from===Uint8Array.from)&&(f.from=function(M,_,b){if("number"==typeof M)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof M);if(M&&void 0===M.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);return B(M,_,b)}),f.alloc||(f.alloc=function(M,_,b){if("number"!=typeof M)throw new TypeError('The "size" argument must be of type number. Received type '+typeof M);if(M<0||M>=2*(1<<30))throw new RangeError('The value "'+M+'" is invalid for option "size"');var C=B(M);return _&&0!==_.length?"string"==typeof b?C.fill(_,b):C.fill(_):C.fill(0),C}),!S.kStringMaxLength)try{S.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(M){}S.constants||(S.constants={MAX_LENGTH:S.kMaxLength},S.kStringMaxLength&&(S.constants.MAX_STRING_LENGTH=S.kStringMaxLength)),ne.exports=S},6692:(ne,F,I)=>{var R=I(3502).Buffer;function B(S,T){this._block=R.alloc(S),this._finalSize=T,this._blockSize=S,this._len=0}B.prototype.update=function(S,T){"string"==typeof S&&(S=R.from(S,T=T||"utf8"));for(var f=this._block,M=this._blockSize,_=S.length,b=this._len,C=0;C<_;){for(var x=b%M,E=Math.min(_-C,M-x),P=0;P=this._finalSize&&(this._update(this._block),this._block.fill(0));var f=8*this._len;if(f<=4294967295)this._block.writeUInt32BE(f,this._blockSize-4);else{var M=(4294967295&f)>>>0;this._block.writeUInt32BE((f-M)/4294967296,this._blockSize-8),this._block.writeUInt32BE(M,this._blockSize-4)}this._update(this._block);var b=this._hash();return S?b.toString(S):b},B.prototype._update=function(){throw new Error("_update must be implemented by subclass")},ne.exports=B},5244:(ne,F,I)=>{var R=ne.exports=function(S){S=S.toLowerCase();var T=R[S];if(!T)throw new Error(S+" is not supported (we accept pull requests)");return new T};R.sha=I(8932),R.sha1=I(7736),R.sha224=I(5044),R.sha256=I(5014),R.sha384=I(6540),R.sha512=I(117)},8932:(ne,F,I)=>{var R=I(3894),B=I(6692),S=I(3502).Buffer,T=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function M(){this.init(),this._w=f,B.call(this,64,56)}function _(x){return x<<5|x>>>27}function b(x){return x<<30|x>>>2}function C(x,E,P,A){return 0===x?E&P|~E&A:2===x?E&P|E&A|P&A:E^P^A}R(M,B),M.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},M.prototype._update=function(x){for(var E=this._w,P=0|this._a,A=0|this._b,O=0|this._c,N=0|this._d,U=0|this._e,H=0;H<16;++H)E[H]=x.readInt32BE(4*H);for(;H<80;++H)E[H]=E[H-3]^E[H-8]^E[H-14]^E[H-16];for(var V=0;V<80;++V){var G=~~(V/20),K=_(P)+C(G,A,O,N)+U+E[V]+T[G]|0;U=N,N=O,O=b(A),A=P,P=K}this._a=P+this._a|0,this._b=A+this._b|0,this._c=O+this._c|0,this._d=N+this._d|0,this._e=U+this._e|0},M.prototype._hash=function(){var x=S.allocUnsafe(20);return x.writeInt32BE(0|this._a,0),x.writeInt32BE(0|this._b,4),x.writeInt32BE(0|this._c,8),x.writeInt32BE(0|this._d,12),x.writeInt32BE(0|this._e,16),x},ne.exports=M},7736:(ne,F,I)=>{var R=I(3894),B=I(6692),S=I(3502).Buffer,T=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function M(){this.init(),this._w=f,B.call(this,64,56)}function _(E){return E<<1|E>>>31}function b(E){return E<<5|E>>>27}function C(E){return E<<30|E>>>2}function x(E,P,A,O){return 0===E?P&A|~P&O:2===E?P&A|P&O|A&O:P^A^O}R(M,B),M.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},M.prototype._update=function(E){for(var P=this._w,A=0|this._a,O=0|this._b,N=0|this._c,U=0|this._d,H=0|this._e,V=0;V<16;++V)P[V]=E.readInt32BE(4*V);for(;V<80;++V)P[V]=_(P[V-3]^P[V-8]^P[V-14]^P[V-16]);for(var G=0;G<80;++G){var K=~~(G/20),X=b(A)+x(K,O,N,U)+H+P[G]+T[K]|0;H=U,U=N,N=C(O),O=A,A=X}this._a=A+this._a|0,this._b=O+this._b|0,this._c=N+this._c|0,this._d=U+this._d|0,this._e=H+this._e|0},M.prototype._hash=function(){var E=S.allocUnsafe(20);return E.writeInt32BE(0|this._a,0),E.writeInt32BE(0|this._b,4),E.writeInt32BE(0|this._c,8),E.writeInt32BE(0|this._d,12),E.writeInt32BE(0|this._e,16),E},ne.exports=M},5044:(ne,F,I)=>{var R=I(3894),B=I(5014),S=I(6692),T=I(3502).Buffer,f=new Array(64);function M(){this.init(),this._w=f,S.call(this,64,56)}R(M,B),M.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},M.prototype._hash=function(){var _=T.allocUnsafe(28);return _.writeInt32BE(this._a,0),_.writeInt32BE(this._b,4),_.writeInt32BE(this._c,8),_.writeInt32BE(this._d,12),_.writeInt32BE(this._e,16),_.writeInt32BE(this._f,20),_.writeInt32BE(this._g,24),_},ne.exports=M},5014:(ne,F,I)=>{var R=I(3894),B=I(6692),S=I(3502).Buffer,T=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=new Array(64);function M(){this.init(),this._w=f,B.call(this,64,56)}function _(A,O,N){return N^A&(O^N)}function b(A,O,N){return A&O|N&(A|O)}function C(A){return(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10)}function x(A){return(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7)}function E(A){return(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3}function P(A){return(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10}R(M,B),M.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},M.prototype._update=function(A){for(var O=this._w,N=0|this._a,U=0|this._b,H=0|this._c,V=0|this._d,G=0|this._e,K=0|this._f,X=0|this._g,Z=0|this._h,z=0;z<16;++z)O[z]=A.readInt32BE(4*z);for(;z<64;++z)O[z]=P(O[z-2])+O[z-7]+E(O[z-15])+O[z-16]|0;for(var J=0;J<64;++J){var re=Z+x(G)+_(G,K,X)+T[J]+O[J]|0,ve=C(N)+b(N,U,H)|0;Z=X,X=K,K=G,G=V+re|0,V=H,H=U,U=N,N=re+ve|0}this._a=N+this._a|0,this._b=U+this._b|0,this._c=H+this._c|0,this._d=V+this._d|0,this._e=G+this._e|0,this._f=K+this._f|0,this._g=X+this._g|0,this._h=Z+this._h|0},M.prototype._hash=function(){var A=S.allocUnsafe(32);return A.writeInt32BE(this._a,0),A.writeInt32BE(this._b,4),A.writeInt32BE(this._c,8),A.writeInt32BE(this._d,12),A.writeInt32BE(this._e,16),A.writeInt32BE(this._f,20),A.writeInt32BE(this._g,24),A.writeInt32BE(this._h,28),A},ne.exports=M},6540:(ne,F,I)=>{var R=I(3894),B=I(117),S=I(6692),T=I(3502).Buffer,f=new Array(160);function M(){this.init(),this._w=f,S.call(this,128,112)}R(M,B),M.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},M.prototype._hash=function(){var _=T.allocUnsafe(48);function b(C,x,E){_.writeInt32BE(C,E),_.writeInt32BE(x,E+4)}return b(this._ah,this._al,0),b(this._bh,this._bl,8),b(this._ch,this._cl,16),b(this._dh,this._dl,24),b(this._eh,this._el,32),b(this._fh,this._fl,40),_},ne.exports=M},117:(ne,F,I)=>{var R=I(3894),B=I(6692),S=I(3502).Buffer,T=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],f=new Array(160);function M(){this.init(),this._w=f,B.call(this,128,112)}function _(U,H,V){return V^U&(H^V)}function b(U,H,V){return U&H|V&(U|H)}function C(U,H){return(U>>>28|H<<4)^(H>>>2|U<<30)^(H>>>7|U<<25)}function x(U,H){return(U>>>14|H<<18)^(U>>>18|H<<14)^(H>>>9|U<<23)}function E(U,H){return(U>>>1|H<<31)^(U>>>8|H<<24)^U>>>7}function P(U,H){return(U>>>1|H<<31)^(U>>>8|H<<24)^(U>>>7|H<<25)}function A(U,H){return(U>>>19|H<<13)^(H>>>29|U<<3)^U>>>6}function O(U,H){return(U>>>19|H<<13)^(H>>>29|U<<3)^(U>>>6|H<<26)}function N(U,H){return U>>>0>>0?1:0}R(M,B),M.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},M.prototype._update=function(U){for(var H=this._w,V=0|this._ah,G=0|this._bh,K=0|this._ch,X=0|this._dh,Z=0|this._eh,z=0|this._fh,J=0|this._gh,re=0|this._hh,ve=0|this._al,y=0|this._bl,o=0|this._cl,l=0|this._dl,c=0|this._el,u=0|this._fl,d=0|this._gl,m=0|this._hl,w=0;w<32;w+=2)H[w]=U.readInt32BE(4*w),H[w+1]=U.readInt32BE(4*w+4);for(;w<160;w+=2){var p=H[w-30],s=H[w-30+1],g=E(p,s),$=P(s,p),k=A(p=H[w-4],s=H[w-4+1]),q=O(s,p),ge=H[w-32],fe=H[w-32+1],se=$+H[w-14+1]|0,ce=g+H[w-14]+N(se,$)|0;ce=(ce=ce+k+N(se=se+q|0,q)|0)+ge+N(se=se+fe|0,fe)|0,H[w]=ce,H[w+1]=se}for(var ee=0;ee<160;ee+=2){ce=H[ee],se=H[ee+1];var pe=b(V,G,K),ue=b(ve,y,o),_e=C(V,ve),Me=C(ve,V),le=x(Z,c),ie=x(c,Z),Y=T[ee],ae=T[ee+1],Le=_(Z,z,J),xe=_(c,u,d),Ce=m+ie|0,Re=re+le+N(Ce,m)|0;Re=(Re=(Re=Re+Le+N(Ce=Ce+xe|0,xe)|0)+Y+N(Ce=Ce+ae|0,ae)|0)+ce+N(Ce=Ce+se|0,se)|0;var we=Me+ue|0,Oe=_e+pe+N(we,Me)|0;re=J,m=d,J=z,d=u,z=Z,u=c,Z=X+Re+N(c=l+Ce|0,l)|0,X=K,l=o,K=G,o=y,G=V,y=ve,V=Re+Oe+N(ve=Ce+we|0,Ce)|0}this._al=this._al+ve|0,this._bl=this._bl+y|0,this._cl=this._cl+o|0,this._dl=this._dl+l|0,this._el=this._el+c|0,this._fl=this._fl+u|0,this._gl=this._gl+d|0,this._hl=this._hl+m|0,this._ah=this._ah+V+N(this._al,ve)|0,this._bh=this._bh+G+N(this._bl,y)|0,this._ch=this._ch+K+N(this._cl,o)|0,this._dh=this._dh+X+N(this._dl,l)|0,this._eh=this._eh+Z+N(this._el,c)|0,this._fh=this._fh+z+N(this._fl,u)|0,this._gh=this._gh+J+N(this._gl,d)|0,this._hh=this._hh+re+N(this._hl,m)|0},M.prototype._hash=function(){var U=S.allocUnsafe(64);function H(V,G,K){U.writeInt32BE(V,K),U.writeInt32BE(G,K+4)}return H(this._ah,this._al,0),H(this._bh,this._bl,8),H(this._ch,this._cl,16),H(this._dh,this._dl,24),H(this._eh,this._el,32),H(this._fh,this._fl,40),H(this._gh,this._gl,48),H(this._hh,this._hl,56),U},ne.exports=M},8475:(ne,F,I)=>{"use strict";var R=I(5203),B=I(5834),S=I(7024),T=R("%TypeError%"),f=R("%WeakMap%",!0),M=R("%Map%",!0),_=B("WeakMap.prototype.get",!0),b=B("WeakMap.prototype.set",!0),C=B("WeakMap.prototype.has",!0),x=B("Map.prototype.get",!0),E=B("Map.prototype.set",!0),P=B("Map.prototype.has",!0),A=function(H,V){for(var K,G=H;null!==(K=G.next);G=K)if(K.key===V)return G.next=K.next,K.next=H.next,H.next=K,K};ne.exports=function(){var V,G,K,X={assert:function(Z){if(!X.has(Z))throw new T("Side channel does not contain "+S(Z))},get:function(Z){if(f&&Z&&("object"==typeof Z||"function"==typeof Z)){if(V)return _(V,Z)}else if(M){if(G)return x(G,Z)}else if(K)return function(H,V){var G=A(H,V);return G&&G.value}(K,Z)},has:function(Z){if(f&&Z&&("object"==typeof Z||"function"==typeof Z)){if(V)return C(V,Z)}else if(M){if(G)return P(G,Z)}else if(K)return function(H,V){return!!A(H,V)}(K,Z);return!1},set:function(Z,z){f&&Z&&("object"==typeof Z||"function"==typeof Z)?(V||(V=new f),b(V,Z,z)):M?(G||(G=new M),E(G,Z,z)):(K||(K={key:{},next:null}),function(H,V,G){var K=A(H,V);K?K.value=G:H.next={key:V,next:H.next,value:G}}(K,Z,z))}};return X}},295:(ne,F,I)=>{ne.exports=S;var R=I(9069).EventEmitter;function S(){R.call(this)}I(3894)(S,R),S.Readable=I(3154),S.Writable=I(520),S.Duplex=I(1339),S.Transform=I(6025),S.PassThrough=I(6071),S.finished=I(7542),S.pipeline=I(954),S.Stream=S,S.prototype.pipe=function(T,f){var M=this;function _(O){T.writable&&!1===T.write(O)&&M.pause&&M.pause()}function b(){M.readable&&M.resume&&M.resume()}M.on("data",_),T.on("drain",b),!T._isStdio&&(!f||!1!==f.end)&&(M.on("end",x),M.on("close",E));var C=!1;function x(){C||(C=!0,T.end())}function E(){C||(C=!0,"function"==typeof T.destroy&&T.destroy())}function P(O){if(A(),0===R.listenerCount(this,"error"))throw O}function A(){M.removeListener("data",_),T.removeListener("drain",b),M.removeListener("end",x),M.removeListener("close",E),M.removeListener("error",P),T.removeListener("error",P),M.removeListener("end",A),M.removeListener("close",A),T.removeListener("close",A)}return M.on("error",P),T.on("error",P),M.on("end",A),M.on("close",A),T.on("close",A),T.emit("pipe",M),T}},4216:(ne,F,I)=>{var R=I(3724),B=I(2359),S=I(4703),T=I(4525),f=I(8762),M=F;M.request=function(_,b){_="string"==typeof _?f.parse(_):S(_);var C=-1===global.location.protocol.search(/^https?:$/)?"http:":"",x=_.protocol||C,E=_.hostname||_.host,P=_.port,A=_.path||"/";E&&-1!==E.indexOf(":")&&(E="["+E+"]"),_.url=(E?x+"//"+E:"")+(P?":"+P:"")+A,_.method=(_.method||"GET").toUpperCase(),_.headers=_.headers||{};var O=new R(_);return b&&O.on("response",b),O},M.get=function(b,C){var x=M.request(b,C);return x.end(),x},M.ClientRequest=R,M.IncomingMessage=B.IncomingMessage,M.Agent=function(){},M.Agent.defaultMaxSockets=4,M.globalAgent=new M.Agent,M.STATUS_CODES=T,M.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"]},7976:(ne,F)=>{var I;function R(){if(void 0!==I)return I;if(global.XMLHttpRequest){I=new global.XMLHttpRequest;try{I.open("GET",global.XDomainRequest?"/":"https://example.com")}catch(T){I=null}}else I=null;return I}function B(T){var f=R();if(!f)return!1;try{return f.responseType=T,f.responseType===T}catch(M){}return!1}function S(T){return"function"==typeof T}F.fetch=S(global.fetch)&&S(global.ReadableStream),F.writableStream=S(global.WritableStream),F.abortController=S(global.AbortController),F.arraybuffer=F.fetch||B("arraybuffer"),F.msstream=!F.fetch&&B("ms-stream"),F.mozchunkedarraybuffer=!F.fetch&&B("moz-chunked-arraybuffer"),F.overrideMimeType=F.fetch||!!R()&&S(R().overrideMimeType),I=null},3724:(ne,F,I)=>{var R=I(7976),B=I(3894),S=I(2359),T=I(5685),f=S.IncomingMessage,M=S.readyStates,b=ne.exports=function(E){var P=this;T.Writable.call(P),P._opts=E,P._body=[],P._headers={},E.auth&&P.setHeader("Authorization","Basic "+Buffer.from(E.auth).toString("base64")),Object.keys(E.headers).forEach(function(N){P.setHeader(N,E.headers[N])});var A,O=!0;if("disable-fetch"===E.mode||"requestTimeout"in E&&!R.abortController)O=!1,A=!0;else if("prefer-streaming"===E.mode)A=!1;else if("allow-wrong-content-type"===E.mode)A=!R.overrideMimeType;else{if(E.mode&&"default"!==E.mode&&"prefer-fast"!==E.mode)throw new Error("Invalid value for opts.mode");A=!0}P._mode=function _(E,P){return R.fetch&&P?"fetch":R.mozchunkedarraybuffer?"moz-chunked-arraybuffer":R.msstream?"ms-stream":R.arraybuffer&&E?"arraybuffer":"text"}(A,O),P._fetchTimer=null,P._socketTimeout=null,P._socketTimer=null,P.on("finish",function(){P._onFinish()})};B(b,T.Writable),b.prototype.setHeader=function(E,P){var O=E.toLowerCase();-1===x.indexOf(O)&&(this._headers[O]={name:E,value:P})},b.prototype.getHeader=function(E){var P=this._headers[E.toLowerCase()];return P?P.value:null},b.prototype.removeHeader=function(E){delete this._headers[E.toLowerCase()]},b.prototype._onFinish=function(){var E=this;if(!E._destroyed){var P=E._opts;"timeout"in P&&0!==P.timeout&&E.setTimeout(P.timeout);var A=E._headers,O=null;"GET"!==P.method&&"HEAD"!==P.method&&(O=new Blob(E._body,{type:(A["content-type"]||{}).value||""}));var N=[];if(Object.keys(A).forEach(function(G){var K=A[G].name,X=A[G].value;Array.isArray(X)?X.forEach(function(Z){N.push([K,Z])}):N.push([K,X])}),"fetch"===E._mode){var U=null;if(R.abortController){var H=new AbortController;U=H.signal,E._fetchAbortController=H,"requestTimeout"in P&&0!==P.requestTimeout&&(E._fetchTimer=global.setTimeout(function(){E.emit("requestTimeout"),E._fetchAbortController&&E._fetchAbortController.abort()},P.requestTimeout))}global.fetch(E._opts.url,{method:E._opts.method,headers:N,body:O||void 0,mode:"cors",credentials:P.withCredentials?"include":"same-origin",signal:U}).then(function(G){E._fetchResponse=G,E._resetTimers(!1),E._connect()},function(G){E._resetTimers(!0),E._destroyed||E.emit("error",G)})}else{var V=E._xhr=new global.XMLHttpRequest;try{V.open(E._opts.method,E._opts.url,!0)}catch(G){return void process.nextTick(function(){E.emit("error",G)})}"responseType"in V&&(V.responseType=E._mode),"withCredentials"in V&&(V.withCredentials=!!P.withCredentials),"text"===E._mode&&"overrideMimeType"in V&&V.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in P&&(V.timeout=P.requestTimeout,V.ontimeout=function(){E.emit("requestTimeout")}),N.forEach(function(G){V.setRequestHeader(G[0],G[1])}),E._response=null,V.onreadystatechange=function(){switch(V.readyState){case M.LOADING:case M.DONE:E._onXHRProgress()}},"moz-chunked-arraybuffer"===E._mode&&(V.onprogress=function(){E._onXHRProgress()}),V.onerror=function(){E._destroyed||(E._resetTimers(!0),E.emit("error",new Error("XHR error")))};try{V.send(O)}catch(G){return void process.nextTick(function(){E.emit("error",G)})}}}},b.prototype._onXHRProgress=function(){var E=this;E._resetTimers(!1),function C(E){try{var P=E.status;return null!==P&&0!==P}catch(A){return!1}}(E._xhr)&&!E._destroyed&&(E._response||E._connect(),E._response._onXHRProgress(E._resetTimers.bind(E)))},b.prototype._connect=function(){var E=this;E._destroyed||(E._response=new f(E._xhr,E._fetchResponse,E._mode,E._resetTimers.bind(E)),E._response.on("error",function(P){E.emit("error",P)}),E.emit("response",E._response))},b.prototype._write=function(E,P,A){this._body.push(E),A()},b.prototype._resetTimers=function(E){var P=this;global.clearTimeout(P._socketTimer),P._socketTimer=null,E?(global.clearTimeout(P._fetchTimer),P._fetchTimer=null):P._socketTimeout&&(P._socketTimer=global.setTimeout(function(){P.emit("timeout")},P._socketTimeout))},b.prototype.abort=b.prototype.destroy=function(E){var P=this;P._destroyed=!0,P._resetTimers(!0),P._response&&(P._response._destroyed=!0),P._xhr?P._xhr.abort():P._fetchAbortController&&P._fetchAbortController.abort(),E&&P.emit("error",E)},b.prototype.end=function(E,P,A){"function"==typeof E&&(A=E,E=void 0),T.Writable.prototype.end.call(this,E,P,A)},b.prototype.setTimeout=function(E,P){var A=this;P&&A.once("timeout",P),A._socketTimeout=E,A._resetTimers(!1)},b.prototype.flushHeaders=function(){},b.prototype.setNoDelay=function(){},b.prototype.setSocketKeepAlive=function(){};var x=["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","via"]},2359:(ne,F,I)=>{var R=I(7976),B=I(3894),S=I(5685),T=F.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=F.IncomingMessage=function(M,_,b,C){var x=this;if(S.Readable.call(x),x._mode=b,x.headers={},x.rawHeaders=[],x.trailers={},x.rawTrailers=[],x.on("end",function(){process.nextTick(function(){x.emit("close")})}),"fetch"===b){let H=function(){P.read().then(function(V){if(!x._destroyed){if(C(V.done),V.done)return void x.push(null);x.push(Buffer.from(V.value)),H()}}).catch(function(V){C(!0),x._destroyed||x.emit("error",V)})};if(x._fetchResponse=_,x.url=_.url,x.statusCode=_.status,x.statusMessage=_.statusText,_.headers.forEach(function(V,G){x.headers[G.toLowerCase()]=V,x.rawHeaders.push(G,V)}),R.writableStream){var E=new WritableStream({write:function(V){return C(!1),new Promise(function(G,K){x._destroyed?K():x.push(Buffer.from(V))?G():x._resumeFetch=G})},close:function(){C(!0),x._destroyed||x.push(null)},abort:function(V){C(!0),x._destroyed||x.emit("error",V)}});try{return void _.body.pipeTo(E).catch(function(V){C(!0),x._destroyed||x.emit("error",V)})}catch(V){}}var P=_.body.getReader();H()}else if(x._xhr=M,x._pos=0,x.url=M.responseURL,x.statusCode=M.status,x.statusMessage=M.statusText,M.getAllResponseHeaders().split(/\r?\n/).forEach(function(H){var V=H.match(/^([^:]+):\s*(.*)/);if(V){var G=V[1].toLowerCase();"set-cookie"===G?(void 0===x.headers[G]&&(x.headers[G]=[]),x.headers[G].push(V[2])):void 0!==x.headers[G]?x.headers[G]+=", "+V[2]:x.headers[G]=V[2],x.rawHeaders.push(V[1],V[2])}}),x._charset="x-user-defined",!R.overrideMimeType){var O=x.rawHeaders["mime-type"];if(O){var N=O.match(/;\s*charset=([^;])(;|$)/);N&&(x._charset=N[1].toLowerCase())}x._charset||(x._charset="utf-8")}};B(f,S.Readable),f.prototype._read=function(){var _=this._resumeFetch;_&&(this._resumeFetch=null,_())},f.prototype._onXHRProgress=function(M){var _=this,b=_._xhr,C=null;switch(_._mode){case"text":if((C=b.responseText).length>_._pos){var x=C.substr(_._pos);if("x-user-defined"===_._charset){for(var E=Buffer.alloc(x.length),P=0;P_._pos&&(_.push(Buffer.from(new Uint8Array(A.result.slice(_._pos)))),_._pos=A.result.byteLength)},A.onload=function(){M(!0),_.push(null)},A.readAsArrayBuffer(C)}_._xhr.readyState===T.DONE&&"ms-stream"!==_._mode&&(M(!0),_.push(null))}},3054:(ne,F,I)=>{"use strict";var R=I(3502).Buffer,B=R.isEncoding||function(V){switch((V=""+V)&&V.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 f(V){var G;switch(this.encoding=function T(V){var G=function S(V){if(!V)return"utf8";for(var G;;)switch(V){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 V;default:if(G)return;V=(""+V).toLowerCase(),G=!0}}(V);if("string"!=typeof G&&(R.isEncoding===B||!B(V)))throw new Error("Unknown encoding: "+V);return G||V}(V),this.encoding){case"utf16le":this.text=P,this.end=A,G=4;break;case"utf8":this.fillLast=C,G=4;break;case"base64":this.text=O,this.end=N,G=3;break;default:return this.write=U,void(this.end=H)}this.lastNeed=0,this.lastTotal=0,this.lastChar=R.allocUnsafe(G)}function M(V){return V<=127?0:V>>5==6?2:V>>4==14?3:V>>3==30?4:V>>6==2?-1:-2}function C(V){var G=this.lastTotal-this.lastNeed,K=function b(V,G,K){if(128!=(192&G[0]))return V.lastNeed=0,"\ufffd";if(V.lastNeed>1&&G.length>1){if(128!=(192&G[1]))return V.lastNeed=1,"\ufffd";if(V.lastNeed>2&&G.length>2&&128!=(192&G[2]))return V.lastNeed=2,"\ufffd"}}(this,V);return void 0!==K?K:this.lastNeed<=V.length?(V.copy(this.lastChar,G,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(V.copy(this.lastChar,G,0,V.length),void(this.lastNeed-=V.length))}function P(V,G){if((V.length-G)%2==0){var K=V.toString("utf16le",G);if(K){var X=K.charCodeAt(K.length-1);if(X>=55296&&X<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=V[V.length-2],this.lastChar[1]=V[V.length-1],K.slice(0,-1)}return K}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=V[V.length-1],V.toString("utf16le",G,V.length-1)}function A(V){var G=V&&V.length?this.write(V):"";return this.lastNeed?G+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):G}function O(V,G){var K=(V.length-G)%3;return 0===K?V.toString("base64",G):(this.lastNeed=3-K,this.lastTotal=3,1===K?this.lastChar[0]=V[V.length-1]:(this.lastChar[0]=V[V.length-2],this.lastChar[1]=V[V.length-1]),V.toString("base64",G,V.length-K))}function N(V){var G=V&&V.length?this.write(V):"";return this.lastNeed?G+this.lastChar.toString("base64",0,3-this.lastNeed):G}function U(V){return V.toString(this.encoding)}function H(V){return V&&V.length?this.write(V):""}F.s=f,f.prototype.write=function(V){if(0===V.length)return"";var G,K;if(this.lastNeed){if(void 0===(G=this.fillLast(V)))return"";K=this.lastNeed,this.lastNeed=0}else K=0;return K=0?(Z>0&&(V.lastNeed=Z-1),Z):--X=0?(Z>0&&(V.lastNeed=Z-2),Z):--X=0?(Z>0&&(2===Z?Z=0:V.lastNeed=Z-3),Z):0}(this,V,G);if(!this.lastNeed)return V.toString("utf8",G);this.lastTotal=K;var X=V.length-(K-this.lastNeed);return V.copy(this.lastChar,0,X),V.toString("utf8",G,X)},f.prototype.fillLast=function(V){if(this.lastNeed<=V.length)return V.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);V.copy(this.lastChar,this.lastTotal-this.lastNeed,0,V.length),this.lastNeed-=V.length}},8517:ne=>{ne.exports=function(I){return ArrayBuffer.isView(I)?Buffer.from(I.buffer,I.byteOffset,I.byteLength):Buffer.from(I)}},1308:function(ne,F,I){var R;ne=I.nmd(ne),function(B){"object"==typeof global&&global;var M,_=2147483647,b=36,U=/^xn--/,H=/[^\x20-\x7E]/,V=/[\x2E\u3002\uFF0E\uFF61]/g,G={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=Math.floor,Z=String.fromCharCode;function J(s){throw new RangeError(G[s])}function re(s,g){for(var $=s.length,k=[];$--;)k[$]=g(s[$]);return k}function ve(s,g){var $=s.split("@"),k="";return $.length>1&&(k=$[0]+"@",s=$[1]),k+re((s=s.replace(V,".")).split("."),g).join(".")}function y(s){for(var q,he,g=[],$=0,k=s.length;$=55296&&q<=56319&&$65535&&($+=Z((g-=65536)>>>10&1023|55296),g=56320|1023&g),$+Z(g)}).join("")}function l(s){return s-48<10?s-22:s-65<26?s-65:s-97<26?s-97:b}function c(s,g){return s+22+75*(s<26)-((0!=g)<<5)}function u(s,g,$){var k=0;for(s=$?X(s/700):s>>1,s+=X(s/g);s>455;k+=b)s=X(s/35);return X(k+36*s/(s+38))}function d(s){var k,ge,fe,se,ce,ee,pe,ue,_e,Me,g=[],$=s.length,q=0,he=128,be=72;for((ge=s.lastIndexOf("-"))<0&&(ge=0),fe=0;fe=128&&J("not-basic"),g.push(s.charCodeAt(fe));for(se=ge>0?ge+1:0;se<$;){for(ce=q,ee=1,pe=b;se>=$&&J("invalid-input"),((ue=l(s.charCodeAt(se++)))>=b||ue>X((_-q)/ee))&&J("overflow"),q+=ue*ee,!(ue<(_e=pe<=be?1:pe>=be+26?26:pe-be));pe+=b)ee>X(_/(Me=b-_e))&&J("overflow"),ee*=Me;be=u(q-ce,k=g.length+1,0==ce),X(q/k)>_-he&&J("overflow"),he+=X(q/k),q%=k,g.splice(q++,0,he)}return o(g)}function m(s){var g,$,k,q,he,be,ge,fe,se,ce,ee,ue,_e,Me,le,pe=[];for(ue=(s=y(s)).length,g=128,$=0,he=72,be=0;be=g&&eeX((_-$)/(_e=k+1))&&J("overflow"),$+=(ge-g)*_e,g=ge,be=0;be_&&J("overflow"),ee==g){for(fe=$,se=b;!(fe<(ce=se<=he?1:se>=he+26?26:se-he));se+=b)pe.push(Z(c(ce+(le=fe-ce)%(Me=b-ce),0))),fe=X(le/Me);pe.push(Z(c(fe,0))),he=u($,_e,k==q),$=0,++k}++$,++g}return pe.join("")}M={version:"1.4.1",ucs2:{decode:y,encode:o},decode:d,encode:m,toASCII:function p(s){return ve(s,function(g){return H.test(g)?"xn--"+m(g):g})},toUnicode:function w(s){return ve(s,function(g){return U.test(g)?d(g.slice(4).toLowerCase()):g})}},void 0!==(R=function(){return M}.call(F,I,F,ne))&&(ne.exports=R)}()},4277:ne=>{"use strict";var F=String.prototype.replace,I=/%20/g;ne.exports={default:"RFC3986",formatters:{RFC1738:function(B){return F.call(B,I,"+")},RFC3986:function(B){return String(B)}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},8011:(ne,F,I)=>{"use strict";var R=I(902),B=I(6830),S=I(4277);ne.exports={formats:S,parse:B,stringify:R}},6830:(ne,F,I)=>{"use strict";var R=I(3295),B=Object.prototype.hasOwnProperty,S=Array.isArray,T={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:R.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},M=function(A,O){return A&&"string"==typeof A&&O.comma&&A.indexOf(",")>-1?A.split(","):A},E=function(O,N,U,H){if(O){var V=U.allowDots?O.replace(/\.([^.[]+)/g,"[$1]"):O,K=/(\[[^[\]]*])/g,X=U.depth>0&&/(\[[^[\]]*])/.exec(V),Z=X?V.slice(0,X.index):V,z=[];if(Z){if(!U.plainObjects&&B.call(Object.prototype,Z)&&!U.allowPrototypes)return;z.push(Z)}for(var J=0;U.depth>0&&null!==(X=K.exec(V))&&J=0;--V){var G,K=A[V];if("[]"===K&&N.parseArrays)G=[].concat(H);else{G=N.plainObjects?Object.create(null):{};var X="["===K.charAt(0)&&"]"===K.charAt(K.length-1)?K.slice(1,-1):K,Z=parseInt(X,10);N.parseArrays||""!==X?!isNaN(Z)&&K!==X&&String(Z)===X&&Z>=0&&N.parseArrays&&Z<=N.arrayLimit?(G=[])[Z]=H:"__proto__"!==X&&(G[X]=H):G={0:H}}H=G}return H}(z,N,U,H)}};ne.exports=function(A,O){var N=function(O){if(!O)return T;if(null!=O.decoder&&"function"!=typeof O.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==O.charset&&"utf-8"!==O.charset&&"iso-8859-1"!==O.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");return{allowDots:void 0===O.allowDots?T.allowDots:!!O.allowDots,allowPrototypes:"boolean"==typeof O.allowPrototypes?O.allowPrototypes:T.allowPrototypes,allowSparse:"boolean"==typeof O.allowSparse?O.allowSparse:T.allowSparse,arrayLimit:"number"==typeof O.arrayLimit?O.arrayLimit:T.arrayLimit,charset:void 0===O.charset?T.charset:O.charset,charsetSentinel:"boolean"==typeof O.charsetSentinel?O.charsetSentinel:T.charsetSentinel,comma:"boolean"==typeof O.comma?O.comma:T.comma,decoder:"function"==typeof O.decoder?O.decoder:T.decoder,delimiter:"string"==typeof O.delimiter||R.isRegExp(O.delimiter)?O.delimiter:T.delimiter,depth:"number"==typeof O.depth||!1===O.depth?+O.depth:T.depth,ignoreQueryPrefix:!0===O.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof O.interpretNumericEntities?O.interpretNumericEntities:T.interpretNumericEntities,parameterLimit:"number"==typeof O.parameterLimit?O.parameterLimit:T.parameterLimit,parseArrays:!1!==O.parseArrays,plainObjects:"boolean"==typeof O.plainObjects?O.plainObjects:T.plainObjects,strictNullHandling:"boolean"==typeof O.strictNullHandling?O.strictNullHandling:T.strictNullHandling}}(O);if(""===A||null==A)return N.plainObjects?Object.create(null):{};for(var U="string"==typeof A?function(O,N){var X,U={__proto__:null},G=(N.ignoreQueryPrefix?O.replace(/^\?/,""):O).split(N.delimiter,N.parameterLimit===1/0?void 0:N.parameterLimit),K=-1,Z=N.charset;if(N.charsetSentinel)for(X=0;X{"use strict";var R=I(8475),B=I(3295),S=I(4277),T=Object.prototype.hasOwnProperty,f={brackets:function(H){return H+"[]"},comma:"comma",indices:function(H,V){return H+"["+V+"]"},repeat:function(H){return H}},M=Array.isArray,_=Array.prototype.push,b=function(U,H){_.apply(U,M(H)?H:[H])},C=Date.prototype.toISOString,x=S.default,E={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:B.encode,encodeValuesOnly:!1,format:x,formatter:S.formatters[x],indices:!1,serializeDate:function(H){return C.call(H)},skipNulls:!1,strictNullHandling:!1},A={},O=function U(H,V,G,K,X,Z,z,J,re,ve,y,o,l,c,u,d){for(var m=H,w=d,p=0,s=!1;void 0!==(w=w.get(A))&&!s;){var g=w.get(H);if(p+=1,void 0!==g){if(g===p)throw new RangeError("Cyclic object value");s=!0}void 0===w.get(A)&&(p=0)}if("function"==typeof J?m=J(V,m):m instanceof Date?m=y(m):"comma"===G&&M(m)&&(m=B.maybeMap(m,function(pe){return pe instanceof Date?y(pe):pe})),null===m){if(X)return z&&!c?z(V,E.encoder,u,"key",o):V;m=""}if(function(H){return"string"==typeof H||"number"==typeof H||"boolean"==typeof H||"symbol"==typeof H||"bigint"==typeof H}(m)||B.isBuffer(m))return z?[l(c?V:z(V,E.encoder,u,"key",o))+"="+l(z(m,E.encoder,u,"value",o))]:[l(V)+"="+l(String(m))];var q,k=[];if(void 0===m)return k;if("comma"===G&&M(m))c&&z&&(m=B.maybeMap(m,z)),q=[{value:m.length>0?m.join(",")||null:void 0}];else if(M(J))q=J;else{var he=Object.keys(m);q=re?he.sort(re):he}for(var be=K&&M(m)&&1===m.length?V+"[]":V,ge=0;ge0?c+l:""}},3295:(ne,F,I)=>{"use strict";var R=I(4277),B=Object.prototype.hasOwnProperty,S=Array.isArray,T=function(){for(var U=[],H=0;H<256;++H)U.push("%"+((H<16?"0":"")+H.toString(16)).toUpperCase());return U}(),M=function(H,V){for(var G=V&&V.plainObjects?Object.create(null):{},K=0;K1;){var V=H.pop(),G=V.obj[V.prop];if(S(G)){for(var K=[],X=0;X=48&&re<=57||re>=65&&re<=90||re>=97&&re<=122||X===R.RFC1738&&(40===re||41===re)?z+=Z.charAt(J):re<128?z+=T[re]:re<2048?z+=T[192|re>>6]+T[128|63&re]:re<55296||re>=57344?z+=T[224|re>>12]+T[128|re>>6&63]+T[128|63&re]:(re=65536+((1023&re)<<10|1023&Z.charCodeAt(J+=1)),z+=T[240|re>>18]+T[128|re>>12&63]+T[128|re>>6&63]+T[128|63&re])}return z},isBuffer:function(H){return!(!H||"object"!=typeof H||!(H.constructor&&H.constructor.isBuffer&&H.constructor.isBuffer(H)))},isRegExp:function(H){return"[object RegExp]"===Object.prototype.toString.call(H)},maybeMap:function(H,V){if(S(H)){for(var G=[],K=0;K{"use strict";var R=I(1308);function B(){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 S=/^([a-z0-9.+-]+:)/i,T=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,_=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),b=["'"].concat(_),C=["%","/","?",";","#"].concat(b),x=["/","?","#"],P=/^[+a-z0-9A-Z_-]{0,63}$/,A=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},N={javascript:!0,"javascript:":!0},U={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=I(8011);function V(Z,z,J){if(Z&&"object"==typeof Z&&Z instanceof B)return Z;var re=new B;return re.parse(Z,z,J),re}B.prototype.parse=function(Z,z,J){if("string"!=typeof Z)throw new TypeError("Parameter 'url' must be a string, not "+typeof Z);var re=Z.indexOf("?"),ve=-1!==re&&re127?ge+="x":ge+=be[fe];if(!ge.match(P)){var ce=q.slice(0,p),ee=q.slice(p+1),pe=be.match(A);pe&&(ce.push(pe[1]),ee.unshift(pe[2])),ee.length&&(l="/"+ee.join(".")+l),this.hostname=ce.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),k||(this.hostname=R.toASCII(this.hostname)),this.host=(this.hostname||"")+(this.port?":"+this.port:""),this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==l[0]&&(l="/"+l))}if(!O[d])for(p=0,he=b.length;p0)&&J.host.split("@"))&&(J.auth=ge.shift(),J.hostname=ge.shift(),J.host=J.hostname)),J.search=Z.search,J.query=Z.query,(null!==J.pathname||null!==J.search)&&(J.path=(J.pathname?J.pathname:"")+(J.search?J.search:"")),J.href=J.format(),J;if(!q.length)return J.pathname=null,J.path=J.search?"/"+J.search:null,J.href=J.format(),J;for(var fe=q.slice(-1)[0],se=(J.host||Z.host||q.length>1)&&("."===fe||".."===fe)||""===fe,ce=0,ee=q.length;ee>=0;ee--)"."===(fe=q[ee])?q.splice(ee,1):".."===fe?(q.splice(ee,1),ce++):ce&&(q.splice(ee,1),ce--);if(!$&&!k)for(;ce--;ce)q.unshift("..");$&&""!==q[0]&&(!q[0]||"/"!==q[0].charAt(0))&&q.unshift(""),se&&"/"!==q.join("/").substr(-1)&&q.push("");var ge,pe=""===q[0]||q[0]&&"/"===q[0].charAt(0);return be&&(J.hostname=pe?"":q.length?q.shift():"",J.host=J.hostname,(ge=!!(J.host&&J.host.indexOf("@")>0)&&J.host.split("@"))&&(J.auth=ge.shift(),J.hostname=ge.shift(),J.host=J.hostname)),($=$||J.host&&q.length)&&!pe&&q.unshift(""),q.length>0?J.pathname=q.join("/"):(J.pathname=null,J.path=null),(null!==J.pathname||null!==J.search)&&(J.path=(J.pathname?J.pathname:"")+(J.search?J.search:"")),J.auth=Z.auth||J.auth,J.slashes=J.slashes||Z.slashes,J.href=J.format(),J},B.prototype.parseHost=function(){var Z=this.host,z=T.exec(Z);z&&(":"!==(z=z[0])&&(this.port=z.substr(1)),Z=Z.substr(0,Z.length-z.length)),Z&&(this.hostname=Z)},F.parse=V,F.resolve=function K(Z,z){return V(Z,!1,!0).resolve(z)},F.resolveObject=function X(Z,z){return Z?V(Z,!1,!0).resolveObject(z):z},F.format=function G(Z){return"string"==typeof Z&&(Z=V(Z)),Z instanceof B?Z.format():B.prototype.format.call(Z)},F.Url=B},3532:ne=>{function I(R){try{if(!global.localStorage)return!1}catch(S){return!1}var B=global.localStorage[R];return null!=B&&"true"===String(B).toLowerCase()}ne.exports=function F(R,B){if(I("noDeprecation"))return R;var S=!1;return function T(){if(!S){if(I("throwDeprecation"))throw new Error(B);I("traceDeprecation")?console.trace(B):console.warn(B),S=!0}return R.apply(this,arguments)}}},1451:ne=>{ne.exports=function(I){return I&&"object"==typeof I&&"function"==typeof I.copy&&"function"==typeof I.fill&&"function"==typeof I.readUInt8}},8791:(ne,F,I)=>{"use strict";var R=I(3407),B=I(110),S=I(2031),T=I(597);function f(ae){return ae.call.bind(ae)}var M="undefined"!=typeof BigInt,_="undefined"!=typeof Symbol,b=f(Object.prototype.toString),C=f(Number.prototype.valueOf),x=f(String.prototype.valueOf),E=f(Boolean.prototype.valueOf);if(M)var P=f(BigInt.prototype.valueOf);if(_)var A=f(Symbol.prototype.valueOf);function O(ae,Le){if("object"!=typeof ae)return!1;try{return Le(ae),!0}catch(xe){return!1}}function o(ae){return"[object Map]"===b(ae)}function c(ae){return"[object Set]"===b(ae)}function d(ae){return"[object WeakMap]"===b(ae)}function w(ae){return"[object WeakSet]"===b(ae)}function s(ae){return"[object ArrayBuffer]"===b(ae)}function g(ae){return"undefined"!=typeof ArrayBuffer&&(s.working?s(ae):ae instanceof ArrayBuffer)}function $(ae){return"[object DataView]"===b(ae)}function k(ae){return"undefined"!=typeof DataView&&($.working?$(ae):ae instanceof DataView)}F.isArgumentsObject=R,F.isGeneratorFunction=B,F.isTypedArray=T,F.isPromise=function N(ae){return"undefined"!=typeof Promise&&ae instanceof Promise||null!==ae&&"object"==typeof ae&&"function"==typeof ae.then&&"function"==typeof ae.catch},F.isArrayBufferView=function U(ae){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(ae):T(ae)||k(ae)},F.isUint8Array=function H(ae){return"Uint8Array"===S(ae)},F.isUint8ClampedArray=function V(ae){return"Uint8ClampedArray"===S(ae)},F.isUint16Array=function G(ae){return"Uint16Array"===S(ae)},F.isUint32Array=function K(ae){return"Uint32Array"===S(ae)},F.isInt8Array=function X(ae){return"Int8Array"===S(ae)},F.isInt16Array=function Z(ae){return"Int16Array"===S(ae)},F.isInt32Array=function z(ae){return"Int32Array"===S(ae)},F.isFloat32Array=function J(ae){return"Float32Array"===S(ae)},F.isFloat64Array=function re(ae){return"Float64Array"===S(ae)},F.isBigInt64Array=function ve(ae){return"BigInt64Array"===S(ae)},F.isBigUint64Array=function y(ae){return"BigUint64Array"===S(ae)},o.working="undefined"!=typeof Map&&o(new Map),F.isMap=function l(ae){return"undefined"!=typeof Map&&(o.working?o(ae):ae instanceof Map)},c.working="undefined"!=typeof Set&&c(new Set),F.isSet=function u(ae){return"undefined"!=typeof Set&&(c.working?c(ae):ae instanceof Set)},d.working="undefined"!=typeof WeakMap&&d(new WeakMap),F.isWeakMap=function m(ae){return"undefined"!=typeof WeakMap&&(d.working?d(ae):ae instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),F.isWeakSet=function p(ae){return w(ae)},s.working="undefined"!=typeof ArrayBuffer&&s(new ArrayBuffer),F.isArrayBuffer=g,$.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&$(new DataView(new ArrayBuffer(1),0,1)),F.isDataView=k;var q="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function he(ae){return"[object SharedArrayBuffer]"===b(ae)}function be(ae){return void 0!==q&&(void 0===he.working&&(he.working=he(new q)),he.working?he(ae):ae instanceof q)}function pe(ae){return O(ae,C)}function ue(ae){return O(ae,x)}function _e(ae){return O(ae,E)}function Me(ae){return M&&O(ae,P)}function le(ae){return _&&O(ae,A)}F.isSharedArrayBuffer=be,F.isAsyncFunction=function ge(ae){return"[object AsyncFunction]"===b(ae)},F.isMapIterator=function fe(ae){return"[object Map Iterator]"===b(ae)},F.isSetIterator=function se(ae){return"[object Set Iterator]"===b(ae)},F.isGeneratorObject=function ce(ae){return"[object Generator]"===b(ae)},F.isWebAssemblyCompiledModule=function ee(ae){return"[object WebAssembly.Module]"===b(ae)},F.isNumberObject=pe,F.isStringObject=ue,F.isBooleanObject=_e,F.isBigIntObject=Me,F.isSymbolObject=le,F.isBoxedPrimitive=function ie(ae){return pe(ae)||ue(ae)||_e(ae)||Me(ae)||le(ae)},F.isAnyArrayBuffer=function Y(ae){return"undefined"!=typeof Uint8Array&&(g(ae)||be(ae))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ae){Object.defineProperty(F,ae,{enumerable:!1,value:function(){throw new Error(ae+" is not supported in userland")}})})},6788:(ne,F,I)=>{var R=Object.getOwnPropertyDescriptors||function(k){for(var q=Object.keys(k),he={},be=0;be=be)return se;switch(se){case"%s":return String(he[q++]);case"%d":return Number(he[q++]);case"%j":try{return JSON.stringify(he[q++])}catch(ce){return"[Circular]"}default:return se}}),fe=he[q];q=3&&(q.depth=arguments[2]),arguments.length>=4&&(q.colors=arguments[3]),H(k)?q.showHidden=k:k&&F._extend(q,k),z(q.showHidden)&&(q.showHidden=!1),z(q.depth)&&(q.depth=2),z(q.colors)&&(q.colors=!1),z(q.customInspect)&&(q.customInspect=!0),q.colors&&(q.stylize=_),x(q,$,q.depth)}function _($,k){var q=M.styles[k];return q?"\x1b["+M.colors[q][0]+"m"+$+"\x1b["+M.colors[q][1]+"m":$}function b($,k){return $}function x($,k,q){if($.customInspect&&k&&o(k.inspect)&&k.inspect!==F.inspect&&(!k.constructor||k.constructor.prototype!==k)){var he=k.inspect(q,$);return X(he)||(he=x($,he,q)),he}var be=function E($,k){if(z(k))return $.stylize("undefined","undefined");if(X(k)){var q="'"+JSON.stringify(k).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(q,"string")}return K(k)?$.stylize(""+k,"number"):H(k)?$.stylize(""+k,"boolean"):V(k)?$.stylize("null","null"):void 0}($,k);if(be)return be;var ge=Object.keys(k),fe=function C($){var k={};return $.forEach(function(q,he){k[q]=!0}),k}(ge);if($.showHidden&&(ge=Object.getOwnPropertyNames(k)),y(k)&&(ge.indexOf("message")>=0||ge.indexOf("description")>=0))return P(k);if(0===ge.length){if(o(k))return $.stylize("[Function"+(k.name?": "+k.name:"")+"]","special");if(J(k))return $.stylize(RegExp.prototype.toString.call(k),"regexp");if(ve(k))return $.stylize(Date.prototype.toString.call(k),"date");if(y(k))return P(k)}var _e,ce="",ee=!1,pe=["{","}"];return U(k)&&(ee=!0,pe=["[","]"]),o(k)&&(ce=" [Function"+(k.name?": "+k.name:"")+"]"),J(k)&&(ce=" "+RegExp.prototype.toString.call(k)),ve(k)&&(ce=" "+Date.prototype.toUTCString.call(k)),y(k)&&(ce=" "+P(k)),0!==ge.length||ee&&0!=k.length?q<0?J(k)?$.stylize(RegExp.prototype.toString.call(k),"regexp"):$.stylize("[Object]","special"):($.seen.push(k),_e=ee?function A($,k,q,he,be){for(var ge=[],fe=0,se=k.length;fe60?q[0]+(""===k?"":k+"\n ")+" "+$.join(",\n ")+" "+q[1]:q[0]+k+" "+$.join(", ")+" "+q[1]}(_e,ce,pe)):pe[0]+ce+pe[1]}function P($){return"["+Error.prototype.toString.call($)+"]"}function O($,k,q,he,be,ge){var fe,se,ce;if((ce=Object.getOwnPropertyDescriptor(k,be)||{value:k[be]}).get?se=$.stylize(ce.set?"[Getter/Setter]":"[Getter]","special"):ce.set&&(se=$.stylize("[Setter]","special")),w(he,be)||(fe="["+be+"]"),se||($.seen.indexOf(ce.value)<0?(se=V(q)?x($,ce.value,null):x($,ce.value,q-1)).indexOf("\n")>-1&&(se=ge?se.split("\n").map(function(ee){return" "+ee}).join("\n").substr(2):"\n"+se.split("\n").map(function(ee){return" "+ee}).join("\n")):se=$.stylize("[Circular]","special")),z(fe)){if(ge&&be.match(/^\d+$/))return se;(fe=JSON.stringify(""+be)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(fe=fe.substr(1,fe.length-2),fe=$.stylize(fe,"name")):(fe=fe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),fe=$.stylize(fe,"string"))}return fe+": "+se}function U($){return Array.isArray($)}function H($){return"boolean"==typeof $}function V($){return null===$}function K($){return"number"==typeof $}function X($){return"string"==typeof $}function z($){return void 0===$}function J($){return re($)&&"[object RegExp]"===c($)}function re($){return"object"==typeof $&&null!==$}function ve($){return re($)&&"[object Date]"===c($)}function y($){return re($)&&("[object Error]"===c($)||$ instanceof Error)}function o($){return"function"==typeof $}function c($){return Object.prototype.toString.call($)}function u($){return $<10?"0"+$.toString(10):$.toString(10)}F.debuglog=function($){if($=$.toUpperCase(),!S[$])if(T.test($)){var k=process.pid;S[$]=function(){var q=F.format.apply(F,arguments);console.error("%s %d: %s",$,k,q)}}else S[$]=function(){};return S[$]},F.inspect=M,M.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]},M.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},F.types=I(8791),F.isArray=U,F.isBoolean=H,F.isNull=V,F.isNullOrUndefined=function G($){return null==$},F.isNumber=K,F.isString=X,F.isSymbol=function Z($){return"symbol"==typeof $},F.isUndefined=z,F.isRegExp=J,F.types.isRegExp=J,F.isObject=re,F.isDate=ve,F.types.isDate=ve,F.isError=y,F.types.isNativeError=y,F.isFunction=o,F.isPrimitive=function l($){return null===$||"boolean"==typeof $||"number"==typeof $||"string"==typeof $||"symbol"==typeof $||void 0===$},F.isBuffer=I(1451);var d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(){var $=new Date,k=[u($.getHours()),u($.getMinutes()),u($.getSeconds())].join(":");return[$.getDate(),d[$.getMonth()],k].join(" ")}function w($,k){return Object.prototype.hasOwnProperty.call($,k)}F.log=function(){console.log("%s - %s",m(),F.format.apply(F,arguments))},F.inherits=I(3894),F._extend=function($,k){if(!k||!re(k))return $;for(var q=Object.keys(k),he=q.length;he--;)$[q[he]]=k[q[he]];return $};var p="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function s($,k){if(!$){var q=new Error("Promise was rejected with a falsy value");q.reason=$,$=q}return k($)}F.promisify=function(k){if("function"!=typeof k)throw new TypeError('The "original" argument must be of type Function');if(p&&k[p]){var q;if("function"!=typeof(q=k[p]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(q,p,{value:q,enumerable:!1,writable:!1,configurable:!0}),q}function q(){for(var he,be,ge=new Promise(function(ce,ee){he=ce,be=ee}),fe=[],se=0;se{"use strict";var R=I(9076),B=I(7029),S=I(5834),T=S("Object.prototype.toString"),M=I(2969)()&&"symbol"==typeof Symbol.toStringTag,_=B(),b=S("String.prototype.slice"),C={},x=I(8555),E=Object.getPrototypeOf;M&&x&&E&&R(_,function(O){if("function"==typeof global[O]){var N=new global[O];if(!(Symbol.toStringTag in N))throw new EvalError("this engine has support for Symbol.toStringTag, but "+O+" does not have the property! Please report this.");var U=E(N),H=x(U,Symbol.toStringTag);if(!H){var V=E(U);H=x(V,Symbol.toStringTag)}C[O]=H.get}});var A=I(597);ne.exports=function(N){return!!A(N)&&(M?function(N){var U=!1;return R(C,function(H,V){if(!U)try{var G=H.call(N);G===V&&(U=G)}catch(K){}}),U}(N):b(T(N),8,-1))}},8930:function(ne,F){"use strict";var f,I=this&&this.__extends||(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,_){M.__proto__=_}||function(M,_){for(var b in _)_.hasOwnProperty(b)&&(M[b]=_[b])},function(M,_){function b(){this.constructor=M}f(M,_),M.prototype=null===_?Object.create(_):(b.prototype=_.prototype,new b)});Object.defineProperty(F,"__esModule",{value:!0});var R=function(f){function M(){return null!==f&&f.apply(this,arguments)||this}return I(M,f),M}(Error);F.SecurityError=R;var B=function(f){function M(){return null!==f&&f.apply(this,arguments)||this}return I(M,f),M}(Error);F.InvalidStateError=B;var S=function(f){function M(){return null!==f&&f.apply(this,arguments)||this}return I(M,f),M}(Error);F.NetworkError=S;var T=function(f){function M(){return null!==f&&f.apply(this,arguments)||this}return I(M,f),M}(Error);F.SyntaxError=T},2015:(ne,F,I)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),function R(S){for(var T in S)F.hasOwnProperty(T)||(F[T]=S[T])}(I(8223));var B=I(2747);F.XMLHttpRequestEventTarget=B.XMLHttpRequestEventTarget},8717:(ne,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ProgressEvent=function R(B){this.type=B,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0}},2747:(ne,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var I=function(){function R(){this.listeners={}}return R.prototype.addEventListener=function(B,S){B=B.toLowerCase(),this.listeners[B]=this.listeners[B]||[],this.listeners[B].push(S.handleEvent||S)},R.prototype.removeEventListener=function(B,S){if(B=B.toLowerCase(),this.listeners[B]){var T=this.listeners[B].indexOf(S.handleEvent||S);T<0||this.listeners[B].splice(T,1)}},R.prototype.dispatchEvent=function(B){var S=B.type.toLowerCase();if(B.target=this,this.listeners[S])for(var T=0,f=this.listeners[S];T=0)return this._url=this._parseUrl(U.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=U,this._response.on("data",function(G){return H._onHttpResponseData(U,G)}),this._response.on("end",function(){return H._onHttpResponseEnd(U)}),this._response.on("close",function(){return H._onHttpResponseClose(U)}),this.responseUrl=this._url.href.split("#")[0],this.status=U.statusCode,this.statusText=S.STATUS_CODES[this.status],this._parseResponseHeaders(U);var V=this._responseHeaders["content-length"]||"";this._totalBytes=+V,this._lengthComputable=!!V,this._setReadyState(O.HEADERS_RECEIVED)}},O.prototype._onHttpResponseData=function(N,U){this._response===N&&(this._responseParts.push(new Buffer(U)),this._loadedBytes+=U.length,this.readyState!==O.LOADING&&this._setReadyState(O.LOADING),this._dispatchProgress("progress"))},O.prototype._onHttpResponseEnd=function(N){this._response===N&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(O.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},O.prototype._onHttpResponseClose=function(N){if(this._response===N){var U=this._request;this._setError(),U.abort(),this._setReadyState(O.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},O.prototype._onHttpTimeout=function(N){this._request===N&&(this._setError(),N.abort(),this._setReadyState(O.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},O.prototype._onHttpRequestError=function(N,U){this._request===N&&(this._setError(),N.abort(),this._setReadyState(O.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},O.prototype._dispatchProgress=function(N){var U=new O.ProgressEvent(N);U.lengthComputable=this._lengthComputable,U.loaded=this._loadedBytes,U.total=this._totalBytes,this.dispatchEvent(U)},O.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},O.prototype._parseUrl=function(N,U,H){var V=null==this.nodejsBaseUrl?N:M.resolve(this.nodejsBaseUrl,N),G=M.parse(V,!1,!0);G.hash=null;var K=(G.auth||"").split(":"),X=K[0],Z=K[1];return(X||Z||U||H)&&(G.auth=(U||X||"")+":"+(H||Z||"")),G},O.prototype._parseResponseHeaders=function(N){for(var U in this._responseHeaders={},N.headers){var H=U.toLowerCase();this._privateHeaders[H]||(this._responseHeaders[H]=N.headers[U])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},O.prototype._parseResponse=function(){var N=Buffer.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(N.toString("utf-8"))}catch(G){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=N);case"arraybuffer":this.responseText=null;for(var U=new ArrayBuffer(N.length),H=new Uint8Array(U),V=0;V{ne.exports=function I(){for(var R={},B=0;B{},6601:()=>{},8623:()=>{},7748:()=>{},5568:()=>{},6619:()=>{},4654:()=>{},7108:()=>{},7029:ne=>{"use strict";var F=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];ne.exports=function(){for(var R=[],B=0;B{"use strict";var B=I(5203)("%Object.getOwnPropertyDescriptor%");if(B)try{B([],"length")}catch(S){B=null}ne.exports=B},4946:ne=>{"use strict";ne.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},5207:ne=>{"use strict";ne.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},7036:ne=>{"use strict";ne.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},9799:ne=>{"use strict";ne.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},8597:ne=>{"use strict";ne.exports={i8:"6.5.4"}},2562:ne=>{"use strict";ne.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},ne=>{ne(ne.s=3581)}]); \ No newline at end of file