diff --git a/.prettierrc b/.prettierrc index 99285d2..5f4511a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { - "useTabs": false, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100 -} \ No newline at end of file + "useTabs": false, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100 +} diff --git a/README.md b/README.md index d5361e9..2d8bd39 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ As a normal user, Download the package either from [Release](https://github.com/snowypowers/ansy/releases) or the ZIP button. -Extract the zip and open `public/index.html` using your browser. +Extract the zip and open `docs/index.html` using your browser. ## License diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/docs/_app/assets/bg-63a55bea.svg b/docs/_app/assets/bg-63a55bea.svg new file mode 100644 index 0000000..bd2f1a9 --- /dev/null +++ b/docs/_app/assets/bg-63a55bea.svg @@ -0,0 +1,34 @@ + + + N3 Logo + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_app/assets/pages/__layout.svelte-ce1d98e9.css b/docs/_app/assets/pages/__layout.svelte-ce1d98e9.css new file mode 100644 index 0000000..63af363 --- /dev/null +++ b/docs/_app/assets/pages/__layout.svelte-ce1d98e9.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity));--tw-blur: var(--tw-empty, );--tw-brightness: var(--tw-empty, );--tw-contrast: var(--tw-empty, );--tw-grayscale: var(--tw-empty, );--tw-hue-rotate: var(--tw-empty, );--tw-invert: var(--tw-empty, );--tw-saturate: var(--tw-empty, );--tw-sepia: var(--tw-empty, );--tw-drop-shadow: var(--tw-empty, );--tw-filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.m-1{margin:.25rem}.m-2{margin:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mb-10{margin-bottom:2.5rem}.mt-12{margin-top:3rem}.flex{display:flex}.hidden{display:none}.w-3\/4{width:75%}.w-1\/4{width:25%}.w-full{width:100%}.w-3\/5{width:60%}.max-w-prose{max-width:65ch}.flex-none{flex:none}.grow{flex-grow:1}.list-none{list-style-type:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.justify-items-center{justify-items:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.break-all{word-break:break-all}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.rounded{border-radius:.25rem}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.border-2{border-width:2px}.border{border-width:1px}.border-b-2{border-bottom-width:2px}.border-t-0{border-top-width:0px}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-opacity-25{--tw-bg-opacity: .25}.p-1{padding:.25rem}.p-5{padding:1.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-4{padding-left:1rem;padding-right:1rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-xs{font-size:.75rem;line-height:1rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-7xl{font-size:4.5rem;line-height:1}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity))}.filter{filter:var(--tw-filter)}body{display:flex;min-height:100vh;flex-direction:column;background-image:url(/ansy/_app/assets/bg-63a55bea.svg);background-repeat:repeat;background-size:256px 256px}@media print{.wallet-page{width:210mm;page-break-after:always}.ribbon,#splash,#form,#print-foot,#foot,.no-print{display:none}}.hover\:border-green-800:hover{--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity))}.focus\:border-green-500:focus{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}@media print{.print\:hidden{display:none}}@media (min-width: 640px){.sm\:mt-6{margin-top:1.5rem}}@media (min-width: 768px){.md\:w-1\/2{width:50%}} diff --git a/docs/_app/assets/pages/index.svelte-30900ca9.css b/docs/_app/assets/pages/index.svelte-30900ca9.css new file mode 100644 index 0000000..0c23b92 --- /dev/null +++ b/docs/_app/assets/pages/index.svelte-30900ca9.css @@ -0,0 +1 @@ +.qr.svelte-o6csz1{width:120px;height:120px;margin:0 auto}div.svelte-1v0gr5y{width:89mm;height:51mm}li.svelte-vpfy36.svelte-vpfy36{margin-bottom:-1px}span.svelte-vpfy36.svelte-vpfy36{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem;display:block;padding:.5rem 1rem;cursor:pointer}span.svelte-vpfy36.svelte-vpfy36:hover{border-color:#e9ecef #e9ecef #dee2e6}li.active.svelte-vpfy36>span.svelte-vpfy36{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff} diff --git a/docs/_app/assets/start-d5b4de3e.css b/docs/_app/assets/start-d5b4de3e.css new file mode 100644 index 0000000..f777c52 --- /dev/null +++ b/docs/_app/assets/start-d5b4de3e.css @@ -0,0 +1 @@ +#svelte-announcer.svelte-1j55zn5{position:absolute;left:0;top:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);overflow:hidden;white-space:nowrap;width:1px;height:1px} diff --git a/docs/_app/chunks/vendor-44ba3db2.js b/docs/_app/chunks/vendor-44ba3db2.js new file mode 100644 index 0000000..d2d9938 --- /dev/null +++ b/docs/_app/chunks/vendor-44ba3db2.js @@ -0,0 +1,26 @@ +function Ur(){}function If(e,t){for(const r in t)e[r]=t[r];return e}function vn(e){return e()}function pn(){return Object.create(null)}function s0(e){e.forEach(vn)}function Pf(e){return typeof e=="function"}function Nf(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let w0;function sl(e,t){return w0||(w0=document.createElement("a")),w0.href=t,e===w0.href}function Uf(e){return Object.keys(e).length===0}function Df(e,...t){if(e==null)return Ur;const r=e.subscribe(...t);return r.unsubscribe?()=>r.unsubscribe():r}function fl(e,t,r){e.$$.on_destroy.push(Df(t,r))}function ol(e,t,r,i){if(e){const f=xn(e,t,r,i);return e[0](f)}}function xn(e,t,r,i){return e[1]&&i?If(r.ctx.slice(),e[1](i(t))):r.ctx}function al(e,t,r,i){if(e[2]&&i){const f=e[2](i(r));if(t.dirty===void 0)return f;if(typeof f=="object"){const s=[],p=Math.max(t.dirty.length,f.length);for(let u=0;u32){const t=[],r=e.ctx.length/32;for(let i=0;i>1);r(f)<=i?e=f+1:t=f}return e}function Cf(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const g=[];for(let S=0;S0&&t[r[f]].claim_order<=S?f+1:zf(1,f,B=>t[r[B]].claim_order,S))-1;i[g]=r[_]+1;const D=_+1;r[D]=g,f=Math.max(D,f)}const s=[],p=[];let u=t.length-1;for(let g=r[f]+1;g!=0;g=i[g-1]){for(s.push(t[g-1]);u>=g;u--)p.push(t[u]);u--}for(;u>=0;u--)p.push(t[u]);s.reverse(),p.sort((g,S)=>g.claim_order-S.claim_order);for(let g=0,S=0;g=s[S].claim_order;)S++;const _=Se.removeEventListener(t,r,i)}function ml(e,t,r){r==null?e.removeAttribute(t):e.getAttribute(t)!==r&&e.setAttribute(t,r)}function qf(e){return Array.from(e.childNodes)}function Kf(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function gn(e,t,r,i,f=!1){Kf(e);const s=(()=>{for(let p=e.claim_info.last_index;p=0;p--){const u=e[p];if(t(u)){const g=r(u);return g===void 0?e.splice(p,1):e[p]=g,f?g===void 0&&e.claim_info.last_index--:e.claim_info.last_index=p,u}}return i()})();return s.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,s}function Yf(e,t,r,i){return gn(e,f=>f.nodeName===t,f=>{const s=[];for(let p=0;pf.removeAttribute(p))},()=>i(t))}function yl(e,t,r){return Yf(e,t,r,Gf)}function Of(e,t){return gn(e,r=>r.nodeType===3,r=>{const i=""+t;if(r.data.startsWith(i)){if(r.data.length!==i.length)return r.splitText(i.length)}else r.data=i},()=>ui(t),!0)}function wl(e){return Of(e," ")}function bl(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Sl(e,t){e.value=t==null?"":t}function _l(e,t,r,i){e.style.setProperty(t,r,i?"important":"")}function Ml(e,t,r){e.classList[r?"add":"remove"](t)}let f0;function o0(e){f0=e}function li(){if(!f0)throw new Error("Function called outside component initialization");return f0}function El(e){li().$$.on_mount.push(e)}function Al(e){li().$$.after_update.push(e)}function Tl(e,t){li().$$.context.set(e,t)}function Bl(e,t){const r=e.$$.callbacks[t.type];r&&r.slice().forEach(i=>i.call(this,t))}const a0=[],mn=[],S0=[],ci=[],Wf=Promise.resolve();let di=!1;function Vf(){di||(di=!0,Wf.then(yn))}function vi(e){S0.push(e)}function Rl(e){ci.push(e)}const pi=new Set;let _0=0;function yn(){const e=f0;do{for(;_0{M0.delete(e),i&&(r&&e.d(1),i())}),e.o(t)}}function Pl(e,t){Xf(e,1,1,()=>{t.delete(e.key)})}function Nl(e,t,r,i,f,s,p,u,g,S,_,D){let B=e.length,L=s.length,H=B;const U={};for(;H--;)U[e[H].key]=H;const N=[],P=new Map,z=new Map;for(H=L;H--;){const M=D(f,s,H),T=r(M);let I=p.get(T);I?i&&I.p(M,t):(I=S(T,M),I.c()),P.set(T,N[H]=I),T in U&&z.set(T,Math.abs(H-U[T]))}const k=new Set,$=new Set;function K(M){wn(M,1),M.m(u,_),p.set(M.key,M),_=M.first,L--}for(;B&&L;){const M=N[L-1],T=e[B-1],I=M.key,q=T.key;M===T?(_=M.first,B--,L--):P.has(q)?!p.has(I)||k.has(I)?K(M):$.has(q)?B--:z.get(I)>z.get(q)?($.add(I),K(M)):(k.add(q),B--):(g(T,p),B--)}for(;B--;){const M=e[B];P.has(M.key)||g(M,p)}for(;L;)K(N[L-1]);return N}function Ul(e,t){const r={},i={},f={$$scope:1};let s=e.length;for(;s--;){const p=e[s],u=t[s];if(u){for(const g in p)g in u||(i[g]=1);for(const g in u)f[g]||(r[g]=u[g],f[g]=1);e[s]=u}else for(const g in p)f[g]=1}for(const p in i)p in r||(r[p]=void 0);return r}function Dl(e){return typeof e=="object"&&e!==null?e:{}}function Hl(e,t,r){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=r,r(e.$$.ctx[i]))}function Fl(e){e&&e.c()}function zl(e,t){e&&e.l(t)}function Zf(e,t,r,i){const{fragment:f,on_mount:s,on_destroy:p,after_update:u}=e.$$;f&&f.m(t,r),i||vi(()=>{const g=s.map(vn).filter(Pf);p?p.push(...g):s0(g),e.$$.on_mount=[]}),u.forEach(vi)}function Qf(e,t){const r=e.$$;r.fragment!==null&&(s0(r.on_destroy),r.fragment&&r.fragment.d(t),r.on_destroy=r.fragment=null,r.ctx=[])}function jf(e,t){e.$$.dirty[0]===-1&&(a0.push(e),Vf(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const H=L.length?L[0]:B;return S.ctx&&f(S.ctx[D],S.ctx[D]=H)&&(!S.skip_bound&&S.bound[D]&&S.bound[D](H),_&&jf(e,D)),B}):[],S.update(),_=!0,s0(S.before_update),S.fragment=i?i(S.ctx):!1,t.target){if(t.hydrate){Hf();const D=qf(t.target);S.fragment&&S.fragment.l(D),D.forEach($f)}else S.fragment&&S.fragment.c();t.intro&&wn(e.$$.fragment),Zf(e,t.target,t.anchor,t.customElement),Ff(),yn()}o0(g)}class kl{$destroy(){Qf(this,1),this.$destroy=Ur}$on(t,r){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(r),()=>{const f=i.indexOf(r);f!==-1&&i.splice(f,1)}}$set(t){this.$$set&&!Uf(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Dr=[];function $l(e,t=Ur){let r;const i=new Set;function f(u){if(Nf(e,u)&&(e=u,r)){const g=!Dr.length;for(const S of i)S[1](),Dr.push(S,e);if(g){for(let S=0;S{i.delete(S),i.size===0&&(r(),r=null)}}return{set:f,update:s,subscribe:p}}var gt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function to(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var eo=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},bn={},we={};let xi;const ro=[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];we.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};we.getSymbolTotalCodewords=function(t){return ro[t]};we.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};we.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');xi=t};we.isKanjiModeEnabled=function(){return typeof xi!="undefined"};we.toSJIS=function(t){return xi(t)};var E0={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(i){return i&&typeof i.bit!="undefined"&&i.bit>=0&&i.bit<4},e.from=function(i,f){if(e.isValid(i))return i;try{return t(i)}catch{return f}}})(E0);function Sn(){this.buffer=[],this.length=0}Sn.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let r=0;r>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var io=Sn;function h0(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}h0.prototype.set=function(e,t,r,i){const f=e*this.size+t;this.data[f]=r,i&&(this.reservedBit[f]=!0)};h0.prototype.get=function(e,t){return this.data[e*this.size+t]};h0.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};h0.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var no=h0,_n={};(function(e){const t=we.getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const f=Math.floor(i/7)+2,s=t(i),p=s===145?26:Math.ceil((s-13)/(2*f-2))*2,u=[s-7];for(let g=1;g=0&&f<=7},e.from=function(f){return e.isValid(f)?parseInt(f,10):void 0},e.getPenaltyN1=function(f){const s=f.size;let p=0,u=0,g=0,S=null,_=null;for(let D=0;D=5&&(p+=t.N1+(u-5)),S=L,u=1),L=f.get(B,D),L===_?g++:(g>=5&&(p+=t.N1+(g-5)),_=L,g=1)}u>=5&&(p+=t.N1+(u-5)),g>=5&&(p+=t.N1+(g-5))}return p},e.getPenaltyN2=function(f){const s=f.size;let p=0;for(let u=0;u=10&&(u===1488||u===93)&&p++,g=g<<1&2047|f.get(_,S),_>=10&&(g===1488||g===93)&&p++}return p*t.N3},e.getPenaltyN4=function(f){let s=0;const p=f.data.length;for(let g=0;g=0;){const p=s[0];for(let g=0;g0){const s=new Uint8Array(this.degree);return s.set(i,f),s}return i};var fo=gi,Rn={},Qe={},mi={};mi.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var Ie={};const Ln="[0-9]+",oo="[A-Z $%*+\\-./:]+";let l0="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";l0=l0.replace(/u/g,"\\u");const ao="(?:(?![A-Z0-9 $%*+\\-./:]|"+l0+`)(?:.|[\r +]))+`;Ie.KANJI=new RegExp(l0,"g");Ie.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ie.BYTE=new RegExp(ao,"g");Ie.NUMERIC=new RegExp(Ln,"g");Ie.ALPHANUMERIC=new RegExp(oo,"g");const ho=new RegExp("^"+l0+"$"),uo=new RegExp("^"+Ln+"$"),lo=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ie.testKanji=function(t){return ho.test(t)};Ie.testNumeric=function(t){return uo.test(t)};Ie.testAlphanumeric=function(t){return lo.test(t)};(function(e){const t=mi,r=Ie;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(s,p){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!t.isValid(p))throw new Error("Invalid version: "+p);return p>=1&&p<10?s.ccBits[0]:p<27?s.ccBits[1]:s.ccBits[2]},e.getBestModeForData=function(s){return r.testNumeric(s)?e.NUMERIC:r.testAlphanumeric(s)?e.ALPHANUMERIC:r.testKanji(s)?e.KANJI:e.BYTE},e.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},e.isValid=function(s){return s&&s.bit&&s.ccBits};function i(f){if(typeof f!="string")throw new Error("Param is not a string");switch(f.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+f)}}e.from=function(s,p){if(e.isValid(s))return s;try{return i(s)}catch{return p}}})(Qe);(function(e){const t=we,r=A0,i=E0,f=Qe,s=mi,p=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,u=t.getBCHDigit(p);function g(B,L,H){for(let U=1;U<=40;U++)if(L<=e.getCapacity(U,H,B))return U}function S(B,L){return f.getCharCountIndicator(B,L)+4}function _(B,L){let H=0;return B.forEach(function(U){H+=S(U.mode,L)+U.getBitsLength()}),H}function D(B,L){for(let H=1;H<=40;H++)if(_(B,H)<=e.getCapacity(H,L,f.MIXED))return H}e.from=function(L,H){return s.isValid(L)?parseInt(L,10):H},e.getCapacity=function(L,H,U){if(!s.isValid(L))throw new Error("Invalid QR Code version");typeof U=="undefined"&&(U=f.BYTE);const N=t.getSymbolTotalCodewords(L),P=r.getTotalCodewordsCount(L,H),z=(N-P)*8;if(U===f.MIXED)return z;const k=z-S(U,L);switch(U){case f.NUMERIC:return Math.floor(k/10*3);case f.ALPHANUMERIC:return Math.floor(k/11*2);case f.KANJI:return Math.floor(k/13);case f.BYTE:default:return Math.floor(k/8)}},e.getBestVersionForData=function(L,H){let U;const N=i.from(H,i.M);if(Array.isArray(L)){if(L.length>1)return D(L,N);if(L.length===0)return 1;U=L[0]}else U=L;return g(U.mode,U.getLength(),N)},e.getEncodedBits=function(L){if(!s.isValid(L)||L<7)throw new Error("Invalid QR Code version");let H=L<<12;for(;t.getBCHDigit(H)-u>=0;)H^=p<=0;)f^=Pn<0&&(i=this.data.substr(r),f=parseInt(i,10),t.put(f,s*3+1))};var po=Hr;const xo=Qe,wi=["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 Fr(e){this.mode=xo.ALPHANUMERIC,this.data=e}Fr.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Fr.prototype.getLength=function(){return this.data.length};Fr.prototype.getBitsLength=function(){return Fr.getBitsLength(this.data.length)};Fr.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let i=wi.indexOf(this.data[r])*45;i+=wi.indexOf(this.data[r+1]),t.put(i,11)}this.data.length%2&&t.put(wi.indexOf(this.data[r]),6)};var go=Fr,mo=function(t){for(var r=[],i=t.length,f=0;f=55296&&s<=56319&&i>f+1){var p=t.charCodeAt(f+1);p>=56320&&p<=57343&&(s=(s-55296)*1024+p-56320+65536,f+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const yo=mo,wo=Qe;function zr(e){this.mode=wo.BYTE,this.data=new Uint8Array(yo(e))}zr.getBitsLength=function(t){return t*8};zr.prototype.getLength=function(){return this.data.length};zr.prototype.getBitsLength=function(){return zr.getBitsLength(this.data.length)};zr.prototype.write=function(e){for(let t=0,r=this.data.length;t=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` +Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};var Mo=Cr,Dn={exports:{}};(function(e){var t={single_source_shortest_paths:function(r,i,f){var s={},p={};p[i]=0;var u=t.PriorityQueue.make();u.push(i,0);for(var g,S,_,D,B,L,H,U,N;!u.empty();){g=u.pop(),S=g.value,D=g.cost,B=r[S]||{};for(_ in B)B.hasOwnProperty(_)&&(L=B[_],H=D+L,U=p[_],N=typeof p[_]=="undefined",(N||U>H)&&(p[_]=H,u.push(_,H),s[_]=S))}if(typeof f!="undefined"&&typeof p[f]=="undefined"){var P=["Could not find a path from ",i," to ",f,"."].join("");throw new Error(P)}return s},extract_shortest_path_from_predecessor_list:function(r,i){for(var f=[],s=i;s;)f.push(s),s=r[s];return f.reverse(),f},find_path:function(r,i,f){var s=t.single_source_shortest_paths(r,i,f);return t.extract_shortest_path_from_predecessor_list(s,f)},PriorityQueue:{make:function(r){var i=t.PriorityQueue,f={},s;r=r||{};for(s in i)i.hasOwnProperty(s)&&(f[s]=i[s]);return f.queue=[],f.sorter=r.sorter||i.default_sorter,f},default_sorter:function(r,i){return r.cost-i.cost},push:function(r,i){var f={value:r,cost:i};this.queue.push(f),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Dn);(function(e){const t=Qe,r=po,i=go,f=bo,s=Mo,p=Ie,u=we,g=Dn.exports;function S(P){return unescape(encodeURIComponent(P)).length}function _(P,z,k){const $=[];let K;for(;(K=P.exec(k))!==null;)$.push({data:K[0],index:K.index,mode:z,length:K[0].length});return $}function D(P){const z=_(p.NUMERIC,t.NUMERIC,P),k=_(p.ALPHANUMERIC,t.ALPHANUMERIC,P);let $,K;return u.isKanjiModeEnabled()?($=_(p.BYTE,t.BYTE,P),K=_(p.KANJI,t.KANJI,P)):($=_(p.BYTE_KANJI,t.BYTE,P),K=[]),z.concat(k,$,K).sort(function(T,I){return T.index-I.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function B(P,z){switch(z){case t.NUMERIC:return r.getBitsLength(P);case t.ALPHANUMERIC:return i.getBitsLength(P);case t.KANJI:return s.getBitsLength(P);case t.BYTE:return f.getBitsLength(P)}}function L(P){return P.reduce(function(z,k){const $=z.length-1>=0?z[z.length-1]:null;return $&&$.mode===k.mode?(z[z.length-1].data+=k.data,z):(z.push(k),z)},[])}function H(P){const z=[];for(let k=0;k=0&&u<=6&&(g===0||g===6)||g>=0&&g<=6&&(u===0||u===6)||u>=2&&u<=4&&g>=2&&g<=4?e.set(s+u,p+g,!0,!0):e.set(s+u,p+g,!1,!0))}}function No(e){const t=e.size;for(let r=8;r>u&1)==1,e.set(f,s,p,!0),e.set(s,f,p,!0)}function Ei(e,t,r){const i=e.size,f=Lo.getEncodedBits(t,r);let s,p;for(s=0;s<15;s++)p=(f>>s&1)==1,s<6?e.set(s,8,p,!0):s<8?e.set(s+1,8,p,!0):e.set(i-15+s,8,p,!0),s<8?e.set(8,i-s-1,p,!0):s<9?e.set(8,15-s-1+1,p,!0):e.set(8,15-s-1,p,!0);e.set(i-8,8,1,!0)}function Ho(e,t){const r=e.size;let i=-1,f=r-1,s=7,p=0;for(let u=r-1;u>0;u-=2)for(u===6&&u--;;){for(let g=0;g<2;g++)if(!e.isReserved(f,u-g)){let S=!1;p>>s&1)==1),e.set(f,u-g,S),s--,s===-1&&(p++,s=7)}if(f+=i,f<0||r<=f){f-=i,i=-i;break}}}function Fo(e,t,r){const i=new Eo;r.forEach(function(g){i.put(g.mode.bit,4),i.put(g.getLength(),Io.getCharCountIndicator(g.mode,e)),g.write(i)});const f=I0.getSymbolTotalCodewords(e),s=_i.getTotalCodewordsCount(e,t),p=(f-s)*8;for(i.getLengthInBits()+4<=p&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const u=(p-i.getLengthInBits())/8;for(let g=0;g=7&&Do(g,t),Ho(g,p),isNaN(i)&&(i=Si.getBestMask(g,Ei.bind(null,g,r))),Si.applyMask(i,g),Ei(g,r,i),{modules:g,version:t,errorCorrectionLevel:r,maskPattern:i,segments:f}}bn.create=function(t,r){if(typeof t=="undefined"||t==="")throw new Error("No input text");let i=bi.M,f,s;return typeof r!="undefined"&&(i=bi.from(r.errorCorrectionLevel,bi.M),f=P0.from(r.version),s=Si.from(r.maskPattern),r.toSJISFunc&&I0.setToSJISFunction(r.toSJISFunc)),Co(t,f,i,s)};var Hn={},Ai={};(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let i=r.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+r);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(s){return[s,s]}))),i.length===6&&i.push("F","F");const f=parseInt(i.join(""),16);return{r:f>>24&255,g:f>>16&255,b:f>>8&255,a:f&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const f=typeof i.margin=="undefined"||i.margin===null||i.margin<0?4:i.margin,s=i.width&&i.width>=21?i.width:void 0,p=i.scale||4;return{width:s,scale:s?4:p,margin:f,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,f){return f.width&&f.width>=i+f.margin*2?f.width/(i+f.margin*2):f.scale},e.getImageWidth=function(i,f){const s=e.getScale(i,f);return Math.floor((i+f.margin*2)*s)},e.qrToImageData=function(i,f,s){const p=f.modules.size,u=f.modules.data,g=e.getScale(p,s),S=Math.floor((p+s.margin*2)*g),_=s.margin*g,D=[s.color.light,s.color.dark];for(let B=0;B=_&&L>=_&&B0&&g>0&&e[u-1]||(i+=s?Ti("M",g+r,.5+S+r):Ti("m",f,0),f=0,s=!1),g+1':"",S="',_='viewBox="0 0 '+u+" "+u+'"',D=f.width?'width="'+f.width+'" height="'+f.width+'" ':"",B=''+g+S+` +`;return typeof i=="function"&&i(null,B),B};const Go=eo,Cn=bn,kn=Hn,qo=Fn;function Bi(e,t,r,i,f){const s=[].slice.call(arguments,1),p=s.length,u=typeof s[p-1]=="function";if(!u&&!Go())throw new Error("Callback required as last argument");if(u){if(p<2)throw new Error("Too few arguments provided");p===2?(f=r,r=t,t=i=void 0):p===3&&(t.getContext&&typeof f=="undefined"?(f=i,i=void 0):(f=i,i=r,r=t,t=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(r=t,t=i=void 0):p===2&&!t.getContext&&(i=r,r=t,t=void 0),new Promise(function(g,S){try{const _=Cn.create(r,i);g(e(_,t,i))}catch(_){S(_)}})}try{const g=Cn.create(r,i);f(null,e(g,t,i))}catch(g){f(g)}}var Gl=Bi.bind(null,kn.render);Bi.bind(null,kn.renderToDataURL);Bi.bind(null,function(e,t,r){return qo.render(e,r)});const N0=53;var $n;(function(e){e[e.MainNet=860833102]="MainNet",e[e.TestNet=877933390]="TestNet",e[e.SoloNet=1234567890]="SoloNet"})($n||($n={}));var Gn;(function(e){e.NeoToken="ef4073a0f2b305a38ec4050e4d3d28bc40ea63f5",e.GasToken="d2a4cff31913016155e38e474a2c06d08be276cf",e.PolicyContract="cc5e4edd9f5f8dba8bb65734541df7a1c081c67b",e.ManagementContract="fffdc93764dbaddd97c48f252a53ea4643faa3fd",e.OracleContract="fe924b7cfe89ddd271abaf7210a80a7e11178758",e.LedgerContract="da65b600f7124ce6c79950c1772a36403104f2be",e.RoleManagement="49cf4e5378ffcd4dec034fd98a174c5491e395e2",e.StdLib="acce6fd80d44e1796aa0c2c625e9e4e0ce39efc0",e.CryptoLib="726cb6e0cd8628a1350a611384688911ab75f51b"})(Gn||(Gn={}));const U0={n:16384,r:8,p:8,size:64},qn={script:"",parameters:[{name:"signature",type:"Signature"}],deployed:!1},Kn="0142",Yn="e0";var On={exports:{}};(function(e){(function(t,r){e.exports?e.exports=r():t.log=r()})(gt,function(){var t=function(){},r="undefined",i=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"];function s(U,N){var P=U[N];if(typeof P.bind=="function")return P.bind(U);try{return Function.prototype.bind.call(P,U)}catch{return function(){return Function.prototype.apply.apply(P,[U,arguments])}}}function p(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(U){return U==="debug"&&(U="log"),typeof console===r?!1:U==="trace"&&i?p:console[U]!==void 0?s(console,U):console.log!==void 0?s(console,"log"):t}function g(U,N){for(var P=0;P=0&&I<=z.levels.SILENT){if(k=I,q!==!1&&K(I),g.call(z,I,U),typeof console===r&&I{const i=r!=null?r:new Date().toUTCString();return e=e.toUpperCase(),`[${i}] (${t}) ${e}: `};var kr=e=>{const t=Ri.getLogger(e);return Vn.apply(t,{format:Ko}),t},Jn={};const Yo="elliptic",Oo="6.5.4",Wo="EC cryptography",Vo="lib/elliptic.js",Jo=["lib"],Xo={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},Zo={type:"git",url:"git@github.com:indutny/elliptic"},Qo=["EC","Elliptic","curve","Cryptography"],jo="Fedor Indutny ",ta="MIT",ea={url:"https://github.com/indutny/elliptic/issues"},ra="https://github.com/indutny/elliptic",ia={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},na={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"};var sa={name:Yo,version:Oo,description:Wo,main:Vo,files:Jo,scripts:Xo,repository:Zo,keywords:Qo,author:jo,license:ta,bugs:ea,homepage:ra,devDependencies:ia,dependencies:na},be={},Pe={exports:{}};(function(e){(function(t,r){function i(w,h){if(!w)throw new Error(h||"Assertion failed")}function f(w,h){w.super_=h;var a=function(){};a.prototype=h.prototype,w.prototype=new a,w.prototype.constructor=w}function s(w,h,a){if(s.isBN(w))return w;this.negative=0,this.words=null,this.length=0,this.red=null,w!==null&&((h==="le"||h==="be")&&(a=h,h=10),this._init(w||0,h||10,a||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var p;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?p=window.Buffer:p=require("buffer").Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,a){return h.cmp(a)>0?h:a},s.min=function(h,a){return h.cmp(a)<0?h:a},s.prototype._init=function(h,a,n){if(typeof h=="number")return this._initNumber(h,a,n);if(typeof h=="object")return this._initArray(h,a,n);a==="hex"&&(a=16),i(a===(a|0)&&a>=2&&a<=36),h=h.toString().replace(/\s+/g,"");var o=0;h[0]==="-"&&(o++,this.negative=1),o=0;o-=3)m=h[o]|h[o-1]<<8|h[o-2]<<16,this.words[l]|=m<>>26-E&67108863,E+=24,E>=26&&(E-=26,l++);else if(n==="le")for(o=0,l=0;o>>26-E&67108863,E+=24,E>=26&&(E-=26,l++);return this.strip()};function u(w,h){var a=w.charCodeAt(h);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function g(w,h,a){var n=u(w,a);return a-1>=h&&(n|=u(w,a-1)<<4),n}s.prototype._parseHex=function(h,a,n){this.length=Math.ceil((h.length-a)/6),this.words=new Array(this.length);for(var o=0;o=a;o-=2)E=g(h,a,o)<=18?(l-=18,m+=1,this.words[m]|=E>>>26):l+=8;else{var y=h.length-a;for(o=y%2==0?a+1:a;o=18?(l-=18,m+=1,this.words[m]|=E>>>26):l+=8}this.strip()};function S(w,h,a,n){for(var o=0,l=Math.min(w.length,a),m=h;m=49?o+=E-49+10:E>=17?o+=E-17+10:o+=E}return o}s.prototype._parseBase=function(h,a,n){this.words=[0],this.length=1;for(var o=0,l=1;l<=67108863;l*=a)o++;o--,l=l/a|0;for(var m=h.length-n,E=m%o,y=Math.min(m,m-E)+n,c=0,v=n;v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var _=["","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"],D=[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],B=[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];s.prototype.toString=function(h,a){h=h||10,a=a|0||1;var n;if(h===16||h==="hex"){n="";for(var o=0,l=0,m=0;m>>24-o&16777215,l!==0||m!==this.length-1?n=_[6-y.length]+y+n:n=y+n,o+=2,o>=26&&(o-=26,m--)}for(l!==0&&(n=l.toString(16)+n);n.length%a!=0;)n="0"+n;return this.negative!==0&&(n="-"+n),n}if(h===(h|0)&&h>=2&&h<=36){var c=D[h],v=B[h];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var A=d.modn(v).toString(h);d=d.idivn(v),d.isZero()?n=A+n:n=_[c-A.length]+A+n}for(this.isZero()&&(n="0"+n);n.length%a!=0;)n="0"+n;return this.negative!==0&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(h,a){return i(typeof p!="undefined"),this.toArrayLike(p,h,a)},s.prototype.toArray=function(h,a){return this.toArrayLike(Array,h,a)},s.prototype.toArrayLike=function(h,a,n){var o=this.byteLength(),l=n||Math.max(1,o);i(o<=l,"byte array longer than desired length"),i(l>0,"Requested array length <= 0"),this.strip();var m=a==="le",E=new h(l),y,c,v=this.clone();if(m){for(c=0;!v.isZero();c++)y=v.andln(255),v.iushrn(8),E[c]=y;for(;c=4096&&(n+=13,a>>>=13),a>=64&&(n+=7,a>>>=7),a>=8&&(n+=4,a>>>=4),a>=2&&(n+=2,a>>>=2),n+a},s.prototype._zeroBits=function(h){if(h===0)return 26;var a=h,n=0;return(a&8191)==0&&(n+=13,a>>>=13),(a&127)==0&&(n+=7,a>>>=7),(a&15)==0&&(n+=4,a>>>=4),(a&3)==0&&(n+=2,a>>>=2),(a&1)==0&&n++,n},s.prototype.bitLength=function(){var h=this.words[this.length-1],a=this._countBits(h);return(this.length-1)*26+a};function L(w){for(var h=new Array(w.bitLength()),a=0;a>>o}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,a=0;ah.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var a;this.length>h.length?a=h:a=this;for(var n=0;nh.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var a,n;this.length>h.length?(a=this,n=h):(a=h,n=this);for(var o=0;oh.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var a=Math.ceil(h/26)|0,n=h%26;this._expand(a),n>0&&a--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,a){i(typeof h=="number"&&h>=0);var n=h/26|0,o=h%26;return this._expand(n+1),a?this.words[n]=this.words[n]|1<h.length?(n=this,o=h):(n=h,o=this);for(var l=0,m=0;m>>26;for(;l!==0&&m>>26;if(this.length=n.length,l!==0)this.words[this.length]=l,this.length++;else if(n!==this)for(;mh.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var a=this.iadd(h);return h.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var n=this.cmp(h);if(n===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,l;n>0?(o=this,l=h):(o=h,l=this);for(var m=0,E=0;E>26,this.words[E]=a&67108863;for(;m!==0&&E>26,this.words[E]=a&67108863;if(m===0&&E>>26,d=y&67108863,A=Math.min(c,h.length-1),Y=Math.max(0,c-w.length+1);Y<=A;Y++){var J=c-Y|0;o=w.words[J]|0,l=h.words[Y]|0,m=o*l+d,v+=m/67108864|0,d=m&67108863}a.words[c]=d|0,y=v|0}return y!==0?a.words[c]=y|0:a.length--,a.strip()}var U=function(h,a,n){var o=h.words,l=a.words,m=n.words,E=0,y,c,v,d=o[0]|0,A=d&8191,Y=d>>>13,J=o[1]|0,X=J&8191,tt=J>>>13,Z=o[2]|0,Q=Z&8191,at=Z>>>13,lt=o[3]|0,et=lt&8191,it=lt>>>13,bt=o[4]|0,ct=bt&8191,Ft=bt>>>13,Nt=o[5]|0,ht=Nt&8191,Ct=Nt>>>13,Ut=o[6]|0,st=Ut&8191,pt=Ut>>>13,Lt=o[7]|0,dt=Lt&8191,Pt=Lt>>>13,Dt=o[8]|0,F=Dt&8191,x=Dt>>>13,b=o[9]|0,G=b&8191,O=b>>>13,W=l[0]|0,V=W&8191,nt=W>>>13,ut=l[1]|0,rt=ut&8191,vt=ut>>>13,ot=l[2]|0,St=ot&8191,$t=ot>>>13,Yt=l[3]|0,mt=Yt&8191,Ot=Yt>>>13,Wt=l[4]|0,_t=Wt&8191,Gt=Wt>>>13,Vt=l[5]|0,Mt=Vt&8191,qt=Vt>>>13,Jt=l[6]|0,yt=Jt&8191,Bt=Jt>>>13,Ht=l[7]|0,wt=Ht&8191,Xt=Ht>>>13,jt=l[8]|0,Et=jt&8191,te=jt>>>13,ee=l[9]|0,At=ee&8191,re=ee>>>13;n.negative=h.negative^a.negative,n.length=19,y=Math.imul(A,V),c=Math.imul(A,nt),c=c+Math.imul(Y,V)|0,v=Math.imul(Y,nt);var Zt=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,y=Math.imul(X,V),c=Math.imul(X,nt),c=c+Math.imul(tt,V)|0,v=Math.imul(tt,nt),y=y+Math.imul(A,rt)|0,c=c+Math.imul(A,vt)|0,c=c+Math.imul(Y,rt)|0,v=v+Math.imul(Y,vt)|0;var Qt=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,y=Math.imul(Q,V),c=Math.imul(Q,nt),c=c+Math.imul(at,V)|0,v=Math.imul(at,nt),y=y+Math.imul(X,rt)|0,c=c+Math.imul(X,vt)|0,c=c+Math.imul(tt,rt)|0,v=v+Math.imul(tt,vt)|0,y=y+Math.imul(A,St)|0,c=c+Math.imul(A,$t)|0,c=c+Math.imul(Y,St)|0,v=v+Math.imul(Y,$t)|0;var or=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(or>>>26)|0,or&=67108863,y=Math.imul(et,V),c=Math.imul(et,nt),c=c+Math.imul(it,V)|0,v=Math.imul(it,nt),y=y+Math.imul(Q,rt)|0,c=c+Math.imul(Q,vt)|0,c=c+Math.imul(at,rt)|0,v=v+Math.imul(at,vt)|0,y=y+Math.imul(X,St)|0,c=c+Math.imul(X,$t)|0,c=c+Math.imul(tt,St)|0,v=v+Math.imul(tt,$t)|0,y=y+Math.imul(A,mt)|0,c=c+Math.imul(A,Ot)|0,c=c+Math.imul(Y,mt)|0,v=v+Math.imul(Y,Ot)|0;var ar=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(ar>>>26)|0,ar&=67108863,y=Math.imul(ct,V),c=Math.imul(ct,nt),c=c+Math.imul(Ft,V)|0,v=Math.imul(Ft,nt),y=y+Math.imul(et,rt)|0,c=c+Math.imul(et,vt)|0,c=c+Math.imul(it,rt)|0,v=v+Math.imul(it,vt)|0,y=y+Math.imul(Q,St)|0,c=c+Math.imul(Q,$t)|0,c=c+Math.imul(at,St)|0,v=v+Math.imul(at,$t)|0,y=y+Math.imul(X,mt)|0,c=c+Math.imul(X,Ot)|0,c=c+Math.imul(tt,mt)|0,v=v+Math.imul(tt,Ot)|0,y=y+Math.imul(A,_t)|0,c=c+Math.imul(A,Gt)|0,c=c+Math.imul(Y,_t)|0,v=v+Math.imul(Y,Gt)|0;var hr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(hr>>>26)|0,hr&=67108863,y=Math.imul(ht,V),c=Math.imul(ht,nt),c=c+Math.imul(Ct,V)|0,v=Math.imul(Ct,nt),y=y+Math.imul(ct,rt)|0,c=c+Math.imul(ct,vt)|0,c=c+Math.imul(Ft,rt)|0,v=v+Math.imul(Ft,vt)|0,y=y+Math.imul(et,St)|0,c=c+Math.imul(et,$t)|0,c=c+Math.imul(it,St)|0,v=v+Math.imul(it,$t)|0,y=y+Math.imul(Q,mt)|0,c=c+Math.imul(Q,Ot)|0,c=c+Math.imul(at,mt)|0,v=v+Math.imul(at,Ot)|0,y=y+Math.imul(X,_t)|0,c=c+Math.imul(X,Gt)|0,c=c+Math.imul(tt,_t)|0,v=v+Math.imul(tt,Gt)|0,y=y+Math.imul(A,Mt)|0,c=c+Math.imul(A,qt)|0,c=c+Math.imul(Y,Mt)|0,v=v+Math.imul(Y,qt)|0;var ur=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(ur>>>26)|0,ur&=67108863,y=Math.imul(st,V),c=Math.imul(st,nt),c=c+Math.imul(pt,V)|0,v=Math.imul(pt,nt),y=y+Math.imul(ht,rt)|0,c=c+Math.imul(ht,vt)|0,c=c+Math.imul(Ct,rt)|0,v=v+Math.imul(Ct,vt)|0,y=y+Math.imul(ct,St)|0,c=c+Math.imul(ct,$t)|0,c=c+Math.imul(Ft,St)|0,v=v+Math.imul(Ft,$t)|0,y=y+Math.imul(et,mt)|0,c=c+Math.imul(et,Ot)|0,c=c+Math.imul(it,mt)|0,v=v+Math.imul(it,Ot)|0,y=y+Math.imul(Q,_t)|0,c=c+Math.imul(Q,Gt)|0,c=c+Math.imul(at,_t)|0,v=v+Math.imul(at,Gt)|0,y=y+Math.imul(X,Mt)|0,c=c+Math.imul(X,qt)|0,c=c+Math.imul(tt,Mt)|0,v=v+Math.imul(tt,qt)|0,y=y+Math.imul(A,yt)|0,c=c+Math.imul(A,Bt)|0,c=c+Math.imul(Y,yt)|0,v=v+Math.imul(Y,Bt)|0;var lr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(lr>>>26)|0,lr&=67108863,y=Math.imul(dt,V),c=Math.imul(dt,nt),c=c+Math.imul(Pt,V)|0,v=Math.imul(Pt,nt),y=y+Math.imul(st,rt)|0,c=c+Math.imul(st,vt)|0,c=c+Math.imul(pt,rt)|0,v=v+Math.imul(pt,vt)|0,y=y+Math.imul(ht,St)|0,c=c+Math.imul(ht,$t)|0,c=c+Math.imul(Ct,St)|0,v=v+Math.imul(Ct,$t)|0,y=y+Math.imul(ct,mt)|0,c=c+Math.imul(ct,Ot)|0,c=c+Math.imul(Ft,mt)|0,v=v+Math.imul(Ft,Ot)|0,y=y+Math.imul(et,_t)|0,c=c+Math.imul(et,Gt)|0,c=c+Math.imul(it,_t)|0,v=v+Math.imul(it,Gt)|0,y=y+Math.imul(Q,Mt)|0,c=c+Math.imul(Q,qt)|0,c=c+Math.imul(at,Mt)|0,v=v+Math.imul(at,qt)|0,y=y+Math.imul(X,yt)|0,c=c+Math.imul(X,Bt)|0,c=c+Math.imul(tt,yt)|0,v=v+Math.imul(tt,Bt)|0,y=y+Math.imul(A,wt)|0,c=c+Math.imul(A,Xt)|0,c=c+Math.imul(Y,wt)|0,v=v+Math.imul(Y,Xt)|0;var cr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(cr>>>26)|0,cr&=67108863,y=Math.imul(F,V),c=Math.imul(F,nt),c=c+Math.imul(x,V)|0,v=Math.imul(x,nt),y=y+Math.imul(dt,rt)|0,c=c+Math.imul(dt,vt)|0,c=c+Math.imul(Pt,rt)|0,v=v+Math.imul(Pt,vt)|0,y=y+Math.imul(st,St)|0,c=c+Math.imul(st,$t)|0,c=c+Math.imul(pt,St)|0,v=v+Math.imul(pt,$t)|0,y=y+Math.imul(ht,mt)|0,c=c+Math.imul(ht,Ot)|0,c=c+Math.imul(Ct,mt)|0,v=v+Math.imul(Ct,Ot)|0,y=y+Math.imul(ct,_t)|0,c=c+Math.imul(ct,Gt)|0,c=c+Math.imul(Ft,_t)|0,v=v+Math.imul(Ft,Gt)|0,y=y+Math.imul(et,Mt)|0,c=c+Math.imul(et,qt)|0,c=c+Math.imul(it,Mt)|0,v=v+Math.imul(it,qt)|0,y=y+Math.imul(Q,yt)|0,c=c+Math.imul(Q,Bt)|0,c=c+Math.imul(at,yt)|0,v=v+Math.imul(at,Bt)|0,y=y+Math.imul(X,wt)|0,c=c+Math.imul(X,Xt)|0,c=c+Math.imul(tt,wt)|0,v=v+Math.imul(tt,Xt)|0,y=y+Math.imul(A,Et)|0,c=c+Math.imul(A,te)|0,c=c+Math.imul(Y,Et)|0,v=v+Math.imul(Y,te)|0;var dr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(dr>>>26)|0,dr&=67108863,y=Math.imul(G,V),c=Math.imul(G,nt),c=c+Math.imul(O,V)|0,v=Math.imul(O,nt),y=y+Math.imul(F,rt)|0,c=c+Math.imul(F,vt)|0,c=c+Math.imul(x,rt)|0,v=v+Math.imul(x,vt)|0,y=y+Math.imul(dt,St)|0,c=c+Math.imul(dt,$t)|0,c=c+Math.imul(Pt,St)|0,v=v+Math.imul(Pt,$t)|0,y=y+Math.imul(st,mt)|0,c=c+Math.imul(st,Ot)|0,c=c+Math.imul(pt,mt)|0,v=v+Math.imul(pt,Ot)|0,y=y+Math.imul(ht,_t)|0,c=c+Math.imul(ht,Gt)|0,c=c+Math.imul(Ct,_t)|0,v=v+Math.imul(Ct,Gt)|0,y=y+Math.imul(ct,Mt)|0,c=c+Math.imul(ct,qt)|0,c=c+Math.imul(Ft,Mt)|0,v=v+Math.imul(Ft,qt)|0,y=y+Math.imul(et,yt)|0,c=c+Math.imul(et,Bt)|0,c=c+Math.imul(it,yt)|0,v=v+Math.imul(it,Bt)|0,y=y+Math.imul(Q,wt)|0,c=c+Math.imul(Q,Xt)|0,c=c+Math.imul(at,wt)|0,v=v+Math.imul(at,Xt)|0,y=y+Math.imul(X,Et)|0,c=c+Math.imul(X,te)|0,c=c+Math.imul(tt,Et)|0,v=v+Math.imul(tt,te)|0,y=y+Math.imul(A,At)|0,c=c+Math.imul(A,re)|0,c=c+Math.imul(Y,At)|0,v=v+Math.imul(Y,re)|0;var vr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(vr>>>26)|0,vr&=67108863,y=Math.imul(G,rt),c=Math.imul(G,vt),c=c+Math.imul(O,rt)|0,v=Math.imul(O,vt),y=y+Math.imul(F,St)|0,c=c+Math.imul(F,$t)|0,c=c+Math.imul(x,St)|0,v=v+Math.imul(x,$t)|0,y=y+Math.imul(dt,mt)|0,c=c+Math.imul(dt,Ot)|0,c=c+Math.imul(Pt,mt)|0,v=v+Math.imul(Pt,Ot)|0,y=y+Math.imul(st,_t)|0,c=c+Math.imul(st,Gt)|0,c=c+Math.imul(pt,_t)|0,v=v+Math.imul(pt,Gt)|0,y=y+Math.imul(ht,Mt)|0,c=c+Math.imul(ht,qt)|0,c=c+Math.imul(Ct,Mt)|0,v=v+Math.imul(Ct,qt)|0,y=y+Math.imul(ct,yt)|0,c=c+Math.imul(ct,Bt)|0,c=c+Math.imul(Ft,yt)|0,v=v+Math.imul(Ft,Bt)|0,y=y+Math.imul(et,wt)|0,c=c+Math.imul(et,Xt)|0,c=c+Math.imul(it,wt)|0,v=v+Math.imul(it,Xt)|0,y=y+Math.imul(Q,Et)|0,c=c+Math.imul(Q,te)|0,c=c+Math.imul(at,Et)|0,v=v+Math.imul(at,te)|0,y=y+Math.imul(X,At)|0,c=c+Math.imul(X,re)|0,c=c+Math.imul(tt,At)|0,v=v+Math.imul(tt,re)|0;var pr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(pr>>>26)|0,pr&=67108863,y=Math.imul(G,St),c=Math.imul(G,$t),c=c+Math.imul(O,St)|0,v=Math.imul(O,$t),y=y+Math.imul(F,mt)|0,c=c+Math.imul(F,Ot)|0,c=c+Math.imul(x,mt)|0,v=v+Math.imul(x,Ot)|0,y=y+Math.imul(dt,_t)|0,c=c+Math.imul(dt,Gt)|0,c=c+Math.imul(Pt,_t)|0,v=v+Math.imul(Pt,Gt)|0,y=y+Math.imul(st,Mt)|0,c=c+Math.imul(st,qt)|0,c=c+Math.imul(pt,Mt)|0,v=v+Math.imul(pt,qt)|0,y=y+Math.imul(ht,yt)|0,c=c+Math.imul(ht,Bt)|0,c=c+Math.imul(Ct,yt)|0,v=v+Math.imul(Ct,Bt)|0,y=y+Math.imul(ct,wt)|0,c=c+Math.imul(ct,Xt)|0,c=c+Math.imul(Ft,wt)|0,v=v+Math.imul(Ft,Xt)|0,y=y+Math.imul(et,Et)|0,c=c+Math.imul(et,te)|0,c=c+Math.imul(it,Et)|0,v=v+Math.imul(it,te)|0,y=y+Math.imul(Q,At)|0,c=c+Math.imul(Q,re)|0,c=c+Math.imul(at,At)|0,v=v+Math.imul(at,re)|0;var xr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(xr>>>26)|0,xr&=67108863,y=Math.imul(G,mt),c=Math.imul(G,Ot),c=c+Math.imul(O,mt)|0,v=Math.imul(O,Ot),y=y+Math.imul(F,_t)|0,c=c+Math.imul(F,Gt)|0,c=c+Math.imul(x,_t)|0,v=v+Math.imul(x,Gt)|0,y=y+Math.imul(dt,Mt)|0,c=c+Math.imul(dt,qt)|0,c=c+Math.imul(Pt,Mt)|0,v=v+Math.imul(Pt,qt)|0,y=y+Math.imul(st,yt)|0,c=c+Math.imul(st,Bt)|0,c=c+Math.imul(pt,yt)|0,v=v+Math.imul(pt,Bt)|0,y=y+Math.imul(ht,wt)|0,c=c+Math.imul(ht,Xt)|0,c=c+Math.imul(Ct,wt)|0,v=v+Math.imul(Ct,Xt)|0,y=y+Math.imul(ct,Et)|0,c=c+Math.imul(ct,te)|0,c=c+Math.imul(Ft,Et)|0,v=v+Math.imul(Ft,te)|0,y=y+Math.imul(et,At)|0,c=c+Math.imul(et,re)|0,c=c+Math.imul(it,At)|0,v=v+Math.imul(it,re)|0;var gr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(gr>>>26)|0,gr&=67108863,y=Math.imul(G,_t),c=Math.imul(G,Gt),c=c+Math.imul(O,_t)|0,v=Math.imul(O,Gt),y=y+Math.imul(F,Mt)|0,c=c+Math.imul(F,qt)|0,c=c+Math.imul(x,Mt)|0,v=v+Math.imul(x,qt)|0,y=y+Math.imul(dt,yt)|0,c=c+Math.imul(dt,Bt)|0,c=c+Math.imul(Pt,yt)|0,v=v+Math.imul(Pt,Bt)|0,y=y+Math.imul(st,wt)|0,c=c+Math.imul(st,Xt)|0,c=c+Math.imul(pt,wt)|0,v=v+Math.imul(pt,Xt)|0,y=y+Math.imul(ht,Et)|0,c=c+Math.imul(ht,te)|0,c=c+Math.imul(Ct,Et)|0,v=v+Math.imul(Ct,te)|0,y=y+Math.imul(ct,At)|0,c=c+Math.imul(ct,re)|0,c=c+Math.imul(Ft,At)|0,v=v+Math.imul(Ft,re)|0;var mr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(mr>>>26)|0,mr&=67108863,y=Math.imul(G,Mt),c=Math.imul(G,qt),c=c+Math.imul(O,Mt)|0,v=Math.imul(O,qt),y=y+Math.imul(F,yt)|0,c=c+Math.imul(F,Bt)|0,c=c+Math.imul(x,yt)|0,v=v+Math.imul(x,Bt)|0,y=y+Math.imul(dt,wt)|0,c=c+Math.imul(dt,Xt)|0,c=c+Math.imul(Pt,wt)|0,v=v+Math.imul(Pt,Xt)|0,y=y+Math.imul(st,Et)|0,c=c+Math.imul(st,te)|0,c=c+Math.imul(pt,Et)|0,v=v+Math.imul(pt,te)|0,y=y+Math.imul(ht,At)|0,c=c+Math.imul(ht,re)|0,c=c+Math.imul(Ct,At)|0,v=v+Math.imul(Ct,re)|0;var yr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(yr>>>26)|0,yr&=67108863,y=Math.imul(G,yt),c=Math.imul(G,Bt),c=c+Math.imul(O,yt)|0,v=Math.imul(O,Bt),y=y+Math.imul(F,wt)|0,c=c+Math.imul(F,Xt)|0,c=c+Math.imul(x,wt)|0,v=v+Math.imul(x,Xt)|0,y=y+Math.imul(dt,Et)|0,c=c+Math.imul(dt,te)|0,c=c+Math.imul(Pt,Et)|0,v=v+Math.imul(Pt,te)|0,y=y+Math.imul(st,At)|0,c=c+Math.imul(st,re)|0,c=c+Math.imul(pt,At)|0,v=v+Math.imul(pt,re)|0;var wr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(wr>>>26)|0,wr&=67108863,y=Math.imul(G,wt),c=Math.imul(G,Xt),c=c+Math.imul(O,wt)|0,v=Math.imul(O,Xt),y=y+Math.imul(F,Et)|0,c=c+Math.imul(F,te)|0,c=c+Math.imul(x,Et)|0,v=v+Math.imul(x,te)|0,y=y+Math.imul(dt,At)|0,c=c+Math.imul(dt,re)|0,c=c+Math.imul(Pt,At)|0,v=v+Math.imul(Pt,re)|0;var br=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(br>>>26)|0,br&=67108863,y=Math.imul(G,Et),c=Math.imul(G,te),c=c+Math.imul(O,Et)|0,v=Math.imul(O,te),y=y+Math.imul(F,At)|0,c=c+Math.imul(F,re)|0,c=c+Math.imul(x,At)|0,v=v+Math.imul(x,re)|0;var Sr=(E+y|0)+((c&8191)<<13)|0;E=(v+(c>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,y=Math.imul(G,At),c=Math.imul(G,re),c=c+Math.imul(O,At)|0,v=Math.imul(O,re);var _r=(E+y|0)+((c&8191)<<13)|0;return E=(v+(c>>>13)|0)+(_r>>>26)|0,_r&=67108863,m[0]=Zt,m[1]=Qt,m[2]=or,m[3]=ar,m[4]=hr,m[5]=ur,m[6]=lr,m[7]=cr,m[8]=dr,m[9]=vr,m[10]=pr,m[11]=xr,m[12]=gr,m[13]=mr,m[14]=yr,m[15]=wr,m[16]=br,m[17]=Sr,m[18]=_r,E!==0&&(m[19]=E,n.length++),n};Math.imul||(U=H);function N(w,h,a){a.negative=h.negative^w.negative,a.length=w.length+h.length;for(var n=0,o=0,l=0;l>>26)|0,o+=m>>>26,m&=67108863}a.words[l]=E,n=m,m=o}return n!==0?a.words[l]=n:a.length--,a.strip()}function P(w,h,a){var n=new z;return n.mulp(w,h,a)}s.prototype.mulTo=function(h,a){var n,o=this.length+h.length;return this.length===10&&h.length===10?n=U(this,h,a):o<63?n=H(this,h,a):o<1024?n=N(this,h,a):n=P(this,h,a),n};function z(w,h){this.x=w,this.y=h}z.prototype.makeRBT=function(h){for(var a=new Array(h),n=s.prototype._countBits(h)-1,o=0;o>=1;return o},z.prototype.permute=function(h,a,n,o,l,m){for(var E=0;E>>1)l++;return 1<>>13,n[2*m+1]=l&8191,l=l>>>13;for(m=2*a;m>=26,a+=o/67108864|0,a+=l>>>26,this.words[n]=l&67108863}return a!==0&&(this.words[n]=a,this.length++),this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var a=L(h);if(a.length===0)return new s(1);for(var n=this,o=0;o=0);var a=h%26,n=(h-a)/26,o=67108863>>>26-a<<26-a,l;if(a!==0){var m=0;for(l=0;l>>26-a}m&&(this.words[l]=m,this.length++)}if(n!==0){for(l=this.length-1;l>=0;l--)this.words[l+n]=this.words[l];for(l=0;l=0);var o;a?o=(a-a%26)/26:o=0;var l=h%26,m=Math.min((h-l)/26,this.length),E=67108863^67108863>>>l<m)for(this.length-=m,c=0;c=0&&(v!==0||c>=o);c--){var d=this.words[c]|0;this.words[c]=v<<26-l|d>>>l,v=d&E}return y&&v!==0&&(y.words[y.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(h,a,n){return i(this.negative===0),this.iushrn(h,a,n)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var a=h%26,n=(h-a)/26,o=1<=0);var a=h%26,n=(h-a)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=n)return this;if(a!==0&&n++,this.length=Math.min(n,this.length),a!==0){var o=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},s.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(y/67108864|0),this.words[l+n]=m&67108863}for(;l>26,this.words[l+n]=m&67108863;if(E===0)return this.strip();for(i(E===-1),E=0,l=0;l>26,this.words[l]=m&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(h,a){var n=this.length-h.length,o=this.clone(),l=h,m=l.words[l.length-1]|0,E=this._countBits(m);n=26-E,n!==0&&(l=l.ushln(n),o.iushln(n),m=l.words[l.length-1]|0);var y=o.length-l.length,c;if(a!=="mod"){c=new s(null),c.length=y+1,c.words=new Array(c.length);for(var v=0;v=0;A--){var Y=(o.words[l.length+A]|0)*67108864+(o.words[l.length+A-1]|0);for(Y=Math.min(Y/m|0,67108863),o._ishlnsubmul(l,Y,A);o.negative!==0;)Y--,o.negative=0,o._ishlnsubmul(l,1,A),o.isZero()||(o.negative^=1);c&&(c.words[A]=Y)}return c&&c.strip(),o.strip(),a!=="div"&&n!==0&&o.iushrn(n),{div:c||null,mod:o}},s.prototype.divmod=function(h,a,n){if(i(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var o,l,m;return this.negative!==0&&h.negative===0?(m=this.neg().divmod(h,a),a!=="mod"&&(o=m.div.neg()),a!=="div"&&(l=m.mod.neg(),n&&l.negative!==0&&l.iadd(h)),{div:o,mod:l}):this.negative===0&&h.negative!==0?(m=this.divmod(h.neg(),a),a!=="mod"&&(o=m.div.neg()),{div:o,mod:m.mod}):(this.negative&h.negative)!=0?(m=this.neg().divmod(h.neg(),a),a!=="div"&&(l=m.mod.neg(),n&&l.negative!==0&&l.isub(h)),{div:m.div,mod:l}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?a==="div"?{div:this.divn(h.words[0]),mod:null}:a==="mod"?{div:null,mod:new s(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modn(h.words[0]))}:this._wordDiv(h,a)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var a=this.divmod(h);if(a.mod.isZero())return a.div;var n=a.div.negative!==0?a.mod.isub(h):a.mod,o=h.ushrn(1),l=h.andln(1),m=n.cmp(o);return m<0||l===1&&m===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},s.prototype.modn=function(h){i(h<=67108863);for(var a=(1<<26)%h,n=0,o=this.length-1;o>=0;o--)n=(a*n+(this.words[o]|0))%h;return n},s.prototype.idivn=function(h){i(h<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var o=(this.words[n]|0)+a*67108864;this.words[n]=o/h|0,a=o%h}return this.strip()},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var a=this,n=h.clone();a.negative!==0?a=a.umod(h):a=a.clone();for(var o=new s(1),l=new s(0),m=new s(0),E=new s(1),y=0;a.isEven()&&n.isEven();)a.iushrn(1),n.iushrn(1),++y;for(var c=n.clone(),v=a.clone();!a.isZero();){for(var d=0,A=1;(a.words[0]&A)==0&&d<26;++d,A<<=1);if(d>0)for(a.iushrn(d);d-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(c),l.isub(v)),o.iushrn(1),l.iushrn(1);for(var Y=0,J=1;(n.words[0]&J)==0&&Y<26;++Y,J<<=1);if(Y>0)for(n.iushrn(Y);Y-- >0;)(m.isOdd()||E.isOdd())&&(m.iadd(c),E.isub(v)),m.iushrn(1),E.iushrn(1);a.cmp(n)>=0?(a.isub(n),o.isub(m),l.isub(E)):(n.isub(a),m.isub(o),E.isub(l))}return{a:m,b:E,gcd:n.iushln(y)}},s.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var a=this,n=h.clone();a.negative!==0?a=a.umod(h):a=a.clone();for(var o=new s(1),l=new s(0),m=n.clone();a.cmpn(1)>0&&n.cmpn(1)>0;){for(var E=0,y=1;(a.words[0]&y)==0&&E<26;++E,y<<=1);if(E>0)for(a.iushrn(E);E-- >0;)o.isOdd()&&o.iadd(m),o.iushrn(1);for(var c=0,v=1;(n.words[0]&v)==0&&c<26;++c,v<<=1);if(c>0)for(n.iushrn(c);c-- >0;)l.isOdd()&&l.iadd(m),l.iushrn(1);a.cmp(n)>=0?(a.isub(n),o.isub(l)):(n.isub(a),l.isub(o))}var d;return a.cmpn(1)===0?d=o:d=l,d.cmpn(0)<0&&d.iadd(h),d},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var a=this.clone(),n=h.clone();a.negative=0,n.negative=0;for(var o=0;a.isEven()&&n.isEven();o++)a.iushrn(1),n.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;n.isEven();)n.iushrn(1);var l=a.cmp(n);if(l<0){var m=a;a=n,n=m}else if(l===0||n.cmpn(1)===0)break;a.isub(n)}while(!0);return n.iushln(o)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)==0},s.prototype.isOdd=function(){return(this.words[0]&1)==1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){i(typeof h=="number");var a=h%26,n=(h-a)/26,o=1<>>26,E&=67108863,this.words[m]=E}return l!==0&&(this.words[m]=l,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var a=h<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this.strip();var n;if(this.length>1)n=1;else{a&&(h=-h),i(h<=67108863,"Number is too big");var o=this.words[0]|0;n=o===h?0:oh.length)return 1;if(this.length=0;n--){var o=this.words[n]|0,l=h.words[n]|0;if(o!==l){ol&&(a=1);break}}return a},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new q(h)},s.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var k={k256:null,p224:null,p192:null,p25519:null};function $(w,h){this.name=w,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}$.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},$.prototype.ireduce=function(h){var a=h,n;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),n=a.bitLength();while(n>this.n);var o=n0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},$.prototype.split=function(h,a){h.iushrn(this.n,0,a)},$.prototype.imulK=function(h){return h.imul(this.k)};function K(){$.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(K,$),K.prototype.split=function(h,a){for(var n=4194303,o=Math.min(h.length,9),l=0;l>>22,m=E}m>>>=22,h.words[l-10]=m,m===0&&h.length>10?h.length-=10:h.length-=9},K.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var a=0,n=0;n>>=26,h.words[n]=l,a=o}return a!==0&&(h.words[h.length++]=a),h},s._prime=function(h){if(k[h])return k[h];var a;if(h==="k256")a=new K;else if(h==="p224")a=new M;else if(h==="p192")a=new T;else if(h==="p25519")a=new I;else throw new Error("Unknown prime "+h);return k[h]=a,a};function q(w){if(typeof w=="string"){var h=s._prime(w);this.m=h.p,this.prime=h}else i(w.gtn(1),"modulus must be greater than 1"),this.m=w,this.prime=null}q.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},q.prototype._verify2=function(h,a){i((h.negative|a.negative)==0,"red works only with positives"),i(h.red&&h.red===a.red,"red works only with red numbers")},q.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},q.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},q.prototype.add=function(h,a){this._verify2(h,a);var n=h.add(a);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},q.prototype.iadd=function(h,a){this._verify2(h,a);var n=h.iadd(a);return n.cmp(this.m)>=0&&n.isub(this.m),n},q.prototype.sub=function(h,a){this._verify2(h,a);var n=h.sub(a);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},q.prototype.isub=function(h,a){this._verify2(h,a);var n=h.isub(a);return n.cmpn(0)<0&&n.iadd(this.m),n},q.prototype.shl=function(h,a){return this._verify1(h),this.imod(h.ushln(a))},q.prototype.imul=function(h,a){return this._verify2(h,a),this.imod(h.imul(a))},q.prototype.mul=function(h,a){return this._verify2(h,a),this.imod(h.mul(a))},q.prototype.isqr=function(h){return this.imul(h,h.clone())},q.prototype.sqr=function(h){return this.mul(h,h)},q.prototype.sqrt=function(h){if(h.isZero())return h.clone();var a=this.m.andln(3);if(i(a%2==1),a===3){var n=this.m.add(new s(1)).iushrn(2);return this.pow(h,n)}for(var o=this.m.subn(1),l=0;!o.isZero()&&o.andln(1)===0;)l++,o.iushrn(1);i(!o.isZero());var m=new s(1).toRed(this),E=m.redNeg(),y=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);this.pow(c,y).cmp(E)!==0;)c.redIAdd(E);for(var v=this.pow(c,o),d=this.pow(h,o.addn(1).iushrn(1)),A=this.pow(h,o),Y=l;A.cmp(m)!==0;){for(var J=A,X=0;J.cmp(m)!==0;X++)J=J.redSqr();i(X=0;l--){for(var v=a.words[l],d=c-1;d>=0;d--){var A=v>>d&1;if(m!==o[0]&&(m=this.sqr(m)),A===0&&E===0){y=0;continue}E<<=1,E|=A,y++,!(y!==n&&(l!==0||d!==0))&&(m=this.mul(m,o[E]),y=0,E=0)}c=26}return m},q.prototype.convertTo=function(h){var a=h.umod(this.m);return a===h?a.clone():a},q.prototype.convertFrom=function(h){var a=h.clone();return a.red=null,a},s.mont=function(h){return new C(h)};function C(w){q.call(this,w),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}f(C,q),C.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},C.prototype.convertFrom=function(h){var a=this.imod(h.mul(this.rinv));return a.red=null,a},C.prototype.imul=function(h,a){if(h.isZero()||a.isZero())return h.words[0]=0,h.length=1,h;var n=h.imul(a),o=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=n.isub(o).iushrn(this.shift),m=l;return l.cmp(this.m)>=0?m=l.isub(this.m):l.cmpn(0)<0&&(m=l.iadd(this.m)),m._forceRed(this)},C.prototype.mul=function(h,a){if(h.isZero()||a.isZero())return new s(0)._forceRed(this);var n=h.mul(a),o=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=n.isub(o).iushrn(this.shift),m=l;return l.cmp(this.m)>=0?m=l.isub(this.m):l.cmpn(0)<0&&(m=l.iadd(this.m)),m._forceRed(this)},C.prototype.invm=function(h){var a=this.imod(h._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(e,gt)})(Pe);var Er=Xn;function Xn(e,t){if(!e)throw new Error(t||"Assertion failed")}Xn.equal=function(t,r,i){if(t!=r)throw new Error(i||"Assertion failed: "+t+" != "+r)};var Li={};(function(e){var t=e;function r(s,p){if(Array.isArray(s))return s.slice();if(!s)return[];var u=[];if(typeof s!="string"){for(var g=0;g>8,D=S&255;_?u.push(_,D):u.push(D)}return u}t.toArray=r;function i(s){return s.length===1?"0"+s:s}t.zero2=i;function f(s){for(var p="",u=0;u(H>>1)-1?P=(H>>1)-z:P=z,U.isubn(P)):P=0,L[N]=P,U.iushrn(1)}return L}t.getNAF=s;function p(_,D){var B=[[],[]];_=_.clone(),D=D.clone();for(var L=0,H=0,U;_.cmpn(-L)>0||D.cmpn(-H)>0;){var N=_.andln(3)+L&3,P=D.andln(3)+H&3;N===3&&(N=-1),P===3&&(P=-1);var z;(N&1)==0?z=0:(U=_.andln(7)+L&7,(U===3||U===5)&&P===2?z=-N:z=N),B[0].push(z);var k;(P&1)==0?k=0:(U=D.andln(7)+H&7,(U===3||U===5)&&N===2?k=-P:k=P),B[1].push(k),2*L===z+1&&(L=1-L),2*H===k+1&&(H=1-H),_.iushrn(1),D.iushrn(1)}return B}t.getJSF=p;function u(_,D,B){var L="_"+D;_.prototype[D]=function(){return this[L]!==void 0?this[L]:this[L]=B.call(this)}}t.cachedProperty=u;function g(_){return typeof _=="string"?t.toArray(_,"hex"):_}t.parseBytes=g;function S(_){return new r(_,"hex","le")}t.intFromLE=S})(be);var D0={exports:{}},Ii;D0.exports=function(t){return Ii||(Ii=new je(null)),Ii.generate(t)};function je(e){this.rand=e}D0.exports.Rand=je;je.prototype.generate=function(t){return this._rand(t)};je.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),i=0;i0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var z0=tr;tr.prototype.point=function(){throw new Error("Not implemented")};tr.prototype.validate=function(){throw new Error("Not implemented")};tr.prototype._fixedNafMul=function(t,r){F0(t.precomputed);var i=t._getDoubles(),f=H0(r,1,this._bitLength),s=(1<=u;S--)g=(g<<1)+f[S];p.push(g)}for(var _=this.jpoint(null,null,null),D=this.jpoint(null,null,null),B=s;B>0;B--){for(u=0;u=0;g--){for(var S=0;g>=0&&p[g]===0;g--)S++;if(g>=0&&S++,u=u.dblp(S),g<0)break;var _=p[g];F0(_!==0),t.type==="affine"?_>0?u=u.mixedAdd(s[_-1>>1]):u=u.mixedAdd(s[-_-1>>1].neg()):_>0?u=u.add(s[_-1>>1]):u=u.add(s[-_-1>>1].neg())}return t.type==="affine"?u.toP():u};tr.prototype._wnafMulAdd=function(t,r,i,f,s){var p=this._wnafT1,u=this._wnafT2,g=this._wnafT3,S=0,_,D,B;for(_=0;_=1;_-=2){var H=_-1,U=_;if(p[H]!==1||p[U]!==1){g[H]=H0(i[H],p[H],this._bitLength),g[U]=H0(i[U],p[U],this._bitLength),S=Math.max(g[H].length,S),S=Math.max(g[U].length,S);continue}var N=[r[H],null,null,r[U]];r[H].y.cmp(r[U].y)===0?(N[1]=r[H].add(r[U]),N[2]=r[H].toJ().mixedAdd(r[U].neg())):r[H].y.cmp(r[U].y.redNeg())===0?(N[1]=r[H].toJ().mixedAdd(r[U]),N[2]=r[H].add(r[U].neg())):(N[1]=r[H].toJ().mixedAdd(r[U]),N[2]=r[H].toJ().mixedAdd(r[U].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],z=fa(i[H],i[U]);for(S=Math.max(z[0].length,S),g[H]=new Array(S),g[U]=new Array(S),D=0;D=0;_--){for(var T=0;_>=0;){var I=!0;for(D=0;D=0&&T++,K=K.dblp(T),_<0)break;for(D=0;D0?B=u[D][q-1>>1]:q<0&&(B=u[D][-q-1>>1].neg()),B.type==="affine"?K=K.mixedAdd(B):K=K.add(B))}}for(_=0;_=Math.ceil((t.bitLength()+1)/r.step):!1};_e.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],f=this,s=0;s=0&&(L=S,H=_),D.negative&&(D=D.neg(),B=B.neg()),L.negative&&(L=L.neg(),H=H.neg()),[{a:D,b:B},{a:L,b:H}]};Me.prototype._endoSplit=function(t){var r=this.endo.basis,i=r[0],f=r[1],s=f.b.mul(t).divRound(this.n),p=i.b.neg().mul(t).divRound(this.n),u=s.mul(i.a),g=p.mul(f.a),S=s.mul(i.b),_=p.mul(f.b),D=t.sub(u).sub(g),B=S.add(_).neg();return{k1:D,k2:B}};Me.prototype.pointFromX=function(t,r){t=new ne(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),f=i.redSqrt();if(f.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var s=f.fromRed().isOdd();return(r&&!s||!r&&s)&&(f=f.redNeg()),this.point(t,f)};Me.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,i=t.y,f=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(f).redIAdd(this.b);return i.redSqr().redISub(s).cmpn(0)===0};Me.prototype._endoWnafMulAdd=function(t,r,i){for(var f=this._endoWnafT1,s=this._endoWnafT2,p=0;p":""};he.prototype.isInfinity=function(){return this.inf};he.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(t.x),f=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,f)};he.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),f=t.redInvm(),s=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(f),p=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(p)).redISub(this.y);return this.curve.point(p,u)};he.prototype.getX=function(){return this.x.fromRed()};he.prototype.getY=function(){return this.y.fromRed()};he.prototype.mul=function(t){return t=new ne(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};he.prototype.mulAdd=function(t,r,i){var f=[this,r],s=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(f,s):this.curve._wnafMulAdd(1,f,s,2)};he.prototype.jmulAdd=function(t,r,i){var f=[this,r],s=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(f,s,!0):this.curve._wnafMulAdd(1,f,s,2,!0)};he.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};he.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,f=function(s){return s.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(f)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(f)}}}return r};he.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function de(e,t,r,i){Gr.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ne(0)):(this.x=new ne(t,16),this.y=new ne(r,16),this.z=new ne(i,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}Ni(de,Gr.BasePoint);Me.prototype.jpoint=function(t,r,i){return new de(this,t,r,i)};de.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),i=this.x.redMul(r),f=this.y.redMul(r).redMul(t);return this.curve.point(i,f)};de.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};de.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),i=this.z.redSqr(),f=this.x.redMul(r),s=t.x.redMul(i),p=this.y.redMul(r.redMul(t.z)),u=t.y.redMul(i.redMul(this.z)),g=f.redSub(s),S=p.redSub(u);if(g.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var _=g.redSqr(),D=_.redMul(g),B=f.redMul(_),L=S.redSqr().redIAdd(D).redISub(B).redISub(B),H=S.redMul(B.redISub(L)).redISub(p.redMul(D)),U=this.z.redMul(t.z).redMul(g);return this.curve.jpoint(L,H,U)};de.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),i=this.x,f=t.x.redMul(r),s=this.y,p=t.y.redMul(r).redMul(this.z),u=i.redSub(f),g=s.redSub(p);if(u.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=u.redSqr(),_=S.redMul(u),D=i.redMul(S),B=g.redSqr().redIAdd(_).redISub(D).redISub(D),L=g.redMul(D.redISub(B)).redISub(s.redMul(_)),H=this.z.redMul(u);return this.curve.jpoint(B,L,H)};de.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r=0)return!1;if(i.redIAdd(s),this.x.cmp(i)===0)return!0}};de.prototype.inspect=function(){return this.isInfinity()?"":""};de.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var qr=Pe.exports,Qn=$r.exports,C0=z0,ua=be;function Kr(e){C0.call(this,"mont",e),this.a=new qr(e.a,16).toRed(this.red),this.b=new qr(e.b,16).toRed(this.red),this.i4=new qr(4).toRed(this.red).redInvm(),this.two=new qr(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Qn(Kr,C0);var la=Kr;Kr.prototype.validate=function(t){var r=t.normalize().x,i=r.redSqr(),f=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r),s=f.redSqrt();return s.redSqr().cmp(f)===0};function ue(e,t,r){C0.BasePoint.call(this,e,"projective"),t===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new qr(t,16),this.z=new qr(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Qn(ue,C0.BasePoint);Kr.prototype.decodePoint=function(t,r){return this.point(ua.toArray(t,r),1)};Kr.prototype.point=function(t,r){return new ue(this,t,r)};Kr.prototype.pointFromJSON=function(t){return ue.fromJSON(this,t)};ue.prototype.precompute=function(){};ue.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};ue.fromJSON=function(t,r){return new ue(t,r[0],r[1]||t.one)};ue.prototype.inspect=function(){return this.isInfinity()?"":""};ue.prototype.isInfinity=function(){return this.z.cmpn(0)===0};ue.prototype.dbl=function(){var t=this.x.redAdd(this.z),r=t.redSqr(),i=this.x.redSub(this.z),f=i.redSqr(),s=r.redSub(f),p=r.redMul(f),u=s.redMul(f.redAdd(this.curve.a24.redMul(s)));return this.curve.point(p,u)};ue.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};ue.prototype.diffAdd=function(t,r){var i=this.x.redAdd(this.z),f=this.x.redSub(this.z),s=t.x.redAdd(t.z),p=t.x.redSub(t.z),u=p.redMul(i),g=s.redMul(f),S=r.z.redMul(u.redAdd(g).redSqr()),_=r.x.redMul(u.redISub(g).redSqr());return this.curve.point(S,_)};ue.prototype.mul=function(t){for(var r=t.clone(),i=this,f=this.curve.point(null,null),s=this,p=[];r.cmpn(0)!==0;r.iushrn(1))p.push(r.andln(1));for(var u=p.length-1;u>=0;u--)p[u]===0?(i=i.diffAdd(f,s),f=f.dbl()):(f=i.diffAdd(f,s),i=i.dbl());return f};ue.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};ue.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};ue.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};ue.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};ue.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var ca=be,Ye=Pe.exports,jn=$r.exports,k0=z0,da=ca.assert;function Ne(e){this.twisted=(e.a|0)!=1,this.mOneA=this.twisted&&(e.a|0)==-1,this.extended=this.mOneA,k0.call(this,"edwards",e),this.a=new Ye(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Ye(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Ye(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),da(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(e.c|0)==1}jn(Ne,k0);var va=Ne;Ne.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};Ne.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};Ne.prototype.jpoint=function(t,r,i,f){return this.point(t,r,i,f)};Ne.prototype.pointFromX=function(t,r){t=new Ye(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr(),f=this.c2.redSub(this.a.redMul(i)),s=this.one.redSub(this.c2.redMul(this.d).redMul(i)),p=f.redMul(s.redInvm()),u=p.redSqrt();if(u.redSqr().redSub(p).cmp(this.zero)!==0)throw new Error("invalid point");var g=u.fromRed().isOdd();return(r&&!g||!r&&g)&&(u=u.redNeg()),this.point(t,u)};Ne.prototype.pointFromY=function(t,r){t=new Ye(t,16),t.red||(t=t.toRed(this.red));var i=t.redSqr(),f=i.redSub(this.c2),s=i.redMul(this.d).redMul(this.c2).redSub(this.a),p=f.redMul(s.redInvm());if(p.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var u=p.redSqrt();if(u.redSqr().redSub(p).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,t)};Ne.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),i=t.y.redSqr(),f=r.redMul(this.a).redAdd(i),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return f.cmp(s)===0};function Kt(e,t,r,i,f){k0.BasePoint.call(this,e,"projective"),t===null&&r===null&&i===null?(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 Ye(t,16),this.y=new Ye(r,16),this.z=i?new Ye(i,16):this.curve.one,this.t=f&&new Ye(f,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()))))}jn(Kt,k0.BasePoint);Ne.prototype.pointFromJSON=function(t){return Kt.fromJSON(this,t)};Ne.prototype.point=function(t,r,i,f){return new Kt(this,t,r,i,f)};Kt.fromJSON=function(t,r){return new Kt(t,r[0],r[1],r[2])};Kt.prototype.inspect=function(){return this.isInfinity()?"":""};Kt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Kt.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var f=this.curve._mulA(t),s=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),p=f.redAdd(r),u=p.redSub(i),g=f.redSub(r),S=s.redMul(u),_=p.redMul(g),D=s.redMul(g),B=u.redMul(p);return this.curve.point(S,_,B,D)};Kt.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),i=this.y.redSqr(),f,s,p,u,g,S;if(this.curve.twisted){u=this.curve._mulA(r);var _=u.redAdd(i);this.zOne?(f=t.redSub(r).redSub(i).redMul(_.redSub(this.curve.two)),s=_.redMul(u.redSub(i)),p=_.redSqr().redSub(_).redSub(_)):(g=this.z.redSqr(),S=_.redSub(g).redISub(g),f=t.redSub(r).redISub(i).redMul(S),s=_.redMul(u.redSub(i)),p=_.redMul(S))}else u=r.redAdd(i),g=this.curve._mulC(this.z).redSqr(),S=u.redSub(g).redSub(g),f=this.curve._mulC(t.redISub(u)).redMul(S),s=this.curve._mulC(u).redMul(r.redISub(i)),p=u.redMul(S);return this.curve.point(f,s,p)};Kt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Kt.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),i=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),f=this.t.redMul(this.curve.dd).redMul(t.t),s=this.z.redMul(t.z.redAdd(t.z)),p=i.redSub(r),u=s.redSub(f),g=s.redAdd(f),S=i.redAdd(r),_=p.redMul(u),D=g.redMul(S),B=p.redMul(S),L=u.redMul(g);return this.curve.point(_,D,L,B)};Kt.prototype._projAdd=function(t){var r=this.z.redMul(t.z),i=r.redSqr(),f=this.x.redMul(t.x),s=this.y.redMul(t.y),p=this.curve.d.redMul(f).redMul(s),u=i.redSub(p),g=i.redAdd(p),S=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(f).redISub(s),_=r.redMul(u).redMul(S),D,B;return this.curve.twisted?(D=r.redMul(g).redMul(s.redSub(this.curve._mulA(f))),B=u.redMul(g)):(D=r.redMul(g).redMul(s.redSub(f)),B=this.curve._mulC(u).redMul(g)),this.curve.point(_,D,B)};Kt.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};Kt.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};Kt.prototype.mulAdd=function(t,r,i){return this.curve._wnafMulAdd(1,[this,r],[t,i],2,!1)};Kt.prototype.jmulAdd=function(t,r,i){return this.curve._wnafMulAdd(1,[this,r],[t,i],2,!0)};Kt.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this};Kt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Kt.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Kt.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Kt.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};Kt.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var i=t.clone(),f=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(f),this.x.cmp(r)===0)return!0}};Kt.prototype.toP=Kt.prototype.normalize;Kt.prototype.mixedAdd=Kt.prototype.add;(function(e){var t=e;t.base=z0,t.short=ha,t.mont=la,t.edwards=va})(Pi);var $0={},G0={},It={},pa=Er,xa=$r.exports;It.inherits=xa;function ga(e,t){return(e.charCodeAt(t)&64512)!=55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)==56320}function ma(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!=0&&(e="0"+e),f=0;f>6|192,r[i++]=s&63|128):ga(e,f)?(s=65536+((s&1023)<<10)+(e.charCodeAt(++f)&1023),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128)}else for(f=0;f>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}It.htonl=ts;function wa(e,t){for(var r="",i=0;i>>0}return s}It.join32=ba;function Sa(e,t){for(var r=new Array(e.length*4),i=0,f=0;i>>24,r[f+1]=s>>>16&255,r[f+2]=s>>>8&255,r[f+3]=s&255):(r[f+3]=s>>>24,r[f+2]=s>>>16&255,r[f+1]=s>>>8&255,r[f]=s&255)}return r}It.split32=Sa;function _a(e,t){return e>>>t|e<<32-t}It.rotr32=_a;function Ma(e,t){return e<>>32-t}It.rotl32=Ma;function Ea(e,t){return e+t>>>0}It.sum32=Ea;function Aa(e,t,r){return e+t+r>>>0}It.sum32_3=Aa;function Ta(e,t,r,i){return e+t+r+i>>>0}It.sum32_4=Ta;function Ba(e,t,r,i,f){return e+t+r+i+f>>>0}It.sum32_5=Ba;function Ra(e,t,r,i){var f=e[t],s=e[t+1],p=i+s>>>0,u=(p>>0,e[t+1]=p}It.sum64=Ra;function La(e,t,r,i){var f=t+i>>>0,s=(f>>0}It.sum64_hi=La;function Ia(e,t,r,i){var f=t+i;return f>>>0}It.sum64_lo=Ia;function Pa(e,t,r,i,f,s,p,u){var g=0,S=t;S=S+i>>>0,g+=S>>0,g+=S>>0,g+=S>>0}It.sum64_4_hi=Pa;function Na(e,t,r,i,f,s,p,u){var g=t+i+s+u;return g>>>0}It.sum64_4_lo=Na;function Ua(e,t,r,i,f,s,p,u,g,S){var _=0,D=t;D=D+i>>>0,_+=D>>0,_+=D>>0,_+=D>>0,_+=D>>0}It.sum64_5_hi=Ua;function Da(e,t,r,i,f,s,p,u,g,S){var _=t+i+s+u+S;return _>>>0}It.sum64_5_lo=Da;function Ha(e,t,r){var i=t<<32-r|e>>>r;return i>>>0}It.rotr64_hi=Ha;function Fa(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}It.rotr64_lo=Fa;function za(e,t,r){return e>>>r}It.shr64_hi=za;function Ca(e,t,r){var i=e<<32-r|t>>>r;return i>>>0}It.shr64_lo=Ca;var Yr={},is=It,ka=Er;function q0(){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}Yr.BlockHash=q0;q0.prototype.update=function(t,r){if(t=is.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var i=t.length%this._delta8;this.pending=t.slice(t.length-i,t.length),this.pending.length===0&&(this.pending=null),t=is.join32(t,0,t.length-i,this.endian);for(var f=0;f>>24&255,f[s++]=t>>>16&255,f[s++]=t>>>8&255,f[s++]=t&255}else for(f[s++]=t&255,f[s++]=t>>>8&255,f[s++]=t>>>16&255,f[s++]=t>>>24&255,f[s++]=0,f[s++]=0,f[s++]=0,f[s++]=0,p=8;p>>3}Ue.g0_256=Ya;function Oa(e){return De(e,17)^De(e,19)^e>>>10}Ue.g1_256=Oa;var Wr=It,Wa=Yr,Va=Ue,Ui=Wr.rotl32,d0=Wr.sum32,Ja=Wr.sum32_5,Xa=Va.ft_1,os=Wa.BlockHash,Za=[1518500249,1859775393,2400959708,3395469782];function He(){if(!(this instanceof He))return new He;os.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Wr.inherits(He,os);var Qa=He;He.blockSize=512;He.outSize=160;He.hmacStrength=80;He.padLength=64;He.prototype._update=function(t,r){for(var i=this.W,f=0;f<16;f++)i[f]=t[r+f];for(;fthis.blockSize&&(t=new this.Hash().update(t).digest()),Ch(t.length<=this.blockSize);for(var r=t.length;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var Gh=rr;rr.prototype._init=function(t,r,i){var f=t.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this._reseed=1};rr.prototype.generate=function(t,r,i,f){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(f=i,i=r,r=null),i&&(i=Br.toArray(i,f||"hex"),this._update(i));for(var s=[];s.length"};var Y0=Pe.exports,ki=be,Oh=ki.assert;function O0(e,t){if(e instanceof O0)return e;this._importDER(e,t)||(Oh(e.r&&e.s,"Signature without r or s"),this.r=new Y0(e.r,16),this.s=new Y0(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Wh=O0;function Vh(){this.place=0}function $i(e,t){var r=e[t.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var f=0,s=0,p=t.place;s>>=0;return f<=127?!1:(t.place=p,f)}function Ss(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}O0.prototype.toDER=function(t){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=Ss(r),i=Ss(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var f=[2];Gi(f,r.length),f=f.concat(r),f.push(2),Gi(f,i.length);var s=f.concat(i),p=[48];return Gi(p,s.length),p=p.concat(s),ki.encode(p,t)};var Rr=Pe.exports,_s=Gh,Jh=be,qi=$0,Xh=D0.exports,Ms=Jh.assert,Ki=Yh,W0=Wh;function Ee(e){if(!(this instanceof Ee))return new Ee(e);typeof e=="string"&&(Ms(Object.prototype.hasOwnProperty.call(qi,e),"Unknown curve "+e),e=qi[e]),e instanceof qi.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Zh=Ee;Ee.prototype.keyPair=function(t){return new Ki(this,t)};Ee.prototype.keyFromPrivate=function(t,r){return Ki.fromPrivate(this,t,r)};Ee.prototype.keyFromPublic=function(t,r){return Ki.fromPublic(this,t,r)};Ee.prototype.genKeyPair=function(t){t||(t={});for(var r=new _s({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Xh(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),f=this.n.sub(new Rr(2));;){var s=new Rr(r.generate(i));if(!(s.cmp(f)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Ee.prototype._truncateToN=function(t,r){var i=t.byteLength()*8-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t};Ee.prototype.sign=function(t,r,i,f){typeof i=="object"&&(f=i,i=null),f||(f={}),r=this.keyFromPrivate(r,i),t=this._truncateToN(new Rr(t,16));for(var s=this.n.byteLength(),p=r.getPrivate().toArray("be",s),u=t.toArray("be",s),g=new _s({hash:this.hash,entropy:p,nonce:u,pers:f.pers,persEnc:f.persEnc||"utf8"}),S=this.n.sub(new Rr(1)),_=0;;_++){var D=f.k?f.k(_):new Rr(g.generate(this.n.byteLength()));if(D=this._truncateToN(D,!0),!(D.cmpn(1)<=0||D.cmp(S)>=0)){var B=this.g.mul(D);if(!B.isInfinity()){var L=B.getX(),H=L.umod(this.n);if(H.cmpn(0)!==0){var U=D.invm(this.n).mul(H.mul(r.getPrivate()).iadd(t));if(U=U.umod(this.n),U.cmpn(0)!==0){var N=(B.getY().isOdd()?1:0)|(L.cmp(H)!==0?2:0);return f.canonical&&U.cmp(this.nh)>0&&(U=this.n.sub(U),N^=1),new W0({r:H,s:U,recoveryParam:N})}}}}}};Ee.prototype.verify=function(t,r,i,f){t=this._truncateToN(new Rr(t,16)),i=this.keyFromPublic(i,f),r=new W0(r,"hex");var s=r.r,p=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||p.cmpn(1)<0||p.cmp(this.n)>=0)return!1;var u=p.invm(this.n),g=u.mul(t).umod(this.n),S=u.mul(s).umod(this.n),_;return this.curve._maxwellTrick?(_=this.g.jmulAdd(g,i.getPublic(),S),_.isInfinity()?!1:_.eqXToP(s)):(_=this.g.mulAdd(g,i.getPublic(),S),_.isInfinity()?!1:_.getX().umod(this.n).cmp(s)===0)};Ee.prototype.recoverPubKey=function(e,t,r,i){Ms((3&r)===r,"The recovery param is more than two bits"),t=new W0(t,i);var f=this.n,s=new Rr(e),p=t.r,u=t.s,g=r&1,S=r>>1;if(p.cmp(this.curve.p.umod(this.curve.n))>=0&&S)throw new Error("Unable to find sencond key candinate");S?p=this.curve.pointFromX(p.add(this.curve.n),g):p=this.curve.pointFromX(p,g);var _=t.r.invm(f),D=f.sub(s).mul(_).umod(f),B=u.mul(_).umod(f);return this.g.mulAdd(D,p,B)};Ee.prototype.getKeyRecoveryParam=function(e,t,r,i){if(t=new W0(t,i),t.recoveryParam!==null)return t.recoveryParam;for(var f=0;f<4;f++){var s;try{s=this.recoverPubKey(e,t,f)}catch{continue}if(s.eq(r))return f}throw new Error("Unable to find valid recovery factor")};var p0=be,Es=p0.assert,As=p0.parseBytes,Zr=p0.cachedProperty;function le(e,t){this.eddsa=e,this._secret=As(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=As(t.pub)}le.fromPublic=function(t,r){return r instanceof le?r:new le(t,{pub:r})};le.fromSecret=function(t,r){return r instanceof le?r:new le(t,{secret:r})};le.prototype.secret=function(){return this._secret};Zr(le,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Zr(le,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Zr(le,"privBytes",function(){var t=this.eddsa,r=this.hash(),i=t.encodingLength-1,f=r.slice(0,t.encodingLength);return f[0]&=248,f[i]&=127,f[i]|=64,f});Zr(le,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Zr(le,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Zr(le,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});le.prototype.sign=function(t){return Es(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};le.prototype.verify=function(t,r){return this.eddsa.verify(t,r,this)};le.prototype.getSecret=function(t){return Es(this._secret,"KeyPair is public only"),p0.encode(this.secret(),t)};le.prototype.getPublic=function(t){return p0.encode(this.pubBytes(),t)};var Qh=le,jh=Pe.exports,V0=be,tu=V0.assert,J0=V0.cachedProperty,eu=V0.parseBytes;function Lr(e,t){this.eddsa=e,typeof t!="object"&&(t=eu(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),tu(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof jh&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}J0(Lr,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});J0(Lr,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});J0(Lr,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});J0(Lr,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Lr.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Lr.prototype.toHex=function(){return V0.encode(this.toBytes(),"hex").toUpperCase()};var ru=Lr,iu=G0,nu=$0,Qr=be,su=Qr.assert,Ts=Qr.parseBytes,Bs=Qh,Rs=ru;function ye(e){if(su(e==="ed25519","only tested with ed25519 so far"),!(this instanceof ye))return new ye(e);e=nu[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=iu.sha512}var fu=ye;ye.prototype.sign=function(t,r){t=Ts(t);var i=this.keyFromSecret(r),f=this.hashInt(i.messagePrefix(),t),s=this.g.mul(f),p=this.encodePoint(s),u=this.hashInt(p,i.pubBytes(),t).mul(i.priv()),g=f.add(u).umod(this.curve.n);return this.makeSignature({R:s,S:g,Rencoded:p})};ye.prototype.verify=function(t,r,i){t=Ts(t),r=this.makeSignature(r);var f=this.keyFromPublic(i),s=this.hashInt(r.Rencoded(),f.pubBytes(),t),p=this.g.mul(r.S()),u=r.R().add(f.pub().mul(s));return u.eq(p)};ye.prototype.hashInt=function(){for(var t=this.hash(),r=0;r0?n:o},s.min=function(n,o){return n.cmp(o)<0?n:o},s.prototype._init=function(n,o,l){if(typeof n=="number")return this._initNumber(n,o,l);if(typeof n=="object")return this._initArray(n,o,l);o==="hex"&&(o=16),i(o===(o|0)&&o>=2&&o<=36),n=n.toString().replace(/\s+/g,"");var m=0;n[0]==="-"&&(m++,this.negative=1),m=0;m-=3)y=n[m]|n[m-1]<<8|n[m-2]<<16,this.words[E]|=y<>>26-c&67108863,c+=24,c>=26&&(c-=26,E++);else if(l==="le")for(m=0,E=0;m>>26-c&67108863,c+=24,c>=26&&(c-=26,E++);return this._strip()};function u(a,n){var o=a.charCodeAt(n);if(o>=48&&o<=57)return o-48;if(o>=65&&o<=70)return o-55;if(o>=97&&o<=102)return o-87;i(!1,"Invalid character in "+a)}function g(a,n,o){var l=u(a,o);return o-1>=n&&(l|=u(a,o-1)<<4),l}s.prototype._parseHex=function(n,o,l){this.length=Math.ceil((n.length-o)/6),this.words=new Array(this.length);for(var m=0;m=o;m-=2)c=g(n,o,m)<=18?(E-=18,y+=1,this.words[y]|=c>>>26):E+=8;else{var v=n.length-o;for(m=v%2==0?o+1:o;m=18?(E-=18,y+=1,this.words[y]|=c>>>26):E+=8}this._strip()};function S(a,n,o,l){for(var m=0,E=0,y=Math.min(a.length,o),c=n;c=49?E=v-49+10:v>=17?E=v-17+10:E=v,i(v>=0&&E1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=D}catch{s.prototype.inspect=D}else s.prototype.inspect=D;function D(){return(this.red?""}var B=["","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"],L=[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],H=[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];s.prototype.toString=function(n,o){n=n||10,o=o|0||1;var l;if(n===16||n==="hex"){l="";for(var m=0,E=0,y=0;y>>24-m&16777215,E!==0||y!==this.length-1?l=B[6-v.length]+v+l:l=v+l,m+=2,m>=26&&(m-=26,y--)}for(E!==0&&(l=E.toString(16)+l);l.length%o!=0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}if(n===(n|0)&&n>=2&&n<=36){var d=L[n],A=H[n];l="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var J=Y.modrn(A).toString(n);Y=Y.idivn(A),Y.isZero()?l=J+l:l=B[d-J.length]+J+l}for(this.isZero()&&(l="0"+l);l.length%o!=0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var n=this.words[0];return this.length===2?n+=this.words[1]*67108864:this.length===3&&this.words[2]===1?n+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-n:n},s.prototype.toJSON=function(){return this.toString(16,2)},p&&(s.prototype.toBuffer=function(n,o){return this.toArrayLike(p,n,o)}),s.prototype.toArray=function(n,o){return this.toArrayLike(Array,n,o)};var U=function(n,o){return n.allocUnsafe?n.allocUnsafe(o):new n(o)};s.prototype.toArrayLike=function(n,o,l){this._strip();var m=this.byteLength(),E=l||Math.max(1,m);i(m<=E,"byte array longer than desired length"),i(E>0,"Requested array length <= 0");var y=U(n,E),c=o==="le"?"LE":"BE";return this["_toArrayLike"+c](y,m),y},s.prototype._toArrayLikeLE=function(n,o){for(var l=0,m=0,E=0,y=0;E>8&255),l>16&255),y===6?(l>24&255),m=0,y=0):(m=c>>>24,y+=2)}if(l=0&&(n[l--]=c>>8&255),l>=0&&(n[l--]=c>>16&255),y===6?(l>=0&&(n[l--]=c>>24&255),m=0,y=0):(m=c>>>24,y+=2)}if(l>=0)for(n[l--]=m;l>=0;)n[l--]=0},Math.clz32?s.prototype._countBits=function(n){return 32-Math.clz32(n)}:s.prototype._countBits=function(n){var o=n,l=0;return o>=4096&&(l+=13,o>>>=13),o>=64&&(l+=7,o>>>=7),o>=8&&(l+=4,o>>>=4),o>=2&&(l+=2,o>>>=2),l+o},s.prototype._zeroBits=function(n){if(n===0)return 26;var o=n,l=0;return(o&8191)==0&&(l+=13,o>>>=13),(o&127)==0&&(l+=7,o>>>=7),(o&15)==0&&(l+=4,o>>>=4),(o&3)==0&&(l+=2,o>>>=2),(o&1)==0&&l++,l},s.prototype.bitLength=function(){var n=this.words[this.length-1],o=this._countBits(n);return(this.length-1)*26+o};function N(a){for(var n=new Array(a.bitLength()),o=0;o>>m&1}return n}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,o=0;on.length?this.clone().ior(n):n.clone().ior(this)},s.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},s.prototype.iuand=function(n){var o;this.length>n.length?o=n:o=this;for(var l=0;ln.length?this.clone().iand(n):n.clone().iand(this)},s.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},s.prototype.iuxor=function(n){var o,l;this.length>n.length?(o=this,l=n):(o=n,l=this);for(var m=0;mn.length?this.clone().ixor(n):n.clone().ixor(this)},s.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},s.prototype.inotn=function(n){i(typeof n=="number"&&n>=0);var o=Math.ceil(n/26)|0,l=n%26;this._expand(o),l>0&&o--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-l),this._strip()},s.prototype.notn=function(n){return this.clone().inotn(n)},s.prototype.setn=function(n,o){i(typeof n=="number"&&n>=0);var l=n/26|0,m=n%26;return this._expand(l+1),o?this.words[l]=this.words[l]|1<n.length?(l=this,m=n):(l=n,m=this);for(var E=0,y=0;y>>26;for(;E!==0&&y>>26;if(this.length=l.length,E!==0)this.words[this.length]=E,this.length++;else if(l!==this)for(;yn.length?this.clone().iadd(n):n.clone().iadd(this)},s.prototype.isub=function(n){if(n.negative!==0){n.negative=0;var o=this.iadd(n);return n.negative=1,o._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var l=this.cmp(n);if(l===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,E;l>0?(m=this,E=n):(m=n,E=this);for(var y=0,c=0;c>26,this.words[c]=o&67108863;for(;y!==0&&c>26,this.words[c]=o&67108863;if(y===0&&c>>26,Y=v&67108863,J=Math.min(d,n.length-1),X=Math.max(0,d-a.length+1);X<=J;X++){var tt=d-X|0;m=a.words[tt]|0,E=n.words[X]|0,y=m*E+Y,A+=y/67108864|0,Y=y&67108863}o.words[d]=Y|0,v=A|0}return v!==0?o.words[d]=v|0:o.length--,o._strip()}var z=function(n,o,l){var m=n.words,E=o.words,y=l.words,c=0,v,d,A,Y=m[0]|0,J=Y&8191,X=Y>>>13,tt=m[1]|0,Z=tt&8191,Q=tt>>>13,at=m[2]|0,lt=at&8191,et=at>>>13,it=m[3]|0,bt=it&8191,ct=it>>>13,Ft=m[4]|0,Nt=Ft&8191,ht=Ft>>>13,Ct=m[5]|0,Ut=Ct&8191,st=Ct>>>13,pt=m[6]|0,Lt=pt&8191,dt=pt>>>13,Pt=m[7]|0,Dt=Pt&8191,F=Pt>>>13,x=m[8]|0,b=x&8191,G=x>>>13,O=m[9]|0,W=O&8191,V=O>>>13,nt=E[0]|0,ut=nt&8191,rt=nt>>>13,vt=E[1]|0,ot=vt&8191,St=vt>>>13,$t=E[2]|0,Yt=$t&8191,mt=$t>>>13,Ot=E[3]|0,Wt=Ot&8191,_t=Ot>>>13,Gt=E[4]|0,Vt=Gt&8191,Mt=Gt>>>13,qt=E[5]|0,Jt=qt&8191,yt=qt>>>13,Bt=E[6]|0,Ht=Bt&8191,wt=Bt>>>13,Xt=E[7]|0,jt=Xt&8191,Et=Xt>>>13,te=E[8]|0,ee=te&8191,At=te>>>13,re=E[9]|0,Zt=re&8191,Qt=re>>>13;l.negative=n.negative^o.negative,l.length=19,v=Math.imul(J,ut),d=Math.imul(J,rt),d=d+Math.imul(X,ut)|0,A=Math.imul(X,rt);var or=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(or>>>26)|0,or&=67108863,v=Math.imul(Z,ut),d=Math.imul(Z,rt),d=d+Math.imul(Q,ut)|0,A=Math.imul(Q,rt),v=v+Math.imul(J,ot)|0,d=d+Math.imul(J,St)|0,d=d+Math.imul(X,ot)|0,A=A+Math.imul(X,St)|0;var ar=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(ar>>>26)|0,ar&=67108863,v=Math.imul(lt,ut),d=Math.imul(lt,rt),d=d+Math.imul(et,ut)|0,A=Math.imul(et,rt),v=v+Math.imul(Z,ot)|0,d=d+Math.imul(Z,St)|0,d=d+Math.imul(Q,ot)|0,A=A+Math.imul(Q,St)|0,v=v+Math.imul(J,Yt)|0,d=d+Math.imul(J,mt)|0,d=d+Math.imul(X,Yt)|0,A=A+Math.imul(X,mt)|0;var hr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(hr>>>26)|0,hr&=67108863,v=Math.imul(bt,ut),d=Math.imul(bt,rt),d=d+Math.imul(ct,ut)|0,A=Math.imul(ct,rt),v=v+Math.imul(lt,ot)|0,d=d+Math.imul(lt,St)|0,d=d+Math.imul(et,ot)|0,A=A+Math.imul(et,St)|0,v=v+Math.imul(Z,Yt)|0,d=d+Math.imul(Z,mt)|0,d=d+Math.imul(Q,Yt)|0,A=A+Math.imul(Q,mt)|0,v=v+Math.imul(J,Wt)|0,d=d+Math.imul(J,_t)|0,d=d+Math.imul(X,Wt)|0,A=A+Math.imul(X,_t)|0;var ur=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(ur>>>26)|0,ur&=67108863,v=Math.imul(Nt,ut),d=Math.imul(Nt,rt),d=d+Math.imul(ht,ut)|0,A=Math.imul(ht,rt),v=v+Math.imul(bt,ot)|0,d=d+Math.imul(bt,St)|0,d=d+Math.imul(ct,ot)|0,A=A+Math.imul(ct,St)|0,v=v+Math.imul(lt,Yt)|0,d=d+Math.imul(lt,mt)|0,d=d+Math.imul(et,Yt)|0,A=A+Math.imul(et,mt)|0,v=v+Math.imul(Z,Wt)|0,d=d+Math.imul(Z,_t)|0,d=d+Math.imul(Q,Wt)|0,A=A+Math.imul(Q,_t)|0,v=v+Math.imul(J,Vt)|0,d=d+Math.imul(J,Mt)|0,d=d+Math.imul(X,Vt)|0,A=A+Math.imul(X,Mt)|0;var lr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(lr>>>26)|0,lr&=67108863,v=Math.imul(Ut,ut),d=Math.imul(Ut,rt),d=d+Math.imul(st,ut)|0,A=Math.imul(st,rt),v=v+Math.imul(Nt,ot)|0,d=d+Math.imul(Nt,St)|0,d=d+Math.imul(ht,ot)|0,A=A+Math.imul(ht,St)|0,v=v+Math.imul(bt,Yt)|0,d=d+Math.imul(bt,mt)|0,d=d+Math.imul(ct,Yt)|0,A=A+Math.imul(ct,mt)|0,v=v+Math.imul(lt,Wt)|0,d=d+Math.imul(lt,_t)|0,d=d+Math.imul(et,Wt)|0,A=A+Math.imul(et,_t)|0,v=v+Math.imul(Z,Vt)|0,d=d+Math.imul(Z,Mt)|0,d=d+Math.imul(Q,Vt)|0,A=A+Math.imul(Q,Mt)|0,v=v+Math.imul(J,Jt)|0,d=d+Math.imul(J,yt)|0,d=d+Math.imul(X,Jt)|0,A=A+Math.imul(X,yt)|0;var cr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(cr>>>26)|0,cr&=67108863,v=Math.imul(Lt,ut),d=Math.imul(Lt,rt),d=d+Math.imul(dt,ut)|0,A=Math.imul(dt,rt),v=v+Math.imul(Ut,ot)|0,d=d+Math.imul(Ut,St)|0,d=d+Math.imul(st,ot)|0,A=A+Math.imul(st,St)|0,v=v+Math.imul(Nt,Yt)|0,d=d+Math.imul(Nt,mt)|0,d=d+Math.imul(ht,Yt)|0,A=A+Math.imul(ht,mt)|0,v=v+Math.imul(bt,Wt)|0,d=d+Math.imul(bt,_t)|0,d=d+Math.imul(ct,Wt)|0,A=A+Math.imul(ct,_t)|0,v=v+Math.imul(lt,Vt)|0,d=d+Math.imul(lt,Mt)|0,d=d+Math.imul(et,Vt)|0,A=A+Math.imul(et,Mt)|0,v=v+Math.imul(Z,Jt)|0,d=d+Math.imul(Z,yt)|0,d=d+Math.imul(Q,Jt)|0,A=A+Math.imul(Q,yt)|0,v=v+Math.imul(J,Ht)|0,d=d+Math.imul(J,wt)|0,d=d+Math.imul(X,Ht)|0,A=A+Math.imul(X,wt)|0;var dr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(dr>>>26)|0,dr&=67108863,v=Math.imul(Dt,ut),d=Math.imul(Dt,rt),d=d+Math.imul(F,ut)|0,A=Math.imul(F,rt),v=v+Math.imul(Lt,ot)|0,d=d+Math.imul(Lt,St)|0,d=d+Math.imul(dt,ot)|0,A=A+Math.imul(dt,St)|0,v=v+Math.imul(Ut,Yt)|0,d=d+Math.imul(Ut,mt)|0,d=d+Math.imul(st,Yt)|0,A=A+Math.imul(st,mt)|0,v=v+Math.imul(Nt,Wt)|0,d=d+Math.imul(Nt,_t)|0,d=d+Math.imul(ht,Wt)|0,A=A+Math.imul(ht,_t)|0,v=v+Math.imul(bt,Vt)|0,d=d+Math.imul(bt,Mt)|0,d=d+Math.imul(ct,Vt)|0,A=A+Math.imul(ct,Mt)|0,v=v+Math.imul(lt,Jt)|0,d=d+Math.imul(lt,yt)|0,d=d+Math.imul(et,Jt)|0,A=A+Math.imul(et,yt)|0,v=v+Math.imul(Z,Ht)|0,d=d+Math.imul(Z,wt)|0,d=d+Math.imul(Q,Ht)|0,A=A+Math.imul(Q,wt)|0,v=v+Math.imul(J,jt)|0,d=d+Math.imul(J,Et)|0,d=d+Math.imul(X,jt)|0,A=A+Math.imul(X,Et)|0;var vr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(vr>>>26)|0,vr&=67108863,v=Math.imul(b,ut),d=Math.imul(b,rt),d=d+Math.imul(G,ut)|0,A=Math.imul(G,rt),v=v+Math.imul(Dt,ot)|0,d=d+Math.imul(Dt,St)|0,d=d+Math.imul(F,ot)|0,A=A+Math.imul(F,St)|0,v=v+Math.imul(Lt,Yt)|0,d=d+Math.imul(Lt,mt)|0,d=d+Math.imul(dt,Yt)|0,A=A+Math.imul(dt,mt)|0,v=v+Math.imul(Ut,Wt)|0,d=d+Math.imul(Ut,_t)|0,d=d+Math.imul(st,Wt)|0,A=A+Math.imul(st,_t)|0,v=v+Math.imul(Nt,Vt)|0,d=d+Math.imul(Nt,Mt)|0,d=d+Math.imul(ht,Vt)|0,A=A+Math.imul(ht,Mt)|0,v=v+Math.imul(bt,Jt)|0,d=d+Math.imul(bt,yt)|0,d=d+Math.imul(ct,Jt)|0,A=A+Math.imul(ct,yt)|0,v=v+Math.imul(lt,Ht)|0,d=d+Math.imul(lt,wt)|0,d=d+Math.imul(et,Ht)|0,A=A+Math.imul(et,wt)|0,v=v+Math.imul(Z,jt)|0,d=d+Math.imul(Z,Et)|0,d=d+Math.imul(Q,jt)|0,A=A+Math.imul(Q,Et)|0,v=v+Math.imul(J,ee)|0,d=d+Math.imul(J,At)|0,d=d+Math.imul(X,ee)|0,A=A+Math.imul(X,At)|0;var pr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(pr>>>26)|0,pr&=67108863,v=Math.imul(W,ut),d=Math.imul(W,rt),d=d+Math.imul(V,ut)|0,A=Math.imul(V,rt),v=v+Math.imul(b,ot)|0,d=d+Math.imul(b,St)|0,d=d+Math.imul(G,ot)|0,A=A+Math.imul(G,St)|0,v=v+Math.imul(Dt,Yt)|0,d=d+Math.imul(Dt,mt)|0,d=d+Math.imul(F,Yt)|0,A=A+Math.imul(F,mt)|0,v=v+Math.imul(Lt,Wt)|0,d=d+Math.imul(Lt,_t)|0,d=d+Math.imul(dt,Wt)|0,A=A+Math.imul(dt,_t)|0,v=v+Math.imul(Ut,Vt)|0,d=d+Math.imul(Ut,Mt)|0,d=d+Math.imul(st,Vt)|0,A=A+Math.imul(st,Mt)|0,v=v+Math.imul(Nt,Jt)|0,d=d+Math.imul(Nt,yt)|0,d=d+Math.imul(ht,Jt)|0,A=A+Math.imul(ht,yt)|0,v=v+Math.imul(bt,Ht)|0,d=d+Math.imul(bt,wt)|0,d=d+Math.imul(ct,Ht)|0,A=A+Math.imul(ct,wt)|0,v=v+Math.imul(lt,jt)|0,d=d+Math.imul(lt,Et)|0,d=d+Math.imul(et,jt)|0,A=A+Math.imul(et,Et)|0,v=v+Math.imul(Z,ee)|0,d=d+Math.imul(Z,At)|0,d=d+Math.imul(Q,ee)|0,A=A+Math.imul(Q,At)|0,v=v+Math.imul(J,Zt)|0,d=d+Math.imul(J,Qt)|0,d=d+Math.imul(X,Zt)|0,A=A+Math.imul(X,Qt)|0;var xr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(xr>>>26)|0,xr&=67108863,v=Math.imul(W,ot),d=Math.imul(W,St),d=d+Math.imul(V,ot)|0,A=Math.imul(V,St),v=v+Math.imul(b,Yt)|0,d=d+Math.imul(b,mt)|0,d=d+Math.imul(G,Yt)|0,A=A+Math.imul(G,mt)|0,v=v+Math.imul(Dt,Wt)|0,d=d+Math.imul(Dt,_t)|0,d=d+Math.imul(F,Wt)|0,A=A+Math.imul(F,_t)|0,v=v+Math.imul(Lt,Vt)|0,d=d+Math.imul(Lt,Mt)|0,d=d+Math.imul(dt,Vt)|0,A=A+Math.imul(dt,Mt)|0,v=v+Math.imul(Ut,Jt)|0,d=d+Math.imul(Ut,yt)|0,d=d+Math.imul(st,Jt)|0,A=A+Math.imul(st,yt)|0,v=v+Math.imul(Nt,Ht)|0,d=d+Math.imul(Nt,wt)|0,d=d+Math.imul(ht,Ht)|0,A=A+Math.imul(ht,wt)|0,v=v+Math.imul(bt,jt)|0,d=d+Math.imul(bt,Et)|0,d=d+Math.imul(ct,jt)|0,A=A+Math.imul(ct,Et)|0,v=v+Math.imul(lt,ee)|0,d=d+Math.imul(lt,At)|0,d=d+Math.imul(et,ee)|0,A=A+Math.imul(et,At)|0,v=v+Math.imul(Z,Zt)|0,d=d+Math.imul(Z,Qt)|0,d=d+Math.imul(Q,Zt)|0,A=A+Math.imul(Q,Qt)|0;var gr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(gr>>>26)|0,gr&=67108863,v=Math.imul(W,Yt),d=Math.imul(W,mt),d=d+Math.imul(V,Yt)|0,A=Math.imul(V,mt),v=v+Math.imul(b,Wt)|0,d=d+Math.imul(b,_t)|0,d=d+Math.imul(G,Wt)|0,A=A+Math.imul(G,_t)|0,v=v+Math.imul(Dt,Vt)|0,d=d+Math.imul(Dt,Mt)|0,d=d+Math.imul(F,Vt)|0,A=A+Math.imul(F,Mt)|0,v=v+Math.imul(Lt,Jt)|0,d=d+Math.imul(Lt,yt)|0,d=d+Math.imul(dt,Jt)|0,A=A+Math.imul(dt,yt)|0,v=v+Math.imul(Ut,Ht)|0,d=d+Math.imul(Ut,wt)|0,d=d+Math.imul(st,Ht)|0,A=A+Math.imul(st,wt)|0,v=v+Math.imul(Nt,jt)|0,d=d+Math.imul(Nt,Et)|0,d=d+Math.imul(ht,jt)|0,A=A+Math.imul(ht,Et)|0,v=v+Math.imul(bt,ee)|0,d=d+Math.imul(bt,At)|0,d=d+Math.imul(ct,ee)|0,A=A+Math.imul(ct,At)|0,v=v+Math.imul(lt,Zt)|0,d=d+Math.imul(lt,Qt)|0,d=d+Math.imul(et,Zt)|0,A=A+Math.imul(et,Qt)|0;var mr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(mr>>>26)|0,mr&=67108863,v=Math.imul(W,Wt),d=Math.imul(W,_t),d=d+Math.imul(V,Wt)|0,A=Math.imul(V,_t),v=v+Math.imul(b,Vt)|0,d=d+Math.imul(b,Mt)|0,d=d+Math.imul(G,Vt)|0,A=A+Math.imul(G,Mt)|0,v=v+Math.imul(Dt,Jt)|0,d=d+Math.imul(Dt,yt)|0,d=d+Math.imul(F,Jt)|0,A=A+Math.imul(F,yt)|0,v=v+Math.imul(Lt,Ht)|0,d=d+Math.imul(Lt,wt)|0,d=d+Math.imul(dt,Ht)|0,A=A+Math.imul(dt,wt)|0,v=v+Math.imul(Ut,jt)|0,d=d+Math.imul(Ut,Et)|0,d=d+Math.imul(st,jt)|0,A=A+Math.imul(st,Et)|0,v=v+Math.imul(Nt,ee)|0,d=d+Math.imul(Nt,At)|0,d=d+Math.imul(ht,ee)|0,A=A+Math.imul(ht,At)|0,v=v+Math.imul(bt,Zt)|0,d=d+Math.imul(bt,Qt)|0,d=d+Math.imul(ct,Zt)|0,A=A+Math.imul(ct,Qt)|0;var yr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(yr>>>26)|0,yr&=67108863,v=Math.imul(W,Vt),d=Math.imul(W,Mt),d=d+Math.imul(V,Vt)|0,A=Math.imul(V,Mt),v=v+Math.imul(b,Jt)|0,d=d+Math.imul(b,yt)|0,d=d+Math.imul(G,Jt)|0,A=A+Math.imul(G,yt)|0,v=v+Math.imul(Dt,Ht)|0,d=d+Math.imul(Dt,wt)|0,d=d+Math.imul(F,Ht)|0,A=A+Math.imul(F,wt)|0,v=v+Math.imul(Lt,jt)|0,d=d+Math.imul(Lt,Et)|0,d=d+Math.imul(dt,jt)|0,A=A+Math.imul(dt,Et)|0,v=v+Math.imul(Ut,ee)|0,d=d+Math.imul(Ut,At)|0,d=d+Math.imul(st,ee)|0,A=A+Math.imul(st,At)|0,v=v+Math.imul(Nt,Zt)|0,d=d+Math.imul(Nt,Qt)|0,d=d+Math.imul(ht,Zt)|0,A=A+Math.imul(ht,Qt)|0;var wr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(wr>>>26)|0,wr&=67108863,v=Math.imul(W,Jt),d=Math.imul(W,yt),d=d+Math.imul(V,Jt)|0,A=Math.imul(V,yt),v=v+Math.imul(b,Ht)|0,d=d+Math.imul(b,wt)|0,d=d+Math.imul(G,Ht)|0,A=A+Math.imul(G,wt)|0,v=v+Math.imul(Dt,jt)|0,d=d+Math.imul(Dt,Et)|0,d=d+Math.imul(F,jt)|0,A=A+Math.imul(F,Et)|0,v=v+Math.imul(Lt,ee)|0,d=d+Math.imul(Lt,At)|0,d=d+Math.imul(dt,ee)|0,A=A+Math.imul(dt,At)|0,v=v+Math.imul(Ut,Zt)|0,d=d+Math.imul(Ut,Qt)|0,d=d+Math.imul(st,Zt)|0,A=A+Math.imul(st,Qt)|0;var br=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(br>>>26)|0,br&=67108863,v=Math.imul(W,Ht),d=Math.imul(W,wt),d=d+Math.imul(V,Ht)|0,A=Math.imul(V,wt),v=v+Math.imul(b,jt)|0,d=d+Math.imul(b,Et)|0,d=d+Math.imul(G,jt)|0,A=A+Math.imul(G,Et)|0,v=v+Math.imul(Dt,ee)|0,d=d+Math.imul(Dt,At)|0,d=d+Math.imul(F,ee)|0,A=A+Math.imul(F,At)|0,v=v+Math.imul(Lt,Zt)|0,d=d+Math.imul(Lt,Qt)|0,d=d+Math.imul(dt,Zt)|0,A=A+Math.imul(dt,Qt)|0;var Sr=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,v=Math.imul(W,jt),d=Math.imul(W,Et),d=d+Math.imul(V,jt)|0,A=Math.imul(V,Et),v=v+Math.imul(b,ee)|0,d=d+Math.imul(b,At)|0,d=d+Math.imul(G,ee)|0,A=A+Math.imul(G,At)|0,v=v+Math.imul(Dt,Zt)|0,d=d+Math.imul(Dt,Qt)|0,d=d+Math.imul(F,Zt)|0,A=A+Math.imul(F,Qt)|0;var _r=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(_r>>>26)|0,_r&=67108863,v=Math.imul(W,ee),d=Math.imul(W,At),d=d+Math.imul(V,ee)|0,A=Math.imul(V,At),v=v+Math.imul(b,Zt)|0,d=d+Math.imul(b,Qt)|0,d=d+Math.imul(G,Zt)|0,A=A+Math.imul(G,Qt)|0;var ai=(c+v|0)+((d&8191)<<13)|0;c=(A+(d>>>13)|0)+(ai>>>26)|0,ai&=67108863,v=Math.imul(W,Zt),d=Math.imul(W,Qt),d=d+Math.imul(V,Zt)|0,A=Math.imul(V,Qt);var hi=(c+v|0)+((d&8191)<<13)|0;return c=(A+(d>>>13)|0)+(hi>>>26)|0,hi&=67108863,y[0]=or,y[1]=ar,y[2]=hr,y[3]=ur,y[4]=lr,y[5]=cr,y[6]=dr,y[7]=vr,y[8]=pr,y[9]=xr,y[10]=gr,y[11]=mr,y[12]=yr,y[13]=wr,y[14]=br,y[15]=Sr,y[16]=_r,y[17]=ai,y[18]=hi,c!==0&&(y[19]=c,l.length++),l};Math.imul||(z=P);function k(a,n,o){o.negative=n.negative^a.negative,o.length=a.length+n.length;for(var l=0,m=0,E=0;E>>26)|0,m+=y>>>26,y&=67108863}o.words[E]=c,l=y,y=m}return l!==0?o.words[E]=l:o.length--,o._strip()}function $(a,n,o){return k(a,n,o)}s.prototype.mulTo=function(n,o){var l,m=this.length+n.length;return this.length===10&&n.length===10?l=z(this,n,o):m<63?l=P(this,n,o):m<1024?l=k(this,n,o):l=$(this,n,o),l},s.prototype.mul=function(n){var o=new s(null);return o.words=new Array(this.length+n.length),this.mulTo(n,o)},s.prototype.mulf=function(n){var o=new s(null);return o.words=new Array(this.length+n.length),$(this,n,o)},s.prototype.imul=function(n){return this.clone().mulTo(n,this)},s.prototype.imuln=function(n){var o=n<0;o&&(n=-n),i(typeof n=="number"),i(n<67108864);for(var l=0,m=0;m>=26,l+=E/67108864|0,l+=y>>>26,this.words[m]=y&67108863}return l!==0&&(this.words[m]=l,this.length++),o?this.ineg():this},s.prototype.muln=function(n){return this.clone().imuln(n)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(n){var o=N(n);if(o.length===0)return new s(1);for(var l=this,m=0;m=0);var o=n%26,l=(n-o)/26,m=67108863>>>26-o<<26-o,E;if(o!==0){var y=0;for(E=0;E>>26-o}y&&(this.words[E]=y,this.length++)}if(l!==0){for(E=this.length-1;E>=0;E--)this.words[E+l]=this.words[E];for(E=0;E=0);var m;o?m=(o-o%26)/26:m=0;var E=n%26,y=Math.min((n-E)/26,this.length),c=67108863^67108863>>>E<y)for(this.length-=y,d=0;d=0&&(A!==0||d>=m);d--){var Y=this.words[d]|0;this.words[d]=A<<26-E|Y>>>E,A=Y&c}return v&&A!==0&&(v.words[v.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(n,o,l){return i(this.negative===0),this.iushrn(n,o,l)},s.prototype.shln=function(n){return this.clone().ishln(n)},s.prototype.ushln=function(n){return this.clone().iushln(n)},s.prototype.shrn=function(n){return this.clone().ishrn(n)},s.prototype.ushrn=function(n){return this.clone().iushrn(n)},s.prototype.testn=function(n){i(typeof n=="number"&&n>=0);var o=n%26,l=(n-o)/26,m=1<=0);var o=n%26,l=(n-o)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=l)return this;if(o!==0&&l++,this.length=Math.min(l,this.length),o!==0){var m=67108863^67108863>>>o<=67108864;o++)this.words[o]-=67108864,o===this.length-1?this.words[o+1]=1:this.words[o+1]++;return this.length=Math.max(this.length,o+1),this},s.prototype.isubn=function(n){if(i(typeof n=="number"),i(n<67108864),n<0)return this.iaddn(-n);if(this.negative!==0)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var o=0;o>26)-(v/67108864|0),this.words[E+l]=y&67108863}for(;E>26,this.words[E+l]=y&67108863;if(c===0)return this._strip();for(i(c===-1),c=0,E=0;E>26,this.words[E]=y&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(n,o){var l=this.length-n.length,m=this.clone(),E=n,y=E.words[E.length-1]|0,c=this._countBits(y);l=26-c,l!==0&&(E=E.ushln(l),m.iushln(l),y=E.words[E.length-1]|0);var v=m.length-E.length,d;if(o!=="mod"){d=new s(null),d.length=v+1,d.words=new Array(d.length);for(var A=0;A=0;J--){var X=(m.words[E.length+J]|0)*67108864+(m.words[E.length+J-1]|0);for(X=Math.min(X/y|0,67108863),m._ishlnsubmul(E,X,J);m.negative!==0;)X--,m.negative=0,m._ishlnsubmul(E,1,J),m.isZero()||(m.negative^=1);d&&(d.words[J]=X)}return d&&d._strip(),m._strip(),o!=="div"&&l!==0&&m.iushrn(l),{div:d||null,mod:m}},s.prototype.divmod=function(n,o,l){if(i(!n.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,E,y;return this.negative!==0&&n.negative===0?(y=this.neg().divmod(n,o),o!=="mod"&&(m=y.div.neg()),o!=="div"&&(E=y.mod.neg(),l&&E.negative!==0&&E.iadd(n)),{div:m,mod:E}):this.negative===0&&n.negative!==0?(y=this.divmod(n.neg(),o),o!=="mod"&&(m=y.div.neg()),{div:m,mod:y.mod}):(this.negative&n.negative)!=0?(y=this.neg().divmod(n.neg(),o),o!=="div"&&(E=y.mod.neg(),l&&E.negative!==0&&E.isub(n)),{div:y.div,mod:E}):n.length>this.length||this.cmp(n)<0?{div:new s(0),mod:this}:n.length===1?o==="div"?{div:this.divn(n.words[0]),mod:null}:o==="mod"?{div:null,mod:new s(this.modrn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new s(this.modrn(n.words[0]))}:this._wordDiv(n,o)},s.prototype.div=function(n){return this.divmod(n,"div",!1).div},s.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},s.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},s.prototype.divRound=function(n){var o=this.divmod(n);if(o.mod.isZero())return o.div;var l=o.div.negative!==0?o.mod.isub(n):o.mod,m=n.ushrn(1),E=n.andln(1),y=l.cmp(m);return y<0||E===1&&y===0?o.div:o.div.negative!==0?o.div.isubn(1):o.div.iaddn(1)},s.prototype.modrn=function(n){var o=n<0;o&&(n=-n),i(n<=67108863);for(var l=(1<<26)%n,m=0,E=this.length-1;E>=0;E--)m=(l*m+(this.words[E]|0))%n;return o?-m:m},s.prototype.modn=function(n){return this.modrn(n)},s.prototype.idivn=function(n){var o=n<0;o&&(n=-n),i(n<=67108863);for(var l=0,m=this.length-1;m>=0;m--){var E=(this.words[m]|0)+l*67108864;this.words[m]=E/n|0,l=E%n}return this._strip(),o?this.ineg():this},s.prototype.divn=function(n){return this.clone().idivn(n)},s.prototype.egcd=function(n){i(n.negative===0),i(!n.isZero());var o=this,l=n.clone();o.negative!==0?o=o.umod(n):o=o.clone();for(var m=new s(1),E=new s(0),y=new s(0),c=new s(1),v=0;o.isEven()&&l.isEven();)o.iushrn(1),l.iushrn(1),++v;for(var d=l.clone(),A=o.clone();!o.isZero();){for(var Y=0,J=1;(o.words[0]&J)==0&&Y<26;++Y,J<<=1);if(Y>0)for(o.iushrn(Y);Y-- >0;)(m.isOdd()||E.isOdd())&&(m.iadd(d),E.isub(A)),m.iushrn(1),E.iushrn(1);for(var X=0,tt=1;(l.words[0]&tt)==0&&X<26;++X,tt<<=1);if(X>0)for(l.iushrn(X);X-- >0;)(y.isOdd()||c.isOdd())&&(y.iadd(d),c.isub(A)),y.iushrn(1),c.iushrn(1);o.cmp(l)>=0?(o.isub(l),m.isub(y),E.isub(c)):(l.isub(o),y.isub(m),c.isub(E))}return{a:y,b:c,gcd:l.iushln(v)}},s.prototype._invmp=function(n){i(n.negative===0),i(!n.isZero());var o=this,l=n.clone();o.negative!==0?o=o.umod(n):o=o.clone();for(var m=new s(1),E=new s(0),y=l.clone();o.cmpn(1)>0&&l.cmpn(1)>0;){for(var c=0,v=1;(o.words[0]&v)==0&&c<26;++c,v<<=1);if(c>0)for(o.iushrn(c);c-- >0;)m.isOdd()&&m.iadd(y),m.iushrn(1);for(var d=0,A=1;(l.words[0]&A)==0&&d<26;++d,A<<=1);if(d>0)for(l.iushrn(d);d-- >0;)E.isOdd()&&E.iadd(y),E.iushrn(1);o.cmp(l)>=0?(o.isub(l),m.isub(E)):(l.isub(o),E.isub(m))}var Y;return o.cmpn(1)===0?Y=m:Y=E,Y.cmpn(0)<0&&Y.iadd(n),Y},s.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var o=this.clone(),l=n.clone();o.negative=0,l.negative=0;for(var m=0;o.isEven()&&l.isEven();m++)o.iushrn(1),l.iushrn(1);do{for(;o.isEven();)o.iushrn(1);for(;l.isEven();)l.iushrn(1);var E=o.cmp(l);if(E<0){var y=o;o=l,l=y}else if(E===0||l.cmpn(1)===0)break;o.isub(l)}while(!0);return l.iushln(m)},s.prototype.invm=function(n){return this.egcd(n).a.umod(n)},s.prototype.isEven=function(){return(this.words[0]&1)==0},s.prototype.isOdd=function(){return(this.words[0]&1)==1},s.prototype.andln=function(n){return this.words[0]&n},s.prototype.bincn=function(n){i(typeof n=="number");var o=n%26,l=(n-o)/26,m=1<>>26,c&=67108863,this.words[y]=c}return E!==0&&(this.words[y]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(n){var o=n<0;if(this.negative!==0&&!o)return-1;if(this.negative===0&&o)return 1;this._strip();var l;if(this.length>1)l=1;else{o&&(n=-n),i(n<=67108863,"Number is too big");var m=this.words[0]|0;l=m===n?0:mn.length)return 1;if(this.length=0;l--){var m=this.words[l]|0,E=n.words[l]|0;if(m!==E){mE&&(o=1);break}}return o},s.prototype.gtn=function(n){return this.cmpn(n)===1},s.prototype.gt=function(n){return this.cmp(n)===1},s.prototype.gten=function(n){return this.cmpn(n)>=0},s.prototype.gte=function(n){return this.cmp(n)>=0},s.prototype.ltn=function(n){return this.cmpn(n)===-1},s.prototype.lt=function(n){return this.cmp(n)===-1},s.prototype.lten=function(n){return this.cmpn(n)<=0},s.prototype.lte=function(n){return this.cmp(n)<=0},s.prototype.eqn=function(n){return this.cmpn(n)===0},s.prototype.eq=function(n){return this.cmp(n)===0},s.red=function(n){return new w(n)},s.prototype.toRed=function(n){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),n.convertTo(this)._forceRed(n)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(n){return this.red=n,this},s.prototype.forceRed=function(n){return i(!this.red,"Already a number in reduction context"),this._forceRed(n)},s.prototype.redAdd=function(n){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},s.prototype.redIAdd=function(n){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},s.prototype.redSub=function(n){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},s.prototype.redISub=function(n){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},s.prototype.redShl=function(n){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},s.prototype.redMul=function(n){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},s.prototype.redIMul=function(n){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(n){return i(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var K={k256:null,p224:null,p192:null,p25519:null};function M(a,n){this.name=a,this.p=new s(n,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}M.prototype._tmp=function(){var n=new s(null);return n.words=new Array(Math.ceil(this.n/13)),n},M.prototype.ireduce=function(n){var o=n,l;do this.split(o,this.tmp),o=this.imulK(o),o=o.iadd(this.tmp),l=o.bitLength();while(l>this.n);var m=l0?o.isub(this.p):o.strip!==void 0?o.strip():o._strip(),o},M.prototype.split=function(n,o){n.iushrn(this.n,0,o)},M.prototype.imulK=function(n){return n.imul(this.k)};function T(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}f(T,M),T.prototype.split=function(n,o){for(var l=4194303,m=Math.min(n.length,9),E=0;E>>22,y=c}y>>>=22,n.words[E-10]=y,y===0&&n.length>10?n.length-=10:n.length-=9},T.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var o=0,l=0;l>>=26,n.words[l]=E,o=m}return o!==0&&(n.words[n.length++]=o),n},s._prime=function(n){if(K[n])return K[n];var o;if(n==="k256")o=new T;else if(n==="p224")o=new I;else if(n==="p192")o=new q;else if(n==="p25519")o=new C;else throw new Error("Unknown prime "+n);return K[n]=o,o};function w(a){if(typeof a=="string"){var n=s._prime(a);this.m=n.p,this.prime=n}else i(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}w.prototype._verify1=function(n){i(n.negative===0,"red works only with positives"),i(n.red,"red works only with red numbers")},w.prototype._verify2=function(n,o){i((n.negative|o.negative)==0,"red works only with positives"),i(n.red&&n.red===o.red,"red works only with red numbers")},w.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):(_(n,n.umod(this.m)._forceRed(this)),n)},w.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},w.prototype.add=function(n,o){this._verify2(n,o);var l=n.add(o);return l.cmp(this.m)>=0&&l.isub(this.m),l._forceRed(this)},w.prototype.iadd=function(n,o){this._verify2(n,o);var l=n.iadd(o);return l.cmp(this.m)>=0&&l.isub(this.m),l},w.prototype.sub=function(n,o){this._verify2(n,o);var l=n.sub(o);return l.cmpn(0)<0&&l.iadd(this.m),l._forceRed(this)},w.prototype.isub=function(n,o){this._verify2(n,o);var l=n.isub(o);return l.cmpn(0)<0&&l.iadd(this.m),l},w.prototype.shl=function(n,o){return this._verify1(n),this.imod(n.ushln(o))},w.prototype.imul=function(n,o){return this._verify2(n,o),this.imod(n.imul(o))},w.prototype.mul=function(n,o){return this._verify2(n,o),this.imod(n.mul(o))},w.prototype.isqr=function(n){return this.imul(n,n.clone())},w.prototype.sqr=function(n){return this.mul(n,n)},w.prototype.sqrt=function(n){if(n.isZero())return n.clone();var o=this.m.andln(3);if(i(o%2==1),o===3){var l=this.m.add(new s(1)).iushrn(2);return this.pow(n,l)}for(var m=this.m.subn(1),E=0;!m.isZero()&&m.andln(1)===0;)E++,m.iushrn(1);i(!m.isZero());var y=new s(1).toRed(this),c=y.redNeg(),v=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,v).cmp(c)!==0;)d.redIAdd(c);for(var A=this.pow(d,m),Y=this.pow(n,m.addn(1).iushrn(1)),J=this.pow(n,m),X=E;J.cmp(y)!==0;){for(var tt=J,Z=0;tt.cmp(y)!==0;Z++)tt=tt.redSqr();i(Z=0;E--){for(var A=o.words[E],Y=d-1;Y>=0;Y--){var J=A>>Y&1;if(y!==m[0]&&(y=this.sqr(y)),J===0&&c===0){v=0;continue}c<<=1,c|=J,v++,!(v!==l&&(E!==0||Y!==0))&&(y=this.mul(y,m[c]),v=0,c=0)}d=26}return y},w.prototype.convertTo=function(n){var o=n.umod(this.m);return o===n?o.clone():o},w.prototype.convertFrom=function(n){var o=n.clone();return o.red=null,o},s.mont=function(n){return new h(n)};function h(a){w.call(this,a),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}f(h,w),h.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},h.prototype.convertFrom=function(n){var o=this.imod(n.mul(this.rinv));return o.red=null,o},h.prototype.imul=function(n,o){if(n.isZero()||o.isZero())return n.words[0]=0,n.length=1,n;var l=n.imul(o),m=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=l.isub(m).iushrn(this.shift),y=E;return E.cmp(this.m)>=0?y=E.isub(this.m):E.cmpn(0)<0&&(y=E.iadd(this.m)),y._forceRed(this)},h.prototype.mul=function(n,o){if(n.isZero()||o.isZero())return new s(0)._forceRed(this);var l=n.mul(o),m=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=l.isub(m).iushrn(this.shift),y=E;return E.cmp(this.m)>=0?y=E.isub(this.m):E.cmpn(0)<0&&(y=E.iadd(this.m)),y._forceRed(this)},h.prototype.invm=function(n){var o=this.imod(n._invmp(this.m).mul(this.r2));return o._forceRed(this)}})(e,gt)})(Ls);var fe=Ls.exports,ve={},X0={};X0.byteLength=hu;X0.toByteArray=lu;X0.fromByteArray=vu;var $e=[],Ae=[],ou=typeof Uint8Array!="undefined"?Uint8Array:Array,Yi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var jr=0,au=Yi.length;jr0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var i=r===t?0:4-r%4;return[r,i]}function hu(e){var t=Is(e),r=t[0],i=t[1];return(r+i)*3/4-i}function uu(e,t,r){return(t+r)*3/4-r}function lu(e){var t,r=Is(e),i=r[0],f=r[1],s=new ou(uu(e,i,f)),p=0,u=f>0?i-4:i,g;for(g=0;g>16&255,s[p++]=t>>8&255,s[p++]=t&255;return f===2&&(t=Ae[e.charCodeAt(g)]<<2|Ae[e.charCodeAt(g+1)]>>4,s[p++]=t&255),f===1&&(t=Ae[e.charCodeAt(g)]<<10|Ae[e.charCodeAt(g+1)]<<4|Ae[e.charCodeAt(g+2)]>>2,s[p++]=t>>8&255,s[p++]=t&255),s}function cu(e){return $e[e>>18&63]+$e[e>>12&63]+$e[e>>6&63]+$e[e&63]}function du(e,t,r){for(var i,f=[],s=t;su?u:p+s));return i===1?(t=e[r-1],f.push($e[t>>2]+$e[t<<4&63]+"==")):i===2&&(t=(e[r-2]<<8)+e[r-1],f.push($e[t>>10]+$e[t>>4&63]+$e[t<<2&63]+"=")),f.join("")}var Oi={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Oi.read=function(e,t,r,i,f){var s,p,u=f*8-i-1,g=(1<>1,_=-7,D=r?f-1:0,B=r?-1:1,L=e[t+D];for(D+=B,s=L&(1<<-_)-1,L>>=-_,_+=u;_>0;s=s*256+e[t+D],D+=B,_-=8);for(p=s&(1<<-_)-1,s>>=-_,_+=i;_>0;p=p*256+e[t+D],D+=B,_-=8);if(s===0)s=1-S;else{if(s===g)return p?NaN:(L?-1:1)*(1/0);p=p+Math.pow(2,i),s=s-S}return(L?-1:1)*p*Math.pow(2,s-i)};Oi.write=function(e,t,r,i,f,s){var p,u,g,S=s*8-f-1,_=(1<>1,B=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=i?0:s-1,H=i?1:-1,U=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,p=_):(p=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+D>=1?t+=B/g:t+=B*Math.pow(2,1-D),t*g>=2&&(p++,g/=2),p+D>=_?(u=0,p=_):p+D>=1?(u=(t*g-1)*Math.pow(2,f),p=p+D):(u=t*Math.pow(2,D-1)*Math.pow(2,f),p=0));f>=8;e[r+L]=u&255,L+=H,u/=256,f-=8);for(p=p<0;e[r+L]=p&255,L+=H,p/=256,S-=8);e[r+L-H]|=U*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(e){const t=X0,r=Oi,i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=z,e.INSPECT_MAX_BYTES=50;const f=2147483647;e.kMaxLength=f,u.TYPED_ARRAY_SUPPORT=s(),!u.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const F=new Uint8Array(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,Uint8Array.prototype),Object.setPrototypeOf(F,x),F.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function p(F){if(F>f)throw new RangeError('The value "'+F+'" is invalid for option "size"');const x=new Uint8Array(F);return Object.setPrototypeOf(x,u.prototype),x}function u(F,x,b){if(typeof F=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return D(F)}return g(F,x,b)}u.poolSize=8192;function g(F,x,b){if(typeof F=="string")return B(F,x);if(ArrayBuffer.isView(F))return H(F);if(F==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F);if(pt(F,ArrayBuffer)||F&&pt(F.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(pt(F,SharedArrayBuffer)||F&&pt(F.buffer,SharedArrayBuffer)))return U(F,x,b);if(typeof F=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const G=F.valueOf&&F.valueOf();if(G!=null&&G!==F)return u.from(G,x,b);const O=N(F);if(O)return O;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof F[Symbol.toPrimitive]=="function")return u.from(F[Symbol.toPrimitive]("string"),x,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F)}u.from=function(F,x,b){return g(F,x,b)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function S(F){if(typeof F!="number")throw new TypeError('"size" argument must be of type number');if(F<0)throw new RangeError('The value "'+F+'" is invalid for option "size"')}function _(F,x,b){return S(F),F<=0?p(F):x!==void 0?typeof b=="string"?p(F).fill(x,b):p(F).fill(x):p(F)}u.alloc=function(F,x,b){return _(F,x,b)};function D(F){return S(F),p(F<0?0:P(F)|0)}u.allocUnsafe=function(F){return D(F)},u.allocUnsafeSlow=function(F){return D(F)};function B(F,x){if((typeof x!="string"||x==="")&&(x="utf8"),!u.isEncoding(x))throw new TypeError("Unknown encoding: "+x);const b=k(F,x)|0;let G=p(b);const O=G.write(F,x);return O!==b&&(G=G.slice(0,O)),G}function L(F){const x=F.length<0?0:P(F.length)|0,b=p(x);for(let G=0;G=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return F|0}function z(F){return+F!=F&&(F=0),u.alloc(+F)}u.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==u.prototype},u.compare=function(x,b){if(pt(x,Uint8Array)&&(x=u.from(x,x.offset,x.byteLength)),pt(b,Uint8Array)&&(b=u.from(b,b.offset,b.byteLength)),!u.isBuffer(x)||!u.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===b)return 0;let G=x.length,O=b.length;for(let W=0,V=Math.min(G,O);WO.length?(u.isBuffer(V)||(V=u.from(V)),V.copy(O,W)):Uint8Array.prototype.set.call(O,V,W);else if(u.isBuffer(V))V.copy(O,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=V.length}return O};function k(F,x){if(u.isBuffer(F))return F.length;if(ArrayBuffer.isView(F)||pt(F,ArrayBuffer))return F.byteLength;if(typeof F!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof F);const b=F.length,G=arguments.length>2&&arguments[2]===!0;if(!G&&b===0)return 0;let O=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return Nt(F).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return Ut(F).length;default:if(O)return G?-1:Nt(F).length;x=(""+x).toLowerCase(),O=!0}}u.byteLength=k;function $(F,x,b){let G=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,x>>>=0,b<=x))return"";for(F||(F="utf8");;)switch(F){case"hex":return y(this,x,b);case"utf8":case"utf-8":return n(this,x,b);case"ascii":return m(this,x,b);case"latin1":case"binary":return E(this,x,b);case"base64":return a(this,x,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c(this,x,b);default:if(G)throw new TypeError("Unknown encoding: "+F);F=(F+"").toLowerCase(),G=!0}}u.prototype._isBuffer=!0;function K(F,x,b){const G=F[x];F[x]=F[b],F[b]=G}u.prototype.swap16=function(){const x=this.length;if(x%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;bb&&(x+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(x,b,G,O,W){if(pt(x,Uint8Array)&&(x=u.from(x,x.offset,x.byteLength)),!u.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(b===void 0&&(b=0),G===void 0&&(G=x?x.length:0),O===void 0&&(O=0),W===void 0&&(W=this.length),b<0||G>x.length||O<0||W>this.length)throw new RangeError("out of range index");if(O>=W&&b>=G)return 0;if(O>=W)return-1;if(b>=G)return 1;if(b>>>=0,G>>>=0,O>>>=0,W>>>=0,this===x)return 0;let V=W-O,nt=G-b;const ut=Math.min(V,nt),rt=this.slice(O,W),vt=x.slice(b,G);for(let ot=0;ot2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,Lt(b)&&(b=O?0:F.length-1),b<0&&(b=F.length+b),b>=F.length){if(O)return-1;b=F.length-1}else if(b<0)if(O)b=0;else return-1;if(typeof x=="string"&&(x=u.from(x,G)),u.isBuffer(x))return x.length===0?-1:T(F,x,b,G,O);if(typeof x=="number")return x=x&255,typeof Uint8Array.prototype.indexOf=="function"?O?Uint8Array.prototype.indexOf.call(F,x,b):Uint8Array.prototype.lastIndexOf.call(F,x,b):T(F,[x],b,G,O);throw new TypeError("val must be string, number or Buffer")}function T(F,x,b,G,O){let W=1,V=F.length,nt=x.length;if(G!==void 0&&(G=String(G).toLowerCase(),G==="ucs2"||G==="ucs-2"||G==="utf16le"||G==="utf-16le")){if(F.length<2||x.length<2)return-1;W=2,V/=2,nt/=2,b/=2}function ut(vt,ot){return W===1?vt[ot]:vt.readUInt16BE(ot*W)}let rt;if(O){let vt=-1;for(rt=b;rtV&&(b=V-nt),rt=b;rt>=0;rt--){let vt=!0;for(let ot=0;otO&&(G=O)):G=O;const W=x.length;G>W/2&&(G=W/2);let V;for(V=0;V>>0,isFinite(G)?(G=G>>>0,O===void 0&&(O="utf8")):(O=G,G=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const W=this.length-b;if((G===void 0||G>W)&&(G=W),x.length>0&&(G<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");O||(O="utf8");let V=!1;for(;;)switch(O){case"hex":return I(this,x,b,G);case"utf8":case"utf-8":return q(this,x,b,G);case"ascii":case"latin1":case"binary":return C(this,x,b,G);case"base64":return w(this,x,b,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h(this,x,b,G);default:if(V)throw new TypeError("Unknown encoding: "+O);O=(""+O).toLowerCase(),V=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function a(F,x,b){return x===0&&b===F.length?t.fromByteArray(F):t.fromByteArray(F.slice(x,b))}function n(F,x,b){b=Math.min(F.length,b);const G=[];let O=x;for(;O239?4:W>223?3:W>191?2:1;if(O+nt<=b){let ut,rt,vt,ot;switch(nt){case 1:W<128&&(V=W);break;case 2:ut=F[O+1],(ut&192)==128&&(ot=(W&31)<<6|ut&63,ot>127&&(V=ot));break;case 3:ut=F[O+1],rt=F[O+2],(ut&192)==128&&(rt&192)==128&&(ot=(W&15)<<12|(ut&63)<<6|rt&63,ot>2047&&(ot<55296||ot>57343)&&(V=ot));break;case 4:ut=F[O+1],rt=F[O+2],vt=F[O+3],(ut&192)==128&&(rt&192)==128&&(vt&192)==128&&(ot=(W&15)<<18|(ut&63)<<12|(rt&63)<<6|vt&63,ot>65535&&ot<1114112&&(V=ot))}}V===null?(V=65533,nt=1):V>65535&&(V-=65536,G.push(V>>>10&1023|55296),V=56320|V&1023),G.push(V),O+=nt}return l(G)}const o=4096;function l(F){const x=F.length;if(x<=o)return String.fromCharCode.apply(String,F);let b="",G=0;for(;GG)&&(b=G);let O="";for(let W=x;WG&&(x=G),b<0?(b+=G,b<0&&(b=0)):b>G&&(b=G),bb)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(x,b,G){x=x>>>0,b=b>>>0,G||v(x,b,this.length);let O=this[x],W=1,V=0;for(;++V>>0,b=b>>>0,G||v(x,b,this.length);let O=this[x+--b],W=1;for(;b>0&&(W*=256);)O+=this[x+--b]*W;return O},u.prototype.readUint8=u.prototype.readUInt8=function(x,b){return x=x>>>0,b||v(x,1,this.length),this[x]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(x,b){return x=x>>>0,b||v(x,2,this.length),this[x]|this[x+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(x,b){return x=x>>>0,b||v(x,2,this.length),this[x]<<8|this[x+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(x,b){return x=x>>>0,b||v(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(x,b){return x=x>>>0,b||v(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])},u.prototype.readBigUInt64LE=Pt(function(x){x=x>>>0,it(x,"offset");const b=this[x],G=this[x+7];(b===void 0||G===void 0)&&bt(x,this.length-8);const O=b+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,W=this[++x]+this[++x]*2**8+this[++x]*2**16+G*2**24;return BigInt(O)+(BigInt(W)<>>0,it(x,"offset");const b=this[x],G=this[x+7];(b===void 0||G===void 0)&&bt(x,this.length-8);const O=b*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],W=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+G;return(BigInt(O)<>>0,b=b>>>0,G||v(x,b,this.length);let O=this[x],W=1,V=0;for(;++V=W&&(O-=Math.pow(2,8*b)),O},u.prototype.readIntBE=function(x,b,G){x=x>>>0,b=b>>>0,G||v(x,b,this.length);let O=b,W=1,V=this[x+--O];for(;O>0&&(W*=256);)V+=this[x+--O]*W;return W*=128,V>=W&&(V-=Math.pow(2,8*b)),V},u.prototype.readInt8=function(x,b){return x=x>>>0,b||v(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]},u.prototype.readInt16LE=function(x,b){x=x>>>0,b||v(x,2,this.length);const G=this[x]|this[x+1]<<8;return G&32768?G|4294901760:G},u.prototype.readInt16BE=function(x,b){x=x>>>0,b||v(x,2,this.length);const G=this[x+1]|this[x]<<8;return G&32768?G|4294901760:G},u.prototype.readInt32LE=function(x,b){return x=x>>>0,b||v(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24},u.prototype.readInt32BE=function(x,b){return x=x>>>0,b||v(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]},u.prototype.readBigInt64LE=Pt(function(x){x=x>>>0,it(x,"offset");const b=this[x],G=this[x+7];(b===void 0||G===void 0)&&bt(x,this.length-8);const O=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(G<<24);return(BigInt(O)<>>0,it(x,"offset");const b=this[x],G=this[x+7];(b===void 0||G===void 0)&&bt(x,this.length-8);const O=(b<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(O)<>>0,b||v(x,4,this.length),r.read(this,x,!0,23,4)},u.prototype.readFloatBE=function(x,b){return x=x>>>0,b||v(x,4,this.length),r.read(this,x,!1,23,4)},u.prototype.readDoubleLE=function(x,b){return x=x>>>0,b||v(x,8,this.length),r.read(this,x,!0,52,8)},u.prototype.readDoubleBE=function(x,b){return x=x>>>0,b||v(x,8,this.length),r.read(this,x,!1,52,8)};function d(F,x,b,G,O,W){if(!u.isBuffer(F))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>O||xF.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(x,b,G,O){if(x=+x,b=b>>>0,G=G>>>0,!O){const nt=Math.pow(2,8*G)-1;d(this,x,b,G,nt,0)}let W=1,V=0;for(this[b]=x&255;++V>>0,G=G>>>0,!O){const nt=Math.pow(2,8*G)-1;d(this,x,b,G,nt,0)}let W=G-1,V=1;for(this[b+W]=x&255;--W>=0&&(V*=256);)this[b+W]=x/V&255;return b+G},u.prototype.writeUint8=u.prototype.writeUInt8=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,1,255,0),this[b]=x&255,b+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,2,65535,0),this[b]=x&255,this[b+1]=x>>>8,b+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,2,65535,0),this[b]=x>>>8,this[b+1]=x&255,b+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,4,4294967295,0),this[b+3]=x>>>24,this[b+2]=x>>>16,this[b+1]=x>>>8,this[b]=x&255,b+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,4,4294967295,0),this[b]=x>>>24,this[b+1]=x>>>16,this[b+2]=x>>>8,this[b+3]=x&255,b+4};function A(F,x,b,G,O){et(x,G,O,F,b,7);let W=Number(x&BigInt(4294967295));F[b++]=W,W=W>>8,F[b++]=W,W=W>>8,F[b++]=W,W=W>>8,F[b++]=W;let V=Number(x>>BigInt(32)&BigInt(4294967295));return F[b++]=V,V=V>>8,F[b++]=V,V=V>>8,F[b++]=V,V=V>>8,F[b++]=V,b}function Y(F,x,b,G,O){et(x,G,O,F,b,7);let W=Number(x&BigInt(4294967295));F[b+7]=W,W=W>>8,F[b+6]=W,W=W>>8,F[b+5]=W,W=W>>8,F[b+4]=W;let V=Number(x>>BigInt(32)&BigInt(4294967295));return F[b+3]=V,V=V>>8,F[b+2]=V,V=V>>8,F[b+1]=V,V=V>>8,F[b]=V,b+8}u.prototype.writeBigUInt64LE=Pt(function(x,b=0){return A(this,x,b,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Pt(function(x,b=0){return Y(this,x,b,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(x,b,G,O){if(x=+x,b=b>>>0,!O){const ut=Math.pow(2,8*G-1);d(this,x,b,G,ut-1,-ut)}let W=0,V=1,nt=0;for(this[b]=x&255;++W>0)-nt&255;return b+G},u.prototype.writeIntBE=function(x,b,G,O){if(x=+x,b=b>>>0,!O){const ut=Math.pow(2,8*G-1);d(this,x,b,G,ut-1,-ut)}let W=G-1,V=1,nt=0;for(this[b+W]=x&255;--W>=0&&(V*=256);)x<0&&nt===0&&this[b+W+1]!==0&&(nt=1),this[b+W]=(x/V>>0)-nt&255;return b+G},u.prototype.writeInt8=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,1,127,-128),x<0&&(x=255+x+1),this[b]=x&255,b+1},u.prototype.writeInt16LE=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,2,32767,-32768),this[b]=x&255,this[b+1]=x>>>8,b+2},u.prototype.writeInt16BE=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,2,32767,-32768),this[b]=x>>>8,this[b+1]=x&255,b+2},u.prototype.writeInt32LE=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,4,2147483647,-2147483648),this[b]=x&255,this[b+1]=x>>>8,this[b+2]=x>>>16,this[b+3]=x>>>24,b+4},u.prototype.writeInt32BE=function(x,b,G){return x=+x,b=b>>>0,G||d(this,x,b,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[b]=x>>>24,this[b+1]=x>>>16,this[b+2]=x>>>8,this[b+3]=x&255,b+4},u.prototype.writeBigInt64LE=Pt(function(x,b=0){return A(this,x,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Pt(function(x,b=0){return Y(this,x,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(F,x,b,G,O,W){if(b+G>F.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function X(F,x,b,G,O){return x=+x,b=b>>>0,O||J(F,x,b,4),r.write(F,x,b,G,23,4),b+4}u.prototype.writeFloatLE=function(x,b,G){return X(this,x,b,!0,G)},u.prototype.writeFloatBE=function(x,b,G){return X(this,x,b,!1,G)};function tt(F,x,b,G,O){return x=+x,b=b>>>0,O||J(F,x,b,8),r.write(F,x,b,G,52,8),b+8}u.prototype.writeDoubleLE=function(x,b,G){return tt(this,x,b,!0,G)},u.prototype.writeDoubleBE=function(x,b,G){return tt(this,x,b,!1,G)},u.prototype.copy=function(x,b,G,O){if(!u.isBuffer(x))throw new TypeError("argument should be a Buffer");if(G||(G=0),!O&&O!==0&&(O=this.length),b>=x.length&&(b=x.length),b||(b=0),O>0&&O=this.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("sourceEnd out of bounds");O>this.length&&(O=this.length),x.length-b>>0,G=G===void 0?this.length:G>>>0,x||(x=0);let W;if(typeof x=="number")for(W=b;W2**32?O=at(String(b)):typeof b=="bigint"&&(O=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(O=at(O)),O+="n"),G+=` It must be ${x}. Received ${O}`,G},RangeError);function at(F){let x="",b=F.length;const G=F[0]==="-"?1:0;for(;b>=G+4;b-=3)x=`_${F.slice(b-3,b)}${x}`;return`${F.slice(0,b)}${x}`}function lt(F,x,b){it(x,"offset"),(F[x]===void 0||F[x+b]===void 0)&&bt(x,F.length-(b+1))}function et(F,x,b,G,O,W){if(F>b||F3?x===0||x===BigInt(0)?nt=`>= 0${V} and < 2${V} ** ${(W+1)*8}${V}`:nt=`>= -(2${V} ** ${(W+1)*8-1}${V}) and < 2 ** ${(W+1)*8-1}${V}`:nt=`>= ${x}${V} and <= ${b}${V}`,new Z.ERR_OUT_OF_RANGE("value",nt,F)}lt(G,O,W)}function it(F,x){if(typeof F!="number")throw new Z.ERR_INVALID_ARG_TYPE(x,"number",F)}function bt(F,x,b){throw Math.floor(F)!==F?(it(F,b),new Z.ERR_OUT_OF_RANGE(b||"offset","an integer",F)):x<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(b||"offset",`>= ${b?1:0} and <= ${x}`,F)}const ct=/[^+/0-9A-Za-z-_]/g;function Ft(F){if(F=F.split("=")[0],F=F.trim().replace(ct,""),F.length<2)return"";for(;F.length%4!=0;)F=F+"=";return F}function Nt(F,x){x=x||1/0;let b;const G=F.length;let O=null;const W=[];for(let V=0;V55295&&b<57344){if(!O){if(b>56319){(x-=3)>-1&&W.push(239,191,189);continue}else if(V+1===G){(x-=3)>-1&&W.push(239,191,189);continue}O=b;continue}if(b<56320){(x-=3)>-1&&W.push(239,191,189),O=b;continue}b=(O-55296<<10|b-56320)+65536}else O&&(x-=3)>-1&&W.push(239,191,189);if(O=null,b<128){if((x-=1)<0)break;W.push(b)}else if(b<2048){if((x-=2)<0)break;W.push(b>>6|192,b&63|128)}else if(b<65536){if((x-=3)<0)break;W.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((x-=4)<0)break;W.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return W}function ht(F){const x=[];for(let b=0;b>8,O=b%256,W.push(O),W.push(G);return W}function Ut(F){return t.toByteArray(Ft(F))}function st(F,x,b,G){let O;for(O=0;O=x.length||O>=F.length);++O)x[O+b]=F[O];return O}function pt(F,x){return F instanceof x||F!=null&&F.constructor!=null&&F.constructor.name!=null&&F.constructor.name===x.name}function Lt(F){return F!==F}const dt=function(){const F="0123456789abcdef",x=new Array(256);for(let b=0;b<16;++b){const G=b*16;for(let O=0;O<16;++O)x[G+O]=F[b]+F[O]}return x}();function Pt(F){return typeof BigInt=="undefined"?Dt:F}function Dt(){throw new Error("BigInt not supported")}})(ve);class Ps{constructor(t){this.curve=new Jn.ec(t)}sign(t,r,i){if(i!==void 0){const s=typeof i=="number"?new fe(i):new fe(i,"hex","be");if(s.cmpn(0)<=0)throw new Error("k must be a positive number");if(this.curve.n&&s.cmp(this.curve.n)>=0)throw new Error(`k must be smaller than ${this.curve.n.toString(10)}`);const p=this.curve.sign(ve.Buffer.from(t,"hex"),ve.Buffer.from(r,"hex"),{k:u=>new fe(s).divn(u+1)});return{r:p.r.toString("hex",32),s:p.s.toString("hex",32)}}const f=this.curve.sign(ve.Buffer.from(t,"hex"),ve.Buffer.from(r,"hex"));return{r:f.r.toString("hex",32),s:f.s.toString("hex",32)}}verify(t,r,i){return this.curve.verify(t,{r:new fe(r.r,16,"be"),s:new fe(r.s,16,"be")},ve.Buffer.from(i,"hex"),"hex")}getPublicKey(t,r=!0){const i=ve.Buffer.from(t,"hex");return this.curve.keyFromPrivate(i,"hex").getPublic().encode("hex",r)}decodePublicKey(t){const r=ve.Buffer.from(t,"hex");return this.curve.keyFromPublic(r,"hex").getPublic().encode("hex",!1)}}var t0;(function(e){e[e.SECP256R1=0]="SECP256R1",e[e.SECP256K1=1]="SECP256K1"})(t0||(t0={}));const pu={[t0.SECP256R1]:new Ps("p256"),[t0.SECP256K1]:new Ps("secp256k1")};function Ns(e){return pu[e]}var Us={exports:{}},Rt={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(gt,function(){var r=r||function(i,f){var s;if(typeof window!="undefined"&&window.crypto&&(s=window.crypto),typeof self!="undefined"&&self.crypto&&(s=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window!="undefined"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof gt!="undefined"&>.crypto&&(s=gt.crypto),!s&&typeof to=="function")try{s=require("crypto")}catch{}var p=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},u=Object.create||function(){function z(){}return function(k){var $;return z.prototype=k,$=new z,z.prototype=null,$}}(),g={},S=g.lib={},_=S.Base=function(){return{extend:function(z){var k=u(this);return z&&k.mixIn(z),(!k.hasOwnProperty("init")||this.init===k.init)&&(k.init=function(){k.$super.init.apply(this,arguments)}),k.init.prototype=k,k.$super=this,k},create:function(){var z=this.extend();return z.init.apply(z,arguments),z},init:function(){},mixIn:function(z){for(var k in z)z.hasOwnProperty(k)&&(this[k]=z[k]);z.hasOwnProperty("toString")&&(this.toString=z.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),D=S.WordArray=_.extend({init:function(z,k){z=this.words=z||[],k!=f?this.sigBytes=k:this.sigBytes=z.length*4},toString:function(z){return(z||L).stringify(this)},concat:function(z){var k=this.words,$=z.words,K=this.sigBytes,M=z.sigBytes;if(this.clamp(),K%4)for(var T=0;T>>2]>>>24-T%4*8&255;k[K+T>>>2]|=I<<24-(K+T)%4*8}else for(var q=0;q>>2]=$[q>>>2];return this.sigBytes+=M,this},clamp:function(){var z=this.words,k=this.sigBytes;z[k>>>2]&=4294967295<<32-k%4*8,z.length=i.ceil(k/4)},clone:function(){var z=_.clone.call(this);return z.words=this.words.slice(0),z},random:function(z){for(var k=[],$=0;$>>2]>>>24-M%4*8&255;K.push((T>>>4).toString(16)),K.push((T&15).toString(16))}return K.join("")},parse:function(z){for(var k=z.length,$=[],K=0;K>>3]|=parseInt(z.substr(K,2),16)<<24-K%8*4;return new D.init($,k/2)}},H=B.Latin1={stringify:function(z){for(var k=z.words,$=z.sigBytes,K=[],M=0;M<$;M++){var T=k[M>>>2]>>>24-M%4*8&255;K.push(String.fromCharCode(T))}return K.join("")},parse:function(z){for(var k=z.length,$=[],K=0;K>>2]|=(z.charCodeAt(K)&255)<<24-K%4*8;return new D.init($,k)}},U=B.Utf8={stringify:function(z){try{return decodeURIComponent(escape(H.stringify(z)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(z){return H.parse(unescape(encodeURIComponent(z)))}},N=S.BufferedBlockAlgorithm=_.extend({reset:function(){this._data=new D.init,this._nDataBytes=0},_append:function(z){typeof z=="string"&&(z=U.parse(z)),this._data.concat(z),this._nDataBytes+=z.sigBytes},_process:function(z){var k,$=this._data,K=$.words,M=$.sigBytes,T=this.blockSize,I=T*4,q=M/I;z?q=i.ceil(q):q=i.max((q|0)-this._minBufferSize,0);var C=q*T,w=i.min(C*4,M);if(C){for(var h=0;h>>24)&16711935|(C<<24|C>>>8)&4278255360}var w=this._hash.words,h=L.words,a=H.words,n=S.words,o=_.words,l=D.words,m=B.words,E,y,c,v,d,A,Y,J,X,tt;A=E=w[0],Y=y=w[1],J=c=w[2],X=v=w[3],tt=d=w[4];for(var Z,I=0;I<80;I+=1)Z=E+M[T+n[I]]|0,I<16?Z+=N(y,c,v)+h[0]:I<32?Z+=P(y,c,v)+h[1]:I<48?Z+=z(y,c,v)+h[2]:I<64?Z+=k(y,c,v)+h[3]:Z+=$(y,c,v)+h[4],Z=Z|0,Z=K(Z,l[I]),Z=Z+d|0,E=d,d=v,v=K(c,10),c=y,y=Z,Z=A+M[T+o[I]]|0,I<16?Z+=$(Y,J,X)+a[0]:I<32?Z+=k(Y,J,X)+a[1]:I<48?Z+=z(Y,J,X)+a[2]:I<64?Z+=P(Y,J,X)+a[3]:Z+=N(Y,J,X)+a[4],Z=Z|0,Z=K(Z,m[I]),Z=Z+tt|0,A=tt,tt=X,X=K(J,10),J=Y,Y=Z;Z=w[1]+c+X|0,w[1]=w[2]+v+tt|0,w[2]=w[3]+d+A|0,w[3]=w[4]+E+Y|0,w[4]=w[0]+y+J|0,w[0]=Z},_doFinalize:function(){var M=this._data,T=M.words,I=this._nDataBytes*8,q=M.sigBytes*8;T[q>>>5]|=128<<24-q%32,T[(q+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,M.sigBytes=(T.length+1)*4,this._process();for(var C=this._hash,w=C.words,h=0;h<5;h++){var a=w[h];w[h]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}return C},clone:function(){var M=u.clone.call(this);return M._hash=this._hash.clone(),M}});function N(M,T,I){return M^T^I}function P(M,T,I){return M&T|~M&I}function z(M,T,I){return(M|~T)^I}function k(M,T,I){return M&I|T&~I}function $(M,T,I){return M^(T|~I)}function K(M,T){return M<>>32-T}f.RIPEMD160=u._createHelper(U),f.HmacRIPEMD160=u._createHmacHelper(U)}(),r.RIPEMD160})})(Vi);var xu=Vi.exports,Z0={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){return function(i){var f=r,s=f.lib,p=s.WordArray,u=s.Hasher,g=f.algo,S=[],_=[];(function(){function L(P){for(var z=i.sqrt(P),k=2;k<=z;k++)if(!(P%k))return!1;return!0}function H(P){return(P-(P|0))*4294967296|0}for(var U=2,N=0;N<64;)L(U)&&(N<8&&(S[N]=H(i.pow(U,1/2))),_[N]=H(i.pow(U,1/3)),N++),U++})();var D=[],B=g.SHA256=u.extend({_doReset:function(){this._hash=new p.init(S.slice(0))},_doProcessBlock:function(L,H){for(var U=this._hash.words,N=U[0],P=U[1],z=U[2],k=U[3],$=U[4],K=U[5],M=U[6],T=U[7],I=0;I<64;I++){if(I<16)D[I]=L[H+I]|0;else{var q=D[I-15],C=(q<<25|q>>>7)^(q<<14|q>>>18)^q>>>3,w=D[I-2],h=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;D[I]=C+D[I-7]+h+D[I-16]}var a=$&K^~$&M,n=N&P^N&z^P&z,o=(N<<30|N>>>2)^(N<<19|N>>>13)^(N<<10|N>>>22),l=($<<26|$>>>6)^($<<21|$>>>11)^($<<7|$>>>25),m=T+l+a+_[I]+D[I],E=o+n;T=M,M=K,K=$,$=k+m|0,k=z,z=P,P=N,N=m+E|0}U[0]=U[0]+N|0,U[1]=U[1]+P|0,U[2]=U[2]+z|0,U[3]=U[3]+k|0,U[4]=U[4]+$|0,U[5]=U[5]+K|0,U[6]=U[6]+M|0,U[7]=U[7]+T|0},_doFinalize:function(){var L=this._data,H=L.words,U=this._nDataBytes*8,N=L.sigBytes*8;return H[N>>>5]|=128<<24-N%32,H[(N+64>>>9<<4)+14]=i.floor(U/4294967296),H[(N+64>>>9<<4)+15]=U,L.sigBytes=H.length*4,this._process(),this._hash},clone:function(){var L=u.clone.call(this);return L._hash=this._hash.clone(),L}});f.SHA256=u._createHelper(B),f.HmacSHA256=u._createHmacHelper(B)}(Math),r.SHA256})})(Z0);var x0=Z0.exports;function Ds(e,t){const r=Wi.parse(e);return t(r).toString(Wi)}function Ji(e){return Ds(e,x0)}function gu(e){return Ds(e,xu)}function Hs(e){const t=Ji(e);return gu(t)}function e0(e){const t=Ji(e);return Ji(t)}var Ir={exports:{}},g0={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){return function(i){var f=r,s=f.lib,p=s.Base,u=s.WordArray,g=f.x64={};g.Word=p.extend({init:function(S,_){this.high=S,this.low=_}}),g.WordArray=p.extend({init:function(S,_){S=this.words=S||[],_!=i?this.sigBytes=_:this.sigBytes=S.length*8},toX32:function(){for(var S=this.words,_=S.length,D=[],B=0;B<_;B++){var L=S[B];D.push(L.high),D.push(L.low)}return u.create(D,this.sigBytes)},clone:function(){for(var S=p.clone.call(this),_=S.words=this.words.slice(0),D=_.length,B=0;B>>2]|=g[D]<<24-D%4*8;p.call(this,_,S)}else p.apply(this,arguments)};u.prototype=s}}(),r.lib.WordArray})})(Fs);var zs={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.WordArray,p=i.enc;p.Utf16=p.Utf16BE={stringify:function(g){for(var S=g.words,_=g.sigBytes,D=[],B=0;B<_;B+=2){var L=S[B>>>2]>>>16-B%4*8&65535;D.push(String.fromCharCode(L))}return D.join("")},parse:function(g){for(var S=g.length,_=[],D=0;D>>1]|=g.charCodeAt(D)<<16-D%2*16;return s.create(_,S*2)}},p.Utf16LE={stringify:function(g){for(var S=g.words,_=g.sigBytes,D=[],B=0;B<_;B+=2){var L=u(S[B>>>2]>>>16-B%4*8&65535);D.push(String.fromCharCode(L))}return D.join("")},parse:function(g){for(var S=g.length,_=[],D=0;D>>1]|=u(g.charCodeAt(D)<<16-D%2*16);return s.create(_,S*2)}};function u(g){return g<<8&4278255360|g>>>8&16711935}}(),r.enc.Utf16})})(zs);var Pr={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.WordArray,p=i.enc;p.Base64={stringify:function(g){var S=g.words,_=g.sigBytes,D=this._map;g.clamp();for(var B=[],L=0;L<_;L+=3)for(var H=S[L>>>2]>>>24-L%4*8&255,U=S[L+1>>>2]>>>24-(L+1)%4*8&255,N=S[L+2>>>2]>>>24-(L+2)%4*8&255,P=H<<16|U<<8|N,z=0;z<4&&L+z*.75<_;z++)B.push(D.charAt(P>>>6*(3-z)&63));var k=D.charAt(64);if(k)for(;B.length%4;)B.push(k);return B.join("")},parse:function(g){var S=g.length,_=this._map,D=this._reverseMap;if(!D){D=this._reverseMap=[];for(var B=0;B<_.length;B++)D[_.charCodeAt(B)]=B}var L=_.charAt(64);if(L){var H=g.indexOf(L);H!==-1&&(S=H)}return u(g,S,D)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function u(g,S,_){for(var D=[],B=0,L=0;L>>6-L%4*2,N=H|U;D[B>>>2]|=N<<24-B%4*8,B++}return s.create(D,B)}}(),r.enc.Base64})})(Pr);var Cs={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.WordArray,p=i.enc;p.Base64url={stringify:function(g,S=!0){var _=g.words,D=g.sigBytes,B=S?this._safe_map:this._map;g.clamp();for(var L=[],H=0;H>>2]>>>24-H%4*8&255,N=_[H+1>>>2]>>>24-(H+1)%4*8&255,P=_[H+2>>>2]>>>24-(H+2)%4*8&255,z=U<<16|N<<8|P,k=0;k<4&&H+k*.75>>6*(3-k)&63));var $=B.charAt(64);if($)for(;L.length%4;)L.push($);return L.join("")},parse:function(g,S=!0){var _=g.length,D=S?this._safe_map:this._map,B=this._reverseMap;if(!B){B=this._reverseMap=[];for(var L=0;L>>6-L%4*2,N=H|U;D[B>>>2]|=N<<24-B%4*8,B++}return s.create(D,B)}}(),r.enc.Base64url})})(Cs);var Nr={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){return function(i){var f=r,s=f.lib,p=s.WordArray,u=s.Hasher,g=f.algo,S=[];(function(){for(var U=0;U<64;U++)S[U]=i.abs(i.sin(U+1))*4294967296|0})();var _=g.MD5=u.extend({_doReset:function(){this._hash=new p.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(U,N){for(var P=0;P<16;P++){var z=N+P,k=U[z];U[z]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}var $=this._hash.words,K=U[N+0],M=U[N+1],T=U[N+2],I=U[N+3],q=U[N+4],C=U[N+5],w=U[N+6],h=U[N+7],a=U[N+8],n=U[N+9],o=U[N+10],l=U[N+11],m=U[N+12],E=U[N+13],y=U[N+14],c=U[N+15],v=$[0],d=$[1],A=$[2],Y=$[3];v=D(v,d,A,Y,K,7,S[0]),Y=D(Y,v,d,A,M,12,S[1]),A=D(A,Y,v,d,T,17,S[2]),d=D(d,A,Y,v,I,22,S[3]),v=D(v,d,A,Y,q,7,S[4]),Y=D(Y,v,d,A,C,12,S[5]),A=D(A,Y,v,d,w,17,S[6]),d=D(d,A,Y,v,h,22,S[7]),v=D(v,d,A,Y,a,7,S[8]),Y=D(Y,v,d,A,n,12,S[9]),A=D(A,Y,v,d,o,17,S[10]),d=D(d,A,Y,v,l,22,S[11]),v=D(v,d,A,Y,m,7,S[12]),Y=D(Y,v,d,A,E,12,S[13]),A=D(A,Y,v,d,y,17,S[14]),d=D(d,A,Y,v,c,22,S[15]),v=B(v,d,A,Y,M,5,S[16]),Y=B(Y,v,d,A,w,9,S[17]),A=B(A,Y,v,d,l,14,S[18]),d=B(d,A,Y,v,K,20,S[19]),v=B(v,d,A,Y,C,5,S[20]),Y=B(Y,v,d,A,o,9,S[21]),A=B(A,Y,v,d,c,14,S[22]),d=B(d,A,Y,v,q,20,S[23]),v=B(v,d,A,Y,n,5,S[24]),Y=B(Y,v,d,A,y,9,S[25]),A=B(A,Y,v,d,I,14,S[26]),d=B(d,A,Y,v,a,20,S[27]),v=B(v,d,A,Y,E,5,S[28]),Y=B(Y,v,d,A,T,9,S[29]),A=B(A,Y,v,d,h,14,S[30]),d=B(d,A,Y,v,m,20,S[31]),v=L(v,d,A,Y,C,4,S[32]),Y=L(Y,v,d,A,a,11,S[33]),A=L(A,Y,v,d,l,16,S[34]),d=L(d,A,Y,v,y,23,S[35]),v=L(v,d,A,Y,M,4,S[36]),Y=L(Y,v,d,A,q,11,S[37]),A=L(A,Y,v,d,h,16,S[38]),d=L(d,A,Y,v,o,23,S[39]),v=L(v,d,A,Y,E,4,S[40]),Y=L(Y,v,d,A,K,11,S[41]),A=L(A,Y,v,d,I,16,S[42]),d=L(d,A,Y,v,w,23,S[43]),v=L(v,d,A,Y,n,4,S[44]),Y=L(Y,v,d,A,m,11,S[45]),A=L(A,Y,v,d,c,16,S[46]),d=L(d,A,Y,v,T,23,S[47]),v=H(v,d,A,Y,K,6,S[48]),Y=H(Y,v,d,A,h,10,S[49]),A=H(A,Y,v,d,y,15,S[50]),d=H(d,A,Y,v,C,21,S[51]),v=H(v,d,A,Y,m,6,S[52]),Y=H(Y,v,d,A,I,10,S[53]),A=H(A,Y,v,d,o,15,S[54]),d=H(d,A,Y,v,M,21,S[55]),v=H(v,d,A,Y,a,6,S[56]),Y=H(Y,v,d,A,c,10,S[57]),A=H(A,Y,v,d,w,15,S[58]),d=H(d,A,Y,v,E,21,S[59]),v=H(v,d,A,Y,q,6,S[60]),Y=H(Y,v,d,A,l,10,S[61]),A=H(A,Y,v,d,T,15,S[62]),d=H(d,A,Y,v,n,21,S[63]),$[0]=$[0]+v|0,$[1]=$[1]+d|0,$[2]=$[2]+A|0,$[3]=$[3]+Y|0},_doFinalize:function(){var U=this._data,N=U.words,P=this._nDataBytes*8,z=U.sigBytes*8;N[z>>>5]|=128<<24-z%32;var k=i.floor(P/4294967296),$=P;N[(z+64>>>9<<4)+15]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,N[(z+64>>>9<<4)+14]=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360,U.sigBytes=(N.length+1)*4,this._process();for(var K=this._hash,M=K.words,T=0;T<4;T++){var I=M[T];M[T]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360}return K},clone:function(){var U=u.clone.call(this);return U._hash=this._hash.clone(),U}});function D(U,N,P,z,k,$,K){var M=U+(N&P|~N&z)+k+K;return(M<<$|M>>>32-$)+N}function B(U,N,P,z,k,$,K){var M=U+(N&z|P&~z)+k+K;return(M<<$|M>>>32-$)+N}function L(U,N,P,z,k,$,K){var M=U+(N^P^z)+k+K;return(M<<$|M>>>32-$)+N}function H(U,N,P,z,k,$,K){var M=U+(P^(N|~z))+k+K;return(M<<$|M>>>32-$)+N}f.MD5=u._createHelper(_),f.HmacMD5=u._createHmacHelper(_)}(Math),r.MD5})})(Nr);var Q0={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.WordArray,p=f.Hasher,u=i.algo,g=[],S=u.SHA1=p.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(_,D){for(var B=this._hash.words,L=B[0],H=B[1],U=B[2],N=B[3],P=B[4],z=0;z<80;z++){if(z<16)g[z]=_[D+z]|0;else{var k=g[z-3]^g[z-8]^g[z-14]^g[z-16];g[z]=k<<1|k>>>31}var $=(L<<5|L>>>27)+P+g[z];z<20?$+=(H&U|~H&N)+1518500249:z<40?$+=(H^U^N)+1859775393:z<60?$+=(H&U|H&N|U&N)-1894007588:$+=(H^U^N)-899497514,P=N,N=U,U=H<<30|H>>>2,H=L,L=$}B[0]=B[0]+L|0,B[1]=B[1]+H|0,B[2]=B[2]+U|0,B[3]=B[3]+N|0,B[4]=B[4]+P|0},_doFinalize:function(){var _=this._data,D=_.words,B=this._nDataBytes*8,L=_.sigBytes*8;return D[L>>>5]|=128<<24-L%32,D[(L+64>>>9<<4)+14]=Math.floor(B/4294967296),D[(L+64>>>9<<4)+15]=B,_.sigBytes=D.length*4,this._process(),this._hash},clone:function(){var _=p.clone.call(this);return _._hash=this._hash.clone(),_}});i.SHA1=p._createHelper(S),i.HmacSHA1=p._createHmacHelper(S)}(),r.SHA1})})(Q0);var ks={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,Z0.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.WordArray,p=i.algo,u=p.SHA256,g=p.SHA224=u.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var S=u._doFinalize.call(this);return S.sigBytes-=4,S}});i.SHA224=u._createHelper(g),i.HmacSHA224=u._createHmacHelper(g)}(),r.SHA224})})(ks);var Xi={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,g0.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.Hasher,p=i.x64,u=p.Word,g=p.WordArray,S=i.algo;function _(){return u.create.apply(u,arguments)}var D=[_(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)],B=[];(function(){for(var H=0;H<80;H++)B[H]=_()})();var L=S.SHA512=s.extend({_doReset:function(){this._hash=new g.init([new u.init(1779033703,4089235720),new u.init(3144134277,2227873595),new u.init(1013904242,4271175723),new u.init(2773480762,1595750129),new u.init(1359893119,2917565137),new u.init(2600822924,725511199),new u.init(528734635,4215389547),new u.init(1541459225,327033209)])},_doProcessBlock:function(H,U){for(var N=this._hash.words,P=N[0],z=N[1],k=N[2],$=N[3],K=N[4],M=N[5],T=N[6],I=N[7],q=P.high,C=P.low,w=z.high,h=z.low,a=k.high,n=k.low,o=$.high,l=$.low,m=K.high,E=K.low,y=M.high,c=M.low,v=T.high,d=T.low,A=I.high,Y=I.low,J=q,X=C,tt=w,Z=h,Q=a,at=n,lt=o,et=l,it=m,bt=E,ct=y,Ft=c,Nt=v,ht=d,Ct=A,Ut=Y,st=0;st<80;st++){var pt,Lt,dt=B[st];if(st<16)Lt=dt.high=H[U+st*2]|0,pt=dt.low=H[U+st*2+1]|0;else{var Pt=B[st-15],Dt=Pt.high,F=Pt.low,x=(Dt>>>1|F<<31)^(Dt>>>8|F<<24)^Dt>>>7,b=(F>>>1|Dt<<31)^(F>>>8|Dt<<24)^(F>>>7|Dt<<25),G=B[st-2],O=G.high,W=G.low,V=(O>>>19|W<<13)^(O<<3|W>>>29)^O>>>6,nt=(W>>>19|O<<13)^(W<<3|O>>>29)^(W>>>6|O<<26),ut=B[st-7],rt=ut.high,vt=ut.low,ot=B[st-16],St=ot.high,$t=ot.low;pt=b+vt,Lt=x+rt+(pt>>>0>>0?1:0),pt=pt+nt,Lt=Lt+V+(pt>>>0>>0?1:0),pt=pt+$t,Lt=Lt+St+(pt>>>0<$t>>>0?1:0),dt.high=Lt,dt.low=pt}var Yt=it&ct^~it&Nt,mt=bt&Ft^~bt&ht,Ot=J&tt^J&Q^tt&Q,Wt=X&Z^X&at^Z&at,_t=(J>>>28|X<<4)^(J<<30|X>>>2)^(J<<25|X>>>7),Gt=(X>>>28|J<<4)^(X<<30|J>>>2)^(X<<25|J>>>7),Vt=(it>>>14|bt<<18)^(it>>>18|bt<<14)^(it<<23|bt>>>9),Mt=(bt>>>14|it<<18)^(bt>>>18|it<<14)^(bt<<23|it>>>9),qt=D[st],Jt=qt.high,yt=qt.low,Bt=Ut+Mt,Ht=Ct+Vt+(Bt>>>0>>0?1:0),Bt=Bt+mt,Ht=Ht+Yt+(Bt>>>0>>0?1:0),Bt=Bt+yt,Ht=Ht+Jt+(Bt>>>0>>0?1:0),Bt=Bt+pt,Ht=Ht+Lt+(Bt>>>0>>0?1:0),wt=Gt+Wt,Xt=_t+Ot+(wt>>>0>>0?1:0);Ct=Nt,Ut=ht,Nt=ct,ht=Ft,ct=it,Ft=bt,bt=et+Bt|0,it=lt+Ht+(bt>>>0>>0?1:0)|0,lt=Q,et=at,Q=tt,at=Z,tt=J,Z=X,X=Bt+wt|0,J=Ht+Xt+(X>>>0>>0?1:0)|0}C=P.low=C+X,P.high=q+J+(C>>>0>>0?1:0),h=z.low=h+Z,z.high=w+tt+(h>>>0>>0?1:0),n=k.low=n+at,k.high=a+Q+(n>>>0>>0?1:0),l=$.low=l+et,$.high=o+lt+(l>>>0>>0?1:0),E=K.low=E+bt,K.high=m+it+(E>>>0>>0?1:0),c=M.low=c+Ft,M.high=y+ct+(c>>>0>>0?1:0),d=T.low=d+ht,T.high=v+Nt+(d>>>0>>0?1:0),Y=I.low=Y+Ut,I.high=A+Ct+(Y>>>0>>0?1:0)},_doFinalize:function(){var H=this._data,U=H.words,N=this._nDataBytes*8,P=H.sigBytes*8;U[P>>>5]|=128<<24-P%32,U[(P+128>>>10<<5)+30]=Math.floor(N/4294967296),U[(P+128>>>10<<5)+31]=N,H.sigBytes=U.length*4,this._process();var z=this._hash.toX32();return z},clone:function(){var H=s.clone.call(this);return H._hash=this._hash.clone(),H},blockSize:1024/32});i.SHA512=s._createHelper(L),i.HmacSHA512=s._createHmacHelper(L)}(),r.SHA512})})(Xi);var $s={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,g0.exports,Xi.exports)})(gt,function(r){return function(){var i=r,f=i.x64,s=f.Word,p=f.WordArray,u=i.algo,g=u.SHA512,S=u.SHA384=g.extend({_doReset:function(){this._hash=new p.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var _=g._doFinalize.call(this);return _.sigBytes-=16,_}});i.SHA384=g._createHelper(S),i.HmacSHA384=g._createHmacHelper(S)}(),r.SHA384})})($s);var Gs={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,g0.exports)})(gt,function(r){return function(i){var f=r,s=f.lib,p=s.WordArray,u=s.Hasher,g=f.x64,S=g.Word,_=f.algo,D=[],B=[],L=[];(function(){for(var N=1,P=0,z=0;z<24;z++){D[N+5*P]=(z+1)*(z+2)/2%64;var k=P%5,$=(2*N+3*P)%5;N=k,P=$}for(var N=0;N<5;N++)for(var P=0;P<5;P++)B[N+5*P]=P+(2*N+3*P)%5*5;for(var K=1,M=0;M<24;M++){for(var T=0,I=0,q=0;q<7;q++){if(K&1){var C=(1<>>24)&16711935|(K<<24|K>>>8)&4278255360,M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360;var T=z[$];T.high^=M,T.low^=K}for(var I=0;I<24;I++){for(var q=0;q<5;q++){for(var C=0,w=0,h=0;h<5;h++){var T=z[q+5*h];C^=T.high,w^=T.low}var a=H[q];a.high=C,a.low=w}for(var q=0;q<5;q++)for(var n=H[(q+4)%5],o=H[(q+1)%5],l=o.high,m=o.low,C=n.high^(l<<1|m>>>31),w=n.low^(m<<1|l>>>31),h=0;h<5;h++){var T=z[q+5*h];T.high^=C,T.low^=w}for(var E=1;E<25;E++){var C,w,T=z[E],y=T.high,c=T.low,v=D[E];v<32?(C=y<>>32-v,w=c<>>32-v):(C=c<>>64-v,w=y<>>64-v);var d=H[B[E]];d.high=C,d.low=w}var A=H[0],Y=z[0];A.high=Y.high,A.low=Y.low;for(var q=0;q<5;q++)for(var h=0;h<5;h++){var E=q+5*h,T=z[E],J=H[E],X=H[(q+1)%5+5*h],tt=H[(q+2)%5+5*h];T.high=J.high^~X.high&tt.high,T.low=J.low^~X.low&tt.low}var T=z[0],Z=L[I];T.high^=Z.high,T.low^=Z.low}},_doFinalize:function(){var N=this._data,P=N.words;this._nDataBytes*8;var z=N.sigBytes*8,k=this.blockSize*32;P[z>>>5]|=1<<24-z%32,P[(i.ceil((z+1)/k)*k>>>5)-1]|=128,N.sigBytes=P.length*4,this._process();for(var $=this._state,K=this.cfg.outputLength/8,M=K/8,T=[],I=0;I>>24)&16711935|(C<<24|C>>>8)&4278255360,w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,T.push(w),T.push(C)}return new p.init(T,K)},clone:function(){for(var N=u.clone.call(this),P=N._state=this._state.slice(0),z=0;z<25;z++)P[z]=P[z].clone();return N}});f.SHA3=u._createHelper(U),f.HmacSHA3=u._createHmacHelper(U)}(Math),r.SHA3})})(Gs);var j0={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){(function(){var i=r,f=i.lib,s=f.Base,p=i.enc,u=p.Utf8,g=i.algo;g.HMAC=s.extend({init:function(S,_){S=this._hasher=new S.init,typeof _=="string"&&(_=u.parse(_));var D=S.blockSize,B=D*4;_.sigBytes>B&&(_=S.finalize(_)),_.clamp();for(var L=this._oKey=_.clone(),H=this._iKey=_.clone(),U=L.words,N=H.words,P=0;P>>2]&255;C.sigBytes-=w}};s.BlockCipher=L.extend({cfg:L.cfg.extend({mode:N,padding:z}),reset:function(){var C;L.reset.call(this);var w=this.cfg,h=w.iv,a=w.mode;this._xformMode==this._ENC_XFORM_MODE?C=a.createEncryptor:(C=a.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==C?this._mode.init(this,h&&h.words):(this._mode=C.call(a,this,h&&h.words),this._mode.__creator=C)},_doProcessBlock:function(C,w){this._mode.processBlock(C,w)},_doFinalize:function(){var C,w=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(w.pad(this._data,this.blockSize),C=this._process(!0)):(C=this._process(!0),w.unpad(C)),C},blockSize:128/32});var k=s.CipherParams=p.extend({init:function(C){this.mixIn(C)},toString:function(C){return(C||this.formatter).stringify(this)}}),$=f.format={},K=$.OpenSSL={stringify:function(C){var w,h=C.ciphertext,a=C.salt;return a?w=u.create([1398893684,1701076831]).concat(a).concat(h):w=h,w.toString(_)},parse:function(C){var w,h=_.parse(C),a=h.words;return a[0]==1398893684&&a[1]==1701076831&&(w=u.create(a.slice(2,4)),a.splice(0,4),h.sigBytes-=16),k.create({ciphertext:h,salt:w})}},M=s.SerializableCipher=p.extend({cfg:p.extend({format:K}),encrypt:function(C,w,h,a){a=this.cfg.extend(a);var n=C.createEncryptor(h,a),o=n.finalize(w),l=n.cfg;return k.create({ciphertext:o,key:h,iv:l.iv,algorithm:C,mode:l.mode,padding:l.padding,blockSize:C.blockSize,formatter:a.format})},decrypt:function(C,w,h,a){a=this.cfg.extend(a),w=this._parse(w,a.format);var n=C.createDecryptor(h,a).finalize(w.ciphertext);return n},_parse:function(C,w){return typeof C=="string"?w.parse(C,this):C}}),T=f.kdf={},I=T.OpenSSL={execute:function(C,w,h,a){a||(a=u.random(64/8));var n=B.create({keySize:w+h}).compute(C,a),o=u.create(n.words.slice(w),h*4);return n.sigBytes=w*4,k.create({key:n,iv:o,salt:a})}},q=s.PasswordBasedCipher=M.extend({cfg:M.cfg.extend({kdf:I}),encrypt:function(C,w,h,a){a=this.cfg.extend(a);var n=a.kdf.execute(h,C.keySize,C.ivSize);a.iv=n.iv;var o=M.encrypt.call(this,C,w,n.key,a);return o.mixIn(n),o},decrypt:function(C,w,h,a){a=this.cfg.extend(a),w=this._parse(w,a.format);var n=a.kdf.execute(h,C.keySize,C.ivSize,w.salt);a.iv=n.iv;var o=M.decrypt.call(this,C,w,n.key,a);return o}})}()})})(ce);var Ks={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,ce.exports)})(gt,function(r){return r.mode.CFB=function(){var i=r.lib.BlockCipherMode.extend();i.Encryptor=i.extend({processBlock:function(s,p){var u=this._cipher,g=u.blockSize;f.call(this,s,p,g,u),this._prevBlock=s.slice(p,p+g)}}),i.Decryptor=i.extend({processBlock:function(s,p){var u=this._cipher,g=u.blockSize,S=s.slice(p,p+g);f.call(this,s,p,g,u),this._prevBlock=S}});function f(s,p,u,g){var S,_=this._iv;_?(S=_.slice(0),this._iv=void 0):S=this._prevBlock,g.encryptBlock(S,0);for(var D=0;D>24&255)==255){var g=u>>16&255,S=u>>8&255,_=u&255;g===255?(g=0,S===255?(S=0,_===255?_=0:++_):++S):++g,u=0,u+=g<<16,u+=S<<8,u+=_}else u+=1<<24;return u}function s(u){return(u[0]=f(u[0]))===0&&(u[1]=f(u[1])),u}var p=i.Encryptor=i.extend({processBlock:function(u,g){var S=this._cipher,_=S.blockSize,D=this._iv,B=this._counter;D&&(B=this._counter=D.slice(0),this._iv=void 0),s(B);var L=B.slice(0);S.encryptBlock(L,0);for(var H=0;H<_;H++)u[g+H]^=L[H]}});return i.Decryptor=p,i}(),r.mode.CTRGladman})})(Os);var Ws={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,ce.exports)})(gt,function(r){return r.mode.OFB=function(){var i=r.lib.BlockCipherMode.extend(),f=i.Encryptor=i.extend({processBlock:function(s,p){var u=this._cipher,g=u.blockSize,S=this._iv,_=this._keystream;S&&(_=this._keystream=S.slice(0),this._iv=void 0),u.encryptBlock(_,0);for(var D=0;D>>2]|=u<<24-g%4*8,i.sigBytes+=u},unpad:function(i){var f=i.words[i.sigBytes-1>>>2]&255;i.sigBytes-=f}},r.pad.Ansix923})})(Vs);var Js={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,ce.exports)})(gt,function(r){return r.pad.Iso10126={pad:function(i,f){var s=f*4,p=s-i.sigBytes%s;i.concat(r.lib.WordArray.random(p-1)).concat(r.lib.WordArray.create([p<<24],1))},unpad:function(i){var f=i.words[i.sigBytes-1>>>2]&255;i.sigBytes-=f}},r.pad.Iso10126})})(Js);var Xs={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,ce.exports)})(gt,function(r){return r.pad.Iso97971={pad:function(i,f){i.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(i,f)},unpad:function(i){r.pad.ZeroPadding.unpad(i),i.sigBytes--}},r.pad.Iso97971})})(Xs);var Zs={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,ce.exports)})(gt,function(r){return r.pad.ZeroPadding={pad:function(i,f){var s=f*4;i.clamp(),i.sigBytes+=s-(i.sigBytes%s||s)},unpad:function(i){for(var f=i.words,s=i.sigBytes-1,s=i.sigBytes-1;s>=0;s--)if(f[s>>>2]>>>24-s%4*8&255){i.sigBytes=s+1;break}}},r.pad.ZeroPadding})})(Zs);var Qi={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,ce.exports)})(gt,function(r){return r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding})})(Qi);var yu=Qi.exports,Qs={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,ce.exports)})(gt,function(r){return function(i){var f=r,s=f.lib,p=s.CipherParams,u=f.enc,g=u.Hex,S=f.format;S.Hex={stringify:function(_){return _.ciphertext.toString(g)},parse:function(_){var D=g.parse(_);return p.create({ciphertext:D})}}}(),r.format.Hex})})(Qs);var ji={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,Pr.exports,Nr.exports,ir.exports,ce.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.BlockCipher,p=i.algo,u=[],g=[],S=[],_=[],D=[],B=[],L=[],H=[],U=[],N=[];(function(){for(var k=[],$=0;$<256;$++)$<128?k[$]=$<<1:k[$]=$<<1^283;for(var K=0,M=0,$=0;$<256;$++){var T=M^M<<1^M<<2^M<<3^M<<4;T=T>>>8^T&255^99,u[K]=T,g[T]=K;var I=k[K],q=k[I],C=k[q],w=k[T]*257^T*16843008;S[K]=w<<24|w>>>8,_[K]=w<<16|w>>>16,D[K]=w<<8|w>>>24,B[K]=w;var w=C*16843009^q*65537^I*257^K*16843008;L[T]=w<<24|w>>>8,H[T]=w<<16|w>>>16,U[T]=w<<8|w>>>24,N[T]=w,K?(K=I^k[k[k[C^I]]],M^=k[k[M]]):K=M=1}})();var P=[0,1,2,4,8,16,32,64,128,27,54],z=p.AES=s.extend({_doReset:function(){var k;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var $=this._keyPriorReset=this._key,K=$.words,M=$.sigBytes/4,T=this._nRounds=M+6,I=(T+1)*4,q=this._keySchedule=[],C=0;C6&&C%M==4&&(k=u[k>>>24]<<24|u[k>>>16&255]<<16|u[k>>>8&255]<<8|u[k&255]):(k=k<<8|k>>>24,k=u[k>>>24]<<24|u[k>>>16&255]<<16|u[k>>>8&255]<<8|u[k&255],k^=P[C/M|0]<<24),q[C]=q[C-M]^k);for(var w=this._invKeySchedule=[],h=0;h>>24]]^H[u[k>>>16&255]]^U[u[k>>>8&255]]^N[u[k&255]]}}},encryptBlock:function(k,$){this._doCryptBlock(k,$,this._keySchedule,S,_,D,B,u)},decryptBlock:function(k,$){var K=k[$+1];k[$+1]=k[$+3],k[$+3]=K,this._doCryptBlock(k,$,this._invKeySchedule,L,H,U,N,g);var K=k[$+1];k[$+1]=k[$+3],k[$+3]=K},_doCryptBlock:function(k,$,K,M,T,I,q,C){for(var w=this._nRounds,h=k[$]^K[0],a=k[$+1]^K[1],n=k[$+2]^K[2],o=k[$+3]^K[3],l=4,m=1;m>>24]^T[a>>>16&255]^I[n>>>8&255]^q[o&255]^K[l++],y=M[a>>>24]^T[n>>>16&255]^I[o>>>8&255]^q[h&255]^K[l++],c=M[n>>>24]^T[o>>>16&255]^I[h>>>8&255]^q[a&255]^K[l++],v=M[o>>>24]^T[h>>>16&255]^I[a>>>8&255]^q[n&255]^K[l++];h=E,a=y,n=c,o=v}var E=(C[h>>>24]<<24|C[a>>>16&255]<<16|C[n>>>8&255]<<8|C[o&255])^K[l++],y=(C[a>>>24]<<24|C[n>>>16&255]<<16|C[o>>>8&255]<<8|C[h&255])^K[l++],c=(C[n>>>24]<<24|C[o>>>16&255]<<16|C[h>>>8&255]<<8|C[a&255])^K[l++],v=(C[o>>>24]<<24|C[h>>>16&255]<<16|C[a>>>8&255]<<8|C[n&255])^K[l++];k[$]=E,k[$+1]=y,k[$+2]=c,k[$+3]=v},keySize:256/32});i.AES=s._createHelper(z)}(),r.AES})})(ji);var js=ji.exports,tf={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,Pr.exports,Nr.exports,ir.exports,ce.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.WordArray,p=f.BlockCipher,u=i.algo,g=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],S=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],_=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],D=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],B=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],L=u.DES=p.extend({_doReset:function(){for(var P=this._key,z=P.words,k=[],$=0;$<56;$++){var K=g[$]-1;k[$]=z[K>>>5]>>>31-K%32&1}for(var M=this._subKeys=[],T=0;T<16;T++){for(var I=M[T]=[],q=_[T],$=0;$<24;$++)I[$/6|0]|=k[(S[$]-1+q)%28]<<31-$%6,I[4+($/6|0)]|=k[28+(S[$+24]-1+q)%28]<<31-$%6;I[0]=I[0]<<1|I[0]>>>31;for(var $=1;$<7;$++)I[$]=I[$]>>>($-1)*4+3;I[7]=I[7]<<5|I[7]>>>27}for(var C=this._invSubKeys=[],$=0;$<16;$++)C[$]=M[15-$]},encryptBlock:function(P,z){this._doCryptBlock(P,z,this._subKeys)},decryptBlock:function(P,z){this._doCryptBlock(P,z,this._invSubKeys)},_doCryptBlock:function(P,z,k){this._lBlock=P[z],this._rBlock=P[z+1],H.call(this,4,252645135),H.call(this,16,65535),U.call(this,2,858993459),U.call(this,8,16711935),H.call(this,1,1431655765);for(var $=0;$<16;$++){for(var K=k[$],M=this._lBlock,T=this._rBlock,I=0,q=0;q<8;q++)I|=D[q][((T^K[q])&B[q])>>>0];this._lBlock=T,this._rBlock=M^I}var C=this._lBlock;this._lBlock=this._rBlock,this._rBlock=C,H.call(this,1,1431655765),U.call(this,8,16711935),U.call(this,2,858993459),H.call(this,16,65535),H.call(this,4,252645135),P[z]=this._lBlock,P[z+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function H(P,z){var k=(this._lBlock>>>P^this._rBlock)&z;this._rBlock^=k,this._lBlock^=k<>>P^this._lBlock)&z;this._lBlock^=k,this._rBlock^=k<192.");var k=z.slice(0,2),$=z.length<4?z.slice(0,2):z.slice(2,4),K=z.length<6?z.slice(0,2):z.slice(4,6);this._des1=L.createEncryptor(s.create(k)),this._des2=L.createEncryptor(s.create($)),this._des3=L.createEncryptor(s.create(K))},encryptBlock:function(P,z){this._des1.encryptBlock(P,z),this._des2.decryptBlock(P,z),this._des3.encryptBlock(P,z)},decryptBlock:function(P,z){this._des3.decryptBlock(P,z),this._des2.encryptBlock(P,z),this._des1.decryptBlock(P,z)},keySize:192/32,ivSize:64/32,blockSize:64/32});i.TripleDES=p._createHelper(N)}(),r.TripleDES})})(tf);var ef={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,Pr.exports,Nr.exports,ir.exports,ce.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.StreamCipher,p=i.algo,u=p.RC4=s.extend({_doReset:function(){for(var _=this._key,D=_.words,B=_.sigBytes,L=this._S=[],H=0;H<256;H++)L[H]=H;for(var H=0,U=0;H<256;H++){var N=H%B,P=D[N>>>2]>>>24-N%4*8&255;U=(U+L[H]+P)%256;var z=L[H];L[H]=L[U],L[U]=z}this._i=this._j=0},_doProcessBlock:function(_,D){_[D]^=g.call(this)},keySize:256/32,ivSize:0});function g(){for(var _=this._S,D=this._i,B=this._j,L=0,H=0;H<4;H++){D=(D+1)%256,B=(B+_[D])%256;var U=_[D];_[D]=_[B],_[B]=U,L|=_[(_[D]+_[B])%256]<<24-H*8}return this._i=D,this._j=B,L}i.RC4=s._createHelper(u);var S=p.RC4Drop=u.extend({cfg:u.cfg.extend({drop:192}),_doReset:function(){u._doReset.call(this);for(var _=this.cfg.drop;_>0;_--)g.call(this)}});i.RC4Drop=s._createHelper(S)}(),r.RC4})})(ef);var rf={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,Pr.exports,Nr.exports,ir.exports,ce.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.StreamCipher,p=i.algo,u=[],g=[],S=[],_=p.Rabbit=s.extend({_doReset:function(){for(var B=this._key.words,L=this.cfg.iv,H=0;H<4;H++)B[H]=(B[H]<<8|B[H]>>>24)&16711935|(B[H]<<24|B[H]>>>8)&4278255360;var U=this._X=[B[0],B[3]<<16|B[2]>>>16,B[1],B[0]<<16|B[3]>>>16,B[2],B[1]<<16|B[0]>>>16,B[3],B[2]<<16|B[1]>>>16],N=this._C=[B[2]<<16|B[2]>>>16,B[0]&4294901760|B[1]&65535,B[3]<<16|B[3]>>>16,B[1]&4294901760|B[2]&65535,B[0]<<16|B[0]>>>16,B[2]&4294901760|B[3]&65535,B[1]<<16|B[1]>>>16,B[3]&4294901760|B[0]&65535];this._b=0;for(var H=0;H<4;H++)D.call(this);for(var H=0;H<8;H++)N[H]^=U[H+4&7];if(L){var P=L.words,z=P[0],k=P[1],$=(z<<8|z>>>24)&16711935|(z<<24|z>>>8)&4278255360,K=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,M=$>>>16|K&4294901760,T=K<<16|$&65535;N[0]^=$,N[1]^=M,N[2]^=K,N[3]^=T,N[4]^=$,N[5]^=M,N[6]^=K,N[7]^=T;for(var H=0;H<4;H++)D.call(this)}},_doProcessBlock:function(B,L){var H=this._X;D.call(this),u[0]=H[0]^H[5]>>>16^H[3]<<16,u[1]=H[2]^H[7]>>>16^H[5]<<16,u[2]=H[4]^H[1]>>>16^H[7]<<16,u[3]=H[6]^H[3]>>>16^H[1]<<16;for(var U=0;U<4;U++)u[U]=(u[U]<<8|u[U]>>>24)&16711935|(u[U]<<24|u[U]>>>8)&4278255360,B[L+U]^=u[U]},blockSize:128/32,ivSize:64/32});function D(){for(var B=this._X,L=this._C,H=0;H<8;H++)g[H]=L[H];L[0]=L[0]+1295307597+this._b|0,L[1]=L[1]+3545052371+(L[0]>>>0>>0?1:0)|0,L[2]=L[2]+886263092+(L[1]>>>0>>0?1:0)|0,L[3]=L[3]+1295307597+(L[2]>>>0>>0?1:0)|0,L[4]=L[4]+3545052371+(L[3]>>>0>>0?1:0)|0,L[5]=L[5]+886263092+(L[4]>>>0>>0?1:0)|0,L[6]=L[6]+1295307597+(L[5]>>>0>>0?1:0)|0,L[7]=L[7]+3545052371+(L[6]>>>0>>0?1:0)|0,this._b=L[7]>>>0>>0?1:0;for(var H=0;H<8;H++){var U=B[H]+L[H],N=U&65535,P=U>>>16,z=((N*N>>>17)+N*P>>>15)+P*P,k=((U&4294901760)*U|0)+((U&65535)*U|0);S[H]=z^k}B[0]=S[0]+(S[7]<<16|S[7]>>>16)+(S[6]<<16|S[6]>>>16)|0,B[1]=S[1]+(S[0]<<8|S[0]>>>24)+S[7]|0,B[2]=S[2]+(S[1]<<16|S[1]>>>16)+(S[0]<<16|S[0]>>>16)|0,B[3]=S[3]+(S[2]<<8|S[2]>>>24)+S[1]|0,B[4]=S[4]+(S[3]<<16|S[3]>>>16)+(S[2]<<16|S[2]>>>16)|0,B[5]=S[5]+(S[4]<<8|S[4]>>>24)+S[3]|0,B[6]=S[6]+(S[5]<<16|S[5]>>>16)+(S[4]<<16|S[4]>>>16)|0,B[7]=S[7]+(S[6]<<8|S[6]>>>24)+S[5]|0}i.Rabbit=s._createHelper(_)}(),r.Rabbit})})(rf);var nf={exports:{}};(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,Pr.exports,Nr.exports,ir.exports,ce.exports)})(gt,function(r){return function(){var i=r,f=i.lib,s=f.StreamCipher,p=i.algo,u=[],g=[],S=[],_=p.RabbitLegacy=s.extend({_doReset:function(){var B=this._key.words,L=this.cfg.iv,H=this._X=[B[0],B[3]<<16|B[2]>>>16,B[1],B[0]<<16|B[3]>>>16,B[2],B[1]<<16|B[0]>>>16,B[3],B[2]<<16|B[1]>>>16],U=this._C=[B[2]<<16|B[2]>>>16,B[0]&4294901760|B[1]&65535,B[3]<<16|B[3]>>>16,B[1]&4294901760|B[2]&65535,B[0]<<16|B[0]>>>16,B[2]&4294901760|B[3]&65535,B[1]<<16|B[1]>>>16,B[3]&4294901760|B[0]&65535];this._b=0;for(var N=0;N<4;N++)D.call(this);for(var N=0;N<8;N++)U[N]^=H[N+4&7];if(L){var P=L.words,z=P[0],k=P[1],$=(z<<8|z>>>24)&16711935|(z<<24|z>>>8)&4278255360,K=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,M=$>>>16|K&4294901760,T=K<<16|$&65535;U[0]^=$,U[1]^=M,U[2]^=K,U[3]^=T,U[4]^=$,U[5]^=M,U[6]^=K,U[7]^=T;for(var N=0;N<4;N++)D.call(this)}},_doProcessBlock:function(B,L){var H=this._X;D.call(this),u[0]=H[0]^H[5]>>>16^H[3]<<16,u[1]=H[2]^H[7]>>>16^H[5]<<16,u[2]=H[4]^H[1]>>>16^H[7]<<16,u[3]=H[6]^H[3]>>>16^H[1]<<16;for(var U=0;U<4;U++)u[U]=(u[U]<<8|u[U]>>>24)&16711935|(u[U]<<24|u[U]>>>8)&4278255360,B[L+U]^=u[U]},blockSize:128/32,ivSize:64/32});function D(){for(var B=this._X,L=this._C,H=0;H<8;H++)g[H]=L[H];L[0]=L[0]+1295307597+this._b|0,L[1]=L[1]+3545052371+(L[0]>>>0>>0?1:0)|0,L[2]=L[2]+886263092+(L[1]>>>0>>0?1:0)|0,L[3]=L[3]+1295307597+(L[2]>>>0>>0?1:0)|0,L[4]=L[4]+3545052371+(L[3]>>>0>>0?1:0)|0,L[5]=L[5]+886263092+(L[4]>>>0>>0?1:0)|0,L[6]=L[6]+1295307597+(L[5]>>>0>>0?1:0)|0,L[7]=L[7]+3545052371+(L[6]>>>0>>0?1:0)|0,this._b=L[7]>>>0>>0?1:0;for(var H=0;H<8;H++){var U=B[H]+L[H],N=U&65535,P=U>>>16,z=((N*N>>>17)+N*P>>>15)+P*P,k=((U&4294901760)*U|0)+((U&65535)*U|0);S[H]=z^k}B[0]=S[0]+(S[7]<<16|S[7]>>>16)+(S[6]<<16|S[6]>>>16)|0,B[1]=S[1]+(S[0]<<8|S[0]>>>24)+S[7]|0,B[2]=S[2]+(S[1]<<16|S[1]>>>16)+(S[0]<<16|S[0]>>>16)|0,B[3]=S[3]+(S[2]<<8|S[2]>>>24)+S[1]|0,B[4]=S[4]+(S[3]<<16|S[3]>>>16)+(S[2]<<16|S[2]>>>16)|0,B[5]=S[5]+(S[4]<<8|S[4]>>>24)+S[3]|0,B[6]=S[6]+(S[5]<<16|S[5]>>>16)+(S[4]<<16|S[4]>>>16)|0,B[7]=S[7]+(S[6]<<8|S[6]>>>24)+S[5]|0}i.RabbitLegacy=s._createHelper(_)}(),r.RabbitLegacy})})(nf);(function(e,t){(function(r,i,f){e.exports=i(Rt.exports,g0.exports,Fs.exports,zs.exports,Pr.exports,Cs.exports,Nr.exports,Q0.exports,Z0.exports,ks.exports,Xi.exports,$s.exports,Gs.exports,Vi.exports,j0.exports,qs.exports,ir.exports,ce.exports,Ks.exports,Ys.exports,Os.exports,Ws.exports,Zi.exports,Vs.exports,Js.exports,Xs.exports,Zs.exports,Qi.exports,Qs.exports,ji.exports,tf.exports,ef.exports,rf.exports,nf.exports)})(gt,function(r){return r})})(Ir);const wu=e=>{const t=e%4==0?e:e+e%4;return(Ir.exports.lib.WordArray.random(t).toString().substr(0,e*2).match(/.{1,2}/g)||[]).map(f=>parseInt(f,16))},bu=/^([0-9A-Fa-f]{2})*$/;function tn(e){try{return bu.test(e)}catch{return!1}}function m0(e){if(!tn(e))throw new Error(`Expected a hexstring but got ${e}`)}function xe(e){m0(e);let t="";for(let r=e.length-2;r>=0;r-=2)t+=e.substr(r,2);return t}function Su(e){return Ir.exports.enc.Base64.stringify(Ir.exports.enc.Hex.parse(e))}function _u(e){return Ir.exports.enc.Base64.parse(e).toString(Ir.exports.enc.Hex)}function Mu(e){return String.fromCharCode.apply(null,Array.from(new Uint8Array(e)))}function Eu(e){if(typeof e!="string")throw new Error(`str2ab expected a string but got ${typeof e} instead.`);const t=new Uint8Array(e.length);for(let r=0,i=e.length;r=10;h/=10,w++);l.e=w,l.c=[M];return}o=M+""}else{if(!Ru.test(o=M+""))return i(l,o,a);l.s=o.charCodeAt(0)==45?(o=o.slice(1),-1):1}(w=o.indexOf("."))>-1&&(o=o.replace(".","")),(h=o.search(/e/i))>0?(w<0&&(w=h),w+=+o.slice(h+1),o=o.substring(0,h)):w<0&&(w=o.length)}else{if(ie(T,2,N.length,"Base"),o=M+"",T==10)return l=new P(M instanceof P?M:o),K(l,p+l.e+1,u);if(a=typeof M=="number",a){if(M*0!=0)return i(l,o,a,T);if(l.s=1/M<0?(o=o.slice(1),-1):1,P.DEBUG&&o.replace(/^0\.0*|\./,"").length>15)throw Error(sf+M);a=!1}else l.s=o.charCodeAt(0)===45?(o=o.slice(1),-1):1;for(I=N.slice(0,T),w=h=0,n=o.length;hw){w=n;continue}}else if(!C&&(o==o.toUpperCase()&&(o=o.toLowerCase())||o==o.toLowerCase()&&(o=o.toUpperCase()))){C=!0,h=-1,w=0;continue}return i(l,M+"",a,T)}o=r(o,T,10,l.s),(w=o.indexOf("."))>-1?o=o.replace(".",""):w=o.length}for(h=0;o.charCodeAt(h)===48;h++);for(n=o.length;o.charCodeAt(--n)===48;);if(o=o.slice(h,++n),o){if(n-=h,a&&P.DEBUG&&n>15&&(M>rn||M!==nr(M)))throw Error(sf+l.s*M);if(w=w-h-1,w>D)l.c=l.e=null;else if(w<_)l.c=[l.e=0];else{if(l.e=w,l.c=[],h=(w+1)%Tt,w<0&&(h+=Tt),h>>11),a>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),q[n]=C[0],q[n+1]=C[1]):(o.push(a%1e14),n+=2);n=h/2}else if(crypto.randomBytes){for(q=crypto.randomBytes(h*=7);n=9e15?crypto.randomBytes(7).copy(q,n):(o.push(a%1e14),n+=7);n=h/7}else throw B=!1,Error(Te+"crypto unavailable");if(!B)for(;n=10;a/=10,n++);nC-1&&(a[h+1]==null&&(a[h+1]=0),a[h+1]+=a[h]/C|0,a[h]%=C)}return a.reverse()}return function(I,q,C,w,h){var a,n,o,l,m,E,y,c,v=I.indexOf("."),d=p,A=u;for(v>=0&&(l=H,H=0,I=I.replace(".",""),c=new P(q),E=c.pow(I.length-v),H=l,c.c=T(fr(Ve(E.c),E.e,"0"),10,C,M),c.e=c.c.length),y=T(I,q,C,h?(a=N,M):(a=M,N)),o=l=y.length;y[--l]==0;y.pop());if(!y[0])return a.charAt(0);if(v<0?--o:(E.c=y,E.e=o,E.s=w,E=t(E,c,d,A,C),y=E.c,m=E.r,o=E.e),n=o+d+1,v=y[n],l=C/2,m=m||n<0||y[n+1]!=null,m=A<4?(v!=null||m)&&(A==0||A==(E.s<0?3:2)):v>l||v==l&&(A==4||m||A==6&&y[n-1]&1||A==(E.s<0?8:7)),n<1||!y[0])I=m?fr(a.charAt(1),-d,a.charAt(0)):a.charAt(0);else{if(y.length=n,m)for(--C;++y[--n]>C;)y[n]=0,n||(++o,y=[1].concat(y));for(l=y.length;!y[--l];);for(v=0,I="";v<=l;I+=a.charAt(y[v++]));I=fr(I,o,a.charAt(0))}return I}}(),t=function(){function M(q,C,w){var h,a,n,o,l=0,m=q.length,E=C%sr,y=C/sr|0;for(q=q.slice();m--;)n=q[m]%sr,o=q[m]/sr|0,h=y*n+o*E,a=E*n+h%sr*sr+l,l=(a/w|0)+(h/sr|0)+y*o,q[m]=a%w;return l&&(q=[l].concat(q)),q}function T(q,C,w,h){var a,n;if(w!=h)n=w>h?1:-1;else for(a=n=0;aC[a]?1:-1;break}return n}function I(q,C,w,h){for(var a=0;w--;)q[w]-=a,a=q[w]1;q.splice(0,1));}return function(q,C,w,h,a){var n,o,l,m,E,y,c,v,d,A,Y,J,X,tt,Z,Q,at,lt=q.s==C.s?1:-1,et=q.c,it=C.c;if(!et||!et[0]||!it||!it[0])return new P(!q.s||!C.s||(et?it&&et[0]==it[0]:!it)?NaN:et&&et[0]==0||!it?lt*0:lt/0);for(v=new P(lt),d=v.c=[],o=q.e-C.e,lt=w+o+1,a||(a=Ge,o=Be(q.e/Tt)-Be(C.e/Tt),lt=lt/Tt|0),l=0;it[l]==(et[l]||0);l++);if(it[l]>(et[l]||0)&&o--,lt<0)d.push(1),m=!0;else{for(tt=et.length,Q=it.length,l=0,lt+=2,E=nr(a/(it[0]+1)),E>1&&(it=M(it,E,a),et=M(et,E,a),Q=it.length,tt=et.length),X=Q,A=et.slice(0,Q),Y=A.length;Y=a/2&&Z++;do{if(E=0,n=T(it,A,Q,Y),n<0){if(J=A[0],Q!=Y&&(J=J*a+(A[1]||0)),E=nr(J/Z),E>1)for(E>=a&&(E=a-1),y=M(it,E,a),c=y.length,Y=A.length;T(y,A,c,Y)==1;)E--,I(y,Q=10;lt/=10,l++);K(v,w+(v.e=l+o*Tt-1)+1,h,m)}else v.e=o,v.r=+m;return v}}();function z(M,T,I,q){var C,w,h,a,n;if(I==null?I=u:ie(I,0,8),!M.c)return M.toString();if(C=M.c[0],h=M.e,T==null)n=Ve(M.c),n=q==1||q==2&&h<=g?ii(n,h):fr(n,h,"0");else if(M=K(new P(M),T,I),w=M.e,n=Ve(M.c),a=n.length,q==1||q==2&&(T<=w||w<=g)){for(;aa){if(--T>0)for(n+=".";T--;n+="0");}else if(T+=w-a,T>0)for(w+1==a&&(n+=".");T--;n+="0");return M.s<0&&C?"-"+n:n}function k(M,T){var I,q,C=0;for(sn(M[0])&&(M=M[0]),I=new P(M[0]);++C=10;C/=10,q++);return(I=q+I*Tt-1)>D?M.c=M.e=null:I<_?M.c=[M.e=0]:(M.e=I,M.c=T),M}i=function(){var M=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,I=/^\.([^.]+)$/,q=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(w,h,a,n){var o,l=a?h:h.replace(C,"");if(q.test(l))w.s=isNaN(l)?null:l<0?-1:1,w.c=w.e=null;else{if(!a&&(l=l.replace(M,function(m,E,y){return o=(y=y.toLowerCase())=="x"?16:y=="b"?2:8,!n||n==o?E:m}),n&&(o=n,l=l.replace(T,"$1").replace(I,"0.$1")),h!=l))return new P(l,o);if(P.DEBUG)throw Error(Te+"Not a"+(n?" base "+n:"")+" number: "+h);w.c=w.e=w.s=null}}}();function K(M,T,I,q){var C,w,h,a,n,o,l,m=M.c,E=nn;if(m){t:{for(C=1,a=m[0];a>=10;a/=10,C++);if(w=T-C,w<0)w+=Tt,h=T,n=m[o=0],l=n/E[C-h-1]%10|0;else if(o=ei((w+1)/Tt),o>=m.length)if(q){for(;m.length<=o;m.push(0));n=l=0,C=1,w%=Tt,h=w-Tt+1}else break t;else{for(n=a=m[o],C=1;a>=10;a/=10,C++);w%=Tt,h=w-Tt+C,l=h<0?0:n/E[C-h-1]%10|0}if(q=q||T<0||m[o+1]!=null||(h<0?n:n%E[C-h-1]),q=I<4?(l||q)&&(I==0||I==(M.s<0?3:2)):l>5||l==5&&(I==4||q||I==6&&(w>0?h>0?n/E[C-h]:0:m[o-1])%10&1||I==(M.s<0?8:7)),T<1||!m[0])return m.length=0,q?(T-=M.e+1,m[0]=E[(Tt-T%Tt)%Tt],M.e=-T||0):m[0]=M.e=0,M;if(w==0?(m.length=o,a=1,o--):(m.length=o+1,a=E[Tt-w],m[o]=h>0?nr(n/E[C-h]%E[h])*a:0),q)for(;;)if(o==0){for(w=1,h=m[0];h>=10;h/=10,w++);for(h=m[0]+=a,a=1;h>=10;h/=10,a++);w!=a&&(M.e++,m[0]==Ge&&(m[0]=1));break}else{if(m[o]+=a,m[o]!=Ge)break;m[o--]=0,a=1}for(w=m.length;m[--w]===0;m.pop());}M.e>D?M.c=M.e=null:M.e<_&&(M.c=[M.e=0])}return M}return f.absoluteValue=f.abs=function(){var M=new P(this);return M.s<0&&(M.s=1),M},f.comparedTo=function(M,T){return r0(this,new P(M,T))},f.decimalPlaces=f.dp=function(M,T){var I,q,C,w=this;if(M!=null)return ie(M,0,ge),T==null?T=u:ie(T,0,8),K(new P(w),M+w.e+1,T);if(!(I=w.c))return null;if(q=((C=I.length-1)-Be(this.e/Tt))*Tt,C=I[C])for(;C%10==0;C/=10,q--);return q<0&&(q=0),q},f.dividedBy=f.div=function(M,T){return t(this,new P(M,T),p,u)},f.dividedToIntegerBy=f.idiv=function(M,T){return t(this,new P(M,T),0,1)},f.exponentiatedBy=f.pow=function(M,T){var I,q,C,w,h,a,n,o,l=this;if(M=new P(M),M.c&&!M.isInteger())throw Error(Te+"Exponent not an integer: "+M);if(T!=null&&(T=new P(T)),h=M.e>14,!l.c||!l.c[0]||l.c[0]==1&&!l.e&&l.c.length==1||!M.c||!M.c[0])return o=new P(Math.pow(+l.valueOf(),h?2-ri(M):+M)),T?o.mod(T):o;if(a=M.s<0,T){if(T.c?!T.c[0]:!T.s)return new P(NaN);q=!a&&l.isInteger()&&T.isInteger(),q&&(l=l.mod(T))}else{if(M.e>9&&(l.e>0||l.e<-1||(l.e==0?l.c[0]>1||h&&l.c[1]>=24e7:l.c[0]<8e13||h&&l.c[0]<=9999975e7)))return C=l.s<0&&ri(M)?-0:0,l.e>-1&&(C=1/C),new P(a?1/C:C);H&&(C=ei(H/Tt+2))}for(h?(I=new P(.5),n=ri(M)):n=M%2,a&&(M.s=1),o=new P(s);;){if(n){if(o=o.times(l),!o.c)break;C?o.c.length>C&&(o.c.length=C):q&&(o=o.mod(T))}if(h){if(M=M.times(I),K(M,M.e+1,1),!M.c[0])break;h=M.e>14,n=ri(M)}else{if(M=nr(M/2),!M)break;n=M%2}l=l.times(l),C?l.c&&l.c.length>C&&(l.c.length=C):q&&(l=l.mod(T))}return q?o:(a&&(o=s.div(o)),T?o.mod(T):C?K(o,H,u,w):o)},f.integerValue=function(M){var T=new P(this);return M==null?M=u:ie(M,0,8),K(T,T.e+1,M)},f.isEqualTo=f.eq=function(M,T){return r0(this,new P(M,T))===0},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(M,T){return r0(this,new P(M,T))>0},f.isGreaterThanOrEqualTo=f.gte=function(M,T){return(T=r0(this,new P(M,T)))===1||T===0},f.isInteger=function(){return!!this.c&&Be(this.e/Tt)>this.c.length-2},f.isLessThan=f.lt=function(M,T){return r0(this,new P(M,T))<0},f.isLessThanOrEqualTo=f.lte=function(M,T){return(T=r0(this,new P(M,T)))===-1||T===0},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&this.c[0]==0},f.minus=function(M,T){var I,q,C,w,h=this,a=h.s;if(M=new P(M,T),T=M.s,!a||!T)return new P(NaN);if(a!=T)return M.s=-T,h.plus(M);var n=h.e/Tt,o=M.e/Tt,l=h.c,m=M.c;if(!n||!o){if(!l||!m)return l?(M.s=-T,M):new P(m?h:NaN);if(!l[0]||!m[0])return m[0]?(M.s=-T,M):new P(l[0]?h:u==3?-0:0)}if(n=Be(n),o=Be(o),l=l.slice(),a=n-o){for((w=a<0)?(a=-a,C=l):(o=n,C=m),C.reverse(),T=a;T--;C.push(0));C.reverse()}else for(q=(w=(a=l.length)<(T=m.length))?a:T,a=T=0;T0)for(;T--;l[I++]=0);for(T=Ge-1;q>a;){if(l[--q]=0;){for(I=0,E=J[C]%d,y=J[C]/d|0,h=n,w=C+h;w>C;)o=Y[--h]%d,l=Y[h]/d|0,a=y*o+l*E,o=E*o+a%d*d+c[w]+I,I=(o/v|0)+(a/d|0)+y*l,c[w--]=o%v;c[w]=I}return I?++q:c.splice(0,1),$(M,c,q)},f.negated=function(){var M=new P(this);return M.s=-M.s||null,M},f.plus=function(M,T){var I,q=this,C=q.s;if(M=new P(M,T),T=M.s,!C||!T)return new P(NaN);if(C!=T)return M.s=-T,q.minus(M);var w=q.e/Tt,h=M.e/Tt,a=q.c,n=M.c;if(!w||!h){if(!a||!n)return new P(C/0);if(!a[0]||!n[0])return n[0]?M:new P(a[0]?q:C*0)}if(w=Be(w),h=Be(h),a=a.slice(),C=w-h){for(C>0?(h=w,I=n):(C=-C,I=a),I.reverse();C--;I.push(0));I.reverse()}for(C=a.length,T=n.length,C-T<0&&(I=n,n=a,a=I,T=C),C=0;T;)C=(a[--T]=a[T]+n[T]+C)/Ge|0,a[T]=Ge===a[T]?0:a[T]%Ge;return C&&(a=[C].concat(a),++h),$(M,a,h)},f.precision=f.sd=function(M,T){var I,q,C,w=this;if(M!=null&&M!==!!M)return ie(M,1,ge),T==null?T=u:ie(T,0,8),K(new P(w),M,T);if(!(I=w.c))return null;if(C=I.length-1,q=C*Tt+1,C=I[C]){for(;C%10==0;C/=10,q--);for(C=I[0];C>=10;C/=10,q++);}return M&&w.e+1>q&&(q=w.e+1),q},f.shiftedBy=function(M){return ie(M,-rn,rn),this.times("1e"+M)},f.squareRoot=f.sqrt=function(){var M,T,I,q,C,w=this,h=w.c,a=w.s,n=w.e,o=p+4,l=new P("0.5");if(a!==1||!h||!h[0])return new P(!a||a<0&&(!h||h[0])?NaN:h?w:1/0);if(a=Math.sqrt(+w),a==0||a==1/0?(T=Ve(h),(T.length+n)%2==0&&(T+="0"),a=Math.sqrt(T),n=Be((n+1)/2)-(n<0||n%2),a==1/0?T="1e"+n:(T=a.toExponential(),T=T.slice(0,T.indexOf("e")+1)+n),I=new P(T)):I=new P(a+""),I.c[0]){for(n=I.e,a=n+o,a<3&&(a=0);;)if(C=I,I=l.times(C.plus(t(w,C,o,1))),Ve(C.c).slice(0,a)===(T=Ve(I.c)).slice(0,a))if(I.e0&&E>0){for(q=E%w||w,n=m.substr(0,q);q0&&(n+=a+m.slice(q)),l&&(n="-"+n)}I=o?n+U.decimalSeparator+((h=+U.fractionGroupSize)?o.replace(new RegExp("\\d{"+h+"}\\B","g"),"$&"+U.fractionGroupSeparator):o):n}return I},f.toFraction=function(M){var T,I,q,C,w,h,a,n,o,l,m,E,y=this,c=y.c;if(M!=null&&(n=new P(M),!n.isInteger()&&(n.c||n.s!==1)||n.lt(s)))throw Error(Te+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+M);if(!c)return y.toString();for(I=new P(s),l=q=new P(s),C=o=new P(s),E=Ve(c),h=I.e=E.length-y.e-1,I.c[0]=nn[(a=h%Tt)<0?Tt+a:a],M=!M||n.comparedTo(I)>0?h>0?I:l:n,a=D,D=1/0,n=new P(E),o.c[0]=0;m=t(n,I,0,1),w=q.plus(m.times(C)),w.comparedTo(M)!=1;)q=C,C=w,l=o.plus(m.times(w=l)),o=w,I=n.minus(m.times(w=I)),n=w;return w=t(M.minus(q),C,0,1),o=o.plus(w.times(l)),q=q.plus(w.times(C)),o.s=l.s=y.s,h*=2,T=t(l,C,h,u).minus(y).abs().comparedTo(t(o,q,h,u).minus(y).abs())<1?[l.toString(),C.toString()]:[o.toString(),q.toString()],D=a,T},f.toNumber=function(){return+this},f.toPrecision=function(M,T){return M!=null&&ie(M,1,ge),z(this,M,T,2)},f.toString=function(M){var T,I=this,q=I.s,C=I.e;return C===null?q?(T="Infinity",q<0&&(T="-"+T)):T="NaN":(T=Ve(I.c),M==null?T=C<=g||C>=S?ii(T,C):fr(T,C,"0"):(ie(M,2,N.length,"Base"),T=r(fr(T,C,"0"),10,M,q,!0)),q<0&&I.c[0]&&(T="-"+T)),T},f.valueOf=f.toJSON=function(){var M,T=this,I=T.e;return I===null?T.toString():(M=Ve(T.c),M=I<=g||I>=S?ii(M,I):fr(M,I,"0"),T.s<0?"-"+M:M)},f._isBigNumber=!0,e!=null&&P.set(e),P}function Be(e){var t=e|0;return e>0||e===t?t:t-1}function Ve(e){for(var t,r,i=1,f=e.length,s=e[0]+"";iS^r?1:-1;for(u=(g=f.length)<(S=s.length)?g:S,p=0;ps[p]^r?1:-1;return g==S?0:g>S^r?1:-1}function ie(e,t,r,i){if(er||e!==(e<0?ei(e):nr(e)))throw Error(Te+(i||"Argument")+(typeof e=="number"?er?" out of range: ":" not an integer: ":" not a primitive number: ")+e)}function sn(e){return Object.prototype.toString.call(e)=="[object Array]"}function ri(e){var t=e.c.length-1;return Be(e.e/Tt)==t&&e.c[t]%2!=0}function ii(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function fr(e,t,r){var i,f;if(t<0){for(f=r+".";++t;f+=r);e=f+e}else if(i=e.length,++t>i){for(f=r,t-=i;--t;f+=r);e+=f}else t16)throw new Error(`expected hex string to have length less or equal than 16: got ${t.length} for hex = ${t}`);let r=new Je(t,16);return r.isGreaterThan(of)&&(r=r.minus(af)),r=r.div(ni),new oe(r,10)}static fromReverseHex(t){return this.fromHex(xe(t))}static fromRawNumber(t,r=8){return new oe(new Je(t).div(new Je(10).pow(r)))}toHex(){let t="";const r=this.toRawNumber();return t=r.isLessThan(0)?af.plus(r).toString(16):r.toString(16),"0".repeat(16-t.length)+t}toReverseHex(){return xe(this.toHex())}toRawNumber(){return super.times(ni)}ceil(){return new oe(super.decimalPlaces(0,Je.ROUND_CEIL))}floor(){return new oe(super.decimalPlaces(0,Je.ROUND_FLOOR))}equals(t){return super.eq(t)}round(t=0,r){return new oe(super.decimalPlaces(t,r))}dividedBy(t,r){return new oe(super.dividedBy(t,r))}div(t,r){return this.dividedBy(t,r)}times(t,r){return new oe(super.times(t,r))}mul(t,r){return this.times(t,r)}plus(t,r){return new oe(super.plus(t,r))}add(t,r){return this.plus(t,r)}minus(t,r){return new oe(super.minus(t,r))}sub(t,r){return this.minus(t,r)}}oe.MAX_VALUE=new oe(of.div(ni));oe.MIN_VALUE=new oe(Lu.div(ni));class hf{constructor(t=""){this.str=t,this.pter=0}isEmpty(){return this.pter>=this.str.length}peek(t=1){return this.isEmpty()?"":this.str.substr(this.pter,t*2)}read(t=1){if(t===0)return"";if(this.isEmpty())throw new Error("Reached the end of the stream!");const r=this.str.substr(this.pter,t*2);return this.pter+=t*2,r}readVarBytes(){return this.read(this.readVarInt())}readVarInt(){let t=parseInt(this.read(1),16);return t===253?t=parseInt(xe(this.read(2)),16):t===254?t=parseInt(xe(this.read(4)),16):t===255&&(t=parseInt(xe(this.read(8)),16)),t}reset(){this.pter=0}context(){const t=this.pter>10?this.str.slice(this.pter-10,this.pter):this.str.slice(0,this.pter),r=this.read(1),i=this.peek(5);return this.pter-=2,`${t}|${r}|${i}`}}var Iu=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,r,i,f){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!f:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?f.call(e,r):f?f.value=r:t.set(e,r),r},i0=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)},Xe;class xt{constructor(t,r=!1){Xe.set(this,void 0),t.startsWith("0x")&&(t=t.slice(2)),this.assert(t),Iu(this,Xe,r?xe(t):t,"f")}get length(){return i0(this,Xe,"f").length}get byteLength(){return i0(this,Xe,"f").length/2}assert(t){m0(t)}toString(){return i0(this,Xe,"f")}toBigEndian(){return i0(this,Xe,"f")}toLittleEndian(){return xe(i0(this,Xe,"f"))}reversed(){return new xt(xe(i0(this,Xe,"f")))}equals(t){return typeof t=="string"?this.toBigEndian()===xt.fromHex(t).toBigEndian():this.toBigEndian()===t.toBigEndian()}xor(t){return xt.fromHex(en(this.toBigEndian(),t.toBigEndian()))}toAscii(){return Tu(this.toBigEndian())}toNumber(t=!1){return parseInt(t?this.toLittleEndian():this.toBigEndian(),16)}toArrayBuffer(t=!1){return y0(t?this.toLittleEndian():this.toBigEndian())}toBase64(t=!1){return Su(t?this.toLittleEndian():this.toBigEndian())}static fromHex(t,r=!1){return typeof t=="object"&&t instanceof xt?new xt(t.toBigEndian()):new xt(t,r)}static fromAscii(t){const r=Au(t);return new xt(r)}static fromNumber(t){const r=t.toString(16);return r.length%2!=0?new xt("0"+r):new xt(r)}static fromArrayBuffer(t,r=!1){return new xt(Se(t),r)}static fromBase64(t,r=!1){return new xt(_u(t),r)}}Xe=new WeakMap;var Pu=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,r,i,f){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!f:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?f.call(e,r):f?f.value=r:t.set(e,r),r},ae=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)},se;class kt{constructor(t){se.set(this,void 0),Pu(this,se,t,"f")}static fromTwos(t,r=!1){const i=t instanceof xt?t:xt.fromHex(t,r);return new kt(new fe(i.toBigEndian(),16).fromTwos(i.byteLength*8))}static fromHex(t,r=!1){const i=t instanceof xt?t:xt.fromHex(t,r);return new kt(new fe(i.toBigEndian(),16))}static fromNumber(t){switch(typeof t){case"string":if(t.indexOf(".")!==-1)throw new Error(`BigInteger only accepts integers. Got ${t}`);return new kt(new fe(t));case"number":if(t%1!=0)throw new Error(`BigInteger only accepts integers. Got ${t}`);return new kt(new fe(t.toString(16),16));default:throw new Error(`Input was not stringified number or number: ${typeof t} ${t}`)}}static fromDecimal(t,r){const f=(typeof t=="number"?t.toFixed(r):t).split(".",2),s=f[0],p=f.length===2?f[1]:"";if(p.length>r)throw new Error(`Input had more decimal places than provided. Got ${p} but only got ${r} decimal places.`);const u=s+p+"0".repeat(r-p.length);return kt.fromNumber(u)}toHex(){const t=ae(this,se,"f").toString(16);return t.length%2!=0?"0"+t:t}toReverseHex(){return xe(this.toHex())}toTwos(){const t=Du(ae(this,se,"f")),r=ae(this,se,"f").toTwos(t*8).toString(16,t*2);return r.length%2!=0?"0"+r:r}toReverseTwos(){return xe(this.toTwos())}toString(){return ae(this,se,"f").toString()}toDecimal(t){if(t===0)return ae(this,se,"f").toString();const r=ae(this,se,"f").isNeg()?"-":"",i=ae(this,se,"f").abs().toString(10);if(i.length<=t)return r+"0."+i.padStart(t,"0");const f=i.slice(0,i.length-t),s=i.slice(f.length);return r+f+"."+s}add(t){const r=t instanceof kt?t:kt.fromNumber(t);return new kt(ae(this,se,"f").add(ae(r,se,"f")))}sub(t){const r=t instanceof kt?t:kt.fromNumber(t);return new kt(ae(this,se,"f").sub(ae(r,se,"f")))}mul(t){const r=t instanceof kt?t:kt.fromNumber(t);return new kt(ae(this,se,"f").mul(ae(r,se,"f")))}div(t){const r=t instanceof kt?t:kt.fromNumber(t);return new kt(ae(this,se,"f").div(ae(r,se,"f")))}mod(t){const r=t instanceof kt?t:kt.fromNumber(t);return new kt(ae(this,se,"f").mod(ae(r,se,"f")))}compare(t){const r=t instanceof kt?t:kt.fromNumber(t);return ae(this,se,"f").cmp(ae(r,se,"f"))}equals(t){return this.compare(t)===0}}se=new WeakMap;const si=[[new fe(-128),new fe(127)],[new fe(-32768),new fe(32767)],[new fe(-8388608),new fe(8388607)]];function Nu(){const e=si.length+1,t=new fe(e*8-1);si.push([new fe(2).pow(t).neg(),new fe(2).pow(t).isubn(1)])}function Uu(e,t){return e.gte(t[0])&&e.lte(t[1])}function Du(e){let t=e.byteLength();if(t===0)return 0;for(;t<=32;){if(si.lengthzt.fromJson(i));return}else throw new Error("Please provide an array for value!");case j.Void:if(r==null){this.value=null;return}else throw new Error("Void should not have any value provided.");default:throw new Error(`${j[this.type]} not supported!`)}}static any(t=null){return new zt({type:j.Any,value:t})}static string(t){return new zt({type:j.String,value:t})}static boolean(t){return new zt({type:j.Boolean,value:!!t})}static publicKey(t){const r=t instanceof xt?t.toBigEndian():t;if(!oi(r))throw new Error(`publicKey expected valid public key but got ${r}`);return new zt({type:j.PublicKey,value:xt.fromHex(r)})}static hash160(t){const r=t instanceof xt?t:xt.fromHex(Sf(t)?wf(t):t);if(r.byteLength!==20)throw new Error(`hash160 expected 20 bytes but got ${r.byteLength} bytes instead.`);return new zt({type:j.Hash160,value:r})}static hash256(t){const r=t instanceof xt?t:xt.fromHex(t);if(r.byteLength!==32)throw new Error(`hash256 expected 32 bytes but got ${r.byteLength} bytes instead.`);return new zt({type:j.Hash256,value:r})}static integer(t){if(typeof t=="string")return new zt({type:j.Integer,value:t.split(".")[0]});if(typeof t=="number")return new zt({type:j.Integer,value:Math.round(t).toString()});if(t instanceof kt)return new zt({type:j.Integer,value:t.toString()});throw new Error(`Unknown input provided: ${t}`)}static byteArray(t){if(typeof t=="string")return new zt({type:j.ByteArray,value:xt.fromBase64(t,!0)});if(t instanceof xt)return new zt({type:j.ByteArray,value:t});throw new Error(`Unknown input provided: ${t}`)}static void(){return new zt({type:j.Void})}static array(...t){const r=t.map(i=>zt.fromJson(i));return new zt({type:j.Array,value:r})}get[Symbol.toStringTag](){return"ContractParam:"+j[this.type]}static fromJson(t){if(t instanceof zt)return new zt(t);const r=fn(t.type,j),i=t.value;switch(r){case j.Any:if(typeof i=="string"||i instanceof xt||i===null||i===void 0)return zt.any(i);break;case j.Array:if(Array.isArray(i))return zt.array(...i);break;case j.Boolean:if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")return zt.boolean(i);break;case j.ByteArray:if(typeof i=="string"||i instanceof xt)return zt.byteArray(i);break;case j.Hash160:if(typeof i=="string"||i instanceof xt)return zt.hash160(i);break;case j.Hash256:if(typeof i=="string"||i instanceof xt)return zt.hash256(i);break;case j.PublicKey:if(typeof i=="string"||i instanceof xt)return zt.publicKey(i);break;case j.Integer:if(typeof i=="string"||typeof i=="number")return zt.integer(i);break;case j.String:if(typeof i=="string")return zt.string(i);break;case j.Void:return zt.void();default:throw new Error(`${j[r]} not supported!`)}throw new Error(`got ${typeof i} which is not convertable to ${j[r]}`)}export(){return this.toJson()}toJson(){switch(this.type){case j.Any:return{type:j[this.type],value:this.value instanceof xt?this.value.toBigEndian():this.value};case j.Void:return{type:j[this.type],value:null};case j.ByteArray:return{type:j[this.type],value:this.value.toBase64(!0)};case j.Hash160:case j.Hash256:case j.PublicKey:return{type:j[this.type],value:this.value.toBigEndian()};case j.Array:return{type:j[this.type],value:this.value.map(t=>t.toJson())};case j.Boolean:return{type:j[this.type],value:this.value};case j.Integer:case j.String:return{type:j[this.type],value:this.value};default:throw new Error("Unsupported!")}}equals(t){if(this.type===fn(t.type,j))switch(this.type){case j.Array:case j.Map:return Array.isArray(this.value)&&Array.isArray(t.value)&&this.value.length===t.value.length?this.value.every((r,i)=>r.equals(t.value[i])):!1;case j.ByteArray:case j.Hash160:case j.Hash256:case j.PublicKey:return t.value instanceof xt||typeof t.value=="string"?this.value.equals(t.value):!1;case j.Integer:return typeof t.value=="number"?this.value===t.value.toString():typeof t.value=="string"?this.value===t.value:!1;case j.Void:return!0;case j.Boolean:case j.String:default:return this.value===t.value}return!1}}function Hu(e){return e==null?!1:e instanceof zt?!0:e.type!==void 0&&e.type in j&&e.value!==null&&e.value!==void 0}var R;(function(e){e[e.PUSHINT8=0]="PUSHINT8",e[e.PUSHINT16=1]="PUSHINT16",e[e.PUSHINT32=2]="PUSHINT32",e[e.PUSHINT64=3]="PUSHINT64",e[e.PUSHINT128=4]="PUSHINT128",e[e.PUSHINT256=5]="PUSHINT256",e[e.PUSHA=10]="PUSHA",e[e.PUSHNULL=11]="PUSHNULL",e[e.PUSHDATA1=12]="PUSHDATA1",e[e.PUSHDATA2=13]="PUSHDATA2",e[e.PUSHDATA4=14]="PUSHDATA4",e[e.PUSHM1=15]="PUSHM1",e[e.PUSH0=16]="PUSH0",e[e.PUSH1=17]="PUSH1",e[e.PUSH2=18]="PUSH2",e[e.PUSH3=19]="PUSH3",e[e.PUSH4=20]="PUSH4",e[e.PUSH5=21]="PUSH5",e[e.PUSH6=22]="PUSH6",e[e.PUSH7=23]="PUSH7",e[e.PUSH8=24]="PUSH8",e[e.PUSH9=25]="PUSH9",e[e.PUSH10=26]="PUSH10",e[e.PUSH11=27]="PUSH11",e[e.PUSH12=28]="PUSH12",e[e.PUSH13=29]="PUSH13",e[e.PUSH14=30]="PUSH14",e[e.PUSH15=31]="PUSH15",e[e.PUSH16=32]="PUSH16",e[e.NOP=33]="NOP",e[e.JMP=34]="JMP",e[e.JMP_L=35]="JMP_L",e[e.JMPIF=36]="JMPIF",e[e.JMPIF_L=37]="JMPIF_L",e[e.JMPIFNOT=38]="JMPIFNOT",e[e.JMPIFNOT_L=39]="JMPIFNOT_L",e[e.JMPEQ=40]="JMPEQ",e[e.JMPEQ_L=41]="JMPEQ_L",e[e.JMPNE=42]="JMPNE",e[e.JMPNE_L=43]="JMPNE_L",e[e.JMPGT=44]="JMPGT",e[e.JMPGT_L=45]="JMPGT_L",e[e.JMPGE=46]="JMPGE",e[e.JMPGE_L=47]="JMPGE_L",e[e.JMPLT=48]="JMPLT",e[e.JMPLT_L=49]="JMPLT_L",e[e.JMPLE=50]="JMPLE",e[e.JMPLE_L=51]="JMPLE_L",e[e.CALL=52]="CALL",e[e.CALL_L=53]="CALL_L",e[e.CALLA=54]="CALLA",e[e.CALLT=55]="CALLT",e[e.ABORT=56]="ABORT",e[e.ASSERT=57]="ASSERT",e[e.THROW=58]="THROW",e[e.TRY=59]="TRY",e[e.TRY_L=60]="TRY_L",e[e.ENDTRY=61]="ENDTRY",e[e.ENDTRY_L=62]="ENDTRY_L",e[e.ENDFINALLY=63]="ENDFINALLY",e[e.RET=64]="RET",e[e.SYSCALL=65]="SYSCALL",e[e.DEPTH=67]="DEPTH",e[e.DROP=69]="DROP",e[e.NIP=70]="NIP",e[e.XDROP=72]="XDROP",e[e.CLEAR=73]="CLEAR",e[e.DUP=74]="DUP",e[e.OVER=75]="OVER",e[e.PICK=77]="PICK",e[e.TUCK=78]="TUCK",e[e.SWAP=80]="SWAP",e[e.ROT=81]="ROT",e[e.ROLL=82]="ROLL",e[e.REVERSE3=83]="REVERSE3",e[e.REVERSE4=84]="REVERSE4",e[e.REVERSEN=85]="REVERSEN",e[e.INITSSLOT=86]="INITSSLOT",e[e.INITSLOT=87]="INITSLOT",e[e.LDSFLD0=88]="LDSFLD0",e[e.LDSFLD1=89]="LDSFLD1",e[e.LDSFLD2=90]="LDSFLD2",e[e.LDSFLD3=91]="LDSFLD3",e[e.LDSFLD4=92]="LDSFLD4",e[e.LDSFLD5=93]="LDSFLD5",e[e.LDSFLD6=94]="LDSFLD6",e[e.LDSFLD=95]="LDSFLD",e[e.STSFLD0=96]="STSFLD0",e[e.STSFLD1=97]="STSFLD1",e[e.STSFLD2=98]="STSFLD2",e[e.STSFLD3=99]="STSFLD3",e[e.STSFLD4=100]="STSFLD4",e[e.STSFLD5=101]="STSFLD5",e[e.STSFLD6=102]="STSFLD6",e[e.STSFLD=103]="STSFLD",e[e.LDLOC0=104]="LDLOC0",e[e.LDLOC1=105]="LDLOC1",e[e.LDLOC2=106]="LDLOC2",e[e.LDLOC3=107]="LDLOC3",e[e.LDLOC4=108]="LDLOC4",e[e.LDLOC5=109]="LDLOC5",e[e.LDLOC6=110]="LDLOC6",e[e.LDLOC=111]="LDLOC",e[e.STLOC0=112]="STLOC0",e[e.STLOC1=113]="STLOC1",e[e.STLOC2=114]="STLOC2",e[e.STLOC3=115]="STLOC3",e[e.STLOC4=116]="STLOC4",e[e.STLOC5=117]="STLOC5",e[e.STLOC6=118]="STLOC6",e[e.STLOC=119]="STLOC",e[e.LDARG0=120]="LDARG0",e[e.LDARG1=121]="LDARG1",e[e.LDARG2=122]="LDARG2",e[e.LDARG3=123]="LDARG3",e[e.LDARG4=124]="LDARG4",e[e.LDARG5=125]="LDARG5",e[e.LDARG6=126]="LDARG6",e[e.LDARG=127]="LDARG",e[e.STARG0=128]="STARG0",e[e.STARG1=129]="STARG1",e[e.STARG2=130]="STARG2",e[e.STARG3=131]="STARG3",e[e.STARG4=132]="STARG4",e[e.STARG5=133]="STARG5",e[e.STARG6=134]="STARG6",e[e.STARG=135]="STARG",e[e.NEWBUFFER=136]="NEWBUFFER",e[e.MEMCPY=137]="MEMCPY",e[e.CAT=139]="CAT",e[e.SUBSTR=140]="SUBSTR",e[e.LEFT=141]="LEFT",e[e.RIGHT=142]="RIGHT",e[e.INVERT=144]="INVERT",e[e.AND=145]="AND",e[e.OR=146]="OR",e[e.XOR=147]="XOR",e[e.EQUAL=151]="EQUAL",e[e.NOTEQUAL=152]="NOTEQUAL",e[e.SIGN=153]="SIGN",e[e.ABS=154]="ABS",e[e.NEGATE=155]="NEGATE",e[e.INC=156]="INC",e[e.DEC=157]="DEC",e[e.ADD=158]="ADD",e[e.SUB=159]="SUB",e[e.MUL=160]="MUL",e[e.DIV=161]="DIV",e[e.MOD=162]="MOD",e[e.POW=163]="POW",e[e.SQRT=164]="SQRT",e[e.SHL=168]="SHL",e[e.SHR=169]="SHR",e[e.NOT=170]="NOT",e[e.BOOLAND=171]="BOOLAND",e[e.BOOLOR=172]="BOOLOR",e[e.NZ=177]="NZ",e[e.NUMEQUAL=179]="NUMEQUAL",e[e.NUMNOTEQUAL=180]="NUMNOTEQUAL",e[e.LT=181]="LT",e[e.LE=182]="LE",e[e.GT=183]="GT",e[e.GE=184]="GE",e[e.MIN=185]="MIN",e[e.MAX=186]="MAX",e[e.WITHIN=187]="WITHIN",e[e.PACK=192]="PACK",e[e.UNPACK=193]="UNPACK",e[e.NEWARRAY0=194]="NEWARRAY0",e[e.NEWARRAY=195]="NEWARRAY",e[e.NEWARRAY_T=196]="NEWARRAY_T",e[e.NEWSTRUCT0=197]="NEWSTRUCT0",e[e.NEWSTRUCT=198]="NEWSTRUCT",e[e.NEWMAP=200]="NEWMAP",e[e.SIZE=202]="SIZE",e[e.HASKEY=203]="HASKEY",e[e.KEYS=204]="KEYS",e[e.VALUES=205]="VALUES",e[e.PICKITEM=206]="PICKITEM",e[e.APPEND=207]="APPEND",e[e.SETITEM=208]="SETITEM",e[e.REVERSEITEMS=209]="REVERSEITEMS",e[e.REMOVE=210]="REMOVE",e[e.CLEARITEMS=211]="CLEARITEMS",e[e.POPITEM=212]="POPITEM",e[e.ISNULL=216]="ISNULL",e[e.ISTYPE=217]="ISTYPE",e[e.CONVERT=219]="CONVERT"})(R||(R={}));var ft;(function(e){e.SYSTEM_CRYPTO_CHECKSIG="56e7b327",e.SYSTEM_CRYPTO_CHECKMULTISIG="9ed0dc3a",e.SYSTEM_BLOCKCHAIN_GETBLOCK="8347922d",e.SYSTEM_BLOCKCHAIN_GETHEIGHT="7ef5721f",e.SYSTEM_BLOCKCHAIN_GETTRANSACTION="e6558d48",e.SYSTEM_BLOCKCHAIN_GETTRANSACTIONFROMBLOCK="7e56fd69",e.SYSTEM_BLOCKCHAIN_GETTRANSACTIONHEIGHT="4a3288b1",e.SYSTEM_CALLBACK_CREATE="d6a52d2a",e.SYSTEM_CALLBACK_CREATEFROMMETHOD="7c507485",e.SYSTEM_CALLBACK_CREATEFROMSYSCALL="d46efa70",e.SYSTEM_CALLBACK_INVOKE="d42b3dad",e.SYSTEM_CONTRACT_CALL="627d5b52",e.SYSTEM_CONTRACT_CALLEX="eef40cdb",e.SYSTEM_CONTRACT_CALLNATIVE="1af77b67",e.SYSTEM_CONTRACT_CREATESTANDARDACCOUNT="cf998702",e.SYSTEM_CONTRACT_CREATEMULTISIGACCOUNT="6a33e909",e.SYSTEM_CONTRACT_GETCALLFLAGS="95da3a81",e.SYSTEM_CONTRACT_ISSTANDARD="d76b9d85",e.SYSTEM_CONTRACT_NATIVEONPERSIST="2edbbc93",e.SYSTEM_CONTRACT_NATIVEPOSTPERSIST="44a15d16",e.SYSTEM_ENUMERATOR_CONCAT="d406e5e1",e.SYSTEM_ENUMERATOR_CREATE="bbaa607a",e.SYSTEM_ENUMERATOR_NEXT="926d4cf0",e.SYSTEM_ENUMERATOR_VALUE="bd20202c",e.SYSTEM_ITERATOR_CONCAT="e5870a81",e.SYSTEM_ITERATOR_CREATE="ed64f727",e.SYSTEM_ITERATOR_KEY="0e9488ba",e.SYSTEM_ITERATOR_KEYS="fd9096e9",e.SYSTEM_ITERATOR_VALUES="beee30ad",e.SYSTEM_RUNTIME_BURNGAS="c35a8cbc",e.SYSTEM_RUNTIME_CHECKWITNESS="f827ec8c",e.SYSTEM_RUNTIME_GASLEFT="1488d8ce",e.SYSTEM_RUNTIME_GETCALLINGSCRIPTHASH="39536e3c",e.SYSTEM_RUNTIME_GETENTRYSCRIPTHASH="f9b4e238",e.SYSTEM_RUNTIME_GETEXECUTINGSCRIPTHASH="dbfea874",e.SYSTEM_RUNTIME_GETINVOCATIONCOUNTER="84271143",e.SYSTEM_RUNTIME_GETNOTIFICATIONS="274335f1",e.SYSTEM_RUNTIME_GETSCRIPTCONTAINER="2d510830",e.SYSTEM_RUNTIME_GETTIME="b7c38803",e.SYSTEM_RUNTIME_GETTRIGGER="e97d38a0",e.SYSTEM_RUNTIME_LOG="cfe74796",e.SYSTEM_RUNTIME_NOTIFY="95016f61",e.SYSTEM_RUNTIME_PLATFORM="b279fcf6",e.SYSTEM_STORAGE_ASREADONLY="764cbfe9",e.SYSTEM_STORAGE_DELETE="2f58c5ed",e.SYSTEM_STORAGE_FIND="df30b89a",e.SYSTEM_STORAGE_GET="925de831",e.SYSTEM_STORAGE_GETCONTEXT="9bf667ce",e.SYSTEM_STORAGE_GETREADONLYCONTEXT="f6b46be2",e.SYSTEM_STORAGE_PUT="e63f1884"})(ft||(ft={}));var on;(function(e){e[e.None=0]="None",e[e.ReadStates=1]="ReadStates",e[e.WriteStates=2]="WriteStates",e[e.AllowCall=4]="AllowCall",e[e.AllowNotify=8]="AllowNotify",e[e.States=3]="States",e[e.ReadOnly=5]="ReadOnly",e[e.All=15]="All"})(on||(on={}));class lf extends hf{build(){return this.str.slice(0)}emit(t,r){return this.str+=Bu(t),r&&(this.str+=r),this}emitAppCall(t,r,i=[],f=on.All){if(i.length===0)this.emit(R.NEWARRAY0);else{for(let s=i.length-1;s>=0;s--)this.emitPush(i[s]);this.emitNumber(i.length),this.emit(R.PACK)}return this.emitPush(f).emitString(r).emitHexString(xt.fromHex(t)).emitSysCall(ft.SYSTEM_CONTRACT_CALL)}emitSysCall(t,...r){for(let i=r.length-1;i>=0;i--)this.emitPush(r[i]);return this.emit(R.SYSCALL,t)}emitPush(t){switch(typeof t){case"boolean":return this.emitBoolean(t);case"string":return this.emitString(t);case"number":return this.emitNumber(t);case"undefined":return this.emitPush(!1);case"object":if(Array.isArray(t))return this.emitArray(t);if(t instanceof xt)return this.emitHexString(t);if(t===null)return this.emitPush(!1);if(Hu(t))return this.emitContractParam(zt.fromJson(t));throw new Error(`Unidentified object: ${t}`);default:throw new Error}}emitBoolean(t){return this.emit(t?R.PUSH1:R.PUSH0)}emitArray(t){for(let r=t.length-1;r>=0;r--)this.emitPush(t[r]);return this.emitNumber(t.length).emit(R.PACK)}emitBytes(t){return this.emitHexString(xt.fromArrayBuffer(t,!0))}emitString(t){const i=new TextEncoder().encode(t);return this.emitBytes(i)}emitHexString(t){typeof t=="string"&&(t=xt.fromHex(t,!0));const r=t.toLittleEndian(),i=t.byteLength;if(i<256)return this.emit(R.PUSHDATA1,ti(i)+r);if(i<65536)return this.emit(R.PUSHDATA2,ti(i,2,!0)+r);if(i<4294967296)return this.emit(R.PUSHDATA4,ti(i,4,!0)+r);throw new Error("Data too big to emit!")}emitPublicKey(t){const r=t instanceof xt?t.toBigEndian():t;return this.emit(R.PUSHDATA1,ti(33)+r)}emitNumber(t){const r=new fe(t,10,"be");if(r.gten(-1)&&r.lten(16))return this.emit(R.PUSH0+r.toNumber());const i=r.isNeg(),f=r.testn(r.byteLength()*8-1),s=r.byteLength(),p=this.roundToBestIntSize(!i&&f?s+1:s);if(p>32)throw new Error(`Number too long to be emitted: ${t.toString()}`);const u=Se(r.toTwos(r.byteLength()*8).toArray("le",p));switch(p){case 1:return this.emit(R.PUSHINT8,u);case 2:return this.emit(R.PUSHINT16,u);case 4:return this.emit(R.PUSHINT32,u);case 8:return this.emit(R.PUSHINT64,u);case 16:return this.emit(R.PUSHINT128,u);case 32:return this.emit(R.PUSHINT256,u);default:throw new Error}}roundToBestIntSize(t){switch(!0){case t==1:return 1;case t==2:return 2;case t<=4:return 4;case t<=8:return 8;case t<=16:return 16;case t<=32:return 32;default:return 64}}emitContractParam(t){var r;if(t.type===void 0)throw new Error("No type available!");switch(t.type){case j.Any:return t.value===null?this.emit(R.PUSHNULL):this.emitHexString((r=t.value)!==null&&r!==void 0?r:"");case j.String:return this.emitString(t.value);case j.Boolean:return this.emitBoolean(t.value);case j.Integer:return this.emitNumber(t.value);case j.ByteArray:return this.emitHexString(t.value);case j.Array:return this.emitArray(t.value);case j.Hash160:case j.Hash256:return this.emitHexString(t.value);case j.PublicKey:return this.emitPublicKey(t.value);default:throw new Error(`Unaccounted ContractParamType!: ${t.type}`)}}emitContractCall(t){return this.emitAppCall(t.scriptHash,t.operation,t.args,t.callFlags)}appendScript(t){return this.str+=t,this}}R.PUSHINT8+"",1<<0,R.PUSHINT16+"",1<<0,R.PUSHINT32+"",1<<0,R.PUSHINT64+"",1<<0,R.PUSHINT128+"",1<<2,R.PUSHINT256+"",1<<2,R.PUSHA+"",1<<2,R.PUSHNULL+"",1<<0,R.PUSHDATA1+"",1<<3,R.PUSHDATA2+"",1<<9,R.PUSHDATA4+"",1<<12,R.PUSHM1+"",1<<0,R.PUSH0+"",1<<0,R.PUSH1+"",1<<0,R.PUSH2+"",1<<0,R.PUSH3+"",1<<0,R.PUSH4+"",1<<0,R.PUSH5+"",1<<0,R.PUSH6+"",1<<0,R.PUSH7+"",1<<0,R.PUSH8+"",1<<0,R.PUSH9+"",1<<0,R.PUSH10+"",1<<0,R.PUSH11+"",1<<0,R.PUSH12+"",1<<0,R.PUSH13+"",1<<0,R.PUSH14+"",1<<0,R.PUSH15+"",1<<0,R.PUSH16+"",1<<0,R.NOP+"",1<<0,R.JMP+"",1<<1,R.JMP_L+"",1<<1,R.JMPIF+"",1<<1,R.JMPIF_L+"",1<<1,R.JMPIFNOT+"",1<<1,R.JMPIFNOT_L+"",1<<1,R.JMPEQ+"",1<<1,R.JMPEQ_L+"",1<<1,R.JMPNE+"",1<<1,R.JMPNE_L+"",1<<1,R.JMPGT+"",1<<1,R.JMPGT_L+"",1<<1,R.JMPGE+"",1<<1,R.JMPGE_L+"",1<<1,R.JMPLT+"",1<<1,R.JMPLT_L+"",1<<1,R.JMPLE+"",1<<1,R.JMPLE_L+"",1<<1,R.CALL+"",1<<9,R.CALL_L+"",1<<9,R.CALLA+"",1<<9,R.CALLT+"",1<<15,R.ABORT+"",R.ASSERT+"",1<<0,R.THROW+"",1<<9,R.TRY+"",1<<2,R.TRY_L+"",1<<2,R.ENDTRY+"",1<<2,R.ENDTRY_L+"",1<<2,R.ENDFINALLY+"",1<<2,R.RET+"",R.SYSCALL+"",R.DEPTH+"",1<<1,R.DROP+"",1<<1,R.NIP+"",1<<1,R.XDROP+"",1<<4,R.CLEAR+"",1<<4,R.DUP+"",1<<1,R.OVER+"",1<<1,R.PICK+"",1<<1,R.TUCK+"",1<<1,R.SWAP+"",1<<1,R.ROT+"",1<<1,R.ROLL+"",1<<4,R.REVERSE3+"",1<<1,R.REVERSE4+"",1<<1,R.REVERSEN+"",1<<4,R.INITSSLOT+"",1<<4,R.INITSLOT+"",1<<6,R.LDSFLD0+"",1<<1,R.LDSFLD1+"",1<<1,R.LDSFLD2+"",1<<1,R.LDSFLD3+"",1<<1,R.LDSFLD4+"",1<<1,R.LDSFLD5+"",1<<1,R.LDSFLD6+"",1<<1,R.LDSFLD+"",1<<1,R.STSFLD0+"",1<<1,R.STSFLD1+"",1<<1,R.STSFLD2+"",1<<1,R.STSFLD3+"",1<<1,R.STSFLD4+"",1<<1,R.STSFLD5+"",1<<1,R.STSFLD6+"",1<<1,R.STSFLD+"",1<<1,R.LDLOC0+"",1<<1,R.LDLOC1+"",1<<1,R.LDLOC2+"",1<<1,R.LDLOC3+"",1<<1,R.LDLOC4+"",1<<1,R.LDLOC5+"",1<<1,R.LDLOC6+"",1<<1,R.LDLOC+"",1<<1,R.STLOC0+"",1<<1,R.STLOC1+"",1<<1,R.STLOC2+"",1<<1,R.STLOC3+"",1<<1,R.STLOC4+"",1<<1,R.STLOC5+"",1<<1,R.STLOC6+"",1<<1,R.STLOC+"",1<<1,R.LDARG0+"",1<<1,R.LDARG1+"",1<<1,R.LDARG2+"",1<<1,R.LDARG3+"",1<<1,R.LDARG4+"",1<<1,R.LDARG5+"",1<<1,R.LDARG6+"",1<<1,R.LDARG+"",1<<1,R.STARG0+"",1<<1,R.STARG1+"",1<<1,R.STARG2+"",1<<1,R.STARG3+"",1<<1,R.STARG4+"",1<<1,R.STARG5+"",1<<1,R.STARG6+"",1<<1,R.STARG+"",1<<1,R.NEWBUFFER+"",1<<8,R.MEMCPY+"",1<<11,R.CAT+"",1<<11,R.SUBSTR+"",1<<11,R.LEFT+"",1<<11,R.RIGHT+"",1<<11,R.INVERT+"",1<<2,R.AND+"",1<<3,R.OR+"",1<<3,R.XOR+"",1<<3,R.EQUAL+"",1<<5,R.NOTEQUAL+"",1<<5,R.SIGN+"",1<<2,R.ABS+"",1<<2,R.NEGATE+"",1<<2,R.INC+"",1<<2,R.DEC+"",1<<2,R.ADD+"",1<<3,R.SUB+"",1<<3,R.MUL+"",1<<3,R.DIV+"",1<<3,R.MOD+"",1<<3,R.POW+"",1<<6,R.SQRT+"",1<<11,R.SHL+"",1<<3,R.SHR+"",1<<3,R.NOT+"",1<<2,R.BOOLAND+"",1<<3,R.BOOLOR+"",1<<3,R.NZ+"",1<<2,R.NUMEQUAL+"",1<<3,R.NUMNOTEQUAL+"",1<<3,R.LT+"",1<<3,R.LE+"",1<<3,R.GT+"",1<<3,R.GE+"",1<<3,R.MIN+"",1<<3,R.MAX+"",1<<3,R.WITHIN+"",1<<3,R.PACK+"",1<<11,R.UNPACK+"",1<<11,R.NEWARRAY0+"",1<<4,R.NEWARRAY+"",1<<9,R.NEWARRAY_T+"",1<<9,R.NEWSTRUCT0+"",1<<4,R.NEWSTRUCT+"",1<<9,R.NEWMAP+"",1<<3,R.SIZE+"",1<<2,R.HASKEY+"",1<<6,R.KEYS+"",1<<4,R.VALUES+"",1<<13,R.PICKITEM+"",1<<6,R.APPEND+"",1<<13,R.SETITEM+"",1<<13,R.REVERSEITEMS+"",1<<13,R.REMOVE+"",1<<4,R.CLEARITEMS+"",1<<4,R.POPITEM+"",1<<4,R.ISNULL+"",1<<1,R.ISTYPE+"",1<<1,R.CONVERT+"",1<<13;ft.SYSTEM_BLOCKCHAIN_GETBLOCK+"",ft.SYSTEM_BLOCKCHAIN_GETHEIGHT+"",ft.SYSTEM_BLOCKCHAIN_GETTRANSACTION+"",ft.SYSTEM_BLOCKCHAIN_GETTRANSACTIONFROMBLOCK+"",ft.SYSTEM_BLOCKCHAIN_GETTRANSACTIONHEIGHT+"",ft.SYSTEM_CRYPTO_CHECKSIG+"",ft.SYSTEM_CRYPTO_CHECKMULTISIG+"",ft.SYSTEM_CALLBACK_CREATE+"",ft.SYSTEM_CALLBACK_CREATEFROMMETHOD+"",ft.SYSTEM_CALLBACK_CREATEFROMSYSCALL+"",ft.SYSTEM_CALLBACK_INVOKE+"",ft.SYSTEM_CONTRACT_CALL+"",ft.SYSTEM_CONTRACT_CALLEX+"",ft.SYSTEM_CONTRACT_CALLNATIVE+"",ft.SYSTEM_CONTRACT_CREATESTANDARDACCOUNT+"",ft.SYSTEM_CONTRACT_CREATEMULTISIGACCOUNT+"",ft.SYSTEM_CONTRACT_GETCALLFLAGS+"",ft.SYSTEM_CONTRACT_ISSTANDARD+"",ft.SYSTEM_CONTRACT_NATIVEONPERSIST+"",ft.SYSTEM_CONTRACT_NATIVEPOSTPERSIST+"",ft.SYSTEM_ENUMERATOR_CONCAT+"",ft.SYSTEM_ENUMERATOR_CREATE+"",ft.SYSTEM_ENUMERATOR_NEXT+"",ft.SYSTEM_ENUMERATOR_VALUE+"",ft.SYSTEM_ITERATOR_CONCAT+"",ft.SYSTEM_ITERATOR_CREATE+"",ft.SYSTEM_ITERATOR_KEY+"",ft.SYSTEM_ITERATOR_KEYS+"",ft.SYSTEM_ITERATOR_VALUES+"",ft.SYSTEM_RUNTIME_BURNGAS+"",ft.SYSTEM_RUNTIME_CHECKWITNESS+"",ft.SYSTEM_RUNTIME_GASLEFT+"",ft.SYSTEM_RUNTIME_GETCALLINGSCRIPTHASH+"",ft.SYSTEM_RUNTIME_GETENTRYSCRIPTHASH+"",ft.SYSTEM_RUNTIME_GETEXECUTINGSCRIPTHASH+"",ft.SYSTEM_RUNTIME_GETINVOCATIONCOUNTER+"",ft.SYSTEM_RUNTIME_GETNOTIFICATIONS+"",ft.SYSTEM_RUNTIME_GETSCRIPTCONTAINER+"",ft.SYSTEM_RUNTIME_GETTIME+"",ft.SYSTEM_RUNTIME_GETTRIGGER+"",ft.SYSTEM_RUNTIME_LOG+"",ft.SYSTEM_RUNTIME_NOTIFY+"",ft.SYSTEM_RUNTIME_PLATFORM+"",ft.SYSTEM_STORAGE_ASREADONLY+"",ft.SYSTEM_STORAGE_DELETE+"",ft.SYSTEM_STORAGE_FIND+"",ft.SYSTEM_STORAGE_GET+"",ft.SYSTEM_STORAGE_GETCONTEXT+"",ft.SYSTEM_STORAGE_GETREADONLYCONTEXT+"",ft.SYSTEM_STORAGE_PUT+"";var cf;(function(e){e[e.Any=0]="Any",e[e.Pointer=16]="Pointer",e[e.Boolean=32]="Boolean",e[e.Integer=33]="Integer",e[e.ByteString=40]="ByteString",e[e.Buffer=48]="Buffer",e[e.Array=64]="Array",e[e.Struct=65]="Struct",e[e.Map=72]="Map",e[e.InteropInterface=96]="InteropInterface"})(cf||(cf={}));const df={[R.PUSHINT8]:{operandSize:1},[R.PUSHINT16]:{operandSize:2},[R.PUSHINT32]:{operandSize:4},[R.PUSHINT64]:{operandSize:8},[R.PUSHINT128]:{operandSize:16},[R.PUSHINT256]:{operandSize:32},[R.PUSHA]:{operandSize:4},[R.PUSHNULL]:{},[R.PUSHDATA1]:{operandSizePrefix:1},[R.PUSHDATA2]:{operandSizePrefix:2},[R.PUSHDATA4]:{operandSizePrefix:4},[R.PUSHM1]:{},[R.PUSH0]:{},[R.PUSH1]:{},[R.PUSH2]:{},[R.PUSH3]:{},[R.PUSH4]:{},[R.PUSH5]:{},[R.PUSH6]:{},[R.PUSH7]:{},[R.PUSH8]:{},[R.PUSH9]:{},[R.PUSH10]:{},[R.PUSH11]:{},[R.PUSH12]:{},[R.PUSH13]:{},[R.PUSH14]:{},[R.PUSH15]:{},[R.PUSH16]:{},[R.NOP]:{},[R.JMP]:{operandSize:1},[R.JMP_L]:{operandSize:4},[R.JMPIF]:{operandSize:1},[R.JMPIF_L]:{operandSize:4},[R.JMPIFNOT]:{operandSize:1},[R.JMPIFNOT_L]:{operandSize:4},[R.JMPEQ]:{operandSize:1},[R.JMPEQ_L]:{operandSize:4},[R.JMPNE]:{operandSize:1},[R.JMPNE_L]:{operandSize:4},[R.JMPGT]:{operandSize:1},[R.JMPGT_L]:{operandSize:4},[R.JMPGE]:{operandSize:1},[R.JMPGE_L]:{operandSize:4},[R.JMPLT]:{operandSize:1},[R.JMPLT_L]:{operandSize:4},[R.JMPLE]:{operandSize:1},[R.JMPLE_L]:{operandSize:4},[R.CALL]:{operandSize:1},[R.CALL_L]:{operandSize:4},[R.CALLA]:{},[R.CALLT]:{operandSize:2},[R.ABORT]:{},[R.ASSERT]:{},[R.THROW]:{},[R.TRY]:{operandSize:2},[R.TRY_L]:{operandSize:8},[R.ENDTRY]:{operandSize:1},[R.ENDTRY_L]:{operandSize:4},[R.ENDFINALLY]:{},[R.RET]:{},[R.SYSCALL]:{operandSize:4},[R.DEPTH]:{},[R.DROP]:{},[R.NIP]:{},[R.XDROP]:{},[R.CLEAR]:{},[R.DUP]:{},[R.OVER]:{},[R.PICK]:{},[R.TUCK]:{},[R.SWAP]:{},[R.ROT]:{},[R.ROLL]:{},[R.REVERSE3]:{},[R.REVERSE4]:{},[R.REVERSEN]:{},[R.INITSSLOT]:{operandSize:1},[R.INITSLOT]:{operandSize:2},[R.LDSFLD0]:{},[R.LDSFLD1]:{},[R.LDSFLD2]:{},[R.LDSFLD3]:{},[R.LDSFLD4]:{},[R.LDSFLD5]:{},[R.LDSFLD6]:{},[R.LDSFLD]:{operandSize:1},[R.STSFLD0]:{},[R.STSFLD1]:{},[R.STSFLD2]:{},[R.STSFLD3]:{},[R.STSFLD4]:{},[R.STSFLD5]:{},[R.STSFLD6]:{},[R.STSFLD]:{operandSize:1},[R.LDLOC0]:{},[R.LDLOC1]:{},[R.LDLOC2]:{},[R.LDLOC3]:{},[R.LDLOC4]:{},[R.LDLOC5]:{},[R.LDLOC6]:{},[R.LDLOC]:{operandSize:1},[R.STLOC0]:{},[R.STLOC1]:{},[R.STLOC2]:{},[R.STLOC3]:{},[R.STLOC4]:{},[R.STLOC5]:{},[R.STLOC6]:{},[R.STLOC]:{operandSize:1},[R.LDARG0]:{},[R.LDARG1]:{},[R.LDARG2]:{},[R.LDARG3]:{},[R.LDARG4]:{},[R.LDARG5]:{},[R.LDARG6]:{},[R.LDARG]:{operandSize:1},[R.STARG0]:{},[R.STARG1]:{},[R.STARG2]:{},[R.STARG3]:{},[R.STARG4]:{},[R.STARG5]:{},[R.STARG6]:{},[R.STARG]:{operandSize:1},[R.NEWBUFFER]:{},[R.MEMCPY]:{},[R.CAT]:{},[R.SUBSTR]:{},[R.LEFT]:{},[R.RIGHT]:{},[R.INVERT]:{},[R.AND]:{},[R.OR]:{},[R.XOR]:{},[R.EQUAL]:{},[R.NOTEQUAL]:{},[R.SIGN]:{},[R.ABS]:{},[R.NEGATE]:{},[R.INC]:{},[R.DEC]:{},[R.ADD]:{},[R.SUB]:{},[R.MUL]:{},[R.DIV]:{},[R.MOD]:{},[R.POW]:{},[R.SQRT]:{},[R.SHL]:{},[R.SHR]:{},[R.NOT]:{},[R.BOOLAND]:{},[R.BOOLOR]:{},[R.NZ]:{},[R.NUMEQUAL]:{},[R.NUMNOTEQUAL]:{},[R.LT]:{},[R.LE]:{},[R.GT]:{},[R.GE]:{},[R.MIN]:{},[R.MAX]:{},[R.WITHIN]:{},[R.PACK]:{},[R.UNPACK]:{},[R.NEWARRAY0]:{},[R.NEWARRAY]:{},[R.NEWARRAY_T]:{operandSize:1},[R.NEWSTRUCT0]:{},[R.NEWSTRUCT]:{},[R.NEWMAP]:{},[R.SIZE]:{},[R.HASKEY]:{},[R.KEYS]:{},[R.VALUES]:{},[R.PICKITEM]:{},[R.APPEND]:{},[R.SETITEM]:{},[R.REVERSEITEMS]:{},[R.REMOVE]:{},[R.CLEARITEMS]:{},[R.POPITEM]:{},[R.ISNULL]:{},[R.ISTYPE]:{operandSize:1},[R.CONVERT]:{operandSize:1}},Fu=[1,2,4,8,16,32];class qe{constructor(t,r){this.code=t,this.params=r}static fromScript(t){var r;if(!tn(t))throw new Error(`Expected a hexstring but got ${t.length>20?t.substr(0,20)+"...":t}`);const i=new hf(t),f=[];for(;!i.isEmpty();){const s=i.read(1),p=parseInt(s,16),u=(r=df[p])!==null&&r!==void 0?r:{},g=u.operandSize?zu(u.operandSize):u.operandSizePrefix?Cu(u.operandSizePrefix):()=>{};f.push(new qe(p,g(i)))}return f}static parseInt(t){if(t.code>=0&&t.code<=5){const r=Fu[t.code]*2;return t.params?parseInt(kt.fromTwos(t.params.substr(0,r),!0).toString()):0}else{if(t.code>=15&&t.code<=32)return t.code-16;throw new Error(`given OpToken ${R[t.code]} isnt a parsable integer.`)}}static forInteger(t){const r=t instanceof kt?t:kt.fromNumber(t);if(t===-1)return new qe(R.PUSHM1);if(r.compare(0)>=0&&r.compare(16)<=0)return new qe(R.PUSH0+parseInt(r.toString()));const i=r.toReverseTwos();if(i.length<=2)return new qe(R.PUSHINT8,i.padEnd(2,"0"));if(i.length<=4)return new qe(R.PUSHINT16,i.padEnd(4,"0"));if(i.length<=8)return new qe(R.PUSHINT32,i.padEnd(8,"0"));if(i.length<=16)return new qe(R.PUSHINT64,i.padEnd(16,"0"));if(i.length<=32)return new qe(R.PUSHINT128,i.padEnd(32,"0"));throw new Error("Number out of range")}prettyPrint(t=12){return`${this.params?R[this.code].padEnd(t)+" "+this.params:R[this.code]}`}toScript(){var t;const r=xt.fromNumber(this.code).toLittleEndian(),i=(t=this.params)!==null&&t!==void 0?t:"",f=df[this.code];if(f.operandSizePrefix){const s=xt.fromNumber(i.length/2).toLittleEndian();if(s.length/2>f.operandSizePrefix){const p=Math.pow(2,f.operandSizePrefix*8);throw new Error(`Expected params to be less than ${p} but got ${i.length/2}`)}return r+s.padEnd(f.operandSizePrefix*2,"0")+i}if(f.operandSize&&i.length/2!==f.operandSize)throw new Error(`Expected params to be ${f.operandSize} bytes long but got ${i.length/2} instead.`);return r+i}}function zu(e){return t=>t.read(e)}function Cu(e){return t=>t.read(xt.fromHex(t.read(e),!0).toNumber())}globalThis&&globalThis.__classPrivateFieldSet;globalThis&&globalThis.__classPrivateFieldGet;globalThis&&globalThis.__classPrivateFieldGet;globalThis&&globalThis.__classPrivateFieldSet;function ku(e){const t=ve.Buffer.from(e.toString(),"hex");if(t.length<42)return!1;let r,i;if(t[0]==R.PUSHINT8)r=t[1],i=2;else if(t[0]==R.PUSHINT16)r=t.readUInt16LE(1),i=3;else if(t[0]<=R.PUSH1||t[0]>=R.PUSH16)r=t[0]-R.PUSH0,i=1;else return!1;if(r<1||r>1024)return!1;let f=0;for(;t[i]==R.PUSHDATA1;){if(t.length<=i+35||t[i+1]!=33)return!1;i+=35,f+=1}if(f1024)return!1;const s=t[i];if(s==R.PUSHINT8){if(t.length<=i+1||f!=t[i+1])return!1;i+=2}else if(s==R.PUSHINT16){if(t.length */(function(e,t){var r=ve,i=r.Buffer;function f(p,u){for(var g in p)u[g]=p[g]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(f(r,t),t.Buffer=s);function s(p,u,g){return i(p,u,g)}s.prototype=Object.create(i.prototype),f(i,s),s.from=function(p,u,g){if(typeof p=="number")throw new TypeError("Argument must not be a number");return i(p,u,g)},s.alloc=function(p,u,g){if(typeof p!="number")throw new TypeError("Argument must be a number");var S=i(p);return u!==void 0?typeof g=="string"?S.fill(u,g):S.fill(u):S.fill(0),S},s.allocUnsafe=function(p){if(typeof p!="number")throw new TypeError("Argument must be a number");return i(p)},s.allocUnsafeSlow=function(p){if(typeof p!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(p)}})(an,an.exports);var fi=an.exports.Buffer;function $u(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,k=new Uint8Array(z);N!==P;){for(var $=L[N],K=0,M=z-1;($!==0||K>>0,k[M]=$%p>>>0,$=$/p>>>0;if($!==0)throw new Error("Non-zero carry");U=K,N++}for(var T=z-U;T!==z&&k[T]===0;)T++;for(var I=u.repeat(H);T>>0,z=new Uint8Array(P);L[H];){var k=t[L.charCodeAt(H)];if(k===255)return;for(var $=0,K=P-1;(k!==0||$>>0,z[K]=k%256>>>0,k=k/256>>>0;if(k!==0)throw new Error("Non-zero carry");N=$,H++}for(var M=P-N;M!==P&&z[M]===0;)M++;var T=fi.allocUnsafe(U+(P-M));T.fill(0,0,U);for(var I=U;M!==P;)T[I++]=z[M++];return T}function B(L){var H=D(L);if(H)return H;throw new Error("Non-base"+p+" character")}return{encode:_,decodeUnsafe:D,decode:B}}var Gu=$u,qu=Gu,Ku="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Ke=qu(Ku);const vf=Ns(t0.SECP256R1);function hn(e){const t=new Uint8Array(y0(e));return t[64]%2==1?"03"+Se(t.slice(1,33)):"02"+Se(t.slice(1,33))}function pf(e){return vf.decodePublicKey(e)}function un(e){return Se(Ke.decode(e)).substr(2,64)}function xf(e){const t="80"+e+"01",i=e0(t).substr(0,8),f=t+i;return Ke.encode(y0(f))}function gf(e,t=!0){return vf.getPublicKey(e,t)}function mf(e){return new lf().emit(R.PUSHDATA1,"21"+e).emitSysCall(ft.SYSTEM_CRYPTO_CHECKSIG).build()}function Yu(e){var t;const r=qe.fromScript(e),i=r.pop();if(i===void 0||i.code!==R.SYSCALL||((t=i.params)!==null&&t!==void 0?t:"")!==ft.SYSTEM_CRYPTO_CHECKSIG)throw new Error("script is not a single key account.");const f=r[0];if(f.code!==R.PUSHDATA1||!f.params)throw new Error("cannot find public key");return f.params}function yf(e){e.substring(0,2)==="04"&&(e=hn(e));const t=mf(e);return xe(Hs(t))}function ln(e,t=N0){e=xe(e);const r=t.toString(16),i=e0(r+e).substr(0,8);return Ke.encode(ve.Buffer.from(r+e+i,"hex"))}function wf(e){const t=Se(Ke.decode(e));return xe(t.substr(2,40))}function Ou(){return Se(wu(32))}function Wu(e){return Ke.decode(e).readUInt8()}function Vu(e){try{if(e.length!==58)return!1;const t=Se(Ke.decode(e));return!(!t||t.length!==86||t.substr(0,2)!=="01"||t.substr(2,2)!=="42"||t.substr(4,2)!=="e0")}catch{return!1}}function bf(e){if(e.length!==52)return!1;const t=Se(Ke.decode(e)),r=t.substr(0,68),i=t.substr(-8);return e0(r).substr(0,8)===i}function Ju(e){return/^[0-9A-Fa-f]{64}$/.test(e)}function oi(e,t){try{let r;switch(e.substr(0,2)){case"04":if(t===!0)return!1;r=hn(e);break;case"02":case"03":if(t===!1)return!1;r=e;break;default:return!1}const i=pf(r),f=parseInt(i.substr(i.length-2,2),16);return r.substr(0,2)==="02"&&f%2==0||r.substr(0,2)==="03"&&f%2==1}catch{return!1}}function Xu(e){return tn(e)&&e.length===40}function Sf(e){try{const t=Se(Ke.decode(e)),r=parseInt(t.slice(0,2),16);if(e0(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;const f=xe(t.slice(2,42));return ln(f,r)===e}catch{return!1}}function Zu(e,t){if(e<=0)throw new Error("signingThreshold must be bigger than zero.");if(e>t.length)throw new Error("signingThreshold must be smaller than or equal to number of keys");const r=new lf;return r.emitPush(e),t.forEach(i=>{if(!oi(i,!0))throw new Error(`${i} is not a valid encoded public key`);r.emitPublicKey(i)}),r.emitPush(t.length).emitSysCall(ft.SYSTEM_CRYPTO_CHECKMULTISIG).build()}var _f={exports:{}};(function(e,t){(function(r,i){e.exports=i(Rt.exports)})(gt,function(r){return r.enc.Latin1})})(_f);var Qu=_f.exports,cn={exports:{}};(function(e,t){(function(r){const i=2147483647;function f(U){const N=new Uint32Array([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]);let P=1779033703,z=3144134277,k=1013904242,$=2773480762,K=1359893119,M=2600822924,T=528734635,I=1541459225;const q=new Uint32Array(64);function C(m){let E=0,y=m.length;for(;y>=64;){let c=P,v=z,d=k,A=$,Y=K,J=M,X=T,tt=I,Z,Q,at,lt,et;for(Q=0;Q<16;Q++)at=E+Q*4,q[Q]=(m[at]&255)<<24|(m[at+1]&255)<<16|(m[at+2]&255)<<8|m[at+3]&255;for(Q=16;Q<64;Q++)Z=q[Q-2],lt=(Z>>>17|Z<<32-17)^(Z>>>19|Z<<32-19)^Z>>>10,Z=q[Q-15],et=(Z>>>7|Z<<32-7)^(Z>>>18|Z<<32-18)^Z>>>3,q[Q]=(lt+q[Q-7]|0)+(et+q[Q-16]|0)|0;for(Q=0;Q<64;Q++)lt=(((Y>>>6|Y<<32-6)^(Y>>>11|Y<<32-11)^(Y>>>25|Y<<32-25))+(Y&J^~Y&X)|0)+(tt+(N[Q]+q[Q]|0)|0)|0,et=((c>>>2|c<<32-2)^(c>>>13|c<<32-13)^(c>>>22|c<<32-22))+(c&v^c&d^v&d)|0,tt=X,X=J,J=Y,Y=A+lt|0,A=d,d=v,v=c,c=lt+et|0;P=P+c|0,z=z+v|0,k=k+d|0,$=$+A|0,K=K+Y|0,M=M+J|0,T=T+X|0,I=I+tt|0,E+=64,y-=64}}C(U);let w,h=U.length%64,a=U.length/536870912|0,n=U.length<<3,o=h<56?56:120,l=U.slice(U.length-h,U.length);for(l.push(128),w=h+1;w>>24&255),l.push(a>>>16&255),l.push(a>>>8&255),l.push(a>>>0&255),l.push(n>>>24&255),l.push(n>>>16&255),l.push(n>>>8&255),l.push(n>>>0&255),C(l),[P>>>24&255,P>>>16&255,P>>>8&255,P>>>0&255,z>>>24&255,z>>>16&255,z>>>8&255,z>>>0&255,k>>>24&255,k>>>16&255,k>>>8&255,k>>>0&255,$>>>24&255,$>>>16&255,$>>>8&255,$>>>0&255,K>>>24&255,K>>>16&255,K>>>8&255,K>>>0&255,M>>>24&255,M>>>16&255,M>>>8&255,M>>>0&255,T>>>24&255,T>>>16&255,T>>>8&255,T>>>0&255,I>>>24&255,I>>>16&255,I>>>8&255,I>>>0&255]}function s(U,N,P){U=U.length<=64?U:f(U);const z=64+N.length+4,k=new Array(z),$=new Array(64);let K,M=[];for(K=0;K<64;K++)k[K]=54;for(K=0;K=z-4;I--){if(k[I]++,k[I]<=255)return;k[I]=0}}for(;P>=32;)T(),M=M.concat(f($.concat(f(k)))),P-=32;return P>0&&(T(),M=M.concat(f($.concat(f(k))).slice(0,P))),M}function p(U,N,P,z,k){let $;for(_(U,(2*P-1)*16,k,0,16),$=0;$<2*P;$++)S(U,$*16,k,16),g(k,z),_(k,0,U,N+$*16,16);for($=0;$>>32-N}function g(U,N){_(U,0,N,0,16);for(let P=8;P>0;P-=2)N[4]^=u(N[0]+N[12],7),N[8]^=u(N[4]+N[0],9),N[12]^=u(N[8]+N[4],13),N[0]^=u(N[12]+N[8],18),N[9]^=u(N[5]+N[1],7),N[13]^=u(N[9]+N[5],9),N[1]^=u(N[13]+N[9],13),N[5]^=u(N[1]+N[13],18),N[14]^=u(N[10]+N[6],7),N[2]^=u(N[14]+N[10],9),N[6]^=u(N[2]+N[14],13),N[10]^=u(N[6]+N[2],18),N[3]^=u(N[15]+N[11],7),N[7]^=u(N[3]+N[15],9),N[11]^=u(N[7]+N[3],13),N[15]^=u(N[11]+N[7],18),N[1]^=u(N[0]+N[3],7),N[2]^=u(N[1]+N[0],9),N[3]^=u(N[2]+N[1],13),N[0]^=u(N[3]+N[2],18),N[6]^=u(N[5]+N[4],7),N[7]^=u(N[6]+N[5],9),N[4]^=u(N[7]+N[6],13),N[5]^=u(N[4]+N[7],18),N[11]^=u(N[10]+N[9],7),N[8]^=u(N[11]+N[10],9),N[9]^=u(N[8]+N[11],13),N[10]^=u(N[9]+N[8],18),N[12]^=u(N[15]+N[14],7),N[13]^=u(N[12]+N[15],9),N[14]^=u(N[13]+N[12],13),N[15]^=u(N[14]+N[13],18);for(let P=0;P<16;++P)U[P]+=N[P]}function S(U,N,P,z){for(let k=0;k=256)return!1}return!0}function B(U,N){if(typeof U!="number"||U%1)throw new Error("invalid "+N);return U}function L(U,N,P,z,k,$,K){if(P=B(P,"N"),z=B(z,"r"),k=B(k,"p"),$=B($,"dkLen"),P===0||(P&P-1)!=0)throw new Error("N must be power of 2");if(P>i/128/z)throw new Error("N too large");if(z>i/128/k)throw new Error("r too large");if(!D(U))throw new Error("password must be an array or buffer");if(U=Array.prototype.slice.call(U),!D(N))throw new Error("salt must be an array or buffer");N=Array.prototype.slice.call(N);let M=s(U,N,k*128*z);const T=new Uint32Array(k*32*z);for(let Y=0;Yv&&(Y=v);for(let X=0;Xv&&(Y=v);for(let X=0;X>0&255),M.push(T[X]>>8&255),M.push(T[X]>>16&255),M.push(T[X]>>24&255);const J=s(U,M,$);return K&&K(null,1,J),J}K&&d(A)};if(!K)for(;;){const Y=A();if(Y!=null)return Y}A()}const H={scrypt:function(U,N,P,z,k,$,K){return new Promise(function(M,T){let I=0;K&&K(0),L(U,N,P,z,k,$,function(q,C,w){if(q)T(q);else if(w)K&&I!==1&&K(1),M(new Uint8Array(w));else if(K&&C!==I)return I=C,K(C)})})},syncScrypt:function(U,N,P,z,k,$){return new Uint8Array(L(U,N,P,z,k,$))}};e.exports=H})()})(cn);const n0={Latin1:Qu,Hex:Wi},Mf={mode:mu,padding:yu},Ef=kr("wallet");async function ju(e,t,r,i,f){const{n:s,r:p,p:u}=f,g=x0(n0.Latin1.parse(i)),S=x0(g).toString().slice(0,8),_=await cn.exports.scrypt(ve.Buffer.from(r.normalize("NFC"),"utf8"),ve.Buffer.from(S,"hex"),s,p,u,64,()=>{}),D=ve.Buffer.from(_).toString("hex"),B=D.slice(0,64),L=D.slice(64),H=en(t,B),U=js.encrypt(n0.Hex.parse(H),n0.Hex.parse(L),Mf),N=Kn+Yn+S+U.ciphertext.toString(),P=e0(N).substr(0,8),z=Ke.encode(y0(N+P));return Ef.info(`Successfully encrypted key to ${z}`),z}function Af(e,t){return ln(yf(gf(e)),t)}function tl(e,t,r=U0,i=N0){const f=bf(e)?un(e):e,s=Af(f,i);return ju(Kn+Yn,f,t,s,r)}async function el(e,t,r,i){const{n:f,r:s,p}=i,u=Se(Ke.decode(e)),g=u.substr(0,u.length-8),S=u.substr(-8);if(e0(g).substr(0,8)!==S)throw new Error("Base58 checksum failed.");const _=g.substr(6,8),D=g.substr(-64),B=await cn.exports.scrypt(ve.Buffer.from(t.normalize("NFC"),"utf8"),ve.Buffer.from(_,"hex"),f,s,p,64,()=>{}),L=ve.Buffer.from(B).toString("hex"),H=L.slice(0,64),U=L.slice(64),N=Ir.exports.lib.CipherParams.create({ciphertext:n0.Hex.parse(D)}),P=js.decrypt(N,n0.Hex.parse(U),Mf),z=en(P.toString(),H),k=r(z),$=x0(x0(n0.Latin1.parse(k))).toString().slice(0,8);if(_!==$)throw new Error("Wrong password or scrypt parameters!");return Ef.info(`Successfully decrypted ${e}`),z}async function rl(e,t,r=U0,i=N0){const f=await el(e,t,s=>Af(s,i),r);return xf(f)}const il=kr("wallet");class Tf{constructor(t="",r={addressVersion:0}){var i,f,s,p;if(this.addressVersion=N0,this.label="",this.isDefault=!1,this.lock=!1,this.contract=Object.assign({},qn),r&&r.addressVersion>0&&(this.addressVersion=r.addressVersion),!t)this._privateKey=Ou();else if(typeof t=="object")this._encrypted=t.key,this._address=t.address,this.label=(i=t.label)!==null&&i!==void 0?i:"",this.isDefault=(f=t.isDefault)!==null&&f!==void 0?f:!1,this.lock=(s=t.lock)!==null&&s!==void 0?s:!1,this.contract=(p=t.contract)!==null&&p!==void 0?p:Object.assign({},qn);else if(Ju(t))this._privateKey=t;else if(oi(t,!1))this._publicKey=hn(t);else if(oi(t,!0))this._publicKey=t;else if(Xu(t))this._scriptHash=t;else if(Sf(t)){this._address=t;const u=Wu(t);if(r.addressVersion>0&&r.addressVersion!==u)throw new Error(`Uncompatible address versions! Address ${t} uses version ${u} but config declares version ${r.addressVersion}`)}else if(bf(t))this._privateKey=un(t),this._WIF=t;else if(Vu(t))this._encrypted=t;else throw new ReferenceError(`Invalid input: ${t}`);if(this._updateContractScript(),!this.label)try{this.label=this.address}catch{this.label=""}}static createMultiSig(t,r){const i=Zu(t,r);return new Tf({contract:{script:xt.fromHex(i).toBase64(),parameters:Array(t).map((f,s)=>({name:`signature${s}`,type:"Signature"})),deployed:!1}})}get[Symbol.toStringTag](){return"Account"}get isMultiSig(){var t;return ku(xt.fromBase64((t=this.contract)===null||t===void 0?void 0:t.script))}get encrypted(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}get WIF(){return this._WIF?this._WIF:(this._WIF=xf(this.privateKey),this._WIF)}get privateKey(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=un(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}get publicKey(){var t;if(this._publicKey)return this._publicKey;if((t=this.contract)===null||t===void 0?void 0:t.script)try{const r=xt.fromBase64(this.contract.script).toBigEndian();return this._publicKey=Yu(r),this._publicKey}catch{}return this._publicKey=gf(this.privateKey),this._publicKey}getPublicKey(t=!0){return t?this.publicKey:pf(this.publicKey)}get scriptHash(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=wf(this.address),this._scriptHash):this.contract.script?(this._scriptHash=this._getScriptHashFromVerificationScript(),this._scriptHash):(this._scriptHash=yf(this.publicKey),this._scriptHash)}get address(){return this._address?this._address:(this._address=ln(this.scriptHash,this.addressVersion),this._address)}tryGet(t){var r,i,f,s,p,u;switch(t){case"encrypted":return(r=this._encrypted)!==null&&r!==void 0?r:"";case"WIF":return(i=this._WIF)!==null&&i!==void 0?i:"";case"privateKey":return(f=this._privateKey)!==null&&f!==void 0?f:"";case"publicKey":return(s=this._publicKey)!==null&&s!==void 0?s:"";case"scriptHash":return(p=this._scriptHash)!==null&&p!==void 0?p:"";case"address":return(u=this._address)!==null&&u!==void 0?u:""}}async encrypt(t,r=U0){return this._encrypted=await tl(this.privateKey,t,r),this}async decrypt(t,r=U0){return this._WIF=await rl(this.encrypted,t,r),this._updateContractScript(),this}export(){var t;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");const r=(t=this._encrypted)!==null&&t!==void 0?t:"";return{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:r,contract:this.contract}}equals(t){return this.address===t.address}_updateContractScript(){try{if(this.contract.script===""){const t=this.publicKey;this.contract.script=xt.fromHex(mf(t)).toBase64(),this._scriptHash=this._getScriptHashFromVerificationScript(),il.debug(`Updated ContractScript for Account: ${this.address}`)}}catch{return}}_getScriptHashFromVerificationScript(){const t=xt.fromBase64(this.contract.script).toBigEndian();return xe(Hs(t))}}Ns(t0.SECP256R1);kr("wallet");globalThis&&globalThis.__classPrivateFieldGet;globalThis&&globalThis.__classPrivateFieldSet;var Bf;(function(e){e[e.None=0]="None",e[e.CalledByEntry=1]="CalledByEntry",e[e.CustomContracts=16]="CustomContracts",e[e.CustomGroups=32]="CustomGroups",e[e.Global=128]="Global"})(Bf||(Bf={}));kr("tx");globalThis&&globalThis.__classPrivateFieldSet;globalThis&&globalThis.__classPrivateFieldGet;kr("tx");var Rf={exports:{}};(function(e,t){var r=typeof self!="undefined"?self:gt,i=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(p){var u={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function g(n){return n&&DataView.prototype.isPrototypeOf(n)}if(u.arrayBuffer)var S=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_=ArrayBuffer.isView||function(n){return n&&S.indexOf(Object.prototype.toString.call(n))>-1};function D(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(n))throw new TypeError("Invalid character in header field name");return n.toLowerCase()}function B(n){return typeof n!="string"&&(n=String(n)),n}function L(n){var o={next:function(){var l=n.shift();return{done:l===void 0,value:l}}};return u.iterable&&(o[Symbol.iterator]=function(){return o}),o}function H(n){this.map={},n instanceof H?n.forEach(function(o,l){this.append(l,o)},this):Array.isArray(n)?n.forEach(function(o){this.append(o[0],o[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(o){this.append(o,n[o])},this)}H.prototype.append=function(n,o){n=D(n),o=B(o);var l=this.map[n];this.map[n]=l?l+", "+o:o},H.prototype.delete=function(n){delete this.map[D(n)]},H.prototype.get=function(n){return n=D(n),this.has(n)?this.map[n]:null},H.prototype.has=function(n){return this.map.hasOwnProperty(D(n))},H.prototype.set=function(n,o){this.map[D(n)]=B(o)},H.prototype.forEach=function(n,o){for(var l in this.map)this.map.hasOwnProperty(l)&&n.call(o,this.map[l],l,this)},H.prototype.keys=function(){var n=[];return this.forEach(function(o,l){n.push(l)}),L(n)},H.prototype.values=function(){var n=[];return this.forEach(function(o){n.push(o)}),L(n)},H.prototype.entries=function(){var n=[];return this.forEach(function(o,l){n.push([l,o])}),L(n)},u.iterable&&(H.prototype[Symbol.iterator]=H.prototype.entries);function U(n){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}function N(n){return new Promise(function(o,l){n.onload=function(){o(n.result)},n.onerror=function(){l(n.error)}})}function P(n){var o=new FileReader,l=N(o);return o.readAsArrayBuffer(n),l}function z(n){var o=new FileReader,l=N(o);return o.readAsText(n),l}function k(n){for(var o=new Uint8Array(n),l=new Array(o.length),m=0;m-1?o:n}function I(n,o){o=o||{};var l=o.body;if(n instanceof I){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,o.headers||(this.headers=new H(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!l&&n._bodyInit!=null&&(l=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=o.credentials||this.credentials||"same-origin",(o.headers||!this.headers)&&(this.headers=new H(o.headers)),this.method=T(o.method||this.method||"GET"),this.mode=o.mode||this.mode||null,this.signal=o.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&l)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(l)}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function q(n){var o=new FormData;return n.trim().split("&").forEach(function(l){if(l){var m=l.split("="),E=m.shift().replace(/\+/g," "),y=m.join("=").replace(/\+/g," ");o.append(decodeURIComponent(E),decodeURIComponent(y))}}),o}function C(n){var o=new H,l=n.replace(/\r?\n[\t ]+/g," ");return l.split(/\r?\n/).forEach(function(m){var E=m.split(":"),y=E.shift().trim();if(y){var c=E.join(":").trim();o.append(y,c)}}),o}K.call(I.prototype);function w(n,o){o||(o={}),this.type="default",this.status=o.status===void 0?200:o.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in o?o.statusText:"OK",this.headers=new H(o.headers),this.url=o.url||"",this._initBody(n)}K.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new H(this.headers),url:this.url})},w.error=function(){var n=new w(null,{status:0,statusText:""});return n.type="error",n};var h=[301,302,303,307,308];w.redirect=function(n,o){if(h.indexOf(o)===-1)throw new RangeError("Invalid status code");return new w(null,{status:o,headers:{location:n}})},p.DOMException=s.DOMException;try{new p.DOMException}catch{p.DOMException=function(o,l){this.message=o,this.name=l;var m=Error(o);this.stack=m.stack},p.DOMException.prototype=Object.create(Error.prototype),p.DOMException.prototype.constructor=p.DOMException}function a(n,o){return new Promise(function(l,m){var E=new I(n,o);if(E.signal&&E.signal.aborted)return m(new p.DOMException("Aborted","AbortError"));var y=new XMLHttpRequest;function c(){y.abort()}y.onload=function(){var v={status:y.status,statusText:y.statusText,headers:C(y.getAllResponseHeaders()||"")};v.url="responseURL"in y?y.responseURL:v.headers.get("X-Request-URL");var d="response"in y?y.response:y.responseText;l(new w(d,v))},y.onerror=function(){m(new TypeError("Network request failed"))},y.ontimeout=function(){m(new TypeError("Network request failed"))},y.onabort=function(){m(new p.DOMException("Aborted","AbortError"))},y.open(E.method,E.url,!0),E.credentials==="include"?y.withCredentials=!0:E.credentials==="omit"&&(y.withCredentials=!1),"responseType"in y&&u.blob&&(y.responseType="blob"),E.headers.forEach(function(v,d){y.setRequestHeader(d,v)}),E.signal&&(E.signal.addEventListener("abort",c),y.onreadystatechange=function(){y.readyState===4&&E.signal.removeEventListener("abort",c)}),y.send(typeof E._bodyInit=="undefined"?null:E._bodyInit)})}return a.polyfill=!0,s.fetch||(s.fetch=a,s.Headers=H,s.Request=I,s.Response=w),p.Headers=H,p.Request=I,p.Response=w,p.fetch=a,Object.defineProperty(p,"__esModule",{value:!0}),p})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var f=i;t=f.fetch,t.default=f.fetch,t.fetch=f.fetch,t.Headers=f.Headers,t.Request=f.Request,t.Response=f.Response,e.exports=t})(Rf,Rf.exports);var dn={exports:{}};const{AbortController:Lf,AbortSignal:nl}=typeof self!="undefined"?self:typeof window!="undefined"?window:void 0;dn.exports=Lf;dn.exports.AbortSignal=nl;dn.exports.default=Lf;kr("rpc");export{Pl as $,Qf as A,If as B,$l as C,ol as D,hl as E,ul as F,al as G,kf as H,Ur as I,Ml as J,gl as K,Gl as L,mn as M,Bl as N,fl as O,cl as P,Sl as Q,Hl as R,kl as S,Rl as T,Tf as U,ll as V,Pf as W,vl as X,_l as Y,sl as Z,Nl as _,qf as a,ml as b,yl as c,$f as d,Gf as e,dl as f,Of as g,bl as h,Cl as i,pl as j,xl as k,wl as l,Ll as m,Xf as n,Il as o,wn as p,Tl as q,Al as r,Nf as s,ui as t,El as u,Fl as v,zl as w,Zf as x,Ul as y,Dl as z}; diff --git a/docs/_app/error.svelte-0437ff64.js b/docs/_app/error.svelte-0437ff64.js new file mode 100644 index 0000000..bc9595d --- /dev/null +++ b/docs/_app/error.svelte-0437ff64.js @@ -0,0 +1 @@ +import{S as w,i as y,s as z,e as d,t as v,c as E,a as b,g as P,d as n,f as u,H as R,h as j,j as H,k as h,l as N,I as q}from"./chunks/vendor-44ba3db2.js";function C(r){let f,t=r[1].frame+"",a;return{c(){f=d("pre"),a=v(t)},l(l){f=E(l,"PRE",{});var s=b(f);a=P(s,t),s.forEach(n)},m(l,s){u(l,f,s),R(f,a)},p(l,s){s&2&&t!==(t=l[1].frame+"")&&j(a,t)},d(l){l&&n(f)}}}function I(r){let f,t=r[1].stack+"",a;return{c(){f=d("pre"),a=v(t)},l(l){f=E(l,"PRE",{});var s=b(f);a=P(s,t),s.forEach(n)},m(l,s){u(l,f,s),R(f,a)},p(l,s){s&2&&t!==(t=l[1].stack+"")&&j(a,t)},d(l){l&&n(f)}}}function A(r){let f,t,a,l,s=r[1].message+"",c,k,m,p,i=r[1].frame&&C(r),o=r[1].stack&&I(r);return{c(){f=d("h1"),t=v(r[0]),a=H(),l=d("pre"),c=v(s),k=H(),i&&i.c(),m=H(),o&&o.c(),p=h()},l(e){f=E(e,"H1",{});var _=b(f);t=P(_,r[0]),_.forEach(n),a=N(e),l=E(e,"PRE",{});var S=b(l);c=P(S,s),S.forEach(n),k=N(e),i&&i.l(e),m=N(e),o&&o.l(e),p=h()},m(e,_){u(e,f,_),R(f,t),u(e,a,_),u(e,l,_),R(l,c),u(e,k,_),i&&i.m(e,_),u(e,m,_),o&&o.m(e,_),u(e,p,_)},p(e,[_]){_&1&&j(t,e[0]),_&2&&s!==(s=e[1].message+"")&&j(c,s),e[1].frame?i?i.p(e,_):(i=C(e),i.c(),i.m(m.parentNode,m)):i&&(i.d(1),i=null),e[1].stack?o?o.p(e,_):(o=I(e),o.c(),o.m(p.parentNode,p)):o&&(o.d(1),o=null)},i:q,o:q,d(e){e&&n(f),e&&n(a),e&&n(l),e&&n(k),i&&i.d(e),e&&n(m),o&&o.d(e),e&&n(p)}}}function F({error:r,status:f}){return{props:{error:r,status:f}}}function B(r,f,t){let{status:a}=f,{error:l}=f;return r.$$set=s=>{"status"in s&&t(0,a=s.status),"error"in s&&t(1,l=s.error)},[a,l]}class G extends w{constructor(f){super();y(this,f,B,A,z,{status:0,error:1})}}export{G as default,F as load}; diff --git a/docs/_app/manifest.json b/docs/_app/manifest.json new file mode 100644 index 0000000..3921c56 --- /dev/null +++ b/docs/_app/manifest.json @@ -0,0 +1,57 @@ +{ + ".svelte-kit/build/runtime/internal/start.js": { + "file": "start-8c841228.js", + "src": ".svelte-kit/build/runtime/internal/start.js", + "isEntry": true, + "imports": [ + "_vendor-44ba3db2.js" + ], + "dynamicImports": [ + "src/routes/__layout.svelte", + ".svelte-kit/build/components/error.svelte", + "src/routes/index.svelte" + ], + "css": [ + "assets/start-d5b4de3e.css" + ] + }, + "src/routes/__layout.svelte": { + "file": "pages/__layout.svelte-b3a62dea.js", + "src": "src/routes/__layout.svelte", + "isEntry": true, + "isDynamicEntry": true, + "imports": [ + "_vendor-44ba3db2.js" + ], + "css": [ + "assets/pages/__layout.svelte-ce1d98e9.css" + ], + "assets": [ + "assets/bg-63a55bea.svg" + ] + }, + ".svelte-kit/build/components/error.svelte": { + "file": "error.svelte-0437ff64.js", + "src": ".svelte-kit/build/components/error.svelte", + "isEntry": true, + "isDynamicEntry": true, + "imports": [ + "_vendor-44ba3db2.js" + ] + }, + "src/routes/index.svelte": { + "file": "pages/index.svelte-57579be3.js", + "src": "src/routes/index.svelte", + "isEntry": true, + "isDynamicEntry": true, + "imports": [ + "_vendor-44ba3db2.js" + ], + "css": [ + "assets/pages/index.svelte-30900ca9.css" + ] + }, + "_vendor-44ba3db2.js": { + "file": "chunks/vendor-44ba3db2.js" + } +} \ No newline at end of file diff --git a/docs/_app/pages/__layout.svelte-b3a62dea.js b/docs/_app/pages/__layout.svelte-b3a62dea.js new file mode 100644 index 0000000..977b12c --- /dev/null +++ b/docs/_app/pages/__layout.svelte-b3a62dea.js @@ -0,0 +1 @@ +import{S as o,i,s as r,D as u,E as f,F as _,G as c,p,n as d}from"../chunks/vendor-44ba3db2.js";function m(n){let s;const l=n[1].default,e=u(l,n,n[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,a){e&&e.m(t,a),s=!0},p(t,[a]){e&&e.p&&(!s||a&1)&&f(e,l,t,t[0],s?c(l,t[0],a,null):_(t[0]),null)},i(t){s||(p(e,t),s=!0)},o(t){d(e,t),s=!1},d(t){e&&e.d(t)}}}function $(n,s,l){let{$$slots:e={},$$scope:t}=s;return n.$$set=a=>{"$$scope"in a&&l(0,t=a.$$scope)},[t,e]}class b extends o{constructor(s){super();i(this,s,$,m,r,{})}}export{b as default}; diff --git a/docs/_app/pages/index.svelte-57579be3.js b/docs/_app/pages/index.svelte-57579be3.js new file mode 100644 index 0000000..1f9abf1 --- /dev/null +++ b/docs/_app/pages/index.svelte-57579be3.js @@ -0,0 +1 @@ +import{C as Fe,S as U,i as O,s as X,e as g,t as K,j as P,c as v,a as E,g as R,d as p,l as C,b as $,f as y,H as m,I as J,J as Y,K as ae,h as Z,u as Ve,L as Le,M as oe,D as Pe,E as Ce,F as Ne,G as Ae,p as I,n as V,v as j,w as M,x as q,A as H,m as ee,o as te,N as Ue,O as ue,P as _e,k as Q,Q as de,R as me,T as $e,U as Te,V as je,W as Oe,X as qe,Y as pe,Z as Xe,_ as Je,$ as Qe}from"../chunks/vendor-44ba3db2.js";const ne=Fe([]);function ze(a){let e,t,n,s,l,c,f,i,d,r,u,o;return{c(){e=g("div"),t=g("p"),n=K("Made by snowypowers | v3.0.0"),s=P(),l=g("p"),c=K("Tips appreciated!"),f=P(),i=g("div"),d=K("NEO: NYBWj9yJHGQ8tP69HuUrSBZgDxJXwdAjDs"),r=P(),u=g("div"),o=K("ETH: 0x2E15cd6Ca9f8dcdCd08Ad62d901b6E6a815a36fd"),this.h()},l(h){e=v(h,"DIV",{class:!0});var b=E(e);t=v(b,"P",{});var B=E(t);n=R(B,"Made by snowypowers | v3.0.0"),B.forEach(p),s=C(b),l=v(b,"P",{class:!0});var G=E(l);c=R(G,"Tips appreciated!"),G.forEach(p),f=C(b),i=v(b,"DIV",{});var k=E(i);d=R(k,"NEO: NYBWj9yJHGQ8tP69HuUrSBZgDxJXwdAjDs"),k.forEach(p),r=C(b),u=v(b,"DIV",{});var _=E(u);o=R(_,"ETH: 0x2E15cd6Ca9f8dcdCd08Ad62d901b6E6a815a36fd"),_.forEach(p),b.forEach(p),this.h()},h(){$(l,"class","mb-4"),$(e,"class","text-center text-xs")},m(h,b){y(h,e,b),m(e,t),m(t,n),m(e,s),m(e,l),m(l,c),m(e,f),m(e,i),m(i,d),m(e,r),m(e,u),m(u,o)},p:J,i:J,o:J,d(h){h&&p(e)}}}class Ye extends U{constructor(e){super();O(this,e,null,ze,X,{})}}function Ze(a){let e,t,n,s,l,c,f,i,d,r,u;return{c(){e=g("div"),t=g("div"),n=g("canvas"),s=P(),l=g("span"),c=K(a[2]),f=P(),i=g("p"),d=K(a[1]),this.h()},l(o){e=v(o,"DIV",{class:!0});var h=E(e);t=v(h,"DIV",{class:!0});var b=E(t);n=v(b,"CANVAS",{class:!0}),E(n).forEach(p),s=C(b),l=v(b,"SPAN",{class:!0});var B=E(l);c=R(B,a[2]),B.forEach(p),b.forEach(p),f=C(h),i=v(h,"P",{});var G=E(i);d=R(G,a[1]),G.forEach(p),h.forEach(p),this.h()},h(){$(n,"class","qr svelte-o6csz1"),Y(n,"hidden",!a[0]),$(l,"class","break-all font-mono text-xs"),Y(l,"hidden",a[0]),$(t,"class","qr svelte-o6csz1"),$(e,"class","flex flex-col text-center")},m(o,h){y(o,e,h),m(e,t),m(t,n),a[5](n),m(t,s),m(t,l),m(l,c),m(e,f),m(e,i),m(i,d),r||(u=ae(t,"dblclick",a[4]),r=!0)},p(o,[h]){h&1&&Y(n,"hidden",!o[0]),h&4&&Z(c,o[2]),h&1&&Y(l,"hidden",o[0]),h&2&&Z(d,o[1])},i:J,o:J,d(o){o&&p(e),a[5](null),r=!1,u()}}}function xe(a,e,t){let n,{label:s="default"}=e,{data:l=""}=e,{showCanvas:c=!0}=e;function f(r){Le(n,r,{margin:1,width:100},u=>{u&&alert(u)})}function i(){t(0,c=!c)}Ve(()=>f(l));function d(r){oe[r?"unshift":"push"](()=>{n=r,t(3,n)})}return a.$$set=r=>{"label"in r&&t(1,s=r.label),"data"in r&&t(2,l=r.data),"showCanvas"in r&&t(0,c=r.showCanvas)},a.$$.update=()=>{a.$$.dirty&5&&c&&f(l)},[c,s,l,n,i,d]}class ie extends U{constructor(e){super();O(this,e,xe,Ze,X,{label:1,data:2,showCanvas:0})}}function et(a){let e,t;const n=a[1].default,s=Pe(n,a,a[0],null);return{c(){e=g("div"),s&&s.c(),this.h()},l(l){e=v(l,"DIV",{class:!0});var c=E(e);s&&s.l(c),c.forEach(p),this.h()},h(){$(e,"class","flex-none rounded-md border-2 border-grey svelte-1v0gr5y")},m(l,c){y(l,e,c),s&&s.m(e,null),t=!0},p(l,[c]){s&&s.p&&(!t||c&1)&&Ce(s,n,l,l[0],t?Ae(n,l[0],c,null):Ne(l[0]),null)},i(l){t||(I(s,l),t=!0)},o(l){V(s,l),t=!1},d(l){l&&p(e),s&&s.d(l)}}}function tt(a,e,t){let{$$slots:n={},$$scope:s}=e;return a.$$set=l=>{"$$scope"in l&&t(0,s=l.$$scope)},[s,n]}class ge extends U{constructor(e){super();O(this,e,tt,et,X,{})}}function nt(a){let e,t=a[0].label+"",n,s,l,c,f,i,d;return c=new ie({props:{data:a[0].address,label:"Address"}}),i=new ie({props:{data:a[0].publicKey,label:"Public Key"}}),{c(){e=g("header"),n=K(t),s=P(),l=g("div"),j(c.$$.fragment),f=P(),j(i.$$.fragment),this.h()},l(r){e=v(r,"HEADER",{class:!0});var u=E(e);n=R(u,t),u.forEach(p),s=C(r),l=v(r,"DIV",{class:!0});var o=E(l);M(c.$$.fragment,o),f=C(o),M(i.$$.fragment,o),o.forEach(p),this.h()},h(){$(e,"class","text-center font-mono"),$(l,"class","flex justify-around")},m(r,u){y(r,e,u),m(e,n),y(r,s,u),y(r,l,u),q(c,l,null),m(l,f),q(i,l,null),d=!0},p(r,u){(!d||u&1)&&t!==(t=r[0].label+"")&&Z(n,t);const o={};u&1&&(o.data=r[0].address),c.$set(o);const h={};u&1&&(h.data=r[0].publicKey),i.$set(h)},i(r){d||(I(c.$$.fragment,r),I(i.$$.fragment,r),d=!0)},o(r){V(c.$$.fragment,r),V(i.$$.fragment,r),d=!1},d(r){r&&p(e),r&&p(s),r&&p(l),H(c),H(i)}}}function lt(a){let e,t;return e=new ge({props:{$$slots:{default:[nt]},$$scope:{ctx:a}}}),{c(){j(e.$$.fragment)},l(n){M(e.$$.fragment,n)},m(n,s){q(e,n,s),t=!0},p(n,[s]){const l={};s&3&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){V(e.$$.fragment,n),t=!1},d(n){H(e,n)}}}function st(a,e,t){let{account:n}=e;return a.$$set=s=>{"account"in s&&t(0,n=s.account)},[n]}class rt extends U{constructor(e){super();O(this,e,st,lt,X,{account:0})}}function at(a){let e,t=a[0].label+"",n,s,l,c,f,i,d;return c=new ie({props:{data:a[0].privateKey,label:"HEX"}}),i=new ie({props:{data:a[0].WIF,label:"WIF"}}),{c(){e=g("header"),n=K(t),s=P(),l=g("div"),j(c.$$.fragment),f=P(),j(i.$$.fragment),this.h()},l(r){e=v(r,"HEADER",{class:!0});var u=E(e);n=R(u,t),u.forEach(p),s=C(r),l=v(r,"DIV",{class:!0});var o=E(l);M(c.$$.fragment,o),f=C(o),M(i.$$.fragment,o),o.forEach(p),this.h()},h(){$(e,"class","text-center font-mono"),$(l,"class","flex justify-evenly")},m(r,u){y(r,e,u),m(e,n),y(r,s,u),y(r,l,u),q(c,l,null),m(l,f),q(i,l,null),d=!0},p(r,u){(!d||u&1)&&t!==(t=r[0].label+"")&&Z(n,t);const o={};u&1&&(o.data=r[0].privateKey),c.$set(o);const h={};u&1&&(h.data=r[0].WIF),i.$set(h)},i(r){d||(I(c.$$.fragment,r),I(i.$$.fragment,r),d=!0)},o(r){V(c.$$.fragment,r),V(i.$$.fragment,r),d=!1},d(r){r&&p(e),r&&p(s),r&&p(l),H(c),H(i)}}}function it(a){let e,t;return e=new ge({props:{$$slots:{default:[at]},$$scope:{ctx:a}}}),{c(){j(e.$$.fragment)},l(n){M(e.$$.fragment,n)},m(n,s){q(e,n,s),t=!0},p(n,[s]){const l={};s&3&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){V(e.$$.fragment,n),t=!1},d(n){H(e,n)}}}function ct(a,e,t){let{account:n}=e;return a.$$set=s=>{"account"in s&&t(0,n=s.account)},[n]}class ft extends U{constructor(e){super();O(this,e,ct,it,X,{account:0})}}function ot(a){let e,t;return{c(){e=g("p"),t=K("No encrypted key provided!"),this.h()},l(n){e=v(n,"P",{class:!0});var s=E(e);t=R(s,"No encrypted key provided!"),s.forEach(p),this.h()},h(){$(e,"class","text-xl")},m(n,s){y(n,e,s),m(e,t)},p:J,i:J,o:J,d(n){n&&p(e)}}}function ut(a){let e,t;return e=new ie({props:{data:a[1].encrypted,label:"NEP2"}}),{c(){j(e.$$.fragment)},l(n){M(e.$$.fragment,n)},m(n,s){q(e,n,s),t=!0},p(n,s){const l={};s&2&&(l.data=n[1].encrypted),e.$set(l)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){V(e.$$.fragment,n),t=!1},d(n){H(e,n)}}}function dt(a){let e,t=a[1].label+"",n,s,l,c,f,i;const d=[ut,ot],r=[];function u(o,h){return o[0]?0:1}return c=u(a),f=r[c]=d[c](a),{c(){e=g("header"),n=K(t),s=P(),l=g("div"),f.c(),this.h()},l(o){e=v(o,"HEADER",{class:!0});var h=E(e);n=R(h,t),h.forEach(p),s=C(o),l=v(o,"DIV",{class:!0});var b=E(l);f.l(b),b.forEach(p),this.h()},h(){$(e,"class","text-center font-mono"),$(l,"class","flex justify-center")},m(o,h){y(o,e,h),m(e,n),y(o,s,h),y(o,l,h),r[c].m(l,null),i=!0},p(o,h){(!i||h&2)&&t!==(t=o[1].label+"")&&Z(n,t);let b=c;c=u(o),c===b?r[c].p(o,h):(ee(),V(r[b],1,1,()=>{r[b]=null}),te(),f=r[c],f?f.p(o,h):(f=r[c]=d[c](o),f.c()),I(f,1),f.m(l,null))},i(o){i||(I(f),i=!0)},o(o){V(f),i=!1},d(o){o&&p(e),o&&p(s),o&&p(l),r[c].d()}}}function pt(a){let e,t;return e=new ge({props:{$$slots:{default:[dt]},$$scope:{ctx:a}}}),{c(){j(e.$$.fragment)},l(n){M(e.$$.fragment,n)},m(n,s){q(e,n,s),t=!0},p(n,[s]){const l={};s&7&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){V(e.$$.fragment,n),t=!1},d(n){H(e,n)}}}function ht(a,e,t){let{account:n}=e,{hasEncrypted:s=!1}=e;return Ve(()=>{try{n.encrypted,t(0,s=!0)}catch{t(0,s=!1)}}),a.$$set=l=>{"account"in l&&t(1,n=l.account),"hasEncrypted"in l&&t(0,s=l.hasEncrypted)},[s,n]}class _t extends U{constructor(e){super();O(this,e,ht,pt,X,{account:1,hasEncrypted:0})}}function mt(a){let e;return{c(){e=K("Click Me!")},l(t){e=R(t,"Click Me!")},m(t,n){y(t,e,n)},d(t){t&&p(e)}}}function $t(a){let e,t,n,s;const l=a[2].default,c=Pe(l,a,a[1],null),f=c||mt();return{c(){e=g("button"),f&&f.c(),this.h()},l(i){e=v(i,"BUTTON",{class:!0});var d=E(e);f&&f.l(d),d.forEach(p),this.h()},h(){e.disabled=a[0],$(e,"class","w-full focus:outline-none bg-white rounded-lg border-2 p-1"),Y(e,"border-green-700",!a[0]),Y(e,"hover:border-green-800",!a[0])},m(i,d){y(i,e,d),f&&f.m(e,null),t=!0,n||(s=ae(e,"click",a[3]),n=!0)},p(i,[d]){c&&c.p&&(!t||d&2)&&Ce(c,l,i,i[1],t?Ae(l,i[1],d,null):Ne(i[1]),null),(!t||d&1)&&(e.disabled=i[0]),d&1&&Y(e,"border-green-700",!i[0]),d&1&&Y(e,"hover:border-green-800",!i[0])},i(i){t||(I(f,i),t=!0)},o(i){V(f,i),t=!1},d(i){i&&p(e),f&&f.d(i),n=!1,s()}}}function gt(a,e,t){let{$$slots:n={},$$scope:s}=e,{disabled:l=!1}=e;function c(f){Ue.call(this,a,f)}return a.$$set=f=>{"disabled"in f&&t(0,l=f.disabled),"$$scope"in f&&t(1,s=f.$$scope)},[l,s,n,c]}class le extends U{constructor(e){super();O(this,e,gt,$t,X,{disabled:0})}}function vt(a){let e;return{c(){e=K("N")},l(t){e=R(t,"N")},m(t,n){y(t,e,n)},d(t){t&&p(e)}}}function bt(a){let e;return{c(){e=K("N")},l(t){e=R(t,"N")},m(t,n){y(t,e,n)},d(t){t&&p(e)}}}function wt(a){let e;return{c(){e=K("X")},l(t){e=R(t,"X")},m(t,n){y(t,e,n)},d(t){t&&p(e)}}}function Et(a){let e,t,n,s,l,c,f,i,d,r,u,o,h;n=new le({props:{$$slots:{default:[vt]},$$scope:{ctx:a}}}),n.$on("click",a[3]);var b=a[1][a[0].left];function B(_){return{props:{account:_[2]}}}b&&(l=new b(B(a)));var G=a[1][a[0].right];function k(_){return{props:{account:_[2]}}}return G&&(f=new G(k(a))),r=new le({props:{$$slots:{default:[bt]},$$scope:{ctx:a}}}),r.$on("click",a[4]),o=new le({props:{$$slots:{default:[wt]},$$scope:{ctx:a}}}),o.$on("click",a[5]),{c(){e=g("article"),t=g("div"),j(n.$$.fragment),s=P(),l&&j(l.$$.fragment),c=P(),f&&j(f.$$.fragment),i=P(),d=g("div"),j(r.$$.fragment),u=P(),j(o.$$.fragment),this.h()},l(_){e=v(_,"ARTICLE",{class:!0});var w=E(e);t=v(w,"DIV",{class:!0});var A=E(t);M(n.$$.fragment,A),A.forEach(p),s=C(w),l&&M(l.$$.fragment,w),c=C(w),f&&M(f.$$.fragment,w),i=C(w),d=v(w,"DIV",{class:!0});var T=E(d);M(r.$$.fragment,T),u=C(T),M(o.$$.fragment,T),T.forEach(p),w.forEach(p),this.h()},h(){$(t,"class","print:hidden"),$(d,"class","flex flex-col justify-start print:hidden"),$(e,"class","flex justify-center")},m(_,w){y(_,e,w),m(e,t),q(n,t,null),m(e,s),l&&q(l,e,null),m(e,c),f&&q(f,e,null),m(e,i),m(e,d),q(r,d,null),m(d,u),q(o,d,null),h=!0},p(_,[w]){const A={};w&128&&(A.$$scope={dirty:w,ctx:_}),n.$set(A);const T={};if(w&4&&(T.account=_[2]),b!==(b=_[1][_[0].left])){if(l){ee();const F=l;V(F.$$.fragment,1,0,()=>{H(F,1)}),te()}b?(l=new b(B(_)),j(l.$$.fragment),I(l.$$.fragment,1),q(l,e,c)):l=null}else b&&l.$set(T);const S={};if(w&4&&(S.account=_[2]),G!==(G=_[1][_[0].right])){if(f){ee();const F=f;V(F.$$.fragment,1,0,()=>{H(F,1)}),te()}G?(f=new G(k(_)),j(f.$$.fragment),I(f.$$.fragment,1),q(f,e,i)):f=null}else G&&f.$set(S);const L={};w&128&&(L.$$scope={dirty:w,ctx:_}),r.$set(L);const z={};w&128&&(z.$$scope={dirty:w,ctx:_}),o.$set(z)},i(_){h||(I(n.$$.fragment,_),l&&I(l.$$.fragment,_),f&&I(f.$$.fragment,_),I(r.$$.fragment,_),I(o.$$.fragment,_),h=!0)},o(_){V(n.$$.fragment,_),l&&V(l.$$.fragment,_),f&&V(f.$$.fragment,_),V(r.$$.fragment,_),V(o.$$.fragment,_),h=!1},d(_){_&&p(e),H(n),l&&H(l),f&&H(f),H(r),H(o)}}}function yt(a,e,t){let n;ue(a,ne,r=>t(6,n=r));const s=[rt,ft,_t];let{account:l=void 0}=e;const c={left:0,right:1};function f(){if(c.left===s.length-1){t(0,c.left=0,c);return}t(0,c.left++,c)}function i(){if(c.right===s.length-1){t(0,c.right=0,c);return}t(0,c.right++,c)}function d(){_e(ne,n=n.filter(r=>r!==l),n)}return a.$$set=r=>{"account"in r&&t(2,l=r.account)},[c,s,l,f,i,d]}class kt extends U{constructor(e){super();O(this,e,yt,Et,X,{cardTypes:1,account:2,cards:0,changeLeft:3,changeRight:4,remove:5})}get cardTypes(){return this.$$.ctx[1]}get cards(){return this.$$.ctx[0]}get changeLeft(){return this.$$.ctx[3]}get changeRight(){return this.$$.ctx[4]}get remove(){return this.$$.ctx[5]}}function It(a){let e,t,n;return{c(){e=g("input"),this.h()},l(s){e=v(s,"INPUT",{class:!0,type:!0,placeholder:!0}),this.h()},h(){$(e,"class","w-full rounded-lg bg-gray-50 border focus:outline-none focus:border-green-500 p-1"),$(e,"type","text"),$(e,"placeholder",a[2])},m(s,l){y(s,e,l),de(e,a[0]),t||(n=ae(e,"input",a[4]),t=!0)},p(s,l){l&4&&$(e,"placeholder",s[2]),l&1&&e.value!==s[0]&&de(e,s[0])},d(s){s&&p(e),t=!1,n()}}}function Dt(a){let e,t,n;return{c(){e=g("input"),this.h()},l(s){e=v(s,"INPUT",{class:!0,type:!0,placeholder:!0}),this.h()},h(){$(e,"class","w-full rounded-lg bg-gray-50 border focus:outline-none focus:border-green-500 p-1"),$(e,"type","password"),$(e,"placeholder",a[2])},m(s,l){y(s,e,l),de(e,a[0]),t||(n=ae(e,"input",a[3]),t=!0)},p(s,l){l&4&&$(e,"placeholder",s[2]),l&1&&e.value!==s[0]&&de(e,s[0])},d(s){s&&p(e),t=!1,n()}}}function Vt(a){let e;function t(l,c){return l[1]==="password"?Dt:It}let n=t(a),s=n(a);return{c(){s.c(),e=Q()},l(l){s.l(l),e=Q()},m(l,c){s.m(l,c),y(l,e,c)},p(l,[c]){n===(n=t(l))&&s?s.p(l,c):(s.d(1),s=n(l),s&&(s.c(),s.m(e.parentNode,e)))},i:J,o:J,d(l){s.d(l),l&&p(e)}}}function Pt(a,e,t){let{type:n}=e,{placeholder:s}=e,{value:l}=e;function c(){l=this.value,t(0,l)}function f(){l=this.value,t(0,l)}return a.$$set=i=>{"type"in i&&t(1,n=i.type),"placeholder"in i&&t(2,s=i.placeholder),"value"in i&&t(0,l=i.value)},[l,n,s,c,f]}class ve extends U{constructor(e){super();O(this,e,Pt,Vt,X,{type:1,placeholder:2,value:0})}}function Ct(a){let e;return{c(){e=K(a[1])},l(t){e=R(t,a[1])},m(t,n){y(t,e,n)},p(t,n){n&2&&Z(e,t[1])},d(t){t&&p(e)}}}function Nt(a){let e,t,n,s,l,c,f,i,d,r,u,o,h,b,B,G;function k(w){a[4](w)}let _={type:"password",placeholder:"Password (Optional)"};return a[0]!==void 0&&(_.value=a[0]),f=new ve({props:_}),oe.push(()=>me(f,"value",k)),u=new le({props:{disabled:a[2],$$slots:{default:[Ct]},$$scope:{ctx:a}}}),u.$on("click",a[3]),{c(){e=g("div"),t=g("p"),n=K("Generate a new Private Key"),s=P(),l=g("div"),c=g("div"),j(f.$$.fragment),d=P(),r=g("div"),j(u.$$.fragment),o=P(),h=g("div"),b=g("p"),B=K("Warning: Encryption will take a while"),this.h()},l(w){e=v(w,"DIV",{class:!0});var A=E(e);t=v(A,"P",{class:!0});var T=E(t);n=R(T,"Generate a new Private Key"),T.forEach(p),s=C(A),l=v(A,"DIV",{class:!0});var S=E(l);c=v(S,"DIV",{class:!0});var L=E(c);M(f.$$.fragment,L),L.forEach(p),d=C(S),r=v(S,"DIV",{class:!0});var z=E(r);M(u.$$.fragment,z),z.forEach(p),S.forEach(p),o=C(A),h=v(A,"DIV",{class:!0});var F=E(h);b=v(F,"P",{class:!0});var x=E(b);B=R(x,"Warning: Encryption will take a while"),x.forEach(p),F.forEach(p),A.forEach(p),this.h()},h(){$(t,"class","m-1"),$(c,"class","w-3/4 grow"),$(r,"class","w-1/4"),$(l,"class","flex space-x-4"),$(b,"class","rounded-lg text-center bg-yellow-200 bg-opacity-25 py-1 px-4"),$(h,"class","flex m-2 justify-center"),$(e,"class","flex flex-col justify-items-center bg-white")},m(w,A){y(w,e,A),m(e,t),m(t,n),m(e,s),m(e,l),m(l,c),q(f,c,null),m(l,d),m(l,r),q(u,r,null),m(e,o),m(e,h),m(h,b),m(b,B),G=!0},p(w,[A]){const T={};!i&&A&1&&(i=!0,T.value=w[0],$e(()=>i=!1)),f.$set(T);const S={};A&4&&(S.disabled=w[2]),A&130&&(S.$$scope={dirty:A,ctx:w}),u.$set(S)},i(w){G||(I(f.$$.fragment,w),I(u.$$.fragment,w),G=!0)},o(w){V(f.$$.fragment,w),V(u.$$.fragment,w),G=!1},d(w){w&&p(e),H(f),H(u)}}}function At(a,e,t){let n;ue(a,ne,r=>t(5,n=r));let s="",l="Generate!",c=!1;function f(r){r?(t(2,c=!1),t(1,l="Generate!")):(t(2,c=!0),t(1,l="Encrypting..."))}async function i(){const r=new Te;s&&(f(!1),await r.encrypt(s),f(!0)),_e(ne,n=[...n,r],n)}function d(r){s=r,t(0,s)}return[s,l,c,i,d]}class Tt extends U{constructor(e){super();O(this,e,At,Nt,X,{})}}function jt(a){let e;return{c(){e=K(a[3])},l(t){e=R(t,a[3])},m(t,n){y(t,e,n)},p(t,n){n&8&&Z(e,t[3])},d(t){t&&p(e)}}}function qt(a){let e,t,n,s,l,c,f,i,d,r,u,o;function h(k){a[5](k)}let b={type:"text",placeholder:"Private Key"};a[2]!==void 0&&(b.value=a[2]),l=new ve({props:b}),oe.push(()=>me(l,"value",h));function B(k){a[6](k)}let G={type:"password",placeholder:"Password (Optional)"};return a[1]!==void 0&&(G.value=a[1]),i=new ve({props:G}),oe.push(()=>me(i,"value",B)),u=new le({props:{disabled:a[4],$$slots:{default:[jt]},$$scope:{ctx:a}}}),u.$on("click",a[0]),{c(){e=g("div"),t=g("p"),n=K("Import an existing key"),s=P(),j(l.$$.fragment),f=P(),j(i.$$.fragment),r=P(),j(u.$$.fragment),this.h()},l(k){e=v(k,"DIV",{class:!0});var _=E(e);t=v(_,"P",{class:!0});var w=E(t);n=R(w,"Import an existing key"),w.forEach(p),s=C(_),M(l.$$.fragment,_),f=C(_),M(i.$$.fragment,_),r=C(_),M(u.$$.fragment,_),_.forEach(p),this.h()},h(){$(t,"class","m-1"),$(e,"class","flex flex-col justify-items-center bg-white")},m(k,_){y(k,e,_),m(e,t),m(t,n),m(e,s),q(l,e,null),m(e,f),q(i,e,null),m(e,r),q(u,e,null),o=!0},p(k,[_]){const w={};!c&&_&4&&(c=!0,w.value=k[2],$e(()=>c=!1)),l.$set(w);const A={};!d&&_&2&&(d=!0,A.value=k[1],$e(()=>d=!1)),i.$set(A);const T={};_&16&&(T.disabled=k[4]),_&1032&&(T.$$scope={dirty:_,ctx:k}),u.$set(T)},i(k){o||(I(l.$$.fragment,k),I(i.$$.fragment,k),I(u.$$.fragment,k),o=!0)},o(k){V(l.$$.fragment,k),V(i.$$.fragment,k),V(u.$$.fragment,k),o=!1},d(k){k&&p(e),H(l),H(i),H(u)}}}function Ht(a,e,t){let n;ue(a,ne,h=>t(7,n=h));let s="",l="",c="Convert",f=!1;function i(h){t(3,c=h),t(4,f=!0)}function d(){t(3,c="Convert"),t(4,f=!1)}async function r(){if(!l){alert("Please input a private key!");return}try{const h=new Te(l);s&&(h.tryGet("encrypted")?(i("Decrypting..."),await h.decrypt(s)):(i("Encrypting..."),await h.encrypt(s))),_e(ne,n=[...n,h],n),d()}catch(h){alert(h),d()}}function u(h){l=h,t(2,l)}function o(h){s=h,t(1,s)}return[r,s,l,c,f,u,o]}class Gt extends U{constructor(e){super();O(this,e,Ht,qt,X,{importAccount:0})}get importAccount(){return this.$$.ctx[0]}}function He(a,e,t){const n=a.slice();return n[3]=e[t],n}function Ge(a,e,t){const n=a.slice();return n[3]=e[t],n}function Be(a){let e,t,n=a[3].label+"",s,l,c,f,i;return{c(){e=g("li"),t=g("span"),s=K(n),l=P(),this.h()},l(d){e=v(d,"LI",{class:!0});var r=E(e);t=v(r,"SPAN",{class:!0});var u=E(t);s=R(u,n),u.forEach(p),l=C(r),r.forEach(p),this.h()},h(){$(t,"class","svelte-vpfy36"),$(e,"class",c=""+(je(a[0]===a[3].value?"active":"")+" svelte-vpfy36"))},m(d,r){y(d,e,r),m(e,t),m(t,s),m(e,l),f||(i=ae(t,"click",function(){Oe(a[2](a[3].value))&&a[2](a[3].value).apply(this,arguments)}),f=!0)},p(d,r){a=d,r&2&&n!==(n=a[3].label+"")&&Z(s,n),r&3&&c!==(c=""+(je(a[0]===a[3].value?"active":"")+" svelte-vpfy36"))&&$(e,"class",c)},d(d){d&&p(e),f=!1,i()}}}function Ke(a){let e,t,n,s;var l=a[3].component;function c(f){return{}}return l&&(t=new l(c())),{c(){e=g("div"),t&&j(t.$$.fragment),n=P(),this.h()},l(f){e=v(f,"DIV",{class:!0});var i=E(e);t&&M(t.$$.fragment,i),n=C(i),i.forEach(p),this.h()},h(){$(e,"class","mb-10 p-5 border border-t-0 rounded rounded-t-none bg-white")},m(f,i){y(f,e,i),t&&q(t,e,null),m(e,n),s=!0},p(f,i){if(l!==(l=f[3].component)){if(t){ee();const d=t;V(d.$$.fragment,1,0,()=>{H(d,1)}),te()}l?(t=new l(c()),j(t.$$.fragment),I(t.$$.fragment,1),q(t,e,n)):t=null}},i(f){s||(t&&I(t.$$.fragment,f),s=!0)},o(f){t&&V(t.$$.fragment,f),s=!1},d(f){f&&p(e),t&&H(t)}}}function Re(a){let e,t,n=a[0]==a[3].value&&Ke(a);return{c(){n&&n.c(),e=Q()},l(s){n&&n.l(s),e=Q()},m(s,l){n&&n.m(s,l),y(s,e,l),t=!0},p(s,l){s[0]==s[3].value?n?(n.p(s,l),l&3&&I(n,1)):(n=Ke(s),n.c(),I(n,1),n.m(e.parentNode,e)):n&&(ee(),V(n,1,1,()=>{n=null}),te())},i(s){t||(I(n),t=!0)},o(s){V(n),t=!1},d(s){n&&n.d(s),s&&p(e)}}}function Bt(a){let e,t,n,s,l=a[1],c=[];for(let r=0;rV(i[r],1,1,()=>{i[r]=null});return{c(){e=g("ul");for(let r=0;r()=>t(0,s=c);return a.$$set=c=>{"items"in c&&t(1,n=c.items),"activeTabValue"in c&&t(0,s=c.activeTabValue)},[s,n,l]}class Rt extends U{constructor(e){super();O(this,e,Kt,Bt,X,{items:1,activeTabValue:0})}}function Me(a,e,t){const n=a.slice();return n[3]=e[t],n[5]=t,n}function Se(a){let e;return{c(){e=g("hr"),this.h()},l(t){e=v(t,"HR",{class:!0}),this.h()},h(){$(e,"class","page-break")},m(t,n){y(t,e,n)},d(t){t&&p(e)}}}function We(a,e){let t,n,s,l,c;n=new kt({props:{account:e[3]}});let f=(e[5]+1)%5==0&&Se();return{key:a,first:null,c(){t=Q(),j(n.$$.fragment),s=P(),f&&f.c(),l=Q(),this.h()},l(i){t=Q(),M(n.$$.fragment,i),s=C(i),f&&f.l(i),l=Q(),this.h()},h(){this.first=t},m(i,d){y(i,t,d),q(n,i,d),y(i,s,d),f&&f.m(i,d),y(i,l,d),c=!0},p(i,d){e=i;const r={};d&4&&(r.account=e[3]),n.$set(r),(e[5]+1)%5==0?f||(f=Se(),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},i(i){c||(I(n.$$.fragment,i),c=!0)},o(i){V(n.$$.fragment,i),c=!1},d(i){i&&p(t),H(n,i),i&&p(s),f&&f.d(i),i&&p(l)}}}function Mt(a){let e;return{c(){e=K("Print!")},l(t){e=R(t,"Print!")},m(t,n){y(t,e,n)},d(t){t&&p(e)}}}function St(a){let e,t,n,s,l,c,f,i,d,r,u,o,h,b,B,G,k,_=[],w=new Map,A,T,S,L,z,F,x;B=new Rt({props:{items:a[1]}});let se=a[2];const we=D=>D[3].address;for(let D=0;Dt(2,n=l));let{tabItems:s=[{label:"Generate",component:Tt,value:1},{label:"Import",component:Gt,value:2}]}=e;return a.$$set=l=>{"tabItems"in l&&t(1,s=l.tabItems)},[be,s,n]}class Lt extends U{constructor(e){super();O(this,e,Wt,St,X,{print:0,tabItems:1})}get print(){return be}}export{Lt as default}; diff --git a/docs/_app/start-8c841228.js b/docs/_app/start-8c841228.js new file mode 100644 index 0000000..daa07f6 --- /dev/null +++ b/docs/_app/start-8c841228.js @@ -0,0 +1 @@ +var re=Object.defineProperty,ne=Object.defineProperties;var ie=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=(n,e,t)=>e in n?re(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,U=(n,e)=>{for(var t in e||(e={}))J.call(e,t)&&M(n,t,e[t]);if(D)for(var t of D(e))G.call(e,t)&&M(n,t,e[t]);return n},Y=(n,e)=>ne(n,ie(e));var X=(n,e)=>{var t={};for(var r in n)J.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&D)for(var r of D(n))e.indexOf(r)<0&&G.call(n,r)&&(t[r]=n[r]);return t};import{S as ae,i as oe,s as le,e as ce,c as fe,a as ue,d as y,b as B,f as $,t as he,g as de,h as _e,j as pe,k as m,l as me,m as N,n as g,o as P,p as w,q as ge,r as we,u as be,v as k,w as j,x as E,y as C,z as O,A as R,B as I,C as K}from"./chunks/vendor-44ba3db2.js";function ve(n){let e,t,r;const l=[n[1]||{}];var i=n[0][0];function a(s){let o={};for(let c=0;c{R(f,1)}),P()}i?(e=new i(a()),k(e.$$.fragment),w(e.$$.fragment,1),E(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&R(e,s)}}}function ye(n){let e,t,r;const l=[n[1]||{}];var i=n[0][0];function a(s){let o={$$slots:{default:[Re]},$$scope:{ctx:s}};for(let c=0;c{R(f,1)}),P()}i?(e=new i(a(s)),k(e.$$.fragment),w(e.$$.fragment,1),E(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&R(e,s)}}}function $e(n){let e,t,r;const l=[n[2]||{}];var i=n[0][1];function a(s){let o={};for(let c=0;c{R(f,1)}),P()}i?(e=new i(a()),k(e.$$.fragment),w(e.$$.fragment,1),E(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&R(e,s)}}}function ke(n){let e,t,r;const l=[n[2]||{}];var i=n[0][1];function a(s){let o={$$slots:{default:[Ee]},$$scope:{ctx:s}};for(let c=0;c{R(f,1)}),P()}i?(e=new i(a(s)),k(e.$$.fragment),w(e.$$.fragment,1),E(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&R(e,s)}}}function Ee(n){let e,t,r;const l=[n[3]||{}];var i=n[0][2];function a(s){let o={};for(let c=0;c{R(f,1)}),P()}i?(e=new i(a()),k(e.$$.fragment),w(e.$$.fragment,1),E(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(s){r||(e&&w(e.$$.fragment,s),r=!0)},o(s){e&&g(e.$$.fragment,s),r=!1},d(s){s&&y(t),e&&R(e,s)}}}function Re(n){let e,t,r,l;const i=[ke,$e],a=[];function s(o,c){return o[0][2]?0:1}return e=s(n),t=a[e]=i[e](n),{c(){t.c(),r=m()},l(o){t.l(o),r=m()},m(o,c){a[e].m(o,c),$(o,r,c),l=!0},p(o,c){let f=e;e=s(o),e===f?a[e].p(o,c):(N(),g(a[f],1,1,()=>{a[f]=null}),P(),t=a[e],t?t.p(o,c):(t=a[e]=i[e](o),t.c()),w(t,1),t.m(r.parentNode,r))},i(o){l||(w(t),l=!0)},o(o){g(t),l=!1},d(o){a[e].d(o),o&&y(r)}}}function F(n){let e,t=n[5]&&H(n);return{c(){e=ce("div"),t&&t.c(),this.h()},l(r){e=fe(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,class:!0});var l=ue(e);t&&t.l(l),l.forEach(y),this.h()},h(){B(e,"id","svelte-announcer"),B(e,"aria-live","assertive"),B(e,"aria-atomic","true"),B(e,"class","svelte-1j55zn5")},m(r,l){$(r,e,l),t&&t.m(e,null)},p(r,l){r[5]?t?t.p(r,l):(t=H(r),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(r){r&&y(e),t&&t.d()}}}function H(n){let e;return{c(){e=he(n[6])},l(t){e=de(t,n[6])},m(t,r){$(t,e,r)},p(t,r){r&64&&_e(e,t[6])},d(t){t&&y(e)}}}function Se(n){let e,t,r,l,i;const a=[ye,ve],s=[];function o(f,h){return f[0][1]?0:1}e=o(n),t=s[e]=a[e](n);let c=n[4]&&F(n);return{c(){t.c(),r=pe(),c&&c.c(),l=m()},l(f){t.l(f),r=me(f),c&&c.l(f),l=m()},m(f,h){s[e].m(f,h),$(f,r,h),c&&c.m(f,h),$(f,l,h),i=!0},p(f,[h]){let u=e;e=o(f),e===u?s[e].p(f,h):(N(),g(s[u],1,1,()=>{s[u]=null}),P(),t=s[e],t?t.p(f,h):(t=s[e]=a[e](f),t.c()),w(t,1),t.m(r.parentNode,r)),f[4]?c?c.p(f,h):(c=F(f),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null)},i(f){i||(w(t),i=!0)},o(f){g(t),i=!1},d(f){s[e].d(f),f&&y(r),c&&c.d(f),f&&y(l)}}}function Le(n,e,t){let{stores:r}=e,{page:l}=e,{components:i}=e,{props_0:a=null}=e,{props_1:s=null}=e,{props_2:o=null}=e;ge("__svelte__",r),we(r.page.notify);let c=!1,f=!1,h=null;return be(()=>{const u=r.page.subscribe(()=>{c&&(t(5,f=!0),t(6,h=document.title||"untitled page"))});return t(4,c=!0),u}),n.$$set=u=>{"stores"in u&&t(7,r=u.stores),"page"in u&&t(8,l=u.page),"components"in u&&t(0,i=u.components),"props_0"in u&&t(1,a=u.props_0),"props_1"in u&&t(2,s=u.props_1),"props_2"in u&&t(3,o=u.props_2)},n.$$.update=()=>{n.$$.dirty&384&&r.page.set(l)},[i,a,s,o,c,f,h,r,l]}class Ue extends ae{constructor(e){super();oe(this,e,Le,Se,le,{stores:7,page:8,components:0,props_0:1,props_1:2,props_2:3})}}const Ae="modulepreload",Q={},Ne="/ansy/_app/",W=function(e,t){return!t||t.length===0?e():Promise.all(t.map(r=>{if(r=`${Ne}${r}`,r in Q)return;Q[r]=!0;const l=r.endsWith(".css"),i=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${i}`))return;const a=document.createElement("link");if(a.rel=l?"stylesheet":Ae,l||(a.as="script",a.crossOrigin=""),a.href=r,document.head.appendChild(a),l)return new Promise((s,o)=>{a.addEventListener("load",s),a.addEventListener("error",o)})})).then(()=>e())},V=[()=>W(()=>import("./pages/__layout.svelte-b3a62dea.js"),["pages/__layout.svelte-b3a62dea.js","assets/pages/__layout.svelte-ce1d98e9.css","chunks/vendor-44ba3db2.js"]),()=>W(()=>import("./error.svelte-0437ff64.js"),["error.svelte-0437ff64.js","chunks/vendor-44ba3db2.js"]),()=>W(()=>import("./pages/index.svelte-57579be3.js"),["pages/index.svelte-57579be3.js","assets/pages/index.svelte-30900ca9.css","chunks/vendor-44ba3db2.js"])],Pe=[[/^\/$/,[V[0],V[2]],[V[1]]]],Te=[V[0](),V[1]()];function je(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}let Z="";function Ce(n){Z=n.base,n.assets}function z(){return{x:pageXOffset,y:pageYOffset}}function x(n){return n.composedPath().find(t=>t instanceof Node&&t.nodeName.toUpperCase()==="A")}function ee(n){return n instanceof SVGAElement?new URL(n.href.baseVal,document.baseURI):new URL(n.href)}class Oe{constructor({base:e,routes:t,trailing_slash:r,renderer:l}){this.base=e,this.routes=t,this.trailing_slash=r,this.navigating=0,this.renderer=l,l.router=this,this.enabled=!0,document.body.setAttribute("tabindex","-1"),history.replaceState(history.state||{},"",location.href)}init_listeners(){"scrollRestoration"in history&&(history.scrollRestoration="manual"),addEventListener("beforeunload",()=>{history.scrollRestoration="auto"}),addEventListener("load",()=>{history.scrollRestoration="manual"});let e;addEventListener("scroll",()=>{clearTimeout(e),e=setTimeout(()=>{const i=Y(U({},history.state||{}),{"sveltekit:scroll":z()});history.replaceState(i,document.title,window.location.href)},200)});const t=i=>{const a=x(i);a&&a.href&&a.hasAttribute("sveltekit:prefetch")&&this.prefetch(ee(a))};let r;const l=i=>{clearTimeout(r),r=setTimeout(()=>{var a;(a=i.target)==null||a.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",t),addEventListener("mousemove",l),addEventListener("sveltekit:trigger_prefetch",t),addEventListener("click",i=>{if(!this.enabled||i.button||i.which!==1||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||i.defaultPrevented)return;const a=x(i);if(!a||!a.href)return;const s=ee(a);if(s.toString()===location.href){location.hash||i.preventDefault();return}const c=(a.getAttribute("rel")||"").split(/\s+/);if(a.hasAttribute("download")||c&&c.includes("external")||(a instanceof SVGAElement?a.target.baseVal:a.target)||!this.owns(s))return;if(s.href.split("#")[0]===location.href.split("#")[0]){setTimeout(()=>history.pushState({},"",s.href));return}history.pushState({},"",s.href);const f=a.hasAttribute("sveltekit:noscroll");this._navigate(s,f?z():null,!1,[],s.hash),i.preventDefault()}),addEventListener("popstate",i=>{if(i.state&&this.enabled){const a=new URL(location.href);this._navigate(a,i.state["sveltekit:scroll"],!1,[])}})}owns(e){return e.origin===location.origin&&e.pathname.startsWith(this.base)}parse(e){if(this.owns(e)){const t=decodeURI(e.pathname.slice(this.base.length)||"/");return{id:e.pathname+e.search,routes:this.routes.filter(([r])=>r.test(t)),url:e,path:t}}}async goto(e,{noscroll:t=!1,replaceState:r=!1,keepfocus:l=!1,state:i={}}={},a){const s=new URL(e,je(document));return this.enabled&&this.owns(s)?(history[r?"replaceState":"pushState"](i,"",e),this._navigate(s,t?z():null,l,a,s.hash)):(location.href=s.href,new Promise(()=>{}))}enable(){this.enabled=!0}disable(){this.enabled=!1}async prefetch(e){const t=this.parse(e);if(!t)throw new Error("Attempted to prefetch a URL that does not belong to this app");return this.renderer.load(t)}async _navigate(e,t,r,l,i){const a=this.parse(e);if(!a)throw new Error("Attempted to navigate to a URL that does not belong to this app");this.navigating||dispatchEvent(new CustomEvent("sveltekit:navigation-start")),this.navigating++;let{pathname:s}=e;this.trailing_slash==="never"?s!=="/"&&s.endsWith("/")&&(s=s.slice(0,-1)):this.trailing_slash==="always"&&!e.pathname.split("/").pop().includes(".")&&!s.endsWith("/")&&(s+="/"),a.url=new URL(e.origin+s+e.search+e.hash),history.replaceState({},"",a.url),await this.renderer.handle_navigation(a,l,!1,{hash:i,scroll:t,keepfocus:r}),this.navigating--,this.navigating||dispatchEvent(new CustomEvent("sveltekit:navigation-end"))}}function te(n){return n instanceof Error||n&&n.name&&n.message?n:new Error(JSON.stringify(n))}function Ie(n){let e=5381,t=n.length;if(typeof n=="string")for(;t;)e=e*33^n.charCodeAt(--t);else for(;t;)e=e*33^n[--t];return(e>>>0).toString(36)}function Ve(n){const e=n.status&&n.status>=400&&n.status<=599&&!n.redirect;if(n.error||e){const t=n.status;if(!n.error&&e)return{status:t||500,error:new Error};const r=typeof n.error=="string"?new Error(n.error):n.error;return r instanceof Error?!t||t<400||t>599?(console.warn('"error" returned from load() without a valid status code \u2014 defaulting to 500'),{status:500,error:r}):{status:t,error:r}:{status:500,error:new Error(`"error" property returned from load() must be a string or instance of Error, received type "${typeof r}"`)}}if(n.redirect){if(!n.status||Math.floor(n.status/100)!==3)return{status:500,error:new Error('"redirect" property returned from load() must be accompanied by a 3xx status code')};if(typeof n.redirect!="string")return{status:500,error:new Error('"redirect" property returned from load() must be a string')}}if(n.context)throw new Error('You are returning "context" from a load function. "context" was renamed to "stuff", please adjust your code accordingly.');return n}function se(n){const e=K(n);let t=!0;function r(){t=!0,e.update(a=>a)}function l(a){t=!1,e.set(a)}function i(a){let s;return e.subscribe(o=>{(s===void 0||t&&o!==s)&&a(s=o)})}return{notify:r,set:l,subscribe:i}}function qe(n,e){const t=typeof n=="string"?n:n.url;let r=`script[data-type="svelte-data"][data-url=${JSON.stringify(t)}]`;e&&typeof e.body=="string"&&(r+=`[data-body="${Ie(e.body)}"]`);const l=document.querySelector(r);if(l&&l.textContent){const i=JSON.parse(l.textContent),{body:a}=i,s=X(i,["body"]);return Promise.resolve(new Response(a,s))}return fetch(n,e)}class De{constructor({Root:e,fallback:t,target:r,session:l}){this.Root=e,this.fallback=t,this.router,this.target=r,this.started=!1,this.session_id=1,this.invalid=new Set,this.invalidating=null,this.autoscroll=!0,this.updating=!1,this.current={url:null,session_id:0,branch:[]},this.cache=new Map,this.loading={id:null,promise:null},this.stores={url:se({}),page:se({}),navigating:K(null),session:K(l)},this.$session=null,this.root=null;let i=!1;this.stores.session.subscribe(async a=>{if(this.$session=a,!i||!this.router)return;this.session_id+=1;const s=this.router.parse(new URL(location.href));s&&this.update(s,[],!0)}),i=!0}disable_scroll_handling(){(this.updating||!this.started)&&(this.autoscroll=!1)}async start({status:e,error:t,nodes:r,url:l,params:i}){const a=[];let s={},o,c;try{for(let f=0;f10||t.includes(e.url.pathname))a=await this._load_error({status:500,error:new Error("Redirect loop"),url:e.url});else{this.router?this.router.goto(a.redirect,{replaceState:!0},[...t,e.url.pathname]):location.href=new URL(a.redirect,location.href).href;return}if(this.updating=!0,this.started?(this.current=a.state,this.root.$set(a.props),this.stores.navigating.set(null)):this._init(a),l){const{hash:c,scroll:f,keepfocus:h}=l;if(h||((o=getSelection())==null||o.removeAllRanges(),document.body.focus()),await 0,this.autoscroll){const u=c&&document.getElementById(c.slice(1));f?scrollTo(f.x,f.y):u?u.scrollIntoView():scrollTo(0,0)}}else await 0;if(this.loading.promise=null,this.loading.id=null,this.autoscroll=!0,this.updating=!1,!this.router)return;const s=a.state.branch[a.state.branch.length-1];s&&s.module.router===!1?this.router.disable():this.router.enable()}load(e){return this.loading.promise=this._get_navigation_result(e,!1),this.loading.id=e.id,this.loading.promise}invalidate(e){return this.invalid.add(e),this.invalidating||(this.invalidating=Promise.resolve().then(async()=>{const t=this.router&&this.router.parse(new URL(location.href));t&&await this.update(t,[],!0),this.invalidating=null})),this.invalidating}_init(e){this.current=e.state;const t=document.querySelector("style[data-svelte]");t&&t.remove(),this.root=new this.Root({target:this.target,props:U({stores:this.stores},e.props),hydrate:!0}),this.started=!0}async _get_navigation_result(e,t){if(this.loading.id===e.id&&this.loading.promise)return this.loading.promise;for(let r=0;ro()),i+=1;else break}const a=await this._load({route:l,info:e},t);if(a)return a}return await this._load_error({status:404,error:new Error(`Not found: ${e.url.pathname}`),url:e.url})}async _get_navigation_result_from_branch({url:e,params:t,branch:r,status:l,error:i}){const a=r.filter(Boolean),s=a.find(h=>h.loaded&&h.loaded.redirect),o={redirect:s&&s.loaded?s.loaded.redirect:void 0,state:{url:e,params:t,branch:r,session_id:this.session_id},props:{components:a.map(h=>h.module.default)}};for(let h=0;h{Object.defineProperty(o.props.page,u,{get:()=>{throw new Error(`$page.${u} has been replaced by $page.url.${p}`)}})};h("origin","origin"),h("path","pathname"),h("query","searchParams")}const c=a[a.length-1],f=c.loaded&&c.loaded.maxage;if(f){const h=e.pathname+e.search;let u=!1;const p=()=>{this.cache.get(h)===o&&this.cache.delete(h),S(),clearTimeout(A)},A=setTimeout(p,f*1e3),S=this.stores.session.subscribe(()=>{u&&p()});u=!0,this.cache.set(h,o)}return o}async _load_node({status:e,error:t,module:r,url:l,params:i,stuff:a}){const s={module:r,uses:{params:new Set,url:!1,session:!1,stuff:!1,dependencies:[]},loaded:null,stuff:a},o={};for(const f in i)Object.defineProperty(o,f,{get(){return s.uses.params.add(f),i[f]},enumerable:!0});const c=this.$session;if(r.load){const{started:f}=this,h={params:o,get url(){return s.uses.url=!0,l},get session(){return s.uses.session=!0,c},get stuff(){return s.uses.stuff=!0,U({},a)},fetch(p,A){const S=typeof p=="string"?p:p.url,{href:L}=new URL(S,l);return s.uses.dependencies.push(L),f?fetch(p,A):qe(p,A)}};t&&(h.status=e,h.error=t);const u=await r.load.call(null,h);if(!u)return;s.loaded=Ve(u),s.loaded.stuff&&(s.stuff=s.loaded.stuff)}return s}async _load({route:e,info:{url:t,path:r}},l){const i=t.pathname+t.search;if(!l){const d=this.cache.get(i);if(d)return d}const[a,s,o,c]=e,f=c?c(a.exec(r)):{},h=this.current.url&&{url:i!==this.current.url.pathname+this.current.url.search,params:Object.keys(f).filter(d=>this.current.params[d]!==f[d]),session:this.session_id!==this.current.session_id};let u=[],p={},A=!1,S=200,L;s.forEach(d=>d());e:for(let d=0;dv.uses.params.has(T))||h.session&&v.uses.session||v.uses.dependencies.some(T=>this.invalid.has(T))||A&&v.uses.stuff){_=await this._load_node({module:b,url:t,params:f,stuff:p});const T=d===s.length-1;if(_&&_.loaded){if(_.loaded.error&&(S=_.loaded.status,L=_.loaded.error),_.loaded.redirect)return{redirect:_.loaded.redirect,props:{},state:this.current};_.loaded.stuff&&(A=!0)}else if(T&&b.load)return}else _=v}catch(b){S=500,L=te(b)}if(L){for(;d--;)if(o[d]){let b,v,q=d;for(;!(v=u[q]);)q-=1;try{if(b=await this._load_node({status:S,error:L,module:await o[d](),url:t,params:f,stuff:v.stuff}),b&&b.loaded&&b.loaded.error)continue;u=u.slice(0,q+1).concat(b);break e}catch{continue}}return await this._load_error({status:S,error:L,url:t})}else _&&_.loaded&&_.loaded.stuff&&(p=U(U({},p),_.loaded.stuff)),u.push(_)}return await this._get_navigation_result_from_branch({url:t,params:f,branch:u,status:S,error:L})}async _load_error({status:e,error:t,url:r}){const l={},i=await this._load_node({module:await this.fallback[0],url:r,params:l,stuff:{}}),a=[i,await this._load_node({status:e,error:t,module:await this.fallback[1],url:r,params:l,stuff:i&&i.loaded&&i.loaded.stuff||{}})];return await this._get_navigation_result_from_branch({url:r,params:l,branch:a,status:e,error:t})}}async function We({paths:n,target:e,session:t,route:r,spa:l,trailing_slash:i,hydrate:a}){const s=new De({Root:Ue,fallback:Te,target:e,session:t}),o=r?new Oe({base:n.base,routes:Pe,trailing_slash:i,renderer:s}):null;Ce(n),a&&await s.start(a),o&&(l&&o.goto(location.href,{replaceState:!0},[]),o.init_listeners()),dispatchEvent(new CustomEvent("sveltekit:start"))}export{We as start}; diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..304c24b --- /dev/null +++ b/docs/index.html @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + +Fork me on GitHub +

Ansy

+ +

Paper wallet for Neo3

+
  • Generate +
  • Import +
+

Generate a new Private Key

+
+
+

Warning: Encryption will take a while +

+
+
+
+

Made by snowypowers | v3.0.0

+

Tips appreciated!

+
NEO: NYBWj9yJHGQ8tP69HuUrSBZgDxJXwdAjDs
+
ETH: 0x2E15cd6Ca9f8dcdCd08Ad62d901b6E6a815a36fd
+ +
+ + diff --git a/jsconfig.json b/jsconfig.json index 4542720..6241d1a 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,18 +1,10 @@ { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "$lib": [ - "src/lib" - ], - "$lib/*": [ - "src/lib/*" - ] - } - }, - "include": [ - "src/**/*.d.ts", - "src/**/*.js", - "src/**/*.svelte" - ] -} \ No newline at end of file + "compilerOptions": { + "baseUrl": ".", + "paths": { + "$lib": ["src/lib"], + "$lib/*": ["src/lib/*"] + } + }, + "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] +} diff --git a/package.json b/package.json index 927623b..7165392 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ansy", - "version": "2.0.1", + "version": "3.0.0", "private": true, "main": "src/index.js", "type": "module", @@ -9,7 +9,7 @@ "homepage": "https://snowypowers.github.io/ansy/", "scripts": { "dev": "svelte-kit dev", - "build": "svelte-kit build", + "build": "svelte-kit build && touch docs/.nojekyll", "package": "svelte-kit package", "preview": "svelte-kit preview", "check": "svelte-check --tsconfig ./tsconfig.json", diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 3d4b007..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/index.html b/public/index.html deleted file mode 100644 index ee0f3dc..0000000 --- a/public/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - Ansy - Minimal NEO Paper Wallet - - - - - - - - - - diff --git a/public/manifest.json b/public/manifest.json deleted file mode 100644 index 7597753..0000000 --- a/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "Ansy", - "name": "Minimal NEO Paper Wallet", - "icons": [ - { - "src": "favicon.ico", - "sizes": "192x192", - "type": "image/png" - } - ], - "start_url": "./index.html", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/src/App.css b/src/App.css index f0b219a..7cffcf3 100644 --- a/src/App.css +++ b/src/App.css @@ -13,41 +13,6 @@ body { background-size: 256px 256px; } -/* -.flex.column { - flex-direction: column; -} - -.App { - display: flex; - min-height: 86vh; - flex-direction: column; - margin: 0 auto; - max-width: 960px; -} - -.middle { - margin: 0 auto; -} - -.center-text { - text-align: center; -} - -#root { - height: 100%; -} - -#splash { - text-align: center; - flex: none; -} - -#print-foot { - flex: none; - min-height: 20%; -} */ - @media print { .wallet-page { width: 210mm; diff --git a/src/App.js b/src/App.js index ff75222..49bee41 100644 --- a/src/App.js +++ b/src/App.js @@ -1,81 +1,91 @@ -import React, { Component } from 'react' -import Form from './components/Form' -import Footer from './components/Footer' -import Wallet from './components/Wallet' -import NEP2Wallet from './components/NEP2Wallet' -import './App.css' +import React, { Component } from 'react'; +import Form from './components/Form'; +import Footer from './components/Footer'; +import Wallet from './components/Wallet'; +import NEP2Wallet from './components/NEP2Wallet'; +import './App.css'; class App extends Component { constructor(props) { - super(props) + super(props); this.state = { wallets: [] - } - this.print = this.print.bind(this) - this.addWallet = this.addWallet.bind(this) - this.removeWallet = this.removeWallet.bind(this) - this.toggleWallet = this.toggleWallet.bind(this) + }; + this.print = this.print.bind(this); + this.addWallet = this.addWallet.bind(this); + this.removeWallet = this.removeWallet.bind(this); + this.toggleWallet = this.toggleWallet.bind(this); } addWallet(newWallet) { for (const wallet of this.state.wallets) { if (wallet.address === newWallet.address) { - return false + return false; } } - this.setState({ wallets: this.state.wallets.concat([newWallet]) }) - return true + this.setState({ wallets: this.state.wallets.concat([newWallet]) }); + return true; } removeWallet(addr) { - this.setState({ wallets: this.state.wallets.filter((w) => w.address !== addr) }) + this.setState({ wallets: this.state.wallets.filter((w) => w.address !== addr) }); } toggleWallet(addr, newType) { this.setState({ wallets: this.state.wallets.filter((w) => { if (w.address === addr) { - return Object.assign(w, {type: newType}) + return Object.assign(w, { type: newType }); } else { - return w + return w; } }) - }) + }); } print() { if (this.state.wallets.length > 0) { - window.print() + window.print(); } else { - alert("You do not have any wallets to print!") + alert('You do not have any wallets to print!'); } } WalletList(props) { const listItems = props.map((p) => { - if (p.type === "NEP2") { + if (p.type === 'NEP2') { return ( - - ) + + ); } else { return ( - - ) + + ); } - }) - const pages = [] + }); + const pages = []; while (listItems.length) { - pages.push(this.WalletPage(listItems.splice(0, 4))) + pages.push(this.WalletPage(listItems.splice(0, 4))); } - return ( -
{pages}
- ) + return
{pages}
; } WalletPage(wallets) { return ( -
{wallets}
- ) +
+ {wallets} +
+ ); } render() { return ( @@ -86,12 +96,15 @@ class App extends Component {

Paper Wallet for NEO

-
this.form = i} /> + (this.form = i)} /> {this.WalletList(this.state.wallets)}
diff --git a/src/app.html b/src/app.html index 955ee6e..5540371 100644 --- a/src/app.html +++ b/src/app.html @@ -1,15 +1,13 @@ - - + %svelte.head% - + - +
%svelte.body%
- - - \ No newline at end of file + + diff --git a/src/bg.svg b/src/bg.svg index 5fa6c23..bd2f1a9 100644 --- a/src/bg.svg +++ b/src/bg.svg @@ -14,7 +14,7 @@ - + diff --git a/src/components/Card.svelte b/src/components/Card.svelte index 09d0aa8..db7d179 100644 --- a/src/components/Card.svelte +++ b/src/components/Card.svelte @@ -1,4 +1,4 @@ -
+
diff --git a/src/components/Tabs.svelte b/src/components/Tabs.svelte index 3203931..45bf754 100644 --- a/src/components/Tabs.svelte +++ b/src/components/Tabs.svelte @@ -7,14 +7,14 @@
    {#each items as item} -
  • +
  • {item.label}
  • {/each}
{#each items as item} {#if activeTabValue == item.value} -
+
{/if} diff --git a/src/components/stores.ts b/src/components/stores.ts index 5f270ac..8589b0f 100644 --- a/src/components/stores.ts +++ b/src/components/stores.ts @@ -1,3 +1,3 @@ -import { writable } from "svelte/store"; +import { writable } from 'svelte/store'; export const accounts = writable([]); diff --git a/src/main.ts b/src/main.ts index d6cacbb..8e1efe9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,10 @@ import App from './App.svelte'; const app = new App({ - target: document.body, - props: { - name: 'world' - } + target: document.body, + props: { + name: 'world' + } }); -export default app; \ No newline at end of file +export default app; diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 92f6606..4039a26 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -2,4 +2,4 @@ import '../app.css'; - \ No newline at end of file + diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 884dddd..12b26df 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -60,24 +60,3 @@
- - diff --git a/svelte.config.js b/svelte.config.js index 309d04f..3c8e71c 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,6 +1,8 @@ import adapter from '@sveltejs/adapter-static'; import preprocess from 'svelte-preprocess'; +const dev = process.env.NODE_ENV === 'development'; + /** @type {import('@sveltejs/kit').Config} */ const config = { // Consult https://github.com/sveltejs/svelte-preprocess @@ -8,10 +10,15 @@ const config = { preprocess: [preprocess({})], kit: { - adapter: adapter(), + adapter: adapter({ + pages: 'docs' + }), // hydrate the
element in src/app.html - target: '#svelte' + target: '#svelte', + paths: { + base: dev ? '' : '/ansy' + } } }; diff --git a/tsconfig.json b/tsconfig.json index 62fcb63..b74bddb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,10 +2,7 @@ "compilerOptions": { "moduleResolution": "node", "module": "es2020", - "lib": [ - "es2020", - "DOM" - ], + "lib": ["es2020", "DOM"], "target": "es2020", /** svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript @@ -26,18 +23,9 @@ "allowJs": true, "checkJs": true, "paths": { - "$lib": [ - "src/lib" - ], - "$lib/*": [ - "src/lib/*" - ] + "$lib": ["src/lib"], + "$lib/*": ["src/lib/*"] } }, - "include": [ - "src/**/*.d.ts", - "src/**/*.js", - "src/**/*.ts", - "src/**/*.svelte" - ] -} \ No newline at end of file + "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"] +}