@learncard/core 3.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- "use strict";var c5=Object.create;var zs=Object.defineProperty,u5=Object.defineProperties,l5=Object.getOwnPropertyDescriptor,d5=Object.getOwnPropertyDescriptors,h5=Object.getOwnPropertyNames,Tc=Object.getOwnPropertySymbols,Tm=Object.getPrototypeOf,hd=Object.prototype.hasOwnProperty,km=Object.prototype.propertyIsEnumerable,p5=Reflect.get;var pd=Math.pow,Am=(r,e,t)=>e in r?zs(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,re=(r,e)=>{for(var t in e||(e={}))hd.call(e,t)&&Am(r,t,e[t]);if(Tc)for(var t of Tc(e))km.call(e,t)&&Am(r,t,e[t]);return r},Te=(r,e)=>u5(r,d5(e)),o=(r,e)=>zs(r,"name",{value:e,configurable:!0});var Cm=(r,e)=>{var t={};for(var n in r)hd.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&Tc)for(var n of Tc(r))e.indexOf(n)<0&&km.call(r,n)&&(t[n]=r[n]);return t};var gt=(r,e)=>()=>(r&&(e=r(r=0)),e);var me=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),St=(r,e)=>{for(var t in e)zs(r,t,{get:e[t],enumerable:!0})},Dm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of h5(e))!hd.call(r,i)&&i!==t&&zs(r,i,{get:()=>e[i],enumerable:!(n=l5(e,i))||n.enumerable});return r};var at=(r,e,t)=>(t=r!=null?c5(Tm(r)):{},Dm(e||!r||!r.__esModule?zs(t,"default",{value:r,enumerable:!0}):t,r)),ef=r=>Dm(zs({},"__esModule",{value:!0}),r);var md=(r,e,t)=>p5(Tm(r),t,e);var Z=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{f(t.next(u))}catch(p){i(p)}},a=u=>{try{f(t.throw(u))}catch(p){i(p)}},f=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);f((t=t.apply(r,e)).next())});var Nm={};St(Nm,{concat:()=>vn});function vn(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}var gd=gt(()=>{o(vn,"concat")});function P5(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var s=r.charAt(i),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=i}var f=r.length,u=r.charAt(0),p=Math.log(f)/Math.log(256),b=Math.log(256)/Math.log(f);function x(T){if(T instanceof Uint8Array||(ArrayBuffer.isView(T)?T=new Uint8Array(T.buffer,T.byteOffset,T.byteLength):Array.isArray(T)&&(T=Uint8Array.from(T))),!(T instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(T.length===0)return"";for(var k=0,$=0,C=0,B=T.length;C!==B&&T[C]===0;)C++,k++;for(var z=(B-C)*b+1>>>0,H=new Uint8Array(z);C!==B;){for(var X=T[C],U=0,L=z-1;(X!==0||U<$)&&L!==-1;L--,U++)X+=256*H[L]>>>0,H[L]=X%f>>>0,X=X/f>>>0;if(X!==0)throw new Error("Non-zero carry");$=U,C++}for(var F=z-$;F!==z&&H[F]===0;)F++;for(var ne=u.repeat(k);F<z;++F)ne+=r.charAt(H[F]);return ne}o(x,"encode");function A(T){if(typeof T!="string")throw new TypeError("Expected String");if(T.length===0)return new Uint8Array;var k=0;if(T[k]!==" "){for(var $=0,C=0;T[k]===u;)$++,k++;for(var B=(T.length-k)*p+1>>>0,z=new Uint8Array(B);T[k];){var H=t[T.charCodeAt(k)];if(H===255)return;for(var X=0,U=B-1;(H!==0||X<C)&&U!==-1;U--,X++)H+=f*z[U]>>>0,z[U]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");C=X,k++}if(T[k]!==" "){for(var L=B-C;L!==B&&z[L]===0;)L++;for(var F=new Uint8Array($+(B-L)),ne=$;L!==B;)F[ne++]=z[L++];return F}}}o(A,"decodeUnsafe");function O(T){var k=A(T);if(k)return k;throw new Error(`Non-${e} character`)}return o(O,"decode"),{encode:x,decodeUnsafe:A,decode:O}}var N5,R5,Rm,Lm=gt(()=>{o(P5,"base");N5=P5,R5=N5,Rm=R5});var nf={};St(nf,{coerce:()=>en,empty:()=>Bm,equals:()=>vd,fromHex:()=>B5,fromString:()=>yd,isBinary:()=>U5,toHex:()=>L5,toString:()=>xd});var Bm,L5,B5,vd,en,U5,yd,xd,Ki=gt(()=>{Bm=new Uint8Array(0),L5=o(r=>r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),"toHex"),B5=o(r=>{let e=r.match(/../g);return e?new Uint8Array(e.map(t=>parseInt(t,16))):Bm},"fromHex"),vd=o((r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},"equals"),en=o(r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),U5=o(r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),"isBinary"),yd=o(r=>new TextEncoder().encode(r),"fromString"),xd=o(r=>new TextDecoder().decode(r),"toString")});var Cc,Dc,Ic,Um,Oc,js,Vi,F5,$5,Dt,yn=gt(()=>{Lm();Ki();Cc=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}};o(Cc,"Encoder");Dc=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Um(this,e)}};o(Dc,"Decoder");Ic=class{constructor(e){this.decoders=e}or(e){return Um(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};o(Ic,"ComposedDecoder");Um=o((r,e)=>new Ic(re(re({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e})),"or"),Oc=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Cc(e,t,n),this.decoder=new Dc(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Oc,"Codec");js=o(({name:r,prefix:e,encode:t,decode:n})=>new Oc(r,e,t,n),"from"),Vi=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Rm(t,e);return js({prefix:r,name:e,encode:n,decode:s=>en(i(s))})},"baseX"),F5=o((r,e,t,n)=>{let i={};for(let b=0;b<e.length;++b)i[e[b]]=b;let s=r.length;for(;r[s-1]==="=";)--s;let a=new Uint8Array(s*t/8|0),f=0,u=0,p=0;for(let b=0;b<s;++b){let x=i[r[b]];if(x===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<t|x,f+=t,f>=8&&(f-=8,a[p++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return a},"decode"),$5=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",a=0,f=0;for(let u=0;u<r.length;++u)for(f=f<<8|r[u],a+=8;a>t;)a-=t,s+=e[i&f>>a];if(a&&(s+=e[i&f<<t-a]),n)for(;s.length*t&7;)s+="=";return s},"encode"),Dt=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>js({prefix:e,name:r,encode(i){return $5(i,n,t)},decode(i){return F5(i,n,t,r)}}),"rfc4648")});var wd={};St(wd,{identity:()=>q5});var q5,Fm=gt(()=>{yn();Ki();q5=js({prefix:"\0",name:"identity",encode:r=>xd(r),decode:r=>yd(r)})});var _d={};St(_d,{base2:()=>H5});var H5,$m=gt(()=>{yn();H5=Dt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Ed={};St(Ed,{base8:()=>z5});var z5,qm=gt(()=>{yn();z5=Dt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Sd={};St(Sd,{base10:()=>j5});var j5,Hm=gt(()=>{yn();j5=Vi({prefix:"9",name:"base10",alphabet:"0123456789"})});var Md={};St(Md,{base16:()=>K5,base16upper:()=>V5});var K5,V5,zm=gt(()=>{yn();K5=Dt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),V5=Dt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Ad={};St(Ad,{base32:()=>Ks,base32hex:()=>J5,base32hexpad:()=>Z5,base32hexpadupper:()=>Q5,base32hexupper:()=>X5,base32pad:()=>G5,base32padupper:()=>Y5,base32upper:()=>W5,base32z:()=>e8});var Ks,W5,G5,Y5,J5,X5,Z5,Q5,e8,Td=gt(()=>{yn();Ks=Dt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),W5=Dt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),G5=Dt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Y5=Dt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),J5=Dt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),X5=Dt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Z5=Dt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Q5=Dt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),e8=Dt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var kd={};St(kd,{base36:()=>Uo,base36upper:()=>t8});var Uo,t8,Pc=gt(()=>{yn();Uo=Vi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),t8=Vi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Cd={};St(Cd,{base58btc:()=>jn,base58flickr:()=>r8});var jn,r8,Dd=gt(()=>{yn();jn=Vi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),r8=Vi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Id={};St(Id,{base64:()=>n8,base64pad:()=>i8,base64url:()=>jm,base64urlpad:()=>o8});var n8,i8,jm,o8,Od=gt(()=>{yn();n8=Dt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),i8=Dt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),jm=Dt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),o8=Dt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Pd={};St(Pd,{base256emoji:()=>u8});function f8(r){return r.reduce((e,t)=>(e+=s8[t],e),"")}function c8(r){let e=[];for(let t of r){let n=a8[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var Km,s8,a8,u8,Vm=gt(()=>{yn();Km=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),s8=Km.reduce((r,e,t)=>(r[t]=e,r),[]),a8=Km.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(f8,"encode");o(c8,"decode");u8=js({prefix:"\u{1F680}",name:"base256emoji",encode:f8,decode:c8})});function Ym(r,e,t){e=e||[],t=t||0;for(var n=t;r>=p8;)e[t++]=r&255|Wm,r/=128;for(;r&h8;)e[t++]=r&255|Wm,r>>>=7;return e[t]=r|0,Ym.bytes=t-n+1,e}function Nd(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw Nd.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&Gm)<<i:(a&Gm)*Math.pow(2,i),i+=7}while(a>=b8);return Nd.bytes=s-n,t}var l8,Wm,d8,h8,p8,m8,b8,Gm,g8,v8,y8,x8,w8,_8,E8,S8,M8,A8,T8,k8,of,Jm=gt(()=>{l8=Ym,Wm=128,d8=127,h8=~d8,p8=Math.pow(2,31);o(Ym,"encode");m8=Nd,b8=128,Gm=127;o(Nd,"read");g8=Math.pow(2,7),v8=Math.pow(2,14),y8=Math.pow(2,21),x8=Math.pow(2,28),w8=Math.pow(2,35),_8=Math.pow(2,42),E8=Math.pow(2,49),S8=Math.pow(2,56),M8=Math.pow(2,63),A8=o(function(r){return r<g8?1:r<v8?2:r<y8?3:r<x8?4:r<w8?5:r<_8?6:r<E8?7:r<S8?8:r<M8?9:10},"length"),T8={encode:l8,decode:m8,encodingLength:A8},k8=T8,of=k8});var Ws={};St(Ws,{decode:()=>Vs,encodeTo:()=>Fo,encodingLength:()=>$o});var Vs,Fo,$o,Nc=gt(()=>{Jm();Vs=o(r=>[of.decode(r),of.decode.bytes],"decode"),Fo=o((r,e,t=0)=>(of.encode(r,e,t),e),"encodeTo"),$o=o(r=>of.encodingLength(r),"encodingLength")});var qo={};St(qo,{Digest:()=>Wi,create:()=>Kn,decode:()=>sf,equals:()=>Rd});var Kn,sf,Rd,Wi,Ho=gt(()=>{Ki();Nc();Kn=o((r,e)=>{let t=e.byteLength,n=$o(r),i=n+$o(t),s=new Uint8Array(i+t);return Fo(r,s,0),Fo(t,s,n),s.set(e,i),new Wi(r,t,e,s)},"create"),sf=o(r=>{let e=en(r),[t,n]=Vs(e),[i,s]=Vs(e.subarray(n)),a=e.subarray(n+s);if(a.byteLength!==i)throw new Error("Incorrect length");return new Wi(t,i,a,e)},"decode"),Rd=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&vd(r.bytes,e.bytes),"equals"),Wi=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Wi,"Digest")});var Lc={};St(Lc,{Hasher:()=>af,from:()=>Rc});var Rc,af,Ld=gt(()=>{Ho();Rc=o(({name:r,code:e,encode:t})=>new af(r,e,t),"from"),af=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Kn(this.code,t):t.then(n=>Kn(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(af,"Hasher")});var Bd={};St(Bd,{sha256:()=>zo,sha512:()=>C8});var Xm,zo,C8,ff=gt(()=>{Ld();Xm=o(r=>e=>Z(void 0,null,function*(){return new Uint8Array(yield crypto.subtle.digest(r,e))}),"sha"),zo=Rc({name:"sha2-256",code:18,encode:Xm("SHA-256")}),C8=Rc({name:"sha2-512",code:19,encode:Xm("SHA-512")})});var Ud={};St(Ud,{identity:()=>Bc});var Zm,D8,Qm,I8,Bc,Fd=gt(()=>{Ki();Ho();Zm=0,D8="identity",Qm=en,I8=o(r=>Kn(Zm,Qm(r)),"digest"),Bc={code:Zm,name:D8,encode:Qm,digest:I8}});var $d={};St($d,{code:()=>P8,decode:()=>R8,encode:()=>N8,name:()=>O8});var O8,P8,N8,R8,e1=gt(()=>{Ki();O8="raw",P8=85,N8=o(r=>en(r),"encode"),R8=o(r=>en(r),"decode")});var qd={};St(qd,{code:()=>F8,decode:()=>q8,encode:()=>$8,name:()=>U8});var L8,B8,U8,F8,$8,q8,t1=gt(()=>{L8=new TextEncoder,B8=new TextDecoder,U8="json",F8=512,$8=o(r=>L8.encode(JSON.stringify(r)),"encode"),q8=o(r=>JSON.parse(B8.decode(r)),"decode")});var Pe,H8,z8,j8,cf,K8,r1,n1,Uc,Fc,V8,W8,G8,Vn=gt(()=>{Nc();Ho();Dd();Td();Ki();Pe=class{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:Fc,byteLength:Fc,code:Uc,version:Uc,multihash:Uc,bytes:Uc,_baseCache:Fc,asCID:Fc})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==cf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==K8)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Pe.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Kn(e,t);return Pe.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&Rd(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return z8(t,i,e||jn.encoder);default:return j8(t,i,e||Ks.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return W8(/^0\.0/,G8),!!(e&&(e[n1]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof Pe)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Pe(t,n,i,s||r1(t,n,i.bytes))}else if(e!=null&&e[n1]===!0){let{version:t,multihash:n,code:i}=e,s=sf(n);return Pe.create(t,i,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==cf)throw new Error(`Version 0 CID must use dag-pb (code: ${cf}) block encoding`);return new Pe(e,t,n,n.bytes)}case 1:{let i=r1(e,t,n.bytes);return new Pe(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Pe.create(0,cf,e)}static createV1(e,t){return Pe.create(1,e,t)}static decode(e){let[t,n]=Pe.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Pe.inspectBytes(e),n=t.size-t.multihashSize,i=en(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),a=new Wi(t.multihashCode,t.digestSize,s,i);return[t.version===0?Pe.createV0(a):Pe.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[x,A]=Vs(e.subarray(t));return t+=A,x},"next"),i=n(),s=cf;if(i===18?(i=0,t=0):i===1&&(s=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=t,f=n(),u=n(),p=t+u,b=p-a;return{version:i,codec:s,multihashCode:f,digestSize:u,multihashSize:b,size:p}}static parse(e,t){let[n,i]=H8(e,t),s=Pe.decode(i);return s._baseCache.set(n,e),s}};o(Pe,"CID");H8=o((r,e)=>{switch(r[0]){case"Q":{let t=e||jn;return[jn.prefix,t.decode(`${jn.prefix}${r}`)]}case jn.prefix:{let t=e||jn;return[jn.prefix,t.decode(r)]}case Ks.prefix:{let t=e||Ks;return[Ks.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},"parseCIDtoBytes"),z8=o((r,e,t)=>{let{prefix:n}=t;if(n!==jn.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return i},"toStringV0"),j8=o((r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let s=t.encode(r);return e.set(n,s),s}else return i},"toStringV1"),cf=112,K8=18,r1=o((r,e,t)=>{let n=$o(r),i=n+$o(e),s=new Uint8Array(i+t.byteLength);return Fo(r,s,0),Fo(e,s,n),s.set(t,i),s},"encodeCID"),n1=Symbol.for("@ipld/js-cid/CID"),Uc={writable:!1,configurable:!1,enumerable:!0},Fc={writable:!1,enumerable:!1,configurable:!1},V8="0.0.0-dev",W8=o((r,e)=>{if(r.test(V8))console.warn(e);else throw new Error(e)},"deprecate"),G8=`CID.isCID(v) is deprecated and will be removed in the next major release.
1
+ "use strict";var f5=Object.create;var zs=Object.defineProperty,c5=Object.defineProperties,u5=Object.getOwnPropertyDescriptor,l5=Object.getOwnPropertyDescriptors,d5=Object.getOwnPropertyNames,Tc=Object.getOwnPropertySymbols,Dm=Object.getPrototypeOf,hd=Object.prototype.hasOwnProperty,Im=Object.prototype.propertyIsEnumerable,h5=Reflect.get;var pd=Math.pow,Cm=(r,e,t)=>e in r?zs(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,re=(r,e)=>{for(var t in e||(e={}))hd.call(e,t)&&Cm(r,t,e[t]);if(Tc)for(var t of Tc(e))Im.call(e,t)&&Cm(r,t,e[t]);return r},Te=(r,e)=>c5(r,l5(e)),o=(r,e)=>zs(r,"name",{value:e,configurable:!0});var Om=(r,e)=>{var t={};for(var n in r)hd.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&Tc)for(var n of Tc(r))e.indexOf(n)<0&&Im.call(r,n)&&(t[n]=r[n]);return t};var gt=(r,e)=>()=>(r&&(e=r(r=0)),e);var me=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),St=(r,e)=>{for(var t in e)zs(r,t,{get:e[t],enumerable:!0})},Pm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d5(e))!hd.call(r,i)&&i!==t&&zs(r,i,{get:()=>e[i],enumerable:!(n=u5(e,i))||n.enumerable});return r};var at=(r,e,t)=>(t=r!=null?f5(Dm(r)):{},Pm(e||!r||!r.__esModule?zs(t,"default",{value:r,enumerable:!0}):t,r)),tf=r=>Pm(zs({},"__esModule",{value:!0}),r);var md=(r,e,t)=>h5(Dm(r),t,e);var Z=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{f(t.next(u))}catch(p){i(p)}},a=u=>{try{f(t.throw(u))}catch(p){i(p)}},f=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);f((t=t.apply(r,e)).next())});var Bm={};St(Bm,{concat:()=>vn});function vn(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}var gd=gt(()=>{o(vn,"concat")});function O5(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var s=r.charAt(i),a=s.charCodeAt(0);if(t[a]!==255)throw new TypeError(s+" is ambiguous");t[a]=i}var f=r.length,u=r.charAt(0),p=Math.log(f)/Math.log(256),b=Math.log(256)/Math.log(f);function x(T){if(T instanceof Uint8Array||(ArrayBuffer.isView(T)?T=new Uint8Array(T.buffer,T.byteOffset,T.byteLength):Array.isArray(T)&&(T=Uint8Array.from(T))),!(T instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(T.length===0)return"";for(var k=0,$=0,C=0,B=T.length;C!==B&&T[C]===0;)C++,k++;for(var z=(B-C)*b+1>>>0,H=new Uint8Array(z);C!==B;){for(var X=T[C],U=0,L=z-1;(X!==0||U<$)&&L!==-1;L--,U++)X+=256*H[L]>>>0,H[L]=X%f>>>0,X=X/f>>>0;if(X!==0)throw new Error("Non-zero carry");$=U,C++}for(var F=z-$;F!==z&&H[F]===0;)F++;for(var ne=u.repeat(k);F<z;++F)ne+=r.charAt(H[F]);return ne}o(x,"encode");function A(T){if(typeof T!="string")throw new TypeError("Expected String");if(T.length===0)return new Uint8Array;var k=0;if(T[k]!==" "){for(var $=0,C=0;T[k]===u;)$++,k++;for(var B=(T.length-k)*p+1>>>0,z=new Uint8Array(B);T[k];){var H=t[T.charCodeAt(k)];if(H===255)return;for(var X=0,U=B-1;(H!==0||X<C)&&U!==-1;U--,X++)H+=f*z[U]>>>0,z[U]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");C=X,k++}if(T[k]!==" "){for(var L=B-C;L!==B&&z[L]===0;)L++;for(var F=new Uint8Array($+(B-L)),ne=$;L!==B;)F[ne++]=z[L++];return F}}}o(A,"decodeUnsafe");function O(T){var k=A(T);if(k)return k;throw new Error(`Non-${e} character`)}return o(O,"decode"),{encode:x,decodeUnsafe:A,decode:O}}var P5,N5,Um,Fm=gt(()=>{o(O5,"base");P5=O5,N5=P5,Um=N5});var nf={};St(nf,{coerce:()=>en,empty:()=>$m,equals:()=>vd,fromHex:()=>L5,fromString:()=>yd,isBinary:()=>B5,toHex:()=>R5,toString:()=>xd});var $m,R5,L5,vd,en,B5,yd,xd,Ki=gt(()=>{$m=new Uint8Array(0),R5=o(r=>r.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),"toHex"),L5=o(r=>{let e=r.match(/../g);return e?new Uint8Array(e.map(t=>parseInt(t,16))):$m},"fromHex"),vd=o((r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},"equals"),en=o(r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),B5=o(r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),"isBinary"),yd=o(r=>new TextEncoder().encode(r),"fromString"),xd=o(r=>new TextDecoder().decode(r),"toString")});var Cc,Dc,Ic,qm,Oc,Ks,Vi,U5,F5,Dt,yn=gt(()=>{Fm();Ki();Cc=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}};o(Cc,"Encoder");Dc=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return qm(this,e)}};o(Dc,"Decoder");Ic=class{constructor(e){this.decoders=e}or(e){return qm(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};o(Ic,"ComposedDecoder");qm=o((r,e)=>new Ic(re(re({},r.decoders||{[r.prefix]:r}),e.decoders||{[e.prefix]:e})),"or"),Oc=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Cc(e,t,n),this.decoder=new Dc(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};o(Oc,"Codec");Ks=o(({name:r,prefix:e,encode:t,decode:n})=>new Oc(r,e,t,n),"from"),Vi=o(({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=Um(t,e);return Ks({prefix:r,name:e,encode:n,decode:s=>en(i(s))})},"baseX"),U5=o((r,e,t,n)=>{let i={};for(let b=0;b<e.length;++b)i[e[b]]=b;let s=r.length;for(;r[s-1]==="=";)--s;let a=new Uint8Array(s*t/8|0),f=0,u=0,p=0;for(let b=0;b<s;++b){let x=i[r[b]];if(x===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<t|x,f+=t,f>=8&&(f-=8,a[p++]=255&u>>f)}if(f>=t||255&u<<8-f)throw new SyntaxError("Unexpected end of data");return a},"decode"),F5=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",a=0,f=0;for(let u=0;u<r.length;++u)for(f=f<<8|r[u],a+=8;a>t;)a-=t,s+=e[i&f>>a];if(a&&(s+=e[i&f<<t-a]),n)for(;s.length*t&7;)s+="=";return s},"encode"),Dt=o(({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ks({prefix:e,name:r,encode(i){return F5(i,n,t)},decode(i){return U5(i,n,t,r)}}),"rfc4648")});var wd={};St(wd,{identity:()=>$5});var $5,Hm=gt(()=>{yn();Ki();$5=Ks({prefix:"\0",name:"identity",encode:r=>xd(r),decode:r=>yd(r)})});var _d={};St(_d,{base2:()=>q5});var q5,zm=gt(()=>{yn();q5=Dt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var Ed={};St(Ed,{base8:()=>H5});var H5,jm=gt(()=>{yn();H5=Dt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var Sd={};St(Sd,{base10:()=>z5});var z5,Km=gt(()=>{yn();z5=Vi({prefix:"9",name:"base10",alphabet:"0123456789"})});var Md={};St(Md,{base16:()=>j5,base16upper:()=>K5});var j5,K5,Vm=gt(()=>{yn();j5=Dt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),K5=Dt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var Ad={};St(Ad,{base32:()=>Vs,base32hex:()=>Y5,base32hexpad:()=>X5,base32hexpadupper:()=>Z5,base32hexupper:()=>J5,base32pad:()=>W5,base32padupper:()=>G5,base32upper:()=>V5,base32z:()=>Q5});var Vs,V5,W5,G5,Y5,J5,X5,Z5,Q5,Td=gt(()=>{yn();Vs=Dt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),V5=Dt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),W5=Dt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),G5=Dt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Y5=Dt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),J5=Dt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),X5=Dt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Z5=Dt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Q5=Dt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var kd={};St(kd,{base36:()=>Uo,base36upper:()=>e8});var Uo,e8,Pc=gt(()=>{yn();Uo=Vi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),e8=Vi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var Cd={};St(Cd,{base58btc:()=>jn,base58flickr:()=>t8});var jn,t8,Dd=gt(()=>{yn();jn=Vi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),t8=Vi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var Id={};St(Id,{base64:()=>r8,base64pad:()=>n8,base64url:()=>Wm,base64urlpad:()=>i8});var r8,n8,Wm,i8,Od=gt(()=>{yn();r8=Dt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),n8=Dt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Wm=Dt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),i8=Dt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var Pd={};St(Pd,{base256emoji:()=>c8});function a8(r){return r.reduce((e,t)=>(e+=o8[t],e),"")}function f8(r){let e=[];for(let t of r){let n=s8[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var Gm,o8,s8,c8,Ym=gt(()=>{yn();Gm=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),o8=Gm.reduce((r,e,t)=>(r[t]=e,r),[]),s8=Gm.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);o(a8,"encode");o(f8,"decode");c8=Ks({prefix:"\u{1F680}",name:"base256emoji",encode:a8,decode:f8})});function Zm(r,e,t){e=e||[],t=t||0;for(var n=t;r>=h8;)e[t++]=r&255|Jm,r/=128;for(;r&d8;)e[t++]=r&255|Jm,r>>>=7;return e[t]=r|0,Zm.bytes=t-n+1,e}function Nd(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw Nd.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&Xm)<<i:(a&Xm)*Math.pow(2,i),i+=7}while(a>=m8);return Nd.bytes=s-n,t}var u8,Jm,l8,d8,h8,p8,m8,Xm,b8,g8,v8,y8,x8,w8,_8,E8,S8,M8,A8,T8,of,Qm=gt(()=>{u8=Zm,Jm=128,l8=127,d8=~l8,h8=Math.pow(2,31);o(Zm,"encode");p8=Nd,m8=128,Xm=127;o(Nd,"read");b8=Math.pow(2,7),g8=Math.pow(2,14),v8=Math.pow(2,21),y8=Math.pow(2,28),x8=Math.pow(2,35),w8=Math.pow(2,42),_8=Math.pow(2,49),E8=Math.pow(2,56),S8=Math.pow(2,63),M8=o(function(r){return r<b8?1:r<g8?2:r<v8?3:r<y8?4:r<x8?5:r<w8?6:r<_8?7:r<E8?8:r<S8?9:10},"length"),A8={encode:u8,decode:p8,encodingLength:M8},T8=A8,of=T8});var Gs={};St(Gs,{decode:()=>Ws,encodeTo:()=>Fo,encodingLength:()=>$o});var Ws,Fo,$o,Nc=gt(()=>{Qm();Ws=o(r=>[of.decode(r),of.decode.bytes],"decode"),Fo=o((r,e,t=0)=>(of.encode(r,e,t),e),"encodeTo"),$o=o(r=>of.encodingLength(r),"encodingLength")});var qo={};St(qo,{Digest:()=>Wi,create:()=>Kn,decode:()=>sf,equals:()=>Rd});var Kn,sf,Rd,Wi,Ho=gt(()=>{Ki();Nc();Kn=o((r,e)=>{let t=e.byteLength,n=$o(r),i=n+$o(t),s=new Uint8Array(i+t);return Fo(r,s,0),Fo(t,s,n),s.set(e,i),new Wi(r,t,e,s)},"create"),sf=o(r=>{let e=en(r),[t,n]=Ws(e),[i,s]=Ws(e.subarray(n)),a=e.subarray(n+s);if(a.byteLength!==i)throw new Error("Incorrect length");return new Wi(t,i,a,e)},"decode"),Rd=o((r,e)=>r===e?!0:r.code===e.code&&r.size===e.size&&vd(r.bytes,e.bytes),"equals"),Wi=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};o(Wi,"Digest")});var Lc={};St(Lc,{Hasher:()=>af,from:()=>Rc});var Rc,af,Ld=gt(()=>{Ho();Rc=o(({name:r,code:e,encode:t})=>new af(r,e,t),"from"),af=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Kn(this.code,t):t.then(n=>Kn(this.code,n))}else throw Error("Unknown type, must be binary type")}};o(af,"Hasher")});var Bd={};St(Bd,{sha256:()=>zo,sha512:()=>k8});var e1,zo,k8,ff=gt(()=>{Ld();e1=o(r=>e=>Z(void 0,null,function*(){return new Uint8Array(yield crypto.subtle.digest(r,e))}),"sha"),zo=Rc({name:"sha2-256",code:18,encode:e1("SHA-256")}),k8=Rc({name:"sha2-512",code:19,encode:e1("SHA-512")})});var Ud={};St(Ud,{identity:()=>Bc});var t1,C8,r1,D8,Bc,Fd=gt(()=>{Ki();Ho();t1=0,C8="identity",r1=en,D8=o(r=>Kn(t1,r1(r)),"digest"),Bc={code:t1,name:C8,encode:r1,digest:D8}});var $d={};St($d,{code:()=>O8,decode:()=>N8,encode:()=>P8,name:()=>I8});var I8,O8,P8,N8,n1=gt(()=>{Ki();I8="raw",O8=85,P8=o(r=>en(r),"encode"),N8=o(r=>en(r),"decode")});var qd={};St(qd,{code:()=>U8,decode:()=>$8,encode:()=>F8,name:()=>B8});var R8,L8,B8,U8,F8,$8,i1=gt(()=>{R8=new TextEncoder,L8=new TextDecoder,B8="json",U8=512,F8=o(r=>R8.encode(JSON.stringify(r)),"encode"),$8=o(r=>JSON.parse(L8.decode(r)),"decode")});var Pe,q8,H8,z8,cf,j8,o1,s1,Uc,Fc,K8,V8,W8,Vn=gt(()=>{Nc();Ho();Dd();Td();Ki();Pe=class{constructor(e,t,n,i){this.code=t,this.version=e,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:Fc,byteLength:Fc,code:Uc,version:Uc,multihash:Uc,bytes:Uc,_baseCache:Fc,asCID:Fc})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==cf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==j8)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Pe.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Kn(e,t);return Pe.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&Rd(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:i}=this;switch(n){case 0:return H8(t,i,e||jn.encoder);default:return z8(t,i,e||Vs.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return V8(/^0\.0/,W8),!!(e&&(e[s1]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof Pe)return e;if(e!=null&&e.asCID===e){let{version:t,code:n,multihash:i,bytes:s}=e;return new Pe(t,n,i,s||o1(t,n,i.bytes))}else if(e!=null&&e[s1]===!0){let{version:t,multihash:n,code:i}=e,s=sf(n);return Pe.create(t,i,s)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==cf)throw new Error(`Version 0 CID must use dag-pb (code: ${cf}) block encoding`);return new Pe(e,t,n,n.bytes)}case 1:{let i=o1(e,t,n.bytes);return new Pe(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return Pe.create(0,cf,e)}static createV1(e,t){return Pe.create(1,e,t)}static decode(e){let[t,n]=Pe.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Pe.inspectBytes(e),n=t.size-t.multihashSize,i=en(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=i.subarray(t.multihashSize-t.digestSize),a=new Wi(t.multihashCode,t.digestSize,s,i);return[t.version===0?Pe.createV0(a):Pe.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=o(()=>{let[x,A]=Ws(e.subarray(t));return t+=A,x},"next"),i=n(),s=cf;if(i===18?(i=0,t=0):i===1&&(s=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let a=t,f=n(),u=n(),p=t+u,b=p-a;return{version:i,codec:s,multihashCode:f,digestSize:u,multihashSize:b,size:p}}static parse(e,t){let[n,i]=q8(e,t),s=Pe.decode(i);return s._baseCache.set(n,e),s}};o(Pe,"CID");q8=o((r,e)=>{switch(r[0]){case"Q":{let t=e||jn;return[jn.prefix,t.decode(`${jn.prefix}${r}`)]}case jn.prefix:{let t=e||jn;return[jn.prefix,t.decode(r)]}case Vs.prefix:{let t=e||Vs;return[Vs.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},"parseCIDtoBytes"),H8=o((r,e,t)=>{let{prefix:n}=t;if(n!==jn.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return i},"toStringV0"),z8=o((r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let s=t.encode(r);return e.set(n,s),s}else return i},"toStringV1"),cf=112,j8=18,o1=o((r,e,t)=>{let n=$o(r),i=n+$o(e),s=new Uint8Array(i+t.byteLength);return Fo(r,s,0),Fo(e,s,n),s.set(t,i),s},"encodeCID"),s1=Symbol.for("@ipld/js-cid/CID"),Uc={writable:!1,configurable:!1,enumerable:!0},Fc={writable:!1,enumerable:!1,configurable:!1},K8="0.0.0-dev",V8=o((r,e)=>{if(r.test(K8))console.warn(e);else throw new Error(e)},"deprecate"),W8=`CID.isCID(v) is deprecated and will be removed in the next major release.
2
2
  Following code pattern:
3
3
 
4
4
  if (CID.isCID(value)) {
@@ -12,11 +12,11 @@ if (cid) {
12
12
  // Make sure to use cid instead of value
13
13
  doSomethingWithCID(cid)
14
14
  }
15
- `});var Hd=gt(()=>{Vn();Nc();Ki();Ld();Ho()});var i1={};St(i1,{CID:()=>Pe,bases:()=>Gs,bytes:()=>nf,codecs:()=>J8,digest:()=>qo,hasher:()=>Lc,hashes:()=>Y8,varint:()=>Ws});var Gs,Y8,J8,$c=gt(()=>{Fm();$m();qm();Hm();zm();Td();Pc();Dd();Od();Vm();ff();Fd();e1();t1();Hd();Gs=re(re(re(re(re(re(re(re(re(re({},wd),_d),Ed),Sd),Md),Ad),kd),Cd),Id),Pd),Y8=re(re({},Bd),Ud),J8={raw:$d,json:qd}});function s1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var o1,zd,X8,qc,jd=gt(()=>{$c();o(s1,"createCodec");o1=s1("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),zd=s1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),X8=re({utf8:o1,"utf-8":o1,hex:Gs.base16,latin1:zd,ascii:zd,binary:zd},Gs),qc=X8});var a1={};St(a1,{fromString:()=>Lt});function Lt(r,e="utf8"){let t=qc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}var Hc=gt(()=>{jd();o(Lt,"fromString")});var f1={};St(f1,{toString:()=>It});function It(r,e="utf8"){let t=qc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var uf=gt(()=>{jd();o(It,"toString")});var c1=me(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});function Z8(r,e){var t=r>>>16&65535,n=r&65535,i=e>>>16&65535,s=e&65535;return n*s+(t*s+n*i<<16>>>0)|0}o(Z8,"imulShim");Ir.mul=Math.imul||Z8;function Q8(r,e){return r+e|0}o(Q8,"add");Ir.add=Q8;function e_(r,e){return r-e|0}o(e_,"sub");Ir.sub=e_;function t_(r,e){return r<<e|r>>>32-e}o(t_,"rotl");Ir.rotl=t_;function r_(r,e){return r<<32-e|r>>>e}o(r_,"rotr");Ir.rotr=r_;function n_(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(n_,"isIntegerShim");Ir.isInteger=Number.isInteger||n_;Ir.MAX_SAFE_INTEGER=9007199254740991;Ir.isSafeInteger=function(r){return Ir.isInteger(r)&&r>=-Ir.MAX_SAFE_INTEGER&&r<=Ir.MAX_SAFE_INTEGER}});var jo=me(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});var u1=c1();function i_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(i_,"readInt16BE");it.readInt16BE=i_;function o_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(o_,"readUint16BE");it.readUint16BE=o_;function s_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(s_,"readInt16LE");it.readInt16LE=s_;function a_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(a_,"readUint16LE");it.readUint16LE=a_;function l1(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}o(l1,"writeUint16BE");it.writeUint16BE=l1;it.writeInt16BE=l1;function d1(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}o(d1,"writeUint16LE");it.writeUint16LE=d1;it.writeInt16LE=d1;function Kd(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(Kd,"readInt32BE");it.readInt32BE=Kd;function Vd(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(Vd,"readUint32BE");it.readUint32BE=Vd;function Wd(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(Wd,"readInt32LE");it.readInt32LE=Wd;function Gd(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(Gd,"readUint32LE");it.readUint32LE=Gd;function jc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}o(jc,"writeUint32BE");it.writeUint32BE=jc;it.writeInt32BE=jc;function Kc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}o(Kc,"writeUint32LE");it.writeUint32LE=Kc;it.writeInt32LE=Kc;function f_(r,e){e===void 0&&(e=0);var t=Kd(r,e),n=Kd(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(f_,"readInt64BE");it.readInt64BE=f_;function c_(r,e){e===void 0&&(e=0);var t=Vd(r,e),n=Vd(r,e+4);return t*4294967296+n}o(c_,"readUint64BE");it.readUint64BE=c_;function u_(r,e){e===void 0&&(e=0);var t=Wd(r,e),n=Wd(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(u_,"readInt64LE");it.readInt64LE=u_;function l_(r,e){e===void 0&&(e=0);var t=Gd(r,e),n=Gd(r,e+4);return n*4294967296+t}o(l_,"readUint64LE");it.readUint64LE=l_;function h1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),jc(r/4294967296>>>0,e,t),jc(r>>>0,e,t+4),e}o(h1,"writeUint64BE");it.writeUint64BE=h1;it.writeInt64BE=h1;function p1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Kc(r>>>0,e,t),Kc(r/4294967296>>>0,e,t+4),e}o(p1,"writeUint64LE");it.writeUint64LE=p1;it.writeInt64LE=p1;function d_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=r/8+t-1;s>=t;s--)n+=e[s]*i,i*=256;return n}o(d_,"readUintBE");it.readUintBE=d_;function h_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=t;s<t+r/8;s++)n+=e[s]*i,i*=256;return n}o(h_,"readUintLE");it.readUintLE=h_;function p_(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!u1.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,s=r/8+n-1;s>=n;s--)t[s]=e/i&255,i*=256;return t}o(p_,"writeUintBE");it.writeUintBE=p_;function m_(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!u1.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s<n+r/8;s++)t[s]=e/i&255,i*=256;return t}o(m_,"writeUintLE");it.writeUintLE=m_;function b_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(b_,"readFloat32BE");it.readFloat32BE=b_;function g_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(g_,"readFloat32LE");it.readFloat32LE=g_;function v_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(v_,"readFloat64BE");it.readFloat64BE=v_;function y_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(y_,"readFloat64LE");it.readFloat64LE=y_;function x_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}o(x_,"writeFloat32BE");it.writeFloat32BE=x_;function w_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}o(w_,"writeFloat32LE");it.writeFloat32LE=w_;function __(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}o(__,"writeFloat64BE");it.writeFloat64BE=__;function E_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}o(E_,"writeFloat64LE");it.writeFloat64LE=E_});var tn=me(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});function S_(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(S_,"wipe");Yd.wipe=S_});var b1=me(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var Wc=jo(),Vc=tn();Gi.DIGEST_LENGTH=32;Gi.BLOCK_SIZE=64;var m1=function(){function r(){this.digestLength=Gi.DIGEST_LENGTH,this.blockSize=Gi.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o(r,"SHA256"),r.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){Vc.wipe(this._buffer),Vc.wipe(this._temp),this.reset()},r.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Jd(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Jd(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,s=t<<3,a=t%64<56?64:128;this._buffer[n]=128;for(var f=n+1;f<a-8;f++)this._buffer[f]=0;Wc.writeUint32BE(i,this._buffer,a-8),Wc.writeUint32BE(s,this._buffer,a-4),Jd(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/4;f++)Wc.writeUint32BE(this._state[f],e,f*4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},r.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){Vc.wipe(e.state),e.buffer&&Vc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Gi.SHA256=m1;var M_=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Jd(r,e,t,n,i){for(;i>=64;){for(var s=e[0],a=e[1],f=e[2],u=e[3],p=e[4],b=e[5],x=e[6],A=e[7],O=0;O<16;O++){var T=n+O*4;r[O]=Wc.readUint32BE(t,T)}for(var O=16;O<64;O++){var k=r[O-2],$=(k>>>17|k<<32-17)^(k>>>19|k<<32-19)^k>>>10;k=r[O-15];var C=(k>>>7|k<<32-7)^(k>>>18|k<<32-18)^k>>>3;r[O]=($+r[O-7]|0)+(C+r[O-16]|0)}for(var O=0;O<64;O++){var $=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&b^~p&x)|0)+(A+(M_[O]+r[O]|0)|0)|0,C=((s>>>2|s<<32-2)^(s>>>13|s<<32-13)^(s>>>22|s<<32-22))+(s&a^s&f^a&f)|0;A=x,x=b,b=p,p=u+$|0,u=f,f=a,a=s,s=$+C|0}e[0]+=s,e[1]+=a,e[2]+=f,e[3]+=u,e[4]+=p,e[5]+=b,e[6]+=x,e[7]+=A,n+=64,i-=64}return n}o(Jd,"hashBlocks");function A_(r){var e=new m1;e.update(r);var t=e.digest();return e.clean(),t}o(A_,"hash");Gi.hash=A_});var Xd=me((ZP,Gc)=>{(function(){"use strict";var r="input is invalid type",e="finalize already called",t=typeof window=="object",n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var i=!t&&typeof self=="object",s=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?n=global:i&&(n=self);var a=!n.JS_SHA3_NO_COMMON_JS&&typeof Gc=="object"&&Gc.exports,f=typeof define=="function"&&define.amd,u=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",p="0123456789abcdef".split(""),b=[31,7936,2031616,520093696],x=[4,1024,262144,67108864],A=[1,256,65536,16777216],O=[6,1536,393216,100663296],T=[0,8,16,24],k=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],$=[224,256,384,512],C=[128,256],B=["hex","buffer","arrayBuffer","array","digest"],z={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(M){return Object.prototype.toString.call(M)==="[object Array]"}),u&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(M){return typeof M=="object"&&M.buffer&&M.buffer.constructor===ArrayBuffer});for(var H=o(function(M,K,J){return function(N){return new g(M,K,M).update(N)[J]()}},"createOutputMethod"),X=o(function(M,K,J){return function(N,R){return new g(M,K,R).update(N)[J]()}},"createShakeOutputMethod"),U=o(function(M,K,J){return function(N,R,V,W){return c["cshake"+M].update(N,R,V,W)[J]()}},"createCshakeOutputMethod"),L=o(function(M,K,J){return function(N,R,V,W){return c["kmac"+M].update(N,R,V,W)[J]()}},"createKmacOutputMethod"),F=o(function(M,K,J,N){for(var R=0;R<B.length;++R){var V=B[R];M[V]=K(J,N,V)}return M},"createOutputMethods"),ne=o(function(M,K){var J=H(M,K,"hex");return J.create=function(){return new g(M,K,M)},J.update=function(N){return J.create().update(N)},F(J,H,M,K)},"createMethod"),D=o(function(M,K){var J=X(M,K,"hex");return J.create=function(N){return new g(M,K,N)},J.update=function(N,R){return J.create(R).update(N)},F(J,X,M,K)},"createShakeMethod"),l=o(function(M,K){var J=z[M],N=U(M,K,"hex");return N.create=function(R,V,W){return!V&&!W?c["shake"+M].create(R):new g(M,K,R).bytepad([V,W],J)},N.update=function(R,V,W,ee){return N.create(V,W,ee).update(R)},F(N,U,M,K)},"createCshakeMethod"),v=o(function(M,K){var J=z[M],N=L(M,K,"hex");return N.create=function(R,V,W){return new S(M,K,V).bytepad(["KMAC",W],J).bytepad([R],J)},N.update=function(R,V,W,ee){return N.create(R,W,ee).update(V)},F(N,L,M,K)},"createKmacMethod"),h=[{name:"keccak",padding:A,bits:$,createMethod:ne},{name:"sha3",padding:O,bits:$,createMethod:ne},{name:"shake",padding:b,bits:C,createMethod:D},{name:"cshake",padding:x,bits:C,createMethod:l},{name:"kmac",padding:x,bits:C,createMethod:v}],c={},d=[],y=0;y<h.length;++y)for(var _=h[y],w=_.bits,m=0;m<w.length;++m){var E=_.name+"_"+w[m];if(d.push(E),c[E]=_.createMethod(w[m],_.padding),_.name!=="sha3"){var I=_.name+w[m];d.push(I),c[I]=c[E]}}function g(M,K,J){this.blocks=[],this.s=[],this.padding=K,this.outputBits=J,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(M<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var N=0;N<50;++N)this.s[N]=0}o(g,"Keccak"),g.prototype.update=function(M){if(this.finalized)throw new Error(e);var K,J=typeof M;if(J!=="string"){if(J==="object"){if(M===null)throw new Error(r);if(u&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!Array.isArray(M)&&(!u||!ArrayBuffer.isView(M)))throw new Error(r)}else throw new Error(r);K=!0}for(var N=this.blocks,R=this.byteCount,V=M.length,W=this.blockCount,ee=0,he=this.s,fe,Y;ee<V;){if(this.reset)for(this.reset=!1,N[0]=this.block,fe=1;fe<W+1;++fe)N[fe]=0;if(K)for(fe=this.start;ee<V&&fe<R;++ee)N[fe>>2]|=M[ee]<<T[fe++&3];else for(fe=this.start;ee<V&&fe<R;++ee)Y=M.charCodeAt(ee),Y<128?N[fe>>2]|=Y<<T[fe++&3]:Y<2048?(N[fe>>2]|=(192|Y>>6)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]):Y<55296||Y>=57344?(N[fe>>2]|=(224|Y>>12)<<T[fe++&3],N[fe>>2]|=(128|Y>>6&63)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]):(Y=65536+((Y&1023)<<10|M.charCodeAt(++ee)&1023),N[fe>>2]|=(240|Y>>18)<<T[fe++&3],N[fe>>2]|=(128|Y>>12&63)<<T[fe++&3],N[fe>>2]|=(128|Y>>6&63)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]);if(this.lastByteIndex=fe,fe>=R){for(this.start=fe-R,this.block=N[W],fe=0;fe<W;++fe)he[fe]^=N[fe];ie(he),this.reset=!0}else this.start=fe}return this},g.prototype.encode=function(M,K){var J=M&255,N=1,R=[J];for(M=M>>8,J=M&255;J>0;)R.unshift(J),M=M>>8,J=M&255,++N;return K?R.push(N):R.unshift(N),this.update(R),R.length},g.prototype.encodeString=function(M){var K,J=typeof M;if(J!=="string"){if(J==="object"){if(M===null)throw new Error(r);if(u&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!Array.isArray(M)&&(!u||!ArrayBuffer.isView(M)))throw new Error(r)}else throw new Error(r);K=!0}var N=0,R=M.length;if(K)N=R;else for(var V=0;V<M.length;++V){var W=M.charCodeAt(V);W<128?N+=1:W<2048?N+=2:W<55296||W>=57344?N+=3:(W=65536+((W&1023)<<10|M.charCodeAt(++V)&1023),N+=4)}return N+=this.encode(N*8),this.update(M),N},g.prototype.bytepad=function(M,K){for(var J=this.encode(K),N=0;N<M.length;++N)J+=this.encodeString(M[N]);var R=K-J%K,V=[];return V.length=R,this.update(V),this},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var M=this.blocks,K=this.lastByteIndex,J=this.blockCount,N=this.s;if(M[K>>2]|=this.padding[K&3],this.lastByteIndex===this.byteCount)for(M[0]=M[J],K=1;K<J+1;++K)M[K]=0;for(M[J-1]|=2147483648,K=0;K<J;++K)N[K]^=M[K];ie(N)}},g.prototype.toString=g.prototype.hex=function(){this.finalize();for(var M=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W="",ee;V<J;){for(R=0;R<M&&V<J;++R,++V)ee=K[R],W+=p[ee>>4&15]+p[ee&15]+p[ee>>12&15]+p[ee>>8&15]+p[ee>>20&15]+p[ee>>16&15]+p[ee>>28&15]+p[ee>>24&15];V%M===0&&(ie(K),R=0)}return N&&(ee=K[R],W+=p[ee>>4&15]+p[ee&15],N>1&&(W+=p[ee>>12&15]+p[ee>>8&15]),N>2&&(W+=p[ee>>20&15]+p[ee>>16&15])),W},g.prototype.arrayBuffer=function(){this.finalize();var M=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=this.outputBits>>3,ee;N?ee=new ArrayBuffer(J+1<<2):ee=new ArrayBuffer(W);for(var he=new Uint32Array(ee);V<J;){for(R=0;R<M&&V<J;++R,++V)he[V]=K[R];V%M===0&&ie(K)}return N&&(he[R]=K[R],ee=ee.slice(0,W)),ee},g.prototype.buffer=g.prototype.arrayBuffer,g.prototype.digest=g.prototype.array=function(){this.finalize();for(var M=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=[],ee,he;V<J;){for(R=0;R<M&&V<J;++R,++V)ee=V<<2,he=K[R],W[ee]=he&255,W[ee+1]=he>>8&255,W[ee+2]=he>>16&255,W[ee+3]=he>>24&255;V%M===0&&ie(K)}return N&&(ee=V<<2,he=K[R],W[ee]=he&255,N>1&&(W[ee+1]=he>>8&255),N>2&&(W[ee+2]=he>>16&255)),W};function S(M,K,J){g.call(this,M,K,J)}o(S,"Kmac"),S.prototype=new g,S.prototype.finalize=function(){return this.encode(this.outputBits,!0),g.prototype.finalize.call(this)};var ie=o(function(M){var K,J,N,R,V,W,ee,he,fe,Y,pe,Q,ce,q,se,be,ke,we,Oe,vr,te,G,P,j,ae,ue,le,ge,ft,Ee,ve,lt,De,Ne,Bn,Le,Be,Un,Ue,Fe,Fn,$e,qe,$n,He,ze,qn,je,Ke,Hn,Ve,We,zn,Ge,Ye,gn,mt,bt,Yr,Jr,Xr,Zr,Qr;for(N=0;N<48;N+=2)R=M[0]^M[10]^M[20]^M[30]^M[40],V=M[1]^M[11]^M[21]^M[31]^M[41],W=M[2]^M[12]^M[22]^M[32]^M[42],ee=M[3]^M[13]^M[23]^M[33]^M[43],he=M[4]^M[14]^M[24]^M[34]^M[44],fe=M[5]^M[15]^M[25]^M[35]^M[45],Y=M[6]^M[16]^M[26]^M[36]^M[46],pe=M[7]^M[17]^M[27]^M[37]^M[47],Q=M[8]^M[18]^M[28]^M[38]^M[48],ce=M[9]^M[19]^M[29]^M[39]^M[49],K=Q^(W<<1|ee>>>31),J=ce^(ee<<1|W>>>31),M[0]^=K,M[1]^=J,M[10]^=K,M[11]^=J,M[20]^=K,M[21]^=J,M[30]^=K,M[31]^=J,M[40]^=K,M[41]^=J,K=R^(he<<1|fe>>>31),J=V^(fe<<1|he>>>31),M[2]^=K,M[3]^=J,M[12]^=K,M[13]^=J,M[22]^=K,M[23]^=J,M[32]^=K,M[33]^=J,M[42]^=K,M[43]^=J,K=W^(Y<<1|pe>>>31),J=ee^(pe<<1|Y>>>31),M[4]^=K,M[5]^=J,M[14]^=K,M[15]^=J,M[24]^=K,M[25]^=J,M[34]^=K,M[35]^=J,M[44]^=K,M[45]^=J,K=he^(Q<<1|ce>>>31),J=fe^(ce<<1|Q>>>31),M[6]^=K,M[7]^=J,M[16]^=K,M[17]^=J,M[26]^=K,M[27]^=J,M[36]^=K,M[37]^=J,M[46]^=K,M[47]^=J,K=Y^(R<<1|V>>>31),J=pe^(V<<1|R>>>31),M[8]^=K,M[9]^=J,M[18]^=K,M[19]^=J,M[28]^=K,M[29]^=J,M[38]^=K,M[39]^=J,M[48]^=K,M[49]^=J,q=M[0],se=M[1],ze=M[11]<<4|M[10]>>>28,qn=M[10]<<4|M[11]>>>28,ge=M[20]<<3|M[21]>>>29,ft=M[21]<<3|M[20]>>>29,Jr=M[31]<<9|M[30]>>>23,Xr=M[30]<<9|M[31]>>>23,$e=M[40]<<18|M[41]>>>14,qe=M[41]<<18|M[40]>>>14,Ne=M[2]<<1|M[3]>>>31,Bn=M[3]<<1|M[2]>>>31,be=M[13]<<12|M[12]>>>20,ke=M[12]<<12|M[13]>>>20,je=M[22]<<10|M[23]>>>22,Ke=M[23]<<10|M[22]>>>22,Ee=M[33]<<13|M[32]>>>19,ve=M[32]<<13|M[33]>>>19,Zr=M[42]<<2|M[43]>>>30,Qr=M[43]<<2|M[42]>>>30,Ge=M[5]<<30|M[4]>>>2,Ye=M[4]<<30|M[5]>>>2,Le=M[14]<<6|M[15]>>>26,Be=M[15]<<6|M[14]>>>26,we=M[25]<<11|M[24]>>>21,Oe=M[24]<<11|M[25]>>>21,Hn=M[34]<<15|M[35]>>>17,Ve=M[35]<<15|M[34]>>>17,lt=M[45]<<29|M[44]>>>3,De=M[44]<<29|M[45]>>>3,j=M[6]<<28|M[7]>>>4,ae=M[7]<<28|M[6]>>>4,gn=M[17]<<23|M[16]>>>9,mt=M[16]<<23|M[17]>>>9,Un=M[26]<<25|M[27]>>>7,Ue=M[27]<<25|M[26]>>>7,vr=M[36]<<21|M[37]>>>11,te=M[37]<<21|M[36]>>>11,We=M[47]<<24|M[46]>>>8,zn=M[46]<<24|M[47]>>>8,$n=M[8]<<27|M[9]>>>5,He=M[9]<<27|M[8]>>>5,ue=M[18]<<20|M[19]>>>12,le=M[19]<<20|M[18]>>>12,bt=M[29]<<7|M[28]>>>25,Yr=M[28]<<7|M[29]>>>25,Fe=M[38]<<8|M[39]>>>24,Fn=M[39]<<8|M[38]>>>24,G=M[48]<<14|M[49]>>>18,P=M[49]<<14|M[48]>>>18,M[0]=q^~be&we,M[1]=se^~ke&Oe,M[10]=j^~ue&ge,M[11]=ae^~le&ft,M[20]=Ne^~Le&Un,M[21]=Bn^~Be&Ue,M[30]=$n^~ze&je,M[31]=He^~qn&Ke,M[40]=Ge^~gn&bt,M[41]=Ye^~mt&Yr,M[2]=be^~we&vr,M[3]=ke^~Oe&te,M[12]=ue^~ge&Ee,M[13]=le^~ft&ve,M[22]=Le^~Un&Fe,M[23]=Be^~Ue&Fn,M[32]=ze^~je&Hn,M[33]=qn^~Ke&Ve,M[42]=gn^~bt&Jr,M[43]=mt^~Yr&Xr,M[4]=we^~vr&G,M[5]=Oe^~te&P,M[14]=ge^~Ee&lt,M[15]=ft^~ve&De,M[24]=Un^~Fe&$e,M[25]=Ue^~Fn&qe,M[34]=je^~Hn&We,M[35]=Ke^~Ve&zn,M[44]=bt^~Jr&Zr,M[45]=Yr^~Xr&Qr,M[6]=vr^~G&q,M[7]=te^~P&se,M[16]=Ee^~lt&j,M[17]=ve^~De&ae,M[26]=Fe^~$e&Ne,M[27]=Fn^~qe&Bn,M[36]=Hn^~We&$n,M[37]=Ve^~zn&He,M[46]=Jr^~Zr&Ge,M[47]=Xr^~Qr&Ye,M[8]=G^~q&be,M[9]=P^~se&ke,M[18]=lt^~j&ue,M[19]=De^~ae&le,M[28]=$e^~Ne&Le,M[29]=qe^~Bn&Be,M[38]=We^~$n&ze,M[39]=zn^~He&qn,M[48]=Zr^~Ge&gn,M[49]=Qr^~Ye&mt,M[0]^=k[N],M[1]^=k[N+1]},"f");if(a)Gc.exports=c;else{for(y=0;y<d.length;++y)n[d[y]]=c[d[y]];f&&define(function(){return c})}})()});var g1=me((QP,T_)=>{T_.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{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/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{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"},dependencies:{"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 Zd=me(()=>{});var Wn=me((v1,Qd)=>{(function(r,e){"use strict";function t(D,l){if(!D)throw new Error(l||"Assertion failed")}o(t,"assert");function n(D,l){D.super_=l;var v=o(function(){},"TempCtor");v.prototype=l.prototype,D.prototype=new v,D.prototype.constructor=D}o(n,"inherits");function i(D,l,v){if(i.isBN(D))return D;this.negative=0,this.words=null,this.length=0,this.red=null,D!==null&&((l==="le"||l==="be")&&(v=l,l=10),this._init(D||0,l||10,v||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=Zd().Buffer}catch(D){}i.isBN=o(function(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},"isBN"),i.max=o(function(l,v){return l.cmp(v)>0?l:v},"max"),i.min=o(function(l,v){return l.cmp(v)<0?l:v},"min"),i.prototype._init=o(function(l,v,h){if(typeof l=="number")return this._initNumber(l,v,h);if(typeof l=="object")return this._initArray(l,v,h);v==="hex"&&(v=16),t(v===(v|0)&&v>=2&&v<=36),l=l.toString().replace(/\s+/g,"");var c=0;l[0]==="-"&&(c++,this.negative=1),c<l.length&&(v===16?this._parseHex(l,c,h):(this._parseBase(l,v,c),h==="le"&&this._initArray(this.toArray(),v,h)))},"init"),i.prototype._initNumber=o(function(l,v,h){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),v,h)},"_initNumber"),i.prototype._initArray=o(function(l,v,h){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d,y,_=0;if(h==="be")for(c=l.length-1,d=0;c>=0;c-=3)y=l[c]|l[c-1]<<8|l[c-2]<<16,this.words[d]|=y<<_&67108863,this.words[d+1]=y>>>26-_&67108863,_+=24,_>=26&&(_-=26,d++);else if(h==="le")for(c=0,d=0;c<l.length;c+=3)y=l[c]|l[c+1]<<8|l[c+2]<<16,this.words[d]|=y<<_&67108863,this.words[d+1]=y>>>26-_&67108863,_+=24,_>=26&&(_-=26,d++);return this.strip()},"_initArray");function a(D,l){var v=D.charCodeAt(l);return v>=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}o(a,"parseHex4Bits");function f(D,l,v){var h=a(D,v);return v-1>=l&&(h|=a(D,v-1)<<4),h}o(f,"parseHexByte"),i.prototype._parseHex=o(function(l,v,h){this.length=Math.ceil((l.length-v)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d=0,y=0,_;if(h==="be")for(c=l.length-1;c>=v;c-=2)_=f(l,v,c)<<d,this.words[y]|=_&67108863,d>=18?(d-=18,y+=1,this.words[y]|=_>>>26):d+=8;else{var w=l.length-v;for(c=w%2===0?v+1:v;c<l.length;c+=2)_=f(l,v,c)<<d,this.words[y]|=_&67108863,d>=18?(d-=18,y+=1,this.words[y]|=_>>>26):d+=8}this.strip()},"_parseHex");function u(D,l,v,h){for(var c=0,d=Math.min(D.length,v),y=l;y<d;y++){var _=D.charCodeAt(y)-48;c*=h,_>=49?c+=_-49+10:_>=17?c+=_-17+10:c+=_}return c}o(u,"parseBase"),i.prototype._parseBase=o(function(l,v,h){this.words=[0],this.length=1;for(var c=0,d=1;d<=67108863;d*=v)c++;c--,d=d/v|0;for(var y=l.length-h,_=y%c,w=Math.min(y,y-_)+h,m=0,E=h;E<w;E+=c)m=u(l,E,E+c,v),this.imuln(d),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if(_!==0){var I=1;for(m=u(l,E,l.length,v),E=0;E<_;E++)I*=v;this.imuln(I),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this.strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var v=0;v<this.length;v++)l.words[v]=this.words[v];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy"),i.prototype.clone=o(function(){var l=new i(null);return this.copy(l),l},"clone"),i.prototype._expand=o(function(l){for(;this.length<l;)this.words[this.length++]=0;return this},"_expand"),i.prototype.strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),i.prototype.inspect=o(function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"},"inspect");var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],b=[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],x=[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];i.prototype.toString=o(function(l,v){l=l||10,v=v|0||1;var h;if(l===16||l==="hex"){h="";for(var c=0,d=0,y=0;y<this.length;y++){var _=this.words[y],w=((_<<c|d)&16777215).toString(16);d=_>>>24-c&16777215,d!==0||y!==this.length-1?h=p[6-w.length]+w+h:h=w+h,c+=2,c>=26&&(c-=26,y--)}for(d!==0&&(h=d.toString(16)+h);h.length%v!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(l===(l|0)&&l>=2&&l<=36){var m=b[l],E=x[l];h="";var I=this.clone();for(I.negative=0;!I.isZero();){var g=I.modn(E).toString(l);I=I.idivn(E),I.isZero()?h=g+h:h=p[m-g.length]+g+h}for(this.isZero()&&(h="0"+h);h.length%v!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(l,v){return t(typeof s!="undefined"),this.toArrayLike(s,l,v)},"toBuffer"),i.prototype.toArray=o(function(l,v){return this.toArrayLike(Array,l,v)},"toArray"),i.prototype.toArrayLike=o(function(l,v,h){var c=this.byteLength(),d=h||Math.max(1,c);t(c<=d,"byte array longer than desired length"),t(d>0,"Requested array length <= 0"),this.strip();var y=v==="le",_=new l(d),w,m,E=this.clone();if(y){for(m=0;!E.isZero();m++)w=E.andln(255),E.iushrn(8),_[m]=w;for(;m<d;m++)_[m]=0}else{for(m=0;m<d-c;m++)_[m]=0;for(m=0;!E.isZero();m++)w=E.andln(255),E.iushrn(8),_[d-m-1]=w}return _},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var v=l,h=0;return v>=4096&&(h+=13,v>>>=13),v>=64&&(h+=7,v>>>=7),v>=8&&(h+=4,v>>>=4),v>=2&&(h+=2,v>>>=2),h+v},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var v=l,h=0;return(v&8191)===0&&(h+=13,v>>>=13),(v&127)===0&&(h+=7,v>>>=7),(v&15)===0&&(h+=4,v>>>=4),(v&3)===0&&(h+=2,v>>>=2),(v&1)===0&&h++,h},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],v=this._countBits(l);return(this.length-1)*26+v},"bitLength");function A(D){for(var l=new Array(D.bitLength()),v=0;v<l.length;v++){var h=v/26|0,c=v%26;l[v]=(D.words[h]&1<<c)>>>c}return l}o(A,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,v=0;v<this.length;v++){var h=this._zeroBits(this.words[v]);if(l+=h,h!==26)break}return l},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var v=0;v<l.length;v++)this.words[v]=this.words[v]|l.words[v];return this.strip()},"iuor"),i.prototype.ior=o(function(l){return t((this.negative|l.negative)===0),this.iuor(l)},"ior"),i.prototype.or=o(function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},"or"),i.prototype.uor=o(function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(l){var v;this.length>l.length?v=l:v=this;for(var h=0;h<v.length;h++)this.words[h]=this.words[h]&l.words[h];return this.length=v.length,this.strip()},"iuand"),i.prototype.iand=o(function(l){return t((this.negative|l.negative)===0),this.iuand(l)},"iand"),i.prototype.and=o(function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},"and"),i.prototype.uand=o(function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(l){var v,h;this.length>l.length?(v=this,h=l):(v=l,h=this);for(var c=0;c<h.length;c++)this.words[c]=v.words[c]^h.words[c];if(this!==v)for(;c<v.length;c++)this.words[c]=v.words[c];return this.length=v.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},"ixor"),i.prototype.xor=o(function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(l){t(typeof l=="number"&&l>=0);var v=Math.ceil(l/26)|0,h=l%26;this._expand(v),h>0&&v--;for(var c=0;c<v;c++)this.words[c]=~this.words[c]&67108863;return h>0&&(this.words[c]=~this.words[c]&67108863>>26-h),this.strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,v){t(typeof l=="number"&&l>=0);var h=l/26|0,c=l%26;return this._expand(h+1),v?this.words[h]=this.words[h]|1<<c:this.words[h]=this.words[h]&~(1<<c),this.strip()},"setn"),i.prototype.iadd=o(function(l){var v;if(this.negative!==0&&l.negative===0)return this.negative=0,v=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,v=this.isub(l),l.negative=1,v._normSign();var h,c;this.length>l.length?(h=this,c=l):(h=l,c=this);for(var d=0,y=0;y<c.length;y++)v=(h.words[y]|0)+(c.words[y]|0)+d,this.words[y]=v&67108863,d=v>>>26;for(;d!==0&&y<h.length;y++)v=(h.words[y]|0)+d,this.words[y]=v&67108863,d=v>>>26;if(this.length=h.length,d!==0)this.words[this.length]=d,this.length++;else if(h!==this)for(;y<h.length;y++)this.words[y]=h.words[y];return this},"iadd"),i.prototype.add=o(function(l){var v;return l.negative!==0&&this.negative===0?(l.negative=0,v=this.sub(l),l.negative^=1,v):l.negative===0&&this.negative!==0?(this.negative=0,v=l.sub(this),this.negative=1,v):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},"add"),i.prototype.isub=o(function(l){if(l.negative!==0){l.negative=0;var v=this.iadd(l);return l.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var h=this.cmp(l);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,d;h>0?(c=this,d=l):(c=l,d=this);for(var y=0,_=0;_<d.length;_++)v=(c.words[_]|0)-(d.words[_]|0)+y,y=v>>26,this.words[_]=v&67108863;for(;y!==0&&_<c.length;_++)v=(c.words[_]|0)+y,y=v>>26,this.words[_]=v&67108863;if(y===0&&_<c.length&&c!==this)for(;_<c.length;_++)this.words[_]=c.words[_];return this.length=Math.max(this.length,_),c!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function O(D,l,v){v.negative=l.negative^D.negative;var h=D.length+l.length|0;v.length=h,h=h-1|0;var c=D.words[0]|0,d=l.words[0]|0,y=c*d,_=y&67108863,w=y/67108864|0;v.words[0]=_;for(var m=1;m<h;m++){for(var E=w>>>26,I=w&67108863,g=Math.min(m,l.length-1),S=Math.max(0,m-D.length+1);S<=g;S++){var ie=m-S|0;c=D.words[ie]|0,d=l.words[S]|0,y=c*d+I,E+=y/67108864|0,I=y&67108863}v.words[m]=I|0,w=E|0}return w!==0?v.words[m]=w|0:v.length--,v.strip()}o(O,"smallMulTo");var T=o(function(l,v,h){var c=l.words,d=v.words,y=h.words,_=0,w,m,E,I=c[0]|0,g=I&8191,S=I>>>13,ie=c[1]|0,M=ie&8191,K=ie>>>13,J=c[2]|0,N=J&8191,R=J>>>13,V=c[3]|0,W=V&8191,ee=V>>>13,he=c[4]|0,fe=he&8191,Y=he>>>13,pe=c[5]|0,Q=pe&8191,ce=pe>>>13,q=c[6]|0,se=q&8191,be=q>>>13,ke=c[7]|0,we=ke&8191,Oe=ke>>>13,vr=c[8]|0,te=vr&8191,G=vr>>>13,P=c[9]|0,j=P&8191,ae=P>>>13,ue=d[0]|0,le=ue&8191,ge=ue>>>13,ft=d[1]|0,Ee=ft&8191,ve=ft>>>13,lt=d[2]|0,De=lt&8191,Ne=lt>>>13,Bn=d[3]|0,Le=Bn&8191,Be=Bn>>>13,Un=d[4]|0,Ue=Un&8191,Fe=Un>>>13,Fn=d[5]|0,$e=Fn&8191,qe=Fn>>>13,$n=d[6]|0,He=$n&8191,ze=$n>>>13,qn=d[7]|0,je=qn&8191,Ke=qn>>>13,Hn=d[8]|0,Ve=Hn&8191,We=Hn>>>13,zn=d[9]|0,Ge=zn&8191,Ye=zn>>>13;h.negative=l.negative^v.negative,h.length=19,w=Math.imul(g,le),m=Math.imul(g,ge),m=m+Math.imul(S,le)|0,E=Math.imul(S,ge);var gn=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(gn>>>26)|0,gn&=67108863,w=Math.imul(M,le),m=Math.imul(M,ge),m=m+Math.imul(K,le)|0,E=Math.imul(K,ge),w=w+Math.imul(g,Ee)|0,m=m+Math.imul(g,ve)|0,m=m+Math.imul(S,Ee)|0,E=E+Math.imul(S,ve)|0;var mt=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(mt>>>26)|0,mt&=67108863,w=Math.imul(N,le),m=Math.imul(N,ge),m=m+Math.imul(R,le)|0,E=Math.imul(R,ge),w=w+Math.imul(M,Ee)|0,m=m+Math.imul(M,ve)|0,m=m+Math.imul(K,Ee)|0,E=E+Math.imul(K,ve)|0,w=w+Math.imul(g,De)|0,m=m+Math.imul(g,Ne)|0,m=m+Math.imul(S,De)|0,E=E+Math.imul(S,Ne)|0;var bt=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(bt>>>26)|0,bt&=67108863,w=Math.imul(W,le),m=Math.imul(W,ge),m=m+Math.imul(ee,le)|0,E=Math.imul(ee,ge),w=w+Math.imul(N,Ee)|0,m=m+Math.imul(N,ve)|0,m=m+Math.imul(R,Ee)|0,E=E+Math.imul(R,ve)|0,w=w+Math.imul(M,De)|0,m=m+Math.imul(M,Ne)|0,m=m+Math.imul(K,De)|0,E=E+Math.imul(K,Ne)|0,w=w+Math.imul(g,Le)|0,m=m+Math.imul(g,Be)|0,m=m+Math.imul(S,Le)|0,E=E+Math.imul(S,Be)|0;var Yr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,w=Math.imul(fe,le),m=Math.imul(fe,ge),m=m+Math.imul(Y,le)|0,E=Math.imul(Y,ge),w=w+Math.imul(W,Ee)|0,m=m+Math.imul(W,ve)|0,m=m+Math.imul(ee,Ee)|0,E=E+Math.imul(ee,ve)|0,w=w+Math.imul(N,De)|0,m=m+Math.imul(N,Ne)|0,m=m+Math.imul(R,De)|0,E=E+Math.imul(R,Ne)|0,w=w+Math.imul(M,Le)|0,m=m+Math.imul(M,Be)|0,m=m+Math.imul(K,Le)|0,E=E+Math.imul(K,Be)|0,w=w+Math.imul(g,Ue)|0,m=m+Math.imul(g,Fe)|0,m=m+Math.imul(S,Ue)|0,E=E+Math.imul(S,Fe)|0;var Jr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,w=Math.imul(Q,le),m=Math.imul(Q,ge),m=m+Math.imul(ce,le)|0,E=Math.imul(ce,ge),w=w+Math.imul(fe,Ee)|0,m=m+Math.imul(fe,ve)|0,m=m+Math.imul(Y,Ee)|0,E=E+Math.imul(Y,ve)|0,w=w+Math.imul(W,De)|0,m=m+Math.imul(W,Ne)|0,m=m+Math.imul(ee,De)|0,E=E+Math.imul(ee,Ne)|0,w=w+Math.imul(N,Le)|0,m=m+Math.imul(N,Be)|0,m=m+Math.imul(R,Le)|0,E=E+Math.imul(R,Be)|0,w=w+Math.imul(M,Ue)|0,m=m+Math.imul(M,Fe)|0,m=m+Math.imul(K,Ue)|0,E=E+Math.imul(K,Fe)|0,w=w+Math.imul(g,$e)|0,m=m+Math.imul(g,qe)|0,m=m+Math.imul(S,$e)|0,E=E+Math.imul(S,qe)|0;var Xr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,w=Math.imul(se,le),m=Math.imul(se,ge),m=m+Math.imul(be,le)|0,E=Math.imul(be,ge),w=w+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,ve)|0,m=m+Math.imul(ce,Ee)|0,E=E+Math.imul(ce,ve)|0,w=w+Math.imul(fe,De)|0,m=m+Math.imul(fe,Ne)|0,m=m+Math.imul(Y,De)|0,E=E+Math.imul(Y,Ne)|0,w=w+Math.imul(W,Le)|0,m=m+Math.imul(W,Be)|0,m=m+Math.imul(ee,Le)|0,E=E+Math.imul(ee,Be)|0,w=w+Math.imul(N,Ue)|0,m=m+Math.imul(N,Fe)|0,m=m+Math.imul(R,Ue)|0,E=E+Math.imul(R,Fe)|0,w=w+Math.imul(M,$e)|0,m=m+Math.imul(M,qe)|0,m=m+Math.imul(K,$e)|0,E=E+Math.imul(K,qe)|0,w=w+Math.imul(g,He)|0,m=m+Math.imul(g,ze)|0,m=m+Math.imul(S,He)|0,E=E+Math.imul(S,ze)|0;var Zr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,w=Math.imul(we,le),m=Math.imul(we,ge),m=m+Math.imul(Oe,le)|0,E=Math.imul(Oe,ge),w=w+Math.imul(se,Ee)|0,m=m+Math.imul(se,ve)|0,m=m+Math.imul(be,Ee)|0,E=E+Math.imul(be,ve)|0,w=w+Math.imul(Q,De)|0,m=m+Math.imul(Q,Ne)|0,m=m+Math.imul(ce,De)|0,E=E+Math.imul(ce,Ne)|0,w=w+Math.imul(fe,Le)|0,m=m+Math.imul(fe,Be)|0,m=m+Math.imul(Y,Le)|0,E=E+Math.imul(Y,Be)|0,w=w+Math.imul(W,Ue)|0,m=m+Math.imul(W,Fe)|0,m=m+Math.imul(ee,Ue)|0,E=E+Math.imul(ee,Fe)|0,w=w+Math.imul(N,$e)|0,m=m+Math.imul(N,qe)|0,m=m+Math.imul(R,$e)|0,E=E+Math.imul(R,qe)|0,w=w+Math.imul(M,He)|0,m=m+Math.imul(M,ze)|0,m=m+Math.imul(K,He)|0,E=E+Math.imul(K,ze)|0,w=w+Math.imul(g,je)|0,m=m+Math.imul(g,Ke)|0,m=m+Math.imul(S,je)|0,E=E+Math.imul(S,Ke)|0;var Qr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,w=Math.imul(te,le),m=Math.imul(te,ge),m=m+Math.imul(G,le)|0,E=Math.imul(G,ge),w=w+Math.imul(we,Ee)|0,m=m+Math.imul(we,ve)|0,m=m+Math.imul(Oe,Ee)|0,E=E+Math.imul(Oe,ve)|0,w=w+Math.imul(se,De)|0,m=m+Math.imul(se,Ne)|0,m=m+Math.imul(be,De)|0,E=E+Math.imul(be,Ne)|0,w=w+Math.imul(Q,Le)|0,m=m+Math.imul(Q,Be)|0,m=m+Math.imul(ce,Le)|0,E=E+Math.imul(ce,Be)|0,w=w+Math.imul(fe,Ue)|0,m=m+Math.imul(fe,Fe)|0,m=m+Math.imul(Y,Ue)|0,E=E+Math.imul(Y,Fe)|0,w=w+Math.imul(W,$e)|0,m=m+Math.imul(W,qe)|0,m=m+Math.imul(ee,$e)|0,E=E+Math.imul(ee,qe)|0,w=w+Math.imul(N,He)|0,m=m+Math.imul(N,ze)|0,m=m+Math.imul(R,He)|0,E=E+Math.imul(R,ze)|0,w=w+Math.imul(M,je)|0,m=m+Math.imul(M,Ke)|0,m=m+Math.imul(K,je)|0,E=E+Math.imul(K,Ke)|0,w=w+Math.imul(g,Ve)|0,m=m+Math.imul(g,We)|0,m=m+Math.imul(S,Ve)|0,E=E+Math.imul(S,We)|0;var To=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(To>>>26)|0,To&=67108863,w=Math.imul(j,le),m=Math.imul(j,ge),m=m+Math.imul(ae,le)|0,E=Math.imul(ae,ge),w=w+Math.imul(te,Ee)|0,m=m+Math.imul(te,ve)|0,m=m+Math.imul(G,Ee)|0,E=E+Math.imul(G,ve)|0,w=w+Math.imul(we,De)|0,m=m+Math.imul(we,Ne)|0,m=m+Math.imul(Oe,De)|0,E=E+Math.imul(Oe,Ne)|0,w=w+Math.imul(se,Le)|0,m=m+Math.imul(se,Be)|0,m=m+Math.imul(be,Le)|0,E=E+Math.imul(be,Be)|0,w=w+Math.imul(Q,Ue)|0,m=m+Math.imul(Q,Fe)|0,m=m+Math.imul(ce,Ue)|0,E=E+Math.imul(ce,Fe)|0,w=w+Math.imul(fe,$e)|0,m=m+Math.imul(fe,qe)|0,m=m+Math.imul(Y,$e)|0,E=E+Math.imul(Y,qe)|0,w=w+Math.imul(W,He)|0,m=m+Math.imul(W,ze)|0,m=m+Math.imul(ee,He)|0,E=E+Math.imul(ee,ze)|0,w=w+Math.imul(N,je)|0,m=m+Math.imul(N,Ke)|0,m=m+Math.imul(R,je)|0,E=E+Math.imul(R,Ke)|0,w=w+Math.imul(M,Ve)|0,m=m+Math.imul(M,We)|0,m=m+Math.imul(K,Ve)|0,E=E+Math.imul(K,We)|0,w=w+Math.imul(g,Ge)|0,m=m+Math.imul(g,Ye)|0,m=m+Math.imul(S,Ge)|0,E=E+Math.imul(S,Ye)|0;var ko=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(ko>>>26)|0,ko&=67108863,w=Math.imul(j,Ee),m=Math.imul(j,ve),m=m+Math.imul(ae,Ee)|0,E=Math.imul(ae,ve),w=w+Math.imul(te,De)|0,m=m+Math.imul(te,Ne)|0,m=m+Math.imul(G,De)|0,E=E+Math.imul(G,Ne)|0,w=w+Math.imul(we,Le)|0,m=m+Math.imul(we,Be)|0,m=m+Math.imul(Oe,Le)|0,E=E+Math.imul(Oe,Be)|0,w=w+Math.imul(se,Ue)|0,m=m+Math.imul(se,Fe)|0,m=m+Math.imul(be,Ue)|0,E=E+Math.imul(be,Fe)|0,w=w+Math.imul(Q,$e)|0,m=m+Math.imul(Q,qe)|0,m=m+Math.imul(ce,$e)|0,E=E+Math.imul(ce,qe)|0,w=w+Math.imul(fe,He)|0,m=m+Math.imul(fe,ze)|0,m=m+Math.imul(Y,He)|0,E=E+Math.imul(Y,ze)|0,w=w+Math.imul(W,je)|0,m=m+Math.imul(W,Ke)|0,m=m+Math.imul(ee,je)|0,E=E+Math.imul(ee,Ke)|0,w=w+Math.imul(N,Ve)|0,m=m+Math.imul(N,We)|0,m=m+Math.imul(R,Ve)|0,E=E+Math.imul(R,We)|0,w=w+Math.imul(M,Ge)|0,m=m+Math.imul(M,Ye)|0,m=m+Math.imul(K,Ge)|0,E=E+Math.imul(K,Ye)|0;var Co=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Co>>>26)|0,Co&=67108863,w=Math.imul(j,De),m=Math.imul(j,Ne),m=m+Math.imul(ae,De)|0,E=Math.imul(ae,Ne),w=w+Math.imul(te,Le)|0,m=m+Math.imul(te,Be)|0,m=m+Math.imul(G,Le)|0,E=E+Math.imul(G,Be)|0,w=w+Math.imul(we,Ue)|0,m=m+Math.imul(we,Fe)|0,m=m+Math.imul(Oe,Ue)|0,E=E+Math.imul(Oe,Fe)|0,w=w+Math.imul(se,$e)|0,m=m+Math.imul(se,qe)|0,m=m+Math.imul(be,$e)|0,E=E+Math.imul(be,qe)|0,w=w+Math.imul(Q,He)|0,m=m+Math.imul(Q,ze)|0,m=m+Math.imul(ce,He)|0,E=E+Math.imul(ce,ze)|0,w=w+Math.imul(fe,je)|0,m=m+Math.imul(fe,Ke)|0,m=m+Math.imul(Y,je)|0,E=E+Math.imul(Y,Ke)|0,w=w+Math.imul(W,Ve)|0,m=m+Math.imul(W,We)|0,m=m+Math.imul(ee,Ve)|0,E=E+Math.imul(ee,We)|0,w=w+Math.imul(N,Ge)|0,m=m+Math.imul(N,Ye)|0,m=m+Math.imul(R,Ge)|0,E=E+Math.imul(R,Ye)|0;var Do=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Do>>>26)|0,Do&=67108863,w=Math.imul(j,Le),m=Math.imul(j,Be),m=m+Math.imul(ae,Le)|0,E=Math.imul(ae,Be),w=w+Math.imul(te,Ue)|0,m=m+Math.imul(te,Fe)|0,m=m+Math.imul(G,Ue)|0,E=E+Math.imul(G,Fe)|0,w=w+Math.imul(we,$e)|0,m=m+Math.imul(we,qe)|0,m=m+Math.imul(Oe,$e)|0,E=E+Math.imul(Oe,qe)|0,w=w+Math.imul(se,He)|0,m=m+Math.imul(se,ze)|0,m=m+Math.imul(be,He)|0,E=E+Math.imul(be,ze)|0,w=w+Math.imul(Q,je)|0,m=m+Math.imul(Q,Ke)|0,m=m+Math.imul(ce,je)|0,E=E+Math.imul(ce,Ke)|0,w=w+Math.imul(fe,Ve)|0,m=m+Math.imul(fe,We)|0,m=m+Math.imul(Y,Ve)|0,E=E+Math.imul(Y,We)|0,w=w+Math.imul(W,Ge)|0,m=m+Math.imul(W,Ye)|0,m=m+Math.imul(ee,Ge)|0,E=E+Math.imul(ee,Ye)|0;var Io=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Io>>>26)|0,Io&=67108863,w=Math.imul(j,Ue),m=Math.imul(j,Fe),m=m+Math.imul(ae,Ue)|0,E=Math.imul(ae,Fe),w=w+Math.imul(te,$e)|0,m=m+Math.imul(te,qe)|0,m=m+Math.imul(G,$e)|0,E=E+Math.imul(G,qe)|0,w=w+Math.imul(we,He)|0,m=m+Math.imul(we,ze)|0,m=m+Math.imul(Oe,He)|0,E=E+Math.imul(Oe,ze)|0,w=w+Math.imul(se,je)|0,m=m+Math.imul(se,Ke)|0,m=m+Math.imul(be,je)|0,E=E+Math.imul(be,Ke)|0,w=w+Math.imul(Q,Ve)|0,m=m+Math.imul(Q,We)|0,m=m+Math.imul(ce,Ve)|0,E=E+Math.imul(ce,We)|0,w=w+Math.imul(fe,Ge)|0,m=m+Math.imul(fe,Ye)|0,m=m+Math.imul(Y,Ge)|0,E=E+Math.imul(Y,Ye)|0;var Oo=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,w=Math.imul(j,$e),m=Math.imul(j,qe),m=m+Math.imul(ae,$e)|0,E=Math.imul(ae,qe),w=w+Math.imul(te,He)|0,m=m+Math.imul(te,ze)|0,m=m+Math.imul(G,He)|0,E=E+Math.imul(G,ze)|0,w=w+Math.imul(we,je)|0,m=m+Math.imul(we,Ke)|0,m=m+Math.imul(Oe,je)|0,E=E+Math.imul(Oe,Ke)|0,w=w+Math.imul(se,Ve)|0,m=m+Math.imul(se,We)|0,m=m+Math.imul(be,Ve)|0,E=E+Math.imul(be,We)|0,w=w+Math.imul(Q,Ge)|0,m=m+Math.imul(Q,Ye)|0,m=m+Math.imul(ce,Ge)|0,E=E+Math.imul(ce,Ye)|0;var Po=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Po>>>26)|0,Po&=67108863,w=Math.imul(j,He),m=Math.imul(j,ze),m=m+Math.imul(ae,He)|0,E=Math.imul(ae,ze),w=w+Math.imul(te,je)|0,m=m+Math.imul(te,Ke)|0,m=m+Math.imul(G,je)|0,E=E+Math.imul(G,Ke)|0,w=w+Math.imul(we,Ve)|0,m=m+Math.imul(we,We)|0,m=m+Math.imul(Oe,Ve)|0,E=E+Math.imul(Oe,We)|0,w=w+Math.imul(se,Ge)|0,m=m+Math.imul(se,Ye)|0,m=m+Math.imul(be,Ge)|0,E=E+Math.imul(be,Ye)|0;var No=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(No>>>26)|0,No&=67108863,w=Math.imul(j,je),m=Math.imul(j,Ke),m=m+Math.imul(ae,je)|0,E=Math.imul(ae,Ke),w=w+Math.imul(te,Ve)|0,m=m+Math.imul(te,We)|0,m=m+Math.imul(G,Ve)|0,E=E+Math.imul(G,We)|0,w=w+Math.imul(we,Ge)|0,m=m+Math.imul(we,Ye)|0,m=m+Math.imul(Oe,Ge)|0,E=E+Math.imul(Oe,Ye)|0;var Ro=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,w=Math.imul(j,Ve),m=Math.imul(j,We),m=m+Math.imul(ae,Ve)|0,E=Math.imul(ae,We),w=w+Math.imul(te,Ge)|0,m=m+Math.imul(te,Ye)|0,m=m+Math.imul(G,Ge)|0,E=E+Math.imul(G,Ye)|0;var Lo=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,w=Math.imul(j,Ge),m=Math.imul(j,Ye),m=m+Math.imul(ae,Ge)|0,E=Math.imul(ae,Ye);var Bo=(_+w|0)+((m&8191)<<13)|0;return _=(E+(m>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,y[0]=gn,y[1]=mt,y[2]=bt,y[3]=Yr,y[4]=Jr,y[5]=Xr,y[6]=Zr,y[7]=Qr,y[8]=To,y[9]=ko,y[10]=Co,y[11]=Do,y[12]=Io,y[13]=Oo,y[14]=Po,y[15]=No,y[16]=Ro,y[17]=Lo,y[18]=Bo,_!==0&&(y[19]=_,h.length++),h},"comb10MulTo");Math.imul||(T=O);function k(D,l,v){v.negative=l.negative^D.negative,v.length=D.length+l.length;for(var h=0,c=0,d=0;d<v.length-1;d++){var y=c;c=0;for(var _=h&67108863,w=Math.min(d,l.length-1),m=Math.max(0,d-D.length+1);m<=w;m++){var E=d-m,I=D.words[E]|0,g=l.words[m]|0,S=I*g,ie=S&67108863;y=y+(S/67108864|0)|0,ie=ie+_|0,_=ie&67108863,y=y+(ie>>>26)|0,c+=y>>>26,y&=67108863}v.words[d]=_,h=y,y=c}return h!==0?v.words[d]=h:v.length--,v.strip()}o(k,"bigMulTo");function $(D,l,v){var h=new C;return h.mulp(D,l,v)}o($,"jumboMulTo"),i.prototype.mulTo=o(function(l,v){var h,c=this.length+l.length;return this.length===10&&l.length===10?h=T(this,l,v):c<63?h=O(this,l,v):c<1024?h=k(this,l,v):h=$(this,l,v),h},"mulTo");function C(D,l){this.x=D,this.y=l}o(C,"FFTM"),C.prototype.makeRBT=o(function(l){for(var v=new Array(l),h=i.prototype._countBits(l)-1,c=0;c<l;c++)v[c]=this.revBin(c,h,l);return v},"makeRBT"),C.prototype.revBin=o(function(l,v,h){if(l===0||l===h-1)return l;for(var c=0,d=0;d<v;d++)c|=(l&1)<<v-d-1,l>>=1;return c},"revBin"),C.prototype.permute=o(function(l,v,h,c,d,y){for(var _=0;_<y;_++)c[_]=v[l[_]],d[_]=h[l[_]]},"permute"),C.prototype.transform=o(function(l,v,h,c,d,y){this.permute(y,l,v,h,c,d);for(var _=1;_<d;_<<=1)for(var w=_<<1,m=Math.cos(2*Math.PI/w),E=Math.sin(2*Math.PI/w),I=0;I<d;I+=w)for(var g=m,S=E,ie=0;ie<_;ie++){var M=h[I+ie],K=c[I+ie],J=h[I+ie+_],N=c[I+ie+_],R=g*J-S*N;N=g*N+S*J,J=R,h[I+ie]=M+J,c[I+ie]=K+N,h[I+ie+_]=M-J,c[I+ie+_]=K-N,ie!==w&&(R=m*g-E*S,S=m*S+E*g,g=R)}},"transform"),C.prototype.guessLen13b=o(function(l,v){var h=Math.max(v,l)|1,c=h&1,d=0;for(h=h/2|0;h;h=h>>>1)d++;return 1<<d+1+c},"guessLen13b"),C.prototype.conjugate=o(function(l,v,h){if(!(h<=1))for(var c=0;c<h/2;c++){var d=l[c];l[c]=l[h-c-1],l[h-c-1]=d,d=v[c],v[c]=-v[h-c-1],v[h-c-1]=-d}},"conjugate"),C.prototype.normalize13b=o(function(l,v){for(var h=0,c=0;c<v/2;c++){var d=Math.round(l[2*c+1]/v)*8192+Math.round(l[2*c]/v)+h;l[c]=d&67108863,d<67108864?h=0:h=d/67108864|0}return l},"normalize13b"),C.prototype.convert13b=o(function(l,v,h,c){for(var d=0,y=0;y<v;y++)d=d+(l[y]|0),h[2*y]=d&8191,d=d>>>13,h[2*y+1]=d&8191,d=d>>>13;for(y=2*v;y<c;++y)h[y]=0;t(d===0),t((d&-8192)===0)},"convert13b"),C.prototype.stub=o(function(l){for(var v=new Array(l),h=0;h<l;h++)v[h]=0;return v},"stub"),C.prototype.mulp=o(function(l,v,h){var c=2*this.guessLen13b(l.length,v.length),d=this.makeRBT(c),y=this.stub(c),_=new Array(c),w=new Array(c),m=new Array(c),E=new Array(c),I=new Array(c),g=new Array(c),S=h.words;S.length=c,this.convert13b(l.words,l.length,_,c),this.convert13b(v.words,v.length,E,c),this.transform(_,y,w,m,c,d),this.transform(E,y,I,g,c,d);for(var ie=0;ie<c;ie++){var M=w[ie]*I[ie]-m[ie]*g[ie];m[ie]=w[ie]*g[ie]+m[ie]*I[ie],w[ie]=M}return this.conjugate(w,m,c),this.transform(w,m,S,y,c,d),this.conjugate(S,y,c),this.normalize13b(S,c),h.negative=l.negative^v.negative,h.length=l.length+v.length,h.strip()},"mulp"),i.prototype.mul=o(function(l){var v=new i(null);return v.words=new Array(this.length+l.length),this.mulTo(l,v)},"mul"),i.prototype.mulf=o(function(l){var v=new i(null);return v.words=new Array(this.length+l.length),$(this,l,v)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){t(typeof l=="number"),t(l<67108864);for(var v=0,h=0;h<this.length;h++){var c=(this.words[h]|0)*l,d=(c&67108863)+(v&67108863);v>>=26,v+=c/67108864|0,v+=d>>>26,this.words[h]=d&67108863}return v!==0&&(this.words[h]=v,this.length++),this},"imuln"),i.prototype.muln=o(function(l){return this.clone().imuln(l)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(l){var v=A(l);if(v.length===0)return new i(1);for(var h=this,c=0;c<v.length&&v[c]===0;c++,h=h.sqr());if(++c<v.length)for(var d=h.sqr();c<v.length;c++,d=d.sqr())v[c]!==0&&(h=h.mul(d));return h},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var v=l%26,h=(l-v)/26,c=67108863>>>26-v<<26-v,d;if(v!==0){var y=0;for(d=0;d<this.length;d++){var _=this.words[d]&c,w=(this.words[d]|0)-_<<v;this.words[d]=w|y,y=_>>>26-v}y&&(this.words[d]=y,this.length++)}if(h!==0){for(d=this.length-1;d>=0;d--)this.words[d+h]=this.words[d];for(d=0;d<h;d++)this.words[d]=0;this.length+=h}return this.strip()},"iushln"),i.prototype.ishln=o(function(l){return t(this.negative===0),this.iushln(l)},"ishln"),i.prototype.iushrn=o(function(l,v,h){t(typeof l=="number"&&l>=0);var c;v?c=(v-v%26)/26:c=0;var d=l%26,y=Math.min((l-d)/26,this.length),_=67108863^67108863>>>d<<d,w=h;if(c-=y,c=Math.max(0,c),w){for(var m=0;m<y;m++)w.words[m]=this.words[m];w.length=y}if(y!==0)if(this.length>y)for(this.length-=y,m=0;m<this.length;m++)this.words[m]=this.words[m+y];else this.words[0]=0,this.length=1;var E=0;for(m=this.length-1;m>=0&&(E!==0||m>=c);m--){var I=this.words[m]|0;this.words[m]=E<<26-d|I>>>d,E=I&_}return w&&E!==0&&(w.words[w.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(l,v,h){return t(this.negative===0),this.iushrn(l,v,h)},"ishrn"),i.prototype.shln=o(function(l){return this.clone().ishln(l)},"shln"),i.prototype.ushln=o(function(l){return this.clone().iushln(l)},"ushln"),i.prototype.shrn=o(function(l){return this.clone().ishrn(l)},"shrn"),i.prototype.ushrn=o(function(l){return this.clone().iushrn(l)},"ushrn"),i.prototype.testn=o(function(l){t(typeof l=="number"&&l>=0);var v=l%26,h=(l-v)/26,c=1<<v;if(this.length<=h)return!1;var d=this.words[h];return!!(d&c)},"testn"),i.prototype.imaskn=o(function(l){t(typeof l=="number"&&l>=0);var v=l%26,h=(l-v)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(v!==0&&h++,this.length=Math.min(h,this.length),v!==0){var c=67108863^67108863>>>v<<v;this.words[this.length-1]&=c}return this.strip()},"imaskn"),i.prototype.maskn=o(function(l){return this.clone().imaskn(l)},"maskn"),i.prototype.iaddn=o(function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},"iaddn"),i.prototype._iaddn=o(function(l){this.words[0]+=l;for(var v=0;v<this.length&&this.words[v]>=67108864;v++)this.words[v]-=67108864,v===this.length-1?this.words[v+1]=1:this.words[v+1]++;return this.length=Math.max(this.length,v+1),this},"_iaddn"),i.prototype.isubn=o(function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var v=0;v<this.length&&this.words[v]<0;v++)this.words[v]+=67108864,this.words[v+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(l){return this.clone().iaddn(l)},"addn"),i.prototype.subn=o(function(l){return this.clone().isubn(l)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(l,v,h){var c=l.length+h,d;this._expand(c);var y,_=0;for(d=0;d<l.length;d++){y=(this.words[d+h]|0)+_;var w=(l.words[d]|0)*v;y-=w&67108863,_=(y>>26)-(w/67108864|0),this.words[d+h]=y&67108863}for(;d<this.length-h;d++)y=(this.words[d+h]|0)+_,_=y>>26,this.words[d+h]=y&67108863;if(_===0)return this.strip();for(t(_===-1),_=0,d=0;d<this.length;d++)y=-(this.words[d]|0)+_,_=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,v){var h=this.length-l.length,c=this.clone(),d=l,y=d.words[d.length-1]|0,_=this._countBits(y);h=26-_,h!==0&&(d=d.ushln(h),c.iushln(h),y=d.words[d.length-1]|0);var w=c.length-d.length,m;if(v!=="mod"){m=new i(null),m.length=w+1,m.words=new Array(m.length);for(var E=0;E<m.length;E++)m.words[E]=0}var I=c.clone()._ishlnsubmul(d,1,w);I.negative===0&&(c=I,m&&(m.words[w]=1));for(var g=w-1;g>=0;g--){var S=(c.words[d.length+g]|0)*67108864+(c.words[d.length+g-1]|0);for(S=Math.min(S/y|0,67108863),c._ishlnsubmul(d,S,g);c.negative!==0;)S--,c.negative=0,c._ishlnsubmul(d,1,g),c.isZero()||(c.negative^=1);m&&(m.words[g]=S)}return m&&m.strip(),c.strip(),v!=="div"&&h!==0&&c.iushrn(h),{div:m||null,mod:c}},"_wordDiv"),i.prototype.divmod=o(function(l,v,h){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var c,d,y;return this.negative!==0&&l.negative===0?(y=this.neg().divmod(l,v),v!=="mod"&&(c=y.div.neg()),v!=="div"&&(d=y.mod.neg(),h&&d.negative!==0&&d.iadd(l)),{div:c,mod:d}):this.negative===0&&l.negative!==0?(y=this.divmod(l.neg(),v),v!=="mod"&&(c=y.div.neg()),{div:c,mod:y.mod}):(this.negative&l.negative)!==0?(y=this.neg().divmod(l.neg(),v),v!=="div"&&(d=y.mod.neg(),h&&d.negative!==0&&d.isub(l)),{div:y.div,mod:d}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?v==="div"?{div:this.divn(l.words[0]),mod:null}:v==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,v)},"divmod"),i.prototype.div=o(function(l){return this.divmod(l,"div",!1).div},"div"),i.prototype.mod=o(function(l){return this.divmod(l,"mod",!1).mod},"mod"),i.prototype.umod=o(function(l){return this.divmod(l,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(l){var v=this.divmod(l);if(v.mod.isZero())return v.div;var h=v.div.negative!==0?v.mod.isub(l):v.mod,c=l.ushrn(1),d=l.andln(1),y=h.cmp(c);return y<0||d===1&&y===0?v.div:v.div.negative!==0?v.div.isubn(1):v.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(l){t(l<=67108863);for(var v=(1<<26)%l,h=0,c=this.length-1;c>=0;c--)h=(v*h+(this.words[c]|0))%l;return h},"modn"),i.prototype.idivn=o(function(l){t(l<=67108863);for(var v=0,h=this.length-1;h>=0;h--){var c=(this.words[h]|0)+v*67108864;this.words[h]=c/l|0,v=c%l}return this.strip()},"idivn"),i.prototype.divn=o(function(l){return this.clone().idivn(l)},"divn"),i.prototype.egcd=o(function(l){t(l.negative===0),t(!l.isZero());var v=this,h=l.clone();v.negative!==0?v=v.umod(l):v=v.clone();for(var c=new i(1),d=new i(0),y=new i(0),_=new i(1),w=0;v.isEven()&&h.isEven();)v.iushrn(1),h.iushrn(1),++w;for(var m=h.clone(),E=v.clone();!v.isZero();){for(var I=0,g=1;(v.words[0]&g)===0&&I<26;++I,g<<=1);if(I>0)for(v.iushrn(I);I-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(m),d.isub(E)),c.iushrn(1),d.iushrn(1);for(var S=0,ie=1;(h.words[0]&ie)===0&&S<26;++S,ie<<=1);if(S>0)for(h.iushrn(S);S-- >0;)(y.isOdd()||_.isOdd())&&(y.iadd(m),_.isub(E)),y.iushrn(1),_.iushrn(1);v.cmp(h)>=0?(v.isub(h),c.isub(y),d.isub(_)):(h.isub(v),y.isub(c),_.isub(d))}return{a:y,b:_,gcd:h.iushln(w)}},"egcd"),i.prototype._invmp=o(function(l){t(l.negative===0),t(!l.isZero());var v=this,h=l.clone();v.negative!==0?v=v.umod(l):v=v.clone();for(var c=new i(1),d=new i(0),y=h.clone();v.cmpn(1)>0&&h.cmpn(1)>0;){for(var _=0,w=1;(v.words[0]&w)===0&&_<26;++_,w<<=1);if(_>0)for(v.iushrn(_);_-- >0;)c.isOdd()&&c.iadd(y),c.iushrn(1);for(var m=0,E=1;(h.words[0]&E)===0&&m<26;++m,E<<=1);if(m>0)for(h.iushrn(m);m-- >0;)d.isOdd()&&d.iadd(y),d.iushrn(1);v.cmp(h)>=0?(v.isub(h),c.isub(d)):(h.isub(v),d.isub(c))}var I;return v.cmpn(1)===0?I=c:I=d,I.cmpn(0)<0&&I.iadd(l),I},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var v=this.clone(),h=l.clone();v.negative=0,h.negative=0;for(var c=0;v.isEven()&&h.isEven();c++)v.iushrn(1),h.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;h.isEven();)h.iushrn(1);var d=v.cmp(h);if(d<0){var y=v;v=h,h=y}else if(d===0||h.cmpn(1)===0)break;v.isub(h)}while(!0);return h.iushln(c)},"gcd"),i.prototype.invm=o(function(l){return this.egcd(l).a.umod(l)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(l){return this.words[0]&l},"andln"),i.prototype.bincn=o(function(l){t(typeof l=="number");var v=l%26,h=(l-v)/26,c=1<<v;if(this.length<=h)return this._expand(h+1),this.words[h]|=c,this;for(var d=c,y=h;d!==0&&y<this.length;y++){var _=this.words[y]|0;_+=d,d=_>>>26,_&=67108863,this.words[y]=_}return d!==0&&(this.words[y]=d,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(l){var v=l<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this.strip();var h;if(this.length>1)h=1;else{v&&(l=-l),t(l<=67108863,"Number is too big");var c=this.words[0]|0;h=c===l?0:c<l?-1:1}return this.negative!==0?-h|0:h},"cmpn"),i.prototype.cmp=o(function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var v=this.ucmp(l);return this.negative!==0?-v|0:v},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var v=0,h=this.length-1;h>=0;h--){var c=this.words[h]|0,d=l.words[h]|0;if(c!==d){c<d?v=-1:c>d&&(v=1);break}}return v},"ucmp"),i.prototype.gtn=o(function(l){return this.cmpn(l)===1},"gtn"),i.prototype.gt=o(function(l){return this.cmp(l)===1},"gt"),i.prototype.gten=o(function(l){return this.cmpn(l)>=0},"gten"),i.prototype.gte=o(function(l){return this.cmp(l)>=0},"gte"),i.prototype.ltn=o(function(l){return this.cmpn(l)===-1},"ltn"),i.prototype.lt=o(function(l){return this.cmp(l)===-1},"lt"),i.prototype.lten=o(function(l){return this.cmpn(l)<=0},"lten"),i.prototype.lte=o(function(l){return this.cmp(l)<=0},"lte"),i.prototype.eqn=o(function(l){return this.cmpn(l)===0},"eqn"),i.prototype.eq=o(function(l){return this.cmp(l)===0},"eq"),i.red=o(function(l){return new F(l)},"red"),i.prototype.toRed=o(function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},"toRed"),i.prototype.fromRed=o(function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),i.prototype._forceRed=o(function(l){return this.red=l,this},"_forceRed"),i.prototype.forceRed=o(function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},"forceRed"),i.prototype.redAdd=o(function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},"redAdd"),i.prototype.redIAdd=o(function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},"redIAdd"),i.prototype.redSub=o(function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},"redSub"),i.prototype.redISub=o(function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},"redISub"),i.prototype.redShl=o(function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},"redShl"),i.prototype.redMul=o(function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},"redMul"),i.prototype.redIMul=o(function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},"redIMul"),i.prototype.redSqr=o(function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)},"redPow");var B={k256:null,p224:null,p192:null,p25519:null};function z(D,l){this.name=D,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(z,"MPrime"),z.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),z.prototype.ireduce=o(function(l){var v=l,h;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),h=v.bitLength();while(h>this.n);var c=h<this.n?-1:v.ucmp(this.p);return c===0?(v.words[0]=0,v.length=1):c>0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},"ireduce"),z.prototype.split=o(function(l,v){l.iushrn(this.n,0,v)},"split"),z.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function H(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,"K256"),n(H,z),H.prototype.split=o(function(l,v){for(var h=4194303,c=Math.min(l.length,9),d=0;d<c;d++)v.words[d]=l.words[d];if(v.length=c,l.length<=9){l.words[0]=0,l.length=1;return}var y=l.words[9];for(v.words[v.length++]=y&h,d=10;d<l.length;d++){var _=l.words[d]|0;l.words[d-10]=(_&h)<<4|y>>>22,y=_}y>>>=22,l.words[d-10]=y,y===0&&l.length>10?l.length-=10:l.length-=9},"split"),H.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var v=0,h=0;h<l.length;h++){var c=l.words[h]|0;v+=c*977,l.words[h]=v&67108863,v=c*64+(v/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function X(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(X,"P224"),n(X,z);function U(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(U,"P192"),n(U,z);function L(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(L,"P25519"),n(L,z),L.prototype.imulK=o(function(l){for(var v=0,h=0;h<l.length;h++){var c=(l.words[h]|0)*19+v,d=c&67108863;c>>>=26,l.words[h]=d,v=c}return v!==0&&(l.words[l.length++]=v),l},"imulK"),i._prime=o(function(l){if(B[l])return B[l];var v;if(l==="k256")v=new H;else if(l==="p224")v=new X;else if(l==="p192")v=new U;else if(l==="p25519")v=new L;else throw new Error("Unknown prime "+l);return B[l]=v,v},"prime");function F(D){if(typeof D=="string"){var l=i._prime(D);this.m=l.p,this.prime=l}else t(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}o(F,"Red"),F.prototype._verify1=o(function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},"_verify1"),F.prototype._verify2=o(function(l,v){t((l.negative|v.negative)===0,"red works only with positives"),t(l.red&&l.red===v.red,"red works only with red numbers")},"_verify2"),F.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},"imod"),F.prototype.neg=o(function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},"neg"),F.prototype.add=o(function(l,v){this._verify2(l,v);var h=l.add(v);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},"add"),F.prototype.iadd=o(function(l,v){this._verify2(l,v);var h=l.iadd(v);return h.cmp(this.m)>=0&&h.isub(this.m),h},"iadd"),F.prototype.sub=o(function(l,v){this._verify2(l,v);var h=l.sub(v);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},"sub"),F.prototype.isub=o(function(l,v){this._verify2(l,v);var h=l.isub(v);return h.cmpn(0)<0&&h.iadd(this.m),h},"isub"),F.prototype.shl=o(function(l,v){return this._verify1(l),this.imod(l.ushln(v))},"shl"),F.prototype.imul=o(function(l,v){return this._verify2(l,v),this.imod(l.imul(v))},"imul"),F.prototype.mul=o(function(l,v){return this._verify2(l,v),this.imod(l.mul(v))},"mul"),F.prototype.isqr=o(function(l){return this.imul(l,l.clone())},"isqr"),F.prototype.sqr=o(function(l){return this.mul(l,l)},"sqr"),F.prototype.sqrt=o(function(l){if(l.isZero())return l.clone();var v=this.m.andln(3);if(t(v%2===1),v===3){var h=this.m.add(new i(1)).iushrn(2);return this.pow(l,h)}for(var c=this.m.subn(1),d=0;!c.isZero()&&c.andln(1)===0;)d++,c.iushrn(1);t(!c.isZero());var y=new i(1).toRed(this),_=y.redNeg(),w=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new i(2*m*m).toRed(this);this.pow(m,w).cmp(_)!==0;)m.redIAdd(_);for(var E=this.pow(m,c),I=this.pow(l,c.addn(1).iushrn(1)),g=this.pow(l,c),S=d;g.cmp(y)!==0;){for(var ie=g,M=0;ie.cmp(y)!==0;M++)ie=ie.redSqr();t(M<S);var K=this.pow(E,new i(1).iushln(S-M-1));I=I.redMul(K),E=K.redSqr(),g=g.redMul(E),S=M}return I},"sqrt"),F.prototype.invm=o(function(l){var v=l._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},"invm"),F.prototype.pow=o(function(l,v){if(v.isZero())return new i(1).toRed(this);if(v.cmpn(1)===0)return l.clone();var h=4,c=new Array(1<<h);c[0]=new i(1).toRed(this),c[1]=l;for(var d=2;d<c.length;d++)c[d]=this.mul(c[d-1],l);var y=c[0],_=0,w=0,m=v.bitLength()%26;for(m===0&&(m=26),d=v.length-1;d>=0;d--){for(var E=v.words[d],I=m-1;I>=0;I--){var g=E>>I&1;if(y!==c[0]&&(y=this.sqr(y)),g===0&&_===0){w=0;continue}_<<=1,_|=g,w++,!(w!==h&&(d!==0||I!==0))&&(y=this.mul(y,c[_]),w=0,_=0)}m=26}return y},"pow"),F.prototype.convertTo=o(function(l){var v=l.umod(this.m);return v===l?v.clone():v},"convertTo"),F.prototype.convertFrom=o(function(l){var v=l.clone();return v.red=null,v},"convertFrom"),i.mont=o(function(l){return new ne(l)},"mont");function ne(D){F.call(this,D),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(ne,"Mont"),n(ne,F),ne.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),ne.prototype.convertFrom=o(function(l){var v=this.imod(l.mul(this.rinv));return v.red=null,v},"convertFrom"),ne.prototype.imul=o(function(l,v){if(l.isZero()||v.isZero())return l.words[0]=0,l.length=1,l;var h=l.imul(v),c=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=h.isub(c).iushrn(this.shift),y=d;return d.cmp(this.m)>=0?y=d.isub(this.m):d.cmpn(0)<0&&(y=d.iadd(this.m)),y._forceRed(this)},"imul"),ne.prototype.mul=o(function(l,v){if(l.isZero()||v.isZero())return new i(0)._forceRed(this);var h=l.mul(v),c=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=h.isub(c).iushrn(this.shift),y=d;return d.cmp(this.m)>=0?y=d.isub(this.m):d.cmpn(0)<0&&(y=d.iadd(this.m)),y._forceRed(this)},"mul"),ne.prototype.invm=o(function(l){var v=this.imod(l._invmp(this.m).mul(this.r2));return v._forceRed(this)},"invm")})(typeof Qd=="undefined"||Qd,v1)});var Yi=me((rN,x1)=>{x1.exports=y1;function y1(r,e){if(!r)throw new Error(e||"Assertion failed")}o(y1,"assert");y1.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var eh=me(E1=>{"use strict";var Yc=E1;function k_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r!="string"){for(var n=0;n<r.length;n++)t[n]=r[n]|0;return t}if(e==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var n=0;n<r.length;n+=2)t.push(parseInt(r[n]+r[n+1],16))}else for(var n=0;n<r.length;n++){var i=r.charCodeAt(n),s=i>>8,a=i&255;s?t.push(s,a):t.push(a)}return t}o(k_,"toArray");Yc.toArray=k_;function w1(r){return r.length===1?"0"+r:r}o(w1,"zero2");Yc.zero2=w1;function _1(r){for(var e="",t=0;t<r.length;t++)e+=w1(r[t].toString(16));return e}o(_1,"toHex");Yc.toHex=_1;Yc.encode=o(function(e,t){return t==="hex"?_1(e):e},"encode")});var Or=me(S1=>{"use strict";var xn=S1,C_=Wn(),D_=Yi(),Jc=eh();xn.assert=D_;xn.toArray=Jc.toArray;xn.zero2=Jc.zero2;xn.toHex=Jc.toHex;xn.encode=Jc.encode;function I_(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1);n.fill(0);for(var i=1<<e+1,s=r.clone(),a=0;a<n.length;a++){var f,u=s.andln(i-1);s.isOdd()?(u>(i>>1)-1?f=(i>>1)-u:f=u,s.isubn(f)):f=0,n[a]=f,s.iushrn(1)}return n}o(I_,"getNAF");xn.getNAF=I_;function O_(r,e){var t=[[],[]];r=r.clone(),e=e.clone();for(var n=0,i=0,s;r.cmpn(-n)>0||e.cmpn(-i)>0;){var a=r.andln(3)+n&3,f=e.andln(3)+i&3;a===3&&(a=-1),f===3&&(f=-1);var u;(a&1)===0?u=0:(s=r.andln(7)+n&7,(s===3||s===5)&&f===2?u=-a:u=a),t[0].push(u);var p;(f&1)===0?p=0:(s=e.andln(7)+i&7,(s===3||s===5)&&a===2?p=-f:p=f),t[1].push(p),2*n===u+1&&(n=1-n),2*i===p+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(O_,"getJSF");xn.getJSF=O_;function P_(r,e,t){var n="_"+e;r.prototype[e]=o(function(){return this[n]!==void 0?this[n]:this[n]=t.call(this)},"cachedProperty")}o(P_,"cachedProperty");xn.cachedProperty=P_;function N_(r){return typeof r=="string"?xn.toArray(r,"hex"):r}o(N_,"parseBytes");xn.parseBytes=N_;function R_(r){return new C_(r,"hex","le")}o(R_,"intFromLE");xn.intFromLE=R_});var ih=me((oN,nh)=>{var th;nh.exports=o(function(e){return th||(th=new Ji(null)),th.generate(e)},"rand");function Ji(r){this.rand=r}o(Ji,"Rand");nh.exports.Rand=Ji;Ji.prototype.generate=o(function(e){return this._rand(e)},"generate");Ji.prototype._rand=o(function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"_rand");if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Ji.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Ji.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(Ji.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(rh=require("crypto"),typeof rh.randomBytes!="function")throw new Error("Not supported");Ji.prototype._rand=o(function(e){return rh.randomBytes(e)},"_rand")}catch(r){}var rh});var df=me((sN,M1)=>{"use strict";var Ko=Wn(),lf=Or(),Xc=lf.getNAF,L_=lf.getJSF,Zc=lf.assert;function Xi(r,e){this.type=r,this.p=new Ko(e.p,16),this.red=e.prime?Ko.red(e.prime):Ko.mont(this.p),this.zero=new Ko(0).toRed(this.red),this.one=new Ko(1).toRed(this.red),this.two=new Ko(2).toRed(this.red),this.n=e.n&&new Ko(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(Xi,"BaseCurve");M1.exports=Xi;Xi.prototype.point=o(function(){throw new Error("Not implemented")},"point");Xi.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Xi.prototype._fixedNafMul=o(function(e,t){Zc(e.precomputed);var n=e._getDoubles(),i=Xc(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var p=f+n.step-1;p>=f;p--)u=(u<<1)+i[p];a.push(u)}for(var b=this.jpoint(null,null,null),x=this.jpoint(null,null,null),A=s;A>0;A--){for(f=0;f<a.length;f++)u=a[f],u===A?x=x.mixedAdd(n.points[f]):u===-A&&(x=x.mixedAdd(n.points[f].neg()));b=b.add(x)}return b.toP()},"_fixedNafMul");Xi.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Xc(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var p=0;u>=0&&a[u]===0;u--)p++;if(u>=0&&p++,f=f.dblp(p),u<0)break;var b=a[u];Zc(b!==0),e.type==="affine"?b>0?f=f.mixedAdd(s[b-1>>1]):f=f.mixedAdd(s[-b-1>>1].neg()):b>0?f=f.add(s[b-1>>1]):f=f.add(s[-b-1>>1].neg())}return e.type==="affine"?f.toP():f},"_wnafMul");Xi.prototype._wnafMulAdd=o(function(e,t,n,i,s){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,p=0,b,x,A;for(b=0;b<i;b++){A=t[b];var O=A._getNAFPoints(e);a[b]=O.wnd,f[b]=O.points}for(b=i-1;b>=1;b-=2){var T=b-1,k=b;if(a[T]!==1||a[k]!==1){u[T]=Xc(n[T],a[T],this._bitLength),u[k]=Xc(n[k],a[k],this._bitLength),p=Math.max(u[T].length,p),p=Math.max(u[k].length,p);continue}var $=[t[T],null,null,t[k]];t[T].y.cmp(t[k].y)===0?($[1]=t[T].add(t[k]),$[2]=t[T].toJ().mixedAdd(t[k].neg())):t[T].y.cmp(t[k].y.redNeg())===0?($[1]=t[T].toJ().mixedAdd(t[k]),$[2]=t[T].add(t[k].neg())):($[1]=t[T].toJ().mixedAdd(t[k]),$[2]=t[T].toJ().mixedAdd(t[k].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],B=L_(n[T],n[k]);for(p=Math.max(B[0].length,p),u[T]=new Array(p),u[k]=new Array(p),x=0;x<p;x++){var z=B[0][x]|0,H=B[1][x]|0;u[T][x]=C[(z+1)*3+(H+1)],u[k][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),U=this._wnafT4;for(b=p;b>=0;b--){for(var L=0;b>=0;){var F=!0;for(x=0;x<i;x++)U[x]=u[x][b]|0,U[x]!==0&&(F=!1);if(!F)break;L++,b--}if(b>=0&&L++,X=X.dblp(L),b<0)break;for(x=0;x<i;x++){var ne=U[x];ne!==0&&(ne>0?A=f[x][ne-1>>1]:ne<0&&(A=f[x][-ne-1>>1].neg()),A.type==="affine"?X=X.mixedAdd(A):X=X.add(A))}}for(b=0;b<i;b++)f[b]=null;return s?X:X.toP()},"_wnafMulAdd");function rn(r,e){this.curve=r,this.type=e,this.precomputed=null}o(rn,"BasePoint");Xi.BasePoint=rn;rn.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");rn.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Xi.prototype.decodePoint=o(function(e,t){e=lf.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Zc(e[e.length-1]%2===0):e[0]===7&&Zc(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},"decodePoint");rn.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");rn.prototype._encode=o(function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},"_encode");rn.prototype.encode=o(function(e,t){return lf.encode(this._encode(t),e)},"encode");rn.prototype.precompute=o(function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},"precompute");rn.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},"_hasDoubles");rn.prototype._getDoubles=o(function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<t;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");rn.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)t[s]=t[s-1].add(i);return{wnd:e,points:t}},"_getNAFPoints");rn.prototype._getBeta=o(function(){return null},"_getBeta");rn.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var hf=me((aN,oh)=>{typeof Object.create=="function"?oh.exports=o(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):oh.exports=o(function(e,t){if(t){e.super_=t;var n=o(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var T1=me((fN,A1)=>{"use strict";var B_=Or(),Ot=Wn(),sh=hf(),Ys=df(),U_=B_.assert;function nn(r){Ys.call(this,"short",r),this.a=new Ot(r.a,16).toRed(this.red),this.b=new Ot(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(nn,"ShortCurve");sh(nn,Ys);A1.exports=nn;nn.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new Ot(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)n=new Ot(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))===0?n=s[0]:(n=s[1],U_(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(f){return{a:new Ot(f.a,16),b:new Ot(f.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}},"_getEndomorphism");nn.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:Ot.mont(e),n=new Ot(2).toRed(t).redInvm(),i=n.redNeg(),s=new Ot(3).toRed(t).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},"_getEndoRoots");nn.prototype._getEndoBasis=o(function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new Ot(1),a=new Ot(0),f=new Ot(0),u=new Ot(1),p,b,x,A,O,T,k,$=0,C,B;n.cmpn(0)!==0;){var z=i.div(n);C=i.sub(z.mul(n)),B=f.sub(z.mul(s));var H=u.sub(z.mul(a));if(!x&&C.cmp(t)<0)p=k.neg(),b=s,x=C.neg(),A=B;else if(x&&++$===2)break;k=C,i=n,n=C,f=s,s=B,u=a,a=H}O=C.neg(),T=B;var X=x.sqr().add(A.sqr()),U=O.sqr().add(T.sqr());return U.cmp(X)>=0&&(O=p,T=b),x.negative&&(x=x.neg(),A=A.neg()),O.negative&&(O=O.neg(),T=T.neg()),[{a:x,b:A},{a:O,b:T}]},"_getEndoBasis");nn.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),f=s.mul(n.a),u=a.mul(i.a),p=s.mul(n.b),b=a.mul(i.b),x=e.sub(f).sub(u),A=p.add(b).neg();return{k1:x,k2:A}},"_endoSplit");nn.prototype.pointFromX=o(function(e,t){e=new Ot(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");nn.prototype.validate=o(function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate");nn.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var f=this._endoSplit(t[a]),u=e[a],p=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),p=p.neg(!0)),i[a*2]=u,i[a*2+1]=p,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var b=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return b},"_endoWnafMulAdd");function zt(r,e,t,n){Ys.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ot(e,16),this.y=new Ot(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}o(zt,"Point");sh(zt,Ys.BasePoint);nn.prototype.point=o(function(e,t,n){return new zt(this,e,t,n)},"point");nn.prototype.pointFromJSON=o(function(e,t){return zt.fromJSON(this,e,t)},"pointFromJSON");zt.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},"_getBeta");zt.prototype.toJSON=o(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON");zt.fromJSON=o(function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],n);if(!t[2])return i;function s(f){return e.point(f[0],f[1],n)}o(s,"obj2point");var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},"fromJSON");zt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect");zt.prototype.isInfinity=o(function(){return this.inf},"isInfinity");zt.prototype.add=o(function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");zt.prototype.dbl=o(function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},"dbl");zt.prototype.getX=o(function(){return this.x.fromRed()},"getX");zt.prototype.getY=o(function(){return this.y.fromRed()},"getY");zt.prototype.mul=o(function(e){return e=new Ot(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},"mul");zt.prototype.mulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},"mulAdd");zt.prototype.jmulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},"jmulAdd");zt.prototype.eq=o(function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},"eq");zt.prototype.neg=o(function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(s){return s.neg()},"negate");t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},"neg");zt.prototype.toJ=o(function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},"toJ");function Zt(r,e,t,n){Ys.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ot(0)):(this.x=new Ot(e,16),this.y=new Ot(t,16),this.z=new Ot(n,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}o(Zt,"JPoint");sh(Zt,Ys.BasePoint);nn.prototype.jpoint=o(function(e,t,n){return new Zt(this,e,t,n)},"jpoint");Zt.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},"toP");Zt.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Zt.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),p=a.redSub(f);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=u.redSqr(),x=b.redMul(u),A=i.redMul(b),O=p.redSqr().redIAdd(x).redISub(A).redISub(A),T=p.redMul(A.redISub(O)).redISub(a.redMul(x)),k=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(O,T,k)},"add");Zt.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),s=this.y,a=e.y.redMul(t).redMul(this.z),f=n.redSub(i),u=s.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=f.redSqr(),b=p.redMul(f),x=n.redMul(p),A=u.redSqr().redIAdd(b).redISub(x).redISub(x),O=u.redMul(x.redISub(A)).redISub(s.redMul(b)),T=this.z.redMul(f);return this.curve.jpoint(A,O,T)},"mixedAdd");Zt.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,u=this.z,p=u.redSqr().redSqr(),b=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),A=b.redSqr(),O=A.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(p)),k=a.redMul(A),$=T.redSqr().redISub(k.redAdd(k)),C=k.redISub($),B=T.redMul(C);B=B.redIAdd(B).redISub(O);var z=b.redMul(u);t+1<e&&(p=p.redMul(O)),a=$,u=z,b=B}return this.curve.jpoint(a,b.redMul(s),u)},"dblp");Zt.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Zt.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),p=u.redSqr().redISub(f).redISub(f),b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),e=p,t=u.redMul(f.redISub(p)).redISub(b),n=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),A=this.y.redSqr(),O=A.redSqr(),T=this.x.redAdd(A).redSqr().redISub(x).redISub(O);T=T.redIAdd(T);var k=x.redAdd(x).redIAdd(x),$=k.redSqr(),C=O.redIAdd(O);C=C.redIAdd(C),C=C.redIAdd(C),e=$.redISub(T).redISub(T),t=k.redMul(T.redISub(e)).redISub(C),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");Zt.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),p=u.redSqr().redISub(f).redISub(f);e=p;var b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),t=u.redMul(f.redISub(p)).redISub(b),n=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),A=this.y.redSqr(),O=this.x.redMul(A),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var k=O.redIAdd(O);k=k.redIAdd(k);var $=k.redAdd(k);e=T.redSqr().redISub($),n=this.y.redAdd(this.z).redSqr().redISub(A).redISub(x);var C=A.redSqr();C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C),t=T.redMul(k.redISub(e)).redISub(C)}return this.curve.jpoint(e,t,n)},"_threeDbl");Zt.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=t.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),p=t.redAdd(t);p=p.redIAdd(p);var b=p.redMul(f),x=u.redSqr().redISub(b.redAdd(b)),A=b.redISub(x),O=f.redSqr();O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=u.redMul(A).redISub(O),k=n.redAdd(n).redMul(i);return this.curve.jpoint(x,T,k)},"_dbl");Zt.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),i=t.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),f=this.x.redAdd(t).redSqr().redISub(e).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),p=i.redIAdd(i);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var b=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(p),x=t.redMul(b);x=x.redIAdd(x),x=x.redIAdd(x);var A=this.x.redMul(u).redISub(x);A=A.redIAdd(A),A=A.redIAdd(A);var O=this.y.redMul(b.redMul(p.redISub(b)).redISub(f.redMul(u)));O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(A,O,T)},"trpl");Zt.prototype.mul=o(function(e,t){return e=new Ot(e,t),this.curve._wnafMul(this,e)},"mul");Zt.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Zt.prototype.eqXToP=o(function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP");Zt.prototype.inspect=o(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect");Zt.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var D1=me((cN,C1)=>{"use strict";var Js=Wn(),k1=hf(),Qc=df(),F_=Or();function Xs(r){Qc.call(this,"mont",r),this.a=new Js(r.a,16).toRed(this.red),this.b=new Js(r.b,16).toRed(this.red),this.i4=new Js(4).toRed(this.red).redInvm(),this.two=new Js(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Xs,"MontCurve");k1(Xs,Qc);C1.exports=Xs;Xs.prototype.validate=o(function(e){var t=e.normalize().x,n=t.redSqr(),i=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t),s=i.redSqrt();return s.redSqr().cmp(i)===0},"validate");function jt(r,e,t){Qc.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Js(e,16),this.z=new Js(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(jt,"Point");k1(jt,Qc.BasePoint);Xs.prototype.decodePoint=o(function(e,t){return this.point(F_.toArray(e,t),1)},"decodePoint");Xs.prototype.point=o(function(e,t){return new jt(this,e,t)},"point");Xs.prototype.pointFromJSON=o(function(e){return jt.fromJSON(this,e)},"pointFromJSON");jt.prototype.precompute=o(function(){},"precompute");jt.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");jt.fromJSON=o(function(e,t){return new jt(e,t[0],t[1]||e.one)},"fromJSON");jt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect");jt.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");jt.prototype.dbl=o(function(){var e=this.x.redAdd(this.z),t=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=t.redSub(i),a=t.redMul(i),f=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,f)},"dbl");jt.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");jt.prototype.diffAdd=o(function(e,t){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),f=a.redMul(n),u=s.redMul(i),p=t.z.redMul(f.redAdd(u).redSqr()),b=t.x.redMul(f.redISub(u).redSqr());return this.curve.point(p,b)},"diffAdd");jt.prototype.mul=o(function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),s=this,a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var f=a.length-1;f>=0;f--)a[f]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i},"mul");jt.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");jt.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");jt.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");jt.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");jt.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var P1=me((uN,O1)=>{"use strict";var $_=Or(),yi=Wn(),I1=hf(),eu=df(),q_=$_.assert;function Gn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,eu.call(this,"edwards",r),this.a=new yi(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new yi(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new yi(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),q_(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(Gn,"EdwardsCurve");I1(Gn,eu);O1.exports=Gn;Gn.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");Gn.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");Gn.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");Gn.prototype.pointFromX=o(function(e,t){e=new yi(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(s.redInvm()),f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var u=f.fromRed().isOdd();return(t&&!u||!t&&u)&&(f=f.redNeg()),this.point(e,f)},"pointFromX");Gn.prototype.pointFromY=o(function(e,t){e=new yi(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return f.fromRed().isOdd()!==t&&(f=f.redNeg()),this.point(f,e)},"pointFromY");Gn.prototype.validate=o(function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),i=t.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return i.cmp(s)===0},"validate");function Mt(r,e,t,n,i){eu.BasePoint.call(this,r,"projective"),e===null&&t===null&&n===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 yi(e,16),this.y=new yi(t,16),this.z=n?new yi(n,16):this.curve.one,this.t=i&&new yi(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.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()))))}o(Mt,"Point");I1(Mt,eu.BasePoint);Gn.prototype.pointFromJSON=o(function(e){return Mt.fromJSON(this,e)},"pointFromJSON");Gn.prototype.point=o(function(e,t,n,i){return new Mt(this,e,t,n,i)},"point");Mt.fromJSON=o(function(e,t){return new Mt(e,t[0],t[1],t[2])},"fromJSON");Mt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect");Mt.prototype.isInfinity=o(function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},"isInfinity");Mt.prototype._extDbl=o(function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=i.redAdd(t),f=a.redSub(n),u=i.redSub(t),p=s.redMul(f),b=a.redMul(u),x=s.redMul(u),A=f.redMul(a);return this.curve.point(p,b,A,x)},"_extDbl");Mt.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),i,s,a,f,u,p;if(this.curve.twisted){f=this.curve._mulA(t);var b=f.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(b.redSub(this.curve.two)),s=b.redMul(f.redSub(n)),a=b.redSqr().redSub(b).redSub(b)):(u=this.z.redSqr(),p=b.redSub(u).redISub(u),i=e.redSub(t).redISub(n).redMul(p),s=b.redMul(f.redSub(n)),a=b.redMul(p))}else f=t.redAdd(n),u=this.curve._mulC(this.z).redSqr(),p=f.redSub(u).redSub(u),i=this.curve._mulC(e.redISub(f)).redMul(p),s=this.curve._mulC(f).redMul(t.redISub(n)),a=f.redMul(p);return this.curve.point(i,s,a)},"_projDbl");Mt.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");Mt.prototype._extAdd=o(function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(t),f=s.redSub(i),u=s.redAdd(i),p=n.redAdd(t),b=a.redMul(f),x=u.redMul(p),A=a.redMul(p),O=f.redMul(u);return this.curve.point(b,x,O,A)},"_extAdd");Mt.prototype._projAdd=o(function(e){var t=this.z.redMul(e.z),n=t.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(i).redMul(s),f=n.redSub(a),u=n.redAdd(a),p=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),b=t.redMul(f).redMul(p),x,A;return this.curve.twisted?(x=t.redMul(u).redMul(s.redSub(this.curve._mulA(i))),A=f.redMul(u)):(x=t.redMul(u).redMul(s.redSub(i)),A=this.curve._mulC(f).redMul(u)),this.curve.point(b,x,A)},"_projAdd");Mt.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");Mt.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");Mt.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");Mt.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");Mt.prototype.normalize=o(function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},"normalize");Mt.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");Mt.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");Mt.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");Mt.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");Mt.prototype.eqXToP=o(function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),this.x.cmp(t)===0)return!0}},"eqXToP");Mt.prototype.toP=Mt.prototype.normalize;Mt.prototype.mixedAdd=Mt.prototype.add});var ah=me(N1=>{"use strict";var tu=N1;tu.base=df();tu.short=T1();tu.mont=D1();tu.edwards=P1()});var wn=me(wt=>{"use strict";var H_=Yi(),z_=hf();wt.inherits=z_;function j_(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(j_,"isSurrogatePair");function K_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),i=0;i<r.length;i+=2)t.push(parseInt(r[i]+r[i+1],16))}else for(var n=0,i=0;i<r.length;i++){var s=r.charCodeAt(i);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):j_(r,i)?(s=65536+((s&1023)<<10)+(r.charCodeAt(++i)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}else for(i=0;i<r.length;i++)t[i]=r[i]|0;return t}o(K_,"toArray");wt.toArray=K_;function V_(r){for(var e="",t=0;t<r.length;t++)e+=L1(r[t].toString(16));return e}o(V_,"toHex");wt.toHex=V_;function R1(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(R1,"htonl");wt.htonl=R1;function W_(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=R1(i)),t+=B1(i.toString(16))}return t}o(W_,"toHex32");wt.toHex32=W_;function L1(r){return r.length===1?"0"+r:r}o(L1,"zero2");wt.zero2=L1;function B1(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}o(B1,"zero8");wt.zero8=B1;function G_(r,e,t,n){var i=t-e;H_(i%4===0);for(var s=new Array(i/4),a=0,f=e;a<s.length;a++,f+=4){var u;n==="big"?u=r[f]<<24|r[f+1]<<16|r[f+2]<<8|r[f+3]:u=r[f+3]<<24|r[f+2]<<16|r[f+1]<<8|r[f],s[a]=u>>>0}return s}o(G_,"join32");wt.join32=G_;function Y_(r,e){for(var t=new Array(r.length*4),n=0,i=0;n<r.length;n++,i+=4){var s=r[n];e==="big"?(t[i]=s>>>24,t[i+1]=s>>>16&255,t[i+2]=s>>>8&255,t[i+3]=s&255):(t[i+3]=s>>>24,t[i+2]=s>>>16&255,t[i+1]=s>>>8&255,t[i]=s&255)}return t}o(Y_,"split32");wt.split32=Y_;function J_(r,e){return r>>>e|r<<32-e}o(J_,"rotr32");wt.rotr32=J_;function X_(r,e){return r<<e|r>>>32-e}o(X_,"rotl32");wt.rotl32=X_;function Z_(r,e){return r+e>>>0}o(Z_,"sum32");wt.sum32=Z_;function Q_(r,e,t){return r+e+t>>>0}o(Q_,"sum32_3");wt.sum32_3=Q_;function e9(r,e,t,n){return r+e+t+n>>>0}o(e9,"sum32_4");wt.sum32_4=e9;function t9(r,e,t,n,i){return r+e+t+n+i>>>0}o(t9,"sum32_5");wt.sum32_5=t9;function r9(r,e,t,n){var i=r[e],s=r[e+1],a=n+s>>>0,f=(a<n?1:0)+t+i;r[e]=f>>>0,r[e+1]=a}o(r9,"sum64");wt.sum64=r9;function n9(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(n9,"sum64_hi");wt.sum64_hi=n9;function i9(r,e,t,n){var i=e+n;return i>>>0}o(i9,"sum64_lo");wt.sum64_lo=i9;function o9(r,e,t,n,i,s,a,f){var u=0,p=e;p=p+n>>>0,u+=p<e?1:0,p=p+s>>>0,u+=p<s?1:0,p=p+f>>>0,u+=p<f?1:0;var b=r+t+i+a+u;return b>>>0}o(o9,"sum64_4_hi");wt.sum64_4_hi=o9;function s9(r,e,t,n,i,s,a,f){var u=e+n+s+f;return u>>>0}o(s9,"sum64_4_lo");wt.sum64_4_lo=s9;function a9(r,e,t,n,i,s,a,f,u,p){var b=0,x=e;x=x+n>>>0,b+=x<e?1:0,x=x+s>>>0,b+=x<s?1:0,x=x+f>>>0,b+=x<f?1:0,x=x+p>>>0,b+=x<p?1:0;var A=r+t+i+a+u+b;return A>>>0}o(a9,"sum64_5_hi");wt.sum64_5_hi=a9;function f9(r,e,t,n,i,s,a,f,u,p){var b=e+n+s+f+p;return b>>>0}o(f9,"sum64_5_lo");wt.sum64_5_lo=f9;function c9(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(c9,"rotr64_hi");wt.rotr64_hi=c9;function u9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(u9,"rotr64_lo");wt.rotr64_lo=u9;function l9(r,e,t){return r>>>t}o(l9,"shr64_hi");wt.shr64_hi=l9;function d9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(d9,"shr64_lo");wt.shr64_lo=d9});var Zs=me(F1=>{"use strict";var U1=wn(),h9=Yi();function ru(){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}o(ru,"BlockHash");F1.BlockHash=ru;ru.prototype.update=o(function(e,t){if(e=U1.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=U1.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},"update");ru.prototype.digest=o(function(e){return this.update(this._pad()),h9(this.pending===null),this._digest(e)},"digest");ru.prototype._pad=o(function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,i=new Array(n+this.padLength);i[0]=128;for(var s=1;s<n;s++)i[s]=0;if(e<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=e>>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,a=8;a<this.padLength;a++)i[s++]=0;return i},"pad")});var fh=me(xi=>{"use strict";var p9=wn(),Yn=p9.rotr32;function m9(r,e,t,n){if(r===0)return $1(e,t,n);if(r===1||r===3)return H1(e,t,n);if(r===2)return q1(e,t,n)}o(m9,"ft_1");xi.ft_1=m9;function $1(r,e,t){return r&e^~r&t}o($1,"ch32");xi.ch32=$1;function q1(r,e,t){return r&e^r&t^e&t}o(q1,"maj32");xi.maj32=q1;function H1(r,e,t){return r^e^t}o(H1,"p32");xi.p32=H1;function b9(r){return Yn(r,2)^Yn(r,13)^Yn(r,22)}o(b9,"s0_256");xi.s0_256=b9;function g9(r){return Yn(r,6)^Yn(r,11)^Yn(r,25)}o(g9,"s1_256");xi.s1_256=g9;function v9(r){return Yn(r,7)^Yn(r,18)^r>>>3}o(v9,"g0_256");xi.g0_256=v9;function y9(r){return Yn(r,17)^Yn(r,19)^r>>>10}o(y9,"g1_256");xi.g1_256=y9});var K1=me((mN,j1)=>{"use strict";var Qs=wn(),x9=Zs(),w9=fh(),ch=Qs.rotl32,pf=Qs.sum32,_9=Qs.sum32_5,E9=w9.ft_1,z1=x9.BlockHash,S9=[1518500249,1859775393,2400959708,3395469782];function Jn(){if(!(this instanceof Jn))return new Jn;z1.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(Jn,"SHA1");Qs.inherits(Jn,z1);j1.exports=Jn;Jn.blockSize=512;Jn.outSize=160;Jn.hmacStrength=80;Jn.padLength=64;Jn.prototype._update=o(function(e,t){for(var n=this.W,i=0;i<16;i++)n[i]=e[t+i];for(;i<n.length;i++)n[i]=ch(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],p=this.h[4];for(i=0;i<n.length;i++){var b=~~(i/20),x=_9(ch(s,5),E9(b,a,f,u),p,n[i],S9[b]);p=u,u=f,f=ch(a,30),a=s,s=x}this.h[0]=pf(this.h[0],s),this.h[1]=pf(this.h[1],a),this.h[2]=pf(this.h[2],f),this.h[3]=pf(this.h[3],u),this.h[4]=pf(this.h[4],p)},"_update");Jn.prototype._digest=o(function(e){return e==="hex"?Qs.toHex32(this.h,"big"):Qs.split32(this.h,"big")},"digest")});var uh=me((bN,W1)=>{"use strict";var ea=wn(),M9=Zs(),ta=fh(),A9=Yi(),_n=ea.sum32,T9=ea.sum32_4,k9=ea.sum32_5,C9=ta.ch32,D9=ta.maj32,I9=ta.s0_256,O9=ta.s1_256,P9=ta.g0_256,N9=ta.g1_256,V1=M9.BlockHash,R9=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Xn(){if(!(this instanceof Xn))return new Xn;V1.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=R9,this.W=new Array(64)}o(Xn,"SHA256");ea.inherits(Xn,V1);W1.exports=Xn;Xn.blockSize=512;Xn.outSize=256;Xn.hmacStrength=192;Xn.padLength=64;Xn.prototype._update=o(function(e,t){for(var n=this.W,i=0;i<16;i++)n[i]=e[t+i];for(;i<n.length;i++)n[i]=T9(N9(n[i-2]),n[i-7],P9(n[i-15]),n[i-16]);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],p=this.h[4],b=this.h[5],x=this.h[6],A=this.h[7];for(A9(this.k.length===n.length),i=0;i<n.length;i++){var O=k9(A,O9(p),C9(p,b,x),this.k[i],n[i]),T=_n(I9(s),D9(s,a,f));A=x,x=b,b=p,p=_n(u,O),u=f,f=a,a=s,s=_n(O,T)}this.h[0]=_n(this.h[0],s),this.h[1]=_n(this.h[1],a),this.h[2]=_n(this.h[2],f),this.h[3]=_n(this.h[3],u),this.h[4]=_n(this.h[4],p),this.h[5]=_n(this.h[5],b),this.h[6]=_n(this.h[6],x),this.h[7]=_n(this.h[7],A)},"_update");Xn.prototype._digest=o(function(e){return e==="hex"?ea.toHex32(this.h,"big"):ea.split32(this.h,"big")},"digest")});var J1=me((gN,Y1)=>{"use strict";var lh=wn(),G1=uh();function wi(){if(!(this instanceof wi))return new wi;G1.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(wi,"SHA224");lh.inherits(wi,G1);Y1.exports=wi;wi.blockSize=512;wi.outSize=224;wi.hmacStrength=192;wi.padLength=64;wi.prototype._digest=o(function(e){return e==="hex"?lh.toHex32(this.h.slice(0,7),"big"):lh.split32(this.h.slice(0,7),"big")},"digest")});var ph=me((vN,eb)=>{"use strict";var Er=wn(),L9=Zs(),B9=Yi(),Zn=Er.rotr64_hi,Qn=Er.rotr64_lo,X1=Er.shr64_hi,Z1=Er.shr64_lo,Zi=Er.sum64,dh=Er.sum64_hi,hh=Er.sum64_lo,U9=Er.sum64_4_hi,F9=Er.sum64_4_lo,$9=Er.sum64_5_hi,q9=Er.sum64_5_lo,Q1=L9.BlockHash,H9=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function En(){if(!(this instanceof En))return new En;Q1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=H9,this.W=new Array(160)}o(En,"SHA512");Er.inherits(En,Q1);eb.exports=En;En.blockSize=1024;En.outSize=512;En.hmacStrength=192;En.padLength=128;En.prototype._prepareBlock=o(function(e,t){for(var n=this.W,i=0;i<32;i++)n[i]=e[t+i];for(;i<n.length;i+=2){var s=Q9(n[i-4],n[i-3]),a=e7(n[i-4],n[i-3]),f=n[i-14],u=n[i-13],p=X9(n[i-30],n[i-29]),b=Z9(n[i-30],n[i-29]),x=n[i-32],A=n[i-31];n[i]=U9(s,a,f,u,p,b,x,A),n[i+1]=F9(s,a,f,u,p,b,x,A)}},"_prepareBlock");En.prototype._update=o(function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],s=this.h[1],a=this.h[2],f=this.h[3],u=this.h[4],p=this.h[5],b=this.h[6],x=this.h[7],A=this.h[8],O=this.h[9],T=this.h[10],k=this.h[11],$=this.h[12],C=this.h[13],B=this.h[14],z=this.h[15];B9(this.k.length===n.length);for(var H=0;H<n.length;H+=2){var X=B,U=z,L=Y9(A,O),F=J9(A,O),ne=z9(A,O,T,k,$,C),D=j9(A,O,T,k,$,C),l=this.k[H],v=this.k[H+1],h=n[H],c=n[H+1],d=$9(X,U,L,F,ne,D,l,v,h,c),y=q9(X,U,L,F,ne,D,l,v,h,c);X=W9(i,s),U=G9(i,s),L=K9(i,s,a,f,u,p),F=V9(i,s,a,f,u,p);var _=dh(X,U,L,F),w=hh(X,U,L,F);B=$,z=C,$=T,C=k,T=A,k=O,A=dh(b,x,d,y),O=hh(x,x,d,y),b=u,x=p,u=a,p=f,a=i,f=s,i=dh(d,y,_,w),s=hh(d,y,_,w)}Zi(this.h,0,i,s),Zi(this.h,2,a,f),Zi(this.h,4,u,p),Zi(this.h,6,b,x),Zi(this.h,8,A,O),Zi(this.h,10,T,k),Zi(this.h,12,$,C),Zi(this.h,14,B,z)},"_update");En.prototype._digest=o(function(e){return e==="hex"?Er.toHex32(this.h,"big"):Er.split32(this.h,"big")},"digest");function z9(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(z9,"ch64_hi");function j9(r,e,t,n,i,s){var a=e&n^~e&s;return a<0&&(a+=4294967296),a}o(j9,"ch64_lo");function K9(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(K9,"maj64_hi");function V9(r,e,t,n,i,s){var a=e&n^e&s^n&s;return a<0&&(a+=4294967296),a}o(V9,"maj64_lo");function W9(r,e){var t=Zn(r,e,28),n=Zn(e,r,2),i=Zn(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(W9,"s0_512_hi");function G9(r,e){var t=Qn(r,e,28),n=Qn(e,r,2),i=Qn(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(G9,"s0_512_lo");function Y9(r,e){var t=Zn(r,e,14),n=Zn(r,e,18),i=Zn(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(Y9,"s1_512_hi");function J9(r,e){var t=Qn(r,e,14),n=Qn(r,e,18),i=Qn(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(J9,"s1_512_lo");function X9(r,e){var t=Zn(r,e,1),n=Zn(r,e,8),i=X1(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(X9,"g0_512_hi");function Z9(r,e){var t=Qn(r,e,1),n=Qn(r,e,8),i=Z1(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(Z9,"g0_512_lo");function Q9(r,e){var t=Zn(r,e,19),n=Zn(e,r,29),i=X1(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(Q9,"g1_512_hi");function e7(r,e){var t=Qn(r,e,19),n=Qn(e,r,29),i=Z1(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(e7,"g1_512_lo")});var nb=me((yN,rb)=>{"use strict";var mh=wn(),tb=ph();function _i(){if(!(this instanceof _i))return new _i;tb.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(_i,"SHA384");mh.inherits(_i,tb);rb.exports=_i;_i.blockSize=1024;_i.outSize=384;_i.hmacStrength=192;_i.padLength=128;_i.prototype._digest=o(function(e){return e==="hex"?mh.toHex32(this.h.slice(0,12),"big"):mh.split32(this.h.slice(0,12),"big")},"digest")});var ib=me(ra=>{"use strict";ra.sha1=K1();ra.sha224=J1();ra.sha256=uh();ra.sha384=nb();ra.sha512=ph()});var ub=me(cb=>{"use strict";var Vo=wn(),t7=Zs(),nu=Vo.rotl32,ob=Vo.sum32,mf=Vo.sum32_3,sb=Vo.sum32_4,fb=t7.BlockHash;function ei(){if(!(this instanceof ei))return new ei;fb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(ei,"RIPEMD160");Vo.inherits(ei,fb);cb.ripemd160=ei;ei.blockSize=512;ei.outSize=160;ei.hmacStrength=192;ei.padLength=64;ei.prototype._update=o(function(e,t){for(var n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],u=n,p=i,b=s,x=a,A=f,O=0;O<80;O++){var T=ob(nu(sb(n,ab(O,i,s,a),e[i7[O]+t],r7(O)),s7[O]),f);n=f,f=a,a=nu(s,10),s=i,i=T,T=ob(nu(sb(u,ab(79-O,p,b,x),e[o7[O]+t],n7(O)),a7[O]),A),u=A,A=x,x=nu(b,10),b=p,p=T}T=mf(this.h[1],s,x),this.h[1]=mf(this.h[2],a,A),this.h[2]=mf(this.h[3],f,u),this.h[3]=mf(this.h[4],n,p),this.h[4]=mf(this.h[0],i,b),this.h[0]=T},"update");ei.prototype._digest=o(function(e){return e==="hex"?Vo.toHex32(this.h,"little"):Vo.split32(this.h,"little")},"digest");function ab(r,e,t,n){return r<=15?e^t^n:r<=31?e&t|~e&n:r<=47?(e|~t)^n:r<=63?e&n|t&~n:e^(t|~n)}o(ab,"f");function r7(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(r7,"K");function n7(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(n7,"Kh");var i7=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],o7=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s7=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],a7=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var db=me((_N,lb)=>{"use strict";var f7=wn(),c7=Yi();function na(r,e,t){if(!(this instanceof na))return new na(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(f7.toArray(e,t))}o(na,"Hmac");lb.exports=na;na.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),c7(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},"init");na.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");na.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var bf=me(hb=>{var Qt=hb;Qt.utils=wn();Qt.common=Zs();Qt.sha=ib();Qt.ripemd=ub();Qt.hmac=db();Qt.sha1=Qt.sha.sha1;Qt.sha256=Qt.sha.sha256;Qt.sha224=Qt.sha.sha224;Qt.sha384=Qt.sha.sha384;Qt.sha512=Qt.sha.sha512;Qt.ripemd160=Qt.ripemd.ripemd160});var mb=me((SN,pb)=>{pb.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var iu=me(vb=>{"use strict";var gh=vb,Qi=bf(),bh=ah(),u7=Or(),bb=u7.assert;function gb(r){r.type==="short"?this.curve=new bh.short(r):r.type==="edwards"?this.curve=new bh.edwards(r):this.curve=new bh.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,bb(this.g.validate(),"Invalid curve"),bb(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(gb,"PresetCurve");gh.PresetCurve=gb;function eo(r,e){Object.defineProperty(gh,r,{configurable:!0,enumerable:!0,get:function(){var t=new gb(e);return Object.defineProperty(gh,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(eo,"defineCurve");eo("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Qi.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});eo("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Qi.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});eo("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Qi.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});eo("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Qi.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});eo("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Qi.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});eo("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qi.sha256,gRed:!1,g:["9"]});eo("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qi.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var vh;try{vh=mb()}catch(r){vh=void 0}eo("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Qi.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",vh]})});var wb=me((AN,xb)=>{"use strict";var l7=bf(),Wo=eh(),yb=Yi();function to(r){if(!(this instanceof to))return new to(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Wo.toArray(r.entropy,r.entropyEnc||"hex"),t=Wo.toArray(r.nonce,r.nonceEnc||"hex"),n=Wo.toArray(r.pers,r.persEnc||"hex");yb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(to,"HmacDRBG");xb.exports=to;to.prototype._init=o(function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");to.prototype._hmac=o(function(){return new l7.hmac(this.hash,this.K)},"hmac");to.prototype._update=o(function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},"update");to.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Wo.toArray(e,t),n=Wo.toArray(n,i),yb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");to.prototype.generate=o(function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=n,n=t,t=null),n&&(n=Wo.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(n),this._reseed++,Wo.encode(a,t)},"generate")});var Eb=me((TN,_b)=>{"use strict";var d7=Wn(),h7=Or(),yh=h7.assert;function ar(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(ar,"KeyPair");_b.exports=ar;ar.fromPublic=o(function(e,t,n){return t instanceof ar?t:new ar(e,{pub:t,pubEnc:n})},"fromPublic");ar.fromPrivate=o(function(e,t,n){return t instanceof ar?t:new ar(e,{priv:t,privEnc:n})},"fromPrivate");ar.prototype.validate=o(function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate");ar.prototype.getPublic=o(function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},"getPublic");ar.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");ar.prototype._importPrivate=o(function(e,t){this.priv=new d7(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");ar.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?yh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&yh(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},"_importPublic");ar.prototype.derive=o(function(e){return e.validate()||yh(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");ar.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");ar.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");ar.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var Ab=me((kN,Mb)=>{"use strict";var ou=Wn(),_h=Or(),p7=_h.assert;function su(r,e){if(r instanceof su)return r;this._importDER(r,e)||(p7(r.r&&r.s,"Signature without r or s"),this.r=new ou(r.r,16),this.s=new ou(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(su,"Signature");Mb.exports=su;function m7(){this.place=0}o(m7,"Position");function xh(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=r[a],i>>>=0;return i<=127?!1:(e.place=a,i)}o(xh,"getLength");function Sb(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}o(Sb,"rmPadding");su.prototype._importDER=o(function(e,t){e=_h.toArray(e,t);var n=new m7;if(e[n.place++]!==48)return!1;var i=xh(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=xh(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var f=xh(e,n);if(f===!1||e.length!==f+n.place)return!1;var u=e.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new ou(a),this.s=new ou(u),this.recoveryParam=null,!0},"_importDER");function wh(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}o(wh,"constructLength");su.prototype.toDER=o(function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=Sb(t),n=Sb(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];wh(i,t.length),i=i.concat(t),i.push(2),wh(i,n.length);var s=i.concat(n),a=[48];return wh(a,s.length),a=a.concat(s),_h.encode(a,e)},"toDER")});var Db=me((CN,Cb)=>{"use strict";var Go=Wn(),Tb=wb(),b7=Or(),Eh=iu(),g7=ih(),kb=b7.assert,Sh=Eb(),au=Ab();function on(r){if(!(this instanceof on))return new on(r);typeof r=="string"&&(kb(Object.prototype.hasOwnProperty.call(Eh,r),"Unknown curve "+r),r=Eh[r]),r instanceof Eh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}o(on,"EC");Cb.exports=on;on.prototype.keyPair=o(function(e){return new Sh(this,e)},"keyPair");on.prototype.keyFromPrivate=o(function(e,t){return Sh.fromPrivate(this,e,t)},"keyFromPrivate");on.prototype.keyFromPublic=o(function(e,t){return Sh.fromPublic(this,e,t)},"keyFromPublic");on.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Tb({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||g7(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Go(2));;){var s=new Go(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");on.prototype._truncateToN=o(function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");on.prototype.sign=o(function(e,t,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Go(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),f=e.toArray("be",s),u=new Tb({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new Go(1)),b=0;;b++){var x=i.k?i.k(b):new Go(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(p)>=0)){var A=this.g.mul(x);if(!A.isInfinity()){var O=A.getX(),T=O.umod(this.n);if(T.cmpn(0)!==0){var k=x.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(k=k.umod(this.n),k.cmpn(0)!==0){var $=(A.getY().isOdd()?1:0)|(O.cmp(T)!==0?2:0);return i.canonical&&k.cmp(this.nh)>0&&(k=this.n.sub(k),$^=1),new au({r:T,s:k,recoveryParam:$})}}}}}},"sign");on.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Go(e,16)),n=this.keyFromPublic(n,i),t=new au(t,"hex");var s=t.r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(e).umod(this.n),p=f.mul(s).umod(this.n),b;return this.curve._maxwellTrick?(b=this.g.jmulAdd(u,n.getPublic(),p),b.isInfinity()?!1:b.eqXToP(s)):(b=this.g.mulAdd(u,n.getPublic(),p),b.isInfinity()?!1:b.getX().umod(this.n).cmp(s)===0)},"verify");on.prototype.recoverPubKey=function(r,e,t,n){kb((3&t)===t,"The recovery param is more than two bits"),e=new au(e,n);var i=this.n,s=new Go(r),a=e.r,f=e.s,u=t&1,p=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var b=e.r.invm(i),x=i.sub(s).mul(b).umod(i),A=f.mul(b).umod(i);return this.g.mulAdd(x,a,A)};on.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new au(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(a){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}});var Nb=me((DN,Pb)=>{"use strict";var gf=Or(),Ob=gf.assert,Ib=gf.parseBytes,ia=gf.cachedProperty;function Kt(r,e){this.eddsa=r,this._secret=Ib(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Ib(e.pub)}o(Kt,"KeyPair");Kt.fromPublic=o(function(e,t){return t instanceof Kt?t:new Kt(e,{pub:t})},"fromPublic");Kt.fromSecret=o(function(e,t){return t instanceof Kt?t:new Kt(e,{secret:t})},"fromSecret");Kt.prototype.secret=o(function(){return this._secret},"secret");ia(Kt,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));ia(Kt,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));ia(Kt,"privBytes",o(function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i},"privBytes"));ia(Kt,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));ia(Kt,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));ia(Kt,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Kt.prototype.sign=o(function(e){return Ob(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Kt.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Kt.prototype.getSecret=o(function(e){return Ob(this._secret,"KeyPair is public only"),gf.encode(this.secret(),e)},"getSecret");Kt.prototype.getPublic=o(function(e){return gf.encode(this.pubBytes(),e)},"getPublic");Pb.exports=Kt});var Lb=me((IN,Rb)=>{"use strict";var v7=Wn(),fu=Or(),y7=fu.assert,cu=fu.cachedProperty,x7=fu.parseBytes;function Yo(r,e){this.eddsa=r,typeof e!="object"&&(e=x7(e)),Array.isArray(e)&&(e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),y7(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof v7&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(Yo,"Signature");cu(Yo,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));cu(Yo,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));cu(Yo,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));cu(Yo,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Yo.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Yo.prototype.toHex=o(function(){return fu.encode(this.toBytes(),"hex").toUpperCase()},"toHex");Rb.exports=Yo});var qb=me((ON,$b)=>{"use strict";var w7=bf(),_7=iu(),oa=Or(),E7=oa.assert,Ub=oa.parseBytes,Fb=Nb(),Bb=Lb();function Sr(r){if(E7(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Sr))return new Sr(r);r=_7[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=w7.sha512}o(Sr,"EDDSA");$b.exports=Sr;Sr.prototype.sign=o(function(e,t){e=Ub(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),a=this.encodePoint(s),f=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),u=i.add(f).umod(this.curve.n);return this.makeSignature({R:s,S:u,Rencoded:a})},"sign");Sr.prototype.verify=o(function(e,t,n){e=Ub(e),t=this.makeSignature(t);var i=this.keyFromPublic(n),s=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S()),f=t.R().add(i.pub().mul(s));return f.eq(a)},"verify");Sr.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return oa.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");Sr.prototype.keyFromPublic=o(function(e){return Fb.fromPublic(this,e)},"keyFromPublic");Sr.prototype.keyFromSecret=o(function(e){return Fb.fromSecret(this,e)},"keyFromSecret");Sr.prototype.makeSignature=o(function(e){return e instanceof Bb?e:new Bb(this,e)},"makeSignature");Sr.prototype.encodePoint=o(function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},"encodePoint");Sr.prototype.decodePoint=o(function(e){e=oa.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=oa.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");Sr.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");Sr.prototype.decodeInt=o(function(e){return oa.intFromLE(e)},"decodeInt");Sr.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var zb=me(Hb=>{"use strict";var Jo=Hb;Jo.version=g1().version;Jo.utils=Or();Jo.rand=ih();Jo.curve=ah();Jo.curves=iu();Jo.ec=Db();Jo.eddsa=qb()});var Kb=me(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});var jb=65536,S7=function(){function r(){this.isAvailable=!1,this.isInstantiated=!1;var e=typeof self!="undefined"?self.crypto||self.msCrypto:null;e&&e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}return o(r,"BrowserRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var t=new Uint8Array(e),n=0;n<t.length;n+=jb)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,jb)));return t},r}();Mh.BrowserRandomSource=S7});var Vb=me(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});var M7=tn(),A7=function(){function r(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require!="undefined"){var e=require("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}return o(r,"NodeRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");var t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");for(var n=new Uint8Array(e),i=0;i<n.length;i++)n[i]=t[i];return M7.wipe(t),n},r}();Ah.NodeRandomSource=A7});var Wb=me(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var T7=Kb(),k7=Vb(),C7=function(){function r(){if(this.isAvailable=!1,this.name="",this._source=new T7.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new k7.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}return o(r,"SystemRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)},r}();Th.SystemRandomSource=C7});var ro=me(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var D7=Wb(),I7=jo(),Gb=tn();Sn.defaultRandomSource=new D7.SystemRandomSource;function kh(r,e){return e===void 0&&(e=Sn.defaultRandomSource),e.randomBytes(r)}o(kh,"randomBytes");Sn.randomBytes=kh;function O7(r){r===void 0&&(r=Sn.defaultRandomSource);var e=kh(4,r),t=I7.readUint32LE(e);return Gb.wipe(e),t}o(O7,"randomUint32");Sn.randomUint32=O7;var Yb="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Jb(r,e,t){if(e===void 0&&(e=Yb),t===void 0&&(t=Sn.defaultRandomSource),e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");for(var n="",i=e.length,s=256-256%i;r>0;){for(var a=kh(Math.ceil(r*256/s),t),f=0;f<a.length&&r>0;f++){var u=a[f];u<s&&(n+=e.charAt(u%i),r--)}Gb.wipe(a)}return n}o(Jb,"randomString");Sn.randomString=Jb;function P7(r,e,t){e===void 0&&(e=Yb),t===void 0&&(t=Sn.defaultRandomSource);var n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return Jb(n,e,t)}o(P7,"randomStringForEntropy");Sn.randomStringForEntropy=P7});var Qb=me(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var aa=jo(),sa=tn();Ei.DIGEST_LENGTH=64;Ei.BLOCK_SIZE=128;var Zb=function(){function r(){this.digestLength=Ei.DIGEST_LENGTH,this.blockSize=Ei.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o(r,"SHA512"),r.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){sa.wipe(this._buffer),sa.wipe(this._tempHi),sa.wipe(this._tempLo),this.reset()},r.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<Ei.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Ch(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Ch(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,s=t<<3,a=t%128<112?128:256;this._buffer[n]=128;for(var f=n+1;f<a-8;f++)this._buffer[f]=0;aa.writeUint32BE(i,this._buffer,a-8),aa.writeUint32BE(s,this._buffer,a-4),Ch(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/8;f++)aa.writeUint32BE(this._stateHi[f],e,f*8),aa.writeUint32BE(this._stateLo[f],e,f*8+4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},r.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){sa.wipe(e.stateHi),sa.wipe(e.stateLo),e.buffer&&sa.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Ei.SHA512=Zb;var Xb=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function Ch(r,e,t,n,i,s,a){for(var f=t[0],u=t[1],p=t[2],b=t[3],x=t[4],A=t[5],O=t[6],T=t[7],k=n[0],$=n[1],C=n[2],B=n[3],z=n[4],H=n[5],X=n[6],U=n[7],L,F,ne,D,l,v,h,c;a>=128;){for(var d=0;d<16;d++){var y=8*d+s;r[d]=aa.readUint32BE(i,y),e[d]=aa.readUint32BE(i,y+4)}for(var d=0;d<80;d++){var _=f,w=u,m=p,E=b,I=x,g=A,S=O,ie=T,M=k,K=$,J=C,N=B,R=z,V=H,W=X,ee=U;if(L=T,F=U,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=(x>>>14|z<<32-14)^(x>>>18|z<<32-18)^(z>>>41-32|x<<32-(41-32)),F=(z>>>14|x<<32-14)^(z>>>18|x<<32-18)^(x>>>41-32|z<<32-(41-32)),l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,L=x&A^~x&O,F=z&H^~z&X,l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,L=Xb[d*2],F=Xb[d*2+1],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,L=r[d%16],F=e[d%16],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,ne=h&65535|c<<16,D=l&65535|v<<16,L=ne,F=D,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=(f>>>28|k<<32-28)^(k>>>34-32|f<<32-(34-32))^(k>>>39-32|f<<32-(39-32)),F=(k>>>28|f<<32-28)^(f>>>34-32|k<<32-(34-32))^(f>>>39-32|k<<32-(39-32)),l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,L=f&u^f&p^u&p,F=k&$^k&C^$&C,l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,ie=h&65535|c<<16,ee=l&65535|v<<16,L=E,F=N,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=ne,F=D,l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,E=h&65535|c<<16,N=l&65535|v<<16,u=_,p=w,b=m,x=E,A=I,O=g,T=S,f=ie,$=M,C=K,B=J,z=N,H=R,X=V,U=W,k=ee,d%16===15)for(var y=0;y<16;y++)L=r[y],F=e[y],l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=r[(y+9)%16],F=e[(y+9)%16],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,ne=r[(y+1)%16],D=e[(y+1)%16],L=(ne>>>1|D<<32-1)^(ne>>>8|D<<32-8)^ne>>>7,F=(D>>>1|ne<<32-1)^(D>>>8|ne<<32-8)^(D>>>7|ne<<32-7),l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,ne=r[(y+14)%16],D=e[(y+14)%16],L=(ne>>>19|D<<32-19)^(D>>>61-32|ne<<32-(61-32))^ne>>>6,F=(D>>>19|ne<<32-19)^(ne>>>61-32|D<<32-(61-32))^(D>>>6|ne<<32-6),l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,r[y]=h&65535|c<<16,e[y]=l&65535|v<<16}L=f,F=k,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[0],F=n[0],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[0]=f=h&65535|c<<16,n[0]=k=l&65535|v<<16,L=u,F=$,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[1],F=n[1],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[1]=u=h&65535|c<<16,n[1]=$=l&65535|v<<16,L=p,F=C,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[2],F=n[2],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[2]=p=h&65535|c<<16,n[2]=C=l&65535|v<<16,L=b,F=B,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[3],F=n[3],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[3]=b=h&65535|c<<16,n[3]=B=l&65535|v<<16,L=x,F=z,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[4],F=n[4],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[4]=x=h&65535|c<<16,n[4]=z=l&65535|v<<16,L=A,F=H,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[5],F=n[5],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[5]=A=h&65535|c<<16,n[5]=H=l&65535|v<<16,L=O,F=X,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[6],F=n[6],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[6]=O=h&65535|c<<16,n[6]=X=l&65535|v<<16,L=T,F=U,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[7],F=n[7],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[7]=T=h&65535|c<<16,n[7]=U=l&65535|v<<16,s+=128,a-=128}return s}o(Ch,"hashBlocks");function N7(r){var e=new Zb;e.update(r);var t=e.digest();return e.clean(),t}o(N7,"hash");Ei.hash=N7});var uu=me($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var R7=ro(),vf=Qb(),ig=tn();$t.SIGNATURE_LENGTH=64;$t.PUBLIC_KEY_LENGTH=32;$t.SECRET_KEY_LENGTH=64;$t.SEED_LENGTH=32;function Ce(r){var e=new Float64Array(16);if(r)for(var t=0;t<r.length;t++)e[t]=r[t];return e}o(Ce,"gf");var L7=new Uint8Array(32);L7[0]=9;var Oh=Ce(),fa=Ce([1]),B7=Ce([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),U7=Ce([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),eg=Ce([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),tg=Ce([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),F7=Ce([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function no(r,e){for(var t=0;t<16;t++)r[t]=e[t]|0}o(no,"set25519");function Dh(r){for(var e=1,t=0;t<16;t++){var n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Dh,"car25519");function og(r,e,t){for(var n=~(t-1),i=0;i<16;i++){var s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(og,"sel25519");function yf(r,e){for(var t=Ce(),n=Ce(),i=0;i<16;i++)n[i]=e[i];Dh(n),Dh(n),Dh(n);for(var s=0;s<2;s++){t[0]=n[0]-65517;for(var i=1;i<15;i++)t[i]=n[i]-65535-(t[i-1]>>16&1),t[i-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);var a=t[15]>>16&1;t[14]&=65535,og(n,t,1-a)}for(var i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(yf,"pack25519");function sg(r,e){for(var t=0,n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(sg,"verify32");function rg(r,e){var t=new Uint8Array(32),n=new Uint8Array(32);return yf(t,r),yf(n,e),sg(t,n)}o(rg,"neq25519");function ag(r){var e=new Uint8Array(32);return yf(e,r),e[0]&1}o(ag,"par25519");function $7(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o($7,"unpack25519");function Xo(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(Xo,"add");function Qo(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(Qo,"sub");function vt(r,e,t){var n,i,s=0,a=0,f=0,u=0,p=0,b=0,x=0,A=0,O=0,T=0,k=0,$=0,C=0,B=0,z=0,H=0,X=0,U=0,L=0,F=0,ne=0,D=0,l=0,v=0,h=0,c=0,d=0,y=0,_=0,w=0,m=0,E=t[0],I=t[1],g=t[2],S=t[3],ie=t[4],M=t[5],K=t[6],J=t[7],N=t[8],R=t[9],V=t[10],W=t[11],ee=t[12],he=t[13],fe=t[14],Y=t[15];n=e[0],s+=n*E,a+=n*I,f+=n*g,u+=n*S,p+=n*ie,b+=n*M,x+=n*K,A+=n*J,O+=n*N,T+=n*R,k+=n*V,$+=n*W,C+=n*ee,B+=n*he,z+=n*fe,H+=n*Y,n=e[1],a+=n*E,f+=n*I,u+=n*g,p+=n*S,b+=n*ie,x+=n*M,A+=n*K,O+=n*J,T+=n*N,k+=n*R,$+=n*V,C+=n*W,B+=n*ee,z+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*E,u+=n*I,p+=n*g,b+=n*S,x+=n*ie,A+=n*M,O+=n*K,T+=n*J,k+=n*N,$+=n*R,C+=n*V,B+=n*W,z+=n*ee,H+=n*he,X+=n*fe,U+=n*Y,n=e[3],u+=n*E,p+=n*I,b+=n*g,x+=n*S,A+=n*ie,O+=n*M,T+=n*K,k+=n*J,$+=n*N,C+=n*R,B+=n*V,z+=n*W,H+=n*ee,X+=n*he,U+=n*fe,L+=n*Y,n=e[4],p+=n*E,b+=n*I,x+=n*g,A+=n*S,O+=n*ie,T+=n*M,k+=n*K,$+=n*J,C+=n*N,B+=n*R,z+=n*V,H+=n*W,X+=n*ee,U+=n*he,L+=n*fe,F+=n*Y,n=e[5],b+=n*E,x+=n*I,A+=n*g,O+=n*S,T+=n*ie,k+=n*M,$+=n*K,C+=n*J,B+=n*N,z+=n*R,H+=n*V,X+=n*W,U+=n*ee,L+=n*he,F+=n*fe,ne+=n*Y,n=e[6],x+=n*E,A+=n*I,O+=n*g,T+=n*S,k+=n*ie,$+=n*M,C+=n*K,B+=n*J,z+=n*N,H+=n*R,X+=n*V,U+=n*W,L+=n*ee,F+=n*he,ne+=n*fe,D+=n*Y,n=e[7],A+=n*E,O+=n*I,T+=n*g,k+=n*S,$+=n*ie,C+=n*M,B+=n*K,z+=n*J,H+=n*N,X+=n*R,U+=n*V,L+=n*W,F+=n*ee,ne+=n*he,D+=n*fe,l+=n*Y,n=e[8],O+=n*E,T+=n*I,k+=n*g,$+=n*S,C+=n*ie,B+=n*M,z+=n*K,H+=n*J,X+=n*N,U+=n*R,L+=n*V,F+=n*W,ne+=n*ee,D+=n*he,l+=n*fe,v+=n*Y,n=e[9],T+=n*E,k+=n*I,$+=n*g,C+=n*S,B+=n*ie,z+=n*M,H+=n*K,X+=n*J,U+=n*N,L+=n*R,F+=n*V,ne+=n*W,D+=n*ee,l+=n*he,v+=n*fe,h+=n*Y,n=e[10],k+=n*E,$+=n*I,C+=n*g,B+=n*S,z+=n*ie,H+=n*M,X+=n*K,U+=n*J,L+=n*N,F+=n*R,ne+=n*V,D+=n*W,l+=n*ee,v+=n*he,h+=n*fe,c+=n*Y,n=e[11],$+=n*E,C+=n*I,B+=n*g,z+=n*S,H+=n*ie,X+=n*M,U+=n*K,L+=n*J,F+=n*N,ne+=n*R,D+=n*V,l+=n*W,v+=n*ee,h+=n*he,c+=n*fe,d+=n*Y,n=e[12],C+=n*E,B+=n*I,z+=n*g,H+=n*S,X+=n*ie,U+=n*M,L+=n*K,F+=n*J,ne+=n*N,D+=n*R,l+=n*V,v+=n*W,h+=n*ee,c+=n*he,d+=n*fe,y+=n*Y,n=e[13],B+=n*E,z+=n*I,H+=n*g,X+=n*S,U+=n*ie,L+=n*M,F+=n*K,ne+=n*J,D+=n*N,l+=n*R,v+=n*V,h+=n*W,c+=n*ee,d+=n*he,y+=n*fe,_+=n*Y,n=e[14],z+=n*E,H+=n*I,X+=n*g,U+=n*S,L+=n*ie,F+=n*M,ne+=n*K,D+=n*J,l+=n*N,v+=n*R,h+=n*V,c+=n*W,d+=n*ee,y+=n*he,_+=n*fe,w+=n*Y,n=e[15],H+=n*E,X+=n*I,U+=n*g,L+=n*S,F+=n*ie,ne+=n*M,D+=n*K,l+=n*J,v+=n*N,h+=n*R,c+=n*V,d+=n*W,y+=n*ee,_+=n*he,w+=n*fe,m+=n*Y,s+=38*X,a+=38*U,f+=38*L,u+=38*F,p+=38*ne,b+=38*D,x+=38*l,A+=38*v,O+=38*h,T+=38*c,k+=38*d,$+=38*y,C+=38*_,B+=38*w,z+=38*m,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=A+i+65535,i=Math.floor(n/65536),A=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=A+i+65535,i=Math.floor(n/65536),A=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=a,r[2]=f,r[3]=u,r[4]=p,r[5]=b,r[6]=x,r[7]=A,r[8]=O,r[9]=T,r[10]=k,r[11]=$,r[12]=C,r[13]=B,r[14]=z,r[15]=H}o(vt,"mul");function Zo(r,e){vt(r,e,e)}o(Zo,"square");function fg(r,e){var t=Ce(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)Zo(t,t),n!==2&&n!==4&&vt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(fg,"inv25519");function q7(r,e){var t=Ce(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)Zo(t,t),n!==1&&vt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(q7,"pow2523");function Ph(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce(),p=Ce(),b=Ce();Qo(t,r[1],r[0]),Qo(b,e[1],e[0]),vt(t,t,b),Xo(n,r[0],r[1]),Xo(b,e[0],e[1]),vt(n,n,b),vt(i,r[3],e[3]),vt(i,i,U7),vt(s,r[2],e[2]),Xo(s,s,s),Qo(a,n,t),Qo(f,s,i),Xo(u,s,i),Xo(p,n,t),vt(r[0],a,f),vt(r[1],p,u),vt(r[2],u,f),vt(r[3],a,p)}o(Ph,"edadd");function ng(r,e,t){for(var n=0;n<4;n++)og(r[n],e[n],t)}o(ng,"cswap");function Rh(r,e){var t=Ce(),n=Ce(),i=Ce();fg(i,e[2]),vt(t,e[0],i),vt(n,e[1],i),yf(r,n),r[31]^=ag(t)<<7}o(Rh,"pack");function cg(r,e,t){no(r[0],Oh),no(r[1],fa),no(r[2],fa),no(r[3],Oh);for(var n=255;n>=0;--n){var i=t[n/8|0]>>(n&7)&1;ng(r,e,i),Ph(e,r),Ph(r,r),ng(r,e,i)}}o(cg,"scalarmult");function Lh(r,e){var t=[Ce(),Ce(),Ce(),Ce()];no(t[0],eg),no(t[1],tg),no(t[2],fa),vt(t[3],eg,tg),cg(r,t,e)}o(Lh,"scalarbase");function ug(r){if(r.length!==$t.SEED_LENGTH)throw new Error("ed25519: seed must be "+$t.SEED_LENGTH+" bytes");var e=vf.hash(r);e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(32),n=[Ce(),Ce(),Ce(),Ce()];Lh(n,e),Rh(t,n);var i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(ug,"generateKeyPairFromSeed");$t.generateKeyPairFromSeed=ug;function H7(r){var e=R7.randomBytes(32,r),t=ug(e);return ig.wipe(e),t}o(H7,"generateKeyPair");$t.generateKeyPair=H7;function z7(r){if(r.length!==$t.SECRET_KEY_LENGTH)throw new Error("ed25519: secret key must be "+$t.SECRET_KEY_LENGTH+" bytes");return new Uint8Array(r.subarray(32))}o(z7,"extractPublicKeyFromSecretKey");$t.extractPublicKeyFromSecretKey=z7;var Ih=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function lg(r,e){var t,n,i,s;for(n=63;n>=32;--n){for(t=0,i=n-32,s=n-12;i<s;++i)e[i]+=t-16*e[n]*Ih[i-(n-32)],t=Math.floor((e[i]+128)/256),e[i]-=t*256;e[i]+=t,e[n]=0}for(t=0,i=0;i<32;i++)e[i]+=t-(e[31]>>4)*Ih[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*Ih[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(lg,"modL");function Nh(r){for(var e=new Float64Array(64),t=0;t<64;t++)e[t]=r[t];for(var t=0;t<64;t++)r[t]=0;lg(r,e)}o(Nh,"reduce");function j7(r,e){var t=new Float64Array(64),n=[Ce(),Ce(),Ce(),Ce()],i=vf.hash(r.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;var s=new Uint8Array(64);s.set(i.subarray(32),32);var a=new vf.SHA512;a.update(s.subarray(32)),a.update(e);var f=a.digest();a.clean(),Nh(f),Lh(n,f),Rh(s,n),a.reset(),a.update(s.subarray(0,32)),a.update(r.subarray(32)),a.update(e);var u=a.digest();Nh(u);for(var p=0;p<32;p++)t[p]=f[p];for(var p=0;p<32;p++)for(var b=0;b<32;b++)t[p+b]+=u[p]*i[b];return lg(s.subarray(32),t),s}o(j7,"sign");$t.sign=j7;function dg(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce();return no(r[2],fa),$7(r[1],e),Zo(i,r[1]),vt(s,i,B7),Qo(i,i,r[2]),Xo(s,r[2],s),Zo(a,s),Zo(f,a),vt(u,f,a),vt(t,u,i),vt(t,t,s),q7(t,t),vt(t,t,i),vt(t,t,s),vt(t,t,s),vt(r[0],t,s),Zo(n,r[0]),vt(n,n,s),rg(n,i)&&vt(r[0],r[0],F7),Zo(n,r[0]),vt(n,n,s),rg(n,i)?-1:(ag(r[0])===e[31]>>7&&Qo(r[0],Oh,r[0]),vt(r[3],r[0],r[1]),0)}o(dg,"unpackneg");function K7(r,e,t){var n=new Uint8Array(32),i=[Ce(),Ce(),Ce(),Ce()],s=[Ce(),Ce(),Ce(),Ce()];if(t.length!==$t.SIGNATURE_LENGTH)throw new Error("ed25519: signature must be "+$t.SIGNATURE_LENGTH+" bytes");if(dg(s,r))return!1;var a=new vf.SHA512;a.update(t.subarray(0,32)),a.update(r),a.update(e);var f=a.digest();return Nh(f),cg(i,s,f),Lh(s,t.subarray(32)),Ph(i,s),Rh(n,i),!sg(t,n)}o(K7,"verify");$t.verify=K7;function V7(r){var e=[Ce(),Ce(),Ce(),Ce()];if(dg(e,r))throw new Error("Ed25519: invalid public key");var t=Ce(),n=Ce(),i=e[1];Xo(t,fa,i),Qo(n,fa,i),fg(n,n),vt(t,t,n);var s=new Uint8Array(32);return yf(s,t),s}o(V7,"convertPublicKeyToX25519");$t.convertPublicKeyToX25519=V7;function W7(r){var e=vf.hash(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(e.subarray(0,32));return ig.wipe(e),t}o(W7,"convertSecretKeyToX25519");$t.convertSecretKeyToX25519=W7});var pg=me(($N,hg)=>{"use strict";hg.exports=o(function r(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,n,i)=>{let s=i===0?"":",",a=n===void 0||typeof n=="symbol"?null:n;return t+s+r(a)},"")+"]":"{"+Object.keys(e).sort().reduce((t,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return t;let s=t.length===0?"":",";return t+s+r(n)+":"+r(e[n])},"")+"}"},"serialize")});var vg=me(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});var G7=ro(),Y7=tn();Mr.PUBLIC_KEY_LENGTH=32;Mr.SECRET_KEY_LENGTH=32;Mr.SHARED_KEY_LENGTH=32;function ti(r){var e=new Float64Array(16);if(r)for(var t=0;t<r.length;t++)e[t]=r[t];return e}o(ti,"gf");var mg=new Uint8Array(32);mg[0]=9;var J7=ti([56129,1]);function Bh(r){for(var e=1,t=0;t<16;t++){var n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Bh,"car25519");function xf(r,e,t){for(var n=~(t-1),i=0;i<16;i++){var s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(xf,"sel25519");function X7(r,e){for(var t=ti(),n=ti(),i=0;i<16;i++)n[i]=e[i];Bh(n),Bh(n),Bh(n);for(var s=0;s<2;s++){t[0]=n[0]-65517;for(var i=1;i<15;i++)t[i]=n[i]-65535-(t[i-1]>>16&1),t[i-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);var a=t[15]>>16&1;t[14]&=65535,xf(n,t,1-a)}for(var i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(X7,"pack25519");function Z7(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(Z7,"unpack25519");function lu(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(lu,"add");function du(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(du,"sub");function Si(r,e,t){var n,i,s=0,a=0,f=0,u=0,p=0,b=0,x=0,A=0,O=0,T=0,k=0,$=0,C=0,B=0,z=0,H=0,X=0,U=0,L=0,F=0,ne=0,D=0,l=0,v=0,h=0,c=0,d=0,y=0,_=0,w=0,m=0,E=t[0],I=t[1],g=t[2],S=t[3],ie=t[4],M=t[5],K=t[6],J=t[7],N=t[8],R=t[9],V=t[10],W=t[11],ee=t[12],he=t[13],fe=t[14],Y=t[15];n=e[0],s+=n*E,a+=n*I,f+=n*g,u+=n*S,p+=n*ie,b+=n*M,x+=n*K,A+=n*J,O+=n*N,T+=n*R,k+=n*V,$+=n*W,C+=n*ee,B+=n*he,z+=n*fe,H+=n*Y,n=e[1],a+=n*E,f+=n*I,u+=n*g,p+=n*S,b+=n*ie,x+=n*M,A+=n*K,O+=n*J,T+=n*N,k+=n*R,$+=n*V,C+=n*W,B+=n*ee,z+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*E,u+=n*I,p+=n*g,b+=n*S,x+=n*ie,A+=n*M,O+=n*K,T+=n*J,k+=n*N,$+=n*R,C+=n*V,B+=n*W,z+=n*ee,H+=n*he,X+=n*fe,U+=n*Y,n=e[3],u+=n*E,p+=n*I,b+=n*g,x+=n*S,A+=n*ie,O+=n*M,T+=n*K,k+=n*J,$+=n*N,C+=n*R,B+=n*V,z+=n*W,H+=n*ee,X+=n*he,U+=n*fe,L+=n*Y,n=e[4],p+=n*E,b+=n*I,x+=n*g,A+=n*S,O+=n*ie,T+=n*M,k+=n*K,$+=n*J,C+=n*N,B+=n*R,z+=n*V,H+=n*W,X+=n*ee,U+=n*he,L+=n*fe,F+=n*Y,n=e[5],b+=n*E,x+=n*I,A+=n*g,O+=n*S,T+=n*ie,k+=n*M,$+=n*K,C+=n*J,B+=n*N,z+=n*R,H+=n*V,X+=n*W,U+=n*ee,L+=n*he,F+=n*fe,ne+=n*Y,n=e[6],x+=n*E,A+=n*I,O+=n*g,T+=n*S,k+=n*ie,$+=n*M,C+=n*K,B+=n*J,z+=n*N,H+=n*R,X+=n*V,U+=n*W,L+=n*ee,F+=n*he,ne+=n*fe,D+=n*Y,n=e[7],A+=n*E,O+=n*I,T+=n*g,k+=n*S,$+=n*ie,C+=n*M,B+=n*K,z+=n*J,H+=n*N,X+=n*R,U+=n*V,L+=n*W,F+=n*ee,ne+=n*he,D+=n*fe,l+=n*Y,n=e[8],O+=n*E,T+=n*I,k+=n*g,$+=n*S,C+=n*ie,B+=n*M,z+=n*K,H+=n*J,X+=n*N,U+=n*R,L+=n*V,F+=n*W,ne+=n*ee,D+=n*he,l+=n*fe,v+=n*Y,n=e[9],T+=n*E,k+=n*I,$+=n*g,C+=n*S,B+=n*ie,z+=n*M,H+=n*K,X+=n*J,U+=n*N,L+=n*R,F+=n*V,ne+=n*W,D+=n*ee,l+=n*he,v+=n*fe,h+=n*Y,n=e[10],k+=n*E,$+=n*I,C+=n*g,B+=n*S,z+=n*ie,H+=n*M,X+=n*K,U+=n*J,L+=n*N,F+=n*R,ne+=n*V,D+=n*W,l+=n*ee,v+=n*he,h+=n*fe,c+=n*Y,n=e[11],$+=n*E,C+=n*I,B+=n*g,z+=n*S,H+=n*ie,X+=n*M,U+=n*K,L+=n*J,F+=n*N,ne+=n*R,D+=n*V,l+=n*W,v+=n*ee,h+=n*he,c+=n*fe,d+=n*Y,n=e[12],C+=n*E,B+=n*I,z+=n*g,H+=n*S,X+=n*ie,U+=n*M,L+=n*K,F+=n*J,ne+=n*N,D+=n*R,l+=n*V,v+=n*W,h+=n*ee,c+=n*he,d+=n*fe,y+=n*Y,n=e[13],B+=n*E,z+=n*I,H+=n*g,X+=n*S,U+=n*ie,L+=n*M,F+=n*K,ne+=n*J,D+=n*N,l+=n*R,v+=n*V,h+=n*W,c+=n*ee,d+=n*he,y+=n*fe,_+=n*Y,n=e[14],z+=n*E,H+=n*I,X+=n*g,U+=n*S,L+=n*ie,F+=n*M,ne+=n*K,D+=n*J,l+=n*N,v+=n*R,h+=n*V,c+=n*W,d+=n*ee,y+=n*he,_+=n*fe,w+=n*Y,n=e[15],H+=n*E,X+=n*I,U+=n*g,L+=n*S,F+=n*ie,ne+=n*M,D+=n*K,l+=n*J,v+=n*N,h+=n*R,c+=n*V,d+=n*W,y+=n*ee,_+=n*he,w+=n*fe,m+=n*Y,s+=38*X,a+=38*U,f+=38*L,u+=38*F,p+=38*ne,b+=38*D,x+=38*l,A+=38*v,O+=38*h,T+=38*c,k+=38*d,$+=38*y,C+=38*_,B+=38*w,z+=38*m,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=A+i+65535,i=Math.floor(n/65536),A=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=A+i+65535,i=Math.floor(n/65536),A=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=a,r[2]=f,r[3]=u,r[4]=p,r[5]=b,r[6]=x,r[7]=A,r[8]=O,r[9]=T,r[10]=k,r[11]=$,r[12]=C,r[13]=B,r[14]=z,r[15]=H}o(Si,"mul");function wf(r,e){Si(r,e,e)}o(wf,"square");function Q7(r,e){for(var t=ti(),n=0;n<16;n++)t[n]=e[n];for(var n=253;n>=0;n--)wf(t,t),n!==2&&n!==4&&Si(t,t,e);for(var n=0;n<16;n++)r[n]=t[n]}o(Q7,"inv25519");function Uh(r,e){for(var t=new Uint8Array(32),n=new Float64Array(80),i=ti(),s=ti(),a=ti(),f=ti(),u=ti(),p=ti(),b=0;b<31;b++)t[b]=r[b];t[31]=r[31]&127|64,t[0]&=248,Z7(n,e);for(var b=0;b<16;b++)s[b]=n[b];i[0]=f[0]=1;for(var b=254;b>=0;--b){var x=t[b>>>3]>>>(b&7)&1;xf(i,s,x),xf(a,f,x),lu(u,i,a),du(i,i,a),lu(a,s,f),du(s,s,f),wf(f,u),wf(p,i),Si(i,a,i),Si(a,s,u),lu(u,i,a),du(i,i,a),wf(s,i),du(a,f,p),Si(i,a,J7),lu(i,i,f),Si(a,a,i),Si(i,f,p),Si(f,s,n),wf(s,u),xf(i,s,x),xf(a,f,x)}for(var b=0;b<16;b++)n[b+16]=i[b],n[b+32]=a[b],n[b+48]=s[b],n[b+64]=f[b];var A=n.subarray(32),O=n.subarray(16);Q7(A,A),Si(O,O,A);var T=new Uint8Array(32);return X7(T,O),T}o(Uh,"scalarMult");Mr.scalarMult=Uh;function bg(r){return Uh(r,mg)}o(bg,"scalarMultBase");Mr.scalarMultBase=bg;function gg(r){if(r.length!==Mr.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+Mr.SECRET_KEY_LENGTH+" bytes");var e=new Uint8Array(r),t=bg(e);return{publicKey:t,secretKey:e}}o(gg,"generateKeyPairFromSeed");Mr.generateKeyPairFromSeed=gg;function eE(r){var e=G7.randomBytes(32,r),t=gg(e);return Y7.wipe(e),t}o(eE,"generateKeyPair");Mr.generateKeyPair=eE;function tE(r,e,t){if(t===void 0&&(t=!1),r.length!==Mr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==Mr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var n=Uh(r,e);if(t){for(var i=0,s=0;s<n.length;s++)i|=n[s];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(tE,"sharedKey");Mr.sharedKey=tE});var $h=me(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});var fr=jo(),Fh=tn(),rE=20;function nE(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,f=t[3]<<24|t[2]<<16|t[1]<<8|t[0],u=t[7]<<24|t[6]<<16|t[5]<<8|t[4],p=t[11]<<24|t[10]<<16|t[9]<<8|t[8],b=t[15]<<24|t[14]<<16|t[13]<<8|t[12],x=t[19]<<24|t[18]<<16|t[17]<<8|t[16],A=t[23]<<24|t[22]<<16|t[21]<<8|t[20],O=t[27]<<24|t[26]<<16|t[25]<<8|t[24],T=t[31]<<24|t[30]<<16|t[29]<<8|t[28],k=e[3]<<24|e[2]<<16|e[1]<<8|e[0],$=e[7]<<24|e[6]<<16|e[5]<<8|e[4],C=e[11]<<24|e[10]<<16|e[9]<<8|e[8],B=e[15]<<24|e[14]<<16|e[13]<<8|e[12],z=n,H=i,X=s,U=a,L=f,F=u,ne=p,D=b,l=x,v=A,h=O,c=T,d=k,y=$,_=C,w=B,m=0;m<rE;m+=2)z=z+L|0,d^=z,d=d>>>32-16|d<<16,l=l+d|0,L^=l,L=L>>>32-12|L<<12,H=H+F|0,y^=H,y=y>>>32-16|y<<16,v=v+y|0,F^=v,F=F>>>32-12|F<<12,X=X+ne|0,_^=X,_=_>>>32-16|_<<16,h=h+_|0,ne^=h,ne=ne>>>32-12|ne<<12,U=U+D|0,w^=U,w=w>>>32-16|w<<16,c=c+w|0,D^=c,D=D>>>32-12|D<<12,X=X+ne|0,_^=X,_=_>>>32-8|_<<8,h=h+_|0,ne^=h,ne=ne>>>32-7|ne<<7,U=U+D|0,w^=U,w=w>>>32-8|w<<8,c=c+w|0,D^=c,D=D>>>32-7|D<<7,H=H+F|0,y^=H,y=y>>>32-8|y<<8,v=v+y|0,F^=v,F=F>>>32-7|F<<7,z=z+L|0,d^=z,d=d>>>32-8|d<<8,l=l+d|0,L^=l,L=L>>>32-7|L<<7,z=z+F|0,w^=z,w=w>>>32-16|w<<16,h=h+w|0,F^=h,F=F>>>32-12|F<<12,H=H+ne|0,d^=H,d=d>>>32-16|d<<16,c=c+d|0,ne^=c,ne=ne>>>32-12|ne<<12,X=X+D|0,y^=X,y=y>>>32-16|y<<16,l=l+y|0,D^=l,D=D>>>32-12|D<<12,U=U+L|0,_^=U,_=_>>>32-16|_<<16,v=v+_|0,L^=v,L=L>>>32-12|L<<12,X=X+D|0,y^=X,y=y>>>32-8|y<<8,l=l+y|0,D^=l,D=D>>>32-7|D<<7,U=U+L|0,_^=U,_=_>>>32-8|_<<8,v=v+_|0,L^=v,L=L>>>32-7|L<<7,H=H+ne|0,d^=H,d=d>>>32-8|d<<8,c=c+d|0,ne^=c,ne=ne>>>32-7|ne<<7,z=z+F|0,w^=z,w=w>>>32-8|w<<8,h=h+w|0,F^=h,F=F>>>32-7|F<<7;fr.writeUint32LE(z+n|0,r,0),fr.writeUint32LE(H+i|0,r,4),fr.writeUint32LE(X+s|0,r,8),fr.writeUint32LE(U+a|0,r,12),fr.writeUint32LE(L+f|0,r,16),fr.writeUint32LE(F+u|0,r,20),fr.writeUint32LE(ne+p|0,r,24),fr.writeUint32LE(D+b|0,r,28),fr.writeUint32LE(l+x|0,r,32),fr.writeUint32LE(v+A|0,r,36),fr.writeUint32LE(h+O|0,r,40),fr.writeUint32LE(c+T|0,r,44),fr.writeUint32LE(d+k|0,r,48),fr.writeUint32LE(y+$|0,r,52),fr.writeUint32LE(_+C|0,r,56),fr.writeUint32LE(w+B|0,r,60)}o(nE,"core");function yg(r,e,t,n,i){if(i===void 0&&(i=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<t.length)throw new Error("ChaCha: destination is shorter than source");var s,a;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),a=s.length-e.length,s.set(e,a)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,a=i}for(var f=new Uint8Array(64),u=0;u<t.length;u+=64){nE(f,s,r);for(var p=u;p<u+64&&p<t.length;p++)n[p]=t[p]^f[p-u];oE(s,0,a)}return Fh.wipe(f),i===0&&Fh.wipe(s),n}o(yg,"streamXOR");hu.streamXOR=yg;function iE(r,e,t,n){return n===void 0&&(n=0),Fh.wipe(t),yg(r,e,t,t,n)}o(iE,"stream");hu.stream=iE;function oE(r,e,t){for(var n=1;t--;)n=n+(r[e]&255)|0,r[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}o(oE,"incrementCounter")});var Eg=me(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var io=jo(),xg=tn(),sE=$h(),aE=20;function wg(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=_g(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var a=sE.streamXOR(i,s,t,n);return xg.wipe(i),a}o(wg,"streamXOR");_f.streamXOR=wg;function fE(r,e,t){return xg.wipe(t),wg(r,e,t,t)}o(fE,"stream");_f.stream=fE;function _g(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,f=r[3]<<24|r[2]<<16|r[1]<<8|r[0],u=r[7]<<24|r[6]<<16|r[5]<<8|r[4],p=r[11]<<24|r[10]<<16|r[9]<<8|r[8],b=r[15]<<24|r[14]<<16|r[13]<<8|r[12],x=r[19]<<24|r[18]<<16|r[17]<<8|r[16],A=r[23]<<24|r[22]<<16|r[21]<<8|r[20],O=r[27]<<24|r[26]<<16|r[25]<<8|r[24],T=r[31]<<24|r[30]<<16|r[29]<<8|r[28],k=e[3]<<24|e[2]<<16|e[1]<<8|e[0],$=e[7]<<24|e[6]<<16|e[5]<<8|e[4],C=e[11]<<24|e[10]<<16|e[9]<<8|e[8],B=e[15]<<24|e[14]<<16|e[13]<<8|e[12],z=n,H=i,X=s,U=a,L=f,F=u,ne=p,D=b,l=x,v=A,h=O,c=T,d=k,y=$,_=C,w=B,m=0;m<aE;m+=2)z=z+L|0,d^=z,d=d>>>32-16|d<<16,l=l+d|0,L^=l,L=L>>>32-12|L<<12,H=H+F|0,y^=H,y=y>>>32-16|y<<16,v=v+y|0,F^=v,F=F>>>32-12|F<<12,X=X+ne|0,_^=X,_=_>>>32-16|_<<16,h=h+_|0,ne^=h,ne=ne>>>32-12|ne<<12,U=U+D|0,w^=U,w=w>>>32-16|w<<16,c=c+w|0,D^=c,D=D>>>32-12|D<<12,X=X+ne|0,_^=X,_=_>>>32-8|_<<8,h=h+_|0,ne^=h,ne=ne>>>32-7|ne<<7,U=U+D|0,w^=U,w=w>>>32-8|w<<8,c=c+w|0,D^=c,D=D>>>32-7|D<<7,H=H+F|0,y^=H,y=y>>>32-8|y<<8,v=v+y|0,F^=v,F=F>>>32-7|F<<7,z=z+L|0,d^=z,d=d>>>32-8|d<<8,l=l+d|0,L^=l,L=L>>>32-7|L<<7,z=z+F|0,w^=z,w=w>>>32-16|w<<16,h=h+w|0,F^=h,F=F>>>32-12|F<<12,H=H+ne|0,d^=H,d=d>>>32-16|d<<16,c=c+d|0,ne^=c,ne=ne>>>32-12|ne<<12,X=X+D|0,y^=X,y=y>>>32-16|y<<16,l=l+y|0,D^=l,D=D>>>32-12|D<<12,U=U+L|0,_^=U,_=_>>>32-16|_<<16,v=v+_|0,L^=v,L=L>>>32-12|L<<12,X=X+D|0,y^=X,y=y>>>32-8|y<<8,l=l+y|0,D^=l,D=D>>>32-7|D<<7,U=U+L|0,_^=U,_=_>>>32-8|_<<8,v=v+_|0,L^=v,L=L>>>32-7|L<<7,H=H+ne|0,d^=H,d=d>>>32-8|d<<8,c=c+d|0,ne^=c,ne=ne>>>32-7|ne<<7,z=z+F|0,w^=z,w=w>>>32-8|w<<8,h=h+w|0,F^=h,F=F>>>32-7|F<<7;return io.writeUint32LE(z,t,0),io.writeUint32LE(H,t,4),io.writeUint32LE(X,t,8),io.writeUint32LE(U,t,12),io.writeUint32LE(d,t,16),io.writeUint32LE(y,t,20),io.writeUint32LE(_,t,24),io.writeUint32LE(w,t,28),t}o(_g,"hchacha");_f.hchacha=_g});var qh=me(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});function cE(r,e,t){return~(r-1)&e|r-1&t}o(cE,"select");ca.select=cE;function uE(r,e){return(r|0)-(e|0)-1>>>31&1}o(uE,"lessOrEqual");ca.lessOrEqual=uE;function Sg(r,e){if(r.length!==e.length)return 0;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return 1&t-1>>>8}o(Sg,"compare");ca.compare=Sg;function lE(r,e){return r.length===0||e.length===0?!1:Sg(r,e)!==0}o(lE,"equal");ca.equal=lE});var Ag=me(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var dE=qh(),pu=tn();Mi.DIGEST_LENGTH=16;var Mg=function(){function r(e){this.digestLength=Mi.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var t=e[0]|e[1]<<8;this._r[0]=t&8191;var n=e[2]|e[3]<<8;this._r[1]=(t>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var s=e[6]|e[7]<<8;this._r[3]=(i>>>7|s<<9)&8191;var a=e[8]|e[9]<<8;this._r[4]=(s>>>4|a<<12)&255,this._r[5]=a>>>1&8190;var f=e[10]|e[11]<<8;this._r[6]=(a>>>14|f<<2)&8191;var u=e[12]|e[13]<<8;this._r[7]=(f>>>11|u<<5)&8065;var p=e[14]|e[15]<<8;this._r[8]=(u>>>8|p<<8)&8191,this._r[9]=p>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return o(r,"Poly1305"),r.prototype._blocks=function(e,t,n){for(var i=this._fin?0:2048,s=this._h[0],a=this._h[1],f=this._h[2],u=this._h[3],p=this._h[4],b=this._h[5],x=this._h[6],A=this._h[7],O=this._h[8],T=this._h[9],k=this._r[0],$=this._r[1],C=this._r[2],B=this._r[3],z=this._r[4],H=this._r[5],X=this._r[6],U=this._r[7],L=this._r[8],F=this._r[9];n>=16;){var ne=e[t+0]|e[t+1]<<8;s+=ne&8191;var D=e[t+2]|e[t+3]<<8;a+=(ne>>>13|D<<3)&8191;var l=e[t+4]|e[t+5]<<8;f+=(D>>>10|l<<6)&8191;var v=e[t+6]|e[t+7]<<8;u+=(l>>>7|v<<9)&8191;var h=e[t+8]|e[t+9]<<8;p+=(v>>>4|h<<12)&8191,b+=h>>>1&8191;var c=e[t+10]|e[t+11]<<8;x+=(h>>>14|c<<2)&8191;var d=e[t+12]|e[t+13]<<8;A+=(c>>>11|d<<5)&8191;var y=e[t+14]|e[t+15]<<8;O+=(d>>>8|y<<8)&8191,T+=y>>>5|i;var _=0,w=_;w+=s*k,w+=a*(5*F),w+=f*(5*L),w+=u*(5*U),w+=p*(5*X),_=w>>>13,w&=8191,w+=b*(5*H),w+=x*(5*z),w+=A*(5*B),w+=O*(5*C),w+=T*(5*$),_+=w>>>13,w&=8191;var m=_;m+=s*$,m+=a*k,m+=f*(5*F),m+=u*(5*L),m+=p*(5*U),_=m>>>13,m&=8191,m+=b*(5*X),m+=x*(5*H),m+=A*(5*z),m+=O*(5*B),m+=T*(5*C),_+=m>>>13,m&=8191;var E=_;E+=s*C,E+=a*$,E+=f*k,E+=u*(5*F),E+=p*(5*L),_=E>>>13,E&=8191,E+=b*(5*U),E+=x*(5*X),E+=A*(5*H),E+=O*(5*z),E+=T*(5*B),_+=E>>>13,E&=8191;var I=_;I+=s*B,I+=a*C,I+=f*$,I+=u*k,I+=p*(5*F),_=I>>>13,I&=8191,I+=b*(5*L),I+=x*(5*U),I+=A*(5*X),I+=O*(5*H),I+=T*(5*z),_+=I>>>13,I&=8191;var g=_;g+=s*z,g+=a*B,g+=f*C,g+=u*$,g+=p*k,_=g>>>13,g&=8191,g+=b*(5*F),g+=x*(5*L),g+=A*(5*U),g+=O*(5*X),g+=T*(5*H),_+=g>>>13,g&=8191;var S=_;S+=s*H,S+=a*z,S+=f*B,S+=u*C,S+=p*$,_=S>>>13,S&=8191,S+=b*k,S+=x*(5*F),S+=A*(5*L),S+=O*(5*U),S+=T*(5*X),_+=S>>>13,S&=8191;var ie=_;ie+=s*X,ie+=a*H,ie+=f*z,ie+=u*B,ie+=p*C,_=ie>>>13,ie&=8191,ie+=b*$,ie+=x*k,ie+=A*(5*F),ie+=O*(5*L),ie+=T*(5*U),_+=ie>>>13,ie&=8191;var M=_;M+=s*U,M+=a*X,M+=f*H,M+=u*z,M+=p*B,_=M>>>13,M&=8191,M+=b*C,M+=x*$,M+=A*k,M+=O*(5*F),M+=T*(5*L),_+=M>>>13,M&=8191;var K=_;K+=s*L,K+=a*U,K+=f*X,K+=u*H,K+=p*z,_=K>>>13,K&=8191,K+=b*B,K+=x*C,K+=A*$,K+=O*k,K+=T*(5*F),_+=K>>>13,K&=8191;var J=_;J+=s*F,J+=a*L,J+=f*U,J+=u*X,J+=p*H,_=J>>>13,J&=8191,J+=b*z,J+=x*B,J+=A*C,J+=O*$,J+=T*k,_+=J>>>13,J&=8191,_=(_<<2)+_|0,_=_+w|0,w=_&8191,_=_>>>13,m+=_,s=w,a=m,f=E,u=I,p=g,b=S,x=ie,A=M,O=K,T=J,t+=16,n-=16}this._h[0]=s,this._h[1]=a,this._h[2]=f,this._h[3]=u,this._h[4]=p,this._h[5]=b,this._h[6]=x,this._h[7]=A,this._h[8]=O,this._h[9]=T},r.prototype.finish=function(e,t){t===void 0&&(t=0);var n=new Uint16Array(10),i,s,a,f;if(this._leftover){for(f=this._leftover,this._buffer[f++]=1;f<16;f++)this._buffer[f]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,f=2;f<10;f++)this._h[f]+=i,i=this._h[f]>>>13,this._h[f]&=8191;for(this._h[0]+=i*5,i=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=i,i=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=i,n[0]=this._h[0]+5,i=n[0]>>>13,n[0]&=8191,f=1;f<10;f++)n[f]=this._h[f]+i,i=n[f]>>>13,n[f]&=8191;for(n[9]-=1<<13,s=(i^1)-1,f=0;f<10;f++)n[f]&=s;for(s=~s,f=0;f<10;f++)this._h[f]=this._h[f]&s|n[f];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,a=this._h[0]+this._pad[0],this._h[0]=a&65535,f=1;f<8;f++)a=(this._h[f]+this._pad[f]|0)+(a>>>16)|0,this._h[f]=a&65535;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},r.prototype.update=function(e){var t=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var s=0;s<i;s++)this._buffer[this._leftover+s]=e[t+s];if(n-=i,t+=i,this._leftover+=i,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(i=n-n%16,this._blocks(e,t,i),t+=i,n-=i),n){for(var s=0;s<n;s++)this._buffer[this._leftover+s]=e[t+s];this._leftover+=n}return this},r.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},r.prototype.clean=function(){return pu.wipe(this._buffer),pu.wipe(this._r),pu.wipe(this._h),pu.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();Mi.Poly1305=Mg;function hE(r,e){var t=new Mg(r);t.update(e);var n=t.digest();return t.clean(),n}o(hE,"oneTimeAuth");Mi.oneTimeAuth=hE;function pE(r,e){return r.length!==Mi.DIGEST_LENGTH||e.length!==Mi.DIGEST_LENGTH?!1:dE.equal(r,e)}o(pE,"equal");Mi.equal=pE});var Cg=me(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});var mu=$h(),mE=Ag(),Ef=tn(),Tg=jo(),bE=qh();Ai.KEY_LENGTH=32;Ai.NONCE_LENGTH=12;Ai.TAG_LENGTH=16;var kg=new Uint8Array(16),gE=function(){function r(e){if(this.nonceLength=Ai.NONCE_LENGTH,this.tagLength=Ai.TAG_LENGTH,e.length!==Ai.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(r,"ChaCha20Poly1305"),r.prototype.seal=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);mu.stream(this._key,s,a,4);var f=t.length+this.tagLength,u;if(i){if(i.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(f);return mu.streamXOR(this._key,s,t,u,4),this._authenticate(u.subarray(u.length-this.tagLength,u.length),a,u.subarray(0,u.length-this.tagLength),n),Ef.wipe(s),u},r.prototype.open=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);mu.stream(this._key,s,a,4);var f=new Uint8Array(this.tagLength);if(this._authenticate(f,a,t.subarray(0,t.length-this.tagLength),n),!bE.equal(f,t.subarray(t.length-this.tagLength,t.length)))return null;var u=t.length-this.tagLength,p;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");p=i}else p=new Uint8Array(u);return mu.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),p,4),Ef.wipe(s),p},r.prototype.clean=function(){return Ef.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new mE.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(kg.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(kg.subarray(n.length%16));var a=new Uint8Array(8);i&&Tg.writeUint64LE(i.length,a),s.update(a),Tg.writeUint64LE(n.length,a),s.update(a);for(var f=s.digest(),u=0;u<f.length;u++)e[u]=f[u];s.clean(),Ef.wipe(f),Ef.wipe(a)},r}();Ai.ChaCha20Poly1305=gE});var Og=me(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var Dg=Eg(),Ig=Cg(),Sf=tn();Ti.KEY_LENGTH=32;Ti.NONCE_LENGTH=24;Ti.TAG_LENGTH=16;var vE=function(){function r(e){if(this.nonceLength=Ti.NONCE_LENGTH,this.tagLength=Ti.TAG_LENGTH,e.length!==Ti.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(r,"XChaCha20Poly1305"),r.prototype.seal=function(e,t,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");var s=Dg.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Ig.ChaCha20Poly1305(s),u=f.seal(a,t,n,i);return Sf.wipe(s),Sf.wipe(a),f.clean(),u},r.prototype.open=function(e,t,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=Dg.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Ig.ChaCha20Poly1305(s),u=f.open(a,t,n,i);return Sf.wipe(s),Sf.wipe(a),f.clean(),u},r.prototype.clean=function(){return Sf.wipe(this._key),this},r}();Ti.XChaCha20Poly1305=vE});var Tn=me((wL,x2)=>{x2.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}});var Nf=me((_L,w2)=>{w2.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}});var S2=me(tr=>{var _2=tr,Nu=4294967292,Ru=4294967293,h0=4294967294,E2=4294967295,xe=[0,1,3,7,15,31,63,127,255,511,1023],fo=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],US="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Br=[];US.forEach(r=>{Br.push(r.charCodeAt(0))});tr.utf8={encode(r){let e=[];return r.forEach(t=>{if(t>=0&&t<=127)e.push(t);else if(t<=2047)e.push(192+(t>>6&xe[5])),e.push(128+(t&xe[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&xe[4])),e.push(128+(t>>6&xe[6])),e.push(128+(t&xe[6]));else if(t>=65536&&t<=1114111){let n=t>>16&xe[5];e.push(240+(n>>2)),e.push(128+((n&xe[2])<<4)+(t>>12&xe[4])),e.push(128+(t>>6&xe[6])),e.push(128+(t&xe[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Buffer.from(e)},decode(r,e){function t(T,k){if((k&192)!==128)return Ru;let $=((T&xe[5])<<6)+(k&xe[6]);return $<128?Nu:$}o(t,"bytes2");function n(T,k,$){if(($&192)!==128||(k&192)!==128)return Ru;let C=((T&xe[4])<<12)+((k&xe[6])<<6)+($&xe[6]);return C<2048?Nu:C>=55296&&C<=57343?h0:C}o(n,"bytes3");function i(T,k,$,C){if((C&192)!==128||($&192)!==128||(k&192)!==128)return Ru;let B=(((T&xe[3])<<2)+(k>>4&xe[2])<<16)+((k&xe[4])<<12)+(($&xe[6])<<6)+(C&xe[6]);return B<65536?Nu:B>1114111?h0:B}o(i,"bytes4");let s,a,f,u,p,b,x=r.length,A=e?3:0,O=[];for(;A<x;){a=r[A],s=E2;let T=!0;for(;T;){if(a>=0&&a<=127){s=a,b=1;break}if(f=A+1,f<x&&a>=194&&a<=223){s=t(a,r[f]),b=2;break}if(u=A+2,u<x&&a>=224&&a<=239){s=n(a,r[f],r[u]),b=3;break}if(p=A+3,p<x&&a>=240&&a<=244){s=i(a,r[f],r[u],r[p]),b=4;break}break}if(s>1114111){let k=`byte[${A}]`;throw s===E2?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${k}`):s===Ru?new RangeError(`utf8.decode: illegal trailing byte found at: ${k}`):s===h0?new RangeError(`utf8.decode: code point out of range found at: ${k}`):s===Nu?new RangeError(`utf8.decode: non-shortest form found at: ${k}`):new RangeError(`utf8.decode: unrecognized error found at: ${k}`)}O.push(s),A+=b}return O}};tr.utf16be={encode(r){let e=[],t,n,i;for(let s=0;s<r.length;s+=1)if(t=r[s],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t>>8&xe[8]),e.push(t&xe[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&xe[10]),e.push(n>>8&xe[8]),e.push(n&xe[8]),e.push(i>>8&xe[8]),e.push(i&xe[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${s}]: ${t}`);return Buffer.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,i=e?2:0,s=0,a,f,u,p,b,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(b=(r[i]<<8)+r[u],b<55296||b>57343){a=b,f=2;break}if(p=i+3,p<n&&(x=(r[i+2]<<8)+r[p],b<=56319&&x>=56320&&x<=57343)){a=65536+(b-55296<<10)+(x-56320),f=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}t[s++]=a,i+=f}return t}};tr.utf16le={encode(r){let e=[],t,n,i;for(let s=0;s<r.length;s+=1)if(t=r[s],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t&xe[8]),e.push(t>>8&xe[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&xe[10]),e.push(n&xe[8]),e.push(n>>8&xe[8]),e.push(i&xe[8]),e.push(i>>8&xe[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${s}]: ${t}`);return Buffer.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,i=e?2:0,s=0,a,f,u,p,b,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(b=(r[u]<<8)+r[i],b<55296||b>57343){a=b,f=2;break}if(p=i+3,p<n&&(x=(r[p]<<8)+r[i+2],b<=56319&&x>=56320&&x<=57343)){a=65536+(b-55296<<10)+(x-56320),f=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}t[s++]=a,i+=f}return t}};tr.utf32be={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${t/4}]: ${n}`);e[t++]=n>>24&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let i=(r[n]<<24)+(r[n+1]<<16)+(r[n+2]<<8)+r[n+3];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${i}`);t.push(i)}return t}};tr.utf32le={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${t/4}]: ${n}`);e[t++]=n&xe[8],e[t++]=n>>8&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>24&xe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let i=(r[n+3]<<24)+(r[n+2]<<16)+(r[n+1]<<8)+r[n];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${i}`);t.push(i)}return t}};tr.uint7={encode(r){let e=Buffer.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${t}]: ${r[t]}`);e[t]=r[t]}return e}};tr.uint8={encode(r){let e=Buffer.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1)e[t]=r[t];return e}};tr.uint16be={encode(r){let e=Buffer.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${t/2}]: ${n}`);e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t]<<8)+r[t+1]);return e}};tr.uint16le={encode(r){let e=Buffer.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${t/2}]: ${n}`);e[t++]=n&xe[8],e[t++]=n>>8&xe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t+1]<<8)+r[t]);return e}};tr.uint32be={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3]);return e}};tr.uint32le={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&xe[8],e[t++]=n>>8&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>24&xe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t+3]<<24)+(r[t+2]<<16)+(r[t+1]<<8)+r[t]);return e}};tr.string={encode(r){return _2.utf16le.encode(r).toString("utf16le")},decode(r){return _2.utf16le.decode(Buffer.from(r,"utf16le"),0)}};tr.escaped={encode(r){let e=[];for(let t=0;t<r.length;t+=1){let n=r[t];if(n===96)e.push(n),e.push(n);else if(n===10)e.push(n);else if(n>=32&&n<=126)e.push(n);else{let i="";if(n>=0&&n<=31)i+=`\`x${fo[n]}`;else if(n>=127&&n<=255)i+=`\`x${fo[n]}`;else if(n>=256&&n<=65535)i+=`\`u${fo[n>>8&xe[8]]}${fo[n&xe[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let a=n>>24&xe[8];a>0&&(i+=fo[a]),i+=`${fo[n>>16&xe[8]]+fo[n>>8&xe[8]]+fo[n&xe[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Buffer.from(i).forEach(a=>{e.push(a)})}}return Buffer.from(e)},decode(r){function e(x){return x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102}o(e,"isHex");function t(x,A,O){let T={char:null,nexti:x+2,error:!0};if(x+1<A&&e(O[x])&&e(O[x+1])){let k=String.fromCodePoint(O[x],O[x+1]);T.char=parseInt(k,16),Number.isNaN(T.char)||(T.error=!1)}return T}o(t,"getx");function n(x,A,O){let T={char:null,nexti:x+4,error:!0};if(x+3<A&&e(O[x])&&e(O[x+1])&&e(O[x+2])&&e(O[x+3])){let k=String.fromCodePoint(O[x],O[x+1],O[x+2],O[x+3]);T.char=parseInt(k,16),Number.isNaN(T.char)||(T.error=!1)}return T}o(n,"getu");function i(x,A,O){let T={char:null,nexti:x+4,error:!0},k="";for(;x<A&&e(O[x]);)k+=String.fromCodePoint(O[x]),x+=1;return T.char=parseInt(k,16),O[x]===125&&!Number.isNaN(T.char)&&(T.error=!1),T.nexti=x+1,T}o(i,"getU");let s=[],a=r.length,f,u,p,b=0;for(;b<a;){for(;;){if(p=!0,r[b]!==96){s.push(r[b]),b+=1,p=!1;break}if(f=b+1,f>=a)break;if(r[f]===96){s.push(96),b+=2,p=!1;break}if(r[f]===120){if(u=t(f+1,a,r),u.error)break;s.push(u.char),b=u.nexti,p=!1;break}if(r[f]===117){if(r[f+1]===123){if(u=i(f+2,a,r),u.error)break;s.push(u.char),b=u.nexti,p=!1;break}if(u=n(f+1,a,r),u.error)break;s.push(u.char),b=u.nexti,p=!1;break}break}if(p)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${b}]`)}return s}};var Rf=13,cn=10;tr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Rf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(Rf),e.push(cn);break;case cn:e.push(Rf),e.push(cn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==cn&&(e.push(Rf),e.push(cn)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Rf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(cn);break;case cn:e.push(cn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==cn&&e.push(cn),e}};tr.base64={encode(r){if(r.length===0)return Buffer.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,a=Buffer.alloc(s*4);i>0&&(s-=1),e=0,t=0;for(let f=0;f<s;f+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[n>>6&xe[6]],a[t++]=Br[n&xe[6]];if(i===0)return a;if(i===1)return n=r[e++]<<16,n+=r[e]<<8,a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[n>>6&xe[6]],a[t]=Br[64],a;if(i===2)return n=r[e]<<16,a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[64],a[t]=Br[64],a},decode(r){function e(b){let x=[],A=0;for(let O=0;O<b.length;O+=1){let T=b[O],k=!0;for(;k&&!(T===32||T===9||T===10||T===13);){if(T>=65&&T<=90){x.push(T-65);break}if(T>=97&&T<=122){x.push(T-71);break}if(T>=48&&T<=57){x.push(T+4);break}if(T===43){x.push(62);break}if(T===47){x.push(63);break}if(T===61){x.push(64),A+=1;break}throw new RangeError(`base64.decode: invalid character buf[${O}]: ${T}`)}}if(x.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${x.length}`);switch(A){case 0:break;case 1:if(x[x.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(x[x.length-1]!==64||x[x.length-2]!==64)throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${A}`)}return{tail:A,buf:Buffer.from(x)}}if(o(e,"validate"),r.length===0)return Buffer.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,a,f,u=i.length/4,p=Buffer.alloc(u*3-n);n>0&&(u-=1),a=0,s=0;for(let b=0;b<u;b+=1)f=i[s++]<<18,f+=i[s++]<<12,f+=i[s++]<<6,f+=i[s++],p[a++]=f>>16&xe[8],p[a++]=f>>8&xe[8],p[a++]=f&xe[8];return n===1&&(f=i[s++]<<18,f+=i[s++]<<12,f+=i[s]<<6,p[a++]=f>>16&xe[8],p[a]=f>>8&xe[8]),n===2&&(f=i[s++]<<18,f+=i[s++]<<12,p[a]=f>>16&xe[8]),p},toString(r){if(r.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${r.length}`);let e="",t=0;function n(s,a,f,u){switch(t){case 76:e+=`\r
15
+ `});var Hd=gt(()=>{Vn();Nc();Ki();Ld();Ho()});var a1={};St(a1,{CID:()=>Pe,bases:()=>Ys,bytes:()=>nf,codecs:()=>Y8,digest:()=>qo,hasher:()=>Lc,hashes:()=>G8,varint:()=>Gs});var Ys,G8,Y8,$c=gt(()=>{Hm();zm();jm();Km();Vm();Td();Pc();Dd();Od();Ym();ff();Fd();n1();i1();Hd();Ys=re(re(re(re(re(re(re(re(re(re({},wd),_d),Ed),Sd),Md),Ad),kd),Cd),Id),Pd),G8=re(re({},Bd),Ud),Y8={raw:$d,json:qd}});function c1(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var f1,zd,J8,qc,jd=gt(()=>{$c();o(c1,"createCodec");f1=c1("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),zd=c1("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),J8=re({utf8:f1,"utf-8":f1,hex:Ys.base16,latin1:zd,ascii:zd,binary:zd},Ys),qc=J8});var u1={};St(u1,{fromString:()=>Lt});function Lt(r,e="utf8"){let t=qc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}var Hc=gt(()=>{jd();o(Lt,"fromString")});var l1={};St(l1,{toString:()=>It});function It(r,e="utf8"){let t=qc[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}var uf=gt(()=>{jd();o(It,"toString")});var d1=me(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});function X8(r,e){var t=r>>>16&65535,n=r&65535,i=e>>>16&65535,s=e&65535;return n*s+(t*s+n*i<<16>>>0)|0}o(X8,"imulShim");Ir.mul=Math.imul||X8;function Z8(r,e){return r+e|0}o(Z8,"add");Ir.add=Z8;function Q8(r,e){return r-e|0}o(Q8,"sub");Ir.sub=Q8;function e_(r,e){return r<<e|r>>>32-e}o(e_,"rotl");Ir.rotl=e_;function t_(r,e){return r<<32-e|r>>>e}o(t_,"rotr");Ir.rotr=t_;function r_(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}o(r_,"isIntegerShim");Ir.isInteger=Number.isInteger||r_;Ir.MAX_SAFE_INTEGER=9007199254740991;Ir.isSafeInteger=function(r){return Ir.isInteger(r)&&r>=-Ir.MAX_SAFE_INTEGER&&r<=Ir.MAX_SAFE_INTEGER}});var jo=me(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});var h1=d1();function n_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}o(n_,"readInt16BE");it.readInt16BE=n_;function i_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}o(i_,"readUint16BE");it.readUint16BE=i_;function o_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}o(o_,"readInt16LE");it.readInt16LE=o_;function s_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}o(s_,"readUint16LE");it.readUint16LE=s_;function p1(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}o(p1,"writeUint16BE");it.writeUint16BE=p1;it.writeInt16BE=p1;function m1(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}o(m1,"writeUint16LE");it.writeUint16LE=m1;it.writeInt16LE=m1;function Kd(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}o(Kd,"readInt32BE");it.readInt32BE=Kd;function Vd(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}o(Vd,"readUint32BE");it.readUint32BE=Vd;function Wd(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}o(Wd,"readInt32LE");it.readInt32LE=Wd;function Gd(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}o(Gd,"readUint32LE");it.readUint32LE=Gd;function jc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}o(jc,"writeUint32BE");it.writeUint32BE=jc;it.writeInt32BE=jc;function Kc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}o(Kc,"writeUint32LE");it.writeUint32LE=Kc;it.writeInt32LE=Kc;function a_(r,e){e===void 0&&(e=0);var t=Kd(r,e),n=Kd(r,e+4);return t*4294967296+n-(n>>31)*4294967296}o(a_,"readInt64BE");it.readInt64BE=a_;function f_(r,e){e===void 0&&(e=0);var t=Vd(r,e),n=Vd(r,e+4);return t*4294967296+n}o(f_,"readUint64BE");it.readUint64BE=f_;function c_(r,e){e===void 0&&(e=0);var t=Wd(r,e),n=Wd(r,e+4);return n*4294967296+t-(t>>31)*4294967296}o(c_,"readInt64LE");it.readInt64LE=c_;function u_(r,e){e===void 0&&(e=0);var t=Gd(r,e),n=Gd(r,e+4);return n*4294967296+t}o(u_,"readUint64LE");it.readUint64LE=u_;function b1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),jc(r/4294967296>>>0,e,t),jc(r>>>0,e,t+4),e}o(b1,"writeUint64BE");it.writeUint64BE=b1;it.writeInt64BE=b1;function g1(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Kc(r>>>0,e,t),Kc(r/4294967296>>>0,e,t+4),e}o(g1,"writeUint64LE");it.writeUint64LE=g1;it.writeInt64LE=g1;function l_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=r/8+t-1;s>=t;s--)n+=e[s]*i,i*=256;return n}o(l_,"readUintBE");it.readUintBE=l_;function d_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=t;s<t+r/8;s++)n+=e[s]*i,i*=256;return n}o(d_,"readUintLE");it.readUintLE=d_;function h_(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!h1.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,s=r/8+n-1;s>=n;s--)t[s]=e/i&255,i*=256;return t}o(h_,"writeUintBE");it.writeUintBE=h_;function p_(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!h1.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s<n+r/8;s++)t[s]=e/i&255,i*=256;return t}o(p_,"writeUintLE");it.writeUintLE=p_;function m_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}o(m_,"readFloat32BE");it.readFloat32BE=m_;function b_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}o(b_,"readFloat32LE");it.readFloat32LE=b_;function g_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}o(g_,"readFloat64BE");it.readFloat64BE=g_;function v_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}o(v_,"readFloat64LE");it.readFloat64LE=v_;function y_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}o(y_,"writeFloat32BE");it.writeFloat32BE=y_;function x_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}o(x_,"writeFloat32LE");it.writeFloat32LE=x_;function w_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}o(w_,"writeFloat64BE");it.writeFloat64BE=w_;function __(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}o(__,"writeFloat64LE");it.writeFloat64LE=__});var tn=me(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});function E_(r){for(var e=0;e<r.length;e++)r[e]=0;return r}o(E_,"wipe");Yd.wipe=E_});var y1=me(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var Wc=jo(),Vc=tn();Gi.DIGEST_LENGTH=32;Gi.BLOCK_SIZE=64;var v1=function(){function r(){this.digestLength=Gi.DIGEST_LENGTH,this.blockSize=Gi.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o(r,"SHA256"),r.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){Vc.wipe(this._buffer),Vc.wipe(this._temp),this.reset()},r.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Jd(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Jd(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,s=t<<3,a=t%64<56?64:128;this._buffer[n]=128;for(var f=n+1;f<a-8;f++)this._buffer[f]=0;Wc.writeUint32BE(i,this._buffer,a-8),Wc.writeUint32BE(s,this._buffer,a-4),Jd(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/4;f++)Wc.writeUint32BE(this._state[f],e,f*4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},r.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){Vc.wipe(e.state),e.buffer&&Vc.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Gi.SHA256=v1;var S_=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Jd(r,e,t,n,i){for(;i>=64;){for(var s=e[0],a=e[1],f=e[2],u=e[3],p=e[4],b=e[5],x=e[6],A=e[7],O=0;O<16;O++){var T=n+O*4;r[O]=Wc.readUint32BE(t,T)}for(var O=16;O<64;O++){var k=r[O-2],$=(k>>>17|k<<32-17)^(k>>>19|k<<32-19)^k>>>10;k=r[O-15];var C=(k>>>7|k<<32-7)^(k>>>18|k<<32-18)^k>>>3;r[O]=($+r[O-7]|0)+(C+r[O-16]|0)}for(var O=0;O<64;O++){var $=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&b^~p&x)|0)+(A+(S_[O]+r[O]|0)|0)|0,C=((s>>>2|s<<32-2)^(s>>>13|s<<32-13)^(s>>>22|s<<32-22))+(s&a^s&f^a&f)|0;A=x,x=b,b=p,p=u+$|0,u=f,f=a,a=s,s=$+C|0}e[0]+=s,e[1]+=a,e[2]+=f,e[3]+=u,e[4]+=p,e[5]+=b,e[6]+=x,e[7]+=A,n+=64,i-=64}return n}o(Jd,"hashBlocks");function M_(r){var e=new v1;e.update(r);var t=e.digest();return e.clean(),t}o(M_,"hash");Gi.hash=M_});var Xd=me((QP,Gc)=>{(function(){"use strict";var r="input is invalid type",e="finalize already called",t=typeof window=="object",n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var i=!t&&typeof self=="object",s=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?n=global:i&&(n=self);var a=!n.JS_SHA3_NO_COMMON_JS&&typeof Gc=="object"&&Gc.exports,f=typeof define=="function"&&define.amd,u=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",p="0123456789abcdef".split(""),b=[31,7936,2031616,520093696],x=[4,1024,262144,67108864],A=[1,256,65536,16777216],O=[6,1536,393216,100663296],T=[0,8,16,24],k=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],$=[224,256,384,512],C=[128,256],B=["hex","buffer","arrayBuffer","array","digest"],z={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(M){return Object.prototype.toString.call(M)==="[object Array]"}),u&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(M){return typeof M=="object"&&M.buffer&&M.buffer.constructor===ArrayBuffer});for(var H=o(function(M,K,J){return function(N){return new g(M,K,M).update(N)[J]()}},"createOutputMethod"),X=o(function(M,K,J){return function(N,R){return new g(M,K,R).update(N)[J]()}},"createShakeOutputMethod"),U=o(function(M,K,J){return function(N,R,V,W){return c["cshake"+M].update(N,R,V,W)[J]()}},"createCshakeOutputMethod"),L=o(function(M,K,J){return function(N,R,V,W){return c["kmac"+M].update(N,R,V,W)[J]()}},"createKmacOutputMethod"),F=o(function(M,K,J,N){for(var R=0;R<B.length;++R){var V=B[R];M[V]=K(J,N,V)}return M},"createOutputMethods"),ne=o(function(M,K){var J=H(M,K,"hex");return J.create=function(){return new g(M,K,M)},J.update=function(N){return J.create().update(N)},F(J,H,M,K)},"createMethod"),D=o(function(M,K){var J=X(M,K,"hex");return J.create=function(N){return new g(M,K,N)},J.update=function(N,R){return J.create(R).update(N)},F(J,X,M,K)},"createShakeMethod"),l=o(function(M,K){var J=z[M],N=U(M,K,"hex");return N.create=function(R,V,W){return!V&&!W?c["shake"+M].create(R):new g(M,K,R).bytepad([V,W],J)},N.update=function(R,V,W,ee){return N.create(V,W,ee).update(R)},F(N,U,M,K)},"createCshakeMethod"),v=o(function(M,K){var J=z[M],N=L(M,K,"hex");return N.create=function(R,V,W){return new S(M,K,V).bytepad(["KMAC",W],J).bytepad([R],J)},N.update=function(R,V,W,ee){return N.create(R,W,ee).update(V)},F(N,L,M,K)},"createKmacMethod"),h=[{name:"keccak",padding:A,bits:$,createMethod:ne},{name:"sha3",padding:O,bits:$,createMethod:ne},{name:"shake",padding:b,bits:C,createMethod:D},{name:"cshake",padding:x,bits:C,createMethod:l},{name:"kmac",padding:x,bits:C,createMethod:v}],c={},d=[],y=0;y<h.length;++y)for(var _=h[y],w=_.bits,m=0;m<w.length;++m){var E=_.name+"_"+w[m];if(d.push(E),c[E]=_.createMethod(w[m],_.padding),_.name!=="sha3"){var I=_.name+w[m];d.push(I),c[I]=c[E]}}function g(M,K,J){this.blocks=[],this.s=[],this.padding=K,this.outputBits=J,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(M<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var N=0;N<50;++N)this.s[N]=0}o(g,"Keccak"),g.prototype.update=function(M){if(this.finalized)throw new Error(e);var K,J=typeof M;if(J!=="string"){if(J==="object"){if(M===null)throw new Error(r);if(u&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!Array.isArray(M)&&(!u||!ArrayBuffer.isView(M)))throw new Error(r)}else throw new Error(r);K=!0}for(var N=this.blocks,R=this.byteCount,V=M.length,W=this.blockCount,ee=0,he=this.s,fe,Y;ee<V;){if(this.reset)for(this.reset=!1,N[0]=this.block,fe=1;fe<W+1;++fe)N[fe]=0;if(K)for(fe=this.start;ee<V&&fe<R;++ee)N[fe>>2]|=M[ee]<<T[fe++&3];else for(fe=this.start;ee<V&&fe<R;++ee)Y=M.charCodeAt(ee),Y<128?N[fe>>2]|=Y<<T[fe++&3]:Y<2048?(N[fe>>2]|=(192|Y>>6)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]):Y<55296||Y>=57344?(N[fe>>2]|=(224|Y>>12)<<T[fe++&3],N[fe>>2]|=(128|Y>>6&63)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]):(Y=65536+((Y&1023)<<10|M.charCodeAt(++ee)&1023),N[fe>>2]|=(240|Y>>18)<<T[fe++&3],N[fe>>2]|=(128|Y>>12&63)<<T[fe++&3],N[fe>>2]|=(128|Y>>6&63)<<T[fe++&3],N[fe>>2]|=(128|Y&63)<<T[fe++&3]);if(this.lastByteIndex=fe,fe>=R){for(this.start=fe-R,this.block=N[W],fe=0;fe<W;++fe)he[fe]^=N[fe];ie(he),this.reset=!0}else this.start=fe}return this},g.prototype.encode=function(M,K){var J=M&255,N=1,R=[J];for(M=M>>8,J=M&255;J>0;)R.unshift(J),M=M>>8,J=M&255,++N;return K?R.push(N):R.unshift(N),this.update(R),R.length},g.prototype.encodeString=function(M){var K,J=typeof M;if(J!=="string"){if(J==="object"){if(M===null)throw new Error(r);if(u&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!Array.isArray(M)&&(!u||!ArrayBuffer.isView(M)))throw new Error(r)}else throw new Error(r);K=!0}var N=0,R=M.length;if(K)N=R;else for(var V=0;V<M.length;++V){var W=M.charCodeAt(V);W<128?N+=1:W<2048?N+=2:W<55296||W>=57344?N+=3:(W=65536+((W&1023)<<10|M.charCodeAt(++V)&1023),N+=4)}return N+=this.encode(N*8),this.update(M),N},g.prototype.bytepad=function(M,K){for(var J=this.encode(K),N=0;N<M.length;++N)J+=this.encodeString(M[N]);var R=K-J%K,V=[];return V.length=R,this.update(V),this},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var M=this.blocks,K=this.lastByteIndex,J=this.blockCount,N=this.s;if(M[K>>2]|=this.padding[K&3],this.lastByteIndex===this.byteCount)for(M[0]=M[J],K=1;K<J+1;++K)M[K]=0;for(M[J-1]|=2147483648,K=0;K<J;++K)N[K]^=M[K];ie(N)}},g.prototype.toString=g.prototype.hex=function(){this.finalize();for(var M=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W="",ee;V<J;){for(R=0;R<M&&V<J;++R,++V)ee=K[R],W+=p[ee>>4&15]+p[ee&15]+p[ee>>12&15]+p[ee>>8&15]+p[ee>>20&15]+p[ee>>16&15]+p[ee>>28&15]+p[ee>>24&15];V%M===0&&(ie(K),R=0)}return N&&(ee=K[R],W+=p[ee>>4&15]+p[ee&15],N>1&&(W+=p[ee>>12&15]+p[ee>>8&15]),N>2&&(W+=p[ee>>20&15]+p[ee>>16&15])),W},g.prototype.arrayBuffer=function(){this.finalize();var M=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=this.outputBits>>3,ee;N?ee=new ArrayBuffer(J+1<<2):ee=new ArrayBuffer(W);for(var he=new Uint32Array(ee);V<J;){for(R=0;R<M&&V<J;++R,++V)he[V]=K[R];V%M===0&&ie(K)}return N&&(he[R]=K[R],ee=ee.slice(0,W)),ee},g.prototype.buffer=g.prototype.arrayBuffer,g.prototype.digest=g.prototype.array=function(){this.finalize();for(var M=this.blockCount,K=this.s,J=this.outputBlocks,N=this.extraBytes,R=0,V=0,W=[],ee,he;V<J;){for(R=0;R<M&&V<J;++R,++V)ee=V<<2,he=K[R],W[ee]=he&255,W[ee+1]=he>>8&255,W[ee+2]=he>>16&255,W[ee+3]=he>>24&255;V%M===0&&ie(K)}return N&&(ee=V<<2,he=K[R],W[ee]=he&255,N>1&&(W[ee+1]=he>>8&255),N>2&&(W[ee+2]=he>>16&255)),W};function S(M,K,J){g.call(this,M,K,J)}o(S,"Kmac"),S.prototype=new g,S.prototype.finalize=function(){return this.encode(this.outputBits,!0),g.prototype.finalize.call(this)};var ie=o(function(M){var K,J,N,R,V,W,ee,he,fe,Y,pe,Q,ce,q,se,be,ke,we,Oe,vr,te,G,P,j,ae,ue,le,ge,ft,Ee,ve,lt,De,Ne,Bn,Le,Be,Un,Ue,Fe,Fn,$e,qe,$n,He,ze,qn,je,Ke,Hn,Ve,We,zn,Ge,Ye,gn,mt,bt,Yr,Jr,Xr,Zr,Qr;for(N=0;N<48;N+=2)R=M[0]^M[10]^M[20]^M[30]^M[40],V=M[1]^M[11]^M[21]^M[31]^M[41],W=M[2]^M[12]^M[22]^M[32]^M[42],ee=M[3]^M[13]^M[23]^M[33]^M[43],he=M[4]^M[14]^M[24]^M[34]^M[44],fe=M[5]^M[15]^M[25]^M[35]^M[45],Y=M[6]^M[16]^M[26]^M[36]^M[46],pe=M[7]^M[17]^M[27]^M[37]^M[47],Q=M[8]^M[18]^M[28]^M[38]^M[48],ce=M[9]^M[19]^M[29]^M[39]^M[49],K=Q^(W<<1|ee>>>31),J=ce^(ee<<1|W>>>31),M[0]^=K,M[1]^=J,M[10]^=K,M[11]^=J,M[20]^=K,M[21]^=J,M[30]^=K,M[31]^=J,M[40]^=K,M[41]^=J,K=R^(he<<1|fe>>>31),J=V^(fe<<1|he>>>31),M[2]^=K,M[3]^=J,M[12]^=K,M[13]^=J,M[22]^=K,M[23]^=J,M[32]^=K,M[33]^=J,M[42]^=K,M[43]^=J,K=W^(Y<<1|pe>>>31),J=ee^(pe<<1|Y>>>31),M[4]^=K,M[5]^=J,M[14]^=K,M[15]^=J,M[24]^=K,M[25]^=J,M[34]^=K,M[35]^=J,M[44]^=K,M[45]^=J,K=he^(Q<<1|ce>>>31),J=fe^(ce<<1|Q>>>31),M[6]^=K,M[7]^=J,M[16]^=K,M[17]^=J,M[26]^=K,M[27]^=J,M[36]^=K,M[37]^=J,M[46]^=K,M[47]^=J,K=Y^(R<<1|V>>>31),J=pe^(V<<1|R>>>31),M[8]^=K,M[9]^=J,M[18]^=K,M[19]^=J,M[28]^=K,M[29]^=J,M[38]^=K,M[39]^=J,M[48]^=K,M[49]^=J,q=M[0],se=M[1],ze=M[11]<<4|M[10]>>>28,qn=M[10]<<4|M[11]>>>28,ge=M[20]<<3|M[21]>>>29,ft=M[21]<<3|M[20]>>>29,Jr=M[31]<<9|M[30]>>>23,Xr=M[30]<<9|M[31]>>>23,$e=M[40]<<18|M[41]>>>14,qe=M[41]<<18|M[40]>>>14,Ne=M[2]<<1|M[3]>>>31,Bn=M[3]<<1|M[2]>>>31,be=M[13]<<12|M[12]>>>20,ke=M[12]<<12|M[13]>>>20,je=M[22]<<10|M[23]>>>22,Ke=M[23]<<10|M[22]>>>22,Ee=M[33]<<13|M[32]>>>19,ve=M[32]<<13|M[33]>>>19,Zr=M[42]<<2|M[43]>>>30,Qr=M[43]<<2|M[42]>>>30,Ge=M[5]<<30|M[4]>>>2,Ye=M[4]<<30|M[5]>>>2,Le=M[14]<<6|M[15]>>>26,Be=M[15]<<6|M[14]>>>26,we=M[25]<<11|M[24]>>>21,Oe=M[24]<<11|M[25]>>>21,Hn=M[34]<<15|M[35]>>>17,Ve=M[35]<<15|M[34]>>>17,lt=M[45]<<29|M[44]>>>3,De=M[44]<<29|M[45]>>>3,j=M[6]<<28|M[7]>>>4,ae=M[7]<<28|M[6]>>>4,gn=M[17]<<23|M[16]>>>9,mt=M[16]<<23|M[17]>>>9,Un=M[26]<<25|M[27]>>>7,Ue=M[27]<<25|M[26]>>>7,vr=M[36]<<21|M[37]>>>11,te=M[37]<<21|M[36]>>>11,We=M[47]<<24|M[46]>>>8,zn=M[46]<<24|M[47]>>>8,$n=M[8]<<27|M[9]>>>5,He=M[9]<<27|M[8]>>>5,ue=M[18]<<20|M[19]>>>12,le=M[19]<<20|M[18]>>>12,bt=M[29]<<7|M[28]>>>25,Yr=M[28]<<7|M[29]>>>25,Fe=M[38]<<8|M[39]>>>24,Fn=M[39]<<8|M[38]>>>24,G=M[48]<<14|M[49]>>>18,P=M[49]<<14|M[48]>>>18,M[0]=q^~be&we,M[1]=se^~ke&Oe,M[10]=j^~ue&ge,M[11]=ae^~le&ft,M[20]=Ne^~Le&Un,M[21]=Bn^~Be&Ue,M[30]=$n^~ze&je,M[31]=He^~qn&Ke,M[40]=Ge^~gn&bt,M[41]=Ye^~mt&Yr,M[2]=be^~we&vr,M[3]=ke^~Oe&te,M[12]=ue^~ge&Ee,M[13]=le^~ft&ve,M[22]=Le^~Un&Fe,M[23]=Be^~Ue&Fn,M[32]=ze^~je&Hn,M[33]=qn^~Ke&Ve,M[42]=gn^~bt&Jr,M[43]=mt^~Yr&Xr,M[4]=we^~vr&G,M[5]=Oe^~te&P,M[14]=ge^~Ee&lt,M[15]=ft^~ve&De,M[24]=Un^~Fe&$e,M[25]=Ue^~Fn&qe,M[34]=je^~Hn&We,M[35]=Ke^~Ve&zn,M[44]=bt^~Jr&Zr,M[45]=Yr^~Xr&Qr,M[6]=vr^~G&q,M[7]=te^~P&se,M[16]=Ee^~lt&j,M[17]=ve^~De&ae,M[26]=Fe^~$e&Ne,M[27]=Fn^~qe&Bn,M[36]=Hn^~We&$n,M[37]=Ve^~zn&He,M[46]=Jr^~Zr&Ge,M[47]=Xr^~Qr&Ye,M[8]=G^~q&be,M[9]=P^~se&ke,M[18]=lt^~j&ue,M[19]=De^~ae&le,M[28]=$e^~Ne&Le,M[29]=qe^~Bn&Be,M[38]=We^~$n&ze,M[39]=zn^~He&qn,M[48]=Zr^~Ge&gn,M[49]=Qr^~Ye&mt,M[0]^=k[N],M[1]^=k[N+1]},"f");if(a)Gc.exports=c;else{for(y=0;y<d.length;++y)n[d[y]]=c[d[y]];f&&define(function(){return c})}})()});var x1=me((eN,A_)=>{A_.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{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/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{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"},dependencies:{"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 Zd=me(()=>{});var Wn=me((w1,Qd)=>{(function(r,e){"use strict";function t(D,l){if(!D)throw new Error(l||"Assertion failed")}o(t,"assert");function n(D,l){D.super_=l;var v=o(function(){},"TempCtor");v.prototype=l.prototype,D.prototype=new v,D.prototype.constructor=D}o(n,"inherits");function i(D,l,v){if(i.isBN(D))return D;this.negative=0,this.words=null,this.length=0,this.red=null,D!==null&&((l==="le"||l==="be")&&(v=l,l=10),this._init(D||0,l||10,v||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=Zd().Buffer}catch(D){}i.isBN=o(function(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},"isBN"),i.max=o(function(l,v){return l.cmp(v)>0?l:v},"max"),i.min=o(function(l,v){return l.cmp(v)<0?l:v},"min"),i.prototype._init=o(function(l,v,h){if(typeof l=="number")return this._initNumber(l,v,h);if(typeof l=="object")return this._initArray(l,v,h);v==="hex"&&(v=16),t(v===(v|0)&&v>=2&&v<=36),l=l.toString().replace(/\s+/g,"");var c=0;l[0]==="-"&&(c++,this.negative=1),c<l.length&&(v===16?this._parseHex(l,c,h):(this._parseBase(l,v,c),h==="le"&&this._initArray(this.toArray(),v,h)))},"init"),i.prototype._initNumber=o(function(l,v,h){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),v,h)},"_initNumber"),i.prototype._initArray=o(function(l,v,h){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d,y,_=0;if(h==="be")for(c=l.length-1,d=0;c>=0;c-=3)y=l[c]|l[c-1]<<8|l[c-2]<<16,this.words[d]|=y<<_&67108863,this.words[d+1]=y>>>26-_&67108863,_+=24,_>=26&&(_-=26,d++);else if(h==="le")for(c=0,d=0;c<l.length;c+=3)y=l[c]|l[c+1]<<8|l[c+2]<<16,this.words[d]|=y<<_&67108863,this.words[d+1]=y>>>26-_&67108863,_+=24,_>=26&&(_-=26,d++);return this.strip()},"_initArray");function a(D,l){var v=D.charCodeAt(l);return v>=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}o(a,"parseHex4Bits");function f(D,l,v){var h=a(D,v);return v-1>=l&&(h|=a(D,v-1)<<4),h}o(f,"parseHexByte"),i.prototype._parseHex=o(function(l,v,h){this.length=Math.ceil((l.length-v)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d=0,y=0,_;if(h==="be")for(c=l.length-1;c>=v;c-=2)_=f(l,v,c)<<d,this.words[y]|=_&67108863,d>=18?(d-=18,y+=1,this.words[y]|=_>>>26):d+=8;else{var w=l.length-v;for(c=w%2===0?v+1:v;c<l.length;c+=2)_=f(l,v,c)<<d,this.words[y]|=_&67108863,d>=18?(d-=18,y+=1,this.words[y]|=_>>>26):d+=8}this.strip()},"_parseHex");function u(D,l,v,h){for(var c=0,d=Math.min(D.length,v),y=l;y<d;y++){var _=D.charCodeAt(y)-48;c*=h,_>=49?c+=_-49+10:_>=17?c+=_-17+10:c+=_}return c}o(u,"parseBase"),i.prototype._parseBase=o(function(l,v,h){this.words=[0],this.length=1;for(var c=0,d=1;d<=67108863;d*=v)c++;c--,d=d/v|0;for(var y=l.length-h,_=y%c,w=Math.min(y,y-_)+h,m=0,E=h;E<w;E+=c)m=u(l,E,E+c,v),this.imuln(d),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if(_!==0){var I=1;for(m=u(l,E,l.length,v),E=0;E<_;E++)I*=v;this.imuln(I),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this.strip()},"_parseBase"),i.prototype.copy=o(function(l){l.words=new Array(this.length);for(var v=0;v<this.length;v++)l.words[v]=this.words[v];l.length=this.length,l.negative=this.negative,l.red=this.red},"copy"),i.prototype.clone=o(function(){var l=new i(null);return this.copy(l),l},"clone"),i.prototype._expand=o(function(l){for(;this.length<l;)this.words[this.length++]=0;return this},"_expand"),i.prototype.strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),i.prototype.inspect=o(function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"},"inspect");var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],b=[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],x=[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];i.prototype.toString=o(function(l,v){l=l||10,v=v|0||1;var h;if(l===16||l==="hex"){h="";for(var c=0,d=0,y=0;y<this.length;y++){var _=this.words[y],w=((_<<c|d)&16777215).toString(16);d=_>>>24-c&16777215,d!==0||y!==this.length-1?h=p[6-w.length]+w+h:h=w+h,c+=2,c>=26&&(c-=26,y--)}for(d!==0&&(h=d.toString(16)+h);h.length%v!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(l===(l|0)&&l>=2&&l<=36){var m=b[l],E=x[l];h="";var I=this.clone();for(I.negative=0;!I.isZero();){var g=I.modn(E).toString(l);I=I.idivn(E),I.isZero()?h=g+h:h=p[m-g.length]+g+h}for(this.isZero()&&(h="0"+h);h.length%v!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16)},"toJSON"),i.prototype.toBuffer=o(function(l,v){return t(typeof s!="undefined"),this.toArrayLike(s,l,v)},"toBuffer"),i.prototype.toArray=o(function(l,v){return this.toArrayLike(Array,l,v)},"toArray"),i.prototype.toArrayLike=o(function(l,v,h){var c=this.byteLength(),d=h||Math.max(1,c);t(c<=d,"byte array longer than desired length"),t(d>0,"Requested array length <= 0"),this.strip();var y=v==="le",_=new l(d),w,m,E=this.clone();if(y){for(m=0;!E.isZero();m++)w=E.andln(255),E.iushrn(8),_[m]=w;for(;m<d;m++)_[m]=0}else{for(m=0;m<d-c;m++)_[m]=0;for(m=0;!E.isZero();m++)w=E.andln(255),E.iushrn(8),_[d-m-1]=w}return _},"toArrayLike"),Math.clz32?i.prototype._countBits=o(function(l){return 32-Math.clz32(l)},"_countBits"):i.prototype._countBits=o(function(l){var v=l,h=0;return v>=4096&&(h+=13,v>>>=13),v>=64&&(h+=7,v>>>=7),v>=8&&(h+=4,v>>>=4),v>=2&&(h+=2,v>>>=2),h+v},"_countBits"),i.prototype._zeroBits=o(function(l){if(l===0)return 26;var v=l,h=0;return(v&8191)===0&&(h+=13,v>>>=13),(v&127)===0&&(h+=7,v>>>=7),(v&15)===0&&(h+=4,v>>>=4),(v&3)===0&&(h+=2,v>>>=2),(v&1)===0&&h++,h},"_zeroBits"),i.prototype.bitLength=o(function(){var l=this.words[this.length-1],v=this._countBits(l);return(this.length-1)*26+v},"bitLength");function A(D){for(var l=new Array(D.bitLength()),v=0;v<l.length;v++){var h=v/26|0,c=v%26;l[v]=(D.words[h]&1<<c)>>>c}return l}o(A,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var l=0,v=0;v<this.length;v++){var h=this._zeroBits(this.words[v]);if(l+=h,h!==26)break}return l},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var v=0;v<l.length;v++)this.words[v]=this.words[v]|l.words[v];return this.strip()},"iuor"),i.prototype.ior=o(function(l){return t((this.negative|l.negative)===0),this.iuor(l)},"ior"),i.prototype.or=o(function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},"or"),i.prototype.uor=o(function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(l){var v;this.length>l.length?v=l:v=this;for(var h=0;h<v.length;h++)this.words[h]=this.words[h]&l.words[h];return this.length=v.length,this.strip()},"iuand"),i.prototype.iand=o(function(l){return t((this.negative|l.negative)===0),this.iuand(l)},"iand"),i.prototype.and=o(function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},"and"),i.prototype.uand=o(function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(l){var v,h;this.length>l.length?(v=this,h=l):(v=l,h=this);for(var c=0;c<h.length;c++)this.words[c]=v.words[c]^h.words[c];if(this!==v)for(;c<v.length;c++)this.words[c]=v.words[c];return this.length=v.length,this.strip()},"iuxor"),i.prototype.ixor=o(function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},"ixor"),i.prototype.xor=o(function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(l){t(typeof l=="number"&&l>=0);var v=Math.ceil(l/26)|0,h=l%26;this._expand(v),h>0&&v--;for(var c=0;c<v;c++)this.words[c]=~this.words[c]&67108863;return h>0&&(this.words[c]=~this.words[c]&67108863>>26-h),this.strip()},"inotn"),i.prototype.notn=o(function(l){return this.clone().inotn(l)},"notn"),i.prototype.setn=o(function(l,v){t(typeof l=="number"&&l>=0);var h=l/26|0,c=l%26;return this._expand(h+1),v?this.words[h]=this.words[h]|1<<c:this.words[h]=this.words[h]&~(1<<c),this.strip()},"setn"),i.prototype.iadd=o(function(l){var v;if(this.negative!==0&&l.negative===0)return this.negative=0,v=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,v=this.isub(l),l.negative=1,v._normSign();var h,c;this.length>l.length?(h=this,c=l):(h=l,c=this);for(var d=0,y=0;y<c.length;y++)v=(h.words[y]|0)+(c.words[y]|0)+d,this.words[y]=v&67108863,d=v>>>26;for(;d!==0&&y<h.length;y++)v=(h.words[y]|0)+d,this.words[y]=v&67108863,d=v>>>26;if(this.length=h.length,d!==0)this.words[this.length]=d,this.length++;else if(h!==this)for(;y<h.length;y++)this.words[y]=h.words[y];return this},"iadd"),i.prototype.add=o(function(l){var v;return l.negative!==0&&this.negative===0?(l.negative=0,v=this.sub(l),l.negative^=1,v):l.negative===0&&this.negative!==0?(this.negative=0,v=l.sub(this),this.negative=1,v):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},"add"),i.prototype.isub=o(function(l){if(l.negative!==0){l.negative=0;var v=this.iadd(l);return l.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var h=this.cmp(l);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,d;h>0?(c=this,d=l):(c=l,d=this);for(var y=0,_=0;_<d.length;_++)v=(c.words[_]|0)-(d.words[_]|0)+y,y=v>>26,this.words[_]=v&67108863;for(;y!==0&&_<c.length;_++)v=(c.words[_]|0)+y,y=v>>26,this.words[_]=v&67108863;if(y===0&&_<c.length&&c!==this)for(;_<c.length;_++)this.words[_]=c.words[_];return this.length=Math.max(this.length,_),c!==this&&(this.negative=1),this.strip()},"isub"),i.prototype.sub=o(function(l){return this.clone().isub(l)},"sub");function O(D,l,v){v.negative=l.negative^D.negative;var h=D.length+l.length|0;v.length=h,h=h-1|0;var c=D.words[0]|0,d=l.words[0]|0,y=c*d,_=y&67108863,w=y/67108864|0;v.words[0]=_;for(var m=1;m<h;m++){for(var E=w>>>26,I=w&67108863,g=Math.min(m,l.length-1),S=Math.max(0,m-D.length+1);S<=g;S++){var ie=m-S|0;c=D.words[ie]|0,d=l.words[S]|0,y=c*d+I,E+=y/67108864|0,I=y&67108863}v.words[m]=I|0,w=E|0}return w!==0?v.words[m]=w|0:v.length--,v.strip()}o(O,"smallMulTo");var T=o(function(l,v,h){var c=l.words,d=v.words,y=h.words,_=0,w,m,E,I=c[0]|0,g=I&8191,S=I>>>13,ie=c[1]|0,M=ie&8191,K=ie>>>13,J=c[2]|0,N=J&8191,R=J>>>13,V=c[3]|0,W=V&8191,ee=V>>>13,he=c[4]|0,fe=he&8191,Y=he>>>13,pe=c[5]|0,Q=pe&8191,ce=pe>>>13,q=c[6]|0,se=q&8191,be=q>>>13,ke=c[7]|0,we=ke&8191,Oe=ke>>>13,vr=c[8]|0,te=vr&8191,G=vr>>>13,P=c[9]|0,j=P&8191,ae=P>>>13,ue=d[0]|0,le=ue&8191,ge=ue>>>13,ft=d[1]|0,Ee=ft&8191,ve=ft>>>13,lt=d[2]|0,De=lt&8191,Ne=lt>>>13,Bn=d[3]|0,Le=Bn&8191,Be=Bn>>>13,Un=d[4]|0,Ue=Un&8191,Fe=Un>>>13,Fn=d[5]|0,$e=Fn&8191,qe=Fn>>>13,$n=d[6]|0,He=$n&8191,ze=$n>>>13,qn=d[7]|0,je=qn&8191,Ke=qn>>>13,Hn=d[8]|0,Ve=Hn&8191,We=Hn>>>13,zn=d[9]|0,Ge=zn&8191,Ye=zn>>>13;h.negative=l.negative^v.negative,h.length=19,w=Math.imul(g,le),m=Math.imul(g,ge),m=m+Math.imul(S,le)|0,E=Math.imul(S,ge);var gn=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(gn>>>26)|0,gn&=67108863,w=Math.imul(M,le),m=Math.imul(M,ge),m=m+Math.imul(K,le)|0,E=Math.imul(K,ge),w=w+Math.imul(g,Ee)|0,m=m+Math.imul(g,ve)|0,m=m+Math.imul(S,Ee)|0,E=E+Math.imul(S,ve)|0;var mt=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(mt>>>26)|0,mt&=67108863,w=Math.imul(N,le),m=Math.imul(N,ge),m=m+Math.imul(R,le)|0,E=Math.imul(R,ge),w=w+Math.imul(M,Ee)|0,m=m+Math.imul(M,ve)|0,m=m+Math.imul(K,Ee)|0,E=E+Math.imul(K,ve)|0,w=w+Math.imul(g,De)|0,m=m+Math.imul(g,Ne)|0,m=m+Math.imul(S,De)|0,E=E+Math.imul(S,Ne)|0;var bt=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(bt>>>26)|0,bt&=67108863,w=Math.imul(W,le),m=Math.imul(W,ge),m=m+Math.imul(ee,le)|0,E=Math.imul(ee,ge),w=w+Math.imul(N,Ee)|0,m=m+Math.imul(N,ve)|0,m=m+Math.imul(R,Ee)|0,E=E+Math.imul(R,ve)|0,w=w+Math.imul(M,De)|0,m=m+Math.imul(M,Ne)|0,m=m+Math.imul(K,De)|0,E=E+Math.imul(K,Ne)|0,w=w+Math.imul(g,Le)|0,m=m+Math.imul(g,Be)|0,m=m+Math.imul(S,Le)|0,E=E+Math.imul(S,Be)|0;var Yr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,w=Math.imul(fe,le),m=Math.imul(fe,ge),m=m+Math.imul(Y,le)|0,E=Math.imul(Y,ge),w=w+Math.imul(W,Ee)|0,m=m+Math.imul(W,ve)|0,m=m+Math.imul(ee,Ee)|0,E=E+Math.imul(ee,ve)|0,w=w+Math.imul(N,De)|0,m=m+Math.imul(N,Ne)|0,m=m+Math.imul(R,De)|0,E=E+Math.imul(R,Ne)|0,w=w+Math.imul(M,Le)|0,m=m+Math.imul(M,Be)|0,m=m+Math.imul(K,Le)|0,E=E+Math.imul(K,Be)|0,w=w+Math.imul(g,Ue)|0,m=m+Math.imul(g,Fe)|0,m=m+Math.imul(S,Ue)|0,E=E+Math.imul(S,Fe)|0;var Jr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,w=Math.imul(Q,le),m=Math.imul(Q,ge),m=m+Math.imul(ce,le)|0,E=Math.imul(ce,ge),w=w+Math.imul(fe,Ee)|0,m=m+Math.imul(fe,ve)|0,m=m+Math.imul(Y,Ee)|0,E=E+Math.imul(Y,ve)|0,w=w+Math.imul(W,De)|0,m=m+Math.imul(W,Ne)|0,m=m+Math.imul(ee,De)|0,E=E+Math.imul(ee,Ne)|0,w=w+Math.imul(N,Le)|0,m=m+Math.imul(N,Be)|0,m=m+Math.imul(R,Le)|0,E=E+Math.imul(R,Be)|0,w=w+Math.imul(M,Ue)|0,m=m+Math.imul(M,Fe)|0,m=m+Math.imul(K,Ue)|0,E=E+Math.imul(K,Fe)|0,w=w+Math.imul(g,$e)|0,m=m+Math.imul(g,qe)|0,m=m+Math.imul(S,$e)|0,E=E+Math.imul(S,qe)|0;var Xr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,w=Math.imul(se,le),m=Math.imul(se,ge),m=m+Math.imul(be,le)|0,E=Math.imul(be,ge),w=w+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,ve)|0,m=m+Math.imul(ce,Ee)|0,E=E+Math.imul(ce,ve)|0,w=w+Math.imul(fe,De)|0,m=m+Math.imul(fe,Ne)|0,m=m+Math.imul(Y,De)|0,E=E+Math.imul(Y,Ne)|0,w=w+Math.imul(W,Le)|0,m=m+Math.imul(W,Be)|0,m=m+Math.imul(ee,Le)|0,E=E+Math.imul(ee,Be)|0,w=w+Math.imul(N,Ue)|0,m=m+Math.imul(N,Fe)|0,m=m+Math.imul(R,Ue)|0,E=E+Math.imul(R,Fe)|0,w=w+Math.imul(M,$e)|0,m=m+Math.imul(M,qe)|0,m=m+Math.imul(K,$e)|0,E=E+Math.imul(K,qe)|0,w=w+Math.imul(g,He)|0,m=m+Math.imul(g,ze)|0,m=m+Math.imul(S,He)|0,E=E+Math.imul(S,ze)|0;var Zr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,w=Math.imul(we,le),m=Math.imul(we,ge),m=m+Math.imul(Oe,le)|0,E=Math.imul(Oe,ge),w=w+Math.imul(se,Ee)|0,m=m+Math.imul(se,ve)|0,m=m+Math.imul(be,Ee)|0,E=E+Math.imul(be,ve)|0,w=w+Math.imul(Q,De)|0,m=m+Math.imul(Q,Ne)|0,m=m+Math.imul(ce,De)|0,E=E+Math.imul(ce,Ne)|0,w=w+Math.imul(fe,Le)|0,m=m+Math.imul(fe,Be)|0,m=m+Math.imul(Y,Le)|0,E=E+Math.imul(Y,Be)|0,w=w+Math.imul(W,Ue)|0,m=m+Math.imul(W,Fe)|0,m=m+Math.imul(ee,Ue)|0,E=E+Math.imul(ee,Fe)|0,w=w+Math.imul(N,$e)|0,m=m+Math.imul(N,qe)|0,m=m+Math.imul(R,$e)|0,E=E+Math.imul(R,qe)|0,w=w+Math.imul(M,He)|0,m=m+Math.imul(M,ze)|0,m=m+Math.imul(K,He)|0,E=E+Math.imul(K,ze)|0,w=w+Math.imul(g,je)|0,m=m+Math.imul(g,Ke)|0,m=m+Math.imul(S,je)|0,E=E+Math.imul(S,Ke)|0;var Qr=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,w=Math.imul(te,le),m=Math.imul(te,ge),m=m+Math.imul(G,le)|0,E=Math.imul(G,ge),w=w+Math.imul(we,Ee)|0,m=m+Math.imul(we,ve)|0,m=m+Math.imul(Oe,Ee)|0,E=E+Math.imul(Oe,ve)|0,w=w+Math.imul(se,De)|0,m=m+Math.imul(se,Ne)|0,m=m+Math.imul(be,De)|0,E=E+Math.imul(be,Ne)|0,w=w+Math.imul(Q,Le)|0,m=m+Math.imul(Q,Be)|0,m=m+Math.imul(ce,Le)|0,E=E+Math.imul(ce,Be)|0,w=w+Math.imul(fe,Ue)|0,m=m+Math.imul(fe,Fe)|0,m=m+Math.imul(Y,Ue)|0,E=E+Math.imul(Y,Fe)|0,w=w+Math.imul(W,$e)|0,m=m+Math.imul(W,qe)|0,m=m+Math.imul(ee,$e)|0,E=E+Math.imul(ee,qe)|0,w=w+Math.imul(N,He)|0,m=m+Math.imul(N,ze)|0,m=m+Math.imul(R,He)|0,E=E+Math.imul(R,ze)|0,w=w+Math.imul(M,je)|0,m=m+Math.imul(M,Ke)|0,m=m+Math.imul(K,je)|0,E=E+Math.imul(K,Ke)|0,w=w+Math.imul(g,Ve)|0,m=m+Math.imul(g,We)|0,m=m+Math.imul(S,Ve)|0,E=E+Math.imul(S,We)|0;var To=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(To>>>26)|0,To&=67108863,w=Math.imul(j,le),m=Math.imul(j,ge),m=m+Math.imul(ae,le)|0,E=Math.imul(ae,ge),w=w+Math.imul(te,Ee)|0,m=m+Math.imul(te,ve)|0,m=m+Math.imul(G,Ee)|0,E=E+Math.imul(G,ve)|0,w=w+Math.imul(we,De)|0,m=m+Math.imul(we,Ne)|0,m=m+Math.imul(Oe,De)|0,E=E+Math.imul(Oe,Ne)|0,w=w+Math.imul(se,Le)|0,m=m+Math.imul(se,Be)|0,m=m+Math.imul(be,Le)|0,E=E+Math.imul(be,Be)|0,w=w+Math.imul(Q,Ue)|0,m=m+Math.imul(Q,Fe)|0,m=m+Math.imul(ce,Ue)|0,E=E+Math.imul(ce,Fe)|0,w=w+Math.imul(fe,$e)|0,m=m+Math.imul(fe,qe)|0,m=m+Math.imul(Y,$e)|0,E=E+Math.imul(Y,qe)|0,w=w+Math.imul(W,He)|0,m=m+Math.imul(W,ze)|0,m=m+Math.imul(ee,He)|0,E=E+Math.imul(ee,ze)|0,w=w+Math.imul(N,je)|0,m=m+Math.imul(N,Ke)|0,m=m+Math.imul(R,je)|0,E=E+Math.imul(R,Ke)|0,w=w+Math.imul(M,Ve)|0,m=m+Math.imul(M,We)|0,m=m+Math.imul(K,Ve)|0,E=E+Math.imul(K,We)|0,w=w+Math.imul(g,Ge)|0,m=m+Math.imul(g,Ye)|0,m=m+Math.imul(S,Ge)|0,E=E+Math.imul(S,Ye)|0;var ko=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(ko>>>26)|0,ko&=67108863,w=Math.imul(j,Ee),m=Math.imul(j,ve),m=m+Math.imul(ae,Ee)|0,E=Math.imul(ae,ve),w=w+Math.imul(te,De)|0,m=m+Math.imul(te,Ne)|0,m=m+Math.imul(G,De)|0,E=E+Math.imul(G,Ne)|0,w=w+Math.imul(we,Le)|0,m=m+Math.imul(we,Be)|0,m=m+Math.imul(Oe,Le)|0,E=E+Math.imul(Oe,Be)|0,w=w+Math.imul(se,Ue)|0,m=m+Math.imul(se,Fe)|0,m=m+Math.imul(be,Ue)|0,E=E+Math.imul(be,Fe)|0,w=w+Math.imul(Q,$e)|0,m=m+Math.imul(Q,qe)|0,m=m+Math.imul(ce,$e)|0,E=E+Math.imul(ce,qe)|0,w=w+Math.imul(fe,He)|0,m=m+Math.imul(fe,ze)|0,m=m+Math.imul(Y,He)|0,E=E+Math.imul(Y,ze)|0,w=w+Math.imul(W,je)|0,m=m+Math.imul(W,Ke)|0,m=m+Math.imul(ee,je)|0,E=E+Math.imul(ee,Ke)|0,w=w+Math.imul(N,Ve)|0,m=m+Math.imul(N,We)|0,m=m+Math.imul(R,Ve)|0,E=E+Math.imul(R,We)|0,w=w+Math.imul(M,Ge)|0,m=m+Math.imul(M,Ye)|0,m=m+Math.imul(K,Ge)|0,E=E+Math.imul(K,Ye)|0;var Co=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Co>>>26)|0,Co&=67108863,w=Math.imul(j,De),m=Math.imul(j,Ne),m=m+Math.imul(ae,De)|0,E=Math.imul(ae,Ne),w=w+Math.imul(te,Le)|0,m=m+Math.imul(te,Be)|0,m=m+Math.imul(G,Le)|0,E=E+Math.imul(G,Be)|0,w=w+Math.imul(we,Ue)|0,m=m+Math.imul(we,Fe)|0,m=m+Math.imul(Oe,Ue)|0,E=E+Math.imul(Oe,Fe)|0,w=w+Math.imul(se,$e)|0,m=m+Math.imul(se,qe)|0,m=m+Math.imul(be,$e)|0,E=E+Math.imul(be,qe)|0,w=w+Math.imul(Q,He)|0,m=m+Math.imul(Q,ze)|0,m=m+Math.imul(ce,He)|0,E=E+Math.imul(ce,ze)|0,w=w+Math.imul(fe,je)|0,m=m+Math.imul(fe,Ke)|0,m=m+Math.imul(Y,je)|0,E=E+Math.imul(Y,Ke)|0,w=w+Math.imul(W,Ve)|0,m=m+Math.imul(W,We)|0,m=m+Math.imul(ee,Ve)|0,E=E+Math.imul(ee,We)|0,w=w+Math.imul(N,Ge)|0,m=m+Math.imul(N,Ye)|0,m=m+Math.imul(R,Ge)|0,E=E+Math.imul(R,Ye)|0;var Do=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Do>>>26)|0,Do&=67108863,w=Math.imul(j,Le),m=Math.imul(j,Be),m=m+Math.imul(ae,Le)|0,E=Math.imul(ae,Be),w=w+Math.imul(te,Ue)|0,m=m+Math.imul(te,Fe)|0,m=m+Math.imul(G,Ue)|0,E=E+Math.imul(G,Fe)|0,w=w+Math.imul(we,$e)|0,m=m+Math.imul(we,qe)|0,m=m+Math.imul(Oe,$e)|0,E=E+Math.imul(Oe,qe)|0,w=w+Math.imul(se,He)|0,m=m+Math.imul(se,ze)|0,m=m+Math.imul(be,He)|0,E=E+Math.imul(be,ze)|0,w=w+Math.imul(Q,je)|0,m=m+Math.imul(Q,Ke)|0,m=m+Math.imul(ce,je)|0,E=E+Math.imul(ce,Ke)|0,w=w+Math.imul(fe,Ve)|0,m=m+Math.imul(fe,We)|0,m=m+Math.imul(Y,Ve)|0,E=E+Math.imul(Y,We)|0,w=w+Math.imul(W,Ge)|0,m=m+Math.imul(W,Ye)|0,m=m+Math.imul(ee,Ge)|0,E=E+Math.imul(ee,Ye)|0;var Io=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Io>>>26)|0,Io&=67108863,w=Math.imul(j,Ue),m=Math.imul(j,Fe),m=m+Math.imul(ae,Ue)|0,E=Math.imul(ae,Fe),w=w+Math.imul(te,$e)|0,m=m+Math.imul(te,qe)|0,m=m+Math.imul(G,$e)|0,E=E+Math.imul(G,qe)|0,w=w+Math.imul(we,He)|0,m=m+Math.imul(we,ze)|0,m=m+Math.imul(Oe,He)|0,E=E+Math.imul(Oe,ze)|0,w=w+Math.imul(se,je)|0,m=m+Math.imul(se,Ke)|0,m=m+Math.imul(be,je)|0,E=E+Math.imul(be,Ke)|0,w=w+Math.imul(Q,Ve)|0,m=m+Math.imul(Q,We)|0,m=m+Math.imul(ce,Ve)|0,E=E+Math.imul(ce,We)|0,w=w+Math.imul(fe,Ge)|0,m=m+Math.imul(fe,Ye)|0,m=m+Math.imul(Y,Ge)|0,E=E+Math.imul(Y,Ye)|0;var Oo=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,w=Math.imul(j,$e),m=Math.imul(j,qe),m=m+Math.imul(ae,$e)|0,E=Math.imul(ae,qe),w=w+Math.imul(te,He)|0,m=m+Math.imul(te,ze)|0,m=m+Math.imul(G,He)|0,E=E+Math.imul(G,ze)|0,w=w+Math.imul(we,je)|0,m=m+Math.imul(we,Ke)|0,m=m+Math.imul(Oe,je)|0,E=E+Math.imul(Oe,Ke)|0,w=w+Math.imul(se,Ve)|0,m=m+Math.imul(se,We)|0,m=m+Math.imul(be,Ve)|0,E=E+Math.imul(be,We)|0,w=w+Math.imul(Q,Ge)|0,m=m+Math.imul(Q,Ye)|0,m=m+Math.imul(ce,Ge)|0,E=E+Math.imul(ce,Ye)|0;var Po=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Po>>>26)|0,Po&=67108863,w=Math.imul(j,He),m=Math.imul(j,ze),m=m+Math.imul(ae,He)|0,E=Math.imul(ae,ze),w=w+Math.imul(te,je)|0,m=m+Math.imul(te,Ke)|0,m=m+Math.imul(G,je)|0,E=E+Math.imul(G,Ke)|0,w=w+Math.imul(we,Ve)|0,m=m+Math.imul(we,We)|0,m=m+Math.imul(Oe,Ve)|0,E=E+Math.imul(Oe,We)|0,w=w+Math.imul(se,Ge)|0,m=m+Math.imul(se,Ye)|0,m=m+Math.imul(be,Ge)|0,E=E+Math.imul(be,Ye)|0;var No=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(No>>>26)|0,No&=67108863,w=Math.imul(j,je),m=Math.imul(j,Ke),m=m+Math.imul(ae,je)|0,E=Math.imul(ae,Ke),w=w+Math.imul(te,Ve)|0,m=m+Math.imul(te,We)|0,m=m+Math.imul(G,Ve)|0,E=E+Math.imul(G,We)|0,w=w+Math.imul(we,Ge)|0,m=m+Math.imul(we,Ye)|0,m=m+Math.imul(Oe,Ge)|0,E=E+Math.imul(Oe,Ye)|0;var Ro=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,w=Math.imul(j,Ve),m=Math.imul(j,We),m=m+Math.imul(ae,Ve)|0,E=Math.imul(ae,We),w=w+Math.imul(te,Ge)|0,m=m+Math.imul(te,Ye)|0,m=m+Math.imul(G,Ge)|0,E=E+Math.imul(G,Ye)|0;var Lo=(_+w|0)+((m&8191)<<13)|0;_=(E+(m>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,w=Math.imul(j,Ge),m=Math.imul(j,Ye),m=m+Math.imul(ae,Ge)|0,E=Math.imul(ae,Ye);var Bo=(_+w|0)+((m&8191)<<13)|0;return _=(E+(m>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,y[0]=gn,y[1]=mt,y[2]=bt,y[3]=Yr,y[4]=Jr,y[5]=Xr,y[6]=Zr,y[7]=Qr,y[8]=To,y[9]=ko,y[10]=Co,y[11]=Do,y[12]=Io,y[13]=Oo,y[14]=Po,y[15]=No,y[16]=Ro,y[17]=Lo,y[18]=Bo,_!==0&&(y[19]=_,h.length++),h},"comb10MulTo");Math.imul||(T=O);function k(D,l,v){v.negative=l.negative^D.negative,v.length=D.length+l.length;for(var h=0,c=0,d=0;d<v.length-1;d++){var y=c;c=0;for(var _=h&67108863,w=Math.min(d,l.length-1),m=Math.max(0,d-D.length+1);m<=w;m++){var E=d-m,I=D.words[E]|0,g=l.words[m]|0,S=I*g,ie=S&67108863;y=y+(S/67108864|0)|0,ie=ie+_|0,_=ie&67108863,y=y+(ie>>>26)|0,c+=y>>>26,y&=67108863}v.words[d]=_,h=y,y=c}return h!==0?v.words[d]=h:v.length--,v.strip()}o(k,"bigMulTo");function $(D,l,v){var h=new C;return h.mulp(D,l,v)}o($,"jumboMulTo"),i.prototype.mulTo=o(function(l,v){var h,c=this.length+l.length;return this.length===10&&l.length===10?h=T(this,l,v):c<63?h=O(this,l,v):c<1024?h=k(this,l,v):h=$(this,l,v),h},"mulTo");function C(D,l){this.x=D,this.y=l}o(C,"FFTM"),C.prototype.makeRBT=o(function(l){for(var v=new Array(l),h=i.prototype._countBits(l)-1,c=0;c<l;c++)v[c]=this.revBin(c,h,l);return v},"makeRBT"),C.prototype.revBin=o(function(l,v,h){if(l===0||l===h-1)return l;for(var c=0,d=0;d<v;d++)c|=(l&1)<<v-d-1,l>>=1;return c},"revBin"),C.prototype.permute=o(function(l,v,h,c,d,y){for(var _=0;_<y;_++)c[_]=v[l[_]],d[_]=h[l[_]]},"permute"),C.prototype.transform=o(function(l,v,h,c,d,y){this.permute(y,l,v,h,c,d);for(var _=1;_<d;_<<=1)for(var w=_<<1,m=Math.cos(2*Math.PI/w),E=Math.sin(2*Math.PI/w),I=0;I<d;I+=w)for(var g=m,S=E,ie=0;ie<_;ie++){var M=h[I+ie],K=c[I+ie],J=h[I+ie+_],N=c[I+ie+_],R=g*J-S*N;N=g*N+S*J,J=R,h[I+ie]=M+J,c[I+ie]=K+N,h[I+ie+_]=M-J,c[I+ie+_]=K-N,ie!==w&&(R=m*g-E*S,S=m*S+E*g,g=R)}},"transform"),C.prototype.guessLen13b=o(function(l,v){var h=Math.max(v,l)|1,c=h&1,d=0;for(h=h/2|0;h;h=h>>>1)d++;return 1<<d+1+c},"guessLen13b"),C.prototype.conjugate=o(function(l,v,h){if(!(h<=1))for(var c=0;c<h/2;c++){var d=l[c];l[c]=l[h-c-1],l[h-c-1]=d,d=v[c],v[c]=-v[h-c-1],v[h-c-1]=-d}},"conjugate"),C.prototype.normalize13b=o(function(l,v){for(var h=0,c=0;c<v/2;c++){var d=Math.round(l[2*c+1]/v)*8192+Math.round(l[2*c]/v)+h;l[c]=d&67108863,d<67108864?h=0:h=d/67108864|0}return l},"normalize13b"),C.prototype.convert13b=o(function(l,v,h,c){for(var d=0,y=0;y<v;y++)d=d+(l[y]|0),h[2*y]=d&8191,d=d>>>13,h[2*y+1]=d&8191,d=d>>>13;for(y=2*v;y<c;++y)h[y]=0;t(d===0),t((d&-8192)===0)},"convert13b"),C.prototype.stub=o(function(l){for(var v=new Array(l),h=0;h<l;h++)v[h]=0;return v},"stub"),C.prototype.mulp=o(function(l,v,h){var c=2*this.guessLen13b(l.length,v.length),d=this.makeRBT(c),y=this.stub(c),_=new Array(c),w=new Array(c),m=new Array(c),E=new Array(c),I=new Array(c),g=new Array(c),S=h.words;S.length=c,this.convert13b(l.words,l.length,_,c),this.convert13b(v.words,v.length,E,c),this.transform(_,y,w,m,c,d),this.transform(E,y,I,g,c,d);for(var ie=0;ie<c;ie++){var M=w[ie]*I[ie]-m[ie]*g[ie];m[ie]=w[ie]*g[ie]+m[ie]*I[ie],w[ie]=M}return this.conjugate(w,m,c),this.transform(w,m,S,y,c,d),this.conjugate(S,y,c),this.normalize13b(S,c),h.negative=l.negative^v.negative,h.length=l.length+v.length,h.strip()},"mulp"),i.prototype.mul=o(function(l){var v=new i(null);return v.words=new Array(this.length+l.length),this.mulTo(l,v)},"mul"),i.prototype.mulf=o(function(l){var v=new i(null);return v.words=new Array(this.length+l.length),$(this,l,v)},"mulf"),i.prototype.imul=o(function(l){return this.clone().mulTo(l,this)},"imul"),i.prototype.imuln=o(function(l){t(typeof l=="number"),t(l<67108864);for(var v=0,h=0;h<this.length;h++){var c=(this.words[h]|0)*l,d=(c&67108863)+(v&67108863);v>>=26,v+=c/67108864|0,v+=d>>>26,this.words[h]=d&67108863}return v!==0&&(this.words[h]=v,this.length++),this},"imuln"),i.prototype.muln=o(function(l){return this.clone().imuln(l)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(l){var v=A(l);if(v.length===0)return new i(1);for(var h=this,c=0;c<v.length&&v[c]===0;c++,h=h.sqr());if(++c<v.length)for(var d=h.sqr();c<v.length;c++,d=d.sqr())v[c]!==0&&(h=h.mul(d));return h},"pow"),i.prototype.iushln=o(function(l){t(typeof l=="number"&&l>=0);var v=l%26,h=(l-v)/26,c=67108863>>>26-v<<26-v,d;if(v!==0){var y=0;for(d=0;d<this.length;d++){var _=this.words[d]&c,w=(this.words[d]|0)-_<<v;this.words[d]=w|y,y=_>>>26-v}y&&(this.words[d]=y,this.length++)}if(h!==0){for(d=this.length-1;d>=0;d--)this.words[d+h]=this.words[d];for(d=0;d<h;d++)this.words[d]=0;this.length+=h}return this.strip()},"iushln"),i.prototype.ishln=o(function(l){return t(this.negative===0),this.iushln(l)},"ishln"),i.prototype.iushrn=o(function(l,v,h){t(typeof l=="number"&&l>=0);var c;v?c=(v-v%26)/26:c=0;var d=l%26,y=Math.min((l-d)/26,this.length),_=67108863^67108863>>>d<<d,w=h;if(c-=y,c=Math.max(0,c),w){for(var m=0;m<y;m++)w.words[m]=this.words[m];w.length=y}if(y!==0)if(this.length>y)for(this.length-=y,m=0;m<this.length;m++)this.words[m]=this.words[m+y];else this.words[0]=0,this.length=1;var E=0;for(m=this.length-1;m>=0&&(E!==0||m>=c);m--){var I=this.words[m]|0;this.words[m]=E<<26-d|I>>>d,E=I&_}return w&&E!==0&&(w.words[w.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),i.prototype.ishrn=o(function(l,v,h){return t(this.negative===0),this.iushrn(l,v,h)},"ishrn"),i.prototype.shln=o(function(l){return this.clone().ishln(l)},"shln"),i.prototype.ushln=o(function(l){return this.clone().iushln(l)},"ushln"),i.prototype.shrn=o(function(l){return this.clone().ishrn(l)},"shrn"),i.prototype.ushrn=o(function(l){return this.clone().iushrn(l)},"ushrn"),i.prototype.testn=o(function(l){t(typeof l=="number"&&l>=0);var v=l%26,h=(l-v)/26,c=1<<v;if(this.length<=h)return!1;var d=this.words[h];return!!(d&c)},"testn"),i.prototype.imaskn=o(function(l){t(typeof l=="number"&&l>=0);var v=l%26,h=(l-v)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(v!==0&&h++,this.length=Math.min(h,this.length),v!==0){var c=67108863^67108863>>>v<<v;this.words[this.length-1]&=c}return this.strip()},"imaskn"),i.prototype.maskn=o(function(l){return this.clone().imaskn(l)},"maskn"),i.prototype.iaddn=o(function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},"iaddn"),i.prototype._iaddn=o(function(l){this.words[0]+=l;for(var v=0;v<this.length&&this.words[v]>=67108864;v++)this.words[v]-=67108864,v===this.length-1?this.words[v+1]=1:this.words[v+1]++;return this.length=Math.max(this.length,v+1),this},"_iaddn"),i.prototype.isubn=o(function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var v=0;v<this.length&&this.words[v]<0;v++)this.words[v]+=67108864,this.words[v+1]-=1;return this.strip()},"isubn"),i.prototype.addn=o(function(l){return this.clone().iaddn(l)},"addn"),i.prototype.subn=o(function(l){return this.clone().isubn(l)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(l,v,h){var c=l.length+h,d;this._expand(c);var y,_=0;for(d=0;d<l.length;d++){y=(this.words[d+h]|0)+_;var w=(l.words[d]|0)*v;y-=w&67108863,_=(y>>26)-(w/67108864|0),this.words[d+h]=y&67108863}for(;d<this.length-h;d++)y=(this.words[d+h]|0)+_,_=y>>26,this.words[d+h]=y&67108863;if(_===0)return this.strip();for(t(_===-1),_=0,d=0;d<this.length;d++)y=-(this.words[d]|0)+_,_=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(l,v){var h=this.length-l.length,c=this.clone(),d=l,y=d.words[d.length-1]|0,_=this._countBits(y);h=26-_,h!==0&&(d=d.ushln(h),c.iushln(h),y=d.words[d.length-1]|0);var w=c.length-d.length,m;if(v!=="mod"){m=new i(null),m.length=w+1,m.words=new Array(m.length);for(var E=0;E<m.length;E++)m.words[E]=0}var I=c.clone()._ishlnsubmul(d,1,w);I.negative===0&&(c=I,m&&(m.words[w]=1));for(var g=w-1;g>=0;g--){var S=(c.words[d.length+g]|0)*67108864+(c.words[d.length+g-1]|0);for(S=Math.min(S/y|0,67108863),c._ishlnsubmul(d,S,g);c.negative!==0;)S--,c.negative=0,c._ishlnsubmul(d,1,g),c.isZero()||(c.negative^=1);m&&(m.words[g]=S)}return m&&m.strip(),c.strip(),v!=="div"&&h!==0&&c.iushrn(h),{div:m||null,mod:c}},"_wordDiv"),i.prototype.divmod=o(function(l,v,h){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var c,d,y;return this.negative!==0&&l.negative===0?(y=this.neg().divmod(l,v),v!=="mod"&&(c=y.div.neg()),v!=="div"&&(d=y.mod.neg(),h&&d.negative!==0&&d.iadd(l)),{div:c,mod:d}):this.negative===0&&l.negative!==0?(y=this.divmod(l.neg(),v),v!=="mod"&&(c=y.div.neg()),{div:c,mod:y.mod}):(this.negative&l.negative)!==0?(y=this.neg().divmod(l.neg(),v),v!=="div"&&(d=y.mod.neg(),h&&d.negative!==0&&d.isub(l)),{div:y.div,mod:d}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?v==="div"?{div:this.divn(l.words[0]),mod:null}:v==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,v)},"divmod"),i.prototype.div=o(function(l){return this.divmod(l,"div",!1).div},"div"),i.prototype.mod=o(function(l){return this.divmod(l,"mod",!1).mod},"mod"),i.prototype.umod=o(function(l){return this.divmod(l,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(l){var v=this.divmod(l);if(v.mod.isZero())return v.div;var h=v.div.negative!==0?v.mod.isub(l):v.mod,c=l.ushrn(1),d=l.andln(1),y=h.cmp(c);return y<0||d===1&&y===0?v.div:v.div.negative!==0?v.div.isubn(1):v.div.iaddn(1)},"divRound"),i.prototype.modn=o(function(l){t(l<=67108863);for(var v=(1<<26)%l,h=0,c=this.length-1;c>=0;c--)h=(v*h+(this.words[c]|0))%l;return h},"modn"),i.prototype.idivn=o(function(l){t(l<=67108863);for(var v=0,h=this.length-1;h>=0;h--){var c=(this.words[h]|0)+v*67108864;this.words[h]=c/l|0,v=c%l}return this.strip()},"idivn"),i.prototype.divn=o(function(l){return this.clone().idivn(l)},"divn"),i.prototype.egcd=o(function(l){t(l.negative===0),t(!l.isZero());var v=this,h=l.clone();v.negative!==0?v=v.umod(l):v=v.clone();for(var c=new i(1),d=new i(0),y=new i(0),_=new i(1),w=0;v.isEven()&&h.isEven();)v.iushrn(1),h.iushrn(1),++w;for(var m=h.clone(),E=v.clone();!v.isZero();){for(var I=0,g=1;(v.words[0]&g)===0&&I<26;++I,g<<=1);if(I>0)for(v.iushrn(I);I-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(m),d.isub(E)),c.iushrn(1),d.iushrn(1);for(var S=0,ie=1;(h.words[0]&ie)===0&&S<26;++S,ie<<=1);if(S>0)for(h.iushrn(S);S-- >0;)(y.isOdd()||_.isOdd())&&(y.iadd(m),_.isub(E)),y.iushrn(1),_.iushrn(1);v.cmp(h)>=0?(v.isub(h),c.isub(y),d.isub(_)):(h.isub(v),y.isub(c),_.isub(d))}return{a:y,b:_,gcd:h.iushln(w)}},"egcd"),i.prototype._invmp=o(function(l){t(l.negative===0),t(!l.isZero());var v=this,h=l.clone();v.negative!==0?v=v.umod(l):v=v.clone();for(var c=new i(1),d=new i(0),y=h.clone();v.cmpn(1)>0&&h.cmpn(1)>0;){for(var _=0,w=1;(v.words[0]&w)===0&&_<26;++_,w<<=1);if(_>0)for(v.iushrn(_);_-- >0;)c.isOdd()&&c.iadd(y),c.iushrn(1);for(var m=0,E=1;(h.words[0]&E)===0&&m<26;++m,E<<=1);if(m>0)for(h.iushrn(m);m-- >0;)d.isOdd()&&d.iadd(y),d.iushrn(1);v.cmp(h)>=0?(v.isub(h),c.isub(d)):(h.isub(v),d.isub(c))}var I;return v.cmpn(1)===0?I=c:I=d,I.cmpn(0)<0&&I.iadd(l),I},"_invmp"),i.prototype.gcd=o(function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var v=this.clone(),h=l.clone();v.negative=0,h.negative=0;for(var c=0;v.isEven()&&h.isEven();c++)v.iushrn(1),h.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;h.isEven();)h.iushrn(1);var d=v.cmp(h);if(d<0){var y=v;v=h,h=y}else if(d===0||h.cmpn(1)===0)break;v.isub(h)}while(!0);return h.iushln(c)},"gcd"),i.prototype.invm=o(function(l){return this.egcd(l).a.umod(l)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(l){return this.words[0]&l},"andln"),i.prototype.bincn=o(function(l){t(typeof l=="number");var v=l%26,h=(l-v)/26,c=1<<v;if(this.length<=h)return this._expand(h+1),this.words[h]|=c,this;for(var d=c,y=h;d!==0&&y<this.length;y++){var _=this.words[y]|0;_+=d,d=_>>>26,_&=67108863,this.words[y]=_}return d!==0&&(this.words[y]=d,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(l){var v=l<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this.strip();var h;if(this.length>1)h=1;else{v&&(l=-l),t(l<=67108863,"Number is too big");var c=this.words[0]|0;h=c===l?0:c<l?-1:1}return this.negative!==0?-h|0:h},"cmpn"),i.prototype.cmp=o(function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var v=this.ucmp(l);return this.negative!==0?-v|0:v},"cmp"),i.prototype.ucmp=o(function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var v=0,h=this.length-1;h>=0;h--){var c=this.words[h]|0,d=l.words[h]|0;if(c!==d){c<d?v=-1:c>d&&(v=1);break}}return v},"ucmp"),i.prototype.gtn=o(function(l){return this.cmpn(l)===1},"gtn"),i.prototype.gt=o(function(l){return this.cmp(l)===1},"gt"),i.prototype.gten=o(function(l){return this.cmpn(l)>=0},"gten"),i.prototype.gte=o(function(l){return this.cmp(l)>=0},"gte"),i.prototype.ltn=o(function(l){return this.cmpn(l)===-1},"ltn"),i.prototype.lt=o(function(l){return this.cmp(l)===-1},"lt"),i.prototype.lten=o(function(l){return this.cmpn(l)<=0},"lten"),i.prototype.lte=o(function(l){return this.cmp(l)<=0},"lte"),i.prototype.eqn=o(function(l){return this.cmpn(l)===0},"eqn"),i.prototype.eq=o(function(l){return this.cmp(l)===0},"eq"),i.red=o(function(l){return new F(l)},"red"),i.prototype.toRed=o(function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},"toRed"),i.prototype.fromRed=o(function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),i.prototype._forceRed=o(function(l){return this.red=l,this},"_forceRed"),i.prototype.forceRed=o(function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},"forceRed"),i.prototype.redAdd=o(function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},"redAdd"),i.prototype.redIAdd=o(function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},"redIAdd"),i.prototype.redSub=o(function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},"redSub"),i.prototype.redISub=o(function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},"redISub"),i.prototype.redShl=o(function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},"redShl"),i.prototype.redMul=o(function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},"redMul"),i.prototype.redIMul=o(function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},"redIMul"),i.prototype.redSqr=o(function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)},"redPow");var B={k256:null,p224:null,p192:null,p25519:null};function z(D,l){this.name=D,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(z,"MPrime"),z.prototype._tmp=o(function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},"_tmp"),z.prototype.ireduce=o(function(l){var v=l,h;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),h=v.bitLength();while(h>this.n);var c=h<this.n?-1:v.ucmp(this.p);return c===0?(v.words[0]=0,v.length=1):c>0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},"ireduce"),z.prototype.split=o(function(l,v){l.iushrn(this.n,0,v)},"split"),z.prototype.imulK=o(function(l){return l.imul(this.k)},"imulK");function H(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,"K256"),n(H,z),H.prototype.split=o(function(l,v){for(var h=4194303,c=Math.min(l.length,9),d=0;d<c;d++)v.words[d]=l.words[d];if(v.length=c,l.length<=9){l.words[0]=0,l.length=1;return}var y=l.words[9];for(v.words[v.length++]=y&h,d=10;d<l.length;d++){var _=l.words[d]|0;l.words[d-10]=(_&h)<<4|y>>>22,y=_}y>>>=22,l.words[d-10]=y,y===0&&l.length>10?l.length-=10:l.length-=9},"split"),H.prototype.imulK=o(function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var v=0,h=0;h<l.length;h++){var c=l.words[h]|0;v+=c*977,l.words[h]=v&67108863,v=c*64+(v/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},"imulK");function X(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(X,"P224"),n(X,z);function U(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(U,"P192"),n(U,z);function L(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(L,"P25519"),n(L,z),L.prototype.imulK=o(function(l){for(var v=0,h=0;h<l.length;h++){var c=(l.words[h]|0)*19+v,d=c&67108863;c>>>=26,l.words[h]=d,v=c}return v!==0&&(l.words[l.length++]=v),l},"imulK"),i._prime=o(function(l){if(B[l])return B[l];var v;if(l==="k256")v=new H;else if(l==="p224")v=new X;else if(l==="p192")v=new U;else if(l==="p25519")v=new L;else throw new Error("Unknown prime "+l);return B[l]=v,v},"prime");function F(D){if(typeof D=="string"){var l=i._prime(D);this.m=l.p,this.prime=l}else t(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}o(F,"Red"),F.prototype._verify1=o(function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},"_verify1"),F.prototype._verify2=o(function(l,v){t((l.negative|v.negative)===0,"red works only with positives"),t(l.red&&l.red===v.red,"red works only with red numbers")},"_verify2"),F.prototype.imod=o(function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},"imod"),F.prototype.neg=o(function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},"neg"),F.prototype.add=o(function(l,v){this._verify2(l,v);var h=l.add(v);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},"add"),F.prototype.iadd=o(function(l,v){this._verify2(l,v);var h=l.iadd(v);return h.cmp(this.m)>=0&&h.isub(this.m),h},"iadd"),F.prototype.sub=o(function(l,v){this._verify2(l,v);var h=l.sub(v);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},"sub"),F.prototype.isub=o(function(l,v){this._verify2(l,v);var h=l.isub(v);return h.cmpn(0)<0&&h.iadd(this.m),h},"isub"),F.prototype.shl=o(function(l,v){return this._verify1(l),this.imod(l.ushln(v))},"shl"),F.prototype.imul=o(function(l,v){return this._verify2(l,v),this.imod(l.imul(v))},"imul"),F.prototype.mul=o(function(l,v){return this._verify2(l,v),this.imod(l.mul(v))},"mul"),F.prototype.isqr=o(function(l){return this.imul(l,l.clone())},"isqr"),F.prototype.sqr=o(function(l){return this.mul(l,l)},"sqr"),F.prototype.sqrt=o(function(l){if(l.isZero())return l.clone();var v=this.m.andln(3);if(t(v%2===1),v===3){var h=this.m.add(new i(1)).iushrn(2);return this.pow(l,h)}for(var c=this.m.subn(1),d=0;!c.isZero()&&c.andln(1)===0;)d++,c.iushrn(1);t(!c.isZero());var y=new i(1).toRed(this),_=y.redNeg(),w=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new i(2*m*m).toRed(this);this.pow(m,w).cmp(_)!==0;)m.redIAdd(_);for(var E=this.pow(m,c),I=this.pow(l,c.addn(1).iushrn(1)),g=this.pow(l,c),S=d;g.cmp(y)!==0;){for(var ie=g,M=0;ie.cmp(y)!==0;M++)ie=ie.redSqr();t(M<S);var K=this.pow(E,new i(1).iushln(S-M-1));I=I.redMul(K),E=K.redSqr(),g=g.redMul(E),S=M}return I},"sqrt"),F.prototype.invm=o(function(l){var v=l._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},"invm"),F.prototype.pow=o(function(l,v){if(v.isZero())return new i(1).toRed(this);if(v.cmpn(1)===0)return l.clone();var h=4,c=new Array(1<<h);c[0]=new i(1).toRed(this),c[1]=l;for(var d=2;d<c.length;d++)c[d]=this.mul(c[d-1],l);var y=c[0],_=0,w=0,m=v.bitLength()%26;for(m===0&&(m=26),d=v.length-1;d>=0;d--){for(var E=v.words[d],I=m-1;I>=0;I--){var g=E>>I&1;if(y!==c[0]&&(y=this.sqr(y)),g===0&&_===0){w=0;continue}_<<=1,_|=g,w++,!(w!==h&&(d!==0||I!==0))&&(y=this.mul(y,c[_]),w=0,_=0)}m=26}return y},"pow"),F.prototype.convertTo=o(function(l){var v=l.umod(this.m);return v===l?v.clone():v},"convertTo"),F.prototype.convertFrom=o(function(l){var v=l.clone();return v.red=null,v},"convertFrom"),i.mont=o(function(l){return new ne(l)},"mont");function ne(D){F.call(this,D),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(ne,"Mont"),n(ne,F),ne.prototype.convertTo=o(function(l){return this.imod(l.ushln(this.shift))},"convertTo"),ne.prototype.convertFrom=o(function(l){var v=this.imod(l.mul(this.rinv));return v.red=null,v},"convertFrom"),ne.prototype.imul=o(function(l,v){if(l.isZero()||v.isZero())return l.words[0]=0,l.length=1,l;var h=l.imul(v),c=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=h.isub(c).iushrn(this.shift),y=d;return d.cmp(this.m)>=0?y=d.isub(this.m):d.cmpn(0)<0&&(y=d.iadd(this.m)),y._forceRed(this)},"imul"),ne.prototype.mul=o(function(l,v){if(l.isZero()||v.isZero())return new i(0)._forceRed(this);var h=l.mul(v),c=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=h.isub(c).iushrn(this.shift),y=d;return d.cmp(this.m)>=0?y=d.isub(this.m):d.cmpn(0)<0&&(y=d.iadd(this.m)),y._forceRed(this)},"mul"),ne.prototype.invm=o(function(l){var v=this.imod(l._invmp(this.m).mul(this.r2));return v._forceRed(this)},"invm")})(typeof Qd=="undefined"||Qd,w1)});var Yi=me((nN,E1)=>{E1.exports=_1;function _1(r,e){if(!r)throw new Error(e||"Assertion failed")}o(_1,"assert");_1.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var eh=me(A1=>{"use strict";var Yc=A1;function T_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r!="string"){for(var n=0;n<r.length;n++)t[n]=r[n]|0;return t}if(e==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var n=0;n<r.length;n+=2)t.push(parseInt(r[n]+r[n+1],16))}else for(var n=0;n<r.length;n++){var i=r.charCodeAt(n),s=i>>8,a=i&255;s?t.push(s,a):t.push(a)}return t}o(T_,"toArray");Yc.toArray=T_;function S1(r){return r.length===1?"0"+r:r}o(S1,"zero2");Yc.zero2=S1;function M1(r){for(var e="",t=0;t<r.length;t++)e+=S1(r[t].toString(16));return e}o(M1,"toHex");Yc.toHex=M1;Yc.encode=o(function(e,t){return t==="hex"?M1(e):e},"encode")});var Or=me(T1=>{"use strict";var xn=T1,k_=Wn(),C_=Yi(),Jc=eh();xn.assert=C_;xn.toArray=Jc.toArray;xn.zero2=Jc.zero2;xn.toHex=Jc.toHex;xn.encode=Jc.encode;function D_(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1);n.fill(0);for(var i=1<<e+1,s=r.clone(),a=0;a<n.length;a++){var f,u=s.andln(i-1);s.isOdd()?(u>(i>>1)-1?f=(i>>1)-u:f=u,s.isubn(f)):f=0,n[a]=f,s.iushrn(1)}return n}o(D_,"getNAF");xn.getNAF=D_;function I_(r,e){var t=[[],[]];r=r.clone(),e=e.clone();for(var n=0,i=0,s;r.cmpn(-n)>0||e.cmpn(-i)>0;){var a=r.andln(3)+n&3,f=e.andln(3)+i&3;a===3&&(a=-1),f===3&&(f=-1);var u;(a&1)===0?u=0:(s=r.andln(7)+n&7,(s===3||s===5)&&f===2?u=-a:u=a),t[0].push(u);var p;(f&1)===0?p=0:(s=e.andln(7)+i&7,(s===3||s===5)&&a===2?p=-f:p=f),t[1].push(p),2*n===u+1&&(n=1-n),2*i===p+1&&(i=1-i),r.iushrn(1),e.iushrn(1)}return t}o(I_,"getJSF");xn.getJSF=I_;function O_(r,e,t){var n="_"+e;r.prototype[e]=o(function(){return this[n]!==void 0?this[n]:this[n]=t.call(this)},"cachedProperty")}o(O_,"cachedProperty");xn.cachedProperty=O_;function P_(r){return typeof r=="string"?xn.toArray(r,"hex"):r}o(P_,"parseBytes");xn.parseBytes=P_;function N_(r){return new k_(r,"hex","le")}o(N_,"intFromLE");xn.intFromLE=N_});var ih=me((sN,nh)=>{var th;nh.exports=o(function(e){return th||(th=new Ji(null)),th.generate(e)},"rand");function Ji(r){this.rand=r}o(Ji,"Rand");nh.exports.Rand=Ji;Ji.prototype.generate=o(function(e){return this._rand(e)},"generate");Ji.prototype._rand=o(function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"_rand");if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Ji.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t},"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?Ji.prototype._rand=o(function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t},"_rand"):typeof window=="object"&&(Ji.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(rh=require("crypto"),typeof rh.randomBytes!="function")throw new Error("Not supported");Ji.prototype._rand=o(function(e){return rh.randomBytes(e)},"_rand")}catch(r){}var rh});var df=me((aN,k1)=>{"use strict";var Ko=Wn(),lf=Or(),Xc=lf.getNAF,R_=lf.getJSF,Zc=lf.assert;function Xi(r,e){this.type=r,this.p=new Ko(e.p,16),this.red=e.prime?Ko.red(e.prime):Ko.mont(this.p),this.zero=new Ko(0).toRed(this.red),this.one=new Ko(1).toRed(this.red),this.two=new Ko(2).toRed(this.red),this.n=e.n&&new Ko(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(Xi,"BaseCurve");k1.exports=Xi;Xi.prototype.point=o(function(){throw new Error("Not implemented")},"point");Xi.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");Xi.prototype._fixedNafMul=o(function(e,t){Zc(e.precomputed);var n=e._getDoubles(),i=Xc(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var p=f+n.step-1;p>=f;p--)u=(u<<1)+i[p];a.push(u)}for(var b=this.jpoint(null,null,null),x=this.jpoint(null,null,null),A=s;A>0;A--){for(f=0;f<a.length;f++)u=a[f],u===A?x=x.mixedAdd(n.points[f]):u===-A&&(x=x.mixedAdd(n.points[f].neg()));b=b.add(x)}return b.toP()},"_fixedNafMul");Xi.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Xc(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var p=0;u>=0&&a[u]===0;u--)p++;if(u>=0&&p++,f=f.dblp(p),u<0)break;var b=a[u];Zc(b!==0),e.type==="affine"?b>0?f=f.mixedAdd(s[b-1>>1]):f=f.mixedAdd(s[-b-1>>1].neg()):b>0?f=f.add(s[b-1>>1]):f=f.add(s[-b-1>>1].neg())}return e.type==="affine"?f.toP():f},"_wnafMul");Xi.prototype._wnafMulAdd=o(function(e,t,n,i,s){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,p=0,b,x,A;for(b=0;b<i;b++){A=t[b];var O=A._getNAFPoints(e);a[b]=O.wnd,f[b]=O.points}for(b=i-1;b>=1;b-=2){var T=b-1,k=b;if(a[T]!==1||a[k]!==1){u[T]=Xc(n[T],a[T],this._bitLength),u[k]=Xc(n[k],a[k],this._bitLength),p=Math.max(u[T].length,p),p=Math.max(u[k].length,p);continue}var $=[t[T],null,null,t[k]];t[T].y.cmp(t[k].y)===0?($[1]=t[T].add(t[k]),$[2]=t[T].toJ().mixedAdd(t[k].neg())):t[T].y.cmp(t[k].y.redNeg())===0?($[1]=t[T].toJ().mixedAdd(t[k]),$[2]=t[T].add(t[k].neg())):($[1]=t[T].toJ().mixedAdd(t[k]),$[2]=t[T].toJ().mixedAdd(t[k].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],B=R_(n[T],n[k]);for(p=Math.max(B[0].length,p),u[T]=new Array(p),u[k]=new Array(p),x=0;x<p;x++){var z=B[0][x]|0,H=B[1][x]|0;u[T][x]=C[(z+1)*3+(H+1)],u[k][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),U=this._wnafT4;for(b=p;b>=0;b--){for(var L=0;b>=0;){var F=!0;for(x=0;x<i;x++)U[x]=u[x][b]|0,U[x]!==0&&(F=!1);if(!F)break;L++,b--}if(b>=0&&L++,X=X.dblp(L),b<0)break;for(x=0;x<i;x++){var ne=U[x];ne!==0&&(ne>0?A=f[x][ne-1>>1]:ne<0&&(A=f[x][-ne-1>>1].neg()),A.type==="affine"?X=X.mixedAdd(A):X=X.add(A))}}for(b=0;b<i;b++)f[b]=null;return s?X:X.toP()},"_wnafMulAdd");function rn(r,e){this.curve=r,this.type=e,this.precomputed=null}o(rn,"BasePoint");Xi.BasePoint=rn;rn.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");rn.prototype.validate=o(function(){return this.curve.validate(this)},"validate");Xi.prototype.decodePoint=o(function(e,t){e=lf.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Zc(e[e.length-1]%2===0):e[0]===7&&Zc(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},"decodePoint");rn.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");rn.prototype._encode=o(function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},"_encode");rn.prototype.encode=o(function(e,t){return lf.encode(this._encode(t),e)},"encode");rn.prototype.precompute=o(function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},"precompute");rn.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},"_hasDoubles");rn.prototype._getDoubles=o(function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<t;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");rn.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)t[s]=t[s-1].add(i);return{wnd:e,points:t}},"_getNAFPoints");rn.prototype._getBeta=o(function(){return null},"_getBeta");rn.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp")});var hf=me((fN,oh)=>{typeof Object.create=="function"?oh.exports=o(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):oh.exports=o(function(e,t){if(t){e.super_=t;var n=o(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var D1=me((cN,C1)=>{"use strict";var L_=Or(),Ot=Wn(),sh=hf(),Js=df(),B_=L_.assert;function nn(r){Js.call(this,"short",r),this.a=new Ot(r.a,16).toRed(this.red),this.b=new Ot(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(nn,"ShortCurve");sh(nn,Js);C1.exports=nn;nn.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new Ot(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)n=new Ot(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))===0?n=s[0]:(n=s[1],B_(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(f){return{a:new Ot(f.a,16),b:new Ot(f.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}},"_getEndomorphism");nn.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:Ot.mont(e),n=new Ot(2).toRed(t).redInvm(),i=n.redNeg(),s=new Ot(3).toRed(t).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},"_getEndoRoots");nn.prototype._getEndoBasis=o(function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new Ot(1),a=new Ot(0),f=new Ot(0),u=new Ot(1),p,b,x,A,O,T,k,$=0,C,B;n.cmpn(0)!==0;){var z=i.div(n);C=i.sub(z.mul(n)),B=f.sub(z.mul(s));var H=u.sub(z.mul(a));if(!x&&C.cmp(t)<0)p=k.neg(),b=s,x=C.neg(),A=B;else if(x&&++$===2)break;k=C,i=n,n=C,f=s,s=B,u=a,a=H}O=C.neg(),T=B;var X=x.sqr().add(A.sqr()),U=O.sqr().add(T.sqr());return U.cmp(X)>=0&&(O=p,T=b),x.negative&&(x=x.neg(),A=A.neg()),O.negative&&(O=O.neg(),T=T.neg()),[{a:x,b:A},{a:O,b:T}]},"_getEndoBasis");nn.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),f=s.mul(n.a),u=a.mul(i.a),p=s.mul(n.b),b=a.mul(i.b),x=e.sub(f).sub(u),A=p.add(b).neg();return{k1:x,k2:A}},"_endoSplit");nn.prototype.pointFromX=o(function(e,t){e=new Ot(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");nn.prototype.validate=o(function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate");nn.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var f=this._endoSplit(t[a]),u=e[a],p=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),p=p.neg(!0)),i[a*2]=u,i[a*2+1]=p,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var b=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return b},"_endoWnafMulAdd");function zt(r,e,t,n){Js.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ot(e,16),this.y=new Ot(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}o(zt,"Point");sh(zt,Js.BasePoint);nn.prototype.point=o(function(e,t,n){return new zt(this,e,t,n)},"point");nn.prototype.pointFromJSON=o(function(e,t){return zt.fromJSON(this,e,t)},"pointFromJSON");zt.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},"_getBeta");zt.prototype.toJSON=o(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON");zt.fromJSON=o(function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],n);if(!t[2])return i;function s(f){return e.point(f[0],f[1],n)}o(s,"obj2point");var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},"fromJSON");zt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect");zt.prototype.isInfinity=o(function(){return this.inf},"isInfinity");zt.prototype.add=o(function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");zt.prototype.dbl=o(function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},"dbl");zt.prototype.getX=o(function(){return this.x.fromRed()},"getX");zt.prototype.getY=o(function(){return this.y.fromRed()},"getY");zt.prototype.mul=o(function(e){return e=new Ot(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},"mul");zt.prototype.mulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},"mulAdd");zt.prototype.jmulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},"jmulAdd");zt.prototype.eq=o(function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},"eq");zt.prototype.neg=o(function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(s){return s.neg()},"negate");t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},"neg");zt.prototype.toJ=o(function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},"toJ");function Zt(r,e,t,n){Js.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ot(0)):(this.x=new Ot(e,16),this.y=new Ot(t,16),this.z=new Ot(n,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}o(Zt,"JPoint");sh(Zt,Js.BasePoint);nn.prototype.jpoint=o(function(e,t,n){return new Zt(this,e,t,n)},"jpoint");Zt.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},"toP");Zt.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");Zt.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),p=a.redSub(f);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=u.redSqr(),x=b.redMul(u),A=i.redMul(b),O=p.redSqr().redIAdd(x).redISub(A).redISub(A),T=p.redMul(A.redISub(O)).redISub(a.redMul(x)),k=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(O,T,k)},"add");Zt.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),s=this.y,a=e.y.redMul(t).redMul(this.z),f=n.redSub(i),u=s.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=f.redSqr(),b=p.redMul(f),x=n.redMul(p),A=u.redSqr().redIAdd(b).redISub(x).redISub(x),O=u.redMul(x.redISub(A)).redISub(s.redMul(b)),T=this.z.redMul(f);return this.curve.jpoint(A,O,T)},"mixedAdd");Zt.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,u=this.z,p=u.redSqr().redSqr(),b=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),A=b.redSqr(),O=A.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(p)),k=a.redMul(A),$=T.redSqr().redISub(k.redAdd(k)),C=k.redISub($),B=T.redMul(C);B=B.redIAdd(B).redISub(O);var z=b.redMul(u);t+1<e&&(p=p.redMul(O)),a=$,u=z,b=B}return this.curve.jpoint(a,b.redMul(s),u)},"dblp");Zt.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");Zt.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),p=u.redSqr().redISub(f).redISub(f),b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),e=p,t=u.redMul(f.redISub(p)).redISub(b),n=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),A=this.y.redSqr(),O=A.redSqr(),T=this.x.redAdd(A).redSqr().redISub(x).redISub(O);T=T.redIAdd(T);var k=x.redAdd(x).redIAdd(x),$=k.redSqr(),C=O.redIAdd(O);C=C.redIAdd(C),C=C.redIAdd(C),e=$.redISub(T).redISub(T),t=k.redMul(T.redISub(e)).redISub(C),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");Zt.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),p=u.redSqr().redISub(f).redISub(f);e=p;var b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),t=u.redMul(f.redISub(p)).redISub(b),n=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),A=this.y.redSqr(),O=this.x.redMul(A),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var k=O.redIAdd(O);k=k.redIAdd(k);var $=k.redAdd(k);e=T.redSqr().redISub($),n=this.y.redAdd(this.z).redSqr().redISub(A).redISub(x);var C=A.redSqr();C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C),t=T.redMul(k.redISub(e)).redISub(C)}return this.curve.jpoint(e,t,n)},"_threeDbl");Zt.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=t.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),p=t.redAdd(t);p=p.redIAdd(p);var b=p.redMul(f),x=u.redSqr().redISub(b.redAdd(b)),A=b.redISub(x),O=f.redSqr();O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=u.redMul(A).redISub(O),k=n.redAdd(n).redMul(i);return this.curve.jpoint(x,T,k)},"_dbl");Zt.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),i=t.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),f=this.x.redAdd(t).redSqr().redISub(e).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),p=i.redIAdd(i);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var b=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(p),x=t.redMul(b);x=x.redIAdd(x),x=x.redIAdd(x);var A=this.x.redMul(u).redISub(x);A=A.redIAdd(A),A=A.redIAdd(A);var O=this.y.redMul(b.redMul(p.redISub(b)).redISub(f.redMul(u)));O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(A,O,T)},"trpl");Zt.prototype.mul=o(function(e,t){return e=new Ot(e,t),this.curve._wnafMul(this,e)},"mul");Zt.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");Zt.prototype.eqXToP=o(function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP");Zt.prototype.inspect=o(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect");Zt.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity")});var P1=me((uN,O1)=>{"use strict";var Xs=Wn(),I1=hf(),Qc=df(),U_=Or();function Zs(r){Qc.call(this,"mont",r),this.a=new Xs(r.a,16).toRed(this.red),this.b=new Xs(r.b,16).toRed(this.red),this.i4=new Xs(4).toRed(this.red).redInvm(),this.two=new Xs(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(Zs,"MontCurve");I1(Zs,Qc);O1.exports=Zs;Zs.prototype.validate=o(function(e){var t=e.normalize().x,n=t.redSqr(),i=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t),s=i.redSqrt();return s.redSqr().cmp(i)===0},"validate");function jt(r,e,t){Qc.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Xs(e,16),this.z=new Xs(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(jt,"Point");I1(jt,Qc.BasePoint);Zs.prototype.decodePoint=o(function(e,t){return this.point(U_.toArray(e,t),1)},"decodePoint");Zs.prototype.point=o(function(e,t){return new jt(this,e,t)},"point");Zs.prototype.pointFromJSON=o(function(e){return jt.fromJSON(this,e)},"pointFromJSON");jt.prototype.precompute=o(function(){},"precompute");jt.prototype._encode=o(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode");jt.fromJSON=o(function(e,t){return new jt(e,t[0],t[1]||e.one)},"fromJSON");jt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect");jt.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");jt.prototype.dbl=o(function(){var e=this.x.redAdd(this.z),t=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=t.redSub(i),a=t.redMul(i),f=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,f)},"dbl");jt.prototype.add=o(function(){throw new Error("Not supported on Montgomery curve")},"add");jt.prototype.diffAdd=o(function(e,t){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),f=a.redMul(n),u=s.redMul(i),p=t.z.redMul(f.redAdd(u).redSqr()),b=t.x.redMul(f.redISub(u).redSqr());return this.curve.point(p,b)},"diffAdd");jt.prototype.mul=o(function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),s=this,a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var f=a.length-1;f>=0;f--)a[f]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i},"mul");jt.prototype.mulAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd");jt.prototype.jumlAdd=o(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd");jt.prototype.eq=o(function(e){return this.getX().cmp(e.getX())===0},"eq");jt.prototype.normalize=o(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize");jt.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX")});var L1=me((lN,R1)=>{"use strict";var F_=Or(),yi=Wn(),N1=hf(),eu=df(),$_=F_.assert;function Gn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,eu.call(this,"edwards",r),this.a=new yi(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new yi(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new yi(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),$_(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}o(Gn,"EdwardsCurve");N1(Gn,eu);R1.exports=Gn;Gn.prototype._mulA=o(function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},"_mulA");Gn.prototype._mulC=o(function(e){return this.oneC?e:this.c.redMul(e)},"_mulC");Gn.prototype.jpoint=o(function(e,t,n,i){return this.point(e,t,n,i)},"jpoint");Gn.prototype.pointFromX=o(function(e,t){e=new yi(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(s.redInvm()),f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var u=f.fromRed().isOdd();return(t&&!u||!t&&u)&&(f=f.redNeg()),this.point(e,f)},"pointFromX");Gn.prototype.pointFromY=o(function(e,t){e=new yi(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return f.fromRed().isOdd()!==t&&(f=f.redNeg()),this.point(f,e)},"pointFromY");Gn.prototype.validate=o(function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),i=t.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return i.cmp(s)===0},"validate");function Mt(r,e,t,n,i){eu.BasePoint.call(this,r,"projective"),e===null&&t===null&&n===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 yi(e,16),this.y=new yi(t,16),this.z=n?new yi(n,16):this.curve.one,this.t=i&&new yi(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.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()))))}o(Mt,"Point");N1(Mt,eu.BasePoint);Gn.prototype.pointFromJSON=o(function(e){return Mt.fromJSON(this,e)},"pointFromJSON");Gn.prototype.point=o(function(e,t,n,i){return new Mt(this,e,t,n,i)},"point");Mt.fromJSON=o(function(e,t){return new Mt(e,t[0],t[1],t[2])},"fromJSON");Mt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect");Mt.prototype.isInfinity=o(function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},"isInfinity");Mt.prototype._extDbl=o(function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=i.redAdd(t),f=a.redSub(n),u=i.redSub(t),p=s.redMul(f),b=a.redMul(u),x=s.redMul(u),A=f.redMul(a);return this.curve.point(p,b,A,x)},"_extDbl");Mt.prototype._projDbl=o(function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),i,s,a,f,u,p;if(this.curve.twisted){f=this.curve._mulA(t);var b=f.redAdd(n);this.zOne?(i=e.redSub(t).redSub(n).redMul(b.redSub(this.curve.two)),s=b.redMul(f.redSub(n)),a=b.redSqr().redSub(b).redSub(b)):(u=this.z.redSqr(),p=b.redSub(u).redISub(u),i=e.redSub(t).redISub(n).redMul(p),s=b.redMul(f.redSub(n)),a=b.redMul(p))}else f=t.redAdd(n),u=this.curve._mulC(this.z).redSqr(),p=f.redSub(u).redSub(u),i=this.curve._mulC(e.redISub(f)).redMul(p),s=this.curve._mulC(f).redMul(t.redISub(n)),a=f.redMul(p);return this.curve.point(i,s,a)},"_projDbl");Mt.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl");Mt.prototype._extAdd=o(function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(t),f=s.redSub(i),u=s.redAdd(i),p=n.redAdd(t),b=a.redMul(f),x=u.redMul(p),A=a.redMul(p),O=f.redMul(u);return this.curve.point(b,x,O,A)},"_extAdd");Mt.prototype._projAdd=o(function(e){var t=this.z.redMul(e.z),n=t.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(i).redMul(s),f=n.redSub(a),u=n.redAdd(a),p=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),b=t.redMul(f).redMul(p),x,A;return this.curve.twisted?(x=t.redMul(u).redMul(s.redSub(this.curve._mulA(i))),A=f.redMul(u)):(x=t.redMul(u).redMul(s.redSub(i)),A=this.curve._mulC(f).redMul(u)),this.curve.point(b,x,A)},"_projAdd");Mt.prototype.add=o(function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},"add");Mt.prototype.mul=o(function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},"mul");Mt.prototype.mulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},"mulAdd");Mt.prototype.jmulAdd=o(function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},"jmulAdd");Mt.prototype.normalize=o(function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},"normalize");Mt.prototype.neg=o(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg");Mt.prototype.getX=o(function(){return this.normalize(),this.x.fromRed()},"getX");Mt.prototype.getY=o(function(){return this.normalize(),this.y.fromRed()},"getY");Mt.prototype.eq=o(function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},"eq");Mt.prototype.eqXToP=o(function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),this.x.cmp(t)===0)return!0}},"eqXToP");Mt.prototype.toP=Mt.prototype.normalize;Mt.prototype.mixedAdd=Mt.prototype.add});var ah=me(B1=>{"use strict";var tu=B1;tu.base=df();tu.short=D1();tu.mont=P1();tu.edwards=L1()});var wn=me(wt=>{"use strict";var q_=Yi(),H_=hf();wt.inherits=H_;function z_(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}o(z_,"isSurrogatePair");function j_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),i=0;i<r.length;i+=2)t.push(parseInt(r[i]+r[i+1],16))}else for(var n=0,i=0;i<r.length;i++){var s=r.charCodeAt(i);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):z_(r,i)?(s=65536+((s&1023)<<10)+(r.charCodeAt(++i)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}else for(i=0;i<r.length;i++)t[i]=r[i]|0;return t}o(j_,"toArray");wt.toArray=j_;function K_(r){for(var e="",t=0;t<r.length;t++)e+=F1(r[t].toString(16));return e}o(K_,"toHex");wt.toHex=K_;function U1(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}o(U1,"htonl");wt.htonl=U1;function V_(r,e){for(var t="",n=0;n<r.length;n++){var i=r[n];e==="little"&&(i=U1(i)),t+=$1(i.toString(16))}return t}o(V_,"toHex32");wt.toHex32=V_;function F1(r){return r.length===1?"0"+r:r}o(F1,"zero2");wt.zero2=F1;function $1(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}o($1,"zero8");wt.zero8=$1;function W_(r,e,t,n){var i=t-e;q_(i%4===0);for(var s=new Array(i/4),a=0,f=e;a<s.length;a++,f+=4){var u;n==="big"?u=r[f]<<24|r[f+1]<<16|r[f+2]<<8|r[f+3]:u=r[f+3]<<24|r[f+2]<<16|r[f+1]<<8|r[f],s[a]=u>>>0}return s}o(W_,"join32");wt.join32=W_;function G_(r,e){for(var t=new Array(r.length*4),n=0,i=0;n<r.length;n++,i+=4){var s=r[n];e==="big"?(t[i]=s>>>24,t[i+1]=s>>>16&255,t[i+2]=s>>>8&255,t[i+3]=s&255):(t[i+3]=s>>>24,t[i+2]=s>>>16&255,t[i+1]=s>>>8&255,t[i]=s&255)}return t}o(G_,"split32");wt.split32=G_;function Y_(r,e){return r>>>e|r<<32-e}o(Y_,"rotr32");wt.rotr32=Y_;function J_(r,e){return r<<e|r>>>32-e}o(J_,"rotl32");wt.rotl32=J_;function X_(r,e){return r+e>>>0}o(X_,"sum32");wt.sum32=X_;function Z_(r,e,t){return r+e+t>>>0}o(Z_,"sum32_3");wt.sum32_3=Z_;function Q_(r,e,t,n){return r+e+t+n>>>0}o(Q_,"sum32_4");wt.sum32_4=Q_;function e9(r,e,t,n,i){return r+e+t+n+i>>>0}o(e9,"sum32_5");wt.sum32_5=e9;function t9(r,e,t,n){var i=r[e],s=r[e+1],a=n+s>>>0,f=(a<n?1:0)+t+i;r[e]=f>>>0,r[e+1]=a}o(t9,"sum64");wt.sum64=t9;function r9(r,e,t,n){var i=e+n>>>0,s=(i<e?1:0)+r+t;return s>>>0}o(r9,"sum64_hi");wt.sum64_hi=r9;function n9(r,e,t,n){var i=e+n;return i>>>0}o(n9,"sum64_lo");wt.sum64_lo=n9;function i9(r,e,t,n,i,s,a,f){var u=0,p=e;p=p+n>>>0,u+=p<e?1:0,p=p+s>>>0,u+=p<s?1:0,p=p+f>>>0,u+=p<f?1:0;var b=r+t+i+a+u;return b>>>0}o(i9,"sum64_4_hi");wt.sum64_4_hi=i9;function o9(r,e,t,n,i,s,a,f){var u=e+n+s+f;return u>>>0}o(o9,"sum64_4_lo");wt.sum64_4_lo=o9;function s9(r,e,t,n,i,s,a,f,u,p){var b=0,x=e;x=x+n>>>0,b+=x<e?1:0,x=x+s>>>0,b+=x<s?1:0,x=x+f>>>0,b+=x<f?1:0,x=x+p>>>0,b+=x<p?1:0;var A=r+t+i+a+u+b;return A>>>0}o(s9,"sum64_5_hi");wt.sum64_5_hi=s9;function a9(r,e,t,n,i,s,a,f,u,p){var b=e+n+s+f+p;return b>>>0}o(a9,"sum64_5_lo");wt.sum64_5_lo=a9;function f9(r,e,t){var n=e<<32-t|r>>>t;return n>>>0}o(f9,"rotr64_hi");wt.rotr64_hi=f9;function c9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(c9,"rotr64_lo");wt.rotr64_lo=c9;function u9(r,e,t){return r>>>t}o(u9,"shr64_hi");wt.shr64_hi=u9;function l9(r,e,t){var n=r<<32-t|e>>>t;return n>>>0}o(l9,"shr64_lo");wt.shr64_lo=l9});var Qs=me(H1=>{"use strict";var q1=wn(),d9=Yi();function ru(){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}o(ru,"BlockHash");H1.BlockHash=ru;ru.prototype.update=o(function(e,t){if(e=q1.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=q1.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},"update");ru.prototype.digest=o(function(e){return this.update(this._pad()),d9(this.pending===null),this._digest(e)},"digest");ru.prototype._pad=o(function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,i=new Array(n+this.padLength);i[0]=128;for(var s=1;s<n;s++)i[s]=0;if(e<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=e>>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,a=8;a<this.padLength;a++)i[s++]=0;return i},"pad")});var fh=me(xi=>{"use strict";var h9=wn(),Yn=h9.rotr32;function p9(r,e,t,n){if(r===0)return z1(e,t,n);if(r===1||r===3)return K1(e,t,n);if(r===2)return j1(e,t,n)}o(p9,"ft_1");xi.ft_1=p9;function z1(r,e,t){return r&e^~r&t}o(z1,"ch32");xi.ch32=z1;function j1(r,e,t){return r&e^r&t^e&t}o(j1,"maj32");xi.maj32=j1;function K1(r,e,t){return r^e^t}o(K1,"p32");xi.p32=K1;function m9(r){return Yn(r,2)^Yn(r,13)^Yn(r,22)}o(m9,"s0_256");xi.s0_256=m9;function b9(r){return Yn(r,6)^Yn(r,11)^Yn(r,25)}o(b9,"s1_256");xi.s1_256=b9;function g9(r){return Yn(r,7)^Yn(r,18)^r>>>3}o(g9,"g0_256");xi.g0_256=g9;function v9(r){return Yn(r,17)^Yn(r,19)^r>>>10}o(v9,"g1_256");xi.g1_256=v9});var G1=me((bN,W1)=>{"use strict";var ea=wn(),y9=Qs(),x9=fh(),ch=ea.rotl32,pf=ea.sum32,w9=ea.sum32_5,_9=x9.ft_1,V1=y9.BlockHash,E9=[1518500249,1859775393,2400959708,3395469782];function Jn(){if(!(this instanceof Jn))return new Jn;V1.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}o(Jn,"SHA1");ea.inherits(Jn,V1);W1.exports=Jn;Jn.blockSize=512;Jn.outSize=160;Jn.hmacStrength=80;Jn.padLength=64;Jn.prototype._update=o(function(e,t){for(var n=this.W,i=0;i<16;i++)n[i]=e[t+i];for(;i<n.length;i++)n[i]=ch(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],p=this.h[4];for(i=0;i<n.length;i++){var b=~~(i/20),x=w9(ch(s,5),_9(b,a,f,u),p,n[i],E9[b]);p=u,u=f,f=ch(a,30),a=s,s=x}this.h[0]=pf(this.h[0],s),this.h[1]=pf(this.h[1],a),this.h[2]=pf(this.h[2],f),this.h[3]=pf(this.h[3],u),this.h[4]=pf(this.h[4],p)},"_update");Jn.prototype._digest=o(function(e){return e==="hex"?ea.toHex32(this.h,"big"):ea.split32(this.h,"big")},"digest")});var uh=me((gN,J1)=>{"use strict";var ta=wn(),S9=Qs(),ra=fh(),M9=Yi(),_n=ta.sum32,A9=ta.sum32_4,T9=ta.sum32_5,k9=ra.ch32,C9=ra.maj32,D9=ra.s0_256,I9=ra.s1_256,O9=ra.g0_256,P9=ra.g1_256,Y1=S9.BlockHash,N9=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Xn(){if(!(this instanceof Xn))return new Xn;Y1.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=N9,this.W=new Array(64)}o(Xn,"SHA256");ta.inherits(Xn,Y1);J1.exports=Xn;Xn.blockSize=512;Xn.outSize=256;Xn.hmacStrength=192;Xn.padLength=64;Xn.prototype._update=o(function(e,t){for(var n=this.W,i=0;i<16;i++)n[i]=e[t+i];for(;i<n.length;i++)n[i]=A9(P9(n[i-2]),n[i-7],O9(n[i-15]),n[i-16]);var s=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],p=this.h[4],b=this.h[5],x=this.h[6],A=this.h[7];for(M9(this.k.length===n.length),i=0;i<n.length;i++){var O=T9(A,I9(p),k9(p,b,x),this.k[i],n[i]),T=_n(D9(s),C9(s,a,f));A=x,x=b,b=p,p=_n(u,O),u=f,f=a,a=s,s=_n(O,T)}this.h[0]=_n(this.h[0],s),this.h[1]=_n(this.h[1],a),this.h[2]=_n(this.h[2],f),this.h[3]=_n(this.h[3],u),this.h[4]=_n(this.h[4],p),this.h[5]=_n(this.h[5],b),this.h[6]=_n(this.h[6],x),this.h[7]=_n(this.h[7],A)},"_update");Xn.prototype._digest=o(function(e){return e==="hex"?ta.toHex32(this.h,"big"):ta.split32(this.h,"big")},"digest")});var Q1=me((vN,Z1)=>{"use strict";var lh=wn(),X1=uh();function wi(){if(!(this instanceof wi))return new wi;X1.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}o(wi,"SHA224");lh.inherits(wi,X1);Z1.exports=wi;wi.blockSize=512;wi.outSize=224;wi.hmacStrength=192;wi.padLength=64;wi.prototype._digest=o(function(e){return e==="hex"?lh.toHex32(this.h.slice(0,7),"big"):lh.split32(this.h.slice(0,7),"big")},"digest")});var ph=me((yN,nb)=>{"use strict";var Er=wn(),R9=Qs(),L9=Yi(),Zn=Er.rotr64_hi,Qn=Er.rotr64_lo,eb=Er.shr64_hi,tb=Er.shr64_lo,Zi=Er.sum64,dh=Er.sum64_hi,hh=Er.sum64_lo,B9=Er.sum64_4_hi,U9=Er.sum64_4_lo,F9=Er.sum64_5_hi,$9=Er.sum64_5_lo,rb=R9.BlockHash,q9=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function En(){if(!(this instanceof En))return new En;rb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=q9,this.W=new Array(160)}o(En,"SHA512");Er.inherits(En,rb);nb.exports=En;En.blockSize=1024;En.outSize=512;En.hmacStrength=192;En.padLength=128;En.prototype._prepareBlock=o(function(e,t){for(var n=this.W,i=0;i<32;i++)n[i]=e[t+i];for(;i<n.length;i+=2){var s=Z9(n[i-4],n[i-3]),a=Q9(n[i-4],n[i-3]),f=n[i-14],u=n[i-13],p=J9(n[i-30],n[i-29]),b=X9(n[i-30],n[i-29]),x=n[i-32],A=n[i-31];n[i]=B9(s,a,f,u,p,b,x,A),n[i+1]=U9(s,a,f,u,p,b,x,A)}},"_prepareBlock");En.prototype._update=o(function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],s=this.h[1],a=this.h[2],f=this.h[3],u=this.h[4],p=this.h[5],b=this.h[6],x=this.h[7],A=this.h[8],O=this.h[9],T=this.h[10],k=this.h[11],$=this.h[12],C=this.h[13],B=this.h[14],z=this.h[15];L9(this.k.length===n.length);for(var H=0;H<n.length;H+=2){var X=B,U=z,L=G9(A,O),F=Y9(A,O),ne=H9(A,O,T,k,$,C),D=z9(A,O,T,k,$,C),l=this.k[H],v=this.k[H+1],h=n[H],c=n[H+1],d=F9(X,U,L,F,ne,D,l,v,h,c),y=$9(X,U,L,F,ne,D,l,v,h,c);X=V9(i,s),U=W9(i,s),L=j9(i,s,a,f,u,p),F=K9(i,s,a,f,u,p);var _=dh(X,U,L,F),w=hh(X,U,L,F);B=$,z=C,$=T,C=k,T=A,k=O,A=dh(b,x,d,y),O=hh(x,x,d,y),b=u,x=p,u=a,p=f,a=i,f=s,i=dh(d,y,_,w),s=hh(d,y,_,w)}Zi(this.h,0,i,s),Zi(this.h,2,a,f),Zi(this.h,4,u,p),Zi(this.h,6,b,x),Zi(this.h,8,A,O),Zi(this.h,10,T,k),Zi(this.h,12,$,C),Zi(this.h,14,B,z)},"_update");En.prototype._digest=o(function(e){return e==="hex"?Er.toHex32(this.h,"big"):Er.split32(this.h,"big")},"digest");function H9(r,e,t,n,i){var s=r&t^~r&i;return s<0&&(s+=4294967296),s}o(H9,"ch64_hi");function z9(r,e,t,n,i,s){var a=e&n^~e&s;return a<0&&(a+=4294967296),a}o(z9,"ch64_lo");function j9(r,e,t,n,i){var s=r&t^r&i^t&i;return s<0&&(s+=4294967296),s}o(j9,"maj64_hi");function K9(r,e,t,n,i,s){var a=e&n^e&s^n&s;return a<0&&(a+=4294967296),a}o(K9,"maj64_lo");function V9(r,e){var t=Zn(r,e,28),n=Zn(e,r,2),i=Zn(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(V9,"s0_512_hi");function W9(r,e){var t=Qn(r,e,28),n=Qn(e,r,2),i=Qn(e,r,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(W9,"s0_512_lo");function G9(r,e){var t=Zn(r,e,14),n=Zn(r,e,18),i=Zn(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(G9,"s1_512_hi");function Y9(r,e){var t=Qn(r,e,14),n=Qn(r,e,18),i=Qn(e,r,9),s=t^n^i;return s<0&&(s+=4294967296),s}o(Y9,"s1_512_lo");function J9(r,e){var t=Zn(r,e,1),n=Zn(r,e,8),i=eb(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(J9,"g0_512_hi");function X9(r,e){var t=Qn(r,e,1),n=Qn(r,e,8),i=tb(r,e,7),s=t^n^i;return s<0&&(s+=4294967296),s}o(X9,"g0_512_lo");function Z9(r,e){var t=Zn(r,e,19),n=Zn(e,r,29),i=eb(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(Z9,"g1_512_hi");function Q9(r,e){var t=Qn(r,e,19),n=Qn(e,r,29),i=tb(r,e,6),s=t^n^i;return s<0&&(s+=4294967296),s}o(Q9,"g1_512_lo")});var sb=me((xN,ob)=>{"use strict";var mh=wn(),ib=ph();function _i(){if(!(this instanceof _i))return new _i;ib.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}o(_i,"SHA384");mh.inherits(_i,ib);ob.exports=_i;_i.blockSize=1024;_i.outSize=384;_i.hmacStrength=192;_i.padLength=128;_i.prototype._digest=o(function(e){return e==="hex"?mh.toHex32(this.h.slice(0,12),"big"):mh.split32(this.h.slice(0,12),"big")},"digest")});var ab=me(na=>{"use strict";na.sha1=G1();na.sha224=Q1();na.sha256=uh();na.sha384=sb();na.sha512=ph()});var hb=me(db=>{"use strict";var Vo=wn(),e7=Qs(),nu=Vo.rotl32,fb=Vo.sum32,mf=Vo.sum32_3,cb=Vo.sum32_4,lb=e7.BlockHash;function ei(){if(!(this instanceof ei))return new ei;lb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}o(ei,"RIPEMD160");Vo.inherits(ei,lb);db.ripemd160=ei;ei.blockSize=512;ei.outSize=160;ei.hmacStrength=192;ei.padLength=64;ei.prototype._update=o(function(e,t){for(var n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],u=n,p=i,b=s,x=a,A=f,O=0;O<80;O++){var T=fb(nu(cb(n,ub(O,i,s,a),e[n7[O]+t],t7(O)),o7[O]),f);n=f,f=a,a=nu(s,10),s=i,i=T,T=fb(nu(cb(u,ub(79-O,p,b,x),e[i7[O]+t],r7(O)),s7[O]),A),u=A,A=x,x=nu(b,10),b=p,p=T}T=mf(this.h[1],s,x),this.h[1]=mf(this.h[2],a,A),this.h[2]=mf(this.h[3],f,u),this.h[3]=mf(this.h[4],n,p),this.h[4]=mf(this.h[0],i,b),this.h[0]=T},"update");ei.prototype._digest=o(function(e){return e==="hex"?Vo.toHex32(this.h,"little"):Vo.split32(this.h,"little")},"digest");function ub(r,e,t,n){return r<=15?e^t^n:r<=31?e&t|~e&n:r<=47?(e|~t)^n:r<=63?e&n|t&~n:e^(t|~n)}o(ub,"f");function t7(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}o(t7,"K");function r7(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}o(r7,"Kh");var n7=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],i7=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],o7=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],s7=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var mb=me((EN,pb)=>{"use strict";var a7=wn(),f7=Yi();function ia(r,e,t){if(!(this instanceof ia))return new ia(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(a7.toArray(e,t))}o(ia,"Hmac");pb.exports=ia;ia.prototype._init=o(function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),f7(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},"init");ia.prototype.update=o(function(e,t){return this.inner.update(e,t),this},"update");ia.prototype.digest=o(function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},"digest")});var bf=me(bb=>{var Qt=bb;Qt.utils=wn();Qt.common=Qs();Qt.sha=ab();Qt.ripemd=hb();Qt.hmac=mb();Qt.sha1=Qt.sha.sha1;Qt.sha256=Qt.sha.sha256;Qt.sha224=Qt.sha.sha224;Qt.sha384=Qt.sha.sha384;Qt.sha512=Qt.sha.sha512;Qt.ripemd160=Qt.ripemd.ripemd160});var vb=me((MN,gb)=>{gb.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var iu=me(wb=>{"use strict";var gh=wb,Qi=bf(),bh=ah(),c7=Or(),yb=c7.assert;function xb(r){r.type==="short"?this.curve=new bh.short(r):r.type==="edwards"?this.curve=new bh.edwards(r):this.curve=new bh.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,yb(this.g.validate(),"Invalid curve"),yb(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(xb,"PresetCurve");gh.PresetCurve=xb;function eo(r,e){Object.defineProperty(gh,r,{configurable:!0,enumerable:!0,get:function(){var t=new xb(e);return Object.defineProperty(gh,r,{configurable:!0,enumerable:!0,value:t}),t}})}o(eo,"defineCurve");eo("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Qi.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});eo("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Qi.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});eo("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Qi.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});eo("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Qi.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});eo("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Qi.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});eo("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qi.sha256,gRed:!1,g:["9"]});eo("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qi.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var vh;try{vh=vb()}catch(r){vh=void 0}eo("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Qi.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",vh]})});var Sb=me((TN,Eb)=>{"use strict";var u7=bf(),Wo=eh(),_b=Yi();function to(r){if(!(this instanceof to))return new to(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Wo.toArray(r.entropy,r.entropyEnc||"hex"),t=Wo.toArray(r.nonce,r.nonceEnc||"hex"),n=Wo.toArray(r.pers,r.persEnc||"hex");_b(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(to,"HmacDRBG");Eb.exports=to;to.prototype._init=o(function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");to.prototype._hmac=o(function(){return new u7.hmac(this.hash,this.K)},"hmac");to.prototype._update=o(function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},"update");to.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Wo.toArray(e,t),n=Wo.toArray(n,i),_b(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");to.prototype.generate=o(function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=n,n=t,t=null),n&&(n=Wo.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(n),this._reseed++,Wo.encode(a,t)},"generate")});var Ab=me((kN,Mb)=>{"use strict";var l7=Wn(),d7=Or(),yh=d7.assert;function ar(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(ar,"KeyPair");Mb.exports=ar;ar.fromPublic=o(function(e,t,n){return t instanceof ar?t:new ar(e,{pub:t,pubEnc:n})},"fromPublic");ar.fromPrivate=o(function(e,t,n){return t instanceof ar?t:new ar(e,{priv:t,privEnc:n})},"fromPrivate");ar.prototype.validate=o(function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate");ar.prototype.getPublic=o(function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},"getPublic");ar.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");ar.prototype._importPrivate=o(function(e,t){this.priv=new l7(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");ar.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?yh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&yh(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},"_importPublic");ar.prototype.derive=o(function(e){return e.validate()||yh(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");ar.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");ar.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");ar.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect")});var Cb=me((CN,kb)=>{"use strict";var ou=Wn(),_h=Or(),h7=_h.assert;function su(r,e){if(r instanceof su)return r;this._importDER(r,e)||(h7(r.r&&r.s,"Signature without r or s"),this.r=new ou(r.r,16),this.s=new ou(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(su,"Signature");kb.exports=su;function p7(){this.place=0}o(p7,"Position");function xh(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=r[a],i>>>=0;return i<=127?!1:(e.place=a,i)}o(xh,"getLength");function Tb(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}o(Tb,"rmPadding");su.prototype._importDER=o(function(e,t){e=_h.toArray(e,t);var n=new p7;if(e[n.place++]!==48)return!1;var i=xh(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=xh(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var f=xh(e,n);if(f===!1||e.length!==f+n.place)return!1;var u=e.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new ou(a),this.s=new ou(u),this.recoveryParam=null,!0},"_importDER");function wh(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}o(wh,"constructLength");su.prototype.toDER=o(function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=Tb(t),n=Tb(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];wh(i,t.length),i=i.concat(t),i.push(2),wh(i,n.length);var s=i.concat(n),a=[48];return wh(a,s.length),a=a.concat(s),_h.encode(a,e)},"toDER")});var Pb=me((DN,Ob)=>{"use strict";var Go=Wn(),Db=Sb(),m7=Or(),Eh=iu(),b7=ih(),Ib=m7.assert,Sh=Ab(),au=Cb();function on(r){if(!(this instanceof on))return new on(r);typeof r=="string"&&(Ib(Object.prototype.hasOwnProperty.call(Eh,r),"Unknown curve "+r),r=Eh[r]),r instanceof Eh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}o(on,"EC");Ob.exports=on;on.prototype.keyPair=o(function(e){return new Sh(this,e)},"keyPair");on.prototype.keyFromPrivate=o(function(e,t){return Sh.fromPrivate(this,e,t)},"keyFromPrivate");on.prototype.keyFromPublic=o(function(e,t){return Sh.fromPublic(this,e,t)},"keyFromPublic");on.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new Db({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||b7(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Go(2));;){var s=new Go(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");on.prototype._truncateToN=o(function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");on.prototype.sign=o(function(e,t,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Go(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),f=e.toArray("be",s),u=new Db({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new Go(1)),b=0;;b++){var x=i.k?i.k(b):new Go(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(p)>=0)){var A=this.g.mul(x);if(!A.isInfinity()){var O=A.getX(),T=O.umod(this.n);if(T.cmpn(0)!==0){var k=x.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(k=k.umod(this.n),k.cmpn(0)!==0){var $=(A.getY().isOdd()?1:0)|(O.cmp(T)!==0?2:0);return i.canonical&&k.cmp(this.nh)>0&&(k=this.n.sub(k),$^=1),new au({r:T,s:k,recoveryParam:$})}}}}}},"sign");on.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Go(e,16)),n=this.keyFromPublic(n,i),t=new au(t,"hex");var s=t.r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(e).umod(this.n),p=f.mul(s).umod(this.n),b;return this.curve._maxwellTrick?(b=this.g.jmulAdd(u,n.getPublic(),p),b.isInfinity()?!1:b.eqXToP(s)):(b=this.g.mulAdd(u,n.getPublic(),p),b.isInfinity()?!1:b.getX().umod(this.n).cmp(s)===0)},"verify");on.prototype.recoverPubKey=function(r,e,t,n){Ib((3&t)===t,"The recovery param is more than two bits"),e=new au(e,n);var i=this.n,s=new Go(r),a=e.r,f=e.s,u=t&1,p=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var b=e.r.invm(i),x=i.sub(s).mul(b).umod(i),A=f.mul(b).umod(i);return this.g.mulAdd(x,a,A)};on.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new au(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(a){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}});var Bb=me((IN,Lb)=>{"use strict";var gf=Or(),Rb=gf.assert,Nb=gf.parseBytes,oa=gf.cachedProperty;function Kt(r,e){this.eddsa=r,this._secret=Nb(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Nb(e.pub)}o(Kt,"KeyPair");Kt.fromPublic=o(function(e,t){return t instanceof Kt?t:new Kt(e,{pub:t})},"fromPublic");Kt.fromSecret=o(function(e,t){return t instanceof Kt?t:new Kt(e,{secret:t})},"fromSecret");Kt.prototype.secret=o(function(){return this._secret},"secret");oa(Kt,"pubBytes",o(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"));oa(Kt,"pub",o(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"));oa(Kt,"privBytes",o(function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i},"privBytes"));oa(Kt,"priv",o(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"));oa(Kt,"hash",o(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash"));oa(Kt,"messagePrefix",o(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix"));Kt.prototype.sign=o(function(e){return Rb(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},"sign");Kt.prototype.verify=o(function(e,t){return this.eddsa.verify(e,t,this)},"verify");Kt.prototype.getSecret=o(function(e){return Rb(this._secret,"KeyPair is public only"),gf.encode(this.secret(),e)},"getSecret");Kt.prototype.getPublic=o(function(e){return gf.encode(this.pubBytes(),e)},"getPublic");Lb.exports=Kt});var Fb=me((ON,Ub)=>{"use strict";var g7=Wn(),fu=Or(),v7=fu.assert,cu=fu.cachedProperty,y7=fu.parseBytes;function Yo(r,e){this.eddsa=r,typeof e!="object"&&(e=y7(e)),Array.isArray(e)&&(e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),v7(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof g7&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(Yo,"Signature");cu(Yo,"S",o(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"));cu(Yo,"R",o(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"));cu(Yo,"Rencoded",o(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"));cu(Yo,"Sencoded",o(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"));Yo.prototype.toBytes=o(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes");Yo.prototype.toHex=o(function(){return fu.encode(this.toBytes(),"hex").toUpperCase()},"toHex");Ub.exports=Yo});var jb=me((PN,zb)=>{"use strict";var x7=bf(),w7=iu(),sa=Or(),_7=sa.assert,qb=sa.parseBytes,Hb=Bb(),$b=Fb();function Sr(r){if(_7(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Sr))return new Sr(r);r=w7[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=x7.sha512}o(Sr,"EDDSA");zb.exports=Sr;Sr.prototype.sign=o(function(e,t){e=qb(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),a=this.encodePoint(s),f=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),u=i.add(f).umod(this.curve.n);return this.makeSignature({R:s,S:u,Rencoded:a})},"sign");Sr.prototype.verify=o(function(e,t,n){e=qb(e),t=this.makeSignature(t);var i=this.keyFromPublic(n),s=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S()),f=t.R().add(i.pub().mul(s));return f.eq(a)},"verify");Sr.prototype.hashInt=o(function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return sa.intFromLE(e.digest()).umod(this.curve.n)},"hashInt");Sr.prototype.keyFromPublic=o(function(e){return Hb.fromPublic(this,e)},"keyFromPublic");Sr.prototype.keyFromSecret=o(function(e){return Hb.fromSecret(this,e)},"keyFromSecret");Sr.prototype.makeSignature=o(function(e){return e instanceof $b?e:new $b(this,e)},"makeSignature");Sr.prototype.encodePoint=o(function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},"encodePoint");Sr.prototype.decodePoint=o(function(e){e=sa.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),i=(e[t]&128)!==0,s=sa.intFromLE(n);return this.curve.pointFromY(s,i)},"decodePoint");Sr.prototype.encodeInt=o(function(e){return e.toArray("le",this.encodingLength)},"encodeInt");Sr.prototype.decodeInt=o(function(e){return sa.intFromLE(e)},"decodeInt");Sr.prototype.isPoint=o(function(e){return e instanceof this.pointClass},"isPoint")});var Vb=me(Kb=>{"use strict";var Jo=Kb;Jo.version=x1().version;Jo.utils=Or();Jo.rand=ih();Jo.curve=ah();Jo.curves=iu();Jo.ec=Pb();Jo.eddsa=jb()});var Gb=me(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});var Wb=65536,E7=function(){function r(){this.isAvailable=!1,this.isInstantiated=!1;var e=typeof self!="undefined"?self.crypto||self.msCrypto:null;e&&e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}return o(r,"BrowserRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var t=new Uint8Array(e),n=0;n<t.length;n+=Wb)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,Wb)));return t},r}();Mh.BrowserRandomSource=E7});var Yb=me(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});var S7=tn(),M7=function(){function r(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require!="undefined"){var e=require("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}return o(r,"NodeRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");var t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");for(var n=new Uint8Array(e),i=0;i<n.length;i++)n[i]=t[i];return S7.wipe(t),n},r}();Ah.NodeRandomSource=M7});var Jb=me(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var A7=Gb(),T7=Yb(),k7=function(){function r(){if(this.isAvailable=!1,this.name="",this._source=new A7.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new T7.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}return o(r,"SystemRandomSource"),r.prototype.randomBytes=function(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)},r}();Th.SystemRandomSource=k7});var ro=me(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var C7=Jb(),D7=jo(),Xb=tn();Sn.defaultRandomSource=new C7.SystemRandomSource;function kh(r,e){return e===void 0&&(e=Sn.defaultRandomSource),e.randomBytes(r)}o(kh,"randomBytes");Sn.randomBytes=kh;function I7(r){r===void 0&&(r=Sn.defaultRandomSource);var e=kh(4,r),t=D7.readUint32LE(e);return Xb.wipe(e),t}o(I7,"randomUint32");Sn.randomUint32=I7;var Zb="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Qb(r,e,t){if(e===void 0&&(e=Zb),t===void 0&&(t=Sn.defaultRandomSource),e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");for(var n="",i=e.length,s=256-256%i;r>0;){for(var a=kh(Math.ceil(r*256/s),t),f=0;f<a.length&&r>0;f++){var u=a[f];u<s&&(n+=e.charAt(u%i),r--)}Xb.wipe(a)}return n}o(Qb,"randomString");Sn.randomString=Qb;function O7(r,e,t){e===void 0&&(e=Zb),t===void 0&&(t=Sn.defaultRandomSource);var n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return Qb(n,e,t)}o(O7,"randomStringForEntropy");Sn.randomStringForEntropy=O7});var rg=me(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var fa=jo(),aa=tn();Ei.DIGEST_LENGTH=64;Ei.BLOCK_SIZE=128;var tg=function(){function r(){this.digestLength=Ei.DIGEST_LENGTH,this.blockSize=Ei.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o(r,"SHA512"),r.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},r.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},r.prototype.clean=function(){aa.wipe(this._buffer),aa.wipe(this._tempHi),aa.wipe(this._tempLo),this.reset()},r.prototype.update=function(e,t){if(t===void 0&&(t=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<Ei.BLOCK_SIZE&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(Ch(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=Ch(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},r.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,s=t<<3,a=t%128<112?128:256;this._buffer[n]=128;for(var f=n+1;f<a-8;f++)this._buffer[f]=0;fa.writeUint32BE(i,this._buffer,a-8),fa.writeUint32BE(s,this._buffer,a-4),Ch(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(var f=0;f<this.digestLength/8;f++)fa.writeUint32BE(this._stateHi[f],e,f*8),fa.writeUint32BE(this._stateLo[f],e,f*8+4);return this},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},r.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},r.prototype.cleanSavedState=function(e){aa.wipe(e.stateHi),aa.wipe(e.stateLo),e.buffer&&aa.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},r}();Ei.SHA512=tg;var eg=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function Ch(r,e,t,n,i,s,a){for(var f=t[0],u=t[1],p=t[2],b=t[3],x=t[4],A=t[5],O=t[6],T=t[7],k=n[0],$=n[1],C=n[2],B=n[3],z=n[4],H=n[5],X=n[6],U=n[7],L,F,ne,D,l,v,h,c;a>=128;){for(var d=0;d<16;d++){var y=8*d+s;r[d]=fa.readUint32BE(i,y),e[d]=fa.readUint32BE(i,y+4)}for(var d=0;d<80;d++){var _=f,w=u,m=p,E=b,I=x,g=A,S=O,ie=T,M=k,K=$,J=C,N=B,R=z,V=H,W=X,ee=U;if(L=T,F=U,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=(x>>>14|z<<32-14)^(x>>>18|z<<32-18)^(z>>>41-32|x<<32-(41-32)),F=(z>>>14|x<<32-14)^(z>>>18|x<<32-18)^(x>>>41-32|z<<32-(41-32)),l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,L=x&A^~x&O,F=z&H^~z&X,l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,L=eg[d*2],F=eg[d*2+1],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,L=r[d%16],F=e[d%16],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,ne=h&65535|c<<16,D=l&65535|v<<16,L=ne,F=D,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=(f>>>28|k<<32-28)^(k>>>34-32|f<<32-(34-32))^(k>>>39-32|f<<32-(39-32)),F=(k>>>28|f<<32-28)^(f>>>34-32|k<<32-(34-32))^(f>>>39-32|k<<32-(39-32)),l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,L=f&u^f&p^u&p,F=k&$^k&C^$&C,l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,ie=h&65535|c<<16,ee=l&65535|v<<16,L=E,F=N,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=ne,F=D,l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,E=h&65535|c<<16,N=l&65535|v<<16,u=_,p=w,b=m,x=E,A=I,O=g,T=S,f=ie,$=M,C=K,B=J,z=N,H=R,X=V,U=W,k=ee,d%16===15)for(var y=0;y<16;y++)L=r[y],F=e[y],l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=r[(y+9)%16],F=e[(y+9)%16],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,ne=r[(y+1)%16],D=e[(y+1)%16],L=(ne>>>1|D<<32-1)^(ne>>>8|D<<32-8)^ne>>>7,F=(D>>>1|ne<<32-1)^(D>>>8|ne<<32-8)^(D>>>7|ne<<32-7),l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,ne=r[(y+14)%16],D=e[(y+14)%16],L=(ne>>>19|D<<32-19)^(D>>>61-32|ne<<32-(61-32))^ne>>>6,F=(D>>>19|ne<<32-19)^(ne>>>61-32|D<<32-(61-32))^(D>>>6|ne<<32-6),l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,r[y]=h&65535|c<<16,e[y]=l&65535|v<<16}L=f,F=k,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[0],F=n[0],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[0]=f=h&65535|c<<16,n[0]=k=l&65535|v<<16,L=u,F=$,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[1],F=n[1],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[1]=u=h&65535|c<<16,n[1]=$=l&65535|v<<16,L=p,F=C,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[2],F=n[2],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[2]=p=h&65535|c<<16,n[2]=C=l&65535|v<<16,L=b,F=B,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[3],F=n[3],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[3]=b=h&65535|c<<16,n[3]=B=l&65535|v<<16,L=x,F=z,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[4],F=n[4],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[4]=x=h&65535|c<<16,n[4]=z=l&65535|v<<16,L=A,F=H,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[5],F=n[5],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[5]=A=h&65535|c<<16,n[5]=H=l&65535|v<<16,L=O,F=X,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[6],F=n[6],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[6]=O=h&65535|c<<16,n[6]=X=l&65535|v<<16,L=T,F=U,l=F&65535,v=F>>>16,h=L&65535,c=L>>>16,L=t[7],F=n[7],l+=F&65535,v+=F>>>16,h+=L&65535,c+=L>>>16,v+=l>>>16,h+=v>>>16,c+=h>>>16,t[7]=T=h&65535|c<<16,n[7]=U=l&65535|v<<16,s+=128,a-=128}return s}o(Ch,"hashBlocks");function P7(r){var e=new tg;e.update(r);var t=e.digest();return e.clean(),t}o(P7,"hash");Ei.hash=P7});var uu=me($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var N7=ro(),vf=rg(),ag=tn();$t.SIGNATURE_LENGTH=64;$t.PUBLIC_KEY_LENGTH=32;$t.SECRET_KEY_LENGTH=64;$t.SEED_LENGTH=32;function Ce(r){var e=new Float64Array(16);if(r)for(var t=0;t<r.length;t++)e[t]=r[t];return e}o(Ce,"gf");var R7=new Uint8Array(32);R7[0]=9;var Oh=Ce(),ca=Ce([1]),L7=Ce([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),B7=Ce([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),ng=Ce([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),ig=Ce([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),U7=Ce([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function no(r,e){for(var t=0;t<16;t++)r[t]=e[t]|0}o(no,"set25519");function Dh(r){for(var e=1,t=0;t<16;t++){var n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Dh,"car25519");function fg(r,e,t){for(var n=~(t-1),i=0;i<16;i++){var s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(fg,"sel25519");function yf(r,e){for(var t=Ce(),n=Ce(),i=0;i<16;i++)n[i]=e[i];Dh(n),Dh(n),Dh(n);for(var s=0;s<2;s++){t[0]=n[0]-65517;for(var i=1;i<15;i++)t[i]=n[i]-65535-(t[i-1]>>16&1),t[i-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);var a=t[15]>>16&1;t[14]&=65535,fg(n,t,1-a)}for(var i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(yf,"pack25519");function cg(r,e){for(var t=0,n=0;n<32;n++)t|=r[n]^e[n];return(1&t-1>>>8)-1}o(cg,"verify32");function og(r,e){var t=new Uint8Array(32),n=new Uint8Array(32);return yf(t,r),yf(n,e),cg(t,n)}o(og,"neq25519");function ug(r){var e=new Uint8Array(32);return yf(e,r),e[0]&1}o(ug,"par25519");function F7(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(F7,"unpack25519");function Xo(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(Xo,"add");function Qo(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(Qo,"sub");function vt(r,e,t){var n,i,s=0,a=0,f=0,u=0,p=0,b=0,x=0,A=0,O=0,T=0,k=0,$=0,C=0,B=0,z=0,H=0,X=0,U=0,L=0,F=0,ne=0,D=0,l=0,v=0,h=0,c=0,d=0,y=0,_=0,w=0,m=0,E=t[0],I=t[1],g=t[2],S=t[3],ie=t[4],M=t[5],K=t[6],J=t[7],N=t[8],R=t[9],V=t[10],W=t[11],ee=t[12],he=t[13],fe=t[14],Y=t[15];n=e[0],s+=n*E,a+=n*I,f+=n*g,u+=n*S,p+=n*ie,b+=n*M,x+=n*K,A+=n*J,O+=n*N,T+=n*R,k+=n*V,$+=n*W,C+=n*ee,B+=n*he,z+=n*fe,H+=n*Y,n=e[1],a+=n*E,f+=n*I,u+=n*g,p+=n*S,b+=n*ie,x+=n*M,A+=n*K,O+=n*J,T+=n*N,k+=n*R,$+=n*V,C+=n*W,B+=n*ee,z+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*E,u+=n*I,p+=n*g,b+=n*S,x+=n*ie,A+=n*M,O+=n*K,T+=n*J,k+=n*N,$+=n*R,C+=n*V,B+=n*W,z+=n*ee,H+=n*he,X+=n*fe,U+=n*Y,n=e[3],u+=n*E,p+=n*I,b+=n*g,x+=n*S,A+=n*ie,O+=n*M,T+=n*K,k+=n*J,$+=n*N,C+=n*R,B+=n*V,z+=n*W,H+=n*ee,X+=n*he,U+=n*fe,L+=n*Y,n=e[4],p+=n*E,b+=n*I,x+=n*g,A+=n*S,O+=n*ie,T+=n*M,k+=n*K,$+=n*J,C+=n*N,B+=n*R,z+=n*V,H+=n*W,X+=n*ee,U+=n*he,L+=n*fe,F+=n*Y,n=e[5],b+=n*E,x+=n*I,A+=n*g,O+=n*S,T+=n*ie,k+=n*M,$+=n*K,C+=n*J,B+=n*N,z+=n*R,H+=n*V,X+=n*W,U+=n*ee,L+=n*he,F+=n*fe,ne+=n*Y,n=e[6],x+=n*E,A+=n*I,O+=n*g,T+=n*S,k+=n*ie,$+=n*M,C+=n*K,B+=n*J,z+=n*N,H+=n*R,X+=n*V,U+=n*W,L+=n*ee,F+=n*he,ne+=n*fe,D+=n*Y,n=e[7],A+=n*E,O+=n*I,T+=n*g,k+=n*S,$+=n*ie,C+=n*M,B+=n*K,z+=n*J,H+=n*N,X+=n*R,U+=n*V,L+=n*W,F+=n*ee,ne+=n*he,D+=n*fe,l+=n*Y,n=e[8],O+=n*E,T+=n*I,k+=n*g,$+=n*S,C+=n*ie,B+=n*M,z+=n*K,H+=n*J,X+=n*N,U+=n*R,L+=n*V,F+=n*W,ne+=n*ee,D+=n*he,l+=n*fe,v+=n*Y,n=e[9],T+=n*E,k+=n*I,$+=n*g,C+=n*S,B+=n*ie,z+=n*M,H+=n*K,X+=n*J,U+=n*N,L+=n*R,F+=n*V,ne+=n*W,D+=n*ee,l+=n*he,v+=n*fe,h+=n*Y,n=e[10],k+=n*E,$+=n*I,C+=n*g,B+=n*S,z+=n*ie,H+=n*M,X+=n*K,U+=n*J,L+=n*N,F+=n*R,ne+=n*V,D+=n*W,l+=n*ee,v+=n*he,h+=n*fe,c+=n*Y,n=e[11],$+=n*E,C+=n*I,B+=n*g,z+=n*S,H+=n*ie,X+=n*M,U+=n*K,L+=n*J,F+=n*N,ne+=n*R,D+=n*V,l+=n*W,v+=n*ee,h+=n*he,c+=n*fe,d+=n*Y,n=e[12],C+=n*E,B+=n*I,z+=n*g,H+=n*S,X+=n*ie,U+=n*M,L+=n*K,F+=n*J,ne+=n*N,D+=n*R,l+=n*V,v+=n*W,h+=n*ee,c+=n*he,d+=n*fe,y+=n*Y,n=e[13],B+=n*E,z+=n*I,H+=n*g,X+=n*S,U+=n*ie,L+=n*M,F+=n*K,ne+=n*J,D+=n*N,l+=n*R,v+=n*V,h+=n*W,c+=n*ee,d+=n*he,y+=n*fe,_+=n*Y,n=e[14],z+=n*E,H+=n*I,X+=n*g,U+=n*S,L+=n*ie,F+=n*M,ne+=n*K,D+=n*J,l+=n*N,v+=n*R,h+=n*V,c+=n*W,d+=n*ee,y+=n*he,_+=n*fe,w+=n*Y,n=e[15],H+=n*E,X+=n*I,U+=n*g,L+=n*S,F+=n*ie,ne+=n*M,D+=n*K,l+=n*J,v+=n*N,h+=n*R,c+=n*V,d+=n*W,y+=n*ee,_+=n*he,w+=n*fe,m+=n*Y,s+=38*X,a+=38*U,f+=38*L,u+=38*F,p+=38*ne,b+=38*D,x+=38*l,A+=38*v,O+=38*h,T+=38*c,k+=38*d,$+=38*y,C+=38*_,B+=38*w,z+=38*m,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=A+i+65535,i=Math.floor(n/65536),A=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=A+i+65535,i=Math.floor(n/65536),A=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=a,r[2]=f,r[3]=u,r[4]=p,r[5]=b,r[6]=x,r[7]=A,r[8]=O,r[9]=T,r[10]=k,r[11]=$,r[12]=C,r[13]=B,r[14]=z,r[15]=H}o(vt,"mul");function Zo(r,e){vt(r,e,e)}o(Zo,"square");function lg(r,e){var t=Ce(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=253;n>=0;n--)Zo(t,t),n!==2&&n!==4&&vt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o(lg,"inv25519");function $7(r,e){var t=Ce(),n;for(n=0;n<16;n++)t[n]=e[n];for(n=250;n>=0;n--)Zo(t,t),n!==1&&vt(t,t,e);for(n=0;n<16;n++)r[n]=t[n]}o($7,"pow2523");function Ph(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce(),p=Ce(),b=Ce();Qo(t,r[1],r[0]),Qo(b,e[1],e[0]),vt(t,t,b),Xo(n,r[0],r[1]),Xo(b,e[0],e[1]),vt(n,n,b),vt(i,r[3],e[3]),vt(i,i,B7),vt(s,r[2],e[2]),Xo(s,s,s),Qo(a,n,t),Qo(f,s,i),Xo(u,s,i),Xo(p,n,t),vt(r[0],a,f),vt(r[1],p,u),vt(r[2],u,f),vt(r[3],a,p)}o(Ph,"edadd");function sg(r,e,t){for(var n=0;n<4;n++)fg(r[n],e[n],t)}o(sg,"cswap");function Rh(r,e){var t=Ce(),n=Ce(),i=Ce();lg(i,e[2]),vt(t,e[0],i),vt(n,e[1],i),yf(r,n),r[31]^=ug(t)<<7}o(Rh,"pack");function dg(r,e,t){no(r[0],Oh),no(r[1],ca),no(r[2],ca),no(r[3],Oh);for(var n=255;n>=0;--n){var i=t[n/8|0]>>(n&7)&1;sg(r,e,i),Ph(e,r),Ph(r,r),sg(r,e,i)}}o(dg,"scalarmult");function Lh(r,e){var t=[Ce(),Ce(),Ce(),Ce()];no(t[0],ng),no(t[1],ig),no(t[2],ca),vt(t[3],ng,ig),dg(r,t,e)}o(Lh,"scalarbase");function hg(r){if(r.length!==$t.SEED_LENGTH)throw new Error("ed25519: seed must be "+$t.SEED_LENGTH+" bytes");var e=vf.hash(r);e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(32),n=[Ce(),Ce(),Ce(),Ce()];Lh(n,e),Rh(t,n);var i=new Uint8Array(64);return i.set(r),i.set(t,32),{publicKey:t,secretKey:i}}o(hg,"generateKeyPairFromSeed");$t.generateKeyPairFromSeed=hg;function q7(r){var e=N7.randomBytes(32,r),t=hg(e);return ag.wipe(e),t}o(q7,"generateKeyPair");$t.generateKeyPair=q7;function H7(r){if(r.length!==$t.SECRET_KEY_LENGTH)throw new Error("ed25519: secret key must be "+$t.SECRET_KEY_LENGTH+" bytes");return new Uint8Array(r.subarray(32))}o(H7,"extractPublicKeyFromSecretKey");$t.extractPublicKeyFromSecretKey=H7;var Ih=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function pg(r,e){var t,n,i,s;for(n=63;n>=32;--n){for(t=0,i=n-32,s=n-12;i<s;++i)e[i]+=t-16*e[n]*Ih[i-(n-32)],t=Math.floor((e[i]+128)/256),e[i]-=t*256;e[i]+=t,e[n]=0}for(t=0,i=0;i<32;i++)e[i]+=t-(e[31]>>4)*Ih[i],t=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=t*Ih[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(pg,"modL");function Nh(r){for(var e=new Float64Array(64),t=0;t<64;t++)e[t]=r[t];for(var t=0;t<64;t++)r[t]=0;pg(r,e)}o(Nh,"reduce");function z7(r,e){var t=new Float64Array(64),n=[Ce(),Ce(),Ce(),Ce()],i=vf.hash(r.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;var s=new Uint8Array(64);s.set(i.subarray(32),32);var a=new vf.SHA512;a.update(s.subarray(32)),a.update(e);var f=a.digest();a.clean(),Nh(f),Lh(n,f),Rh(s,n),a.reset(),a.update(s.subarray(0,32)),a.update(r.subarray(32)),a.update(e);var u=a.digest();Nh(u);for(var p=0;p<32;p++)t[p]=f[p];for(var p=0;p<32;p++)for(var b=0;b<32;b++)t[p+b]+=u[p]*i[b];return pg(s.subarray(32),t),s}o(z7,"sign");$t.sign=z7;function mg(r,e){var t=Ce(),n=Ce(),i=Ce(),s=Ce(),a=Ce(),f=Ce(),u=Ce();return no(r[2],ca),F7(r[1],e),Zo(i,r[1]),vt(s,i,L7),Qo(i,i,r[2]),Xo(s,r[2],s),Zo(a,s),Zo(f,a),vt(u,f,a),vt(t,u,i),vt(t,t,s),$7(t,t),vt(t,t,i),vt(t,t,s),vt(t,t,s),vt(r[0],t,s),Zo(n,r[0]),vt(n,n,s),og(n,i)&&vt(r[0],r[0],U7),Zo(n,r[0]),vt(n,n,s),og(n,i)?-1:(ug(r[0])===e[31]>>7&&Qo(r[0],Oh,r[0]),vt(r[3],r[0],r[1]),0)}o(mg,"unpackneg");function j7(r,e,t){var n=new Uint8Array(32),i=[Ce(),Ce(),Ce(),Ce()],s=[Ce(),Ce(),Ce(),Ce()];if(t.length!==$t.SIGNATURE_LENGTH)throw new Error("ed25519: signature must be "+$t.SIGNATURE_LENGTH+" bytes");if(mg(s,r))return!1;var a=new vf.SHA512;a.update(t.subarray(0,32)),a.update(r),a.update(e);var f=a.digest();return Nh(f),dg(i,s,f),Lh(s,t.subarray(32)),Ph(i,s),Rh(n,i),!cg(t,n)}o(j7,"verify");$t.verify=j7;function K7(r){var e=[Ce(),Ce(),Ce(),Ce()];if(mg(e,r))throw new Error("Ed25519: invalid public key");var t=Ce(),n=Ce(),i=e[1];Xo(t,ca,i),Qo(n,ca,i),lg(n,n),vt(t,t,n);var s=new Uint8Array(32);return yf(s,t),s}o(K7,"convertPublicKeyToX25519");$t.convertPublicKeyToX25519=K7;function V7(r){var e=vf.hash(r.subarray(0,32));e[0]&=248,e[31]&=127,e[31]|=64;var t=new Uint8Array(e.subarray(0,32));return ag.wipe(e),t}o(V7,"convertSecretKeyToX25519");$t.convertSecretKeyToX25519=V7});var gg=me((qN,bg)=>{"use strict";bg.exports=o(function r(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,n,i)=>{let s=i===0?"":",",a=n===void 0||typeof n=="symbol"?null:n;return t+s+r(a)},"")+"]":"{"+Object.keys(e).sort().reduce((t,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return t;let s=t.length===0?"":",";return t+s+r(n)+":"+r(e[n])},"")+"}"},"serialize")});var wg=me(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});var W7=ro(),G7=tn();Mr.PUBLIC_KEY_LENGTH=32;Mr.SECRET_KEY_LENGTH=32;Mr.SHARED_KEY_LENGTH=32;function ti(r){var e=new Float64Array(16);if(r)for(var t=0;t<r.length;t++)e[t]=r[t];return e}o(ti,"gf");var vg=new Uint8Array(32);vg[0]=9;var Y7=ti([56129,1]);function Bh(r){for(var e=1,t=0;t<16;t++){var n=r[t]+e+65535;e=Math.floor(n/65536),r[t]=n-e*65536}r[0]+=e-1+37*(e-1)}o(Bh,"car25519");function xf(r,e,t){for(var n=~(t-1),i=0;i<16;i++){var s=n&(r[i]^e[i]);r[i]^=s,e[i]^=s}}o(xf,"sel25519");function J7(r,e){for(var t=ti(),n=ti(),i=0;i<16;i++)n[i]=e[i];Bh(n),Bh(n),Bh(n);for(var s=0;s<2;s++){t[0]=n[0]-65517;for(var i=1;i<15;i++)t[i]=n[i]-65535-(t[i-1]>>16&1),t[i-1]&=65535;t[15]=n[15]-32767-(t[14]>>16&1);var a=t[15]>>16&1;t[14]&=65535,xf(n,t,1-a)}for(var i=0;i<16;i++)r[2*i]=n[i]&255,r[2*i+1]=n[i]>>8}o(J7,"pack25519");function X7(r,e){for(var t=0;t<16;t++)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(X7,"unpack25519");function lu(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]+t[n]}o(lu,"add");function du(r,e,t){for(var n=0;n<16;n++)r[n]=e[n]-t[n]}o(du,"sub");function Si(r,e,t){var n,i,s=0,a=0,f=0,u=0,p=0,b=0,x=0,A=0,O=0,T=0,k=0,$=0,C=0,B=0,z=0,H=0,X=0,U=0,L=0,F=0,ne=0,D=0,l=0,v=0,h=0,c=0,d=0,y=0,_=0,w=0,m=0,E=t[0],I=t[1],g=t[2],S=t[3],ie=t[4],M=t[5],K=t[6],J=t[7],N=t[8],R=t[9],V=t[10],W=t[11],ee=t[12],he=t[13],fe=t[14],Y=t[15];n=e[0],s+=n*E,a+=n*I,f+=n*g,u+=n*S,p+=n*ie,b+=n*M,x+=n*K,A+=n*J,O+=n*N,T+=n*R,k+=n*V,$+=n*W,C+=n*ee,B+=n*he,z+=n*fe,H+=n*Y,n=e[1],a+=n*E,f+=n*I,u+=n*g,p+=n*S,b+=n*ie,x+=n*M,A+=n*K,O+=n*J,T+=n*N,k+=n*R,$+=n*V,C+=n*W,B+=n*ee,z+=n*he,H+=n*fe,X+=n*Y,n=e[2],f+=n*E,u+=n*I,p+=n*g,b+=n*S,x+=n*ie,A+=n*M,O+=n*K,T+=n*J,k+=n*N,$+=n*R,C+=n*V,B+=n*W,z+=n*ee,H+=n*he,X+=n*fe,U+=n*Y,n=e[3],u+=n*E,p+=n*I,b+=n*g,x+=n*S,A+=n*ie,O+=n*M,T+=n*K,k+=n*J,$+=n*N,C+=n*R,B+=n*V,z+=n*W,H+=n*ee,X+=n*he,U+=n*fe,L+=n*Y,n=e[4],p+=n*E,b+=n*I,x+=n*g,A+=n*S,O+=n*ie,T+=n*M,k+=n*K,$+=n*J,C+=n*N,B+=n*R,z+=n*V,H+=n*W,X+=n*ee,U+=n*he,L+=n*fe,F+=n*Y,n=e[5],b+=n*E,x+=n*I,A+=n*g,O+=n*S,T+=n*ie,k+=n*M,$+=n*K,C+=n*J,B+=n*N,z+=n*R,H+=n*V,X+=n*W,U+=n*ee,L+=n*he,F+=n*fe,ne+=n*Y,n=e[6],x+=n*E,A+=n*I,O+=n*g,T+=n*S,k+=n*ie,$+=n*M,C+=n*K,B+=n*J,z+=n*N,H+=n*R,X+=n*V,U+=n*W,L+=n*ee,F+=n*he,ne+=n*fe,D+=n*Y,n=e[7],A+=n*E,O+=n*I,T+=n*g,k+=n*S,$+=n*ie,C+=n*M,B+=n*K,z+=n*J,H+=n*N,X+=n*R,U+=n*V,L+=n*W,F+=n*ee,ne+=n*he,D+=n*fe,l+=n*Y,n=e[8],O+=n*E,T+=n*I,k+=n*g,$+=n*S,C+=n*ie,B+=n*M,z+=n*K,H+=n*J,X+=n*N,U+=n*R,L+=n*V,F+=n*W,ne+=n*ee,D+=n*he,l+=n*fe,v+=n*Y,n=e[9],T+=n*E,k+=n*I,$+=n*g,C+=n*S,B+=n*ie,z+=n*M,H+=n*K,X+=n*J,U+=n*N,L+=n*R,F+=n*V,ne+=n*W,D+=n*ee,l+=n*he,v+=n*fe,h+=n*Y,n=e[10],k+=n*E,$+=n*I,C+=n*g,B+=n*S,z+=n*ie,H+=n*M,X+=n*K,U+=n*J,L+=n*N,F+=n*R,ne+=n*V,D+=n*W,l+=n*ee,v+=n*he,h+=n*fe,c+=n*Y,n=e[11],$+=n*E,C+=n*I,B+=n*g,z+=n*S,H+=n*ie,X+=n*M,U+=n*K,L+=n*J,F+=n*N,ne+=n*R,D+=n*V,l+=n*W,v+=n*ee,h+=n*he,c+=n*fe,d+=n*Y,n=e[12],C+=n*E,B+=n*I,z+=n*g,H+=n*S,X+=n*ie,U+=n*M,L+=n*K,F+=n*J,ne+=n*N,D+=n*R,l+=n*V,v+=n*W,h+=n*ee,c+=n*he,d+=n*fe,y+=n*Y,n=e[13],B+=n*E,z+=n*I,H+=n*g,X+=n*S,U+=n*ie,L+=n*M,F+=n*K,ne+=n*J,D+=n*N,l+=n*R,v+=n*V,h+=n*W,c+=n*ee,d+=n*he,y+=n*fe,_+=n*Y,n=e[14],z+=n*E,H+=n*I,X+=n*g,U+=n*S,L+=n*ie,F+=n*M,ne+=n*K,D+=n*J,l+=n*N,v+=n*R,h+=n*V,c+=n*W,d+=n*ee,y+=n*he,_+=n*fe,w+=n*Y,n=e[15],H+=n*E,X+=n*I,U+=n*g,L+=n*S,F+=n*ie,ne+=n*M,D+=n*K,l+=n*J,v+=n*N,h+=n*R,c+=n*V,d+=n*W,y+=n*ee,_+=n*he,w+=n*fe,m+=n*Y,s+=38*X,a+=38*U,f+=38*L,u+=38*F,p+=38*ne,b+=38*D,x+=38*l,A+=38*v,O+=38*h,T+=38*c,k+=38*d,$+=38*y,C+=38*_,B+=38*w,z+=38*m,i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=A+i+65535,i=Math.floor(n/65536),A=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),i=1,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=f+i+65535,i=Math.floor(n/65536),f=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=b+i+65535,i=Math.floor(n/65536),b=n-i*65536,n=x+i+65535,i=Math.floor(n/65536),x=n-i*65536,n=A+i+65535,i=Math.floor(n/65536),A=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=T+i+65535,i=Math.floor(n/65536),T=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=$+i+65535,i=Math.floor(n/65536),$=n-i*65536,n=C+i+65535,i=Math.floor(n/65536),C=n-i*65536,n=B+i+65535,i=Math.floor(n/65536),B=n-i*65536,n=z+i+65535,i=Math.floor(n/65536),z=n-i*65536,n=H+i+65535,i=Math.floor(n/65536),H=n-i*65536,s+=i-1+37*(i-1),r[0]=s,r[1]=a,r[2]=f,r[3]=u,r[4]=p,r[5]=b,r[6]=x,r[7]=A,r[8]=O,r[9]=T,r[10]=k,r[11]=$,r[12]=C,r[13]=B,r[14]=z,r[15]=H}o(Si,"mul");function wf(r,e){Si(r,e,e)}o(wf,"square");function Z7(r,e){for(var t=ti(),n=0;n<16;n++)t[n]=e[n];for(var n=253;n>=0;n--)wf(t,t),n!==2&&n!==4&&Si(t,t,e);for(var n=0;n<16;n++)r[n]=t[n]}o(Z7,"inv25519");function Uh(r,e){for(var t=new Uint8Array(32),n=new Float64Array(80),i=ti(),s=ti(),a=ti(),f=ti(),u=ti(),p=ti(),b=0;b<31;b++)t[b]=r[b];t[31]=r[31]&127|64,t[0]&=248,X7(n,e);for(var b=0;b<16;b++)s[b]=n[b];i[0]=f[0]=1;for(var b=254;b>=0;--b){var x=t[b>>>3]>>>(b&7)&1;xf(i,s,x),xf(a,f,x),lu(u,i,a),du(i,i,a),lu(a,s,f),du(s,s,f),wf(f,u),wf(p,i),Si(i,a,i),Si(a,s,u),lu(u,i,a),du(i,i,a),wf(s,i),du(a,f,p),Si(i,a,Y7),lu(i,i,f),Si(a,a,i),Si(i,f,p),Si(f,s,n),wf(s,u),xf(i,s,x),xf(a,f,x)}for(var b=0;b<16;b++)n[b+16]=i[b],n[b+32]=a[b],n[b+48]=s[b],n[b+64]=f[b];var A=n.subarray(32),O=n.subarray(16);Z7(A,A),Si(O,O,A);var T=new Uint8Array(32);return J7(T,O),T}o(Uh,"scalarMult");Mr.scalarMult=Uh;function yg(r){return Uh(r,vg)}o(yg,"scalarMultBase");Mr.scalarMultBase=yg;function xg(r){if(r.length!==Mr.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+Mr.SECRET_KEY_LENGTH+" bytes");var e=new Uint8Array(r),t=yg(e);return{publicKey:t,secretKey:e}}o(xg,"generateKeyPairFromSeed");Mr.generateKeyPairFromSeed=xg;function Q7(r){var e=W7.randomBytes(32,r),t=xg(e);return G7.wipe(e),t}o(Q7,"generateKeyPair");Mr.generateKeyPair=Q7;function eE(r,e,t){if(t===void 0&&(t=!1),r.length!==Mr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==Mr.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var n=Uh(r,e);if(t){for(var i=0,s=0;s<n.length;s++)i|=n[s];if(i===0)throw new Error("X25519: invalid shared key")}return n}o(eE,"sharedKey");Mr.sharedKey=eE});var $h=me(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});var fr=jo(),Fh=tn(),tE=20;function rE(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,f=t[3]<<24|t[2]<<16|t[1]<<8|t[0],u=t[7]<<24|t[6]<<16|t[5]<<8|t[4],p=t[11]<<24|t[10]<<16|t[9]<<8|t[8],b=t[15]<<24|t[14]<<16|t[13]<<8|t[12],x=t[19]<<24|t[18]<<16|t[17]<<8|t[16],A=t[23]<<24|t[22]<<16|t[21]<<8|t[20],O=t[27]<<24|t[26]<<16|t[25]<<8|t[24],T=t[31]<<24|t[30]<<16|t[29]<<8|t[28],k=e[3]<<24|e[2]<<16|e[1]<<8|e[0],$=e[7]<<24|e[6]<<16|e[5]<<8|e[4],C=e[11]<<24|e[10]<<16|e[9]<<8|e[8],B=e[15]<<24|e[14]<<16|e[13]<<8|e[12],z=n,H=i,X=s,U=a,L=f,F=u,ne=p,D=b,l=x,v=A,h=O,c=T,d=k,y=$,_=C,w=B,m=0;m<tE;m+=2)z=z+L|0,d^=z,d=d>>>32-16|d<<16,l=l+d|0,L^=l,L=L>>>32-12|L<<12,H=H+F|0,y^=H,y=y>>>32-16|y<<16,v=v+y|0,F^=v,F=F>>>32-12|F<<12,X=X+ne|0,_^=X,_=_>>>32-16|_<<16,h=h+_|0,ne^=h,ne=ne>>>32-12|ne<<12,U=U+D|0,w^=U,w=w>>>32-16|w<<16,c=c+w|0,D^=c,D=D>>>32-12|D<<12,X=X+ne|0,_^=X,_=_>>>32-8|_<<8,h=h+_|0,ne^=h,ne=ne>>>32-7|ne<<7,U=U+D|0,w^=U,w=w>>>32-8|w<<8,c=c+w|0,D^=c,D=D>>>32-7|D<<7,H=H+F|0,y^=H,y=y>>>32-8|y<<8,v=v+y|0,F^=v,F=F>>>32-7|F<<7,z=z+L|0,d^=z,d=d>>>32-8|d<<8,l=l+d|0,L^=l,L=L>>>32-7|L<<7,z=z+F|0,w^=z,w=w>>>32-16|w<<16,h=h+w|0,F^=h,F=F>>>32-12|F<<12,H=H+ne|0,d^=H,d=d>>>32-16|d<<16,c=c+d|0,ne^=c,ne=ne>>>32-12|ne<<12,X=X+D|0,y^=X,y=y>>>32-16|y<<16,l=l+y|0,D^=l,D=D>>>32-12|D<<12,U=U+L|0,_^=U,_=_>>>32-16|_<<16,v=v+_|0,L^=v,L=L>>>32-12|L<<12,X=X+D|0,y^=X,y=y>>>32-8|y<<8,l=l+y|0,D^=l,D=D>>>32-7|D<<7,U=U+L|0,_^=U,_=_>>>32-8|_<<8,v=v+_|0,L^=v,L=L>>>32-7|L<<7,H=H+ne|0,d^=H,d=d>>>32-8|d<<8,c=c+d|0,ne^=c,ne=ne>>>32-7|ne<<7,z=z+F|0,w^=z,w=w>>>32-8|w<<8,h=h+w|0,F^=h,F=F>>>32-7|F<<7;fr.writeUint32LE(z+n|0,r,0),fr.writeUint32LE(H+i|0,r,4),fr.writeUint32LE(X+s|0,r,8),fr.writeUint32LE(U+a|0,r,12),fr.writeUint32LE(L+f|0,r,16),fr.writeUint32LE(F+u|0,r,20),fr.writeUint32LE(ne+p|0,r,24),fr.writeUint32LE(D+b|0,r,28),fr.writeUint32LE(l+x|0,r,32),fr.writeUint32LE(v+A|0,r,36),fr.writeUint32LE(h+O|0,r,40),fr.writeUint32LE(c+T|0,r,44),fr.writeUint32LE(d+k|0,r,48),fr.writeUint32LE(y+$|0,r,52),fr.writeUint32LE(_+C|0,r,56),fr.writeUint32LE(w+B|0,r,60)}o(rE,"core");function _g(r,e,t,n,i){if(i===void 0&&(i=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<t.length)throw new Error("ChaCha: destination is shorter than source");var s,a;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),a=s.length-e.length,s.set(e,a)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,a=i}for(var f=new Uint8Array(64),u=0;u<t.length;u+=64){rE(f,s,r);for(var p=u;p<u+64&&p<t.length;p++)n[p]=t[p]^f[p-u];iE(s,0,a)}return Fh.wipe(f),i===0&&Fh.wipe(s),n}o(_g,"streamXOR");hu.streamXOR=_g;function nE(r,e,t,n){return n===void 0&&(n=0),Fh.wipe(t),_g(r,e,t,t,n)}o(nE,"stream");hu.stream=nE;function iE(r,e,t){for(var n=1;t--;)n=n+(r[e]&255)|0,r[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}o(iE,"incrementCounter")});var Ag=me(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var io=jo(),Eg=tn(),oE=$h(),sE=20;function Sg(r,e,t,n){if(e.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var i=Mg(r,e.subarray(0,16),new Uint8Array(32)),s=new Uint8Array(12);s.set(e.subarray(16),4);var a=oE.streamXOR(i,s,t,n);return Eg.wipe(i),a}o(Sg,"streamXOR");_f.streamXOR=Sg;function aE(r,e,t){return Eg.wipe(t),Sg(r,e,t,t)}o(aE,"stream");_f.stream=aE;function Mg(r,e,t){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,f=r[3]<<24|r[2]<<16|r[1]<<8|r[0],u=r[7]<<24|r[6]<<16|r[5]<<8|r[4],p=r[11]<<24|r[10]<<16|r[9]<<8|r[8],b=r[15]<<24|r[14]<<16|r[13]<<8|r[12],x=r[19]<<24|r[18]<<16|r[17]<<8|r[16],A=r[23]<<24|r[22]<<16|r[21]<<8|r[20],O=r[27]<<24|r[26]<<16|r[25]<<8|r[24],T=r[31]<<24|r[30]<<16|r[29]<<8|r[28],k=e[3]<<24|e[2]<<16|e[1]<<8|e[0],$=e[7]<<24|e[6]<<16|e[5]<<8|e[4],C=e[11]<<24|e[10]<<16|e[9]<<8|e[8],B=e[15]<<24|e[14]<<16|e[13]<<8|e[12],z=n,H=i,X=s,U=a,L=f,F=u,ne=p,D=b,l=x,v=A,h=O,c=T,d=k,y=$,_=C,w=B,m=0;m<sE;m+=2)z=z+L|0,d^=z,d=d>>>32-16|d<<16,l=l+d|0,L^=l,L=L>>>32-12|L<<12,H=H+F|0,y^=H,y=y>>>32-16|y<<16,v=v+y|0,F^=v,F=F>>>32-12|F<<12,X=X+ne|0,_^=X,_=_>>>32-16|_<<16,h=h+_|0,ne^=h,ne=ne>>>32-12|ne<<12,U=U+D|0,w^=U,w=w>>>32-16|w<<16,c=c+w|0,D^=c,D=D>>>32-12|D<<12,X=X+ne|0,_^=X,_=_>>>32-8|_<<8,h=h+_|0,ne^=h,ne=ne>>>32-7|ne<<7,U=U+D|0,w^=U,w=w>>>32-8|w<<8,c=c+w|0,D^=c,D=D>>>32-7|D<<7,H=H+F|0,y^=H,y=y>>>32-8|y<<8,v=v+y|0,F^=v,F=F>>>32-7|F<<7,z=z+L|0,d^=z,d=d>>>32-8|d<<8,l=l+d|0,L^=l,L=L>>>32-7|L<<7,z=z+F|0,w^=z,w=w>>>32-16|w<<16,h=h+w|0,F^=h,F=F>>>32-12|F<<12,H=H+ne|0,d^=H,d=d>>>32-16|d<<16,c=c+d|0,ne^=c,ne=ne>>>32-12|ne<<12,X=X+D|0,y^=X,y=y>>>32-16|y<<16,l=l+y|0,D^=l,D=D>>>32-12|D<<12,U=U+L|0,_^=U,_=_>>>32-16|_<<16,v=v+_|0,L^=v,L=L>>>32-12|L<<12,X=X+D|0,y^=X,y=y>>>32-8|y<<8,l=l+y|0,D^=l,D=D>>>32-7|D<<7,U=U+L|0,_^=U,_=_>>>32-8|_<<8,v=v+_|0,L^=v,L=L>>>32-7|L<<7,H=H+ne|0,d^=H,d=d>>>32-8|d<<8,c=c+d|0,ne^=c,ne=ne>>>32-7|ne<<7,z=z+F|0,w^=z,w=w>>>32-8|w<<8,h=h+w|0,F^=h,F=F>>>32-7|F<<7;return io.writeUint32LE(z,t,0),io.writeUint32LE(H,t,4),io.writeUint32LE(X,t,8),io.writeUint32LE(U,t,12),io.writeUint32LE(d,t,16),io.writeUint32LE(y,t,20),io.writeUint32LE(_,t,24),io.writeUint32LE(w,t,28),t}o(Mg,"hchacha");_f.hchacha=Mg});var qh=me(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});function fE(r,e,t){return~(r-1)&e|r-1&t}o(fE,"select");ua.select=fE;function cE(r,e){return(r|0)-(e|0)-1>>>31&1}o(cE,"lessOrEqual");ua.lessOrEqual=cE;function Tg(r,e){if(r.length!==e.length)return 0;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return 1&t-1>>>8}o(Tg,"compare");ua.compare=Tg;function uE(r,e){return r.length===0||e.length===0?!1:Tg(r,e)!==0}o(uE,"equal");ua.equal=uE});var Cg=me(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var lE=qh(),pu=tn();Mi.DIGEST_LENGTH=16;var kg=function(){function r(e){this.digestLength=Mi.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var t=e[0]|e[1]<<8;this._r[0]=t&8191;var n=e[2]|e[3]<<8;this._r[1]=(t>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var s=e[6]|e[7]<<8;this._r[3]=(i>>>7|s<<9)&8191;var a=e[8]|e[9]<<8;this._r[4]=(s>>>4|a<<12)&255,this._r[5]=a>>>1&8190;var f=e[10]|e[11]<<8;this._r[6]=(a>>>14|f<<2)&8191;var u=e[12]|e[13]<<8;this._r[7]=(f>>>11|u<<5)&8065;var p=e[14]|e[15]<<8;this._r[8]=(u>>>8|p<<8)&8191,this._r[9]=p>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return o(r,"Poly1305"),r.prototype._blocks=function(e,t,n){for(var i=this._fin?0:2048,s=this._h[0],a=this._h[1],f=this._h[2],u=this._h[3],p=this._h[4],b=this._h[5],x=this._h[6],A=this._h[7],O=this._h[8],T=this._h[9],k=this._r[0],$=this._r[1],C=this._r[2],B=this._r[3],z=this._r[4],H=this._r[5],X=this._r[6],U=this._r[7],L=this._r[8],F=this._r[9];n>=16;){var ne=e[t+0]|e[t+1]<<8;s+=ne&8191;var D=e[t+2]|e[t+3]<<8;a+=(ne>>>13|D<<3)&8191;var l=e[t+4]|e[t+5]<<8;f+=(D>>>10|l<<6)&8191;var v=e[t+6]|e[t+7]<<8;u+=(l>>>7|v<<9)&8191;var h=e[t+8]|e[t+9]<<8;p+=(v>>>4|h<<12)&8191,b+=h>>>1&8191;var c=e[t+10]|e[t+11]<<8;x+=(h>>>14|c<<2)&8191;var d=e[t+12]|e[t+13]<<8;A+=(c>>>11|d<<5)&8191;var y=e[t+14]|e[t+15]<<8;O+=(d>>>8|y<<8)&8191,T+=y>>>5|i;var _=0,w=_;w+=s*k,w+=a*(5*F),w+=f*(5*L),w+=u*(5*U),w+=p*(5*X),_=w>>>13,w&=8191,w+=b*(5*H),w+=x*(5*z),w+=A*(5*B),w+=O*(5*C),w+=T*(5*$),_+=w>>>13,w&=8191;var m=_;m+=s*$,m+=a*k,m+=f*(5*F),m+=u*(5*L),m+=p*(5*U),_=m>>>13,m&=8191,m+=b*(5*X),m+=x*(5*H),m+=A*(5*z),m+=O*(5*B),m+=T*(5*C),_+=m>>>13,m&=8191;var E=_;E+=s*C,E+=a*$,E+=f*k,E+=u*(5*F),E+=p*(5*L),_=E>>>13,E&=8191,E+=b*(5*U),E+=x*(5*X),E+=A*(5*H),E+=O*(5*z),E+=T*(5*B),_+=E>>>13,E&=8191;var I=_;I+=s*B,I+=a*C,I+=f*$,I+=u*k,I+=p*(5*F),_=I>>>13,I&=8191,I+=b*(5*L),I+=x*(5*U),I+=A*(5*X),I+=O*(5*H),I+=T*(5*z),_+=I>>>13,I&=8191;var g=_;g+=s*z,g+=a*B,g+=f*C,g+=u*$,g+=p*k,_=g>>>13,g&=8191,g+=b*(5*F),g+=x*(5*L),g+=A*(5*U),g+=O*(5*X),g+=T*(5*H),_+=g>>>13,g&=8191;var S=_;S+=s*H,S+=a*z,S+=f*B,S+=u*C,S+=p*$,_=S>>>13,S&=8191,S+=b*k,S+=x*(5*F),S+=A*(5*L),S+=O*(5*U),S+=T*(5*X),_+=S>>>13,S&=8191;var ie=_;ie+=s*X,ie+=a*H,ie+=f*z,ie+=u*B,ie+=p*C,_=ie>>>13,ie&=8191,ie+=b*$,ie+=x*k,ie+=A*(5*F),ie+=O*(5*L),ie+=T*(5*U),_+=ie>>>13,ie&=8191;var M=_;M+=s*U,M+=a*X,M+=f*H,M+=u*z,M+=p*B,_=M>>>13,M&=8191,M+=b*C,M+=x*$,M+=A*k,M+=O*(5*F),M+=T*(5*L),_+=M>>>13,M&=8191;var K=_;K+=s*L,K+=a*U,K+=f*X,K+=u*H,K+=p*z,_=K>>>13,K&=8191,K+=b*B,K+=x*C,K+=A*$,K+=O*k,K+=T*(5*F),_+=K>>>13,K&=8191;var J=_;J+=s*F,J+=a*L,J+=f*U,J+=u*X,J+=p*H,_=J>>>13,J&=8191,J+=b*z,J+=x*B,J+=A*C,J+=O*$,J+=T*k,_+=J>>>13,J&=8191,_=(_<<2)+_|0,_=_+w|0,w=_&8191,_=_>>>13,m+=_,s=w,a=m,f=E,u=I,p=g,b=S,x=ie,A=M,O=K,T=J,t+=16,n-=16}this._h[0]=s,this._h[1]=a,this._h[2]=f,this._h[3]=u,this._h[4]=p,this._h[5]=b,this._h[6]=x,this._h[7]=A,this._h[8]=O,this._h[9]=T},r.prototype.finish=function(e,t){t===void 0&&(t=0);var n=new Uint16Array(10),i,s,a,f;if(this._leftover){for(f=this._leftover,this._buffer[f++]=1;f<16;f++)this._buffer[f]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,f=2;f<10;f++)this._h[f]+=i,i=this._h[f]>>>13,this._h[f]&=8191;for(this._h[0]+=i*5,i=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=i,i=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=i,n[0]=this._h[0]+5,i=n[0]>>>13,n[0]&=8191,f=1;f<10;f++)n[f]=this._h[f]+i,i=n[f]>>>13,n[f]&=8191;for(n[9]-=1<<13,s=(i^1)-1,f=0;f<10;f++)n[f]&=s;for(s=~s,f=0;f<10;f++)this._h[f]=this._h[f]&s|n[f];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,a=this._h[0]+this._pad[0],this._h[0]=a&65535,f=1;f<8;f++)a=(this._h[f]+this._pad[f]|0)+(a>>>16)|0,this._h[f]=a&65535;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},r.prototype.update=function(e){var t=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var s=0;s<i;s++)this._buffer[this._leftover+s]=e[t+s];if(n-=i,t+=i,this._leftover+=i,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(i=n-n%16,this._blocks(e,t,i),t+=i,n-=i),n){for(var s=0;s<n;s++)this._buffer[this._leftover+s]=e[t+s];this._leftover+=n}return this},r.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},r.prototype.clean=function(){return pu.wipe(this._buffer),pu.wipe(this._r),pu.wipe(this._h),pu.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},r}();Mi.Poly1305=kg;function dE(r,e){var t=new kg(r);t.update(e);var n=t.digest();return t.clean(),n}o(dE,"oneTimeAuth");Mi.oneTimeAuth=dE;function hE(r,e){return r.length!==Mi.DIGEST_LENGTH||e.length!==Mi.DIGEST_LENGTH?!1:lE.equal(r,e)}o(hE,"equal");Mi.equal=hE});var Og=me(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});var mu=$h(),pE=Cg(),Ef=tn(),Dg=jo(),mE=qh();Ai.KEY_LENGTH=32;Ai.NONCE_LENGTH=12;Ai.TAG_LENGTH=16;var Ig=new Uint8Array(16),bE=function(){function r(e){if(this.nonceLength=Ai.NONCE_LENGTH,this.tagLength=Ai.TAG_LENGTH,e.length!==Ai.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(r,"ChaCha20Poly1305"),r.prototype.seal=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);mu.stream(this._key,s,a,4);var f=t.length+this.tagLength,u;if(i){if(i.length!==f)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(f);return mu.streamXOR(this._key,s,t,u,4),this._authenticate(u.subarray(u.length-this.tagLength,u.length),a,u.subarray(0,u.length-this.tagLength),n),Ef.wipe(s),u},r.prototype.open=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);mu.stream(this._key,s,a,4);var f=new Uint8Array(this.tagLength);if(this._authenticate(f,a,t.subarray(0,t.length-this.tagLength),n),!mE.equal(f,t.subarray(t.length-this.tagLength,t.length)))return null;var u=t.length-this.tagLength,p;if(i){if(i.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");p=i}else p=new Uint8Array(u);return mu.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),p,4),Ef.wipe(s),p},r.prototype.clean=function(){return Ef.wipe(this._key),this},r.prototype._authenticate=function(e,t,n,i){var s=new pE.Poly1305(t);i&&(s.update(i),i.length%16>0&&s.update(Ig.subarray(i.length%16))),s.update(n),n.length%16>0&&s.update(Ig.subarray(n.length%16));var a=new Uint8Array(8);i&&Dg.writeUint64LE(i.length,a),s.update(a),Dg.writeUint64LE(n.length,a),s.update(a);for(var f=s.digest(),u=0;u<f.length;u++)e[u]=f[u];s.clean(),Ef.wipe(f),Ef.wipe(a)},r}();Ai.ChaCha20Poly1305=bE});var Rg=me(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var Pg=Ag(),Ng=Og(),Sf=tn();Ti.KEY_LENGTH=32;Ti.NONCE_LENGTH=24;Ti.TAG_LENGTH=16;var gE=function(){function r(e){if(this.nonceLength=Ti.NONCE_LENGTH,this.tagLength=Ti.TAG_LENGTH,e.length!==Ti.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return o(r,"XChaCha20Poly1305"),r.prototype.seal=function(e,t,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");var s=Pg.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Ng.ChaCha20Poly1305(s),u=f.seal(a,t,n,i);return Sf.wipe(s),Sf.wipe(a),f.clean(),u},r.prototype.open=function(e,t,n,i){if(e.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=Pg.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),a=new Uint8Array(12);a.set(e.subarray(16),4);var f=new Ng.ChaCha20Poly1305(s),u=f.open(a,t,n,i);return Sf.wipe(s),Sf.wipe(a),f.clean(),u},r.prototype.clean=function(){return Sf.wipe(this._key),this},r}();Ti.XChaCha20Poly1305=gE});var Tn=me((_L,E2)=>{E2.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}});var Nf=me((EL,S2)=>{S2.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}});var T2=me(tr=>{var M2=tr,Nu=4294967292,Ru=4294967293,h0=4294967294,A2=4294967295,xe=[0,1,3,7,15,31,63,127,255,511,1023],fo=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],BS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),Br=[];BS.forEach(r=>{Br.push(r.charCodeAt(0))});tr.utf8={encode(r){let e=[];return r.forEach(t=>{if(t>=0&&t<=127)e.push(t);else if(t<=2047)e.push(192+(t>>6&xe[5])),e.push(128+(t&xe[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&xe[4])),e.push(128+(t>>6&xe[6])),e.push(128+(t&xe[6]));else if(t>=65536&&t<=1114111){let n=t>>16&xe[5];e.push(240+(n>>2)),e.push(128+((n&xe[2])<<4)+(t>>12&xe[4])),e.push(128+(t>>6&xe[6])),e.push(128+(t&xe[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Buffer.from(e)},decode(r,e){function t(T,k){if((k&192)!==128)return Ru;let $=((T&xe[5])<<6)+(k&xe[6]);return $<128?Nu:$}o(t,"bytes2");function n(T,k,$){if(($&192)!==128||(k&192)!==128)return Ru;let C=((T&xe[4])<<12)+((k&xe[6])<<6)+($&xe[6]);return C<2048?Nu:C>=55296&&C<=57343?h0:C}o(n,"bytes3");function i(T,k,$,C){if((C&192)!==128||($&192)!==128||(k&192)!==128)return Ru;let B=(((T&xe[3])<<2)+(k>>4&xe[2])<<16)+((k&xe[4])<<12)+(($&xe[6])<<6)+(C&xe[6]);return B<65536?Nu:B>1114111?h0:B}o(i,"bytes4");let s,a,f,u,p,b,x=r.length,A=e?3:0,O=[];for(;A<x;){a=r[A],s=A2;let T=!0;for(;T;){if(a>=0&&a<=127){s=a,b=1;break}if(f=A+1,f<x&&a>=194&&a<=223){s=t(a,r[f]),b=2;break}if(u=A+2,u<x&&a>=224&&a<=239){s=n(a,r[f],r[u]),b=3;break}if(p=A+3,p<x&&a>=240&&a<=244){s=i(a,r[f],r[u],r[p]),b=4;break}break}if(s>1114111){let k=`byte[${A}]`;throw s===A2?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${k}`):s===Ru?new RangeError(`utf8.decode: illegal trailing byte found at: ${k}`):s===h0?new RangeError(`utf8.decode: code point out of range found at: ${k}`):s===Nu?new RangeError(`utf8.decode: non-shortest form found at: ${k}`):new RangeError(`utf8.decode: unrecognized error found at: ${k}`)}O.push(s),A+=b}return O}};tr.utf16be={encode(r){let e=[],t,n,i;for(let s=0;s<r.length;s+=1)if(t=r[s],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t>>8&xe[8]),e.push(t&xe[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&xe[10]),e.push(n>>8&xe[8]),e.push(n&xe[8]),e.push(i>>8&xe[8]),e.push(i&xe[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${s}]: ${t}`);return Buffer.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,i=e?2:0,s=0,a,f,u,p,b,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(b=(r[i]<<8)+r[u],b<55296||b>57343){a=b,f=2;break}if(p=i+3,p<n&&(x=(r[i+2]<<8)+r[p],b<=56319&&x>=56320&&x<=57343)){a=65536+(b-55296<<10)+(x-56320),f=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${i}]`)}t[s++]=a,i+=f}return t}};tr.utf16le={encode(r){let e=[],t,n,i;for(let s=0;s<r.length;s+=1)if(t=r[s],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t&xe[8]),e.push(t>>8&xe[8]);else if(t>=65536&&t<=1114111)i=t-65536,n=55296+(i>>10),i=56320+(i&xe[10]),e.push(n&xe[8]),e.push(n>>8&xe[8]),e.push(i&xe[8]),e.push(i>>8&xe[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${s}]: ${t}`);return Buffer.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,i=e?2:0,s=0,a,f,u,p,b,x;for(;i<n;){for(;;){if(u=i+1,u<n){if(b=(r[u]<<8)+r[i],b<55296||b>57343){a=b,f=2;break}if(p=i+3,p<n&&(x=(r[p]<<8)+r[i+2],b<=56319&&x>=56320&&x<=57343)){a=65536+(b-55296<<10)+(x-56320),f=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${i}]`)}t[s++]=a,i+=f}return t}};tr.utf32be={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${t/4}]: ${n}`);e[t++]=n>>24&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let i=(r[n]<<24)+(r[n+1]<<16)+(r[n+2]<<8)+r[n+3];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${i}`);t.push(i)}return t}};tr.utf32le={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${t/4}]: ${n}`);e[t++]=n&xe[8],e[t++]=n>>8&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>24&xe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let i=(r[n+3]<<24)+(r[n+2]<<16)+(r[n+1]<<8)+r[n];if(i>=55296&&i<=57343||i>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${i}`);t.push(i)}return t}};tr.uint7={encode(r){let e=Buffer.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${t}]: ${r[t]}`);e[t]=r[t]}return e}};tr.uint8={encode(r){let e=Buffer.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1)e[t]=r[t];return e}};tr.uint16be={encode(r){let e=Buffer.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${t/2}]: ${n}`);e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t]<<8)+r[t+1]);return e}};tr.uint16le={encode(r){let e=Buffer.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${t/2}]: ${n}`);e[t++]=n&xe[8],e[t++]=n>>8&xe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t+1]<<8)+r[t]);return e}};tr.uint32be={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>8&xe[8],e[t++]=n&xe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3]);return e}};tr.uint32le={encode(r){let e=Buffer.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&xe[8],e[t++]=n>>8&xe[8],e[t++]=n>>16&xe[8],e[t++]=n>>24&xe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t+3]<<24)+(r[t+2]<<16)+(r[t+1]<<8)+r[t]);return e}};tr.string={encode(r){return M2.utf16le.encode(r).toString("utf16le")},decode(r){return M2.utf16le.decode(Buffer.from(r,"utf16le"),0)}};tr.escaped={encode(r){let e=[];for(let t=0;t<r.length;t+=1){let n=r[t];if(n===96)e.push(n),e.push(n);else if(n===10)e.push(n);else if(n>=32&&n<=126)e.push(n);else{let i="";if(n>=0&&n<=31)i+=`\`x${fo[n]}`;else if(n>=127&&n<=255)i+=`\`x${fo[n]}`;else if(n>=256&&n<=65535)i+=`\`u${fo[n>>8&xe[8]]}${fo[n&xe[8]]}`;else if(n>=65536&&n<=4294967295){i+="`u{";let a=n>>24&xe[8];a>0&&(i+=fo[a]),i+=`${fo[n>>16&xe[8]]+fo[n>>8&xe[8]]+fo[n&xe[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Buffer.from(i).forEach(a=>{e.push(a)})}}return Buffer.from(e)},decode(r){function e(x){return x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102}o(e,"isHex");function t(x,A,O){let T={char:null,nexti:x+2,error:!0};if(x+1<A&&e(O[x])&&e(O[x+1])){let k=String.fromCodePoint(O[x],O[x+1]);T.char=parseInt(k,16),Number.isNaN(T.char)||(T.error=!1)}return T}o(t,"getx");function n(x,A,O){let T={char:null,nexti:x+4,error:!0};if(x+3<A&&e(O[x])&&e(O[x+1])&&e(O[x+2])&&e(O[x+3])){let k=String.fromCodePoint(O[x],O[x+1],O[x+2],O[x+3]);T.char=parseInt(k,16),Number.isNaN(T.char)||(T.error=!1)}return T}o(n,"getu");function i(x,A,O){let T={char:null,nexti:x+4,error:!0},k="";for(;x<A&&e(O[x]);)k+=String.fromCodePoint(O[x]),x+=1;return T.char=parseInt(k,16),O[x]===125&&!Number.isNaN(T.char)&&(T.error=!1),T.nexti=x+1,T}o(i,"getU");let s=[],a=r.length,f,u,p,b=0;for(;b<a;){for(;;){if(p=!0,r[b]!==96){s.push(r[b]),b+=1,p=!1;break}if(f=b+1,f>=a)break;if(r[f]===96){s.push(96),b+=2,p=!1;break}if(r[f]===120){if(u=t(f+1,a,r),u.error)break;s.push(u.char),b=u.nexti,p=!1;break}if(r[f]===117){if(r[f+1]===123){if(u=i(f+2,a,r),u.error)break;s.push(u.char),b=u.nexti,p=!1;break}if(u=n(f+1,a,r),u.error)break;s.push(u.char),b=u.nexti,p=!1;break}break}if(p)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${b}]`)}return s}};var Rf=13,cn=10;tr.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Rf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(Rf),e.push(cn);break;case cn:e.push(Rf),e.push(cn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==cn&&(e.push(Rf),e.push(cn)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Rf:t+1<r.length&&r[t+1]===cn?t+=2:t+=1,e.push(cn);break;case cn:e.push(cn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==cn&&e.push(cn),e}};tr.base64={encode(r){if(r.length===0)return Buffer.alloc(0);let e,t,n,i=r.length%3;i=i>0?3-i:0;let s=(r.length+i)/3,a=Buffer.alloc(s*4);i>0&&(s-=1),e=0,t=0;for(let f=0;f<s;f+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[n>>6&xe[6]],a[t++]=Br[n&xe[6]];if(i===0)return a;if(i===1)return n=r[e++]<<16,n+=r[e]<<8,a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[n>>6&xe[6]],a[t]=Br[64],a;if(i===2)return n=r[e]<<16,a[t++]=Br[n>>18&xe[6]],a[t++]=Br[n>>12&xe[6]],a[t++]=Br[64],a[t]=Br[64],a},decode(r){function e(b){let x=[],A=0;for(let O=0;O<b.length;O+=1){let T=b[O],k=!0;for(;k&&!(T===32||T===9||T===10||T===13);){if(T>=65&&T<=90){x.push(T-65);break}if(T>=97&&T<=122){x.push(T-71);break}if(T>=48&&T<=57){x.push(T+4);break}if(T===43){x.push(62);break}if(T===47){x.push(63);break}if(T===61){x.push(64),A+=1;break}throw new RangeError(`base64.decode: invalid character buf[${O}]: ${T}`)}}if(x.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${x.length}`);switch(A){case 0:break;case 1:if(x[x.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(x[x.length-1]!==64||x[x.length-2]!==64)throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${A}`)}return{tail:A,buf:Buffer.from(x)}}if(o(e,"validate"),r.length===0)return Buffer.alloc(0);let t=e(r),{tail:n}=t,i=t.buf,s,a,f,u=i.length/4,p=Buffer.alloc(u*3-n);n>0&&(u-=1),a=0,s=0;for(let b=0;b<u;b+=1)f=i[s++]<<18,f+=i[s++]<<12,f+=i[s++]<<6,f+=i[s++],p[a++]=f>>16&xe[8],p[a++]=f>>8&xe[8],p[a++]=f&xe[8];return n===1&&(f=i[s++]<<18,f+=i[s++]<<12,f+=i[s]<<6,p[a++]=f>>16&xe[8],p[a]=f>>8&xe[8]),n===2&&(f=i[s++]<<18,f+=i[s++]<<12,p[a]=f>>16&xe[8]),p},toString(r){if(r.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${r.length}`);let e="",t=0;function n(s,a,f,u){switch(t){case 76:e+=`\r
16
16
  ${s}${a}${f}${u}`,t=4;break;case 75:e+=`${s}\r
17
17
  ${a}${f}${u}`,t=3;break;case 74:e+=`${s+a}\r
18
18
  ${f}${u}`,t=2;break;case 73:e+=`${s+a+f}\r
19
- ${u}`,t=1;break;default:e+=s+a+f+u,t+=4;break}}o(n,"buildLine");function i(s){return s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===43||s===47||s===61}o(i,"validate");for(let s=0;s<r.length;s+=4){for(let a=s;a<s+4;a+=1)if(!i(r[a]))throw new RangeError(`base64.toString: buf[${a}]: ${r[a]} : not valid base64 character code`);n(String.fromCharCode(r[s]),String.fromCharCode(r[s+1]),String.fromCharCode(r[s+2]),String.fromCharCode(r[s+3]))}return e}}});var g0=me(Bf=>{var M2=Bf,dt=S2(),Lf="UTF8",m0="UTF16",ni="UTF16BE",Di="UTF16LE",b0="UTF32",ii="UTF32BE",Ii="UTF32LE",va="UINT7",A2="ASCII",T2="BINARY",ya="UINT8",k2="UINT16",Lu="UINT16LE",xa="UINT16BE",C2="UINT32",Bu="UINT32LE",wa="UINT32BE",Uu="ESCAPED",co="STRING",FS=o(function(e){e.type=Lf;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),$S=o(function(e){let t=e.data;switch(e.bom=0,e.type){case m0:e.type=ni,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=Di,e.bom=2));break;case ni:if(e.type=ni,t.length>=2){if(t[0]===254&&t[1]===255)e.bom=2;else if(t[0]===255&&t[1]===254)throw new TypeError(`src type: "${ni}" specified but BOM is for "${Di}"`)}break;case Di:if(e.type=Di,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${Di}" specified but BOM is for "${ni}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),qS=o(function(e){let t=e.data;switch(e.bom=0,e.type){case b0:e.type=ii,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.type=Ii,e.bom=4));break;case ii:if(e.type=ii,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0))throw new TypeError(`src type: ${ii} specified but BOM is for ${Ii}"`);break;case Ii:if(e.type=Ii,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${Ii}" specified but BOM is for "${ii}"`);t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},"bom32"),HS=o(function(e,t){function n(s){let a={type:"",base64:!1},u=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(s);return u&&(u[2]&&(a.type=u[2].toUpperCase()),u[1]&&(a.base64=!0)),a}if(o(n,"getType"),typeof e!="string"||e==="")throw new TypeError(`type: "${e}" not recognized`);let i=n(e.toUpperCase());if(i.base64){if(i.type===co)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${co}`);if(Buffer.isBuffer(t))i.data=dt.base64.decode(t);else if(typeof t=="string"){let s=Buffer.from(t,"ascii");i.data=dt.base64.decode(s)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else i.data=t;switch(i.type){case Lf:FS(i);break;case m0:case ni:case Di:$S(i);break;case b0:case ii:case Ii:qS(i);break;case k2:i.type=xa;break;case C2:i.type=wa;break;case A2:i.type=va;break;case T2:i.type=ya;break;case va:case ya:case Lu:case xa:case Bu:case wa:case co:case Uu:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===co){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Buffer.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),zS=o(function(e,t){function n(s){let a,f,u={crlf:!1,lf:!1,base64:!1,type:""},p=!0;for(;p;){if(f=s,a=s.slice(0,5),a==="CRLF:"){u.crlf=!0,f=s.slice(5);break}if(a=s.slice(0,3),a==="LF:"){u.lf=!0,f=s.slice(3);break}break}return a=f.split(":"),a.length===1?u.type=a[0]:a.length===2&&a[1]==="BASE64"&&(u.base64=!0,u.type=a[0]),u}if(o(n,"getType"),!Array.isArray(t))throw new TypeError(`dst chars: not array: "${typeof t}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let i=n(e.toUpperCase());switch(i.type){case Lf:case ni:case Di:case ii:case Ii:case va:case ya:case Lu:case xa:case Bu:case wa:case Uu:break;case co:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${co}`);break;case A2:i.type=va;break;case T2:i.type=ya;break;case m0:i.type=ni;break;case b0:i.type=ii;break;case k2:i.type=xa;break;case C2:i.type=wa;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),p0=o(function(e,t){switch(e){case Lf:return dt.utf8.encode(t);case ni:return dt.utf16be.encode(t);case Di:return dt.utf16le.encode(t);case ii:return dt.utf32be.encode(t);case Ii:return dt.utf32le.encode(t);case va:return dt.uint7.encode(t);case ya:return dt.uint8.encode(t);case xa:return dt.uint16be.encode(t);case Lu:return dt.uint16le.encode(t);case wa:return dt.uint32be.encode(t);case Bu:return dt.uint32le.encode(t);case co:return dt.string.encode(t);case Uu:return dt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),jS=o(function(e){switch(e.type){case Lf:return dt.utf8.decode(e.data,e.bom);case Di:return dt.utf16le.decode(e.data,e.bom);case ni:return dt.utf16be.decode(e.data,e.bom);case ii:return dt.utf32be.decode(e.data,e.bom);case Ii:return dt.utf32le.decode(e.data,e.bom);case va:return dt.uint7.decode(e.data);case ya:return dt.uint8.decode(e.data);case xa:return dt.uint16be.decode(e.data);case Lu:return dt.uint16le.decode(e.data);case wa:return dt.uint32be.decode(e.data);case Bu:return dt.uint32le.decode(e.data);case co:return dt.string.decode(e.data);case Uu:return dt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Bf.decode=o(function(e,t){let n=HS(e,t);return jS(n)},"exportsDecode");Bf.encode=o(function(e,t){let n,i,s=zS(e,t);return s.crlf?(n=dt.lineEnds.crlf(t),i=p0(s.type,n)):s.lf?(n=dt.lineEnds.lf(t),i=p0(s.type,n)):i=p0(s.type,t),s.base64&&(i=dt.base64.encode(i)),i},"exportsEncode");Bf.convert=o(function(e,t,n){return M2.encode(n,M2.decode(e,t))},"convert")});var v0=me((ML,D2)=>{D2.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
19
+ ${u}`,t=1;break;default:e+=s+a+f+u,t+=4;break}}o(n,"buildLine");function i(s){return s>=65&&s<=90||s>=97&&s<=122||s>=48&&s<=57||s===43||s===47||s===61}o(i,"validate");for(let s=0;s<r.length;s+=4){for(let a=s;a<s+4;a+=1)if(!i(r[a]))throw new RangeError(`base64.toString: buf[${a}]: ${r[a]} : not valid base64 character code`);n(String.fromCharCode(r[s]),String.fromCharCode(r[s+1]),String.fromCharCode(r[s+2]),String.fromCharCode(r[s+3]))}return e}}});var g0=me(Bf=>{var k2=Bf,dt=T2(),Lf="UTF8",m0="UTF16",ni="UTF16BE",Di="UTF16LE",b0="UTF32",ii="UTF32BE",Ii="UTF32LE",ya="UINT7",C2="ASCII",D2="BINARY",xa="UINT8",I2="UINT16",Lu="UINT16LE",wa="UINT16BE",O2="UINT32",Bu="UINT32LE",_a="UINT32BE",Uu="ESCAPED",co="STRING",US=o(function(e){e.type=Lf;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},"bom8"),FS=o(function(e){let t=e.data;switch(e.bom=0,e.type){case m0:e.type=ni,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=Di,e.bom=2));break;case ni:if(e.type=ni,t.length>=2){if(t[0]===254&&t[1]===255)e.bom=2;else if(t[0]===255&&t[1]===254)throw new TypeError(`src type: "${ni}" specified but BOM is for "${Di}"`)}break;case Di:if(e.type=Di,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${Di}" specified but BOM is for "${ni}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},"bom16"),$S=o(function(e){let t=e.data;switch(e.bom=0,e.type){case b0:e.type=ii,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.type=Ii,e.bom=4));break;case ii:if(e.type=ii,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0))throw new TypeError(`src type: ${ii} specified but BOM is for ${Ii}"`);break;case Ii:if(e.type=Ii,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${Ii}" specified but BOM is for "${ii}"`);t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},"bom32"),qS=o(function(e,t){function n(s){let a={type:"",base64:!1},u=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(s);return u&&(u[2]&&(a.type=u[2].toUpperCase()),u[1]&&(a.base64=!0)),a}if(o(n,"getType"),typeof e!="string"||e==="")throw new TypeError(`type: "${e}" not recognized`);let i=n(e.toUpperCase());if(i.base64){if(i.type===co)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${co}`);if(Buffer.isBuffer(t))i.data=dt.base64.decode(t);else if(typeof t=="string"){let s=Buffer.from(t,"ascii");i.data=dt.base64.decode(s)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else i.data=t;switch(i.type){case Lf:US(i);break;case m0:case ni:case Di:FS(i);break;case b0:case ii:case Ii:$S(i);break;case I2:i.type=wa;break;case O2:i.type=_a;break;case C2:i.type=ya;break;case D2:i.type=xa;break;case ya:case xa:case Lu:case wa:case Bu:case _a:case co:case Uu:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(i.type===co){if(typeof i.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Buffer.isBuffer(i.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return i},"validateSrc"),HS=o(function(e,t){function n(s){let a,f,u={crlf:!1,lf:!1,base64:!1,type:""},p=!0;for(;p;){if(f=s,a=s.slice(0,5),a==="CRLF:"){u.crlf=!0,f=s.slice(5);break}if(a=s.slice(0,3),a==="LF:"){u.lf=!0,f=s.slice(3);break}break}return a=f.split(":"),a.length===1?u.type=a[0]:a.length===2&&a[1]==="BASE64"&&(u.base64=!0,u.type=a[0]),u}if(o(n,"getType"),!Array.isArray(t))throw new TypeError(`dst chars: not array: "${typeof t}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let i=n(e.toUpperCase());switch(i.type){case Lf:case ni:case Di:case ii:case Ii:case ya:case xa:case Lu:case wa:case Bu:case _a:case Uu:break;case co:if(i.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${co}`);break;case C2:i.type=ya;break;case D2:i.type=xa;break;case m0:i.type=ni;break;case b0:i.type=ii;break;case I2:i.type=wa;break;case O2:i.type=_a;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return i},"validateDst"),p0=o(function(e,t){switch(e){case Lf:return dt.utf8.encode(t);case ni:return dt.utf16be.encode(t);case Di:return dt.utf16le.encode(t);case ii:return dt.utf32be.encode(t);case Ii:return dt.utf32le.encode(t);case ya:return dt.uint7.encode(t);case xa:return dt.uint8.encode(t);case wa:return dt.uint16be.encode(t);case Lu:return dt.uint16le.encode(t);case _a:return dt.uint32be.encode(t);case Bu:return dt.uint32le.encode(t);case co:return dt.string.encode(t);case Uu:return dt.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},"encode"),zS=o(function(e){switch(e.type){case Lf:return dt.utf8.decode(e.data,e.bom);case Di:return dt.utf16le.decode(e.data,e.bom);case ni:return dt.utf16be.decode(e.data,e.bom);case ii:return dt.utf32be.decode(e.data,e.bom);case Ii:return dt.utf32le.decode(e.data,e.bom);case ya:return dt.uint7.decode(e.data);case xa:return dt.uint8.decode(e.data);case wa:return dt.uint16be.decode(e.data);case Lu:return dt.uint16le.decode(e.data);case _a:return dt.uint32be.decode(e.data);case Bu:return dt.uint32le.decode(e.data);case co:return dt.string.decode(e.data);case Uu:return dt.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}},"decode");Bf.decode=o(function(e,t){let n=qS(e,t);return zS(n)},"exportsDecode");Bf.encode=o(function(e,t){let n,i,s=HS(e,t);return s.crlf?(n=dt.lineEnds.crlf(t),i=p0(s.type,n)):s.lf?(n=dt.lineEnds.lf(t),i=p0(s.type,n)):i=p0(s.type,t),s.base64&&(i=dt.base64.encode(i)),i},"exportsEncode");Bf.convert=o(function(e,t,n){return k2.encode(n,k2.decode(e,t))},"convert")});var v0=me((AL,P2)=>{P2.exports=o(function(){return`/* This file automatically generated by jsonToless() and LESS. */
20
20
  .apg-mono {
21
21
  font-family: monospace;
22
22
  }
@@ -230,13 +230,13 @@ table.apg-attrs a {
230
230
  table.apg-attrs a:hover {
231
231
  color: #8caae6 !important;
232
232
  }
233
- `},"emittcss")});var ss=me(Wt=>{var kr=Nf(),y0=g0(),KS=v0(),Pt=Tn(),uo="utilities.js: ",Oi=Wt,os=o(function(r,e,t){let n,i=e,s=!0;for(;s;){if(r<=0){i=0,n=0;break}if(typeof i!="number"){i=0,n=r;break}if(i>=r){i=r,n=r;break}if(typeof t!="number"){n=r;break}if(n=i+t,n>r){n=r;break}break}return{beg:i,end:n}},"getBounds");Wt.htmlToPage=function(r,e){let t;if(typeof r!="string")throw new Error(`${uo}htmlToPage: input HTML is not a string`);typeof e!="string"?t="htmlToPage":t=e;let n="";return n+=`<!DOCTYPE html>
233
+ `},"emittcss")});var ss=me(Wt=>{var kr=Nf(),y0=g0(),jS=v0(),Pt=Tn(),uo="utilities.js: ",Oi=Wt,os=o(function(r,e,t){let n,i=e,s=!0;for(;s;){if(r<=0){i=0,n=0;break}if(typeof i!="number"){i=0,n=r;break}if(i>=r){i=r,n=r;break}if(typeof t!="number"){n=r;break}if(n=i+t,n>r){n=r;break}break}return{beg:i,end:n}},"getBounds");Wt.htmlToPage=function(r,e){let t;if(typeof r!="string")throw new Error(`${uo}htmlToPage: input HTML is not a string`);typeof e!="string"?t="htmlToPage":t=e;let n="";return n+=`<!DOCTYPE html>
234
234
  `,n+=`<html lang="en">
235
235
  `,n+=`<head>
236
236
  `,n+=`<meta charset="utf-8">
237
237
  `,n+=`<title>${t}</title>
238
238
  `,n+=`<style>
239
- `,n+=KS(),n+=`</style>
239
+ `,n+=jS(),n+=`</style>
240
240
  `,n+=`</head>
241
241
  <body>
242
242
  `,n+=`<p>${new Date}</p>
@@ -261,7 +261,7 @@ table.apg-attrs a:hover {
261
261
  `,s+=`<tr><td>sub-string end</td><td>${r.subEnd}</td><td>sub-string end-of-string index</td></tr>
262
262
  `,s+=`<tr><td>sub-string length</td><td>${r.subLength}</td><td>sub-string length</td></tr>
263
263
  `,s+=`</table>
264
- `,s};Wt.charsToString=function(r,e,t){let n,i;if(typeof e=="number"){if(e>=r.length)return"";n=e<0?0:e}else n=0;if(typeof t=="number"){if(t<=0)return"";i=t>r.length-n?r.length:n+t}else i=r.length;return n<i?y0.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};Wt.stringToChars=function(r){return y0.decode("STRING",r)};Wt.opcodeToString=function(r){let e="unknown";switch(r){case Pt.ALT:e="ALT";break;case Pt.CAT:e="CAT";break;case Pt.RNM:e="RNM";break;case Pt.UDT:e="UDT";break;case Pt.AND:e="AND";break;case Pt.NOT:e="NOT";break;case Pt.REP:e="REP";break;case Pt.TRG:e="TRG";break;case Pt.TBS:e="TBS";break;case Pt.TLS:e="TLS";break;case Pt.BKR:e="BKR";break;case Pt.BKA:e="BKA";break;case Pt.BKN:e="BKN";break;case Pt.ABG:e="ABG";break;case Pt.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};Wt.stateToString=function(r){let e="unknown";switch(r){case Pt.ACTIVE:e="ACTIVE";break;case Pt.MATCH:e="MATCH";break;case Pt.EMPTY:e="EMPTY";break;case Pt.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};Wt.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US","&nbsp;","!","&#34;","#","$","%","&#38;","&#39;","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&#60;","=","&#62;","?","@","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","[","&#92;","]","^","_","`","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","{","|","}","~","DEL"];Wt.charToHex=function(r){let e=r.toString(16).toUpperCase();switch(e.length){case 1:case 3:case 7:e=`0${e}`;break;case 2:case 6:e=`00${e}`;break;case 4:break;case 5:e=`000${e}`;break;default:throw new Error("unrecognized option")}return e};Wt.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToDec: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg){n+=r[i.beg];for(let s=i.beg+1;s<i.end;s+=1)n+=`,${r[s]}`}return n};Wt.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToHex: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg){n+=`\\x${Oi.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${Oi.charToHex(r[s])}`}return n};Wt.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToHex: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)n+=`&#x${r[s].toString(16)};`;return n};function VS(r){return!(r>=55296&&r<=57343||r>1114111)}o(VS,"isUnicode");Wt.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToUnicode: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)VS(r[s])?n+=`&#${r[s]};`:n+=` U+${Oi.charToHex(r[s])}`;return n};Wt.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToJsUnicode: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg){n+=`\\u${Oi.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${Oi.charToHex(r[s])}`}return n};Wt.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToAscii: input must be an array of integers`);let i=os(r.length,e,t);for(let s=i.beg;s<i.end;s+=1){let a=r[s];a>=32&&a<=126?n+=String.fromCharCode(a):n+=`\\x${Oi.charToHex(a)}`}return n};Wt.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${uo}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=os(r.length,e,t);for(let a=s.beg;a<s.end;a+=1)i=r[a],i<32||i===127?n+=`<span class="${kr.CLASS_CTRLCHAR}">${Oi.asciiChars[i]}</span>`:i>127?n+=`<span class="${kr.CLASS_CTRLCHAR}">U+${Oi.charToHex(i)}</span>`:n+=Oi.asciiChars[i];return n};Wt.stringToAsciiHtml=function(r){let e=y0.decode("STRING",r);return this.charsToAsciiHtml(e)}});var O2=me((TL,I2)=>{I2.exports=o(function(){let e=Tn(),t=ss(),n="ast.js: ",i=this,s=null,a=null,f=null,u=0,p=[],b=[],x=[],A=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(k,$,C){x.length=0,A.length=0,p.length=0,u=0,s=k,a=$,f=C;let B,z=[];for(B=0;B<s.length;B+=1)z.push(s[B].lower);for(B=0;B<a.length;B+=1)z.push(a[B].lower);for(u=s.length+a.length,B=0;B<u;B+=1)p[B]=!1,b[B]=null;for(let H in i.callbacks){let X=H.toLowerCase();if(B=z.indexOf(X),B<0)throw new Error(`${n}init: node '${H}' not a rule or udt name`);typeof i.callbacks[H]=="function"&&(p[B]=!0,b[B]=i.callbacks[H]),i.callbacks[H]===!0&&(p[B]=!0)}},"init"),this.ruleDefined=o(function(k){return p[k]!==!1},"ruleDefined"),this.udtDefined=o(function(k){return p[s.length+k]!==!1},"udtDefined"),this.down=o(function(k,$){let C=A.length;return x.push(C),A.push({name:$,thisIndex:C,thatIndex:null,state:e.SEM_PRE,callbackIndex:k,phraseIndex:null,phraseLength:null,stack:x.length}),C},"down"),this.up=o(function(k,$,C,B){let z=A.length,H=x.pop();return A.push({name:$,thisIndex:z,thatIndex:H,state:e.SEM_POST,callbackIndex:k,phraseIndex:C,phraseLength:B,stack:x.length}),A[H].thatIndex=z,A[H].phraseIndex=C,A[H].phraseLength=B,z},"up"),this.translate=o(function(k){let $,C,B;for(let z=0;z<A.length;z+=1)B=A[z],C=b[B.callbackIndex],B.state===e.SEM_PRE?C!==null&&($=C(e.SEM_PRE,f,B.phraseIndex,B.phraseLength,k),$===e.SEM_SKIP&&(z=B.thatIndex)):C!==null&&C(e.SEM_POST,f,B.phraseIndex,B.phraseLength,k)},"translate"),this.setLength=o(function(k){A.length=k,k>0?x.length=A[k-1].stack:x.length=0},"setLength"),this.getLength=o(function(){return A.length},"getLength");function O(T){let k="";for(let $=0;$<T;$+=1)k+=" ";return k}o(O,"indent"),this.toXml=o(function(k){let $=t.charsToDec,C="decimal integer character codes";if(typeof k=="string"&&k.length>=3){let H=k.slice(0,3).toLowerCase();H==="asc"?($=t.charsToAscii,C="ASCII for printing characters, hex for non-printing"):H==="hex"?($=t.charsToHex,C="hexadecimal integer character codes"):H==="uni"&&($=t.charsToUnicode,C="Unicode UTF-32 integer character codes")}let B="",z=0;return B+=`<?xml version="1.0" encoding="utf-8"?>
264
+ `,s};Wt.charsToString=function(r,e,t){let n,i;if(typeof e=="number"){if(e>=r.length)return"";n=e<0?0:e}else n=0;if(typeof t=="number"){if(t<=0)return"";i=t>r.length-n?r.length:n+t}else i=r.length;return n<i?y0.encode("UTF16LE",r.slice(n,i)).toString("utf16le"):""};Wt.stringToChars=function(r){return y0.decode("STRING",r)};Wt.opcodeToString=function(r){let e="unknown";switch(r){case Pt.ALT:e="ALT";break;case Pt.CAT:e="CAT";break;case Pt.RNM:e="RNM";break;case Pt.UDT:e="UDT";break;case Pt.AND:e="AND";break;case Pt.NOT:e="NOT";break;case Pt.REP:e="REP";break;case Pt.TRG:e="TRG";break;case Pt.TBS:e="TBS";break;case Pt.TLS:e="TLS";break;case Pt.BKR:e="BKR";break;case Pt.BKA:e="BKA";break;case Pt.BKN:e="BKN";break;case Pt.ABG:e="ABG";break;case Pt.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};Wt.stateToString=function(r){let e="unknown";switch(r){case Pt.ACTIVE:e="ACTIVE";break;case Pt.MATCH:e="MATCH";break;case Pt.EMPTY:e="EMPTY";break;case Pt.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};Wt.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US","&nbsp;","!","&#34;","#","$","%","&#38;","&#39;","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&#60;","=","&#62;","?","@","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","[","&#92;","]","^","_","`","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","{","|","}","~","DEL"];Wt.charToHex=function(r){let e=r.toString(16).toUpperCase();switch(e.length){case 1:case 3:case 7:e=`0${e}`;break;case 2:case 6:e=`00${e}`;break;case 4:break;case 5:e=`000${e}`;break;default:throw new Error("unrecognized option")}return e};Wt.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToDec: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg){n+=r[i.beg];for(let s=i.beg+1;s<i.end;s+=1)n+=`,${r[s]}`}return n};Wt.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToHex: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg){n+=`\\x${Oi.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\x${Oi.charToHex(r[s])}`}return n};Wt.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToHex: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)n+=`&#x${r[s].toString(16)};`;return n};function KS(r){return!(r>=55296&&r<=57343||r>1114111)}o(KS,"isUnicode");Wt.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToUnicode: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg)for(let s=i.beg;s<i.end;s+=1)KS(r[s])?n+=`&#${r[s]};`:n+=` U+${Oi.charToHex(r[s])}`;return n};Wt.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToJsUnicode: input must be an array of integers`);let i=os(r.length,e,t);if(i.end>i.beg){n+=`\\u${Oi.charToHex(r[i.beg])}`;for(let s=i.beg+1;s<i.end;s+=1)n+=`,\\u${Oi.charToHex(r[s])}`}return n};Wt.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${uo}charsToAscii: input must be an array of integers`);let i=os(r.length,e,t);for(let s=i.beg;s<i.end;s+=1){let a=r[s];a>=32&&a<=126?n+=String.fromCharCode(a):n+=`\\x${Oi.charToHex(a)}`}return n};Wt.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${uo}charsToAsciiHtml: input must be an array of integers`);let n="",i,s=os(r.length,e,t);for(let a=s.beg;a<s.end;a+=1)i=r[a],i<32||i===127?n+=`<span class="${kr.CLASS_CTRLCHAR}">${Oi.asciiChars[i]}</span>`:i>127?n+=`<span class="${kr.CLASS_CTRLCHAR}">U+${Oi.charToHex(i)}</span>`:n+=Oi.asciiChars[i];return n};Wt.stringToAsciiHtml=function(r){let e=y0.decode("STRING",r);return this.charsToAsciiHtml(e)}});var R2=me((kL,N2)=>{N2.exports=o(function(){let e=Tn(),t=ss(),n="ast.js: ",i=this,s=null,a=null,f=null,u=0,p=[],b=[],x=[],A=[];this.callbacks=[],this.astObject="astObject",this.init=o(function(k,$,C){x.length=0,A.length=0,p.length=0,u=0,s=k,a=$,f=C;let B,z=[];for(B=0;B<s.length;B+=1)z.push(s[B].lower);for(B=0;B<a.length;B+=1)z.push(a[B].lower);for(u=s.length+a.length,B=0;B<u;B+=1)p[B]=!1,b[B]=null;for(let H in i.callbacks){let X=H.toLowerCase();if(B=z.indexOf(X),B<0)throw new Error(`${n}init: node '${H}' not a rule or udt name`);typeof i.callbacks[H]=="function"&&(p[B]=!0,b[B]=i.callbacks[H]),i.callbacks[H]===!0&&(p[B]=!0)}},"init"),this.ruleDefined=o(function(k){return p[k]!==!1},"ruleDefined"),this.udtDefined=o(function(k){return p[s.length+k]!==!1},"udtDefined"),this.down=o(function(k,$){let C=A.length;return x.push(C),A.push({name:$,thisIndex:C,thatIndex:null,state:e.SEM_PRE,callbackIndex:k,phraseIndex:null,phraseLength:null,stack:x.length}),C},"down"),this.up=o(function(k,$,C,B){let z=A.length,H=x.pop();return A.push({name:$,thisIndex:z,thatIndex:H,state:e.SEM_POST,callbackIndex:k,phraseIndex:C,phraseLength:B,stack:x.length}),A[H].thatIndex=z,A[H].phraseIndex=C,A[H].phraseLength=B,z},"up"),this.translate=o(function(k){let $,C,B;for(let z=0;z<A.length;z+=1)B=A[z],C=b[B.callbackIndex],B.state===e.SEM_PRE?C!==null&&($=C(e.SEM_PRE,f,B.phraseIndex,B.phraseLength,k),$===e.SEM_SKIP&&(z=B.thatIndex)):C!==null&&C(e.SEM_POST,f,B.phraseIndex,B.phraseLength,k)},"translate"),this.setLength=o(function(k){A.length=k,k>0?x.length=A[k-1].stack:x.length=0},"setLength"),this.getLength=o(function(){return A.length},"getLength");function O(T){let k="";for(let $=0;$<T;$+=1)k+=" ";return k}o(O,"indent"),this.toXml=o(function(k){let $=t.charsToDec,C="decimal integer character codes";if(typeof k=="string"&&k.length>=3){let H=k.slice(0,3).toLowerCase();H==="asc"?($=t.charsToAscii,C="ASCII for printing characters, hex for non-printing"):H==="hex"?($=t.charsToHex,C="hexadecimal integer character codes"):H==="uni"&&($=t.charsToUnicode,C="Unicode UTF-32 integer character codes")}let B="",z=0;return B+=`<?xml version="1.0" encoding="utf-8"?>
265
265
  `,B+=`<root nodes="${A.length/2}" characters="${f.length}">
266
266
  `,B+=`<!-- input string, ${C} -->
267
267
  `,B+=O(z+2),B+=$(f),B+=`
@@ -269,7 +269,7 @@ table.apg-attrs a:hover {
269
269
  `,B+=O(z+2),B+=$(f,H.phraseIndex,H.phraseLength),B+=`
270
270
  `):(B+=O(z),B+=`</node><!-- name="${H.name}" -->
271
271
  `,z-=1)}),B+=`</root>
272
- `,B},"toSml"),this.phrases=o(function(){let k={},$,C;for($=0;$<A.length;$+=1)C=A[$],C.state===e.SEM_PRE&&(Array.isArray(k[C.name])||(k[C.name]=[]),k[C.name].push({index:C.phraseIndex,length:C.phraseLength}));return k},"phrases")},"exportsAst")});var x0=me((kL,P2)=>{P2.exports=o(function(){let e="circular-buffer.js: ",t=-1,n=0;this.init=o(function(s){if(typeof s!="number"||s<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(s),t=-1},"init"),this.increment=o(function(){return t+=1,(t+n)%n},"increment"),this.maxSize=o(function(){return n},"maxSize"),this.items=o(function(){return t+1},"items"),this.getListIndex=o(function(s){return t===-1||s<0||s>t||t-s>=n?-1:(s+n)%n},"getListIndex"),this.forEach=o(function(s){if(t!==-1){if(t<n){for(let a=0;a<=t;a+=1)s(a,a);return}for(let a=t-n+1;a<=t;a+=1){let f=(a+n)%n;s(f,a)}}},"forEach")},"exportsCircularBuffer")});var R2=me((CL,N2)=>{N2.exports=o(function(){let e=Tn(),t=ss(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let a=null,f=null,u,p,b,x,A=0,O=0,T=0,k=null,$=null,C=null,B=null,z=null,H=0,X=1/0,U=1/0,L=o(function(G,P,j){let ae=`${n}evaluateRule(): `;if(G>=C.length)throw new Error(`${ae}rule index: ${G} out of range`);if(P>=b)throw new Error(`${ae}phrase index: ${P} out of range`);let{length:ue}=a;a.push({type:e.RNM,index:G}),s(ue,P,j),a.pop()},"evaluateRule"),F=o(function(te,G,P){let j=`${n}evaluateUdt(): `;if(te>=B.length)throw new Error(`${j}udt index: ${te} out of range`);if(G>=b)throw new Error(`${j}phrase index: ${G} out of range`);let{length:ae}=a;a.push({type:e.UDT,empty:B[te].empty,index:te}),s(ae,G,P),a.pop()},"evaluateUdt"),ne=o(function(){A=0,O=0,T=0,H=0,x=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],C=null,B=null,f=null,u=0,p=0,b=0,k=null,$=null,z=null,a=null},"clear"),D=o(function(){let te=[],G=o(function(){let j={};C.forEach(ae=>{ae.isBkr&&(j[ae.lower]=null)}),B.length>0&&B.forEach(ae=>{ae.isBkr&&(j[ae.lower]=null)}),te.push(j)},"init"),P=o(function(){let j=te[te.length-1],ae={};for(let ue in j)ae[ue]=j[ue];return ae},"copy");this.push=o(function(){te.push(P())},"push"),this.pop=o(function(ae){let ue=ae;if(ue||(ue=te.length-1),ue<1||ue>te.length)throw new Error(`${n}backRef.pop(): bad length: ${ue}`);return te.length=ue,te[te.length-1]},"pop"),this.length=o(function(){return te.length},"length"),this.savePhrase=o(function(ae,ue,le){te[te.length-1][ae]={phraseIndex:ue,phraseLength:le}},"savePhrase"),this.getPhrase=function(j){return te[te.length-1][j]},G()},"backRef"),l=o(function(){let G=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=x[x.length-1],this.uFrame=new D,this.pFrame=new D,this.evaluateRule=L,this.evaluateUdt=F,this.refresh=o(function(){G.state=e.ACTIVE,G.phraseLength=0,G.lookAround=x[x.length-1]},"refresh")},"systemData"),v=o(function(){return x[x.length-1]},"lookAroundValue"),h=o(function(){return x.length>1},"inLookAround"),c=o(function(){return x[x.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),d=o(function(){let te=`${n}initializeAst(): `,G=!0;for(;G;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${te}ast object not recognized`);break}i.ast!==null&&i.ast.init(C,B,f)},"initializeAst"),y=o(function(){let te=`${n}initializeTrace(): `,G=!0;for(;G;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${te}trace object not recognized`);break}i.trace!==null&&i.trace.init(C,B,f)},"initializeTrace"),_=o(function(){let te=`${n}initializeStats(): `,G=!0;for(;G;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${te}stats object not recognized`);break}i.stats!==null&&i.stats.init(C,B)},"initializeStats"),w=o(function(te){let G=`${n}initializeGrammar(): `;if(!te)throw new Error(`${G}grammar object undefined`);if(te.grammarObject!=="grammarObject")throw new Error(`${G}bad grammar object`);C=te.rules,B=te.udts},"initializeGrammar"),m=o(function(te){let G=`${n}initializeStartRule(): `,P=null;if(typeof te=="number"){if(te>=C.length)throw new Error(`${G}start rule index too large: max: ${C.length}: index: ${te}`);P=te}else if(typeof te=="string"){let j=te.toLowerCase();for(let ae=0;ae<C.length;ae+=1)if(j===C[ae].lower){P=C[ae].index;break}if(P===null)throw new Error(`${G}start rule name '${te}' not recognized`)}else throw new Error(`${G}type of start rule '${typeof te}' not recognized`);return P},"initializeStartRule"),E=o(function(G,P,j){let ae=`${n}initializeInputChars(): `,ue=G,le=P,ge=j;if(ue===void 0)throw new Error(`${ae}input string is undefined`);if(ue===null)throw new Error(`${ae}input string is null`);if(typeof ue=="string")ue=t.stringToChars(ue);else if(!Array.isArray(ue))throw new Error(`${ae}input string is not a string or array`);if(ue.length>0&&typeof ue[0]!="number")throw new Error(`${ae}input string not an array of integers`);if(typeof le!="number")le=0;else if(le=Math.floor(le),le<0||le>ue.length)throw new Error(`${ae}input beginning index out of range: ${le}`);if(typeof ge!="number")ge=ue.length-le;else if(ge=Math.floor(ge),ge<0||ge>ue.length-le)throw new Error(`${ae}input length out of range: ${ge}`);f=ue,u=le,p=ge,b=u+p},"initializeInputChars"),I=o(function(){let te=`${n}initializeCallbacks(): `,G;for(k=[],$=[],G=0;G<C.length;G+=1)k[G]=null;for(G=0;G<B.length;G+=1)$[G]=null;let P,j=[];for(G=0;G<C.length;G+=1)j.push(C[G].lower);for(G=0;G<B.length;G+=1)j.push(B[G].lower);for(let ae in i.callbacks){if(G=j.indexOf(ae.toLowerCase()),G<0)throw new Error(`${te}syntax callback '${ae}' not a rule or udt name`);if(P=i.callbacks[ae],P||(P=null),typeof P=="function"||P===null)G<C.length?k[G]=P:$[G-C.length]=P;else throw new Error(`${te}syntax callback[${ae}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(G=0;G<B.length;G+=1)if($[G]===null)throw new Error(`${te}all UDT callbacks must be defined. UDT callback[${B[G].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(te){if(typeof te!="number")throw new Error(`parser: max tree depth must be integer > 0: ${te}`);if(X=Math.floor(te),X<=0)throw new Error(`parser: max tree depth must be integer > 0: ${te}`)},this.setMaxNodeHits=function(te){if(typeof te!="number")throw new Error(`parser: max node hits must be integer > 0: ${te}`);if(U=Math.floor(te),U<=0)throw new Error(`parser: max node hits must be integer > 0: ${te}`)};let g=o(function(te,G,P){let j,ae=`${n}parse(): `;w(te);let ue=m(G);I(),y(),_(),d();let le=new l;switch(P!=null&&(z=P),a=[{type:e.RNM,index:ue}],s(0,u,le),a=null,le.state){case e.ACTIVE:throw new Error(`${ae}final state should never be 'ACTIVE'`);case e.NOMATCH:j=!1;break;case e.EMPTY:case e.MATCH:le.phraseLength===p?j=!0:j=!1;break;default:throw new Error("unrecognized state")}return{success:j,state:le.state,length:p,matched:le.phraseLength,maxMatched:H,maxTreeDepth:O,nodeHits:T,inputLength:f.length,subBegin:u,subEnd:b,subLength:p}},"privateParse");this.parseSubstring=o(function(G,P,j,ae,ue,le){return ne(),E(j,ae,ue),g(G,P,le)},"parseSubstring"),this.parse=o(function(G,P,j,ae){return ne(),E(j,0,j.length),g(G,P,ae)},"parse");let S=o(function(te,G,P){let j=a[te];for(let ae=0;ae<j.children.length&&(s(j.children[ae],G,P),P.state===e.NOMATCH);ae+=1);},"opALT"),ie=o(function(te,G,P){let j,ae,ue,le,ge=a[te],ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(ae=i.ast.getLength()),j=!0,ue=G,le=0;for(let ve=0;ve<ge.children.length;ve+=1)if(s(ge.children[ve],ue,P),P.state===e.NOMATCH){j=!1;break}else ue+=P.phraseLength,le+=P.phraseLength;j?(P.state=le===0?e.EMPTY:e.MATCH,P.phraseLength=le):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(ae))},"opCAT"),M=o(function(te,G,P){let j,ae,ue,le,ge=a[te];ae=G,ue=0,le=0;let ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(j=i.ast.getLength());let ve=!0;for(;ve&&!(ae>=b||(s(te+1,ae,P),P.state===e.NOMATCH)||P.state===e.EMPTY||(le+=1,ue+=P.phraseLength,ae+=P.phraseLength,le===ge.max)););P.state===e.EMPTY||le>=ge.min?(P.state=ue===0?e.EMPTY:e.MATCH,P.phraseLength=ue):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(j))},"opREP"),K=o(function(te,G,P,j){if(G.phraseLength>P){let ae=`${n}opRNM(${te.name}): callback function error: `;throw ae+=`sysData.phraseLength: ${G.phraseLength}`,ae+=` must be <= remaining chars: ${P}`,new Error(ae)}switch(G.state){case e.ACTIVE:if(j!==!0)throw new Error(`${n}opRNM(${te.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:G.phraseLength=0;break;case e.MATCH:G.phraseLength===0&&(G.state=e.EMPTY);break;case e.NOMATCH:G.phraseLength=0;break;default:throw new Error(`${n}opRNM(${te.name}): callback function return error. Unrecognized return state: ${G.state}`)}},"validateRnmCallbackResult"),J=o(function(te,G,P){let j,ae,ue,le,ge,ft,Ee=a[te],ve=C[Ee.index],lt=k[ve.index],De=!h();if(De&&(ae=i.ast&&i.ast.ruleDefined(Ee.index),ae&&(j=i.ast.getLength(),i.ast.down(Ee.index,C[Ee.index].name)),le=P.uFrame.length(),ge=P.pFrame.length(),P.uFrame.push(),P.pFrame.push(),ft=P.pFrame,P.pFrame=new D),lt===null)ue=a,a=ve.opcodes,s(0,G,P),a=ue;else{let Ne=b-G;P.ruleIndex=ve.index,lt(P,f,G,z),K(ve,P,Ne,!0),P.state===e.ACTIVE&&(ue=a,a=ve.opcodes,s(0,G,P),a=ue,P.ruleIndex=ve.index,lt(P,f,G,z),K(ve,P,Ne,!1))}De&&(ae&&(P.state===e.NOMATCH?i.ast.setLength(j):i.ast.up(Ee.index,ve.name,G,P.phraseLength)),P.pFrame=ft,P.state===e.NOMATCH?(P.uFrame.pop(le),P.pFrame.pop(ge)):ve.isBkr&&(P.pFrame.savePhrase(ve.lower,G,P.phraseLength),P.uFrame.savePhrase(ve.lower,G,P.phraseLength)))},"opRNM"),N=o(function(te,G,P){if(G.phraseLength>P){let j=`${n}opUDT(${te.name}): callback function error: `;throw j+=`sysData.phraseLength: ${G.phraseLength}`,j+=` must be <= remaining chars: ${P}`,new Error(j)}switch(G.state){case e.ACTIVE:throw new Error(`${n}opUDT(${te.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(te.empty===!1)throw new Error(`${n}opUDT(${te.name}): callback function return error. May not return EMPTY.`);G.phraseLength=0;break;case e.MATCH:if(G.phraseLength===0){if(te.empty===!1)throw new Error(`${n}opUDT(${te.name}): callback function return error. May not return EMPTY.`);G.state=e.EMPTY}break;case e.NOMATCH:G.phraseLength=0;break;default:throw new Error(`${n}opUDT(${te.name}): callback function return error. Unrecognized return state: ${G.state}`)}},"validateUdtCallbackResult"),R=o(function(te,G,P){let j,ae,ue,le,ge,ft,Ee=a[te],ve=B[Ee.index];P.UdtIndex=ve.index;let lt=!h();lt&&(ue=i.ast&&i.ast.udtDefined(Ee.index),ue&&(ae=C.length+Ee.index,j=i.ast.getLength(),i.ast.down(ae,ve.name)),le=P.uFrame.length(),ge=P.pFrame.length(),P.uFrame.push(),P.pFrame.push(),ft=P.pFrame,P.pFrame=new D);let De=b-G;$[Ee.index](P,f,G,z),N(ve,P,De),lt&&(ue&&(P.state===e.NOMATCH?i.ast.setLength(j):i.ast.up(ae,ve.name,G,P.phraseLength)),P.pFrame=ft,P.state===e.NOMATCH?(P.uFrame.pop(le),P.pFrame.pop(ge)):ve.isBkr&&(P.pFrame.savePhrase(ve.lower,G,P.phraseLength),P.uFrame.savePhrase(ve.lower,G,P.phraseLength)))},"opUDT"),V=o(function(te,G,P){x.push({lookAround:e.LOOKAROUND_AHEAD,anchor:G,charsEnd:b,charsLength:p}),b=f.length,p=f.length-u,s(te+1,G,P);let j=x.pop();switch(b=j.charsEnd,p=j.charsLength,P.phraseLength=0,P.state){case e.EMPTY:P.state=e.EMPTY;break;case e.MATCH:P.state=e.EMPTY;break;case e.NOMATCH:P.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${P.state}`)}},"opAND"),W=o(function(te,G,P){x.push({lookAround:e.LOOKAROUND_AHEAD,anchor:G,charsEnd:b,charsLength:p}),b=f.length,p=f.length-u,s(te+1,G,P);let j=x.pop();switch(b=j.charsEnd,p=j.charsLength,P.phraseLength=0,P.state){case e.EMPTY:case e.MATCH:P.state=e.NOMATCH;break;case e.NOMATCH:P.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${P.state}`)}},"opNOT"),ee=o(function(te,G,P){let j=a[te];P.state=e.NOMATCH,G<b&&j.min<=f[G]&&f[G]<=j.max&&(P.state=e.MATCH,P.phraseLength=1)},"opTRG"),he=o(function(te,G,P){let j,ae=a[te],ue=ae.string.length;if(P.state=e.NOMATCH,G+ue<=b){for(j=0;j<ue;j+=1)if(f[G+j]!==ae.string[j])return;P.state=e.MATCH,P.phraseLength=ue}},"opTBS"),fe=o(function(te,G,P){let j,ae,ue=a[te];P.state=e.NOMATCH;let le=ue.string.length;if(le===0){P.state=e.EMPTY;return}if(G+le<=b){for(j=0;j<le;j+=1)if(ae=f[G+j],ae>=65&&ae<=90&&(ae+=32),ae!==ue.string[j])return;P.state=e.MATCH,P.phraseLength=le}},"opTLS"),Y=o(function(te,G,P){P.state=e.NOMATCH,P.phraseLength=0,P.state=G===0?e.EMPTY:e.NOMATCH},"opABG"),pe=o(function(te,G,P){P.state=e.NOMATCH,P.phraseLength=0,P.state=G===f.length?e.EMPTY:e.NOMATCH},"opAEN"),Q=o(function(te,G,P){let j,ae,ue,le,ge=a[te];P.state=e.NOMATCH,ge.index<C.length?le=C[ge.index].lower:le=B[ge.index-C.length].lower;let ft=ge.bkrMode===e.BKR_MODE_PM?P.pFrame.getPhrase(le):P.uFrame.getPhrase(le),Ee=ge.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let ve=ft.phraseIndex,lt=ft.phraseLength;if(lt===0){P.state=e.EMPTY;return}if(G+lt<=b){if(Ee){for(j=0;j<lt;j+=1)if(ae=f[G+j],ue=f[ve+j],ae>=65&&ae<=90&&(ae+=32),ue>=65&&ue<=90&&(ue+=32),ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}else for(j=0;j<lt;j+=1)if(ae=f[G+j],ue=f[ve+j],ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}},"opBKR"),ce=o(function(te,G,P){switch(x.push({lookAround:e.LOOKAROUND_BEHIND,anchor:G}),s(te+1,G,P),x.pop(),P.phraseLength=0,P.state){case e.EMPTY:P.state=e.EMPTY;break;case e.MATCH:P.state=e.EMPTY;break;case e.NOMATCH:P.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${P.state}`)}},"opBKA"),q=o(function(te,G,P){switch(x.push({lookAround:e.LOOKAROUND_BEHIND,anchor:G}),s(te+1,G,P),x.pop(),P.phraseLength=0,P.state){case e.EMPTY:case e.MATCH:P.state=e.NOMATCH;break;case e.NOMATCH:P.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${P.state}`)}},"opBKN"),se=o(function(te,G,P){let j,ae,ue,le,ge=a[te],ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(ae=i.ast.getLength()),j=!0,ue=G,le=0;for(let ve=ge.children.length-1;ve>=0;ve-=1)if(s(ge.children[ve],ue,P),ue-=P.phraseLength,le+=P.phraseLength,P.state===e.NOMATCH){j=!1;break}j?(P.state=le===0?e.EMPTY:e.MATCH,P.phraseLength=le):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(ae))},"opCATBehind"),be=o(function(te,G,P){let j,ae,ue,le,ge=a[te];ae=G,ue=0,le=0;let ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(j=i.ast.getLength());let ve=!0;for(;ve&&!(ae<=0||(s(te+1,ae,P),P.state===e.NOMATCH)||P.state===e.EMPTY||(le+=1,ue+=P.phraseLength,ae-=P.phraseLength,le===ge.max)););P.state===e.EMPTY||le>=ge.min?(P.state=ue===0?e.EMPTY:e.MATCH,P.phraseLength=ue):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(j))},"opREPBehind"),ke=o(function(te,G,P){let j=a[te];if(P.state=e.NOMATCH,P.phraseLength=0,G>0){let ae=f[G-1];j.min<=ae&&ae<=j.max&&(P.state=e.MATCH,P.phraseLength=1)}},"opTRGBehind"),we=o(function(te,G,P){let j,ae=a[te];P.state=e.NOMATCH;let ue=ae.string.length,le=G-ue;if(le>=0){for(j=0;j<ue;j+=1)if(f[le+j]!==ae.string[j])return;P.state=e.MATCH,P.phraseLength=ue}},"opTBSBehind"),Oe=o(function(te,G,P){let j,ae=a[te];P.state=e.NOMATCH;let ue=ae.string.length;if(ue===0){P.state=e.EMPTY;return}let le=G-ue;if(le>=0){for(let ge=0;ge<ue;ge+=1)if(j=f[le+ge],j>=65&&j<=90&&(j+=32),j!==ae.string[ge])return;P.state=e.MATCH,P.phraseLength=ue}},"opTLSBehind"),vr=o(function(te,G,P){let j,ae,ue,le,ge=a[te];P.state=e.NOMATCH,P.phraseLength=0,ge.index<C.length?le=C[ge.index].lower:le=B[ge.index-C.length].lower;let ft=ge.bkrMode===e.BKR_MODE_PM?P.pFrame.getPhrase(le):P.uFrame.getPhrase(le),Ee=ge.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let ve=ft.phraseIndex,lt=ft.phraseLength;if(lt===0){P.state=e.EMPTY,P.phraseLength=0;return}let De=G-lt;if(De>=0){if(Ee){for(j=0;j<lt;j+=1)if(ae=f[De+j],ue=f[ve+j],ae>=65&&ae<=90&&(ae+=32),ue>=65&&ue<=90&&(ue+=32),ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}else for(j=0;j<lt;j+=1)if(ae=f[De+j],ue=f[ve+j],ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}},"opBKRBehind");s=o(function(G,P,j){let ae=!0,ue=a[G];if(T+=1,T>U)throw new Error(`parser: maximum number of node hits exceeded: ${U}`);if(A+=1,A>O&&(O=A,O>X))throw new Error(`parser: maximum parse tree depth exceeded: ${X}`);if(j.refresh(),i.trace!==null){let le=v();i.trace.down(ue,j.state,P,j.phraseLength,le.anchor,le.lookAround)}if(c())switch(ue.type){case e.ALT:S(G,P,j);break;case e.CAT:se(G,P,j);break;case e.REP:be(G,P,j);break;case e.RNM:J(G,P,j);break;case e.UDT:R(G,P,j);break;case e.AND:V(G,P,j);break;case e.NOT:W(G,P,j);break;case e.TRG:ke(G,P,j);break;case e.TBS:we(G,P,j);break;case e.TLS:Oe(G,P,j);break;case e.BKR:vr(G,P,j);break;case e.BKA:ce(G,P,j);break;case e.BKN:q(G,P,j);break;case e.ABG:Y(G,P,j);break;case e.AEN:pe(G,P,j);break;default:ae=!1;break}else switch(ue.type){case e.ALT:S(G,P,j);break;case e.CAT:ie(G,P,j);break;case e.REP:M(G,P,j);break;case e.RNM:J(G,P,j);break;case e.UDT:R(G,P,j);break;case e.AND:V(G,P,j);break;case e.NOT:W(G,P,j);break;case e.TRG:ee(G,P,j);break;case e.TBS:he(G,P,j);break;case e.TLS:fe(G,P,j);break;case e.BKR:Q(G,P,j);break;case e.BKA:ce(G,P,j);break;case e.BKN:q(G,P,j);break;case e.ABG:Y(G,P,j);break;case e.AEN:pe(G,P,j);break;default:ae=!1;break}if(!h()&&P+j.phraseLength>H&&(H=P+j.phraseLength),i.stats!==null&&i.stats.collect(ue,j),i.trace!==null){let le=v();i.trace.up(ue,j.state,P,j.phraseLength,le.anchor,le.lookAround)}return A-=1,ae},"opExecuteFunc")},"parser")});var B2=me((DL,L2)=>{L2.exports=o(function(){let e=Tn(),t=ss(),n=Nf(),i="stats.js: ",s=[],a=[],f=[],u,p=[],b=[];this.statsObject="statsObject";let x="stats",A=o(function(U,L){return U.lower<L.lower?-1:U.lower>L.lower?1:0},"sortAlpha"),O=o(function(U,L){return U.total<L.total?1:U.total>L.total?-1:A(U,L)},"sortHits"),T=o(function(U,L){return U.index<L.index?-1:U.index>L.index?1:0},"sortIndex"),k=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),$=o(function(){f.length=0,u=new k,f[e.ALT]=new k,f[e.CAT]=new k,f[e.REP]=new k,f[e.RNM]=new k,f[e.TRG]=new k,f[e.TBS]=new k,f[e.TLS]=new k,f[e.UDT]=new k,f[e.AND]=new k,f[e.NOT]=new k,f[e.BKR]=new k,f[e.BKA]=new k,f[e.BKN]=new k,f[e.ABG]=new k,f[e.AEN]=new k,p.length=0;for(let U=0;U<s.length;U+=1)p.push({empty:0,match:0,nomatch:0,total:0,name:s[U].name,lower:s[U].lower,index:s[U].index});if(a.length>0){b.length=0;for(let U=0;U<a.length;U+=1)b.push({empty:0,match:0,nomatch:0,total:0,name:a[U].name,lower:a[U].lower,index:a[U].index})}},"clear"),C=o(function(U,L){switch(U.total+=1,L){case e.EMPTY:U.empty+=1;break;case e.MATCH:U.match+=1;break;case e.NOMATCH:U.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${L}`)}},"incStat"),B=o(function(U,L){let F="";return F+="<tr>",F+=`<td class="${n.CLASS_ACTIVE}">${U}</td>`,F+=`<td class="${n.CLASS_EMPTY}">${L.empty}</td>`,F+=`<td class="${n.CLASS_MATCH}">${L.match}</td>`,F+=`<td class="${n.CLASS_NOMATCH}">${L.nomatch}</td>`,F+=`<td class="${n.CLASS_ACTIVE}">${L.total}</td>`,F+=`</tr>
272
+ `,B},"toSml"),this.phrases=o(function(){let k={},$,C;for($=0;$<A.length;$+=1)C=A[$],C.state===e.SEM_PRE&&(Array.isArray(k[C.name])||(k[C.name]=[]),k[C.name].push({index:C.phraseIndex,length:C.phraseLength}));return k},"phrases")},"exportsAst")});var x0=me((CL,L2)=>{L2.exports=o(function(){let e="circular-buffer.js: ",t=-1,n=0;this.init=o(function(s){if(typeof s!="number"||s<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(s),t=-1},"init"),this.increment=o(function(){return t+=1,(t+n)%n},"increment"),this.maxSize=o(function(){return n},"maxSize"),this.items=o(function(){return t+1},"items"),this.getListIndex=o(function(s){return t===-1||s<0||s>t||t-s>=n?-1:(s+n)%n},"getListIndex"),this.forEach=o(function(s){if(t!==-1){if(t<n){for(let a=0;a<=t;a+=1)s(a,a);return}for(let a=t-n+1;a<=t;a+=1){let f=(a+n)%n;s(f,a)}}},"forEach")},"exportsCircularBuffer")});var U2=me((DL,B2)=>{B2.exports=o(function(){let e=Tn(),t=ss(),n="parser.js: ",i=this,s;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let a=null,f=null,u,p,b,x,A=0,O=0,T=0,k=null,$=null,C=null,B=null,z=null,H=0,X=1/0,U=1/0,L=o(function(G,P,j){let ae=`${n}evaluateRule(): `;if(G>=C.length)throw new Error(`${ae}rule index: ${G} out of range`);if(P>=b)throw new Error(`${ae}phrase index: ${P} out of range`);let{length:ue}=a;a.push({type:e.RNM,index:G}),s(ue,P,j),a.pop()},"evaluateRule"),F=o(function(te,G,P){let j=`${n}evaluateUdt(): `;if(te>=B.length)throw new Error(`${j}udt index: ${te} out of range`);if(G>=b)throw new Error(`${j}phrase index: ${G} out of range`);let{length:ae}=a;a.push({type:e.UDT,empty:B[te].empty,index:te}),s(ae,G,P),a.pop()},"evaluateUdt"),ne=o(function(){A=0,O=0,T=0,H=0,x=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],C=null,B=null,f=null,u=0,p=0,b=0,k=null,$=null,z=null,a=null},"clear"),D=o(function(){let te=[],G=o(function(){let j={};C.forEach(ae=>{ae.isBkr&&(j[ae.lower]=null)}),B.length>0&&B.forEach(ae=>{ae.isBkr&&(j[ae.lower]=null)}),te.push(j)},"init"),P=o(function(){let j=te[te.length-1],ae={};for(let ue in j)ae[ue]=j[ue];return ae},"copy");this.push=o(function(){te.push(P())},"push"),this.pop=o(function(ae){let ue=ae;if(ue||(ue=te.length-1),ue<1||ue>te.length)throw new Error(`${n}backRef.pop(): bad length: ${ue}`);return te.length=ue,te[te.length-1]},"pop"),this.length=o(function(){return te.length},"length"),this.savePhrase=o(function(ae,ue,le){te[te.length-1][ae]={phraseIndex:ue,phraseLength:le}},"savePhrase"),this.getPhrase=function(j){return te[te.length-1][j]},G()},"backRef"),l=o(function(){let G=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=x[x.length-1],this.uFrame=new D,this.pFrame=new D,this.evaluateRule=L,this.evaluateUdt=F,this.refresh=o(function(){G.state=e.ACTIVE,G.phraseLength=0,G.lookAround=x[x.length-1]},"refresh")},"systemData"),v=o(function(){return x[x.length-1]},"lookAroundValue"),h=o(function(){return x.length>1},"inLookAround"),c=o(function(){return x[x.length-1].lookAround===e.LOOKAROUND_BEHIND},"inLookBehind"),d=o(function(){let te=`${n}initializeAst(): `,G=!0;for(;G;){if(i.ast===void 0){i.ast=null;break}if(i.ast===null)break;if(i.ast.astObject!=="astObject")throw new Error(`${te}ast object not recognized`);break}i.ast!==null&&i.ast.init(C,B,f)},"initializeAst"),y=o(function(){let te=`${n}initializeTrace(): `,G=!0;for(;G;){if(i.trace===void 0){i.trace=null;break}if(i.trace===null)break;if(i.trace.traceObject!=="traceObject")throw new Error(`${te}trace object not recognized`);break}i.trace!==null&&i.trace.init(C,B,f)},"initializeTrace"),_=o(function(){let te=`${n}initializeStats(): `,G=!0;for(;G;){if(i.stats===void 0){i.stats=null;break}if(i.stats===null)break;if(i.stats.statsObject!=="statsObject")throw new Error(`${te}stats object not recognized`);break}i.stats!==null&&i.stats.init(C,B)},"initializeStats"),w=o(function(te){let G=`${n}initializeGrammar(): `;if(!te)throw new Error(`${G}grammar object undefined`);if(te.grammarObject!=="grammarObject")throw new Error(`${G}bad grammar object`);C=te.rules,B=te.udts},"initializeGrammar"),m=o(function(te){let G=`${n}initializeStartRule(): `,P=null;if(typeof te=="number"){if(te>=C.length)throw new Error(`${G}start rule index too large: max: ${C.length}: index: ${te}`);P=te}else if(typeof te=="string"){let j=te.toLowerCase();for(let ae=0;ae<C.length;ae+=1)if(j===C[ae].lower){P=C[ae].index;break}if(P===null)throw new Error(`${G}start rule name '${te}' not recognized`)}else throw new Error(`${G}type of start rule '${typeof te}' not recognized`);return P},"initializeStartRule"),E=o(function(G,P,j){let ae=`${n}initializeInputChars(): `,ue=G,le=P,ge=j;if(ue===void 0)throw new Error(`${ae}input string is undefined`);if(ue===null)throw new Error(`${ae}input string is null`);if(typeof ue=="string")ue=t.stringToChars(ue);else if(!Array.isArray(ue))throw new Error(`${ae}input string is not a string or array`);if(ue.length>0&&typeof ue[0]!="number")throw new Error(`${ae}input string not an array of integers`);if(typeof le!="number")le=0;else if(le=Math.floor(le),le<0||le>ue.length)throw new Error(`${ae}input beginning index out of range: ${le}`);if(typeof ge!="number")ge=ue.length-le;else if(ge=Math.floor(ge),ge<0||ge>ue.length-le)throw new Error(`${ae}input length out of range: ${ge}`);f=ue,u=le,p=ge,b=u+p},"initializeInputChars"),I=o(function(){let te=`${n}initializeCallbacks(): `,G;for(k=[],$=[],G=0;G<C.length;G+=1)k[G]=null;for(G=0;G<B.length;G+=1)$[G]=null;let P,j=[];for(G=0;G<C.length;G+=1)j.push(C[G].lower);for(G=0;G<B.length;G+=1)j.push(B[G].lower);for(let ae in i.callbacks){if(G=j.indexOf(ae.toLowerCase()),G<0)throw new Error(`${te}syntax callback '${ae}' not a rule or udt name`);if(P=i.callbacks[ae],P||(P=null),typeof P=="function"||P===null)G<C.length?k[G]=P:$[G-C.length]=P;else throw new Error(`${te}syntax callback[${ae}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(G=0;G<B.length;G+=1)if($[G]===null)throw new Error(`${te}all UDT callbacks must be defined. UDT callback[${B[G].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(te){if(typeof te!="number")throw new Error(`parser: max tree depth must be integer > 0: ${te}`);if(X=Math.floor(te),X<=0)throw new Error(`parser: max tree depth must be integer > 0: ${te}`)},this.setMaxNodeHits=function(te){if(typeof te!="number")throw new Error(`parser: max node hits must be integer > 0: ${te}`);if(U=Math.floor(te),U<=0)throw new Error(`parser: max node hits must be integer > 0: ${te}`)};let g=o(function(te,G,P){let j,ae=`${n}parse(): `;w(te);let ue=m(G);I(),y(),_(),d();let le=new l;switch(P!=null&&(z=P),a=[{type:e.RNM,index:ue}],s(0,u,le),a=null,le.state){case e.ACTIVE:throw new Error(`${ae}final state should never be 'ACTIVE'`);case e.NOMATCH:j=!1;break;case e.EMPTY:case e.MATCH:le.phraseLength===p?j=!0:j=!1;break;default:throw new Error("unrecognized state")}return{success:j,state:le.state,length:p,matched:le.phraseLength,maxMatched:H,maxTreeDepth:O,nodeHits:T,inputLength:f.length,subBegin:u,subEnd:b,subLength:p}},"privateParse");this.parseSubstring=o(function(G,P,j,ae,ue,le){return ne(),E(j,ae,ue),g(G,P,le)},"parseSubstring"),this.parse=o(function(G,P,j,ae){return ne(),E(j,0,j.length),g(G,P,ae)},"parse");let S=o(function(te,G,P){let j=a[te];for(let ae=0;ae<j.children.length&&(s(j.children[ae],G,P),P.state===e.NOMATCH);ae+=1);},"opALT"),ie=o(function(te,G,P){let j,ae,ue,le,ge=a[te],ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(ae=i.ast.getLength()),j=!0,ue=G,le=0;for(let ve=0;ve<ge.children.length;ve+=1)if(s(ge.children[ve],ue,P),P.state===e.NOMATCH){j=!1;break}else ue+=P.phraseLength,le+=P.phraseLength;j?(P.state=le===0?e.EMPTY:e.MATCH,P.phraseLength=le):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(ae))},"opCAT"),M=o(function(te,G,P){let j,ae,ue,le,ge=a[te];ae=G,ue=0,le=0;let ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(j=i.ast.getLength());let ve=!0;for(;ve&&!(ae>=b||(s(te+1,ae,P),P.state===e.NOMATCH)||P.state===e.EMPTY||(le+=1,ue+=P.phraseLength,ae+=P.phraseLength,le===ge.max)););P.state===e.EMPTY||le>=ge.min?(P.state=ue===0?e.EMPTY:e.MATCH,P.phraseLength=ue):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(j))},"opREP"),K=o(function(te,G,P,j){if(G.phraseLength>P){let ae=`${n}opRNM(${te.name}): callback function error: `;throw ae+=`sysData.phraseLength: ${G.phraseLength}`,ae+=` must be <= remaining chars: ${P}`,new Error(ae)}switch(G.state){case e.ACTIVE:if(j!==!0)throw new Error(`${n}opRNM(${te.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:G.phraseLength=0;break;case e.MATCH:G.phraseLength===0&&(G.state=e.EMPTY);break;case e.NOMATCH:G.phraseLength=0;break;default:throw new Error(`${n}opRNM(${te.name}): callback function return error. Unrecognized return state: ${G.state}`)}},"validateRnmCallbackResult"),J=o(function(te,G,P){let j,ae,ue,le,ge,ft,Ee=a[te],ve=C[Ee.index],lt=k[ve.index],De=!h();if(De&&(ae=i.ast&&i.ast.ruleDefined(Ee.index),ae&&(j=i.ast.getLength(),i.ast.down(Ee.index,C[Ee.index].name)),le=P.uFrame.length(),ge=P.pFrame.length(),P.uFrame.push(),P.pFrame.push(),ft=P.pFrame,P.pFrame=new D),lt===null)ue=a,a=ve.opcodes,s(0,G,P),a=ue;else{let Ne=b-G;P.ruleIndex=ve.index,lt(P,f,G,z),K(ve,P,Ne,!0),P.state===e.ACTIVE&&(ue=a,a=ve.opcodes,s(0,G,P),a=ue,P.ruleIndex=ve.index,lt(P,f,G,z),K(ve,P,Ne,!1))}De&&(ae&&(P.state===e.NOMATCH?i.ast.setLength(j):i.ast.up(Ee.index,ve.name,G,P.phraseLength)),P.pFrame=ft,P.state===e.NOMATCH?(P.uFrame.pop(le),P.pFrame.pop(ge)):ve.isBkr&&(P.pFrame.savePhrase(ve.lower,G,P.phraseLength),P.uFrame.savePhrase(ve.lower,G,P.phraseLength)))},"opRNM"),N=o(function(te,G,P){if(G.phraseLength>P){let j=`${n}opUDT(${te.name}): callback function error: `;throw j+=`sysData.phraseLength: ${G.phraseLength}`,j+=` must be <= remaining chars: ${P}`,new Error(j)}switch(G.state){case e.ACTIVE:throw new Error(`${n}opUDT(${te.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(te.empty===!1)throw new Error(`${n}opUDT(${te.name}): callback function return error. May not return EMPTY.`);G.phraseLength=0;break;case e.MATCH:if(G.phraseLength===0){if(te.empty===!1)throw new Error(`${n}opUDT(${te.name}): callback function return error. May not return EMPTY.`);G.state=e.EMPTY}break;case e.NOMATCH:G.phraseLength=0;break;default:throw new Error(`${n}opUDT(${te.name}): callback function return error. Unrecognized return state: ${G.state}`)}},"validateUdtCallbackResult"),R=o(function(te,G,P){let j,ae,ue,le,ge,ft,Ee=a[te],ve=B[Ee.index];P.UdtIndex=ve.index;let lt=!h();lt&&(ue=i.ast&&i.ast.udtDefined(Ee.index),ue&&(ae=C.length+Ee.index,j=i.ast.getLength(),i.ast.down(ae,ve.name)),le=P.uFrame.length(),ge=P.pFrame.length(),P.uFrame.push(),P.pFrame.push(),ft=P.pFrame,P.pFrame=new D);let De=b-G;$[Ee.index](P,f,G,z),N(ve,P,De),lt&&(ue&&(P.state===e.NOMATCH?i.ast.setLength(j):i.ast.up(ae,ve.name,G,P.phraseLength)),P.pFrame=ft,P.state===e.NOMATCH?(P.uFrame.pop(le),P.pFrame.pop(ge)):ve.isBkr&&(P.pFrame.savePhrase(ve.lower,G,P.phraseLength),P.uFrame.savePhrase(ve.lower,G,P.phraseLength)))},"opUDT"),V=o(function(te,G,P){x.push({lookAround:e.LOOKAROUND_AHEAD,anchor:G,charsEnd:b,charsLength:p}),b=f.length,p=f.length-u,s(te+1,G,P);let j=x.pop();switch(b=j.charsEnd,p=j.charsLength,P.phraseLength=0,P.state){case e.EMPTY:P.state=e.EMPTY;break;case e.MATCH:P.state=e.EMPTY;break;case e.NOMATCH:P.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${P.state}`)}},"opAND"),W=o(function(te,G,P){x.push({lookAround:e.LOOKAROUND_AHEAD,anchor:G,charsEnd:b,charsLength:p}),b=f.length,p=f.length-u,s(te+1,G,P);let j=x.pop();switch(b=j.charsEnd,p=j.charsLength,P.phraseLength=0,P.state){case e.EMPTY:case e.MATCH:P.state=e.NOMATCH;break;case e.NOMATCH:P.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${P.state}`)}},"opNOT"),ee=o(function(te,G,P){let j=a[te];P.state=e.NOMATCH,G<b&&j.min<=f[G]&&f[G]<=j.max&&(P.state=e.MATCH,P.phraseLength=1)},"opTRG"),he=o(function(te,G,P){let j,ae=a[te],ue=ae.string.length;if(P.state=e.NOMATCH,G+ue<=b){for(j=0;j<ue;j+=1)if(f[G+j]!==ae.string[j])return;P.state=e.MATCH,P.phraseLength=ue}},"opTBS"),fe=o(function(te,G,P){let j,ae,ue=a[te];P.state=e.NOMATCH;let le=ue.string.length;if(le===0){P.state=e.EMPTY;return}if(G+le<=b){for(j=0;j<le;j+=1)if(ae=f[G+j],ae>=65&&ae<=90&&(ae+=32),ae!==ue.string[j])return;P.state=e.MATCH,P.phraseLength=le}},"opTLS"),Y=o(function(te,G,P){P.state=e.NOMATCH,P.phraseLength=0,P.state=G===0?e.EMPTY:e.NOMATCH},"opABG"),pe=o(function(te,G,P){P.state=e.NOMATCH,P.phraseLength=0,P.state=G===f.length?e.EMPTY:e.NOMATCH},"opAEN"),Q=o(function(te,G,P){let j,ae,ue,le,ge=a[te];P.state=e.NOMATCH,ge.index<C.length?le=C[ge.index].lower:le=B[ge.index-C.length].lower;let ft=ge.bkrMode===e.BKR_MODE_PM?P.pFrame.getPhrase(le):P.uFrame.getPhrase(le),Ee=ge.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let ve=ft.phraseIndex,lt=ft.phraseLength;if(lt===0){P.state=e.EMPTY;return}if(G+lt<=b){if(Ee){for(j=0;j<lt;j+=1)if(ae=f[G+j],ue=f[ve+j],ae>=65&&ae<=90&&(ae+=32),ue>=65&&ue<=90&&(ue+=32),ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}else for(j=0;j<lt;j+=1)if(ae=f[G+j],ue=f[ve+j],ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}},"opBKR"),ce=o(function(te,G,P){switch(x.push({lookAround:e.LOOKAROUND_BEHIND,anchor:G}),s(te+1,G,P),x.pop(),P.phraseLength=0,P.state){case e.EMPTY:P.state=e.EMPTY;break;case e.MATCH:P.state=e.EMPTY;break;case e.NOMATCH:P.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${P.state}`)}},"opBKA"),q=o(function(te,G,P){switch(x.push({lookAround:e.LOOKAROUND_BEHIND,anchor:G}),s(te+1,G,P),x.pop(),P.phraseLength=0,P.state){case e.EMPTY:case e.MATCH:P.state=e.NOMATCH;break;case e.NOMATCH:P.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${P.state}`)}},"opBKN"),se=o(function(te,G,P){let j,ae,ue,le,ge=a[te],ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(ae=i.ast.getLength()),j=!0,ue=G,le=0;for(let ve=ge.children.length-1;ve>=0;ve-=1)if(s(ge.children[ve],ue,P),ue-=P.phraseLength,le+=P.phraseLength,P.state===e.NOMATCH){j=!1;break}j?(P.state=le===0?e.EMPTY:e.MATCH,P.phraseLength=le):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(ae))},"opCATBehind"),be=o(function(te,G,P){let j,ae,ue,le,ge=a[te];ae=G,ue=0,le=0;let ft=P.uFrame.length(),Ee=P.pFrame.length();i.ast&&(j=i.ast.getLength());let ve=!0;for(;ve&&!(ae<=0||(s(te+1,ae,P),P.state===e.NOMATCH)||P.state===e.EMPTY||(le+=1,ue+=P.phraseLength,ae-=P.phraseLength,le===ge.max)););P.state===e.EMPTY||le>=ge.min?(P.state=ue===0?e.EMPTY:e.MATCH,P.phraseLength=ue):(P.state=e.NOMATCH,P.phraseLength=0,P.uFrame.pop(ft),P.pFrame.pop(Ee),i.ast&&i.ast.setLength(j))},"opREPBehind"),ke=o(function(te,G,P){let j=a[te];if(P.state=e.NOMATCH,P.phraseLength=0,G>0){let ae=f[G-1];j.min<=ae&&ae<=j.max&&(P.state=e.MATCH,P.phraseLength=1)}},"opTRGBehind"),we=o(function(te,G,P){let j,ae=a[te];P.state=e.NOMATCH;let ue=ae.string.length,le=G-ue;if(le>=0){for(j=0;j<ue;j+=1)if(f[le+j]!==ae.string[j])return;P.state=e.MATCH,P.phraseLength=ue}},"opTBSBehind"),Oe=o(function(te,G,P){let j,ae=a[te];P.state=e.NOMATCH;let ue=ae.string.length;if(ue===0){P.state=e.EMPTY;return}let le=G-ue;if(le>=0){for(let ge=0;ge<ue;ge+=1)if(j=f[le+ge],j>=65&&j<=90&&(j+=32),j!==ae.string[ge])return;P.state=e.MATCH,P.phraseLength=ue}},"opTLSBehind"),vr=o(function(te,G,P){let j,ae,ue,le,ge=a[te];P.state=e.NOMATCH,P.phraseLength=0,ge.index<C.length?le=C[ge.index].lower:le=B[ge.index-C.length].lower;let ft=ge.bkrMode===e.BKR_MODE_PM?P.pFrame.getPhrase(le):P.uFrame.getPhrase(le),Ee=ge.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let ve=ft.phraseIndex,lt=ft.phraseLength;if(lt===0){P.state=e.EMPTY,P.phraseLength=0;return}let De=G-lt;if(De>=0){if(Ee){for(j=0;j<lt;j+=1)if(ae=f[De+j],ue=f[ve+j],ae>=65&&ae<=90&&(ae+=32),ue>=65&&ue<=90&&(ue+=32),ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}else for(j=0;j<lt;j+=1)if(ae=f[De+j],ue=f[ve+j],ae!==ue)return;P.state=e.MATCH,P.phraseLength=lt}},"opBKRBehind");s=o(function(G,P,j){let ae=!0,ue=a[G];if(T+=1,T>U)throw new Error(`parser: maximum number of node hits exceeded: ${U}`);if(A+=1,A>O&&(O=A,O>X))throw new Error(`parser: maximum parse tree depth exceeded: ${X}`);if(j.refresh(),i.trace!==null){let le=v();i.trace.down(ue,j.state,P,j.phraseLength,le.anchor,le.lookAround)}if(c())switch(ue.type){case e.ALT:S(G,P,j);break;case e.CAT:se(G,P,j);break;case e.REP:be(G,P,j);break;case e.RNM:J(G,P,j);break;case e.UDT:R(G,P,j);break;case e.AND:V(G,P,j);break;case e.NOT:W(G,P,j);break;case e.TRG:ke(G,P,j);break;case e.TBS:we(G,P,j);break;case e.TLS:Oe(G,P,j);break;case e.BKR:vr(G,P,j);break;case e.BKA:ce(G,P,j);break;case e.BKN:q(G,P,j);break;case e.ABG:Y(G,P,j);break;case e.AEN:pe(G,P,j);break;default:ae=!1;break}else switch(ue.type){case e.ALT:S(G,P,j);break;case e.CAT:ie(G,P,j);break;case e.REP:M(G,P,j);break;case e.RNM:J(G,P,j);break;case e.UDT:R(G,P,j);break;case e.AND:V(G,P,j);break;case e.NOT:W(G,P,j);break;case e.TRG:ee(G,P,j);break;case e.TBS:he(G,P,j);break;case e.TLS:fe(G,P,j);break;case e.BKR:Q(G,P,j);break;case e.BKA:ce(G,P,j);break;case e.BKN:q(G,P,j);break;case e.ABG:Y(G,P,j);break;case e.AEN:pe(G,P,j);break;default:ae=!1;break}if(!h()&&P+j.phraseLength>H&&(H=P+j.phraseLength),i.stats!==null&&i.stats.collect(ue,j),i.trace!==null){let le=v();i.trace.up(ue,j.state,P,j.phraseLength,le.anchor,le.lookAround)}return A-=1,ae},"opExecuteFunc")},"parser")});var $2=me((IL,F2)=>{F2.exports=o(function(){let e=Tn(),t=ss(),n=Nf(),i="stats.js: ",s=[],a=[],f=[],u,p=[],b=[];this.statsObject="statsObject";let x="stats",A=o(function(U,L){return U.lower<L.lower?-1:U.lower>L.lower?1:0},"sortAlpha"),O=o(function(U,L){return U.total<L.total?1:U.total>L.total?-1:A(U,L)},"sortHits"),T=o(function(U,L){return U.index<L.index?-1:U.index>L.index?1:0},"sortIndex"),k=o(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat"),$=o(function(){f.length=0,u=new k,f[e.ALT]=new k,f[e.CAT]=new k,f[e.REP]=new k,f[e.RNM]=new k,f[e.TRG]=new k,f[e.TBS]=new k,f[e.TLS]=new k,f[e.UDT]=new k,f[e.AND]=new k,f[e.NOT]=new k,f[e.BKR]=new k,f[e.BKA]=new k,f[e.BKN]=new k,f[e.ABG]=new k,f[e.AEN]=new k,p.length=0;for(let U=0;U<s.length;U+=1)p.push({empty:0,match:0,nomatch:0,total:0,name:s[U].name,lower:s[U].lower,index:s[U].index});if(a.length>0){b.length=0;for(let U=0;U<a.length;U+=1)b.push({empty:0,match:0,nomatch:0,total:0,name:a[U].name,lower:a[U].lower,index:a[U].index})}},"clear"),C=o(function(U,L){switch(U.total+=1,L){case e.EMPTY:U.empty+=1;break;case e.MATCH:U.match+=1;break;case e.NOMATCH:U.nomatch+=1;break;default:throw new Error(`${i}collect(): incStat(): unrecognized state: ${L}`)}},"incStat"),B=o(function(U,L){let F="";return F+="<tr>",F+=`<td class="${n.CLASS_ACTIVE}">${U}</td>`,F+=`<td class="${n.CLASS_EMPTY}">${L.empty}</td>`,F+=`<td class="${n.CLASS_MATCH}">${L.match}</td>`,F+=`<td class="${n.CLASS_NOMATCH}">${L.nomatch}</td>`,F+=`<td class="${n.CLASS_ACTIVE}">${L.total}</td>`,F+=`</tr>
273
273
  `,F},"displayRow"),z=o(function(){let U="";return U+=B("ALT",f[e.ALT]),U+=B("CAT",f[e.CAT]),U+=B("REP",f[e.REP]),U+=B("RNM",f[e.RNM]),U+=B("TRG",f[e.TRG]),U+=B("TBS",f[e.TBS]),U+=B("TLS",f[e.TLS]),U+=B("UDT",f[e.UDT]),U+=B("AND",f[e.AND]),U+=B("NOT",f[e.NOT]),U+=B("BKR",f[e.BKR]),U+=B("BKA",f[e.BKA]),U+=B("BKN",f[e.BKN]),U+=B("ABG",f[e.ABG]),U+=B("AEN",f[e.AEN]),U+=B("totals",u),U},"displayOpsOnly"),H=o(function(){let U="";U+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
274
274
  `,U+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
275
275
  `;for(let L=0;L<s.length;L+=1)p[L].total>0&&(U+="<tr>",U+=`<td class="${n.CLASS_ACTIVE}">${p[L].name}</td>`,U+=`<td class="${n.CLASS_EMPTY}">${p[L].empty}</td>`,U+=`<td class="${n.CLASS_MATCH}">${p[L].match}</td>`,U+=`<td class="${n.CLASS_NOMATCH}">${p[L].nomatch}</td>`,U+=`<td class="${n.CLASS_ACTIVE}">${p[L].total}</td>`,U+=`</tr>
@@ -284,7 +284,7 @@ table.apg-attrs a:hover {
284
284
  `,F+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
285
285
  `,F+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
286
286
  `;let ne=!0;for(;ne;){if(U===void 0){F+=z();break}if(U===null){F+=z();break}if(U==="ops"){F+=z();break}if(U==="index"){p.sort(T),b.length>0&&b.sort(T),F+=z(),F+=H();break}if(U==="hits"){p.sort(O),b.length>0&&b.sort(T),F+=z(),F+=H();break}if(U==="alpha"){p.sort(A),b.length>0&&b.sort(A),F+=z(),F+=H();break}break}return F+=`</table>
287
- `,F},"toHtml"),this.toHtmlPage=o(function(U,L,F){return t.htmlToPage(this.toHtml(U,L),F)},"toHtmlPage")},"statsFunc")});var F2=me((IL,U2)=>{U2.exports=o(function(){let e=ss(),t=Nf(),n=new(x0()),i=Tn(),s="trace.js: ",a=this,f=16,u=10,p=8,b=32,x=80,A=5,O=[],T=5e3,k=-1,$=0,C=0,B=[],z=null,H=null,X=null,U=[],L=[],F=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,ne=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,D=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,l=o(function(){let N=o(function(V){U[i.ALT]=V,U[i.CAT]=V,U[i.REP]=V,U[i.TLS]=V,U[i.TBS]=V,U[i.TRG]=V,U[i.AND]=V,U[i.NOT]=V,U[i.BKR]=V,U[i.BKA]=V,U[i.BKN]=V,U[i.ABG]=V,U[i.AEN]=V},"setOperators"),R=0;for(let V in a.filter.operators)R+=1;if(R===0){N(!1);return}for(let V in a.filter.operators){let W=V.toUpperCase();if(W==="<ALL>"){N(!0);return}if(W==="<NONE>"){N(!1);return}}N(!1);for(let V in a.filter.operators){let W=V.toUpperCase();if(W==="ALT")U[i.ALT]=a.filter.operators[V]===!0;else if(W==="CAT")U[i.CAT]=a.filter.operators[V]===!0;else if(W==="REP")U[i.REP]=a.filter.operators[V]===!0;else if(W==="AND")U[i.AND]=a.filter.operators[V]===!0;else if(W==="NOT")U[i.NOT]=a.filter.operators[V]===!0;else if(W==="TLS")U[i.TLS]=a.filter.operators[V]===!0;else if(W==="TBS")U[i.TBS]=a.filter.operators[V]===!0;else if(W==="TRG")U[i.TRG]=a.filter.operators[V]===!0;else if(W==="BKR")U[i.BKR]=a.filter.operators[V]===!0;else if(W==="BKA")U[i.BKA]=a.filter.operators[V]===!0;else if(W==="BKN")U[i.BKN]=a.filter.operators[V]===!0;else if(W==="ABG")U[i.ABG]=a.filter.operators[V]===!0;else if(W==="AEN")U[i.AEN]=a.filter.operators[V]===!0;else throw new Error(`${s}initOpratorFilter: '${V}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),v=o(function(){let N=o(function(ee){U[i.RNM]=ee,U[i.UDT]=ee;let he=H.length+X.length;L.length=0;for(let fe=0;fe<he;fe+=1)L.push(ee)},"setRules"),R,V,W=[];for(V=0;V<H.length;V+=1)W.push(H[V].lower);for(V=0;V<X.length;V+=1)W.push(X[V].lower);L.length=0,R=0;for(let ee in a.filter.rules)R+=1;if(R===0){N(!0);return}for(let ee in a.filter.rules){let he=ee.toLowerCase();if(he==="<all>"){N(!0);return}if(he==="<none>"){N(!1);return}}N(!1),U[i.RNM]=!0,U[i.UDT]=!0;for(let ee in a.filter.rules){let he=ee.toLowerCase();if(V=W.indexOf(he),V<0)throw new Error(`${s}initRuleFilter: '${ee}' not a valid rule or udt name`);L[V]=a.filter.rules[ee]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(N,R){if(k=-1,typeof N=="number"&&N>0)T=Math.ceil(N);else{T=0;return}typeof R=="number"&&(k=Math.floor(R),k<0&&(k=-1))},this.getMaxRecords=function(){return T},this.getLastRecord=function(){return k},this.init=function(N,R,V){O.length=0,B.length=0,$=0,C=0,z=V,H=N,X=R,l(),v(),n.init(T)};let h=o(function(N){let R=!1;return N.type===i.RNM?U[N.type]&&L[N.index]?R=!0:R=!1:N.type===i.UDT?U[N.type]&&L[H.length+N.index]?R=!0:R=!1:R=U[N.type],R},"filterOps"),c=o(function(N){return k===-1||N<=k},"filterRecords");this.down=function(N,R,V,W,ee,he){c($)&&h(N)&&(B.push($),O[n.increment()]={dirUp:!1,depth:C,thisLine:$,thatLine:void 0,opcode:N,state:R,phraseIndex:V,phraseLength:W,lookAnchor:ee,lookAround:he},$+=1,C+=1)},this.up=function(N,R,V,W,ee,he){if(c($)&&h(N)){let fe=$,Y=B.pop(),pe=n.getListIndex(Y);pe!==-1&&(O[pe].thatLine=fe),C-=1,O[n.increment()]={dirUp:!0,depth:C,thisLine:fe,thatLine:Y,opcode:N,state:R,phraseIndex:V,phraseLength:W,lookAnchor:ee,lookAround:he},$+=1}};let d=o(function(){function N(P,j){let ae,ue,le;if(j)switch(P.op={id:j.type,name:e.opcodeToString(j.type)},P.opData=void 0,j.type){case i.RNM:P.opData=H[j.index].name;break;case i.UDT:P.opData=X[j.index].name;break;case i.BKR:j.index<H.length?ae=H[j.index].name:ae=X[j.index-H.length].name,ue=j.bkrCase===i.BKR_MODE_CI?"%i":"%s",le=j.bkrMode===i.BKR_MODE_UM?"%u":"%p",P.opData=`\\\\${ue}${le}${ae}`;break;case i.TLS:P.opData=[];for(let ge=0;ge<j.string.length;ge+=1)P.opData.push(j.string[ge]);break;case i.TBS:P.opData=[];for(let ge=0;ge<j.string.length;ge+=1)P.opData.push(j.string[ge]);break;case i.TRG:P.opData=[j.min,j.max];break;case i.REP:P.opData=[j.min,j.max];break;default:throw new Error("unrecognized opcode")}else P.op={id:void 0,name:void 0},P.opData=void 0}o(N,"nodeOpcode");function R(P,j,ae){return P===i.MATCH?{index:j,length:ae}:P===i.NOMATCH?{index:j,length:0}:P===i.EMPTY?{index:j,length:0}:null}o(R,"nodePhrase");let V=-1;function W(P,j,ae){let ue={id:V++,branch:-1,parent:P,up:!1,down:!1,depth:ae,children:[]};return j?(ue.down=!0,ue.state={id:j.state,name:e.stateToString(j.state)},ue.phrase=null,N(ue,j.opcode)):(ue.state={id:void 0,name:void 0},ue.phrase=R(),N(ue,void 0)),ue}o(W,"nodeDown");function ee(P,j){j&&(P.up=!0,P.state={id:j.state,name:e.stateToString(j.state)},P.phrase=R(j.state,j.phraseIndex,j.phraseLength),P.down||N(P,j.opcode))}o(ee,"nodeUp");let he=0,fe=-1,Y=1;function pe(P){if(fe+=1,P.branch=Y,fe>C&&(C=fe),P.children.length===0)he+=1;else for(let j=0;j<P.children.length;j+=1)j>0&&(Y+=1),P.children[j].leftMost=!1,P.children[j].rightMost=!1,P.leftMost&&(P.children[j].leftMost=j===0),P.rightMost&&(P.children[j].rightMost=j===P.children.length-1),pe(P.children[j]);fe-=1}o(pe,"walk");function Q(P,j){let ae,ue={};if(ue.id=P.id,ue.branch=P.branch,ue.leftMost=P.leftMost,ue.rightMost=P.rightMost,ae=P.state.name?P.state.name:"ACTIVE",ue.state={id:P.state.id,name:ae},ae=P.op.name?P.op.name:"?",ue.op={id:P.op.id,name:ae},typeof P.opData=="string")ue.opData=P.opData;else if(Array.isArray(P.opData)){ue.opData=[];for(let le=0;le<P.opData.length;le+=1)ue.opData[le]=P.opData[le]}else ue.opData=void 0;P.phrase?ue.phrase={index:P.phrase.index,length:P.phrase.length}:ue.phrase=null,ue.depth=P.depth,ue.children=[];for(let le=0;le<P.children.length;le+=1){let ge=le!==P.children.length-1;ue.children[le]=Q(P.children[le],j,ge)}return ue}o(Q,"display");let ce=[],q,se,be,ke,we=!0,Oe=W(null,null,-1);for(ce.push(Oe),se=Oe,n.forEach(P=>{if(ke=O[P],we&&(we=!1,ke.depth>0)){let j=ke.dirUp?ke.depth+1:ke.depth;for(let ae=0;ae<j;ae+=1)be=se,se=W(se,null,ae),ce.push(se),be.children.push(se)}ke.dirUp?(se=ce.pop(),ee(se,ke),se=ce[ce.length-1]):(be=se,se=W(se,ke,ke.depth),ce.push(se),be.children.push(se))});ce.length>1;)se=ce.pop(),ee(se,null);if(Oe.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(ce.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");q=Oe.children[0];let vr=q;for(;q&&!q.down&&!q.up;)vr=q,q=q.children[0];q=vr,q.leftMost=!0,q.rightMost=!0,pe(q),q.branch=0;let te={};te.string=[];for(let P=0;P<z.length;P+=1)te.string[P]=z[P];te.rules=[];for(let P=0;P<H.length;P+=1)te.rules[P]=H[P].name;te.udts=[];for(let P=0;P<X.length;P+=1)te.udts[P]=X[P].name;te.id={},te.id.ALT={id:i.ALT,name:"ALT"},te.id.CAT={id:i.CAT,name:"CAT"},te.id.REP={id:i.REP,name:"REP"},te.id.RNM={id:i.RNM,name:"RNM"},te.id.TLS={id:i.TLS,name:"TLS"},te.id.TBS={id:i.TBS,name:"TBS"},te.id.TRG={id:i.TRG,name:"TRG"},te.id.UDT={id:i.UDT,name:"UDT"},te.id.AND={id:i.AND,name:"AND"},te.id.NOT={id:i.NOT,name:"NOT"},te.id.BKR={id:i.BKR,name:"BKR"},te.id.BKA={id:i.BKA,name:"BKA"},te.id.BKN={id:i.BKN,name:"BKN"},te.id.ABG={id:i.ABG,name:"ABG"},te.id.AEN={id:i.AEN,name:"AEN"},te.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},te.id.MATCH={id:i.MATCH,name:"MATCH"},te.id.EMPTY={id:i.EMPTY,name:"EMPTY"},te.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},te.treeDepth=C,te.leafNodes=he;let G;return q.down?q.up?G="none":G="right":q.up?G="left":G="both",te.branchesIncomplete=G,te.tree=Q(q,q.depth,!1),te},"toTreeObj");this.toTree=function(N){let R=d();return N?JSON.stringify(R):R},this.toHtmlPage=function(N,R,V){return e.htmlToPage(this.toHtml(N,R),V)};let y=o(function(N,R){let V;switch(N){case f:V="hexadecimal";break;case u:V="decimal";break;case p:V="ASCII";break;case b:V="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${N}`)}let W="";return W+=`<p>display mode: ${V}</p>
287
+ `,F},"toHtml"),this.toHtmlPage=o(function(U,L,F){return t.htmlToPage(this.toHtml(U,L),F)},"toHtmlPage")},"statsFunc")});var H2=me((OL,q2)=>{q2.exports=o(function(){let e=ss(),t=Nf(),n=new(x0()),i=Tn(),s="trace.js: ",a=this,f=16,u=10,p=8,b=32,x=80,A=5,O=[],T=5e3,k=-1,$=0,C=0,B=[],z=null,H=null,X=null,U=[],L=[],F=`<span class="${t.CLASS_LINEEND}">&bull;</span>`,ne=`<span class="${t.CLASS_LINEEND}">&hellip;</span>`,D=`<span class="${t.CLASS_EMPTY}">&#120634;</span>`,l=o(function(){let N=o(function(V){U[i.ALT]=V,U[i.CAT]=V,U[i.REP]=V,U[i.TLS]=V,U[i.TBS]=V,U[i.TRG]=V,U[i.AND]=V,U[i.NOT]=V,U[i.BKR]=V,U[i.BKA]=V,U[i.BKN]=V,U[i.ABG]=V,U[i.AEN]=V},"setOperators"),R=0;for(let V in a.filter.operators)R+=1;if(R===0){N(!1);return}for(let V in a.filter.operators){let W=V.toUpperCase();if(W==="<ALL>"){N(!0);return}if(W==="<NONE>"){N(!1);return}}N(!1);for(let V in a.filter.operators){let W=V.toUpperCase();if(W==="ALT")U[i.ALT]=a.filter.operators[V]===!0;else if(W==="CAT")U[i.CAT]=a.filter.operators[V]===!0;else if(W==="REP")U[i.REP]=a.filter.operators[V]===!0;else if(W==="AND")U[i.AND]=a.filter.operators[V]===!0;else if(W==="NOT")U[i.NOT]=a.filter.operators[V]===!0;else if(W==="TLS")U[i.TLS]=a.filter.operators[V]===!0;else if(W==="TBS")U[i.TBS]=a.filter.operators[V]===!0;else if(W==="TRG")U[i.TRG]=a.filter.operators[V]===!0;else if(W==="BKR")U[i.BKR]=a.filter.operators[V]===!0;else if(W==="BKA")U[i.BKA]=a.filter.operators[V]===!0;else if(W==="BKN")U[i.BKN]=a.filter.operators[V]===!0;else if(W==="ABG")U[i.ABG]=a.filter.operators[V]===!0;else if(W==="AEN")U[i.AEN]=a.filter.operators[V]===!0;else throw new Error(`${s}initOpratorFilter: '${V}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),v=o(function(){let N=o(function(ee){U[i.RNM]=ee,U[i.UDT]=ee;let he=H.length+X.length;L.length=0;for(let fe=0;fe<he;fe+=1)L.push(ee)},"setRules"),R,V,W=[];for(V=0;V<H.length;V+=1)W.push(H[V].lower);for(V=0;V<X.length;V+=1)W.push(X[V].lower);L.length=0,R=0;for(let ee in a.filter.rules)R+=1;if(R===0){N(!0);return}for(let ee in a.filter.rules){let he=ee.toLowerCase();if(he==="<all>"){N(!0);return}if(he==="<none>"){N(!1);return}}N(!1),U[i.RNM]=!0,U[i.UDT]=!0;for(let ee in a.filter.rules){let he=ee.toLowerCase();if(V=W.indexOf(he),V<0)throw new Error(`${s}initRuleFilter: '${ee}' not a valid rule or udt name`);L[V]=a.filter.rules[ee]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(N,R){if(k=-1,typeof N=="number"&&N>0)T=Math.ceil(N);else{T=0;return}typeof R=="number"&&(k=Math.floor(R),k<0&&(k=-1))},this.getMaxRecords=function(){return T},this.getLastRecord=function(){return k},this.init=function(N,R,V){O.length=0,B.length=0,$=0,C=0,z=V,H=N,X=R,l(),v(),n.init(T)};let h=o(function(N){let R=!1;return N.type===i.RNM?U[N.type]&&L[N.index]?R=!0:R=!1:N.type===i.UDT?U[N.type]&&L[H.length+N.index]?R=!0:R=!1:R=U[N.type],R},"filterOps"),c=o(function(N){return k===-1||N<=k},"filterRecords");this.down=function(N,R,V,W,ee,he){c($)&&h(N)&&(B.push($),O[n.increment()]={dirUp:!1,depth:C,thisLine:$,thatLine:void 0,opcode:N,state:R,phraseIndex:V,phraseLength:W,lookAnchor:ee,lookAround:he},$+=1,C+=1)},this.up=function(N,R,V,W,ee,he){if(c($)&&h(N)){let fe=$,Y=B.pop(),pe=n.getListIndex(Y);pe!==-1&&(O[pe].thatLine=fe),C-=1,O[n.increment()]={dirUp:!0,depth:C,thisLine:fe,thatLine:Y,opcode:N,state:R,phraseIndex:V,phraseLength:W,lookAnchor:ee,lookAround:he},$+=1}};let d=o(function(){function N(P,j){let ae,ue,le;if(j)switch(P.op={id:j.type,name:e.opcodeToString(j.type)},P.opData=void 0,j.type){case i.RNM:P.opData=H[j.index].name;break;case i.UDT:P.opData=X[j.index].name;break;case i.BKR:j.index<H.length?ae=H[j.index].name:ae=X[j.index-H.length].name,ue=j.bkrCase===i.BKR_MODE_CI?"%i":"%s",le=j.bkrMode===i.BKR_MODE_UM?"%u":"%p",P.opData=`\\\\${ue}${le}${ae}`;break;case i.TLS:P.opData=[];for(let ge=0;ge<j.string.length;ge+=1)P.opData.push(j.string[ge]);break;case i.TBS:P.opData=[];for(let ge=0;ge<j.string.length;ge+=1)P.opData.push(j.string[ge]);break;case i.TRG:P.opData=[j.min,j.max];break;case i.REP:P.opData=[j.min,j.max];break;default:throw new Error("unrecognized opcode")}else P.op={id:void 0,name:void 0},P.opData=void 0}o(N,"nodeOpcode");function R(P,j,ae){return P===i.MATCH?{index:j,length:ae}:P===i.NOMATCH?{index:j,length:0}:P===i.EMPTY?{index:j,length:0}:null}o(R,"nodePhrase");let V=-1;function W(P,j,ae){let ue={id:V++,branch:-1,parent:P,up:!1,down:!1,depth:ae,children:[]};return j?(ue.down=!0,ue.state={id:j.state,name:e.stateToString(j.state)},ue.phrase=null,N(ue,j.opcode)):(ue.state={id:void 0,name:void 0},ue.phrase=R(),N(ue,void 0)),ue}o(W,"nodeDown");function ee(P,j){j&&(P.up=!0,P.state={id:j.state,name:e.stateToString(j.state)},P.phrase=R(j.state,j.phraseIndex,j.phraseLength),P.down||N(P,j.opcode))}o(ee,"nodeUp");let he=0,fe=-1,Y=1;function pe(P){if(fe+=1,P.branch=Y,fe>C&&(C=fe),P.children.length===0)he+=1;else for(let j=0;j<P.children.length;j+=1)j>0&&(Y+=1),P.children[j].leftMost=!1,P.children[j].rightMost=!1,P.leftMost&&(P.children[j].leftMost=j===0),P.rightMost&&(P.children[j].rightMost=j===P.children.length-1),pe(P.children[j]);fe-=1}o(pe,"walk");function Q(P,j){let ae,ue={};if(ue.id=P.id,ue.branch=P.branch,ue.leftMost=P.leftMost,ue.rightMost=P.rightMost,ae=P.state.name?P.state.name:"ACTIVE",ue.state={id:P.state.id,name:ae},ae=P.op.name?P.op.name:"?",ue.op={id:P.op.id,name:ae},typeof P.opData=="string")ue.opData=P.opData;else if(Array.isArray(P.opData)){ue.opData=[];for(let le=0;le<P.opData.length;le+=1)ue.opData[le]=P.opData[le]}else ue.opData=void 0;P.phrase?ue.phrase={index:P.phrase.index,length:P.phrase.length}:ue.phrase=null,ue.depth=P.depth,ue.children=[];for(let le=0;le<P.children.length;le+=1){let ge=le!==P.children.length-1;ue.children[le]=Q(P.children[le],j,ge)}return ue}o(Q,"display");let ce=[],q,se,be,ke,we=!0,Oe=W(null,null,-1);for(ce.push(Oe),se=Oe,n.forEach(P=>{if(ke=O[P],we&&(we=!1,ke.depth>0)){let j=ke.dirUp?ke.depth+1:ke.depth;for(let ae=0;ae<j;ae+=1)be=se,se=W(se,null,ae),ce.push(se),be.children.push(se)}ke.dirUp?(se=ce.pop(),ee(se,ke),se=ce[ce.length-1]):(be=se,se=W(se,ke,ke.depth),ce.push(se),be.children.push(se))});ce.length>1;)se=ce.pop(),ee(se,null);if(Oe.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(ce.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");q=Oe.children[0];let vr=q;for(;q&&!q.down&&!q.up;)vr=q,q=q.children[0];q=vr,q.leftMost=!0,q.rightMost=!0,pe(q),q.branch=0;let te={};te.string=[];for(let P=0;P<z.length;P+=1)te.string[P]=z[P];te.rules=[];for(let P=0;P<H.length;P+=1)te.rules[P]=H[P].name;te.udts=[];for(let P=0;P<X.length;P+=1)te.udts[P]=X[P].name;te.id={},te.id.ALT={id:i.ALT,name:"ALT"},te.id.CAT={id:i.CAT,name:"CAT"},te.id.REP={id:i.REP,name:"REP"},te.id.RNM={id:i.RNM,name:"RNM"},te.id.TLS={id:i.TLS,name:"TLS"},te.id.TBS={id:i.TBS,name:"TBS"},te.id.TRG={id:i.TRG,name:"TRG"},te.id.UDT={id:i.UDT,name:"UDT"},te.id.AND={id:i.AND,name:"AND"},te.id.NOT={id:i.NOT,name:"NOT"},te.id.BKR={id:i.BKR,name:"BKR"},te.id.BKA={id:i.BKA,name:"BKA"},te.id.BKN={id:i.BKN,name:"BKN"},te.id.ABG={id:i.ABG,name:"ABG"},te.id.AEN={id:i.AEN,name:"AEN"},te.id.ACTIVE={id:i.ACTIVE,name:"ACTIVE"},te.id.MATCH={id:i.MATCH,name:"MATCH"},te.id.EMPTY={id:i.EMPTY,name:"EMPTY"},te.id.NOMATCH={id:i.NOMATCH,name:"NOMATCH"},te.treeDepth=C,te.leafNodes=he;let G;return q.down?q.up?G="none":G="right":q.up?G="left":G="both",te.branchesIncomplete=G,te.tree=Q(q,q.depth,!1),te},"toTreeObj");this.toTree=function(N){let R=d();return N?JSON.stringify(R):R},this.toHtmlPage=function(N,R,V){return e.htmlToPage(this.toHtml(N,R),V)};let y=o(function(N,R){let V;switch(N){case f:V="hexadecimal";break;case u:V="decimal";break;case p:V="ASCII";break;case b:V="UNICODE";break;default:throw new Error(`${s}htmlHeader: unrecognized mode: ${N}`)}let W="";return W+=`<p>display mode: ${V}</p>
288
288
  `,W+=`<table class="${t.CLASS_TRACE}">
289
289
  `,typeof R=="string"&&(W+=`<caption>${R}</caption>`),W},"htmlHeader"),_=o(function(){let N="";return N+=`</table>
290
290
  `,N+=`<p class="${t.CLASS_MONOSPACE}">legend:<br>
@@ -333,7 +333,7 @@ table.apg-attrs a:hover {
333
333
  `,n.forEach(pe=>{let Q=O[pe];switch(V=Q.thisLine,W=Q.thatLine!==void 0?Q.thatLine:"--",ee=!1,he=!1,fe=!1,Q.lookAround===i.LOOKAROUND_AHEAD&&(ee=!0,fe=!0,Y=Q.lookAnchor),(Q.opcode.type===i.AND||Q.opcode.type===i.NOT)&&(ee=!0,fe=!0,Y=Q.phraseIndex),Q.lookAround===i.LOOKAROUND_BEHIND&&(he=!0,fe=!0,Y=Q.lookAnchor),(Q.opcode.type===i.BKA||Q.opcode.type===i.BKN)&&(he=!0,fe=!0,Y=Q.phraseIndex),R+="<tr>",R+=`<td>${V}</td><td>${W}</td>`,R+=`<td>${Q.phraseIndex}</td>`,R+=`<td>${Q.phraseLength}</td>`,R+=`<td>${Q.depth}</td>`,R+="<td>",Q.state){case i.ACTIVE:R+=`<span class="${t.CLASS_ACTIVE}">&darr;&nbsp;</span>`;break;case i.MATCH:R+=`<span class="${t.CLASS_MATCH}">&uarr;M</span>`;break;case i.NOMATCH:R+=`<span class="${t.CLASS_NOMATCH}">&uarr;N</span>`;break;case i.EMPTY:R+=`<span class="${t.CLASS_EMPTY}">&uarr;E</span>`;break;default:R+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(R+="</td>",R+="<td>",R+=a.indent(Q.depth),ee?R+=`<span class="${t.CLASS_LOOKAHEAD}">`:he&&(R+=`<span class="${t.CLASS_LOOKBEHIND}">`),R+=e.opcodeToString(Q.opcode.type),Q.opcode.type===i.RNM&&(R+=`(${H[Q.opcode.index].name}) `),Q.opcode.type===i.BKR){let ce=Q.opcode.bkrCase===i.BKR_MODE_CI?"%i":"%s",q=Q.opcode.bkrMode===i.BKR_MODE_UM?"%u":"%p";R+=`(\\${ce}${q}${H[Q.opcode.index].name}) `}Q.opcode.type===i.UDT&&(R+=`(${X[Q.opcode.index].name}) `),Q.opcode.type===i.TRG&&(R+=`(${w(N,Q.opcode)}) `),Q.opcode.type===i.TBS&&(R+=`(${E(N,Q.opcode)}) `),Q.opcode.type===i.TLS&&(R+=`(${I(N,Q.opcode)}) `),Q.opcode.type===i.REP&&(R+=`(${m(N,Q.opcode)}) `),fe&&(R+="</span>"),R+="</td>",R+="<td>",he?R+=S(N,z,Q.state,Q.phraseIndex,Q.phraseLength,Y):ee?R+=M(N,z,Q.state,Q.phraseIndex,Q.phraseLength):R+=K(N,z,Q.state,Q.phraseIndex,Q.phraseLength),R+=`</td></tr>
334
334
  `}),R+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",R+=`<th>operator</th><th>phrase</th></tr>
335
335
  `,R+=`</table>
336
- `,R},"htmlTable");this.toHtml=function(N,R){let V=p;if(typeof N=="string"&&N.length>=3){let ee=N.toLowerCase().slice(0,3);ee==="hex"?V=f:ee==="dec"?V=u:ee==="uni"&&(V=b)}let W="";return W+=y(V,R),W+=J(V),W+=_(),W}},"exportTrace")});var as=me((OL,$2)=>{$2.exports={ast:O2(),circular:x0(),ids:Tn(),parser:R2(),stats:B2(),trace:F2(),utils:ss(),emitcss:v0(),style:Nf()}});var H2=me((PL,q2)=>{q2.exports=o(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=o(function(){let t="";return t+=`file = *line [last-line]
336
+ `,R},"htmlTable");this.toHtml=function(N,R){let V=p;if(typeof N=="string"&&N.length>=3){let ee=N.toLowerCase().slice(0,3);ee==="hex"?V=f:ee==="dec"?V=u:ee==="uni"&&(V=b)}let W="";return W+=y(V,R),W+=J(V),W+=_(),W}},"exportTrace")});var as=me((PL,z2)=>{z2.exports={ast:R2(),circular:x0(),ids:Tn(),parser:U2(),stats:$2(),trace:H2(),utils:ss(),emitcss:v0(),style:Nf()}});var K2=me((NL,j2)=>{j2.exports=o(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=o(function(){let t="";return t+=`file = *line [last-line]
337
337
  `,t+=`line = line-text end
338
338
  `,t+=`line-text = *(valid/invalid)
339
339
  `,t+=`last-line = 1*(valid/invalid)
@@ -343,7 +343,7 @@ table.apg-attrs a:hover {
343
343
  `,t+=`CRLF = %d13.10
344
344
  `,t+=`LF = %d10
345
345
  `,t+=`CR = %d13
346
- `,t},"toString")},"grammar")});var j2=me(z2=>{var cr=Tn(),WS=ss();function GS(r,e,t,n,i){return r===cr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.lines.push({lineNo:i.lines.length,beginChar:t,length:n,textLength:i.textLength,endType:i.endType,invalidChars:i.invalidCount}),cr.SEM_OK}o(GS,"semLine");function YS(r,e,t,n,i){return r===cr.SEM_PRE&&(i.textLength=n),cr.SEM_OK}o(YS,"semLineText");function JS(r,e,t,n,i){return r===cr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.strict?(i.lines.push({lineNo:i.lines.length,beginChar:t,length:n,textLength:n,endType:"none",invalidChars:i.invalidCount}),i.errors.push({line:i.lineNo,char:t+n,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(e.push(10),i.lines.push({lineNo:i.lines.length,beginChar:t,length:n+1,textLength:n,endType:"LF",invalidChars:i.invalidCount})),cr.SEM_OK}o(JS,"semLastLine");function XS(r,e,t,n,i){return r===cr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${WS.charToHex(e[t])}'`}),cr.SEM_OK}o(XS,"semInvalid");function ZS(r,e,t,n,i){return r===cr.SEM_POST&&(i.lineNo+=1),cr.SEM_OK}o(ZS,"semEnd");function QS(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="LF",i.strict&&i.errors.push({line:i.lineNo,char:t,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),cr.SEM_OK}o(QS,"semLF");function eM(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="CR",i.strict&&i.errors.push({line:i.lineNo,char:t,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),cr.SEM_OK}o(eM,"semCR");function tM(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="CRLF"),cr.SEM_OK}o(tM,"semCRLF");var Pi=[];Pi.line=GS;Pi["line-text"]=YS;Pi["last-line"]=JS;Pi.invalid=XS;Pi.end=ZS;Pi.lf=QS;Pi.cr=eM;Pi.crlf=tM;z2.callbacks=Pi});var V2=me((RL,K2)=>{K2.exports=o(function(e,t,n,i){let s="scanner.js: ",a=as(),f=new(H2()),{callbacks:u}=j2(),p=[],b=new a.parser;if(b.ast=new a.ast,b.ast.callbacks=u,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);b.trace=i}if(b.parse(f,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let A={lines:p,lineNo:0,errors:t,strict:!!n};return b.ast.translate(A),p},"exfn")});var G2=me((LL,W2)=>{W2.exports=o(function(){let e="syntax-callbacks.js: ",t=as(),n=t.ids,i,s=o(function(I,g,S,ie){switch(I.state){case n.ACTIVE:ie.altStack=[],ie.repCount=0;break;case n.EMPTY:ie.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:ie.ruleCount===0&&ie.errors.push({line:0,char:0,msg:"no rules defined"});break;case n.NOMATCH:throw new Error(`${e}synFile: grammar file NOMATCH: design error: should never happen.`);default:throw new Error(`${e}synFile: unrecognized case.`)}},"synFile"),a=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:S.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},S.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:S.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),f=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),u=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),p=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),b=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),x=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),A=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Positive look-behind operator(&&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),O=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Negative look-behind operator(!!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),T=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Beginning of string anchor(%^) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),k=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"End of string anchor(%$) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),$=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(S.strict){let ie=t.utils.charsToString(I,g,E.phraseLength);S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:`Back reference operator(${ie}) found - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),C=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(S.strict){let ie=t.utils.charsToString(I,g,E.phraseLength);S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:`UDT operator found(${ie}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),B=o(function(E,I,g){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=g;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),z=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:S.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.stringTabChar!==!1&&S.errors.push({line:S.findLine(S.lines,S.stringTabChar),char:S.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsString"),H=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.stringTabChar=g;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),X=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.tlsOpen),char:i.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),i.basicError=!0,i.tlsOpen=null;break;case n.MATCH:i.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsClose"),U=o(function(E,I,g){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=g;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),L=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:S.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.stringTabChar!==!1&&S.errors.push({line:S.findLine(S.lines,S.stringTabChar),char:S.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),F=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.clsOpen),char:i.clsOpen,msg:"Case-sensitive literal string('...') opened but not closed."}),i.clsOpen=null,i.basicError=!0;break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,i.clsOpen),char:i.clsOpen,msg:"Case-sensitive string operator('...') found - strict ABNF specified."}),i.clsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsClose"),ne=o(function(E,I,g){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=g;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),D=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:S.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.stringTabChar!==!1&&S.errors.push({line:S.findLine(S.lines,S.stringTabChar),char:S.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValString"),l=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),i.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValClose"),v=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:g,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},S.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),h=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=S.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=S.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),c=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:null,groupError:!1,optionOpen:g,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},S.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),d=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=S.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=S.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),y=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),_=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(E.phraseLength===1&&S.strict){let ie=I[g]===13?"CR":"LF";S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:`Line end '${ie}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),w=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),m=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.repCount+=1;break;case n.MATCH:S.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=b,this.callbacks.basicelementerr=y,this.callbacks.clsclose=F,this.callbacks.clsopen=U,this.callbacks.clsstring=L,this.callbacks.definedaserror=p,this.callbacks.file=s,this.callbacks.groupclose=h,this.callbacks.groupopen=v,this.callbacks.lineenderror=w,this.callbacks.lineend=_,this.callbacks.notop=x,this.callbacks.optionclose=d,this.callbacks.optionopen=c,this.callbacks.prosvalclose=l,this.callbacks.prosvalopen=ne,this.callbacks.prosvalstring=D,this.callbacks.repetition=m,this.callbacks.rule=a,this.callbacks.ruleerror=f,this.callbacks.rulenameerror=u,this.callbacks.stringtab=H,this.callbacks.tlsclose=X,this.callbacks.tlsopen=B,this.callbacks.tlsstring=z,this.callbacks.udtop=C,this.callbacks.bkaop=A,this.callbacks.bknop=O,this.callbacks.bkrop=$,this.callbacks.abgop=T,this.callbacks.aenop=k},"exfn")});var J2=me((BL,Y2)=>{Y2.exports=o(function(){let e=as(),t=e.ids,n=o(function(){this.names=[],this.add=o(function(Q){let ce=-1;return this.get(Q)===-1&&(ce={name:Q,lower:Q.toLowerCase(),index:this.names.length},this.names.push(ce)),ce},"add"),this.get=o(function(Q){let ce=-1,q=Q.toLowerCase();for(let se=0;se<this.names.length;se+=1)if(this.names[se].lower===q){ce=this.names[se];break}return ce},"get")},"NameList"),i=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1)q=10*q+pe[se]-48;return q},"decnum"),s=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1)q=2*q+pe[se]-48;return q},"binnum"),a=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1){let be=pe[se];if(be>=48&&be<=57)be-=48;else if(be>=65&&be<=70)be-=55;else if(be>=97&&be<=102)be-=87;else throw new Error("hexnum out of range");q=16*q+be}return q},"hexnum");function f(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)q.ruleNames=new n,q.udtNames=new n,q.rules=[],q.udts=[],q.rulesLineMap=[],q.opcodes=[],q.altStack=[],q.topStack=null,q.topRule=null;else if(Y===t.SEM_POST){let be;q.rules.forEach(ke=>{ke.isBkr=!1,ke.opcodes.forEach(we=>{we.type===t.RNM&&(be=q.ruleNames.get(we.index.name),be===-1?(q.errors.push({line:q.findLine(q.lines,we.index.phraseIndex,q.charsLength),char:we.index.phraseIndex,msg:`Rule name '${we.index.name}' used but not defined.`}),we.index=-1):we.index=be.index)})}),q.udts.forEach(ke=>{ke.isBkr=!1}),q.rules.forEach(ke=>{ke.opcodes.forEach(we=>{we.type===t.BKR&&(ke.hasBkr=!0,be=q.ruleNames.get(we.index.name),be!==-1?(q.rules[be.index].isBkr=!0,we.index=be.index):(be=q.udtNames.get(we.index.name),be!==-1?(q.udts[be.index].isBkr=!0,we.index=q.rules.length+be.index):(q.errors.push({line:q.findLine(q.lines,we.index.phraseIndex,q.charsLength),char:we.index.phraseIndex,msg:`Back reference name '${we.index.name}' refers to undefined rule or unamed UDT.`}),we.index=-1)))})})}return se}o(f,"semFile");function u(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.altStack.length=0,q.topStack=null,q.rulesLineMap.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q})),se}o(u,"semRule");function p(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)q.ruleName="",q.definedas="";else if(Y===t.SEM_POST){let be;q.definedas==="="?(be=q.ruleNames.add(q.ruleName),be===-1?(q.definedas=null,q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`Rule name '${q.ruleName}' previously defined.`})):(q.topRule={name:be.name,lower:be.lower,opcodes:[],index:be.index},q.rules.push(q.topRule),q.opcodes=q.topRule.opcodes)):(be=q.ruleNames.get(q.ruleName),be===-1?(q.definedas=null,q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`Rule name '${q.ruleName}' for incremental alternate not previously defined.`})):(q.topRule=q.rules[be.index],q.opcodes=q.topRule.opcodes))}return se}o(p,"semRuleLookup");function b(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)for(;;){if(q.definedas===null){se=t.SEM_SKIP;break}if(q.topStack===null){if(q.definedas==="="){q.topStack={alt:{type:t.ALT,children:[]},cat:null},q.altStack.push(q.topStack),q.opcodes.push(q.topStack.alt);break}q.topStack={alt:q.opcodes[0],cat:null},q.altStack.push(q.topStack);break}q.topStack={alt:{type:t.ALT,children:[]},cat:null},q.altStack.push(q.topStack),q.opcodes.push(q.topStack.alt);break}else Y===t.SEM_POST&&(q.altStack.pop(),q.altStack.length>0?q.topStack=q.altStack[q.altStack.length-1]:q.topStack=null);return se}o(b,"semAlternation");function x(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.topStack.alt.children.push(q.opcodes.length),q.topStack.cat={type:t.CAT,children:[]},q.opcodes.push(q.topStack.cat)):Y===t.SEM_POST&&(q.topStack.cat=null),se}o(x,"semConcatenation");function A(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&q.topStack.cat.children.push(q.opcodes.length),se}o(A,"semRepetition");function O(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.REP,min:0,max:1,char:Q}),se}o(O,"semOptionOpen");function T(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.ruleName=e.utils.charsToString(pe,Q,ce)),se}o(T,"semRuleName");function k(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.definedas="="),se}o(k,"semDefined");function $(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.definedas="=/"),se}o($,"semIncAlt");function C(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.min=0,q.max=1/0,q.topRep={type:t.REP,min:0,max:1/0},q.opcodes.push(q.topRep)):Y===t.SEM_POST&&(q.min>q.max&&q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`repetition min cannot be greater than max: min: ${q.min}: max: ${q.max}`}),q.topRep.min=q.min,q.topRep.max=q.max),se}o(C,"semRepOp");function B(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=i(pe,Q,ce)),se}o(B,"semRepMin");function z(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce)),se}o(z,"semRepMax");function H(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce),q.min=q.max),se}o(H,"semRepMinMax");function X(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.AND}),se}o(X,"semAndOp");function U(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.NOT}),se}o(U,"semNotOp");function L(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.RNM,index:{phraseIndex:Q,name:e.utils.charsToString(pe,Q,ce)}}),se}o(L,"semRnmOp");function F(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.ABG}),se}o(F,"semAbgOp");function ne(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.AEN}),se}o(ne,"semAenOp");function D(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.BKA}),se}o(D,"semBkaOp");function l(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.BKN}),se}o(l,"semBknOp");function v(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.ci=!0,q.cs=!1,q.um=!0,q.pm=!1):Y===t.SEM_POST&&q.opcodes.push({type:t.BKR,bkrCase:q.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:q.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:q.bkrname.phraseIndex,name:e.utils.charsToString(pe,q.bkrname.phraseIndex,q.bkrname.phraseLength)}}),se}o(v,"semBkrOp");function h(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.ci=!0),se}o(h,"semBkrCi");function c(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.cs=!0),se}o(c,"semBkrCs");function d(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.um=!0),se}o(d,"semBkrUm");function y(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.pm=!0),se}o(y,"semBkrPm");function _(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.bkrname={phraseIndex:Q,phraseLength:ce}),se}o(_,"semBkrName");function w(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST){let be=e.utils.charsToString(pe,Q,ce),ke=q.udtNames.add(be);if(ke===-1){if(ke=q.udtNames.get(be),ke===-1)throw new Error("semUdtEmpty: name look up error")}else q.udts.push({name:ke.name,lower:ke.lower,index:ke.index,empty:!0});q.opcodes.push({type:t.UDT,empty:!0,index:ke.index})}return se}o(w,"semUdtEmpty");function m(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST){let be=e.utils.charsToString(pe,Q,ce),ke=q.udtNames.add(be);if(ke===-1){if(ke=q.udtNames.get(be),ke===-1)throw new Error("semUdtNonEmpty: name look up error")}else q.udts.push({name:ke.name,lower:ke.lower,index:ke.index,empty:!1});q.opcodes.push({type:t.UDT,empty:!1,index:ke.index,syntax:null,semantic:null})}return se}o(m,"semUdtNonEmpty");function E(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.tlscase=!0),se}o(E,"semTlsOp");function I(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&ce>0&&(pe[Q+1]===83||pe[Q+1]===115)&&(q.tlscase=!1),se}o(I,"semTlsCase");function g(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST)if(q.tlscase){let be=pe.slice(Q,Q+ce);for(let ke=0;ke<be.length;ke+=1)be[ke]>=65&&be[ke]<=90&&(be[ke]+=32);q.opcodes.push({type:t.TLS,string:be})}else q.opcodes.push({type:t.TBS,string:pe.slice(Q,Q+ce)});return se}o(g,"semTlsString");function S(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(ce<=2?q.opcodes.push({type:t.TLS,string:[]}):q.opcodes.push({type:t.TBS,string:pe.slice(Q+1,Q+ce-1)})),se}o(S,"semClsOp");function ie(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?q.tbsstr=[]:Y===t.SEM_POST&&q.opcodes.push({type:t.TBS,string:q.tbsstr}),se}o(ie,"semTbsOp");function M(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.min=0,q.max=0):Y===t.SEM_POST&&(q.min>q.max&&q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${q.min}: max: ${q.max}`}),q.opcodes.push({type:t.TRG,min:q.min,max:q.max})),se}o(M,"semTrgOp");function K(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=i(pe,Q,ce)),se}o(K,"semDmin");function J(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce)),se}o(J,"semDmax");function N(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=s(pe,Q,ce)),se}o(N,"semBmin");function R(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=s(pe,Q,ce)),se}o(R,"semBmax");function V(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=a(pe,Q,ce)),se}o(V,"semXmin");function W(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=a(pe,Q,ce)),se}o(W,"semXmax");function ee(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(i(pe,Q,ce)),se}o(ee,"semDstring");function he(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(s(pe,Q,ce)),se}o(he,"semBstring");function fe(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(a(pe,Q,ce)),se}o(fe,"semXstring"),this.callbacks=[],this.callbacks.abgop=F,this.callbacks.aenop=ne,this.callbacks.alternation=b,this.callbacks.andop=X,this.callbacks.bmax=R,this.callbacks.bmin=N,this.callbacks.bkaop=D,this.callbacks.bknop=l,this.callbacks.bkrop=v,this.callbacks["bkr-name"]=_,this.callbacks.bstring=he,this.callbacks.clsop=S,this.callbacks.ci=h,this.callbacks.cs=c,this.callbacks.um=d,this.callbacks.pm=y,this.callbacks.concatenation=x,this.callbacks.defined=k,this.callbacks.dmax=J,this.callbacks.dmin=K,this.callbacks.dstring=ee,this.callbacks.file=f,this.callbacks.incalt=$,this.callbacks.notop=U,this.callbacks.optionopen=O,this.callbacks["rep-max"]=z,this.callbacks["rep-min"]=B,this.callbacks["rep-min-max"]=H,this.callbacks.repetition=A,this.callbacks.repop=C,this.callbacks.rnmop=L,this.callbacks.rule=u,this.callbacks.rulelookup=p,this.callbacks.rulename=T,this.callbacks.tbsop=ie,this.callbacks.tlscase=I,this.callbacks.tlsstring=g,this.callbacks.tlsop=E,this.callbacks.trgop=M,this.callbacks["udt-empty"]=w,this.callbacks["udt-non-empty"]=m,this.callbacks.xmax=W,this.callbacks.xmin=V,this.callbacks.xstring=fe},"exfn")});var Z2=me((UL,X2)=>{X2.exports=o(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=o(function(){let t="";return t+=`;
346
+ `,t},"toString")},"grammar")});var W2=me(V2=>{var cr=Tn(),VS=ss();function WS(r,e,t,n,i){return r===cr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.lines.push({lineNo:i.lines.length,beginChar:t,length:n,textLength:i.textLength,endType:i.endType,invalidChars:i.invalidCount}),cr.SEM_OK}o(WS,"semLine");function GS(r,e,t,n,i){return r===cr.SEM_PRE&&(i.textLength=n),cr.SEM_OK}o(GS,"semLineText");function YS(r,e,t,n,i){return r===cr.SEM_PRE?(i.endLength=0,i.textLength=0,i.invalidCount=0):i.strict?(i.lines.push({lineNo:i.lines.length,beginChar:t,length:n,textLength:n,endType:"none",invalidChars:i.invalidCount}),i.errors.push({line:i.lineNo,char:t+n,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(e.push(10),i.lines.push({lineNo:i.lines.length,beginChar:t,length:n+1,textLength:n,endType:"LF",invalidChars:i.invalidCount})),cr.SEM_OK}o(YS,"semLastLine");function JS(r,e,t,n,i){return r===cr.SEM_PRE&&i.errors.push({line:i.lineNo,char:t,msg:`invalid character found '\\x${VS.charToHex(e[t])}'`}),cr.SEM_OK}o(JS,"semInvalid");function XS(r,e,t,n,i){return r===cr.SEM_POST&&(i.lineNo+=1),cr.SEM_OK}o(XS,"semEnd");function ZS(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="LF",i.strict&&i.errors.push({line:i.lineNo,char:t,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),cr.SEM_OK}o(ZS,"semLF");function QS(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="CR",i.strict&&i.errors.push({line:i.lineNo,char:t,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),cr.SEM_OK}o(QS,"semCR");function eM(r,e,t,n,i){return r===cr.SEM_PRE&&(i.endType="CRLF"),cr.SEM_OK}o(eM,"semCRLF");var Pi=[];Pi.line=WS;Pi["line-text"]=GS;Pi["last-line"]=YS;Pi.invalid=JS;Pi.end=XS;Pi.lf=ZS;Pi.cr=QS;Pi.crlf=eM;V2.callbacks=Pi});var Y2=me((LL,G2)=>{G2.exports=o(function(e,t,n,i){let s="scanner.js: ",a=as(),f=new(K2()),{callbacks:u}=W2(),p=[],b=new a.parser;if(b.ast=new a.ast,b.ast.callbacks=u,i){if(i.traceObject!=="traceObject")throw new TypeError(`${s}trace argument is not a trace object`);b.trace=i}if(b.parse(f,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let A={lines:p,lineNo:0,errors:t,strict:!!n};return b.ast.translate(A),p},"exfn")});var X2=me((BL,J2)=>{J2.exports=o(function(){let e="syntax-callbacks.js: ",t=as(),n=t.ids,i,s=o(function(I,g,S,ie){switch(I.state){case n.ACTIVE:ie.altStack=[],ie.repCount=0;break;case n.EMPTY:ie.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:ie.ruleCount===0&&ie.errors.push({line:0,char:0,msg:"no rules defined"});break;case n.NOMATCH:throw new Error(`${e}synFile: grammar file NOMATCH: design error: should never happen.`);default:throw new Error(`${e}synFile: unrecognized case.`)}},"synFile"),a=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:S.altStack.length=0,i={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},S.altStack.push(i);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:S.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRule"),f=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleError"),u=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRuleNameError"),p=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synDefinedAsError"),b=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAndOp"),x=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synNotOp"),A=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Positive look-behind operator(&&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkaOp"),O=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Negative look-behind operator(!!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBknOp"),T=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Beginning of string anchor(%^) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAbgOp"),k=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"End of string anchor(%$) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synAenOp"),$=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(S.strict){let ie=t.utils.charsToString(I,g,E.phraseLength);S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:`Back reference operator(${ie}) found - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBkrOp"),C=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(S.strict){let ie=t.utils.charsToString(I,g,E.phraseLength);S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:`UDT operator found(${ie}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synUdtOp"),B=o(function(E,I,g){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.tlsOpen=g;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsOpen"),z=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:S.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.stringTabChar!==!1&&S.errors.push({line:S.findLine(S.lines,S.stringTabChar),char:S.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsString"),H=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.stringTabChar=g;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synStringTab"),X=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.tlsOpen),char:i.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),i.basicError=!0,i.tlsOpen=null;break;case n.MATCH:i.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synTlsClose"),U=o(function(E,I,g){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.clsOpen=g;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsOpen"),L=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:S.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.stringTabChar!==!1&&S.errors.push({line:S.findLine(S.lines,S.stringTabChar),char:S.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsString"),F=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.clsOpen),char:i.clsOpen,msg:"Case-sensitive literal string('...') opened but not closed."}),i.clsOpen=null,i.basicError=!0;break;case n.MATCH:S.strict&&S.errors.push({line:S.findLine(S.lines,i.clsOpen),char:i.clsOpen,msg:"Case-sensitive string operator('...') found - strict ABNF specified."}),i.clsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synClsClose"),ne=o(function(E,I,g){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.prosValOpen=g;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValOpen"),D=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:S.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.stringTabChar!==!1&&S.errors.push({line:S.findLine(S.lines,S.stringTabChar),char:S.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValString"),l=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),i.basicError=!0,i.prosValOpen=null;break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,i.prosValOpen),char:i.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),i.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synProsValClose"),v=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:g,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},S.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupOpen"),h=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.groupOpen),char:i.groupOpen,msg:'Group "(...)" opened but not closed.'}),i=S.altStack.pop(),i.groupError=!0;break;case n.MATCH:i=S.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synGroupClose"),c=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i={groupOpen:null,groupError:!1,optionOpen:g,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},S.altStack.push(i);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionOpen"),d=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.errors.push({line:S.findLine(S.lines,i.optionOpen),char:i.optionOpen,msg:'Option "[...]" opened but not closed.'}),i=S.altStack.pop(),i.optionError=!0;break;case n.MATCH:i=S.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synOptionClose"),y=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:i.basicError===!1&&S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synBasicElementError"),_=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(E.phraseLength===1&&S.strict){let ie=I[g]===13?"CR":"LF";S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:`Line end '${ie}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEnd"),w=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:S.errors.push({line:S.findLine(S.lines,g,S.charsLength),char:g,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synLineEndError"),m=o(function(E,I,g,S){switch(E.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:S.repCount+=1;break;case n.MATCH:S.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=b,this.callbacks.basicelementerr=y,this.callbacks.clsclose=F,this.callbacks.clsopen=U,this.callbacks.clsstring=L,this.callbacks.definedaserror=p,this.callbacks.file=s,this.callbacks.groupclose=h,this.callbacks.groupopen=v,this.callbacks.lineenderror=w,this.callbacks.lineend=_,this.callbacks.notop=x,this.callbacks.optionclose=d,this.callbacks.optionopen=c,this.callbacks.prosvalclose=l,this.callbacks.prosvalopen=ne,this.callbacks.prosvalstring=D,this.callbacks.repetition=m,this.callbacks.rule=a,this.callbacks.ruleerror=f,this.callbacks.rulenameerror=u,this.callbacks.stringtab=H,this.callbacks.tlsclose=X,this.callbacks.tlsopen=B,this.callbacks.tlsstring=z,this.callbacks.udtop=C,this.callbacks.bkaop=A,this.callbacks.bknop=O,this.callbacks.bkrop=$,this.callbacks.abgop=T,this.callbacks.aenop=k},"exfn")});var Q2=me((UL,Z2)=>{Z2.exports=o(function(){let e=as(),t=e.ids,n=o(function(){this.names=[],this.add=o(function(Q){let ce=-1;return this.get(Q)===-1&&(ce={name:Q,lower:Q.toLowerCase(),index:this.names.length},this.names.push(ce)),ce},"add"),this.get=o(function(Q){let ce=-1,q=Q.toLowerCase();for(let se=0;se<this.names.length;se+=1)if(this.names[se].lower===q){ce=this.names[se];break}return ce},"get")},"NameList"),i=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1)q=10*q+pe[se]-48;return q},"decnum"),s=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1)q=2*q+pe[se]-48;return q},"binnum"),a=o(function(pe,Q,ce){let q=0;for(let se=Q;se<Q+ce;se+=1){let be=pe[se];if(be>=48&&be<=57)be-=48;else if(be>=65&&be<=70)be-=55;else if(be>=97&&be<=102)be-=87;else throw new Error("hexnum out of range");q=16*q+be}return q},"hexnum");function f(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)q.ruleNames=new n,q.udtNames=new n,q.rules=[],q.udts=[],q.rulesLineMap=[],q.opcodes=[],q.altStack=[],q.topStack=null,q.topRule=null;else if(Y===t.SEM_POST){let be;q.rules.forEach(ke=>{ke.isBkr=!1,ke.opcodes.forEach(we=>{we.type===t.RNM&&(be=q.ruleNames.get(we.index.name),be===-1?(q.errors.push({line:q.findLine(q.lines,we.index.phraseIndex,q.charsLength),char:we.index.phraseIndex,msg:`Rule name '${we.index.name}' used but not defined.`}),we.index=-1):we.index=be.index)})}),q.udts.forEach(ke=>{ke.isBkr=!1}),q.rules.forEach(ke=>{ke.opcodes.forEach(we=>{we.type===t.BKR&&(ke.hasBkr=!0,be=q.ruleNames.get(we.index.name),be!==-1?(q.rules[be.index].isBkr=!0,we.index=be.index):(be=q.udtNames.get(we.index.name),be!==-1?(q.udts[be.index].isBkr=!0,we.index=q.rules.length+be.index):(q.errors.push({line:q.findLine(q.lines,we.index.phraseIndex,q.charsLength),char:we.index.phraseIndex,msg:`Back reference name '${we.index.name}' refers to undefined rule or unamed UDT.`}),we.index=-1)))})})}return se}o(f,"semFile");function u(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.altStack.length=0,q.topStack=null,q.rulesLineMap.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q})),se}o(u,"semRule");function p(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)q.ruleName="",q.definedas="";else if(Y===t.SEM_POST){let be;q.definedas==="="?(be=q.ruleNames.add(q.ruleName),be===-1?(q.definedas=null,q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`Rule name '${q.ruleName}' previously defined.`})):(q.topRule={name:be.name,lower:be.lower,opcodes:[],index:be.index},q.rules.push(q.topRule),q.opcodes=q.topRule.opcodes)):(be=q.ruleNames.get(q.ruleName),be===-1?(q.definedas=null,q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`Rule name '${q.ruleName}' for incremental alternate not previously defined.`})):(q.topRule=q.rules[be.index],q.opcodes=q.topRule.opcodes))}return se}o(p,"semRuleLookup");function b(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_PRE)for(;;){if(q.definedas===null){se=t.SEM_SKIP;break}if(q.topStack===null){if(q.definedas==="="){q.topStack={alt:{type:t.ALT,children:[]},cat:null},q.altStack.push(q.topStack),q.opcodes.push(q.topStack.alt);break}q.topStack={alt:q.opcodes[0],cat:null},q.altStack.push(q.topStack);break}q.topStack={alt:{type:t.ALT,children:[]},cat:null},q.altStack.push(q.topStack),q.opcodes.push(q.topStack.alt);break}else Y===t.SEM_POST&&(q.altStack.pop(),q.altStack.length>0?q.topStack=q.altStack[q.altStack.length-1]:q.topStack=null);return se}o(b,"semAlternation");function x(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.topStack.alt.children.push(q.opcodes.length),q.topStack.cat={type:t.CAT,children:[]},q.opcodes.push(q.topStack.cat)):Y===t.SEM_POST&&(q.topStack.cat=null),se}o(x,"semConcatenation");function A(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&q.topStack.cat.children.push(q.opcodes.length),se}o(A,"semRepetition");function O(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.REP,min:0,max:1,char:Q}),se}o(O,"semOptionOpen");function T(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.ruleName=e.utils.charsToString(pe,Q,ce)),se}o(T,"semRuleName");function k(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.definedas="="),se}o(k,"semDefined");function $(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.definedas="=/"),se}o($,"semIncAlt");function C(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.min=0,q.max=1/0,q.topRep={type:t.REP,min:0,max:1/0},q.opcodes.push(q.topRep)):Y===t.SEM_POST&&(q.min>q.max&&q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`repetition min cannot be greater than max: min: ${q.min}: max: ${q.max}`}),q.topRep.min=q.min,q.topRep.max=q.max),se}o(C,"semRepOp");function B(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=i(pe,Q,ce)),se}o(B,"semRepMin");function z(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce)),se}o(z,"semRepMax");function H(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce),q.min=q.max),se}o(H,"semRepMinMax");function X(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.AND}),se}o(X,"semAndOp");function U(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.NOT}),se}o(U,"semNotOp");function L(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.RNM,index:{phraseIndex:Q,name:e.utils.charsToString(pe,Q,ce)}}),se}o(L,"semRnmOp");function F(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.ABG}),se}o(F,"semAbgOp");function ne(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.AEN}),se}o(ne,"semAenOp");function D(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.BKA}),se}o(D,"semBkaOp");function l(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.opcodes.push({type:t.BKN}),se}o(l,"semBknOp");function v(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.ci=!0,q.cs=!1,q.um=!0,q.pm=!1):Y===t.SEM_POST&&q.opcodes.push({type:t.BKR,bkrCase:q.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:q.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:q.bkrname.phraseIndex,name:e.utils.charsToString(pe,q.bkrname.phraseIndex,q.bkrname.phraseLength)}}),se}o(v,"semBkrOp");function h(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.ci=!0),se}o(h,"semBkrCi");function c(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.cs=!0),se}o(c,"semBkrCs");function d(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.um=!0),se}o(d,"semBkrUm");function y(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.pm=!0),se}o(y,"semBkrPm");function _(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.bkrname={phraseIndex:Q,phraseLength:ce}),se}o(_,"semBkrName");function w(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST){let be=e.utils.charsToString(pe,Q,ce),ke=q.udtNames.add(be);if(ke===-1){if(ke=q.udtNames.get(be),ke===-1)throw new Error("semUdtEmpty: name look up error")}else q.udts.push({name:ke.name,lower:ke.lower,index:ke.index,empty:!0});q.opcodes.push({type:t.UDT,empty:!0,index:ke.index})}return se}o(w,"semUdtEmpty");function m(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST){let be=e.utils.charsToString(pe,Q,ce),ke=q.udtNames.add(be);if(ke===-1){if(ke=q.udtNames.get(be),ke===-1)throw new Error("semUdtNonEmpty: name look up error")}else q.udts.push({name:ke.name,lower:ke.lower,index:ke.index,empty:!1});q.opcodes.push({type:t.UDT,empty:!1,index:ke.index,syntax:null,semantic:null})}return se}o(m,"semUdtNonEmpty");function E(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE&&(q.tlscase=!0),se}o(E,"semTlsOp");function I(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&ce>0&&(pe[Q+1]===83||pe[Q+1]===115)&&(q.tlscase=!1),se}o(I,"semTlsCase");function g(Y,pe,Q,ce,q){let se=t.SEM_OK;if(Y===t.SEM_POST)if(q.tlscase){let be=pe.slice(Q,Q+ce);for(let ke=0;ke<be.length;ke+=1)be[ke]>=65&&be[ke]<=90&&(be[ke]+=32);q.opcodes.push({type:t.TLS,string:be})}else q.opcodes.push({type:t.TBS,string:pe.slice(Q,Q+ce)});return se}o(g,"semTlsString");function S(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(ce<=2?q.opcodes.push({type:t.TLS,string:[]}):q.opcodes.push({type:t.TBS,string:pe.slice(Q+1,Q+ce-1)})),se}o(S,"semClsOp");function ie(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?q.tbsstr=[]:Y===t.SEM_POST&&q.opcodes.push({type:t.TBS,string:q.tbsstr}),se}o(ie,"semTbsOp");function M(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_PRE?(q.min=0,q.max=0):Y===t.SEM_POST&&(q.min>q.max&&q.errors.push({line:q.findLine(q.lines,Q,q.charsLength),char:Q,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${q.min}: max: ${q.max}`}),q.opcodes.push({type:t.TRG,min:q.min,max:q.max})),se}o(M,"semTrgOp");function K(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=i(pe,Q,ce)),se}o(K,"semDmin");function J(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=i(pe,Q,ce)),se}o(J,"semDmax");function N(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=s(pe,Q,ce)),se}o(N,"semBmin");function R(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=s(pe,Q,ce)),se}o(R,"semBmax");function V(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.min=a(pe,Q,ce)),se}o(V,"semXmin");function W(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&(q.max=a(pe,Q,ce)),se}o(W,"semXmax");function ee(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(i(pe,Q,ce)),se}o(ee,"semDstring");function he(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(s(pe,Q,ce)),se}o(he,"semBstring");function fe(Y,pe,Q,ce,q){let se=t.SEM_OK;return Y===t.SEM_POST&&q.tbsstr.push(a(pe,Q,ce)),se}o(fe,"semXstring"),this.callbacks=[],this.callbacks.abgop=F,this.callbacks.aenop=ne,this.callbacks.alternation=b,this.callbacks.andop=X,this.callbacks.bmax=R,this.callbacks.bmin=N,this.callbacks.bkaop=D,this.callbacks.bknop=l,this.callbacks.bkrop=v,this.callbacks["bkr-name"]=_,this.callbacks.bstring=he,this.callbacks.clsop=S,this.callbacks.ci=h,this.callbacks.cs=c,this.callbacks.um=d,this.callbacks.pm=y,this.callbacks.concatenation=x,this.callbacks.defined=k,this.callbacks.dmax=J,this.callbacks.dmin=K,this.callbacks.dstring=ee,this.callbacks.file=f,this.callbacks.incalt=$,this.callbacks.notop=U,this.callbacks.optionopen=O,this.callbacks["rep-max"]=z,this.callbacks["rep-min"]=B,this.callbacks["rep-min-max"]=H,this.callbacks.repetition=A,this.callbacks.repop=C,this.callbacks.rnmop=L,this.callbacks.rule=u,this.callbacks.rulelookup=p,this.callbacks.rulename=T,this.callbacks.tbsop=ie,this.callbacks.tlscase=I,this.callbacks.tlsstring=g,this.callbacks.tlsop=E,this.callbacks.trgop=M,this.callbacks["udt-empty"]=w,this.callbacks["udt-non-empty"]=m,this.callbacks.xmax=W,this.callbacks.xmin=V,this.callbacks.xstring=fe},"exfn")});var ty=me((FL,ey)=>{ey.exports=o(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=o(function(){let t="";return t+=`;
347
347
  `,t+=`; ABNF for JavaScript APG 2.0 SABNF
348
348
  `,t+=`; RFC 5234 with some restrictions and additions.
349
349
  `,t+=`; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation
@@ -514,7 +514,7 @@ table.apg-attrs a:hover {
514
514
  `,t+=` / %d10
515
515
  `,t+=` / %d13
516
516
  `,t+=`LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)
517
- `,t},"toString")},"grammar")});var ey=me((FL,Q2)=>{Q2.exports=o(function(){let e="parser: ",t=as(),n=t.ids,i=new(G2()),s=new(J2()),a=new(Z2()),f=new t.parser;f.ast=new t.ast,f.callbacks=i.callbacks,f.ast.callbacks=s.callbacks;let u=o(function(A,O,T){if(O<0||O>=T)return-1;for(let k=0;k<A.length;k+=1)if(O>=A[k].beginChar&&O<A[k].beginChar+A[k].length)return k;return-1},"findLine"),p=o(function(A,O){let T=-1;if(O<A.length){for(let k=O;k<A.length;k+=1)if(A[k]!==null){T=A[k];break}}return T},"translateIndex"),b=o(function(A){A.forEach(O=>{let T=[],k=[],$=0;O.opcodes.forEach(C=>{C.type===n.ALT&&C.children.length===1||C.type===n.CAT&&C.children.length===1||C.type===n.REP&&C.min===1&&C.max===1?k.push(null):(k.push($),T.push(C),$+=1)}),k.push($),T.forEach(C=>{if(C.type===n.ALT||C.type===n.CAT)for(let B=0;B<C.children.length;B+=1)C.children[B]=p(k,C.children[B])}),O.opcodes=T})},"reduceOpcodes");this.syntax=o(function(A,O,T,k,$){if($){if($.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);f.trace=$}let C={};C.errors=T,C.strict=!!k,C.lines=O,C.findLine=u,C.charsLength=A.length,C.ruleCount=0,f.parse(a,"file",A,C).success||T.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(A,O,T){let k={};return k.errors=T,k.lines=O,k.findLine=u,k.charsLength=A.length,f.ast.translate(k),T.length?null:(b(k.rules),{rules:k.rules,udts:k.udts,lineMap:k.rulesLineMap})},"semantic"),this.generateSource=o(function(A,O,T,k,$){let C="",B,z,H,X=0,U=1/0,L=0,F=[],ne=[],D=0,l=0,v=0,h=0,c=0,d=0,y=0,_=0,w=0,m=0,E=0,I=0,g=0,S=0,ie=0;T.forEach(J=>{F.push(J.lower),X+=J.opcodes.length,J.opcodes.forEach(N=>{switch(N.type){case n.ALT:D+=1;break;case n.CAT:l+=1;break;case n.RNM:v+=1;break;case n.UDT:h+=1;break;case n.REP:c+=1;break;case n.AND:d+=1;break;case n.NOT:y+=1;break;case n.BKA:I+=1;break;case n.BKN:g+=1;break;case n.BKR:E+=1;break;case n.ABG:S+=1;break;case n.AEN:ie+=1;break;case n.TLS:for(_+=1,B=0;B<N.string.length;B+=1)N.string[B]<U&&(U=N.string[B]),N.string[B]>L&&(L=N.string[B]);break;case n.TBS:for(w+=1,B=0;B<N.string.length;B+=1)N.string[B]<U&&(U=N.string[B]),N.string[B]>L&&(L=N.string[B]);break;case n.TRG:m+=1,N.min<U&&(U=N.min),N.max>L&&(L=N.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),F.sort(),k.length>0&&(k.forEach(J=>{ne.push(J.lower)}),ne.sort());let M="module.exports";$&&typeof $=="string"&&(M=`let ${$}`),C+=`// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>
517
+ `,t},"toString")},"grammar")});var ny=me(($L,ry)=>{ry.exports=o(function(){let e="parser: ",t=as(),n=t.ids,i=new(X2()),s=new(Q2()),a=new(ty()),f=new t.parser;f.ast=new t.ast,f.callbacks=i.callbacks,f.ast.callbacks=s.callbacks;let u=o(function(A,O,T){if(O<0||O>=T)return-1;for(let k=0;k<A.length;k+=1)if(O>=A[k].beginChar&&O<A[k].beginChar+A[k].length)return k;return-1},"findLine"),p=o(function(A,O){let T=-1;if(O<A.length){for(let k=O;k<A.length;k+=1)if(A[k]!==null){T=A[k];break}}return T},"translateIndex"),b=o(function(A){A.forEach(O=>{let T=[],k=[],$=0;O.opcodes.forEach(C=>{C.type===n.ALT&&C.children.length===1||C.type===n.CAT&&C.children.length===1||C.type===n.REP&&C.min===1&&C.max===1?k.push(null):(k.push($),T.push(C),$+=1)}),k.push($),T.forEach(C=>{if(C.type===n.ALT||C.type===n.CAT)for(let B=0;B<C.children.length;B+=1)C.children[B]=p(k,C.children[B])}),O.opcodes=T})},"reduceOpcodes");this.syntax=o(function(A,O,T,k,$){if($){if($.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);f.trace=$}let C={};C.errors=T,C.strict=!!k,C.lines=O,C.findLine=u,C.charsLength=A.length,C.ruleCount=0,f.parse(a,"file",A,C).success||T.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),this.semantic=o(function(A,O,T){let k={};return k.errors=T,k.lines=O,k.findLine=u,k.charsLength=A.length,f.ast.translate(k),T.length?null:(b(k.rules),{rules:k.rules,udts:k.udts,lineMap:k.rulesLineMap})},"semantic"),this.generateSource=o(function(A,O,T,k,$){let C="",B,z,H,X=0,U=1/0,L=0,F=[],ne=[],D=0,l=0,v=0,h=0,c=0,d=0,y=0,_=0,w=0,m=0,E=0,I=0,g=0,S=0,ie=0;T.forEach(J=>{F.push(J.lower),X+=J.opcodes.length,J.opcodes.forEach(N=>{switch(N.type){case n.ALT:D+=1;break;case n.CAT:l+=1;break;case n.RNM:v+=1;break;case n.UDT:h+=1;break;case n.REP:c+=1;break;case n.AND:d+=1;break;case n.NOT:y+=1;break;case n.BKA:I+=1;break;case n.BKN:g+=1;break;case n.BKR:E+=1;break;case n.ABG:S+=1;break;case n.AEN:ie+=1;break;case n.TLS:for(_+=1,B=0;B<N.string.length;B+=1)N.string[B]<U&&(U=N.string[B]),N.string[B]>L&&(L=N.string[B]);break;case n.TBS:for(w+=1,B=0;B<N.string.length;B+=1)N.string[B]<U&&(U=N.string[B]),N.string[B]>L&&(L=N.string[B]);break;case n.TRG:m+=1,N.min<U&&(U=N.min),N.max>L&&(L=N.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),F.sort(),k.length>0&&(k.forEach(J=>{ne.push(J.lower)}),ne.sort());let M="module.exports";$&&typeof $=="string"&&(M=`let ${$}`),C+=`// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>
518
518
  `,C+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
519
519
  `,C+=`//
520
520
  `,C+=`// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)
@@ -578,7 +578,7 @@ table.apg-attrs a:hover {
578
578
  `}),C+=` return str;
579
579
  `,C+=` }
580
580
  `,C+=`}
581
- `,C},"generateSource"),this.generateObject=o(function(A,O,T){let k={},$=[],C=[],B=A.slice(0);return k.grammarObject="grammarObject",O.forEach(z=>{$.push(z.lower)}),$.sort(),T.length>0&&(T.forEach(z=>{C.push(z.lower)}),C.sort()),k.callbacks=[],$.forEach(z=>{k.callbacks[z]=!1}),T.length>0&&C.forEach(z=>{k.callbacks[z]=!1}),k.rules=O,k.udts=T,k.toString=o(function(){return B},"toStringFunc"),k},"generateObject")},"exportParser")});var ry=me(($L,ty)=>{ty.exports=o(function(){let e=Tn(),t="rule-attributes.js",n=null;function i(D){return D.left||D.nested||D.right||D.cyclic?!1:D.empty}o(i,"isEmptyOnly");function s(D){return!!(D.left||D.nested||D.right||D.cyclic)}o(s,"isRecursive");function a(D,l){let v=0,h=0,c=0;for(v=0;v<l;v+=1)if(D[v].nested)return!0;for(v=0;v<l;v+=1)if(D[v].right&&!D[v].leaf){for(h=v+1;h<l;h+=1)if(!i(D[h]))return!0}for(v=l-1;v>=0;v-=1)if(D[v].left&&!D[v].leaf){for(h=v-1;h>=0;h-=1)if(!i(D[h]))return!0}for(v=0;v<l;v+=1)if(!D[v].empty&&!s(D[v])){for(h=v+1;h<l;h+=1)if(s(D[h])){for(c=h+1;c<l;c+=1)if(!D[c].empty&&!s(D[c]))return!0}}return!1}o(a,"isCatNested");function f(D,l){for(let v=0;v<l;v+=1)if(!D[v].cyclic)return!1;return!0}o(f,"isCatCyclic");function u(D,l){for(let v=0;v<l;v+=1){if(D[v].left)return!0;if(!D[v].empty)return!1}return!1}o(u,"isCatLeft");function p(D,l){for(let v=l-1;v>=0;v-=1){if(D[v].right)return!0;if(!D[v].empty)return!1}return!1}o(p,"isCatRight");function b(D,l){for(let v=0;v<l;v+=1)if(!D[v].empty)return!1;return!0}o(b,"isCatEmpty");function x(D,l){for(let v=0;v<l;v+=1)if(!D[v].finite)return!1;return!0}o(x,"isCatFinite");function A(D,l,v,h){let c=0,d=l[v],y=d.children.length,_=[];for(c=0;c<y;c+=1)_.push(D.attrGen());for(c=0;c<y;c+=1)k(D,l,d.children[c],_[c]);h.left=u(_,y),h.right=p(_,y),h.nested=a(_,y),h.empty=b(_,y),h.finite=x(_,y),h.cyclic=f(_,y)}o(A,"cat");function O(D,l,v,h){let c=0,d=l[v],y=d.children.length,_=[];for(c=0;c<y;c+=1)_.push(D.attrGen());for(c=0;c<y;c+=1)k(D,l,d.children[c],_[c]);for(h.left=!1,h.right=!1,h.nested=!1,h.empty=!1,h.finite=!1,h.cyclic=!1,c=0;c<y;c+=1)_[c].left&&(h.left=!0),_[c].nested&&(h.nested=!0),_[c].right&&(h.right=!0),_[c].empty&&(h.empty=!0),_[c].finite&&(h.finite=!0),_[c].cyclic&&(h.cyclic=!0)}o(O,"alt");function T(D,l,v,h){let c=l[v];c.index>=D.ruleCount?(h.empty=D.udts[c.index-D.ruleCount].empty,h.finite=!0):($(D,c.index,h),h.left=!1,h.nested=!1,h.right=!1,h.cyclic=!1)}o(T,"bkr");function k(D,l,v,h){D.attrInit(h);let c=l[v];switch(c.type){case e.ALT:O(D,l,v,h);break;case e.CAT:A(D,l,v,h);break;case e.REP:k(D,l,v+1,h),c.min===0&&(h.empty=!0,h.finite=!0);break;case e.RNM:$(D,l[v].index,h);break;case e.BKR:T(D,l,v,h);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:k(D,l,v+1,h),h.empty=!0;break;case e.TLS:h.empty=!l[v].string.length,h.finite=!0,h.cyclic=!1;break;case e.TBS:case e.TRG:h.empty=!1,h.finite=!0,h.cyclic=!1;break;case e.UDT:h.empty=c.empty,h.finite=!0,h.cyclic=!1;break;case e.ABG:case e.AEN:h.empty=!0,h.finite=!0,h.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${c}`)}}o(k,"opEval");function $(D,l,v){let h=D.attrsWorking[l];h.isComplete?D.attrCopy(v,h):h.isOpen?l===D.startRule?l===D.startRule&&(v.left=!0,v.right=!0,v.cyclic=!0,v.leaf=!0):v.finite=!0:(h.isOpen=!0,k(D,h.rule.opcodes,0,v),h.left=v.left,h.right=v.right,h.nested=v.nested,h.empty=v.empty,h.finite=v.finite,h.cyclic=v.cyclic,h.leaf=!1,h.isOpen=!1,h.isComplete=!0)}o($,"ruleAttrsEval");let C=o(D=>{n=D;let l=0,v=0,h=n.attrGen();for(l=0;l<n.ruleCount;l+=1){for(v=0;v<n.ruleCount;v+=1)n.attrInit(n.attrsWorking[v]);n.startRule=l,$(n,l,h),n.attrCopy(n.attrs[l],n.attrsWorking[l])}n.attributesComplete=!0;let c=null;for(l=0;l<n.ruleCount;l+=1)if(c=n.attrs[l],c.left||!c.finite||c.cyclic){let d=n.attrGen(c.rule);n.attrCopy(d,c),n.attrsErrors.push(d),n.attrsErrorCount+=1}},"ruleAttributes"),B=o(D=>D?"t":"f","truth"),z=o(D=>D?"e":"f","tError"),H=o(D=>D?"t":"e","fError"),X=o((D,l,v,h)=>{let c=`${D}:${l}:`;return c+=`${z(v.left)} `,c+=`${B(v.nested)} `,c+=`${B(v.right)} `,c+=`${z(v.cyclic)} `,c+=`${H(v.finite)} `,c+=`${B(v.empty)}:`,c+=`${n.typeToString(h.recursiveType)}:`,c+=h.recursiveType===e.ATTR_MR?h.groupNumber:"-",c+=`:${v.rule.name}
581
+ `,C},"generateSource"),this.generateObject=o(function(A,O,T){let k={},$=[],C=[],B=A.slice(0);return k.grammarObject="grammarObject",O.forEach(z=>{$.push(z.lower)}),$.sort(),T.length>0&&(T.forEach(z=>{C.push(z.lower)}),C.sort()),k.callbacks=[],$.forEach(z=>{k.callbacks[z]=!1}),T.length>0&&C.forEach(z=>{k.callbacks[z]=!1}),k.rules=O,k.udts=T,k.toString=o(function(){return B},"toStringFunc"),k},"generateObject")},"exportParser")});var oy=me((qL,iy)=>{iy.exports=o(function(){let e=Tn(),t="rule-attributes.js",n=null;function i(D){return D.left||D.nested||D.right||D.cyclic?!1:D.empty}o(i,"isEmptyOnly");function s(D){return!!(D.left||D.nested||D.right||D.cyclic)}o(s,"isRecursive");function a(D,l){let v=0,h=0,c=0;for(v=0;v<l;v+=1)if(D[v].nested)return!0;for(v=0;v<l;v+=1)if(D[v].right&&!D[v].leaf){for(h=v+1;h<l;h+=1)if(!i(D[h]))return!0}for(v=l-1;v>=0;v-=1)if(D[v].left&&!D[v].leaf){for(h=v-1;h>=0;h-=1)if(!i(D[h]))return!0}for(v=0;v<l;v+=1)if(!D[v].empty&&!s(D[v])){for(h=v+1;h<l;h+=1)if(s(D[h])){for(c=h+1;c<l;c+=1)if(!D[c].empty&&!s(D[c]))return!0}}return!1}o(a,"isCatNested");function f(D,l){for(let v=0;v<l;v+=1)if(!D[v].cyclic)return!1;return!0}o(f,"isCatCyclic");function u(D,l){for(let v=0;v<l;v+=1){if(D[v].left)return!0;if(!D[v].empty)return!1}return!1}o(u,"isCatLeft");function p(D,l){for(let v=l-1;v>=0;v-=1){if(D[v].right)return!0;if(!D[v].empty)return!1}return!1}o(p,"isCatRight");function b(D,l){for(let v=0;v<l;v+=1)if(!D[v].empty)return!1;return!0}o(b,"isCatEmpty");function x(D,l){for(let v=0;v<l;v+=1)if(!D[v].finite)return!1;return!0}o(x,"isCatFinite");function A(D,l,v,h){let c=0,d=l[v],y=d.children.length,_=[];for(c=0;c<y;c+=1)_.push(D.attrGen());for(c=0;c<y;c+=1)k(D,l,d.children[c],_[c]);h.left=u(_,y),h.right=p(_,y),h.nested=a(_,y),h.empty=b(_,y),h.finite=x(_,y),h.cyclic=f(_,y)}o(A,"cat");function O(D,l,v,h){let c=0,d=l[v],y=d.children.length,_=[];for(c=0;c<y;c+=1)_.push(D.attrGen());for(c=0;c<y;c+=1)k(D,l,d.children[c],_[c]);for(h.left=!1,h.right=!1,h.nested=!1,h.empty=!1,h.finite=!1,h.cyclic=!1,c=0;c<y;c+=1)_[c].left&&(h.left=!0),_[c].nested&&(h.nested=!0),_[c].right&&(h.right=!0),_[c].empty&&(h.empty=!0),_[c].finite&&(h.finite=!0),_[c].cyclic&&(h.cyclic=!0)}o(O,"alt");function T(D,l,v,h){let c=l[v];c.index>=D.ruleCount?(h.empty=D.udts[c.index-D.ruleCount].empty,h.finite=!0):($(D,c.index,h),h.left=!1,h.nested=!1,h.right=!1,h.cyclic=!1)}o(T,"bkr");function k(D,l,v,h){D.attrInit(h);let c=l[v];switch(c.type){case e.ALT:O(D,l,v,h);break;case e.CAT:A(D,l,v,h);break;case e.REP:k(D,l,v+1,h),c.min===0&&(h.empty=!0,h.finite=!0);break;case e.RNM:$(D,l[v].index,h);break;case e.BKR:T(D,l,v,h);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:k(D,l,v+1,h),h.empty=!0;break;case e.TLS:h.empty=!l[v].string.length,h.finite=!0,h.cyclic=!1;break;case e.TBS:case e.TRG:h.empty=!1,h.finite=!0,h.cyclic=!1;break;case e.UDT:h.empty=c.empty,h.finite=!0,h.cyclic=!1;break;case e.ABG:case e.AEN:h.empty=!0,h.finite=!0,h.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${c}`)}}o(k,"opEval");function $(D,l,v){let h=D.attrsWorking[l];h.isComplete?D.attrCopy(v,h):h.isOpen?l===D.startRule?l===D.startRule&&(v.left=!0,v.right=!0,v.cyclic=!0,v.leaf=!0):v.finite=!0:(h.isOpen=!0,k(D,h.rule.opcodes,0,v),h.left=v.left,h.right=v.right,h.nested=v.nested,h.empty=v.empty,h.finite=v.finite,h.cyclic=v.cyclic,h.leaf=!1,h.isOpen=!1,h.isComplete=!0)}o($,"ruleAttrsEval");let C=o(D=>{n=D;let l=0,v=0,h=n.attrGen();for(l=0;l<n.ruleCount;l+=1){for(v=0;v<n.ruleCount;v+=1)n.attrInit(n.attrsWorking[v]);n.startRule=l,$(n,l,h),n.attrCopy(n.attrs[l],n.attrsWorking[l])}n.attributesComplete=!0;let c=null;for(l=0;l<n.ruleCount;l+=1)if(c=n.attrs[l],c.left||!c.finite||c.cyclic){let d=n.attrGen(c.rule);n.attrCopy(d,c),n.attrsErrors.push(d),n.attrsErrorCount+=1}},"ruleAttributes"),B=o(D=>D?"t":"f","truth"),z=o(D=>D?"e":"f","tError"),H=o(D=>D?"t":"e","fError"),X=o((D,l,v,h)=>{let c=`${D}:${l}:`;return c+=`${z(v.left)} `,c+=`${B(v.nested)} `,c+=`${B(v.right)} `,c+=`${z(v.cyclic)} `,c+=`${H(v.finite)} `,c+=`${B(v.empty)}:`,c+=`${n.typeToString(h.recursiveType)}:`,c+=h.recursiveType===e.ATTR_MR?h.groupNumber:"-",c+=`:${v.rule.name}
582
582
  `,c},"showAttr"),U=o(()=>{let D=`LEGEND - t=true, f=false, e=error
583
583
  `;return D+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
584
584
  `,D},"showLegend"),L=o(()=>{let D=null,l=null,v="";if(v+=`RULE ATTRIBUTES WITH ERRORS
@@ -587,7 +587,7 @@ table.apg-attrs a:hover {
587
587
  `;return D.charCodeAt(0)===97?(l+=`alphabetical by rule name
588
588
  `,l+=v,l+=U(),l+=F(97)):D.charCodeAt(0)===116?(l+=`ordered by rule type
589
589
  `,l+=v,l+=U(),l+=F(116)):(l+=`ordered by rule index
590
- `,l+=v,l+=U(),l+=F()),l},"showAttributes"),showAttributeErrors:L}},"exportRuleAttributes")()});var iy=me((qL,ny)=>{ny.exports=(()=>{let r=Tn(),e=null,t=o((a,f,u,p)=>{let b=0,x=0,A=f[u];p[u]=!0;let O=A.rule.opcodes;for(b=0;b<O.length;b+=1){let T=O[b];if(T.type===r.RNM)for(A.refersTo[T.index]=!0,p[T.index]||t(a,f,T.index,p),x=0;x<a;x+=1)f[T.index].refersTo[x]&&(A.refersTo[x]=!0);else T.type===r.UDT?A.refersToUdt[T.index]=!0:T.type===r.BKR&&(T.index<a?(A.refersTo[T.index]=!0,p[T.index]||t(a,f,T.index,p)):A.refersToUdt[a-T.index]=!0)}},"scan"),n=o(a=>{e=a;let f=0,u=0,p=0,b=null,x=null,A=!1;e.dependenciesComplete=!1;let O=e.falseArray(e.ruleCount);for(f=0;f<e.ruleCount;f+=1)e.falsifyArray(O),t(e.ruleCount,e.ruleDeps,f,O);for(f=0;f<e.ruleCount;f+=1)for(u=0;u<e.ruleCount;u+=1)f!==u&&e.ruleDeps[u].refersTo[f]&&(e.ruleDeps[f].referencedBy[u]=!0);for(f=0;f<e.ruleCount;f+=1)e.ruleDeps[f].recursiveType=r.ATTR_N,e.ruleDeps[f].refersTo[f]&&(e.ruleDeps[f].recursiveType=r.ATTR_R);for(p=-1,f=0;f<e.ruleCount;f+=1)if(b=e.ruleDeps[f],b.recursiveType===r.ATTR_R)for(A=!0,u=0;u<e.ruleCount;u+=1)f!==u&&(x=e.ruleDeps[u],x.recursiveType===r.ATTR_R&&b.refersTo[u]&&x.refersTo[f]&&(A&&(p+=1,b.recursiveType=r.ATTR_MR,b.groupNumber=p,A=!1),x.recursiveType=r.ATTR_MR,x.groupNumber=p));e.isMutuallyRecursive=p>-1,e.ruleAlphaIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesType),e.isMutuallyRecursive&&e.ruleTypeIndexes.sort(e.compRulesGroup),e.udtCount&&e.udtAlphaIndexes.sort(e.compUdtsAlpha),e.dependenciesComplete=!0},"ruleDependencies"),i=o((a=null)=>{let f=0,u=0,p=0,b=0,x=e.ruleCount-1,A=e.udtCount-1,O=100,T="",k="",$="=> ",C="<= ",B=!1,z=null,{ruleIndexes:H}=e,{udtIndexes:X}=e;for(a===97?(H=e.ruleAlphaIndexes,X=e.udtAlphaIndexes):a===116&&(H=e.ruleTypeIndexes,X=e.udtAlphaIndexes),f=0;f<e.ruleCount;f+=1){for(z=e.ruleDeps[H[f]],k=`${H[f]}:${e.typeToString(z.recursiveType)}:`,e.isMutuallyRecursive&&(k+=z.groupNumber>-1?z.groupNumber:"-",k+=":"),k+=" ",T+=`${k+e.rules[H[f]].name}
590
+ `,l+=v,l+=U(),l+=F()),l},"showAttributes"),showAttributeErrors:L}},"exportRuleAttributes")()});var ay=me((HL,sy)=>{sy.exports=(()=>{let r=Tn(),e=null,t=o((a,f,u,p)=>{let b=0,x=0,A=f[u];p[u]=!0;let O=A.rule.opcodes;for(b=0;b<O.length;b+=1){let T=O[b];if(T.type===r.RNM)for(A.refersTo[T.index]=!0,p[T.index]||t(a,f,T.index,p),x=0;x<a;x+=1)f[T.index].refersTo[x]&&(A.refersTo[x]=!0);else T.type===r.UDT?A.refersToUdt[T.index]=!0:T.type===r.BKR&&(T.index<a?(A.refersTo[T.index]=!0,p[T.index]||t(a,f,T.index,p)):A.refersToUdt[a-T.index]=!0)}},"scan"),n=o(a=>{e=a;let f=0,u=0,p=0,b=null,x=null,A=!1;e.dependenciesComplete=!1;let O=e.falseArray(e.ruleCount);for(f=0;f<e.ruleCount;f+=1)e.falsifyArray(O),t(e.ruleCount,e.ruleDeps,f,O);for(f=0;f<e.ruleCount;f+=1)for(u=0;u<e.ruleCount;u+=1)f!==u&&e.ruleDeps[u].refersTo[f]&&(e.ruleDeps[f].referencedBy[u]=!0);for(f=0;f<e.ruleCount;f+=1)e.ruleDeps[f].recursiveType=r.ATTR_N,e.ruleDeps[f].refersTo[f]&&(e.ruleDeps[f].recursiveType=r.ATTR_R);for(p=-1,f=0;f<e.ruleCount;f+=1)if(b=e.ruleDeps[f],b.recursiveType===r.ATTR_R)for(A=!0,u=0;u<e.ruleCount;u+=1)f!==u&&(x=e.ruleDeps[u],x.recursiveType===r.ATTR_R&&b.refersTo[u]&&x.refersTo[f]&&(A&&(p+=1,b.recursiveType=r.ATTR_MR,b.groupNumber=p,A=!1),x.recursiveType=r.ATTR_MR,x.groupNumber=p));e.isMutuallyRecursive=p>-1,e.ruleAlphaIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesType),e.isMutuallyRecursive&&e.ruleTypeIndexes.sort(e.compRulesGroup),e.udtCount&&e.udtAlphaIndexes.sort(e.compUdtsAlpha),e.dependenciesComplete=!0},"ruleDependencies"),i=o((a=null)=>{let f=0,u=0,p=0,b=0,x=e.ruleCount-1,A=e.udtCount-1,O=100,T="",k="",$="=> ",C="<= ",B=!1,z=null,{ruleIndexes:H}=e,{udtIndexes:X}=e;for(a===97?(H=e.ruleAlphaIndexes,X=e.udtAlphaIndexes):a===116&&(H=e.ruleTypeIndexes,X=e.udtAlphaIndexes),f=0;f<e.ruleCount;f+=1){for(z=e.ruleDeps[H[f]],k=`${H[f]}:${e.typeToString(z.recursiveType)}:`,e.isMutuallyRecursive&&(k+=z.groupNumber>-1?z.groupNumber:"-",k+=":"),k+=" ",T+=`${k+e.rules[H[f]].name}
591
591
  `,B=!0,p=0,b=T.length,T+=k,u=0;u<e.ruleCount;u+=1)z.refersTo[H[u]]&&(B?(T+=$,B=!1,T+=e.ruleDeps[H[u]].rule.name):T+=`, ${e.ruleDeps[H[u]].rule.name}`,p+=1),T.length-b>O&&u!==x&&(T+=`
592
592
  ${k}${$}`,b=T.length);if(e.udtCount)for(u=0;u<e.udtCount;u+=1)z.refersToUdt[X[u]]&&(B?(T+=$,B=!1,T+=e.udts[X[u]].name):T+=`, ${e.udts[X[u]].name}`,p+=1),T.length-b>O&&u!==A&&(T+=`
593
593
  ${k}${$}`,b=T.length);for(p===0&&(T+=`=> <none>
@@ -602,13 +602,13 @@ ${k}${$}`,b=T.length);p===0&&(T+=`<= <none>
602
602
  `,e.dependenciesComplete&&(a.charCodeAt(0)===97?(f+=`alphabetical by rule name
603
603
  `,f+=i(97)):a.charCodeAt(0)===116?(f+=`ordered by rule type
604
604
  `,f+=i(116)):(f+=`ordered by rule index
605
- `,f+=i(null))),f},"showRuleDependencies")}})()});var sy=me((HL,oy)=>{oy.exports=o(function(){let e=Tn(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=ry(),{ruleDependencies:s,showRuleDependencies:a}=iy();class f{constructor(b,x){this.rules=b,this.udts=x,this.ruleCount=b.length,this.udtCount=x.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let A=0;A<this.ruleCount;A+=1)this.attrs.push(this.attrGen(this.rules[A])),this.attrsWorking.push(this.attrGen(this.rules[A])),this.ruleDeps.push(this.rdGen(b[A],this.ruleCount,this.udtCount));this.compRulesAlpha=this.compRulesAlpha.bind(this),this.compUdtsAlpha=this.compUdtsAlpha.bind(this),this.compRulesType=this.compRulesType.bind(this),this.compRulesGroup=this.compRulesGroup.bind(this)}attrGen(b){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:b}}attrInit(b){b.left=!1,b.nested=!1,b.right=!1,b.empty=!1,b.finite=!1,b.cyclic=!1,b.leaf=!1,b.isOpen=!1,b.isComplete=!1}attrCopy(b,x){b.left=x.left,b.nested=x.nested,b.right=x.right,b.empty=x.empty,b.finite=x.finite,b.cyclic=x.cyclic,b.leaf=x.leaf,b.isOpen=x.isOpen,b.isComplete=x.isComplete,b.rule=x.rule}rdGen(b,x,A){return{rule:b,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(x),refersToUdt:this.falseArray(A),referencedBy:this.falseArray(x)}}typeToString(b){switch(b){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(b){let x=[];if(b>0)for(let A=0;A<b;A+=1)x.push(!1);return x}falsifyArray(b){for(let x=0;x<b.length;x+=1)b[x]=!1}indexArray(b){let x=[];if(b>0)for(let A=0;A<b;A+=1)x.push(A);return x}compRulesAlpha(b,x){return this.rules[b].lower<this.rules[x].lower?-1:this.rules[b].lower>this.rules[x].lower?1:0}compUdtsAlpha(b,x){return this.udts[b].lower<this.udts[x].lower?-1:this.udts[b].lower>this.udts[x].lower?1:0}compRulesType(b,x){return this.ruleDeps[b].recursiveType<this.ruleDeps[x].recursiveType?-1:this.ruleDeps[b].recursiveType>this.ruleDeps[x].recursiveType?1:0}compRulesGroup(b,x){if(this.ruleDeps[b].recursiveType===e.ATTR_MR&&this.ruleDeps[x].recursiveType===e.ATTR_MR){if(this.ruleDeps[b].groupNumber<this.ruleDeps[x].groupNumber)return-1;if(this.ruleDeps[b].groupNumber>this.ruleDeps[x].groupNumber)return 1}return 0}}return o(f,"State"),{attributes:o(function(b=[],x=[],A=[],O=[]){let T=new f(b,x);return s(T),t(T),T.attrsErrorCount&&O.push({line:0,char:0,msg:`${T.attrsErrorCount} attribute errors`}),T.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:a}},"exportAttributes")()});var fy=me((zL,ay)=>{ay.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],a="index"){let f="showRules",u=[],p=[],b=[],x=[],A=i,O=s,T=i.length,k=s.length,$="RULE/UDT NAMES",C;function B(H,X){return A[H].lower<A[X].lower?-1:A[H].lower>A[X].lower?1:0}o(B,"compRulesAlpha");function z(H,X){return O[H].lower<O[X].lower?-1:O[H].lower>O[X].lower?1:0}if(o(z,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${f}: rules arg must be array with length > 0`);if(!Array.isArray(s))throw new Error(`${e}:${f}: udts arg must be array`);for(C=0;C<T;C+=1)b.push(C);if(u=b.slice(0),u.sort(B),k){for(C=0;C<k;C+=1)x.push(C);p=x.slice(0),p.sort(z)}if(a.charCodeAt(0)===97){for($+=` - alphabetical by rule/UDT name
605
+ `,f+=i(null))),f},"showRuleDependencies")}})()});var cy=me((zL,fy)=>{fy.exports=o(function(){let e=Tn(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:i}=oy(),{ruleDependencies:s,showRuleDependencies:a}=ay();class f{constructor(b,x){this.rules=b,this.udts=x,this.ruleCount=b.length,this.udtCount=x.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let A=0;A<this.ruleCount;A+=1)this.attrs.push(this.attrGen(this.rules[A])),this.attrsWorking.push(this.attrGen(this.rules[A])),this.ruleDeps.push(this.rdGen(b[A],this.ruleCount,this.udtCount));this.compRulesAlpha=this.compRulesAlpha.bind(this),this.compUdtsAlpha=this.compUdtsAlpha.bind(this),this.compRulesType=this.compRulesType.bind(this),this.compRulesGroup=this.compRulesGroup.bind(this)}attrGen(b){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:b}}attrInit(b){b.left=!1,b.nested=!1,b.right=!1,b.empty=!1,b.finite=!1,b.cyclic=!1,b.leaf=!1,b.isOpen=!1,b.isComplete=!1}attrCopy(b,x){b.left=x.left,b.nested=x.nested,b.right=x.right,b.empty=x.empty,b.finite=x.finite,b.cyclic=x.cyclic,b.leaf=x.leaf,b.isOpen=x.isOpen,b.isComplete=x.isComplete,b.rule=x.rule}rdGen(b,x,A){return{rule:b,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(x),refersToUdt:this.falseArray(A),referencedBy:this.falseArray(x)}}typeToString(b){switch(b){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(b){let x=[];if(b>0)for(let A=0;A<b;A+=1)x.push(!1);return x}falsifyArray(b){for(let x=0;x<b.length;x+=1)b[x]=!1}indexArray(b){let x=[];if(b>0)for(let A=0;A<b;A+=1)x.push(A);return x}compRulesAlpha(b,x){return this.rules[b].lower<this.rules[x].lower?-1:this.rules[b].lower>this.rules[x].lower?1:0}compUdtsAlpha(b,x){return this.udts[b].lower<this.udts[x].lower?-1:this.udts[b].lower>this.udts[x].lower?1:0}compRulesType(b,x){return this.ruleDeps[b].recursiveType<this.ruleDeps[x].recursiveType?-1:this.ruleDeps[b].recursiveType>this.ruleDeps[x].recursiveType?1:0}compRulesGroup(b,x){if(this.ruleDeps[b].recursiveType===e.ATTR_MR&&this.ruleDeps[x].recursiveType===e.ATTR_MR){if(this.ruleDeps[b].groupNumber<this.ruleDeps[x].groupNumber)return-1;if(this.ruleDeps[b].groupNumber>this.ruleDeps[x].groupNumber)return 1}return 0}}return o(f,"State"),{attributes:o(function(b=[],x=[],A=[],O=[]){let T=new f(b,x);return s(T),t(T),T.attrsErrorCount&&O.push({line:0,char:0,msg:`${T.attrsErrorCount} attribute errors`}),T.attrsErrorCount},"attributes"),showAttributes:n,showAttributeErrors:i,showRuleDependencies:a}},"exportAttributes")()});var ly=me((jL,uy)=>{uy.exports=o(function(){let e="show-rules.js";return o(function(i=[],s=[],a="index"){let f="showRules",u=[],p=[],b=[],x=[],A=i,O=s,T=i.length,k=s.length,$="RULE/UDT NAMES",C;function B(H,X){return A[H].lower<A[X].lower?-1:A[H].lower>A[X].lower?1:0}o(B,"compRulesAlpha");function z(H,X){return O[H].lower<O[X].lower?-1:O[H].lower>O[X].lower?1:0}if(o(z,"compUdtsAlpha"),!(Array.isArray(i)&&i.length))throw new Error(`${e}:${f}: rules arg must be array with length > 0`);if(!Array.isArray(s))throw new Error(`${e}:${f}: udts arg must be array`);for(C=0;C<T;C+=1)b.push(C);if(u=b.slice(0),u.sort(B),k){for(C=0;C<k;C+=1)x.push(C);p=x.slice(0),p.sort(z)}if(a.charCodeAt(0)===97){for($+=` - alphabetical by rule/UDT name
606
606
  `,C=0;C<T;C+=1)$+=`${C}: ${u[C]}: ${A[u[C]].name}
607
607
  `;if(k)for(C=0;C<k;C+=1)$+=`${C}: ${p[C]}: ${O[p[C]].name}
608
608
  `}else{for($+=` - ordered by rule/UDT index
609
609
  `,C=0;C<T;C+=1)$+=`${C}: ${A[C].name}
610
610
  `;if(k)for(C=0;C<k;C+=1)$+=`${C}: ${O[C].name}
611
- `}return $},"showRules")},"exfn")()});var uy=me((jL,cy)=>{cy.exports=o(function(e){let t="api.js: ",n=this,i=as(),s=g0(),a=V2(),f=new(ey()),{attributes:u,showAttributes:p,showAttributeErrors:b,showRuleDependencies:x}=sy(),A=fy(),O=o(function(D,l,v){let y=`<span class="${i.style.CLASS_CTRLCHAR}">`,_="</span>",w=`<span class="${i.style.CLASS_NOMATCH}">`,m="</span>",E,I="",g=!0;for(;g&&!(!Array.isArray(D)||D.length===0);){if(typeof l!="number")throw new Error("abnfToHtml: beg must be type number");if(l>=D.length)break;typeof v!="number"||l+v>=D.length?E=D.length:E=l+v;let S=0;for(let ie=l;ie<E;ie+=1){let M=D[ie];if(M>=32&&M<=126)switch(S===1?(I+=_,S=0):S===2&&(I+=m,S=0),M){case 32:I+="&nbsp;";break;case 60:I+="&lt;";break;case 62:I+="&gt;";break;case 38:I+="&amp;";break;case 34:I+="&quot;";break;case 39:I+="&#039;";break;case 92:I+="&#092;";break;default:I+=String.fromCharCode(M);break}else M===9||M===10||M===13?(S===0?(I+=y,S=1):S===2&&(I+=m+y,S=1),M===9&&(I+="TAB"),M===10&&(I+="LF"),M===13&&(I+="CR")):(S===0?(I+=w,S=2):S===1&&(I+=_+w,S=2),I+=`\\x${i.utils.charToHex(M)}`)}S===2&&(I+=m),S===1&&(I+=_);break}return I},"abnfToHtml"),T=o(function(D,l,v){let h="";for(let c=l;c<l+v;c+=1){let d=D[c];if(d>=32&&d<=126)h+=String.fromCharCode(d);else switch(d){case 9:h+="\\t";break;case 10:h+="\\n";break;case 13:h+="\\r";break;default:h+="\\unknown";break}}return h},"abnfToAscii"),k=o(function(D){let l="Annotated Input Grammar";return D.forEach(v=>{l+=`
611
+ `}return $},"showRules")},"exfn")()});var hy=me((KL,dy)=>{dy.exports=o(function(e){let t="api.js: ",n=this,i=as(),s=g0(),a=Y2(),f=new(ny()),{attributes:u,showAttributes:p,showAttributeErrors:b,showRuleDependencies:x}=cy(),A=ly(),O=o(function(D,l,v){let y=`<span class="${i.style.CLASS_CTRLCHAR}">`,_="</span>",w=`<span class="${i.style.CLASS_NOMATCH}">`,m="</span>",E,I="",g=!0;for(;g&&!(!Array.isArray(D)||D.length===0);){if(typeof l!="number")throw new Error("abnfToHtml: beg must be type number");if(l>=D.length)break;typeof v!="number"||l+v>=D.length?E=D.length:E=l+v;let S=0;for(let ie=l;ie<E;ie+=1){let M=D[ie];if(M>=32&&M<=126)switch(S===1?(I+=_,S=0):S===2&&(I+=m,S=0),M){case 32:I+="&nbsp;";break;case 60:I+="&lt;";break;case 62:I+="&gt;";break;case 38:I+="&amp;";break;case 34:I+="&quot;";break;case 39:I+="&#039;";break;case 92:I+="&#092;";break;default:I+=String.fromCharCode(M);break}else M===9||M===10||M===13?(S===0?(I+=y,S=1):S===2&&(I+=m+y,S=1),M===9&&(I+="TAB"),M===10&&(I+="LF"),M===13&&(I+="CR")):(S===0?(I+=w,S=2):S===1&&(I+=_+w,S=2),I+=`\\x${i.utils.charToHex(M)}`)}S===2&&(I+=m),S===1&&(I+=_);break}return I},"abnfToHtml"),T=o(function(D,l,v){let h="";for(let c=l;c<l+v;c+=1){let d=D[c];if(d>=32&&d<=126)h+=String.fromCharCode(d);else switch(d){case 9:h+="\\t";break;case 10:h+="\\n";break;case 13:h+="\\r";break;default:h+="\\unknown";break}}return h},"abnfToAscii"),k=o(function(D){let l="Annotated Input Grammar";return D.forEach(v=>{l+=`
612
612
  `,l+=`line no: ${v.lineNo}`,l+=` : char index: ${v.beginChar}`,l+=` : length: ${v.length}`,l+=` : abnf: ${T(n.chars,v.beginChar,v.length)}`}),l+=`
613
613
  `,l},"linesToAscii"),$=o(function(D){let l="";return l+=`<table class="${i.style.CLASS_GRAMMAR}">
614
614
  `,l+=`<caption>Annotated Input Grammar</caption>
@@ -623,14 +623,14 @@ ${k}${$}`,b=T.length);p===0&&(T+=`<= <none>
623
623
  `)}),d+=`</table></p>
624
624
  `,d},"errorsToHtml"),B=o(function(D,l,v){let h,c,d,y;return h="",D.forEach(_=>{c=l[_.line],h+=`${c.lineNo}: `,h+=`${c.beginChar}: `,h+=`${_.char-c.beginChar}: `,d=c.beginChar,y=_.char-c.beginChar,h+=T(v,d,y),h+=" >> ",d=_.char,y=c.beginChar+c.length-_.char,h+=T(v,d,y),h+=`
625
625
  `,h+=`${c.lineNo}: `,h+=`${c.beginChar}: `,h+=`${_.char-c.beginChar}: `,h+="error: ",h+=_.msg,h+=`
626
- `}),h},"errorsToAscii"),z=!1,H=!1,X=!1,U=!1,L=0,F;if(this.errors=[],Buffer.isBuffer(e))this.chars=s.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=s.decode("STRING",e);else throw new Error(`${t}input source is not a string, byte Buffer or character array`);this.sabnf=s.encode("STRING",this.chars),this.scan=o(function(D,l){this.lines=a(this.chars,this.errors,D,l),z=!0},"scan"),this.parse=o(function(D,l){if(!z)throw new Error(`${t}grammar not scanned`);f.syntax(this.chars,this.lines,this.errors,D,l),H=!0},"parse"),this.translate=o(function(){if(!H)throw new Error(`${t}grammar not scanned and parsed`);let D=f.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=D.rules,this.udts=D.udts,F=D.lineMap,X=!0)},"translate"),this.attributes=o(function(){if(!X)throw new Error(`${t}grammar not scanned, parsed and translated`);return L=u(this.rules,this.udts,F,this.errors),U=!0,L},"attrs"),this.generate=o(function(D){if(this.lines=a(this.chars,this.errors,D),this.errors.length||(f.syntax(this.chars,this.lines,this.errors,D),this.errors.length))return;let l=f.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=l.rules,this.udts=l.udts,F=l.lineMap,L=u(this.rules,this.udts,F,this.errors),U=!0)},"generate"),this.displayRules=o(function(D="index"){if(!X)throw new Error(`${t}grammar not scanned, parsed and translated`);return A(this.rules,this.udts,D)},"displayRules"),this.displayRuleDependencies=o(function(D="index"){if(!U)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return x(D)},"displayRuleDependencies"),this.displayAttributes=o(function(D="index"){if(!U)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return L&&b(D),p(D)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!U)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return b()},"displayAttributeErrors"),this.toSource=o(function(D){if(!U)throw new Error(`${t}can't generate parser source - must be preceeded by call to attributes()`);if(L)throw new Error(`${t}can't generate parser source - attributes have ${L} errors`);return f.generateSource(this.chars,this.lines,this.rules,this.udts,D)},"toSource"),this.toObject=o(function(){if(!U)throw new Error(`${t}can't generate parser source - must be preceeded by call to attributes()`);if(L)throw new Error(`${t}can't generate parser source - attributes have ${L} errors`);return f.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return B(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(D){return C(this.errors,this.lines,this.chars,D)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return k(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return $(this.lines)},"linesToHtmlFunc")},"api")});var I0=me((_y,D0)=>{(function(r,e){"use strict";function t(h,c){if(!h)throw new Error(c||"Assertion failed")}o(t,"assert");function n(h,c){h.super_=c;var d=o(function(){},"TempCtor");d.prototype=c.prototype,h.prototype=new d,h.prototype.constructor=h}o(n,"inherits");function i(h,c,d){if(i.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(h||0,c||10,d||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=Zd().Buffer}catch(h){}i.isBN=o(function(c){return c instanceof i?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===i.wordSize&&Array.isArray(c.words)},"isBN"),i.max=o(function(c,d){return c.cmp(d)>0?c:d},"max"),i.min=o(function(c,d){return c.cmp(d)<0?c:d},"min"),i.prototype._init=o(function(c,d,y){if(typeof c=="number")return this._initNumber(c,d,y);if(typeof c=="object")return this._initArray(c,d,y);d==="hex"&&(d=16),t(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var _=0;c[0]==="-"&&(_++,this.negative=1),_<c.length&&(d===16?this._parseHex(c,_,y):(this._parseBase(c,d,_),y==="le"&&this._initArray(this.toArray(),d,y)))},"init"),i.prototype._initNumber=o(function(c,d,y){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),d,y)},"_initNumber"),i.prototype._initArray=o(function(c,d,y){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var w,m,E=0;if(y==="be")for(_=c.length-1,w=0;_>=0;_-=3)m=c[_]|c[_-1]<<8|c[_-2]<<16,this.words[w]|=m<<E&67108863,this.words[w+1]=m>>>26-E&67108863,E+=24,E>=26&&(E-=26,w++);else if(y==="le")for(_=0,w=0;_<c.length;_+=3)m=c[_]|c[_+1]<<8|c[_+2]<<16,this.words[w]|=m<<E&67108863,this.words[w+1]=m>>>26-E&67108863,E+=24,E>=26&&(E-=26,w++);return this._strip()},"_initArray");function a(h,c){var d=h.charCodeAt(c);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;t(!1,"Invalid character in "+h)}o(a,"parseHex4Bits");function f(h,c,d){var y=a(h,d);return d-1>=c&&(y|=a(h,d-1)<<4),y}o(f,"parseHexByte"),i.prototype._parseHex=o(function(c,d,y){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var w=0,m=0,E;if(y==="be")for(_=c.length-1;_>=d;_-=2)E=f(c,d,_)<<w,this.words[m]|=E&67108863,w>=18?(w-=18,m+=1,this.words[m]|=E>>>26):w+=8;else{var I=c.length-d;for(_=I%2===0?d+1:d;_<c.length;_+=2)E=f(c,d,_)<<w,this.words[m]|=E&67108863,w>=18?(w-=18,m+=1,this.words[m]|=E>>>26):w+=8}this._strip()},"_parseHex");function u(h,c,d,y){for(var _=0,w=0,m=Math.min(h.length,d),E=c;E<m;E++){var I=h.charCodeAt(E)-48;_*=y,I>=49?w=I-49+10:I>=17?w=I-17+10:w=I,t(I>=0&&w<y,"Invalid character"),_+=w}return _}o(u,"parseBase"),i.prototype._parseBase=o(function(c,d,y){this.words=[0],this.length=1;for(var _=0,w=1;w<=67108863;w*=d)_++;_--,w=w/d|0;for(var m=c.length-y,E=m%_,I=Math.min(m,m-E)+y,g=0,S=y;S<I;S+=_)g=u(c,S,S+_,d),this.imuln(w),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(E!==0){var ie=1;for(g=u(c,S,c.length,d),S=0;S<E;S++)ie*=d;this.imuln(ie),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this._strip()},"_parseBase"),i.prototype.copy=o(function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red},"copy");function p(h,c){h.words=c.words,h.length=c.length,h.negative=c.negative,h.red=c.red}if(o(p,"move"),i.prototype._move=o(function(c){p(c,this)},"_move"),i.prototype.clone=o(function(){var c=new i(null);return this.copy(c),c},"clone"),i.prototype._expand=o(function(c){for(;this.length<c;)this.words[this.length++]=0;return this},"_expand"),i.prototype._strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(h){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(b,"inspect");var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],O=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=o(function(c,d){c=c||10,d=d|0||1;var y;if(c===16||c==="hex"){y="";for(var _=0,w=0,m=0;m<this.length;m++){var E=this.words[m],I=((E<<_|w)&16777215).toString(16);w=E>>>24-_&16777215,_+=2,_>=26&&(_-=26,m--),w!==0||m!==this.length-1?y=x[6-I.length]+I+y:y=I+y}for(w!==0&&(y=w.toString(16)+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(c===(c|0)&&c>=2&&c<=36){var g=A[c],S=O[c];y="";var ie=this.clone();for(ie.negative=0;!ie.isZero();){var M=ie.modrn(S).toString(c);ie=ie.idivn(S),ie.isZero()?y=M+y:y=x[g-M.length]+M+y}for(this.isZero()&&(y="0"+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16,2)},"toJSON"),s&&(i.prototype.toBuffer=o(function(c,d){return this.toArrayLike(s,c,d)},"toBuffer")),i.prototype.toArray=o(function(c,d){return this.toArrayLike(Array,c,d)},"toArray");var T=o(function(c,d){return c.allocUnsafe?c.allocUnsafe(d):new c(d)},"allocate");i.prototype.toArrayLike=o(function(c,d,y){this._strip();var _=this.byteLength(),w=y||Math.max(1,_);t(_<=w,"byte array longer than desired length"),t(w>0,"Requested array length <= 0");var m=T(c,w),E=d==="le"?"LE":"BE";return this["_toArrayLike"+E](m,_),m},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(c,d){for(var y=0,_=0,w=0,m=0;w<this.length;w++){var E=this.words[w]<<m|_;c[y++]=E&255,y<c.length&&(c[y++]=E>>8&255),y<c.length&&(c[y++]=E>>16&255),m===6?(y<c.length&&(c[y++]=E>>24&255),_=0,m=0):(_=E>>>24,m+=2)}if(y<c.length)for(c[y++]=_;y<c.length;)c[y++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(c,d){for(var y=c.length-1,_=0,w=0,m=0;w<this.length;w++){var E=this.words[w]<<m|_;c[y--]=E&255,y>=0&&(c[y--]=E>>8&255),y>=0&&(c[y--]=E>>16&255),m===6?(y>=0&&(c[y--]=E>>24&255),_=0,m=0):(_=E>>>24,m+=2)}if(y>=0)for(c[y--]=_;y>=0;)c[y--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(c){return 32-Math.clz32(c)},"_countBits"):i.prototype._countBits=o(function(c){var d=c,y=0;return d>=4096&&(y+=13,d>>>=13),d>=64&&(y+=7,d>>>=7),d>=8&&(y+=4,d>>>=4),d>=2&&(y+=2,d>>>=2),y+d},"_countBits"),i.prototype._zeroBits=o(function(c){if(c===0)return 26;var d=c,y=0;return(d&8191)===0&&(y+=13,d>>>=13),(d&127)===0&&(y+=7,d>>>=7),(d&15)===0&&(y+=4,d>>>=4),(d&3)===0&&(y+=2,d>>>=2),(d&1)===0&&y++,y},"_zeroBits"),i.prototype.bitLength=o(function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d},"bitLength");function k(h){for(var c=new Array(h.bitLength()),d=0;d<c.length;d++){var y=d/26|0,_=d%26;c[d]=h.words[y]>>>_&1}return c}o(k,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var y=this._zeroBits(this.words[d]);if(c+=y,y!==26)break}return c},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this._strip()},"iuor"),i.prototype.ior=o(function(c){return t((this.negative|c.negative)===0),this.iuor(c)},"ior"),i.prototype.or=o(function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},"or"),i.prototype.uor=o(function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(c){var d;this.length>c.length?d=c:d=this;for(var y=0;y<d.length;y++)this.words[y]=this.words[y]&c.words[y];return this.length=d.length,this._strip()},"iuand"),i.prototype.iand=o(function(c){return t((this.negative|c.negative)===0),this.iuand(c)},"iand"),i.prototype.and=o(function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},"and"),i.prototype.uand=o(function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(c){var d,y;this.length>c.length?(d=this,y=c):(d=c,y=this);for(var _=0;_<y.length;_++)this.words[_]=d.words[_]^y.words[_];if(this!==d)for(;_<d.length;_++)this.words[_]=d.words[_];return this.length=d.length,this._strip()},"iuxor"),i.prototype.ixor=o(function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},"ixor"),i.prototype.xor=o(function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(c){t(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,y=c%26;this._expand(d),y>0&&d--;for(var _=0;_<d;_++)this.words[_]=~this.words[_]&67108863;return y>0&&(this.words[_]=~this.words[_]&67108863>>26-y),this._strip()},"inotn"),i.prototype.notn=o(function(c){return this.clone().inotn(c)},"notn"),i.prototype.setn=o(function(c,d){t(typeof c=="number"&&c>=0);var y=c/26|0,_=c%26;return this._expand(y+1),d?this.words[y]=this.words[y]|1<<_:this.words[y]=this.words[y]&~(1<<_),this._strip()},"setn"),i.prototype.iadd=o(function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var y,_;this.length>c.length?(y=this,_=c):(y=c,_=this);for(var w=0,m=0;m<_.length;m++)d=(y.words[m]|0)+(_.words[m]|0)+w,this.words[m]=d&67108863,w=d>>>26;for(;w!==0&&m<y.length;m++)d=(y.words[m]|0)+w,this.words[m]=d&67108863,w=d>>>26;if(this.length=y.length,w!==0)this.words[this.length]=w,this.length++;else if(y!==this)for(;m<y.length;m++)this.words[m]=y.words[m];return this},"iadd"),i.prototype.add=o(function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},"add"),i.prototype.isub=o(function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var y=this.cmp(c);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,w;y>0?(_=this,w=c):(_=c,w=this);for(var m=0,E=0;E<w.length;E++)d=(_.words[E]|0)-(w.words[E]|0)+m,m=d>>26,this.words[E]=d&67108863;for(;m!==0&&E<_.length;E++)d=(_.words[E]|0)+m,m=d>>26,this.words[E]=d&67108863;if(m===0&&E<_.length&&_!==this)for(;E<_.length;E++)this.words[E]=_.words[E];return this.length=Math.max(this.length,E),_!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(c){return this.clone().isub(c)},"sub");function $(h,c,d){d.negative=c.negative^h.negative;var y=h.length+c.length|0;d.length=y,y=y-1|0;var _=h.words[0]|0,w=c.words[0]|0,m=_*w,E=m&67108863,I=m/67108864|0;d.words[0]=E;for(var g=1;g<y;g++){for(var S=I>>>26,ie=I&67108863,M=Math.min(g,c.length-1),K=Math.max(0,g-h.length+1);K<=M;K++){var J=g-K|0;_=h.words[J]|0,w=c.words[K]|0,m=_*w+ie,S+=m/67108864|0,ie=m&67108863}d.words[g]=ie|0,I=S|0}return I!==0?d.words[g]=I|0:d.length--,d._strip()}o($,"smallMulTo");var C=o(function(c,d,y){var _=c.words,w=d.words,m=y.words,E=0,I,g,S,ie=_[0]|0,M=ie&8191,K=ie>>>13,J=_[1]|0,N=J&8191,R=J>>>13,V=_[2]|0,W=V&8191,ee=V>>>13,he=_[3]|0,fe=he&8191,Y=he>>>13,pe=_[4]|0,Q=pe&8191,ce=pe>>>13,q=_[5]|0,se=q&8191,be=q>>>13,ke=_[6]|0,we=ke&8191,Oe=ke>>>13,vr=_[7]|0,te=vr&8191,G=vr>>>13,P=_[8]|0,j=P&8191,ae=P>>>13,ue=_[9]|0,le=ue&8191,ge=ue>>>13,ft=w[0]|0,Ee=ft&8191,ve=ft>>>13,lt=w[1]|0,De=lt&8191,Ne=lt>>>13,Bn=w[2]|0,Le=Bn&8191,Be=Bn>>>13,Un=w[3]|0,Ue=Un&8191,Fe=Un>>>13,Fn=w[4]|0,$e=Fn&8191,qe=Fn>>>13,$n=w[5]|0,He=$n&8191,ze=$n>>>13,qn=w[6]|0,je=qn&8191,Ke=qn>>>13,Hn=w[7]|0,Ve=Hn&8191,We=Hn>>>13,zn=w[8]|0,Ge=zn&8191,Ye=zn>>>13,gn=w[9]|0,mt=gn&8191,bt=gn>>>13;y.negative=c.negative^d.negative,y.length=19,I=Math.imul(M,Ee),g=Math.imul(M,ve),g=g+Math.imul(K,Ee)|0,S=Math.imul(K,ve);var Yr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,I=Math.imul(N,Ee),g=Math.imul(N,ve),g=g+Math.imul(R,Ee)|0,S=Math.imul(R,ve),I=I+Math.imul(M,De)|0,g=g+Math.imul(M,Ne)|0,g=g+Math.imul(K,De)|0,S=S+Math.imul(K,Ne)|0;var Jr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,I=Math.imul(W,Ee),g=Math.imul(W,ve),g=g+Math.imul(ee,Ee)|0,S=Math.imul(ee,ve),I=I+Math.imul(N,De)|0,g=g+Math.imul(N,Ne)|0,g=g+Math.imul(R,De)|0,S=S+Math.imul(R,Ne)|0,I=I+Math.imul(M,Le)|0,g=g+Math.imul(M,Be)|0,g=g+Math.imul(K,Le)|0,S=S+Math.imul(K,Be)|0;var Xr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,I=Math.imul(fe,Ee),g=Math.imul(fe,ve),g=g+Math.imul(Y,Ee)|0,S=Math.imul(Y,ve),I=I+Math.imul(W,De)|0,g=g+Math.imul(W,Ne)|0,g=g+Math.imul(ee,De)|0,S=S+Math.imul(ee,Ne)|0,I=I+Math.imul(N,Le)|0,g=g+Math.imul(N,Be)|0,g=g+Math.imul(R,Le)|0,S=S+Math.imul(R,Be)|0,I=I+Math.imul(M,Ue)|0,g=g+Math.imul(M,Fe)|0,g=g+Math.imul(K,Ue)|0,S=S+Math.imul(K,Fe)|0;var Zr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,I=Math.imul(Q,Ee),g=Math.imul(Q,ve),g=g+Math.imul(ce,Ee)|0,S=Math.imul(ce,ve),I=I+Math.imul(fe,De)|0,g=g+Math.imul(fe,Ne)|0,g=g+Math.imul(Y,De)|0,S=S+Math.imul(Y,Ne)|0,I=I+Math.imul(W,Le)|0,g=g+Math.imul(W,Be)|0,g=g+Math.imul(ee,Le)|0,S=S+Math.imul(ee,Be)|0,I=I+Math.imul(N,Ue)|0,g=g+Math.imul(N,Fe)|0,g=g+Math.imul(R,Ue)|0,S=S+Math.imul(R,Fe)|0,I=I+Math.imul(M,$e)|0,g=g+Math.imul(M,qe)|0,g=g+Math.imul(K,$e)|0,S=S+Math.imul(K,qe)|0;var Qr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,I=Math.imul(se,Ee),g=Math.imul(se,ve),g=g+Math.imul(be,Ee)|0,S=Math.imul(be,ve),I=I+Math.imul(Q,De)|0,g=g+Math.imul(Q,Ne)|0,g=g+Math.imul(ce,De)|0,S=S+Math.imul(ce,Ne)|0,I=I+Math.imul(fe,Le)|0,g=g+Math.imul(fe,Be)|0,g=g+Math.imul(Y,Le)|0,S=S+Math.imul(Y,Be)|0,I=I+Math.imul(W,Ue)|0,g=g+Math.imul(W,Fe)|0,g=g+Math.imul(ee,Ue)|0,S=S+Math.imul(ee,Fe)|0,I=I+Math.imul(N,$e)|0,g=g+Math.imul(N,qe)|0,g=g+Math.imul(R,$e)|0,S=S+Math.imul(R,qe)|0,I=I+Math.imul(M,He)|0,g=g+Math.imul(M,ze)|0,g=g+Math.imul(K,He)|0,S=S+Math.imul(K,ze)|0;var To=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(To>>>26)|0,To&=67108863,I=Math.imul(we,Ee),g=Math.imul(we,ve),g=g+Math.imul(Oe,Ee)|0,S=Math.imul(Oe,ve),I=I+Math.imul(se,De)|0,g=g+Math.imul(se,Ne)|0,g=g+Math.imul(be,De)|0,S=S+Math.imul(be,Ne)|0,I=I+Math.imul(Q,Le)|0,g=g+Math.imul(Q,Be)|0,g=g+Math.imul(ce,Le)|0,S=S+Math.imul(ce,Be)|0,I=I+Math.imul(fe,Ue)|0,g=g+Math.imul(fe,Fe)|0,g=g+Math.imul(Y,Ue)|0,S=S+Math.imul(Y,Fe)|0,I=I+Math.imul(W,$e)|0,g=g+Math.imul(W,qe)|0,g=g+Math.imul(ee,$e)|0,S=S+Math.imul(ee,qe)|0,I=I+Math.imul(N,He)|0,g=g+Math.imul(N,ze)|0,g=g+Math.imul(R,He)|0,S=S+Math.imul(R,ze)|0,I=I+Math.imul(M,je)|0,g=g+Math.imul(M,Ke)|0,g=g+Math.imul(K,je)|0,S=S+Math.imul(K,Ke)|0;var ko=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(ko>>>26)|0,ko&=67108863,I=Math.imul(te,Ee),g=Math.imul(te,ve),g=g+Math.imul(G,Ee)|0,S=Math.imul(G,ve),I=I+Math.imul(we,De)|0,g=g+Math.imul(we,Ne)|0,g=g+Math.imul(Oe,De)|0,S=S+Math.imul(Oe,Ne)|0,I=I+Math.imul(se,Le)|0,g=g+Math.imul(se,Be)|0,g=g+Math.imul(be,Le)|0,S=S+Math.imul(be,Be)|0,I=I+Math.imul(Q,Ue)|0,g=g+Math.imul(Q,Fe)|0,g=g+Math.imul(ce,Ue)|0,S=S+Math.imul(ce,Fe)|0,I=I+Math.imul(fe,$e)|0,g=g+Math.imul(fe,qe)|0,g=g+Math.imul(Y,$e)|0,S=S+Math.imul(Y,qe)|0,I=I+Math.imul(W,He)|0,g=g+Math.imul(W,ze)|0,g=g+Math.imul(ee,He)|0,S=S+Math.imul(ee,ze)|0,I=I+Math.imul(N,je)|0,g=g+Math.imul(N,Ke)|0,g=g+Math.imul(R,je)|0,S=S+Math.imul(R,Ke)|0,I=I+Math.imul(M,Ve)|0,g=g+Math.imul(M,We)|0,g=g+Math.imul(K,Ve)|0,S=S+Math.imul(K,We)|0;var Co=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Co>>>26)|0,Co&=67108863,I=Math.imul(j,Ee),g=Math.imul(j,ve),g=g+Math.imul(ae,Ee)|0,S=Math.imul(ae,ve),I=I+Math.imul(te,De)|0,g=g+Math.imul(te,Ne)|0,g=g+Math.imul(G,De)|0,S=S+Math.imul(G,Ne)|0,I=I+Math.imul(we,Le)|0,g=g+Math.imul(we,Be)|0,g=g+Math.imul(Oe,Le)|0,S=S+Math.imul(Oe,Be)|0,I=I+Math.imul(se,Ue)|0,g=g+Math.imul(se,Fe)|0,g=g+Math.imul(be,Ue)|0,S=S+Math.imul(be,Fe)|0,I=I+Math.imul(Q,$e)|0,g=g+Math.imul(Q,qe)|0,g=g+Math.imul(ce,$e)|0,S=S+Math.imul(ce,qe)|0,I=I+Math.imul(fe,He)|0,g=g+Math.imul(fe,ze)|0,g=g+Math.imul(Y,He)|0,S=S+Math.imul(Y,ze)|0,I=I+Math.imul(W,je)|0,g=g+Math.imul(W,Ke)|0,g=g+Math.imul(ee,je)|0,S=S+Math.imul(ee,Ke)|0,I=I+Math.imul(N,Ve)|0,g=g+Math.imul(N,We)|0,g=g+Math.imul(R,Ve)|0,S=S+Math.imul(R,We)|0,I=I+Math.imul(M,Ge)|0,g=g+Math.imul(M,Ye)|0,g=g+Math.imul(K,Ge)|0,S=S+Math.imul(K,Ye)|0;var Do=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Do>>>26)|0,Do&=67108863,I=Math.imul(le,Ee),g=Math.imul(le,ve),g=g+Math.imul(ge,Ee)|0,S=Math.imul(ge,ve),I=I+Math.imul(j,De)|0,g=g+Math.imul(j,Ne)|0,g=g+Math.imul(ae,De)|0,S=S+Math.imul(ae,Ne)|0,I=I+Math.imul(te,Le)|0,g=g+Math.imul(te,Be)|0,g=g+Math.imul(G,Le)|0,S=S+Math.imul(G,Be)|0,I=I+Math.imul(we,Ue)|0,g=g+Math.imul(we,Fe)|0,g=g+Math.imul(Oe,Ue)|0,S=S+Math.imul(Oe,Fe)|0,I=I+Math.imul(se,$e)|0,g=g+Math.imul(se,qe)|0,g=g+Math.imul(be,$e)|0,S=S+Math.imul(be,qe)|0,I=I+Math.imul(Q,He)|0,g=g+Math.imul(Q,ze)|0,g=g+Math.imul(ce,He)|0,S=S+Math.imul(ce,ze)|0,I=I+Math.imul(fe,je)|0,g=g+Math.imul(fe,Ke)|0,g=g+Math.imul(Y,je)|0,S=S+Math.imul(Y,Ke)|0,I=I+Math.imul(W,Ve)|0,g=g+Math.imul(W,We)|0,g=g+Math.imul(ee,Ve)|0,S=S+Math.imul(ee,We)|0,I=I+Math.imul(N,Ge)|0,g=g+Math.imul(N,Ye)|0,g=g+Math.imul(R,Ge)|0,S=S+Math.imul(R,Ye)|0,I=I+Math.imul(M,mt)|0,g=g+Math.imul(M,bt)|0,g=g+Math.imul(K,mt)|0,S=S+Math.imul(K,bt)|0;var Io=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Io>>>26)|0,Io&=67108863,I=Math.imul(le,De),g=Math.imul(le,Ne),g=g+Math.imul(ge,De)|0,S=Math.imul(ge,Ne),I=I+Math.imul(j,Le)|0,g=g+Math.imul(j,Be)|0,g=g+Math.imul(ae,Le)|0,S=S+Math.imul(ae,Be)|0,I=I+Math.imul(te,Ue)|0,g=g+Math.imul(te,Fe)|0,g=g+Math.imul(G,Ue)|0,S=S+Math.imul(G,Fe)|0,I=I+Math.imul(we,$e)|0,g=g+Math.imul(we,qe)|0,g=g+Math.imul(Oe,$e)|0,S=S+Math.imul(Oe,qe)|0,I=I+Math.imul(se,He)|0,g=g+Math.imul(se,ze)|0,g=g+Math.imul(be,He)|0,S=S+Math.imul(be,ze)|0,I=I+Math.imul(Q,je)|0,g=g+Math.imul(Q,Ke)|0,g=g+Math.imul(ce,je)|0,S=S+Math.imul(ce,Ke)|0,I=I+Math.imul(fe,Ve)|0,g=g+Math.imul(fe,We)|0,g=g+Math.imul(Y,Ve)|0,S=S+Math.imul(Y,We)|0,I=I+Math.imul(W,Ge)|0,g=g+Math.imul(W,Ye)|0,g=g+Math.imul(ee,Ge)|0,S=S+Math.imul(ee,Ye)|0,I=I+Math.imul(N,mt)|0,g=g+Math.imul(N,bt)|0,g=g+Math.imul(R,mt)|0,S=S+Math.imul(R,bt)|0;var Oo=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,I=Math.imul(le,Le),g=Math.imul(le,Be),g=g+Math.imul(ge,Le)|0,S=Math.imul(ge,Be),I=I+Math.imul(j,Ue)|0,g=g+Math.imul(j,Fe)|0,g=g+Math.imul(ae,Ue)|0,S=S+Math.imul(ae,Fe)|0,I=I+Math.imul(te,$e)|0,g=g+Math.imul(te,qe)|0,g=g+Math.imul(G,$e)|0,S=S+Math.imul(G,qe)|0,I=I+Math.imul(we,He)|0,g=g+Math.imul(we,ze)|0,g=g+Math.imul(Oe,He)|0,S=S+Math.imul(Oe,ze)|0,I=I+Math.imul(se,je)|0,g=g+Math.imul(se,Ke)|0,g=g+Math.imul(be,je)|0,S=S+Math.imul(be,Ke)|0,I=I+Math.imul(Q,Ve)|0,g=g+Math.imul(Q,We)|0,g=g+Math.imul(ce,Ve)|0,S=S+Math.imul(ce,We)|0,I=I+Math.imul(fe,Ge)|0,g=g+Math.imul(fe,Ye)|0,g=g+Math.imul(Y,Ge)|0,S=S+Math.imul(Y,Ye)|0,I=I+Math.imul(W,mt)|0,g=g+Math.imul(W,bt)|0,g=g+Math.imul(ee,mt)|0,S=S+Math.imul(ee,bt)|0;var Po=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Po>>>26)|0,Po&=67108863,I=Math.imul(le,Ue),g=Math.imul(le,Fe),g=g+Math.imul(ge,Ue)|0,S=Math.imul(ge,Fe),I=I+Math.imul(j,$e)|0,g=g+Math.imul(j,qe)|0,g=g+Math.imul(ae,$e)|0,S=S+Math.imul(ae,qe)|0,I=I+Math.imul(te,He)|0,g=g+Math.imul(te,ze)|0,g=g+Math.imul(G,He)|0,S=S+Math.imul(G,ze)|0,I=I+Math.imul(we,je)|0,g=g+Math.imul(we,Ke)|0,g=g+Math.imul(Oe,je)|0,S=S+Math.imul(Oe,Ke)|0,I=I+Math.imul(se,Ve)|0,g=g+Math.imul(se,We)|0,g=g+Math.imul(be,Ve)|0,S=S+Math.imul(be,We)|0,I=I+Math.imul(Q,Ge)|0,g=g+Math.imul(Q,Ye)|0,g=g+Math.imul(ce,Ge)|0,S=S+Math.imul(ce,Ye)|0,I=I+Math.imul(fe,mt)|0,g=g+Math.imul(fe,bt)|0,g=g+Math.imul(Y,mt)|0,S=S+Math.imul(Y,bt)|0;var No=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(No>>>26)|0,No&=67108863,I=Math.imul(le,$e),g=Math.imul(le,qe),g=g+Math.imul(ge,$e)|0,S=Math.imul(ge,qe),I=I+Math.imul(j,He)|0,g=g+Math.imul(j,ze)|0,g=g+Math.imul(ae,He)|0,S=S+Math.imul(ae,ze)|0,I=I+Math.imul(te,je)|0,g=g+Math.imul(te,Ke)|0,g=g+Math.imul(G,je)|0,S=S+Math.imul(G,Ke)|0,I=I+Math.imul(we,Ve)|0,g=g+Math.imul(we,We)|0,g=g+Math.imul(Oe,Ve)|0,S=S+Math.imul(Oe,We)|0,I=I+Math.imul(se,Ge)|0,g=g+Math.imul(se,Ye)|0,g=g+Math.imul(be,Ge)|0,S=S+Math.imul(be,Ye)|0,I=I+Math.imul(Q,mt)|0,g=g+Math.imul(Q,bt)|0,g=g+Math.imul(ce,mt)|0,S=S+Math.imul(ce,bt)|0;var Ro=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,I=Math.imul(le,He),g=Math.imul(le,ze),g=g+Math.imul(ge,He)|0,S=Math.imul(ge,ze),I=I+Math.imul(j,je)|0,g=g+Math.imul(j,Ke)|0,g=g+Math.imul(ae,je)|0,S=S+Math.imul(ae,Ke)|0,I=I+Math.imul(te,Ve)|0,g=g+Math.imul(te,We)|0,g=g+Math.imul(G,Ve)|0,S=S+Math.imul(G,We)|0,I=I+Math.imul(we,Ge)|0,g=g+Math.imul(we,Ye)|0,g=g+Math.imul(Oe,Ge)|0,S=S+Math.imul(Oe,Ye)|0,I=I+Math.imul(se,mt)|0,g=g+Math.imul(se,bt)|0,g=g+Math.imul(be,mt)|0,S=S+Math.imul(be,bt)|0;var Lo=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,I=Math.imul(le,je),g=Math.imul(le,Ke),g=g+Math.imul(ge,je)|0,S=Math.imul(ge,Ke),I=I+Math.imul(j,Ve)|0,g=g+Math.imul(j,We)|0,g=g+Math.imul(ae,Ve)|0,S=S+Math.imul(ae,We)|0,I=I+Math.imul(te,Ge)|0,g=g+Math.imul(te,Ye)|0,g=g+Math.imul(G,Ge)|0,S=S+Math.imul(G,Ye)|0,I=I+Math.imul(we,mt)|0,g=g+Math.imul(we,bt)|0,g=g+Math.imul(Oe,mt)|0,S=S+Math.imul(Oe,bt)|0;var Bo=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,I=Math.imul(le,Ve),g=Math.imul(le,We),g=g+Math.imul(ge,Ve)|0,S=Math.imul(ge,We),I=I+Math.imul(j,Ge)|0,g=g+Math.imul(j,Ye)|0,g=g+Math.imul(ae,Ge)|0,S=S+Math.imul(ae,Ye)|0,I=I+Math.imul(te,mt)|0,g=g+Math.imul(te,bt)|0,g=g+Math.imul(G,mt)|0,S=S+Math.imul(G,bt)|0;var ud=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(ud>>>26)|0,ud&=67108863,I=Math.imul(le,Ge),g=Math.imul(le,Ye),g=g+Math.imul(ge,Ge)|0,S=Math.imul(ge,Ye),I=I+Math.imul(j,mt)|0,g=g+Math.imul(j,bt)|0,g=g+Math.imul(ae,mt)|0,S=S+Math.imul(ae,bt)|0;var ld=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(ld>>>26)|0,ld&=67108863,I=Math.imul(le,mt),g=Math.imul(le,bt),g=g+Math.imul(ge,mt)|0,S=Math.imul(ge,bt);var dd=(E+I|0)+((g&8191)<<13)|0;return E=(S+(g>>>13)|0)+(dd>>>26)|0,dd&=67108863,m[0]=Yr,m[1]=Jr,m[2]=Xr,m[3]=Zr,m[4]=Qr,m[5]=To,m[6]=ko,m[7]=Co,m[8]=Do,m[9]=Io,m[10]=Oo,m[11]=Po,m[12]=No,m[13]=Ro,m[14]=Lo,m[15]=Bo,m[16]=ud,m[17]=ld,m[18]=dd,E!==0&&(m[19]=E,y.length++),y},"comb10MulTo");Math.imul||(C=$);function B(h,c,d){d.negative=c.negative^h.negative,d.length=h.length+c.length;for(var y=0,_=0,w=0;w<d.length-1;w++){var m=_;_=0;for(var E=y&67108863,I=Math.min(w,c.length-1),g=Math.max(0,w-h.length+1);g<=I;g++){var S=w-g,ie=h.words[S]|0,M=c.words[g]|0,K=ie*M,J=K&67108863;m=m+(K/67108864|0)|0,J=J+E|0,E=J&67108863,m=m+(J>>>26)|0,_+=m>>>26,m&=67108863}d.words[w]=E,y=m,m=_}return y!==0?d.words[w]=y:d.length--,d._strip()}o(B,"bigMulTo");function z(h,c,d){return B(h,c,d)}o(z,"jumboMulTo"),i.prototype.mulTo=o(function(c,d){var y,_=this.length+c.length;return this.length===10&&c.length===10?y=C(this,c,d):_<63?y=$(this,c,d):_<1024?y=B(this,c,d):y=z(this,c,d),y},"mulTo");function H(h,c){this.x=h,this.y=c}o(H,"FFTM"),H.prototype.makeRBT=o(function(c){for(var d=new Array(c),y=i.prototype._countBits(c)-1,_=0;_<c;_++)d[_]=this.revBin(_,y,c);return d},"makeRBT"),H.prototype.revBin=o(function(c,d,y){if(c===0||c===y-1)return c;for(var _=0,w=0;w<d;w++)_|=(c&1)<<d-w-1,c>>=1;return _},"revBin"),H.prototype.permute=o(function(c,d,y,_,w,m){for(var E=0;E<m;E++)_[E]=d[c[E]],w[E]=y[c[E]]},"permute"),H.prototype.transform=o(function(c,d,y,_,w,m){this.permute(m,c,d,y,_,w);for(var E=1;E<w;E<<=1)for(var I=E<<1,g=Math.cos(2*Math.PI/I),S=Math.sin(2*Math.PI/I),ie=0;ie<w;ie+=I)for(var M=g,K=S,J=0;J<E;J++){var N=y[ie+J],R=_[ie+J],V=y[ie+J+E],W=_[ie+J+E],ee=M*V-K*W;W=M*W+K*V,V=ee,y[ie+J]=N+V,_[ie+J]=R+W,y[ie+J+E]=N-V,_[ie+J+E]=R-W,J!==I&&(ee=g*M-S*K,K=g*K+S*M,M=ee)}},"transform"),H.prototype.guessLen13b=o(function(c,d){var y=Math.max(d,c)|1,_=y&1,w=0;for(y=y/2|0;y;y=y>>>1)w++;return 1<<w+1+_},"guessLen13b"),H.prototype.conjugate=o(function(c,d,y){if(!(y<=1))for(var _=0;_<y/2;_++){var w=c[_];c[_]=c[y-_-1],c[y-_-1]=w,w=d[_],d[_]=-d[y-_-1],d[y-_-1]=-w}},"conjugate"),H.prototype.normalize13b=o(function(c,d){for(var y=0,_=0;_<d/2;_++){var w=Math.round(c[2*_+1]/d)*8192+Math.round(c[2*_]/d)+y;c[_]=w&67108863,w<67108864?y=0:y=w/67108864|0}return c},"normalize13b"),H.prototype.convert13b=o(function(c,d,y,_){for(var w=0,m=0;m<d;m++)w=w+(c[m]|0),y[2*m]=w&8191,w=w>>>13,y[2*m+1]=w&8191,w=w>>>13;for(m=2*d;m<_;++m)y[m]=0;t(w===0),t((w&-8192)===0)},"convert13b"),H.prototype.stub=o(function(c){for(var d=new Array(c),y=0;y<c;y++)d[y]=0;return d},"stub"),H.prototype.mulp=o(function(c,d,y){var _=2*this.guessLen13b(c.length,d.length),w=this.makeRBT(_),m=this.stub(_),E=new Array(_),I=new Array(_),g=new Array(_),S=new Array(_),ie=new Array(_),M=new Array(_),K=y.words;K.length=_,this.convert13b(c.words,c.length,E,_),this.convert13b(d.words,d.length,S,_),this.transform(E,m,I,g,_,w),this.transform(S,m,ie,M,_,w);for(var J=0;J<_;J++){var N=I[J]*ie[J]-g[J]*M[J];g[J]=I[J]*M[J]+g[J]*ie[J],I[J]=N}return this.conjugate(I,g,_),this.transform(I,g,K,m,_,w),this.conjugate(K,m,_),this.normalize13b(K,_),y.negative=c.negative^d.negative,y.length=c.length+d.length,y._strip()},"mulp"),i.prototype.mul=o(function(c){var d=new i(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},"mul"),i.prototype.mulf=o(function(c){var d=new i(null);return d.words=new Array(this.length+c.length),z(this,c,d)},"mulf"),i.prototype.imul=o(function(c){return this.clone().mulTo(c,this)},"imul"),i.prototype.imuln=o(function(c){var d=c<0;d&&(c=-c),t(typeof c=="number"),t(c<67108864);for(var y=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*c,m=(w&67108863)+(y&67108863);y>>=26,y+=w/67108864|0,y+=m>>>26,this.words[_]=m&67108863}return y!==0&&(this.words[_]=y,this.length++),d?this.ineg():this},"imuln"),i.prototype.muln=o(function(c){return this.clone().imuln(c)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(c){var d=k(c);if(d.length===0)return new i(1);for(var y=this,_=0;_<d.length&&d[_]===0;_++,y=y.sqr());if(++_<d.length)for(var w=y.sqr();_<d.length;_++,w=w.sqr())d[_]!==0&&(y=y.mul(w));return y},"pow"),i.prototype.iushln=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,_=67108863>>>26-d<<26-d,w;if(d!==0){var m=0;for(w=0;w<this.length;w++){var E=this.words[w]&_,I=(this.words[w]|0)-E<<d;this.words[w]=I|m,m=E>>>26-d}m&&(this.words[w]=m,this.length++)}if(y!==0){for(w=this.length-1;w>=0;w--)this.words[w+y]=this.words[w];for(w=0;w<y;w++)this.words[w]=0;this.length+=y}return this._strip()},"iushln"),i.prototype.ishln=o(function(c){return t(this.negative===0),this.iushln(c)},"ishln"),i.prototype.iushrn=o(function(c,d,y){t(typeof c=="number"&&c>=0);var _;d?_=(d-d%26)/26:_=0;var w=c%26,m=Math.min((c-w)/26,this.length),E=67108863^67108863>>>w<<w,I=y;if(_-=m,_=Math.max(0,_),I){for(var g=0;g<m;g++)I.words[g]=this.words[g];I.length=m}if(m!==0)if(this.length>m)for(this.length-=m,g=0;g<this.length;g++)this.words[g]=this.words[g+m];else this.words[0]=0,this.length=1;var S=0;for(g=this.length-1;g>=0&&(S!==0||g>=_);g--){var ie=this.words[g]|0;this.words[g]=S<<26-w|ie>>>w,S=ie&E}return I&&S!==0&&(I.words[I.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(c,d,y){return t(this.negative===0),this.iushrn(c,d,y)},"ishrn"),i.prototype.shln=o(function(c){return this.clone().ishln(c)},"shln"),i.prototype.ushln=o(function(c){return this.clone().iushln(c)},"ushln"),i.prototype.shrn=o(function(c){return this.clone().ishrn(c)},"shrn"),i.prototype.ushrn=o(function(c){return this.clone().iushrn(c)},"ushrn"),i.prototype.testn=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,_=1<<d;if(this.length<=y)return!1;var w=this.words[y];return!!(w&_)},"testn"),i.prototype.imaskn=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(d!==0&&y++,this.length=Math.min(y,this.length),d!==0){var _=67108863^67108863>>>d<<d;this.words[this.length-1]&=_}return this._strip()},"imaskn"),i.prototype.maskn=o(function(c){return this.clone().imaskn(c)},"maskn"),i.prototype.iaddn=o(function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},"iaddn"),i.prototype._iaddn=o(function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},"_iaddn"),i.prototype.isubn=o(function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},"isubn"),i.prototype.addn=o(function(c){return this.clone().iaddn(c)},"addn"),i.prototype.subn=o(function(c){return this.clone().isubn(c)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(c,d,y){var _=c.length+y,w;this._expand(_);var m,E=0;for(w=0;w<c.length;w++){m=(this.words[w+y]|0)+E;var I=(c.words[w]|0)*d;m-=I&67108863,E=(m>>26)-(I/67108864|0),this.words[w+y]=m&67108863}for(;w<this.length-y;w++)m=(this.words[w+y]|0)+E,E=m>>26,this.words[w+y]=m&67108863;if(E===0)return this._strip();for(t(E===-1),E=0,w=0;w<this.length;w++)m=-(this.words[w]|0)+E,E=m>>26,this.words[w]=m&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(c,d){var y=this.length-c.length,_=this.clone(),w=c,m=w.words[w.length-1]|0,E=this._countBits(m);y=26-E,y!==0&&(w=w.ushln(y),_.iushln(y),m=w.words[w.length-1]|0);var I=_.length-w.length,g;if(d!=="mod"){g=new i(null),g.length=I+1,g.words=new Array(g.length);for(var S=0;S<g.length;S++)g.words[S]=0}var ie=_.clone()._ishlnsubmul(w,1,I);ie.negative===0&&(_=ie,g&&(g.words[I]=1));for(var M=I-1;M>=0;M--){var K=(_.words[w.length+M]|0)*67108864+(_.words[w.length+M-1]|0);for(K=Math.min(K/m|0,67108863),_._ishlnsubmul(w,K,M);_.negative!==0;)K--,_.negative=0,_._ishlnsubmul(w,1,M),_.isZero()||(_.negative^=1);g&&(g.words[M]=K)}return g&&g._strip(),_._strip(),d!=="div"&&y!==0&&_.iushrn(y),{div:g||null,mod:_}},"_wordDiv"),i.prototype.divmod=o(function(c,d,y){if(t(!c.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var _,w,m;return this.negative!==0&&c.negative===0?(m=this.neg().divmod(c,d),d!=="mod"&&(_=m.div.neg()),d!=="div"&&(w=m.mod.neg(),y&&w.negative!==0&&w.iadd(c)),{div:_,mod:w}):this.negative===0&&c.negative!==0?(m=this.divmod(c.neg(),d),d!=="mod"&&(_=m.div.neg()),{div:_,mod:m.mod}):(this.negative&c.negative)!==0?(m=this.neg().divmod(c.neg(),d),d!=="div"&&(w=m.mod.neg(),y&&w.negative!==0&&w.isub(c)),{div:m.div,mod:w}):c.length>this.length||this.cmp(c)<0?{div:new i(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new i(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new i(this.modrn(c.words[0]))}:this._wordDiv(c,d)},"divmod"),i.prototype.div=o(function(c){return this.divmod(c,"div",!1).div},"div"),i.prototype.mod=o(function(c){return this.divmod(c,"mod",!1).mod},"mod"),i.prototype.umod=o(function(c){return this.divmod(c,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var y=d.div.negative!==0?d.mod.isub(c):d.mod,_=c.ushrn(1),w=c.andln(1),m=y.cmp(_);return m<0||w===1&&m===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(c){var d=c<0;d&&(c=-c),t(c<=67108863);for(var y=(1<<26)%c,_=0,w=this.length-1;w>=0;w--)_=(y*_+(this.words[w]|0))%c;return d?-_:_},"modrn"),i.prototype.modn=o(function(c){return this.modrn(c)},"modn"),i.prototype.idivn=o(function(c){var d=c<0;d&&(c=-c),t(c<=67108863);for(var y=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+y*67108864;this.words[_]=w/c|0,y=w%c}return this._strip(),d?this.ineg():this},"idivn"),i.prototype.divn=o(function(c){return this.clone().idivn(c)},"divn"),i.prototype.egcd=o(function(c){t(c.negative===0),t(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var _=new i(1),w=new i(0),m=new i(0),E=new i(1),I=0;d.isEven()&&y.isEven();)d.iushrn(1),y.iushrn(1),++I;for(var g=y.clone(),S=d.clone();!d.isZero();){for(var ie=0,M=1;(d.words[0]&M)===0&&ie<26;++ie,M<<=1);if(ie>0)for(d.iushrn(ie);ie-- >0;)(_.isOdd()||w.isOdd())&&(_.iadd(g),w.isub(S)),_.iushrn(1),w.iushrn(1);for(var K=0,J=1;(y.words[0]&J)===0&&K<26;++K,J<<=1);if(K>0)for(y.iushrn(K);K-- >0;)(m.isOdd()||E.isOdd())&&(m.iadd(g),E.isub(S)),m.iushrn(1),E.iushrn(1);d.cmp(y)>=0?(d.isub(y),_.isub(m),w.isub(E)):(y.isub(d),m.isub(_),E.isub(w))}return{a:m,b:E,gcd:y.iushln(I)}},"egcd"),i.prototype._invmp=o(function(c){t(c.negative===0),t(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var _=new i(1),w=new i(0),m=y.clone();d.cmpn(1)>0&&y.cmpn(1)>0;){for(var E=0,I=1;(d.words[0]&I)===0&&E<26;++E,I<<=1);if(E>0)for(d.iushrn(E);E-- >0;)_.isOdd()&&_.iadd(m),_.iushrn(1);for(var g=0,S=1;(y.words[0]&S)===0&&g<26;++g,S<<=1);if(g>0)for(y.iushrn(g);g-- >0;)w.isOdd()&&w.iadd(m),w.iushrn(1);d.cmp(y)>=0?(d.isub(y),_.isub(w)):(y.isub(d),w.isub(_))}var ie;return d.cmpn(1)===0?ie=_:ie=w,ie.cmpn(0)<0&&ie.iadd(c),ie},"_invmp"),i.prototype.gcd=o(function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),y=c.clone();d.negative=0,y.negative=0;for(var _=0;d.isEven()&&y.isEven();_++)d.iushrn(1),y.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;y.isEven();)y.iushrn(1);var w=d.cmp(y);if(w<0){var m=d;d=y,y=m}else if(w===0||y.cmpn(1)===0)break;d.isub(y)}while(!0);return y.iushln(_)},"gcd"),i.prototype.invm=o(function(c){return this.egcd(c).a.umod(c)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(c){return this.words[0]&c},"andln"),i.prototype.bincn=o(function(c){t(typeof c=="number");var d=c%26,y=(c-d)/26,_=1<<d;if(this.length<=y)return this._expand(y+1),this.words[y]|=_,this;for(var w=_,m=y;w!==0&&m<this.length;m++){var E=this.words[m]|0;E+=w,w=E>>>26,E&=67108863,this.words[m]=E}return w!==0&&(this.words[m]=w,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var y;if(this.length>1)y=1;else{d&&(c=-c),t(c<=67108863,"Number is too big");var _=this.words[0]|0;y=_===c?0:_<c?-1:1}return this.negative!==0?-y|0:y},"cmpn"),i.prototype.cmp=o(function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},"cmp"),i.prototype.ucmp=o(function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,y=this.length-1;y>=0;y--){var _=this.words[y]|0,w=c.words[y]|0;if(_!==w){_<w?d=-1:_>w&&(d=1);break}}return d},"ucmp"),i.prototype.gtn=o(function(c){return this.cmpn(c)===1},"gtn"),i.prototype.gt=o(function(c){return this.cmp(c)===1},"gt"),i.prototype.gten=o(function(c){return this.cmpn(c)>=0},"gten"),i.prototype.gte=o(function(c){return this.cmp(c)>=0},"gte"),i.prototype.ltn=o(function(c){return this.cmpn(c)===-1},"ltn"),i.prototype.lt=o(function(c){return this.cmp(c)===-1},"lt"),i.prototype.lten=o(function(c){return this.cmpn(c)<=0},"lten"),i.prototype.lte=o(function(c){return this.cmp(c)<=0},"lte"),i.prototype.eqn=o(function(c){return this.cmpn(c)===0},"eqn"),i.prototype.eq=o(function(c){return this.cmp(c)===0},"eq"),i.red=o(function(c){return new l(c)},"red"),i.prototype.toRed=o(function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},"toRed"),i.prototype.fromRed=o(function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),i.prototype._forceRed=o(function(c){return this.red=c,this},"_forceRed"),i.prototype.forceRed=o(function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},"forceRed"),i.prototype.redAdd=o(function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},"redAdd"),i.prototype.redIAdd=o(function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},"redIAdd"),i.prototype.redSub=o(function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},"redSub"),i.prototype.redISub=o(function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},"redISub"),i.prototype.redShl=o(function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},"redShl"),i.prototype.redMul=o(function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},"redMul"),i.prototype.redIMul=o(function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},"redIMul"),i.prototype.redSqr=o(function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)},"redPow");var X={k256:null,p224:null,p192:null,p25519:null};function U(h,c){this.name=h,this.p=new i(c,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(U,"MPrime"),U.prototype._tmp=o(function(){var c=new i(null);return c.words=new Array(Math.ceil(this.n/13)),c},"_tmp"),U.prototype.ireduce=o(function(c){var d=c,y;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),y=d.bitLength();while(y>this.n);var _=y<this.n?-1:d.ucmp(this.p);return _===0?(d.words[0]=0,d.length=1):_>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},"ireduce"),U.prototype.split=o(function(c,d){c.iushrn(this.n,0,d)},"split"),U.prototype.imulK=o(function(c){return c.imul(this.k)},"imulK");function L(){U.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(L,"K256"),n(L,U),L.prototype.split=o(function(c,d){for(var y=4194303,_=Math.min(c.length,9),w=0;w<_;w++)d.words[w]=c.words[w];if(d.length=_,c.length<=9){c.words[0]=0,c.length=1;return}var m=c.words[9];for(d.words[d.length++]=m&y,w=10;w<c.length;w++){var E=c.words[w]|0;c.words[w-10]=(E&y)<<4|m>>>22,m=E}m>>>=22,c.words[w-10]=m,m===0&&c.length>10?c.length-=10:c.length-=9},"split"),L.prototype.imulK=o(function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,y=0;y<c.length;y++){var _=c.words[y]|0;d+=_*977,c.words[y]=d&67108863,d=_*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c},"imulK");function F(){U.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(F,"P224"),n(F,U);function ne(){U.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(ne,"P192"),n(ne,U);function D(){U.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(D,"P25519"),n(D,U),D.prototype.imulK=o(function(c){for(var d=0,y=0;y<c.length;y++){var _=(c.words[y]|0)*19+d,w=_&67108863;_>>>=26,c.words[y]=w,d=_}return d!==0&&(c.words[c.length++]=d),c},"imulK"),i._prime=o(function(c){if(X[c])return X[c];var d;if(c==="k256")d=new L;else if(c==="p224")d=new F;else if(c==="p192")d=new ne;else if(c==="p25519")d=new D;else throw new Error("Unknown prime "+c);return X[c]=d,d},"prime");function l(h){if(typeof h=="string"){var c=i._prime(h);this.m=c.p,this.prime=c}else t(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}o(l,"Red"),l.prototype._verify1=o(function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},"_verify1"),l.prototype._verify2=o(function(c,d){t((c.negative|d.negative)===0,"red works only with positives"),t(c.red&&c.red===d.red,"red works only with red numbers")},"_verify2"),l.prototype.imod=o(function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(p(c,c.umod(this.m)._forceRed(this)),c)},"imod"),l.prototype.neg=o(function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},"neg"),l.prototype.add=o(function(c,d){this._verify2(c,d);var y=c.add(d);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},"add"),l.prototype.iadd=o(function(c,d){this._verify2(c,d);var y=c.iadd(d);return y.cmp(this.m)>=0&&y.isub(this.m),y},"iadd"),l.prototype.sub=o(function(c,d){this._verify2(c,d);var y=c.sub(d);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},"sub"),l.prototype.isub=o(function(c,d){this._verify2(c,d);var y=c.isub(d);return y.cmpn(0)<0&&y.iadd(this.m),y},"isub"),l.prototype.shl=o(function(c,d){return this._verify1(c),this.imod(c.ushln(d))},"shl"),l.prototype.imul=o(function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},"imul"),l.prototype.mul=o(function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},"mul"),l.prototype.isqr=o(function(c){return this.imul(c,c.clone())},"isqr"),l.prototype.sqr=o(function(c){return this.mul(c,c)},"sqr"),l.prototype.sqrt=o(function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(t(d%2===1),d===3){var y=this.m.add(new i(1)).iushrn(2);return this.pow(c,y)}for(var _=this.m.subn(1),w=0;!_.isZero()&&_.andln(1)===0;)w++,_.iushrn(1);t(!_.isZero());var m=new i(1).toRed(this),E=m.redNeg(),I=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new i(2*g*g).toRed(this);this.pow(g,I).cmp(E)!==0;)g.redIAdd(E);for(var S=this.pow(g,_),ie=this.pow(c,_.addn(1).iushrn(1)),M=this.pow(c,_),K=w;M.cmp(m)!==0;){for(var J=M,N=0;J.cmp(m)!==0;N++)J=J.redSqr();t(N<K);var R=this.pow(S,new i(1).iushln(K-N-1));ie=ie.redMul(R),S=R.redSqr(),M=M.redMul(S),K=N}return ie},"sqrt"),l.prototype.invm=o(function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},"invm"),l.prototype.pow=o(function(c,d){if(d.isZero())return new i(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var y=4,_=new Array(1<<y);_[0]=new i(1).toRed(this),_[1]=c;for(var w=2;w<_.length;w++)_[w]=this.mul(_[w-1],c);var m=_[0],E=0,I=0,g=d.bitLength()%26;for(g===0&&(g=26),w=d.length-1;w>=0;w--){for(var S=d.words[w],ie=g-1;ie>=0;ie--){var M=S>>ie&1;if(m!==_[0]&&(m=this.sqr(m)),M===0&&E===0){I=0;continue}E<<=1,E|=M,I++,!(I!==y&&(w!==0||ie!==0))&&(m=this.mul(m,_[E]),I=0,E=0)}g=26}return m},"pow"),l.prototype.convertTo=o(function(c){var d=c.umod(this.m);return d===c?d.clone():d},"convertTo"),l.prototype.convertFrom=o(function(c){var d=c.clone();return d.red=null,d},"convertFrom"),i.mont=o(function(c){return new v(c)},"mont");function v(h){l.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(v,"Mont"),n(v,l),v.prototype.convertTo=o(function(c){return this.imod(c.ushln(this.shift))},"convertTo"),v.prototype.convertFrom=o(function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},"convertFrom"),v.prototype.imul=o(function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var y=c.imul(d),_=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(_).iushrn(this.shift),m=w;return w.cmp(this.m)>=0?m=w.isub(this.m):w.cmpn(0)<0&&(m=w.iadd(this.m)),m._forceRed(this)},"imul"),v.prototype.mul=o(function(c,d){if(c.isZero()||d.isZero())return new i(0)._forceRed(this);var y=c.mul(d),_=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(_).iushrn(this.shift),m=w;return w.cmp(this.m)>=0?m=w.isub(this.m):w.cmpn(0)<0&&(m=w.iadd(this.m)),m._forceRed(this)},"mul"),v.prototype.invm=o(function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)},"invm")})(typeof D0=="undefined"||D0,_y)});var f3=me((CU,a3)=>{a3.exports=j0;var s3=128,DM=127,IM=~DM,OM=Math.pow(2,31);function j0(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw j0.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=OM;)e[t++]=r&255|s3,r/=128;for(;r&IM;)e[t++]=r&255|s3,r>>>=7;return e[t]=r|0,j0.bytes=t-n+1,e}o(j0,"encode")});var l3=me((DU,u3)=>{u3.exports=K0;var PM=128,c3=127;function K0(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f||i>49)throw K0.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&c3)<<i:(a&c3)*Math.pow(2,i),i+=7}while(a>=PM);return K0.bytes=s-n,t}o(K0,"read")});var h3=me((IU,d3)=>{var NM=Math.pow(2,7),RM=Math.pow(2,14),LM=Math.pow(2,21),BM=Math.pow(2,28),UM=Math.pow(2,35),FM=Math.pow(2,42),$M=Math.pow(2,49),qM=Math.pow(2,56),HM=Math.pow(2,63);d3.exports=function(r){return r<NM?1:r<RM?2:r<LM?3:r<BM?4:r<UM?5:r<FM?6:r<$M?7:r<qM?8:r<HM?9:10}});var Vf=me((OU,p3)=>{p3.exports={encode:f3(),decode:l3(),encodingLength:h3()}});var b3=me((PU,m3)=>{"use strict";function zM(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var n=0;n<r.length;n++){var i=r.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var a=r.length,f=r.charAt(0),u=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function b(O){if(O instanceof Uint8Array||(ArrayBuffer.isView(O)?O=new Uint8Array(O.buffer,O.byteOffset,O.byteLength):Array.isArray(O)&&(O=Uint8Array.from(O))),!(O instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(O.length===0)return"";for(var T=0,k=0,$=0,C=O.length;$!==C&&O[$]===0;)$++,T++;for(var B=(C-$)*p+1>>>0,z=new Uint8Array(B);$!==C;){for(var H=O[$],X=0,U=B-1;(H!==0||X<k)&&U!==-1;U--,X++)H+=256*z[U]>>>0,z[U]=H%a>>>0,H=H/a>>>0;if(H!==0)throw new Error("Non-zero carry");k=X,$++}for(var L=B-k;L!==B&&z[L]===0;)L++;for(var F=f.repeat(T);L<B;++L)F+=r.charAt(z[L]);return F}o(b,"encode");function x(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return new Uint8Array;var T=0;if(O[T]!==" "){for(var k=0,$=0;O[T]===f;)k++,T++;for(var C=(O.length-T)*u+1>>>0,B=new Uint8Array(C);O[T];){var z=e[O.charCodeAt(T)];if(z===255)return;for(var H=0,X=C-1;(z!==0||H<$)&&X!==-1;X--,H++)z+=a*B[X]>>>0,B[X]=z%256>>>0,z=z/256>>>0;if(z!==0)throw new Error("Non-zero carry");$=H,T++}if(O[T]!==" "){for(var U=C-$;U!==C&&B[U]===0;)U++;for(var L=new Uint8Array(k+(C-U)),F=k;U!==C;)L[F++]=B[U++];return L}}}o(x,"decodeUnsafe");function A(O){var T=x(O);if(T)return T;throw new Error("Non-base"+a+" character")}return o(A,"decode"),{encode:b,decodeUnsafe:x,decode:A}}o(zM,"base");m3.exports=zM});var el=me((NU,g3)=>{"use strict";var jM=new TextDecoder,KM=o(r=>jM.decode(r),"decodeText"),VM=new TextEncoder,WM=o(r=>VM.encode(r),"encodeText");function GM(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(GM,"concat");g3.exports={decodeText:KM,encodeText:WM,concat:GM}});var y3=me((RU,v3)=>{"use strict";var{encodeText:YM}=el(),tl=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=YM(this.code),this.alphabet=i,this.codec=n(i)}encode(e){return this.codec.encode(e)}decode(e){for(let t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}};o(tl,"Base");v3.exports=tl});var w3=me((LU,x3)=>{"use strict";var JM=o((r,e,t)=>{let n={};for(let p=0;p<e.length;++p)n[e[p]]=p;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),a=0,f=0,u=0;for(let p=0;p<i;++p){let b=n[r[p]];if(b===void 0)throw new SyntaxError("Invalid character "+r[p]);f=f<<t|b,a+=t,a>=8&&(a-=8,s[u++]=255&f>>a)}if(a>=t||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return s},"decode"),XM=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",a=0,f=0;for(let u=0;u<r.length;++u)for(f=f<<8|r[u],a+=8;a>t;)a-=t,s+=e[i&f>>a];if(a&&(s+=e[i&f<<t-a]),n)for(;s.length*t&7;)s+="=";return s},"encode"),ZM=o(r=>e=>({encode(t){return XM(t,e,r)},decode(t){return JM(t,e,r)}}),"rfc4648");x3.exports={rfc4648:ZM}});var M3=me((BU,S3)=>{"use strict";var Wf=b3(),QM=y3(),{rfc4648:nr}=w3(),{decodeText:eA,encodeText:tA}=el(),rA=o(()=>({encode:eA,decode:tA}),"identity"),_3=[["identity","\0",rA,""],["base2","0",nr(1),"01"],["base8","7",nr(3),"01234567"],["base10","9",Wf,"0123456789"],["base16","f",nr(4),"0123456789abcdef"],["base16upper","F",nr(4),"0123456789ABCDEF"],["base32hex","v",nr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",nr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",nr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",nr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",nr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",nr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",nr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",nr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",nr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",Wf,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Wf,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Wf,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Wf,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],E3=_3.reduce((r,e)=>(r[e[0]]=new QM(e[0],e[1],e[2],e[3]),r),{}),nA=_3.reduce((r,e)=>(r[e[1]]=E3[e[0]],r),{});S3.exports={names:E3,codes:nA}});var V0=me((Ni,T3)=>{"use strict";var ka=M3(),{encodeText:iA,decodeText:rl,concat:A3}=el();function oA(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=ds(r);return cA(t,e),A3([n,e],n.length+e.length)}o(oA,"multibase");function sA(r,e){let t=ds(r),n=iA(t.encode(e));return A3([t.codeBuf,n],t.codeBuf.length+n.length)}o(sA,"encode");function aA(r){r instanceof Uint8Array&&(r=rl(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),ds(r[0]).decode(r.substring(1))}o(aA,"decode");function fA(r){if(r instanceof Uint8Array&&(r=rl(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return ds(r[0]).name}catch(e){return!1}}o(fA,"isEncoded");function cA(r,e){ds(r).decode(rl(e))}o(cA,"validEncode");function ds(r){if(Object.prototype.hasOwnProperty.call(ka.names,r))return ka.names[r];if(Object.prototype.hasOwnProperty.call(ka.codes,r))return ka.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(ds,"encoding");function uA(r){return r instanceof Uint8Array&&(r=rl(r)),ds(r[0])}o(uA,"encodingFromData");Ni=T3.exports=oA;Ni.encode=sA;Ni.decode=aA;Ni.isEncoded=fA;Ni.encoding=ds;Ni.encodingFromData=uA;var lA=Object.freeze(ka.names),dA=Object.freeze(ka.codes);Ni.names=lA;Ni.codes=dA});var C3=me((UU,k3)=>{"use strict";function hA(r,e){for(let t=0;t<r.byteLength;t++){if(r[t]<e[t])return-1;if(r[t]>e[t])return 1}return r.byteLength>e.byteLength?1:r.byteLength<e.byteLength?-1:0}o(hA,"compare");k3.exports=hA});var I3=me((FU,D3)=>{"use strict";function pA(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(pA,"concat");D3.exports=pA});var P3=me(($U,O3)=>{"use strict";function mA(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}o(mA,"equals");O3.exports=mA});var G0=me((qU,B3)=>{"use strict";var{bases:N3}=($c(),ef(i1));function L3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}o(L3,"createCodec");var R3=L3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),W0=L3("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),bA=re({utf8:R3,"utf-8":R3,hex:N3.base16,latin1:W0,ascii:W0,binary:W0},N3);B3.exports=bA});var F3=me((HU,U3)=>{"use strict";var gA=G0();function vA(r,e="utf8"){let t=gA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}o(vA,"fromString");U3.exports=vA});var q3=me((zU,$3)=>{"use strict";var yA=G0();function xA(r,e="utf8"){let t=yA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}o(xA,"toString");$3.exports=xA});var z3=me((jU,H3)=>{"use strict";function wA(r,e){if(r.length!==e.length)throw new Error("Inputs should have the same length");let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}o(wA,"xor");H3.exports=wA});var Y0=me((KU,j3)=>{"use strict";var _A=C3(),EA=I3(),SA=P3(),MA=F3(),AA=q3(),TA=z3();j3.exports={compare:_A,concat:EA,equals:SA,fromString:MA,toString:AA,xor:TA}});var K3=me(ai=>{"use strict";var kA=ai&&ai.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),CA=ai&&ai.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),DA=ai&&ai.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&kA(e,r,t);return CA(e,r),e};Object.defineProperty(ai,"__esModule",{value:!0});ai.keyToDidDoc=void 0;var IA=DA(Y0());function OA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:IA.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(OA,"keyToDidDoc");ai.keyToDidDoc=OA});var V3=me(fi=>{"use strict";var PA=fi&&fi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),NA=fi&&fi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),RA=fi&&fi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&PA(e,r,t);return NA(e,r),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.keyToDidDoc=void 0;var J0=RA(Y0()),LA=uu();function BA(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${J0.toString(e,"base58btc")}`}o(BA,"encodeKey");function UA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=LA.convertPublicKeyToX25519(r),s=`${t}#${BA(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:J0.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:J0.toString(i,"base58btc")}]}}o(UA,"keyToDidDoc");fi.keyToDidDoc=UA});var Z3=me(Fr=>{"use strict";var FA=Fr&&Fr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),$A=Fr&&Fr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Y3=Fr&&Fr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&FA(e,r,t);return $A(e,r),e},J3=Fr&&Fr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getResolver=void 0;var W3=J3(Vf()),qA=J3(V0()),HA=Y3(K3()),zA=Y3(V3()),jA="application/did+ld+json",G3="application/did+json",KA={231:HA,237:zA};function X3(){return{key:(r,e,t,n)=>Z(this,null,function*(){let i=n.accept||G3,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let a=qA.default.decode(e.id),f=W3.default.decode(a),u=a.slice(W3.default.decode.bytes),p=yield KA[f].keyToDidDoc(u,e.id);i===jA?(p["@context"]="https://w3id.org/did/v1",s.didDocument=p):i===G3?s.didDocument=p:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(a){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=a.toString()}return s})}}o(X3,"getResolver");Fr.getResolver=X3;Fr.default={getResolver:X3}});var e6=me((YU,Q3)=>{"use strict";Q3.exports=function(r,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(s){return function(a){return function(f,u){var p={key:f,value:a[f]},b={key:u,value:a[u]};return s(p,b)}}}(e.cmp),i=[];return o(function s(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var f,u;if(Array.isArray(a)){for(u="[",f=0;f<a.length;f++)f&&(u+=","),u+=s(a[f])||"null";return u+"]"}if(a===null)return"null";if(i.indexOf(a)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var p=i.push(a)-1,b=Object.keys(a).sort(n&&n(a));for(u="",f=0;f<b.length;f++){var x=b[f],A=s(a[x]);!A||(u&&(u+=","),u+=JSON.stringify(x)+":"+A)}return i.splice(p,1),"{"+u+"}"}},"stringify")(r)}});var nc=me((ec,Pa)=>{var gT=200,A6="__lodash_hash_undefined__",T6=9007199254740991,yp="[object Arguments]",vT="[object Array]",k6="[object Boolean]",C6="[object Date]",yT="[object Error]",xp="[object Function]",D6="[object GeneratorFunction]",dl="[object Map]",I6="[object Number]",wp="[object Object]",m6="[object Promise]",O6="[object RegExp]",hl="[object Set]",P6="[object String]",N6="[object Symbol]",hp="[object WeakMap]",R6="[object ArrayBuffer]",pl="[object DataView]",L6="[object Float32Array]",B6="[object Float64Array]",U6="[object Int8Array]",F6="[object Int16Array]",$6="[object Int32Array]",q6="[object Uint8Array]",H6="[object Uint8ClampedArray]",z6="[object Uint16Array]",j6="[object Uint32Array]",xT=/[\\^$.*+?()[\]{}|]/g,wT=/\w*$/,_T=/^\[object .+?Constructor\]$/,ET=/^(?:0|[1-9]\d*)$/,At={};At[yp]=At[vT]=At[R6]=At[pl]=At[k6]=At[C6]=At[L6]=At[B6]=At[U6]=At[F6]=At[$6]=At[dl]=At[I6]=At[wp]=At[O6]=At[hl]=At[P6]=At[N6]=At[q6]=At[H6]=At[z6]=At[j6]=!0;At[yT]=At[xp]=At[hp]=!1;var ST=typeof global=="object"&&global&&global.Object===Object&&global,MT=typeof self=="object"&&self&&self.Object===Object&&self,Li=ST||MT||Function("return this")(),K6=typeof ec=="object"&&ec&&!ec.nodeType&&ec,b6=K6&&typeof Pa=="object"&&Pa&&!Pa.nodeType&&Pa,AT=b6&&b6.exports===K6;function TT(r,e){return r.set(e[0],e[1]),r}o(TT,"addMapEntry");function kT(r,e){return r.add(e),r}o(kT,"addSetEntry");function CT(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(CT,"arrayEach");function DT(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(DT,"arrayPush");function V6(r,e,t,n){var i=-1,s=r?r.length:0;for(n&&s&&(t=r[++i]);++i<s;)t=e(t,r[i],i,r);return t}o(V6,"arrayReduce");function IT(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(IT,"baseTimes");function OT(r,e){return r==null?void 0:r[e]}o(OT,"getValue");function W6(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch(t){}return e}o(W6,"isHostObject");function g6(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(g6,"mapToArray");function _p(r,e){return function(t){return r(e(t))}}o(_p,"overArg");function v6(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(v6,"setToArray");var PT=Array.prototype,NT=Function.prototype,ml=Object.prototype,dp=Li["__core-js_shared__"],y6=function(){var r=/[^.]+$/.exec(dp&&dp.keys&&dp.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),G6=NT.toString,bo=ml.hasOwnProperty,bl=ml.toString,RT=RegExp("^"+G6.call(bo).replace(xT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x6=AT?Li.Buffer:void 0,w6=Li.Symbol,_6=Li.Uint8Array,LT=_p(Object.getPrototypeOf,Object),BT=Object.create,UT=ml.propertyIsEnumerable,FT=PT.splice,E6=Object.getOwnPropertySymbols,$T=x6?x6.isBuffer:void 0,qT=_p(Object.keys,Object),pp=La(Li,"DataView"),tc=La(Li,"Map"),mp=La(Li,"Promise"),bp=La(Li,"Set"),gp=La(Li,"WeakMap"),rc=La(Object,"create"),HT=gs(pp),zT=gs(tc),jT=gs(mp),KT=gs(bp),VT=gs(gp),S6=w6?w6.prototype:void 0,M6=S6?S6.valueOf:void 0;function bs(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(bs,"Hash");function WT(){this.__data__=rc?rc(null):{}}o(WT,"hashClear");function GT(r){return this.has(r)&&delete this.__data__[r]}o(GT,"hashDelete");function YT(r){var e=this.__data__;if(rc){var t=e[r];return t===A6?void 0:t}return bo.call(e,r)?e[r]:void 0}o(YT,"hashGet");function JT(r){var e=this.__data__;return rc?e[r]!==void 0:bo.call(e,r)}o(JT,"hashHas");function XT(r,e){var t=this.__data__;return t[r]=rc&&e===void 0?A6:e,this}o(XT,"hashSet");bs.prototype.clear=WT;bs.prototype.delete=GT;bs.prototype.get=YT;bs.prototype.has=JT;bs.prototype.set=XT;function Bi(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(Bi,"ListCache");function ZT(){this.__data__=[]}o(ZT,"listCacheClear");function QT(r){var e=this.__data__,t=gl(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():FT.call(e,t,1),!0}o(QT,"listCacheDelete");function ek(r){var e=this.__data__,t=gl(e,r);return t<0?void 0:e[t][1]}o(ek,"listCacheGet");function tk(r){return gl(this.__data__,r)>-1}o(tk,"listCacheHas");function rk(r,e){var t=this.__data__,n=gl(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(rk,"listCacheSet");Bi.prototype.clear=ZT;Bi.prototype.delete=QT;Bi.prototype.get=ek;Bi.prototype.has=tk;Bi.prototype.set=rk;function Na(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(Na,"MapCache");function nk(){this.__data__={hash:new bs,map:new(tc||Bi),string:new bs}}o(nk,"mapCacheClear");function ik(r){return vl(this,r).delete(r)}o(ik,"mapCacheDelete");function ok(r){return vl(this,r).get(r)}o(ok,"mapCacheGet");function sk(r){return vl(this,r).has(r)}o(sk,"mapCacheHas");function ak(r,e){return vl(this,r).set(r,e),this}o(ak,"mapCacheSet");Na.prototype.clear=nk;Na.prototype.delete=ik;Na.prototype.get=ok;Na.prototype.has=sk;Na.prototype.set=ak;function Ra(r){this.__data__=new Bi(r)}o(Ra,"Stack");function fk(){this.__data__=new Bi}o(fk,"stackClear");function ck(r){return this.__data__.delete(r)}o(ck,"stackDelete");function uk(r){return this.__data__.get(r)}o(uk,"stackGet");function lk(r){return this.__data__.has(r)}o(lk,"stackHas");function dk(r,e){var t=this.__data__;if(t instanceof Bi){var n=t.__data__;if(!tc||n.length<gT-1)return n.push([r,e]),this;t=this.__data__=new Na(n)}return t.set(r,e),this}o(dk,"stackSet");Ra.prototype.clear=fk;Ra.prototype.delete=ck;Ra.prototype.get=uk;Ra.prototype.has=lk;Ra.prototype.set=dk;function hk(r,e){var t=Sp(r)||Bk(r)?IT(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||bo.call(r,s))&&!(i&&(s=="length"||Pk(s,n)))&&t.push(s);return t}o(hk,"arrayLikeKeys");function Y6(r,e,t){var n=r[e];(!(bo.call(r,e)&&Q6(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(Y6,"assignValue");function gl(r,e){for(var t=r.length;t--;)if(Q6(r[t][0],e))return t;return-1}o(gl,"assocIndexOf");function pk(r,e){return r&&J6(e,Mp(e),r)}o(pk,"baseAssign");function vp(r,e,t,n,i,s,a){var f;if(n&&(f=s?n(r,i,s,a):n(r)),f!==void 0)return f;if(!yl(r))return r;var u=Sp(r);if(u){if(f=Dk(r),!e)return Tk(r,f)}else{var p=ms(r),b=p==xp||p==D6;if(Fk(r))return xk(r,e);if(p==wp||p==yp||b&&!s){if(W6(r))return s?r:{};if(f=Ik(b?{}:r),!e)return kk(r,pk(f,r))}else{if(!At[p])return s?r:{};f=Ok(r,p,vp,e)}}a||(a=new Ra);var x=a.get(r);if(x)return x;if(a.set(r,f),!u)var A=t?Ck(r):Mp(r);return CT(A||r,function(O,T){A&&(T=O,O=r[T]),Y6(f,T,vp(O,e,t,n,T,r,a))}),f}o(vp,"baseClone");function mk(r){return yl(r)?BT(r):{}}o(mk,"baseCreate");function bk(r,e,t){var n=e(r);return Sp(r)?n:DT(n,t(r))}o(bk,"baseGetAllKeys");function gk(r){return bl.call(r)}o(gk,"baseGetTag");function vk(r){if(!yl(r)||Rk(r))return!1;var e=tx(r)||W6(r)?RT:_T;return e.test(gs(r))}o(vk,"baseIsNative");function yk(r){if(!Z6(r))return qT(r);var e=[];for(var t in Object(r))bo.call(r,t)&&t!="constructor"&&e.push(t);return e}o(yk,"baseKeys");function xk(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(xk,"cloneBuffer");function Ep(r){var e=new r.constructor(r.byteLength);return new _6(e).set(new _6(r)),e}o(Ep,"cloneArrayBuffer");function wk(r,e){var t=e?Ep(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(wk,"cloneDataView");function _k(r,e,t){var n=e?t(g6(r),!0):g6(r);return V6(n,TT,new r.constructor)}o(_k,"cloneMap");function Ek(r){var e=new r.constructor(r.source,wT.exec(r));return e.lastIndex=r.lastIndex,e}o(Ek,"cloneRegExp");function Sk(r,e,t){var n=e?t(v6(r),!0):v6(r);return V6(n,kT,new r.constructor)}o(Sk,"cloneSet");function Mk(r){return M6?Object(M6.call(r)):{}}o(Mk,"cloneSymbol");function Ak(r,e){var t=e?Ep(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(Ak,"cloneTypedArray");function Tk(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(Tk,"copyArray");function J6(r,e,t,n){t||(t={});for(var i=-1,s=e.length;++i<s;){var a=e[i],f=n?n(t[a],r[a],a,t,r):void 0;Y6(t,a,f===void 0?r[a]:f)}return t}o(J6,"copyObject");function kk(r,e){return J6(r,X6(r),e)}o(kk,"copySymbols");function Ck(r){return bk(r,Mp,X6)}o(Ck,"getAllKeys");function vl(r,e){var t=r.__data__;return Nk(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(vl,"getMapData");function La(r,e){var t=OT(r,e);return vk(t)?t:void 0}o(La,"getNative");var X6=E6?_p(E6,Object):Hk,ms=gk;(pp&&ms(new pp(new ArrayBuffer(1)))!=pl||tc&&ms(new tc)!=dl||mp&&ms(mp.resolve())!=m6||bp&&ms(new bp)!=hl||gp&&ms(new gp)!=hp)&&(ms=o(function(r){var e=bl.call(r),t=e==wp?r.constructor:void 0,n=t?gs(t):void 0;if(n)switch(n){case HT:return pl;case zT:return dl;case jT:return m6;case KT:return hl;case VT:return hp}return e},"getTag"));function Dk(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&bo.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(Dk,"initCloneArray");function Ik(r){return typeof r.constructor=="function"&&!Z6(r)?mk(LT(r)):{}}o(Ik,"initCloneObject");function Ok(r,e,t,n){var i=r.constructor;switch(e){case R6:return Ep(r);case k6:case C6:return new i(+r);case pl:return wk(r,n);case L6:case B6:case U6:case F6:case $6:case q6:case H6:case z6:case j6:return Ak(r,n);case dl:return _k(r,n,t);case I6:case P6:return new i(r);case O6:return Ek(r);case hl:return Sk(r,n,t);case N6:return Mk(r)}}o(Ok,"initCloneByTag");function Pk(r,e){return e=e==null?T6:e,!!e&&(typeof r=="number"||ET.test(r))&&r>-1&&r%1==0&&r<e}o(Pk,"isIndex");function Nk(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(Nk,"isKeyable");function Rk(r){return!!y6&&y6 in r}o(Rk,"isMasked");function Z6(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||ml;return r===t}o(Z6,"isPrototype");function gs(r){if(r!=null){try{return G6.call(r)}catch(e){}try{return r+""}catch(e){}}return""}o(gs,"toSource");function Lk(r){return vp(r,!0,!0)}o(Lk,"cloneDeep");function Q6(r,e){return r===e||r!==r&&e!==e}o(Q6,"eq");function Bk(r){return Uk(r)&&bo.call(r,"callee")&&(!UT.call(r,"callee")||bl.call(r)==yp)}o(Bk,"isArguments");var Sp=Array.isArray;function ex(r){return r!=null&&$k(r.length)&&!tx(r)}o(ex,"isArrayLike");function Uk(r){return qk(r)&&ex(r)}o(Uk,"isArrayLikeObject");var Fk=$T||zk;function tx(r){var e=yl(r)?bl.call(r):"";return e==xp||e==D6}o(tx,"isFunction");function $k(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=T6}o($k,"isLength");function yl(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(yl,"isObject");function qk(r){return!!r&&typeof r=="object"}o(qk,"isObjectLike");function Mp(r){return ex(r)?hk(r):yk(r)}o(Mp,"keys");function Hk(){return[]}o(Hk,"stubArray");function zk(){return!1}o(zk,"stubFalse");Pa.exports=Lk});var Ex=me((FF,_l)=>{var rx,nx,ix,ox,sx,ax,fx,cx,ux,xl,Ap,lx,dx,hx,Ba,px,mx,bx,gx,vx,yx,xx,wx,_x,wl;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof _l=="object"&&typeof _l.exports=="object"?r(t(e,t(_l.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){return n[s]=i?i(s,a):a}}o(t,"createExporter")})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};rx=o(function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}o(s,"__"),n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},"__extends"),nx=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(n[f]=i[f])}return n},ix=o(function(n,i){var s={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(s[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,a=Object.getOwnPropertySymbols(n);f<a.length;f++)i.indexOf(a[f])<0&&Object.prototype.propertyIsEnumerable.call(n,a[f])&&(s[a[f]]=n[a[f]]);return s},"__rest"),ox=o(function(n,i,s,a){var f=arguments.length,u=f<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,i,s,a);else for(var b=n.length-1;b>=0;b--)(p=n[b])&&(u=(f<3?p(u):f>3?p(i,s,u):p(i,s))||u);return f>3&&u&&Object.defineProperty(i,s,u),u},"__decorate"),sx=o(function(n,i){return function(s,a){i(s,a,n)}},"__param"),ax=o(function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},"__metadata"),fx=o(function(n,i,s,a){function f(u){return u instanceof s?u:new s(function(p){p(u)})}return o(f,"adopt"),new(s||(s=Promise))(function(u,p){function b(O){try{A(a.next(O))}catch(T){p(T)}}o(b,"fulfilled");function x(O){try{A(a.throw(O))}catch(T){p(T)}}o(x,"rejected");function A(O){O.done?u(O.value):f(O.value).then(b,x)}o(A,"step"),A((a=a.apply(n,i||[])).next())})},"__awaiter"),cx=o(function(n,i){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},a,f,u,p;return p={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function b(A){return function(O){return x([A,O])}}function x(A){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,f&&(u=A[0]&2?f.return:A[0]?f.throw||((u=f.return)&&u.call(f),0):f.next)&&!(u=u.call(f,A[1])).done)return u;switch(f=0,u&&(A=[A[0]&2,u.value]),A[0]){case 0:case 1:u=A;break;case 4:return s.label++,{value:A[1],done:!1};case 5:s.label++,f=A[1],A=[0];continue;case 7:A=s.ops.pop(),s.trys.pop();continue;default:if(u=s.trys,!(u=u.length>0&&u[u.length-1])&&(A[0]===6||A[0]===2)){s=0;continue}if(A[0]===3&&(!u||A[1]>u[0]&&A[1]<u[3])){s.label=A[1];break}if(A[0]===6&&s.label<u[1]){s.label=u[1],u=A;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(A);break}u[2]&&s.ops.pop(),s.trys.pop();continue}A=i.call(n,s)}catch(O){A=[6,O],f=0}finally{a=u=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},"__generator"),ux=o(function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&wl(i,n,s)},"__exportStar"),wl=Object.create?function(n,i,s,a){a===void 0&&(a=s);var f=Object.getOwnPropertyDescriptor(i,s);(!f||("get"in f?!i.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,f)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]},xl=o(function(n){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&n[i],a=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),Ap=o(function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var a=s.call(n),f,u=[],p;try{for(;(i===void 0||i-- >0)&&!(f=a.next()).done;)u.push(f.value)}catch(b){p={error:b}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(p)throw p.error}}return u},"__read"),lx=o(function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(Ap(arguments[i]));return n},"__spread"),dx=o(function(){for(var n=0,i=0,s=arguments.length;i<s;i++)n+=arguments[i].length;for(var a=Array(n),f=0,i=0;i<s;i++)for(var u=arguments[i],p=0,b=u.length;p<b;p++,f++)a[f]=u[p];return a},"__spreadArrays"),hx=o(function(n,i,s){if(s||arguments.length===2)for(var a=0,f=i.length,u;a<f;a++)(u||!(a in i))&&(u||(u=Array.prototype.slice.call(i,0,a)),u[a]=i[a]);return n.concat(u||Array.prototype.slice.call(i))},"__spreadArray"),Ba=o(function(n){return this instanceof Ba?(this.v=n,this):new Ba(n)},"__await"),px=o(function(n,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s.apply(n,i||[]),f,u=[];return f={},p("next"),p("throw"),p("return"),f[Symbol.asyncIterator]=function(){return this},f;function p(k){a[k]&&(f[k]=function($){return new Promise(function(C,B){u.push([k,$,C,B])>1||b(k,$)})})}function b(k,$){try{x(a[k]($))}catch(C){T(u[0][3],C)}}function x(k){k.value instanceof Ba?Promise.resolve(k.value.v).then(A,O):T(u[0][2],k)}function A(k){b("next",k)}function O(k){b("throw",k)}function T(k,$){k($),u.shift(),u.length&&b(u[0][0],u[0][1])}},"__asyncGenerator"),mx=o(function(n){var i,s;return i={},a("next"),a("throw",function(f){throw f}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(f,u){i[f]=n[f]?function(p){return(s=!s)?{value:Ba(n[f](p)),done:f==="return"}:u?u(p):p}:u}},"__asyncDelegator"),bx=o(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof xl=="function"?xl(n):n[Symbol.iterator](),s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s);function a(u){s[u]=n[u]&&function(p){return new Promise(function(b,x){p=n[u](p),f(b,x,p.done,p.value)})}}function f(u,p,b,x){Promise.resolve(x).then(function(A){u({value:A,done:b})},p)}},"__asyncValues"),gx=o(function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n},"__makeTemplateObject");var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};vx=o(function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&wl(i,n,s);return t(i,n),i},"__importStar"),yx=o(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),xx=o(function(n,i,s,a){if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?a:s==="a"?a.call(n):a?a.value:i.get(n)},"__classPrivateFieldGet"),wx=o(function(n,i,s,a,f){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!f:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?f.call(n,s):f?f.value=s:i.set(n,s),s},"__classPrivateFieldSet"),_x=o(function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},"__classPrivateFieldIn"),r("__extends",rx),r("__assign",nx),r("__rest",ix),r("__decorate",ox),r("__param",sx),r("__metadata",ax),r("__awaiter",fx),r("__generator",cx),r("__exportStar",ux),r("__createBinding",wl),r("__values",xl),r("__read",Ap),r("__spread",lx),r("__spreadArrays",dx),r("__spreadArray",hx),r("__await",Ba),r("__asyncGenerator",px),r("__asyncDelegator",mx),r("__asyncValues",bx),r("__makeTemplateObject",gx),r("__importStar",vx),r("__importDefault",yx),r("__classPrivateFieldGet",xx),r("__classPrivateFieldSet",wx),r("__classPrivateFieldIn",_x)})});var xw=me((Wj,yw)=>{"use strict";var yC=function(){function r(t,n){if(typeof t!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+t+"."));this._batchLoadFn=t,this._maxBatchSize=EC(n),this._batchScheduleFn=SC(n),this._cacheKeyFn=MC(n),this._cacheMap=AC(n),this._batch=null}o(r,"DataLoader");var e=r.prototype;return e.load=o(function(n){if(n==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(n)+"."));var i=wC(this),s=this._cacheMap,a=this._cacheKeyFn(n);if(s){var f=s.get(a);if(f){var u=i.cacheHits||(i.cacheHits=[]);return new Promise(function(b){u.push(function(){b(f)})})}}i.keys.push(n);var p=new Promise(function(b,x){i.callbacks.push({resolve:b,reject:x})});return s&&s.set(a,p),p},"load"),e.loadMany=o(function(n){if(!vw(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var i=[],s=0;s<n.length;s++)i.push(this.load(n[s]).catch(function(a){return a}));return Promise.all(i)},"loadMany"),e.clear=o(function(n){var i=this._cacheMap;if(i){var s=this._cacheKeyFn(n);i.delete(s)}return this},"clear"),e.clearAll=o(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),e.prime=o(function(n,i){var s=this._cacheMap;if(s){var a=this._cacheKeyFn(n);if(s.get(a)===void 0){var f;i instanceof Error?(f=Promise.reject(i),f.catch(function(){})):f=Promise.resolve(i),s.set(a,f)}}return this},"prime"),r}(),xC=typeof process=="object"&&typeof process.nextTick=="function"?function(r){jp||(jp=Promise.resolve()),jp.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},jp;function wC(r){var e=r._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<r._maxBatchSize&&(!e.cacheHits||e.cacheHits.length<r._maxBatchSize))return e;var t={hasDispatched:!1,keys:[],callbacks:[]};return r._batch=t,r._batchScheduleFn(function(){_C(r,t)}),t}o(wC,"getCurrentBatch");function _C(r,e){if(e.hasDispatched=!0,e.keys.length===0){Kp(e);return}var t=r._batchLoadFn(e.keys);if(!t||typeof t.then!="function")return gw(r,e,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise: "+String(t)+".")));t.then(function(n){if(!vw(n))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise of an Array: "+String(n)+"."));if(n.length!==e.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(`
626
+ `}),h},"errorsToAscii"),z=!1,H=!1,X=!1,U=!1,L=0,F;if(this.errors=[],Buffer.isBuffer(e))this.chars=s.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=s.decode("STRING",e);else throw new Error(`${t}input source is not a string, byte Buffer or character array`);this.sabnf=s.encode("STRING",this.chars),this.scan=o(function(D,l){this.lines=a(this.chars,this.errors,D,l),z=!0},"scan"),this.parse=o(function(D,l){if(!z)throw new Error(`${t}grammar not scanned`);f.syntax(this.chars,this.lines,this.errors,D,l),H=!0},"parse"),this.translate=o(function(){if(!H)throw new Error(`${t}grammar not scanned and parsed`);let D=f.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=D.rules,this.udts=D.udts,F=D.lineMap,X=!0)},"translate"),this.attributes=o(function(){if(!X)throw new Error(`${t}grammar not scanned, parsed and translated`);return L=u(this.rules,this.udts,F,this.errors),U=!0,L},"attrs"),this.generate=o(function(D){if(this.lines=a(this.chars,this.errors,D),this.errors.length||(f.syntax(this.chars,this.lines,this.errors,D),this.errors.length))return;let l=f.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=l.rules,this.udts=l.udts,F=l.lineMap,L=u(this.rules,this.udts,F,this.errors),U=!0)},"generate"),this.displayRules=o(function(D="index"){if(!X)throw new Error(`${t}grammar not scanned, parsed and translated`);return A(this.rules,this.udts,D)},"displayRules"),this.displayRuleDependencies=o(function(D="index"){if(!U)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return x(D)},"displayRuleDependencies"),this.displayAttributes=o(function(D="index"){if(!U)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return L&&b(D),p(D)},"displayAttributes"),this.displayAttributeErrors=o(function(){if(!U)throw new Error(`${t}no attributes - must be preceeded by call to attributes()`);return b()},"displayAttributeErrors"),this.toSource=o(function(D){if(!U)throw new Error(`${t}can't generate parser source - must be preceeded by call to attributes()`);if(L)throw new Error(`${t}can't generate parser source - attributes have ${L} errors`);return f.generateSource(this.chars,this.lines,this.rules,this.udts,D)},"toSource"),this.toObject=o(function(){if(!U)throw new Error(`${t}can't generate parser source - must be preceeded by call to attributes()`);if(L)throw new Error(`${t}can't generate parser source - attributes have ${L} errors`);return f.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),this.errorsToAscii=o(function(){return B(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),this.errorsToHtml=o(function(D){return C(this.errors,this.lines,this.chars,D)},"errorsToHtmlFunc"),this.linesToAscii=o(function(){return k(this.lines)},"linesToAsciiFunc"),this.linesToHtml=o(function(){return $(this.lines)},"linesToHtmlFunc")},"api")});var I0=me((My,D0)=>{(function(r,e){"use strict";function t(h,c){if(!h)throw new Error(c||"Assertion failed")}o(t,"assert");function n(h,c){h.super_=c;var d=o(function(){},"TempCtor");d.prototype=c.prototype,h.prototype=new d,h.prototype.constructor=h}o(n,"inherits");function i(h,c,d){if(i.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(h||0,c||10,d||"be"))}o(i,"BN"),typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=Zd().Buffer}catch(h){}i.isBN=o(function(c){return c instanceof i?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===i.wordSize&&Array.isArray(c.words)},"isBN"),i.max=o(function(c,d){return c.cmp(d)>0?c:d},"max"),i.min=o(function(c,d){return c.cmp(d)<0?c:d},"min"),i.prototype._init=o(function(c,d,y){if(typeof c=="number")return this._initNumber(c,d,y);if(typeof c=="object")return this._initArray(c,d,y);d==="hex"&&(d=16),t(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var _=0;c[0]==="-"&&(_++,this.negative=1),_<c.length&&(d===16?this._parseHex(c,_,y):(this._parseBase(c,d,_),y==="le"&&this._initArray(this.toArray(),d,y)))},"init"),i.prototype._initNumber=o(function(c,d,y){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),d,y)},"_initNumber"),i.prototype._initArray=o(function(c,d,y){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var w,m,E=0;if(y==="be")for(_=c.length-1,w=0;_>=0;_-=3)m=c[_]|c[_-1]<<8|c[_-2]<<16,this.words[w]|=m<<E&67108863,this.words[w+1]=m>>>26-E&67108863,E+=24,E>=26&&(E-=26,w++);else if(y==="le")for(_=0,w=0;_<c.length;_+=3)m=c[_]|c[_+1]<<8|c[_+2]<<16,this.words[w]|=m<<E&67108863,this.words[w+1]=m>>>26-E&67108863,E+=24,E>=26&&(E-=26,w++);return this._strip()},"_initArray");function a(h,c){var d=h.charCodeAt(c);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;t(!1,"Invalid character in "+h)}o(a,"parseHex4Bits");function f(h,c,d){var y=a(h,d);return d-1>=c&&(y|=a(h,d-1)<<4),y}o(f,"parseHexByte"),i.prototype._parseHex=o(function(c,d,y){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var w=0,m=0,E;if(y==="be")for(_=c.length-1;_>=d;_-=2)E=f(c,d,_)<<w,this.words[m]|=E&67108863,w>=18?(w-=18,m+=1,this.words[m]|=E>>>26):w+=8;else{var I=c.length-d;for(_=I%2===0?d+1:d;_<c.length;_+=2)E=f(c,d,_)<<w,this.words[m]|=E&67108863,w>=18?(w-=18,m+=1,this.words[m]|=E>>>26):w+=8}this._strip()},"_parseHex");function u(h,c,d,y){for(var _=0,w=0,m=Math.min(h.length,d),E=c;E<m;E++){var I=h.charCodeAt(E)-48;_*=y,I>=49?w=I-49+10:I>=17?w=I-17+10:w=I,t(I>=0&&w<y,"Invalid character"),_+=w}return _}o(u,"parseBase"),i.prototype._parseBase=o(function(c,d,y){this.words=[0],this.length=1;for(var _=0,w=1;w<=67108863;w*=d)_++;_--,w=w/d|0;for(var m=c.length-y,E=m%_,I=Math.min(m,m-E)+y,g=0,S=y;S<I;S+=_)g=u(c,S,S+_,d),this.imuln(w),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(E!==0){var ie=1;for(g=u(c,S,c.length,d),S=0;S<E;S++)ie*=d;this.imuln(ie),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this._strip()},"_parseBase"),i.prototype.copy=o(function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red},"copy");function p(h,c){h.words=c.words,h.length=c.length,h.negative=c.negative,h.red=c.red}if(o(p,"move"),i.prototype._move=o(function(c){p(c,this)},"_move"),i.prototype.clone=o(function(){var c=new i(null);return this.copy(c),c},"clone"),i.prototype._expand=o(function(c){for(;this.length<c;)this.words[this.length++]=0;return this},"_expand"),i.prototype._strip=o(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),i.prototype._normSign=o(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(h){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}o(b,"inspect");var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],O=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=o(function(c,d){c=c||10,d=d|0||1;var y;if(c===16||c==="hex"){y="";for(var _=0,w=0,m=0;m<this.length;m++){var E=this.words[m],I=((E<<_|w)&16777215).toString(16);w=E>>>24-_&16777215,_+=2,_>=26&&(_-=26,m--),w!==0||m!==this.length-1?y=x[6-I.length]+I+y:y=I+y}for(w!==0&&(y=w.toString(16)+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(c===(c|0)&&c>=2&&c<=36){var g=A[c],S=O[c];y="";var ie=this.clone();for(ie.negative=0;!ie.isZero();){var M=ie.modrn(S).toString(c);ie=ie.idivn(S),ie.isZero()?y=M+y:y=x[g-M.length]+M+y}for(this.isZero()&&(y="0"+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}t(!1,"Base should be between 2 and 36")},"toString"),i.prototype.toNumber=o(function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},"toNumber"),i.prototype.toJSON=o(function(){return this.toString(16,2)},"toJSON"),s&&(i.prototype.toBuffer=o(function(c,d){return this.toArrayLike(s,c,d)},"toBuffer")),i.prototype.toArray=o(function(c,d){return this.toArrayLike(Array,c,d)},"toArray");var T=o(function(c,d){return c.allocUnsafe?c.allocUnsafe(d):new c(d)},"allocate");i.prototype.toArrayLike=o(function(c,d,y){this._strip();var _=this.byteLength(),w=y||Math.max(1,_);t(_<=w,"byte array longer than desired length"),t(w>0,"Requested array length <= 0");var m=T(c,w),E=d==="le"?"LE":"BE";return this["_toArrayLike"+E](m,_),m},"toArrayLike"),i.prototype._toArrayLikeLE=o(function(c,d){for(var y=0,_=0,w=0,m=0;w<this.length;w++){var E=this.words[w]<<m|_;c[y++]=E&255,y<c.length&&(c[y++]=E>>8&255),y<c.length&&(c[y++]=E>>16&255),m===6?(y<c.length&&(c[y++]=E>>24&255),_=0,m=0):(_=E>>>24,m+=2)}if(y<c.length)for(c[y++]=_;y<c.length;)c[y++]=0},"_toArrayLikeLE"),i.prototype._toArrayLikeBE=o(function(c,d){for(var y=c.length-1,_=0,w=0,m=0;w<this.length;w++){var E=this.words[w]<<m|_;c[y--]=E&255,y>=0&&(c[y--]=E>>8&255),y>=0&&(c[y--]=E>>16&255),m===6?(y>=0&&(c[y--]=E>>24&255),_=0,m=0):(_=E>>>24,m+=2)}if(y>=0)for(c[y--]=_;y>=0;)c[y--]=0},"_toArrayLikeBE"),Math.clz32?i.prototype._countBits=o(function(c){return 32-Math.clz32(c)},"_countBits"):i.prototype._countBits=o(function(c){var d=c,y=0;return d>=4096&&(y+=13,d>>>=13),d>=64&&(y+=7,d>>>=7),d>=8&&(y+=4,d>>>=4),d>=2&&(y+=2,d>>>=2),y+d},"_countBits"),i.prototype._zeroBits=o(function(c){if(c===0)return 26;var d=c,y=0;return(d&8191)===0&&(y+=13,d>>>=13),(d&127)===0&&(y+=7,d>>>=7),(d&15)===0&&(y+=4,d>>>=4),(d&3)===0&&(y+=2,d>>>=2),(d&1)===0&&y++,y},"_zeroBits"),i.prototype.bitLength=o(function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d},"bitLength");function k(h){for(var c=new Array(h.bitLength()),d=0;d<c.length;d++){var y=d/26|0,_=d%26;c[d]=h.words[y]>>>_&1}return c}o(k,"toBitArray"),i.prototype.zeroBits=o(function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var y=this._zeroBits(this.words[d]);if(c+=y,y!==26)break}return c},"zeroBits"),i.prototype.byteLength=o(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),i.prototype.toTwos=o(function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},"toTwos"),i.prototype.fromTwos=o(function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},"fromTwos"),i.prototype.isNeg=o(function(){return this.negative!==0},"isNeg"),i.prototype.neg=o(function(){return this.clone().ineg()},"neg"),i.prototype.ineg=o(function(){return this.isZero()||(this.negative^=1),this},"ineg"),i.prototype.iuor=o(function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this._strip()},"iuor"),i.prototype.ior=o(function(c){return t((this.negative|c.negative)===0),this.iuor(c)},"ior"),i.prototype.or=o(function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},"or"),i.prototype.uor=o(function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},"uor"),i.prototype.iuand=o(function(c){var d;this.length>c.length?d=c:d=this;for(var y=0;y<d.length;y++)this.words[y]=this.words[y]&c.words[y];return this.length=d.length,this._strip()},"iuand"),i.prototype.iand=o(function(c){return t((this.negative|c.negative)===0),this.iuand(c)},"iand"),i.prototype.and=o(function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},"and"),i.prototype.uand=o(function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},"uand"),i.prototype.iuxor=o(function(c){var d,y;this.length>c.length?(d=this,y=c):(d=c,y=this);for(var _=0;_<y.length;_++)this.words[_]=d.words[_]^y.words[_];if(this!==d)for(;_<d.length;_++)this.words[_]=d.words[_];return this.length=d.length,this._strip()},"iuxor"),i.prototype.ixor=o(function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},"ixor"),i.prototype.xor=o(function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},"xor"),i.prototype.uxor=o(function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},"uxor"),i.prototype.inotn=o(function(c){t(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,y=c%26;this._expand(d),y>0&&d--;for(var _=0;_<d;_++)this.words[_]=~this.words[_]&67108863;return y>0&&(this.words[_]=~this.words[_]&67108863>>26-y),this._strip()},"inotn"),i.prototype.notn=o(function(c){return this.clone().inotn(c)},"notn"),i.prototype.setn=o(function(c,d){t(typeof c=="number"&&c>=0);var y=c/26|0,_=c%26;return this._expand(y+1),d?this.words[y]=this.words[y]|1<<_:this.words[y]=this.words[y]&~(1<<_),this._strip()},"setn"),i.prototype.iadd=o(function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var y,_;this.length>c.length?(y=this,_=c):(y=c,_=this);for(var w=0,m=0;m<_.length;m++)d=(y.words[m]|0)+(_.words[m]|0)+w,this.words[m]=d&67108863,w=d>>>26;for(;w!==0&&m<y.length;m++)d=(y.words[m]|0)+w,this.words[m]=d&67108863,w=d>>>26;if(this.length=y.length,w!==0)this.words[this.length]=w,this.length++;else if(y!==this)for(;m<y.length;m++)this.words[m]=y.words[m];return this},"iadd"),i.prototype.add=o(function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},"add"),i.prototype.isub=o(function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var y=this.cmp(c);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,w;y>0?(_=this,w=c):(_=c,w=this);for(var m=0,E=0;E<w.length;E++)d=(_.words[E]|0)-(w.words[E]|0)+m,m=d>>26,this.words[E]=d&67108863;for(;m!==0&&E<_.length;E++)d=(_.words[E]|0)+m,m=d>>26,this.words[E]=d&67108863;if(m===0&&E<_.length&&_!==this)for(;E<_.length;E++)this.words[E]=_.words[E];return this.length=Math.max(this.length,E),_!==this&&(this.negative=1),this._strip()},"isub"),i.prototype.sub=o(function(c){return this.clone().isub(c)},"sub");function $(h,c,d){d.negative=c.negative^h.negative;var y=h.length+c.length|0;d.length=y,y=y-1|0;var _=h.words[0]|0,w=c.words[0]|0,m=_*w,E=m&67108863,I=m/67108864|0;d.words[0]=E;for(var g=1;g<y;g++){for(var S=I>>>26,ie=I&67108863,M=Math.min(g,c.length-1),K=Math.max(0,g-h.length+1);K<=M;K++){var J=g-K|0;_=h.words[J]|0,w=c.words[K]|0,m=_*w+ie,S+=m/67108864|0,ie=m&67108863}d.words[g]=ie|0,I=S|0}return I!==0?d.words[g]=I|0:d.length--,d._strip()}o($,"smallMulTo");var C=o(function(c,d,y){var _=c.words,w=d.words,m=y.words,E=0,I,g,S,ie=_[0]|0,M=ie&8191,K=ie>>>13,J=_[1]|0,N=J&8191,R=J>>>13,V=_[2]|0,W=V&8191,ee=V>>>13,he=_[3]|0,fe=he&8191,Y=he>>>13,pe=_[4]|0,Q=pe&8191,ce=pe>>>13,q=_[5]|0,se=q&8191,be=q>>>13,ke=_[6]|0,we=ke&8191,Oe=ke>>>13,vr=_[7]|0,te=vr&8191,G=vr>>>13,P=_[8]|0,j=P&8191,ae=P>>>13,ue=_[9]|0,le=ue&8191,ge=ue>>>13,ft=w[0]|0,Ee=ft&8191,ve=ft>>>13,lt=w[1]|0,De=lt&8191,Ne=lt>>>13,Bn=w[2]|0,Le=Bn&8191,Be=Bn>>>13,Un=w[3]|0,Ue=Un&8191,Fe=Un>>>13,Fn=w[4]|0,$e=Fn&8191,qe=Fn>>>13,$n=w[5]|0,He=$n&8191,ze=$n>>>13,qn=w[6]|0,je=qn&8191,Ke=qn>>>13,Hn=w[7]|0,Ve=Hn&8191,We=Hn>>>13,zn=w[8]|0,Ge=zn&8191,Ye=zn>>>13,gn=w[9]|0,mt=gn&8191,bt=gn>>>13;y.negative=c.negative^d.negative,y.length=19,I=Math.imul(M,Ee),g=Math.imul(M,ve),g=g+Math.imul(K,Ee)|0,S=Math.imul(K,ve);var Yr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,I=Math.imul(N,Ee),g=Math.imul(N,ve),g=g+Math.imul(R,Ee)|0,S=Math.imul(R,ve),I=I+Math.imul(M,De)|0,g=g+Math.imul(M,Ne)|0,g=g+Math.imul(K,De)|0,S=S+Math.imul(K,Ne)|0;var Jr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,I=Math.imul(W,Ee),g=Math.imul(W,ve),g=g+Math.imul(ee,Ee)|0,S=Math.imul(ee,ve),I=I+Math.imul(N,De)|0,g=g+Math.imul(N,Ne)|0,g=g+Math.imul(R,De)|0,S=S+Math.imul(R,Ne)|0,I=I+Math.imul(M,Le)|0,g=g+Math.imul(M,Be)|0,g=g+Math.imul(K,Le)|0,S=S+Math.imul(K,Be)|0;var Xr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,I=Math.imul(fe,Ee),g=Math.imul(fe,ve),g=g+Math.imul(Y,Ee)|0,S=Math.imul(Y,ve),I=I+Math.imul(W,De)|0,g=g+Math.imul(W,Ne)|0,g=g+Math.imul(ee,De)|0,S=S+Math.imul(ee,Ne)|0,I=I+Math.imul(N,Le)|0,g=g+Math.imul(N,Be)|0,g=g+Math.imul(R,Le)|0,S=S+Math.imul(R,Be)|0,I=I+Math.imul(M,Ue)|0,g=g+Math.imul(M,Fe)|0,g=g+Math.imul(K,Ue)|0,S=S+Math.imul(K,Fe)|0;var Zr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,I=Math.imul(Q,Ee),g=Math.imul(Q,ve),g=g+Math.imul(ce,Ee)|0,S=Math.imul(ce,ve),I=I+Math.imul(fe,De)|0,g=g+Math.imul(fe,Ne)|0,g=g+Math.imul(Y,De)|0,S=S+Math.imul(Y,Ne)|0,I=I+Math.imul(W,Le)|0,g=g+Math.imul(W,Be)|0,g=g+Math.imul(ee,Le)|0,S=S+Math.imul(ee,Be)|0,I=I+Math.imul(N,Ue)|0,g=g+Math.imul(N,Fe)|0,g=g+Math.imul(R,Ue)|0,S=S+Math.imul(R,Fe)|0,I=I+Math.imul(M,$e)|0,g=g+Math.imul(M,qe)|0,g=g+Math.imul(K,$e)|0,S=S+Math.imul(K,qe)|0;var Qr=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,I=Math.imul(se,Ee),g=Math.imul(se,ve),g=g+Math.imul(be,Ee)|0,S=Math.imul(be,ve),I=I+Math.imul(Q,De)|0,g=g+Math.imul(Q,Ne)|0,g=g+Math.imul(ce,De)|0,S=S+Math.imul(ce,Ne)|0,I=I+Math.imul(fe,Le)|0,g=g+Math.imul(fe,Be)|0,g=g+Math.imul(Y,Le)|0,S=S+Math.imul(Y,Be)|0,I=I+Math.imul(W,Ue)|0,g=g+Math.imul(W,Fe)|0,g=g+Math.imul(ee,Ue)|0,S=S+Math.imul(ee,Fe)|0,I=I+Math.imul(N,$e)|0,g=g+Math.imul(N,qe)|0,g=g+Math.imul(R,$e)|0,S=S+Math.imul(R,qe)|0,I=I+Math.imul(M,He)|0,g=g+Math.imul(M,ze)|0,g=g+Math.imul(K,He)|0,S=S+Math.imul(K,ze)|0;var To=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(To>>>26)|0,To&=67108863,I=Math.imul(we,Ee),g=Math.imul(we,ve),g=g+Math.imul(Oe,Ee)|0,S=Math.imul(Oe,ve),I=I+Math.imul(se,De)|0,g=g+Math.imul(se,Ne)|0,g=g+Math.imul(be,De)|0,S=S+Math.imul(be,Ne)|0,I=I+Math.imul(Q,Le)|0,g=g+Math.imul(Q,Be)|0,g=g+Math.imul(ce,Le)|0,S=S+Math.imul(ce,Be)|0,I=I+Math.imul(fe,Ue)|0,g=g+Math.imul(fe,Fe)|0,g=g+Math.imul(Y,Ue)|0,S=S+Math.imul(Y,Fe)|0,I=I+Math.imul(W,$e)|0,g=g+Math.imul(W,qe)|0,g=g+Math.imul(ee,$e)|0,S=S+Math.imul(ee,qe)|0,I=I+Math.imul(N,He)|0,g=g+Math.imul(N,ze)|0,g=g+Math.imul(R,He)|0,S=S+Math.imul(R,ze)|0,I=I+Math.imul(M,je)|0,g=g+Math.imul(M,Ke)|0,g=g+Math.imul(K,je)|0,S=S+Math.imul(K,Ke)|0;var ko=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(ko>>>26)|0,ko&=67108863,I=Math.imul(te,Ee),g=Math.imul(te,ve),g=g+Math.imul(G,Ee)|0,S=Math.imul(G,ve),I=I+Math.imul(we,De)|0,g=g+Math.imul(we,Ne)|0,g=g+Math.imul(Oe,De)|0,S=S+Math.imul(Oe,Ne)|0,I=I+Math.imul(se,Le)|0,g=g+Math.imul(se,Be)|0,g=g+Math.imul(be,Le)|0,S=S+Math.imul(be,Be)|0,I=I+Math.imul(Q,Ue)|0,g=g+Math.imul(Q,Fe)|0,g=g+Math.imul(ce,Ue)|0,S=S+Math.imul(ce,Fe)|0,I=I+Math.imul(fe,$e)|0,g=g+Math.imul(fe,qe)|0,g=g+Math.imul(Y,$e)|0,S=S+Math.imul(Y,qe)|0,I=I+Math.imul(W,He)|0,g=g+Math.imul(W,ze)|0,g=g+Math.imul(ee,He)|0,S=S+Math.imul(ee,ze)|0,I=I+Math.imul(N,je)|0,g=g+Math.imul(N,Ke)|0,g=g+Math.imul(R,je)|0,S=S+Math.imul(R,Ke)|0,I=I+Math.imul(M,Ve)|0,g=g+Math.imul(M,We)|0,g=g+Math.imul(K,Ve)|0,S=S+Math.imul(K,We)|0;var Co=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Co>>>26)|0,Co&=67108863,I=Math.imul(j,Ee),g=Math.imul(j,ve),g=g+Math.imul(ae,Ee)|0,S=Math.imul(ae,ve),I=I+Math.imul(te,De)|0,g=g+Math.imul(te,Ne)|0,g=g+Math.imul(G,De)|0,S=S+Math.imul(G,Ne)|0,I=I+Math.imul(we,Le)|0,g=g+Math.imul(we,Be)|0,g=g+Math.imul(Oe,Le)|0,S=S+Math.imul(Oe,Be)|0,I=I+Math.imul(se,Ue)|0,g=g+Math.imul(se,Fe)|0,g=g+Math.imul(be,Ue)|0,S=S+Math.imul(be,Fe)|0,I=I+Math.imul(Q,$e)|0,g=g+Math.imul(Q,qe)|0,g=g+Math.imul(ce,$e)|0,S=S+Math.imul(ce,qe)|0,I=I+Math.imul(fe,He)|0,g=g+Math.imul(fe,ze)|0,g=g+Math.imul(Y,He)|0,S=S+Math.imul(Y,ze)|0,I=I+Math.imul(W,je)|0,g=g+Math.imul(W,Ke)|0,g=g+Math.imul(ee,je)|0,S=S+Math.imul(ee,Ke)|0,I=I+Math.imul(N,Ve)|0,g=g+Math.imul(N,We)|0,g=g+Math.imul(R,Ve)|0,S=S+Math.imul(R,We)|0,I=I+Math.imul(M,Ge)|0,g=g+Math.imul(M,Ye)|0,g=g+Math.imul(K,Ge)|0,S=S+Math.imul(K,Ye)|0;var Do=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Do>>>26)|0,Do&=67108863,I=Math.imul(le,Ee),g=Math.imul(le,ve),g=g+Math.imul(ge,Ee)|0,S=Math.imul(ge,ve),I=I+Math.imul(j,De)|0,g=g+Math.imul(j,Ne)|0,g=g+Math.imul(ae,De)|0,S=S+Math.imul(ae,Ne)|0,I=I+Math.imul(te,Le)|0,g=g+Math.imul(te,Be)|0,g=g+Math.imul(G,Le)|0,S=S+Math.imul(G,Be)|0,I=I+Math.imul(we,Ue)|0,g=g+Math.imul(we,Fe)|0,g=g+Math.imul(Oe,Ue)|0,S=S+Math.imul(Oe,Fe)|0,I=I+Math.imul(se,$e)|0,g=g+Math.imul(se,qe)|0,g=g+Math.imul(be,$e)|0,S=S+Math.imul(be,qe)|0,I=I+Math.imul(Q,He)|0,g=g+Math.imul(Q,ze)|0,g=g+Math.imul(ce,He)|0,S=S+Math.imul(ce,ze)|0,I=I+Math.imul(fe,je)|0,g=g+Math.imul(fe,Ke)|0,g=g+Math.imul(Y,je)|0,S=S+Math.imul(Y,Ke)|0,I=I+Math.imul(W,Ve)|0,g=g+Math.imul(W,We)|0,g=g+Math.imul(ee,Ve)|0,S=S+Math.imul(ee,We)|0,I=I+Math.imul(N,Ge)|0,g=g+Math.imul(N,Ye)|0,g=g+Math.imul(R,Ge)|0,S=S+Math.imul(R,Ye)|0,I=I+Math.imul(M,mt)|0,g=g+Math.imul(M,bt)|0,g=g+Math.imul(K,mt)|0,S=S+Math.imul(K,bt)|0;var Io=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Io>>>26)|0,Io&=67108863,I=Math.imul(le,De),g=Math.imul(le,Ne),g=g+Math.imul(ge,De)|0,S=Math.imul(ge,Ne),I=I+Math.imul(j,Le)|0,g=g+Math.imul(j,Be)|0,g=g+Math.imul(ae,Le)|0,S=S+Math.imul(ae,Be)|0,I=I+Math.imul(te,Ue)|0,g=g+Math.imul(te,Fe)|0,g=g+Math.imul(G,Ue)|0,S=S+Math.imul(G,Fe)|0,I=I+Math.imul(we,$e)|0,g=g+Math.imul(we,qe)|0,g=g+Math.imul(Oe,$e)|0,S=S+Math.imul(Oe,qe)|0,I=I+Math.imul(se,He)|0,g=g+Math.imul(se,ze)|0,g=g+Math.imul(be,He)|0,S=S+Math.imul(be,ze)|0,I=I+Math.imul(Q,je)|0,g=g+Math.imul(Q,Ke)|0,g=g+Math.imul(ce,je)|0,S=S+Math.imul(ce,Ke)|0,I=I+Math.imul(fe,Ve)|0,g=g+Math.imul(fe,We)|0,g=g+Math.imul(Y,Ve)|0,S=S+Math.imul(Y,We)|0,I=I+Math.imul(W,Ge)|0,g=g+Math.imul(W,Ye)|0,g=g+Math.imul(ee,Ge)|0,S=S+Math.imul(ee,Ye)|0,I=I+Math.imul(N,mt)|0,g=g+Math.imul(N,bt)|0,g=g+Math.imul(R,mt)|0,S=S+Math.imul(R,bt)|0;var Oo=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,I=Math.imul(le,Le),g=Math.imul(le,Be),g=g+Math.imul(ge,Le)|0,S=Math.imul(ge,Be),I=I+Math.imul(j,Ue)|0,g=g+Math.imul(j,Fe)|0,g=g+Math.imul(ae,Ue)|0,S=S+Math.imul(ae,Fe)|0,I=I+Math.imul(te,$e)|0,g=g+Math.imul(te,qe)|0,g=g+Math.imul(G,$e)|0,S=S+Math.imul(G,qe)|0,I=I+Math.imul(we,He)|0,g=g+Math.imul(we,ze)|0,g=g+Math.imul(Oe,He)|0,S=S+Math.imul(Oe,ze)|0,I=I+Math.imul(se,je)|0,g=g+Math.imul(se,Ke)|0,g=g+Math.imul(be,je)|0,S=S+Math.imul(be,Ke)|0,I=I+Math.imul(Q,Ve)|0,g=g+Math.imul(Q,We)|0,g=g+Math.imul(ce,Ve)|0,S=S+Math.imul(ce,We)|0,I=I+Math.imul(fe,Ge)|0,g=g+Math.imul(fe,Ye)|0,g=g+Math.imul(Y,Ge)|0,S=S+Math.imul(Y,Ye)|0,I=I+Math.imul(W,mt)|0,g=g+Math.imul(W,bt)|0,g=g+Math.imul(ee,mt)|0,S=S+Math.imul(ee,bt)|0;var Po=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Po>>>26)|0,Po&=67108863,I=Math.imul(le,Ue),g=Math.imul(le,Fe),g=g+Math.imul(ge,Ue)|0,S=Math.imul(ge,Fe),I=I+Math.imul(j,$e)|0,g=g+Math.imul(j,qe)|0,g=g+Math.imul(ae,$e)|0,S=S+Math.imul(ae,qe)|0,I=I+Math.imul(te,He)|0,g=g+Math.imul(te,ze)|0,g=g+Math.imul(G,He)|0,S=S+Math.imul(G,ze)|0,I=I+Math.imul(we,je)|0,g=g+Math.imul(we,Ke)|0,g=g+Math.imul(Oe,je)|0,S=S+Math.imul(Oe,Ke)|0,I=I+Math.imul(se,Ve)|0,g=g+Math.imul(se,We)|0,g=g+Math.imul(be,Ve)|0,S=S+Math.imul(be,We)|0,I=I+Math.imul(Q,Ge)|0,g=g+Math.imul(Q,Ye)|0,g=g+Math.imul(ce,Ge)|0,S=S+Math.imul(ce,Ye)|0,I=I+Math.imul(fe,mt)|0,g=g+Math.imul(fe,bt)|0,g=g+Math.imul(Y,mt)|0,S=S+Math.imul(Y,bt)|0;var No=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(No>>>26)|0,No&=67108863,I=Math.imul(le,$e),g=Math.imul(le,qe),g=g+Math.imul(ge,$e)|0,S=Math.imul(ge,qe),I=I+Math.imul(j,He)|0,g=g+Math.imul(j,ze)|0,g=g+Math.imul(ae,He)|0,S=S+Math.imul(ae,ze)|0,I=I+Math.imul(te,je)|0,g=g+Math.imul(te,Ke)|0,g=g+Math.imul(G,je)|0,S=S+Math.imul(G,Ke)|0,I=I+Math.imul(we,Ve)|0,g=g+Math.imul(we,We)|0,g=g+Math.imul(Oe,Ve)|0,S=S+Math.imul(Oe,We)|0,I=I+Math.imul(se,Ge)|0,g=g+Math.imul(se,Ye)|0,g=g+Math.imul(be,Ge)|0,S=S+Math.imul(be,Ye)|0,I=I+Math.imul(Q,mt)|0,g=g+Math.imul(Q,bt)|0,g=g+Math.imul(ce,mt)|0,S=S+Math.imul(ce,bt)|0;var Ro=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Ro>>>26)|0,Ro&=67108863,I=Math.imul(le,He),g=Math.imul(le,ze),g=g+Math.imul(ge,He)|0,S=Math.imul(ge,ze),I=I+Math.imul(j,je)|0,g=g+Math.imul(j,Ke)|0,g=g+Math.imul(ae,je)|0,S=S+Math.imul(ae,Ke)|0,I=I+Math.imul(te,Ve)|0,g=g+Math.imul(te,We)|0,g=g+Math.imul(G,Ve)|0,S=S+Math.imul(G,We)|0,I=I+Math.imul(we,Ge)|0,g=g+Math.imul(we,Ye)|0,g=g+Math.imul(Oe,Ge)|0,S=S+Math.imul(Oe,Ye)|0,I=I+Math.imul(se,mt)|0,g=g+Math.imul(se,bt)|0,g=g+Math.imul(be,mt)|0,S=S+Math.imul(be,bt)|0;var Lo=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,I=Math.imul(le,je),g=Math.imul(le,Ke),g=g+Math.imul(ge,je)|0,S=Math.imul(ge,Ke),I=I+Math.imul(j,Ve)|0,g=g+Math.imul(j,We)|0,g=g+Math.imul(ae,Ve)|0,S=S+Math.imul(ae,We)|0,I=I+Math.imul(te,Ge)|0,g=g+Math.imul(te,Ye)|0,g=g+Math.imul(G,Ge)|0,S=S+Math.imul(G,Ye)|0,I=I+Math.imul(we,mt)|0,g=g+Math.imul(we,bt)|0,g=g+Math.imul(Oe,mt)|0,S=S+Math.imul(Oe,bt)|0;var Bo=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,I=Math.imul(le,Ve),g=Math.imul(le,We),g=g+Math.imul(ge,Ve)|0,S=Math.imul(ge,We),I=I+Math.imul(j,Ge)|0,g=g+Math.imul(j,Ye)|0,g=g+Math.imul(ae,Ge)|0,S=S+Math.imul(ae,Ye)|0,I=I+Math.imul(te,mt)|0,g=g+Math.imul(te,bt)|0,g=g+Math.imul(G,mt)|0,S=S+Math.imul(G,bt)|0;var ud=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(ud>>>26)|0,ud&=67108863,I=Math.imul(le,Ge),g=Math.imul(le,Ye),g=g+Math.imul(ge,Ge)|0,S=Math.imul(ge,Ye),I=I+Math.imul(j,mt)|0,g=g+Math.imul(j,bt)|0,g=g+Math.imul(ae,mt)|0,S=S+Math.imul(ae,bt)|0;var ld=(E+I|0)+((g&8191)<<13)|0;E=(S+(g>>>13)|0)+(ld>>>26)|0,ld&=67108863,I=Math.imul(le,mt),g=Math.imul(le,bt),g=g+Math.imul(ge,mt)|0,S=Math.imul(ge,bt);var dd=(E+I|0)+((g&8191)<<13)|0;return E=(S+(g>>>13)|0)+(dd>>>26)|0,dd&=67108863,m[0]=Yr,m[1]=Jr,m[2]=Xr,m[3]=Zr,m[4]=Qr,m[5]=To,m[6]=ko,m[7]=Co,m[8]=Do,m[9]=Io,m[10]=Oo,m[11]=Po,m[12]=No,m[13]=Ro,m[14]=Lo,m[15]=Bo,m[16]=ud,m[17]=ld,m[18]=dd,E!==0&&(m[19]=E,y.length++),y},"comb10MulTo");Math.imul||(C=$);function B(h,c,d){d.negative=c.negative^h.negative,d.length=h.length+c.length;for(var y=0,_=0,w=0;w<d.length-1;w++){var m=_;_=0;for(var E=y&67108863,I=Math.min(w,c.length-1),g=Math.max(0,w-h.length+1);g<=I;g++){var S=w-g,ie=h.words[S]|0,M=c.words[g]|0,K=ie*M,J=K&67108863;m=m+(K/67108864|0)|0,J=J+E|0,E=J&67108863,m=m+(J>>>26)|0,_+=m>>>26,m&=67108863}d.words[w]=E,y=m,m=_}return y!==0?d.words[w]=y:d.length--,d._strip()}o(B,"bigMulTo");function z(h,c,d){return B(h,c,d)}o(z,"jumboMulTo"),i.prototype.mulTo=o(function(c,d){var y,_=this.length+c.length;return this.length===10&&c.length===10?y=C(this,c,d):_<63?y=$(this,c,d):_<1024?y=B(this,c,d):y=z(this,c,d),y},"mulTo");function H(h,c){this.x=h,this.y=c}o(H,"FFTM"),H.prototype.makeRBT=o(function(c){for(var d=new Array(c),y=i.prototype._countBits(c)-1,_=0;_<c;_++)d[_]=this.revBin(_,y,c);return d},"makeRBT"),H.prototype.revBin=o(function(c,d,y){if(c===0||c===y-1)return c;for(var _=0,w=0;w<d;w++)_|=(c&1)<<d-w-1,c>>=1;return _},"revBin"),H.prototype.permute=o(function(c,d,y,_,w,m){for(var E=0;E<m;E++)_[E]=d[c[E]],w[E]=y[c[E]]},"permute"),H.prototype.transform=o(function(c,d,y,_,w,m){this.permute(m,c,d,y,_,w);for(var E=1;E<w;E<<=1)for(var I=E<<1,g=Math.cos(2*Math.PI/I),S=Math.sin(2*Math.PI/I),ie=0;ie<w;ie+=I)for(var M=g,K=S,J=0;J<E;J++){var N=y[ie+J],R=_[ie+J],V=y[ie+J+E],W=_[ie+J+E],ee=M*V-K*W;W=M*W+K*V,V=ee,y[ie+J]=N+V,_[ie+J]=R+W,y[ie+J+E]=N-V,_[ie+J+E]=R-W,J!==I&&(ee=g*M-S*K,K=g*K+S*M,M=ee)}},"transform"),H.prototype.guessLen13b=o(function(c,d){var y=Math.max(d,c)|1,_=y&1,w=0;for(y=y/2|0;y;y=y>>>1)w++;return 1<<w+1+_},"guessLen13b"),H.prototype.conjugate=o(function(c,d,y){if(!(y<=1))for(var _=0;_<y/2;_++){var w=c[_];c[_]=c[y-_-1],c[y-_-1]=w,w=d[_],d[_]=-d[y-_-1],d[y-_-1]=-w}},"conjugate"),H.prototype.normalize13b=o(function(c,d){for(var y=0,_=0;_<d/2;_++){var w=Math.round(c[2*_+1]/d)*8192+Math.round(c[2*_]/d)+y;c[_]=w&67108863,w<67108864?y=0:y=w/67108864|0}return c},"normalize13b"),H.prototype.convert13b=o(function(c,d,y,_){for(var w=0,m=0;m<d;m++)w=w+(c[m]|0),y[2*m]=w&8191,w=w>>>13,y[2*m+1]=w&8191,w=w>>>13;for(m=2*d;m<_;++m)y[m]=0;t(w===0),t((w&-8192)===0)},"convert13b"),H.prototype.stub=o(function(c){for(var d=new Array(c),y=0;y<c;y++)d[y]=0;return d},"stub"),H.prototype.mulp=o(function(c,d,y){var _=2*this.guessLen13b(c.length,d.length),w=this.makeRBT(_),m=this.stub(_),E=new Array(_),I=new Array(_),g=new Array(_),S=new Array(_),ie=new Array(_),M=new Array(_),K=y.words;K.length=_,this.convert13b(c.words,c.length,E,_),this.convert13b(d.words,d.length,S,_),this.transform(E,m,I,g,_,w),this.transform(S,m,ie,M,_,w);for(var J=0;J<_;J++){var N=I[J]*ie[J]-g[J]*M[J];g[J]=I[J]*M[J]+g[J]*ie[J],I[J]=N}return this.conjugate(I,g,_),this.transform(I,g,K,m,_,w),this.conjugate(K,m,_),this.normalize13b(K,_),y.negative=c.negative^d.negative,y.length=c.length+d.length,y._strip()},"mulp"),i.prototype.mul=o(function(c){var d=new i(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},"mul"),i.prototype.mulf=o(function(c){var d=new i(null);return d.words=new Array(this.length+c.length),z(this,c,d)},"mulf"),i.prototype.imul=o(function(c){return this.clone().mulTo(c,this)},"imul"),i.prototype.imuln=o(function(c){var d=c<0;d&&(c=-c),t(typeof c=="number"),t(c<67108864);for(var y=0,_=0;_<this.length;_++){var w=(this.words[_]|0)*c,m=(w&67108863)+(y&67108863);y>>=26,y+=w/67108864|0,y+=m>>>26,this.words[_]=m&67108863}return y!==0&&(this.words[_]=y,this.length++),d?this.ineg():this},"imuln"),i.prototype.muln=o(function(c){return this.clone().imuln(c)},"muln"),i.prototype.sqr=o(function(){return this.mul(this)},"sqr"),i.prototype.isqr=o(function(){return this.imul(this.clone())},"isqr"),i.prototype.pow=o(function(c){var d=k(c);if(d.length===0)return new i(1);for(var y=this,_=0;_<d.length&&d[_]===0;_++,y=y.sqr());if(++_<d.length)for(var w=y.sqr();_<d.length;_++,w=w.sqr())d[_]!==0&&(y=y.mul(w));return y},"pow"),i.prototype.iushln=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,_=67108863>>>26-d<<26-d,w;if(d!==0){var m=0;for(w=0;w<this.length;w++){var E=this.words[w]&_,I=(this.words[w]|0)-E<<d;this.words[w]=I|m,m=E>>>26-d}m&&(this.words[w]=m,this.length++)}if(y!==0){for(w=this.length-1;w>=0;w--)this.words[w+y]=this.words[w];for(w=0;w<y;w++)this.words[w]=0;this.length+=y}return this._strip()},"iushln"),i.prototype.ishln=o(function(c){return t(this.negative===0),this.iushln(c)},"ishln"),i.prototype.iushrn=o(function(c,d,y){t(typeof c=="number"&&c>=0);var _;d?_=(d-d%26)/26:_=0;var w=c%26,m=Math.min((c-w)/26,this.length),E=67108863^67108863>>>w<<w,I=y;if(_-=m,_=Math.max(0,_),I){for(var g=0;g<m;g++)I.words[g]=this.words[g];I.length=m}if(m!==0)if(this.length>m)for(this.length-=m,g=0;g<this.length;g++)this.words[g]=this.words[g+m];else this.words[0]=0,this.length=1;var S=0;for(g=this.length-1;g>=0&&(S!==0||g>=_);g--){var ie=this.words[g]|0;this.words[g]=S<<26-w|ie>>>w,S=ie&E}return I&&S!==0&&(I.words[I.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),i.prototype.ishrn=o(function(c,d,y){return t(this.negative===0),this.iushrn(c,d,y)},"ishrn"),i.prototype.shln=o(function(c){return this.clone().ishln(c)},"shln"),i.prototype.ushln=o(function(c){return this.clone().iushln(c)},"ushln"),i.prototype.shrn=o(function(c){return this.clone().ishrn(c)},"shrn"),i.prototype.ushrn=o(function(c){return this.clone().iushrn(c)},"ushrn"),i.prototype.testn=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,_=1<<d;if(this.length<=y)return!1;var w=this.words[y];return!!(w&_)},"testn"),i.prototype.imaskn=o(function(c){t(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(d!==0&&y++,this.length=Math.min(y,this.length),d!==0){var _=67108863^67108863>>>d<<d;this.words[this.length-1]&=_}return this._strip()},"imaskn"),i.prototype.maskn=o(function(c){return this.clone().imaskn(c)},"maskn"),i.prototype.iaddn=o(function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},"iaddn"),i.prototype._iaddn=o(function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},"_iaddn"),i.prototype.isubn=o(function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},"isubn"),i.prototype.addn=o(function(c){return this.clone().iaddn(c)},"addn"),i.prototype.subn=o(function(c){return this.clone().isubn(c)},"subn"),i.prototype.iabs=o(function(){return this.negative=0,this},"iabs"),i.prototype.abs=o(function(){return this.clone().iabs()},"abs"),i.prototype._ishlnsubmul=o(function(c,d,y){var _=c.length+y,w;this._expand(_);var m,E=0;for(w=0;w<c.length;w++){m=(this.words[w+y]|0)+E;var I=(c.words[w]|0)*d;m-=I&67108863,E=(m>>26)-(I/67108864|0),this.words[w+y]=m&67108863}for(;w<this.length-y;w++)m=(this.words[w+y]|0)+E,E=m>>26,this.words[w+y]=m&67108863;if(E===0)return this._strip();for(t(E===-1),E=0,w=0;w<this.length;w++)m=-(this.words[w]|0)+E,E=m>>26,this.words[w]=m&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),i.prototype._wordDiv=o(function(c,d){var y=this.length-c.length,_=this.clone(),w=c,m=w.words[w.length-1]|0,E=this._countBits(m);y=26-E,y!==0&&(w=w.ushln(y),_.iushln(y),m=w.words[w.length-1]|0);var I=_.length-w.length,g;if(d!=="mod"){g=new i(null),g.length=I+1,g.words=new Array(g.length);for(var S=0;S<g.length;S++)g.words[S]=0}var ie=_.clone()._ishlnsubmul(w,1,I);ie.negative===0&&(_=ie,g&&(g.words[I]=1));for(var M=I-1;M>=0;M--){var K=(_.words[w.length+M]|0)*67108864+(_.words[w.length+M-1]|0);for(K=Math.min(K/m|0,67108863),_._ishlnsubmul(w,K,M);_.negative!==0;)K--,_.negative=0,_._ishlnsubmul(w,1,M),_.isZero()||(_.negative^=1);g&&(g.words[M]=K)}return g&&g._strip(),_._strip(),d!=="div"&&y!==0&&_.iushrn(y),{div:g||null,mod:_}},"_wordDiv"),i.prototype.divmod=o(function(c,d,y){if(t(!c.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var _,w,m;return this.negative!==0&&c.negative===0?(m=this.neg().divmod(c,d),d!=="mod"&&(_=m.div.neg()),d!=="div"&&(w=m.mod.neg(),y&&w.negative!==0&&w.iadd(c)),{div:_,mod:w}):this.negative===0&&c.negative!==0?(m=this.divmod(c.neg(),d),d!=="mod"&&(_=m.div.neg()),{div:_,mod:m.mod}):(this.negative&c.negative)!==0?(m=this.neg().divmod(c.neg(),d),d!=="div"&&(w=m.mod.neg(),y&&w.negative!==0&&w.isub(c)),{div:m.div,mod:w}):c.length>this.length||this.cmp(c)<0?{div:new i(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new i(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new i(this.modrn(c.words[0]))}:this._wordDiv(c,d)},"divmod"),i.prototype.div=o(function(c){return this.divmod(c,"div",!1).div},"div"),i.prototype.mod=o(function(c){return this.divmod(c,"mod",!1).mod},"mod"),i.prototype.umod=o(function(c){return this.divmod(c,"mod",!0).mod},"umod"),i.prototype.divRound=o(function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var y=d.div.negative!==0?d.mod.isub(c):d.mod,_=c.ushrn(1),w=c.andln(1),m=y.cmp(_);return m<0||w===1&&m===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},"divRound"),i.prototype.modrn=o(function(c){var d=c<0;d&&(c=-c),t(c<=67108863);for(var y=(1<<26)%c,_=0,w=this.length-1;w>=0;w--)_=(y*_+(this.words[w]|0))%c;return d?-_:_},"modrn"),i.prototype.modn=o(function(c){return this.modrn(c)},"modn"),i.prototype.idivn=o(function(c){var d=c<0;d&&(c=-c),t(c<=67108863);for(var y=0,_=this.length-1;_>=0;_--){var w=(this.words[_]|0)+y*67108864;this.words[_]=w/c|0,y=w%c}return this._strip(),d?this.ineg():this},"idivn"),i.prototype.divn=o(function(c){return this.clone().idivn(c)},"divn"),i.prototype.egcd=o(function(c){t(c.negative===0),t(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var _=new i(1),w=new i(0),m=new i(0),E=new i(1),I=0;d.isEven()&&y.isEven();)d.iushrn(1),y.iushrn(1),++I;for(var g=y.clone(),S=d.clone();!d.isZero();){for(var ie=0,M=1;(d.words[0]&M)===0&&ie<26;++ie,M<<=1);if(ie>0)for(d.iushrn(ie);ie-- >0;)(_.isOdd()||w.isOdd())&&(_.iadd(g),w.isub(S)),_.iushrn(1),w.iushrn(1);for(var K=0,J=1;(y.words[0]&J)===0&&K<26;++K,J<<=1);if(K>0)for(y.iushrn(K);K-- >0;)(m.isOdd()||E.isOdd())&&(m.iadd(g),E.isub(S)),m.iushrn(1),E.iushrn(1);d.cmp(y)>=0?(d.isub(y),_.isub(m),w.isub(E)):(y.isub(d),m.isub(_),E.isub(w))}return{a:m,b:E,gcd:y.iushln(I)}},"egcd"),i.prototype._invmp=o(function(c){t(c.negative===0),t(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var _=new i(1),w=new i(0),m=y.clone();d.cmpn(1)>0&&y.cmpn(1)>0;){for(var E=0,I=1;(d.words[0]&I)===0&&E<26;++E,I<<=1);if(E>0)for(d.iushrn(E);E-- >0;)_.isOdd()&&_.iadd(m),_.iushrn(1);for(var g=0,S=1;(y.words[0]&S)===0&&g<26;++g,S<<=1);if(g>0)for(y.iushrn(g);g-- >0;)w.isOdd()&&w.iadd(m),w.iushrn(1);d.cmp(y)>=0?(d.isub(y),_.isub(w)):(y.isub(d),w.isub(_))}var ie;return d.cmpn(1)===0?ie=_:ie=w,ie.cmpn(0)<0&&ie.iadd(c),ie},"_invmp"),i.prototype.gcd=o(function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),y=c.clone();d.negative=0,y.negative=0;for(var _=0;d.isEven()&&y.isEven();_++)d.iushrn(1),y.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;y.isEven();)y.iushrn(1);var w=d.cmp(y);if(w<0){var m=d;d=y,y=m}else if(w===0||y.cmpn(1)===0)break;d.isub(y)}while(!0);return y.iushln(_)},"gcd"),i.prototype.invm=o(function(c){return this.egcd(c).a.umod(c)},"invm"),i.prototype.isEven=o(function(){return(this.words[0]&1)===0},"isEven"),i.prototype.isOdd=o(function(){return(this.words[0]&1)===1},"isOdd"),i.prototype.andln=o(function(c){return this.words[0]&c},"andln"),i.prototype.bincn=o(function(c){t(typeof c=="number");var d=c%26,y=(c-d)/26,_=1<<d;if(this.length<=y)return this._expand(y+1),this.words[y]|=_,this;for(var w=_,m=y;w!==0&&m<this.length;m++){var E=this.words[m]|0;E+=w,w=E>>>26,E&=67108863,this.words[m]=E}return w!==0&&(this.words[m]=w,this.length++),this},"bincn"),i.prototype.isZero=o(function(){return this.length===1&&this.words[0]===0},"isZero"),i.prototype.cmpn=o(function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var y;if(this.length>1)y=1;else{d&&(c=-c),t(c<=67108863,"Number is too big");var _=this.words[0]|0;y=_===c?0:_<c?-1:1}return this.negative!==0?-y|0:y},"cmpn"),i.prototype.cmp=o(function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},"cmp"),i.prototype.ucmp=o(function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,y=this.length-1;y>=0;y--){var _=this.words[y]|0,w=c.words[y]|0;if(_!==w){_<w?d=-1:_>w&&(d=1);break}}return d},"ucmp"),i.prototype.gtn=o(function(c){return this.cmpn(c)===1},"gtn"),i.prototype.gt=o(function(c){return this.cmp(c)===1},"gt"),i.prototype.gten=o(function(c){return this.cmpn(c)>=0},"gten"),i.prototype.gte=o(function(c){return this.cmp(c)>=0},"gte"),i.prototype.ltn=o(function(c){return this.cmpn(c)===-1},"ltn"),i.prototype.lt=o(function(c){return this.cmp(c)===-1},"lt"),i.prototype.lten=o(function(c){return this.cmpn(c)<=0},"lten"),i.prototype.lte=o(function(c){return this.cmp(c)<=0},"lte"),i.prototype.eqn=o(function(c){return this.cmpn(c)===0},"eqn"),i.prototype.eq=o(function(c){return this.cmp(c)===0},"eq"),i.red=o(function(c){return new l(c)},"red"),i.prototype.toRed=o(function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},"toRed"),i.prototype.fromRed=o(function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),i.prototype._forceRed=o(function(c){return this.red=c,this},"_forceRed"),i.prototype.forceRed=o(function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},"forceRed"),i.prototype.redAdd=o(function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},"redAdd"),i.prototype.redIAdd=o(function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},"redIAdd"),i.prototype.redSub=o(function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},"redSub"),i.prototype.redISub=o(function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},"redISub"),i.prototype.redShl=o(function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},"redShl"),i.prototype.redMul=o(function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},"redMul"),i.prototype.redIMul=o(function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},"redIMul"),i.prototype.redSqr=o(function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),i.prototype.redISqr=o(function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),i.prototype.redSqrt=o(function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),i.prototype.redInvm=o(function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),i.prototype.redNeg=o(function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),i.prototype.redPow=o(function(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)},"redPow");var X={k256:null,p224:null,p192:null,p25519:null};function U(h,c){this.name=h,this.p=new i(c,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}o(U,"MPrime"),U.prototype._tmp=o(function(){var c=new i(null);return c.words=new Array(Math.ceil(this.n/13)),c},"_tmp"),U.prototype.ireduce=o(function(c){var d=c,y;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),y=d.bitLength();while(y>this.n);var _=y<this.n?-1:d.ucmp(this.p);return _===0?(d.words[0]=0,d.length=1):_>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},"ireduce"),U.prototype.split=o(function(c,d){c.iushrn(this.n,0,d)},"split"),U.prototype.imulK=o(function(c){return c.imul(this.k)},"imulK");function L(){U.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(L,"K256"),n(L,U),L.prototype.split=o(function(c,d){for(var y=4194303,_=Math.min(c.length,9),w=0;w<_;w++)d.words[w]=c.words[w];if(d.length=_,c.length<=9){c.words[0]=0,c.length=1;return}var m=c.words[9];for(d.words[d.length++]=m&y,w=10;w<c.length;w++){var E=c.words[w]|0;c.words[w-10]=(E&y)<<4|m>>>22,m=E}m>>>=22,c.words[w-10]=m,m===0&&c.length>10?c.length-=10:c.length-=9},"split"),L.prototype.imulK=o(function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,y=0;y<c.length;y++){var _=c.words[y]|0;d+=_*977,c.words[y]=d&67108863,d=_*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c},"imulK");function F(){U.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(F,"P224"),n(F,U);function ne(){U.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(ne,"P192"),n(ne,U);function D(){U.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(D,"P25519"),n(D,U),D.prototype.imulK=o(function(c){for(var d=0,y=0;y<c.length;y++){var _=(c.words[y]|0)*19+d,w=_&67108863;_>>>=26,c.words[y]=w,d=_}return d!==0&&(c.words[c.length++]=d),c},"imulK"),i._prime=o(function(c){if(X[c])return X[c];var d;if(c==="k256")d=new L;else if(c==="p224")d=new F;else if(c==="p192")d=new ne;else if(c==="p25519")d=new D;else throw new Error("Unknown prime "+c);return X[c]=d,d},"prime");function l(h){if(typeof h=="string"){var c=i._prime(h);this.m=c.p,this.prime=c}else t(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}o(l,"Red"),l.prototype._verify1=o(function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},"_verify1"),l.prototype._verify2=o(function(c,d){t((c.negative|d.negative)===0,"red works only with positives"),t(c.red&&c.red===d.red,"red works only with red numbers")},"_verify2"),l.prototype.imod=o(function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(p(c,c.umod(this.m)._forceRed(this)),c)},"imod"),l.prototype.neg=o(function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},"neg"),l.prototype.add=o(function(c,d){this._verify2(c,d);var y=c.add(d);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},"add"),l.prototype.iadd=o(function(c,d){this._verify2(c,d);var y=c.iadd(d);return y.cmp(this.m)>=0&&y.isub(this.m),y},"iadd"),l.prototype.sub=o(function(c,d){this._verify2(c,d);var y=c.sub(d);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},"sub"),l.prototype.isub=o(function(c,d){this._verify2(c,d);var y=c.isub(d);return y.cmpn(0)<0&&y.iadd(this.m),y},"isub"),l.prototype.shl=o(function(c,d){return this._verify1(c),this.imod(c.ushln(d))},"shl"),l.prototype.imul=o(function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},"imul"),l.prototype.mul=o(function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},"mul"),l.prototype.isqr=o(function(c){return this.imul(c,c.clone())},"isqr"),l.prototype.sqr=o(function(c){return this.mul(c,c)},"sqr"),l.prototype.sqrt=o(function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(t(d%2===1),d===3){var y=this.m.add(new i(1)).iushrn(2);return this.pow(c,y)}for(var _=this.m.subn(1),w=0;!_.isZero()&&_.andln(1)===0;)w++,_.iushrn(1);t(!_.isZero());var m=new i(1).toRed(this),E=m.redNeg(),I=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new i(2*g*g).toRed(this);this.pow(g,I).cmp(E)!==0;)g.redIAdd(E);for(var S=this.pow(g,_),ie=this.pow(c,_.addn(1).iushrn(1)),M=this.pow(c,_),K=w;M.cmp(m)!==0;){for(var J=M,N=0;J.cmp(m)!==0;N++)J=J.redSqr();t(N<K);var R=this.pow(S,new i(1).iushln(K-N-1));ie=ie.redMul(R),S=R.redSqr(),M=M.redMul(S),K=N}return ie},"sqrt"),l.prototype.invm=o(function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},"invm"),l.prototype.pow=o(function(c,d){if(d.isZero())return new i(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var y=4,_=new Array(1<<y);_[0]=new i(1).toRed(this),_[1]=c;for(var w=2;w<_.length;w++)_[w]=this.mul(_[w-1],c);var m=_[0],E=0,I=0,g=d.bitLength()%26;for(g===0&&(g=26),w=d.length-1;w>=0;w--){for(var S=d.words[w],ie=g-1;ie>=0;ie--){var M=S>>ie&1;if(m!==_[0]&&(m=this.sqr(m)),M===0&&E===0){I=0;continue}E<<=1,E|=M,I++,!(I!==y&&(w!==0||ie!==0))&&(m=this.mul(m,_[E]),I=0,E=0)}g=26}return m},"pow"),l.prototype.convertTo=o(function(c){var d=c.umod(this.m);return d===c?d.clone():d},"convertTo"),l.prototype.convertFrom=o(function(c){var d=c.clone();return d.red=null,d},"convertFrom"),i.mont=o(function(c){return new v(c)},"mont");function v(h){l.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}o(v,"Mont"),n(v,l),v.prototype.convertTo=o(function(c){return this.imod(c.ushln(this.shift))},"convertTo"),v.prototype.convertFrom=o(function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},"convertFrom"),v.prototype.imul=o(function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var y=c.imul(d),_=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(_).iushrn(this.shift),m=w;return w.cmp(this.m)>=0?m=w.isub(this.m):w.cmpn(0)<0&&(m=w.iadd(this.m)),m._forceRed(this)},"imul"),v.prototype.mul=o(function(c,d){if(c.isZero()||d.isZero())return new i(0)._forceRed(this);var y=c.mul(d),_=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=y.isub(_).iushrn(this.shift),m=w;return w.cmp(this.m)>=0?m=w.isub(this.m):w.cmpn(0)<0&&(m=w.iadd(this.m)),m._forceRed(this)},"mul"),v.prototype.invm=o(function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)},"invm")})(typeof D0=="undefined"||D0,My)});var l3=me((DU,u3)=>{u3.exports=j0;var c3=128,CM=127,DM=~CM,IM=Math.pow(2,31);function j0(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw j0.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=IM;)e[t++]=r&255|c3,r/=128;for(;r&DM;)e[t++]=r&255|c3,r>>>=7;return e[t]=r|0,j0.bytes=t-n+1,e}o(j0,"encode")});var p3=me((IU,h3)=>{h3.exports=K0;var OM=128,d3=127;function K0(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f||i>49)throw K0.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&d3)<<i:(a&d3)*Math.pow(2,i),i+=7}while(a>=OM);return K0.bytes=s-n,t}o(K0,"read")});var b3=me((OU,m3)=>{var PM=Math.pow(2,7),NM=Math.pow(2,14),RM=Math.pow(2,21),LM=Math.pow(2,28),BM=Math.pow(2,35),UM=Math.pow(2,42),FM=Math.pow(2,49),$M=Math.pow(2,56),qM=Math.pow(2,63);m3.exports=function(r){return r<PM?1:r<NM?2:r<RM?3:r<LM?4:r<BM?5:r<UM?6:r<FM?7:r<$M?8:r<qM?9:10}});var Vf=me((PU,g3)=>{g3.exports={encode:l3(),decode:p3(),encodingLength:b3()}});var y3=me((NU,v3)=>{"use strict";function HM(r){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var n=0;n<r.length;n++){var i=r.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var a=r.length,f=r.charAt(0),u=Math.log(a)/Math.log(256),p=Math.log(256)/Math.log(a);function b(O){if(O instanceof Uint8Array||(ArrayBuffer.isView(O)?O=new Uint8Array(O.buffer,O.byteOffset,O.byteLength):Array.isArray(O)&&(O=Uint8Array.from(O))),!(O instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(O.length===0)return"";for(var T=0,k=0,$=0,C=O.length;$!==C&&O[$]===0;)$++,T++;for(var B=(C-$)*p+1>>>0,z=new Uint8Array(B);$!==C;){for(var H=O[$],X=0,U=B-1;(H!==0||X<k)&&U!==-1;U--,X++)H+=256*z[U]>>>0,z[U]=H%a>>>0,H=H/a>>>0;if(H!==0)throw new Error("Non-zero carry");k=X,$++}for(var L=B-k;L!==B&&z[L]===0;)L++;for(var F=f.repeat(T);L<B;++L)F+=r.charAt(z[L]);return F}o(b,"encode");function x(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return new Uint8Array;var T=0;if(O[T]!==" "){for(var k=0,$=0;O[T]===f;)k++,T++;for(var C=(O.length-T)*u+1>>>0,B=new Uint8Array(C);O[T];){var z=e[O.charCodeAt(T)];if(z===255)return;for(var H=0,X=C-1;(z!==0||H<$)&&X!==-1;X--,H++)z+=a*B[X]>>>0,B[X]=z%256>>>0,z=z/256>>>0;if(z!==0)throw new Error("Non-zero carry");$=H,T++}if(O[T]!==" "){for(var U=C-$;U!==C&&B[U]===0;)U++;for(var L=new Uint8Array(k+(C-U)),F=k;U!==C;)L[F++]=B[U++];return L}}}o(x,"decodeUnsafe");function A(O){var T=x(O);if(T)return T;throw new Error("Non-base"+a+" character")}return o(A,"decode"),{encode:b,decodeUnsafe:x,decode:A}}o(HM,"base");v3.exports=HM});var el=me((RU,x3)=>{"use strict";var zM=new TextDecoder,jM=o(r=>zM.decode(r),"decodeText"),KM=new TextEncoder,VM=o(r=>KM.encode(r),"encodeText");function WM(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(WM,"concat");x3.exports={decodeText:jM,encodeText:VM,concat:WM}});var _3=me((LU,w3)=>{"use strict";var{encodeText:GM}=el(),tl=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=GM(this.code),this.alphabet=i,this.codec=n(i)}encode(e){return this.codec.encode(e)}decode(e){for(let t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}};o(tl,"Base");w3.exports=tl});var S3=me((BU,E3)=>{"use strict";var YM=o((r,e,t)=>{let n={};for(let p=0;p<e.length;++p)n[e[p]]=p;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),a=0,f=0,u=0;for(let p=0;p<i;++p){let b=n[r[p]];if(b===void 0)throw new SyntaxError("Invalid character "+r[p]);f=f<<t|b,a+=t,a>=8&&(a-=8,s[u++]=255&f>>a)}if(a>=t||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return s},"decode"),JM=o((r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,s="",a=0,f=0;for(let u=0;u<r.length;++u)for(f=f<<8|r[u],a+=8;a>t;)a-=t,s+=e[i&f>>a];if(a&&(s+=e[i&f<<t-a]),n)for(;s.length*t&7;)s+="=";return s},"encode"),XM=o(r=>e=>({encode(t){return JM(t,e,r)},decode(t){return YM(t,e,r)}}),"rfc4648");E3.exports={rfc4648:XM}});var k3=me((UU,T3)=>{"use strict";var Wf=y3(),ZM=_3(),{rfc4648:nr}=S3(),{decodeText:QM,encodeText:eA}=el(),tA=o(()=>({encode:QM,decode:eA}),"identity"),M3=[["identity","\0",tA,""],["base2","0",nr(1),"01"],["base8","7",nr(3),"01234567"],["base10","9",Wf,"0123456789"],["base16","f",nr(4),"0123456789abcdef"],["base16upper","F",nr(4),"0123456789ABCDEF"],["base32hex","v",nr(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",nr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",nr(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",nr(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",nr(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",nr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",nr(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",nr(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",nr(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",Wf,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",Wf,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",Wf,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",Wf,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",nr(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],A3=M3.reduce((r,e)=>(r[e[0]]=new ZM(e[0],e[1],e[2],e[3]),r),{}),rA=M3.reduce((r,e)=>(r[e[1]]=A3[e[0]],r),{});T3.exports={names:A3,codes:rA}});var V0=me((Ni,D3)=>{"use strict";var Ca=k3(),{encodeText:nA,decodeText:rl,concat:C3}=el();function iA(r,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:t,codeBuf:n}=ds(r);return fA(t,e),C3([n,e],n.length+e.length)}o(iA,"multibase");function oA(r,e){let t=ds(r),n=nA(t.encode(e));return C3([t.codeBuf,n],t.codeBuf.length+n.length)}o(oA,"encode");function sA(r){r instanceof Uint8Array&&(r=rl(r));let e=r[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(r=r.toLowerCase()),ds(r[0]).decode(r.substring(1))}o(sA,"decode");function aA(r){if(r instanceof Uint8Array&&(r=rl(r)),Object.prototype.toString.call(r)!=="[object String]")return!1;try{return ds(r[0]).name}catch(e){return!1}}o(aA,"isEncoded");function fA(r,e){ds(r).decode(rl(e))}o(fA,"validEncode");function ds(r){if(Object.prototype.hasOwnProperty.call(Ca.names,r))return Ca.names[r];if(Object.prototype.hasOwnProperty.call(Ca.codes,r))return Ca.codes[r];throw new Error(`Unsupported encoding: ${r}`)}o(ds,"encoding");function cA(r){return r instanceof Uint8Array&&(r=rl(r)),ds(r[0])}o(cA,"encodingFromData");Ni=D3.exports=iA;Ni.encode=oA;Ni.decode=sA;Ni.isEncoded=aA;Ni.encoding=ds;Ni.encodingFromData=cA;var uA=Object.freeze(Ca.names),lA=Object.freeze(Ca.codes);Ni.names=uA;Ni.codes=lA});var O3=me((FU,I3)=>{"use strict";function dA(r,e){for(let t=0;t<r.byteLength;t++){if(r[t]<e[t])return-1;if(r[t]>e[t])return 1}return r.byteLength>e.byteLength?1:r.byteLength<e.byteLength?-1:0}o(dA,"compare");I3.exports=dA});var N3=me(($U,P3)=>{"use strict";function hA(r,e){e||(e=r.reduce((i,s)=>i+s.length,0));let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}o(hA,"concat");P3.exports=hA});var L3=me((qU,R3)=>{"use strict";function pA(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}o(pA,"equals");R3.exports=pA});var G0=me((HU,$3)=>{"use strict";var{bases:B3}=($c(),tf(a1));function F3(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}o(F3,"createCodec");var U3=F3("utf8","u",r=>{let e=new TextDecoder("utf8");return"u"+e.decode(r)},r=>new TextEncoder().encode(r.substring(1))),W0=F3("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),mA=re({utf8:U3,"utf-8":U3,hex:B3.base16,latin1:W0,ascii:W0,binary:W0},B3);$3.exports=mA});var H3=me((zU,q3)=>{"use strict";var bA=G0();function gA(r,e="utf8"){let t=bA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.decoder.decode(`${t.prefix}${r}`)}o(gA,"fromString");q3.exports=gA});var j3=me((jU,z3)=>{"use strict";var vA=G0();function yA(r,e="utf8"){let t=vA[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return t.encoder.encode(r).substring(1)}o(yA,"toString");z3.exports=yA});var V3=me((KU,K3)=>{"use strict";function xA(r,e){if(r.length!==e.length)throw new Error("Inputs should have the same length");let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}o(xA,"xor");K3.exports=xA});var Y0=me((VU,W3)=>{"use strict";var wA=O3(),_A=N3(),EA=L3(),SA=H3(),MA=j3(),AA=V3();W3.exports={compare:wA,concat:_A,equals:EA,fromString:SA,toString:MA,xor:AA}});var G3=me(ai=>{"use strict";var TA=ai&&ai.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),kA=ai&&ai.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),CA=ai&&ai.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&TA(e,r,t);return kA(e,r),e};Object.defineProperty(ai,"__esModule",{value:!0});ai.keyToDidDoc=void 0;var DA=CA(Y0());function IA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`;return{id:t,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:t,publicKeyBase58:DA.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}o(IA,"keyToDidDoc");ai.keyToDidDoc=IA});var Y3=me(fi=>{"use strict";var OA=fi&&fi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PA=fi&&fi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),NA=fi&&fi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&OA(e,r,t);return PA(e,r),e};Object.defineProperty(fi,"__esModule",{value:!0});fi.keyToDidDoc=void 0;var J0=NA(Y0()),RA=uu();function LA(r){let e=new Uint8Array(r.length+2);return e[0]=236,e[1]=1,e.set(r,2),`z${J0.toString(e,"base58btc")}`}o(LA,"encodeKey");function BA(r,e){let t=`did:key:${e}`,n=`${t}#${e}`,i=RA.convertPublicKeyToX25519(r),s=`${t}#${LA(i)}`;return{id:t,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:t,publicKeyBase58:J0.toString(r,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:t,publicKeyBase58:J0.toString(i,"base58btc")}]}}o(BA,"keyToDidDoc");fi.keyToDidDoc=BA});var t6=me(Fr=>{"use strict";var UA=Fr&&Fr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),FA=Fr&&Fr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Z3=Fr&&Fr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&UA(e,r,t);return FA(e,r),e},Q3=Fr&&Fr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getResolver=void 0;var J3=Q3(Vf()),$A=Q3(V0()),qA=Z3(G3()),HA=Z3(Y3()),zA="application/did+ld+json",X3="application/did+json",jA={231:qA,237:HA};function e6(){return{key:(r,e,t,n)=>Z(this,null,function*(){let i=n.accept||X3,s={didResolutionMetadata:{contentType:i},didDocument:null,didDocumentMetadata:{}};try{let a=$A.default.decode(e.id),f=J3.default.decode(a),u=a.slice(J3.default.decode.bytes),p=yield jA[f].keyToDidDoc(u,e.id);i===zA?(p["@context"]="https://w3id.org/did/v1",s.didDocument=p):i===X3?s.didDocument=p:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(a){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=a.toString()}return s})}}o(e6,"getResolver");Fr.getResolver=e6;Fr.default={getResolver:e6}});var n6=me((JU,r6)=>{"use strict";r6.exports=function(r,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(s){return function(a){return function(f,u){var p={key:f,value:a[f]},b={key:u,value:a[u]};return s(p,b)}}}(e.cmp),i=[];return o(function s(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var f,u;if(Array.isArray(a)){for(u="[",f=0;f<a.length;f++)f&&(u+=","),u+=s(a[f])||"null";return u+"]"}if(a===null)return"null";if(i.indexOf(a)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var p=i.push(a)-1,b=Object.keys(a).sort(n&&n(a));for(u="",f=0;f<b.length;f++){var x=b[f],A=s(a[x]);!A||(u&&(u+=","),u+=JSON.stringify(x)+":"+A)}return i.splice(p,1),"{"+u+"}"}},"stringify")(r)}});var nc=me((ec,Na)=>{var bT=200,C6="__lodash_hash_undefined__",D6=9007199254740991,yp="[object Arguments]",gT="[object Array]",I6="[object Boolean]",O6="[object Date]",vT="[object Error]",xp="[object Function]",P6="[object GeneratorFunction]",dl="[object Map]",N6="[object Number]",wp="[object Object]",v6="[object Promise]",R6="[object RegExp]",hl="[object Set]",L6="[object String]",B6="[object Symbol]",hp="[object WeakMap]",U6="[object ArrayBuffer]",pl="[object DataView]",F6="[object Float32Array]",$6="[object Float64Array]",q6="[object Int8Array]",H6="[object Int16Array]",z6="[object Int32Array]",j6="[object Uint8Array]",K6="[object Uint8ClampedArray]",V6="[object Uint16Array]",W6="[object Uint32Array]",yT=/[\\^$.*+?()[\]{}|]/g,xT=/\w*$/,wT=/^\[object .+?Constructor\]$/,_T=/^(?:0|[1-9]\d*)$/,At={};At[yp]=At[gT]=At[U6]=At[pl]=At[I6]=At[O6]=At[F6]=At[$6]=At[q6]=At[H6]=At[z6]=At[dl]=At[N6]=At[wp]=At[R6]=At[hl]=At[L6]=At[B6]=At[j6]=At[K6]=At[V6]=At[W6]=!0;At[vT]=At[xp]=At[hp]=!1;var ET=typeof global=="object"&&global&&global.Object===Object&&global,ST=typeof self=="object"&&self&&self.Object===Object&&self,Li=ET||ST||Function("return this")(),G6=typeof ec=="object"&&ec&&!ec.nodeType&&ec,y6=G6&&typeof Na=="object"&&Na&&!Na.nodeType&&Na,MT=y6&&y6.exports===G6;function AT(r,e){return r.set(e[0],e[1]),r}o(AT,"addMapEntry");function TT(r,e){return r.add(e),r}o(TT,"addSetEntry");function kT(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}o(kT,"arrayEach");function CT(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}o(CT,"arrayPush");function Y6(r,e,t,n){var i=-1,s=r?r.length:0;for(n&&s&&(t=r[++i]);++i<s;)t=e(t,r[i],i,r);return t}o(Y6,"arrayReduce");function DT(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}o(DT,"baseTimes");function IT(r,e){return r==null?void 0:r[e]}o(IT,"getValue");function J6(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch(t){}return e}o(J6,"isHostObject");function x6(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}o(x6,"mapToArray");function _p(r,e){return function(t){return r(e(t))}}o(_p,"overArg");function w6(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}o(w6,"setToArray");var OT=Array.prototype,PT=Function.prototype,ml=Object.prototype,dp=Li["__core-js_shared__"],_6=function(){var r=/[^.]+$/.exec(dp&&dp.keys&&dp.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),X6=PT.toString,bo=ml.hasOwnProperty,bl=ml.toString,NT=RegExp("^"+X6.call(bo).replace(yT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E6=MT?Li.Buffer:void 0,S6=Li.Symbol,M6=Li.Uint8Array,RT=_p(Object.getPrototypeOf,Object),LT=Object.create,BT=ml.propertyIsEnumerable,UT=OT.splice,A6=Object.getOwnPropertySymbols,FT=E6?E6.isBuffer:void 0,$T=_p(Object.keys,Object),pp=Ba(Li,"DataView"),tc=Ba(Li,"Map"),mp=Ba(Li,"Promise"),bp=Ba(Li,"Set"),gp=Ba(Li,"WeakMap"),rc=Ba(Object,"create"),qT=gs(pp),HT=gs(tc),zT=gs(mp),jT=gs(bp),KT=gs(gp),T6=S6?S6.prototype:void 0,k6=T6?T6.valueOf:void 0;function bs(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(bs,"Hash");function VT(){this.__data__=rc?rc(null):{}}o(VT,"hashClear");function WT(r){return this.has(r)&&delete this.__data__[r]}o(WT,"hashDelete");function GT(r){var e=this.__data__;if(rc){var t=e[r];return t===C6?void 0:t}return bo.call(e,r)?e[r]:void 0}o(GT,"hashGet");function YT(r){var e=this.__data__;return rc?e[r]!==void 0:bo.call(e,r)}o(YT,"hashHas");function JT(r,e){var t=this.__data__;return t[r]=rc&&e===void 0?C6:e,this}o(JT,"hashSet");bs.prototype.clear=VT;bs.prototype.delete=WT;bs.prototype.get=GT;bs.prototype.has=YT;bs.prototype.set=JT;function Bi(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(Bi,"ListCache");function XT(){this.__data__=[]}o(XT,"listCacheClear");function ZT(r){var e=this.__data__,t=gl(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():UT.call(e,t,1),!0}o(ZT,"listCacheDelete");function QT(r){var e=this.__data__,t=gl(e,r);return t<0?void 0:e[t][1]}o(QT,"listCacheGet");function ek(r){return gl(this.__data__,r)>-1}o(ek,"listCacheHas");function tk(r,e){var t=this.__data__,n=gl(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}o(tk,"listCacheSet");Bi.prototype.clear=XT;Bi.prototype.delete=ZT;Bi.prototype.get=QT;Bi.prototype.has=ek;Bi.prototype.set=tk;function Ra(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}o(Ra,"MapCache");function rk(){this.__data__={hash:new bs,map:new(tc||Bi),string:new bs}}o(rk,"mapCacheClear");function nk(r){return vl(this,r).delete(r)}o(nk,"mapCacheDelete");function ik(r){return vl(this,r).get(r)}o(ik,"mapCacheGet");function ok(r){return vl(this,r).has(r)}o(ok,"mapCacheHas");function sk(r,e){return vl(this,r).set(r,e),this}o(sk,"mapCacheSet");Ra.prototype.clear=rk;Ra.prototype.delete=nk;Ra.prototype.get=ik;Ra.prototype.has=ok;Ra.prototype.set=sk;function La(r){this.__data__=new Bi(r)}o(La,"Stack");function ak(){this.__data__=new Bi}o(ak,"stackClear");function fk(r){return this.__data__.delete(r)}o(fk,"stackDelete");function ck(r){return this.__data__.get(r)}o(ck,"stackGet");function uk(r){return this.__data__.has(r)}o(uk,"stackHas");function lk(r,e){var t=this.__data__;if(t instanceof Bi){var n=t.__data__;if(!tc||n.length<bT-1)return n.push([r,e]),this;t=this.__data__=new Ra(n)}return t.set(r,e),this}o(lk,"stackSet");La.prototype.clear=ak;La.prototype.delete=fk;La.prototype.get=ck;La.prototype.has=uk;La.prototype.set=lk;function dk(r,e){var t=Sp(r)||Lk(r)?DT(r.length,String):[],n=t.length,i=!!n;for(var s in r)(e||bo.call(r,s))&&!(i&&(s=="length"||Ok(s,n)))&&t.push(s);return t}o(dk,"arrayLikeKeys");function Z6(r,e,t){var n=r[e];(!(bo.call(r,e)&&rx(n,t))||t===void 0&&!(e in r))&&(r[e]=t)}o(Z6,"assignValue");function gl(r,e){for(var t=r.length;t--;)if(rx(r[t][0],e))return t;return-1}o(gl,"assocIndexOf");function hk(r,e){return r&&Q6(e,Mp(e),r)}o(hk,"baseAssign");function vp(r,e,t,n,i,s,a){var f;if(n&&(f=s?n(r,i,s,a):n(r)),f!==void 0)return f;if(!yl(r))return r;var u=Sp(r);if(u){if(f=Ck(r),!e)return Ak(r,f)}else{var p=ms(r),b=p==xp||p==P6;if(Uk(r))return yk(r,e);if(p==wp||p==yp||b&&!s){if(J6(r))return s?r:{};if(f=Dk(b?{}:r),!e)return Tk(r,hk(f,r))}else{if(!At[p])return s?r:{};f=Ik(r,p,vp,e)}}a||(a=new La);var x=a.get(r);if(x)return x;if(a.set(r,f),!u)var A=t?kk(r):Mp(r);return kT(A||r,function(O,T){A&&(T=O,O=r[T]),Z6(f,T,vp(O,e,t,n,T,r,a))}),f}o(vp,"baseClone");function pk(r){return yl(r)?LT(r):{}}o(pk,"baseCreate");function mk(r,e,t){var n=e(r);return Sp(r)?n:CT(n,t(r))}o(mk,"baseGetAllKeys");function bk(r){return bl.call(r)}o(bk,"baseGetTag");function gk(r){if(!yl(r)||Nk(r))return!1;var e=ix(r)||J6(r)?NT:wT;return e.test(gs(r))}o(gk,"baseIsNative");function vk(r){if(!tx(r))return $T(r);var e=[];for(var t in Object(r))bo.call(r,t)&&t!="constructor"&&e.push(t);return e}o(vk,"baseKeys");function yk(r,e){if(e)return r.slice();var t=new r.constructor(r.length);return r.copy(t),t}o(yk,"cloneBuffer");function Ep(r){var e=new r.constructor(r.byteLength);return new M6(e).set(new M6(r)),e}o(Ep,"cloneArrayBuffer");function xk(r,e){var t=e?Ep(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}o(xk,"cloneDataView");function wk(r,e,t){var n=e?t(x6(r),!0):x6(r);return Y6(n,AT,new r.constructor)}o(wk,"cloneMap");function _k(r){var e=new r.constructor(r.source,xT.exec(r));return e.lastIndex=r.lastIndex,e}o(_k,"cloneRegExp");function Ek(r,e,t){var n=e?t(w6(r),!0):w6(r);return Y6(n,TT,new r.constructor)}o(Ek,"cloneSet");function Sk(r){return k6?Object(k6.call(r)):{}}o(Sk,"cloneSymbol");function Mk(r,e){var t=e?Ep(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}o(Mk,"cloneTypedArray");function Ak(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}o(Ak,"copyArray");function Q6(r,e,t,n){t||(t={});for(var i=-1,s=e.length;++i<s;){var a=e[i],f=n?n(t[a],r[a],a,t,r):void 0;Z6(t,a,f===void 0?r[a]:f)}return t}o(Q6,"copyObject");function Tk(r,e){return Q6(r,ex(r),e)}o(Tk,"copySymbols");function kk(r){return mk(r,Mp,ex)}o(kk,"getAllKeys");function vl(r,e){var t=r.__data__;return Pk(e)?t[typeof e=="string"?"string":"hash"]:t.map}o(vl,"getMapData");function Ba(r,e){var t=IT(r,e);return gk(t)?t:void 0}o(Ba,"getNative");var ex=A6?_p(A6,Object):qk,ms=bk;(pp&&ms(new pp(new ArrayBuffer(1)))!=pl||tc&&ms(new tc)!=dl||mp&&ms(mp.resolve())!=v6||bp&&ms(new bp)!=hl||gp&&ms(new gp)!=hp)&&(ms=o(function(r){var e=bl.call(r),t=e==wp?r.constructor:void 0,n=t?gs(t):void 0;if(n)switch(n){case qT:return pl;case HT:return dl;case zT:return v6;case jT:return hl;case KT:return hp}return e},"getTag"));function Ck(r){var e=r.length,t=r.constructor(e);return e&&typeof r[0]=="string"&&bo.call(r,"index")&&(t.index=r.index,t.input=r.input),t}o(Ck,"initCloneArray");function Dk(r){return typeof r.constructor=="function"&&!tx(r)?pk(RT(r)):{}}o(Dk,"initCloneObject");function Ik(r,e,t,n){var i=r.constructor;switch(e){case U6:return Ep(r);case I6:case O6:return new i(+r);case pl:return xk(r,n);case F6:case $6:case q6:case H6:case z6:case j6:case K6:case V6:case W6:return Mk(r,n);case dl:return wk(r,n,t);case N6:case L6:return new i(r);case R6:return _k(r);case hl:return Ek(r,n,t);case B6:return Sk(r)}}o(Ik,"initCloneByTag");function Ok(r,e){return e=e==null?D6:e,!!e&&(typeof r=="number"||_T.test(r))&&r>-1&&r%1==0&&r<e}o(Ok,"isIndex");function Pk(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}o(Pk,"isKeyable");function Nk(r){return!!_6&&_6 in r}o(Nk,"isMasked");function tx(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||ml;return r===t}o(tx,"isPrototype");function gs(r){if(r!=null){try{return X6.call(r)}catch(e){}try{return r+""}catch(e){}}return""}o(gs,"toSource");function Rk(r){return vp(r,!0,!0)}o(Rk,"cloneDeep");function rx(r,e){return r===e||r!==r&&e!==e}o(rx,"eq");function Lk(r){return Bk(r)&&bo.call(r,"callee")&&(!BT.call(r,"callee")||bl.call(r)==yp)}o(Lk,"isArguments");var Sp=Array.isArray;function nx(r){return r!=null&&Fk(r.length)&&!ix(r)}o(nx,"isArrayLike");function Bk(r){return $k(r)&&nx(r)}o(Bk,"isArrayLikeObject");var Uk=FT||Hk;function ix(r){var e=yl(r)?bl.call(r):"";return e==xp||e==P6}o(ix,"isFunction");function Fk(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=D6}o(Fk,"isLength");function yl(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}o(yl,"isObject");function $k(r){return!!r&&typeof r=="object"}o($k,"isObjectLike");function Mp(r){return nx(r)?dk(r):vk(r)}o(Mp,"keys");function qk(){return[]}o(qk,"stubArray");function Hk(){return!1}o(Hk,"stubFalse");Na.exports=Rk});var Ax=me(($F,_l)=>{var ox,sx,ax,fx,cx,ux,lx,dx,hx,xl,Ap,px,mx,bx,Ua,gx,vx,yx,xx,wx,_x,Ex,Sx,Mx,wl;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof _l=="object"&&typeof _l.exports=="object"?r(t(e,t(_l.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){return n[s]=i?i(s,a):a}}o(t,"createExporter")})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};ox=o(function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}o(s,"__"),n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},"__extends"),sx=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(n[f]=i[f])}return n},ax=o(function(n,i){var s={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(s[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,a=Object.getOwnPropertySymbols(n);f<a.length;f++)i.indexOf(a[f])<0&&Object.prototype.propertyIsEnumerable.call(n,a[f])&&(s[a[f]]=n[a[f]]);return s},"__rest"),fx=o(function(n,i,s,a){var f=arguments.length,u=f<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,i,s,a);else for(var b=n.length-1;b>=0;b--)(p=n[b])&&(u=(f<3?p(u):f>3?p(i,s,u):p(i,s))||u);return f>3&&u&&Object.defineProperty(i,s,u),u},"__decorate"),cx=o(function(n,i){return function(s,a){i(s,a,n)}},"__param"),ux=o(function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},"__metadata"),lx=o(function(n,i,s,a){function f(u){return u instanceof s?u:new s(function(p){p(u)})}return o(f,"adopt"),new(s||(s=Promise))(function(u,p){function b(O){try{A(a.next(O))}catch(T){p(T)}}o(b,"fulfilled");function x(O){try{A(a.throw(O))}catch(T){p(T)}}o(x,"rejected");function A(O){O.done?u(O.value):f(O.value).then(b,x)}o(A,"step"),A((a=a.apply(n,i||[])).next())})},"__awaiter"),dx=o(function(n,i){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},a,f,u,p;return p={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function b(A){return function(O){return x([A,O])}}function x(A){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,f&&(u=A[0]&2?f.return:A[0]?f.throw||((u=f.return)&&u.call(f),0):f.next)&&!(u=u.call(f,A[1])).done)return u;switch(f=0,u&&(A=[A[0]&2,u.value]),A[0]){case 0:case 1:u=A;break;case 4:return s.label++,{value:A[1],done:!1};case 5:s.label++,f=A[1],A=[0];continue;case 7:A=s.ops.pop(),s.trys.pop();continue;default:if(u=s.trys,!(u=u.length>0&&u[u.length-1])&&(A[0]===6||A[0]===2)){s=0;continue}if(A[0]===3&&(!u||A[1]>u[0]&&A[1]<u[3])){s.label=A[1];break}if(A[0]===6&&s.label<u[1]){s.label=u[1],u=A;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(A);break}u[2]&&s.ops.pop(),s.trys.pop();continue}A=i.call(n,s)}catch(O){A=[6,O],f=0}finally{a=u=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},"__generator"),hx=o(function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&wl(i,n,s)},"__exportStar"),wl=Object.create?function(n,i,s,a){a===void 0&&(a=s);var f=Object.getOwnPropertyDescriptor(i,s);(!f||("get"in f?!i.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,f)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]},xl=o(function(n){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&n[i],a=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),Ap=o(function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var a=s.call(n),f,u=[],p;try{for(;(i===void 0||i-- >0)&&!(f=a.next()).done;)u.push(f.value)}catch(b){p={error:b}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(p)throw p.error}}return u},"__read"),px=o(function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(Ap(arguments[i]));return n},"__spread"),mx=o(function(){for(var n=0,i=0,s=arguments.length;i<s;i++)n+=arguments[i].length;for(var a=Array(n),f=0,i=0;i<s;i++)for(var u=arguments[i],p=0,b=u.length;p<b;p++,f++)a[f]=u[p];return a},"__spreadArrays"),bx=o(function(n,i,s){if(s||arguments.length===2)for(var a=0,f=i.length,u;a<f;a++)(u||!(a in i))&&(u||(u=Array.prototype.slice.call(i,0,a)),u[a]=i[a]);return n.concat(u||Array.prototype.slice.call(i))},"__spreadArray"),Ua=o(function(n){return this instanceof Ua?(this.v=n,this):new Ua(n)},"__await"),gx=o(function(n,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s.apply(n,i||[]),f,u=[];return f={},p("next"),p("throw"),p("return"),f[Symbol.asyncIterator]=function(){return this},f;function p(k){a[k]&&(f[k]=function($){return new Promise(function(C,B){u.push([k,$,C,B])>1||b(k,$)})})}function b(k,$){try{x(a[k]($))}catch(C){T(u[0][3],C)}}function x(k){k.value instanceof Ua?Promise.resolve(k.value.v).then(A,O):T(u[0][2],k)}function A(k){b("next",k)}function O(k){b("throw",k)}function T(k,$){k($),u.shift(),u.length&&b(u[0][0],u[0][1])}},"__asyncGenerator"),vx=o(function(n){var i,s;return i={},a("next"),a("throw",function(f){throw f}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(f,u){i[f]=n[f]?function(p){return(s=!s)?{value:Ua(n[f](p)),done:f==="return"}:u?u(p):p}:u}},"__asyncDelegator"),yx=o(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof xl=="function"?xl(n):n[Symbol.iterator](),s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s);function a(u){s[u]=n[u]&&function(p){return new Promise(function(b,x){p=n[u](p),f(b,x,p.done,p.value)})}}function f(u,p,b,x){Promise.resolve(x).then(function(A){u({value:A,done:b})},p)}},"__asyncValues"),xx=o(function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n},"__makeTemplateObject");var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};wx=o(function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&wl(i,n,s);return t(i,n),i},"__importStar"),_x=o(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),Ex=o(function(n,i,s,a){if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?a:s==="a"?a.call(n):a?a.value:i.get(n)},"__classPrivateFieldGet"),Sx=o(function(n,i,s,a,f){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!f:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?f.call(n,s):f?f.value=s:i.set(n,s),s},"__classPrivateFieldSet"),Mx=o(function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},"__classPrivateFieldIn"),r("__extends",ox),r("__assign",sx),r("__rest",ax),r("__decorate",fx),r("__param",cx),r("__metadata",ux),r("__awaiter",lx),r("__generator",dx),r("__exportStar",hx),r("__createBinding",wl),r("__values",xl),r("__read",Ap),r("__spread",px),r("__spreadArrays",mx),r("__spreadArray",bx),r("__await",Ua),r("__asyncGenerator",gx),r("__asyncDelegator",vx),r("__asyncValues",yx),r("__makeTemplateObject",xx),r("__importStar",wx),r("__importDefault",_x),r("__classPrivateFieldGet",Ex),r("__classPrivateFieldSet",Sx),r("__classPrivateFieldIn",Mx)})});var Ew=me((Gj,_w)=>{"use strict";var vC=function(){function r(t,n){if(typeof t!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+t+"."));this._batchLoadFn=t,this._maxBatchSize=_C(n),this._batchScheduleFn=EC(n),this._cacheKeyFn=SC(n),this._cacheMap=MC(n),this._batch=null}o(r,"DataLoader");var e=r.prototype;return e.load=o(function(n){if(n==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(n)+"."));var i=xC(this),s=this._cacheMap,a=this._cacheKeyFn(n);if(s){var f=s.get(a);if(f){var u=i.cacheHits||(i.cacheHits=[]);return new Promise(function(b){u.push(function(){b(f)})})}}i.keys.push(n);var p=new Promise(function(b,x){i.callbacks.push({resolve:b,reject:x})});return s&&s.set(a,p),p},"load"),e.loadMany=o(function(n){if(!ww(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var i=[],s=0;s<n.length;s++)i.push(this.load(n[s]).catch(function(a){return a}));return Promise.all(i)},"loadMany"),e.clear=o(function(n){var i=this._cacheMap;if(i){var s=this._cacheKeyFn(n);i.delete(s)}return this},"clear"),e.clearAll=o(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),e.prime=o(function(n,i){var s=this._cacheMap;if(s){var a=this._cacheKeyFn(n);if(s.get(a)===void 0){var f;i instanceof Error?(f=Promise.reject(i),f.catch(function(){})):f=Promise.resolve(i),s.set(a,f)}}return this},"prime"),r}(),yC=typeof process=="object"&&typeof process.nextTick=="function"?function(r){jp||(jp=Promise.resolve()),jp.then(function(){process.nextTick(r)})}:typeof setImmediate=="function"?function(r){setImmediate(r)}:function(r){setTimeout(r)},jp;function xC(r){var e=r._batch;if(e!==null&&!e.hasDispatched&&e.keys.length<r._maxBatchSize&&(!e.cacheHits||e.cacheHits.length<r._maxBatchSize))return e;var t={hasDispatched:!1,keys:[],callbacks:[]};return r._batch=t,r._batchScheduleFn(function(){wC(r,t)}),t}o(xC,"getCurrentBatch");function wC(r,e){if(e.hasDispatched=!0,e.keys.length===0){Kp(e);return}var t=r._batchLoadFn(e.keys);if(!t||typeof t.then!="function")return xw(r,e,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise: "+String(t)+".")));t.then(function(n){if(!ww(n))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise of an Array: "+String(n)+"."));if(n.length!==e.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(`
627
627
 
628
628
  Keys:
629
629
  `+String(e.keys))+(`
630
630
 
631
631
  Values:
632
- `+String(n)));Kp(e);for(var i=0;i<e.callbacks.length;i++){var s=n[i];s instanceof Error?e.callbacks[i].reject(s):e.callbacks[i].resolve(s)}}).catch(function(n){gw(r,e,n)})}o(_C,"dispatchBatch");function gw(r,e,t){Kp(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(gw,"failedDispatch");function Kp(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Kp,"resolveCacheHits");function EC(r){var e=!r||r.batch!==!1;if(!e)return 1;var t=r&&r.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}o(EC,"getValidMaxBatchSize");function SC(r){var e=r&&r.batchScheduleFn;if(e===void 0)return xC;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(SC,"getValidBatchScheduleFn");function MC(r){var e=r&&r.cacheKeyFn;if(e===void 0)return function(t){return t};if(typeof e!="function")throw new TypeError("cacheKeyFn must be a function: "+e);return e}o(MC,"getValidCacheKeyFn");function AC(r){var e=!r||r.cache!==!1;if(!e)return null;var t=r&&r.cacheMap;if(t===void 0)return new Map;if(t!==null){var n=["get","set","delete","clear"],i=n.filter(function(s){return t&&typeof t[s]!="function"});if(i.length!==0)throw new TypeError("Custom cacheMap missing methods: "+i.join(", "))}return t}o(AC,"getValidCacheMap");function vw(r){return typeof r=="object"&&r!==null&&typeof r.length=="number"&&(r.length===0||r.length>0&&Object.prototype.hasOwnProperty.call(r,r.length-1))}o(vw,"isArrayLike");yw.exports=yC});var Nw=me((wK,Pw)=>{Pw.exports=Ow;var Iw=128,VC=127,WC=~VC,GC=Math.pow(2,31);function Ow(r,e,t){e=e||[],t=t||0;for(var n=t;r>=GC;)e[t++]=r&255|Iw,r/=128;for(;r&WC;)e[t++]=r&255|Iw,r>>>=7;return e[t]=r|0,Ow.bytes=t-n+1,e}o(Ow,"encode")});var Bw=me((_K,Lw)=>{Lw.exports=nm;var YC=128,Rw=127;function nm(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw nm.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&Rw)<<i:(a&Rw)*Math.pow(2,i),i+=7}while(a>=YC);return nm.bytes=s-n,t}o(nm,"read")});var Fw=me((EK,Uw)=>{var JC=Math.pow(2,7),XC=Math.pow(2,14),ZC=Math.pow(2,21),QC=Math.pow(2,28),eD=Math.pow(2,35),tD=Math.pow(2,42),rD=Math.pow(2,49),nD=Math.pow(2,56),iD=Math.pow(2,63);Uw.exports=function(r){return r<JC?1:r<XC?2:r<ZC?3:r<QC?4:r<eD?5:r<tD?6:r<rD?7:r<nD?8:r<iD?9:10}});var qw=me((SK,$w)=>{$w.exports={encode:Nw(),decode:Bw(),encodingLength:Fw()}});var zw=me((MK,Hw)=>{"use strict";var oD=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});Hw.exports={names:oD}});var Jw=me((AK,Yw)=>{"use strict";var jw=V0(),Wa=qw(),{names:mc}=zw(),{toString:Ql}=(uf(),ef(f1)),{fromString:sD}=(Hc(),ef(a1)),{concat:aD}=(gd(),ef(Nm)),Ga={};for(let r in mc){let e=r;Ga[mc[e]]=e}Object.freeze(Ga);function fD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return Ql(r,"base16")}o(fD,"toHexString");function cD(r){return sD(r,"base16")}o(cD,"fromHexString");function uD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return Ql(jw.encode("base58btc",r)).slice(1)}o(uD,"toB58String");function lD(r){let e=r instanceof Uint8Array?Ql(r):r;return jw.decode("z"+e)}o(lD,"fromB58String");function Kw(r){if(!(r instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(r.length<2)throw new Error("multihash too short. must be > 2 bytes.");let e=Wa.decode(r);if(!Ww(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(Wa.decode.bytes);let t=Wa.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(Wa.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${Ql(r,"base16")}`);return{code:e,name:Ga[e],length:t,digest:r}}o(Kw,"decode");function dD(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=Vw(e);if(!(r instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(t==null&&(t=r.length),t&&r.length!==t)throw new Error("digest length should be equal to specified length.");let i=Wa.encode(n),s=Wa.encode(t);return aD([i,s,r],i.length+s.length+r.length)}o(dD,"encode");function Vw(r){let e=r;if(typeof r=="string"){if(mc[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=mc[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Ga[e]===void 0&&!im(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(Vw,"coerceCode");function im(r){return r>0&&r<16}o(im,"isAppCode");function Ww(r){return!!(im(r)||Ga[r])}o(Ww,"isValidCode");function Gw(r){Kw(r)}o(Gw,"validate");function hD(r){return Gw(r),r.subarray(0,2)}o(hD,"prefix");Yw.exports={names:mc,codes:Ga,toHexString:fD,fromHexString:cD,toB58String:uD,fromB58String:lD,decode:Kw,encode:dD,coerceCode:Vw,isAppCode:im,validate:Gw,prefix:hD,isValidCode:Ww}});var b4=me((FV,TD)=>{TD.exports=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}]});var zO={};St(zO,{walletFromKey:()=>f5});module.exports=ef(zO);var gY=require("isomorphic-fetch"),vY=require("abort-controller/polyfill");var Im=at(require("isomorphic-webcrypto"));typeof window=="undefined"&&(globalThis.crypto=Im.default);var b5=o((r,e)=>Z(void 0,null,function*(){return tf(r.contents,{plugins:[...r.plugins,e]})}),"addPluginToWallet"),g5=o((r,e)=>Z(void 0,null,function*(){return tf([...r.contents,e],r)}),"addToWallet"),v5=o((r,e)=>Z(void 0,null,function*(){let t=JSON.parse(JSON.stringify(r.contents)),n=t.find(i=>i.id===e);return tf(t.filter(i=>i.id!==n.id),r)}),"removeFromWallet"),y5=o((r,e)=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.bind(r,r)])),"bindMethods"),tf=o((...t)=>Z(void 0,[...t],function*(r=[],e={}){let{plugins:n=[]}=e,i=n.reduce((a,f)=>re(re({},a),f.pluginMethods),{}),s={contents:[...r],add:function(a){return g5(this,a)},remove:function(a){return v5(this,a)},plugins:n,pluginMethods:i,addPlugin:function(a){return b5(this,a)}};return i&&(s.pluginMethods=y5(s,i)),s}),"generateWallet");function x5(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(x5,"_catch");function w5(){let r=new Map;return function(e,t){try{let i=function(a){if(n)return a;let f=r.get(e.didUrl);return f!==void 0?f:Promise.resolve(t()).then(function(u){var p;return((p=u.didResolutionMetadata)==null?void 0:p.error)!=="notFound"&&r.set(e.didUrl,u),u})};o(i,"_temp2");let n,s=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(t()).then(function(a){return n=1,a})}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(n){return Promise.reject(n)}}}o(w5,"inMemoryCache");function _5(r,e){return e()}o(_5,"noCache");var E5="(?:%[0-9a-fA-F]{2})",Om=`(?:[a-zA-Z0-9._-]|${E5})`,S5="([a-z0-9]+)",M5=`((?:${Om}*:)*(${Om}+))`,Pm="[a-zA-Z0-9_.:%-]",A5=`;${Pm}+=${Pm}*`,T5=`((${A5})*)`,k5="(/[^#?]*)?",C5="([?][^#]*)?",D5="(#.*)?",I5=new RegExp(`^did:${S5}:${M5}${T5}${k5}${C5}${D5}$`);function bd(r){if(r===""||!r)return null;let e=r.match(I5);if(e){let t={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:r};if(e[4]){let n=e[4].slice(1).split(";");t.params={};for(let i of n){let s=i.split("=");t.params[s[0]]=s[1]}}return e[6]&&(t.path=e[6]),e[7]&&(t.query=e[7].slice(1)),e[8]&&(t.fragment=e[8].slice(1)),t}return null}o(bd,"parse");var kc={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function O5(r){return function(e,t,n){try{return Promise.resolve(x5(function(){return Promise.resolve(r(e,t,n)).then(function(i){return Te(re({},kc),{didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i})})},function(i){return Te(re({},kc),{didResolutionMetadata:{error:"notFound",message:i.toString()}})}))}catch(i){return Promise.reject(i)}}}o(O5,"wrapLegacyResolver");var rf=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?w5():t.cache||_5,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=O5(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=bd(e);if(i===null)return Promise.resolve(Te(re({},kc),{didResolutionMetadata:{error:"invalidDid"}}));let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve(Te(re({},kc),{didResolutionMetadata:{error:"unsupportedDidMethod"}}))}catch(n){return Promise.reject(n)}}};o(rf,"Resolver");gd();Hc();uf();$c();var Vh=at(b1()),$g=at(Xd()),Wh=at(zb()),gu=at(uu()),qg=at(pg()),Mf=at(vg()),Gh=at(Og()),Yh=at(ro());function sn(r){return It(r,"base64url")}o(sn,"bytesToBase64url");function Ar(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Lt(e,"base64url")}o(Ar,"base64ToBytes");function Jh(r){return Lt(r,"base58btc")}o(Jh,"base58ToBytes");function zh(r){let e=r.startsWith("0x")?r.substring(2):r;return Lt(e.toLowerCase(),"base16")}o(zh,"hexToBytes");function jh(r){return sn(Lt(r))}o(jh,"encodeBase64url");function Hg(r){return It(Ar(r))}o(Hg,"decodeBase64url");function es(r){return It(r,"base16")}o(es,"bytesToHex");function zg(r){return Lt(r)}o(zg,"stringToBytes");function yE({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set(Lt(r,"base16"),0),i.set(Lt(e,"base16"),32),n){if(typeof t=="undefined")throw new Error("Signer did not return a recoveryParam");i[64]=t}return sn(i)}o(yE,"toJose");function xE(r){let e=Ar(r);if(e.length<64||e.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${e.length}`);let t=es(e.slice(0,32)),n=es(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(xE,"fromJose");function jg(r,e){return vn([Ar(r),Ar(e)])}o(jg,"toSealed");var wE=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,_E=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,EE=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function SE(r){if(typeof r=="string"){if(wE.test(r))return zh(r);if(_E.test(r))return Jh(r);if(EE.test(r))return Ar(r);throw TypeError("bad_key: Invalid private key format")}else{if(r instanceof Uint8Array)return r;throw TypeError("bad_key: Invalid private key format")}}o(SE,"parseKey");function Kg(r){let e=typeof r=="string"?Lt(r):r;return(0,Vh.hash)(e)}o(Kg,"sha256");function ME(r){return new Uint8Array($g.keccak_256.arrayBuffer(r))}o(ME,"keccak");function AE(r){let e=Lt(r.slice(2),"base16");return`0x${It(ME(e).slice(-20),"base16")}`}o(AE,"toEthereumAddress");function Kh(r,e=new Uint8Array(4)){let t=Lt(r.toString(),"base10");return e.set(t,4-t.length),e}o(Kh,"writeUint32BE");var Hh=o(r=>vn([Kh(r.length),r]),"lengthAndInput");function Vg(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=vn([Hh(Lt(t)),Hh(typeof n=="undefined"?new Uint8Array(0):n),Hh(typeof i=="undefined"?new Uint8Array(0):i),Kh(e)]);return(0,Vh.hash)(vn([Kh(1),r,s]))}o(Vg,"concatKDF");var YN=new Wh.ec("secp256k1");function Wg(r){let e=SE(r);if(e.length!==64)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${e.length}`);return function(t){try{let n=typeof t=="string"?zg(t):t,i=(0,gu.sign)(e,n);return Promise.resolve(sn(i))}catch(n){return Promise.reject(n)}}}o(Wg,"EdDSASigner");function Gg(r){return typeof r=="object"&&"r"in r&&"s"in r}o(Gg,"instanceOfEcdsaSignature");function Pg(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(Gg(i))return yE(i,r);if(r&&typeof xE(i).recoveryParam=="undefined")throw new Error("not_supported: ES256K-R not supported when signer doesn't provide a recovery param");return i})}catch(i){return Promise.reject(i)}},"sign")}o(Pg,"ES256KSignerAlg");function Ng(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(Gg(n))throw new Error("invalid_config: expected a signer function that returns a string instead of signature object");return n})}catch(n){return Promise.reject(n)}},"sign")}o(Ng,"Ed25519SignerAlg");var TE={ES256K:Pg(),"ES256K-R":Pg(!0),Ed25519:Ng(),EdDSA:Ng()};function kE(r){let e=TE[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(kE,"SignerAlg");var Xh=new Wh.ec("secp256k1");function bu(r,e=!1){let t=Ar(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=es(t.slice(0,32)),i=es(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(bu,"toSignatureObject");function Zh(r){if(r.publicKeyBase58)return Jh(r.publicKeyBase58);if(r.publicKeyBase64)return Ar(r.publicKeyBase64);if(r.publicKeyHex)return zh(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return zh(Xh.keyFromPublic({x:es(Ar(r.publicKeyJwk.x)),y:es(Ar(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=Gs;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(Zh,"extractPublicKeyBytes");function CE(r,e,t){let n=Kg(r),i=bu(e),s=t.filter(({ethereumAddress:u,blockchainAccountId:p})=>typeof u=="undefined"&&typeof p=="undefined"),a=t.filter(({ethereumAddress:u,blockchainAccountId:p})=>typeof u!="undefined"||typeof p!==void 0),f=s.find(u=>{try{let p=Zh(u);return Xh.keyFromPublic(p).verify(n,i)}catch(p){return!1}});if(!f&&a.length>0&&(f=Yg(r,e,a)),!f)throw new Error("invalid_signature: Signature invalid for JWT");return f}o(CE,"verifyES256K");function Yg(r,e,t){let n;if(e.length>86)n=[bu(e,!0)];else{let a=bu(e,!1);n=[Te(re({},a),{recoveryParam:0}),Te(re({},a),{recoveryParam:1})]}let i=o(a=>{let f=Kg(r),u=Xh.recoverPubKey(f,a,a.recoveryParam),p=u.encode("hex"),b=u.encode("hex",!0),x=AE(p);return t.find(O=>{var T,k,$;let C=es(Zh(O));return C===p||C===b||((T=O.ethereumAddress)==null?void 0:T.toLowerCase())===x||((k=O.blockchainAccountId)==null||($=k.split("@eip155"))==null?void 0:$[0].toLowerCase())===x})},"checkSignatureAgainstSigner"),s=n.map(i).filter(a=>typeof a!="undefined");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}o(Yg,"verifyRecoverableES256K");function Rg(r,e,t){let n=zg(r),i=Ar(e),s=t.find(a=>(0,gu.verify)(Zh(a),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(Rg,"verifyEd25519");var DE={ES256K:CE,"ES256K-R":Yg,Ed25519:Rg,EdDSA:Rg};function Jg(r){let e=DE[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(Jg,"VerifierAlgorithm");Jg.toSignatureObject=bu;var Xg=o(function(r,e,t={},n={}){try{t.alg||(t.alg=IE);let i=typeof r=="string"?r:Lg(r,n.canonicalize),s=[Lg(t,n.canonicalize),i].join("."),a=kE(t.alg);return Promise.resolve(a(s,e)).then(function(f){return[s,f].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var IE="ES256K";function Lg(r,e=!1){return jh(e?(0,qg.default)(r):JSON.stringify(r))}o(Lg,"encodeSection");function OE(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Hg(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(OE,"decodeJWS");function PE({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),Jg(r.alg)(e,t,n)}o(PE,"verifyJWSDecoded");function Zg(r,e){let t=OE(r);return PE(t,e)}o(Zg,"verifyJWS");function NE(r,e,t){for(var n;;){var i=r();if(oo(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var s=t();if(s&&s.then)if(oo(s))s=s.s;else{n=1;break}if(e){var a=e();if(a&&a.then&&!oo(a)){n=2;break}}}var f=new ts,u=qt.bind(null,f,2);return(n===0?i.then(b):n===1?s.then(p):a.then(x)).then(void 0,u),f;function p(A){s=A;do{if(e&&(a=e(),a&&a.then&&!oo(a))){a.then(x).then(void 0,u);return}if(i=r(),!i||oo(i)&&!i.v){qt(f,1,s);return}if(i.then){i.then(b).then(void 0,u);return}s=t(),oo(s)&&(s=s.v)}while(!s||!s.then);s.then(p).then(void 0,u)}o(p,"_resumeAfterBody");function b(A){A?(s=t(),s&&s.then?s.then(p).then(void 0,u):p(s)):qt(f,1,s)}o(b,"_resumeAfterTest");function x(){(i=r())?i.then?i.then(b).then(void 0,u):b(i):qt(f,1,s)}o(x,"_resumeAfterUpdate")}o(NE,"_for");var Qg=o(function(r,e){try{let n=function(p){if(f===null)throw new Error("failure: Failed to decrypt");return f};o(n,"_temp5");let t;BE(r);let i=JSON.parse(Hg(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=jg(r.ciphertext,r.tag),a=new Uint8Array(Buffer.from(r.aad?`${r.protected}.${r.aad}`:r.protected)),f=null,u=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(s,Ar(r.iv),a)).then(function(p){f=p}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let p=0;return NE(function(){return!f&&p<r.recipients.length},function(){return p++},function(){let b=r.recipients[p];Object.assign(b.header,i);let x=function(){if(b.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Ar(r.iv),a,b)).then(function(A){f=A})}();if(x&&x.then)return x.then(function(){})})}}()}();return Promise.resolve(u&&u.then?u.then(n):n(u))}catch(t){return Promise.reject(t)}},"decryptJWE"),Bg=typeof Symbol!="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function qt(r,e,t){if(!r.s){if(t instanceof ts)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=qt.bind(null,r,e);return}if(t&&t.then){t.then(qt.bind(null,r,e),qt.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(qt,"_settle");var ts=function(){function r(){}return o(r,"_Pact"),r.prototype.then=function(e,t){let n=new r,i=this.s;if(i){let s=i&1?e:t;if(s){try{qt(n,1,s(this.v))}catch(a){qt(n,2,a)}return n}else return this}return this.o=function(s){try{let a=s.v;s.s&1?qt(n,1,e?e(a):a):t?qt(n,1,t(a)):qt(n,2,a)}catch(a){qt(n,2,a)}},n},r}();function oo(r){return r instanceof ts&&r.s&1}o(oo,"_isSettledPact");function RE(r,e,t){var n=-1,i,s;function a(f){try{for(;++n<r.length&&(!t||!t());)if(f=e(n),f&&f.then)if(oo(f))f=f.v;else{f.then(a,s||(s=qt.bind(null,i=new ts,2)));return}i?qt(i,1,f):i=f}catch(u){qt(i||(i=new ts),2,u)}}return o(a,"_cycle"),a(),i}o(RE,"_forTo");function LE(r,e,t){if(typeof r[Bg]=="function"){let b=function(x){try{for(;!(i=n.next()).done&&(!t||!t());)if(x=e(i.value),x&&x.then)if(oo(x))x=x.v;else{x.then(b,a||(a=qt.bind(null,s=new ts,2)));return}s?qt(s,1,x):s=x}catch(A){qt(s||(s=new ts),2,A)}};o(b,"_cycle");var n=r[Bg](),i,s,a;if(b(),n.return){var f=o(function(x){try{i.done||n.return()}catch(A){}return x},"_fixup");if(s&&s.then)return s.then(f,function(x){throw f(x)});f()}return s}if(!("length"in r))throw new TypeError("Object is not iterable");for(var u=[],p=0;p<r.length;p++)u.push(r[p]);return RE(u,function(b){return e(u[b])},t)}o(LE,"_forOf");function BE(r){if(!(r.protected&&r.iv&&r.ciphertext&&r.tag))throw new Error("bad_jwe: missing properties");r.recipients&&r.recipients.map(e=>{if(!(e.header&&e.encrypted_key))throw new Error("bad_jwe: malformed recipients")})}o(BE,"validateJWE");function Ug({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let a={protected:n,iv:sn(t),ciphertext:sn(r),tag:sn(e)};return s&&(a.aad=sn(s)),i&&(a.recipients=[i]),a}o(Ug,"encodeJWE");var ev=o(function(r,e,t={},n){try{if(e[0].alg==="dir"){if(e.length>1)throw new Error('not_supported: Can only do "dir" encryption to one key.');return Promise.resolve(e[0].encrypt(r,t,n)).then(function(i){return Ug(i,n)})}else{let i=e[0].enc;if(!e.reduce((u,p)=>u&&p.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,a,f=LE(e,function(u){let p=function(){return s?Promise.resolve(u.encryptCek==null?void 0:u.encryptCek(s)).then(function(b){if(b){var x,A;(x=a)==null||(A=x.recipients)==null||A.push(b)}}):Promise.resolve(u.encrypt(r,t,n)).then(function(b){s=b.cek,a=Ug(b,n)})}();if(p&&p.then)return p.then(function(){})});return Promise.resolve(f&&f.then?f.then(function(){return a}):a)}}catch(i){return Promise.reject(i)}},"createJWE");var tv=o(function(r,e){try{let t=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:s,didDocument:a}){var f;if(s!=null&&s.error||a==null)throw new Error(`resolver_error: Could not resolve ${i}: ${s.error}, ${s.message}`);if(!a.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let p=((f=a.keyAgreement)==null?void 0:f.map(b=>typeof b=="string"?[...a.publicKey||[],...a.verificationMethod||[]].find(x=>x.id===b):b).filter(b=>typeof b!="undefined")).filter(b=>b.type==="X25519KeyAgreementKey2019"&&Boolean(b.publicKeyBase58));if(!p.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return p.map(b=>FE(Jh(b.publicKeyBase58),b.id))})}catch(s){return Promise.reject(s)}},"encryptersForDID"),n=r.map(i=>t(i));return Promise.resolve(Promise.all(n)).then(function(i){return[].concat(...i)})}catch(t){return Promise.reject(t)}},"resolveX25519Encrypters");function rv(r){let e=new Gh.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,Yh.randomBytes)(e.nonceLength),s=e.seal(i,t,n);return{ciphertext:s.subarray(0,s.length-e.tagLength),tag:s.subarray(s.length-e.tagLength),iv:i}}}o(rv,"xc20pEncrypter");function UE(r){let e=o(function(s,a={},f){try{let u=jh(JSON.stringify(Object.assign({alg:i},a,{enc:n}))),p=new Uint8Array(Buffer.from(f?`${u}.${sn(f)}`:u));return Promise.resolve(Te(re({},t(s,p)),{protectedHeader:u}))}catch(u){return Promise.reject(u)}},"encrypt"),t=rv(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(UE,"xc20pDirEncrypter");function Fg(r){let e=o(function(n,i,s){try{return Promise.resolve(t.open(i,n,s))}catch(a){return Promise.reject(a)}},"decrypt"),t=new Gh.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(Fg,"xc20pDirDecrypter");function FE(r,e){let t=o(function(f,u={},p){try{Object.assign(u,{alg:void 0});let b=(0,Yh.randomBytes)(32);return Promise.resolve(UE(b).encrypt(f,u,p)).then(function(x){return Promise.resolve(n(b)).then(function(A){return Te(re({},x),{recipient:A,cek:b})})})}catch(b){return Promise.reject(b)}},"encrypt"),n=o(function(f){try{let u=(0,Mf.generateKeyPair)(),p=(0,Mf.sharedKey)(u.secretKey,r),b=Vg(p,s,i),x=rv(b)(f),A={encrypted_key:sn(x.ciphertext),header:{alg:i,iv:sn(x.iv),tag:sn(x.tag),epk:{kty:"OKP",crv:a,x:sn(u.publicKey)}}};return e&&(A.header.kid=e),Promise.resolve(A)}catch(u){return Promise.reject(u)}},"encryptCek"),i="ECDH-ES+XC20PKW",s=256,a="X25519";return{alg:i,enc:"XC20P",encrypt:t,encryptCek:n}}o(FE,"x25519Encrypter");function $E(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o($E,"validateHeader");function nv(r){let e=o(function(s,a,f,u){try{let x=function(){let k=Vg(O,n,t),$=jg(u.encrypted_key,u.header.tag);return Promise.resolve(Fg(k).decrypt($,Ar(u.header.iv))).then(function(C){return C===null?null:Fg(C).decrypt(s,a,f)})};o(x,"_temp4");var p,b;if($E((p=u)==null?void 0:p.header),u=u,((b=u.header.epk)==null?void 0:b.crv)!==i||typeof u.header.epk.x=="undefined")return Promise.resolve(null);let A=Ar(u.header.epk.x),O,T=function(){if(r instanceof Uint8Array)O=(0,Mf.sharedKey)(r,A);else return Promise.resolve(r(A)).then(function(k){O=k})}();return Promise.resolve(T&&T.then?T.then(x):x(T))}catch(x){return Promise.reject(x)}},"decrypt"),t="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:t,enc:"XC20P",decrypt:e}}o(nv,"x25519Decrypter");Hd();var vu=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),Qh=o(function*(r,e){if(r!=null&&!(r instanceof Uint8Array))for(let[t,n]of Object.entries(r)){let i=[...e,t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,a]of n.entries()){let f=[...i,s],u=Pe.asCID(a);u?yield[f.join("/"),u]:typeof a=="object"&&(yield*Qh(a,f))}else{let s=Pe.asCID(n);s?yield[i.join("/"),s]:yield*Qh(n,i)}}},"links"),e0=o(function*(r,e){if(r!=null)for(let[t,n]of Object.entries(r)){let i=[...e,t];if(yield i.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!Pe.asCID(n))if(Array.isArray(n))for(let[s,a]of n.entries()){let f=[...i,s];yield f.join("/"),typeof a=="object"&&!Pe.asCID(a)&&(yield*e0(a,f))}else yield*e0(n,i)}},"tree"),qE=o((r,e)=>{let t=r;for(let[n,i]of e.entries()){if(t=t[i],t==null)throw new Error(`Object has no property at ${e.slice(0,n+1).map(a=>`[${JSON.stringify(a)}]`).join("")}`);let s=Pe.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),yu=class{constructor({cid:e,bytes:t,value:n}){if(!e||!t||typeof n=="undefined")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:vu(),bytes:vu(),value:vu(),asBlock:vu()})}links(){return Qh(this.value,[])}tree(){return e0(this.value,[])}get(e="/"){return qE(this.value,e.split("/").filter(Boolean))}};o(yu,"Block");var rs=o(n=>Z(void 0,[n],function*({value:r,codec:e,hasher:t}){if(typeof r=="undefined")throw new Error('Missing required argument "value"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let i=e.encode(r),s=yield t.digest(i),a=Pe.create(1,e.code,s);return new yu({value:r,bytes:i,cid:a})}),"encode");Vn();ff();Fd();Od();var Ci={};St(Ci,{code:()=>ba,decode:()=>l0,encode:()=>If,name:()=>ES});var HE=["string","number","bigint","symbol"],zE=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function iv(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(HE.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(jE(r))return"Buffer";let t=KE(r);return t||"Object"}o(iv,"is");function jE(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(jE,"isBuffer");function KE(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(zE.includes(e))return e}o(KE,"getObjectType");var de=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};o(de,"Type");de.uint=new de(0,"uint",!0);de.negint=new de(1,"negint",!0);de.bytes=new de(2,"bytes",!0);de.string=new de(3,"string",!0);de.array=new de(4,"array",!1);de.map=new de(5,"map",!1);de.tag=new de(6,"tag",!1);de.float=new de(7,"float",!0);de.false=new de(7,"false",!0);de.true=new de(7,"true",!0);de.null=new de(7,"null",!0);de.undefined=new de(7,"undefined",!0);de.break=new de(7,"break",!0);var _e=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};o(_e,"Token");var ua=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",VE=new TextDecoder,WE=new TextEncoder;function xu(r){return ua&&globalThis.Buffer.isBuffer(r)}o(xu,"isBuffer");function r0(r){return r instanceof Uint8Array?xu(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(r0,"asU8A");var fv=ua?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):sv(r,e,t):(r,e,t)=>t-e>64?VE.decode(r.subarray(e,t)):sv(r,e,t),cv=ua?r=>r.length>64?globalThis.Buffer.from(r):ov(r):r=>r.length>64?WE.encode(r):ov(r),ri=o(r=>Uint8Array.from(r),"fromArray"),la=ua?(r,e,t)=>xu(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),uv=ua?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),r0(globalThis.Buffer.concat(r,e))):(r,e)=>{let t=new Uint8Array(e),n=0;for(let i of r)n+i.length>t.length&&(i=i.subarray(0,t.length-n)),t.set(i,n),n+=i.length;return t},lv=ua?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function dv(r,e){if(xu(r)&&xu(e))return r.compare(e);for(let t=0;t<r.length;t++)if(r[t]!==e[t])return r[t]<e[t]?-1:1;return 0}o(dv,"compare");function ov(r,e=1/0){let t,n=r.length,i=null,s=[];for(let a=0;a<n;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}o(ov,"utf8ToBytes");function sv(r,e,t){let n=[];for(;e<t;){let i=r[e],s=null,a=i>239?4:i>223?3:i>191?2:1;if(e+a<=t){let f,u,p,b;switch(a){case 1:i<128&&(s=i);break;case 2:f=r[e+1],(f&192)===128&&(b=(i&31)<<6|f&63,b>127&&(s=b));break;case 3:f=r[e+1],u=r[e+2],(f&192)===128&&(u&192)===128&&(b=(i&15)<<12|(f&63)<<6|u&63,b>2047&&(b<55296||b>57343)&&(s=b));break;case 4:f=r[e+1],u=r[e+2],p=r[e+3],(f&192)===128&&(u&192)===128&&(p&192)===128&&(b=(i&15)<<18|(f&63)<<12|(u&63)<<6|p&63,b>65535&&b<1114112&&(s=b))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=a}return GE(n)}o(sv,"utf8Slice");var av=4096;function GE(r){let e=r.length;if(e<=av)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=av));return t}o(GE,"decodeCodePointsArray");var YE=256,da=class{constructor(e=YE){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=t.length-(this.maxCursor-this.cursor)-1;t.set(e,i)}else{if(t){let i=t.length-(this.maxCursor-this.cursor)-1;i<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=lv(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=la(n,0,this.cursor)}else t=uv(this.chunks,this.cursor);return e&&this.reset(),t}};o(da,"Bl");var Xe="CBOR decode error:",n0="CBOR encode error:",Af=[];Af[23]=1;Af[24]=2;Af[25]=3;Af[26]=5;Af[27]=9;function ki(r,e,t){if(r.length-e<t)throw new Error(`${Xe} not enough data for type`)}o(ki,"assertEnoughData");var Vt=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Pr(r,e,t){ki(r,e,1);let n=r[e];if(t.strict===!0&&n<Vt[0])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Pr,"readUint8");function Nr(r,e,t){ki(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Vt[1])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Nr,"readUint16");function Rr(r,e,t){ki(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Vt[2])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Rr,"readUint32");function Lr(r,e,t){ki(r,e,8);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3],i=r[e+4]*16777216+(r[e+5]<<16)+(r[e+6]<<8)+r[e+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(t.strict===!0&&s<Vt[3])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(t.allowBigInt===!0)return s;throw new Error(`${Xe} integers outside of the safe integer range are not supported`)}o(Lr,"readUint64");function hv(r,e,t,n){return new _e(de.uint,Pr(r,e+1,n),2)}o(hv,"decodeUint8");function pv(r,e,t,n){return new _e(de.uint,Nr(r,e+1,n),3)}o(pv,"decodeUint16");function mv(r,e,t,n){return new _e(de.uint,Rr(r,e+1,n),5)}o(mv,"decodeUint32");function bv(r,e,t,n){return new _e(de.uint,Lr(r,e+1,n),9)}o(bv,"decodeUint64");function an(r,e){return er(r,0,e.value)}o(an,"encodeUint");function er(r,e,t){if(t<Vt[0]){let n=Number(t);r.push([e|n])}else if(t<Vt[1]){let n=Number(t);r.push([e|24,n])}else if(t<Vt[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Vt[3]){let n=Number(t);r.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(t);if(n<Vt[4]){let i=[e|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=a&255,a=a>>8,i[3]=a&255,a=a>>8,i[2]=a&255,a=a>>8,i[1]=a&255,r.push(i)}else throw new Error(`${Xe} encountered BigInt larger than allowable range`)}}o(er,"encodeUintValue");an.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");er.encodedSize=o(function(e){return e<Vt[0]?1:e<Vt[1]?2:e<Vt[2]?3:e<Vt[3]?5:9},"encodedSize");an.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function gv(r,e,t,n){return new _e(de.negint,-1-Pr(r,e+1,n),2)}o(gv,"decodeNegint8");function vv(r,e,t,n){return new _e(de.negint,-1-Nr(r,e+1,n),3)}o(vv,"decodeNegint16");function yv(r,e,t,n){return new _e(de.negint,-1-Rr(r,e+1,n),5)}o(yv,"decodeNegint32");var i0=BigInt(-1),xv=BigInt(1);function wv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new _e(de.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Xe} integers outside of the safe integer range are not supported`);return new _e(de.negint,i0-BigInt(i),9)}o(wv,"decodeNegint64");function wu(r,e){let t=e.value,n=typeof t=="bigint"?t*i0-xv:t*-1-1;er(r,e.type.majorEncoded,n)}o(wu,"encodeNegint");wu.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*i0-xv:t*-1-1;return n<Vt[0]?1:n<Vt[1]?2:n<Vt[2]?3:n<Vt[3]?5:9},"encodedSize");wu.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function Tf(r,e,t,n){ki(r,e,t+n);let i=la(r,e+t,e+t+n);return new _e(de.bytes,i,t+n)}o(Tf,"toToken");function _v(r,e,t,n){return Tf(r,e,1,t)}o(_v,"decodeBytesCompact");function Ev(r,e,t,n){return Tf(r,e,2,Pr(r,e+1,n))}o(Ev,"decodeBytes8");function Sv(r,e,t,n){return Tf(r,e,3,Nr(r,e+1,n))}o(Sv,"decodeBytes16");function Mv(r,e,t,n){return Tf(r,e,5,Rr(r,e+1,n))}o(Mv,"decodeBytes32");function Av(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer bytes lengths not supported`);return Tf(r,e,9,i)}o(Av,"decodeBytes64");function _u(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===de.string?cv(r.value):r.value),r.encodedBytes}o(_u,"tokenBytes");function ha(r,e){let t=_u(e);er(r,e.type.majorEncoded,t.length),r.push(t)}o(ha,"encodeBytes");ha.encodedSize=o(function(e){let t=_u(e);return er.encodedSize(t.length)+t.length},"encodedSize");ha.compareTokens=o(function(e,t){return XE(_u(e),_u(t))},"compareTokens");function XE(r,e){return r.length<e.length?-1:r.length>e.length?1:dv(r,e)}o(XE,"compareBytes");function kf(r,e,t,n,i){let s=t+n;ki(r,e,s);let a=new _e(de.string,fv(r,e+t,e+s),s);return i.retainStringBytes===!0&&(a.byteValue=la(r,e+t,e+s)),a}o(kf,"toToken");function Tv(r,e,t,n){return kf(r,e,1,t,n)}o(Tv,"decodeStringCompact");function kv(r,e,t,n){return kf(r,e,2,Pr(r,e+1,n),n)}o(kv,"decodeString8");function Cv(r,e,t,n){return kf(r,e,3,Nr(r,e+1,n),n)}o(Cv,"decodeString16");function Dv(r,e,t,n){return kf(r,e,5,Rr(r,e+1,n),n)}o(Dv,"decodeString32");function Iv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer string lengths not supported`);return kf(r,e,9,i,n)}o(Iv,"decodeString64");var Ov=ha;function pa(r,e,t,n){return new _e(de.array,n,t)}o(pa,"toToken");function Pv(r,e,t,n){return pa(r,e,1,t)}o(Pv,"decodeArrayCompact");function Nv(r,e,t,n){return pa(r,e,2,Pr(r,e+1,n))}o(Nv,"decodeArray8");function Rv(r,e,t,n){return pa(r,e,3,Nr(r,e+1,n))}o(Rv,"decodeArray16");function Lv(r,e,t,n){return pa(r,e,5,Rr(r,e+1,n))}o(Lv,"decodeArray32");function Bv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer array lengths not supported`);return pa(r,e,9,i)}o(Bv,"decodeArray64");function Uv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return pa(r,e,1,1/0)}o(Uv,"decodeArrayIndefinite");function Eu(r,e){er(r,de.array.majorEncoded,e.value)}o(Eu,"encodeArray");Eu.compareTokens=an.compareTokens;Eu.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function ma(r,e,t,n){return new _e(de.map,n,t)}o(ma,"toToken");function Fv(r,e,t,n){return ma(r,e,1,t)}o(Fv,"decodeMapCompact");function $v(r,e,t,n){return ma(r,e,2,Pr(r,e+1,n))}o($v,"decodeMap8");function qv(r,e,t,n){return ma(r,e,3,Nr(r,e+1,n))}o(qv,"decodeMap16");function Hv(r,e,t,n){return ma(r,e,5,Rr(r,e+1,n))}o(Hv,"decodeMap32");function zv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer map lengths not supported`);return ma(r,e,9,i)}o(zv,"decodeMap64");function jv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return ma(r,e,1,1/0)}o(jv,"decodeMapIndefinite");function Su(r,e){er(r,de.map.majorEncoded,e.value)}o(Su,"encodeMap");Su.compareTokens=an.compareTokens;Su.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function Kv(r,e,t,n){return new _e(de.tag,t,1)}o(Kv,"decodeTagCompact");function Vv(r,e,t,n){return new _e(de.tag,Pr(r,e+1,n),2)}o(Vv,"decodeTag8");function Wv(r,e,t,n){return new _e(de.tag,Nr(r,e+1,n),3)}o(Wv,"decodeTag16");function Gv(r,e,t,n){return new _e(de.tag,Rr(r,e+1,n),5)}o(Gv,"decodeTag32");function Yv(r,e,t,n){return new _e(de.tag,Lr(r,e+1,n),9)}o(Yv,"decodeTag64");function Mu(r,e){er(r,de.tag.majorEncoded,e.value)}o(Mu,"encodeTag");Mu.compareTokens=an.compareTokens;Mu.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");var nS=20,iS=21,oS=22,sS=23;function Jv(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${Xe} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new _e(de.null,null,1):new _e(de.undefined,void 0,1)}o(Jv,"decodeUndefined");function Xv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return new _e(de.break,void 0,1)}o(Xv,"decodeBreak");function o0(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${Xe} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${Xe} Infinity values are not supported`)}return new _e(de.float,r,e)}o(o0,"createToken");function Zv(r,e,t,n){return o0(s0(r,e+1),3,n)}o(Zv,"decodeFloat16");function Qv(r,e,t,n){return o0(a0(r,e+1),5,n)}o(Qv,"decodeFloat32");function e2(r,e,t,n){return o0(i2(r,e+1),9,n)}o(e2,"decodeFloat64");function Au(r,e,t){let n=e.value;if(n===!1)r.push([de.float.majorEncoded|nS]);else if(n===!0)r.push([de.float.majorEncoded|iS]);else if(n===null)r.push([de.float.majorEncoded|oS]);else if(n===void 0)r.push([de.float.majorEncoded|sS]);else{let i,s=!1;(!t||t.float64!==!0)&&(r2(n),i=s0(Mn,1),n===i||Number.isNaN(n)?(Mn[0]=249,r.push(Mn.slice(0,3)),s=!0):(n2(n),i=a0(Mn,1),n===i&&(Mn[0]=250,r.push(Mn.slice(0,5)),s=!0))),s||(aS(n),i=i2(Mn,1),Mn[0]=251,r.push(Mn.slice(0,9)))}}o(Au,"encodeFloat");Au.encodedSize=o(function(e,t){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!t||t.float64!==!0){r2(n);let i=s0(Mn,1);if(n===i||Number.isNaN(n))return 3;if(n2(n),i=a0(Mn,1),n===i)return 5}return 9},"encodedSize");var t2=new ArrayBuffer(9),fn=new DataView(t2,1),Mn=new Uint8Array(t2,0);function r2(r){if(r===1/0)fn.setUint16(0,31744,!1);else if(r===-1/0)fn.setUint16(0,64512,!1);else if(Number.isNaN(r))fn.setUint16(0,32256,!1);else{fn.setFloat32(0,r);let e=fn.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)fn.setUint16(0,31744,!1);else if(t===0)fn.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?fn.setUint16(0,0):i<-14?fn.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):fn.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(r2,"encodeFloat16");function s0(r,e){if(r.length-e<2)throw new Error(`${Xe} not enough data for float16`);let t=(r[e]<<8)+r[e+1];if(t===31744)return 1/0;if(t===64512)return-1/0;if(t===32256)return NaN;let n=t>>10&31,i=t&1023,s;return n===0?s=i*pd(2,-24):n!==31?s=(i+1024)*pd(2,n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(s0,"readFloat16");function n2(r){fn.setFloat32(0,r,!1)}o(n2,"encodeFloat32");function a0(r,e){if(r.length-e<4)throw new Error(`${Xe} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(a0,"readFloat32");function aS(r){fn.setFloat64(0,r,!1)}o(aS,"encodeFloat64");function i2(r,e){if(r.length-e<8)throw new Error(`${Xe} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(i2,"readFloat64");Au.compareTokens=an.compareTokens;function ct(r,e,t){throw new Error(`${Xe} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o(ct,"invalidMinor");function Tu(r){return()=>{throw new Error(`${Xe} ${r}`)}}o(Tu,"errorer");var ye=[];for(let r=0;r<=23;r++)ye[r]=ct;ye[24]=hv;ye[25]=pv;ye[26]=mv;ye[27]=bv;ye[28]=ct;ye[29]=ct;ye[30]=ct;ye[31]=ct;for(let r=32;r<=55;r++)ye[r]=ct;ye[56]=gv;ye[57]=vv;ye[58]=yv;ye[59]=wv;ye[60]=ct;ye[61]=ct;ye[62]=ct;ye[63]=ct;for(let r=64;r<=87;r++)ye[r]=_v;ye[88]=Ev;ye[89]=Sv;ye[90]=Mv;ye[91]=Av;ye[92]=ct;ye[93]=ct;ye[94]=ct;ye[95]=Tu("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)ye[r]=Tv;ye[120]=kv;ye[121]=Cv;ye[122]=Dv;ye[123]=Iv;ye[124]=ct;ye[125]=ct;ye[126]=ct;ye[127]=Tu("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)ye[r]=Pv;ye[152]=Nv;ye[153]=Rv;ye[154]=Lv;ye[155]=Bv;ye[156]=ct;ye[157]=ct;ye[158]=ct;ye[159]=Uv;for(let r=160;r<=183;r++)ye[r]=Fv;ye[184]=$v;ye[185]=qv;ye[186]=Hv;ye[187]=zv;ye[188]=ct;ye[189]=ct;ye[190]=ct;ye[191]=jv;for(let r=192;r<=215;r++)ye[r]=Kv;ye[216]=Vv;ye[217]=Wv;ye[218]=Gv;ye[219]=Yv;ye[220]=ct;ye[221]=ct;ye[222]=ct;ye[223]=ct;for(let r=224;r<=243;r++)ye[r]=Tu("simple values are not supported");ye[244]=ct;ye[245]=ct;ye[246]=ct;ye[247]=Jv;ye[248]=Tu("simple values are not supported");ye[249]=Zv;ye[250]=Qv;ye[251]=e2;ye[252]=ct;ye[253]=ct;ye[254]=ct;ye[255]=Xv;var An=[];for(let r=0;r<24;r++)An[r]=new _e(de.uint,r,1);for(let r=-1;r>=-24;r--)An[31-r]=new _e(de.negint,r,1);An[64]=new _e(de.bytes,new Uint8Array(0),1);An[96]=new _e(de.string,"",1);An[128]=new _e(de.array,0,1);An[160]=new _e(de.map,0,1);An[244]=new _e(de.false,!1,1);An[245]=new _e(de.true,!0,1);An[246]=new _e(de.null,null,1);function o2(r){switch(r.type){case de.false:return ri([244]);case de.true:return ri([245]);case de.null:return ri([246]);case de.bytes:return r.value.length?void 0:ri([64]);case de.string:return r.value===""?ri([96]):void 0;case de.array:return r.value===0?ri([128]):void 0;case de.map:return r.value===0?ri([160]):void 0;case de.uint:return r.value<24?ri([Number(r.value)]):void 0;case de.negint:if(r.value>=-24)return ri([31-Number(r.value)])}}o(o2,"quickEncodeToken");var cS={float64:!1,mapSorter:dS,quickEncodeToken:o2};function uS(){let r=[];return r[de.uint.major]=an,r[de.negint.major]=wu,r[de.bytes.major]=ha,r[de.string.major]=Ov,r[de.array.major]=Eu,r[de.map.major]=Su,r[de.tag.major]=Mu,r[de.float.major]=Au,r}o(uS,"makeCborEncoders");var s2=uS(),f0=new da,is=class{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do if(t.obj===e)return!0;while(t=t.parent);return!1}static createCheck(e,t){if(e&&e.includes(t))throw new Error(`${n0} object contains circular references`);return new is(t,e)}};o(is,"Ref");var so={null:new _e(de.null,null),undefined:new _e(de.undefined,void 0),true:new _e(de.true,!0),false:new _e(de.false,!1),emptyArray:new _e(de.array,0),emptyMap:new _e(de.map,0)},ao={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new _e(de.float,r):r>=0?new _e(de.uint,r):new _e(de.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new _e(de.uint,r):new _e(de.negint,r)},Uint8Array(r,e,t,n){return new _e(de.bytes,r)},string(r,e,t,n){return new _e(de.string,r)},boolean(r,e,t,n){return r?so.true:so.false},null(r,e,t,n){return so.null},undefined(r,e,t,n){return so.undefined},ArrayBuffer(r,e,t,n){return new _e(de.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new _e(de.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[so.emptyArray,new _e(de.break)]:so.emptyArray;n=is.createCheck(n,r);let i=[],s=0;for(let a of r)i[s++]=ku(a,t,n);return t.addBreakTokens?[new _e(de.array,r.length),i,new _e(de.break)]:[new _e(de.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",s=i?r.keys():Object.keys(r),a=i?r.size:s.length;if(!a)return t.addBreakTokens===!0?[so.emptyMap,new _e(de.break)]:so.emptyMap;n=is.createCheck(n,r);let f=[],u=0;for(let p of s)f[u++]=[ku(p,t,n),ku(i?r.get(p):r[p],t,n)];return lS(f,t),t.addBreakTokens?[new _e(de.map,a),f,new _e(de.break)]:[new _e(de.map,a),f]}};ao.Map=ao.Object;ao.Buffer=ao.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))ao[`${r}Array`]=ao.DataView;function ku(r,e={},t){let n=iv(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||ao[n];if(typeof i=="function"){let a=i(r,n,e,t);if(a!=null)return a}let s=ao[n];if(!s)throw new Error(`${n0} unsupported type: ${n}`);return s(r,n,e,t)}o(ku,"objectToTokens");function lS(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(lS,"sortMapEntries");function dS(r,e){let t=Array.isArray(r[0])?r[0][0]:r[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(t.type!==n.type)return t.type.compare(n.type);let i=t.type.major,s=s2[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(dS,"mapSorter");function a2(r,e,t,n){if(Array.isArray(e))for(let i of e)a2(r,i,t,n);else t[e.type.major](r,e,n)}o(a2,"tokensToEncoded");function hS(r,e,t){let n=ku(r,t);if(!Array.isArray(n)&&t.quickEncodeToken){let i=t.quickEncodeToken(n);if(i)return i;let s=e[n.type.major];if(s.encodedSize){let a=s.encodedSize(n,t),f=new da(a);if(s(f,n,t),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return r0(f.chunks[0])}}return f0.reset(),a2(f0,n,e,t),f0.toBytes(!0)}o(hS,"encodeCustom");function c0(r,e){return e=Object.assign({},cS,e),hS(r,s2,e)}o(c0,"encode");var pS={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Cu=class{constructor(e,t={}){this.pos=0,this.data=e,this.options=t}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],t=An[e];if(t===void 0){let n=ye[e];if(!n)throw new Error(`${Xe} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;t=n(this.data,this.pos,i,this.options)}return this.pos+=t.encodedLength,t}};o(Cu,"Tokeniser");var Cf=Symbol.for("DONE"),Du=Symbol.for("BREAK");function mS(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=Df(e,t);if(s===Du){if(r.value===1/0)break;throw new Error(`${Xe} got unexpected break to lengthed array`)}if(s===Cf)throw new Error(`${Xe} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(mS,"tokenToArray");function bS(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let a=0;a<r.value;a++){let f=Df(e,t);if(f===Du){if(r.value===1/0)break;throw new Error(`${Xe} got unexpected break to lengthed map`)}if(f===Cf)throw new Error(`${Xe} found map but not enough entries (got ${a} [no key], expected ${r.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${Xe} non-string keys not supported (got ${typeof f})`);let u=Df(e,t);if(u===Cf)throw new Error(`${Xe} found map but not enough entries (got ${a} [no value], expected ${r.value})`);n?s.set(f,u):i[f]=u}return n?s:i}o(bS,"tokenToMap");function Df(r,e){if(r.done())return Cf;let t=r.next();if(t.type===de.break)return Du;if(t.type.terminal)return t.value;if(t.type===de.array)return mS(t,r,e);if(t.type===de.map)return bS(t,r,e);if(t.type===de.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=Df(r,e);return e.tags[t.value](n)}throw new Error(`${Xe} tag not supported (${t.value})`)}throw new Error("unsupported")}o(Df,"tokensToObject");function u0(r,e){if(!(r instanceof Uint8Array))throw new Error(`${Xe} data to decode must be a Uint8Array`);e=Object.assign({},pS,e);let t=e.tokenizer||new Cu(r,e),n=Df(t,e);if(n===Cf)throw new Error(`${Xe} did not find any content to decode`);if(n===Du)throw new Error(`${Xe} got unexpected break`);if(!t.done())throw new Error(`${Xe} too many terminals, data makes no sense`);return n}o(u0,"decode");Vn();var f2=42;function vS(r){if(r.asCID!==r)return null;let e=Pe.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new _e(de.tag,f2),new _e(de.bytes,t)]}o(vS,"cidEncoder");function yS(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(yS,"undefinedEncoder");function xS(r){if(Number.isNaN(r))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(r===1/0||r===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}o(xS,"numberEncoder");var wS={float64:!0,typeEncoders:{Object:vS,undefined:yS,number:xS}};function _S(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Pe.decode(r.subarray(1))}o(_S,"cidDecoder");var c2={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};c2.tags[f2]=_S;var ES="dag-cbor",ba=113,If=o(r=>c0(r,wS),"encode"),l0=o(r=>u0(r,c2),"decode");var SS=24;function u2(r){return Z(this,null,function*(){let e=yield rs({value:r,codec:Ci,hasher:zo});return{cid:e.cid,linkedBlock:e.bytes}})}o(u2,"encodePayload");function MS(r,e=SS){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(MS,"pad");function AS(r){return Z(this,null,function*(){return(yield rs({value:r,codec:Ci,hasher:Bc})).cid})}o(AS,"encodeIdentityCID");function TS(r){if(r=Pe.asCID(r),r.code!==ba)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==Bc.code)throw new Error("CID must use identity multihash");return l0(r.multihash.digest)}o(TS,"decodeIdentityCID");function l2(r,e){return Z(this,null,function*(){return MS((yield AS(r)).bytes,e)})}o(l2,"prepareCleartext");function d2(r){return TS(Pe.decodeFirst(r)[0])}o(d2,"decodeCleartext");var h2=Symbol("abortable"),Iu=Symbol("aborted");function p2(r,e){if(e.aborted)return Promise.reject(Iu);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Iu)}),Promise.race([r,n])}o(p2,"abortable");var m2=o((r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),""),"nanoid");var Ou="utils_abort_request";var yr;(function(r){r[r.PARSE_ERROR=-32700]="PARSE_ERROR",r[r.INVALID_REQUEST=-32600]="INVALID_REQUEST",r[r.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",r[r.INVALID_PARAMS=-32602]="INVALID_PARAMS",r[r.INTERNAL_ERROR=-32603]="INTERNAL_ERROR"})(yr||(yr={}));var b2={[yr.PARSE_ERROR]:"Parse error",[yr.INVALID_REQUEST]:"Invalid request",[yr.METHOD_NOT_FOUND]:"Method not found",[yr.INVALID_PARAMS]:"Invalid params",[yr.INTERNAL_ERROR]:"Internal error"};function kS(r){return-32e3>=r&&r>=-32099}o(kS,"isServerError");function Pu(r){var e;return(e=b2[r.toString()])!=null?e:kS(r)?"Server error":"Application error"}o(Pu,"getErrorMessage");var Tr=class extends Error{static fromObject(e){return new Tr(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,t,n){super(),Object.setPrototypeOf(this,Tr.prototype),this.code=e,this.data=n,this.message=t!=null?t:Pu(e)}};o(Tr,"RPCError");function Of(r){let e=b2[r];return o(function(n){return new Tr(r,e,n)},"createError")}o(Of,"createErrorFactory");var CS=Of(yr.PARSE_ERROR),aL=Of(yr.INVALID_REQUEST),fL=Of(yr.METHOD_NOT_FOUND),cL=Of(yr.INVALID_PARAMS),uL=Of(yr.INTERNAL_ERROR);function DS(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(DS,"_checkPrivateRedeclaration");function IS(r,e){return e.get?e.get.call(r):e.value}o(IS,"_classApplyDescriptorGet");function OS(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(OS,"_classApplyDescriptorSet");function g2(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(g2,"_classExtractFieldDescriptor");function d0(r,e){var t=g2(r,e,"get");return IS(r,t)}o(d0,"_classPrivateFieldGet");function PS(r,e,t){DS(r,e),e.set(r,t)}o(PS,"_classPrivateFieldInit");function NS(r,e,t){var n=g2(r,e,"set");return OS(r,n,t),t}o(NS,"_classPrivateFieldSet");var Pf=new WeakMap,ga=class{get connection(){return d0(this,Pf)}createID(){return m2()}request(e,t=void 0,n={}){let{signal:i}=n;if(i!=null&&i.aborted)return Promise.reject(Iu);let s=this.createID(),a=d0(this,Pf).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(f=>{if(f==null)throw new Error("Missing response");if(f.error!=null)throw Tr.fromObject(f.error);return f.result});return i==null?a:(i.addEventListener("abort",()=>{this.notify(Ou,{id:s})}),p2(a,i))}notify(e,t=void 0){return Z(this,null,function*(){yield d0(this,Pf).send({jsonrpc:"2.0",method:e,params:t})})}constructor(e){PS(this,Pf,{writable:!0,value:void 0}),NS(this,Pf,e)}};o(ga,"RPCClient");function v2(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:Pu(e)}}}o(v2,"createErrorResponse");function RS(r,e,t){console.warn("Unhandled handler error",e,t)}o(RS,"fallbackOnHandlerError");function LS(r,e){console.warn("Unhandled invalid message",e)}o(LS,"fallbackOnInvalidMessage");function BS(r,e){console.warn("Unhandled notification",e)}o(BS,"fallbackOnNotification");function y2(r,e={}){var f,u,p;let t=(f=e.onHandlerError)!=null?f:RS,n=(u=e.onInvalidMessage)!=null?u:LS,i=(p=e.onNotification)!=null?p:BS,s={};function a(b,x){var A,O;if(x.method===Ou){let T=(A=x.params)==null?void 0:A.id;T!=null&&((O=s[T])==null||O.abort())}else i(b,x)}return o(a,"handleNotification"),o(function(x,A){return Z(this,null,function*(){var k,$,C;let O=A.id;if(A.jsonrpc!=="2.0"||A.method==null)return O==null?(n(x,A),null):v2(O,yr.INVALID_REQUEST);let T=r[A.method];if(T==null)return O==null?(a(x,A),null):v2(O,yr.METHOD_NOT_FOUND);try{let B;if(O!=null&&T[h2]){let H=new AbortController;s[O]=H,B=T(x,A.params,{signal:H.signal})}else B=T(x,A.params,{});let z=B==null?B:typeof B.then=="function"?yield B:B;return O==null||((k=s[O])==null?void 0:k.signal.aborted)?null:{jsonrpc:"2.0",id:O,result:z}}catch(B){if(O==null||(($=s[O])==null?void 0:$.signal.aborted))return t(x,A,B),null;let z;if(B instanceof Tr)z=B.toObject();else{t(x,A,B);let H=(C=B.code)!=null?C:-32e3;z={code:H,message:B.message||Pu(H)}}return{jsonrpc:"2.0",id:O,error:z}}finally{O!=null&&delete s[O]}})},"handleRequest")}o(y2,"createHandler");Vn();var Yy=at(uy(),1),dr=at(as(),1);function w0(){return w0=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},w0.apply(this,arguments)}o(w0,"_extends");var _0={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},rM={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},E0={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},nM={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:_0,1:E0}}},iM={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:_0,1:E0,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},Uf={2:_0,10:rM,19:{assetName:E0,assetType:nM,assetId:iM}};function ly(r,e){return r.split(e.parameters.delimiter)}o(ly,"splitParams");function Ff(r,e){var t=ly(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o(Ff,"getParams");function _a(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:_a(n,t)}).join(e.parameters.delimiter)}o(_a,"joinParams");function $f(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=ly(r,e);if(t.length!==Object.keys(e.parameters.values).length)return!1;var n=t.map(function(i,s){return new RegExp(e.parameters.values[s].regex).test(i)}).filter(function(i){return!!i});return n.length===t.length}o($f,"isValidId");var lo=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.namespace=t.namespace,this.reference=t.reference}o(r,"ChainId"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(Ff(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return _a(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),r}();lo.spec=Uf[2];var fs=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new lo(t.chainId),this.address=t.address}o(r,"AccountId"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=Ff(n,this.spec),s=i.namespace,a=i.reference,f=i.address,u=new lo({namespace:s,reference:a});return new r({chainId:u,address:f}).toJSON()},"parse"),r.format=o(function(n){var i=new lo(n.chainId),s=w0({},i.toJSON(),{address:n.address});return _a(s,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON"),r}();fs.spec=Uf[10];var S0=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.namespace=t.namespace,this.reference=t.reference}o(r,"AssetName"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(Ff(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return _a(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),r}();S0.spec=Uf[19].assetName;var oM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new lo(t.chainId),this.assetName=new S0(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(Ff(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return _a(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON"),r}();oM.spec=Uf[19].assetType;var sM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new lo(t.chainId),this.assetName=new S0(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(Ff(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return _a(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON"),r}();sM.spec=Uf[19].assetId;var dy="logger/5.6.0";var hy=!1,py=!1,Fu={debug:1,default:2,info:2,warning:3,error:4,off:5},my=Fu.default,M0=null;function aM(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch(t){r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}o(aM,"_checkNormalize");var by=aM(),A0;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(A0||(A0={}));var kn;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED"})(kn||(kn={}));var gy="0123456789abcdef",tt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();Fu[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(my>Fu[n])&&console.log.apply(console,t)}debug(...e){this._log(tt.levels.DEBUG,e)}info(...e){this._log(tt.levels.INFO,e)}warn(...e){this._log(tt.levels.WARNING,e)}makeError(e,t,n){if(py)return this.makeError("censored error",t,{});t||(t=tt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(u=>{let p=n[u];try{if(p instanceof Uint8Array){let b="";for(let x=0;x<p.length;x++)b+=gy[p[x]>>4],b+=gy[p[x]&15];i.push(u+"=Uint8Array(0x"+b+")")}else i.push(u+"="+JSON.stringify(p))}catch(b){i.push(u+"="+JSON.stringify(n[u].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);let s=e,a="";switch(t){case kn.NUMERIC_FAULT:{a="NUMERIC_FAULT";let u=e;switch(u){case"overflow":case"underflow":case"division-by-zero":a+="-"+u;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result";break}break}case kn.CALL_EXCEPTION:case kn.INSUFFICIENT_FUNDS:case kn.MISSING_NEW:case kn.NONCE_EXPIRED:case kn.REPLACEMENT_UNDERPRICED:case kn.TRANSACTION_REPLACED:case kn.UNPREDICTABLE_GAS_LIMIT:a=t;break}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let f=new Error(e);return f.reason=s,f.code=t,Object.keys(n).forEach(function(u){f[u]=n[u]}),f}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,tt.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,i){e||this.throwError(t,n,i)}assertArgument(e,t,n,i){e||this.throwArgumentError(t,n,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),by&&this.throwError("platform missing String.prototype.normalize",tt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:by})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,tt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,tt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n?n=": "+n:n="",e<t&&this.throwError("missing argument"+n,tt.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,tt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",tt.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",tt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",tt.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return M0||(M0=new tt(dy)),M0}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),hy){if(!e)return;this.globalLogger().throwError("error censorship permanent",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}py=!!e,hy=!!t}static setLogLevel(e){let t=Fu[e.toLowerCase()];if(t==null){tt.globalLogger().warn("invalid log level - "+e);return}my=t}static from(e){return new tt(e)}};o(tt,"Logger");tt.errors=kn;tt.levels=A0;var vy="bytes/5.6.1";var Bt=new tt(vy);function xy(r){return!!r.toHexString}o(xy,"isHexable");function Ea(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Ea(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Ea,"addSlice");function wy(r){return Cn(r)&&!(r.length%2)||k0(r)}o(wy,"isBytesLike");function yy(r){return typeof r=="number"&&r==r&&r%1===0}o(yy,"isInteger");function k0(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!yy(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!yy(t)||t<0||t>=256)return!1}return!0}o(k0,"isBytes");function Tt(r,e){if(e||(e={}),typeof r=="number"){Bt.checkSafeUint53(r,"invalid arrayify value");let t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),Ea(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),xy(r)&&(r=r.toHexString()),Cn(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":Bt.throwArgumentError("hex data is odd-length","value",r));let n=[];for(let i=0;i<t.length;i+=2)n.push(parseInt(t.substring(i,i+2),16));return Ea(new Uint8Array(n))}return k0(r)?Ea(new Uint8Array(r)):Bt.throwArgumentError("invalid arrayify value","value",r)}o(Tt,"arrayify");function C0(r){let e=r.map(i=>Tt(i)),t=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(t);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Ea(n)}o(C0,"concat");function fM(r,e){r=Tt(r),r.length>e&&Bt.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),Ea(t)}o(fM,"zeroPad");function Cn(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Cn,"isHexString");var T0="0123456789abcdef";function ur(r,e){if(e||(e={}),typeof r=="number"){Bt.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=T0[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),xy(r))return r.toHexString();if(Cn(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":Bt.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(k0(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=T0[(i&240)>>4]+T0[i&15]}return t}return Bt.throwArgumentError("invalid hexlify value","value",r)}o(ur,"hexlify");function $u(r){if(typeof r!="string")r=ur(r);else if(!Cn(r)||r.length%2)return null;return(r.length-2)/2}o($u,"hexDataLength");function qu(r,e,t){return typeof r!="string"?r=ur(r):(!Cn(r)||r.length%2)&&Bt.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(qu,"hexDataSlice");function ho(r,e){for(typeof r!="string"?r=ur(r):Cn(r)||Bt.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&Bt.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(ho,"hexZeroPad");function Hu(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(wy(r)){let t=Tt(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=ur(t.slice(0,32)),e.s=ur(t.slice(32,64))):t.length===65?(e.r=ur(t.slice(0,32)),e.s=ur(t.slice(32,64)),e.v=t[64]):Bt.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:Bt.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=ur(t.slice(32,64))}else{if(e.r=r.r,e.s=r.s,e.v=r.v,e.recoveryParam=r.recoveryParam,e._vs=r._vs,e._vs!=null){let i=fM(Tt(e._vs),32);e._vs=ur(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Bt.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let a=ur(i);e.s==null?e.s=a:e.s!==a&&Bt.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?Bt.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Bt.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Cn(e.r)?Bt.throwArgumentError("signature missing or invalid r","signature",r):e.r=ho(e.r,32),e.s==null||!Cn(e.s)?Bt.throwArgumentError("signature missing or invalid s","signature",r):e.s=ho(e.s,32);let t=Tt(e.s);t[0]>=128&&Bt.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=ur(t);e._vs&&(Cn(e._vs)||Bt.throwArgumentError("signature invalid _vs","signature",r),e._vs=ho(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Bt.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(Hu,"splitSignature");var Sy=at(I0());var Ey="bignumber/5.6.2";var cM=Sy.default.BN,rB=new tt(Ey);function O0(r){return new cM(r,36).toString(16)}o(O0,"_base36To16");var My=at(Xd());function Sa(r){return"0x"+My.default.keccak_256(Tt(r))}o(Sa,"keccak256");var Ay="address/5.6.1";var qf=new tt(Ay);function Ty(r){Cn(r,20)||qf.throwArgumentError("invalid address","address",r),r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);let n=Tt(Sa(t));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}o(Ty,"getChecksumAddress");var dM=9007199254740991;function hM(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(hM,"log10");var P0={};for(let r=0;r<10;r++)P0[String(r)]=String(r);for(let r=0;r<26;r++)P0[String.fromCharCode(65+r)]=String(10+r);var ky=Math.floor(hM(dM));function pM(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>P0[n]).join("");for(;e.length>=ky;){let n=e.substring(0,ky);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}o(pM,"ibanChecksum");function Cy(r){let e=null;if(typeof r!="string"&&qf.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=Ty(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&qf.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==pM(r)&&qf.throwArgumentError("bad icap checksum","address",r),e=O0(r.substring(4));e.length<40;)e="0"+e;e=Ty("0x"+e)}else qf.throwArgumentError("invalid address","address",r);return e}o(Cy,"getAddress");var Dy="properties/5.6.0";var yB=new tt(Dy);function Ma(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Ma,"defineReadOnly");var Iy="strings/5.6.1";var Oy=new tt(Iy),Hf;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(Hf||(Hf={}));var cs;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(cs||(cs={}));function mM(r,e,t,n,i){return Oy.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(mM,"errorFunc");function Py(r,e,t,n,i){if(r===cs.BAD_PREFIX||r===cs.UNEXPECTED_CONTINUE){let s=0;for(let a=e+1;a<t.length&&t[a]>>6===2;a++)s++;return s}return r===cs.OVERRUN?t.length-e-1:0}o(Py,"ignoreFunc");function bM(r,e,t,n,i){return r===cs.OVERLONG?(n.push(i),0):(n.push(65533),Py(r,e,t,n,i))}o(bM,"replaceFunc");var gM=Object.freeze({error:mM,ignore:Py,replace:bM});function zf(r,e=Hf.current){e!=Hf.current&&(Oy.checkNormalize(),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192),t.push(i&63|128);else if((i&64512)==55296){n++;let s=r.charCodeAt(n);if(n>=r.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");let a=65536+((i&1023)<<10)+(s&1023);t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return Tt(t)}o(zf,"toUtf8Bytes");var Ny=`Ethereum Signed Message:
633
- `;function N0(r){return typeof r=="string"&&(r=zf(r)),Sa(C0([zf(Ny),zf(String(r.length)),r]))}o(N0,"hashMessage");var Qe=at(I0()),oi=at(bf());function Aa(r,e,t){return t={path:e,exports:{},require:function(n,i){return vM(n,i==null?t.path:i)}},r(t,t.exports),t.exports}o(Aa,"createCommonjsModule");function vM(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(vM,"commonjsRequire");var U0=Ly;function Ly(r,e){if(!r)throw new Error(e||"Assertion failed")}o(Ly,"assert");Ly.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var Dn=Aa(function(r,e){"use strict";var t=e;function n(a,f){if(Array.isArray(a))return a.slice();if(!a)return[];var u=[];if(typeof a!="string"){for(var p=0;p<a.length;p++)u[p]=a[p]|0;return u}if(f==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var p=0;p<a.length;p+=2)u.push(parseInt(a[p]+a[p+1],16))}else for(var p=0;p<a.length;p++){var b=a.charCodeAt(p),x=b>>8,A=b&255;x?u.push(x,A):u.push(A)}return u}o(n,"toArray"),t.toArray=n;function i(a){return a.length===1?"0"+a:a}o(i,"zero2"),t.zero2=i;function s(a){for(var f="",u=0;u<a.length;u++)f+=i(a[u].toString(16));return f}o(s,"toHex"),t.toHex=s,t.encode=o(function(f,u){return u==="hex"?s(f):f},"encode")}),Ur=Aa(function(r,e){"use strict";var t=e;t.assert=U0,t.toArray=Dn.toArray,t.zero2=Dn.zero2,t.toHex=Dn.toHex,t.encode=Dn.encode;function n(u,p,b){var x=new Array(Math.max(u.bitLength(),b)+1);x.fill(0);for(var A=1<<p+1,O=u.clone(),T=0;T<x.length;T++){var k,$=O.andln(A-1);O.isOdd()?($>(A>>1)-1?k=(A>>1)-$:k=$,O.isubn(k)):k=0,x[T]=k,O.iushrn(1)}return x}o(n,"getNAF"),t.getNAF=n;function i(u,p){var b=[[],[]];u=u.clone(),p=p.clone();for(var x=0,A=0,O;u.cmpn(-x)>0||p.cmpn(-A)>0;){var T=u.andln(3)+x&3,k=p.andln(3)+A&3;T===3&&(T=-1),k===3&&(k=-1);var $;(T&1)===0?$=0:(O=u.andln(7)+x&7,(O===3||O===5)&&k===2?$=-T:$=T),b[0].push($);var C;(k&1)===0?C=0:(O=p.andln(7)+A&7,(O===3||O===5)&&T===2?C=-k:C=k),b[1].push(C),2*x===$+1&&(x=1-x),2*A===C+1&&(A=1-A),u.iushrn(1),p.iushrn(1)}return b}o(i,"getJSF"),t.getJSF=i;function s(u,p,b){var x="_"+p;u.prototype[p]=o(function(){return this[x]!==void 0?this[x]:this[x]=b.call(this)},"cachedProperty")}o(s,"cachedProperty"),t.cachedProperty=s;function a(u){return typeof u=="string"?t.toArray(u,"hex"):u}o(a,"parseBytes"),t.parseBytes=a;function f(u){return new Qe.default(u,"hex","le")}o(f,"intFromLE"),t.intFromLE=f}),Ku=Ur.getNAF,yM=Ur.getJSF,Vu=Ur.assert;function mo(r,e){this.type=r,this.p=new Qe.default(e.p,16),this.red=e.prime?Qe.default.red(e.prime):Qe.default.mont(this.p),this.zero=new Qe.default(0).toRed(this.red),this.one=new Qe.default(1).toRed(this.red),this.two=new Qe.default(2).toRed(this.red),this.n=e.n&&new Qe.default(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(mo,"BaseCurve");var us=mo;mo.prototype.point=o(function(){throw new Error("Not implemented")},"point");mo.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");mo.prototype._fixedNafMul=o(function(e,t){Vu(e.precomputed);var n=e._getDoubles(),i=Ku(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var p=f+n.step-1;p>=f;p--)u=(u<<1)+i[p];a.push(u)}for(var b=this.jpoint(null,null,null),x=this.jpoint(null,null,null),A=s;A>0;A--){for(f=0;f<a.length;f++)u=a[f],u===A?x=x.mixedAdd(n.points[f]):u===-A&&(x=x.mixedAdd(n.points[f].neg()));b=b.add(x)}return b.toP()},"_fixedNafMul");mo.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Ku(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var p=0;u>=0&&a[u]===0;u--)p++;if(u>=0&&p++,f=f.dblp(p),u<0)break;var b=a[u];Vu(b!==0),e.type==="affine"?b>0?f=f.mixedAdd(s[b-1>>1]):f=f.mixedAdd(s[-b-1>>1].neg()):b>0?f=f.add(s[b-1>>1]):f=f.add(s[-b-1>>1].neg())}return e.type==="affine"?f.toP():f},"_wnafMul");mo.prototype._wnafMulAdd=o(function(e,t,n,i,s){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,p=0,b,x,A;for(b=0;b<i;b++){A=t[b];var O=A._getNAFPoints(e);a[b]=O.wnd,f[b]=O.points}for(b=i-1;b>=1;b-=2){var T=b-1,k=b;if(a[T]!==1||a[k]!==1){u[T]=Ku(n[T],a[T],this._bitLength),u[k]=Ku(n[k],a[k],this._bitLength),p=Math.max(u[T].length,p),p=Math.max(u[k].length,p);continue}var $=[t[T],null,null,t[k]];t[T].y.cmp(t[k].y)===0?($[1]=t[T].add(t[k]),$[2]=t[T].toJ().mixedAdd(t[k].neg())):t[T].y.cmp(t[k].y.redNeg())===0?($[1]=t[T].toJ().mixedAdd(t[k]),$[2]=t[T].add(t[k].neg())):($[1]=t[T].toJ().mixedAdd(t[k]),$[2]=t[T].toJ().mixedAdd(t[k].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],B=yM(n[T],n[k]);for(p=Math.max(B[0].length,p),u[T]=new Array(p),u[k]=new Array(p),x=0;x<p;x++){var z=B[0][x]|0,H=B[1][x]|0;u[T][x]=C[(z+1)*3+(H+1)],u[k][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),U=this._wnafT4;for(b=p;b>=0;b--){for(var L=0;b>=0;){var F=!0;for(x=0;x<i;x++)U[x]=u[x][b]|0,U[x]!==0&&(F=!1);if(!F)break;L++,b--}if(b>=0&&L++,X=X.dblp(L),b<0)break;for(x=0;x<i;x++){var ne=U[x];ne!==0&&(ne>0?A=f[x][ne-1>>1]:ne<0&&(A=f[x][-ne-1>>1].neg()),A.type==="affine"?X=X.mixedAdd(A):X=X.add(A))}}for(b=0;b<i;b++)f[b]=null;return s?X:X.toP()},"_wnafMulAdd");function ln(r,e){this.curve=r,this.type=e,this.precomputed=null}o(ln,"BasePoint");mo.BasePoint=ln;ln.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");ln.prototype.validate=o(function(){return this.curve.validate(this)},"validate");mo.prototype.decodePoint=o(function(e,t){e=Ur.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Vu(e[e.length-1]%2===0):e[0]===7&&Vu(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},"decodePoint");ln.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");ln.prototype._encode=o(function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},"_encode");ln.prototype.encode=o(function(e,t){return Ur.encode(this._encode(t),e)},"encode");ln.prototype.precompute=o(function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},"precompute");ln.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},"_hasDoubles");ln.prototype._getDoubles=o(function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<t;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");ln.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)t[s]=t[s-1].add(i);return{wnd:e,points:t}},"_getNAFPoints");ln.prototype._getBeta=o(function(){return null},"_getBeta");ln.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var F0=Aa(function(r){typeof Object.create=="function"?r.exports=o(function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):r.exports=o(function(t,n){if(n){t.super_=n;var i=o(function(){},"TempCtor");i.prototype=n.prototype,t.prototype=new i,t.prototype.constructor=t}},"inherits")}),xM=Ur.assert;function dn(r){us.call(this,"short",r),this.a=new Qe.default(r.a,16).toRed(this.red),this.b=new Qe.default(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(dn,"ShortCurve");F0(dn,us);var wM=dn;dn.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new Qe.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)n=new Qe.default(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))===0?n=s[0]:(n=s[1],xM(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(f){return{a:new Qe.default(f.a,16),b:new Qe.default(f.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}},"_getEndomorphism");dn.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:Qe.default.mont(e),n=new Qe.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new Qe.default(3).toRed(t).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},"_getEndoRoots");dn.prototype._getEndoBasis=o(function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new Qe.default(1),a=new Qe.default(0),f=new Qe.default(0),u=new Qe.default(1),p,b,x,A,O,T,k,$=0,C,B;n.cmpn(0)!==0;){var z=i.div(n);C=i.sub(z.mul(n)),B=f.sub(z.mul(s));var H=u.sub(z.mul(a));if(!x&&C.cmp(t)<0)p=k.neg(),b=s,x=C.neg(),A=B;else if(x&&++$===2)break;k=C,i=n,n=C,f=s,s=B,u=a,a=H}O=C.neg(),T=B;var X=x.sqr().add(A.sqr()),U=O.sqr().add(T.sqr());return U.cmp(X)>=0&&(O=p,T=b),x.negative&&(x=x.neg(),A=A.neg()),O.negative&&(O=O.neg(),T=T.neg()),[{a:x,b:A},{a:O,b:T}]},"_getEndoBasis");dn.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),f=s.mul(n.a),u=a.mul(i.a),p=s.mul(n.b),b=a.mul(i.b),x=e.sub(f).sub(u),A=p.add(b).neg();return{k1:x,k2:A}},"_endoSplit");dn.prototype.pointFromX=o(function(e,t){e=new Qe.default(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");dn.prototype.validate=o(function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate");dn.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var f=this._endoSplit(t[a]),u=e[a],p=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),p=p.neg(!0)),i[a*2]=u,i[a*2+1]=p,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var b=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return b},"_endoWnafMulAdd");function Gt(r,e,t,n){us.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Qe.default(e,16),this.y=new Qe.default(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}o(Gt,"Point");F0(Gt,us.BasePoint);dn.prototype.point=o(function(e,t,n){return new Gt(this,e,t,n)},"point");dn.prototype.pointFromJSON=o(function(e,t){return Gt.fromJSON(this,e,t)},"pointFromJSON");Gt.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},"_getBeta");Gt.prototype.toJSON=o(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON");Gt.fromJSON=o(function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],n);if(!t[2])return i;function s(f){return e.point(f[0],f[1],n)}o(s,"obj2point");var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},"fromJSON");Gt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect");Gt.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Gt.prototype.add=o(function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");Gt.prototype.dbl=o(function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},"dbl");Gt.prototype.getX=o(function(){return this.x.fromRed()},"getX");Gt.prototype.getY=o(function(){return this.y.fromRed()},"getY");Gt.prototype.mul=o(function(e){return e=new Qe.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},"mul");Gt.prototype.mulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},"mulAdd");Gt.prototype.jmulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},"jmulAdd");Gt.prototype.eq=o(function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},"eq");Gt.prototype.neg=o(function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(s){return s.neg()},"negate");t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},"neg");Gt.prototype.toJ=o(function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},"toJ");function rr(r,e,t,n){us.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Qe.default(0)):(this.x=new Qe.default(e,16),this.y=new Qe.default(t,16),this.z=new Qe.default(n,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}o(rr,"JPoint");F0(rr,us.BasePoint);dn.prototype.jpoint=o(function(e,t,n){return new rr(this,e,t,n)},"jpoint");rr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},"toP");rr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");rr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),p=a.redSub(f);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=u.redSqr(),x=b.redMul(u),A=i.redMul(b),O=p.redSqr().redIAdd(x).redISub(A).redISub(A),T=p.redMul(A.redISub(O)).redISub(a.redMul(x)),k=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(O,T,k)},"add");rr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),s=this.y,a=e.y.redMul(t).redMul(this.z),f=n.redSub(i),u=s.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=f.redSqr(),b=p.redMul(f),x=n.redMul(p),A=u.redSqr().redIAdd(b).redISub(x).redISub(x),O=u.redMul(x.redISub(A)).redISub(s.redMul(b)),T=this.z.redMul(f);return this.curve.jpoint(A,O,T)},"mixedAdd");rr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,u=this.z,p=u.redSqr().redSqr(),b=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),A=b.redSqr(),O=A.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(p)),k=a.redMul(A),$=T.redSqr().redISub(k.redAdd(k)),C=k.redISub($),B=T.redMul(C);B=B.redIAdd(B).redISub(O);var z=b.redMul(u);t+1<e&&(p=p.redMul(O)),a=$,u=z,b=B}return this.curve.jpoint(a,b.redMul(s),u)},"dblp");rr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");rr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),p=u.redSqr().redISub(f).redISub(f),b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),e=p,t=u.redMul(f.redISub(p)).redISub(b),n=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),A=this.y.redSqr(),O=A.redSqr(),T=this.x.redAdd(A).redSqr().redISub(x).redISub(O);T=T.redIAdd(T);var k=x.redAdd(x).redIAdd(x),$=k.redSqr(),C=O.redIAdd(O);C=C.redIAdd(C),C=C.redIAdd(C),e=$.redISub(T).redISub(T),t=k.redMul(T.redISub(e)).redISub(C),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");rr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),p=u.redSqr().redISub(f).redISub(f);e=p;var b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),t=u.redMul(f.redISub(p)).redISub(b),n=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),A=this.y.redSqr(),O=this.x.redMul(A),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var k=O.redIAdd(O);k=k.redIAdd(k);var $=k.redAdd(k);e=T.redSqr().redISub($),n=this.y.redAdd(this.z).redSqr().redISub(A).redISub(x);var C=A.redSqr();C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C),t=T.redMul(k.redISub(e)).redISub(C)}return this.curve.jpoint(e,t,n)},"_threeDbl");rr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=t.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),p=t.redAdd(t);p=p.redIAdd(p);var b=p.redMul(f),x=u.redSqr().redISub(b.redAdd(b)),A=b.redISub(x),O=f.redSqr();O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=u.redMul(A).redISub(O),k=n.redAdd(n).redMul(i);return this.curve.jpoint(x,T,k)},"_dbl");rr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),i=t.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),f=this.x.redAdd(t).redSqr().redISub(e).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),p=i.redIAdd(i);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var b=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(p),x=t.redMul(b);x=x.redIAdd(x),x=x.redIAdd(x);var A=this.x.redMul(u).redISub(x);A=A.redIAdd(A),A=A.redIAdd(A);var O=this.y.redMul(b.redMul(p.redISub(b)).redISub(f.redMul(u)));O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(A,O,T)},"trpl");rr.prototype.mul=o(function(e,t){return e=new Qe.default(e,t),this.curve._wnafMul(this,e)},"mul");rr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");rr.prototype.eqXToP=o(function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP");rr.prototype.inspect=o(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect");rr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var zu=Aa(function(r,e){"use strict";var t=e;t.base=us,t.short=wM,t.mont=null,t.edwards=null}),ju=Aa(function(r,e){"use strict";var t=e,n=Ur.assert;function i(f){f.type==="short"?this.curve=new zu.short(f):f.type==="edwards"?this.curve=new zu.edwards(f):this.curve=new zu.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(i,"PresetCurve"),t.PresetCurve=i;function s(f,u){Object.defineProperty(t,f,{configurable:!0,enumerable:!0,get:function(){var p=new i(u);return Object.defineProperty(t,f,{configurable:!0,enumerable:!0,value:p}),p}})}o(s,"defineCurve"),s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:oi.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:oi.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:oi.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:oi.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:oi.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oi.default.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oi.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch(f){a=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:oi.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function po(r){if(!(this instanceof po))return new po(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Dn.toArray(r.entropy,r.entropyEnc||"hex"),t=Dn.toArray(r.nonce,r.nonceEnc||"hex"),n=Dn.toArray(r.pers,r.persEnc||"hex");U0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(po,"HmacDRBG");var By=po;po.prototype._init=o(function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");po.prototype._hmac=o(function(){return new oi.default.hmac(this.hash,this.K)},"hmac");po.prototype._update=o(function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},"update");po.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Dn.toArray(e,t),n=Dn.toArray(n,i),U0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");po.prototype.generate=o(function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=n,n=t,t=null),n&&(n=Dn.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(n),this._reseed++,Dn.encode(a,t)},"generate");var B0=Ur.assert;function lr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(lr,"KeyPair");var $0=lr;lr.fromPublic=o(function(e,t,n){return t instanceof lr?t:new lr(e,{pub:t,pubEnc:n})},"fromPublic");lr.fromPrivate=o(function(e,t,n){return t instanceof lr?t:new lr(e,{priv:t,privEnc:n})},"fromPrivate");lr.prototype.validate=o(function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate");lr.prototype.getPublic=o(function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},"getPublic");lr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");lr.prototype._importPrivate=o(function(e,t){this.priv=new Qe.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");lr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?B0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&B0(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},"_importPublic");lr.prototype.derive=o(function(e){return e.validate()||B0(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");lr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");lr.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");lr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var _M=Ur.assert;function Wu(r,e){if(r instanceof Wu)return r;this._importDER(r,e)||(_M(r.r&&r.s,"Signature without r or s"),this.r=new Qe.default(r.r,16),this.s=new Qe.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(Wu,"Signature");var Gu=Wu;function EM(){this.place=0}o(EM,"Position");function R0(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=r[a],i>>>=0;return i<=127?!1:(e.place=a,i)}o(R0,"getLength");function Ry(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}o(Ry,"rmPadding");Wu.prototype._importDER=o(function(e,t){e=Ur.toArray(e,t);var n=new EM;if(e[n.place++]!==48)return!1;var i=R0(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=R0(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var f=R0(e,n);if(f===!1||e.length!==f+n.place)return!1;var u=e.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new Qe.default(a),this.s=new Qe.default(u),this.recoveryParam=null,!0},"_importDER");function L0(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}o(L0,"constructLength");Wu.prototype.toDER=o(function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=Ry(t),n=Ry(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];L0(i,t.length),i=i.concat(t),i.push(2),L0(i,n.length);var s=i.concat(n),a=[48];return L0(a,s.length),a=a.concat(s),Ur.encode(a,e)},"toDER");var SM=o(function(){throw new Error("unsupported")},"rand"),Uy=Ur.assert;function un(r){if(!(this instanceof un))return new un(r);typeof r=="string"&&(Uy(Object.prototype.hasOwnProperty.call(ju,r),"Unknown curve "+r),r=ju[r]),r instanceof ju.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}o(un,"EC");var MM=un;un.prototype.keyPair=o(function(e){return new $0(this,e)},"keyPair");un.prototype.keyFromPrivate=o(function(e,t){return $0.fromPrivate(this,e,t)},"keyFromPrivate");un.prototype.keyFromPublic=o(function(e,t){return $0.fromPublic(this,e,t)},"keyFromPublic");un.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new By({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||SM(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Qe.default(2));;){var s=new Qe.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");un.prototype._truncateToN=o(function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");un.prototype.sign=o(function(e,t,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Qe.default(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),f=e.toArray("be",s),u=new By({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new Qe.default(1)),b=0;;b++){var x=i.k?i.k(b):new Qe.default(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(p)>=0)){var A=this.g.mul(x);if(!A.isInfinity()){var O=A.getX(),T=O.umod(this.n);if(T.cmpn(0)!==0){var k=x.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(k=k.umod(this.n),k.cmpn(0)!==0){var $=(A.getY().isOdd()?1:0)|(O.cmp(T)!==0?2:0);return i.canonical&&k.cmp(this.nh)>0&&(k=this.n.sub(k),$^=1),new Gu({r:T,s:k,recoveryParam:$})}}}}}},"sign");un.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Qe.default(e,16)),n=this.keyFromPublic(n,i),t=new Gu(t,"hex");var s=t.r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(e).umod(this.n),p=f.mul(s).umod(this.n),b;return this.curve._maxwellTrick?(b=this.g.jmulAdd(u,n.getPublic(),p),b.isInfinity()?!1:b.eqXToP(s)):(b=this.g.mulAdd(u,n.getPublic(),p),b.isInfinity()?!1:b.getX().umod(this.n).cmp(s)===0)},"verify");un.prototype.recoverPubKey=function(r,e,t,n){Uy((3&t)===t,"The recovery param is more than two bits"),e=new Gu(e,n);var i=this.n,s=new Qe.default(r),a=e.r,f=e.s,u=t&1,p=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var b=e.r.invm(i),x=i.sub(s).mul(b).umod(i),A=f.mul(b).umod(i);return this.g.mulAdd(x,a,A)};un.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new Gu(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(a){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var AM=Aa(function(r,e){"use strict";var t=e;t.version="6.5.4",t.utils=Ur,t.rand=function(){throw new Error("unsupported")},t.curve=zu,t.curves=ju,t.ec=MM,t.eddsa=null}),Fy=AM.ec;var $y="signing-key/5.6.2";var H0=new tt($y),q0=null;function si(){return q0||(q0=new Fy("secp256k1")),q0}o(si,"getCurve");var Yu=class{constructor(e){Ma(this,"curve","secp256k1"),Ma(this,"privateKey",ur(e)),$u(this.privateKey)!==32&&H0.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=si().keyFromPrivate(Tt(this.privateKey));Ma(this,"publicKey","0x"+t.getPublic(!1,"hex")),Ma(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Ma(this,"_isSigningKey",!0)}_addPoint(e){let t=si().keyFromPublic(Tt(this.publicKey)),n=si().keyFromPublic(Tt(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=si().keyFromPrivate(Tt(this.privateKey)),n=Tt(e);n.length!==32&&H0.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return Hu({recoveryParam:i.recoveryParam,r:ho("0x"+i.r.toString(16),32),s:ho("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=si().keyFromPrivate(Tt(this.privateKey)),n=si().keyFromPublic(Tt(z0(e)));return ho("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(Yu,"SigningKey");function qy(r,e){let t=Hu(e),n={r:Tt(t.r),s:Tt(t.s)};return"0x"+si().recoverPubKey(Tt(r),n,t.recoveryParam).encode("hex",!1)}o(qy,"recoverPublicKey");function z0(r,e){let t=Tt(r);if(t.length===32){let n=new Yu(t);return e?"0x"+si().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?ur(t):"0x"+si().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+si().keyFromPublic(t).getPublic(!0,"hex"):ur(t)}return H0.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(z0,"computePublicKey");var Hy="transactions/5.6.2";var QB=new tt(Hy),zy;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(zy||(zy={}));function jy(r){let e=z0(r);return Cy(qu(Sa(qu(e,1)),12))}o(jy,"computeAddress");function Ky(r,e){return jy(qy(Tt(r),e))}o(Ky,"recoverAddress");var Vy="wallet/5.6.2";var fU=new tt(Vy);function Wy(r,e){return Ky(N0(r),e)}o(Wy,"verifyMessage");ff();var TM=`
632
+ `+String(n)));Kp(e);for(var i=0;i<e.callbacks.length;i++){var s=n[i];s instanceof Error?e.callbacks[i].reject(s):e.callbacks[i].resolve(s)}}).catch(function(n){xw(r,e,n)})}o(wC,"dispatchBatch");function xw(r,e,t){Kp(e);for(var n=0;n<e.keys.length;n++)r.clear(e.keys[n]),e.callbacks[n].reject(t)}o(xw,"failedDispatch");function Kp(r){if(r.cacheHits)for(var e=0;e<r.cacheHits.length;e++)r.cacheHits[e]()}o(Kp,"resolveCacheHits");function _C(r){var e=!r||r.batch!==!1;if(!e)return 1;var t=r&&r.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}o(_C,"getValidMaxBatchSize");function EC(r){var e=r&&r.batchScheduleFn;if(e===void 0)return yC;if(typeof e!="function")throw new TypeError("batchScheduleFn must be a function: "+e);return e}o(EC,"getValidBatchScheduleFn");function SC(r){var e=r&&r.cacheKeyFn;if(e===void 0)return function(t){return t};if(typeof e!="function")throw new TypeError("cacheKeyFn must be a function: "+e);return e}o(SC,"getValidCacheKeyFn");function MC(r){var e=!r||r.cache!==!1;if(!e)return null;var t=r&&r.cacheMap;if(t===void 0)return new Map;if(t!==null){var n=["get","set","delete","clear"],i=n.filter(function(s){return t&&typeof t[s]!="function"});if(i.length!==0)throw new TypeError("Custom cacheMap missing methods: "+i.join(", "))}return t}o(MC,"getValidCacheMap");function ww(r){return typeof r=="object"&&r!==null&&typeof r.length=="number"&&(r.length===0||r.length>0&&Object.prototype.hasOwnProperty.call(r,r.length-1))}o(ww,"isArrayLike");_w.exports=vC});var Bw=me((_K,Lw)=>{Lw.exports=Rw;var Nw=128,KC=127,VC=~KC,WC=Math.pow(2,31);function Rw(r,e,t){e=e||[],t=t||0;for(var n=t;r>=WC;)e[t++]=r&255|Nw,r/=128;for(;r&VC;)e[t++]=r&255|Nw,r>>>=7;return e[t]=r|0,Rw.bytes=t-n+1,e}o(Rw,"encode")});var $w=me((EK,Fw)=>{Fw.exports=nm;var GC=128,Uw=127;function nm(r,n){var t=0,n=n||0,i=0,s=n,a,f=r.length;do{if(s>=f)throw nm.bytes=0,new RangeError("Could not decode varint");a=r[s++],t+=i<28?(a&Uw)<<i:(a&Uw)*Math.pow(2,i),i+=7}while(a>=GC);return nm.bytes=s-n,t}o(nm,"read")});var Hw=me((SK,qw)=>{var YC=Math.pow(2,7),JC=Math.pow(2,14),XC=Math.pow(2,21),ZC=Math.pow(2,28),QC=Math.pow(2,35),eD=Math.pow(2,42),tD=Math.pow(2,49),rD=Math.pow(2,56),nD=Math.pow(2,63);qw.exports=function(r){return r<YC?1:r<JC?2:r<XC?3:r<ZC?4:r<QC?5:r<eD?6:r<tD?7:r<rD?8:r<nD?9:10}});var jw=me((MK,zw)=>{zw.exports={encode:Bw(),decode:$w(),encodingLength:Hw()}});var Vw=me((AK,Kw)=>{"use strict";var iD=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});Kw.exports={names:iD}});var Qw=me((TK,Zw)=>{"use strict";var Ww=V0(),Ga=jw(),{names:mc}=Vw(),{toString:Ql}=(uf(),tf(l1)),{fromString:oD}=(Hc(),tf(u1)),{concat:sD}=(gd(),tf(Bm)),Ya={};for(let r in mc){let e=r;Ya[mc[e]]=e}Object.freeze(Ya);function aD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return Ql(r,"base16")}o(aD,"toHexString");function fD(r){return oD(r,"base16")}o(fD,"fromHexString");function cD(r){if(!(r instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return Ql(Ww.encode("base58btc",r)).slice(1)}o(cD,"toB58String");function uD(r){let e=r instanceof Uint8Array?Ql(r):r;return Ww.decode("z"+e)}o(uD,"fromB58String");function Gw(r){if(!(r instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(r.length<2)throw new Error("multihash too short. must be > 2 bytes.");let e=Ga.decode(r);if(!Jw(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);r=r.slice(Ga.decode.bytes);let t=Ga.decode(r);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(r=r.slice(Ga.decode.bytes),r.length!==t)throw new Error(`multihash length inconsistent: 0x${Ql(r,"base16")}`);return{code:e,name:Ya[e],length:t,digest:r}}o(Gw,"decode");function lD(r,e,t){if(!r||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=Yw(e);if(!(r instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(t==null&&(t=r.length),t&&r.length!==t)throw new Error("digest length should be equal to specified length.");let i=Ga.encode(n),s=Ga.encode(t);return sD([i,s,r],i.length+s.length+r.length)}o(lD,"encode");function Yw(r){let e=r;if(typeof r=="string"){if(mc[r]===void 0)throw new Error(`Unrecognized hash function named: ${r}`);e=mc[r]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Ya[e]===void 0&&!im(e))throw new Error(`Unrecognized function code: ${e}`);return e}o(Yw,"coerceCode");function im(r){return r>0&&r<16}o(im,"isAppCode");function Jw(r){return!!(im(r)||Ya[r])}o(Jw,"isValidCode");function Xw(r){Gw(r)}o(Xw,"validate");function dD(r){return Xw(r),r.subarray(0,2)}o(dD,"prefix");Zw.exports={names:mc,codes:Ya,toHexString:aD,fromHexString:fD,toB58String:cD,fromB58String:uD,decode:Gw,encode:lD,coerceCode:Yw,isAppCode:im,validate:Xw,prefix:dD,isValidCode:Jw}});var O4=me((GV,RD)=>{RD.exports=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}]});var jO={};St(jO,{emptyWallet:()=>HO,walletFromKey:()=>zO});module.exports=tf(jO);var yY=require("isomorphic-fetch"),xY=require("abort-controller/polyfill");var Nm=at(require("isomorphic-webcrypto"));typeof window=="undefined"&&(globalThis.crypto=Nm.default);var m5=o((r,e)=>Z(void 0,null,function*(){return js(r.contents,{plugins:[...r.plugins,e]})}),"addPluginToWallet"),b5=o((r,e)=>Z(void 0,null,function*(){return js([...r.contents,e],r)}),"addToWallet"),g5=o((r,e)=>Z(void 0,null,function*(){let t=JSON.parse(JSON.stringify(r.contents)),n=t.find(i=>i.id===e);return js(t.filter(i=>i.id!==n.id),r)}),"removeFromWallet"),v5=o((r,e)=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,n.bind(r,r)])),"bindMethods"),js=o((...t)=>Z(void 0,[...t],function*(r=[],e={}){let{plugins:n=[]}=e,i=n.reduce((a,f)=>re(re({},a),f.pluginMethods),{}),s={contents:[...r],add:function(a){return b5(this,a)},remove:function(a){return g5(this,a)},plugins:n,pluginMethods:i,addPlugin:function(a){return m5(this,a)}};return i&&(s.pluginMethods=v5(s,i)),s}),"generateWallet");function y5(r,e){try{var t=r()}catch(n){return e(n)}return t&&t.then?t.then(void 0,e):t}o(y5,"_catch");function x5(){let r=new Map;return function(e,t){try{let i=function(a){if(n)return a;let f=r.get(e.didUrl);return f!==void 0?f:Promise.resolve(t()).then(function(u){var p;return((p=u.didResolutionMetadata)==null?void 0:p.error)!=="notFound"&&r.set(e.didUrl,u),u})};o(i,"_temp2");let n,s=function(){if(e.params&&e.params["no-cache"]==="true")return Promise.resolve(t()).then(function(a){return n=1,a})}();return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(n){return Promise.reject(n)}}}o(x5,"inMemoryCache");function w5(r,e){return e()}o(w5,"noCache");var _5="(?:%[0-9a-fA-F]{2})",Rm=`(?:[a-zA-Z0-9._-]|${_5})`,E5="([a-z0-9]+)",S5=`((?:${Rm}*:)*(${Rm}+))`,Lm="[a-zA-Z0-9_.:%-]",M5=`;${Lm}+=${Lm}*`,A5=`((${M5})*)`,T5="(/[^#?]*)?",k5="([?][^#]*)?",C5="(#.*)?",D5=new RegExp(`^did:${E5}:${S5}${A5}${T5}${k5}${C5}$`);function bd(r){if(r===""||!r)return null;let e=r.match(D5);if(e){let t={did:`did:${e[1]}:${e[2]}`,method:e[1],id:e[2],didUrl:r};if(e[4]){let n=e[4].slice(1).split(";");t.params={};for(let i of n){let s=i.split("=");t.params[s[0]]=s[1]}}return e[6]&&(t.path=e[6]),e[7]&&(t.query=e[7].slice(1)),e[8]&&(t.fragment=e[8].slice(1)),t}return null}o(bd,"parse");var kc={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function I5(r){return function(e,t,n){try{return Promise.resolve(y5(function(){return Promise.resolve(r(e,t,n)).then(function(i){return Te(re({},kc),{didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:i})})},function(i){return Te(re({},kc),{didResolutionMetadata:{error:"notFound",message:i.toString()}})}))}catch(i){return Promise.reject(i)}}}o(I5,"wrapLegacyResolver");var rf=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?x5():t.cache||w5,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(n=>{this.registry[n]||(this.registry[n]=I5(t.legacyResolvers[n]))})}resolve(e,t={}){try{let n=this,i=bd(e);if(i===null)return Promise.resolve(Te(re({},kc),{didResolutionMetadata:{error:"invalidDid"}}));let s=n.registry[i.method];return s?Promise.resolve(n.cache(i,()=>s(i.did,i,n,t))):Promise.resolve(Te(re({},kc),{didResolutionMetadata:{error:"unsupportedDidMethod"}}))}catch(n){return Promise.reject(n)}}};o(rf,"Resolver");gd();Hc();uf();$c();var Vh=at(y1()),zg=at(Xd()),Wh=at(Vb()),gu=at(uu()),jg=at(gg()),Mf=at(wg()),Gh=at(Rg()),Yh=at(ro());function sn(r){return It(r,"base64url")}o(sn,"bytesToBase64url");function Ar(r){let e=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Lt(e,"base64url")}o(Ar,"base64ToBytes");function Jh(r){return Lt(r,"base58btc")}o(Jh,"base58ToBytes");function zh(r){let e=r.startsWith("0x")?r.substring(2):r;return Lt(e.toLowerCase(),"base16")}o(zh,"hexToBytes");function jh(r){return sn(Lt(r))}o(jh,"encodeBase64url");function Kg(r){return It(Ar(r))}o(Kg,"decodeBase64url");function es(r){return It(r,"base16")}o(es,"bytesToHex");function Vg(r){return Lt(r)}o(Vg,"stringToBytes");function vE({r,s:e,recoveryParam:t},n){let i=new Uint8Array(n?65:64);if(i.set(Lt(r,"base16"),0),i.set(Lt(e,"base16"),32),n){if(typeof t=="undefined")throw new Error("Signer did not return a recoveryParam");i[64]=t}return sn(i)}o(vE,"toJose");function yE(r){let e=Ar(r);if(e.length<64||e.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${e.length}`);let t=es(e.slice(0,32)),n=es(e.slice(32,64)),i=e.length===65?e[64]:void 0;return{r:t,s:n,recoveryParam:i}}o(yE,"fromJose");function Wg(r,e){return vn([Ar(r),Ar(e)])}o(Wg,"toSealed");var xE=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,wE=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,_E=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function EE(r){if(typeof r=="string"){if(xE.test(r))return zh(r);if(wE.test(r))return Jh(r);if(_E.test(r))return Ar(r);throw TypeError("bad_key: Invalid private key format")}else{if(r instanceof Uint8Array)return r;throw TypeError("bad_key: Invalid private key format")}}o(EE,"parseKey");function Gg(r){let e=typeof r=="string"?Lt(r):r;return(0,Vh.hash)(e)}o(Gg,"sha256");function SE(r){return new Uint8Array(zg.keccak_256.arrayBuffer(r))}o(SE,"keccak");function ME(r){let e=Lt(r.slice(2),"base16");return`0x${It(SE(e).slice(-20),"base16")}`}o(ME,"toEthereumAddress");function Kh(r,e=new Uint8Array(4)){let t=Lt(r.toString(),"base10");return e.set(t,4-t.length),e}o(Kh,"writeUint32BE");var Hh=o(r=>vn([Kh(r.length),r]),"lengthAndInput");function Yg(r,e,t,n,i){if(e!==256)throw new Error(`Unsupported key length: ${e}`);let s=vn([Hh(Lt(t)),Hh(typeof n=="undefined"?new Uint8Array(0):n),Hh(typeof i=="undefined"?new Uint8Array(0):i),Kh(e)]);return(0,Vh.hash)(vn([Kh(1),r,s]))}o(Yg,"concatKDF");var JN=new Wh.ec("secp256k1");function Jg(r){let e=EE(r);if(e.length!==64)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${e.length}`);return function(t){try{let n=typeof t=="string"?Vg(t):t,i=(0,gu.sign)(e,n);return Promise.resolve(sn(i))}catch(n){return Promise.reject(n)}}}o(Jg,"EdDSASigner");function Xg(r){return typeof r=="object"&&"r"in r&&"s"in r}o(Xg,"instanceOfEcdsaSignature");function Lg(r){return o(function(t,n){try{return Promise.resolve(n(t)).then(function(i){if(Xg(i))return vE(i,r);if(r&&typeof yE(i).recoveryParam=="undefined")throw new Error("not_supported: ES256K-R not supported when signer doesn't provide a recovery param");return i})}catch(i){return Promise.reject(i)}},"sign")}o(Lg,"ES256KSignerAlg");function Bg(){return o(function(e,t){try{return Promise.resolve(t(e)).then(function(n){if(Xg(n))throw new Error("invalid_config: expected a signer function that returns a string instead of signature object");return n})}catch(n){return Promise.reject(n)}},"sign")}o(Bg,"Ed25519SignerAlg");var AE={ES256K:Lg(),"ES256K-R":Lg(!0),Ed25519:Bg(),EdDSA:Bg()};function TE(r){let e=AE[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(TE,"SignerAlg");var Xh=new Wh.ec("secp256k1");function bu(r,e=!1){let t=Ar(r);if(t.length!==(e?65:64))throw new Error("wrong signature length");let n=es(t.slice(0,32)),i=es(t.slice(32,64)),s={r:n,s:i};return e&&(s.recoveryParam=t[64]),s}o(bu,"toSignatureObject");function Zh(r){if(r.publicKeyBase58)return Jh(r.publicKeyBase58);if(r.publicKeyBase64)return Ar(r.publicKeyBase64);if(r.publicKeyHex)return zh(r.publicKeyHex);if(r.publicKeyJwk&&r.publicKeyJwk.crv==="secp256k1"&&r.publicKeyJwk.x&&r.publicKeyJwk.y)return zh(Xh.keyFromPublic({x:es(Ar(r.publicKeyJwk.x)),y:es(Ar(r.publicKeyJwk.y))}).getPublic("hex"));if(r.publicKeyMultibase){let{base16:e,base58btc:t,base64:n,base64url:i}=Ys;return e.decoder.or(t.decoder.or(n.decoder.or(i.decoder))).decode(r.publicKeyMultibase)}return new Uint8Array}o(Zh,"extractPublicKeyBytes");function kE(r,e,t){let n=Gg(r),i=bu(e),s=t.filter(({ethereumAddress:u,blockchainAccountId:p})=>typeof u=="undefined"&&typeof p=="undefined"),a=t.filter(({ethereumAddress:u,blockchainAccountId:p})=>typeof u!="undefined"||typeof p!==void 0),f=s.find(u=>{try{let p=Zh(u);return Xh.keyFromPublic(p).verify(n,i)}catch(p){return!1}});if(!f&&a.length>0&&(f=Zg(r,e,a)),!f)throw new Error("invalid_signature: Signature invalid for JWT");return f}o(kE,"verifyES256K");function Zg(r,e,t){let n;if(e.length>86)n=[bu(e,!0)];else{let a=bu(e,!1);n=[Te(re({},a),{recoveryParam:0}),Te(re({},a),{recoveryParam:1})]}let i=o(a=>{let f=Gg(r),u=Xh.recoverPubKey(f,a,a.recoveryParam),p=u.encode("hex"),b=u.encode("hex",!0),x=ME(p);return t.find(O=>{var T,k,$;let C=es(Zh(O));return C===p||C===b||((T=O.ethereumAddress)==null?void 0:T.toLowerCase())===x||((k=O.blockchainAccountId)==null||($=k.split("@eip155"))==null?void 0:$[0].toLowerCase())===x})},"checkSignatureAgainstSigner"),s=n.map(i).filter(a=>typeof a!="undefined");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}o(Zg,"verifyRecoverableES256K");function Ug(r,e,t){let n=Vg(r),i=Ar(e),s=t.find(a=>(0,gu.verify)(Zh(a),n,i));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}o(Ug,"verifyEd25519");var CE={ES256K:kE,"ES256K-R":Zg,Ed25519:Ug,EdDSA:Ug};function Qg(r){let e=CE[r];if(!e)throw new Error(`not_supported: Unsupported algorithm ${r}`);return e}o(Qg,"VerifierAlgorithm");Qg.toSignatureObject=bu;var ev=o(function(r,e,t={},n={}){try{t.alg||(t.alg=DE);let i=typeof r=="string"?r:Fg(r,n.canonicalize),s=[Fg(t,n.canonicalize),i].join("."),a=TE(t.alg);return Promise.resolve(a(s,e)).then(function(f){return[s,f].join(".")})}catch(i){return Promise.reject(i)}},"createJWS");var DE="ES256K";function Fg(r,e=!1){return jh(e?(0,jg.default)(r):JSON.stringify(r))}o(Fg,"encodeSection");function IE(r){let e=r.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(Kg(e[1])),payload:e[2],signature:e[3],data:`${e[1]}.${e[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}o(IE,"decodeJWS");function OE({header:r,data:e,signature:t},n){return Array.isArray(n)||(n=[n]),Qg(r.alg)(e,t,n)}o(OE,"verifyJWSDecoded");function tv(r,e){let t=IE(r);return OE(t,e)}o(tv,"verifyJWS");function PE(r,e,t){for(var n;;){var i=r();if(oo(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var s=t();if(s&&s.then)if(oo(s))s=s.s;else{n=1;break}if(e){var a=e();if(a&&a.then&&!oo(a)){n=2;break}}}var f=new ts,u=qt.bind(null,f,2);return(n===0?i.then(b):n===1?s.then(p):a.then(x)).then(void 0,u),f;function p(A){s=A;do{if(e&&(a=e(),a&&a.then&&!oo(a))){a.then(x).then(void 0,u);return}if(i=r(),!i||oo(i)&&!i.v){qt(f,1,s);return}if(i.then){i.then(b).then(void 0,u);return}s=t(),oo(s)&&(s=s.v)}while(!s||!s.then);s.then(p).then(void 0,u)}o(p,"_resumeAfterBody");function b(A){A?(s=t(),s&&s.then?s.then(p).then(void 0,u):p(s)):qt(f,1,s)}o(b,"_resumeAfterTest");function x(){(i=r())?i.then?i.then(b).then(void 0,u):b(i):qt(f,1,s)}o(x,"_resumeAfterUpdate")}o(PE,"_for");var rv=o(function(r,e){try{let n=function(p){if(f===null)throw new Error("failure: Failed to decrypt");return f};o(n,"_temp5");let t;LE(r);let i=JSON.parse(Kg(r.protected));if(i.enc!==e.enc)throw new Error(`not_supported: Decrypter does not supported: '${i.enc}'`);let s=Wg(r.ciphertext,r.tag),a=new Uint8Array(Buffer.from(r.aad?`${r.protected}.${r.aad}`:r.protected)),f=null,u=function(){return i.alg==="dir"&&e.alg==="dir"?Promise.resolve(e.decrypt(s,Ar(r.iv),a)).then(function(p){f=p}):function(){if(!r.recipients||r.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let p=0;return PE(function(){return!f&&p<r.recipients.length},function(){return p++},function(){let b=r.recipients[p];Object.assign(b.header,i);let x=function(){if(b.header.alg===e.alg)return Promise.resolve(e.decrypt(s,Ar(r.iv),a,b)).then(function(A){f=A})}();if(x&&x.then)return x.then(function(){})})}}()}();return Promise.resolve(u&&u.then?u.then(n):n(u))}catch(t){return Promise.reject(t)}},"decryptJWE"),$g=typeof Symbol!="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function qt(r,e,t){if(!r.s){if(t instanceof ts)if(t.s)e&1&&(e=t.s),t=t.v;else{t.o=qt.bind(null,r,e);return}if(t&&t.then){t.then(qt.bind(null,r,e),qt.bind(null,r,2));return}r.s=e,r.v=t;let n=r.o;n&&n(r)}}o(qt,"_settle");var ts=function(){function r(){}return o(r,"_Pact"),r.prototype.then=function(e,t){let n=new r,i=this.s;if(i){let s=i&1?e:t;if(s){try{qt(n,1,s(this.v))}catch(a){qt(n,2,a)}return n}else return this}return this.o=function(s){try{let a=s.v;s.s&1?qt(n,1,e?e(a):a):t?qt(n,1,t(a)):qt(n,2,a)}catch(a){qt(n,2,a)}},n},r}();function oo(r){return r instanceof ts&&r.s&1}o(oo,"_isSettledPact");function NE(r,e,t){var n=-1,i,s;function a(f){try{for(;++n<r.length&&(!t||!t());)if(f=e(n),f&&f.then)if(oo(f))f=f.v;else{f.then(a,s||(s=qt.bind(null,i=new ts,2)));return}i?qt(i,1,f):i=f}catch(u){qt(i||(i=new ts),2,u)}}return o(a,"_cycle"),a(),i}o(NE,"_forTo");function RE(r,e,t){if(typeof r[$g]=="function"){let b=function(x){try{for(;!(i=n.next()).done&&(!t||!t());)if(x=e(i.value),x&&x.then)if(oo(x))x=x.v;else{x.then(b,a||(a=qt.bind(null,s=new ts,2)));return}s?qt(s,1,x):s=x}catch(A){qt(s||(s=new ts),2,A)}};o(b,"_cycle");var n=r[$g](),i,s,a;if(b(),n.return){var f=o(function(x){try{i.done||n.return()}catch(A){}return x},"_fixup");if(s&&s.then)return s.then(f,function(x){throw f(x)});f()}return s}if(!("length"in r))throw new TypeError("Object is not iterable");for(var u=[],p=0;p<r.length;p++)u.push(r[p]);return NE(u,function(b){return e(u[b])},t)}o(RE,"_forOf");function LE(r){if(!(r.protected&&r.iv&&r.ciphertext&&r.tag))throw new Error("bad_jwe: missing properties");r.recipients&&r.recipients.map(e=>{if(!(e.header&&e.encrypted_key))throw new Error("bad_jwe: malformed recipients")})}o(LE,"validateJWE");function qg({ciphertext:r,tag:e,iv:t,protectedHeader:n,recipient:i},s){let a={protected:n,iv:sn(t),ciphertext:sn(r),tag:sn(e)};return s&&(a.aad=sn(s)),i&&(a.recipients=[i]),a}o(qg,"encodeJWE");var nv=o(function(r,e,t={},n){try{if(e[0].alg==="dir"){if(e.length>1)throw new Error('not_supported: Can only do "dir" encryption to one key.');return Promise.resolve(e[0].encrypt(r,t,n)).then(function(i){return qg(i,n)})}else{let i=e[0].enc;if(!e.reduce((u,p)=>u&&p.enc===i,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,a,f=RE(e,function(u){let p=function(){return s?Promise.resolve(u.encryptCek==null?void 0:u.encryptCek(s)).then(function(b){if(b){var x,A;(x=a)==null||(A=x.recipients)==null||A.push(b)}}):Promise.resolve(u.encrypt(r,t,n)).then(function(b){s=b.cek,a=qg(b,n)})}();if(p&&p.then)return p.then(function(){})});return Promise.resolve(f&&f.then?f.then(function(){return a}):a)}}catch(i){return Promise.reject(i)}},"createJWE");var iv=o(function(r,e){try{let t=o(function(i){try{return Promise.resolve(e.resolve(i)).then(function({didResolutionMetadata:s,didDocument:a}){var f;if(s!=null&&s.error||a==null)throw new Error(`resolver_error: Could not resolve ${i}: ${s.error}, ${s.message}`);if(!a.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);let p=((f=a.keyAgreement)==null?void 0:f.map(b=>typeof b=="string"?[...a.publicKey||[],...a.verificationMethod||[]].find(x=>x.id===b):b).filter(b=>typeof b!="undefined")).filter(b=>b.type==="X25519KeyAgreementKey2019"&&Boolean(b.publicKeyBase58));if(!p.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${i}`);return p.map(b=>UE(Jh(b.publicKeyBase58),b.id))})}catch(s){return Promise.reject(s)}},"encryptersForDID"),n=r.map(i=>t(i));return Promise.resolve(Promise.all(n)).then(function(i){return[].concat(...i)})}catch(t){return Promise.reject(t)}},"resolveX25519Encrypters");function ov(r){let e=new Gh.XChaCha20Poly1305(r);return(t,n)=>{let i=(0,Yh.randomBytes)(e.nonceLength),s=e.seal(i,t,n);return{ciphertext:s.subarray(0,s.length-e.tagLength),tag:s.subarray(s.length-e.tagLength),iv:i}}}o(ov,"xc20pEncrypter");function BE(r){let e=o(function(s,a={},f){try{let u=jh(JSON.stringify(Object.assign({alg:i},a,{enc:n}))),p=new Uint8Array(Buffer.from(f?`${u}.${sn(f)}`:u));return Promise.resolve(Te(re({},t(s,p)),{protectedHeader:u}))}catch(u){return Promise.reject(u)}},"encrypt"),t=ov(r),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:e}}o(BE,"xc20pDirEncrypter");function Hg(r){let e=o(function(n,i,s){try{return Promise.resolve(t.open(i,n,s))}catch(a){return Promise.reject(a)}},"decrypt"),t=new Gh.XChaCha20Poly1305(r);return{alg:"dir",enc:"XC20P",decrypt:e}}o(Hg,"xc20pDirDecrypter");function UE(r,e){let t=o(function(f,u={},p){try{Object.assign(u,{alg:void 0});let b=(0,Yh.randomBytes)(32);return Promise.resolve(BE(b).encrypt(f,u,p)).then(function(x){return Promise.resolve(n(b)).then(function(A){return Te(re({},x),{recipient:A,cek:b})})})}catch(b){return Promise.reject(b)}},"encrypt"),n=o(function(f){try{let u=(0,Mf.generateKeyPair)(),p=(0,Mf.sharedKey)(u.secretKey,r),b=Yg(p,s,i),x=ov(b)(f),A={encrypted_key:sn(x.ciphertext),header:{alg:i,iv:sn(x.iv),tag:sn(x.tag),epk:{kty:"OKP",crv:a,x:sn(u.publicKey)}}};return e&&(A.header.kid=e),Promise.resolve(A)}catch(u){return Promise.reject(u)}},"encryptCek"),i="ECDH-ES+XC20PKW",s=256,a="X25519";return{alg:i,enc:"XC20P",encrypt:t,encryptCek:n}}o(UE,"x25519Encrypter");function FE(r){if(!(r&&r.epk&&r.iv&&r.tag))throw new Error("bad_jwe: malformed header")}o(FE,"validateHeader");function sv(r){let e=o(function(s,a,f,u){try{let x=function(){let k=Yg(O,n,t),$=Wg(u.encrypted_key,u.header.tag);return Promise.resolve(Hg(k).decrypt($,Ar(u.header.iv))).then(function(C){return C===null?null:Hg(C).decrypt(s,a,f)})};o(x,"_temp4");var p,b;if(FE((p=u)==null?void 0:p.header),u=u,((b=u.header.epk)==null?void 0:b.crv)!==i||typeof u.header.epk.x=="undefined")return Promise.resolve(null);let A=Ar(u.header.epk.x),O,T=function(){if(r instanceof Uint8Array)O=(0,Mf.sharedKey)(r,A);else return Promise.resolve(r(A)).then(function(k){O=k})}();return Promise.resolve(T&&T.then?T.then(x):x(T))}catch(x){return Promise.reject(x)}},"decrypt"),t="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:t,enc:"XC20P",decrypt:e}}o(sv,"x25519Decrypter");Hd();var vu=o(({enumerable:r=!0,configurable:e=!1}={})=>({enumerable:r,configurable:e,writable:!1}),"readonly"),Qh=o(function*(r,e){if(r!=null&&!(r instanceof Uint8Array))for(let[t,n]of Object.entries(r)){let i=[...e,t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,a]of n.entries()){let f=[...i,s],u=Pe.asCID(a);u?yield[f.join("/"),u]:typeof a=="object"&&(yield*Qh(a,f))}else{let s=Pe.asCID(n);s?yield[i.join("/"),s]:yield*Qh(n,i)}}},"links"),e0=o(function*(r,e){if(r!=null)for(let[t,n]of Object.entries(r)){let i=[...e,t];if(yield i.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!Pe.asCID(n))if(Array.isArray(n))for(let[s,a]of n.entries()){let f=[...i,s];yield f.join("/"),typeof a=="object"&&!Pe.asCID(a)&&(yield*e0(a,f))}else yield*e0(n,i)}},"tree"),$E=o((r,e)=>{let t=r;for(let[n,i]of e.entries()){if(t=t[i],t==null)throw new Error(`Object has no property at ${e.slice(0,n+1).map(a=>`[${JSON.stringify(a)}]`).join("")}`);let s=Pe.asCID(t);if(s)return{value:s,remaining:e.slice(n+1).join("/")}}return{value:t}},"get"),yu=class{constructor({cid:e,bytes:t,value:n}){if(!e||!t||typeof n=="undefined")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:vu(),bytes:vu(),value:vu(),asBlock:vu()})}links(){return Qh(this.value,[])}tree(){return e0(this.value,[])}get(e="/"){return $E(this.value,e.split("/").filter(Boolean))}};o(yu,"Block");var rs=o(n=>Z(void 0,[n],function*({value:r,codec:e,hasher:t}){if(typeof r=="undefined")throw new Error('Missing required argument "value"');if(!e||!t)throw new Error("Missing required argument: codec or hasher");let i=e.encode(r),s=yield t.digest(i),a=Pe.create(1,e.code,s);return new yu({value:r,bytes:i,cid:a})}),"encode");Vn();ff();Fd();Od();var Ci={};St(Ci,{code:()=>ga,decode:()=>l0,encode:()=>If,name:()=>_S});var qE=["string","number","bigint","symbol"],HE=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function av(r){if(r===null)return"null";if(r===void 0)return"undefined";if(r===!0||r===!1)return"boolean";let e=typeof r;if(qE.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(r))return"Array";if(zE(r))return"Buffer";let t=jE(r);return t||"Object"}o(av,"is");function zE(r){return r&&r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer.call(null,r)}o(zE,"isBuffer");function jE(r){let e=Object.prototype.toString.call(r).slice(8,-1);if(HE.includes(e))return e}o(jE,"getObjectType");var de=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};o(de,"Type");de.uint=new de(0,"uint",!0);de.negint=new de(1,"negint",!0);de.bytes=new de(2,"bytes",!0);de.string=new de(3,"string",!0);de.array=new de(4,"array",!1);de.map=new de(5,"map",!1);de.tag=new de(6,"tag",!1);de.float=new de(7,"float",!0);de.false=new de(7,"false",!0);de.true=new de(7,"true",!0);de.null=new de(7,"null",!0);de.undefined=new de(7,"undefined",!0);de.break=new de(7,"break",!0);var _e=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};o(_e,"Token");var la=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",KE=new TextDecoder,VE=new TextEncoder;function xu(r){return la&&globalThis.Buffer.isBuffer(r)}o(xu,"isBuffer");function r0(r){return r instanceof Uint8Array?xu(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r:Uint8Array.from(r)}o(r0,"asU8A");var lv=la?(r,e,t)=>t-e>64?globalThis.Buffer.from(r.subarray(e,t)).toString("utf8"):cv(r,e,t):(r,e,t)=>t-e>64?KE.decode(r.subarray(e,t)):cv(r,e,t),dv=la?r=>r.length>64?globalThis.Buffer.from(r):fv(r):r=>r.length>64?VE.encode(r):fv(r),ri=o(r=>Uint8Array.from(r),"fromArray"),da=la?(r,e,t)=>xu(r)?new Uint8Array(r.subarray(e,t)):r.slice(e,t):(r,e,t)=>r.slice(e,t),hv=la?(r,e)=>(r=r.map(t=>t instanceof Uint8Array?t:globalThis.Buffer.from(t)),r0(globalThis.Buffer.concat(r,e))):(r,e)=>{let t=new Uint8Array(e),n=0;for(let i of r)n+i.length>t.length&&(i=i.subarray(0,t.length-n)),t.set(i,n),n+=i.length;return t},pv=la?r=>globalThis.Buffer.allocUnsafe(r):r=>new Uint8Array(r);function mv(r,e){if(xu(r)&&xu(e))return r.compare(e);for(let t=0;t<r.length;t++)if(r[t]!==e[t])return r[t]<e[t]?-1:1;return 0}o(mv,"compare");function fv(r,e=1/0){let t,n=r.length,i=null,s=[];for(let a=0;a<n;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}o(fv,"utf8ToBytes");function cv(r,e,t){let n=[];for(;e<t;){let i=r[e],s=null,a=i>239?4:i>223?3:i>191?2:1;if(e+a<=t){let f,u,p,b;switch(a){case 1:i<128&&(s=i);break;case 2:f=r[e+1],(f&192)===128&&(b=(i&31)<<6|f&63,b>127&&(s=b));break;case 3:f=r[e+1],u=r[e+2],(f&192)===128&&(u&192)===128&&(b=(i&15)<<12|(f&63)<<6|u&63,b>2047&&(b<55296||b>57343)&&(s=b));break;case 4:f=r[e+1],u=r[e+2],p=r[e+3],(f&192)===128&&(u&192)===128&&(p&192)===128&&(b=(i&15)<<18|(f&63)<<12|(u&63)<<6|p&63,b>65535&&b<1114112&&(s=b))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),e+=a}return WE(n)}o(cv,"utf8Slice");var uv=4096;function WE(r){let e=r.length;if(e<=uv)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=uv));return t}o(WE,"decodeCodePointsArray");var GE=256,ha=class{constructor(e=GE){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let i=t.length-(this.maxCursor-this.cursor)-1;t.set(e,i)}else{if(t){let i=t.length-(this.maxCursor-this.cursor)-1;i<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,i),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=pv(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=da(n,0,this.cursor)}else t=hv(this.chunks,this.cursor);return e&&this.reset(),t}};o(ha,"Bl");var Xe="CBOR decode error:",n0="CBOR encode error:",Af=[];Af[23]=1;Af[24]=2;Af[25]=3;Af[26]=5;Af[27]=9;function ki(r,e,t){if(r.length-e<t)throw new Error(`${Xe} not enough data for type`)}o(ki,"assertEnoughData");var Vt=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Pr(r,e,t){ki(r,e,1);let n=r[e];if(t.strict===!0&&n<Vt[0])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Pr,"readUint8");function Nr(r,e,t){ki(r,e,2);let n=r[e]<<8|r[e+1];if(t.strict===!0&&n<Vt[1])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Nr,"readUint16");function Rr(r,e,t){ki(r,e,4);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3];if(t.strict===!0&&n<Vt[2])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);return n}o(Rr,"readUint32");function Lr(r,e,t){ki(r,e,8);let n=r[e]*16777216+(r[e+1]<<16)+(r[e+2]<<8)+r[e+3],i=r[e+4]*16777216+(r[e+5]<<16)+(r[e+6]<<8)+r[e+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(t.strict===!0&&s<Vt[3])throw new Error(`${Xe} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(t.allowBigInt===!0)return s;throw new Error(`${Xe} integers outside of the safe integer range are not supported`)}o(Lr,"readUint64");function bv(r,e,t,n){return new _e(de.uint,Pr(r,e+1,n),2)}o(bv,"decodeUint8");function gv(r,e,t,n){return new _e(de.uint,Nr(r,e+1,n),3)}o(gv,"decodeUint16");function vv(r,e,t,n){return new _e(de.uint,Rr(r,e+1,n),5)}o(vv,"decodeUint32");function yv(r,e,t,n){return new _e(de.uint,Lr(r,e+1,n),9)}o(yv,"decodeUint64");function an(r,e){return er(r,0,e.value)}o(an,"encodeUint");function er(r,e,t){if(t<Vt[0]){let n=Number(t);r.push([e|n])}else if(t<Vt[1]){let n=Number(t);r.push([e|24,n])}else if(t<Vt[2]){let n=Number(t);r.push([e|25,n>>>8,n&255])}else if(t<Vt[3]){let n=Number(t);r.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(t);if(n<Vt[4]){let i=[e|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),a=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=a&255,a=a>>8,i[3]=a&255,a=a>>8,i[2]=a&255,a=a>>8,i[1]=a&255,r.push(i)}else throw new Error(`${Xe} encountered BigInt larger than allowable range`)}}o(er,"encodeUintValue");an.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");er.encodedSize=o(function(e){return e<Vt[0]?1:e<Vt[1]?2:e<Vt[2]?3:e<Vt[3]?5:9},"encodedSize");an.compareTokens=o(function(e,t){return e.value<t.value?-1:e.value>t.value?1:0},"compareTokens");function xv(r,e,t,n){return new _e(de.negint,-1-Pr(r,e+1,n),2)}o(xv,"decodeNegint8");function wv(r,e,t,n){return new _e(de.negint,-1-Nr(r,e+1,n),3)}o(wv,"decodeNegint16");function _v(r,e,t,n){return new _e(de.negint,-1-Rr(r,e+1,n),5)}o(_v,"decodeNegint32");var i0=BigInt(-1),Ev=BigInt(1);function Sv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new _e(de.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Xe} integers outside of the safe integer range are not supported`);return new _e(de.negint,i0-BigInt(i),9)}o(Sv,"decodeNegint64");function wu(r,e){let t=e.value,n=typeof t=="bigint"?t*i0-Ev:t*-1-1;er(r,e.type.majorEncoded,n)}o(wu,"encodeNegint");wu.encodedSize=o(function(e){let t=e.value,n=typeof t=="bigint"?t*i0-Ev:t*-1-1;return n<Vt[0]?1:n<Vt[1]?2:n<Vt[2]?3:n<Vt[3]?5:9},"encodedSize");wu.compareTokens=o(function(e,t){return e.value<t.value?1:e.value>t.value?-1:0},"compareTokens");function Tf(r,e,t,n){ki(r,e,t+n);let i=da(r,e+t,e+t+n);return new _e(de.bytes,i,t+n)}o(Tf,"toToken");function Mv(r,e,t,n){return Tf(r,e,1,t)}o(Mv,"decodeBytesCompact");function Av(r,e,t,n){return Tf(r,e,2,Pr(r,e+1,n))}o(Av,"decodeBytes8");function Tv(r,e,t,n){return Tf(r,e,3,Nr(r,e+1,n))}o(Tv,"decodeBytes16");function kv(r,e,t,n){return Tf(r,e,5,Rr(r,e+1,n))}o(kv,"decodeBytes32");function Cv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer bytes lengths not supported`);return Tf(r,e,9,i)}o(Cv,"decodeBytes64");function _u(r){return r.encodedBytes===void 0&&(r.encodedBytes=r.type===de.string?dv(r.value):r.value),r.encodedBytes}o(_u,"tokenBytes");function pa(r,e){let t=_u(e);er(r,e.type.majorEncoded,t.length),r.push(t)}o(pa,"encodeBytes");pa.encodedSize=o(function(e){let t=_u(e);return er.encodedSize(t.length)+t.length},"encodedSize");pa.compareTokens=o(function(e,t){return JE(_u(e),_u(t))},"compareTokens");function JE(r,e){return r.length<e.length?-1:r.length>e.length?1:mv(r,e)}o(JE,"compareBytes");function kf(r,e,t,n,i){let s=t+n;ki(r,e,s);let a=new _e(de.string,lv(r,e+t,e+s),s);return i.retainStringBytes===!0&&(a.byteValue=da(r,e+t,e+s)),a}o(kf,"toToken");function Dv(r,e,t,n){return kf(r,e,1,t,n)}o(Dv,"decodeStringCompact");function Iv(r,e,t,n){return kf(r,e,2,Pr(r,e+1,n),n)}o(Iv,"decodeString8");function Ov(r,e,t,n){return kf(r,e,3,Nr(r,e+1,n),n)}o(Ov,"decodeString16");function Pv(r,e,t,n){return kf(r,e,5,Rr(r,e+1,n),n)}o(Pv,"decodeString32");function Nv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer string lengths not supported`);return kf(r,e,9,i,n)}o(Nv,"decodeString64");var Rv=pa;function ma(r,e,t,n){return new _e(de.array,n,t)}o(ma,"toToken");function Lv(r,e,t,n){return ma(r,e,1,t)}o(Lv,"decodeArrayCompact");function Bv(r,e,t,n){return ma(r,e,2,Pr(r,e+1,n))}o(Bv,"decodeArray8");function Uv(r,e,t,n){return ma(r,e,3,Nr(r,e+1,n))}o(Uv,"decodeArray16");function Fv(r,e,t,n){return ma(r,e,5,Rr(r,e+1,n))}o(Fv,"decodeArray32");function $v(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer array lengths not supported`);return ma(r,e,9,i)}o($v,"decodeArray64");function qv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return ma(r,e,1,1/0)}o(qv,"decodeArrayIndefinite");function Eu(r,e){er(r,de.array.majorEncoded,e.value)}o(Eu,"encodeArray");Eu.compareTokens=an.compareTokens;Eu.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function ba(r,e,t,n){return new _e(de.map,n,t)}o(ba,"toToken");function Hv(r,e,t,n){return ba(r,e,1,t)}o(Hv,"decodeMapCompact");function zv(r,e,t,n){return ba(r,e,2,Pr(r,e+1,n))}o(zv,"decodeMap8");function jv(r,e,t,n){return ba(r,e,3,Nr(r,e+1,n))}o(jv,"decodeMap16");function Kv(r,e,t,n){return ba(r,e,5,Rr(r,e+1,n))}o(Kv,"decodeMap32");function Vv(r,e,t,n){let i=Lr(r,e+1,n);if(typeof i=="bigint")throw new Error(`${Xe} 64-bit integer map lengths not supported`);return ba(r,e,9,i)}o(Vv,"decodeMap64");function Wv(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return ba(r,e,1,1/0)}o(Wv,"decodeMapIndefinite");function Su(r,e){er(r,de.map.majorEncoded,e.value)}o(Su,"encodeMap");Su.compareTokens=an.compareTokens;Su.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");function Gv(r,e,t,n){return new _e(de.tag,t,1)}o(Gv,"decodeTagCompact");function Yv(r,e,t,n){return new _e(de.tag,Pr(r,e+1,n),2)}o(Yv,"decodeTag8");function Jv(r,e,t,n){return new _e(de.tag,Nr(r,e+1,n),3)}o(Jv,"decodeTag16");function Xv(r,e,t,n){return new _e(de.tag,Rr(r,e+1,n),5)}o(Xv,"decodeTag32");function Zv(r,e,t,n){return new _e(de.tag,Lr(r,e+1,n),9)}o(Zv,"decodeTag64");function Mu(r,e){er(r,de.tag.majorEncoded,e.value)}o(Mu,"encodeTag");Mu.compareTokens=an.compareTokens;Mu.encodedSize=o(function(e){return er.encodedSize(e.value)},"encodedSize");var rS=20,nS=21,iS=22,oS=23;function Qv(r,e,t,n){if(n.allowUndefined===!1)throw new Error(`${Xe} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new _e(de.null,null,1):new _e(de.undefined,void 0,1)}o(Qv,"decodeUndefined");function e2(r,e,t,n){if(n.allowIndefinite===!1)throw new Error(`${Xe} indefinite length items not allowed`);return new _e(de.break,void 0,1)}o(e2,"decodeBreak");function o0(r,e,t){if(t){if(t.allowNaN===!1&&Number.isNaN(r))throw new Error(`${Xe} NaN values are not supported`);if(t.allowInfinity===!1&&(r===1/0||r===-1/0))throw new Error(`${Xe} Infinity values are not supported`)}return new _e(de.float,r,e)}o(o0,"createToken");function t2(r,e,t,n){return o0(s0(r,e+1),3,n)}o(t2,"decodeFloat16");function r2(r,e,t,n){return o0(a0(r,e+1),5,n)}o(r2,"decodeFloat32");function n2(r,e,t,n){return o0(a2(r,e+1),9,n)}o(n2,"decodeFloat64");function Au(r,e,t){let n=e.value;if(n===!1)r.push([de.float.majorEncoded|rS]);else if(n===!0)r.push([de.float.majorEncoded|nS]);else if(n===null)r.push([de.float.majorEncoded|iS]);else if(n===void 0)r.push([de.float.majorEncoded|oS]);else{let i,s=!1;(!t||t.float64!==!0)&&(o2(n),i=s0(Mn,1),n===i||Number.isNaN(n)?(Mn[0]=249,r.push(Mn.slice(0,3)),s=!0):(s2(n),i=a0(Mn,1),n===i&&(Mn[0]=250,r.push(Mn.slice(0,5)),s=!0))),s||(sS(n),i=a2(Mn,1),Mn[0]=251,r.push(Mn.slice(0,9)))}}o(Au,"encodeFloat");Au.encodedSize=o(function(e,t){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!t||t.float64!==!0){o2(n);let i=s0(Mn,1);if(n===i||Number.isNaN(n))return 3;if(s2(n),i=a0(Mn,1),n===i)return 5}return 9},"encodedSize");var i2=new ArrayBuffer(9),fn=new DataView(i2,1),Mn=new Uint8Array(i2,0);function o2(r){if(r===1/0)fn.setUint16(0,31744,!1);else if(r===-1/0)fn.setUint16(0,64512,!1);else if(Number.isNaN(r))fn.setUint16(0,32256,!1);else{fn.setFloat32(0,r);let e=fn.getUint32(0),t=(e&2139095040)>>23,n=e&8388607;if(t===255)fn.setUint16(0,31744,!1);else if(t===0)fn.setUint16(0,(r&2147483648)>>16|n>>13,!1);else{let i=t-127;i<-24?fn.setUint16(0,0):i<-14?fn.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):fn.setUint16(0,(e&2147483648)>>16|i+15<<10|n>>13,!1)}}}o(o2,"encodeFloat16");function s0(r,e){if(r.length-e<2)throw new Error(`${Xe} not enough data for float16`);let t=(r[e]<<8)+r[e+1];if(t===31744)return 1/0;if(t===64512)return-1/0;if(t===32256)return NaN;let n=t>>10&31,i=t&1023,s;return n===0?s=i*pd(2,-24):n!==31?s=(i+1024)*pd(2,n-25):s=i===0?1/0:NaN,t&32768?-s:s}o(s0,"readFloat16");function s2(r){fn.setFloat32(0,r,!1)}o(s2,"encodeFloat32");function a0(r,e){if(r.length-e<4)throw new Error(`${Xe} not enough data for float32`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,4).getFloat32(0,!1)}o(a0,"readFloat32");function sS(r){fn.setFloat64(0,r,!1)}o(sS,"encodeFloat64");function a2(r,e){if(r.length-e<8)throw new Error(`${Xe} not enough data for float64`);let t=(r.byteOffset||0)+e;return new DataView(r.buffer,t,8).getFloat64(0,!1)}o(a2,"readFloat64");Au.compareTokens=an.compareTokens;function ct(r,e,t){throw new Error(`${Xe} encountered invalid minor (${t}) for major ${r[e]>>>5}`)}o(ct,"invalidMinor");function Tu(r){return()=>{throw new Error(`${Xe} ${r}`)}}o(Tu,"errorer");var ye=[];for(let r=0;r<=23;r++)ye[r]=ct;ye[24]=bv;ye[25]=gv;ye[26]=vv;ye[27]=yv;ye[28]=ct;ye[29]=ct;ye[30]=ct;ye[31]=ct;for(let r=32;r<=55;r++)ye[r]=ct;ye[56]=xv;ye[57]=wv;ye[58]=_v;ye[59]=Sv;ye[60]=ct;ye[61]=ct;ye[62]=ct;ye[63]=ct;for(let r=64;r<=87;r++)ye[r]=Mv;ye[88]=Av;ye[89]=Tv;ye[90]=kv;ye[91]=Cv;ye[92]=ct;ye[93]=ct;ye[94]=ct;ye[95]=Tu("indefinite length bytes/strings are not supported");for(let r=96;r<=119;r++)ye[r]=Dv;ye[120]=Iv;ye[121]=Ov;ye[122]=Pv;ye[123]=Nv;ye[124]=ct;ye[125]=ct;ye[126]=ct;ye[127]=Tu("indefinite length bytes/strings are not supported");for(let r=128;r<=151;r++)ye[r]=Lv;ye[152]=Bv;ye[153]=Uv;ye[154]=Fv;ye[155]=$v;ye[156]=ct;ye[157]=ct;ye[158]=ct;ye[159]=qv;for(let r=160;r<=183;r++)ye[r]=Hv;ye[184]=zv;ye[185]=jv;ye[186]=Kv;ye[187]=Vv;ye[188]=ct;ye[189]=ct;ye[190]=ct;ye[191]=Wv;for(let r=192;r<=215;r++)ye[r]=Gv;ye[216]=Yv;ye[217]=Jv;ye[218]=Xv;ye[219]=Zv;ye[220]=ct;ye[221]=ct;ye[222]=ct;ye[223]=ct;for(let r=224;r<=243;r++)ye[r]=Tu("simple values are not supported");ye[244]=ct;ye[245]=ct;ye[246]=ct;ye[247]=Qv;ye[248]=Tu("simple values are not supported");ye[249]=t2;ye[250]=r2;ye[251]=n2;ye[252]=ct;ye[253]=ct;ye[254]=ct;ye[255]=e2;var An=[];for(let r=0;r<24;r++)An[r]=new _e(de.uint,r,1);for(let r=-1;r>=-24;r--)An[31-r]=new _e(de.negint,r,1);An[64]=new _e(de.bytes,new Uint8Array(0),1);An[96]=new _e(de.string,"",1);An[128]=new _e(de.array,0,1);An[160]=new _e(de.map,0,1);An[244]=new _e(de.false,!1,1);An[245]=new _e(de.true,!0,1);An[246]=new _e(de.null,null,1);function f2(r){switch(r.type){case de.false:return ri([244]);case de.true:return ri([245]);case de.null:return ri([246]);case de.bytes:return r.value.length?void 0:ri([64]);case de.string:return r.value===""?ri([96]):void 0;case de.array:return r.value===0?ri([128]):void 0;case de.map:return r.value===0?ri([160]):void 0;case de.uint:return r.value<24?ri([Number(r.value)]):void 0;case de.negint:if(r.value>=-24)return ri([31-Number(r.value)])}}o(f2,"quickEncodeToken");var fS={float64:!1,mapSorter:lS,quickEncodeToken:f2};function cS(){let r=[];return r[de.uint.major]=an,r[de.negint.major]=wu,r[de.bytes.major]=pa,r[de.string.major]=Rv,r[de.array.major]=Eu,r[de.map.major]=Su,r[de.tag.major]=Mu,r[de.float.major]=Au,r}o(cS,"makeCborEncoders");var c2=cS(),f0=new ha,is=class{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do if(t.obj===e)return!0;while(t=t.parent);return!1}static createCheck(e,t){if(e&&e.includes(t))throw new Error(`${n0} object contains circular references`);return new is(t,e)}};o(is,"Ref");var so={null:new _e(de.null,null),undefined:new _e(de.undefined,void 0),true:new _e(de.true,!0),false:new _e(de.false,!1),emptyArray:new _e(de.array,0),emptyMap:new _e(de.map,0)},ao={number(r,e,t,n){return!Number.isInteger(r)||!Number.isSafeInteger(r)?new _e(de.float,r):r>=0?new _e(de.uint,r):new _e(de.negint,r)},bigint(r,e,t,n){return r>=BigInt(0)?new _e(de.uint,r):new _e(de.negint,r)},Uint8Array(r,e,t,n){return new _e(de.bytes,r)},string(r,e,t,n){return new _e(de.string,r)},boolean(r,e,t,n){return r?so.true:so.false},null(r,e,t,n){return so.null},undefined(r,e,t,n){return so.undefined},ArrayBuffer(r,e,t,n){return new _e(de.bytes,new Uint8Array(r))},DataView(r,e,t,n){return new _e(de.bytes,new Uint8Array(r.buffer,r.byteOffset,r.byteLength))},Array(r,e,t,n){if(!r.length)return t.addBreakTokens===!0?[so.emptyArray,new _e(de.break)]:so.emptyArray;n=is.createCheck(n,r);let i=[],s=0;for(let a of r)i[s++]=ku(a,t,n);return t.addBreakTokens?[new _e(de.array,r.length),i,new _e(de.break)]:[new _e(de.array,r.length),i]},Object(r,e,t,n){let i=e!=="Object",s=i?r.keys():Object.keys(r),a=i?r.size:s.length;if(!a)return t.addBreakTokens===!0?[so.emptyMap,new _e(de.break)]:so.emptyMap;n=is.createCheck(n,r);let f=[],u=0;for(let p of s)f[u++]=[ku(p,t,n),ku(i?r.get(p):r[p],t,n)];return uS(f,t),t.addBreakTokens?[new _e(de.map,a),f,new _e(de.break)]:[new _e(de.map,a),f]}};ao.Map=ao.Object;ao.Buffer=ao.Uint8Array;for(let r of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))ao[`${r}Array`]=ao.DataView;function ku(r,e={},t){let n=av(r),i=e&&e.typeEncoders&&e.typeEncoders[n]||ao[n];if(typeof i=="function"){let a=i(r,n,e,t);if(a!=null)return a}let s=ao[n];if(!s)throw new Error(`${n0} unsupported type: ${n}`);return s(r,n,e,t)}o(ku,"objectToTokens");function uS(r,e){e.mapSorter&&r.sort(e.mapSorter)}o(uS,"sortMapEntries");function lS(r,e){let t=Array.isArray(r[0])?r[0][0]:r[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(t.type!==n.type)return t.type.compare(n.type);let i=t.type.major,s=c2[i].compareTokens(t,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}o(lS,"mapSorter");function u2(r,e,t,n){if(Array.isArray(e))for(let i of e)u2(r,i,t,n);else t[e.type.major](r,e,n)}o(u2,"tokensToEncoded");function dS(r,e,t){let n=ku(r,t);if(!Array.isArray(n)&&t.quickEncodeToken){let i=t.quickEncodeToken(n);if(i)return i;let s=e[n.type.major];if(s.encodedSize){let a=s.encodedSize(n,t),f=new ha(a);if(s(f,n,t),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return r0(f.chunks[0])}}return f0.reset(),u2(f0,n,e,t),f0.toBytes(!0)}o(dS,"encodeCustom");function c0(r,e){return e=Object.assign({},fS,e),dS(r,c2,e)}o(c0,"encode");var hS={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Cu=class{constructor(e,t={}){this.pos=0,this.data=e,this.options=t}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],t=An[e];if(t===void 0){let n=ye[e];if(!n)throw new Error(`${Xe} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let i=e&31;t=n(this.data,this.pos,i,this.options)}return this.pos+=t.encodedLength,t}};o(Cu,"Tokeniser");var Cf=Symbol.for("DONE"),Du=Symbol.for("BREAK");function pS(r,e,t){let n=[];for(let i=0;i<r.value;i++){let s=Df(e,t);if(s===Du){if(r.value===1/0)break;throw new Error(`${Xe} got unexpected break to lengthed array`)}if(s===Cf)throw new Error(`${Xe} found array but not enough entries (got ${i}, expected ${r.value})`);n[i]=s}return n}o(pS,"tokenToArray");function mS(r,e,t){let n=t.useMaps===!0,i=n?void 0:{},s=n?new Map:void 0;for(let a=0;a<r.value;a++){let f=Df(e,t);if(f===Du){if(r.value===1/0)break;throw new Error(`${Xe} got unexpected break to lengthed map`)}if(f===Cf)throw new Error(`${Xe} found map but not enough entries (got ${a} [no key], expected ${r.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${Xe} non-string keys not supported (got ${typeof f})`);let u=Df(e,t);if(u===Cf)throw new Error(`${Xe} found map but not enough entries (got ${a} [no value], expected ${r.value})`);n?s.set(f,u):i[f]=u}return n?s:i}o(mS,"tokenToMap");function Df(r,e){if(r.done())return Cf;let t=r.next();if(t.type===de.break)return Du;if(t.type.terminal)return t.value;if(t.type===de.array)return pS(t,r,e);if(t.type===de.map)return mS(t,r,e);if(t.type===de.tag){if(e.tags&&typeof e.tags[t.value]=="function"){let n=Df(r,e);return e.tags[t.value](n)}throw new Error(`${Xe} tag not supported (${t.value})`)}throw new Error("unsupported")}o(Df,"tokensToObject");function u0(r,e){if(!(r instanceof Uint8Array))throw new Error(`${Xe} data to decode must be a Uint8Array`);e=Object.assign({},hS,e);let t=e.tokenizer||new Cu(r,e),n=Df(t,e);if(n===Cf)throw new Error(`${Xe} did not find any content to decode`);if(n===Du)throw new Error(`${Xe} got unexpected break`);if(!t.done())throw new Error(`${Xe} too many terminals, data makes no sense`);return n}o(u0,"decode");Vn();var l2=42;function gS(r){if(r.asCID!==r)return null;let e=Pe.asCID(r);if(!e)return null;let t=new Uint8Array(e.bytes.byteLength+1);return t.set(e.bytes,1),[new _e(de.tag,l2),new _e(de.bytes,t)]}o(gS,"cidEncoder");function vS(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}o(vS,"undefinedEncoder");function yS(r){if(Number.isNaN(r))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(r===1/0||r===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}o(yS,"numberEncoder");var xS={float64:!0,typeEncoders:{Object:gS,undefined:vS,number:yS}};function wS(r){if(r[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Pe.decode(r.subarray(1))}o(wS,"cidDecoder");var d2={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};d2.tags[l2]=wS;var _S="dag-cbor",ga=113,If=o(r=>c0(r,xS),"encode"),l0=o(r=>u0(r,d2),"decode");var ES=24;function h2(r){return Z(this,null,function*(){let e=yield rs({value:r,codec:Ci,hasher:zo});return{cid:e.cid,linkedBlock:e.bytes}})}o(h2,"encodePayload");function SS(r,e=ES){let t=(e-r.length%e)%e,n=new Uint8Array(r.length+t);return n.set(r,0),n}o(SS,"pad");function MS(r){return Z(this,null,function*(){return(yield rs({value:r,codec:Ci,hasher:Bc})).cid})}o(MS,"encodeIdentityCID");function AS(r){if(r=Pe.asCID(r),r.code!==ga)throw new Error("CID codec must be dag-cbor");if(r.multihash.code!==Bc.code)throw new Error("CID must use identity multihash");return l0(r.multihash.digest)}o(AS,"decodeIdentityCID");function p2(r,e){return Z(this,null,function*(){return SS((yield MS(r)).bytes,e)})}o(p2,"prepareCleartext");function m2(r){return AS(Pe.decodeFirst(r)[0])}o(m2,"decodeCleartext");var b2=Symbol("abortable"),Iu=Symbol("aborted");function g2(r,e){if(e.aborted)return Promise.reject(Iu);let t,n=new Promise((i,s)=>{t=s});return e.addEventListener("abort",()=>{t(Iu)}),Promise.race([r,n])}o(g2,"abortable");var v2=o((r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),""),"nanoid");var Ou="utils_abort_request";var yr;(function(r){r[r.PARSE_ERROR=-32700]="PARSE_ERROR",r[r.INVALID_REQUEST=-32600]="INVALID_REQUEST",r[r.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",r[r.INVALID_PARAMS=-32602]="INVALID_PARAMS",r[r.INTERNAL_ERROR=-32603]="INTERNAL_ERROR"})(yr||(yr={}));var y2={[yr.PARSE_ERROR]:"Parse error",[yr.INVALID_REQUEST]:"Invalid request",[yr.METHOD_NOT_FOUND]:"Method not found",[yr.INVALID_PARAMS]:"Invalid params",[yr.INTERNAL_ERROR]:"Internal error"};function TS(r){return-32e3>=r&&r>=-32099}o(TS,"isServerError");function Pu(r){var e;return(e=y2[r.toString()])!=null?e:TS(r)?"Server error":"Application error"}o(Pu,"getErrorMessage");var Tr=class extends Error{static fromObject(e){return new Tr(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,t,n){super(),Object.setPrototypeOf(this,Tr.prototype),this.code=e,this.data=n,this.message=t!=null?t:Pu(e)}};o(Tr,"RPCError");function Of(r){let e=y2[r];return o(function(n){return new Tr(r,e,n)},"createError")}o(Of,"createErrorFactory");var kS=Of(yr.PARSE_ERROR),fL=Of(yr.INVALID_REQUEST),cL=Of(yr.METHOD_NOT_FOUND),uL=Of(yr.INVALID_PARAMS),lL=Of(yr.INTERNAL_ERROR);function CS(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(CS,"_checkPrivateRedeclaration");function DS(r,e){return e.get?e.get.call(r):e.value}o(DS,"_classApplyDescriptorGet");function IS(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(IS,"_classApplyDescriptorSet");function x2(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(x2,"_classExtractFieldDescriptor");function d0(r,e){var t=x2(r,e,"get");return DS(r,t)}o(d0,"_classPrivateFieldGet");function OS(r,e,t){CS(r,e),e.set(r,t)}o(OS,"_classPrivateFieldInit");function PS(r,e,t){var n=x2(r,e,"set");return IS(r,n,t),t}o(PS,"_classPrivateFieldSet");var Pf=new WeakMap,va=class{get connection(){return d0(this,Pf)}createID(){return v2()}request(e,t=void 0,n={}){let{signal:i}=n;if(i!=null&&i.aborted)return Promise.reject(Iu);let s=this.createID(),a=d0(this,Pf).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(f=>{if(f==null)throw new Error("Missing response");if(f.error!=null)throw Tr.fromObject(f.error);return f.result});return i==null?a:(i.addEventListener("abort",()=>{this.notify(Ou,{id:s})}),g2(a,i))}notify(e,t=void 0){return Z(this,null,function*(){yield d0(this,Pf).send({jsonrpc:"2.0",method:e,params:t})})}constructor(e){OS(this,Pf,{writable:!0,value:void 0}),PS(this,Pf,e)}};o(va,"RPCClient");function w2(r,e){return{jsonrpc:"2.0",id:r,error:{code:e,message:Pu(e)}}}o(w2,"createErrorResponse");function NS(r,e,t){console.warn("Unhandled handler error",e,t)}o(NS,"fallbackOnHandlerError");function RS(r,e){console.warn("Unhandled invalid message",e)}o(RS,"fallbackOnInvalidMessage");function LS(r,e){console.warn("Unhandled notification",e)}o(LS,"fallbackOnNotification");function _2(r,e={}){var f,u,p;let t=(f=e.onHandlerError)!=null?f:NS,n=(u=e.onInvalidMessage)!=null?u:RS,i=(p=e.onNotification)!=null?p:LS,s={};function a(b,x){var A,O;if(x.method===Ou){let T=(A=x.params)==null?void 0:A.id;T!=null&&((O=s[T])==null||O.abort())}else i(b,x)}return o(a,"handleNotification"),o(function(x,A){return Z(this,null,function*(){var k,$,C;let O=A.id;if(A.jsonrpc!=="2.0"||A.method==null)return O==null?(n(x,A),null):w2(O,yr.INVALID_REQUEST);let T=r[A.method];if(T==null)return O==null?(a(x,A),null):w2(O,yr.METHOD_NOT_FOUND);try{let B;if(O!=null&&T[b2]){let H=new AbortController;s[O]=H,B=T(x,A.params,{signal:H.signal})}else B=T(x,A.params,{});let z=B==null?B:typeof B.then=="function"?yield B:B;return O==null||((k=s[O])==null?void 0:k.signal.aborted)?null:{jsonrpc:"2.0",id:O,result:z}}catch(B){if(O==null||(($=s[O])==null?void 0:$.signal.aborted))return t(x,A,B),null;let z;if(B instanceof Tr)z=B.toObject();else{t(x,A,B);let H=(C=B.code)!=null?C:-32e3;z={code:H,message:B.message||Pu(H)}}return{jsonrpc:"2.0",id:O,error:z}}finally{O!=null&&delete s[O]}})},"handleRequest")}o(_2,"createHandler");Vn();var Zy=at(hy(),1),dr=at(as(),1);function w0(){return w0=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},w0.apply(this,arguments)}o(w0,"_extends");var _0={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},tM={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},E0={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},rM={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:_0,1:E0}}},nM={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:_0,1:E0,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},Uf={2:_0,10:tM,19:{assetName:E0,assetType:rM,assetId:nM}};function py(r,e){return r.split(e.parameters.delimiter)}o(py,"splitParams");function Ff(r,e){var t=py(r,e),n={};return t.forEach(function(i,s){n[e.parameters.values[s].name]=i}),n}o(Ff,"getParams");function Ea(r,e){return Object.values(e.parameters.values).map(function(t){var n=r[t.name];return typeof n=="string"?n:Ea(n,t)}).join(e.parameters.delimiter)}o(Ea,"joinParams");function $f(r,e){if(!new RegExp(e.regex).test(r))return!1;var t=py(r,e);if(t.length!==Object.keys(e.parameters.values).length)return!1;var n=t.map(function(i,s){return new RegExp(e.parameters.values[s].regex).test(i)}).filter(function(i){return!!i});return n.length===t.length}o($f,"isValidId");var lo=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.namespace=t.namespace,this.reference=t.reference}o(r,"ChainId"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(Ff(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),r}();lo.spec=Uf[2];var fs=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new lo(t.chainId),this.address=t.address}o(r,"AccountId"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var i=Ff(n,this.spec),s=i.namespace,a=i.reference,f=i.address,u=new lo({namespace:s,reference:a});return new r({chainId:u,address:f}).toJSON()},"parse"),r.format=o(function(n){var i=new lo(n.chainId),s=w0({},i.toJSON(),{address:n.address});return Ea(s,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON"),r}();fs.spec=Uf[10];var S0=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.namespace=t.namespace,this.reference=t.reference}o(r,"AssetName"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(Ff(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON"),r}();S0.spec=Uf[19].assetName;var iM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new lo(t.chainId),this.assetName=new S0(t.assetName)}o(r,"AssetType"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(Ff(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON"),r}();iM.spec=Uf[19].assetType;var oM=function(){function r(t){typeof t=="string"&&(t=r.parse(t)),this.chainId=new lo(t.chainId),this.assetName=new S0(t.assetName),this.tokenId=t.tokenId}o(r,"AssetId"),r.parse=o(function(n){if(!$f(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new r(Ff(n,this.spec)).toJSON()},"parse"),r.format=o(function(n){return Ea(n,this.spec)},"format");var e=r.prototype;return e.toString=o(function(){return r.format(this.toJSON())},"toString"),e.toJSON=o(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON"),r}();oM.spec=Uf[19].assetId;var my="logger/5.6.0";var by=!1,gy=!1,Fu={debug:1,default:2,info:2,warning:3,error:4,off:5},vy=Fu.default,M0=null;function sM(){try{let r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch(t){r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}o(sM,"_checkNormalize");var yy=sM(),A0;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(A0||(A0={}));var kn;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED"})(kn||(kn={}));var xy="0123456789abcdef",tt=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();Fu[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(vy>Fu[n])&&console.log.apply(console,t)}debug(...e){this._log(tt.levels.DEBUG,e)}info(...e){this._log(tt.levels.INFO,e)}warn(...e){this._log(tt.levels.WARNING,e)}makeError(e,t,n){if(gy)return this.makeError("censored error",t,{});t||(t=tt.errors.UNKNOWN_ERROR),n||(n={});let i=[];Object.keys(n).forEach(u=>{let p=n[u];try{if(p instanceof Uint8Array){let b="";for(let x=0;x<p.length;x++)b+=xy[p[x]>>4],b+=xy[p[x]&15];i.push(u+"=Uint8Array(0x"+b+")")}else i.push(u+"="+JSON.stringify(p))}catch(b){i.push(u+"="+JSON.stringify(n[u].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);let s=e,a="";switch(t){case kn.NUMERIC_FAULT:{a="NUMERIC_FAULT";let u=e;switch(u){case"overflow":case"underflow":case"division-by-zero":a+="-"+u;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result";break}break}case kn.CALL_EXCEPTION:case kn.INSUFFICIENT_FUNDS:case kn.MISSING_NEW:case kn.NONCE_EXPIRED:case kn.REPLACEMENT_UNDERPRICED:case kn.TRANSACTION_REPLACED:case kn.UNPREDICTABLE_GAS_LIMIT:a=t;break}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let f=new Error(e);return f.reason=s,f.code=t,Object.keys(n).forEach(function(u){f[u]=n[u]}),f}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,tt.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,i){e||this.throwError(t,n,i)}assertArgument(e,t,n,i){e||this.throwArgumentError(t,n,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),yy&&this.throwError("platform missing String.prototype.normalize",tt.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:yy})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,tt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,tt.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n?n=": "+n:n="",e<t&&this.throwError("missing argument"+n,tt.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,tt.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",tt.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",tt.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",tt.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return M0||(M0=new tt(my)),M0}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),by){if(!e)return;this.globalLogger().throwError("error censorship permanent",tt.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}gy=!!e,by=!!t}static setLogLevel(e){let t=Fu[e.toLowerCase()];if(t==null){tt.globalLogger().warn("invalid log level - "+e);return}vy=t}static from(e){return new tt(e)}};o(tt,"Logger");tt.errors=kn;tt.levels=A0;var wy="bytes/5.6.1";var Bt=new tt(wy);function Ey(r){return!!r.toHexString}o(Ey,"isHexable");function Sa(r){return r.slice||(r.slice=function(){let e=Array.prototype.slice.call(arguments);return Sa(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}o(Sa,"addSlice");function Sy(r){return Cn(r)&&!(r.length%2)||k0(r)}o(Sy,"isBytesLike");function _y(r){return typeof r=="number"&&r==r&&r%1===0}o(_y,"isInteger");function k0(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!_y(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){let t=r[e];if(!_y(t)||t<0||t>=256)return!1}return!0}o(k0,"isBytes");function Tt(r,e){if(e||(e={}),typeof r=="number"){Bt.checkSafeUint53(r,"invalid arrayify value");let t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),Sa(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Ey(r)&&(r=r.toHexString()),Cn(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":Bt.throwArgumentError("hex data is odd-length","value",r));let n=[];for(let i=0;i<t.length;i+=2)n.push(parseInt(t.substring(i,i+2),16));return Sa(new Uint8Array(n))}return k0(r)?Sa(new Uint8Array(r)):Bt.throwArgumentError("invalid arrayify value","value",r)}o(Tt,"arrayify");function C0(r){let e=r.map(i=>Tt(i)),t=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(t);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Sa(n)}o(C0,"concat");function aM(r,e){r=Tt(r),r.length>e&&Bt.throwArgumentError("value out of range","value",arguments[0]);let t=new Uint8Array(e);return t.set(r,e-r.length),Sa(t)}o(aM,"zeroPad");function Cn(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}o(Cn,"isHexString");var T0="0123456789abcdef";function ur(r,e){if(e||(e={}),typeof r=="number"){Bt.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=T0[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Ey(r))return r.toHexString();if(Cn(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":Bt.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(k0(r)){let t="0x";for(let n=0;n<r.length;n++){let i=r[n];t+=T0[(i&240)>>4]+T0[i&15]}return t}return Bt.throwArgumentError("invalid hexlify value","value",r)}o(ur,"hexlify");function $u(r){if(typeof r!="string")r=ur(r);else if(!Cn(r)||r.length%2)return null;return(r.length-2)/2}o($u,"hexDataLength");function qu(r,e,t){return typeof r!="string"?r=ur(r):(!Cn(r)||r.length%2)&&Bt.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}o(qu,"hexDataSlice");function ho(r,e){for(typeof r!="string"?r=ur(r):Cn(r)||Bt.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&Bt.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}o(ho,"hexZeroPad");function Hu(r){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Sy(r)){let t=Tt(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=ur(t.slice(0,32)),e.s=ur(t.slice(32,64))):t.length===65?(e.r=ur(t.slice(0,32)),e.s=ur(t.slice(32,64)),e.v=t[64]):Bt.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:Bt.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=ur(t.slice(32,64))}else{if(e.r=r.r,e.s=r.s,e.v=r.v,e.recoveryParam=r.recoveryParam,e._vs=r._vs,e._vs!=null){let i=aM(Tt(e._vs),32);e._vs=ur(i);let s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Bt.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;let a=ur(i);e.s==null?e.s=a:e.s!==a&&Bt.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?Bt.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Bt.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Cn(e.r)?Bt.throwArgumentError("signature missing or invalid r","signature",r):e.r=ho(e.r,32),e.s==null||!Cn(e.s)?Bt.throwArgumentError("signature missing or invalid s","signature",r):e.s=ho(e.s,32);let t=Tt(e.s);t[0]>=128&&Bt.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);let n=ur(t);e._vs&&(Cn(e._vs)||Bt.throwArgumentError("signature invalid _vs","signature",r),e._vs=ho(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Bt.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}o(Hu,"splitSignature");var Ty=at(I0());var Ay="bignumber/5.6.2";var fM=Ty.default.BN,nB=new tt(Ay);function O0(r){return new fM(r,36).toString(16)}o(O0,"_base36To16");var ky=at(Xd());function Ma(r){return"0x"+ky.default.keccak_256(Tt(r))}o(Ma,"keccak256");var Cy="address/5.6.1";var qf=new tt(Cy);function Dy(r){Cn(r,20)||qf.throwArgumentError("invalid address","address",r),r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);let n=Tt(Ma(t));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}o(Dy,"getChecksumAddress");var lM=9007199254740991;function dM(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}o(dM,"log10");var P0={};for(let r=0;r<10;r++)P0[String(r)]=String(r);for(let r=0;r<26;r++)P0[String.fromCharCode(65+r)]=String(10+r);var Iy=Math.floor(dM(lM));function hM(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>P0[n]).join("");for(;e.length>=Iy;){let n=e.substring(0,Iy);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}o(hM,"ibanChecksum");function Oy(r){let e=null;if(typeof r!="string"&&qf.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=Dy(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&qf.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==hM(r)&&qf.throwArgumentError("bad icap checksum","address",r),e=O0(r.substring(4));e.length<40;)e="0"+e;e=Dy("0x"+e)}else qf.throwArgumentError("invalid address","address",r);return e}o(Oy,"getAddress");var Py="properties/5.6.0";var xB=new tt(Py);function Aa(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}o(Aa,"defineReadOnly");var Ny="strings/5.6.1";var Ry=new tt(Ny),Hf;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(Hf||(Hf={}));var cs;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(cs||(cs={}));function pM(r,e,t,n,i){return Ry.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}o(pM,"errorFunc");function Ly(r,e,t,n,i){if(r===cs.BAD_PREFIX||r===cs.UNEXPECTED_CONTINUE){let s=0;for(let a=e+1;a<t.length&&t[a]>>6===2;a++)s++;return s}return r===cs.OVERRUN?t.length-e-1:0}o(Ly,"ignoreFunc");function mM(r,e,t,n,i){return r===cs.OVERLONG?(n.push(i),0):(n.push(65533),Ly(r,e,t,n,i))}o(mM,"replaceFunc");var bM=Object.freeze({error:pM,ignore:Ly,replace:mM});function zf(r,e=Hf.current){e!=Hf.current&&(Ry.checkNormalize(),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192),t.push(i&63|128);else if((i&64512)==55296){n++;let s=r.charCodeAt(n);if(n>=r.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");let a=65536+((i&1023)<<10)+(s&1023);t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return Tt(t)}o(zf,"toUtf8Bytes");var By=`Ethereum Signed Message:
633
+ `;function N0(r){return typeof r=="string"&&(r=zf(r)),Ma(C0([zf(By),zf(String(r.length)),r]))}o(N0,"hashMessage");var Qe=at(I0()),oi=at(bf());function Ta(r,e,t){return t={path:e,exports:{},require:function(n,i){return gM(n,i==null?t.path:i)}},r(t,t.exports),t.exports}o(Ta,"createCommonjsModule");function gM(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}o(gM,"commonjsRequire");var U0=Fy;function Fy(r,e){if(!r)throw new Error(e||"Assertion failed")}o(Fy,"assert");Fy.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual");var Dn=Ta(function(r,e){"use strict";var t=e;function n(a,f){if(Array.isArray(a))return a.slice();if(!a)return[];var u=[];if(typeof a!="string"){for(var p=0;p<a.length;p++)u[p]=a[p]|0;return u}if(f==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var p=0;p<a.length;p+=2)u.push(parseInt(a[p]+a[p+1],16))}else for(var p=0;p<a.length;p++){var b=a.charCodeAt(p),x=b>>8,A=b&255;x?u.push(x,A):u.push(A)}return u}o(n,"toArray"),t.toArray=n;function i(a){return a.length===1?"0"+a:a}o(i,"zero2"),t.zero2=i;function s(a){for(var f="",u=0;u<a.length;u++)f+=i(a[u].toString(16));return f}o(s,"toHex"),t.toHex=s,t.encode=o(function(f,u){return u==="hex"?s(f):f},"encode")}),Ur=Ta(function(r,e){"use strict";var t=e;t.assert=U0,t.toArray=Dn.toArray,t.zero2=Dn.zero2,t.toHex=Dn.toHex,t.encode=Dn.encode;function n(u,p,b){var x=new Array(Math.max(u.bitLength(),b)+1);x.fill(0);for(var A=1<<p+1,O=u.clone(),T=0;T<x.length;T++){var k,$=O.andln(A-1);O.isOdd()?($>(A>>1)-1?k=(A>>1)-$:k=$,O.isubn(k)):k=0,x[T]=k,O.iushrn(1)}return x}o(n,"getNAF"),t.getNAF=n;function i(u,p){var b=[[],[]];u=u.clone(),p=p.clone();for(var x=0,A=0,O;u.cmpn(-x)>0||p.cmpn(-A)>0;){var T=u.andln(3)+x&3,k=p.andln(3)+A&3;T===3&&(T=-1),k===3&&(k=-1);var $;(T&1)===0?$=0:(O=u.andln(7)+x&7,(O===3||O===5)&&k===2?$=-T:$=T),b[0].push($);var C;(k&1)===0?C=0:(O=p.andln(7)+A&7,(O===3||O===5)&&T===2?C=-k:C=k),b[1].push(C),2*x===$+1&&(x=1-x),2*A===C+1&&(A=1-A),u.iushrn(1),p.iushrn(1)}return b}o(i,"getJSF"),t.getJSF=i;function s(u,p,b){var x="_"+p;u.prototype[p]=o(function(){return this[x]!==void 0?this[x]:this[x]=b.call(this)},"cachedProperty")}o(s,"cachedProperty"),t.cachedProperty=s;function a(u){return typeof u=="string"?t.toArray(u,"hex"):u}o(a,"parseBytes"),t.parseBytes=a;function f(u){return new Qe.default(u,"hex","le")}o(f,"intFromLE"),t.intFromLE=f}),Ku=Ur.getNAF,vM=Ur.getJSF,Vu=Ur.assert;function mo(r,e){this.type=r,this.p=new Qe.default(e.p,16),this.red=e.prime?Qe.default.red(e.prime):Qe.default.mont(this.p),this.zero=new Qe.default(0).toRed(this.red),this.one=new Qe.default(1).toRed(this.red),this.two=new Qe.default(2).toRed(this.red),this.n=e.n&&new Qe.default(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}o(mo,"BaseCurve");var us=mo;mo.prototype.point=o(function(){throw new Error("Not implemented")},"point");mo.prototype.validate=o(function(){throw new Error("Not implemented")},"validate");mo.prototype._fixedNafMul=o(function(e,t){Vu(e.precomputed);var n=e._getDoubles(),i=Ku(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var p=f+n.step-1;p>=f;p--)u=(u<<1)+i[p];a.push(u)}for(var b=this.jpoint(null,null,null),x=this.jpoint(null,null,null),A=s;A>0;A--){for(f=0;f<a.length;f++)u=a[f],u===A?x=x.mixedAdd(n.points[f]):u===-A&&(x=x.mixedAdd(n.points[f].neg()));b=b.add(x)}return b.toP()},"_fixedNafMul");mo.prototype._wnafMul=o(function(e,t){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Ku(t,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var p=0;u>=0&&a[u]===0;u--)p++;if(u>=0&&p++,f=f.dblp(p),u<0)break;var b=a[u];Vu(b!==0),e.type==="affine"?b>0?f=f.mixedAdd(s[b-1>>1]):f=f.mixedAdd(s[-b-1>>1].neg()):b>0?f=f.add(s[b-1>>1]):f=f.add(s[-b-1>>1].neg())}return e.type==="affine"?f.toP():f},"_wnafMul");mo.prototype._wnafMulAdd=o(function(e,t,n,i,s){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,p=0,b,x,A;for(b=0;b<i;b++){A=t[b];var O=A._getNAFPoints(e);a[b]=O.wnd,f[b]=O.points}for(b=i-1;b>=1;b-=2){var T=b-1,k=b;if(a[T]!==1||a[k]!==1){u[T]=Ku(n[T],a[T],this._bitLength),u[k]=Ku(n[k],a[k],this._bitLength),p=Math.max(u[T].length,p),p=Math.max(u[k].length,p);continue}var $=[t[T],null,null,t[k]];t[T].y.cmp(t[k].y)===0?($[1]=t[T].add(t[k]),$[2]=t[T].toJ().mixedAdd(t[k].neg())):t[T].y.cmp(t[k].y.redNeg())===0?($[1]=t[T].toJ().mixedAdd(t[k]),$[2]=t[T].add(t[k].neg())):($[1]=t[T].toJ().mixedAdd(t[k]),$[2]=t[T].toJ().mixedAdd(t[k].neg()));var C=[-3,-1,-5,-7,0,7,5,1,3],B=vM(n[T],n[k]);for(p=Math.max(B[0].length,p),u[T]=new Array(p),u[k]=new Array(p),x=0;x<p;x++){var z=B[0][x]|0,H=B[1][x]|0;u[T][x]=C[(z+1)*3+(H+1)],u[k][x]=0,f[T]=$}}var X=this.jpoint(null,null,null),U=this._wnafT4;for(b=p;b>=0;b--){for(var L=0;b>=0;){var F=!0;for(x=0;x<i;x++)U[x]=u[x][b]|0,U[x]!==0&&(F=!1);if(!F)break;L++,b--}if(b>=0&&L++,X=X.dblp(L),b<0)break;for(x=0;x<i;x++){var ne=U[x];ne!==0&&(ne>0?A=f[x][ne-1>>1]:ne<0&&(A=f[x][-ne-1>>1].neg()),A.type==="affine"?X=X.mixedAdd(A):X=X.add(A))}}for(b=0;b<i;b++)f[b]=null;return s?X:X.toP()},"_wnafMulAdd");function ln(r,e){this.curve=r,this.type=e,this.precomputed=null}o(ln,"BasePoint");mo.BasePoint=ln;ln.prototype.eq=o(function(){throw new Error("Not implemented")},"eq");ln.prototype.validate=o(function(){return this.curve.validate(this)},"validate");mo.prototype.decodePoint=o(function(e,t){e=Ur.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Vu(e[e.length-1]%2===0):e[0]===7&&Vu(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},"decodePoint");ln.prototype.encodeCompressed=o(function(e){return this.encode(e,!0)},"encodeCompressed");ln.prototype._encode=o(function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},"_encode");ln.prototype.encode=o(function(e,t){return Ur.encode(this._encode(t),e)},"encode");ln.prototype.precompute=o(function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},"precompute");ln.prototype._hasDoubles=o(function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1},"_hasDoubles");ln.prototype._getDoubles=o(function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<t;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}},"_getDoubles");ln.prototype._getNAFPoints=o(function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)t[s]=t[s-1].add(i);return{wnd:e,points:t}},"_getNAFPoints");ln.prototype._getBeta=o(function(){return null},"_getBeta");ln.prototype.dblp=o(function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},"dblp");var F0=Ta(function(r){typeof Object.create=="function"?r.exports=o(function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):r.exports=o(function(t,n){if(n){t.super_=n;var i=o(function(){},"TempCtor");i.prototype=n.prototype,t.prototype=new i,t.prototype.constructor=t}},"inherits")}),yM=Ur.assert;function dn(r){us.call(this,"short",r),this.a=new Qe.default(r.a,16).toRed(this.red),this.b=new Qe.default(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}o(dn,"ShortCurve");F0(dn,us);var xM=dn;dn.prototype._getEndomorphism=o(function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new Qe.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)n=new Qe.default(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))===0?n=s[0]:(n=s[1],yM(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(f){return{a:new Qe.default(f.a,16),b:new Qe.default(f.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}},"_getEndomorphism");dn.prototype._getEndoRoots=o(function(e){var t=e===this.p?this.red:Qe.default.mont(e),n=new Qe.default(2).toRed(t).redInvm(),i=n.redNeg(),s=new Qe.default(3).toRed(t).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},"_getEndoRoots");dn.prototype._getEndoBasis=o(function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new Qe.default(1),a=new Qe.default(0),f=new Qe.default(0),u=new Qe.default(1),p,b,x,A,O,T,k,$=0,C,B;n.cmpn(0)!==0;){var z=i.div(n);C=i.sub(z.mul(n)),B=f.sub(z.mul(s));var H=u.sub(z.mul(a));if(!x&&C.cmp(t)<0)p=k.neg(),b=s,x=C.neg(),A=B;else if(x&&++$===2)break;k=C,i=n,n=C,f=s,s=B,u=a,a=H}O=C.neg(),T=B;var X=x.sqr().add(A.sqr()),U=O.sqr().add(T.sqr());return U.cmp(X)>=0&&(O=p,T=b),x.negative&&(x=x.neg(),A=A.neg()),O.negative&&(O=O.neg(),T=T.neg()),[{a:x,b:A},{a:O,b:T}]},"_getEndoBasis");dn.prototype._endoSplit=o(function(e){var t=this.endo.basis,n=t[0],i=t[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),f=s.mul(n.a),u=a.mul(i.a),p=s.mul(n.b),b=a.mul(i.b),x=e.sub(f).sub(u),A=p.add(b).neg();return{k1:x,k2:A}},"_endoSplit");dn.prototype.pointFromX=o(function(e,t){e=new Qe.default(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},"pointFromX");dn.prototype.validate=o(function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),s=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate");dn.prototype._endoWnafMulAdd=o(function(e,t,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var f=this._endoSplit(t[a]),u=e[a],p=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),p=p.neg(!0)),i[a*2]=u,i[a*2+1]=p,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var b=this._wnafMulAdd(1,i,s,a*2,n),x=0;x<a*2;x++)i[x]=null,s[x]=null;return b},"_endoWnafMulAdd");function Gt(r,e,t,n){us.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Qe.default(e,16),this.y=new Qe.default(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}o(Gt,"Point");F0(Gt,us.BasePoint);dn.prototype.point=o(function(e,t,n){return new Gt(this,e,t,n)},"point");dn.prototype.pointFromJSON=o(function(e,t){return Gt.fromJSON(this,e,t)},"pointFromJSON");Gt.prototype._getBeta=o(function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},"_getBeta");Gt.prototype.toJSON=o(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON");Gt.fromJSON=o(function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var i=e.point(t[0],t[1],n);if(!t[2])return i;function s(f){return e.point(f[0],f[1],n)}o(s,"obj2point");var a=t[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},"fromJSON");Gt.prototype.inspect=o(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect");Gt.prototype.isInfinity=o(function(){return this.inf},"isInfinity");Gt.prototype.add=o(function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},"add");Gt.prototype.dbl=o(function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},"dbl");Gt.prototype.getX=o(function(){return this.x.fromRed()},"getX");Gt.prototype.getY=o(function(){return this.y.fromRed()},"getY");Gt.prototype.mul=o(function(e){return e=new Qe.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},"mul");Gt.prototype.mulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},"mulAdd");Gt.prototype.jmulAdd=o(function(e,t,n){var i=[this,t],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},"jmulAdd");Gt.prototype.eq=o(function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},"eq");Gt.prototype.neg=o(function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=o(function(s){return s.neg()},"negate");t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},"neg");Gt.prototype.toJ=o(function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},"toJ");function rr(r,e,t,n){us.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Qe.default(0)):(this.x=new Qe.default(e,16),this.y=new Qe.default(t,16),this.z=new Qe.default(n,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}o(rr,"JPoint");F0(rr,us.BasePoint);dn.prototype.jpoint=o(function(e,t,n){return new rr(this,e,t,n)},"jpoint");rr.prototype.toP=o(function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},"toP");rr.prototype.neg=o(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg");rr.prototype.add=o(function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),s=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),p=a.redSub(f);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=u.redSqr(),x=b.redMul(u),A=i.redMul(b),O=p.redSqr().redIAdd(x).redISub(A).redISub(A),T=p.redMul(A.redISub(O)).redISub(a.redMul(x)),k=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(O,T,k)},"add");rr.prototype.mixedAdd=o(function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),s=this.y,a=e.y.redMul(t).redMul(this.z),f=n.redSub(i),u=s.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=f.redSqr(),b=p.redMul(f),x=n.redMul(p),A=u.redSqr().redIAdd(b).redISub(x).redISub(x),O=u.redMul(x.redISub(A)).redISub(s.redMul(b)),T=this.z.redMul(f);return this.curve.jpoint(A,O,T)},"mixedAdd");rr.prototype.dblp=o(function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,u=this.z,p=u.redSqr().redSqr(),b=f.redAdd(f);for(t=0;t<e;t++){var x=a.redSqr(),A=b.redSqr(),O=A.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(i.redMul(p)),k=a.redMul(A),$=T.redSqr().redISub(k.redAdd(k)),C=k.redISub($),B=T.redMul(C);B=B.redIAdd(B).redISub(O);var z=b.redMul(u);t+1<e&&(p=p.redMul(O)),a=$,u=z,b=B}return this.curve.jpoint(a,b.redMul(s),u)},"dblp");rr.prototype.dbl=o(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl");rr.prototype._zeroDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),p=u.redSqr().redISub(f).redISub(f),b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),e=p,t=u.redMul(f.redISub(p)).redISub(b),n=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),A=this.y.redSqr(),O=A.redSqr(),T=this.x.redAdd(A).redSqr().redISub(x).redISub(O);T=T.redIAdd(T);var k=x.redAdd(x).redIAdd(x),$=k.redSqr(),C=O.redIAdd(O);C=C.redIAdd(C),C=C.redIAdd(C),e=$.redISub(T).redISub(T),t=k.redMul(T.redISub(e)).redISub(C),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)},"_zeroDbl");rr.prototype._threeDbl=o(function(){var e,t,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),p=u.redSqr().redISub(f).redISub(f);e=p;var b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),t=u.redMul(f.redISub(p)).redISub(b),n=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),A=this.y.redSqr(),O=this.x.redMul(A),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var k=O.redIAdd(O);k=k.redIAdd(k);var $=k.redAdd(k);e=T.redSqr().redISub($),n=this.y.redAdd(this.z).redSqr().redISub(A).redISub(x);var C=A.redSqr();C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C),t=T.redMul(k.redISub(e)).redISub(C)}return this.curve.jpoint(e,t,n)},"_threeDbl");rr.prototype._dbl=o(function(){var e=this.curve.a,t=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=t.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),p=t.redAdd(t);p=p.redIAdd(p);var b=p.redMul(f),x=u.redSqr().redISub(b.redAdd(b)),A=b.redISub(x),O=f.redSqr();O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=u.redMul(A).redISub(O),k=n.redAdd(n).redMul(i);return this.curve.jpoint(x,T,k)},"_dbl");rr.prototype.trpl=o(function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),i=t.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),f=this.x.redAdd(t).redSqr().redISub(e).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),p=i.redIAdd(i);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var b=s.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(p),x=t.redMul(b);x=x.redIAdd(x),x=x.redIAdd(x);var A=this.x.redMul(u).redISub(x);A=A.redIAdd(A),A=A.redIAdd(A);var O=this.y.redMul(b.redMul(p.redISub(b)).redISub(f.redMul(u)));O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(A,O,T)},"trpl");rr.prototype.mul=o(function(e,t){return e=new Qe.default(e,t),this.curve._wnafMul(this,e)},"mul");rr.prototype.eq=o(function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var i=t.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0},"eq");rr.prototype.eqXToP=o(function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP");rr.prototype.inspect=o(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect");rr.prototype.isInfinity=o(function(){return this.z.cmpn(0)===0},"isInfinity");var zu=Ta(function(r,e){"use strict";var t=e;t.base=us,t.short=xM,t.mont=null,t.edwards=null}),ju=Ta(function(r,e){"use strict";var t=e,n=Ur.assert;function i(f){f.type==="short"?this.curve=new zu.short(f):f.type==="edwards"?this.curve=new zu.edwards(f):this.curve=new zu.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o(i,"PresetCurve"),t.PresetCurve=i;function s(f,u){Object.defineProperty(t,f,{configurable:!0,enumerable:!0,get:function(){var p=new i(u);return Object.defineProperty(t,f,{configurable:!0,enumerable:!0,value:p}),p}})}o(s,"defineCurve"),s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:oi.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:oi.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:oi.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:oi.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:oi.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oi.default.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oi.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch(f){a=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:oi.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function po(r){if(!(this instanceof po))return new po(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Dn.toArray(r.entropy,r.entropyEnc||"hex"),t=Dn.toArray(r.nonce,r.nonceEnc||"hex"),n=Dn.toArray(r.pers,r.persEnc||"hex");U0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,n)}o(po,"HmacDRBG");var $y=po;po.prototype._init=o(function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},"init");po.prototype._hmac=o(function(){return new oi.default.hmac(this.hash,this.K)},"hmac");po.prototype._update=o(function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},"update");po.prototype.reseed=o(function(e,t,n,i){typeof t!="string"&&(i=n,n=t,t=null),e=Dn.toArray(e,t),n=Dn.toArray(n,i),U0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},"reseed");po.prototype.generate=o(function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(i=n,n=t,t=null),n&&(n=Dn.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(n),this._reseed++,Dn.encode(a,t)},"generate");var B0=Ur.assert;function lr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}o(lr,"KeyPair");var $0=lr;lr.fromPublic=o(function(e,t,n){return t instanceof lr?t:new lr(e,{pub:t,pubEnc:n})},"fromPublic");lr.fromPrivate=o(function(e,t,n){return t instanceof lr?t:new lr(e,{priv:t,privEnc:n})},"fromPrivate");lr.prototype.validate=o(function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate");lr.prototype.getPublic=o(function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},"getPublic");lr.prototype.getPrivate=o(function(e){return e==="hex"?this.priv.toString(16,2):this.priv},"getPrivate");lr.prototype._importPrivate=o(function(e,t){this.priv=new Qe.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate");lr.prototype._importPublic=o(function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?B0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&B0(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},"_importPublic");lr.prototype.derive=o(function(e){return e.validate()||B0(e.validate(),"public point not validated"),e.mul(this.priv).getX()},"derive");lr.prototype.sign=o(function(e,t,n){return this.ec.sign(e,this,t,n)},"sign");lr.prototype.verify=o(function(e,t){return this.ec.verify(e,t,this)},"verify");lr.prototype.inspect=o(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect");var wM=Ur.assert;function Wu(r,e){if(r instanceof Wu)return r;this._importDER(r,e)||(wM(r.r&&r.s,"Signature without r or s"),this.r=new Qe.default(r.r,16),this.s=new Qe.default(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}o(Wu,"Signature");var Gu=Wu;function _M(){this.place=0}o(_M,"Position");function R0(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=r[a],i>>>=0;return i<=127?!1:(e.place=a,i)}o(R0,"getLength");function Uy(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}o(Uy,"rmPadding");Wu.prototype._importDER=o(function(e,t){e=Ur.toArray(e,t);var n=new _M;if(e[n.place++]!==48)return!1;var i=R0(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=R0(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var f=R0(e,n);if(f===!1||e.length!==f+n.place)return!1;var u=e.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new Qe.default(a),this.s=new Qe.default(u),this.recoveryParam=null,!0},"_importDER");function L0(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}o(L0,"constructLength");Wu.prototype.toDER=o(function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=Uy(t),n=Uy(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];L0(i,t.length),i=i.concat(t),i.push(2),L0(i,n.length);var s=i.concat(n),a=[48];return L0(a,s.length),a=a.concat(s),Ur.encode(a,e)},"toDER");var EM=o(function(){throw new Error("unsupported")},"rand"),qy=Ur.assert;function un(r){if(!(this instanceof un))return new un(r);typeof r=="string"&&(qy(Object.prototype.hasOwnProperty.call(ju,r),"Unknown curve "+r),r=ju[r]),r instanceof ju.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}o(un,"EC");var SM=un;un.prototype.keyPair=o(function(e){return new $0(this,e)},"keyPair");un.prototype.keyFromPrivate=o(function(e,t){return $0.fromPrivate(this,e,t)},"keyFromPrivate");un.prototype.keyFromPublic=o(function(e,t){return $0.fromPublic(this,e,t)},"keyFromPublic");un.prototype.genKeyPair=o(function(e){e||(e={});for(var t=new $y({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||EM(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Qe.default(2));;){var s=new Qe.default(t.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair");un.prototype._truncateToN=o(function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},"_truncateToN");un.prototype.sign=o(function(e,t,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Qe.default(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),f=e.toArray("be",s),u=new $y({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new Qe.default(1)),b=0;;b++){var x=i.k?i.k(b):new Qe.default(u.generate(this.n.byteLength()));if(x=this._truncateToN(x,!0),!(x.cmpn(1)<=0||x.cmp(p)>=0)){var A=this.g.mul(x);if(!A.isInfinity()){var O=A.getX(),T=O.umod(this.n);if(T.cmpn(0)!==0){var k=x.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(k=k.umod(this.n),k.cmpn(0)!==0){var $=(A.getY().isOdd()?1:0)|(O.cmp(T)!==0?2:0);return i.canonical&&k.cmp(this.nh)>0&&(k=this.n.sub(k),$^=1),new Gu({r:T,s:k,recoveryParam:$})}}}}}},"sign");un.prototype.verify=o(function(e,t,n,i){e=this._truncateToN(new Qe.default(e,16)),n=this.keyFromPublic(n,i),t=new Gu(t,"hex");var s=t.r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(e).umod(this.n),p=f.mul(s).umod(this.n),b;return this.curve._maxwellTrick?(b=this.g.jmulAdd(u,n.getPublic(),p),b.isInfinity()?!1:b.eqXToP(s)):(b=this.g.mulAdd(u,n.getPublic(),p),b.isInfinity()?!1:b.getX().umod(this.n).cmp(s)===0)},"verify");un.prototype.recoverPubKey=function(r,e,t,n){qy((3&t)===t,"The recovery param is more than two bits"),e=new Gu(e,n);var i=this.n,s=new Qe.default(r),a=e.r,f=e.s,u=t&1,p=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var b=e.r.invm(i),x=i.sub(s).mul(b).umod(i),A=f.mul(b).umod(i);return this.g.mulAdd(x,a,A)};un.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new Gu(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(a){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var MM=Ta(function(r,e){"use strict";var t=e;t.version="6.5.4",t.utils=Ur,t.rand=function(){throw new Error("unsupported")},t.curve=zu,t.curves=ju,t.ec=SM,t.eddsa=null}),Hy=MM.ec;var zy="signing-key/5.6.2";var H0=new tt(zy),q0=null;function si(){return q0||(q0=new Hy("secp256k1")),q0}o(si,"getCurve");var Yu=class{constructor(e){Aa(this,"curve","secp256k1"),Aa(this,"privateKey",ur(e)),$u(this.privateKey)!==32&&H0.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=si().keyFromPrivate(Tt(this.privateKey));Aa(this,"publicKey","0x"+t.getPublic(!1,"hex")),Aa(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Aa(this,"_isSigningKey",!0)}_addPoint(e){let t=si().keyFromPublic(Tt(this.publicKey)),n=si().keyFromPublic(Tt(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){let t=si().keyFromPrivate(Tt(this.privateKey)),n=Tt(e);n.length!==32&&H0.throwArgumentError("bad digest length","digest",e);let i=t.sign(n,{canonical:!0});return Hu({recoveryParam:i.recoveryParam,r:ho("0x"+i.r.toString(16),32),s:ho("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=si().keyFromPrivate(Tt(this.privateKey)),n=si().keyFromPublic(Tt(z0(e)));return ho("0x"+t.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};o(Yu,"SigningKey");function jy(r,e){let t=Hu(e),n={r:Tt(t.r),s:Tt(t.s)};return"0x"+si().recoverPubKey(Tt(r),n,t.recoveryParam).encode("hex",!1)}o(jy,"recoverPublicKey");function z0(r,e){let t=Tt(r);if(t.length===32){let n=new Yu(t);return e?"0x"+si().keyFromPrivate(t).getPublic(!0,"hex"):n.publicKey}else{if(t.length===33)return e?ur(t):"0x"+si().keyFromPublic(t).getPublic(!1,"hex");if(t.length===65)return e?"0x"+si().keyFromPublic(t).getPublic(!0,"hex"):ur(t)}return H0.throwArgumentError("invalid public or private key","key","[REDACTED]")}o(z0,"computePublicKey");var Ky="transactions/5.6.2";var eU=new tt(Ky),Vy;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(Vy||(Vy={}));function Wy(r){let e=z0(r);return Oy(qu(Ma(qu(e,1)),12))}o(Wy,"computeAddress");function Gy(r,e){return Wy(jy(Tt(r),e))}o(Gy,"recoverAddress");var Yy="wallet/5.6.2";var cU=new tt(Yy);function Jy(r,e){return Gy(N0(r),e)}o(Jy,"verifyMessage");ff();var AM=`
634
634
  sign-in-with-ethereum =
635
635
  domain %s" wants you to sign in with your Ethereum account:" LF
636
636
  address LF
@@ -777,19 +777,19 @@ LF = %x0A
777
777
  DIGIT = %x30-39
778
778
  ; 0-9
779
779
  HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
780
- `,Ju=class{constructor(e){this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0;let t=new Yy.default(TM);if(t.generate(),t.errors.length)throw console.error(t.errorsToAscii()),console.error(t.linesToAscii()),console.log(t.displayAttributeErrors()),new Error("ABNF grammar has errors");let n=t.toObject(),i=new dr.default.parser;i.ast=new dr.default.ast;let s=dr.default.ids,a=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.domain=dr.default.utils.charsToString(X,U,L)),ne},"domain");i.ast.callbacks.domain=a;let f=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.address=dr.default.utils.charsToString(X,U,L)),ne},"address");i.ast.callbacks.address=f;let u=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.statement=dr.default.utils.charsToString(X,U,L)),ne},"statement");i.ast.callbacks.statement=u;let p=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.uri||(F.uri=dr.default.utils.charsToString(X,U,L))),ne},"uri");i.ast.callbacks.uri=p;let b=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.version=dr.default.utils.charsToString(X,U,L)),ne},"version");i.ast.callbacks.version=b;let x=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.chainId=dr.default.utils.charsToString(X,U,L)),ne},"chainId");i.ast.callbacks["chain-id"]=x;let A=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.nonce=dr.default.utils.charsToString(X,U,L)),ne},"nonce");i.ast.callbacks.nonce=A;let O=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.issuedAt=dr.default.utils.charsToString(X,U,L)),ne},"issuedAt");i.ast.callbacks["issued-at"]=O;let T=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.expirationTime=dr.default.utils.charsToString(X,U,L)),ne},"expirationTime");i.ast.callbacks["expiration-time"]=T;let k=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.notBefore=dr.default.utils.charsToString(X,U,L)),ne},"notBefore");i.ast.callbacks["not-before"]=k;let $=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.requestId=dr.default.utils.charsToString(X,U,L)),ne},"requestId");i.ast.callbacks["request-id"]=$;let C=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.resources=dr.default.utils.charsToString(X,U,L).slice(3).split(`
781
- - `)),ne},"resources");i.ast.callbacks.resources=C;let B=i.parse(n,"sign-in-with-ethereum",e);if(!B.success)throw new Error(`Invalid message: ${JSON.stringify(B)}`);let z={};i.ast.translate(z);for(let[H,X]of Object.entries(z))this[H]=X}};o(Ju,"ParsedMessage");var Gy;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(Gy||(Gy={}));var Xu;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(Xu||(Xu={}));var Ta=class{constructor(e){if(this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0,this.signature=void 0,this.type=void 0,typeof e=="string"){let t=new Ju(e);this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else Object.assign(this,e)}static fromCacao(e){let t=fs.parse(e.p.iss.replace("did:pkh:","")),n=new Ta({domain:e.p.domain,address:t.address,uri:e.p.aud,version:e.p.version,chainId:new lo(t.chainId).reference});return e.p.statement&&(n.statement=e.p.statement),e.p.nonce&&(n.nonce=e.p.nonce),e.p.iat&&(n.issuedAt=e.p.iat),e.p.exp&&(n.expirationTime=e.p.exp),e.p.nbf&&(n.notBefore=e.p.nbf),e.p.requestId&&(n.requestId=e.p.requestId),e.p.resources&&(n.resources=e.p.resources),e.s&&(e.s.s&&(n.signature=e.s.s),e.s.t==="eip191"&&(n.type=Xu.PERSONAL_SIGNATURE)),n}toMessage(){let e=`${this.domain} wants you to sign in with your Ethereum account:`,t=`URI: ${this.uri}`,n=[e,this.address].join(`
780
+ `,Ju=class{constructor(e){this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0;let t=new Zy.default(AM);if(t.generate(),t.errors.length)throw console.error(t.errorsToAscii()),console.error(t.linesToAscii()),console.log(t.displayAttributeErrors()),new Error("ABNF grammar has errors");let n=t.toObject(),i=new dr.default.parser;i.ast=new dr.default.ast;let s=dr.default.ids,a=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.domain=dr.default.utils.charsToString(X,U,L)),ne},"domain");i.ast.callbacks.domain=a;let f=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.address=dr.default.utils.charsToString(X,U,L)),ne},"address");i.ast.callbacks.address=f;let u=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.statement=dr.default.utils.charsToString(X,U,L)),ne},"statement");i.ast.callbacks.statement=u;let p=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.uri||(F.uri=dr.default.utils.charsToString(X,U,L))),ne},"uri");i.ast.callbacks.uri=p;let b=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.version=dr.default.utils.charsToString(X,U,L)),ne},"version");i.ast.callbacks.version=b;let x=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.chainId=dr.default.utils.charsToString(X,U,L)),ne},"chainId");i.ast.callbacks["chain-id"]=x;let A=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.nonce=dr.default.utils.charsToString(X,U,L)),ne},"nonce");i.ast.callbacks.nonce=A;let O=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.issuedAt=dr.default.utils.charsToString(X,U,L)),ne},"issuedAt");i.ast.callbacks["issued-at"]=O;let T=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.expirationTime=dr.default.utils.charsToString(X,U,L)),ne},"expirationTime");i.ast.callbacks["expiration-time"]=T;let k=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.notBefore=dr.default.utils.charsToString(X,U,L)),ne},"notBefore");i.ast.callbacks["not-before"]=k;let $=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.requestId=dr.default.utils.charsToString(X,U,L)),ne},"requestId");i.ast.callbacks["request-id"]=$;let C=o(function(H,X,U,L,F){let ne=s.SEM_OK;return H===s.SEM_PRE&&(F.resources=dr.default.utils.charsToString(X,U,L).slice(3).split(`
781
+ - `)),ne},"resources");i.ast.callbacks.resources=C;let B=i.parse(n,"sign-in-with-ethereum",e);if(!B.success)throw new Error(`Invalid message: ${JSON.stringify(B)}`);let z={};i.ast.translate(z);for(let[H,X]of Object.entries(z))this[H]=X}};o(Ju,"ParsedMessage");var Xy;(function(r){r.INVALID_SIGNATURE="Invalid signature.",r.EXPIRED_MESSAGE="Expired message.",r.MALFORMED_SESSION="Malformed session."})(Xy||(Xy={}));var Xu;(function(r){r.PERSONAL_SIGNATURE="Personal signature"})(Xu||(Xu={}));var ka=class{constructor(e){if(this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0,this.signature=void 0,this.type=void 0,typeof e=="string"){let t=new Ju(e);this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else Object.assign(this,e)}static fromCacao(e){let t=fs.parse(e.p.iss.replace("did:pkh:","")),n=new ka({domain:e.p.domain,address:t.address,uri:e.p.aud,version:e.p.version,chainId:new lo(t.chainId).reference});return e.p.statement&&(n.statement=e.p.statement),e.p.nonce&&(n.nonce=e.p.nonce),e.p.iat&&(n.issuedAt=e.p.iat),e.p.exp&&(n.expirationTime=e.p.exp),e.p.nbf&&(n.notBefore=e.p.nbf),e.p.requestId&&(n.requestId=e.p.requestId),e.p.resources&&(n.resources=e.p.resources),e.s&&(e.s.s&&(n.signature=e.s.s),e.s.t==="eip191"&&(n.type=Xu.PERSONAL_SIGNATURE)),n}toMessage(){let e=`${this.domain} wants you to sign in with your Ethereum account:`,t=`URI: ${this.uri}`,n=[e,this.address].join(`
782
782
  `),i=`Version: ${this.version}`;this.nonce||(this.nonce=(Math.random()+1).toString(36).substring(4));let s=`Nonce: ${this.nonce}`,a=[t,i,s];if(this.issuedAt=this.issuedAt?this.issuedAt:new Date().toISOString(),a.push(`Issued At: ${this.issuedAt}`),this.expirationTime){let u=`Expiration Time: ${this.expirationTime}`;a.push(u)}this.notBefore&&a.push(`Not Before: ${this.notBefore}`),this.requestId&&a.push(`Request ID: ${this.requestId}`),this.chainId&&a.push(`Chain ID: ${this.chainId}`),this.resources&&a.push(["Resources:",...this.resources.map(u=>`- ${u}`)].join(`
783
783
  `));let f=a.join(`
784
784
  `);return this.statement&&(n=[n,this.statement].join(`
785
785
 
786
786
  `)),[n,f].join(`
787
787
 
788
- `)}signMessage(){let e;switch(this.type){case Xu.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(Ta,"SiweMessage");var kM=5*60,jf;(function(r){function e(i){let s={h:{t:"eip4361"},p:{domain:i.domain,iat:i.issuedAt,iss:`did:pkh:eip155:${i.chainId}:${i.address}`,aud:i.uri,version:i.version,nonce:i.nonce}};return i.signature&&(s.s={t:"eip191",s:i.signature}),i.notBefore&&(s.p.nbf=i.notBefore),i.expirationTime&&(s.p.exp=i.expirationTime),i.statement&&(s.p.statement=i.statement),i.requestId&&(s.p.requestId=i.requestId),i.resources&&(s.p.resources=i.resources),s}o(e,"fromSiweMessage"),r.fromSiweMessage=e;function t(i,s={}){var a;if(i.h.t==="eip4361"&&((a=i.s)==null?void 0:a.t)==="eip191")return n(i,s);throw new Error("Unsupported CACAO signature type")}o(t,"verify"),r.verify=t;function n(i,s){var O;if(!i.s)throw new Error("CACAO does not have a signature");let a=s.atTime?s.atTime.getTime():Date.now(),f=((O=s.clockSkewSecs)!=null?O:kM)*1e3;if(Date.parse(i.p.iat)>a+f||Date.parse(i.p.nbf)>a+f)throw new Error("CACAO is not valid yet");let u=s.revocationPhaseOutSecs?s.revocationPhaseOutSecs*1e3:0;if(Date.parse(i.p.exp)+u+f<a)throw new Error("CACAO has expired");let p=Ta.fromCacao(i),b=i.s.s,x=Wy(p.toMessage(),b),A=fs.parse(i.p.iss.replace("did:pkh:","")).address;if(x.toLowerCase()!==A.toLowerCase())throw new Error("Signature does not belong to issuer")}o(n,"verifyEIP191Signature"),r.verifyEIP191Signature=n})(jf||(jf={}));var Kf;(function(r){let e=o(function(t){try{return Promise.resolve(rs({value:t,codec:Ci,hasher:zo}))}catch(n){return Promise.reject(n)}},"fromCacao");r.fromCacao=e})(Kf||(Kf={}));uf();Hc();var Jy=at(ro(),1);uf();function Xy(){return It((0,Jy.randomBytes)(16),"base64")}o(Xy,"randomString");var Zy="base64pad",Qy="base64url";function e3(r){return It(r,Zy)}o(e3,"encodeBase64");function t3(r){return It(r,Qy)}o(t3,"encodeBase64Url");function r3(r){return Lt(r,Zy)}o(r3,"decodeBase64");function Zu(r){return JSON.parse(It(Lt(r,Qy)))}o(Zu,"base64urlToJSON");function n3(r){if(r.signatures.length>1)throw new Error("Cant convert to compact jws");return`${r.signatures[0].protected}.${r.payload}.${r.signatures[0].signature}`}o(n3,"fromDagJWS");function i3(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(i3,"didWithTime");function o3(r){return r?Array.isArray(r)?r:[r]:[]}o(o3,"extractControllers");function CM(r){return"registry"in r&&"cache"in r}o(CM,"isResolver");var ls=class{constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new ga(e)),i){if(this._capability=i,this._parentId=this._capability.p.iss,s&&this._parentId!==s)throw new Error("Capability issuer and parent not equal")}else s&&(this._parentId=s);this.setResolver(t,n)}get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return this._capability!=null}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return this._parentId!=null}get id(){if(this._id==null)throw new Error("DID is not authenticated");return this._id}get authenticated(){return this._id!=null}withCapability(e){var t;return new ls({provider:(t=this._client)==null?void 0:t.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new ga(e);else if(this._client.connection!==e)throw new Error("A different provider is already set, create a new DID instance to use another provider")}setResolver(e,t){this._resolver=CM(e)?e:new rf(e,t)}authenticate(){return Z(this,arguments,function*({provider:e,paths:t=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=Xy(),s=yield this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:a}=yield this.verifyJWS(s),f=Zu(s.payload);if(!a.includes(f.did))throw new Error("Invalid authencation response, kid mismatch");if(f.nonce!==i)throw new Error("Invalid authencation response, wrong nonce");if(f.aud!==n)throw new Error("Invalid authencation response, wrong aud");if(f.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=f.did,this._id})}createJWS(n){return Z(this,arguments,function*(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");if(this._capability){let s=yield Kf.fromCacao(this._capability),a=Pe.asCID(s.cid);if(!a)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");t.protected=t.protected||{},t.protected.cap=`ipfs://${a==null?void 0:a.toString()}`}let{jws:i}=yield this._client.request("did_createJWS",Te(re({did:this._id},t),{payload:e}));return i})}createDagJWS(n){return Z(this,arguments,function*(e,t={}){let{cid:i,linkedBlock:s}=yield u2(e),a=t3(i.bytes);Object.assign(t,{linkedBlock:e3(s)});let f=yield this.createJWS(a,t),u=Pe.asCID(i);if(!u)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(f.link=u,this._capability){let p=yield Kf.fromCacao(this._capability);return{jws:f,linkedBlock:s,cacaoBlock:p.bytes}}return{jws:f,linkedBlock:s}})}verifyJWS(n){return Z(this,arguments,function*(e,t={}){var b,x,A,O,T,k,$;typeof e!="string"&&(e=n3(e));let i=Zu(e.split(".")[0]).kid;if(!i)throw new Error('No "kid" found in jws');let s=yield this.resolve(i);if(!t.disableTimecheck){let C=(b=s.didDocumentMetadata)==null?void 0:b.nextUpdate;if(C){let z=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,H=new Date(C).valueOf()+z;if(!(t.atTime&&t.atTime.getTime()<H))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${i}`)}let B=(x=s.didDocumentMetadata)==null?void 0:x.updated;if(B&&t.atTime&&t.atTime.getTime()<new Date(B).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${i}`)}let f=(A=s.didDocument)==null?void 0:A.id;if(t.issuer&&t.issuer===((O=t.capability)==null?void 0:O.p.iss)&&f===t.capability.p.aud)jf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(t.issuer&&t.issuer!==f){let C=i3(t.issuer,t.atTime),z=(T=(yield this.resolve(C)).didDocument)==null?void 0:T.controller,H=o3(z);if(((k=t.capability)==null?void 0:k.s)&&t.capability.p.aud===f&&H.includes(t.capability.p.iss))jf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(!(f?H.includes(f):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${i}`)}let u=(($=s.didDocument)==null?void 0:$.verificationMethod)||[];Zg(e,u);let p;try{p=Zu(e.split(".")[1])}catch(C){}return{kid:i,payload:p,didResolutionResult:s}})}createJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield tv(t,this._resolver);return ev(e,a,n.protectedHeader,n.aad)})}createDagJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield l2(e);return this.createJWE(a,t,n)})}decryptJWE(n){return Z(this,arguments,function*(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");let{cleartext:i}=yield this._client.request("did_decryptJWE",Te(re({did:this._id},t),{jwe:e}));return r3(i)})}decryptDagJWE(e){return Z(this,null,function*(){let t=yield this.decryptJWE(e);return d2(t)})}resolve(e){return Z(this,null,function*(){let t=yield this._resolver.resolve(e);if(t.didResolutionMetadata.error){let{error:n,message:i}=t.didResolutionMetadata,s=i?`, ${i}`:"";throw new Error(`Failed to resolve ${e}: ${n}${s}`)}return t})}};o(ls,"DID");function Qu(r){var e=0,t=r.length,n=[];if(t%2)throw new Error("invalid hex:"+r);for(;e<t;e+=2)n.push(parseInt(r.substr(e,2),16));return new Uint8Array(n)}o(Qu,"toUint8Array");var s4=at(Z3());var nl=at(uu(),1);var i6=at(e6(),1);var VA="base64pad";function t6(r){return JSON.parse((0,i6.default)(r))}o(t6,"toStableObject");function WA(r){let e=new Uint8Array(r.length+2);return e[0]=237,e[1]=1,e.set(r,2),`did:key:z${It(e,"base58btc")}`}o(WA,"encodeDID");function r6(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(r6,"toGeneralJWS");var n6=o((i,s,a,...f)=>Z(void 0,[i,s,a,...f],function*(r,e,t,n={}){let u=`${e}#${e.split(":")[2]}`,p=Wg(t),b=t6(Object.assign(n,{kid:u,alg:"EdDSA"}));return Xg(typeof r=="string"?r:t6(r),p,b)}),"sign"),GA={did_authenticate:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){let s=yield n6({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return r6(s)}),did_createJWS:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){if(t.did.split("#")[0]!==r)throw new Tr(4100,`Unknown DID: ${r}`);let a=yield n6(t.payload,r,e,t.protected);return{jws:r6(a)}}),did_decryptJWE:(t,n)=>Z(void 0,[t,n],function*({secretKey:r},e){let i=nv((0,nl.convertSecretKeyToX25519)(r));try{let s=yield Qg(e.jwe,i);return{cleartext:It(s,VA)}}catch(s){throw new Tr(-32e3,s.message)}})},Gf=class{constructor(e){let{secretKey:t,publicKey:n}=(0,nl.generateKeyPairFromSeed)(e),i=WA(n),s=y2(GA);this._handle=a=>Z(this,null,function*(){return yield s({did:i,secretKey:t},a)})}get isDidProvider(){return!0}send(e){return Z(this,null,function*(){return yield this._handle(e)})}};o(Gf,"Ed25519Provider");Vn();Pc();var o6={tile:0,"caip10-link":1,model:2,MID:3};function YA(r){let e=o6[r];if(typeof e!="undefined")return e;throw new Error(`No stream type registered for name ${r}`)}o(YA,"codeByName");function JA(r){let e=Object.entries(o6).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(JA,"nameByCode");var Cr=class{};o(Cr,"StreamType");Cr.nameByCode=JA;Cr.codeByName=YA;var op=at(Vf(),1);function $r(r){let e,t,n;return typeof r=="object"?(e=r.hashFunction,t=r.expiring,n=r.tags):e=r,(i,s,a)=>{if(a.value!=null)a.value=s6(a.value,e,t,n);else if(a.get!=null)a.get=s6(a.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o($r,"Memoize");var X0=new Map;function s6(r,e,t=0,n){let i=Symbol("__memoized_map__");return function(...s){let a;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[i];if(Array.isArray(n))for(let u of n)X0.has(u)?X0.get(u).push(f):X0.set(u,[f]);if(e||s.length>0||t>0){let u;e===!0?u=s.map(x=>x.toString()).join("!"):e?u=e.apply(this,s):u=s[0];let p=`${u}__timestamp`,b=!1;if(t>0)if(!f.has(p))b=!0;else{let x=f.get(p);b=Date.now()-x>t}f.has(u)&&!b?a=f.get(u):(a=r.apply(this,s),f.set(u,a),t>0&&f.set(p,Date.now()))}else{let u=this;f.has(u)?a=f.get(u):(a=r.apply(this,s),f.set(u,a))}return a}}o(s6,"getNewFunction");Vn();var Z0=at(Vf(),1);Ho();function ci(r){let e=Z0.default.decode(r),t=Z0.default.decode.bytes,n=r.slice(t);return[e,n,t]}o(ci,"readVarint");function XA(r){return r===0||r===1}o(XA,"isCidVersion");function Q0(r){let e=ep(r);if(e instanceof Error)throw e;return e}o(Q0,"readCid");function ep(r){let[e,t]=ci(r);if(!XA(e))return new Error(`Unknown CID version ${e}`);let[n,i]=ci(t),[,s,a]=ci(i),[f,,u]=ci(s),p=i.slice(0,a+u+f),b=i.slice(a+u+f);return[Pe.create(e,n,sf(p)),b]}o(ep,"readCidNoThrow");Vn();Pc();ff();var tp=at(Vf(),1);var Yf=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},hn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)};function ZA(r){let e=np(r);if(e instanceof Error)throw e;return e}o(ZA,"fromBytes");function np(r){let[e,t]=ci(r);if(e!==206)return new Error("fromBytes: invalid streamid, does not include streamid codec");let[n,i]=ci(t),s=ep(i);if(s instanceof Error)return s;let[a,f]=s;return f.length>0?new Error("Invalid StreamID: contains commit"):new Je(n,a)}o(np,"fromBytesNoThrow");function QA(r){let e=f6(r);if(e instanceof Error)throw e;return e}o(QA,"fromString");function f6(r){let e=r.replace("ceramic://","").replace("/ceramic/",""),t=e.includes("commit")?e.split("?")[0]:e,n=Uo.decode(t);return np(n)}o(f6,"fromStringNoThrow");var a6=Symbol.for("@ceramicnetwork/streamid/StreamID"),Je=class{constructor(e,t){if(this._tag=a6,!(e||e===0))throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");this._type=typeof e=="string"?Cr.codeByName(e):e,this._cid=typeof t=="string"?Pe.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===a6}static fromGenesis(e,t){return Z(this,null,function*(){let n=yield rs({value:t,codec:Ci,hasher:zo});return new Je(e,n.cid)})}get type(){return this._type}get typeName(){return Cr.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=tp.default.encode(206),t=tp.default.encode(this.type);return vn([e,t,this.cid.bytes])}get baseID(){return new Je(this._type,this._cid)}equals(e){return Je.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Uo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Je,"StreamID");Je.fromBytes=ZA;Je.fromBytesNoThrow=np;Je.fromString=QA;Je.fromStringNoThrow=f6;Yf([$r(),hn("design:type",String),hn("design:paramtypes",[])],Je.prototype,"typeName",null);Yf([$r(),hn("design:type",Uint8Array),hn("design:paramtypes",[])],Je.prototype,"bytes",null);Yf([$r(),hn("design:type",Je),hn("design:paramtypes",[])],Je.prototype,"baseID",null);Yf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toString",null);Yf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toUrl",null);var Da=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Dr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ip=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ri=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ca,hs,Jf;function eT(r){let e=sp(r);if(e instanceof Error)throw e;return e}o(eT,"fromBytes");function sp(r){let[e,t]=ci(r);if(e!==206)return new Error("fromBytes: invalid streamid, does not include streamid codec");let[n,i]=ci(t),s=Q0(i);if(s instanceof Error)return s;let[a,f]=s;if(f.length===0)return new Error("No commit information provided");if(f.length===1)return new ht(n,a,f[0]);{let[u]=Q0(f);return new ht(n,a,u)}}o(sp,"fromBytesNoThrow");function tT(r){try{return typeof r=="string"?Pe.parse(r):Pe.asCID(r)}catch(e){return}}o(tT,"parseCID");function rT(r,e=null){if(!e)return null;let t=tT(e);if(t)return r.equals(t)?null:t;if(String(e)==="0")return null;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(rT,"parseCommit");function nT(r){let e=u6(r);if(e instanceof Error)throw e;return e}o(nT,"fromString");function u6(r){let e=r.replace("ceramic://","").replace("/ceramic/","");if(e.includes("commit")){let t=e.split("?")[1].split("=")[1],n=e.split("?")[0];return l6(Je.fromString(n),t)}else return sp(Uo.decode(e))}o(u6,"fromStringNoThrow");var c6=Symbol.for("@ceramicnetwork/streamid/CommitID");function l6(r,e){return new ht(r.type,r.cid,e)}o(l6,"make");var ht=class{constructor(e,t,n=null){if(this._tag=c6,Ca.set(this,void 0),hs.set(this,void 0),Jf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");ip(this,Ca,typeof e=="string"?Cr.codeByName(e):e,"f"),ip(this,hs,typeof t=="string"?Pe.parse(t):t,"f"),ip(this,Jf,rT(Ri(this,hs,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===c6}get baseID(){return new Je(Ri(this,Ca,"f"),Ri(this,hs,"f"))}get type(){return Ri(this,Ca,"f")}get typeName(){return Cr.nameByCode(Ri(this,Ca,"f"))}get cid(){return Ri(this,hs,"f")}get commit(){return Ri(this,Jf,"f")||Ri(this,hs,"f")}get bytes(){var i;let e=op.default.encode(206),t=op.default.encode(this.type),n=((i=Ri(this,Jf,"f"))==null?void 0:i.bytes)||new Uint8Array([0]);return vn([e,t,this.cid.bytes,n])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Uo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Ca=new WeakMap,hs=new WeakMap,Jf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(ht,"CommitID");ht.fromBytes=eT;ht.fromBytesNoThrow=sp;ht.fromString=nT;ht.fromStringNoThrow=u6;ht.make=l6;Da([$r(),Dr("design:type",Je),Dr("design:paramtypes",[])],ht.prototype,"baseID",null);Da([$r(),Dr("design:type",String),Dr("design:paramtypes",[])],ht.prototype,"typeName",null);Da([$r(),Dr("design:type",Pe),Dr("design:paramtypes",[])],ht.prototype,"commit",null);Da([$r(),Dr("design:type",Uint8Array),Dr("design:paramtypes",[])],ht.prototype,"bytes",null);Da([$r(),Dr("design:type",Function),Dr("design:paramtypes",[]),Dr("design:returntype",String)],ht.prototype,"toString",null);Da([$r(),Dr("design:type",Function),Dr("design:paramtypes",[]),Dr("design:returntype",String)],ht.prototype,"toUrl",null);var xr;(function(r){function e(t){if(Je.isInstance(t))return t;if(ht.isInstance(t))return t;if(t instanceof Uint8Array){let n=ht.fromBytesNoThrow(t);return n instanceof Error?Je.fromBytes(t):n}else if(typeof t=="string"){let n=ht.fromStringNoThrow(t);return n instanceof Error?Je.fromString(t):n}else throw new Error("Can not build CommitID or StreamID")}o(e,"from"),r.from=e})(xr||(xr={}));var d6="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",il="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var ap={};St(ap,{JsonPatchError:()=>Nt,_areEquals:()=>Qf,applyOperation:()=>ps,applyPatch:()=>ll,applyReducer:()=>fT,deepClone:()=>sT,getValueByPointer:()=>cl,validate:()=>p6,validator:()=>ul});var iT=function(){var r=o(function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},r(e,t)},"extendStatics");return function(e,t){r(e,t);function n(){this.constructor=e}o(n,"__"),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),oT=Object.prototype.hasOwnProperty;function sl(r,e){return oT.call(r,e)}o(sl,"hasOwnProperty");function al(r){if(Array.isArray(r)){for(var e=new Array(r.length),t=0;t<e.length;t++)e[t]=""+t;return e}if(Object.keys)return Object.keys(r);var n=[];for(var i in r)sl(r,i)&&n.push(i);return n}o(al,"_objectKeys");function ir(r){switch(typeof r){case"object":return JSON.parse(JSON.stringify(r));case"undefined":return null;default:return r}}o(ir,"_deepClone");function fl(r){for(var e=0,t=r.length,n;e<t;){if(n=r.charCodeAt(e),n>=48&&n<=57){e++;continue}return!1}return!0}o(fl,"isInteger");function ui(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(ui,"escapePathComponent");function Xf(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Xf,"unescapePathComponent");function ol(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(ol(r[e]))return!0}else if(typeof r=="object"){for(var n=al(r),i=n.length,s=0;s<i;s++)if(ol(r[n[s]]))return!0}}return!1}o(ol,"hasUndefined");function h6(r,e){var t=[r];for(var n in e){var i=typeof e[n]=="object"?JSON.stringify(e[n],null,2):e[n];typeof i!="undefined"&&t.push(n+": "+i)}return t.join(`
789
- `)}o(h6,"patchErrorMessageFormatter");var Zf=function(r){iT(e,r);function e(t,n,i,s,a){var f=this.constructor,u=r.call(this,h6(t,{name:n,index:i,operation:s,tree:a}))||this;return u.name=n,u.index=i,u.operation=s,u.tree=a,Object.setPrototypeOf(u,f.prototype),u.message=h6(t,{name:n,index:i,operation:s,tree:a}),u}return o(e,"PatchError"),e}(Error);var Nt=Zf,sT=ir,Ia={add:function(r,e,t){return r[e]=this.value,{newDocument:t}},remove:function(r,e,t){var n=r[e];return delete r[e],{newDocument:t,removed:n}},replace:function(r,e,t){var n=r[e];return r[e]=this.value,{newDocument:t,removed:n}},move:function(r,e,t){var n=cl(t,this.path);n&&(n=ir(n));var i=ps(t,{op:"remove",path:this.from}).removed;return ps(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=cl(t,this.from);return ps(t,{op:"add",path:this.path,value:ir(n)}),{newDocument:t}},test:function(r,e,t){return{newDocument:t,test:Qf(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},aT={add:function(r,e,t){return fl(e)?r.splice(e,0,this.value):r[e]=this.value,{newDocument:t,index:e}},remove:function(r,e,t){var n=r.splice(e,1);return{newDocument:t,removed:n[0]}},replace:function(r,e,t){var n=r[e];return r[e]=this.value,{newDocument:t,removed:n}},move:Ia.move,copy:Ia.copy,test:Ia.test,_get:Ia._get};function cl(r,e){if(e=="")return r;var t={op:"_get",path:e};return ps(r,t),t.value}o(cl,"getValueByPointer");function ps(r,e,t,n,i,s){if(t===void 0&&(t=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=0),t&&(typeof t=="function"?t(e,0,r,e.path):ul(e,0)),e.path===""){var a={newDocument:r};if(e.op==="add")return a.newDocument=e.value,a;if(e.op==="replace")return a.newDocument=e.value,a.removed=r,a;if(e.op==="move"||e.op==="copy")return a.newDocument=cl(r,e.from),e.op==="move"&&(a.removed=r),a;if(e.op==="test"){if(a.test=Qf(r,e.value),a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a.newDocument=r,a}else{if(e.op==="remove")return a.removed=r,a.newDocument=null,a;if(e.op==="_get")return e.value=r,a;if(t)throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,e,r);return a}}else{n||(r=ir(r));var f=e.path||"",u=f.split("/"),p=r,b=1,x=u.length,A=void 0,O=void 0,T=void 0;for(typeof t=="function"?T=t:T=ul;;){if(O=u[b],O&&O.indexOf("~")!=-1&&(O=Xf(O)),i&&(O=="__proto__"||O=="prototype"&&b>0&&u[b-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(t&&A===void 0&&(p[O]===void 0?A=u.slice(0,b).join("/"):b==x-1&&(A=e.path),A!==void 0&&T(e,0,r,A)),b++,Array.isArray(p)){if(O==="-")O=p.length;else{if(t&&!fl(O))throw new Nt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,e,r);fl(O)&&(O=~~O)}if(b>=x){if(t&&e.op==="add"&&O>p.length)throw new Nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,e,r);var a=aT[e.op].call(e,p,O,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}}else if(b>=x){var a=Ia[e.op].call(e,p,O,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}if(p=p[O],t&&b<x&&(!p||typeof p!="object"))throw new Nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(ps,"applyOperation");function ll(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(r=ir(r));for(var s=new Array(e.length),a=0,f=e.length;a<f;a++)s[a]=ps(r,e[a],t,!0,i,a),r=s[a].newDocument;return s.newDocument=r,s}o(ll,"applyPatch");function fT(r,e,t){var n=ps(r,e);if(n.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(fT,"applyReducer");function ul(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new Nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if(Ia[r.op]){if(typeof r.path!="string")throw new Nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new Nt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,r,t);if((r.op==="move"||r.op==="copy")&&typeof r.from!="string")throw new Nt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,r,t);if((r.op==="add"||r.op==="replace"||r.op==="test")&&r.value===void 0)throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,r,t);if((r.op==="add"||r.op==="replace"||r.op==="test")&&ol(r.value))throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,r,t);if(t){if(r.op=="add"){var i=r.path.split("/").length,s=n.split("/").length;if(i!==s+1&&i!==s)throw new Nt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,r,t)}else if(r.op==="replace"||r.op==="remove"||r.op==="_get"){if(r.path!==n)throw new Nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,r,t)}else if(r.op==="move"||r.op==="copy"){var a={op:"_get",path:r.from,value:void 0},f=p6([a],t);if(f&&f.name==="OPERATION_PATH_UNRESOLVABLE")throw new Nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(ul,"validator");function p6(r,e,t){try{if(!Array.isArray(r))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)ll(ir(e),ir(r),t||!0);else{t=t||ul;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof Nt)return i;throw i}}o(p6,"validate");function Qf(r,e){if(r===e)return!0;if(r&&e&&typeof r=="object"&&typeof e=="object"){var t=Array.isArray(r),n=Array.isArray(e),i,s,a;if(t&&n){if(s=r.length,s!=e.length)return!1;for(i=s;i--!==0;)if(!Qf(r[i],e[i]))return!1;return!0}if(t!=n)return!1;var f=Object.keys(r);if(s=f.length,s!==Object.keys(e).length)return!1;for(i=s;i--!==0;)if(!e.hasOwnProperty(f[i]))return!1;for(i=s;i--!==0;)if(a=f[i],!Qf(r[a],e[a]))return!1;return!0}return r!==r&&e!==e}o(Qf,"_areEquals");var lp={};St(lp,{compare:()=>bT,generate:()=>fp,observe:()=>mT,unobserve:()=>pT});var cp=new WeakMap,cT=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),uT=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function lT(r){return cp.get(r)}o(lT,"getMirror");function dT(r,e){return r.observers.get(e)}o(dT,"getObserverFromMirror");function hT(r,e){r.observers.delete(e.callback)}o(hT,"removeObserverFromMirror");function pT(r,e){e.unobserve()}o(pT,"unobserve");function mT(r,e){var t=[],n,i=lT(r);if(!i)i=new cT(r),cp.set(r,i);else{var s=dT(i,e);n=s&&s.observer}if(n)return n;if(n={},i.value=ir(r),e){n.callback=e,n.next=null;var a=o(function(){fp(n)},"dirtyCheck"),f=o(function(){clearTimeout(n.next),n.next=setTimeout(a)},"fastCheck");typeof window!="undefined"&&(window.addEventListener("mouseup",f),window.addEventListener("keyup",f),window.addEventListener("mousedown",f),window.addEventListener("keydown",f),window.addEventListener("change",f))}return n.patches=t,n.object=r,n.unobserve=function(){fp(n),clearTimeout(n.next),hT(i,n),typeof window!="undefined"&&(window.removeEventListener("mouseup",f),window.removeEventListener("keyup",f),window.removeEventListener("mousedown",f),window.removeEventListener("keydown",f),window.removeEventListener("change",f))},i.observers.set(e,new uT(e,n)),n}o(mT,"observe");function fp(r,e){e===void 0&&(e=!1);var t=cp.get(r.object);up(t.value,r.object,r.patches,"",e),r.patches.length&&ll(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(fp,"generate");function up(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=al(e),a=al(r),f=!1,u=!1,p=a.length-1;p>=0;p--){var b=a[p],x=r[b];if(sl(e,b)&&!(e[b]===void 0&&x!==void 0&&Array.isArray(e)===!1)){var A=e[b];typeof x=="object"&&x!=null&&typeof A=="object"&&A!=null&&Array.isArray(x)===Array.isArray(A)?up(x,A,t,n+"/"+ui(b),i):x!==A&&(f=!0,i&&t.push({op:"test",path:n+"/"+ui(b),value:ir(x)}),t.push({op:"replace",path:n+"/"+ui(b),value:ir(A)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+ui(b),value:ir(x)}),t.push({op:"remove",path:n+"/"+ui(b)}),u=!0):(i&&t.push({op:"test",path:n,value:r}),t.push({op:"replace",path:n,value:e}),f=!0)}if(!(!u&&s.length==a.length))for(var p=0;p<s.length;p++){var b=s[p];!sl(r,b)&&e[b]!==void 0&&t.push({op:"add",path:n+"/"+ui(b),value:ir(e[b])})}}}o(up,"_generate");function bT(r,e,t){t===void 0&&(t=!1);var n=[];return up(r,e,n,"",t),n}o(bT,"compare");var Oa=Object.assign({},ap,lp,{JsonPatchError:Zf,deepClone:ir,escapePathComponent:ui,unescapePathComponent:Xf});var mw=at(nc(),1);var bw=at(ro(),1);var Ct;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC"})(Ct||(Ct={}));var Fp=at(nc(),1);var Sx=at(Ex(),1),{__extends:hr,__assign:$F,__rest:qF,__decorate:HF,__param:zF,__metadata:jF,__awaiter:Mx,__generator:El,__exportStar:KF,__createBinding:VF,__values:vs,__read:qr,__spread:WF,__spreadArrays:GF,__spreadArray:In,__await:Sl,__asyncGenerator:Ax,__asyncDelegator:YF,__asyncValues:Tx,__makeTemplateObject:JF,__importStar:XF,__importDefault:ZF,__classPrivateFieldGet:QF,__classPrivateFieldSet:e$,__classPrivateFieldIn:t$}=Sx.default;function rt(r){return typeof r=="function"}o(rt,"isFunction");function Ua(r){var e=o(function(n){Error.call(n),n.stack=new Error().stack},"_super"),t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}o(Ua,"createErrorClass");var Ml=Ua(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
788
+ `)}signMessage(){let e;switch(this.type){case Xu.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}};o(ka,"SiweMessage");var TM=5*60,jf;(function(r){function e(i){let s={h:{t:"eip4361"},p:{domain:i.domain,iat:i.issuedAt,iss:`did:pkh:eip155:${i.chainId}:${i.address}`,aud:i.uri,version:i.version,nonce:i.nonce}};return i.signature&&(s.s={t:"eip191",s:i.signature}),i.notBefore&&(s.p.nbf=i.notBefore),i.expirationTime&&(s.p.exp=i.expirationTime),i.statement&&(s.p.statement=i.statement),i.requestId&&(s.p.requestId=i.requestId),i.resources&&(s.p.resources=i.resources),s}o(e,"fromSiweMessage"),r.fromSiweMessage=e;function t(i,s={}){var a;if(i.h.t==="eip4361"&&((a=i.s)==null?void 0:a.t)==="eip191")return n(i,s);throw new Error("Unsupported CACAO signature type")}o(t,"verify"),r.verify=t;function n(i,s){var O;if(!i.s)throw new Error("CACAO does not have a signature");let a=s.atTime?s.atTime.getTime():Date.now(),f=((O=s.clockSkewSecs)!=null?O:TM)*1e3;if(Date.parse(i.p.iat)>a+f||Date.parse(i.p.nbf)>a+f)throw new Error("CACAO is not valid yet");let u=s.revocationPhaseOutSecs?s.revocationPhaseOutSecs*1e3:0;if(Date.parse(i.p.exp)+u+f<a)throw new Error("CACAO has expired");let p=ka.fromCacao(i),b=i.s.s,x=Jy(p.toMessage(),b),A=fs.parse(i.p.iss.replace("did:pkh:","")).address;if(x.toLowerCase()!==A.toLowerCase())throw new Error("Signature does not belong to issuer")}o(n,"verifyEIP191Signature"),r.verifyEIP191Signature=n})(jf||(jf={}));var Kf;(function(r){let e=o(function(t){try{return Promise.resolve(rs({value:t,codec:Ci,hasher:zo}))}catch(n){return Promise.reject(n)}},"fromCacao");r.fromCacao=e})(Kf||(Kf={}));uf();Hc();var Qy=at(ro(),1);uf();function e3(){return It((0,Qy.randomBytes)(16),"base64")}o(e3,"randomString");var t3="base64pad",r3="base64url";function n3(r){return It(r,t3)}o(n3,"encodeBase64");function i3(r){return It(r,r3)}o(i3,"encodeBase64Url");function o3(r){return Lt(r,t3)}o(o3,"decodeBase64");function Zu(r){return JSON.parse(It(Lt(r,r3)))}o(Zu,"base64urlToJSON");function s3(r){if(r.signatures.length>1)throw new Error("Cant convert to compact jws");return`${r.signatures[0].protected}.${r.payload}.${r.signatures[0].signature}`}o(s3,"fromDagJWS");function a3(r,e){if(e){let t=e.toISOString().split(".")[0]+"Z";return`${r}?versionTime=${t}`}else return r}o(a3,"didWithTime");function f3(r){return r?Array.isArray(r)?r:[r]:[]}o(f3,"extractControllers");function kM(r){return"registry"in r&&"cache"in r}o(kM,"isResolver");var ls=class{constructor({provider:e,resolver:t={},resolverOptions:n,capability:i,parent:s}={}){if(e!=null&&(this._client=new va(e)),i){if(this._capability=i,this._parentId=this._capability.p.iss,s&&this._parentId!==s)throw new Error("Capability issuer and parent not equal")}else s&&(this._parentId=s);this.setResolver(t,n)}get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return this._capability!=null}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return this._parentId!=null}get id(){if(this._id==null)throw new Error("DID is not authenticated");return this._id}get authenticated(){return this._id!=null}withCapability(e){var t;return new ls({provider:(t=this._client)==null?void 0:t.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new va(e);else if(this._client.connection!==e)throw new Error("A different provider is already set, create a new DID instance to use another provider")}setResolver(e,t){this._resolver=kM(e)?e:new rf(e,t)}authenticate(){return Z(this,arguments,function*({provider:e,paths:t=[],aud:n}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let i=e3(),s=yield this._client.request("did_authenticate",{nonce:i,aud:n,paths:t}),{kid:a}=yield this.verifyJWS(s),f=Zu(s.payload);if(!a.includes(f.did))throw new Error("Invalid authencation response, kid mismatch");if(f.nonce!==i)throw new Error("Invalid authencation response, wrong nonce");if(f.aud!==n)throw new Error("Invalid authencation response, wrong aud");if(f.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=f.did,this._id})}createJWS(n){return Z(this,arguments,function*(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");if(this._capability){let s=yield Kf.fromCacao(this._capability),a=Pe.asCID(s.cid);if(!a)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");t.protected=t.protected||{},t.protected.cap=`ipfs://${a==null?void 0:a.toString()}`}let{jws:i}=yield this._client.request("did_createJWS",Te(re({did:this._id},t),{payload:e}));return i})}createDagJWS(n){return Z(this,arguments,function*(e,t={}){let{cid:i,linkedBlock:s}=yield h2(e),a=i3(i.bytes);Object.assign(t,{linkedBlock:n3(s)});let f=yield this.createJWS(a,t),u=Pe.asCID(i);if(!u)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(f.link=u,this._capability){let p=yield Kf.fromCacao(this._capability);return{jws:f,linkedBlock:s,cacaoBlock:p.bytes}}return{jws:f,linkedBlock:s}})}verifyJWS(n){return Z(this,arguments,function*(e,t={}){var b,x,A,O,T,k,$;typeof e!="string"&&(e=s3(e));let i=Zu(e.split(".")[0]).kid;if(!i)throw new Error('No "kid" found in jws');let s=yield this.resolve(i);if(!t.disableTimecheck){let C=(b=s.didDocumentMetadata)==null?void 0:b.nextUpdate;if(C){let z=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,H=new Date(C).valueOf()+z;if(!(t.atTime&&t.atTime.getTime()<H))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${i}`)}let B=(x=s.didDocumentMetadata)==null?void 0:x.updated;if(B&&t.atTime&&t.atTime.getTime()<new Date(B).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${i}`)}let f=(A=s.didDocument)==null?void 0:A.id;if(t.issuer&&t.issuer===((O=t.capability)==null?void 0:O.p.iss)&&f===t.capability.p.aud)jf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(t.issuer&&t.issuer!==f){let C=a3(t.issuer,t.atTime),z=(T=(yield this.resolve(C)).didDocument)==null?void 0:T.controller,H=f3(z);if(((k=t.capability)==null?void 0:k.s)&&t.capability.p.aud===f&&H.includes(t.capability.p.iss))jf.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs});else if(!(f?H.includes(f):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${i}`)}let u=(($=s.didDocument)==null?void 0:$.verificationMethod)||[];tv(e,u);let p;try{p=Zu(e.split(".")[1])}catch(C){}return{kid:i,payload:p,didResolutionResult:s}})}createJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield iv(t,this._resolver);return nv(e,a,n.protectedHeader,n.aad)})}createDagJWE(i,s){return Z(this,arguments,function*(e,t,n={}){let a=yield p2(e);return this.createJWE(a,t,n)})}decryptJWE(n){return Z(this,arguments,function*(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");let{cleartext:i}=yield this._client.request("did_decryptJWE",Te(re({did:this._id},t),{jwe:e}));return o3(i)})}decryptDagJWE(e){return Z(this,null,function*(){let t=yield this.decryptJWE(e);return m2(t)})}resolve(e){return Z(this,null,function*(){let t=yield this._resolver.resolve(e);if(t.didResolutionMetadata.error){let{error:n,message:i}=t.didResolutionMetadata,s=i?`, ${i}`:"";throw new Error(`Failed to resolve ${e}: ${n}${s}`)}return t})}};o(ls,"DID");function Qu(r){var e=0,t=r.length,n=[];if(t%2)throw new Error("invalid hex:"+r);for(;e<t;e+=2)n.push(parseInt(r.substr(e,2),16));return new Uint8Array(n)}o(Qu,"toUint8Array");var c4=at(t6());var nl=at(uu(),1);var a6=at(n6(),1);var KA="base64pad";function i6(r){return JSON.parse((0,a6.default)(r))}o(i6,"toStableObject");function VA(r){let e=new Uint8Array(r.length+2);return e[0]=237,e[1]=1,e.set(r,2),`did:key:z${It(e,"base58btc")}`}o(VA,"encodeDID");function o6(r){let[e,t,n]=r.split(".");return{payload:t,signatures:[{protected:e,signature:n}]}}o(o6,"toGeneralJWS");var s6=o((i,s,a,...f)=>Z(void 0,[i,s,a,...f],function*(r,e,t,n={}){let u=`${e}#${e.split(":")[2]}`,p=Jg(t),b=i6(Object.assign(n,{kid:u,alg:"EdDSA"}));return ev(typeof r=="string"?r:i6(r),p,b)}),"sign"),WA={did_authenticate:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){let s=yield s6({did:r,aud:t.aud,nonce:t.nonce,paths:t.paths,exp:Math.floor(Date.now()/1e3)+600},r,e);return o6(s)}),did_createJWS:(n,i)=>Z(void 0,[n,i],function*({did:r,secretKey:e},t){if(t.did.split("#")[0]!==r)throw new Tr(4100,`Unknown DID: ${r}`);let a=yield s6(t.payload,r,e,t.protected);return{jws:o6(a)}}),did_decryptJWE:(t,n)=>Z(void 0,[t,n],function*({secretKey:r},e){let i=sv((0,nl.convertSecretKeyToX25519)(r));try{let s=yield rv(e.jwe,i);return{cleartext:It(s,KA)}}catch(s){throw new Tr(-32e3,s.message)}})},Gf=class{constructor(e){let{secretKey:t,publicKey:n}=(0,nl.generateKeyPairFromSeed)(e),i=VA(n),s=_2(WA);this._handle=a=>Z(this,null,function*(){return yield s({did:i,secretKey:t},a)})}get isDidProvider(){return!0}send(e){return Z(this,null,function*(){return yield this._handle(e)})}};o(Gf,"Ed25519Provider");Vn();Pc();var f6={tile:0,"caip10-link":1,model:2,MID:3};function GA(r){let e=f6[r];if(typeof e!="undefined")return e;throw new Error(`No stream type registered for name ${r}`)}o(GA,"codeByName");function YA(r){let e=Object.entries(f6).find(([,t])=>t===r);if(e)return e[0];throw new Error(`No stream type registered for index ${r}`)}o(YA,"nameByCode");var Cr=class{};o(Cr,"StreamType");Cr.nameByCode=YA;Cr.codeByName=GA;var op=at(Vf(),1);function $r(r){let e,t,n;return typeof r=="object"?(e=r.hashFunction,t=r.expiring,n=r.tags):e=r,(i,s,a)=>{if(a.value!=null)a.value=c6(a.value,e,t,n);else if(a.get!=null)a.get=c6(a.get,e,t,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}o($r,"Memoize");var X0=new Map;function c6(r,e,t=0,n){let i=Symbol("__memoized_map__");return function(...s){let a;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[i];if(Array.isArray(n))for(let u of n)X0.has(u)?X0.get(u).push(f):X0.set(u,[f]);if(e||s.length>0||t>0){let u;e===!0?u=s.map(x=>x.toString()).join("!"):e?u=e.apply(this,s):u=s[0];let p=`${u}__timestamp`,b=!1;if(t>0)if(!f.has(p))b=!0;else{let x=f.get(p);b=Date.now()-x>t}f.has(u)&&!b?a=f.get(u):(a=r.apply(this,s),f.set(u,a),t>0&&f.set(p,Date.now()))}else{let u=this;f.has(u)?a=f.get(u):(a=r.apply(this,s),f.set(u,a))}return a}}o(c6,"getNewFunction");Vn();var Z0=at(Vf(),1);Ho();function ci(r){let e=Z0.default.decode(r),t=Z0.default.decode.bytes,n=r.slice(t);return[e,n,t]}o(ci,"readVarint");function JA(r){return r===0||r===1}o(JA,"isCidVersion");function Q0(r){let e=ep(r);if(e instanceof Error)throw e;return e}o(Q0,"readCid");function ep(r){let[e,t]=ci(r);if(!JA(e))return new Error(`Unknown CID version ${e}`);let[n,i]=ci(t),[,s,a]=ci(i),[f,,u]=ci(s),p=i.slice(0,a+u+f),b=i.slice(a+u+f);return[Pe.create(e,n,sf(p)),b]}o(ep,"readCidNoThrow");Vn();Pc();ff();var tp=at(Vf(),1);var Yf=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},hn=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)};function XA(r){let e=np(r);if(e instanceof Error)throw e;return e}o(XA,"fromBytes");function np(r){let[e,t]=ci(r);if(e!==206)return new Error("fromBytes: invalid streamid, does not include streamid codec");let[n,i]=ci(t),s=ep(i);if(s instanceof Error)return s;let[a,f]=s;return f.length>0?new Error("Invalid StreamID: contains commit"):new Je(n,a)}o(np,"fromBytesNoThrow");function ZA(r){let e=l6(r);if(e instanceof Error)throw e;return e}o(ZA,"fromString");function l6(r){let e=r.replace("ceramic://","").replace("/ceramic/",""),t=e.includes("commit")?e.split("?")[0]:e,n=Uo.decode(t);return np(n)}o(l6,"fromStringNoThrow");var u6=Symbol.for("@ceramicnetwork/streamid/StreamID"),Je=class{constructor(e,t){if(this._tag=u6,!(e||e===0))throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");this._type=typeof e=="string"?Cr.codeByName(e):e,this._cid=typeof t=="string"?Pe.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===u6}static fromGenesis(e,t){return Z(this,null,function*(){let n=yield rs({value:t,codec:Ci,hasher:zo});return new Je(e,n.cid)})}get type(){return this._type}get typeName(){return Cr.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=tp.default.encode(206),t=tp.default.encode(this.type);return vn([e,t,this.cid.bytes])}get baseID(){return new Je(this._type,this._cid)}equals(e){return Je.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Uo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(Je,"StreamID");Je.fromBytes=XA;Je.fromBytesNoThrow=np;Je.fromString=ZA;Je.fromStringNoThrow=l6;Yf([$r(),hn("design:type",String),hn("design:paramtypes",[])],Je.prototype,"typeName",null);Yf([$r(),hn("design:type",Uint8Array),hn("design:paramtypes",[])],Je.prototype,"bytes",null);Yf([$r(),hn("design:type",Je),hn("design:paramtypes",[])],Je.prototype,"baseID",null);Yf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toString",null);Yf([$r(),hn("design:type",Function),hn("design:paramtypes",[]),hn("design:returntype",String)],Je.prototype,"toUrl",null);var Ia=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Dr=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},ip=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ri=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Da,hs,Jf;function QA(r){let e=sp(r);if(e instanceof Error)throw e;return e}o(QA,"fromBytes");function sp(r){let[e,t]=ci(r);if(e!==206)return new Error("fromBytes: invalid streamid, does not include streamid codec");let[n,i]=ci(t),s=Q0(i);if(s instanceof Error)return s;let[a,f]=s;if(f.length===0)return new Error("No commit information provided");if(f.length===1)return new ht(n,a,f[0]);{let[u]=Q0(f);return new ht(n,a,u)}}o(sp,"fromBytesNoThrow");function eT(r){try{return typeof r=="string"?Pe.parse(r):Pe.asCID(r)}catch(e){return}}o(eT,"parseCID");function tT(r,e=null){if(!e)return null;let t=eT(e);if(t)return r.equals(t)?null:t;if(String(e)==="0")return null;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}o(tT,"parseCommit");function rT(r){let e=h6(r);if(e instanceof Error)throw e;return e}o(rT,"fromString");function h6(r){let e=r.replace("ceramic://","").replace("/ceramic/","");if(e.includes("commit")){let t=e.split("?")[1].split("=")[1],n=e.split("?")[0];return p6(Je.fromString(n),t)}else return sp(Uo.decode(e))}o(h6,"fromStringNoThrow");var d6=Symbol.for("@ceramicnetwork/streamid/CommitID");function p6(r,e){return new ht(r.type,r.cid,e)}o(p6,"make");var ht=class{constructor(e,t,n=null){if(this._tag=d6,Da.set(this,void 0),hs.set(this,void 0),Jf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");ip(this,Da,typeof e=="string"?Cr.codeByName(e):e,"f"),ip(this,hs,typeof t=="string"?Pe.parse(t):t,"f"),ip(this,Jf,tT(Ri(this,hs,"f"),n),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===d6}get baseID(){return new Je(Ri(this,Da,"f"),Ri(this,hs,"f"))}get type(){return Ri(this,Da,"f")}get typeName(){return Cr.nameByCode(Ri(this,Da,"f"))}get cid(){return Ri(this,hs,"f")}get commit(){return Ri(this,Jf,"f")||Ri(this,hs,"f")}get bytes(){var i;let e=op.default.encode(206),t=op.default.encode(this.type),n=((i=Ri(this,Jf,"f"))==null?void 0:i.bytes)||new Uint8Array([0]);return vn([e,t,this.cid.bytes,n])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Uo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Da=new WeakMap,hs=new WeakMap,Jf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};o(ht,"CommitID");ht.fromBytes=QA;ht.fromBytesNoThrow=sp;ht.fromString=rT;ht.fromStringNoThrow=h6;ht.make=p6;Ia([$r(),Dr("design:type",Je),Dr("design:paramtypes",[])],ht.prototype,"baseID",null);Ia([$r(),Dr("design:type",String),Dr("design:paramtypes",[])],ht.prototype,"typeName",null);Ia([$r(),Dr("design:type",Pe),Dr("design:paramtypes",[])],ht.prototype,"commit",null);Ia([$r(),Dr("design:type",Uint8Array),Dr("design:paramtypes",[])],ht.prototype,"bytes",null);Ia([$r(),Dr("design:type",Function),Dr("design:paramtypes",[]),Dr("design:returntype",String)],ht.prototype,"toString",null);Ia([$r(),Dr("design:type",Function),Dr("design:paramtypes",[]),Dr("design:returntype",String)],ht.prototype,"toUrl",null);var xr;(function(r){function e(t){if(Je.isInstance(t))return t;if(ht.isInstance(t))return t;if(t instanceof Uint8Array){let n=ht.fromBytesNoThrow(t);return n instanceof Error?Je.fromBytes(t):n}else if(typeof t=="string"){let n=ht.fromStringNoThrow(t);return n instanceof Error?Je.fromString(t):n}else throw new Error("Can not build CommitID or StreamID")}o(e,"from"),r.from=e})(xr||(xr={}));var m6="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",il="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var ap={};St(ap,{JsonPatchError:()=>Nt,_areEquals:()=>Qf,applyOperation:()=>ps,applyPatch:()=>ll,applyReducer:()=>aT,deepClone:()=>oT,getValueByPointer:()=>cl,validate:()=>g6,validator:()=>ul});var nT=function(){var r=o(function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},r(e,t)},"extendStatics");return function(e,t){r(e,t);function n(){this.constructor=e}o(n,"__"),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),iT=Object.prototype.hasOwnProperty;function sl(r,e){return iT.call(r,e)}o(sl,"hasOwnProperty");function al(r){if(Array.isArray(r)){for(var e=new Array(r.length),t=0;t<e.length;t++)e[t]=""+t;return e}if(Object.keys)return Object.keys(r);var n=[];for(var i in r)sl(r,i)&&n.push(i);return n}o(al,"_objectKeys");function ir(r){switch(typeof r){case"object":return JSON.parse(JSON.stringify(r));case"undefined":return null;default:return r}}o(ir,"_deepClone");function fl(r){for(var e=0,t=r.length,n;e<t;){if(n=r.charCodeAt(e),n>=48&&n<=57){e++;continue}return!1}return!0}o(fl,"isInteger");function ui(r){return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}o(ui,"escapePathComponent");function Xf(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}o(Xf,"unescapePathComponent");function ol(r){if(r===void 0)return!0;if(r){if(Array.isArray(r)){for(var e=0,t=r.length;e<t;e++)if(ol(r[e]))return!0}else if(typeof r=="object"){for(var n=al(r),i=n.length,s=0;s<i;s++)if(ol(r[n[s]]))return!0}}return!1}o(ol,"hasUndefined");function b6(r,e){var t=[r];for(var n in e){var i=typeof e[n]=="object"?JSON.stringify(e[n],null,2):e[n];typeof i!="undefined"&&t.push(n+": "+i)}return t.join(`
789
+ `)}o(b6,"patchErrorMessageFormatter");var Zf=function(r){nT(e,r);function e(t,n,i,s,a){var f=this.constructor,u=r.call(this,b6(t,{name:n,index:i,operation:s,tree:a}))||this;return u.name=n,u.index=i,u.operation=s,u.tree=a,Object.setPrototypeOf(u,f.prototype),u.message=b6(t,{name:n,index:i,operation:s,tree:a}),u}return o(e,"PatchError"),e}(Error);var Nt=Zf,oT=ir,Oa={add:function(r,e,t){return r[e]=this.value,{newDocument:t}},remove:function(r,e,t){var n=r[e];return delete r[e],{newDocument:t,removed:n}},replace:function(r,e,t){var n=r[e];return r[e]=this.value,{newDocument:t,removed:n}},move:function(r,e,t){var n=cl(t,this.path);n&&(n=ir(n));var i=ps(t,{op:"remove",path:this.from}).removed;return ps(t,{op:"add",path:this.path,value:i}),{newDocument:t,removed:n}},copy:function(r,e,t){var n=cl(t,this.from);return ps(t,{op:"add",path:this.path,value:ir(n)}),{newDocument:t}},test:function(r,e,t){return{newDocument:t,test:Qf(r[e],this.value)}},_get:function(r,e,t){return this.value=r[e],{newDocument:t}}},sT={add:function(r,e,t){return fl(e)?r.splice(e,0,this.value):r[e]=this.value,{newDocument:t,index:e}},remove:function(r,e,t){var n=r.splice(e,1);return{newDocument:t,removed:n[0]}},replace:function(r,e,t){var n=r[e];return r[e]=this.value,{newDocument:t,removed:n}},move:Oa.move,copy:Oa.copy,test:Oa.test,_get:Oa._get};function cl(r,e){if(e=="")return r;var t={op:"_get",path:e};return ps(r,t),t.value}o(cl,"getValueByPointer");function ps(r,e,t,n,i,s){if(t===void 0&&(t=!1),n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=0),t&&(typeof t=="function"?t(e,0,r,e.path):ul(e,0)),e.path===""){var a={newDocument:r};if(e.op==="add")return a.newDocument=e.value,a;if(e.op==="replace")return a.newDocument=e.value,a.removed=r,a;if(e.op==="move"||e.op==="copy")return a.newDocument=cl(r,e.from),e.op==="move"&&(a.removed=r),a;if(e.op==="test"){if(a.test=Qf(r,e.value),a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a.newDocument=r,a}else{if(e.op==="remove")return a.removed=r,a.newDocument=null,a;if(e.op==="_get")return e.value=r,a;if(t)throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,e,r);return a}}else{n||(r=ir(r));var f=e.path||"",u=f.split("/"),p=r,b=1,x=u.length,A=void 0,O=void 0,T=void 0;for(typeof t=="function"?T=t:T=ul;;){if(O=u[b],O&&O.indexOf("~")!=-1&&(O=Xf(O)),i&&(O=="__proto__"||O=="prototype"&&b>0&&u[b-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(t&&A===void 0&&(p[O]===void 0?A=u.slice(0,b).join("/"):b==x-1&&(A=e.path),A!==void 0&&T(e,0,r,A)),b++,Array.isArray(p)){if(O==="-")O=p.length;else{if(t&&!fl(O))throw new Nt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,e,r);fl(O)&&(O=~~O)}if(b>=x){if(t&&e.op==="add"&&O>p.length)throw new Nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,e,r);var a=sT[e.op].call(e,p,O,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}}else if(b>=x){var a=Oa[e.op].call(e,p,O,r);if(a.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,e,r);return a}if(p=p[O],t&&b<x&&(!p||typeof p!="object"))throw new Nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,r)}}}o(ps,"applyOperation");function ll(r,e,t,n,i){if(n===void 0&&(n=!0),i===void 0&&(i=!0),t&&!Array.isArray(e))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(r=ir(r));for(var s=new Array(e.length),a=0,f=e.length;a<f;a++)s[a]=ps(r,e[a],t,!0,i,a),r=s[a].newDocument;return s.newDocument=r,s}o(ll,"applyPatch");function aT(r,e,t){var n=ps(r,e);if(n.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",t,e,r);return n.newDocument}o(aT,"applyReducer");function ul(r,e,t,n){if(typeof r!="object"||r===null||Array.isArray(r))throw new Nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,r,t);if(Oa[r.op]){if(typeof r.path!="string")throw new Nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,r,t);if(r.path.indexOf("/")!==0&&r.path.length>0)throw new Nt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,r,t);if((r.op==="move"||r.op==="copy")&&typeof r.from!="string")throw new Nt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,r,t);if((r.op==="add"||r.op==="replace"||r.op==="test")&&r.value===void 0)throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,r,t);if((r.op==="add"||r.op==="replace"||r.op==="test")&&ol(r.value))throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,r,t);if(t){if(r.op=="add"){var i=r.path.split("/").length,s=n.split("/").length;if(i!==s+1&&i!==s)throw new Nt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,r,t)}else if(r.op==="replace"||r.op==="remove"||r.op==="_get"){if(r.path!==n)throw new Nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,r,t)}else if(r.op==="move"||r.op==="copy"){var a={op:"_get",path:r.from,value:void 0},f=g6([a],t);if(f&&f.name==="OPERATION_PATH_UNRESOLVABLE")throw new Nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,r,t)}}}else throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,r,t)}o(ul,"validator");function g6(r,e,t){try{if(!Array.isArray(r))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)ll(ir(e),ir(r),t||!0);else{t=t||ul;for(var n=0;n<r.length;n++)t(r[n],n,e,void 0)}}catch(i){if(i instanceof Nt)return i;throw i}}o(g6,"validate");function Qf(r,e){if(r===e)return!0;if(r&&e&&typeof r=="object"&&typeof e=="object"){var t=Array.isArray(r),n=Array.isArray(e),i,s,a;if(t&&n){if(s=r.length,s!=e.length)return!1;for(i=s;i--!==0;)if(!Qf(r[i],e[i]))return!1;return!0}if(t!=n)return!1;var f=Object.keys(r);if(s=f.length,s!==Object.keys(e).length)return!1;for(i=s;i--!==0;)if(!e.hasOwnProperty(f[i]))return!1;for(i=s;i--!==0;)if(a=f[i],!Qf(r[a],e[a]))return!1;return!0}return r!==r&&e!==e}o(Qf,"_areEquals");var lp={};St(lp,{compare:()=>mT,generate:()=>fp,observe:()=>pT,unobserve:()=>hT});var cp=new WeakMap,fT=function(){function r(e){this.observers=new Map,this.obj=e}return o(r,"Mirror"),r}(),cT=function(){function r(e,t){this.callback=e,this.observer=t}return o(r,"ObserverInfo"),r}();function uT(r){return cp.get(r)}o(uT,"getMirror");function lT(r,e){return r.observers.get(e)}o(lT,"getObserverFromMirror");function dT(r,e){r.observers.delete(e.callback)}o(dT,"removeObserverFromMirror");function hT(r,e){e.unobserve()}o(hT,"unobserve");function pT(r,e){var t=[],n,i=uT(r);if(!i)i=new fT(r),cp.set(r,i);else{var s=lT(i,e);n=s&&s.observer}if(n)return n;if(n={},i.value=ir(r),e){n.callback=e,n.next=null;var a=o(function(){fp(n)},"dirtyCheck"),f=o(function(){clearTimeout(n.next),n.next=setTimeout(a)},"fastCheck");typeof window!="undefined"&&(window.addEventListener("mouseup",f),window.addEventListener("keyup",f),window.addEventListener("mousedown",f),window.addEventListener("keydown",f),window.addEventListener("change",f))}return n.patches=t,n.object=r,n.unobserve=function(){fp(n),clearTimeout(n.next),dT(i,n),typeof window!="undefined"&&(window.removeEventListener("mouseup",f),window.removeEventListener("keyup",f),window.removeEventListener("mousedown",f),window.removeEventListener("keydown",f),window.removeEventListener("change",f))},i.observers.set(e,new cT(e,n)),n}o(pT,"observe");function fp(r,e){e===void 0&&(e=!1);var t=cp.get(r.object);up(t.value,r.object,r.patches,"",e),r.patches.length&&ll(t.value,r.patches);var n=r.patches;return n.length>0&&(r.patches=[],r.callback&&r.callback(n)),n}o(fp,"generate");function up(r,e,t,n,i){if(e!==r){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=al(e),a=al(r),f=!1,u=!1,p=a.length-1;p>=0;p--){var b=a[p],x=r[b];if(sl(e,b)&&!(e[b]===void 0&&x!==void 0&&Array.isArray(e)===!1)){var A=e[b];typeof x=="object"&&x!=null&&typeof A=="object"&&A!=null&&Array.isArray(x)===Array.isArray(A)?up(x,A,t,n+"/"+ui(b),i):x!==A&&(f=!0,i&&t.push({op:"test",path:n+"/"+ui(b),value:ir(x)}),t.push({op:"replace",path:n+"/"+ui(b),value:ir(A)}))}else Array.isArray(r)===Array.isArray(e)?(i&&t.push({op:"test",path:n+"/"+ui(b),value:ir(x)}),t.push({op:"remove",path:n+"/"+ui(b)}),u=!0):(i&&t.push({op:"test",path:n,value:r}),t.push({op:"replace",path:n,value:e}),f=!0)}if(!(!u&&s.length==a.length))for(var p=0;p<s.length;p++){var b=s[p];!sl(r,b)&&e[b]!==void 0&&t.push({op:"add",path:n+"/"+ui(b),value:ir(e[b])})}}}o(up,"_generate");function mT(r,e,t){t===void 0&&(t=!1);var n=[];return up(r,e,n,"",t),n}o(mT,"compare");var Pa=Object.assign({},ap,lp,{JsonPatchError:Zf,deepClone:ir,escapePathComponent:ui,unescapePathComponent:Xf});var vw=at(nc(),1);var yw=at(ro(),1);var Ct;(function(r){r[r.PREFER_CACHE=0]="PREFER_CACHE",r[r.SYNC_ALWAYS=1]="SYNC_ALWAYS",r[r.NEVER_SYNC=2]="NEVER_SYNC"})(Ct||(Ct={}));var Fp=at(nc(),1);var Tx=at(Ax(),1),{__extends:hr,__assign:qF,__rest:HF,__decorate:zF,__param:jF,__metadata:KF,__awaiter:kx,__generator:El,__exportStar:VF,__createBinding:WF,__values:vs,__read:qr,__spread:GF,__spreadArrays:YF,__spreadArray:In,__await:Sl,__asyncGenerator:Cx,__asyncDelegator:JF,__asyncValues:Dx,__makeTemplateObject:XF,__importStar:ZF,__importDefault:QF,__classPrivateFieldGet:e$,__classPrivateFieldSet:t$,__classPrivateFieldIn:r$}=Tx.default;function rt(r){return typeof r=="function"}o(rt,"isFunction");function Fa(r){var e=o(function(n){Error.call(n),n.stack=new Error().stack},"_super"),t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}o(Fa,"createErrorClass");var Ml=Fa(function(r){return o(function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
790
790
  `+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
791
- `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function ys(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(ys,"arrRemove");var go=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return o(r,"Subscription"),r.prototype.unsubscribe=function(){var e,t,n,i,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var f=vs(a),u=f.next();!u.done;u=f.next()){var p=u.value;p.remove(this)}}catch(k){e={error:k}}finally{try{u&&!u.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}else a.remove(this);var b=this.initialTeardown;if(rt(b))try{b()}catch(k){s=k instanceof Ml?k.errors:[k]}var x=this._finalizers;if(x){this._finalizers=null;try{for(var A=vs(x),O=A.next();!O.done;O=A.next()){var T=O.value;try{kx(T)}catch(k){s=s!=null?s:[],k instanceof Ml?s=In(In([],qr(s)),qr(k.errors)):s.push(k)}}}catch(k){n={error:k}}finally{try{O&&!O.done&&(i=A.return)&&i.call(A)}finally{if(n)throw n.error}}}if(s)throw new Ml(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)kx(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&ys(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&ys(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var Tp=go.EMPTY;function Al(r){return r instanceof go||r&&"closed"in r&&rt(r.remove)&&rt(r.add)&&rt(r.unsubscribe)}o(Al,"isSubscription");function kx(r){rt(r)?r():r.unsubscribe()}o(kx,"execFinalizer");var On={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Fa={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=Fa.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,In([r,e],qr(t))):setTimeout.apply(void 0,In([r,e],qr(t)))},clearTimeout:function(r){var e=Fa.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function Tl(r){Fa.setTimeout(function(){var e=On.onUnhandledError;if(e)e(r);else throw r})}o(Tl,"reportUnhandledError");function kp(){}o(kp,"noop");var Cx=function(){return Cp("C",void 0,void 0)}();function Dx(r){return Cp("E",void 0,r)}o(Dx,"errorNotification");function Ix(r){return Cp("N",r,void 0)}o(Ix,"nextNotification");function Cp(r,e,t){return{kind:r,value:e,error:t}}o(Cp,"createNotification");var xs=null;function $a(r){if(On.useDeprecatedSynchronousErrorHandling){var e=!xs;if(e&&(xs={errorThrown:!1,error:null}),r(),e){var t=xs,n=t.errorThrown,i=t.error;if(xs=null,n)throw i}}else r()}o($a,"errorContext");function Ox(r){On.useDeprecatedSynchronousErrorHandling&&xs&&(xs.errorThrown=!0,xs.error=r)}o(Ox,"captureError");var ic=function(r){hr(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Al(t)&&t.add(n)):n.destination=Wk,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new Cl(t,n,i)},e.prototype.next=function(t){this.isStopped?Ip(Ix(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Ip(Dx(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Ip(Cx,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(go);var jk=Function.prototype.bind;function Dp(r,e){return jk.call(r,e)}o(Dp,"bind");var Kk=function(){function r(e){this.partialObserver=e}return o(r,"ConsumerObserver"),r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){kl(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){kl(n)}else kl(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){kl(t)}},r}(),Cl=function(r){hr(e,r);function e(t,n,i){var s=r.call(this)||this,a;if(rt(t)||!t)a={next:t!=null?t:void 0,error:n!=null?n:void 0,complete:i!=null?i:void 0};else{var f;s&&On.useDeprecatedNextContext?(f=Object.create(t),f.unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Dp(t.next,f),error:t.error&&Dp(t.error,f),complete:t.complete&&Dp(t.complete,f)}):a=t}return s.destination=new Kk(a),s}return o(e,"SafeSubscriber"),e}(ic);function kl(r){On.useDeprecatedSynchronousErrorHandling?Ox(r):Tl(r)}o(kl,"handleUnhandledError");function Vk(r){throw r}o(Vk,"defaultErrorHandler");function Ip(r,e){var t=On.onStoppedNotification;t&&Fa.setTimeout(function(){return t(r,e)})}o(Ip,"handleStoppedNotification");var Wk={closed:!0,next:kp,error:Vk,complete:kp};var qa=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ha(r){return r}o(Ha,"identity");function Px(r){return r.length===0?Ha:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(Px,"pipeFromArray");var _t=function(){function r(e){e&&(this._subscribe=e)}return o(r,"Observable"),r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,s=Yk(e)?e:new Cl(e,t,n);return $a(function(){var a=i,f=a.operator,u=a.source;s.add(f?f.call(s,u):u?i._subscribe(s):i._trySubscribe(s))}),s},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=Nx(t),new t(function(i,s){var a=new Cl({next:function(f){try{e(f)}catch(u){s(u),a.unsubscribe()}},error:s,complete:i});n.subscribe(a)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[qa]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Px(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=Nx(e),new e(function(n,i){var s;t.subscribe(function(a){return s=a},function(a){return i(a)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();function Nx(r){var e;return(e=r!=null?r:On.Promise)!==null&&e!==void 0?e:Promise}o(Nx,"getPromiseCtor");function Gk(r){return r&&rt(r.next)&&rt(r.error)&&rt(r.complete)}o(Gk,"isObserver");function Yk(r){return r&&r instanceof ic||Gk(r)&&Al(r)}o(Yk,"isSubscriber");function Jk(r){return rt(r==null?void 0:r.lift)}o(Jk,"hasLift");function Yt(r){return function(e){if(Jk(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}o(Yt,"operate");function Jt(r,e,t,n,i){return new Xk(r,e,t,n,i)}o(Jt,"createOperatorSubscriber");var Xk=function(r){hr(e,r);function e(t,n,i,s,a,f){var u=r.call(this,t)||this;return u.onFinalize=a,u.shouldUnsubscribe=f,u._next=n?function(p){try{n(p)}catch(b){t.error(b)}}:r.prototype._next,u._error=s?function(p){try{s(p)}catch(b){t.error(b)}finally{this.unsubscribe()}}:r.prototype._error,u._complete=i?function(){try{i()}catch(p){t.error(p)}finally{this.unsubscribe()}}:r.prototype._complete,u}return o(e,"OperatorSubscriber"),e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(ic);var Rx=Ua(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Op=function(r){hr(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o(e,"Subject"),e.prototype.lift=function(t){var n=new Lx(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new Rx},e.prototype.next=function(t){var n=this;$a(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=vs(n.currentObservers),f=a.next();!f.done;f=a.next()){var u=f.value;u.next(t)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;$a(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;$a(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,s=i.hasError,a=i.isStopped,f=i.observers;return s||a?Tp:(this.currentObservers=null,f.push(t),new go(function(){n.currentObservers=null,ys(f,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,a=n.isStopped;i?t.error(s):a&&t.complete()},e.prototype.asObservable=function(){var t=new _t;return t.source=this,t},e.create=function(t,n){return new Lx(t,n)},e}(_t);var Lx=function(r){hr(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return o(e,"AnonymousSubject"),e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:Tp},e}(Op);var Pp=function(r){hr(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return o(e,"BehaviorSubject"),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,s=t._value;if(n)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(Op);var Np={now:function(){return(Np.delegate||Date).now()},delegate:void 0};var Bx=function(r){hr(e,r);function e(t,n){return r.call(this)||this}return o(e,"Action"),e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e}(go);var oc={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=oc.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,In([r,e],qr(t))):setInterval.apply(void 0,In([r,e],qr(t)))},clearInterval:function(r){var e=oc.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(r)},delegate:void 0};var Ux=function(r){hr(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.pending=!1,i}return o(e,"AsyncAction"),e.prototype.schedule=function(t,n){if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),oc.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;oc.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var i=!1,s;try{this.work(t)}catch(a){i=!0,s=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ys(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(Bx);var Rp=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return o(r,"Scheduler"),r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=Np.now,r}();var Fx=function(r){hr(e,r);function e(t,n){n===void 0&&(n=Rp.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,i._scheduled=void 0,i}return o(e,"AsyncScheduler"),e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,i){for(;t=n.shift();)t.unsubscribe();throw i}},e}(Rp);var Zk=new Fx(Ux),$x=Zk;var Dl=new _t(function(r){return r.complete()});function Il(r){return r&&rt(r.schedule)}o(Il,"isScheduler");function qx(r){return r[r.length-1]}o(qx,"last");function Hx(r){return Il(qx(r))?r.pop():void 0}o(Hx,"popScheduler");function zx(r,e){return typeof qx(r)=="number"?r.pop():e}o(zx,"popNumber");var za=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function Ol(r){return rt(r==null?void 0:r.then)}o(Ol,"isPromise");function Pl(r){return rt(r[qa])}o(Pl,"isInteropObservable");function Nl(r){return Symbol.asyncIterator&&rt(r==null?void 0:r[Symbol.asyncIterator])}o(Nl,"isAsyncIterable");function Rl(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}o(Rl,"createInvalidObservableTypeError");function Qk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(Qk,"getSymbolIterator");var Ll=Qk();function Bl(r){return rt(r==null?void 0:r[Ll])}o(Bl,"isIterable");function Ul(r){return Ax(this,arguments,o(function(){var t,n,i,s;return El(this,function(a){switch(a.label){case 0:t=r.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Sl(t.read())];case 3:return n=a.sent(),i=n.value,s=n.done,s?[4,Sl(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Sl(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(Ul,"readableStreamLikeToAsyncGenerator");function Fl(r){return rt(r==null?void 0:r.getReader)}o(Fl,"isReadableStreamLike");function pr(r){if(r instanceof _t)return r;if(r!=null){if(Pl(r))return eC(r);if(za(r))return tC(r);if(Ol(r))return rC(r);if(Nl(r))return jx(r);if(Bl(r))return nC(r);if(Fl(r))return iC(r)}throw Rl(r)}o(pr,"innerFrom");function eC(r){return new _t(function(e){var t=r[qa]();if(rt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(eC,"fromInteropObservable");function tC(r){return new _t(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(tC,"fromArrayLike");function rC(r){return new _t(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Tl)})}o(rC,"fromPromise");function nC(r){return new _t(function(e){var t,n;try{for(var i=vs(r),s=i.next();!s.done;s=i.next()){var a=s.value;if(e.next(a),e.closed)return}}catch(f){t={error:f}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}o(nC,"fromIterable");function jx(r){return new _t(function(e){oC(r,e).catch(function(t){return e.error(t)})})}o(jx,"fromAsyncIterable");function iC(r){return jx(Ul(r))}o(iC,"fromReadableStreamLike");function oC(r,e){var t,n,i,s;return Mx(this,void 0,void 0,function(){var a,f;return El(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=Tx(r),u.label=1;case 1:return[4,t.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(a=n.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return f=u.sent(),i={error:f},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}o(oC,"process");function pn(r,e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(s),!i)return s}o(pn,"executeSchedule");function $l(r,e){return e===void 0&&(e=0),Yt(function(t,n){t.subscribe(Jt(n,function(i){return pn(n,r,function(){return n.next(i)},e)},function(){return pn(n,r,function(){return n.complete()},e)},function(i){return pn(n,r,function(){return n.error(i)},e)}))})}o($l,"observeOn");function ql(r,e){return e===void 0&&(e=0),Yt(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(ql,"subscribeOn");function Kx(r,e){return pr(r).pipe(ql(e),$l(e))}o(Kx,"scheduleObservable");function Vx(r,e){return pr(r).pipe(ql(e),$l(e))}o(Vx,"schedulePromise");function Wx(r,e){return new _t(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(Wx,"scheduleArray");function Gx(r,e){return new _t(function(t){var n;return pn(t,e,function(){n=r[Ll](),pn(t,e,function(){var i,s,a;try{i=n.next(),s=i.value,a=i.done}catch(f){t.error(f);return}a?t.complete():t.next(s)},0,!0)}),function(){return rt(n==null?void 0:n.return)&&n.return()}})}o(Gx,"scheduleIterable");function Hl(r,e){if(!r)throw new Error("Iterable cannot be null");return new _t(function(t){pn(t,e,function(){var n=r[Symbol.asyncIterator]();pn(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(Hl,"scheduleAsyncIterable");function Yx(r,e){return Hl(Ul(r),e)}o(Yx,"scheduleReadableStreamLike");function Jx(r,e){if(r!=null){if(Pl(r))return Kx(r,e);if(za(r))return Wx(r,e);if(Ol(r))return Vx(r,e);if(Nl(r))return Hl(r,e);if(Bl(r))return Gx(r,e);if(Fl(r))return Yx(r,e)}throw Rl(r)}o(Jx,"scheduled");function Xx(r,e){return e?Jx(r,e):pr(r)}o(Xx,"from");var zl=Ua(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function Zx(r){return r instanceof Date&&!isNaN(r)}o(Zx,"isValidDate");function jl(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){n.next(r.call(e,s,i++))}))})}o(jl,"map");var sC=Array.isArray;function aC(r,e){return sC(e)?r.apply(void 0,In([],qr(e))):r(e)}o(aC,"callOrApply");function Qx(r){return jl(function(e){return aC(r,e)})}o(Qx,"mapOneOrManyArgs");function ew(r,e,t,n,i,s,a,f){var u=[],p=0,b=0,x=!1,A=o(function(){x&&!u.length&&!p&&e.complete()},"checkComplete"),O=o(function(k){return p<n?T(k):u.push(k)},"outerNext"),T=o(function(k){s&&e.next(k),p++;var $=!1;pr(t(k,b++)).subscribe(Jt(e,function(C){i==null||i(C),s?O(C):e.next(C)},function(){$=!0},void 0,function(){if($)try{p--;for(var C=o(function(){var B=u.shift();a?pn(e,a,function(){return T(B)}):T(B)},"_loop_1");u.length&&p<n;)C();A()}catch(B){e.error(B)}}))},"doInnerSub");return r.subscribe(Jt(e,O,function(){x=!0,A()})),function(){f==null||f()}}o(ew,"mergeInternals");function sc(r,e,t){return t===void 0&&(t=1/0),rt(e)?sc(function(n,i){return jl(function(s,a){return e(n,s,i,a)})(pr(r(n,i)))},t):(typeof e=="number"&&(t=e),Yt(function(n,i){return ew(n,i,r,t)}))}o(sc,"mergeMap");function tw(r){return r===void 0&&(r=1/0),sc(Ha,r)}o(tw,"mergeAll");var fC=["addListener","removeListener"],cC=["addEventListener","removeEventListener"],uC=["on","off"];function ac(r,e,t,n){if(rt(t)&&(n=t,t=void 0),n)return ac(r,e,t).pipe(Qx(n));var i=qr(hC(r)?cC.map(function(f){return function(u){return r[f](e,u,t)}}):lC(r)?fC.map(rw(r,e)):dC(r)?uC.map(rw(r,e)):[],2),s=i[0],a=i[1];if(!s&&za(r))return sc(function(f){return ac(f,e,t)})(pr(r));if(!s)throw new TypeError("Invalid event target");return new _t(function(f){var u=o(function(){for(var p=[],b=0;b<arguments.length;b++)p[b]=arguments[b];return f.next(1<p.length?p:p[0])},"handler");return s(u),function(){return a(u)}})}o(ac,"fromEvent");function rw(r,e){return function(t){return function(n){return r[t](e,n)}}}o(rw,"toCommonHandlerRegistry");function lC(r){return rt(r.addListener)&&rt(r.removeListener)}o(lC,"isNodeStyleEventEmitter");function dC(r){return rt(r.on)&&rt(r.off)}o(dC,"isJQueryStyleEventEmitter");function hC(r){return rt(r.addEventListener)&&rt(r.removeEventListener)}o(hC,"isEventTarget");function fc(r,e,t){r===void 0&&(r=0),t===void 0&&(t=$x);var n=-1;return e!=null&&(Il(e)?t=e:n=e),new _t(function(i){var s=Zx(r)?+r-t.now():r;s<0&&(s=0);var a=0;return t.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},s)})}o(fc,"timer");function Lp(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Hx(r),n=zx(r,1/0),i=r;return i.length?i.length===1?pr(i[0]):tw(n)(Xx(i,t)):Dl}o(Lp,"merge");function nw(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(nw,"filter");function iw(r){return Yt(function(e,t){var n=!1;e.subscribe(Jt(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(iw,"defaultIfEmpty");function ow(r){return r<=0?function(){return Dl}:Yt(function(e,t){var n=0;e.subscribe(Jt(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(ow,"take");function sw(r){return r===void 0&&(r=pC),Yt(function(e,t){var n=!1;e.subscribe(Jt(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(sw,"throwIfEmpty");function pC(){return new zl}o(pC,"defaultErrorFactory");function Bp(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?nw(function(i,s){return r(i,s,n)}):Ha,ow(1),t?iw(e):sw(function(){return new zl}))}}o(Bp,"first");var mC={leading:!0,trailing:!1};function Up(r,e){return e===void 0&&(e=mC),Yt(function(t,n){var i=e.leading,s=e.trailing,a=!1,f=null,u=null,p=!1,b=o(function(){u==null||u.unsubscribe(),u=null,s&&(O(),p&&n.complete())},"endThrottling"),x=o(function(){u=null,p&&n.complete()},"cleanupThrottling"),A=o(function(T){return u=pr(r(T)).subscribe(Jt(n,b,x))},"startThrottle"),O=o(function(){if(a){a=!1;var T=f;f=null,n.next(T),!p&&A(T)}},"send");t.subscribe(Jt(n,function(T){a=!0,f=T,!(u&&!u.closed)&&(i?O():A(T))},function(){p=!0,!(s&&a&&u&&!u.closed)&&n.complete()}))})}o(Up,"throttle");var aw;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(aw||(aw={}));var ws;(function(r){r[r.NOT_REQUESTED=0]="NOT_REQUESTED",r[r.PENDING=1]="PENDING",r[r.PROCESSING=2]="PROCESSING",r[r.ANCHORED=3]="ANCHORED",r[r.FAILED=4]="FAILED"})(ws||(ws={}));var $p;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})($p||($p={}));var Pn=class extends _t{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new Je(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){var n;let{next:e,content:t}=this.state$.value;return(0,Fp.default)((n=e==null?void 0:e.content)!=null?n:t)}get controllers(){return this.metadata.controllers}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return ht.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>ht.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===$p.ANCHOR).map(({cid:e})=>ht.make(this.id,e))}get state(){return(0,Fp.default)(this.state$.value)}sync(){return Z(this,arguments,function*(e={}){e=re({sync:Ct.PREFER_CACHE},e);let t=yield this.api.loadStream(this.id,e);this.state$.next(t.state)})}requestAnchor(){return Z(this,null,function*(){return this.api.requestAnchor(this.id)})}};o(Pn,"Stream");function vo(){return r=>{}}o(vo,"StreamStatic");var uw=at(require("cross-fetch"),1);function fw(r){let e=new AbortController;if(r.length===0)throw Error("Need abort signals to create a merged abort signal");return r.some(t=>t.aborted)?(e.abort(),e.signal):(Lp(...r.map(t=>ac(t,"abort"))).pipe(Bp()).subscribe(()=>{e.abort()}),e.signal)}o(fw,"mergeAbortSignals");var cc=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=fc(e).subscribe(()=>{t.abort()})}clear(){var e;(e=this._subscription)==null||e.unsubscribe()}};o(cc,"TimedAbortSignal");function cw(r,e){return Z(this,null,function*(){let t=new AbortController,n=o(()=>{t.abort()},"onAbort");return r.addEventListener("abort",n),r.aborted&&t.abort(),e(t.signal).finally(()=>{r.removeEventListener("abort",n)})})}o(cw,"abortable");var bC=60*1e3*3;function wr(t){return Z(this,arguments,function*(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{"Content-Type":"application/json"}});let n=e.timeout||bC,i=new cc(n),s=e.signal?fw([e.signal,i.signal]):i.signal,a=yield cw(s,f=>(0,uw.default)(String(r),Te(re({},e),{signal:f}))).finally(()=>i.clear());if(!a.ok){let f=yield a.text();throw new Error(`HTTP request to '${r}' failed with status '${a.statusText}': ${f}`)}return a.json()})}o(wr,"fetchJson");var uc=at(nc(),1);Vn();function Ui(r){let e=Pe.asCID(r);if(e)return e;if(typeof r=="string")return Pe.parse(r);if(r instanceof Uint8Array)return Pe.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(Ui,"toCID");var lw=0,yt=class{static streamIdFromState(e){return new Je(e.type,e.log[0].cid)}static serializeCommit(e){var n;let t=(0,uc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=It(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=It(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(e)&&(t.link=t.link.toString()),yt.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),(n=e.header)!=null&&n.model&&(t.header.model=e.header.model.toString()),t)}static deserializeCommit(e){var n;let t=(0,uc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=Ui(t.jws.link),t.linkedBlock=Lt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Lt(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(t)&&(t.link=Ui(t.link)),yt.isAnchorCommit(t)&&(t.proof=Ui(t.proof)),t.id&&(t.id=Ui(t.id)),t.prev&&(t.prev=Ui(t.prev)),(n=t.header)!=null&&n.model&&(t.header.model=Je.fromString(t.header.model)),t)}static serializeState(e){var n,i,s,a;let t=(0,uc.default)(e);return t.log=t.log.map(f=>Te(re({},f),{cid:f.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=ws[t.anchorStatus]),t.anchorScheduledFor!=null&&(t.anchorScheduledFor=new Date(t.anchorScheduledFor).toISOString()),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),(n=e.metadata)!=null&&n.model&&(t.metadata.model=e.metadata.model.toString()),(s=(i=e.next)==null?void 0:i.metadata)!=null&&s.model&&(t.next.metadata.model=e.next.metadata.model.toString()),((a=e.metadata)==null?void 0:a.unique)&&e.type!=lw&&(t.metadata.unique=It(t.metadata.unique,"base64")),t.doctype=Cr.nameByCode(t.type),t}static deserializeState(e){var i,s,a,f;let t=(0,uc.default)(e);t.doctype&&(t.type=Cr.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(u=>Te(re({},u),{cid:Ui(u.cid)})),t.anchorProof&&(t.anchorProof.txHash=Ui(t.anchorProof.txHash),t.anchorProof.root=Ui(t.anchorProof.root));let n=!0;return t.anchorStatus&&(t.anchorStatus=ws[t.anchorStatus],n=t.anchorStatus!==ws.FAILED&&t.anchorStatus!==ws.ANCHORED),t.anchorScheduledFor&&(n?t.anchorScheduledFor=Date.parse(t.anchorScheduledFor):delete t.anchorScheduledFor),(i=e.metadata)!=null&&i.model&&(t.metadata.model=Je.fromString(e.metadata.model)),(a=(s=e.next)==null?void 0:s.metadata)!=null&&a.model&&(t.next.metadata.model=Je.fromString(e.next.metadata.model)),((f=e.metadata)==null?void 0:f.unique)&&e.type!=lw&&(t.metadata.unique=Lt(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(yt.serializeState(e))===JSON.stringify(yt.serializeState(t))}static isStateSupersetOf(e,t){if(e.log.length<t.log.length)return!1;for(let n in t.log)if(!e.log[n].cid.equals(t.log[n].cid))return!1;return e.anchorStatus==t.anchorStatus}static assertCommitLinksToState(e,t){let n=this.streamIdFromState(e);if(t.id&&!t.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${n.toString()}. Found: ${t.id}, expected ${e.log[0].cid}`);let i=e.log[e.log.length-1].cid;if(!t.prev.equals(i))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${i}, found 'prev' ${t.prev}`)}static convertCommitToSignedCommitContainer(e,t){return Z(this,null,function*(){if(yt.isSignedCommit(e)){let n=yield t.block.get(e.link);return{jws:e,linkedBlock:n}}return e})}static isSignedCommitContainer(e){return e&&e.jws!==void 0}static isSignedCommit(e){return e&&e.link!==void 0}static isAnchorCommit(e){return e&&e.proof!==void 0}static isSignedCommitData(e){return e&&e.envelope!==void 0}static isAnchorCommitData(e){return e&&e.proof!==void 0}};o(yt,"StreamUtils");function dw(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new fs({address:e,chainId:t})}return new fs(r)}o(dw,"normalizeAccountId");var lc=class extends Pp{next(e){let t=this.value;yt.statesEqual(t,e)||super.next(e)}};o(lc,"StreamStateSubject");var gC=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Hr,qp={anchor:!0,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},vC={sync:Ct.PREFER_CACHE},hw={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Hp(r,e){var n;if(typeof(r==null?void 0:r.schema)=="string")try{ht.fromString(r.schema)}catch(i){throw new Error("Schema must be a CommitID")}let t={controllers:r==null?void 0:r.controllers,family:r==null?void 0:r.family,schema:(n=r==null?void 0:r.schema)==null?void 0:n.toString(),tags:r==null?void 0:r.tags};if(e)r!=null&&r.deterministic||(t.unique=It((0,bw.randomBytes)(12),"base64")),r!=null&&r.forbidControllerChange&&(t.forbidControllerChange=!0);else{if((r==null?void 0:r.deterministic)!==void 0||(r==null?void 0:r.unique)!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if((r==null?void 0:r.forbidControllerChange)!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(t).forEach(i=>t[i]===void 0&&delete t[i]),t}o(Hp,"headerFromMetadata");function pw(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(pw,"_ensureAuthenticated");function zp(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(zp,"throwReadOnlyError");var zr=Hr=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){var n;let{next:e,metadata:t}=this.state$.value;return(0,mw.default)((n=e==null?void 0:e.metadata)!=null?n:t)}static create(s,a,f){return Z(this,arguments,function*(e,t,n,i={}){i=re(re({},qp),i),!(n!=null&&n.deterministic)&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let u=i.asDID?{did:i.asDID}:e,p=yield Hr.makeGenesis(u,t,n);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,p,i)})}static createFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){var f;n=re(re({},qp),n),((f=t.header)==null?void 0:f.unique)&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=t.data?yield Hr._signDagJWS(e,t):t;return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,a,n)})}static deterministic(i,s){return Z(this,arguments,function*(e,t,n={}){if(n=re(re({},qp),n),t=Te(re({},t),{deterministic:!0}),t.family==null&&t.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let a=yield Hr.makeGenesis(e,null,t);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,a,n)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},vC),n);let a=xr.from(t);if(a.type!=Hr.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Hr.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}update(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},hw),n);let a=n.asDID?{did:n.asDID}:this.api,f=yield this.makeCommit(a,e,t),u=yield this.api.applyCommit(this.id,f,n);this.state$.next(u.state)})}patch(n){return Z(this,arguments,function*(e,t={}){t=re(re({},hw),t);let s={header:Hp(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},a=yield Hr._signDagJWS(this.api,s),f=yield this.api.applyCommit(this.id,a,t);this.state$.next(f.state)})}makeReadOnly(){this.update=zp,this.patch=zp,this.sync=zp,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}makeCommit(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawCommit(e,t,n);return Hr._signDagJWS(e,i)})}_makeRawCommit(e,t,n){return Z(this,null,function*(){let i=Hp(n,!1);if(t==null&&(t=this.content),i.controllers){if(i.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!i.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let s=Oa.compare(this.content,t);return{header:i,data:s,prev:this.tip,id:this.state.log[0].cid}})}static makeGenesis(e,t,n){return Z(this,null,function*(){var a;if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did)yield pw(e),n.controllers=[e.did.hasParent?e.did.parent:e.did.id];else throw new Error("No controllers specified");if(((a=n.controllers)==null?void 0:a.length)!==1)throw new Error("Exactly one controller must be specified");let i=Hp(n,!0);if((n==null?void 0:n.deterministic)&&t)throw new Error("Initial content must be null when creating a deterministic Tile document");if(t==null){let f={header:i};return If(f),f}let s={data:t,header:i};return Hr._signDagJWS(e,s)})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield pw(e),e.did.createDagJWS(t)})}},"TileDocument");zr.STREAM_TYPE_NAME="tile";zr.STREAM_TYPE_ID=0;zr=Hr=gC([vo()],zr);var Sw=at(xw(),1);function TC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(TC,"_checkPrivateRedeclaration");function kC(r,e){return e.get?e.get.call(r):e.value}o(kC,"_classApplyDescriptorGet");function CC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(CC,"_classApplyDescriptorSet");function Ew(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Ew,"_classExtractFieldDescriptor");function Vp(r,e){var t=Ew(r,e,"get");return kC(r,t)}o(Vp,"_classPrivateFieldGet");function ww(r,e,t){TC(r,e),e.set(r,t)}o(ww,"_classPrivateFieldInit");function _w(r,e,t){var n=Ew(r,e,"set");return CC(r,n,t),t}o(_w,"_classPrivateFieldSet");function DC(r){return typeof r=="string"||ht.isInstance(r)||Je.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(DC,"keyToQuery");function Wp(r){return typeof r=="string"?xr.from(r).toString():ht.isInstance(r)||Je.isInstance(r)?r.toString():r.streamId.toString()}o(Wp,"keyToString");function Yp(r){return Z(this,null,function*(){let e=yield zr.makeGenesis({},null,Te(re({},r),{deterministic:!0})),t=yield Je.fromGenesis("tile",e);return{genesis:e,streamId:t}})}o(Yp,"getDeterministicQuery");var IC=o(()=>Promise.resolve([]),"tempBatchLoadFn"),Kl=new WeakMap,Gp=new WeakMap,mn=class extends Sw.default{cache(e){if(!Vp(this,Gp))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}create(e,t,n){return Z(this,null,function*(){let i=yield zr.create(Vp(this,Kl),e,t,n);return this.cache(i),i})}deterministic(e,t){return Z(this,null,function*(){let n=yield Yp(e);try{return yield md(mn.prototype,this,"load").call(this,n)}catch(i){let s=yield zr.createFromGenesis(Vp(this,Kl),n.genesis,t);return this.cache(s),s}})}load(e){return Z(this,null,function*(){return yield md(mn.prototype,this,"load").call(this,e)})}update(e,t,n,i){return Z(this,null,function*(){let s=Wp(e);this.clear(s);let a=yield this.load({streamId:s});return yield a.update(t,n,i),a})}constructor(e){super(IC,{cache:!0,cacheKeyFn:Wp,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),ww(this,Kl,{writable:!0,value:void 0}),ww(this,Gp,{writable:!0,value:void 0}),this._batchLoadFn=t=>Z(this,null,function*(){e.cache||this.clearAll();let n=yield e.ceramic.multiQuery(t.map(DC),e.multiqueryTimeout);return t.map(i=>{let s=Wp(i),a=n[s];return a||new Error(`Failed to load stream: ${s}`)})}),_w(this,Kl,e.ceramic),_w(this,Gp,!!e.cache)}};o(mn,"TileLoader");function OC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(OC,"_checkPrivateRedeclaration");function PC(r,e){return e.get?e.get.call(r):e.value}o(PC,"_classApplyDescriptorGet");function NC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(NC,"_classApplyDescriptorSet");function Aw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Aw,"_classExtractFieldDescriptor");function _s(r,e){var t=Aw(r,e,"get");return PC(r,t)}o(_s,"_classPrivateFieldGet");function Mw(r,e,t){OC(r,e),e.set(r,t)}o(Mw,"_classPrivateFieldInit");function Jp(r,e,t){var n=Aw(r,e,"set");return NC(r,n,t),t}o(Jp,"_classPrivateFieldSet");var ja=new WeakMap,Ka=new WeakMap,Va=class{get aliases(){return _s(this,ja)}get loader(){return _s(this,Ka)}getDefinitionID(e){var t;return(t=_s(this,ja).definitions[e])!=null?t:null}getSchemaURL(e){var t;return(t=_s(this,ja).schemas[e])!=null?t:null}getTileID(e){var t;return(t=_s(this,ja).tiles[e])!=null?t:null}loadTile(e){return Z(this,null,function*(){let t=this.getTileID(e);if(t==null)throw new Error(`Tile alias "${e}" is not defined`);return yield _s(this,Ka).load(t)})}createTile(i,s){return Z(this,arguments,function*(e,t,n={}){let a=this.getSchemaURL(e);if(a==null)throw new Error(`Schema alias "${e}" is not defined`);let b=n,{controller:f}=b,u=Cm(b,["controller"]),p={schema:a};return f!=null&&(p.controllers=[f]),yield _s(this,Ka).create(t,p,u)})}constructor(e){if(Mw(this,ja,{writable:!0,value:void 0}),Mw(this,Ka,{writable:!0,value:void 0}),Jp(this,ja,e.aliases),e.loader!=null)Jp(this,Ka,e.loader);else{if(e.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");Jp(this,Ka,new mn({ceramic:e.ceramic,cache:e.cache}))}}};o(Va,"DataModel");function RC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(RC,"_checkPrivateRedeclaration");function LC(r,e){return e.get?e.get.call(r):e.value}o(LC,"_classApplyDescriptorGet");function BC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(BC,"_classApplyDescriptorSet");function Tw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Tw,"_classExtractFieldDescriptor");function li(r,e){var t=Tw(r,e,"get");return LC(r,t)}o(li,"_classPrivateFieldGet");function Vl(r,e,t){RC(r,e),e.set(r,t)}o(Vl,"_classPrivateFieldInit");function Wl(r,e,t){var n=Tw(r,e,"set");return BC(r,n,t),t}o(Wl,"_classPrivateFieldSet");var Gl=new WeakMap,Es=new WeakMap,Xp=new WeakMap,Yl=new WeakMap,dc=class{_createValuePromise(){Wl(this,Xp,new Promise((e,t)=>{Wl(this,Yl,{resolve:e,reject:t})}))}change(e){return new Promise((t,n)=>{let i=o(s=>Z(this,null,function*(){try{let a=yield e(s);t(),this._next(a)}catch(a){n(a),this._next(s)}}),"run");li(this,Es).push({reject:n,run:i}),li(this,Es).length===1&&this._start()})}changeContent(e){return Z(this,null,function*(){let t=o(n=>Z(this,null,function*(){return yield n.update(e(n.content),n.metadata),n}),"mutation");return yield this.change(t)})}get(){return Z(this,null,function*(){return li(this,Es).length===0?yield li(this,Gl).call(this):yield li(this,Xp)})}_start(){return Z(this,null,function*(){try{let e=yield li(this,Gl).call(this);this._next(e)}catch(e){li(this,Es).forEach(t=>{t.reject(e)}),Wl(this,Es,[]),li(this,Yl).reject(e),this._createValuePromise()}})}_next(e){let t=li(this,Es).shift();t==null?this._end(e):t.run(e)}_end(e){li(this,Yl).resolve(e),this._createValuePromise()}constructor(e){Vl(this,Gl,{writable:!0,value:void 0}),Vl(this,Es,{writable:!0,value:[]}),Vl(this,Xp,{writable:!0,value:void 0}),Vl(this,Yl,{writable:!0,value:void 0}),Wl(this,Gl,e),this._createValuePromise()}};o(dc,"TileProxy");var UC=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function FC(r){return UC.test(r)}o(FC,"isDIDstring");function $C(r){if(!FC(r))throw new Error(`Invalid DID: ${r}`)}o($C,"assertDIDstring");function Zp(r){return $C(r),{controllers:[r],family:"IDX"}}o(Zp,"getIDXMetadata");function qC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(qC,"_checkPrivateRedeclaration");function HC(r,e){return e.get?e.get.call(r):e.value}o(HC,"_classApplyDescriptorGet");function zC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(zC,"_classApplyDescriptorSet");function kw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(kw,"_classExtractFieldDescriptor");function Ut(r,e){var t=kw(r,e,"get");return HC(r,t)}o(Ut,"_classPrivateFieldGet");function hc(r,e,t){qC(r,e),e.set(r,t)}o(hc,"_classPrivateFieldInit");function Jl(r,e,t){var n=kw(r,e,"set");return zC(r,n,t),t}o(Jl,"_classPrivateFieldSet");var Fi=new WeakMap,Xl=new WeakMap,Qp=new WeakMap,di=new WeakMap,Zl=new WeakMap,pc=class{get authenticated(){return Ut(this,Fi).did!=null}get ceramic(){return Ut(this,Fi)}get id(){if(Ut(this,Xl)!=null)return Ut(this,Xl);if(Ut(this,Fi).did==null)throw new Error("Ceramic instance is not authenticated");return Ut(this,Fi).did.hasParent?Ut(this,Fi).did.parent:Ut(this,Fi).did.id}get loader(){return Ut(this,di)}get model(){return Ut(this,Zl)}has(e,t){return Z(this,null,function*(){let n=this.getDefinitionID(e);return(yield this.getRecordID(n,t))!=null})}get(e,t){return Z(this,null,function*(){let n=this.getDefinitionID(e);return yield this.getRecord(n,t)})}getMultiple(e,t){return Z(this,null,function*(){var f,u,p;let n=this.getDefinitionID(e),i=yield Promise.all(t.map(b=>Z(this,null,function*(){let{genesis:x,streamId:A}=yield Yp(Zp(b));return{genesis:x,streamId:A.toString(),paths:[n]}}))),s=yield Ut(this,Fi).multiQuery(i),a=[];for(let b of i){let x=(u=(f=s[b.streamId])==null?void 0:f.content)==null?void 0:u[n],A=x?s[Je.fromString(x).toString()]:null;a.push((p=A==null?void 0:A.content)!=null?p:null)}return a})}set(i,s){return Z(this,arguments,function*(e,t,n={}){var p;let a=this.getDefinitionID(e),[f,u]=yield this._setRecordOnly(a,t,n);return f&&(yield this._setReference((p=n.controller)!=null?p:this.id,a,u)),u})}merge(i,s){return Z(this,arguments,function*(e,t,n={}){let a=this.getDefinitionID(e),f=yield this.getRecord(a),u=f?re(re({},f),t):t;return yield this.setRecord(a,u,n)})}setAll(n){return Z(this,arguments,function*(e,t={}){var f;let i=Object.entries(e).map(b=>Z(this,[b],function*([u,p]){let x=this.getDefinitionID(u),[A,O]=yield this._setRecordOnly(x,p,t);return[A,x,O]})),a=(yield Promise.all(i)).reduce((u,[p,b,x])=>(p&&(u[b]=x.toUrl()),u),{});return yield this._setReferences((f=t.controller)!=null?f:this.id,a),a})}setDefaults(n){return Z(this,arguments,function*(e,t={}){var u,p;let i=(u=yield this.getIndex())!=null?u:{},s=Object.entries(e).map(([b,x])=>[this.getDefinitionID(b),x]).filter(b=>i[b[0]]==null).map(A=>Z(this,[A],function*([b,x]){let O=yield this.getDefinition(b),T=yield this._createRecord(O,x,t);return{[b]:T.toUrl()}})),f=(yield Promise.all(s)).reduce((b,x)=>Object.assign(b,x),{});return yield this._setReferences((p=t.controller)!=null?p:this.id,f),f})}remove(n){return Z(this,arguments,function*(e,t=this.id){yield this._getIndexProxy(t).changeContent(i=>(i!=null&&delete i[this.getDefinitionID(e)],i))})}getIndex(){return Z(this,arguments,function*(e=this.id){let t=this.authenticated&&e===this.id?yield this._getIndexProxy(e).get():yield this._getIDXDoc(e);return t?t.content:null})}iterator(e){let t,n=0;return{[Symbol.asyncIterator](){return this},next:()=>Z(this,null,function*(){if(t==null){let f=yield this.getIndex(e);t=Object.entries(f!=null?f:{})}if(n===t.length)return{done:!0,value:null};let[i,s]=t[n++],a=yield Ut(this,di).load(s);return{done:!1,value:{key:i,id:s,record:a.content}}})}}_createIDXDoc(e){return Z(this,null,function*(){return yield Ut(this,di).deterministic(Zp(e))})}_getIDXDoc(e){return Z(this,null,function*(){let t=yield this._createIDXDoc(e);if(t.content==null||t.metadata.schema==null)return null;if(t.metadata.schema!==il)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getOwnIDXDoc(e){return Z(this,null,function*(){let t=yield this._createIDXDoc(e);if(t.content==null||t.metadata.schema==null)yield t.update({},{schema:il});else if(t.metadata.schema!==il)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getIndexProxy(e){let t=Ut(this,Qp)[e];return t==null&&(t=new dc(()=>Z(this,null,function*(){return yield this._getOwnIDXDoc(e)})),Ut(this,Qp)[e]=t),t}getDefinitionID(e){var t;return(t=Ut(this,Zl).getDefinitionID(e))!=null?t:e}getDefinition(e){return Z(this,null,function*(){let t=yield Ut(this,di).load(e);if(t.metadata.schema!==d6)throw new Error("Invalid document: schema is not Definition");return Te(re({},t.content),{id:t.id})})}getRecordID(e,t){return Z(this,null,function*(){var i;let n=yield this.getIndex(t!=null?t:this.id);return(i=n==null?void 0:n[e])!=null?i:null})}getRecordDocument(e,t){return Z(this,null,function*(){let n=yield this.getRecordID(e,t);return n?yield Ut(this,di).load(n):null})}getRecord(e,t){return Z(this,null,function*(){let n=yield this.getRecordDocument(e,t);return n?n.content:null})}setRecord(i,s){return Z(this,arguments,function*(e,t,n={}){var u;let[a,f]=yield this._setRecordOnly(e,t,n);return a&&(yield this._setReference((u=n.controller)!=null?u:this.id,e,f)),f})}_setRecordOnly(e,t,n){return Z(this,null,function*(){var s;let i=yield this.getRecordID(e,(s=n.controller)!=null?s:this.id);if(i==null){let a=yield this.getDefinition(e),f=yield this._createRecord(a,t,n);return[!0,f]}else{let a=yield Ut(this,di).update(i,t);return[!1,a.id]}})}_createRecord(s,a,f){return Z(this,arguments,function*(e,t,{controller:n,pin:i}){let u=yield Ut(this,di).deterministic({controllers:[n!=null?n:this.id],family:e.id.toString()},{pin:i});return yield u.update(t,{schema:e.schema}),u.id})}_setReference(e,t,n){return Z(this,null,function*(){yield this._getIndexProxy(e).changeContent(i=>Te(re({},i),{[t]:n.toUrl()}))})}_setReferences(e,t){return Z(this,null,function*(){Object.keys(t).length!==0&&(yield this._getIndexProxy(e).changeContent(n=>re(re({},n),t)))})}constructor(e){hc(this,Fi,{writable:!0,value:void 0}),hc(this,Xl,{writable:!0,value:void 0}),hc(this,Qp,{writable:!0,value:{}}),hc(this,di,{writable:!0,value:void 0}),hc(this,Zl,{writable:!0,value:void 0});let{cache:t,ceramic:n,id:i,loader:s,model:a}=e;Jl(this,Fi,n),Jl(this,Xl,i),Jl(this,di,s!=null?s:new mn({ceramic:n,cache:t})),Jl(this,Zl,a instanceof Va?a:new Va({loader:Ut(this,di),aliases:a}))}};o(pc,"DIDDataStore");function em(r){return typeof r=="string"?Je.fromString(r):r}o(em,"typeStreamID");var mr=class extends _t{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=fc(0,n).pipe(Up(()=>this._syncState(this.id,{sync:Ct.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{var f;this.state$.observers.length===0&&((f=this.periodicSubscription)==null||f.unsubscribe())})}),this.state$=new lc(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}_syncState(e,t){return Z(this,null,function*(){let n=yield mr._load(e,this._apiUrl,t);this.state$.next(yt.deserializeState(n))})}get id(){return new Je(this.state$.value.type,this.state$.value.log[0].cid)}static createFromGenesis(e,t,n,i,s){return Z(this,null,function*(){let a=new URL("./streams",e),{state:f}=yield wr(a,{method:"post",body:{type:t,genesis:yt.serializeCommit(n),opts:i}});return new mr(yt.deserializeState(f),e,s)})}static applyCommit(e,t,n,i,s){return Z(this,null,function*(){let a=new URL("./commits",e),{state:f}=yield wr(a,{method:"post",body:{streamId:t.toString(),commit:yt.serializeCommit(n),opts:i}});return new mr(yt.deserializeState(f),e,s)})}static _load(e,t,n){return Z(this,null,function*(){let i=new URL(`./streams/${e}`,t);for(let a in n)i.searchParams.set(a,n[a]);let{state:s}=yield wr(i);return s})}static load(e,t,n,i){return Z(this,null,function*(){let s=yield mr._load(e,t,i);return new mr(yt.deserializeState(s),t,n)})}static loadStreamCommits(e,t){return Z(this,null,function*(){let n=new URL(`./commits/${e}`,t),{commits:i}=yield wr(n);return i.map(s=>({cid:s.cid,value:yt.deserializeCommit(s.value)}))})}complete(){this.state$.complete()}};o(mr,"Document");var Dw=at(nc(),1),jC=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ss,tm=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),Cw={anchor:!1,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},rm={anchor:!0,publish:!0,throwOnInvalidCommit:!0},KC={sync:Ct.PREFER_CACHE},Ms=Ss=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){var n;let{next:e,metadata:t}=this.state$.value;return(0,Dw.default)((n=e==null?void 0:e.metadata)!=null?n:t)}static fromAccount(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},Cw),n);let a=dw(t),f=Ss.makeGenesis(a);return Ss.fromGenesis(e,f,n)})}static fromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){return n=re(re({},Cw),n),e.createStreamFromGenesis(Ss.STREAM_TYPE_ID,t,n)})}setDid(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},rm),n);let a=typeof e=="string"?e.trim():e.id,f=bd(a);if((f==null?void 0:f.did)!==a)throw new Error(`DID is not valid: '${a}'`);let u=yield t.createLink(a);return this.setDidProof(u,n)})}setDidProof(n){return Z(this,arguments,function*(e,t={}){t=re(re({},rm),t);let i=this.makeCommit(e),s=yield this.api.applyCommit(this.id,i,t);this.state$.next(s.state)})}clearDid(n){return Z(this,arguments,function*(e,t={}){t=re(re({},rm),t);let i=yield e.createLink("");return this.setDidProof(i,t)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},KC),n);let a=xr.from(t);if(a.type!=Ss.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Ss.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}static makeGenesis(e){return e.chainId.namespace==="eip155"&&(e.address=e.address.toLowerCase()),{header:{controllers:[`${e.address}@${e.chainId.toString()}`],family:`caip10-${e.chainId.toString()}`}}}makeCommit(e){return{data:e,prev:this.tip,id:this.id.cid}}makeReadOnly(){this.setDidProof=tm,this.setDid=tm,this.sync=tm,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");Ms.STREAM_TYPE_NAME="caip10-link";Ms.STREAM_TYPE_ID=1;Ms=Ss=jC([vo()],Ms);var e4=at(ro(),1);Vn();Ho();var t4=at(Jw(),1),pD=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},br,mD={sync:Ct.PREFER_CACHE};function Xw(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(Xw,"_ensureAuthenticated");function Zw(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(Zw,"throwReadOnlyError");var Qw;(function(r){r.LIST="list",r.SINGLE="single"})(Qw||(Qw={}));var yo=br=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:br.MODEL}}static create(e,t,n){return Z(this,null,function*(){br.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:Ct.NEVER_SYNC,throwOnInvalidCommit:!0},s=yield br._makeGenesis(e,t,n);return yield e.createStreamFromGenesis(br.STREAM_TYPE_ID,s,i)})}static createPlaceholder(e,t,n){return Z(this,null,function*(){let i={publish:!1,anchor:!1,pin:!1,sync:Ct.NEVER_SYNC,throwOnInvalidCommit:!0},s=yield br._makeGenesis(e,t,n);return e.createStreamFromGenesis(br.STREAM_TYPE_ID,s,i)})}replacePlaceholder(e){return Z(this,null,function*(){br.assertComplete(e,this.id);let t={publish:!0,anchor:!0,pin:!0,throwOnInvalidCommit:!0},n=yield this._makeCommit(this.api,e),i=yield this.api.applyCommit(this.id,n,t);this.state$.next(i.state)})}static assertComplete(e,t){if(!e.name)throw t?new Error(`Model with StreamID ${t.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!e.schema)throw t?new Error(`Model ${e.name} (${t.toString()}) is missing a 'schema' field`):new Error(`Model ${e.name} is missing a 'schema' field`);if(!e.accountRelation)throw t?new Error(`Model ${e.name} (${t.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${e.name} is missing a 'accountRelation' field`)}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},mD),n);let a=xr.from(t);if(a.type!=br.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${br.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);let f=yield e.loadStream(a,n);try{br.assertComplete(f.content,t)}catch(u){throw new Error(`Incomplete placeholder Models cannot be loaded: ${u.message}`)}return f})}_makeCommit(e,t){return Z(this,null,function*(){let n=this._makeRawCommit(t);return br._signDagJWS(e,n)})}_makeRawCommit(e){if(e==null)throw new Error("Cannot set Model content to null");return{data:Oa.compare(this.content,e),prev:this.tip,id:this.state.log[0].cid}}static _makeGenesis(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawGenesis(e,t,n);return br._signDagJWS(e,i)})}static _makeRawGenesis(e,t,n){return Z(this,null,function*(){if(t==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)yield Xw(e),n={controller:e.did.hasParent?e.did.parent:e.did.id};else throw new Error("No controller specified");let i={controllers:[n.controller],unique:(0,e4.randomBytes)(12),model:br.MODEL.bytes};return{data:t,header:i}})}makeReadOnly(){this.replacePlaceholder=Zw,this.sync=Zw,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static _signDagJWS(e,t){return Z(this,null,function*(){return yield Xw(e),e.did.createDagJWS(t)})}},"Model");yo.STREAM_TYPE_NAME="model";yo.STREAM_TYPE_ID=2;yo.MODEL=function(){let r=If("model-v1"),e=t4.default.encode(r,"identity"),t=Kn(ba,e),n=Pe.createV1(ba,t);return new Je(br.STREAM_TYPE_ID,n)}();yo=br=pD([vo()],yo);var i4=at(ro(),1);var bD=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},$i,gD={anchor:!0,publish:!0,pin:!0,sync:Ct.NEVER_SYNC,syncTimeoutSeconds:0},vD={sync:Ct.PREFER_CACHE},r4={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function n4(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(n4,"_ensureAuthenticated");function om(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(om,"throwReadOnlyError");var As=$i=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let e=this.state$.value.metadata;return{controller:e.controllers[0],model:e.model}}static create(s,a,f){return Z(this,arguments,function*(e,t,n,i={}){i=re(re({},gD),i);let u=i.asDID?{did:i.asDID}:e,p=yield $i._makeGenesis(u,t,n);return e.createStreamFromGenesis($i.STREAM_TYPE_ID,p,i)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},vD),n);let a=xr.from(t);if(a.type!=$i.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${$i.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}replace(n){return Z(this,arguments,function*(e,t={}){t=re(re({},r4),t);let i=t.asDID?{did:t.asDID}:this.api,s=yield this._makeCommit(i,e),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}patch(n){return Z(this,arguments,function*(e,t={}){t=re(re({},r4),t);let i={data:e,prev:this.tip,id:this.id.cid},s=yield $i._signDagJWS(this.api,i),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}makeReadOnly(){this.replace=om,this.patch=om,this.sync=om,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return $i._signDagJWS(e,n)}_makeRawCommit(e){return{data:Oa.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static _makeGenesis(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawGenesis(e,t,n);return $i._signDagJWS(e,i)})}static _makeRawGenesis(e,t,n){return Z(this,null,function*(){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");if(!n.controller)if(e.did)yield n4(e),n.controller=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let i={controllers:[n.controller],unique:(0,i4.randomBytes)(12),model:n.model.bytes};return{data:t,header:i}})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield n4(e),e.did.createDagJWS(t)})}},"ModelInstanceDocument");As.STREAM_TYPE_NAME="MID";As.STREAM_TYPE_ID=3;As=$i=bD([vo()],As);var bc=class{constructor(e){this._apiUrl=e}add(e,t){return Z(this,null,function*(){let n={};t&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);yield wr(i,{method:"post",body:n})})}rm(e,t){return Z(this,null,function*(){let n=new URL(`./pins/${e}`,this._apiUrl);yield wr(n,{method:"delete",body:{opts:t}})})}ls(e){return Z(this,null,function*(){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=yield wr(t),{pinnedStreamIds:i}=n;return{[Symbol.asyncIterator](){let s=0;return{next(){return s===i.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:i[s++],done:!1})}}}}})}};o(bc,"RemotePinApi");var gc=class{constructor(e){this._fetchJson=wr,this._collectionURL=new URL("./collection",e)}queryIndex(e){return Z(this,null,function*(){let t=new URL(this._collectionURL);for(let s in e)t.searchParams.set(s,e[s]);let n=yield this._fetchJson(t);return{edges:n.edges.map(s=>({cursor:s.cursor,node:yt.deserializeState(s.node)})),pageInfo:n.pageInfo}})}};o(gc,"RemoteIndexApi");var yD="/api/v0/",xD="http://localhost:7007",wD={syncInterval:5e3},_D={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},ED={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},o4={sync:Ct.PREFER_CACHE},vc=class{constructor(e=xD,t={}){this._config=re(re({},wD),t),this._apiUrl=new URL(yD,e),this._streamCache=new Map,this.context={api:this},this.pin=new bc(this._apiUrl),this.index=new gc(this._apiUrl),this._streamConstructors={[Ms.STREAM_TYPE_ID]:Ms,[yo.STREAM_TYPE_ID]:yo,[As.STREAM_TYPE_ID]:As,[zr.STREAM_TYPE_ID]:zr}}get did(){return this.context.did}set did(e){this.context.did=e}createStreamFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},ED),n);let a=yield mr.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),f=this._streamCache.get(a.id.toString());return f?(yt.statesEqual(a.state,f.state)||f.next(a.state),this.buildStreamFromDocument(f)):(this._streamCache.set(a.id.toString(),a),this.buildStreamFromDocument(a))})}loadStream(n){return Z(this,arguments,function*(e,t={}){t=re(re({},o4),t);let i=xr.from(e),s=this._streamCache.get(i.baseID.toString());return s?yield s._syncState(i,t):(s=yield mr.load(i,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(s.id.toString(),s)),this.buildStreamFromDocument(s)})}multiQuery(e,t){return Z(this,null,function*(){let n=e.map(a=>Te(re({},a),{streamId:typeof a.streamId=="string"?a.streamId:a.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),s=yield wr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((a,f)=>{let[u,p]=f,b=yt.deserializeState(p),x=new mr(b,this._apiUrl,this._config.syncInterval);return a[u]=this.buildStreamFromDocument(x),a},{})})}loadStreamCommits(e){let t=em(e);return mr.loadStreamCommits(t,this._apiUrl)}applyCommit(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},_D),n);let a=em(e),f=yield mr.applyCommit(this._apiUrl,a,t,n,this._config.syncInterval),u=this._streamCache.get(a.toString());return u?(u.next(f.state),this.buildStreamFromDocument(f)):(this._streamCache.set(a.toString(),f),this.buildStreamFromDocument(f))})}requestAnchor(n){return Z(this,arguments,function*(e,t={}){t=re(re({},o4),t);let{anchorStatus:i}=yield wr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return i})}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new mr(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(t)}buildStreamFromDocument(e){let t=e.state.type,n=this._streamConstructors[t];if(!n)throw new Error(`Failed to find constructor for stream ${t}`);return new n(e,this.context)}setDID(e){return Z(this,null,function*(){this.context.did=e})}getSupportedChains(){return Z(this,null,function*(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=yield wr(this._apiUrl+"/node/chains");return this._supportedChains=e,e})}close(){return Z(this,null,function*(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()})}};o(vc,"CeramicClient");var SD=o((r,e)=>Z(void 0,null,function*(){let t=new vc(e),n=re({},s4.default.getResolver()),i=new ls({resolver:n});t.did=i;let s=r.pluginMethods.getKey(),a=new Gf(Qu(s));return t.did.setProvider(a),yield t.did.authenticate(),t}),"getCeramicClientFromWalletSuite"),ed=o((s,a)=>Z(void 0,[s,a],function*(r,{modelData:e,credentialAlias:t,ceramicEndpoint:n,defaultContentFamily:i}){let f=yield SD(r,n),u=new mn({ceramic:f}),p=new pc({ceramic:f,model:e}),b=o((...$)=>Z(void 0,[...$],function*(k=t){return(yield p.get(k))||{credentials:[]}}),"getCredentialsListFromIdx"),x=o((k,$)=>Z(void 0,null,function*(){if(!k)throw new Error("record is required");if(!k.id)throw Error("No streamId provided");k.id.indexOf("ceramic://")===-1&&(k.id="ceramic://"+k.id),$||($=t);let C=yield b($),B=C.credentials.findIndex(z=>z.title===k.title);return B>-1?C.credentials[B]=re({storageType:"ceramic"},k):C.credentials.push(re({storageType:"ceramic"},k)),p.set($,C)}),"addCredentialStreamIdToIdx"),A=o((k,$)=>Z(void 0,null,function*(){if(!k)throw new Error("record is required");$||($=t);let C=yield b($);return C.credentials=C.credentials.filter(B=>B.title!==k),p.set($,C)}),"removeCredentialFromIdx"),O=o((B,...z)=>Z(void 0,[B,...z],function*(k,$={},C={}){if(!k)throw new Error("content is required");return $.controllers||($.controllers=[f.did.id]),$.family||($.family=i),"pin"in C||(C.pin=!0),(yield zr.create(f,k,$,C)).id.toString()}),"publishContentToCeramic"),T=o(k=>Z(void 0,null,function*(){var $;return($=yield u.load(k))==null?void 0:$.content}),"readContentFromCeramic");return{pluginMethods:{getCredentialsListFromIdx:(C,...B)=>Z(void 0,[C,...B],function*(k,$=t){return b($)}),publishContentToCeramic:(k,$)=>Z(void 0,null,function*(){return O($)}),readContentFromCeramic:(k,$)=>Z(void 0,null,function*(){return T($)}),getVerifiableCredentialFromIdx:(k,$)=>Z(void 0,null,function*(){var z;let C=yield b(),B=(z=C==null?void 0:C.credentials)==null?void 0:z.find(H=>(H==null?void 0:H.title)===$);return B&&(yield T(B.id))}),getVerifiableCredentialsFromIdx:()=>Z(void 0,null,function*(){var C,B;let k=yield b(),$=(B=(C=k==null?void 0:k.credentials)==null?void 0:C.map(z=>z==null?void 0:z.id))!=null?B:[];return Promise.all($.map(z=>Z(void 0,null,function*(){return T(z)})))}),addVerifiableCredentialInIdx:(B,z)=>Z(void 0,[B,z],function*(k,{title:$,id:C}){return x({title:$,id:C})}),removeVerifiableCredentialInIdx:(k,$)=>Z(void 0,null,function*(){return A($)})}}}),"getIDXPlugin");var MD=["key","tz","pkh:tz","pkh:tezos","pkh:sol","pkh:solana"],AD=["key","tz","ethr","pkh:tz","pkh:tezos","pkh:eth","pkh:celo","pkh:poly","pkh:btc","pkh:doge","pkh:eip155","pkh:bip122"],a4=o(r=>/^[0-9a-f]+$/i.test(r),"isHex"),f4=o(r=>{if(MD.includes(r))return"ed25519";if(AD.includes(r)||r.startsWith("pkh:eip155:")||r.startsWith("pkh:bip122:"))return"secp256k1";throw new Error("Unspported Did Method")},"getAlgorithmForDidMethod");var c4=o((r,e)=>Z(void 0,null,function*(){if(e.length===0)throw new Error("Please don't use an empty string for a key!");if(!a4(e))throw new Error("Key must be a hexadecimal string!");if(e.length>64)throw new Error("Key must be less than 64 characters");let t=e.padStart(64,"0"),n=Qu(t),i={},s={ed25519:r.pluginMethods.generateEd25519KeyFromBytes(n),secp256k1:r.pluginMethods.generateSecp256k1KeyFromBytes(n)};return{pluginMethods:{getSubjectDid:(a,f)=>{if(!i[f]){let u=f4(f);i[f]=r.pluginMethods.keyToDid(f,s[u])}return i[f]},getSubjectKeypair:(a,f="ed25519")=>{if(!s[f])throw new Error("Unsupported algorithm");return s[f]},getKey:()=>t}}}),"getDidKeyPlugin");var u4=o(r=>({pluginMethods:{verifyCredential:(e,t)=>Z(void 0,null,function*(){let n=yield r.pluginMethods.verifyCredential(t);return t.expirationDate&&new Date>new Date(t.expirationDate)?n.errors.push("expiration error: Credential is expired"):n.checks.push("expiration"),n})}}),"ExpirationPlugin");var l4=o(r=>({}),"recycleDependents");var d4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectKeypair();if(!n)throw new Error("Cannot issue credential: Could not get subject keypair");let i={verificationMethod:yield r.pluginMethods.keyToVerificationMethod("key",n),proofPurpose:"assertionMethod"};return r.pluginMethods.issueCredential(t,i,n)}),"issueCredential");var h4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyCredential(t)}),"verifyCredential");var p4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectKeypair();if(!n)throw new Error("Cannot issue credential: Could not get subject keypair");let i={verificationMethod:yield r.pluginMethods.keyToVerificationMethod("key",n),proofPurpose:"assertionMethod"};return r.pluginMethods.issuePresentation(t,i,n)}),"issuePresentation");var m4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyPresentation(t)}),"verifyPresentation");var sm=o(r=>Z(void 0,null,function*(){return{pluginMethods:Te(re({},l4(r.pluginMethods)),{issueCredential:d4(r),verifyCredential:h4(r),issuePresentation:p4(r),verifyPresentation:m4(r),getTestVc:(e,t="did:example:d23dd687a7dc6787646f2eb98d0")=>{let n=e.pluginMethods.getSubjectDid("key");return{"@context":["https://www.w3.org/2018/credentials/v1"],id:"http://example.org/credentials/3731",type:["VerifiableCredential"],issuer:n,issuanceDate:"2020-08-19T21:41:50Z",credentialSubject:{id:t}}},getTestVp:(e,t)=>Z(void 0,null,function*(){let n=t||(yield e.pluginMethods.issueCredential(e.pluginMethods.getTestVc())),i=e.pluginMethods.getSubjectDid("key");return{"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],holder:i,verifiableCredential:n}})})}}),"getVCPlugin");var Ya=require("ethers"),g4=o((r,e)=>{let{address:t,infuraProjectId:n,network:i="mainnet"}=e,s;n?s=new Ya.ethers.providers.InfuraProvider(i,n):s=Ya.ethers.getDefaultProvider(i);let a=o(f=>Z(void 0,null,function*(){if(!t)throw new Error("Can't check balance: No address provided.");let u=b4(),b=yield new Ya.ethers.Contract(f,u,s).balanceOf(t);return Ya.ethers.utils.formatUnits(b)}),"checkErc20TokenBalance");return{pluginMethods:{checkMyEth:()=>Z(void 0,null,function*(){if(!t)throw new Error("Can't check ETH: No ethereum address provided.");let f=yield s.getBalance(t);return Ya.ethers.utils.formatEther(f)}),checkMyDai:()=>Z(void 0,null,function*(){return yield a("0x6B175474E89094C44Da98b954EedeAC495271d0F")}),checkMyUsdc:()=>Z(void 0,null,function*(){return yield a("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48")})}}},"getEthereumPlugin");var kt;(function(r){function e(n){throw new Error}o(e,"assertNever"),r.assertNever=e,r.arrayToEnum=n=>{let i={};for(let s of n)i[s]=s;return i},r.getValidEnumValues=n=>{let i=r.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(let a of i)s[a]=n[a];return r.objectValues(s)},r.objectValues=n=>r.objectKeys(n).map(function(i){return n[i]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let i=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},r.find=(n,i)=>{for(let s of n)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function t(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}o(t,"joinValues"),r.joinValues=t})(kt||(kt={}));var Me=kt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xo=o(r=>{switch(typeof r){case"undefined":return Me.undefined;case"string":return Me.string;case"number":return isNaN(r)?Me.nan:Me.number;case"boolean":return Me.boolean;case"function":return Me.function;case"bigint":return Me.bigint;case"object":return Array.isArray(r)?Me.array:r===null?Me.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Me.promise:typeof Map!="undefined"&&r instanceof Map?Me.map:typeof Set!="undefined"&&r instanceof Set?Me.set:typeof Date!="undefined"&&r instanceof Date?Me.date:Me.object;default:return Me.unknown}},"getParsedType"),Se=kt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of"]),kD=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),bn=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(s){return s.message},n={_errors:[]},i=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let f=n,u=0;for(;u<a.path.length;){let p=a.path[u];u===a.path.length-1?(f[p]=f[p]||{_errors:[]},f[p]._errors.push(t(a))):f[p]=f[p]||{_errors:[]},f=f[p],u++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,null,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};o(bn,"ZodError");bn.create=r=>new bn(r);var yc=o((r,e)=>{let t;switch(r.code){case Se.invalid_type:r.received===Me.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Se.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected)}`;break;case Se.unrecognized_keys:t=`Unrecognized key(s) in object: ${kt.joinValues(r.keys,", ")}`;break;case Se.invalid_union:t="Invalid input";break;case Se.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${kt.joinValues(r.options)}`;break;case Se.invalid_enum_value:t=`Invalid enum value. Expected ${kt.joinValues(r.options)}, received '${r.received}'`;break;case Se.invalid_arguments:t="Invalid function arguments";break;case Se.invalid_return_type:t="Invalid function return type";break;case Se.invalid_date:t="Invalid date";break;case Se.invalid_string:r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Se.too_small:r.type==="array"?t=`Array must contain ${r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be greater than ${r.inclusive?"or equal to ":""}${r.minimum}`:t="Invalid input";break;case Se.too_big:r.type==="array"?t=`Array must contain ${r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be less than ${r.inclusive?"or equal to ":""}${r.maximum}`:t="Invalid input";break;case Se.custom:t="Invalid input";break;case Se.invalid_intersection_types:t="Intersection results could not be merged";break;case Se.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;default:t=e.defaultError,kt.assertNever(r)}return{message:t}},"defaultErrorMap"),xc=yc,CD=o(r=>{xc=r},"setErrorMap"),td=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],a=Te(re({},i),{path:s}),f="",u=n.filter(p=>!!p).slice().reverse();for(let p of u)f=p(a,{data:e,defaultError:f}).message;return Te(re({},i),{path:s,message:i.message||f})},"makeIssue"),DD=[];function Re(r,e){let t=td({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xc,yc].filter(n=>!!n)});r.common.issues.push(t)}o(Re,"addIssueToContext");var or=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return nt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static mergeObjectAsync(e,t){return Z(this,null,function*(){let n=[];for(let i of t)n.push({key:yield i.key,value:yield i.value});return or.mergeObjectSync(e,n)})}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return nt;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),(typeof a.value!="undefined"||i.alwaysSet)&&(n[s.value]=a.value)}return{status:e.value,value:n}}};o(or,"ParseStatus");var nt=Object.freeze({status:"aborted"}),ID=o(r=>({status:"dirty",value:r}),"DIRTY"),_r=o(r=>({status:"valid",value:r}),"OK"),am=o(r=>r.status==="aborted","isAborted"),fm=o(r=>r.status==="dirty","isDirty"),rd=o(r=>r.status==="valid","isValid"),cm=o(r=>typeof Promise!==void 0&&r instanceof Promise,"isAsync"),xt;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(xt||(xt={}));var jr=class{constructor(e,t,n,i){this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._path.concat(this._key)}};o(jr,"ParseInputLazyPath");var v4=o((r,e)=>{if(rd(e))return{success:!0,data:e.value};{if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");let t=new bn(r.common.issues);return{success:!1,error:t}}},"handleResult");function st(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||n))throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:o((a,f)=>a.code!=="invalid_type"?{message:f.defaultError}:typeof f.data=="undefined"&&n?{message:n}:r.invalid_type_error?{message:r.invalid_type_error}:{message:f.defaultError},"customMap"),description:i}}o(st,"processCreateParams");var ot=class{constructor(e){this.spa=this.safeParseAsync,this.superRefine=this._refinement,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return xo(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:xo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new or,ctx:{common:e.parent.common,data:e.data,parsedType:xo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(cm(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xo(e)},s=this._parseSync({data:e,path:i.path,parent:i});return v4(i,s)}parseAsync(e,t){return Z(this,null,function*(){let n=yield this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error})}safeParseAsync(e,t){return Z(this,null,function*(){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xo(e)},i=this._parse({data:e,path:[],parent:n}),s=yield cm(i)?i:Promise.resolve(i);return v4(n,s)})}refine(e,t){let n=o(i=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let a=e(i),f=o(()=>s.addIssue(re({code:Se.custom},n(i))),"setError");return typeof Promise!="undefined"&&a instanceof Promise?a.then(u=>u?!0:(f(),!1)):a?!0:(f(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new Wr({schema:this,typeName:et.ZodEffects,effect:{type:"refinement",refinement:e}})}optional(){return Gr.create(this)}nullable(){return bi.create(this)}nullish(){return this.optional().nullable()}array(){return Kr.create(this)}promise(){return Hi.create(this)}or(e){return wo.create([this,e])}and(e){return _o.create(this,e)}transform(e){return new Wr({schema:this,typeName:et.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Xa({innerType:this,defaultValue:t,typeName:et.ZodDefault})}describe(e){let t=this.constructor;return new t(Te(re({},this._def),{description:e}))}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(ot,"ZodType");var OD=/^c[^\s-]{8,}$/i,PD=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,ND=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Nn=class extends ot{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement(i=>e.test(i),re({validation:t,code:Se.invalid_string},xt.errToObj(n))),this.nonempty=e=>this.min(1,xt.errToObj(e)),this.trim=()=>new Nn(Te(re({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}_parse(e){if(this._getType(e)!==Me.string){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Me.string,received:s.parsedType}),nt}let n=new or,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Re(i,{code:Se.too_small,minimum:s.value,type:"string",inclusive:!0,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Re(i,{code:Se.too_big,maximum:s.value,type:"string",inclusive:!0,message:s.message}),n.dirty());else if(s.kind==="email")ND.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"email",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")PD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"uuid",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")OD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"cuid",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch(a){i=this._getOrReturnCtx(e,i),Re(i,{validation:"url",code:Se.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"regex",code:Se.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():kt.assertNever(s);return{status:n.value,value:e.data}}_addCheck(e){return new Nn(Te(re({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(re({kind:"email"},xt.errToObj(e)))}url(e){return this._addCheck(re({kind:"url"},xt.errToObj(e)))}uuid(e){return this._addCheck(re({kind:"uuid"},xt.errToObj(e)))}cuid(e){return this._addCheck(re({kind:"cuid"},xt.errToObj(e)))}regex(e,t){return this._addCheck(re({kind:"regex",regex:e},xt.errToObj(t)))}min(e,t){return this._addCheck(re({kind:"min",value:e},xt.errToObj(t)))}max(e,t){return this._addCheck(re({kind:"max",value:e},xt.errToObj(t)))}length(e,t){return this.min(e,t).max(e,t)}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=-1/0;return this._def.checks.map(t=>{t.kind==="min"&&(e===null||t.value>e)&&(e=t.value)}),e}get maxLength(){let e=null;return this._def.checks.map(t=>{t.kind==="max"&&(e===null||t.value<e)&&(e=t.value)}),e}};o(Nn,"ZodString");Nn.create=r=>new Nn(re({checks:[],typeName:et.ZodString},st(r)));function RD(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,s=parseInt(r.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}o(RD,"floatSafeRemainder");var hi=class extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._getType(e)!==Me.number){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Me.number,received:s.parsedType}),nt}let n,i=new or;for(let s of this._def.checks)s.kind==="int"?kt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?RD(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):kt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,xt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,xt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,xt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,xt.toString(t))}setLimit(e,t,n,i){return new hi(Te(re({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:xt.toString(i)}]}))}_addCheck(e){return new hi(Te(re({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:xt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:xt.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};o(hi,"ZodNumber");hi.create=r=>new hi(re({checks:[],typeName:et.ZodNumber},st(r)));var Ts=class extends ot{_parse(e){if(this._getType(e)!==Me.bigint){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.bigint,received:n.parsedType}),nt}return _r(e.data)}};o(Ts,"ZodBigInt");Ts.create=r=>new Ts(re({typeName:et.ZodBigInt},st(r)));var ks=class extends ot{_parse(e){if(this._getType(e)!==Me.boolean){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.boolean,received:n.parsedType}),nt}return _r(e.data)}};o(ks,"ZodBoolean");ks.create=r=>new ks(re({typeName:et.ZodBoolean},st(r)));var Cs=class extends ot{_parse(e){if(this._getType(e)!==Me.date){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.date,received:n.parsedType}),nt}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_date}),nt}return{status:"valid",value:new Date(e.data.getTime())}}};o(Cs,"ZodDate");Cs.create=r=>new Cs(re({typeName:et.ZodDate},st(r)));var Ds=class extends ot{_parse(e){if(this._getType(e)!==Me.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.undefined,received:n.parsedType}),nt}return _r(e.data)}};o(Ds,"ZodUndefined");Ds.create=r=>new Ds(re({typeName:et.ZodUndefined},st(r)));var Is=class extends ot{_parse(e){if(this._getType(e)!==Me.null){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.null,received:n.parsedType}),nt}return _r(e.data)}};o(Is,"ZodNull");Is.create=r=>new Is(re({typeName:et.ZodNull},st(r)));var qi=class extends ot{constructor(){super(...arguments),this._any=!0}_parse(e){return _r(e.data)}};o(qi,"ZodAny");qi.create=r=>new qi(re({typeName:et.ZodAny},st(r)));var Rn=class extends ot{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _r(e.data)}};o(Rn,"ZodUnknown");Rn.create=r=>new Rn(re({typeName:et.ZodUnknown},st(r)));var Ln=class extends ot{_parse(e){let t=this._getOrReturnCtx(e);return Re(t,{code:Se.invalid_type,expected:Me.never,received:t.parsedType}),nt}};o(Ln,"ZodNever");Ln.create=r=>new Ln(re({typeName:et.ZodNever},st(r)));var Os=class extends ot{_parse(e){if(this._getType(e)!==Me.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.void,received:n.parsedType}),nt}return _r(e.data)}};o(Os,"ZodVoid");Os.create=r=>new Os(re({typeName:et.ZodVoid},st(r)));var Kr=class extends ot{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==Me.array)return Re(t,{code:Se.invalid_type,expected:Me.array,received:t.parsedType}),nt;if(i.minLength!==null&&t.data.length<i.minLength.value&&(Re(t,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(Re(t,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all(t.data.map((a,f)=>i.type._parseAsync(new jr(t,a,t.path,f)))).then(a=>or.mergeArray(n,a));let s=t.data.map((a,f)=>i.type._parseSync(new jr(t,a,t.path,f)));return or.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new Kr(Te(re({},this._def),{minLength:{value:e,message:xt.toString(t)}}))}max(e,t){return new Kr(Te(re({},this._def),{maxLength:{value:e,message:xt.toString(t)}}))}length(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(Kr,"ZodArray");Kr.create=(r,e)=>new Kr(re({type:r,minLength:null,maxLength:null,typeName:et.ZodArray},st(e)));var nd;(function(r){r.mergeShapes=(e,t)=>re(re({},e),t)})(nd||(nd={}));var y4=o(r=>e=>new Et(Te(re({},r),{shape:()=>re(re({},r.shape()),e)})),"AugmentFactory");function Ja(r){if(r instanceof Et){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Gr.create(Ja(n))}return new Et(Te(re({},r._def),{shape:()=>e}))}else return r instanceof Kr?Kr.create(Ja(r.element)):r instanceof Gr?Gr.create(Ja(r.unwrap())):r instanceof bi?bi.create(Ja(r.unwrap())):r instanceof Vr?Vr.create(r.items.map(e=>Ja(e))):r}o(Ja,"deepPartialify");var Et=class extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=y4(this._def),this.extend=y4(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=kt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Me.object){let p=this._getOrReturnCtx(e);return Re(p,{code:Se.invalid_type,expected:Me.object,received:p.parsedType}),nt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),f=[];for(let p in i.data)a.includes(p)||f.push(p);let u=[];for(let p of a){let b=s[p],x=i.data[p];u.push({key:{status:"valid",value:p},value:b._parse(new jr(i,x,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof Ln){let p=this._def.unknownKeys;if(p==="passthrough")for(let b of f)u.push({key:{status:"valid",value:b},value:{status:"valid",value:i.data[b]}});else if(p==="strict")f.length>0&&(Re(i,{code:Se.unrecognized_keys,keys:f}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let b of f){let x=i.data[b];u.push({key:{status:"valid",value:b},value:p._parse(new jr(i,x,i.path,b)),alwaysSet:b in i.data})}}return i.common.async?Promise.resolve().then(()=>Z(this,null,function*(){let p=[];for(let b of u){let x=yield b.key;p.push({key:x,value:yield b.value,alwaysSet:b.alwaysSet})}return p})).then(p=>or.mergeObjectSync(n,p)):or.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return xt.errToObj,new Et(re(Te(re({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,s,a,f;let u=(a=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&a!==void 0?a:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=xt.errToObj(e).message)!==null&&f!==void 0?f:u}:{message:u}}}:{}))}strip(){return new Et(Te(re({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Et(Te(re({},this._def),{unknownKeys:"passthrough"}))}setKey(e,t){return this.augment({[e]:t})}merge(e){return new Et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>nd.mergeShapes(this._def.shape(),e._def.shape()),typeName:et.ZodObject})}catchall(e){return new Et(Te(re({},this._def),{catchall:e}))}pick(e){let t={};return kt.objectKeys(e).map(n=>{this.shape[n]&&(t[n]=this.shape[n])}),new Et(Te(re({},this._def),{shape:()=>t}))}omit(e){let t={};return kt.objectKeys(this.shape).map(n=>{kt.objectKeys(e).indexOf(n)===-1&&(t[n]=this.shape[n])}),new Et(Te(re({},this._def),{shape:()=>t}))}deepPartial(){return Ja(this)}partial(e){let t={};if(e)return kt.objectKeys(this.shape).map(n=>{kt.objectKeys(e).indexOf(n)===-1?t[n]=this.shape[n]:t[n]=this.shape[n].optional()}),new Et(Te(re({},this._def),{shape:()=>t}));for(let n in this.shape){let i=this.shape[n];t[n]=i.optional()}return new Et(Te(re({},this._def),{shape:()=>t}))}required(){let e={};for(let t in this.shape){let i=this.shape[t];for(;i instanceof Gr;)i=i._def.innerType;e[t]=i}return new Et(Te(re({},this._def),{shape:()=>e}))}};o(Et,"ZodObject");Et.create=(r,e)=>new Et(re({shape:()=>r,unknownKeys:"strip",catchall:Ln.create(),typeName:et.ZodObject},st(e)));Et.strictCreate=(r,e)=>new Et(re({shape:()=>r,unknownKeys:"strict",catchall:Ln.create(),typeName:et.ZodObject},st(e)));Et.lazycreate=(r,e)=>new Et(re({shape:r,unknownKeys:"strip",catchall:Ln.create(),typeName:et.ZodObject},st(e)));var wo=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let f of s)if(f.result.status==="valid")return f.result;for(let f of s)if(f.result.status==="dirty")return t.common.issues.push(...f.ctx.common.issues),f.result;let a=s.map(f=>new bn(f.ctx.common.issues));return Re(t,{code:Se.invalid_union,unionErrors:a}),nt}if(o(i,"handleResults"),t.common.async)return Promise.all(n.map(s=>Z(this,null,function*(){let a=Te(re({},t),{common:Te(re({},t.common),{issues:[]}),parent:null});return{result:yield s._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then(i);{let s,a=[];for(let u of n){let p=Te(re({},t),{common:Te(re({},t.common),{issues:[]}),parent:null}),b=u._parseSync({data:t.data,path:t.path,parent:p});if(b.status==="valid")return b;b.status==="dirty"&&!s&&(s={result:b,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let f=a.map(u=>new bn(u));return Re(t,{code:Se.invalid_union,unionErrors:f}),nt}}get options(){return this._def.options}};o(wo,"ZodUnion");wo.create=(r,e)=>new wo(re({options:r,typeName:et.ZodUnion},st(e)));var Ps=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.object)return Re(t,{code:Se.invalid_type,expected:Me.object,received:t.parsedType}),nt;let n=this.discriminator,i=t.data[n],s=this.options.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(Re(t,{code:Se.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[n]}),nt)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(e,t,n){let i=new Map;try{t.forEach(s=>{let a=s.shape[e].value;i.set(a,s)})}catch(s){throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(i.size!==t.length)throw new Error("Some of the discriminator values are not unique");return new Ps(re({typeName:et.ZodDiscriminatedUnion,discriminator:e,options:i},st(n)))}};o(Ps,"ZodDiscriminatedUnion");function um(r,e){let t=xo(r),n=xo(e);if(r===e)return{valid:!0,data:r};if(t===Me.object&&n===Me.object){let i=kt.objectKeys(e),s=kt.objectKeys(r).filter(f=>i.indexOf(f)!==-1),a=re(re({},r),e);for(let f of s){let u=um(r[f],e[f]);if(!u.valid)return{valid:!1};a[f]=u.data}return{valid:!0,data:a}}else if(t===Me.array&&n===Me.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<r.length;s++){let a=r[s],f=e[s],u=um(a,f);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===Me.date&&n===Me.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(um,"mergeValues");var _o=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,a)=>{if(am(s)||am(a))return nt;let f=um(s.value,a.value);return f.valid?((fm(s)||fm(a))&&t.dirty(),{status:t.value,value:f.data}):(Re(n,{code:Se.invalid_intersection_types}),nt)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(_o,"ZodIntersection");_o.create=(r,e,t)=>new _o(re({left:r,right:e,typeName:et.ZodIntersection},st(t)));var Vr=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.array)return Re(n,{code:Se.invalid_type,expected:Me.array,received:n.parsedType}),nt;if(n.data.length<this._def.items.length)return Re(n,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),nt;!this._def.rest&&n.data.length>this._def.items.length&&(Re(n,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),t.dirty());let s=n.data.map((a,f)=>{let u=this._def.items[f]||this._def.rest;return u?u._parse(new jr(n,a,n.path,f)):null}).filter(a=>!!a);return n.common.async?Promise.all(s).then(a=>or.mergeArray(t,a)):or.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Vr(Te(re({},this._def),{rest:e}))}};o(Vr,"ZodTuple");Vr.create=(r,e)=>new Vr(re({items:r,typeName:et.ZodTuple,rest:null},st(e)));var Eo=class extends ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.object)return Re(n,{code:Se.invalid_type,expected:Me.object,received:n.parsedType}),nt;let i=[],s=this._def.keyType,a=this._def.valueType;for(let f in n.data)i.push({key:s._parse(new jr(n,f,n.path,f)),value:a._parse(new jr(n,n.data[f],n.path,f))});return n.common.async?or.mergeObjectAsync(t,i):or.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ot?new Eo(re({keyType:e,valueType:t,typeName:et.ZodRecord},st(n))):new Eo(re({keyType:Nn.create(),valueType:e,typeName:et.ZodRecord},st(t)))}};o(Eo,"ZodRecord");var Ns=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.map)return Re(n,{code:Se.invalid_type,expected:Me.map,received:n.parsedType}),nt;let i=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([f,u],p)=>({key:i._parse(new jr(n,f,n.path,[p,"key"])),value:s._parse(new jr(n,u,n.path,[p,"value"]))}));if(n.common.async){let f=new Map;return Promise.resolve().then(()=>Z(this,null,function*(){for(let u of a){let p=yield u.key,b=yield u.value;if(p.status==="aborted"||b.status==="aborted")return nt;(p.status==="dirty"||b.status==="dirty")&&t.dirty(),f.set(p.value,b.value)}return{status:t.value,value:f}}))}else{let f=new Map;for(let u of a){let p=u.key,b=u.value;if(p.status==="aborted"||b.status==="aborted")return nt;(p.status==="dirty"||b.status==="dirty")&&t.dirty(),f.set(p.value,b.value)}return{status:t.value,value:f}}}};o(Ns,"ZodMap");Ns.create=(r,e,t)=>new Ns(re({valueType:e,keyType:r,typeName:et.ZodMap},st(t)));var pi=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.set)return Re(n,{code:Se.invalid_type,expected:Me.set,received:n.parsedType}),nt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Re(n,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Re(n,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function a(u){let p=new Set;for(let b of u){if(b.status==="aborted")return nt;b.status==="dirty"&&t.dirty(),p.add(b.value)}return{status:t.value,value:p}}o(a,"finalizeSet");let f=[...n.data.values()].map((u,p)=>s._parse(new jr(n,u,n.path,p)));return n.common.async?Promise.all(f).then(u=>a(u)):a(f)}min(e,t){return new pi(Te(re({},this._def),{minSize:{value:e,message:xt.toString(t)}}))}max(e,t){return new pi(Te(re({},this._def),{maxSize:{value:e,message:xt.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(pi,"ZodSet");pi.create=(r,e)=>new pi(re({valueType:r,minSize:null,maxSize:null,typeName:et.ZodSet},st(e)));var mi=class extends ot{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.function)return Re(t,{code:Se.invalid_type,expected:Me.function,received:t.parsedType}),nt;function n(f,u){return td({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xc,yc].filter(p=>!!p),issueData:{code:Se.invalid_arguments,argumentsError:u}})}o(n,"makeArgsIssue");function i(f,u){return td({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xc,yc].filter(p=>!!p),issueData:{code:Se.invalid_return_type,returnTypeError:u}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},a=t.data;return this._def.returns instanceof Hi?_r((...f)=>Z(this,null,function*(){let u=new bn([]),p=yield this._def.args.parseAsync(f,s).catch(A=>{throw u.addIssue(n(f,A)),u}),b=yield a(...p);return yield this._def.returns._def.type.parseAsync(b,s).catch(A=>{throw u.addIssue(i(b,A)),u})})):_r((...f)=>{let u=this._def.args.safeParse(f,s);if(!u.success)throw new bn([n(f,u.error)]);let p=a(...u.data),b=this._def.returns.safeParse(p,s);if(!b.success)throw new bn([i(p,b.error)]);return b.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mi(Te(re({},this._def),{args:Vr.create(e).rest(Rn.create())}))}returns(e){return new mi(Te(re({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}};o(mi,"ZodFunction");mi.create=(r,e,t)=>new mi(re({args:r?r.rest(Rn.create()):Vr.create([]).rest(Rn.create()),returns:e||Rn.create(),typeName:et.ZodFunction},st(t)));var Rs=class extends ot{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};o(Rs,"ZodLazy");Rs.create=(r,e)=>new Rs(re({getter:r,typeName:et.ZodLazy},st(e)));var Ls=class extends ot{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Re(t,{code:Se.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(Ls,"ZodLiteral");Ls.create=(r,e)=>new Ls(re({value:r,typeName:et.ZodLiteral},st(e)));function LD(r,e){return new Bs(re({values:r,typeName:et.ZodEnum},st(e)))}o(LD,"createZodEnum");var Bs=class extends ot{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return Re(t,{expected:kt.joinValues(n),received:t.parsedType,code:Se.invalid_type}),nt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),n=this._def.values;return Re(t,{received:t.data,code:Se.invalid_enum_value,options:n}),nt}return _r(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}};o(Bs,"ZodEnum");Bs.create=LD;var Us=class extends ot{_parse(e){let t=kt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Me.string&&n.parsedType!==Me.number){let i=kt.objectValues(t);return Re(n,{expected:kt.joinValues(i),received:n.parsedType,code:Se.invalid_type}),nt}if(t.indexOf(e.data)===-1){let i=kt.objectValues(t);return Re(n,{received:n.data,code:Se.invalid_enum_value,options:i}),nt}return _r(e.data)}get enum(){return this._def.values}};o(Us,"ZodNativeEnum");Us.create=(r,e)=>new Us(re({values:r,typeName:et.ZodNativeEnum},st(e)));var Hi=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.promise&&t.common.async===!1)return Re(t,{code:Se.invalid_type,expected:Me.promise,received:t.parsedType}),nt;let n=t.parsedType===Me.promise?t.data:Promise.resolve(t.data);return _r(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(Hi,"ZodPromise");Hi.create=(r,e)=>new Hi(re({type:r,typeName:et.ZodPromise},st(e)));var Wr=class extends ot{innerType(){return this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let a=i.transform(n.data);return n.common.async?Promise.resolve(a).then(f=>this._def.schema._parseAsync({data:f,path:n.path,parent:n})):this._def.schema._parseSync({data:a,path:n.path,parent:n})}let s={addIssue:a=>{Re(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="refinement"){let a=o(f=>{let u=i.refinement(f,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f},"executeRefinement");if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return f.status==="aborted"?nt:(f.status==="dirty"&&t.dirty(),a(f.value),{status:t.value,value:f.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>f.status==="aborted"?nt:(f.status==="dirty"&&t.dirty(),a(f.value).then(()=>({status:t.value,value:f.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!rd(a))return a;let f=i.transform(a.value,s);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:f}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>rd(a)?Promise.resolve(i.transform(a.value,s)).then(f=>({status:t.value,value:f})):a);kt.assertNever(i)}};o(Wr,"ZodEffects");Wr.create=(r,e,t)=>new Wr(re({schema:r,typeName:et.ZodEffects,effect:e},st(t)));Wr.createWithPreprocess=(r,e,t)=>new Wr(re({schema:e,effect:{type:"preprocess",transform:r},typeName:et.ZodEffects},st(t)));var Gr=class extends ot{_parse(e){return this._getType(e)===Me.undefined?_r(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Gr,"ZodOptional");Gr.create=(r,e)=>new Gr(re({innerType:r,typeName:et.ZodOptional},st(e)));var bi=class extends ot{_parse(e){return this._getType(e)===Me.null?_r(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(bi,"ZodNullable");bi.create=(r,e)=>new bi(re({innerType:r,typeName:et.ZodNullable},st(e)));var Xa=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Me.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(Xa,"ZodDefault");Xa.create=(r,e)=>new Gr(re({innerType:r,typeName:et.ZodOptional},st(e)));var Fs=class extends ot{_parse(e){if(this._getType(e)!==Me.nan){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.nan,received:n.parsedType}),nt}return{status:"valid",value:e.data}}};o(Fs,"ZodNaN");Fs.create=r=>new Fs(re({typeName:et.ZodNaN},st(r)));var w4=o((r,e={},t)=>r?qi.create().superRefine((n,i)=>{if(!r(n)){let s=typeof e=="function"?e(n):e,a=typeof s=="string"?{message:s}:s;i.addIssue(Te(re({code:"custom"},a),{fatal:t}))}}):qi.create(),"custom"),BD={object:Et.lazycreate},et;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodPromise="ZodPromise"})(et||(et={}));var UD=o((r,e={message:`Input not instance of ${r.name}`})=>w4(t=>t instanceof r,e,!0),"instanceOfType"),_4=Nn.create,E4=hi.create,FD=Fs.create,$D=Ts.create,S4=ks.create,qD=Cs.create,HD=Ds.create,zD=Is.create,jD=qi.create,KD=Rn.create,VD=Ln.create,WD=Os.create,GD=Kr.create,YD=Et.create,JD=Et.strictCreate,XD=wo.create,ZD=Ps.create,QD=_o.create,eI=Vr.create,tI=Eo.create,rI=Ns.create,nI=pi.create,iI=mi.create,oI=Rs.create,sI=Ls.create,aI=Bs.create,fI=Us.create,cI=Hi.create,x4=Wr.create,uI=Gr.create,lI=bi.create,dI=Wr.createWithPreprocess,hI=o(()=>_4().optional(),"ostring"),pI=o(()=>E4().optional(),"onumber"),mI=o(()=>S4().optional(),"oboolean"),oe=Object.freeze({__proto__:null,getParsedType:xo,ZodParsedType:Me,makeIssue:td,EMPTY_PATH:DD,addIssueToContext:Re,ParseStatus:or,INVALID:nt,DIRTY:ID,OK:_r,isAborted:am,isDirty:fm,isValid:rd,isAsync:cm,ZodType:ot,ZodString:Nn,ZodNumber:hi,ZodBigInt:Ts,ZodBoolean:ks,ZodDate:Cs,ZodUndefined:Ds,ZodNull:Is,ZodAny:qi,ZodUnknown:Rn,ZodNever:Ln,ZodVoid:Os,ZodArray:Kr,get objectUtil(){return nd},ZodObject:Et,ZodUnion:wo,ZodDiscriminatedUnion:Ps,ZodIntersection:_o,ZodTuple:Vr,ZodRecord:Eo,ZodMap:Ns,ZodSet:pi,ZodFunction:mi,ZodLazy:Rs,ZodLiteral:Ls,ZodEnum:Bs,ZodNativeEnum:Us,ZodPromise:Hi,ZodEffects:Wr,ZodTransformer:Wr,ZodOptional:Gr,ZodNullable:bi,ZodDefault:Xa,ZodNaN:Fs,custom:w4,Schema:ot,ZodSchema:ot,late:BD,get ZodFirstPartyTypeKind(){return et},any:jD,array:GD,bigint:$D,boolean:S4,date:qD,discriminatedUnion:ZD,effect:x4,enum:aI,function:iI,instanceof:UD,intersection:QD,lazy:oI,literal:sI,map:rI,nan:FD,nativeEnum:fI,never:VD,null:zD,nullable:lI,number:E4,object:YD,oboolean:mI,onumber:pI,optional:uI,ostring:hI,preprocess:dI,promise:cI,record:tI,set:nI,strictObject:JD,string:_4,transformer:x4,tuple:eI,undefined:HD,union:XD,unknown:KD,void:WD,ZodIssueCode:Se,quotelessJson:kD,ZodError:bn,defaultErrorMap:yc,get overrideErrorMap(){return xc},setErrorMap:CD});var T4=oe.string().array(),zV=oe.object({type:oe.string().optional(),narrative:oe.string().optional()}),dm=oe.string().or(oe.object({id:oe.string(),type:oe.string(),caption:oe.string().optional()})),bI=oe.object({type:oe.string().array().nonempty(),latitude:oe.number(),longitude:oe.number()}),gI=oe.object({type:oe.string().array().nonempty(),addressCountry:oe.string().optional(),addressCountryCode:oe.string().optional(),addressRegion:oe.string().optional(),addressLocality:oe.string().optional(),streetAddress:oe.string().optional(),postOfficeBoxNumber:oe.string().optional(),postalCode:oe.string().optional(),geo:bI.optional()}),vI=oe.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(oe.string()),k4=oe.object({type:oe.string().array().nonempty(),identifier:oe.string(),identifierType:vI}),wc=oe.string().or(oe.object({id:oe.string().optional(),type:oe.string().array().nonempty().optional(),name:oe.string().optional(),url:oe.string().optional(),phone:oe.string().optional(),description:oe.string().optional(),endorsement:oe.any().array().optional(),image:dm.optional(),email:oe.string().email().optional(),address:gI.optional(),otherIdentifier:k4.array().optional(),official:oe.string().optional(),parentOrg:oe.any().optional(),familyName:oe.string().optional(),givenName:oe.string().optional(),additionalName:oe.string().optional(),patronymicName:oe.string().optional(),honorificPrefix:oe.string().optional(),honorificSuffix:oe.string().optional(),familyNamePrefix:oe.string().optional(),dateOfBirth:oe.string().optional()}).catchall(oe.any())),lm=oe.object({id:oe.string().optional()}).catchall(oe.any()),yI=oe.object({type:oe.string(),id:oe.string()}),xI=oe.object({id:oe.string(),type:oe.string()}),wI=oe.object({id:oe.string(),type:oe.string()}).catchall(oe.any()),id=oe.object({"@context":T4,id:oe.string().optional(),type:oe.string().array().nonempty(),issuer:wc,issuanceDate:oe.string(),expirationDate:oe.string().optional(),credentialSubject:lm.or(lm.array()),credentialStatus:yI.optional(),credentialSchema:xI.array().optional(),refreshService:wI.optional()}).catchall(oe.any()),So=oe.object({type:oe.string(),created:oe.string(),challenge:oe.string().optional(),domain:oe.string().optional(),nonce:oe.string().optional(),proofPurpose:oe.string(),verificationMethod:oe.string(),jws:oe.string().optional()}).catchall(oe.any()),M4=id.extend({proof:So.or(So.array())}),_I=oe.object({"@context":T4,id:oe.string().optional(),type:oe.string().array().nonempty(),verifiableCredential:M4.or(M4.array()),holder:oe.string().optional()}).catchall(oe.any()),jV=_I.extend({proof:So.or(So.array())}),EI=oe.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(oe.string()),od=oe.object({type:oe.string().array().nonempty(),targetCode:oe.string().optional(),targetDescription:oe.string().optional(),targetName:oe.string(),targetFramework:oe.string().optional(),targetType:EI.optional(),targetUrl:oe.string()}),SI=oe.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]).or(oe.string()),MI=oe.object({id:oe.string().optional(),narrative:oe.string().optional()}).catchall(oe.any()),AI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),endorsementComment:oe.string().optional()}),TI=id.extend({credentialSubject:AI,proof:So.or(So.array()).optional()}),kI=oe.object({id:oe.string(),"@language":oe.string().optional(),version:oe.string().optional()}),CI=oe.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(oe.string()),DI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:od.array().optional(),description:oe.string().optional(),level:oe.string().optional(),name:oe.string(),points:oe.string().optional()}).catchall(oe.any()),II=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:od.array().optional(),allowedValue:oe.string().array().optional(),name:oe.string(),requiredLevel:oe.string().optional(),requiredValue:oe.string().optional(),resultType:CI,rubricCriterionLevel:DI.array().optional(),valueMax:oe.string().optional(),valueMin:oe.string().optional()}).catchall(oe.any()),OI=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),alignment:od.array().optional(),achievementType:SI.optional(),creator:wc.optional(),creditsAvailable:oe.number().optional(),criteria:MI,description:oe.string(),endorsement:TI.array().optional(),fieldOfStudy:oe.string().optional(),humanCode:oe.string().optional(),image:dm.optional(),"@language":oe.string().optional(),name:oe.string(),otherIdentifier:k4.array().optional(),related:kI.array().optional(),resultDescription:II.array().optional(),specialization:oe.string().optional(),tag:oe.string().array().optional(),version:oe.string().optional()}).catchall(oe.any()),PI=oe.object({type:oe.string(),hashed:oe.boolean(),identityHash:oe.string(),identityType:oe.string(),salt:oe.string().optional()}),NI=oe.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),RI=oe.object({type:oe.string().array().nonempty(),achievedLevel:oe.string().optional(),alignment:od.array().optional(),resultDescription:oe.string().optional(),status:NI.optional(),value:oe.string().optional()}).catchall(oe.any()),A4=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),activityEndDate:oe.string().optional(),activityStartDate:oe.string().optional(),creditsEarned:oe.number().optional(),achievement:OI.optional(),identifier:PI.optional(),image:dm.optional(),licenseNumber:oe.string().optional(),narrative:oe.string().optional(),result:RI.array().optional(),role:oe.string().optional(),source:wc.optional(),term:oe.string().optional()}).catchall(oe.any()),LI=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),narrative:oe.string().optional(),name:oe.string().optional(),description:oe.string().optional(),genre:oe.string().optional(),audience:oe.string().optional()}).catchall(oe.any()),BI=id.extend({name:oe.string().optional(),description:oe.string().optional(),image:oe.string().optional(),credentialSubject:A4.or(A4.array()),endorsement:id.array().optional(),evidence:LI.array().optional()}),VV=BI.extend({proof:So.or(So.array())}),GV=oe.object({checks:oe.string().array(),warnings:oe.string().array(),errors:oe.string().array()}),C4=oe.enum(["Success","Failed","Error"]),sd=C4.enum,YV=oe.object({check:oe.string(),status:C4,message:oe.string().optional(),details:oe.string().optional()}),JV=oe.object({title:oe.string().optional(),createdAt:oe.string().optional(),issuer:wc.optional(),issuee:wc.optional(),credentialSubject:lm.optional()});function Ht(r){if(r===null||r===!0||r===!1)return NaN;var e=Number(r);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}o(Ht,"toInteger");function pt(r,e){if(e.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+e.length+" present")}o(pt,"requiredArgs");function Ft(r){pt(1,arguments);var e=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&e==="[object Date]"?new Date(r.getTime()):typeof r=="number"||e==="[object Number]"?new Date(r):((typeof r=="string"||e==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}o(Ft,"toDate");function hm(r,e){pt(2,arguments);var t=Ft(r).getTime(),n=Ht(e);return new Date(t+n)}o(hm,"addMilliseconds");function pm(r){var e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),r.getTime()-e.getTime()}o(pm,"getTimezoneOffsetInMilliseconds");function mm(r){return pt(1,arguments),r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}o(mm,"isDate");function bm(r){if(pt(1,arguments),!mm(r)&&typeof r!="number")return!1;var e=Ft(r);return!isNaN(Number(e))}o(bm,"isValid");var UI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},FI=o(function(r,e,t){var n,i=UI[r];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n},"formatDistance"),D4=FI;function _c(r){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):r.defaultWidth,n=r.formats[t]||r.formats[r.defaultWidth];return n}}o(_c,"buildFormatLongFn");var $I={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},HI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zI={date:_c({formats:$I,defaultWidth:"full"}),time:_c({formats:qI,defaultWidth:"full"}),dateTime:_c({formats:HI,defaultWidth:"full"})},I4=zI;var jI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},KI=o(function(r,e,t,n){return jI[r]},"formatRelative"),O4=KI;function $s(r){return function(e,t){var n=t||{},i=n.context?String(n.context):"standalone",s;if(i==="formatting"&&r.formattingValues){var a=r.defaultFormattingWidth||r.defaultWidth,f=n.width?String(n.width):a;s=r.formattingValues[f]||r.formattingValues[a]}else{var u=r.defaultWidth,p=n.width?String(n.width):r.defaultWidth;s=r.values[p]||r.values[u]}var b=r.argumentCallback?r.argumentCallback(e):e;return s[b]}}o($s,"buildLocalizeFn");var VI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},WI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},GI={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},YI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},JI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},XI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ZI=o(function(r,e){var t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},"ordinalNumber"),QI={ordinalNumber:ZI,era:$s({values:VI,defaultWidth:"wide"}),quarter:$s({values:WI,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:$s({values:GI,defaultWidth:"wide"}),day:$s({values:YI,defaultWidth:"wide"}),dayPeriod:$s({values:JI,defaultWidth:"wide",formattingValues:XI,defaultFormattingWidth:"wide"})},P4=QI;function qs(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=e.match(i);if(!s)return null;var a=s[0],f=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],u=Array.isArray(f)?tO(f,function(x){return x.test(a)}):eO(f,function(x){return x.test(a)}),p;p=r.valueCallback?r.valueCallback(u):u,p=t.valueCallback?t.valueCallback(p):p;var b=e.slice(a.length);return{value:p,rest:b}}}o(qs,"buildMatchFn");function eO(r,e){for(var t in r)if(r.hasOwnProperty(t)&&e(r[t]))return t}o(eO,"findKey");function tO(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return t}o(tO,"findIndex");function gm(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.match(r.matchPattern);if(!n)return null;var i=n[0],s=e.match(r.parsePattern);if(!s)return null;var a=r.valueCallback?r.valueCallback(s[0]):s[0];a=t.valueCallback?t.valueCallback(a):a;var f=e.slice(i.length);return{value:a,rest:f}}}o(gm,"buildMatchPatternFn");var rO=/^(\d+)(th|st|nd|rd)?/i,nO=/\d+/i,iO={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},oO={any:[/^b/i,/^(a|c)/i]},sO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},aO={any:[/1/i,/2/i,/3/i,/4/i]},fO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},cO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},uO={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},lO={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},dO={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hO={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},pO={ordinalNumber:gm({matchPattern:rO,parsePattern:nO,valueCallback:function(r){return parseInt(r,10)}}),era:qs({matchPatterns:iO,defaultMatchWidth:"wide",parsePatterns:oO,defaultParseWidth:"any"}),quarter:qs({matchPatterns:sO,defaultMatchWidth:"wide",parsePatterns:aO,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:qs({matchPatterns:fO,defaultMatchWidth:"wide",parsePatterns:cO,defaultParseWidth:"any"}),day:qs({matchPatterns:uO,defaultMatchWidth:"wide",parsePatterns:lO,defaultParseWidth:"any"}),dayPeriod:qs({matchPatterns:dO,defaultMatchWidth:"any",parsePatterns:hO,defaultParseWidth:"any"})},N4=pO;var mO={code:"en-US",formatDistance:D4,formatLong:I4,formatRelative:O4,localize:P4,match:N4,options:{weekStartsOn:0,firstWeekContainsDate:1}},R4=mO;function vm(r,e){pt(2,arguments);var t=Ht(e);return hm(r,-t)}o(vm,"subMilliseconds");var bO=864e5;function ym(r){pt(1,arguments);var e=Ft(r),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),i=t-n;return Math.floor(i/bO)+1}o(ym,"getUTCDayOfYear");function Mo(r){pt(1,arguments);var e=1,t=Ft(r),n=t.getUTCDay(),i=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}o(Mo,"startOfUTCISOWeek");function Ec(r){pt(1,arguments);var e=Ft(r),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Mo(n),s=new Date(0);s.setUTCFullYear(t,0,4),s.setUTCHours(0,0,0,0);var a=Mo(s);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}o(Ec,"getUTCISOWeekYear");function xm(r){pt(1,arguments);var e=Ec(r),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=Mo(t);return n}o(xm,"startOfUTCISOWeekYear");var gO=6048e5;function wm(r){pt(1,arguments);var e=Ft(r),t=Mo(e).getTime()-xm(e).getTime();return Math.round(t/gO)+1}o(wm,"getUTCISOWeek");function Ao(r,e){pt(1,arguments);var t=e||{},n=t.locale,i=n&&n.options&&n.options.weekStartsOn,s=i==null?0:Ht(i),a=t.weekStartsOn==null?s:Ht(t.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Ft(r),u=f.getUTCDay(),p=(u<a?7:0)+u-a;return f.setUTCDate(f.getUTCDate()-p),f.setUTCHours(0,0,0,0),f}o(Ao,"startOfUTCWeek");function Sc(r,e){pt(1,arguments);var t=Ft(r),n=t.getUTCFullYear(),i=e||{},s=i.locale,a=s&&s.options&&s.options.firstWeekContainsDate,f=a==null?1:Ht(a),u=i.firstWeekContainsDate==null?f:Ht(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(n+1,0,u),p.setUTCHours(0,0,0,0);var b=Ao(p,e),x=new Date(0);x.setUTCFullYear(n,0,u),x.setUTCHours(0,0,0,0);var A=Ao(x,e);return t.getTime()>=b.getTime()?n+1:t.getTime()>=A.getTime()?n:n-1}o(Sc,"getUTCWeekYear");function _m(r,e){pt(1,arguments);var t=e||{},n=t.locale,i=n&&n.options&&n.options.firstWeekContainsDate,s=i==null?1:Ht(i),a=t.firstWeekContainsDate==null?s:Ht(t.firstWeekContainsDate),f=Sc(r,e),u=new Date(0);u.setUTCFullYear(f,0,a),u.setUTCHours(0,0,0,0);var p=Ao(u,e);return p}o(_m,"startOfUTCWeekYear");var vO=6048e5;function Em(r,e){pt(1,arguments);var t=Ft(r),n=Ao(t,e).getTime()-_m(t,e).getTime();return Math.round(n/vO)+1}o(Em,"getUTCWeek");function ut(r,e){for(var t=r<0?"-":"",n=Math.abs(r).toString();n.length<e;)n="0"+n;return t+n}o(ut,"addLeadingZeros");var yO={y:function(r,e){var t=r.getUTCFullYear(),n=t>0?t:1-t;return ut(e==="yy"?n%100:n,e.length)},M:function(r,e){var t=r.getUTCMonth();return e==="M"?String(t+1):ut(t+1,2)},d:function(r,e){return ut(r.getUTCDate(),e.length)},a:function(r,e){var t=r.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h:function(r,e){return ut(r.getUTCHours()%12||12,e.length)},H:function(r,e){return ut(r.getUTCHours(),e.length)},m:function(r,e){return ut(r.getUTCMinutes(),e.length)},s:function(r,e){return ut(r.getUTCSeconds(),e.length)},S:function(r,e){var t=e.length,n=r.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,t-3));return ut(i,e.length)}},zi=yO;var Za={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xO={G:function(r,e,t){var n=r.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){var n=r.getUTCFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return zi.y(r,e)},Y:function(r,e,t,n){var i=Sc(r,n),s=i>0?i:1-i;if(e==="YY"){var a=s%100;return ut(a,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):ut(s,e.length)},R:function(r,e){var t=Ec(r);return ut(t,e.length)},u:function(r,e){var t=r.getUTCFullYear();return ut(t,e.length)},Q:function(r,e,t){var n=Math.ceil((r.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return ut(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){var n=Math.ceil((r.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return ut(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){var n=r.getUTCMonth();switch(e){case"M":case"MM":return zi.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){var n=r.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return ut(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){var i=Em(r,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):ut(i,e.length)},I:function(r,e,t){var n=wm(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):ut(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getUTCDate(),{unit:"date"}):zi.d(r,e)},D:function(r,e,t){var n=ym(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):ut(n,e.length)},E:function(r,e,t){var n=r.getUTCDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){var i=r.getUTCDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return ut(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){var i=r.getUTCDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return ut(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(r,e,t){var n=r.getUTCDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return ut(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){var n=r.getUTCHours(),i=n/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,e,t){var n=r.getUTCHours(),i;switch(n===12?i=Za.noon:n===0?i=Za.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,e,t){var n=r.getUTCHours(),i;switch(n>=17?i=Za.evening:n>=12?i=Za.afternoon:n>=4?i=Za.morning:i=Za.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){var n=r.getUTCHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return zi.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getUTCHours(),{unit:"hour"}):zi.H(r,e)},K:function(r,e,t){var n=r.getUTCHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):ut(n,e.length)},k:function(r,e,t){var n=r.getUTCHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):ut(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):zi.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):zi.s(r,e)},S:function(r,e){return zi.S(r,e)},X:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return B4(s);case"XXXX":case"XX":return Hs(s);case"XXXXX":case"XXX":default:return Hs(s,":")}},x:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"x":return B4(s);case"xxxx":case"xx":return Hs(s);case"xxxxx":case"xxx":default:return Hs(s,":")}},O:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+L4(s,":");case"OOOO":default:return"GMT"+Hs(s,":")}},z:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+L4(s,":");case"zzzz":default:return"GMT"+Hs(s,":")}},t:function(r,e,t,n){var i=n._originalDate||r,s=Math.floor(i.getTime()/1e3);return ut(s,e.length)},T:function(r,e,t,n){var i=n._originalDate||r,s=i.getTime();return ut(s,e.length)}};function L4(r,e){var t=r>0?"-":"+",n=Math.abs(r),i=Math.floor(n/60),s=n%60;if(s===0)return t+String(i);var a=e||"";return t+String(i)+a+ut(s,2)}o(L4,"formatTimezoneShort");function B4(r,e){if(r%60===0){var t=r>0?"-":"+";return t+ut(Math.abs(r)/60,2)}return Hs(r,e)}o(B4,"formatTimezoneWithOptionalMinutes");function Hs(r,e){var t=e||"",n=r>0?"-":"+",i=Math.abs(r),s=ut(Math.floor(i/60),2),a=ut(i%60,2);return n+s+t+a}o(Hs,"formatTimezone");var U4=xO;function F4(r,e){switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}o(F4,"dateLongFormatter");function $4(r,e){switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}o($4,"timeLongFormatter");function wO(r,e){var t=r.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return F4(r,e);var s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",F4(n,e)).replace("{{time}}",$4(i,e))}o(wO,"dateTimeLongFormatter");var _O={p:$4,P:wO},q4=_O;var EO=["D","DD"],SO=["YY","YYYY"];function H4(r){return EO.indexOf(r)!==-1}o(H4,"isProtectedDayOfYearToken");function z4(r){return SO.indexOf(r)!==-1}o(z4,"isProtectedWeekYearToken");function Sm(r,e,t){if(r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"))}o(Sm,"throwProtectedError");var MO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,AO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,TO=/^'([^]*?)'?$/,kO=/''/g,CO=/[a-zA-Z]/;function Mc(r,e,t){pt(2,arguments);var n=String(e),i=t||{},s=i.locale||R4,a=s.options&&s.options.firstWeekContainsDate,f=a==null?1:Ht(a),u=i.firstWeekContainsDate==null?f:Ht(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=s.options&&s.options.weekStartsOn,b=p==null?0:Ht(p),x=i.weekStartsOn==null?b:Ht(i.weekStartsOn);if(!(x>=0&&x<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!s.localize)throw new RangeError("locale must contain localize property");if(!s.formatLong)throw new RangeError("locale must contain formatLong property");var A=Ft(r);if(!bm(A))throw new RangeError("Invalid time value");var O=pm(A),T=vm(A,O),k={firstWeekContainsDate:u,weekStartsOn:x,locale:s,_originalDate:A},$=n.match(AO).map(function(C){var B=C[0];if(B==="p"||B==="P"){var z=q4[B];return z(C,s.formatLong,k)}return C}).join("").match(MO).map(function(C){if(C==="''")return"'";var B=C[0];if(B==="'")return DO(C);var z=U4[B];if(z)return!i.useAdditionalWeekYearTokens&&z4(C)&&Sm(C,e,r),!i.useAdditionalDayOfYearTokens&&H4(C)&&Sm(C,e,r),z(T,C,s.localize,k);if(B.match(CO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+B+"`");return C}).join("");return $}o(Mc,"format");function DO(r){return r.match(TO)[1].replace(kO,"'")}o(DO,"cleanEscapedString");var IO=o((r,e)=>r.split(" error")[0]||r,"transformErrorCheck"),OO=o((r,e)=>r.startsWith("expiration")?e.expirationDate?`Invalid \u2022 Expired ${Mc(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Invalid \u2022 Expired":r,"transformErrorMessage"),PO=o((r,e)=>({proof:"Valid",expiration:e.expirationDate?`Valid \u2022 Expires ${Mc(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Valid \u2022 Does Not Expire"})[r]||r,"transformCheckMessage"),j4=o(r=>e=>Z(void 0,null,function*(){let t=yield r.pluginMethods.verifyCredential(e),n=[];return t.errors.forEach(i=>{n.push({status:sd.Failed,check:IO(i,e),details:OO(i,e)})}),t.warnings.forEach(i=>{n.push({status:sd.Error,check:"hmm",message:i})}),t.checks.forEach(i=>{n.push({status:sd.Success,check:i,message:PO(i,e)})}),n}),"verifyCredential");var K4={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials",ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"},V4={address:"",infuraProjectId:"",network:"mainnet"};var Ae,W4=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});W4.decode();var ad=null;function Qa(){return(ad===null||ad.buffer!==Ae.memory.buffer)&&(ad=new Uint8Array(Ae.memory.buffer)),ad}o(Qa,"getUint8Memory0");function gi(r,e){return W4.decode(Qa().subarray(r,r+e))}o(gi,"getStringFromWasm0");var ji=new Array(32).fill(void 0);ji.push(void 0,null,!0,!1);var Ac=ji.length;function Ze(r){Ac===ji.length&&ji.push(ji.length+1);let e=Ac;return Ac=ji[e],ji[e]=r,e}o(Ze,"addHeapObject");function Ie(r){return ji[r]}o(Ie,"getObject");function NO(r){r<36||(ji[r]=Ac,Ac=r)}o(NO,"dropObject");function vi(r){let e=Ie(r);return NO(r),e}o(vi,"takeObject");var Rt=0,cd=new TextEncoder("utf-8"),RO=typeof cd.encodeInto=="function"?function(r,e){return cd.encodeInto(r,e)}:function(r,e){let t=cd.encode(r);return e.set(t),{read:r.length,written:t.length}};function sr(r,e,t){if(t===void 0){let f=cd.encode(r),u=e(f.length);return Qa().subarray(u,u+f.length).set(f),Rt=f.length,u}let n=r.length,i=e(n),s=Qa(),a=0;for(;a<n;a++){let f=r.charCodeAt(a);if(f>127)break;s[i+a]=f}if(a!==n){a!==0&&(r=r.slice(a)),i=t(i,n,n=a+r.length*3);let f=Qa().subarray(i+a,i+n);a+=RO(r,f).written}return Rt=a,i}o(sr,"passStringToWasm0");function LO(r){return r==null}o(LO,"isLikeNone");var fd=null;function Xt(){return(fd===null||fd.buffer!==Ae.memory.buffer)&&(fd=new Int32Array(Ae.memory.buffer)),fd}o(Xt,"getInt32Memory0");function Mm(r){let e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){let i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){let i=r.length,s="[";i>0&&(s+=Mm(r[0]));for(let a=1;a<i;a++)s+=", "+Mm(r[a]);return s+="]",s}let t=/\[object ([^\]]+)\]/.exec(toString.call(r)),n;if(t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch(i){return"Object"}return r instanceof Error?`${r.name}: ${r.message}
792
- ${r.stack}`:n}o(Mm,"debugString");function BO(r,e,t,n){let i={a:r,b:e,cnt:1,dtor:t},s=o((...a)=>{i.cnt++;let f=i.a;i.a=0;try{return n(f,i.b,...a)}finally{--i.cnt===0?Ae.__wbindgen_export_2.get(i.dtor)(f,i.b):i.a=f}},"real");return s.original=i,s}o(BO,"makeMutClosure");function UO(r,e,t){Ae._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(r,e,Ze(t))}o(UO,"__wbg_adapter_24");function G4(r,e){let t=e(r.length*1);return Qa().set(r,t/1),Rt=r.length,t}o(G4,"passArray8ToWasm0");function Y4(r){try{let f=Ae.__wbindgen_add_to_stack_pointer(-16),u=G4(r,Ae.__wbindgen_malloc),p=Rt;Ae.generateEd25519KeyFromBytes(f,u,p);var e=Xt()[f/4+0],t=Xt()[f/4+1],n=Xt()[f/4+2],i=Xt()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,vi(n);return gi(s,a)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(s,a)}}o(Y4,"generateEd25519KeyFromBytes");function J4(r){try{let f=Ae.__wbindgen_add_to_stack_pointer(-16),u=G4(r,Ae.__wbindgen_malloc),p=Rt;Ae.generateSecp256k1KeyFromBytes(f,u,p);var e=Xt()[f/4+0],t=Xt()[f/4+1],n=Xt()[f/4+2],i=Xt()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,vi(n);return gi(s,a)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(s,a)}}o(J4,"generateSecp256k1KeyFromBytes");function X4(r,e){try{let u=Ae.__wbindgen_add_to_stack_pointer(-16),p=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),b=Rt,x=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),A=Rt;Ae.keyToDID(u,p,b,x,A);var t=Xt()[u/4+0],n=Xt()[u/4+1],i=Xt()[u/4+2],s=Xt()[u/4+3],a=t,f=n;if(s)throw a=0,f=0,vi(i);return gi(a,f)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(a,f)}}o(X4,"keyToDID");function Z4(r,e){let t=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.keyToVerificationMethod(t,n,i,s);return vi(a)}o(Z4,"keyToVerificationMethod");function Q4(r,e,t){let n=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),i=Rt,s=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),a=Rt,f=sr(t,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt,p=Ae.issueCredential(n,i,s,a,f,u);return vi(p)}o(Q4,"issueCredential");function e5(r,e){let t=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.verifyCredential(t,n,i,s);return vi(a)}o(e5,"verifyCredential");function t5(r,e,t){let n=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),i=Rt,s=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),a=Rt,f=sr(t,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt,p=Ae.issuePresentation(n,i,s,a,f,u);return vi(p)}o(t5,"issuePresentation");function r5(r,e){let t=sr(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=sr(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.verifyPresentation(t,n,i,s);return vi(a)}o(r5,"verifyPresentation");function gr(r,e){try{return r.apply(this,e)}catch(t){Ae.__wbindgen_exn_store(Ze(t))}}o(gr,"handleError");function FO(r,e){return Qa().subarray(r/1,r/1+e)}o(FO,"getArrayU8FromWasm0");function $O(r,e,t,n){Ae.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(r,e,Ze(t),Ze(n))}o($O,"__wbg_adapter_110");function qO(r,e){return Z(this,null,function*(){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return yield WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}let t=yield r.arrayBuffer();return yield WebAssembly.instantiate(t,e)}else{let t=yield WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}})}o(qO,"load");function n5(r){return Z(this,null,function*(){let e={};e.wbg={},e.wbg.__wbindgen_string_new=function(i,s){let a=gi(i,s);return Ze(a)},e.wbg.__wbindgen_object_drop_ref=function(i){vi(i)},e.wbg.__wbindgen_cb_drop=function(i){let s=vi(i).original;return s.cnt--==1?(s.a=0,!0):!1},e.wbg.__wbindgen_object_clone_ref=function(i){let s=Ie(i);return Ze(s)},e.wbg.__wbg_fetch_811d43d6bdcad5b1=function(i){let s=fetch(Ie(i));return Ze(s)},e.wbg.__wbg_fetch_bf56e2a9f0644e3f=function(i,s){let a=Ie(i).fetch(Ie(s));return Ze(a)},e.wbg.__wbg_new_89d7f088c1c45353=function(){return gr(function(){let i=new Headers;return Ze(i)},arguments)},e.wbg.__wbg_append_f4f93bc73c45ee3e=function(){return gr(function(i,s,a,f,u){Ie(i).append(gi(s,a),gi(f,u))},arguments)},e.wbg.__wbindgen_string_get=function(i,s){let a=Ie(s),f=typeof a=="string"?a:void 0;var u=LO(f)?0:sr(f,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),p=Rt;Xt()[i/4+1]=p,Xt()[i/4+0]=u},e.wbg.__wbg_instanceof_Response_ccfeb62399355bcd=function(i){return Ie(i)instanceof Response},e.wbg.__wbg_url_06c0f822d68d195c=function(i,s){let a=Ie(s).url,f=sr(a,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt;Xt()[i/4+1]=u,Xt()[i/4+0]=f},e.wbg.__wbg_status_600fd8b881393898=function(i){return Ie(i).status},e.wbg.__wbg_headers_9e7f2c05a9b962ea=function(i){let s=Ie(i).headers;return Ze(s)},e.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return gr(function(i){let s=Ie(i).arrayBuffer();return Ze(s)},arguments)},e.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return gr(function(i,s,a){let f=new Request(gi(i,s),Ie(a));return Ze(f)},arguments)},e.wbg.__wbindgen_is_object=function(i){let s=Ie(i);return typeof s=="object"&&s!==null},e.wbg.__wbg_self_86b4b13392c7af56=function(){return gr(function(){let i=self.self;return Ze(i)},arguments)},e.wbg.__wbg_crypto_b8c92eaac23d0d80=function(i){let s=Ie(i).crypto;return Ze(s)},e.wbg.__wbg_msCrypto_9ad6677321a08dd8=function(i){let s=Ie(i).msCrypto;return Ze(s)},e.wbg.__wbindgen_is_undefined=function(i){return Ie(i)===void 0},e.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81=function(){return Ze(n)},e.wbg.__wbg_require_f5521a5b85ad2542=function(i,s,a){let f=Ie(i).require(gi(s,a));return Ze(f)},e.wbg.__wbg_getRandomValues_dd27e6b0652b3236=function(i){let s=Ie(i).getRandomValues;return Ze(s)},e.wbg.__wbg_getRandomValues_e57c9b75ddead065=function(i,s){Ie(i).getRandomValues(Ie(s))},e.wbg.__wbg_randomFillSync_d2ba53160aec6aba=function(i,s,a){Ie(i).randomFillSync(FO(s,a))},e.wbg.__wbindgen_is_function=function(i){return typeof Ie(i)=="function"},e.wbg.__wbg_newnoargs_e23b458e372830de=function(i,s){let a=new Function(gi(i,s));return Ze(a)},e.wbg.__wbg_next_cabb70b365520721=function(i){let s=Ie(i).next;return Ze(s)},e.wbg.__wbg_next_bf3d83fc18df496e=function(){return gr(function(i){let s=Ie(i).next();return Ze(s)},arguments)},e.wbg.__wbg_done_040f966faa9a72b3=function(i){return Ie(i).done},e.wbg.__wbg_value_419afbd9b9574c4c=function(i){let s=Ie(i).value;return Ze(s)},e.wbg.__wbg_iterator_4832ef1f15b0382b=function(){return Ze(Symbol.iterator)},e.wbg.__wbg_get_a9cab131e3152c49=function(){return gr(function(i,s){let a=Reflect.get(Ie(i),Ie(s));return Ze(a)},arguments)},e.wbg.__wbg_call_ae78342adc33730a=function(){return gr(function(i,s){let a=Ie(i).call(Ie(s));return Ze(a)},arguments)},e.wbg.__wbg_new_36359baae5a47e27=function(){let i=new Object;return Ze(i)},e.wbg.__wbg_call_3ed288a247f13ea5=function(){return gr(function(i,s,a){let f=Ie(i).call(Ie(s),Ie(a));return Ze(f)},arguments)},e.wbg.__wbg_getTime_bffb1c09df09618b=function(i){return Ie(i).getTime()},e.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){let i=new Date;return Ze(i)},e.wbg.__wbg_new_37705eed627d5ed9=function(i,s){try{var a={a:i,b:s},f=o((p,b)=>{let x=a.a;a.a=0;try{return $O(x,a.b,p,b)}finally{a.a=x}},"cb0");let u=new Promise(f);return Ze(u)}finally{a.a=a.b=0}},e.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(i){let s=Promise.resolve(Ie(i));return Ze(s)},e.wbg.__wbg_then_ce526c837d07b68f=function(i,s){let a=Ie(i).then(Ie(s));return Ze(a)},e.wbg.__wbg_then_842e65b843962f56=function(i,s,a){let f=Ie(i).then(Ie(s),Ie(a));return Ze(f)},e.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return gr(function(){let i=self.self;return Ze(i)},arguments)},e.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return gr(function(){let i=window.window;return Ze(i)},arguments)},e.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return gr(function(){let i=globalThis.globalThis;return Ze(i)},arguments)},e.wbg.__wbg_global_5de1e0f82bddcd27=function(){return gr(function(){let i=global.global;return Ze(i)},arguments)},e.wbg.__wbg_buffer_7af23f65f6c64548=function(i){let s=Ie(i).buffer;return Ze(s)},e.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(i,s,a){let f=new Uint8Array(Ie(i),s>>>0,a>>>0);return Ze(f)},e.wbg.__wbg_new_cc9018bd6f283b6f=function(i){let s=new Uint8Array(Ie(i));return Ze(s)},e.wbg.__wbg_set_f25e869e4565d2a2=function(i,s,a){Ie(i).set(Ie(s),a>>>0)},e.wbg.__wbg_length_0acb1cf9bbaf8519=function(i){return Ie(i).length},e.wbg.__wbg_newwithlength_8f0657faca9f1422=function(i){let s=new Uint8Array(i>>>0);return Ze(s)},e.wbg.__wbg_subarray_da527dbd24eafb6b=function(i,s,a){let f=Ie(i).subarray(s>>>0,a>>>0);return Ze(f)},e.wbg.__wbg_has_ce995ec88636803d=function(){return gr(function(i,s){return Reflect.has(Ie(i),Ie(s))},arguments)},e.wbg.__wbg_set_93b1c87ee2af852e=function(){return gr(function(i,s,a){return Reflect.set(Ie(i),Ie(s),Ie(a))},arguments)},e.wbg.__wbg_stringify_c760003feffcc1f2=function(){return gr(function(i){let s=JSON.stringify(Ie(i));return Ze(s)},arguments)},e.wbg.__wbindgen_debug_string=function(i,s){let a=Mm(Ie(s)),f=sr(a,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt;Xt()[i/4+1]=u,Xt()[i/4+0]=f},e.wbg.__wbindgen_throw=function(i,s){throw new Error(gi(i,s))},e.wbg.__wbindgen_memory=function(){let i=Ae.memory;return Ze(i)},e.wbg.__wbindgen_closure_wrapper10913=function(i,s,a){let f=BO(i,s,3725,UO);return Ze(f)},(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));let{instance:t,module:n}=yield qO(yield r,e);return Ae=t.exports,n5.__wbindgen_wasm_module=n,Ae})}o(n5,"init");var i5=n5;var o5=!1,HO=o((r="https://cdn.filestackcontent.com/dlXanMvQCGDR76JXcBkA")=>Z(void 0,null,function*(){if(!o5)return o5=!0,i5(r)}),"init"),s5=HO;var a5=o(r=>Z(void 0,null,function*(){yield s5(r);let e={};return{pluginMethods:{generateEd25519KeyFromBytes:(t,n)=>JSON.parse(Y4(n)),generateSecp256k1KeyFromBytes:(t,n)=>JSON.parse(J4(n)),keyToDid:(t,n,i)=>{let s=e[n];if(!s){let a=X4(n,JSON.stringify(i));return e[n]=a,a}return s},keyToVerificationMethod:(t,n,i)=>Z(void 0,null,function*(){return Z4(n,JSON.stringify(i))}),issueCredential:(t,n,i,s)=>Z(void 0,null,function*(){return JSON.parse(yield Q4(JSON.stringify(n),JSON.stringify(i),JSON.stringify(s)))}),verifyCredential:(t,n)=>Z(void 0,null,function*(){return JSON.parse(yield e5(JSON.stringify(n),"{}"))}),issuePresentation:(t,n,i,s)=>Z(void 0,null,function*(){return JSON.parse(yield t5(JSON.stringify(n),JSON.stringify(i),JSON.stringify(s)))}),verifyPresentation:(t,n)=>Z(void 0,null,function*(){return JSON.parse(yield r5(JSON.stringify(n),"{}"))})}}}),"getDidKitPlugin");var f5=o((s,...a)=>Z(void 0,[s,...a],function*(r,{ceramicIdx:e=K4,didkit:t,defaultContents:n=[],ethereumConfig:i=V4}={}){let f=yield(yield tf(n)).addPlugin(yield a5(t)),u=yield f.addPlugin(yield c4(f,r)),p=yield u.addPlugin(yield sm(u)),b=yield p.addPlugin(yield ed(p,e)),x=yield b.addPlugin(u4(b)),A=yield x.addPlugin(g4(x,i));return{_wallet:A,did:(O="key")=>A.pluginMethods.getSubjectDid(O),keypair:(O="ed25519")=>A.pluginMethods.getSubjectKeypair(O),issueCredential:A.pluginMethods.issueCredential,verifyCredential:j4(A),issuePresentation:A.pluginMethods.issuePresentation,verifyPresentation:A.pluginMethods.verifyPresentation,getCredential:A.pluginMethods.getVerifiableCredentialFromIdx,getCredentials:A.pluginMethods.getVerifiableCredentialsFromIdx,getCredentialsList:()=>Z(void 0,null,function*(){return(yield A.pluginMethods.getCredentialsListFromIdx()).credentials}),publishCredential:A.pluginMethods.publishContentToCeramic,addCredential:O=>Z(void 0,null,function*(){yield A.pluginMethods.addVerifiableCredentialInIdx(O)}),removeCredential:O=>Z(void 0,null,function*(){yield A.pluginMethods.removeVerifiableCredentialInIdx(O)}),readFromCeramic:A.pluginMethods.readContentFromCeramic,getTestVc:A.pluginMethods.getTestVc,getTestVp:A.pluginMethods.getTestVp,checkMyEth:A.pluginMethods.checkMyEth,checkMyDai:A.pluginMethods.checkMyDai,checkMyUsdc:A.pluginMethods.checkMyUsdc}}),"walletFromKey");
791
+ `):"",this.name="UnsubscriptionError",this.errors=t},"UnsubscriptionErrorImpl")});function ys(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}o(ys,"arrRemove");var go=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return o(r,"Subscription"),r.prototype.unsubscribe=function(){var e,t,n,i,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var f=vs(a),u=f.next();!u.done;u=f.next()){var p=u.value;p.remove(this)}}catch(k){e={error:k}}finally{try{u&&!u.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}else a.remove(this);var b=this.initialTeardown;if(rt(b))try{b()}catch(k){s=k instanceof Ml?k.errors:[k]}var x=this._finalizers;if(x){this._finalizers=null;try{for(var A=vs(x),O=A.next();!O.done;O=A.next()){var T=O.value;try{Ix(T)}catch(k){s=s!=null?s:[],k instanceof Ml?s=In(In([],qr(s)),qr(k.errors)):s.push(k)}}}catch(k){n={error:k}}finally{try{O&&!O.done&&(i=A.return)&&i.call(A)}finally{if(n)throw n.error}}}if(s)throw new Ml(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Ix(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&ys(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&ys(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();var Tp=go.EMPTY;function Al(r){return r instanceof go||r&&"closed"in r&&rt(r.remove)&&rt(r.add)&&rt(r.unsubscribe)}o(Al,"isSubscription");function Ix(r){rt(r)?r():r.unsubscribe()}o(Ix,"execFinalizer");var On={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var $a={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=$a.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,In([r,e],qr(t))):setTimeout.apply(void 0,In([r,e],qr(t)))},clearTimeout:function(r){var e=$a.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function Tl(r){$a.setTimeout(function(){var e=On.onUnhandledError;if(e)e(r);else throw r})}o(Tl,"reportUnhandledError");function kp(){}o(kp,"noop");var Ox=function(){return Cp("C",void 0,void 0)}();function Px(r){return Cp("E",void 0,r)}o(Px,"errorNotification");function Nx(r){return Cp("N",r,void 0)}o(Nx,"nextNotification");function Cp(r,e,t){return{kind:r,value:e,error:t}}o(Cp,"createNotification");var xs=null;function qa(r){if(On.useDeprecatedSynchronousErrorHandling){var e=!xs;if(e&&(xs={errorThrown:!1,error:null}),r(),e){var t=xs,n=t.errorThrown,i=t.error;if(xs=null,n)throw i}}else r()}o(qa,"errorContext");function Rx(r){On.useDeprecatedSynchronousErrorHandling&&xs&&(xs.errorThrown=!0,xs.error=r)}o(Rx,"captureError");var ic=function(r){hr(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Al(t)&&t.add(n)):n.destination=Vk,n}return o(e,"Subscriber"),e.create=function(t,n,i){return new Cl(t,n,i)},e.prototype.next=function(t){this.isStopped?Ip(Nx(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Ip(Px(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Ip(Ox,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(go);var zk=Function.prototype.bind;function Dp(r,e){return zk.call(r,e)}o(Dp,"bind");var jk=function(){function r(e){this.partialObserver=e}return o(r,"ConsumerObserver"),r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){kl(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){kl(n)}else kl(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){kl(t)}},r}(),Cl=function(r){hr(e,r);function e(t,n,i){var s=r.call(this)||this,a;if(rt(t)||!t)a={next:t!=null?t:void 0,error:n!=null?n:void 0,complete:i!=null?i:void 0};else{var f;s&&On.useDeprecatedNextContext?(f=Object.create(t),f.unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Dp(t.next,f),error:t.error&&Dp(t.error,f),complete:t.complete&&Dp(t.complete,f)}):a=t}return s.destination=new jk(a),s}return o(e,"SafeSubscriber"),e}(ic);function kl(r){On.useDeprecatedSynchronousErrorHandling?Rx(r):Tl(r)}o(kl,"handleUnhandledError");function Kk(r){throw r}o(Kk,"defaultErrorHandler");function Ip(r,e){var t=On.onStoppedNotification;t&&$a.setTimeout(function(){return t(r,e)})}o(Ip,"handleStoppedNotification");var Vk={closed:!0,next:kp,error:Kk,complete:kp};var Ha=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function za(r){return r}o(za,"identity");function Lx(r){return r.length===0?za:r.length===1?r[0]:o(function(t){return r.reduce(function(n,i){return i(n)},t)},"piped")}o(Lx,"pipeFromArray");var _t=function(){function r(e){e&&(this._subscribe=e)}return o(r,"Observable"),r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,s=Gk(e)?e:new Cl(e,t,n);return qa(function(){var a=i,f=a.operator,u=a.source;s.add(f?f.call(s,u):u?i._subscribe(s):i._trySubscribe(s))}),s},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=Bx(t),new t(function(i,s){var a=new Cl({next:function(f){try{e(f)}catch(u){s(u),a.unsubscribe()}},error:s,complete:i});n.subscribe(a)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[Ha]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Lx(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=Bx(e),new e(function(n,i){var s;t.subscribe(function(a){return s=a},function(a){return i(a)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();function Bx(r){var e;return(e=r!=null?r:On.Promise)!==null&&e!==void 0?e:Promise}o(Bx,"getPromiseCtor");function Wk(r){return r&&rt(r.next)&&rt(r.error)&&rt(r.complete)}o(Wk,"isObserver");function Gk(r){return r&&r instanceof ic||Wk(r)&&Al(r)}o(Gk,"isSubscriber");function Yk(r){return rt(r==null?void 0:r.lift)}o(Yk,"hasLift");function Yt(r){return function(e){if(Yk(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}o(Yt,"operate");function Jt(r,e,t,n,i){return new Jk(r,e,t,n,i)}o(Jt,"createOperatorSubscriber");var Jk=function(r){hr(e,r);function e(t,n,i,s,a,f){var u=r.call(this,t)||this;return u.onFinalize=a,u.shouldUnsubscribe=f,u._next=n?function(p){try{n(p)}catch(b){t.error(b)}}:r.prototype._next,u._error=s?function(p){try{s(p)}catch(b){t.error(b)}finally{this.unsubscribe()}}:r.prototype._error,u._complete=i?function(){try{i()}catch(p){t.error(p)}finally{this.unsubscribe()}}:r.prototype._complete,u}return o(e,"OperatorSubscriber"),e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(ic);var Ux=Fa(function(r){return o(function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl")});var Op=function(r){hr(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o(e,"Subject"),e.prototype.lift=function(t){var n=new Fx(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ux},e.prototype.next=function(t){var n=this;qa(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=vs(n.currentObservers),f=a.next();!f.done;f=a.next()){var u=f.value;u.next(t)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;qa(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;qa(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,s=i.hasError,a=i.isStopped,f=i.observers;return s||a?Tp:(this.currentObservers=null,f.push(t),new go(function(){n.currentObservers=null,ys(f,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,a=n.isStopped;i?t.error(s):a&&t.complete()},e.prototype.asObservable=function(){var t=new _t;return t.source=this,t},e.create=function(t,n){return new Fx(t,n)},e}(_t);var Fx=function(r){hr(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return o(e,"AnonymousSubject"),e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:Tp},e}(Op);var Pp=function(r){hr(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return o(e,"BehaviorSubject"),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,s=t._value;if(n)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(Op);var Np={now:function(){return(Np.delegate||Date).now()},delegate:void 0};var $x=function(r){hr(e,r);function e(t,n){return r.call(this)||this}return o(e,"Action"),e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e}(go);var oc={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=oc.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,In([r,e],qr(t))):setInterval.apply(void 0,In([r,e],qr(t)))},clearInterval:function(r){var e=oc.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(r)},delegate:void 0};var qx=function(r){hr(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.pending=!1,i}return o(e,"AsyncAction"),e.prototype.schedule=function(t,n){if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),oc.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;oc.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var i=!1,s;try{this.work(t)}catch(a){i=!0,s=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ys(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}($x);var Rp=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return o(r,"Scheduler"),r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=Np.now,r}();var Hx=function(r){hr(e,r);function e(t,n){n===void 0&&(n=Rp.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,i._scheduled=void 0,i}return o(e,"AsyncScheduler"),e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,i){for(;t=n.shift();)t.unsubscribe();throw i}},e}(Rp);var Xk=new Hx(qx),zx=Xk;var Dl=new _t(function(r){return r.complete()});function Il(r){return r&&rt(r.schedule)}o(Il,"isScheduler");function jx(r){return r[r.length-1]}o(jx,"last");function Kx(r){return Il(jx(r))?r.pop():void 0}o(Kx,"popScheduler");function Vx(r,e){return typeof jx(r)=="number"?r.pop():e}o(Vx,"popNumber");var ja=o(function(r){return r&&typeof r.length=="number"&&typeof r!="function"},"isArrayLike");function Ol(r){return rt(r==null?void 0:r.then)}o(Ol,"isPromise");function Pl(r){return rt(r[Ha])}o(Pl,"isInteropObservable");function Nl(r){return Symbol.asyncIterator&&rt(r==null?void 0:r[Symbol.asyncIterator])}o(Nl,"isAsyncIterable");function Rl(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}o(Rl,"createInvalidObservableTypeError");function Zk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}o(Zk,"getSymbolIterator");var Ll=Zk();function Bl(r){return rt(r==null?void 0:r[Ll])}o(Bl,"isIterable");function Ul(r){return Cx(this,arguments,o(function(){var t,n,i,s;return El(this,function(a){switch(a.label){case 0:t=r.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Sl(t.read())];case 3:return n=a.sent(),i=n.value,s=n.done,s?[4,Sl(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Sl(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"))}o(Ul,"readableStreamLikeToAsyncGenerator");function Fl(r){return rt(r==null?void 0:r.getReader)}o(Fl,"isReadableStreamLike");function pr(r){if(r instanceof _t)return r;if(r!=null){if(Pl(r))return Qk(r);if(ja(r))return eC(r);if(Ol(r))return tC(r);if(Nl(r))return Wx(r);if(Bl(r))return rC(r);if(Fl(r))return nC(r)}throw Rl(r)}o(pr,"innerFrom");function Qk(r){return new _t(function(e){var t=r[Ha]();if(rt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}o(Qk,"fromInteropObservable");function eC(r){return new _t(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}o(eC,"fromArrayLike");function tC(r){return new _t(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Tl)})}o(tC,"fromPromise");function rC(r){return new _t(function(e){var t,n;try{for(var i=vs(r),s=i.next();!s.done;s=i.next()){var a=s.value;if(e.next(a),e.closed)return}}catch(f){t={error:f}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}o(rC,"fromIterable");function Wx(r){return new _t(function(e){iC(r,e).catch(function(t){return e.error(t)})})}o(Wx,"fromAsyncIterable");function nC(r){return Wx(Ul(r))}o(nC,"fromReadableStreamLike");function iC(r,e){var t,n,i,s;return kx(this,void 0,void 0,function(){var a,f;return El(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=Dx(r),u.label=1;case 1:return[4,t.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(a=n.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return f=u.sent(),i={error:f},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}o(iC,"process");function pn(r,e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(s),!i)return s}o(pn,"executeSchedule");function $l(r,e){return e===void 0&&(e=0),Yt(function(t,n){t.subscribe(Jt(n,function(i){return pn(n,r,function(){return n.next(i)},e)},function(){return pn(n,r,function(){return n.complete()},e)},function(i){return pn(n,r,function(){return n.error(i)},e)}))})}o($l,"observeOn");function ql(r,e){return e===void 0&&(e=0),Yt(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}o(ql,"subscribeOn");function Gx(r,e){return pr(r).pipe(ql(e),$l(e))}o(Gx,"scheduleObservable");function Yx(r,e){return pr(r).pipe(ql(e),$l(e))}o(Yx,"schedulePromise");function Jx(r,e){return new _t(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}o(Jx,"scheduleArray");function Xx(r,e){return new _t(function(t){var n;return pn(t,e,function(){n=r[Ll](),pn(t,e,function(){var i,s,a;try{i=n.next(),s=i.value,a=i.done}catch(f){t.error(f);return}a?t.complete():t.next(s)},0,!0)}),function(){return rt(n==null?void 0:n.return)&&n.return()}})}o(Xx,"scheduleIterable");function Hl(r,e){if(!r)throw new Error("Iterable cannot be null");return new _t(function(t){pn(t,e,function(){var n=r[Symbol.asyncIterator]();pn(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}o(Hl,"scheduleAsyncIterable");function Zx(r,e){return Hl(Ul(r),e)}o(Zx,"scheduleReadableStreamLike");function Qx(r,e){if(r!=null){if(Pl(r))return Gx(r,e);if(ja(r))return Jx(r,e);if(Ol(r))return Yx(r,e);if(Nl(r))return Hl(r,e);if(Bl(r))return Xx(r,e);if(Fl(r))return Zx(r,e)}throw Rl(r)}o(Qx,"scheduled");function ew(r,e){return e?Qx(r,e):pr(r)}o(ew,"from");var zl=Fa(function(r){return o(function(){r(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl")});function tw(r){return r instanceof Date&&!isNaN(r)}o(tw,"isValidDate");function jl(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){n.next(r.call(e,s,i++))}))})}o(jl,"map");var oC=Array.isArray;function sC(r,e){return oC(e)?r.apply(void 0,In([],qr(e))):r(e)}o(sC,"callOrApply");function rw(r){return jl(function(e){return sC(r,e)})}o(rw,"mapOneOrManyArgs");function nw(r,e,t,n,i,s,a,f){var u=[],p=0,b=0,x=!1,A=o(function(){x&&!u.length&&!p&&e.complete()},"checkComplete"),O=o(function(k){return p<n?T(k):u.push(k)},"outerNext"),T=o(function(k){s&&e.next(k),p++;var $=!1;pr(t(k,b++)).subscribe(Jt(e,function(C){i==null||i(C),s?O(C):e.next(C)},function(){$=!0},void 0,function(){if($)try{p--;for(var C=o(function(){var B=u.shift();a?pn(e,a,function(){return T(B)}):T(B)},"_loop_1");u.length&&p<n;)C();A()}catch(B){e.error(B)}}))},"doInnerSub");return r.subscribe(Jt(e,O,function(){x=!0,A()})),function(){f==null||f()}}o(nw,"mergeInternals");function sc(r,e,t){return t===void 0&&(t=1/0),rt(e)?sc(function(n,i){return jl(function(s,a){return e(n,s,i,a)})(pr(r(n,i)))},t):(typeof e=="number"&&(t=e),Yt(function(n,i){return nw(n,i,r,t)}))}o(sc,"mergeMap");function iw(r){return r===void 0&&(r=1/0),sc(za,r)}o(iw,"mergeAll");var aC=["addListener","removeListener"],fC=["addEventListener","removeEventListener"],cC=["on","off"];function ac(r,e,t,n){if(rt(t)&&(n=t,t=void 0),n)return ac(r,e,t).pipe(rw(n));var i=qr(dC(r)?fC.map(function(f){return function(u){return r[f](e,u,t)}}):uC(r)?aC.map(ow(r,e)):lC(r)?cC.map(ow(r,e)):[],2),s=i[0],a=i[1];if(!s&&ja(r))return sc(function(f){return ac(f,e,t)})(pr(r));if(!s)throw new TypeError("Invalid event target");return new _t(function(f){var u=o(function(){for(var p=[],b=0;b<arguments.length;b++)p[b]=arguments[b];return f.next(1<p.length?p:p[0])},"handler");return s(u),function(){return a(u)}})}o(ac,"fromEvent");function ow(r,e){return function(t){return function(n){return r[t](e,n)}}}o(ow,"toCommonHandlerRegistry");function uC(r){return rt(r.addListener)&&rt(r.removeListener)}o(uC,"isNodeStyleEventEmitter");function lC(r){return rt(r.on)&&rt(r.off)}o(lC,"isJQueryStyleEventEmitter");function dC(r){return rt(r.addEventListener)&&rt(r.removeEventListener)}o(dC,"isEventTarget");function fc(r,e,t){r===void 0&&(r=0),t===void 0&&(t=zx);var n=-1;return e!=null&&(Il(e)?t=e:n=e),new _t(function(i){var s=tw(r)?+r-t.now():r;s<0&&(s=0);var a=0;return t.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},s)})}o(fc,"timer");function Lp(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Kx(r),n=Vx(r,1/0),i=r;return i.length?i.length===1?pr(i[0]):iw(n)(ew(i,t)):Dl}o(Lp,"merge");function sw(r,e){return Yt(function(t,n){var i=0;t.subscribe(Jt(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}o(sw,"filter");function aw(r){return Yt(function(e,t){var n=!1;e.subscribe(Jt(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}o(aw,"defaultIfEmpty");function fw(r){return r<=0?function(){return Dl}:Yt(function(e,t){var n=0;e.subscribe(Jt(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}o(fw,"take");function cw(r){return r===void 0&&(r=hC),Yt(function(e,t){var n=!1;e.subscribe(Jt(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}o(cw,"throwIfEmpty");function hC(){return new zl}o(hC,"defaultErrorFactory");function Bp(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?sw(function(i,s){return r(i,s,n)}):za,fw(1),t?aw(e):cw(function(){return new zl}))}}o(Bp,"first");var pC={leading:!0,trailing:!1};function Up(r,e){return e===void 0&&(e=pC),Yt(function(t,n){var i=e.leading,s=e.trailing,a=!1,f=null,u=null,p=!1,b=o(function(){u==null||u.unsubscribe(),u=null,s&&(O(),p&&n.complete())},"endThrottling"),x=o(function(){u=null,p&&n.complete()},"cleanupThrottling"),A=o(function(T){return u=pr(r(T)).subscribe(Jt(n,b,x))},"startThrottle"),O=o(function(){if(a){a=!1;var T=f;f=null,n.next(T),!p&&A(T)}},"send");t.subscribe(Jt(n,function(T){a=!0,f=T,!(u&&!u.closed)&&(i?O():A(T))},function(){p=!0,!(s&&a&&u&&!u.closed)&&n.complete()}))})}o(Up,"throttle");var uw;(function(r){r[r.GENESIS=0]="GENESIS",r[r.PARTIAL=1]="PARTIAL",r[r.SIGNED=2]="SIGNED"})(uw||(uw={}));var ws;(function(r){r[r.NOT_REQUESTED=0]="NOT_REQUESTED",r[r.PENDING=1]="PENDING",r[r.PROCESSING=2]="PROCESSING",r[r.ANCHORED=3]="ANCHORED",r[r.FAILED=4]="FAILED"})(ws||(ws={}));var $p;(function(r){r[r.GENESIS=0]="GENESIS",r[r.SIGNED=1]="SIGNED",r[r.ANCHOR=2]="ANCHOR"})($p||($p={}));var Pn=class extends _t{constructor(e,t){super(n=>{e.subscribe(n)}),this.state$=e,this._context=t}get id(){return new Je(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){var n;let{next:e,content:t}=this.state$.value;return(0,Fp.default)((n=e==null?void 0:e.content)!=null?n:t)}get controllers(){return this.metadata.controllers}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return ht.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>ht.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===$p.ANCHOR).map(({cid:e})=>ht.make(this.id,e))}get state(){return(0,Fp.default)(this.state$.value)}sync(){return Z(this,arguments,function*(e={}){e=re({sync:Ct.PREFER_CACHE},e);let t=yield this.api.loadStream(this.id,e);this.state$.next(t.state)})}requestAnchor(){return Z(this,null,function*(){return this.api.requestAnchor(this.id)})}};o(Pn,"Stream");function vo(){return r=>{}}o(vo,"StreamStatic");var hw=at(require("cross-fetch"),1);function lw(r){let e=new AbortController;if(r.length===0)throw Error("Need abort signals to create a merged abort signal");return r.some(t=>t.aborted)?(e.abort(),e.signal):(Lp(...r.map(t=>ac(t,"abort"))).pipe(Bp()).subscribe(()=>{e.abort()}),e.signal)}o(lw,"mergeAbortSignals");var cc=class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=fc(e).subscribe(()=>{t.abort()})}clear(){var e;(e=this._subscription)==null||e.unsubscribe()}};o(cc,"TimedAbortSignal");function dw(r,e){return Z(this,null,function*(){let t=new AbortController,n=o(()=>{t.abort()},"onAbort");return r.addEventListener("abort",n),r.aborted&&t.abort(),e(t.signal).finally(()=>{r.removeEventListener("abort",n)})})}o(dw,"abortable");var mC=60*1e3*3;function wr(t){return Z(this,arguments,function*(r,e={}){e.body&&Object.assign(e,{body:JSON.stringify(e.body),headers:{"Content-Type":"application/json"}});let n=e.timeout||mC,i=new cc(n),s=e.signal?lw([e.signal,i.signal]):i.signal,a=yield dw(s,f=>(0,hw.default)(String(r),Te(re({},e),{signal:f}))).finally(()=>i.clear());if(!a.ok){let f=yield a.text();throw new Error(`HTTP request to '${r}' failed with status '${a.statusText}': ${f}`)}return a.json()})}o(wr,"fetchJson");var uc=at(nc(),1);Vn();function Ui(r){let e=Pe.asCID(r);if(e)return e;if(typeof r=="string")return Pe.parse(r);if(r instanceof Uint8Array)return Pe.decode(r);throw new Error(`${r} cannot be converted to a CID`)}o(Ui,"toCID");var pw=0,yt=class{static streamIdFromState(e){return new Je(e.type,e.log[0].cid)}static serializeCommit(e){var n;let t=(0,uc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=It(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=It(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(e)&&(t.link=t.link.toString()),yt.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),(n=e.header)!=null&&n.model&&(t.header.model=e.header.model.toString()),t)}static deserializeCommit(e){var n;let t=(0,uc.default)(e);return yt.isSignedCommitContainer(t)?(t.jws.link=Ui(t.jws.link),t.linkedBlock=Lt(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Lt(t.cacaoBlock,"base64")),t):(yt.isSignedCommit(t)&&(t.link=Ui(t.link)),yt.isAnchorCommit(t)&&(t.proof=Ui(t.proof)),t.id&&(t.id=Ui(t.id)),t.prev&&(t.prev=Ui(t.prev)),(n=t.header)!=null&&n.model&&(t.header.model=Je.fromString(t.header.model)),t)}static serializeState(e){var n,i,s,a;let t=(0,uc.default)(e);return t.log=t.log.map(f=>Te(re({},f),{cid:f.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=ws[t.anchorStatus]),t.anchorScheduledFor!=null&&(t.anchorScheduledFor=new Date(t.anchorScheduledFor).toISOString()),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),(n=e.metadata)!=null&&n.model&&(t.metadata.model=e.metadata.model.toString()),(s=(i=e.next)==null?void 0:i.metadata)!=null&&s.model&&(t.next.metadata.model=e.next.metadata.model.toString()),((a=e.metadata)==null?void 0:a.unique)&&e.type!=pw&&(t.metadata.unique=It(t.metadata.unique,"base64")),t.doctype=Cr.nameByCode(t.type),t}static deserializeState(e){var i,s,a,f;let t=(0,uc.default)(e);t.doctype&&(t.type=Cr.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(u=>Te(re({},u),{cid:Ui(u.cid)})),t.anchorProof&&(t.anchorProof.txHash=Ui(t.anchorProof.txHash),t.anchorProof.root=Ui(t.anchorProof.root));let n=!0;return t.anchorStatus&&(t.anchorStatus=ws[t.anchorStatus],n=t.anchorStatus!==ws.FAILED&&t.anchorStatus!==ws.ANCHORED),t.anchorScheduledFor&&(n?t.anchorScheduledFor=Date.parse(t.anchorScheduledFor):delete t.anchorScheduledFor),(i=e.metadata)!=null&&i.model&&(t.metadata.model=Je.fromString(e.metadata.model)),(a=(s=e.next)==null?void 0:s.metadata)!=null&&a.model&&(t.next.metadata.model=Je.fromString(e.next.metadata.model)),((f=e.metadata)==null?void 0:f.unique)&&e.type!=pw&&(t.metadata.unique=Lt(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(yt.serializeState(e))===JSON.stringify(yt.serializeState(t))}static isStateSupersetOf(e,t){if(e.log.length<t.log.length)return!1;for(let n in t.log)if(!e.log[n].cid.equals(t.log[n].cid))return!1;return e.anchorStatus==t.anchorStatus}static assertCommitLinksToState(e,t){let n=this.streamIdFromState(e);if(t.id&&!t.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${n.toString()}. Found: ${t.id}, expected ${e.log[0].cid}`);let i=e.log[e.log.length-1].cid;if(!t.prev.equals(i))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${i}, found 'prev' ${t.prev}`)}static convertCommitToSignedCommitContainer(e,t){return Z(this,null,function*(){if(yt.isSignedCommit(e)){let n=yield t.block.get(e.link);return{jws:e,linkedBlock:n}}return e})}static isSignedCommitContainer(e){return e&&e.jws!==void 0}static isSignedCommit(e){return e&&e.link!==void 0}static isAnchorCommit(e){return e&&e.proof!==void 0}static isSignedCommitData(e){return e&&e.envelope!==void 0}static isAnchorCommitData(e){return e&&e.proof!==void 0}};o(yt,"StreamUtils");function mw(r){if(typeof r=="string"&&r.includes("@")){let[e,t]=r.split("@");if(!e||!t)throw new Error("Invalid accountId provided");return new fs({address:e,chainId:t})}return new fs(r)}o(mw,"normalizeAccountId");var lc=class extends Pp{next(e){let t=this.value;yt.statesEqual(t,e)||super.next(e)}};o(lc,"StreamStateSubject");var bC=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Hr,qp={anchor:!0,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},gC={sync:Ct.PREFER_CACHE},bw={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Hp(r,e){var n;if(typeof(r==null?void 0:r.schema)=="string")try{ht.fromString(r.schema)}catch(i){throw new Error("Schema must be a CommitID")}let t={controllers:r==null?void 0:r.controllers,family:r==null?void 0:r.family,schema:(n=r==null?void 0:r.schema)==null?void 0:n.toString(),tags:r==null?void 0:r.tags};if(e)r!=null&&r.deterministic||(t.unique=It((0,yw.randomBytes)(12),"base64")),r!=null&&r.forbidControllerChange&&(t.forbidControllerChange=!0);else{if((r==null?void 0:r.deterministic)!==void 0||(r==null?void 0:r.unique)!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if((r==null?void 0:r.forbidControllerChange)!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(t).forEach(i=>t[i]===void 0&&delete t[i]),t}o(Hp,"headerFromMetadata");function gw(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(gw,"_ensureAuthenticated");function zp(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(zp,"throwReadOnlyError");var zr=Hr=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){var n;let{next:e,metadata:t}=this.state$.value;return(0,vw.default)((n=e==null?void 0:e.metadata)!=null?n:t)}static create(s,a,f){return Z(this,arguments,function*(e,t,n,i={}){i=re(re({},qp),i),!(n!=null&&n.deterministic)&&i.syncTimeoutSeconds==null&&(i.syncTimeoutSeconds=0);let u=i.asDID?{did:i.asDID}:e,p=yield Hr.makeGenesis(u,t,n);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,p,i)})}static createFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){var f;n=re(re({},qp),n),((f=t.header)==null?void 0:f.unique)&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=t.data?yield Hr._signDagJWS(e,t):t;return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,a,n)})}static deterministic(i,s){return Z(this,arguments,function*(e,t,n={}){if(n=re(re({},qp),n),t=Te(re({},t),{deterministic:!0}),t.family==null&&t.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let a=yield Hr.makeGenesis(e,null,t);return e.createStreamFromGenesis(Hr.STREAM_TYPE_ID,a,n)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},gC),n);let a=xr.from(t);if(a.type!=Hr.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Hr.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}update(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},bw),n);let a=n.asDID?{did:n.asDID}:this.api,f=yield this.makeCommit(a,e,t),u=yield this.api.applyCommit(this.id,f,n);this.state$.next(u.state)})}patch(n){return Z(this,arguments,function*(e,t={}){t=re(re({},bw),t);let s={header:Hp(this.metadata,!1),data:e,prev:this.tip,id:this.id.cid},a=yield Hr._signDagJWS(this.api,s),f=yield this.api.applyCommit(this.id,a,t);this.state$.next(f.state)})}makeReadOnly(){this.update=zp,this.patch=zp,this.sync=zp,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}makeCommit(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawCommit(e,t,n);return Hr._signDagJWS(e,i)})}_makeRawCommit(e,t,n){return Z(this,null,function*(){let i=Hp(n,!1);if(t==null&&(t=this.content),i.controllers){if(i.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!i.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let s=Pa.compare(this.content,t);return{header:i,data:s,prev:this.tip,id:this.state.log[0].cid}})}static makeGenesis(e,t,n){return Z(this,null,function*(){var a;if(n||(n={}),!n.controllers||n.controllers.length===0)if(e.did)yield gw(e),n.controllers=[e.did.hasParent?e.did.parent:e.did.id];else throw new Error("No controllers specified");if(((a=n.controllers)==null?void 0:a.length)!==1)throw new Error("Exactly one controller must be specified");let i=Hp(n,!0);if((n==null?void 0:n.deterministic)&&t)throw new Error("Initial content must be null when creating a deterministic Tile document");if(t==null){let f={header:i};return If(f),f}let s={data:t,header:i};return Hr._signDagJWS(e,s)})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield gw(e),e.did.createDagJWS(t)})}},"TileDocument");zr.STREAM_TYPE_NAME="tile";zr.STREAM_TYPE_ID=0;zr=Hr=bC([vo()],zr);var Tw=at(Ew(),1);function AC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(AC,"_checkPrivateRedeclaration");function TC(r,e){return e.get?e.get.call(r):e.value}o(TC,"_classApplyDescriptorGet");function kC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(kC,"_classApplyDescriptorSet");function Aw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Aw,"_classExtractFieldDescriptor");function Vp(r,e){var t=Aw(r,e,"get");return TC(r,t)}o(Vp,"_classPrivateFieldGet");function Sw(r,e,t){AC(r,e),e.set(r,t)}o(Sw,"_classPrivateFieldInit");function Mw(r,e,t){var n=Aw(r,e,"set");return kC(r,n,t),t}o(Mw,"_classPrivateFieldSet");function CC(r){return typeof r=="string"||ht.isInstance(r)||Je.isInstance(r)?{streamId:r}:{streamId:r.streamId,genesis:r.genesis}}o(CC,"keyToQuery");function Wp(r){return typeof r=="string"?xr.from(r).toString():ht.isInstance(r)||Je.isInstance(r)?r.toString():r.streamId.toString()}o(Wp,"keyToString");function Yp(r){return Z(this,null,function*(){let e=yield zr.makeGenesis({},null,Te(re({},r),{deterministic:!0})),t=yield Je.fromGenesis("tile",e);return{genesis:e,streamId:t}})}o(Yp,"getDeterministicQuery");var DC=o(()=>Promise.resolve([]),"tempBatchLoadFn"),Kl=new WeakMap,Gp=new WeakMap,mn=class extends Tw.default{cache(e){if(!Vp(this,Gp))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}create(e,t,n){return Z(this,null,function*(){let i=yield zr.create(Vp(this,Kl),e,t,n);return this.cache(i),i})}deterministic(e,t){return Z(this,null,function*(){let n=yield Yp(e);try{return yield md(mn.prototype,this,"load").call(this,n)}catch(i){let s=yield zr.createFromGenesis(Vp(this,Kl),n.genesis,t);return this.cache(s),s}})}load(e){return Z(this,null,function*(){return yield md(mn.prototype,this,"load").call(this,e)})}update(e,t,n,i){return Z(this,null,function*(){let s=Wp(e);this.clear(s);let a=yield this.load({streamId:s});return yield a.update(t,n,i),a})}constructor(e){super(DC,{cache:!0,cacheKeyFn:Wp,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),Sw(this,Kl,{writable:!0,value:void 0}),Sw(this,Gp,{writable:!0,value:void 0}),this._batchLoadFn=t=>Z(this,null,function*(){e.cache||this.clearAll();let n=yield e.ceramic.multiQuery(t.map(CC),e.multiqueryTimeout);return t.map(i=>{let s=Wp(i),a=n[s];return a||new Error(`Failed to load stream: ${s}`)})}),Mw(this,Kl,e.ceramic),Mw(this,Gp,!!e.cache)}};o(mn,"TileLoader");function IC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(IC,"_checkPrivateRedeclaration");function OC(r,e){return e.get?e.get.call(r):e.value}o(OC,"_classApplyDescriptorGet");function PC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(PC,"_classApplyDescriptorSet");function Cw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Cw,"_classExtractFieldDescriptor");function _s(r,e){var t=Cw(r,e,"get");return OC(r,t)}o(_s,"_classPrivateFieldGet");function kw(r,e,t){IC(r,e),e.set(r,t)}o(kw,"_classPrivateFieldInit");function Jp(r,e,t){var n=Cw(r,e,"set");return PC(r,n,t),t}o(Jp,"_classPrivateFieldSet");var Ka=new WeakMap,Va=new WeakMap,Wa=class{get aliases(){return _s(this,Ka)}get loader(){return _s(this,Va)}getDefinitionID(e){var t;return(t=_s(this,Ka).definitions[e])!=null?t:null}getSchemaURL(e){var t;return(t=_s(this,Ka).schemas[e])!=null?t:null}getTileID(e){var t;return(t=_s(this,Ka).tiles[e])!=null?t:null}loadTile(e){return Z(this,null,function*(){let t=this.getTileID(e);if(t==null)throw new Error(`Tile alias "${e}" is not defined`);return yield _s(this,Va).load(t)})}createTile(i,s){return Z(this,arguments,function*(e,t,n={}){let a=this.getSchemaURL(e);if(a==null)throw new Error(`Schema alias "${e}" is not defined`);let b=n,{controller:f}=b,u=Om(b,["controller"]),p={schema:a};return f!=null&&(p.controllers=[f]),yield _s(this,Va).create(t,p,u)})}constructor(e){if(kw(this,Ka,{writable:!0,value:void 0}),kw(this,Va,{writable:!0,value:void 0}),Jp(this,Ka,e.aliases),e.loader!=null)Jp(this,Va,e.loader);else{if(e.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");Jp(this,Va,new mn({ceramic:e.ceramic,cache:e.cache}))}}};o(Wa,"DataModel");function NC(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(NC,"_checkPrivateRedeclaration");function RC(r,e){return e.get?e.get.call(r):e.value}o(RC,"_classApplyDescriptorGet");function LC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(LC,"_classApplyDescriptorSet");function Dw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Dw,"_classExtractFieldDescriptor");function li(r,e){var t=Dw(r,e,"get");return RC(r,t)}o(li,"_classPrivateFieldGet");function Vl(r,e,t){NC(r,e),e.set(r,t)}o(Vl,"_classPrivateFieldInit");function Wl(r,e,t){var n=Dw(r,e,"set");return LC(r,n,t),t}o(Wl,"_classPrivateFieldSet");var Gl=new WeakMap,Es=new WeakMap,Xp=new WeakMap,Yl=new WeakMap,dc=class{_createValuePromise(){Wl(this,Xp,new Promise((e,t)=>{Wl(this,Yl,{resolve:e,reject:t})}))}change(e){return new Promise((t,n)=>{let i=o(s=>Z(this,null,function*(){try{let a=yield e(s);t(),this._next(a)}catch(a){n(a),this._next(s)}}),"run");li(this,Es).push({reject:n,run:i}),li(this,Es).length===1&&this._start()})}changeContent(e){return Z(this,null,function*(){let t=o(n=>Z(this,null,function*(){return yield n.update(e(n.content),n.metadata),n}),"mutation");return yield this.change(t)})}get(){return Z(this,null,function*(){return li(this,Es).length===0?yield li(this,Gl).call(this):yield li(this,Xp)})}_start(){return Z(this,null,function*(){try{let e=yield li(this,Gl).call(this);this._next(e)}catch(e){li(this,Es).forEach(t=>{t.reject(e)}),Wl(this,Es,[]),li(this,Yl).reject(e),this._createValuePromise()}})}_next(e){let t=li(this,Es).shift();t==null?this._end(e):t.run(e)}_end(e){li(this,Yl).resolve(e),this._createValuePromise()}constructor(e){Vl(this,Gl,{writable:!0,value:void 0}),Vl(this,Es,{writable:!0,value:[]}),Vl(this,Xp,{writable:!0,value:void 0}),Vl(this,Yl,{writable:!0,value:void 0}),Wl(this,Gl,e),this._createValuePromise()}};o(dc,"TileProxy");var BC=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function UC(r){return BC.test(r)}o(UC,"isDIDstring");function FC(r){if(!UC(r))throw new Error(`Invalid DID: ${r}`)}o(FC,"assertDIDstring");function Zp(r){return FC(r),{controllers:[r],family:"IDX"}}o(Zp,"getIDXMetadata");function $C(r,e){if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")}o($C,"_checkPrivateRedeclaration");function qC(r,e){return e.get?e.get.call(r):e.value}o(qC,"_classApplyDescriptorGet");function HC(r,e,t){if(e.set)e.set.call(r,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}o(HC,"_classApplyDescriptorSet");function Iw(r,e,t){if(!e.has(r))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(r)}o(Iw,"_classExtractFieldDescriptor");function Ut(r,e){var t=Iw(r,e,"get");return qC(r,t)}o(Ut,"_classPrivateFieldGet");function hc(r,e,t){$C(r,e),e.set(r,t)}o(hc,"_classPrivateFieldInit");function Jl(r,e,t){var n=Iw(r,e,"set");return HC(r,n,t),t}o(Jl,"_classPrivateFieldSet");var Fi=new WeakMap,Xl=new WeakMap,Qp=new WeakMap,di=new WeakMap,Zl=new WeakMap,pc=class{get authenticated(){return Ut(this,Fi).did!=null}get ceramic(){return Ut(this,Fi)}get id(){if(Ut(this,Xl)!=null)return Ut(this,Xl);if(Ut(this,Fi).did==null)throw new Error("Ceramic instance is not authenticated");return Ut(this,Fi).did.hasParent?Ut(this,Fi).did.parent:Ut(this,Fi).did.id}get loader(){return Ut(this,di)}get model(){return Ut(this,Zl)}has(e,t){return Z(this,null,function*(){let n=this.getDefinitionID(e);return(yield this.getRecordID(n,t))!=null})}get(e,t){return Z(this,null,function*(){let n=this.getDefinitionID(e);return yield this.getRecord(n,t)})}getMultiple(e,t){return Z(this,null,function*(){var f,u,p;let n=this.getDefinitionID(e),i=yield Promise.all(t.map(b=>Z(this,null,function*(){let{genesis:x,streamId:A}=yield Yp(Zp(b));return{genesis:x,streamId:A.toString(),paths:[n]}}))),s=yield Ut(this,Fi).multiQuery(i),a=[];for(let b of i){let x=(u=(f=s[b.streamId])==null?void 0:f.content)==null?void 0:u[n],A=x?s[Je.fromString(x).toString()]:null;a.push((p=A==null?void 0:A.content)!=null?p:null)}return a})}set(i,s){return Z(this,arguments,function*(e,t,n={}){var p;let a=this.getDefinitionID(e),[f,u]=yield this._setRecordOnly(a,t,n);return f&&(yield this._setReference((p=n.controller)!=null?p:this.id,a,u)),u})}merge(i,s){return Z(this,arguments,function*(e,t,n={}){let a=this.getDefinitionID(e),f=yield this.getRecord(a),u=f?re(re({},f),t):t;return yield this.setRecord(a,u,n)})}setAll(n){return Z(this,arguments,function*(e,t={}){var f;let i=Object.entries(e).map(b=>Z(this,[b],function*([u,p]){let x=this.getDefinitionID(u),[A,O]=yield this._setRecordOnly(x,p,t);return[A,x,O]})),a=(yield Promise.all(i)).reduce((u,[p,b,x])=>(p&&(u[b]=x.toUrl()),u),{});return yield this._setReferences((f=t.controller)!=null?f:this.id,a),a})}setDefaults(n){return Z(this,arguments,function*(e,t={}){var u,p;let i=(u=yield this.getIndex())!=null?u:{},s=Object.entries(e).map(([b,x])=>[this.getDefinitionID(b),x]).filter(b=>i[b[0]]==null).map(A=>Z(this,[A],function*([b,x]){let O=yield this.getDefinition(b),T=yield this._createRecord(O,x,t);return{[b]:T.toUrl()}})),f=(yield Promise.all(s)).reduce((b,x)=>Object.assign(b,x),{});return yield this._setReferences((p=t.controller)!=null?p:this.id,f),f})}remove(n){return Z(this,arguments,function*(e,t=this.id){yield this._getIndexProxy(t).changeContent(i=>(i!=null&&delete i[this.getDefinitionID(e)],i))})}getIndex(){return Z(this,arguments,function*(e=this.id){let t=this.authenticated&&e===this.id?yield this._getIndexProxy(e).get():yield this._getIDXDoc(e);return t?t.content:null})}iterator(e){let t,n=0;return{[Symbol.asyncIterator](){return this},next:()=>Z(this,null,function*(){if(t==null){let f=yield this.getIndex(e);t=Object.entries(f!=null?f:{})}if(n===t.length)return{done:!0,value:null};let[i,s]=t[n++],a=yield Ut(this,di).load(s);return{done:!1,value:{key:i,id:s,record:a.content}}})}}_createIDXDoc(e){return Z(this,null,function*(){return yield Ut(this,di).deterministic(Zp(e))})}_getIDXDoc(e){return Z(this,null,function*(){let t=yield this._createIDXDoc(e);if(t.content==null||t.metadata.schema==null)return null;if(t.metadata.schema!==il)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getOwnIDXDoc(e){return Z(this,null,function*(){let t=yield this._createIDXDoc(e);if(t.content==null||t.metadata.schema==null)yield t.update({},{schema:il});else if(t.metadata.schema!==il)throw new Error("Invalid document: schema is not IdentityIndex");return t})}_getIndexProxy(e){let t=Ut(this,Qp)[e];return t==null&&(t=new dc(()=>Z(this,null,function*(){return yield this._getOwnIDXDoc(e)})),Ut(this,Qp)[e]=t),t}getDefinitionID(e){var t;return(t=Ut(this,Zl).getDefinitionID(e))!=null?t:e}getDefinition(e){return Z(this,null,function*(){let t=yield Ut(this,di).load(e);if(t.metadata.schema!==m6)throw new Error("Invalid document: schema is not Definition");return Te(re({},t.content),{id:t.id})})}getRecordID(e,t){return Z(this,null,function*(){var i;let n=yield this.getIndex(t!=null?t:this.id);return(i=n==null?void 0:n[e])!=null?i:null})}getRecordDocument(e,t){return Z(this,null,function*(){let n=yield this.getRecordID(e,t);return n?yield Ut(this,di).load(n):null})}getRecord(e,t){return Z(this,null,function*(){let n=yield this.getRecordDocument(e,t);return n?n.content:null})}setRecord(i,s){return Z(this,arguments,function*(e,t,n={}){var u;let[a,f]=yield this._setRecordOnly(e,t,n);return a&&(yield this._setReference((u=n.controller)!=null?u:this.id,e,f)),f})}_setRecordOnly(e,t,n){return Z(this,null,function*(){var s;let i=yield this.getRecordID(e,(s=n.controller)!=null?s:this.id);if(i==null){let a=yield this.getDefinition(e),f=yield this._createRecord(a,t,n);return[!0,f]}else{let a=yield Ut(this,di).update(i,t);return[!1,a.id]}})}_createRecord(s,a,f){return Z(this,arguments,function*(e,t,{controller:n,pin:i}){let u=yield Ut(this,di).deterministic({controllers:[n!=null?n:this.id],family:e.id.toString()},{pin:i});return yield u.update(t,{schema:e.schema}),u.id})}_setReference(e,t,n){return Z(this,null,function*(){yield this._getIndexProxy(e).changeContent(i=>Te(re({},i),{[t]:n.toUrl()}))})}_setReferences(e,t){return Z(this,null,function*(){Object.keys(t).length!==0&&(yield this._getIndexProxy(e).changeContent(n=>re(re({},n),t)))})}constructor(e){hc(this,Fi,{writable:!0,value:void 0}),hc(this,Xl,{writable:!0,value:void 0}),hc(this,Qp,{writable:!0,value:{}}),hc(this,di,{writable:!0,value:void 0}),hc(this,Zl,{writable:!0,value:void 0});let{cache:t,ceramic:n,id:i,loader:s,model:a}=e;Jl(this,Fi,n),Jl(this,Xl,i),Jl(this,di,s!=null?s:new mn({ceramic:n,cache:t})),Jl(this,Zl,a instanceof Wa?a:new Wa({loader:Ut(this,di),aliases:a}))}};o(pc,"DIDDataStore");function em(r){return typeof r=="string"?Je.fromString(r):r}o(em,"typeStreamID");var mr=class extends _t{constructor(e,t,n){super(i=>{this.state$.observers.length===0&&(this.periodicSubscription=fc(0,n).pipe(Up(()=>this._syncState(this.id,{sync:Ct.PREFER_CACHE}))).subscribe()),this.state$.subscribe(i).add(()=>{var f;this.state$.observers.length===0&&((f=this.periodicSubscription)==null||f.unsubscribe())})}),this.state$=new lc(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}_syncState(e,t){return Z(this,null,function*(){let n=yield mr._load(e,this._apiUrl,t);this.state$.next(yt.deserializeState(n))})}get id(){return new Je(this.state$.value.type,this.state$.value.log[0].cid)}static createFromGenesis(e,t,n,i,s){return Z(this,null,function*(){let a=new URL("./streams",e),{state:f}=yield wr(a,{method:"post",body:{type:t,genesis:yt.serializeCommit(n),opts:i}});return new mr(yt.deserializeState(f),e,s)})}static applyCommit(e,t,n,i,s){return Z(this,null,function*(){let a=new URL("./commits",e),{state:f}=yield wr(a,{method:"post",body:{streamId:t.toString(),commit:yt.serializeCommit(n),opts:i}});return new mr(yt.deserializeState(f),e,s)})}static _load(e,t,n){return Z(this,null,function*(){let i=new URL(`./streams/${e}`,t);for(let a in n)i.searchParams.set(a,n[a]);let{state:s}=yield wr(i);return s})}static load(e,t,n,i){return Z(this,null,function*(){let s=yield mr._load(e,t,i);return new mr(yt.deserializeState(s),t,n)})}static loadStreamCommits(e,t){return Z(this,null,function*(){let n=new URL(`./commits/${e}`,t),{commits:i}=yield wr(n);return i.map(s=>({cid:s.cid,value:yt.deserializeCommit(s.value)}))})}complete(){this.state$.complete()}};o(mr,"Document");var Pw=at(nc(),1),zC=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Ss,tm=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),Ow={anchor:!1,publish:!0,pin:!0,sync:Ct.PREFER_CACHE},rm={anchor:!0,publish:!0,throwOnInvalidCommit:!0},jC={sync:Ct.PREFER_CACHE},Ms=Ss=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){var n;let{next:e,metadata:t}=this.state$.value;return(0,Pw.default)((n=e==null?void 0:e.metadata)!=null?n:t)}static fromAccount(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},Ow),n);let a=mw(t),f=Ss.makeGenesis(a);return Ss.fromGenesis(e,f,n)})}static fromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){return n=re(re({},Ow),n),e.createStreamFromGenesis(Ss.STREAM_TYPE_ID,t,n)})}setDid(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},rm),n);let a=typeof e=="string"?e.trim():e.id,f=bd(a);if((f==null?void 0:f.did)!==a)throw new Error(`DID is not valid: '${a}'`);let u=yield t.createLink(a);return this.setDidProof(u,n)})}setDidProof(n){return Z(this,arguments,function*(e,t={}){t=re(re({},rm),t);let i=this.makeCommit(e),s=yield this.api.applyCommit(this.id,i,t);this.state$.next(s.state)})}clearDid(n){return Z(this,arguments,function*(e,t={}){t=re(re({},rm),t);let i=yield e.createLink("");return this.setDidProof(i,t)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},jC),n);let a=xr.from(t);if(a.type!=Ss.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Ss.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}static makeGenesis(e){return e.chainId.namespace==="eip155"&&(e.address=e.address.toLowerCase()),{header:{controllers:[`${e.address}@${e.chainId.toString()}`],family:`caip10-${e.chainId.toString()}`}}}makeCommit(e){return{data:e,prev:this.tip,id:this.id.cid}}makeReadOnly(){this.setDidProof=tm,this.setDid=tm,this.sync=tm,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");Ms.STREAM_TYPE_NAME="caip10-link";Ms.STREAM_TYPE_ID=1;Ms=Ss=zC([vo()],Ms);var n4=at(ro(),1);Vn();Ho();var i4=at(Qw(),1),hD=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},br,pD={sync:Ct.PREFER_CACHE};function e4(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(e4,"_ensureAuthenticated");function t4(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(t4,"throwReadOnlyError");var r4;(function(r){r.LIST="list",r.SINGLE="single"})(r4||(r4={}));var yo=br=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:br.MODEL}}static create(e,t,n){return Z(this,null,function*(){br.assertComplete(t);let i={publish:!0,anchor:!0,pin:!0,sync:Ct.NEVER_SYNC,throwOnInvalidCommit:!0},s=yield br._makeGenesis(e,t,n);return yield e.createStreamFromGenesis(br.STREAM_TYPE_ID,s,i)})}static createPlaceholder(e,t,n){return Z(this,null,function*(){let i={publish:!1,anchor:!1,pin:!1,sync:Ct.NEVER_SYNC,throwOnInvalidCommit:!0},s=yield br._makeGenesis(e,t,n);return e.createStreamFromGenesis(br.STREAM_TYPE_ID,s,i)})}replacePlaceholder(e){return Z(this,null,function*(){br.assertComplete(e,this.id);let t={publish:!0,anchor:!0,pin:!0,throwOnInvalidCommit:!0},n=yield this._makeCommit(this.api,e),i=yield this.api.applyCommit(this.id,n,t);this.state$.next(i.state)})}static assertComplete(e,t){if(!e.name)throw t?new Error(`Model with StreamID ${t.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!e.schema)throw t?new Error(`Model ${e.name} (${t.toString()}) is missing a 'schema' field`):new Error(`Model ${e.name} is missing a 'schema' field`);if(!e.accountRelation)throw t?new Error(`Model ${e.name} (${t.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${e.name} is missing a 'accountRelation' field`)}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},pD),n);let a=xr.from(t);if(a.type!=br.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${br.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);let f=yield e.loadStream(a,n);try{br.assertComplete(f.content,t)}catch(u){throw new Error(`Incomplete placeholder Models cannot be loaded: ${u.message}`)}return f})}_makeCommit(e,t){return Z(this,null,function*(){let n=this._makeRawCommit(t);return br._signDagJWS(e,n)})}_makeRawCommit(e){if(e==null)throw new Error("Cannot set Model content to null");return{data:Pa.compare(this.content,e),prev:this.tip,id:this.state.log[0].cid}}static _makeGenesis(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawGenesis(e,t,n);return br._signDagJWS(e,i)})}static _makeRawGenesis(e,t,n){return Z(this,null,function*(){if(t==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(e.did)yield e4(e),n={controller:e.did.hasParent?e.did.parent:e.did.id};else throw new Error("No controller specified");let i={controllers:[n.controller],unique:(0,n4.randomBytes)(12),model:br.MODEL.bytes};return{data:t,header:i}})}makeReadOnly(){this.replacePlaceholder=t4,this.sync=t4,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static _signDagJWS(e,t){return Z(this,null,function*(){return yield e4(e),e.did.createDagJWS(t)})}},"Model");yo.STREAM_TYPE_NAME="model";yo.STREAM_TYPE_ID=2;yo.MODEL=function(){let r=If("model-v1"),e=i4.default.encode(r,"identity"),t=Kn(ga,e),n=Pe.createV1(ga,t);return new Je(br.STREAM_TYPE_ID,n)}();yo=br=hD([vo()],yo);var a4=at(ro(),1);var mD=function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var f=r.length-1;f>=0;f--)(a=r[f])&&(s=(i<3?a(s):i>3?a(e,t,s):a(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},$i,bD={anchor:!0,publish:!0,pin:!0,sync:Ct.NEVER_SYNC,syncTimeoutSeconds:0},gD={sync:Ct.PREFER_CACHE},o4={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function s4(r){return Z(this,null,function*(){if(r.did==null)throw new Error("No DID provided");r.did.authenticated||(yield r.did.authenticate(),r.loggerProvider&&r.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${r.did.id}`))})}o(s4,"_ensureAuthenticated");function om(){return Z(this,null,function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")})}o(om,"throwReadOnlyError");var As=$i=o(class extends Pn{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let e=this.state$.value.metadata;return{controller:e.controllers[0],model:e.model}}static create(s,a,f){return Z(this,arguments,function*(e,t,n,i={}){i=re(re({},bD),i);let u=i.asDID?{did:i.asDID}:e,p=yield $i._makeGenesis(u,t,n);return e.createStreamFromGenesis($i.STREAM_TYPE_ID,p,i)})}static load(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},gD),n);let a=xr.from(t);if(a.type!=$i.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${$i.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return e.loadStream(a,n)})}replace(n){return Z(this,arguments,function*(e,t={}){t=re(re({},o4),t);let i=t.asDID?{did:t.asDID}:this.api,s=yield this._makeCommit(i,e),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}patch(n){return Z(this,arguments,function*(e,t={}){t=re(re({},o4),t);let i={data:e,prev:this.tip,id:this.id.cid},s=yield $i._signDagJWS(this.api,i),a=yield this.api.applyCommit(this.id,s,t);this.state$.next(a.state)})}makeReadOnly(){this.replace=om,this.patch=om,this.sync=om,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(e,t){let n=this._makeRawCommit(t);return $i._signDagJWS(e,n)}_makeRawCommit(e){return{data:Pa.compare(this.content,e||{}),prev:this.tip,id:this.state.log[0].cid}}static _makeGenesis(e,t,n){return Z(this,null,function*(){let i=yield this._makeRawGenesis(e,t,n);return $i._signDagJWS(e,i)})}static _makeRawGenesis(e,t,n){return Z(this,null,function*(){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");if(!n.controller)if(e.did)yield s4(e),n.controller=e.did.hasParent?e.did.parent:e.did.id;else throw new Error("No controller specified");let i={controllers:[n.controller],unique:(0,a4.randomBytes)(12),model:n.model.bytes};return{data:t,header:i}})}static _signDagJWS(e,t){return Z(this,null,function*(){return yield s4(e),e.did.createDagJWS(t)})}},"ModelInstanceDocument");As.STREAM_TYPE_NAME="MID";As.STREAM_TYPE_ID=3;As=$i=mD([vo()],As);var bc=class{constructor(e){this._apiUrl=e}add(e,t){return Z(this,null,function*(){let n={};t&&(n.force=!0);let i=new URL(`./pins/${e}`,this._apiUrl);yield wr(i,{method:"post",body:n})})}rm(e,t){return Z(this,null,function*(){let n=new URL(`./pins/${e}`,this._apiUrl);yield wr(n,{method:"delete",body:{opts:t}})})}ls(e){return Z(this,null,function*(){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let n=yield wr(t),{pinnedStreamIds:i}=n;return{[Symbol.asyncIterator](){let s=0;return{next(){return s===i.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:i[s++],done:!1})}}}}})}};o(bc,"RemotePinApi");var gc=class{constructor(e){this._fetchJson=wr,this._collectionURL=new URL("./collection",e)}queryIndex(e){return Z(this,null,function*(){let t=new URL(this._collectionURL);for(let s in e)t.searchParams.set(s,e[s]);let n=yield this._fetchJson(t);return{edges:n.edges.map(s=>({cursor:s.cursor,node:yt.deserializeState(s.node)})),pageInfo:n.pageInfo}})}};o(gc,"RemoteIndexApi");var vD="/api/v0/",yD="http://localhost:7007",xD={syncInterval:5e3},wD={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},_D={anchor:!0,publish:!0,sync:Ct.PREFER_CACHE},f4={sync:Ct.PREFER_CACHE},vc=class{constructor(e=yD,t={}){this._config=re(re({},xD),t),this._apiUrl=new URL(vD,e),this._streamCache=new Map,this.context={api:this},this.pin=new bc(this._apiUrl),this.index=new gc(this._apiUrl),this._streamConstructors={[Ms.STREAM_TYPE_ID]:Ms,[yo.STREAM_TYPE_ID]:yo,[As.STREAM_TYPE_ID]:As,[zr.STREAM_TYPE_ID]:zr}}get did(){return this.context.did}set did(e){this.context.did=e}createStreamFromGenesis(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},_D),n);let a=yield mr.createFromGenesis(this._apiUrl,e,t,n,this._config.syncInterval),f=this._streamCache.get(a.id.toString());return f?(yt.statesEqual(a.state,f.state)||f.next(a.state),this.buildStreamFromDocument(f)):(this._streamCache.set(a.id.toString(),a),this.buildStreamFromDocument(a))})}loadStream(n){return Z(this,arguments,function*(e,t={}){t=re(re({},f4),t);let i=xr.from(e),s=this._streamCache.get(i.baseID.toString());return s?yield s._syncState(i,t):(s=yield mr.load(i,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(s.id.toString(),s)),this.buildStreamFromDocument(s)})}multiQuery(e,t){return Z(this,null,function*(){let n=e.map(a=>Te(re({},a),{streamId:typeof a.streamId=="string"?a.streamId:a.streamId.toString()})),i=new URL("./multiqueries",this._apiUrl),s=yield wr(i,{method:"post",body:{queries:n,timeout:t}});return Object.entries(s).reduce((a,f)=>{let[u,p]=f,b=yt.deserializeState(p),x=new mr(b,this._apiUrl,this._config.syncInterval);return a[u]=this.buildStreamFromDocument(x),a},{})})}loadStreamCommits(e){let t=em(e);return mr.loadStreamCommits(t,this._apiUrl)}applyCommit(i,s){return Z(this,arguments,function*(e,t,n={}){n=re(re({},wD),n);let a=em(e),f=yield mr.applyCommit(this._apiUrl,a,t,n,this._config.syncInterval),u=this._streamCache.get(a.toString());return u?(u.next(f.state),this.buildStreamFromDocument(f)):(this._streamCache.set(a.toString(),f),this.buildStreamFromDocument(f))})}requestAnchor(n){return Z(this,arguments,function*(e,t={}){t=re(re({},f4),t);let{anchorStatus:i}=yield wr(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return i})}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new mr(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(t)}buildStreamFromDocument(e){let t=e.state.type,n=this._streamConstructors[t];if(!n)throw new Error(`Failed to find constructor for stream ${t}`);return new n(e,this.context)}setDID(e){return Z(this,null,function*(){this.context.did=e})}getSupportedChains(){return Z(this,null,function*(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=yield wr(this._apiUrl+"/node/chains");return this._supportedChains=e,e})}close(){return Z(this,null,function*(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()})}};o(vc,"CeramicClient");var ED=o((r,e)=>Z(void 0,null,function*(){let t=new vc(e),n=re({},c4.default.getResolver()),i=new ls({resolver:n});t.did=i;let s=r.pluginMethods.getKey(),a=new Gf(Qu(s));return t.did.setProvider(a),yield t.did.authenticate(),t}),"getCeramicClientFromWalletSuite"),ed=o((s,a)=>Z(void 0,[s,a],function*(r,{modelData:e,credentialAlias:t,ceramicEndpoint:n,defaultContentFamily:i}){let f=yield ED(r,n),u=new mn({ceramic:f}),p=new pc({ceramic:f,model:e}),b=o((...$)=>Z(void 0,[...$],function*(k=t){return(yield p.get(k))||{credentials:[]}}),"getCredentialsListFromIdx"),x=o((k,$)=>Z(void 0,null,function*(){if(!k)throw new Error("record is required");if(!k.id)throw Error("No streamId provided");k.id.indexOf("ceramic://")===-1&&(k.id="ceramic://"+k.id),$||($=t);let C=yield b($),B=C.credentials.findIndex(z=>z.title===k.title);return B>-1?C.credentials[B]=re({storageType:"ceramic"},k):C.credentials.push(re({storageType:"ceramic"},k)),p.set($,C)}),"addCredentialStreamIdToIdx"),A=o((k,$)=>Z(void 0,null,function*(){if(!k)throw new Error("record is required");$||($=t);let C=yield b($);return C.credentials=C.credentials.filter(B=>B.title!==k),p.set($,C)}),"removeCredentialFromIdx"),O=o((B,...z)=>Z(void 0,[B,...z],function*(k,$={},C={}){if(!k)throw new Error("content is required");return $.controllers||($.controllers=[f.did.id]),$.family||($.family=i),"pin"in C||(C.pin=!0),(yield zr.create(f,k,$,C)).id.toString()}),"publishContentToCeramic"),T=o(k=>Z(void 0,null,function*(){var $;return($=yield u.load(k))==null?void 0:$.content}),"readContentFromCeramic");return{pluginMethods:{getCredentialsListFromIdx:(C,...B)=>Z(void 0,[C,...B],function*(k,$=t){return b($)}),publishContentToCeramic:(k,$)=>Z(void 0,null,function*(){return O($)}),readContentFromCeramic:(k,$)=>Z(void 0,null,function*(){return T($)}),getVerifiableCredentialFromIdx:(k,$)=>Z(void 0,null,function*(){var z;let C=yield b(),B=(z=C==null?void 0:C.credentials)==null?void 0:z.find(H=>(H==null?void 0:H.title)===$);return B&&(yield T(B.id))}),getVerifiableCredentialsFromIdx:()=>Z(void 0,null,function*(){var C,B;let k=yield b(),$=(B=(C=k==null?void 0:k.credentials)==null?void 0:C.map(z=>z==null?void 0:z.id))!=null?B:[];return Promise.all($.map(z=>Z(void 0,null,function*(){return T(z)})))}),addVerifiableCredentialInIdx:(B,z)=>Z(void 0,[B,z],function*(k,{title:$,id:C}){return x({title:$,id:C})}),removeVerifiableCredentialInIdx:(k,$)=>Z(void 0,null,function*(){return A($)})}}}),"getIDXPlugin");var Ae,u4=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});u4.decode();var td=null;function Ja(){return(td===null||td.buffer!==Ae.memory.buffer)&&(td=new Uint8Array(Ae.memory.buffer)),td}o(Ja,"getUint8Memory0");function hi(r,e){return u4.decode(Ja().subarray(r,r+e))}o(hi,"getStringFromWasm0");var qi=new Array(32).fill(void 0);qi.push(void 0,null,!0,!1);var yc=qi.length;function Ze(r){yc===qi.length&&qi.push(qi.length+1);let e=yc;return yc=qi[e],qi[e]=r,e}o(Ze,"addHeapObject");function Ie(r){return qi[r]}o(Ie,"getObject");function SD(r){r<36||(qi[r]=yc,yc=r)}o(SD,"dropObject");function pi(r){let e=Ie(r);return SD(r),e}o(pi,"takeObject");var Rt=0,nd=new TextEncoder("utf-8"),MD=typeof nd.encodeInto=="function"?function(r,e){return nd.encodeInto(r,e)}:function(r,e){let t=nd.encode(r);return e.set(t),{read:r.length,written:t.length}};function or(r,e,t){if(t===void 0){let f=nd.encode(r),u=e(f.length);return Ja().subarray(u,u+f.length).set(f),Rt=f.length,u}let n=r.length,i=e(n),s=Ja(),a=0;for(;a<n;a++){let f=r.charCodeAt(a);if(f>127)break;s[i+a]=f}if(a!==n){a!==0&&(r=r.slice(a)),i=t(i,n,n=a+r.length*3);let f=Ja().subarray(i+a,i+n);a+=MD(r,f).written}return Rt=a,i}o(or,"passStringToWasm0");function AD(r){return r==null}o(AD,"isLikeNone");var rd=null;function Xt(){return(rd===null||rd.buffer!==Ae.memory.buffer)&&(rd=new Int32Array(Ae.memory.buffer)),rd}o(Xt,"getInt32Memory0");function sm(r){let e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){let i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){let i=r.length,s="[";i>0&&(s+=sm(r[0]));for(let a=1;a<i;a++)s+=", "+sm(r[a]);return s+="]",s}let t=/\[object ([^\]]+)\]/.exec(toString.call(r)),n;if(t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch(i){return"Object"}return r instanceof Error?`${r.name}: ${r.message}
792
+ ${r.stack}`:n}o(sm,"debugString");function TD(r,e,t,n){let i={a:r,b:e,cnt:1,dtor:t},s=o((...a)=>{i.cnt++;let f=i.a;i.a=0;try{return n(f,i.b,...a)}finally{--i.cnt===0?Ae.__wbindgen_export_2.get(i.dtor)(f,i.b):i.a=f}},"real");return s.original=i,s}o(TD,"makeMutClosure");function kD(r,e,t){Ae._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(r,e,Ze(t))}o(kD,"__wbg_adapter_24");function l4(r,e){let t=e(r.length*1);return Ja().set(r,t/1),Rt=r.length,t}o(l4,"passArray8ToWasm0");function d4(r){try{let f=Ae.__wbindgen_add_to_stack_pointer(-16),u=l4(r,Ae.__wbindgen_malloc),p=Rt;Ae.generateEd25519KeyFromBytes(f,u,p);var e=Xt()[f/4+0],t=Xt()[f/4+1],n=Xt()[f/4+2],i=Xt()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,pi(n);return hi(s,a)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(s,a)}}o(d4,"generateEd25519KeyFromBytes");function h4(r){try{let f=Ae.__wbindgen_add_to_stack_pointer(-16),u=l4(r,Ae.__wbindgen_malloc),p=Rt;Ae.generateSecp256k1KeyFromBytes(f,u,p);var e=Xt()[f/4+0],t=Xt()[f/4+1],n=Xt()[f/4+2],i=Xt()[f/4+3],s=e,a=t;if(i)throw s=0,a=0,pi(n);return hi(s,a)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(s,a)}}o(h4,"generateSecp256k1KeyFromBytes");function p4(r,e){try{let u=Ae.__wbindgen_add_to_stack_pointer(-16),p=or(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),b=Rt,x=or(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),A=Rt;Ae.keyToDID(u,p,b,x,A);var t=Xt()[u/4+0],n=Xt()[u/4+1],i=Xt()[u/4+2],s=Xt()[u/4+3],a=t,f=n;if(s)throw a=0,f=0,pi(i);return hi(a,f)}finally{Ae.__wbindgen_add_to_stack_pointer(16),Ae.__wbindgen_free(a,f)}}o(p4,"keyToDID");function m4(r,e){let t=or(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=or(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.keyToVerificationMethod(t,n,i,s);return pi(a)}o(m4,"keyToVerificationMethod");function b4(r,e,t){let n=or(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),i=Rt,s=or(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),a=Rt,f=or(t,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt,p=Ae.issueCredential(n,i,s,a,f,u);return pi(p)}o(b4,"issueCredential");function g4(r,e){let t=or(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=or(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.verifyCredential(t,n,i,s);return pi(a)}o(g4,"verifyCredential");function v4(r,e,t){let n=or(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),i=Rt,s=or(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),a=Rt,f=or(t,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt,p=Ae.issuePresentation(n,i,s,a,f,u);return pi(p)}o(v4,"issuePresentation");function y4(r,e){let t=or(r,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),n=Rt,i=or(e,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),s=Rt,a=Ae.verifyPresentation(t,n,i,s);return pi(a)}o(y4,"verifyPresentation");function gr(r,e){try{return r.apply(this,e)}catch(t){Ae.__wbindgen_exn_store(Ze(t))}}o(gr,"handleError");function CD(r,e){return Ja().subarray(r/1,r/1+e)}o(CD,"getArrayU8FromWasm0");function DD(r,e,t,n){Ae.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(r,e,Ze(t),Ze(n))}o(DD,"__wbg_adapter_110");function ID(r,e){return Z(this,null,function*(){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return yield WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}let t=yield r.arrayBuffer();return yield WebAssembly.instantiate(t,e)}else{let t=yield WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}})}o(ID,"load");function x4(r){return Z(this,null,function*(){let e={};e.wbg={},e.wbg.__wbindgen_string_new=function(i,s){let a=hi(i,s);return Ze(a)},e.wbg.__wbindgen_object_drop_ref=function(i){pi(i)},e.wbg.__wbindgen_cb_drop=function(i){let s=pi(i).original;return s.cnt--==1?(s.a=0,!0):!1},e.wbg.__wbindgen_object_clone_ref=function(i){let s=Ie(i);return Ze(s)},e.wbg.__wbg_fetch_811d43d6bdcad5b1=function(i){let s=fetch(Ie(i));return Ze(s)},e.wbg.__wbg_fetch_bf56e2a9f0644e3f=function(i,s){let a=Ie(i).fetch(Ie(s));return Ze(a)},e.wbg.__wbg_new_89d7f088c1c45353=function(){return gr(function(){let i=new Headers;return Ze(i)},arguments)},e.wbg.__wbg_append_f4f93bc73c45ee3e=function(){return gr(function(i,s,a,f,u){Ie(i).append(hi(s,a),hi(f,u))},arguments)},e.wbg.__wbindgen_string_get=function(i,s){let a=Ie(s),f=typeof a=="string"?a:void 0;var u=AD(f)?0:or(f,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),p=Rt;Xt()[i/4+1]=p,Xt()[i/4+0]=u},e.wbg.__wbg_instanceof_Response_ccfeb62399355bcd=function(i){return Ie(i)instanceof Response},e.wbg.__wbg_url_06c0f822d68d195c=function(i,s){let a=Ie(s).url,f=or(a,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt;Xt()[i/4+1]=u,Xt()[i/4+0]=f},e.wbg.__wbg_status_600fd8b881393898=function(i){return Ie(i).status},e.wbg.__wbg_headers_9e7f2c05a9b962ea=function(i){let s=Ie(i).headers;return Ze(s)},e.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return gr(function(i){let s=Ie(i).arrayBuffer();return Ze(s)},arguments)},e.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return gr(function(i,s,a){let f=new Request(hi(i,s),Ie(a));return Ze(f)},arguments)},e.wbg.__wbindgen_is_object=function(i){let s=Ie(i);return typeof s=="object"&&s!==null},e.wbg.__wbg_self_86b4b13392c7af56=function(){return gr(function(){let i=self.self;return Ze(i)},arguments)},e.wbg.__wbg_crypto_b8c92eaac23d0d80=function(i){let s=Ie(i).crypto;return Ze(s)},e.wbg.__wbg_msCrypto_9ad6677321a08dd8=function(i){let s=Ie(i).msCrypto;return Ze(s)},e.wbg.__wbindgen_is_undefined=function(i){return Ie(i)===void 0},e.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81=function(){return Ze(n)},e.wbg.__wbg_require_f5521a5b85ad2542=function(i,s,a){let f=Ie(i).require(hi(s,a));return Ze(f)},e.wbg.__wbg_getRandomValues_dd27e6b0652b3236=function(i){let s=Ie(i).getRandomValues;return Ze(s)},e.wbg.__wbg_getRandomValues_e57c9b75ddead065=function(i,s){Ie(i).getRandomValues(Ie(s))},e.wbg.__wbg_randomFillSync_d2ba53160aec6aba=function(i,s,a){Ie(i).randomFillSync(CD(s,a))},e.wbg.__wbindgen_is_function=function(i){return typeof Ie(i)=="function"},e.wbg.__wbg_newnoargs_e23b458e372830de=function(i,s){let a=new Function(hi(i,s));return Ze(a)},e.wbg.__wbg_next_cabb70b365520721=function(i){let s=Ie(i).next;return Ze(s)},e.wbg.__wbg_next_bf3d83fc18df496e=function(){return gr(function(i){let s=Ie(i).next();return Ze(s)},arguments)},e.wbg.__wbg_done_040f966faa9a72b3=function(i){return Ie(i).done},e.wbg.__wbg_value_419afbd9b9574c4c=function(i){let s=Ie(i).value;return Ze(s)},e.wbg.__wbg_iterator_4832ef1f15b0382b=function(){return Ze(Symbol.iterator)},e.wbg.__wbg_get_a9cab131e3152c49=function(){return gr(function(i,s){let a=Reflect.get(Ie(i),Ie(s));return Ze(a)},arguments)},e.wbg.__wbg_call_ae78342adc33730a=function(){return gr(function(i,s){let a=Ie(i).call(Ie(s));return Ze(a)},arguments)},e.wbg.__wbg_new_36359baae5a47e27=function(){let i=new Object;return Ze(i)},e.wbg.__wbg_call_3ed288a247f13ea5=function(){return gr(function(i,s,a){let f=Ie(i).call(Ie(s),Ie(a));return Ze(f)},arguments)},e.wbg.__wbg_getTime_bffb1c09df09618b=function(i){return Ie(i).getTime()},e.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){let i=new Date;return Ze(i)},e.wbg.__wbg_new_37705eed627d5ed9=function(i,s){try{var a={a:i,b:s},f=o((p,b)=>{let x=a.a;a.a=0;try{return DD(x,a.b,p,b)}finally{a.a=x}},"cb0");let u=new Promise(f);return Ze(u)}finally{a.a=a.b=0}},e.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(i){let s=Promise.resolve(Ie(i));return Ze(s)},e.wbg.__wbg_then_ce526c837d07b68f=function(i,s){let a=Ie(i).then(Ie(s));return Ze(a)},e.wbg.__wbg_then_842e65b843962f56=function(i,s,a){let f=Ie(i).then(Ie(s),Ie(a));return Ze(f)},e.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return gr(function(){let i=self.self;return Ze(i)},arguments)},e.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return gr(function(){let i=window.window;return Ze(i)},arguments)},e.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return gr(function(){let i=globalThis.globalThis;return Ze(i)},arguments)},e.wbg.__wbg_global_5de1e0f82bddcd27=function(){return gr(function(){let i=global.global;return Ze(i)},arguments)},e.wbg.__wbg_buffer_7af23f65f6c64548=function(i){let s=Ie(i).buffer;return Ze(s)},e.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(i,s,a){let f=new Uint8Array(Ie(i),s>>>0,a>>>0);return Ze(f)},e.wbg.__wbg_new_cc9018bd6f283b6f=function(i){let s=new Uint8Array(Ie(i));return Ze(s)},e.wbg.__wbg_set_f25e869e4565d2a2=function(i,s,a){Ie(i).set(Ie(s),a>>>0)},e.wbg.__wbg_length_0acb1cf9bbaf8519=function(i){return Ie(i).length},e.wbg.__wbg_newwithlength_8f0657faca9f1422=function(i){let s=new Uint8Array(i>>>0);return Ze(s)},e.wbg.__wbg_subarray_da527dbd24eafb6b=function(i,s,a){let f=Ie(i).subarray(s>>>0,a>>>0);return Ze(f)},e.wbg.__wbg_has_ce995ec88636803d=function(){return gr(function(i,s){return Reflect.has(Ie(i),Ie(s))},arguments)},e.wbg.__wbg_set_93b1c87ee2af852e=function(){return gr(function(i,s,a){return Reflect.set(Ie(i),Ie(s),Ie(a))},arguments)},e.wbg.__wbg_stringify_c760003feffcc1f2=function(){return gr(function(i){let s=JSON.stringify(Ie(i));return Ze(s)},arguments)},e.wbg.__wbindgen_debug_string=function(i,s){let a=sm(Ie(s)),f=or(a,Ae.__wbindgen_malloc,Ae.__wbindgen_realloc),u=Rt;Xt()[i/4+1]=u,Xt()[i/4+0]=f},e.wbg.__wbindgen_throw=function(i,s){throw new Error(hi(i,s))},e.wbg.__wbindgen_memory=function(){let i=Ae.memory;return Ze(i)},e.wbg.__wbindgen_closure_wrapper10913=function(i,s,a){let f=TD(i,s,3725,kD);return Ze(f)},(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));let{instance:t,module:n}=yield ID(yield r,e);return Ae=t.exports,x4.__wbindgen_wasm_module=n,Ae})}o(x4,"init");var w4=x4;var _4=!1,OD=o((r="https://cdn.filestackcontent.com/dlXanMvQCGDR76JXcBkA")=>Z(void 0,null,function*(){if(!_4)return _4=!0,w4(r)}),"init"),E4=OD;var am=o(r=>Z(void 0,null,function*(){yield E4(r);let e={};return{pluginMethods:{generateEd25519KeyFromBytes:(t,n)=>JSON.parse(d4(n)),generateSecp256k1KeyFromBytes:(t,n)=>JSON.parse(h4(n)),keyToDid:(t,n,i)=>{let s=e[n];if(!s){let a=p4(n,JSON.stringify(i));return e[n]=a,a}return s},keyToVerificationMethod:(t,n,i)=>Z(void 0,null,function*(){return m4(n,JSON.stringify(i))}),issueCredential:(t,n,i,s)=>Z(void 0,null,function*(){return JSON.parse(yield b4(JSON.stringify(n),JSON.stringify(i),JSON.stringify(s)))}),verifyCredential:(t,n)=>Z(void 0,null,function*(){return JSON.parse(yield g4(JSON.stringify(n),"{}"))}),issuePresentation:(t,n,i,s)=>Z(void 0,null,function*(){return JSON.parse(yield v4(JSON.stringify(n),JSON.stringify(i),JSON.stringify(s)))}),verifyPresentation:(t,n)=>Z(void 0,null,function*(){return JSON.parse(yield y4(JSON.stringify(n),"{}"))})}}}),"getDidKitPlugin");var PD=["key","tz","pkh:tz","pkh:tezos","pkh:sol","pkh:solana"],ND=["key","tz","ethr","pkh:tz","pkh:tezos","pkh:eth","pkh:celo","pkh:poly","pkh:btc","pkh:doge","pkh:eip155","pkh:bip122"],S4=o(r=>/^[0-9a-f]+$/i.test(r),"isHex"),M4=o(r=>{if(PD.includes(r))return"ed25519";if(ND.includes(r)||r.startsWith("pkh:eip155:")||r.startsWith("pkh:bip122:"))return"secp256k1";throw new Error("Unspported Did Method")},"getAlgorithmForDidMethod");var A4=o((r,e)=>Z(void 0,null,function*(){if(e.length===0)throw new Error("Please don't use an empty string for a key!");if(!S4(e))throw new Error("Key must be a hexadecimal string!");if(e.length>64)throw new Error("Key must be less than 64 characters");let t=e.padStart(64,"0"),n=Qu(t),i={},s={ed25519:r.pluginMethods.generateEd25519KeyFromBytes(n),secp256k1:r.pluginMethods.generateSecp256k1KeyFromBytes(n)};return{pluginMethods:{getSubjectDid:(a,f)=>{if(!i[f]){let u=M4(f);i[f]=r.pluginMethods.keyToDid(f,s[u])}return i[f]},getSubjectKeypair:(a,f="ed25519")=>{if(!s[f])throw new Error("Unsupported algorithm");return s[f]},getKey:()=>t}}}),"getDidKeyPlugin");var fm=o(r=>({pluginMethods:{verifyCredential:(e,t)=>Z(void 0,null,function*(){let n=yield r.pluginMethods.verifyCredential(t);return t.expirationDate&&new Date>new Date(t.expirationDate)?n.errors.push("expiration error: Credential is expired"):n.checks.push("expiration"),n})}}),"ExpirationPlugin");var T4=o(r=>({}),"recycleDependents");var k4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectKeypair();if(!n)throw new Error("Cannot issue credential: Could not get subject keypair");let i={verificationMethod:yield r.pluginMethods.keyToVerificationMethod("key",n),proofPurpose:"assertionMethod"};return r.pluginMethods.issueCredential(t,i,n)}),"issueCredential");var C4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyCredential(t)}),"verifyCredential");var D4=o(r=>(e,t)=>Z(void 0,null,function*(){let n=e.pluginMethods.getSubjectKeypair();if(!n)throw new Error("Cannot issue credential: Could not get subject keypair");let i={verificationMethod:yield r.pluginMethods.keyToVerificationMethod("key",n),proofPurpose:"assertionMethod"};return r.pluginMethods.issuePresentation(t,i,n)}),"issuePresentation");var I4=o(r=>(e,t)=>Z(void 0,null,function*(){return r.pluginMethods.verifyPresentation(t)}),"verifyPresentation");var cm=o(r=>Z(void 0,null,function*(){return{pluginMethods:Te(re({},T4(r.pluginMethods)),{issueCredential:k4(r),verifyCredential:C4(r),issuePresentation:D4(r),verifyPresentation:I4(r),getTestVc:(e,t="did:example:d23dd687a7dc6787646f2eb98d0")=>{let n=e.pluginMethods.getSubjectDid("key");return{"@context":["https://www.w3.org/2018/credentials/v1"],id:"http://example.org/credentials/3731",type:["VerifiableCredential"],issuer:n,issuanceDate:"2020-08-19T21:41:50Z",credentialSubject:{id:t}}},getTestVp:(e,t)=>Z(void 0,null,function*(){let n=t||(yield e.pluginMethods.issueCredential(e.pluginMethods.getTestVc())),i=e.pluginMethods.getSubjectDid("key");return{"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],holder:i,verifiableCredential:n}})})}}),"getVCPlugin");var Xa=require("ethers"),P4=o((r,e)=>{let{address:t,infuraProjectId:n,network:i="mainnet"}=e,s;n?s=new Xa.ethers.providers.InfuraProvider(i,n):s=Xa.ethers.getDefaultProvider(i);let a=o(f=>Z(void 0,null,function*(){if(!t)throw new Error("Can't check balance: No address provided.");let u=O4(),b=yield new Xa.ethers.Contract(f,u,s).balanceOf(t);return Xa.ethers.utils.formatUnits(b)}),"checkErc20TokenBalance");return{pluginMethods:{checkMyEth:()=>Z(void 0,null,function*(){if(!t)throw new Error("Can't check ETH: No ethereum address provided.");let f=yield s.getBalance(t);return Xa.ethers.utils.formatEther(f)}),checkMyDai:()=>Z(void 0,null,function*(){return yield a("0x6B175474E89094C44Da98b954EedeAC495271d0F")}),checkMyUsdc:()=>Z(void 0,null,function*(){return yield a("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48")})}}},"getEthereumPlugin");var kt;(function(r){function e(n){throw new Error}o(e,"assertNever"),r.assertNever=e,r.arrayToEnum=n=>{let i={};for(let s of n)i[s]=s;return i},r.getValidEnumValues=n=>{let i=r.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(let a of i)s[a]=n[a];return r.objectValues(s)},r.objectValues=n=>r.objectKeys(n).map(function(i){return n[i]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let i=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},r.find=(n,i)=>{for(let s of n)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function t(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}o(t,"joinValues"),r.joinValues=t})(kt||(kt={}));var Me=kt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xo=o(r=>{switch(typeof r){case"undefined":return Me.undefined;case"string":return Me.string;case"number":return isNaN(r)?Me.nan:Me.number;case"boolean":return Me.boolean;case"function":return Me.function;case"bigint":return Me.bigint;case"object":return Array.isArray(r)?Me.array:r===null?Me.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Me.promise:typeof Map!="undefined"&&r instanceof Map?Me.map:typeof Set!="undefined"&&r instanceof Set?Me.set:typeof Date!="undefined"&&r instanceof Date?Me.date:Me.object;default:return Me.unknown}},"getParsedType"),Se=kt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of"]),LD=o(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),bn=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(s){return s.message},n={_errors:[]},i=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let f=n,u=0;for(;u<a.path.length;){let p=a.path[u];u===a.path.length-1?(f[p]=f[p]||{_errors:[]},f[p]._errors.push(t(a))):f[p]=f[p]||{_errors:[]},f=f[p],u++}}},"processError");return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,null,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};o(bn,"ZodError");bn.create=r=>new bn(r);var xc=o((r,e)=>{let t;switch(r.code){case Se.invalid_type:r.received===Me.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case Se.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected)}`;break;case Se.unrecognized_keys:t=`Unrecognized key(s) in object: ${kt.joinValues(r.keys,", ")}`;break;case Se.invalid_union:t="Invalid input";break;case Se.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${kt.joinValues(r.options)}`;break;case Se.invalid_enum_value:t=`Invalid enum value. Expected ${kt.joinValues(r.options)}, received '${r.received}'`;break;case Se.invalid_arguments:t="Invalid function arguments";break;case Se.invalid_return_type:t="Invalid function return type";break;case Se.invalid_date:t="Invalid date";break;case Se.invalid_string:r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case Se.too_small:r.type==="array"?t=`Array must contain ${r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be greater than ${r.inclusive?"or equal to ":""}${r.minimum}`:t="Invalid input";break;case Se.too_big:r.type==="array"?t=`Array must contain ${r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be less than ${r.inclusive?"or equal to ":""}${r.maximum}`:t="Invalid input";break;case Se.custom:t="Invalid input";break;case Se.invalid_intersection_types:t="Intersection results could not be merged";break;case Se.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;default:t=e.defaultError,kt.assertNever(r)}return{message:t}},"defaultErrorMap"),wc=xc,BD=o(r=>{wc=r},"setErrorMap"),id=o(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,s=[...t,...i.path||[]],a=Te(re({},i),{path:s}),f="",u=n.filter(p=>!!p).slice().reverse();for(let p of u)f=p(a,{data:e,defaultError:f}).message;return Te(re({},i),{path:s,message:i.message||f})},"makeIssue"),UD=[];function Re(r,e){let t=id({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,wc,xc].filter(n=>!!n)});r.common.issues.push(t)}o(Re,"addIssueToContext");var sr=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return nt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static mergeObjectAsync(e,t){return Z(this,null,function*(){let n=[];for(let i of t)n.push({key:yield i.key,value:yield i.value});return sr.mergeObjectSync(e,n)})}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return nt;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),(typeof a.value!="undefined"||i.alwaysSet)&&(n[s.value]=a.value)}return{status:e.value,value:n}}};o(sr,"ParseStatus");var nt=Object.freeze({status:"aborted"}),FD=o(r=>({status:"dirty",value:r}),"DIRTY"),_r=o(r=>({status:"valid",value:r}),"OK"),um=o(r=>r.status==="aborted","isAborted"),lm=o(r=>r.status==="dirty","isDirty"),od=o(r=>r.status==="valid","isValid"),dm=o(r=>typeof Promise!==void 0&&r instanceof Promise,"isAsync"),xt;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(xt||(xt={}));var jr=class{constructor(e,t,n,i){this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._path.concat(this._key)}};o(jr,"ParseInputLazyPath");var N4=o((r,e)=>{if(od(e))return{success:!0,data:e.value};{if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");let t=new bn(r.common.issues);return{success:!1,error:t}}},"handleResult");function st(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||n))throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:o((a,f)=>a.code!=="invalid_type"?{message:f.defaultError}:typeof f.data=="undefined"&&n?{message:n}:r.invalid_type_error?{message:r.invalid_type_error}:{message:f.defaultError},"customMap"),description:i}}o(st,"processCreateParams");var ot=class{constructor(e){this.spa=this.safeParseAsync,this.superRefine=this._refinement,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return xo(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:xo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new sr,ctx:{common:e.parent.common,data:e.data,parsedType:xo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(dm(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xo(e)},s=this._parseSync({data:e,path:i.path,parent:i});return N4(i,s)}parseAsync(e,t){return Z(this,null,function*(){let n=yield this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error})}safeParseAsync(e,t){return Z(this,null,function*(){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xo(e)},i=this._parse({data:e,path:[],parent:n}),s=yield dm(i)?i:Promise.resolve(i);return N4(n,s)})}refine(e,t){let n=o(i=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,s)=>{let a=e(i),f=o(()=>s.addIssue(re({code:Se.custom},n(i))),"setError");return typeof Promise!="undefined"&&a instanceof Promise?a.then(u=>u?!0:(f(),!1)):a?!0:(f(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new Wr({schema:this,typeName:et.ZodEffects,effect:{type:"refinement",refinement:e}})}optional(){return Gr.create(this)}nullable(){return vi.create(this)}nullish(){return this.optional().nullable()}array(){return Kr.create(this)}promise(){return zi.create(this)}or(e){return wo.create([this,e])}and(e){return _o.create(this,e)}transform(e){return new Wr({schema:this,typeName:et.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Qa({innerType:this,defaultValue:t,typeName:et.ZodDefault})}describe(e){let t=this.constructor;return new t(Te(re({},this._def),{description:e}))}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(ot,"ZodType");var $D=/^c[^\s-]{8,}$/i,qD=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,HD=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Nn=class extends ot{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement(i=>e.test(i),re({validation:t,code:Se.invalid_string},xt.errToObj(n))),this.nonempty=e=>this.min(1,xt.errToObj(e)),this.trim=()=>new Nn(Te(re({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}_parse(e){if(this._getType(e)!==Me.string){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Me.string,received:s.parsedType}),nt}let n=new sr,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Re(i,{code:Se.too_small,minimum:s.value,type:"string",inclusive:!0,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Re(i,{code:Se.too_big,maximum:s.value,type:"string",inclusive:!0,message:s.message}),n.dirty());else if(s.kind==="email")HD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"email",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")qD.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"uuid",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")$D.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"cuid",code:Se.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch(a){i=this._getOrReturnCtx(e,i),Re(i,{validation:"url",code:Se.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Re(i,{validation:"regex",code:Se.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():kt.assertNever(s);return{status:n.value,value:e.data}}_addCheck(e){return new Nn(Te(re({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(re({kind:"email"},xt.errToObj(e)))}url(e){return this._addCheck(re({kind:"url"},xt.errToObj(e)))}uuid(e){return this._addCheck(re({kind:"uuid"},xt.errToObj(e)))}cuid(e){return this._addCheck(re({kind:"cuid"},xt.errToObj(e)))}regex(e,t){return this._addCheck(re({kind:"regex",regex:e},xt.errToObj(t)))}min(e,t){return this._addCheck(re({kind:"min",value:e},xt.errToObj(t)))}max(e,t){return this._addCheck(re({kind:"max",value:e},xt.errToObj(t)))}length(e,t){return this.min(e,t).max(e,t)}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=-1/0;return this._def.checks.map(t=>{t.kind==="min"&&(e===null||t.value>e)&&(e=t.value)}),e}get maxLength(){let e=null;return this._def.checks.map(t=>{t.kind==="max"&&(e===null||t.value<e)&&(e=t.value)}),e}};o(Nn,"ZodString");Nn.create=r=>new Nn(re({checks:[],typeName:et.ZodString},st(r)));function zD(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,s=parseInt(r.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}o(zD,"floatSafeRemainder");var mi=class extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._getType(e)!==Me.number){let s=this._getOrReturnCtx(e);return Re(s,{code:Se.invalid_type,expected:Me.number,received:s.parsedType}),nt}let n,i=new sr;for(let s of this._def.checks)s.kind==="int"?kt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?zD(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Re(n,{code:Se.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):kt.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,xt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,xt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,xt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,xt.toString(t))}setLimit(e,t,n,i){return new mi(Te(re({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:xt.toString(i)}]}))}_addCheck(e){return new mi(Te(re({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:xt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:xt.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};o(mi,"ZodNumber");mi.create=r=>new mi(re({checks:[],typeName:et.ZodNumber},st(r)));var Ts=class extends ot{_parse(e){if(this._getType(e)!==Me.bigint){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.bigint,received:n.parsedType}),nt}return _r(e.data)}};o(Ts,"ZodBigInt");Ts.create=r=>new Ts(re({typeName:et.ZodBigInt},st(r)));var ks=class extends ot{_parse(e){if(this._getType(e)!==Me.boolean){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.boolean,received:n.parsedType}),nt}return _r(e.data)}};o(ks,"ZodBoolean");ks.create=r=>new ks(re({typeName:et.ZodBoolean},st(r)));var Cs=class extends ot{_parse(e){if(this._getType(e)!==Me.date){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.date,received:n.parsedType}),nt}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_date}),nt}return{status:"valid",value:new Date(e.data.getTime())}}};o(Cs,"ZodDate");Cs.create=r=>new Cs(re({typeName:et.ZodDate},st(r)));var Ds=class extends ot{_parse(e){if(this._getType(e)!==Me.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.undefined,received:n.parsedType}),nt}return _r(e.data)}};o(Ds,"ZodUndefined");Ds.create=r=>new Ds(re({typeName:et.ZodUndefined},st(r)));var Is=class extends ot{_parse(e){if(this._getType(e)!==Me.null){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.null,received:n.parsedType}),nt}return _r(e.data)}};o(Is,"ZodNull");Is.create=r=>new Is(re({typeName:et.ZodNull},st(r)));var Hi=class extends ot{constructor(){super(...arguments),this._any=!0}_parse(e){return _r(e.data)}};o(Hi,"ZodAny");Hi.create=r=>new Hi(re({typeName:et.ZodAny},st(r)));var Rn=class extends ot{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _r(e.data)}};o(Rn,"ZodUnknown");Rn.create=r=>new Rn(re({typeName:et.ZodUnknown},st(r)));var Ln=class extends ot{_parse(e){let t=this._getOrReturnCtx(e);return Re(t,{code:Se.invalid_type,expected:Me.never,received:t.parsedType}),nt}};o(Ln,"ZodNever");Ln.create=r=>new Ln(re({typeName:et.ZodNever},st(r)));var Os=class extends ot{_parse(e){if(this._getType(e)!==Me.undefined){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.void,received:n.parsedType}),nt}return _r(e.data)}};o(Os,"ZodVoid");Os.create=r=>new Os(re({typeName:et.ZodVoid},st(r)));var Kr=class extends ot{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==Me.array)return Re(t,{code:Se.invalid_type,expected:Me.array,received:t.parsedType}),nt;if(i.minLength!==null&&t.data.length<i.minLength.value&&(Re(t,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(Re(t,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all(t.data.map((a,f)=>i.type._parseAsync(new jr(t,a,t.path,f)))).then(a=>sr.mergeArray(n,a));let s=t.data.map((a,f)=>i.type._parseSync(new jr(t,a,t.path,f)));return sr.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new Kr(Te(re({},this._def),{minLength:{value:e,message:xt.toString(t)}}))}max(e,t){return new Kr(Te(re({},this._def),{maxLength:{value:e,message:xt.toString(t)}}))}length(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(Kr,"ZodArray");Kr.create=(r,e)=>new Kr(re({type:r,minLength:null,maxLength:null,typeName:et.ZodArray},st(e)));var sd;(function(r){r.mergeShapes=(e,t)=>re(re({},e),t)})(sd||(sd={}));var R4=o(r=>e=>new Et(Te(re({},r),{shape:()=>re(re({},r.shape()),e)})),"AugmentFactory");function Za(r){if(r instanceof Et){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Gr.create(Za(n))}return new Et(Te(re({},r._def),{shape:()=>e}))}else return r instanceof Kr?Kr.create(Za(r.element)):r instanceof Gr?Gr.create(Za(r.unwrap())):r instanceof vi?vi.create(Za(r.unwrap())):r instanceof Vr?Vr.create(r.items.map(e=>Za(e))):r}o(Za,"deepPartialify");var Et=class extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=R4(this._def),this.extend=R4(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=kt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Me.object){let p=this._getOrReturnCtx(e);return Re(p,{code:Se.invalid_type,expected:Me.object,received:p.parsedType}),nt}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),f=[];for(let p in i.data)a.includes(p)||f.push(p);let u=[];for(let p of a){let b=s[p],x=i.data[p];u.push({key:{status:"valid",value:p},value:b._parse(new jr(i,x,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof Ln){let p=this._def.unknownKeys;if(p==="passthrough")for(let b of f)u.push({key:{status:"valid",value:b},value:{status:"valid",value:i.data[b]}});else if(p==="strict")f.length>0&&(Re(i,{code:Se.unrecognized_keys,keys:f}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let b of f){let x=i.data[b];u.push({key:{status:"valid",value:b},value:p._parse(new jr(i,x,i.path,b)),alwaysSet:b in i.data})}}return i.common.async?Promise.resolve().then(()=>Z(this,null,function*(){let p=[];for(let b of u){let x=yield b.key;p.push({key:x,value:yield b.value,alwaysSet:b.alwaysSet})}return p})).then(p=>sr.mergeObjectSync(n,p)):sr.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return xt.errToObj,new Et(re(Te(re({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,s,a,f;let u=(a=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&a!==void 0?a:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=xt.errToObj(e).message)!==null&&f!==void 0?f:u}:{message:u}}}:{}))}strip(){return new Et(Te(re({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Et(Te(re({},this._def),{unknownKeys:"passthrough"}))}setKey(e,t){return this.augment({[e]:t})}merge(e){return new Et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>sd.mergeShapes(this._def.shape(),e._def.shape()),typeName:et.ZodObject})}catchall(e){return new Et(Te(re({},this._def),{catchall:e}))}pick(e){let t={};return kt.objectKeys(e).map(n=>{this.shape[n]&&(t[n]=this.shape[n])}),new Et(Te(re({},this._def),{shape:()=>t}))}omit(e){let t={};return kt.objectKeys(this.shape).map(n=>{kt.objectKeys(e).indexOf(n)===-1&&(t[n]=this.shape[n])}),new Et(Te(re({},this._def),{shape:()=>t}))}deepPartial(){return Za(this)}partial(e){let t={};if(e)return kt.objectKeys(this.shape).map(n=>{kt.objectKeys(e).indexOf(n)===-1?t[n]=this.shape[n]:t[n]=this.shape[n].optional()}),new Et(Te(re({},this._def),{shape:()=>t}));for(let n in this.shape){let i=this.shape[n];t[n]=i.optional()}return new Et(Te(re({},this._def),{shape:()=>t}))}required(){let e={};for(let t in this.shape){let i=this.shape[t];for(;i instanceof Gr;)i=i._def.innerType;e[t]=i}return new Et(Te(re({},this._def),{shape:()=>e}))}};o(Et,"ZodObject");Et.create=(r,e)=>new Et(re({shape:()=>r,unknownKeys:"strip",catchall:Ln.create(),typeName:et.ZodObject},st(e)));Et.strictCreate=(r,e)=>new Et(re({shape:()=>r,unknownKeys:"strict",catchall:Ln.create(),typeName:et.ZodObject},st(e)));Et.lazycreate=(r,e)=>new Et(re({shape:r,unknownKeys:"strip",catchall:Ln.create(),typeName:et.ZodObject},st(e)));var wo=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(s){for(let f of s)if(f.result.status==="valid")return f.result;for(let f of s)if(f.result.status==="dirty")return t.common.issues.push(...f.ctx.common.issues),f.result;let a=s.map(f=>new bn(f.ctx.common.issues));return Re(t,{code:Se.invalid_union,unionErrors:a}),nt}if(o(i,"handleResults"),t.common.async)return Promise.all(n.map(s=>Z(this,null,function*(){let a=Te(re({},t),{common:Te(re({},t.common),{issues:[]}),parent:null});return{result:yield s._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then(i);{let s,a=[];for(let u of n){let p=Te(re({},t),{common:Te(re({},t.common),{issues:[]}),parent:null}),b=u._parseSync({data:t.data,path:t.path,parent:p});if(b.status==="valid")return b;b.status==="dirty"&&!s&&(s={result:b,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let f=a.map(u=>new bn(u));return Re(t,{code:Se.invalid_union,unionErrors:f}),nt}}get options(){return this._def.options}};o(wo,"ZodUnion");wo.create=(r,e)=>new wo(re({options:r,typeName:et.ZodUnion},st(e)));var Ps=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.object)return Re(t,{code:Se.invalid_type,expected:Me.object,received:t.parsedType}),nt;let n=this.discriminator,i=t.data[n],s=this.options.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(Re(t,{code:Se.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[n]}),nt)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(e,t,n){let i=new Map;try{t.forEach(s=>{let a=s.shape[e].value;i.set(a,s)})}catch(s){throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(i.size!==t.length)throw new Error("Some of the discriminator values are not unique");return new Ps(re({typeName:et.ZodDiscriminatedUnion,discriminator:e,options:i},st(n)))}};o(Ps,"ZodDiscriminatedUnion");function hm(r,e){let t=xo(r),n=xo(e);if(r===e)return{valid:!0,data:r};if(t===Me.object&&n===Me.object){let i=kt.objectKeys(e),s=kt.objectKeys(r).filter(f=>i.indexOf(f)!==-1),a=re(re({},r),e);for(let f of s){let u=hm(r[f],e[f]);if(!u.valid)return{valid:!1};a[f]=u.data}return{valid:!0,data:a}}else if(t===Me.array&&n===Me.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<r.length;s++){let a=r[s],f=e[s],u=hm(a,f);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===Me.date&&n===Me.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}o(hm,"mergeValues");var _o=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=o((s,a)=>{if(um(s)||um(a))return nt;let f=hm(s.value,a.value);return f.valid?((lm(s)||lm(a))&&t.dirty(),{status:t.value,value:f.data}):(Re(n,{code:Se.invalid_intersection_types}),nt)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(_o,"ZodIntersection");_o.create=(r,e,t)=>new _o(re({left:r,right:e,typeName:et.ZodIntersection},st(t)));var Vr=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.array)return Re(n,{code:Se.invalid_type,expected:Me.array,received:n.parsedType}),nt;if(n.data.length<this._def.items.length)return Re(n,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),nt;!this._def.rest&&n.data.length>this._def.items.length&&(Re(n,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),t.dirty());let s=n.data.map((a,f)=>{let u=this._def.items[f]||this._def.rest;return u?u._parse(new jr(n,a,n.path,f)):null}).filter(a=>!!a);return n.common.async?Promise.all(s).then(a=>sr.mergeArray(t,a)):sr.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Vr(Te(re({},this._def),{rest:e}))}};o(Vr,"ZodTuple");Vr.create=(r,e)=>new Vr(re({items:r,typeName:et.ZodTuple,rest:null},st(e)));var Eo=class extends ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.object)return Re(n,{code:Se.invalid_type,expected:Me.object,received:n.parsedType}),nt;let i=[],s=this._def.keyType,a=this._def.valueType;for(let f in n.data)i.push({key:s._parse(new jr(n,f,n.path,f)),value:a._parse(new jr(n,n.data[f],n.path,f))});return n.common.async?sr.mergeObjectAsync(t,i):sr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ot?new Eo(re({keyType:e,valueType:t,typeName:et.ZodRecord},st(n))):new Eo(re({keyType:Nn.create(),valueType:e,typeName:et.ZodRecord},st(t)))}};o(Eo,"ZodRecord");var Ns=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.map)return Re(n,{code:Se.invalid_type,expected:Me.map,received:n.parsedType}),nt;let i=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([f,u],p)=>({key:i._parse(new jr(n,f,n.path,[p,"key"])),value:s._parse(new jr(n,u,n.path,[p,"value"]))}));if(n.common.async){let f=new Map;return Promise.resolve().then(()=>Z(this,null,function*(){for(let u of a){let p=yield u.key,b=yield u.value;if(p.status==="aborted"||b.status==="aborted")return nt;(p.status==="dirty"||b.status==="dirty")&&t.dirty(),f.set(p.value,b.value)}return{status:t.value,value:f}}))}else{let f=new Map;for(let u of a){let p=u.key,b=u.value;if(p.status==="aborted"||b.status==="aborted")return nt;(p.status==="dirty"||b.status==="dirty")&&t.dirty(),f.set(p.value,b.value)}return{status:t.value,value:f}}}};o(Ns,"ZodMap");Ns.create=(r,e,t)=>new Ns(re({valueType:e,keyType:r,typeName:et.ZodMap},st(t)));var bi=class extends ot{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Me.set)return Re(n,{code:Se.invalid_type,expected:Me.set,received:n.parsedType}),nt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Re(n,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Re(n,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,message:i.maxSize.message}),t.dirty());let s=this._def.valueType;function a(u){let p=new Set;for(let b of u){if(b.status==="aborted")return nt;b.status==="dirty"&&t.dirty(),p.add(b.value)}return{status:t.value,value:p}}o(a,"finalizeSet");let f=[...n.data.values()].map((u,p)=>s._parse(new jr(n,u,n.path,p)));return n.common.async?Promise.all(f).then(u=>a(u)):a(f)}min(e,t){return new bi(Te(re({},this._def),{minSize:{value:e,message:xt.toString(t)}}))}max(e,t){return new bi(Te(re({},this._def),{maxSize:{value:e,message:xt.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};o(bi,"ZodSet");bi.create=(r,e)=>new bi(re({valueType:r,minSize:null,maxSize:null,typeName:et.ZodSet},st(e)));var gi=class extends ot{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.function)return Re(t,{code:Se.invalid_type,expected:Me.function,received:t.parsedType}),nt;function n(f,u){return id({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wc,xc].filter(p=>!!p),issueData:{code:Se.invalid_arguments,argumentsError:u}})}o(n,"makeArgsIssue");function i(f,u){return id({data:f,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wc,xc].filter(p=>!!p),issueData:{code:Se.invalid_return_type,returnTypeError:u}})}o(i,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},a=t.data;return this._def.returns instanceof zi?_r((...f)=>Z(this,null,function*(){let u=new bn([]),p=yield this._def.args.parseAsync(f,s).catch(A=>{throw u.addIssue(n(f,A)),u}),b=yield a(...p);return yield this._def.returns._def.type.parseAsync(b,s).catch(A=>{throw u.addIssue(i(b,A)),u})})):_r((...f)=>{let u=this._def.args.safeParse(f,s);if(!u.success)throw new bn([n(f,u.error)]);let p=a(...u.data),b=this._def.returns.safeParse(p,s);if(!b.success)throw new bn([i(p,b.error)]);return b.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new gi(Te(re({},this._def),{args:Vr.create(e).rest(Rn.create())}))}returns(e){return new gi(Te(re({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}};o(gi,"ZodFunction");gi.create=(r,e,t)=>new gi(re({args:r?r.rest(Rn.create()):Vr.create([]).rest(Rn.create()),returns:e||Rn.create(),typeName:et.ZodFunction},st(t)));var Rs=class extends ot{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};o(Rs,"ZodLazy");Rs.create=(r,e)=>new Rs(re({getter:r,typeName:et.ZodLazy},st(e)));var Ls=class extends ot{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Re(t,{code:Se.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:e.data}}get value(){return this._def.value}};o(Ls,"ZodLiteral");Ls.create=(r,e)=>new Ls(re({value:r,typeName:et.ZodLiteral},st(e)));function jD(r,e){return new Bs(re({values:r,typeName:et.ZodEnum},st(e)))}o(jD,"createZodEnum");var Bs=class extends ot{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return Re(t,{expected:kt.joinValues(n),received:t.parsedType,code:Se.invalid_type}),nt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),n=this._def.values;return Re(t,{received:t.data,code:Se.invalid_enum_value,options:n}),nt}return _r(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}};o(Bs,"ZodEnum");Bs.create=jD;var Us=class extends ot{_parse(e){let t=kt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Me.string&&n.parsedType!==Me.number){let i=kt.objectValues(t);return Re(n,{expected:kt.joinValues(i),received:n.parsedType,code:Se.invalid_type}),nt}if(t.indexOf(e.data)===-1){let i=kt.objectValues(t);return Re(n,{received:n.data,code:Se.invalid_enum_value,options:i}),nt}return _r(e.data)}get enum(){return this._def.values}};o(Us,"ZodNativeEnum");Us.create=(r,e)=>new Us(re({values:r,typeName:et.ZodNativeEnum},st(e)));var zi=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Me.promise&&t.common.async===!1)return Re(t,{code:Se.invalid_type,expected:Me.promise,received:t.parsedType}),nt;let n=t.parsedType===Me.promise?t.data:Promise.resolve(t.data);return _r(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};o(zi,"ZodPromise");zi.create=(r,e)=>new zi(re({type:r,typeName:et.ZodPromise},st(e)));var Wr=class extends ot{innerType(){return this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null;if(i.type==="preprocess"){let a=i.transform(n.data);return n.common.async?Promise.resolve(a).then(f=>this._def.schema._parseAsync({data:f,path:n.path,parent:n})):this._def.schema._parseSync({data:a,path:n.path,parent:n})}let s={addIssue:a=>{Re(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="refinement"){let a=o(f=>{let u=i.refinement(f,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f},"executeRefinement");if(n.common.async===!1){let f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return f.status==="aborted"?nt:(f.status==="dirty"&&t.dirty(),a(f.value),{status:t.value,value:f.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>f.status==="aborted"?nt:(f.status==="dirty"&&t.dirty(),a(f.value).then(()=>({status:t.value,value:f.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!od(a))return a;let f=i.transform(a.value,s);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:f}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>od(a)?Promise.resolve(i.transform(a.value,s)).then(f=>({status:t.value,value:f})):a);kt.assertNever(i)}};o(Wr,"ZodEffects");Wr.create=(r,e,t)=>new Wr(re({schema:r,typeName:et.ZodEffects,effect:e},st(t)));Wr.createWithPreprocess=(r,e,t)=>new Wr(re({schema:e,effect:{type:"preprocess",transform:r},typeName:et.ZodEffects},st(t)));var Gr=class extends ot{_parse(e){return this._getType(e)===Me.undefined?_r(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(Gr,"ZodOptional");Gr.create=(r,e)=>new Gr(re({innerType:r,typeName:et.ZodOptional},st(e)));var vi=class extends ot{_parse(e){return this._getType(e)===Me.null?_r(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};o(vi,"ZodNullable");vi.create=(r,e)=>new vi(re({innerType:r,typeName:et.ZodNullable},st(e)));var Qa=class extends ot{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Me.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};o(Qa,"ZodDefault");Qa.create=(r,e)=>new Gr(re({innerType:r,typeName:et.ZodOptional},st(e)));var Fs=class extends ot{_parse(e){if(this._getType(e)!==Me.nan){let n=this._getOrReturnCtx(e);return Re(n,{code:Se.invalid_type,expected:Me.nan,received:n.parsedType}),nt}return{status:"valid",value:e.data}}};o(Fs,"ZodNaN");Fs.create=r=>new Fs(re({typeName:et.ZodNaN},st(r)));var B4=o((r,e={},t)=>r?Hi.create().superRefine((n,i)=>{if(!r(n)){let s=typeof e=="function"?e(n):e,a=typeof s=="string"?{message:s}:s;i.addIssue(Te(re({code:"custom"},a),{fatal:t}))}}):Hi.create(),"custom"),KD={object:Et.lazycreate},et;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodPromise="ZodPromise"})(et||(et={}));var VD=o((r,e={message:`Input not instance of ${r.name}`})=>B4(t=>t instanceof r,e,!0),"instanceOfType"),U4=Nn.create,F4=mi.create,WD=Fs.create,GD=Ts.create,$4=ks.create,YD=Cs.create,JD=Ds.create,XD=Is.create,ZD=Hi.create,QD=Rn.create,eI=Ln.create,tI=Os.create,rI=Kr.create,nI=Et.create,iI=Et.strictCreate,oI=wo.create,sI=Ps.create,aI=_o.create,fI=Vr.create,cI=Eo.create,uI=Ns.create,lI=bi.create,dI=gi.create,hI=Rs.create,pI=Ls.create,mI=Bs.create,bI=Us.create,gI=zi.create,L4=Wr.create,vI=Gr.create,yI=vi.create,xI=Wr.createWithPreprocess,wI=o(()=>U4().optional(),"ostring"),_I=o(()=>F4().optional(),"onumber"),EI=o(()=>$4().optional(),"oboolean"),oe=Object.freeze({__proto__:null,getParsedType:xo,ZodParsedType:Me,makeIssue:id,EMPTY_PATH:UD,addIssueToContext:Re,ParseStatus:sr,INVALID:nt,DIRTY:FD,OK:_r,isAborted:um,isDirty:lm,isValid:od,isAsync:dm,ZodType:ot,ZodString:Nn,ZodNumber:mi,ZodBigInt:Ts,ZodBoolean:ks,ZodDate:Cs,ZodUndefined:Ds,ZodNull:Is,ZodAny:Hi,ZodUnknown:Rn,ZodNever:Ln,ZodVoid:Os,ZodArray:Kr,get objectUtil(){return sd},ZodObject:Et,ZodUnion:wo,ZodDiscriminatedUnion:Ps,ZodIntersection:_o,ZodTuple:Vr,ZodRecord:Eo,ZodMap:Ns,ZodSet:bi,ZodFunction:gi,ZodLazy:Rs,ZodLiteral:Ls,ZodEnum:Bs,ZodNativeEnum:Us,ZodPromise:zi,ZodEffects:Wr,ZodTransformer:Wr,ZodOptional:Gr,ZodNullable:vi,ZodDefault:Qa,ZodNaN:Fs,custom:B4,Schema:ot,ZodSchema:ot,late:KD,get ZodFirstPartyTypeKind(){return et},any:ZD,array:rI,bigint:GD,boolean:$4,date:YD,discriminatedUnion:sI,effect:L4,enum:mI,function:dI,instanceof:VD,intersection:aI,lazy:hI,literal:pI,map:uI,nan:WD,nativeEnum:bI,never:eI,null:XD,nullable:yI,number:F4,object:nI,oboolean:EI,onumber:_I,optional:vI,ostring:wI,preprocess:xI,promise:gI,record:cI,set:lI,strictObject:iI,string:U4,transformer:L4,tuple:fI,undefined:JD,union:oI,unknown:QD,void:tI,ZodIssueCode:Se,quotelessJson:LD,ZodError:bn,defaultErrorMap:xc,get overrideErrorMap(){return wc},setErrorMap:BD});var z4=oe.string().array(),ZV=oe.object({type:oe.string().optional(),narrative:oe.string().optional()}),mm=oe.string().or(oe.object({id:oe.string(),type:oe.string(),caption:oe.string().optional()})),SI=oe.object({type:oe.string().array().nonempty(),latitude:oe.number(),longitude:oe.number()}),MI=oe.object({type:oe.string().array().nonempty(),addressCountry:oe.string().optional(),addressCountryCode:oe.string().optional(),addressRegion:oe.string().optional(),addressLocality:oe.string().optional(),streetAddress:oe.string().optional(),postOfficeBoxNumber:oe.string().optional(),postalCode:oe.string().optional(),geo:SI.optional()}),AI=oe.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(oe.string()),j4=oe.object({type:oe.string().array().nonempty(),identifier:oe.string(),identifierType:AI}),_c=oe.string().or(oe.object({id:oe.string().optional(),type:oe.string().array().nonempty().optional(),name:oe.string().optional(),url:oe.string().optional(),phone:oe.string().optional(),description:oe.string().optional(),endorsement:oe.any().array().optional(),image:mm.optional(),email:oe.string().email().optional(),address:MI.optional(),otherIdentifier:j4.array().optional(),official:oe.string().optional(),parentOrg:oe.any().optional(),familyName:oe.string().optional(),givenName:oe.string().optional(),additionalName:oe.string().optional(),patronymicName:oe.string().optional(),honorificPrefix:oe.string().optional(),honorificSuffix:oe.string().optional(),familyNamePrefix:oe.string().optional(),dateOfBirth:oe.string().optional()}).catchall(oe.any())),pm=oe.object({id:oe.string().optional()}).catchall(oe.any()),TI=oe.object({type:oe.string(),id:oe.string()}),kI=oe.object({id:oe.string(),type:oe.string()}),CI=oe.object({id:oe.string(),type:oe.string()}).catchall(oe.any()),ad=oe.object({"@context":z4,id:oe.string().optional(),type:oe.string().array().nonempty(),issuer:_c,issuanceDate:oe.string(),expirationDate:oe.string().optional(),credentialSubject:pm.or(pm.array()),credentialStatus:TI.optional(),credentialSchema:kI.array().optional(),refreshService:CI.optional()}).catchall(oe.any()),So=oe.object({type:oe.string(),created:oe.string(),challenge:oe.string().optional(),domain:oe.string().optional(),nonce:oe.string().optional(),proofPurpose:oe.string(),verificationMethod:oe.string(),jws:oe.string().optional()}).catchall(oe.any()),q4=ad.extend({proof:So.or(So.array())}),DI=oe.object({"@context":z4,id:oe.string().optional(),type:oe.string().array().nonempty(),verifiableCredential:q4.or(q4.array()),holder:oe.string().optional()}).catchall(oe.any()),QV=DI.extend({proof:So.or(So.array())}),II=oe.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(oe.string()),fd=oe.object({type:oe.string().array().nonempty(),targetCode:oe.string().optional(),targetDescription:oe.string().optional(),targetName:oe.string(),targetFramework:oe.string().optional(),targetType:II.optional(),targetUrl:oe.string()}),OI=oe.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]).or(oe.string()),PI=oe.object({id:oe.string().optional(),narrative:oe.string().optional()}).catchall(oe.any()),NI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),endorsementComment:oe.string().optional()}),RI=ad.extend({credentialSubject:NI,proof:So.or(So.array()).optional()}),LI=oe.object({id:oe.string(),"@language":oe.string().optional(),version:oe.string().optional()}),BI=oe.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(oe.string()),UI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:fd.array().optional(),description:oe.string().optional(),level:oe.string().optional(),name:oe.string(),points:oe.string().optional()}).catchall(oe.any()),FI=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:fd.array().optional(),allowedValue:oe.string().array().optional(),name:oe.string(),requiredLevel:oe.string().optional(),requiredValue:oe.string().optional(),resultType:BI,rubricCriterionLevel:UI.array().optional(),valueMax:oe.string().optional(),valueMin:oe.string().optional()}).catchall(oe.any()),$I=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),alignment:fd.array().optional(),achievementType:OI.optional(),creator:_c.optional(),creditsAvailable:oe.number().optional(),criteria:PI,description:oe.string(),endorsement:RI.array().optional(),fieldOfStudy:oe.string().optional(),humanCode:oe.string().optional(),image:mm.optional(),"@language":oe.string().optional(),name:oe.string(),otherIdentifier:j4.array().optional(),related:LI.array().optional(),resultDescription:FI.array().optional(),specialization:oe.string().optional(),tag:oe.string().array().optional(),version:oe.string().optional()}).catchall(oe.any()),qI=oe.object({type:oe.string(),hashed:oe.boolean(),identityHash:oe.string(),identityType:oe.string(),salt:oe.string().optional()}),HI=oe.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),zI=oe.object({type:oe.string().array().nonempty(),achievedLevel:oe.string().optional(),alignment:fd.array().optional(),resultDescription:oe.string().optional(),status:HI.optional(),value:oe.string().optional()}).catchall(oe.any()),H4=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),activityEndDate:oe.string().optional(),activityStartDate:oe.string().optional(),creditsEarned:oe.number().optional(),achievement:$I.optional(),identifier:qI.optional(),image:mm.optional(),licenseNumber:oe.string().optional(),narrative:oe.string().optional(),result:zI.array().optional(),role:oe.string().optional(),source:_c.optional(),term:oe.string().optional()}).catchall(oe.any()),jI=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),narrative:oe.string().optional(),name:oe.string().optional(),description:oe.string().optional(),genre:oe.string().optional(),audience:oe.string().optional()}).catchall(oe.any()),KI=ad.extend({name:oe.string().optional(),description:oe.string().optional(),image:oe.string().optional(),credentialSubject:H4.or(H4.array()),endorsement:ad.array().optional(),evidence:jI.array().optional()}),tW=KI.extend({proof:So.or(So.array())}),nW=oe.object({checks:oe.string().array(),warnings:oe.string().array(),errors:oe.string().array()}),K4=oe.enum(["Success","Failed","Error"]),cd=K4.enum,iW=oe.object({check:oe.string(),status:K4,message:oe.string().optional(),details:oe.string().optional()}),oW=oe.object({title:oe.string().optional(),createdAt:oe.string().optional(),issuer:_c.optional(),issuee:_c.optional(),credentialSubject:pm.optional()});function Ht(r){if(r===null||r===!0||r===!1)return NaN;var e=Number(r);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}o(Ht,"toInteger");function pt(r,e){if(e.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+e.length+" present")}o(pt,"requiredArgs");function Ft(r){pt(1,arguments);var e=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&e==="[object Date]"?new Date(r.getTime()):typeof r=="number"||e==="[object Number]"?new Date(r):((typeof r=="string"||e==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}o(Ft,"toDate");function bm(r,e){pt(2,arguments);var t=Ft(r).getTime(),n=Ht(e);return new Date(t+n)}o(bm,"addMilliseconds");function gm(r){var e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),r.getTime()-e.getTime()}o(gm,"getTimezoneOffsetInMilliseconds");function vm(r){return pt(1,arguments),r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}o(vm,"isDate");function ym(r){if(pt(1,arguments),!vm(r)&&typeof r!="number")return!1;var e=Ft(r);return!isNaN(Number(e))}o(ym,"isValid");var VI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},WI=o(function(r,e,t){var n,i=VI[r];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n},"formatDistance"),V4=WI;function Ec(r){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):r.defaultWidth,n=r.formats[t]||r.formats[r.defaultWidth];return n}}o(Ec,"buildFormatLongFn");var GI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},YI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},JI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},XI={date:Ec({formats:GI,defaultWidth:"full"}),time:Ec({formats:YI,defaultWidth:"full"}),dateTime:Ec({formats:JI,defaultWidth:"full"})},W4=XI;var ZI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},QI=o(function(r,e,t,n){return ZI[r]},"formatRelative"),G4=QI;function $s(r){return function(e,t){var n=t||{},i=n.context?String(n.context):"standalone",s;if(i==="formatting"&&r.formattingValues){var a=r.defaultFormattingWidth||r.defaultWidth,f=n.width?String(n.width):a;s=r.formattingValues[f]||r.formattingValues[a]}else{var u=r.defaultWidth,p=n.width?String(n.width):r.defaultWidth;s=r.values[p]||r.values[u]}var b=r.argumentCallback?r.argumentCallback(e):e;return s[b]}}o($s,"buildLocalizeFn");var eO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rO={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nO={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},iO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},oO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sO=o(function(r,e){var t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},"ordinalNumber"),aO={ordinalNumber:sO,era:$s({values:eO,defaultWidth:"wide"}),quarter:$s({values:tO,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:$s({values:rO,defaultWidth:"wide"}),day:$s({values:nO,defaultWidth:"wide"}),dayPeriod:$s({values:iO,defaultWidth:"wide",formattingValues:oO,defaultFormattingWidth:"wide"})},Y4=aO;function qs(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=e.match(i);if(!s)return null;var a=s[0],f=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],u=Array.isArray(f)?cO(f,function(x){return x.test(a)}):fO(f,function(x){return x.test(a)}),p;p=r.valueCallback?r.valueCallback(u):u,p=t.valueCallback?t.valueCallback(p):p;var b=e.slice(a.length);return{value:p,rest:b}}}o(qs,"buildMatchFn");function fO(r,e){for(var t in r)if(r.hasOwnProperty(t)&&e(r[t]))return t}o(fO,"findKey");function cO(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return t}o(cO,"findIndex");function xm(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.match(r.matchPattern);if(!n)return null;var i=n[0],s=e.match(r.parsePattern);if(!s)return null;var a=r.valueCallback?r.valueCallback(s[0]):s[0];a=t.valueCallback?t.valueCallback(a):a;var f=e.slice(i.length);return{value:a,rest:f}}}o(xm,"buildMatchPatternFn");var uO=/^(\d+)(th|st|nd|rd)?/i,lO=/\d+/i,dO={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hO={any:[/^b/i,/^(a|c)/i]},pO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mO={any:[/1/i,/2/i,/3/i,/4/i]},bO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},vO={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},yO={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},xO={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wO={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_O={ordinalNumber:xm({matchPattern:uO,parsePattern:lO,valueCallback:function(r){return parseInt(r,10)}}),era:qs({matchPatterns:dO,defaultMatchWidth:"wide",parsePatterns:hO,defaultParseWidth:"any"}),quarter:qs({matchPatterns:pO,defaultMatchWidth:"wide",parsePatterns:mO,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:qs({matchPatterns:bO,defaultMatchWidth:"wide",parsePatterns:gO,defaultParseWidth:"any"}),day:qs({matchPatterns:vO,defaultMatchWidth:"wide",parsePatterns:yO,defaultParseWidth:"any"}),dayPeriod:qs({matchPatterns:xO,defaultMatchWidth:"any",parsePatterns:wO,defaultParseWidth:"any"})},J4=_O;var EO={code:"en-US",formatDistance:V4,formatLong:W4,formatRelative:G4,localize:Y4,match:J4,options:{weekStartsOn:0,firstWeekContainsDate:1}},X4=EO;function wm(r,e){pt(2,arguments);var t=Ht(e);return bm(r,-t)}o(wm,"subMilliseconds");var SO=864e5;function _m(r){pt(1,arguments);var e=Ft(r),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),i=t-n;return Math.floor(i/SO)+1}o(_m,"getUTCDayOfYear");function Mo(r){pt(1,arguments);var e=1,t=Ft(r),n=t.getUTCDay(),i=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}o(Mo,"startOfUTCISOWeek");function Sc(r){pt(1,arguments);var e=Ft(r),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var i=Mo(n),s=new Date(0);s.setUTCFullYear(t,0,4),s.setUTCHours(0,0,0,0);var a=Mo(s);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}o(Sc,"getUTCISOWeekYear");function Em(r){pt(1,arguments);var e=Sc(r),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=Mo(t);return n}o(Em,"startOfUTCISOWeekYear");var MO=6048e5;function Sm(r){pt(1,arguments);var e=Ft(r),t=Mo(e).getTime()-Em(e).getTime();return Math.round(t/MO)+1}o(Sm,"getUTCISOWeek");function Ao(r,e){pt(1,arguments);var t=e||{},n=t.locale,i=n&&n.options&&n.options.weekStartsOn,s=i==null?0:Ht(i),a=t.weekStartsOn==null?s:Ht(t.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Ft(r),u=f.getUTCDay(),p=(u<a?7:0)+u-a;return f.setUTCDate(f.getUTCDate()-p),f.setUTCHours(0,0,0,0),f}o(Ao,"startOfUTCWeek");function Mc(r,e){pt(1,arguments);var t=Ft(r),n=t.getUTCFullYear(),i=e||{},s=i.locale,a=s&&s.options&&s.options.firstWeekContainsDate,f=a==null?1:Ht(a),u=i.firstWeekContainsDate==null?f:Ht(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(n+1,0,u),p.setUTCHours(0,0,0,0);var b=Ao(p,e),x=new Date(0);x.setUTCFullYear(n,0,u),x.setUTCHours(0,0,0,0);var A=Ao(x,e);return t.getTime()>=b.getTime()?n+1:t.getTime()>=A.getTime()?n:n-1}o(Mc,"getUTCWeekYear");function Mm(r,e){pt(1,arguments);var t=e||{},n=t.locale,i=n&&n.options&&n.options.firstWeekContainsDate,s=i==null?1:Ht(i),a=t.firstWeekContainsDate==null?s:Ht(t.firstWeekContainsDate),f=Mc(r,e),u=new Date(0);u.setUTCFullYear(f,0,a),u.setUTCHours(0,0,0,0);var p=Ao(u,e);return p}o(Mm,"startOfUTCWeekYear");var AO=6048e5;function Am(r,e){pt(1,arguments);var t=Ft(r),n=Ao(t,e).getTime()-Mm(t,e).getTime();return Math.round(n/AO)+1}o(Am,"getUTCWeek");function ut(r,e){for(var t=r<0?"-":"",n=Math.abs(r).toString();n.length<e;)n="0"+n;return t+n}o(ut,"addLeadingZeros");var TO={y:function(r,e){var t=r.getUTCFullYear(),n=t>0?t:1-t;return ut(e==="yy"?n%100:n,e.length)},M:function(r,e){var t=r.getUTCMonth();return e==="M"?String(t+1):ut(t+1,2)},d:function(r,e){return ut(r.getUTCDate(),e.length)},a:function(r,e){var t=r.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h:function(r,e){return ut(r.getUTCHours()%12||12,e.length)},H:function(r,e){return ut(r.getUTCHours(),e.length)},m:function(r,e){return ut(r.getUTCMinutes(),e.length)},s:function(r,e){return ut(r.getUTCSeconds(),e.length)},S:function(r,e){var t=e.length,n=r.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,t-3));return ut(i,e.length)}},ji=TO;var ef={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},kO={G:function(r,e,t){var n=r.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){var n=r.getUTCFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return ji.y(r,e)},Y:function(r,e,t,n){var i=Mc(r,n),s=i>0?i:1-i;if(e==="YY"){var a=s%100;return ut(a,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):ut(s,e.length)},R:function(r,e){var t=Sc(r);return ut(t,e.length)},u:function(r,e){var t=r.getUTCFullYear();return ut(t,e.length)},Q:function(r,e,t){var n=Math.ceil((r.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return ut(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){var n=Math.ceil((r.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return ut(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){var n=r.getUTCMonth();switch(e){case"M":case"MM":return ji.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){var n=r.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return ut(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){var i=Am(r,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):ut(i,e.length)},I:function(r,e,t){var n=Sm(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):ut(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getUTCDate(),{unit:"date"}):ji.d(r,e)},D:function(r,e,t){var n=_m(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):ut(n,e.length)},E:function(r,e,t){var n=r.getUTCDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){var i=r.getUTCDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return ut(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){var i=r.getUTCDay(),s=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return ut(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(r,e,t){var n=r.getUTCDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return ut(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){var n=r.getUTCHours(),i=n/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,e,t){var n=r.getUTCHours(),i;switch(n===12?i=ef.noon:n===0?i=ef.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,e,t){var n=r.getUTCHours(),i;switch(n>=17?i=ef.evening:n>=12?i=ef.afternoon:n>=4?i=ef.morning:i=ef.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){var n=r.getUTCHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return ji.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getUTCHours(),{unit:"hour"}):ji.H(r,e)},K:function(r,e,t){var n=r.getUTCHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):ut(n,e.length)},k:function(r,e,t){var n=r.getUTCHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):ut(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):ji.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):ji.s(r,e)},S:function(r,e){return ji.S(r,e)},X:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Q4(s);case"XXXX":case"XX":return Hs(s);case"XXXXX":case"XXX":default:return Hs(s,":")}},x:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"x":return Q4(s);case"xxxx":case"xx":return Hs(s);case"xxxxx":case"xxx":default:return Hs(s,":")}},O:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Z4(s,":");case"OOOO":default:return"GMT"+Hs(s,":")}},z:function(r,e,t,n){var i=n._originalDate||r,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Z4(s,":");case"zzzz":default:return"GMT"+Hs(s,":")}},t:function(r,e,t,n){var i=n._originalDate||r,s=Math.floor(i.getTime()/1e3);return ut(s,e.length)},T:function(r,e,t,n){var i=n._originalDate||r,s=i.getTime();return ut(s,e.length)}};function Z4(r,e){var t=r>0?"-":"+",n=Math.abs(r),i=Math.floor(n/60),s=n%60;if(s===0)return t+String(i);var a=e||"";return t+String(i)+a+ut(s,2)}o(Z4,"formatTimezoneShort");function Q4(r,e){if(r%60===0){var t=r>0?"-":"+";return t+ut(Math.abs(r)/60,2)}return Hs(r,e)}o(Q4,"formatTimezoneWithOptionalMinutes");function Hs(r,e){var t=e||"",n=r>0?"-":"+",i=Math.abs(r),s=ut(Math.floor(i/60),2),a=ut(i%60,2);return n+s+t+a}o(Hs,"formatTimezone");var e5=kO;function t5(r,e){switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}o(t5,"dateLongFormatter");function r5(r,e){switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}o(r5,"timeLongFormatter");function CO(r,e){var t=r.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return t5(r,e);var s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",t5(n,e)).replace("{{time}}",r5(i,e))}o(CO,"dateTimeLongFormatter");var DO={p:r5,P:CO},n5=DO;var IO=["D","DD"],OO=["YY","YYYY"];function i5(r){return IO.indexOf(r)!==-1}o(i5,"isProtectedDayOfYearToken");function o5(r){return OO.indexOf(r)!==-1}o(o5,"isProtectedWeekYearToken");function Tm(r,e,t){if(r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"));if(r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"))}o(Tm,"throwProtectedError");var PO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,NO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RO=/^'([^]*?)'?$/,LO=/''/g,BO=/[a-zA-Z]/;function Ac(r,e,t){pt(2,arguments);var n=String(e),i=t||{},s=i.locale||X4,a=s.options&&s.options.firstWeekContainsDate,f=a==null?1:Ht(a),u=i.firstWeekContainsDate==null?f:Ht(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=s.options&&s.options.weekStartsOn,b=p==null?0:Ht(p),x=i.weekStartsOn==null?b:Ht(i.weekStartsOn);if(!(x>=0&&x<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!s.localize)throw new RangeError("locale must contain localize property");if(!s.formatLong)throw new RangeError("locale must contain formatLong property");var A=Ft(r);if(!ym(A))throw new RangeError("Invalid time value");var O=gm(A),T=wm(A,O),k={firstWeekContainsDate:u,weekStartsOn:x,locale:s,_originalDate:A},$=n.match(NO).map(function(C){var B=C[0];if(B==="p"||B==="P"){var z=n5[B];return z(C,s.formatLong,k)}return C}).join("").match(PO).map(function(C){if(C==="''")return"'";var B=C[0];if(B==="'")return UO(C);var z=e5[B];if(z)return!i.useAdditionalWeekYearTokens&&o5(C)&&Tm(C,e,r),!i.useAdditionalDayOfYearTokens&&i5(C)&&Tm(C,e,r),z(T,C,s.localize,k);if(B.match(BO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+B+"`");return C}).join("");return $}o(Ac,"format");function UO(r){return r.match(RO)[1].replace(LO,"'")}o(UO,"cleanEscapedString");var FO=o((r,e)=>r.split(" error")[0]||r,"transformErrorCheck"),$O=o((r,e)=>r.startsWith("expiration")?e.expirationDate?`Invalid \u2022 Expired ${Ac(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Invalid \u2022 Expired":r,"transformErrorMessage"),qO=o((r,e)=>({proof:"Valid",expiration:e.expirationDate?`Valid \u2022 Expires ${Ac(new Date(e.expirationDate),"dd MMM yyyy").toUpperCase()}`:"Valid \u2022 Does Not Expire"})[r]||r,"transformCheckMessage"),km=o(r=>e=>Z(void 0,null,function*(){let t=yield r.pluginMethods.verifyCredential(e),n=[];return t.errors.forEach(i=>{n.push({status:cd.Failed,check:FO(i,e),details:$O(i,e)})}),t.warnings.forEach(i=>{n.push({status:cd.Error,check:"hmm",message:i})}),t.checks.forEach(i=>{n.push({status:cd.Success,check:i,message:qO(i,e)})}),n}),"verifyCredential");var s5={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials",ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"},a5={address:"",infuraProjectId:"",network:"mainnet"};var HO=o((...e)=>Z(void 0,[...e],function*({didkit:r}={}){let t=yield(yield js()).addPlugin(yield am(r)),n=yield t.addPlugin(fm(t));return{_wallet:n,verifyCredential:km(n),verifyPresentation:n.pluginMethods.verifyPresentation}}),"emptyWallet"),zO=o((s,...a)=>Z(void 0,[s,...a],function*(r,{ceramicIdx:e=s5,didkit:t,defaultContents:n=[],ethereumConfig:i=a5}={}){let f=yield(yield js(n)).addPlugin(yield am(t)),u=yield f.addPlugin(yield A4(f,r)),p=yield u.addPlugin(yield cm(u)),b=yield p.addPlugin(yield ed(p,e)),x=yield b.addPlugin(fm(b)),A=yield x.addPlugin(P4(x,i));return{_wallet:A,did:(O="key")=>A.pluginMethods.getSubjectDid(O),keypair:(O="ed25519")=>A.pluginMethods.getSubjectKeypair(O),issueCredential:A.pluginMethods.issueCredential,verifyCredential:km(A),issuePresentation:A.pluginMethods.issuePresentation,verifyPresentation:A.pluginMethods.verifyPresentation,getCredential:A.pluginMethods.getVerifiableCredentialFromIdx,getCredentials:A.pluginMethods.getVerifiableCredentialsFromIdx,getCredentialsList:()=>Z(void 0,null,function*(){return(yield A.pluginMethods.getCredentialsListFromIdx()).credentials}),publishCredential:A.pluginMethods.publishContentToCeramic,addCredential:O=>Z(void 0,null,function*(){yield A.pluginMethods.addVerifiableCredentialInIdx(O)}),removeCredential:O=>Z(void 0,null,function*(){yield A.pluginMethods.removeVerifiableCredentialInIdx(O)}),readFromCeramic:A.pluginMethods.readContentFromCeramic,getTestVc:A.pluginMethods.getTestVc,getTestVp:A.pluginMethods.getTestVp,checkMyEth:A.pluginMethods.checkMyEth,checkMyDai:A.pluginMethods.checkMyDai,checkMyUsdc:A.pluginMethods.checkMyUsdc}}),"walletFromKey");
793
793
  /*!
794
794
  * https://github.com/Starcounter-Jack/JSON-Patch
795
795
  * (c) 2017-2021 Joachim Wester